aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-09-14 10:06:31 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-09-19 13:38:48 -0400
commit77a2faa55c1a497f4e7e89eabd11830f0e3cb3dd (patch)
tree6c0eb5f3977246e97ae34339b72b45bd1a65ac21 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
parent403009bfba45163887398652762ed1fc6645181c (diff)
drm/amdgpu: fix up GDS/GWS/OA shifting
That only worked by pure coincident. Completely remove the shifting and always apply correct PAGE_SHIFT. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index d30a0838851b..7b3d1ebda9df 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -244,16 +244,10 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
244 return -EINVAL; 244 return -EINVAL;
245 } 245 }
246 flags |= AMDGPU_GEM_CREATE_NO_CPU_ACCESS; 246 flags |= AMDGPU_GEM_CREATE_NO_CPU_ACCESS;
247 if (args->in.domains == AMDGPU_GEM_DOMAIN_GDS) 247 /* GDS allocations must be DW aligned */
248 size = size << AMDGPU_GDS_SHIFT; 248 if (args->in.domains & AMDGPU_GEM_DOMAIN_GDS)
249 else if (args->in.domains == AMDGPU_GEM_DOMAIN_GWS) 249 size = ALIGN(size, 4);
250 size = size << AMDGPU_GWS_SHIFT;
251 else if (args->in.domains == AMDGPU_GEM_DOMAIN_OA)
252 size = size << AMDGPU_OA_SHIFT;
253 else
254 return -EINVAL;
255 } 250 }
256 size = roundup(size, PAGE_SIZE);
257 251
258 if (flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID) { 252 if (flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID) {
259 r = amdgpu_bo_reserve(vm->root.base.bo, false); 253 r = amdgpu_bo_reserve(vm->root.base.bo, false);