drm/radeon: add userptr flag to limit it to anonymous memory v2

Avoid problems with writeback by limiting userptr to anonymous memory.

v2: add commit and code comments

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Christian König 2014-08-07 09:36:01 +02:00 committed by Alex Deucher
parent f72a113a71
commit ddd00e33e1
3 changed files with 13 additions and 1 deletions

View file

@ -290,7 +290,8 @@ int radeon_gem_userptr_ioctl(struct drm_device *dev, void *data,
return -EACCES;
/* reject unknown flag values */
if (args->flags & ~RADEON_GEM_USERPTR_READONLY)
if (args->flags & ~(RADEON_GEM_USERPTR_READONLY |
RADEON_GEM_USERPTR_ANONONLY))
return -EINVAL;
/* readonly pages not tested on older hardware */