sparse and DRM on non-x86
keith at tungstengraphics.com
Fri Oct 1 10:05:29 PDT 2004
Jon Smirl wrote:
> I just spent sometime looking at about a thousand errors from sparse
> in the DRM code.
> There are two main problems, first DRM makes use of opaque handles
> which are passed to user space. These handles can be to normal or
> iomem memory. Since the handles are typeless this generates a lot of
> sparse errors. Other data associated with the handle can be use to
> tell if it is normal or iomem.
> Second the DRM code always treats the framebuffer as if it is in
> IOMEM. But what about IGP type devices where the framebuffer is in
> main memory? These only exist on the x86 so treating their framebuffer
> as IOMEM works since there is no difference between IOMEM and normal
> memory access on an x86.
The framebuffer lives in agp memory on those devices, presumably this is iomem
as it appears to be memory of the agp device.
> Is there an example of a IGP type device on an architecture where
> normal and IOMEM need different access functions? I suspect DRI/DRM
> would break on the device.
The trouble is that until one materializes, we don't really know how it will work.
Until such a device comes along, I'd rather not waste time worrying about it.
> This implies that DRM should be passing back two distinct handle
> types, one for normal and one for IOMEM, so that the user space app
> will use the correct access function. This is also a pretty good
> argument for hiding direct framebuffer access and forcing access with
> read/write calls on a handle like the IA64 people want to do.
When you say "read" and "write" and "handle", do you mean read(2)/write(2) and
filehandle? Or some sort of #defined read/write macros? or something else?
More information about the xorg