All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 12/12] drm/i915: Rename variables in intel_primary_plane_create()
Date: Tue, 28 Aug 2018 18:19:44 -0700	[thread overview]
Message-ID: <9db2290b7b1f76d550d2c9a17576cba1badc8308.camel@intel.com> (raw)
In-Reply-To: <20180601170034.13095-13-ville.syrjala@linux.intel.com>




On Fri, 2018-06-01 at 20:00 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Let's try to stick a common naming pattern in all the plane init
> funcs.
> 

Since you are moving things around, do you think this is a good time to
move all plane_create functions to intel_sprite and rename it as
intel_plane.c? 



> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 86 ++++++++++++++++++------
> ------------
>  1 file changed, 42 insertions(+), 44 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index 08ae063fecae..5e9e51135086 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13398,72 +13398,72 @@ static bool i9xx_plane_has_fbc(struct
> drm_i915_private *dev_priv,
>  static struct intel_plane *
>  intel_primary_plane_create(struct drm_i915_private *dev_priv, enum
> pipe pipe)
>  {
> -	struct intel_plane *primary;
> +	struct intel_plane *plane;
>  	const struct drm_plane_funcs *plane_funcs;
> -	const uint32_t *intel_primary_formats;
>  	unsigned int supported_rotations;
>  	unsigned int possible_crtcs;
> -	unsigned int num_formats;
> -	const uint64_t *modifiers;
> +	const u64 *modifiers;
> +	const u32 *formats;
> +	int num_formats;
>  	int ret;
>  
>  	if (INTEL_GEN(dev_priv) >= 9) {
> -		primary = skl_universal_plane_create(dev_priv, pipe,
> -						     PLANE_PRIMARY);
> -		if (IS_ERR(primary))
> -			return primary;
> +		plane = skl_universal_plane_create(dev_priv, pipe,
> +						   PLANE_PRIMARY);
> +		if (IS_ERR(plane))
> +			return plane;
>  
>  		/* FIXME unify */
> -		primary->check_plane = intel_check_primary_plane;
> +		plane->check_plane = intel_check_primary_plane;
>  
> -		return primary;
> +		return plane;
>  	}
>  
> -	primary = intel_plane_alloc();
> -	if (IS_ERR(primary))
> -		return primary;
> +	plane = intel_plane_alloc();
> +	if (IS_ERR(plane))
> +		return plane;
>  
> -	primary->can_scale = false;
> -	primary->max_downscale = 1;
> -	primary->pipe = pipe;
> +	plane->can_scale = false;
> +	plane->max_downscale = 1;
> +	plane->pipe = pipe;
>  	/*
>  	 * On gen2/3 only plane A can do FBC, but the panel fitter
> and LVDS
>  	 * port is hooked to pipe B. Hence we want plane A feeding
> pipe B.
>  	 */
>  	if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
> -		primary->i9xx_plane = (enum i9xx_plane_id) !pipe;
> +		plane->i9xx_plane = (enum i9xx_plane_id) !pipe;
>  	else
> -		primary->i9xx_plane = (enum i9xx_plane_id) pipe;
> -	primary->id = PLANE_PRIMARY;
> -	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary-
> >id);
> +		plane->i9xx_plane = (enum i9xx_plane_id) pipe;
> +	plane->id = PLANE_PRIMARY;
> +	plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
>  
> -	primary->has_fbc = i9xx_plane_has_fbc(dev_priv, primary-
> >i9xx_plane);
> -	if (primary->has_fbc) {
> +	plane->has_fbc = i9xx_plane_has_fbc(dev_priv, plane-
> >i9xx_plane);
> +	if (plane->has_fbc) {
>  		struct intel_fbc *fbc = &dev_priv->fbc;
>  
> -		fbc->possible_framebuffer_bits |= primary-
> >frontbuffer_bit;
> +		fbc->possible_framebuffer_bits |= plane-
> >frontbuffer_bit;
>  	}
>  
> -	primary->check_plane = intel_check_primary_plane;
> +	plane->check_plane = intel_check_primary_plane;
>  
>  	if (INTEL_GEN(dev_priv) >= 4) {
> -		intel_primary_formats = i965_primary_formats;
> +		formats = i965_primary_formats;
>  		num_formats = ARRAY_SIZE(i965_primary_formats);
>  		modifiers = i9xx_format_modifiers;
>  
> -		primary->update_plane = i9xx_update_plane;
> -		primary->disable_plane = i9xx_disable_plane;
> -		primary->get_hw_state = i9xx_plane_get_hw_state;
> +		plane->update_plane = i9xx_update_plane;
> +		plane->disable_plane = i9xx_disable_plane;
> +		plane->get_hw_state = i9xx_plane_get_hw_state;
>  
>  		plane_funcs = &i965_plane_funcs;
>  	} else {
> -		intel_primary_formats = i8xx_primary_formats;
> +		formats = i8xx_primary_formats;
>  		num_formats = ARRAY_SIZE(i8xx_primary_formats);
>  		modifiers = i9xx_format_modifiers;
>  
> -		primary->update_plane = i9xx_update_plane;
> -		primary->disable_plane = i9xx_disable_plane;
> -		primary->get_hw_state = i9xx_plane_get_hw_state;
> +		plane->update_plane = i9xx_update_plane;
> +		plane->disable_plane = i9xx_disable_plane;
> +		plane->get_hw_state = i9xx_plane_get_hw_state;
>  
>  		plane_funcs = &i8xx_plane_funcs;
>  	}
> @@ -13471,20 +13471,18 @@ intel_primary_plane_create(struct
> drm_i915_private *dev_priv, enum pipe pipe)
>  	possible_crtcs = BIT(pipe);
>  
>  	if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
> -		ret = drm_universal_plane_init(&dev_priv->drm,
> &primary->base,
> +		ret = drm_universal_plane_init(&dev_priv->drm,
> &plane->base,
>  					       possible_crtcs,
> plane_funcs,
> -					       intel_primary_formats
> , num_formats,
> -					       modifiers,
> +					       formats, num_formats,
> modifiers,
>  					       DRM_PLANE_TYPE_PRIMAR
> Y,
>  					       "primary %c",
> pipe_name(pipe));
>  	else
> -		ret = drm_universal_plane_init(&dev_priv->drm,
> &primary->base,
> +		ret = drm_universal_plane_init(&dev_priv->drm,
> &plane->base,
>  					       possible_crtcs,
> plane_funcs,
> -					       intel_primary_formats
> , num_formats,
> -					       modifiers,
> +					       formats, num_formats,
> modifiers,
>  					       DRM_PLANE_TYPE_PRIMAR
> Y,
>  					       "plane %c",
> -					       plane_name(primary-
> >i9xx_plane));
> +					       plane_name(plane-
> >i9xx_plane));
>  	if (ret)
>  		goto fail;
>  
> @@ -13500,12 +13498,12 @@ intel_primary_plane_create(struct
> drm_i915_private *dev_priv, enum pipe pipe)
>  	}
>  
>  	if (INTEL_GEN(dev_priv) >= 4)
> -		drm_plane_create_rotation_property(&primary->base,
> +		drm_plane_create_rotation_property(&plane->base,
>  						   DRM_MODE_ROTATE_0
> ,
>  						   supported_rotatio
> ns);
>  
>  	if (INTEL_GEN(dev_priv) >= 9)
> -		drm_plane_create_color_properties(&primary->base,
> +		drm_plane_create_color_properties(&plane->base,
>  						  BIT(DRM_COLOR_YCBC
> R_BT601) |
>  						  BIT(DRM_COLOR_YCBC
> R_BT709),
>  						  BIT(DRM_COLOR_YCBC
> R_LIMITED_RANGE) |
> @@ -13513,12 +13511,12 @@ intel_primary_plane_create(struct
> drm_i915_private *dev_priv, enum pipe pipe)
>  						  DRM_COLOR_YCBCR_BT
> 709,
>  						  DRM_COLOR_YCBCR_LI
> MITED_RANGE);
>  
> -	drm_plane_helper_add(&primary->base,
> &intel_plane_helper_funcs);
> +	drm_plane_helper_add(&plane->base,
> &intel_plane_helper_funcs);
>  
> -	return primary;
> +	return plane;
>  
>  fail:
> -	intel_plane_free(primary);
> +	intel_plane_free(plane);
>  
>  	return ERR_PTR(ret);
>  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-08-29  1:19 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 ` [PATCH v3 11/12] drm/i915: s/intel_plane/plane/ in sprite init Ville Syrjala
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   ` Dhinakaran Pandiyan [this message]
2018-08-29 11:55     ` [PATCH v3 " 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=9db2290b7b1f76d550d2c9a17576cba1badc8308.camel@intel.com \
    --to=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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.