diff options
author | 2014-11-20 09:56:25 +0100 | |
---|---|---|
committer | 2014-11-21 12:12:41 +1000 | |
commit | 355a70183848f21198e9f6296bd646df3478a26d (patch) | |
tree | 24d8480a3dc04ac66ed2017e62d2e644758c389c /include/drm/drm_gem.h | |
parent | Merge branch 'amdkfd-v6' of git://people.freedesktop.org/~gabbayo/linux into ... (diff) | |
download | linux-355a70183848f21198e9f6296bd646df3478a26d.tar.gz linux-355a70183848f21198e9f6296bd646df3478a26d.tar.bz2 linux-355a70183848f21198e9f6296bd646df3478a26d.zip |
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>
Diffstat (limited to 'include/drm/drm_gem.h')
-rw-r--r-- | include/drm/drm_gem.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 1e6ae1458f7a..780511a459c0 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -119,6 +119,13 @@ struct drm_gem_object { * simply leave it as NULL. */ struct dma_buf_attachment *import_attach; + + /** + * dumb - created as dumb buffer + * Whether the gem object was created using the dumb buffer interface + * as such it may not be used for GPU rendering. + */ + bool dumb; }; void drm_gem_object_release(struct drm_gem_object *obj); |