[PATCH 02/22] drm/amdgpu: Remove pointless on stack mode copies

Harry Wentland harry.wentland at amd.com
Fri Feb 18 16:28:21 UTC 2022



On 2022-02-18 05:03, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> These on stack copies of the modes appear to be pointless.
> Just look at the originals directly.
> 
> Cc: Harry Wentland <harry.wentland at amd.com>
> Cc: Leo Li <sunpeng.li at amd.com>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: amd-gfx at lists.freedesktop.org
> Cc: Nikola Cornij <nikola.cornij at amd.com>
> Cc: Aurabindo Pillai <aurabindo.pillai at amd.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Harry Wentland <harry.wentland at amd.com>

Harry

> ---
>  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 32 +++++++++----------
>  1 file changed, 16 insertions(+), 16 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 21dba337dab0..65aab0d086b6 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -10139,27 +10139,27 @@ static bool
>  is_timing_unchanged_for_freesync(struct drm_crtc_state *old_crtc_state,
>  				 struct drm_crtc_state *new_crtc_state)
>  {
> -	struct drm_display_mode old_mode, new_mode;
> +	const struct drm_display_mode *old_mode, *new_mode;
>  
>  	if (!old_crtc_state || !new_crtc_state)
>  		return false;
>  
> -	old_mode = old_crtc_state->mode;
> -	new_mode = new_crtc_state->mode;
> +	old_mode = &old_crtc_state->mode;
> +	new_mode = &new_crtc_state->mode;
>  
> -	if (old_mode.clock       == new_mode.clock &&
> -	    old_mode.hdisplay    == new_mode.hdisplay &&
> -	    old_mode.vdisplay    == new_mode.vdisplay &&
> -	    old_mode.htotal      == new_mode.htotal &&
> -	    old_mode.vtotal      != new_mode.vtotal &&
> -	    old_mode.hsync_start == new_mode.hsync_start &&
> -	    old_mode.vsync_start != new_mode.vsync_start &&
> -	    old_mode.hsync_end   == new_mode.hsync_end &&
> -	    old_mode.vsync_end   != new_mode.vsync_end &&
> -	    old_mode.hskew       == new_mode.hskew &&
> -	    old_mode.vscan       == new_mode.vscan &&
> -	    (old_mode.vsync_end - old_mode.vsync_start) ==
> -	    (new_mode.vsync_end - new_mode.vsync_start))
> +	if (old_mode->clock       == new_mode->clock &&
> +	    old_mode->hdisplay    == new_mode->hdisplay &&
> +	    old_mode->vdisplay    == new_mode->vdisplay &&
> +	    old_mode->htotal      == new_mode->htotal &&
> +	    old_mode->vtotal      != new_mode->vtotal &&
> +	    old_mode->hsync_start == new_mode->hsync_start &&
> +	    old_mode->vsync_start != new_mode->vsync_start &&
> +	    old_mode->hsync_end   == new_mode->hsync_end &&
> +	    old_mode->vsync_end   != new_mode->vsync_end &&
> +	    old_mode->hskew       == new_mode->hskew &&
> +	    old_mode->vscan       == new_mode->vscan &&
> +	    (old_mode->vsync_end - old_mode->vsync_start) ==
> +	    (new_mode->vsync_end - new_mode->vsync_start))
>  		return true;
>  
>  	return false;



More information about the amd-gfx mailing list