On Thu, Apr 07, 2016 at 08:20:15PM +0200, Mark Kettenis wrote: > On OpenBSD I implemented idr_alloc() to return random IDs. While the > xf86-video-modesetting driver is perfectly happy with this, the > xf86-video-intel driver doesn't like it very much. I quickly figured > out that that driver truncates the identifiers to 8-bits when it > stores the values in its sna_crtc data structure. But the modeset > identifiers are clearly 32-bit in the drm API, and the idr_alloc() > call that allocates them doesn't limit their values in any way. So > I'd say this is a bug in the xf86-video-intel driver. Or do people > consider it reasonable for the driver to expect the values to be > smaller than 256? Then the drm kernel code should probably specify an > upper limit in the idr_alloc call. > > Fixing the xf86-video-intel driver isn't completely trivial. But of > people do agree this is something that should be fixed, I'll give it a > go. Neither does it limit the kernel ABI since it is using inside knowledge of how linux works, nor is it difficult to change if you really want to use randomised numbers and a hash lookup in the kernel. -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx