diff options
author | Chunming Zhou <david1.zhou@amd.com> | 2018-05-30 05:12:08 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-30 19:34:34 +0200 |
commit | ee5309d5f3eba16d7901d29179d03d4336319fc0 (patch) | |
tree | 59a2977c92b4881b27b8e2cfe8be4ebe0d4f3d6b /drivers | |
parent | drm/amdgpu: To get gds, gws and oa from adev->gds (v2) (diff) | |
download | linux-ee5309d5f3eba16d7901d29179d03d4336319fc0.tar.xz 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')
-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; |