amdgpu: allow setting contiguous on non-kernel bos for placement
Subsystems (2)
Dave Airlie
maintainerPATCH 1/1 amdgpu: allow setting contiguous on non-kernel bos for placement
From: Dave Airlie <[email protected]>
This is a partial revert of drm/amdgpu: Modify the contiguous flags behaviour.
This broke VCN AV1 decoding on radv video on GFX11.
On VCN4 only the first VCN block has AV1 decode support, so the kernel has a hacky heurisitic to work out from the submitted IB if it's AV1. YOU COULD HAVE PUT A FLAG ON THE BO SUBMISSION YOU KNOW!.
Now in order to access the submitted IB, it has to mark it as contiguous, so the ioremap can work on it so the kernel can access the contents.
However this buffer isn't a kernel buffer, so the new check introduced in the above commit, breaks the whole show. I'm not sure why vaapi manages to avoid this fate, but it does somehow. Anyways this restores the behaviour from before.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -2
@@ -153,8 +153,7 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)else places[c].flags |=TTM_PL_FLAG_TOPDOWN ; -if (abo->tbo.type == ttm_bo_type_kernel && - flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) +if (flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) places[c].flags |=TTM_PL_FLAG_CONTIGUOUS ; c++;
Signature · 1 line
2.45.2
Am 24.07.24 um 09:02 schrieb Dave Airlie:
Quoted 9 lines
From: Dave Airlie <[email protected]>
This is a partial revert of drm/amdgpu: Modify the contiguous flags behaviour.
This broke VCN AV1 decoding on radv video on GFX11.
On VCN4 only the first VCN block has AV1 decode support, so the kernel has a hacky heurisitic to work out from the submitted IB if it's AV1. YOU COULD HAVE PUT A FLAG ON THE BO SUBMISSION YOU KNOW!.
And we intentionally didn't do that.
Quoted 2 lines
Now in order to access the submitted IB, it has to mark it as contiguous, so the ioremap can work on it so the kernel can access the contents.
Stop, something is wrong here. We should be able to kmap non-contiguous BOs.
Quoted 4 lines
However this buffer isn't a kernel buffer, so the new check introduced in the above commit, breaks the whole show. I'm not sure why vaapi manages to avoid this fate, but it does somehow. Anyways this restores the behaviour from before.
And breaks other places, so that is really not something we can do.
Regards,
Christian.
Quoted 22 lines
Fixes 143c51da8dba ("drm/amdgpu: Modify the contiguous flags behaviour")Signed-off-by Dave Airlie <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1
-2@@ -153,8 +153,7 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)else places[c].flags |=TTM_PL_FLAG_TOPDOWN ; -if (abo->tbo.type == ttm_bo_type_kernel && - flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) +if (flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) places[c].flags |=TTM_PL_FLAG_CONTIGUOUS ; c++;