[PATCH] drm/radeon: use the dummy page for GART if needed

Alex Deucher alexdeucher at gmail.com
Wed May 12 18:10:40 UTC 2021


On Wed, May 12, 2021 at 6:18 AM Christian König
<ckoenig.leichtzumerken at gmail.com> wrote:
>
> Imported BOs don't have a pagelist any more.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> Fixes: 0575ff3d33cd ("drm/radeon: stop using pages with drm_prime_sg_to_page_addr_arrays v2")
> CC: stable at vger.kernel.org # 5.12

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/radeon/radeon_gart.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
> index 3808a753127b..04109a2a6fd7 100644
> --- a/drivers/gpu/drm/radeon/radeon_gart.c
> +++ b/drivers/gpu/drm/radeon/radeon_gart.c
> @@ -301,7 +301,8 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
>         p = t / (PAGE_SIZE / RADEON_GPU_PAGE_SIZE);
>
>         for (i = 0; i < pages; i++, p++) {
> -               rdev->gart.pages[p] = pagelist[i];
> +               rdev->gart.pages[p] = pagelist ? pagelist[i] :
> +                       rdev->dummy_page.page;
>                 page_base = dma_addr[i];
>                 for (j = 0; j < (PAGE_SIZE / RADEON_GPU_PAGE_SIZE); j++, t++) {
>                         page_entry = radeon_gart_get_page_entry(page_base, flags);
> --
> 2.25.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list