Re: [PATCH 1/2] drm/amdgpu/virtual_dce: No need to pin the fb's bo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2018-12-24 7:08 a.m., Emily Deng wrote:
> For virtual display, no need to pin the fb's bo.
> 
> Signed-off-by: Emily Deng <Emily.Deng@xxxxxxx>
> 
> [...]
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> index ea89c54..4e94473 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> @@ -188,10 +188,12 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
>  		goto cleanup;
>  	}
>  
> -	r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev));
> -	if (unlikely(r != 0)) {
> -		DRM_ERROR("failed to pin new abo buffer before flip\n");
> -		goto unreserve;
> +	if (!adev->enable_virtual_display) {
> +		r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev));
> +		if (unlikely(r != 0)) {
> +			DRM_ERROR("failed to pin new abo buffer before flip\n");
> +			goto unreserve;
> +		}
>  	}
>  
>  	r = amdgpu_ttm_alloc_gart(&new_abo->tbo);

I think the amdgpu_ttm_alloc_gart call could be skipped as well?


> @@ -242,9 +245,10 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
>  		goto cleanup;
>  	}
>  unpin:
> -	if (unlikely(amdgpu_bo_unpin(new_abo) != 0)) {
> -		DRM_ERROR("failed to unpin new abo in error path\n");
> -	}
> +	if (!adev->enable_virtual_display)
> +		if (unlikely(amdgpu_bo_unpin(new_abo) != 0))
> +			DRM_ERROR("failed to unpin new abo in error path\n");

This should be written as either

	if (!adev->enable_virtual_display &&
	    unlikely(amdgpu_bo_unpin(new_abo) != 0))
		DRM_ERROR("failed to unpin new abo in error path\n");

or

	if (!adev->enable_virtual_display) {
		if (unlikely(amdgpu_bo_unpin(new_abo) != 0))
			DRM_ERROR("failed to unpin new abo in error path\n");
	}


P.S. A lot of people are out for Christmas and New Year's.

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux