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

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

 




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

Reviewed-by: Harry Wentland <harry.wentland@xxxxxxx>

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;




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux