On Fri, Feb 22, 2019 at 10:11:14AM +0100, Daniel Vetter wrote: > On Thu, Feb 21, 2019 at 10:41:21AM -0800, Matthew Wilcox wrote: > > Divide all the indices by 64 to save memory. > > > > Signed-off-by: Matthew Wilcox <wi...@infradead.org> > > Pretty sure this goes boom. Our char device minor allocation scheme is > > device 0: card0=0, renderD0=64 > device 1: card1=1, renderD1=65 > ... > > I think your scheme aliases all devices with the first one. > > And yes the minor(cardX) + 64 == minor(renderDX) is uapi :-) > > If you want to save space we'd need to move the minor allocation from > drm_minor to drm_device (with a very strange allocation scheme of blocks > of 64 entries, every 128 entries). That would also solve the issue with > the current scheme potentially racing if you load multiple drivers at the > same time (except for drm_global_mutex, but that's more an accident than > intention). Not sure if worth the bother. > > Or maybe coffee hasn't kicked in yet over here and I'm missing something?
I'm the one who needed moar coffee. I misread: > > - r = idr_alloc(&drm_minors_idr, > > - NULL, > > - 64 * type, > > - 64 * (type + 1), > > - GFP_NOWAIT); As (64 * type) + 1. So I'll redo this patch. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel