diff mbox series

[v2,12/13] drm/i915: Rename the confusing 'plane_id' to 'color_plane'

Message ID 20181114210729.16185-13-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Program SKL+ watermarks/ddb more carefully | expand

Commit Message

Ville Syrjala Nov. 14, 2018, 9:07 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

A variable whose name is 'plane_id' is expected to be of the
enum plane_id type. In this case we have a raw int, which turns
out to refer to the plane of the framebuffer. Rename the variable
to 'color_plane' in line with the trend started earlier.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Matt Roper Nov. 26, 2018, 11:30 p.m. UTC | #1
On Wed, Nov 14, 2018 at 11:07:28PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> A variable whose name is 'plane_id' is expected to be of the
> enum plane_id type. In this case we have a raw int, which turns
> out to refer to the plane of the framebuffer. Rename the variable
> to 'color_plane' in line with the trend started earlier.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 1b337004054a..395c11b8a212 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4581,7 +4581,7 @@ skl_adjusted_plane_pixel_rate(const struct intel_crtc_state *cstate,
>  static int
>  skl_compute_plane_wm_params(const struct intel_crtc_state *cstate,
>  			    const struct intel_plane_state *intel_pstate,
> -			    struct skl_wm_params *wp, int plane_id)
> +			    struct skl_wm_params *wp, int color_plane)
>  {
>  	struct intel_plane *plane = to_intel_plane(intel_pstate->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> @@ -4593,7 +4593,7 @@ skl_compute_plane_wm_params(const struct intel_crtc_state *cstate,
>  	bool apply_memory_bw_wa = skl_needs_memory_bw_wa(state);
>  
>  	/* only NV12 format has two planes */
> -	if (plane_id == 1 && fb->format->format != DRM_FORMAT_NV12) {
> +	if (color_plane == 1 && fb->format->format != DRM_FORMAT_NV12) {
>  		DRM_DEBUG_KMS("Non NV12 format have single plane\n");
>  		return -EINVAL;
>  	}
> @@ -4618,10 +4618,10 @@ skl_compute_plane_wm_params(const struct intel_crtc_state *cstate,
>  		wp->width = drm_rect_width(&intel_pstate->base.src) >> 16;
>  	}
>  
> -	if (plane_id == 1 && wp->is_planar)
> +	if (color_plane == 1 && wp->is_planar)
>  		wp->width /= 2;
>  
> -	wp->cpp = fb->format->cpp[plane_id];
> +	wp->cpp = fb->format->cpp[color_plane];
>  	wp->plane_pixel_rate = skl_adjusted_plane_pixel_rate(cstate,
>  							     intel_pstate);
>  
> -- 
> 2.18.1
> 
> _______________________________________________
> 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 1b337004054a..395c11b8a212 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4581,7 +4581,7 @@  skl_adjusted_plane_pixel_rate(const struct intel_crtc_state *cstate,
 static int
 skl_compute_plane_wm_params(const struct intel_crtc_state *cstate,
 			    const struct intel_plane_state *intel_pstate,
-			    struct skl_wm_params *wp, int plane_id)
+			    struct skl_wm_params *wp, int color_plane)
 {
 	struct intel_plane *plane = to_intel_plane(intel_pstate->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
@@ -4593,7 +4593,7 @@  skl_compute_plane_wm_params(const struct intel_crtc_state *cstate,
 	bool apply_memory_bw_wa = skl_needs_memory_bw_wa(state);
 
 	/* only NV12 format has two planes */
-	if (plane_id == 1 && fb->format->format != DRM_FORMAT_NV12) {
+	if (color_plane == 1 && fb->format->format != DRM_FORMAT_NV12) {
 		DRM_DEBUG_KMS("Non NV12 format have single plane\n");
 		return -EINVAL;
 	}
@@ -4618,10 +4618,10 @@  skl_compute_plane_wm_params(const struct intel_crtc_state *cstate,
 		wp->width = drm_rect_width(&intel_pstate->base.src) >> 16;
 	}
 
-	if (plane_id == 1 && wp->is_planar)
+	if (color_plane == 1 && wp->is_planar)
 		wp->width /= 2;
 
-	wp->cpp = fb->format->cpp[plane_id];
+	wp->cpp = fb->format->cpp[color_plane];
 	wp->plane_pixel_rate = skl_adjusted_plane_pixel_rate(cstate,
 							     intel_pstate);