[Intel-gfx] [PATCH 04/11] drm/i915: remove useless memset() for watermarks parameters

Ville Syrjälä ville.syrjala at linux.intel.com
Thu Oct 18 13:31:27 UTC 2018


On Tue, Oct 16, 2018 at 03:01:26PM -0700, Paulo Zanoni wrote:
> The skl_compute_plane_wm_params() already completely sets the contents
> of its struct, or returns plane_visible=0 or returns an error code.
> There's no need to memset() it at this point for the same reason we
> don't zero-initialize it up when dealing with plane 0.

If old garbage in the struct is OK for the luma plane then it
should be OK for chroma as well.

Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

> 
> If we want to keep the memset "just to be safe", then we should also
> zero initialize it when we use it for plane 0.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 9043ffe40ce8..d1dd3ae408f9 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4972,7 +4972,6 @@ static int skl_build_pipe_wm(struct intel_crtc_state *cstate,
>  
>  		/* uv plane watermarks must also be validated for NV12/Planar */
>  		if (wm_params.is_planar) {
> -			memset(&wm_params, 0, sizeof(struct skl_wm_params));
>  			wm->is_planar = true;
>  
>  			ret = skl_compute_plane_wm_params(dev_priv, cstate,
> -- 
> 2.14.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list