diff mbox series

[05/11] drm/i915: simplify wm->is_planar assignment

Message ID 20181016220133.26991-6-paulo.r.zanoni@intel.com (mailing list archive)
State New, archived
Headers show
Series More watermarks improvements | expand

Commit Message

Zanoni, Paulo R Oct. 16, 2018, 10:01 p.m. UTC
We're currently doing it in two different ways, none of them based on
the wm_params struct. Both places are correct, so I chose to keep the
one in skl_compute_wm_levels() since it's the function that sets the
other values for the same struct. But I'm open to better suggestions
on the place to assign it.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Ville Syrjälä Oct. 18, 2018, 1:34 p.m. UTC | #1
On Tue, Oct 16, 2018 at 03:01:27PM -0700, Paulo Zanoni wrote:
> We're currently doing it in two different ways, none of them based on
> the wm_params struct. Both places are correct, so I chose to keep the
> one in skl_compute_wm_levels() since it's the function that sets the
> other values for the same struct. But I'm open to better suggestions
> on the place to assign it.

I'm not a huge fan of the entire wm_params thing. Lots of
duplicated infromation for dubious gain. But given that we have
it I think this patch is fine.

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

> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index d1dd3ae408f9..7fd344b81d66 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4832,8 +4832,7 @@ skl_compute_wm_levels(const struct drm_i915_private *dev_priv,
>  			return ret;
>  	}
>  
> -	if (intel_pstate->base.fb->format->format == DRM_FORMAT_NV12)
> -		wm->is_planar = true;
> +	wm->is_planar = wm_params->is_planar;
>  
>  	return 0;
>  }
> @@ -4972,8 +4971,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) {
> -			wm->is_planar = true;
> -
>  			ret = skl_compute_plane_wm_params(dev_priv, cstate,
>  							  intel_pstate,
>  							  &wm_params, 1);
> -- 
> 2.14.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index d1dd3ae408f9..7fd344b81d66 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4832,8 +4832,7 @@  skl_compute_wm_levels(const struct drm_i915_private *dev_priv,
 			return ret;
 	}
 
-	if (intel_pstate->base.fb->format->format == DRM_FORMAT_NV12)
-		wm->is_planar = true;
+	wm->is_planar = wm_params->is_planar;
 
 	return 0;
 }
@@ -4972,8 +4971,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) {
-			wm->is_planar = true;
-
 			ret = skl_compute_plane_wm_params(dev_priv, cstate,
 							  intel_pstate,
 							  &wm_params, 1);