All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v3 11/12] drm/i915: s/intel_plane/plane/ in sprite init
Date: Fri,  1 Jun 2018 20:00:33 +0300	[thread overview]
Message-ID: <20180601170034.13095-12-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20180601170034.13095-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Use a more familiar naming pattern for our variables in the sprite plane
init function.

v2: Drop the redundant 'plane' from plane_formats and num_planes_formats
    too

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

diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 74500c3afc76..6157e2562f07 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -1603,81 +1603,81 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
 
 struct intel_plane *
 intel_sprite_plane_create(struct drm_i915_private *dev_priv,
-			  enum pipe pipe, int plane)
+			  enum pipe pipe, int sprite)
 {
-	struct intel_plane *intel_plane;
+	struct intel_plane *plane;
 	const struct drm_plane_funcs *plane_funcs;
 	unsigned long possible_crtcs;
-	const uint32_t *plane_formats;
-	const uint64_t *modifiers;
 	unsigned int supported_rotations;
-	int num_plane_formats;
+	const u64 *modifiers;
+	const u32 *formats;
+	int num_formats;
 	int ret;
 
 	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_plane = skl_universal_plane_create(dev_priv, pipe,
-							 PLANE_SPRITE0 + plane);
-		if (IS_ERR(intel_plane))
-			return intel_plane;
+		plane = skl_universal_plane_create(dev_priv, pipe,
+						   PLANE_SPRITE0 + sprite);
+		if (IS_ERR(plane))
+			return plane;
 
 		/* FIXME unify */
-		intel_plane->check_plane = intel_check_sprite_plane;
+		plane->check_plane = intel_check_sprite_plane;
 
-		return intel_plane;
+		return plane;
 	}
 
-	intel_plane = intel_plane_alloc();
-	if (IS_ERR(intel_plane))
-		return intel_plane;
+	plane = intel_plane_alloc();
+	if (IS_ERR(plane))
+		return plane;
 
 	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
-		intel_plane->can_scale = false;
-		intel_plane->max_downscale = 1;
+		plane->can_scale = false;
+		plane->max_downscale = 1;
 
-		intel_plane->update_plane = vlv_update_plane;
-		intel_plane->disable_plane = vlv_disable_plane;
-		intel_plane->get_hw_state = vlv_plane_get_hw_state;
+		plane->update_plane = vlv_update_plane;
+		plane->disable_plane = vlv_disable_plane;
+		plane->get_hw_state = vlv_plane_get_hw_state;
 
-		plane_formats = vlv_plane_formats;
-		num_plane_formats = ARRAY_SIZE(vlv_plane_formats);
+		formats = vlv_plane_formats;
+		num_formats = ARRAY_SIZE(vlv_plane_formats);
 		modifiers = i9xx_plane_format_modifiers;
 
 		plane_funcs = &vlv_sprite_funcs;
 	} else if (INTEL_GEN(dev_priv) >= 7) {
 		if (IS_IVYBRIDGE(dev_priv)) {
-			intel_plane->can_scale = true;
-			intel_plane->max_downscale = 2;
+			plane->can_scale = true;
+			plane->max_downscale = 2;
 		} else {
-			intel_plane->can_scale = false;
-			intel_plane->max_downscale = 1;
+			plane->can_scale = false;
+			plane->max_downscale = 1;
 		}
 
-		intel_plane->update_plane = ivb_update_plane;
-		intel_plane->disable_plane = ivb_disable_plane;
-		intel_plane->get_hw_state = ivb_plane_get_hw_state;
+		plane->update_plane = ivb_update_plane;
+		plane->disable_plane = ivb_disable_plane;
+		plane->get_hw_state = ivb_plane_get_hw_state;
 
-		plane_formats = snb_plane_formats;
-		num_plane_formats = ARRAY_SIZE(snb_plane_formats);
+		formats = snb_plane_formats;
+		num_formats = ARRAY_SIZE(snb_plane_formats);
 		modifiers = i9xx_plane_format_modifiers;
 
 		plane_funcs = &snb_sprite_funcs;
 	} else {
-		intel_plane->can_scale = true;
-		intel_plane->max_downscale = 16;
+		plane->can_scale = true;
+		plane->max_downscale = 16;
 
-		intel_plane->update_plane = g4x_update_plane;
-		intel_plane->disable_plane = g4x_disable_plane;
-		intel_plane->get_hw_state = g4x_plane_get_hw_state;
+		plane->update_plane = g4x_update_plane;
+		plane->disable_plane = g4x_disable_plane;
+		plane->get_hw_state = g4x_plane_get_hw_state;
 
 		modifiers = i9xx_plane_format_modifiers;
 		if (IS_GEN6(dev_priv)) {
-			plane_formats = snb_plane_formats;
-			num_plane_formats = ARRAY_SIZE(snb_plane_formats);
+			formats = snb_plane_formats;
+			num_formats = ARRAY_SIZE(snb_plane_formats);
 
 			plane_funcs = &snb_sprite_funcs;
 		} else {
-			plane_formats = g4x_plane_formats;
-			num_plane_formats = ARRAY_SIZE(g4x_plane_formats);
+			formats = g4x_plane_formats;
+			num_formats = ARRAY_SIZE(g4x_plane_formats);
 
 			plane_funcs = &g4x_sprite_funcs;
 		}
@@ -1692,27 +1692,26 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
 			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180;
 	}
 
-	intel_plane->pipe = pipe;
-	intel_plane->id = PLANE_SPRITE0 + plane;
-	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, intel_plane->id);
-	intel_plane->check_plane = intel_check_sprite_plane;
+	plane->pipe = pipe;
+	plane->id = PLANE_SPRITE0 + sprite;
+	plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
+	plane->check_plane = intel_check_sprite_plane;
 
 	possible_crtcs = BIT(pipe);
 
-	ret = drm_universal_plane_init(&dev_priv->drm, &intel_plane->base,
+	ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
 				       possible_crtcs, plane_funcs,
-				       plane_formats, num_plane_formats,
-				       modifiers,
+				       formats, num_formats, modifiers,
 				       DRM_PLANE_TYPE_OVERLAY,
-				       "sprite %c", sprite_name(pipe, plane));
+				       "sprite %c", sprite_name(pipe, sprite));
 	if (ret)
 		goto fail;
 
-	drm_plane_create_rotation_property(&intel_plane->base,
+	drm_plane_create_rotation_property(&plane->base,
 					   DRM_MODE_ROTATE_0,
 					   supported_rotations);
 
-	drm_plane_create_color_properties(&intel_plane->base,
+	drm_plane_create_color_properties(&plane->base,
 					  BIT(DRM_COLOR_YCBCR_BT601) |
 					  BIT(DRM_COLOR_YCBCR_BT709),
 					  BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |
@@ -1720,12 +1719,12 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
 					  DRM_COLOR_YCBCR_BT709,
 					  DRM_COLOR_YCBCR_LIMITED_RANGE);
 
-	drm_plane_helper_add(&intel_plane->base, &intel_plane_helper_funcs);
+	drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
 
-	return intel_plane;
+	return plane;
 
 fail:
-	intel_plane_free(intel_plane);
+	intel_plane_free(plane);
 
 	return ERR_PTR(ret);
 }
-- 
2.16.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-06-01 17:01 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01 17:00 [PATCH v3 00/12] drm/i915: Some plane init cleanups Ville Syrjala
2018-06-01 17:00 ` [PATCH v3 01/12] drm/i915: Constify all plane_funcs structs Ville Syrjala
2018-06-13 12:30   ` Jani Nikula
2018-06-01 17:00 ` [PATCH v3 02/12] drm/i915: Populate possible_crtcs for primary/cursor planes Ville Syrjala
2018-06-01 20:30   ` Chris Wilson
2018-06-01 20:32   ` Chris Wilson
2018-06-01 17:00 ` [PATCH v3 03/12] drm/i915: Don't populate plane->i9xx_plane for sprites Ville Syrjala
2018-06-01 17:00 ` [PATCH v3 04/12] drm/i915: Allow horizontal mirroring for cnl+ "sprite" planes Ville Syrjala
2018-06-01 17:00 ` [PATCH v3 05/12] drm/i915: Disallow plane scaling with specific pixel formats Ville Syrjala
2018-06-01 17:00 ` [PATCH v3 06/12] drm/i915: Add missing pixel formats for skl+ "sprites" Ville Syrjala
2018-06-01 17:00 ` [PATCH v3 07/12] drm/i915: Move plane_state->scaler_id initialization into intel_create_plane_state() Ville Syrjala
2018-06-01 20:36   ` Chris Wilson
2018-06-01 17:00 ` [PATCH v3 08/12] drm/i915: Introduce intel_plane_alloc() Ville Syrjala
2018-06-01 20:40   ` Chris Wilson
2018-06-01 17:00 ` [PATCH v3 09/12] drm/i915: Extract skl_universal_plane_init() Ville Syrjala
2018-06-01 18:39   ` [PATCH v4 " Ville Syrjala
2018-07-06 11:20     ` Lisovskiy, Stanislav
2018-06-01 17:00 ` [PATCH v3 10/12] drm/i915: Simplify skl_plane_has_planar() Ville Syrjala
2018-06-01 17:00 ` Ville Syrjala [this message]
2018-06-01 17:00 ` [PATCH v3 12/12] drm/i915: Rename variables in intel_primary_plane_create() Ville Syrjala
2018-06-01 18:39   ` [PATCH v4 " Ville Syrjala
2018-08-29  1:19   ` [PATCH v3 " Dhinakaran Pandiyan
2018-08-29 11:55     ` Ville Syrjälä
2018-06-01 17:07 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Some plane init cleanups Patchwork
2018-06-01 17:26 ` ✓ Fi.CI.BAT: success " Patchwork
2018-06-01 18:59 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Some plane init cleanups (rev3) Patchwork
2018-06-01 19:18 ` ✓ Fi.CI.BAT: success " Patchwork
2018-06-01 19:37 ` ✓ Fi.CI.IGT: success for drm/i915: Some plane init cleanups Patchwork
2018-06-01 20:21 ` ✓ Fi.CI.IGT: success for drm/i915: Some plane init cleanups (rev3) Patchwork
2018-07-06 12:21 ` [PATCH v3 00/12] drm/i915: Some plane init cleanups Lisovskiy, Stanislav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180601170034.13095-12-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.