diff options
author | Chunming Zhou <david1.zhou@amd.com> | 2018-05-30 11:12:08 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-30 12:34:34 -0500 |
commit | ee5309d5f3eba16d7901d29179d03d4336319fc0 (patch) | |
tree | 59a2977c92b4881b27b8e2cfe8be4ebe0d4f3d6b /drivers/gpu/drm | |
parent | 01d98506eca24f1a6b67374ffb65c2e62a56e8e7 (diff) | |
download | linux-ee5309d5f3eba16d7901d29179d03d4336319fc0.tar.gz linux-ee5309d5f3eba16d7901d29179d03d4336319fc0.tar.bz2 linux-ee5309d5f3eba16d7901d29179d03d4336319fc0.zip |
drm/amdgpu: gds bo must not be per-vm-bo
In per-vm-bo case, there could be no bo list.
But gds bo created from user space must be passed to bo list.
So adding a check to prevent to creat gds bo as per-vm-bo.
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 556406a44da3..5fb156a01774 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -236,6 +236,13 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, /* create a gem object to contain this object in */ if (args->in.domains & (AMDGPU_GEM_DOMAIN_GDS | AMDGPU_GEM_DOMAIN_GWS | AMDGPU_GEM_DOMAIN_OA)) { + if (flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID) { + /* if gds bo is created from user space, it must be + * passed to bo list + */ + DRM_ERROR("GDS bo cannot be per-vm-bo\n"); + return -EINVAL; + } flags |= AMDGPU_GEM_CREATE_NO_CPU_ACCESS; if (args->in.domains == AMDGPU_GEM_DOMAIN_GDS) size = size << AMDGPU_GDS_SHIFT; |