]> git.baikalelectronics.ru Git - kernel.git/commit
drm/gem: Warn on illegal use of the dumb buffer interface v2
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 20 Nov 2014 08:56:25 +0000 (09:56 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 21 Nov 2014 02:12:41 +0000 (12:12 +1000)
commit3cf2c60dbc99980ea6b9a9c6837337ffe493da47
tree24d8480a3dc04ac66ed2017e62d2e644758c389c
parentc99a801b20bb06e56b0c795a13e86af18ab40312
drm/gem: Warn on illegal use of the dumb buffer interface v2

It happens on occasion that developers of generic user-space applications
abuse the dumb buffer API to get hold of drm buffers that they can both
mmap() and use for GPU acceleration, using the assumptions that dumb buffers
and buffers available for GPU are
a) The same type and can be aribtrarily type-casted.
b) fully coherent.

This patch makes the most widely used drivers warn nicely when that happens,
the next step will be to fail.

v2: Move drmP.h changes to drm_gem.h. Fix Radeon dumb mmap breakage.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_execbuffer.c
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_gem.c
drivers/gpu/drm/radeon/radeon_gem.c
drivers/gpu/drm/radeon/radeon_object.c
include/drm/drm_gem.h