[PATCH] drm/amd/display: Drop 'acrtc' and add 'new_crtc_state' NULL check for writeback requests.

Alex Hung alex.hung at amd.com
Mon Jan 15 21:44:35 UTC 2024


Thanks for catching this.

Reviewed-by: Alex Hung <alex.hung at amd.com>

On 2024-01-13 02:11, Srinivasan Shanmugam wrote:
> Return value of 'to_amdgpu_crtc' which is container_of(...) can't be
> null, so it's null check 'acrtc' is dropped.
> 
> Fixing the below:
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9302 amdgpu_dm_atomic_commit_tail() error: we previously assumed 'acrtc' could be null (see line 9299)
> 
> Add 'new_crtc_state'NULL check for function
> 'drm_atomic_get_new_crtc_state' that retrieves the new state for a CRTC,
> while enabling writeback requests.
> 
> Cc: stable at vger.kernel.org
> Cc: Alex Hung <alex.hung at amd.com>
> Cc: Aurabindo Pillai <aurabindo.pillai at amd.com>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
> Cc: Hamza Mahfooz <hamza.mahfooz at amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 95ff3800fc87..8eb381d5f6b8 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -9294,10 +9294,10 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
>   		if (!new_con_state->writeback_job)
>   			continue;
>   
> -		new_crtc_state = NULL;
> +		new_crtc_state = drm_atomic_get_new_crtc_state(state, &acrtc->base);
>   
> -		if (acrtc)
> -			new_crtc_state = drm_atomic_get_new_crtc_state(state, &acrtc->base);
> +		if (!new_crtc_state)
> +			continue;
>   
>   		if (acrtc->wb_enabled)
>   			continue;


More information about the amd-gfx mailing list