drm/amdgpu: Mask out clear/wipe operation if buffer function is unavailable
Subsystems (2)
PATCH 1/1 drm/amdgpu: Mask out clear/wipe operation if buffer function is unavailable
It makes no sense to use clear/wipe operation if buffer function is unavailable. It's useful in bring up phase when SDMA is not ready and/or disabled intentionally by amdgpu_ip_block_mask. This avoids manually masking out clear/wipe operation repeatedly.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +4 -0
@@ -689,6 +689,10 @@ int amdgpu_bo_create(struct amdgpu_device *adev,if (!amdgpu_bo_support_uswc (bo->flags)) bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC ; +if (!adev->mman.buffer_funcs_enabled) + bo->flags &= ~(AMDGPU_GEM_CREATE_VRAM_CLEARED | +AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE ); + bo->tbo.bdev = &adev->mman.bdev;if (bp->domain & (AMDGPU_GEM_DOMAIN_GWS |AMDGPU_GEM_DOMAIN_OA |AMDGPU_GEM_DOMAIN_GDS ))
Signature · 1 line
2.34.1
Christian König
maintainerQuoted 4 lines · Lang Yu
It makes no sense to use clear/wipe operation if buffer function is unavailable. It's useful in bring up phase when SDMA is not ready and/or disabled intentionally by
amdgpu_ip_block_mask. This avoids manually masking out clear/wipe operation repeatedly.
Clear NAK. SDMA can be temporary unavailable during suspend/resume, but that doesn't mean that we can skip that.
Especially ignoring AMDGPU_GEM_CREATE_VRAM_CLEARED will just crash userspace.
Regards,
Christian.
Quoted 21 lines
Signed-off-by Lang Yu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +4
-0@@ -689,6 +689,10 @@ int amdgpu_bo_create(struct amdgpu_device *adev,if (!amdgpu_bo_support_uswc (bo->flags)) bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC ; +if (!adev->mman.buffer_funcs_enabled) + bo->flags &= ~(AMDGPU_GEM_CREATE_VRAM_CLEARED | +AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE ); + bo->tbo.bdev = &adev->mman.bdev;if (bp->domain & (AMDGPU_GEM_DOMAIN_GWS |AMDGPU_GEM_DOMAIN_OA |AMDGPU_GEM_DOMAIN_GDS ))