[PATCH] amdgpu: allow setting contiguous on non-kernel bos for placement

Christian König ckoenig.leichtzumerken at gmail.com
Wed Jul 24 07:12:19 UTC 2024


Am 24.07.24 um 09:02 schrieb Dave Airlie:
> From: Dave Airlie <airlied at redhat.com>
>
> 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.

> 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.

> 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.

>
> Fixes: 143c51da8dba ("drm/amdgpu: Modify the contiguous flags behaviour")
> Cc: stable at vger.kernel.org
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 706345ea1430..b3ee952f68d4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -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++;



More information about the amd-gfx mailing list