On 2018-06-26 08:00 AM, Junwei Zhang wrote:
> Instead of calling gart memory on every bo pin,
> allocates it on demand
> 
> Signed-off-by: Junwei Zhang <[email protected]>
> 
> [...]
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> index 036b6f7..0d1c4be 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> @@ -194,6 +194,12 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc 
> *crtc,
>               goto unreserve;
>       }
>  
> +     r = amdgpu_ttm_alloc_gart(&new_abo->tbo);
> +     if (unlikely(r != 0)) {
> +             DRM_ERROR("%p bind failed\n", new_abo);
> +             goto unreserve;
> +     }

The error case here also needs to unpin the BO, otherwise we leak the
pin. I suspect the same issue applies to at least some of the other
places modified by this patch.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to