[PATCH v2] drm: Compare only lower 32 bits of framebuffer map offsets

Tormod Volden lists.tormod at gmail.com
Tue May 31 15:04:40 PDT 2011


On Mon, May 30, 2011 at 9:45 PM, Tormod Volden wrote:
> (*) It actually checks if _DRM_CONTAINS_LOCK is the /only/ flag set. I
> suppose this is intentional. My v2 patch does not change anything in the
> case of _DRM_SHM: If it contains a lock, it returns a match without
> comparing offsets. If no lock, it compares the full offsets. Is this
> because the only _DRM_SHM used by userspace is the one with a lock, so
> there is never a need to check a userspace-provided offset, or are those
> always within 32 bit so a full check is ok?

After googling up an old "DRM map design" thread from 2005
(http://thread.gmane.org/gmane.comp.video.dri.devel/19545/focus=19689),
and http://dri.freedesktop.org/wiki/DrmMapHandling I think I can
answer this to some extent myself: For _DRM_SHM it is not an offset
that is passed from/to userspace, but a handle, which I guess is kept
within 32 bit. Although this is not fully clear to me after browsing
through drm_addmap_core(), where the offset or handle is the result of
vmalloc_user().

Tormod


More information about the dri-devel mailing list