All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: jani.nikula@intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v4 4/7] drm/i915: Fix wrongly populated plane possible_crtcs bit mask
Date: Fri, 28 Feb 2020 15:50:14 +0200	[thread overview]
Message-ID: <20200228135014.GD13686@intel.com> (raw)
In-Reply-To: <20200226163517.31234-1-anshuman.gupta@intel.com>

On Wed, Feb 26, 2020 at 10:05:17PM +0530, Anshuman Gupta wrote:
> As a disabled pipe in pipe_mask is not having a valid intel crtc,
> driver wrongly populates the possible_crtcs mask while initializing
> the plane for a CRTC. Fixing up the plane possible_crtcs mask.
> 
> changes since RFC:
> - Simplify the possible_crtcs initialization. [Ville]
> v2:
> - Removed the unnecessary stack garbage possible_crtcs to
>   drm_universal_plane_init. [Ville]
> v3:
> - Combine the intel_crtc assignment and declaration. [Ville]
> v4:
> - Fix possible_crtcs abused bits from
>   intel_{primary,curosr,sprite}_plane_create(). [Ville]
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>

Thanks. Pushed to dinq.

> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 25 +++++++++++++-------
>  drivers/gpu/drm/i915/display/intel_sprite.c  | 10 ++------
>  2 files changed, 18 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index aacbdc47fcea..071fda408116 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -16329,7 +16329,6 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
>  	struct intel_plane *plane;
>  	const struct drm_plane_funcs *plane_funcs;
>  	unsigned int supported_rotations;
> -	unsigned int possible_crtcs;
>  	const u32 *formats;
>  	int num_formats;
>  	int ret, zpos;
> @@ -16410,18 +16409,16 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
>  	plane->get_hw_state = i9xx_plane_get_hw_state;
>  	plane->check_plane = i9xx_plane_check;
>  
> -	possible_crtcs = BIT(pipe);
> -
>  	if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
>  		ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
> -					       possible_crtcs, plane_funcs,
> +					       0, plane_funcs,
>  					       formats, num_formats,
>  					       i9xx_format_modifiers,
>  					       DRM_PLANE_TYPE_PRIMARY,
>  					       "primary %c", pipe_name(pipe));
>  	else
>  		ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
> -					       possible_crtcs, plane_funcs,
> +					       0, plane_funcs,
>  					       formats, num_formats,
>  					       i9xx_format_modifiers,
>  					       DRM_PLANE_TYPE_PRIMARY,
> @@ -16463,7 +16460,6 @@ static struct intel_plane *
>  intel_cursor_plane_create(struct drm_i915_private *dev_priv,
>  			  enum pipe pipe)
>  {
> -	unsigned int possible_crtcs;
>  	struct intel_plane *cursor;
>  	int ret, zpos;
>  
> @@ -16496,10 +16492,8 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
>  	if (IS_I845G(dev_priv) || IS_I865G(dev_priv) || HAS_CUR_FBC(dev_priv))
>  		cursor->cursor.size = ~0;
>  
> -	possible_crtcs = BIT(pipe);
> -
>  	ret = drm_universal_plane_init(&dev_priv->drm, &cursor->base,
> -				       possible_crtcs, &intel_cursor_plane_funcs,
> +				       0, &intel_cursor_plane_funcs,
>  				       intel_cursor_formats,
>  				       ARRAY_SIZE(intel_cursor_formats),
>  				       cursor_format_modifiers,
> @@ -16628,6 +16622,18 @@ static void intel_crtc_free(struct intel_crtc *crtc)
>  	kfree(crtc);
>  }
>  
> +static void intel_plane_possible_crtcs_init(struct drm_i915_private *dev_priv)
> +{
> +	struct intel_plane *plane;
> +
> +	for_each_intel_plane(&dev_priv->drm, plane) {
> +		struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv,
> +								  plane->pipe);
> +
> +		plane->base.possible_crtcs = drm_crtc_mask(&crtc->base);
> +	}
> +}
> +
>  static int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
>  {
>  	struct intel_plane *primary, *cursor;
> @@ -17843,6 +17849,7 @@ int intel_modeset_init(struct drm_i915_private *i915)
>  		}
>  	}
>  
> +	intel_plane_possible_crtcs_init(i915);
>  	intel_shared_dpll_init(dev);
>  	intel_update_fdi_pll_freq(i915);
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> index 7abeefe8dce5..53bb65666587 100644
> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> @@ -3011,7 +3011,6 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
>  	struct intel_plane *plane;
>  	enum drm_plane_type plane_type;
>  	unsigned int supported_rotations;
> -	unsigned int possible_crtcs;
>  	const u64 *modifiers;
>  	const u32 *formats;
>  	int num_formats;
> @@ -3066,10 +3065,8 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
>  	else
>  		plane_type = DRM_PLANE_TYPE_OVERLAY;
>  
> -	possible_crtcs = BIT(pipe);
> -
>  	ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
> -				       possible_crtcs, plane_funcs,
> +				       0, plane_funcs,
>  				       formats, num_formats, modifiers,
>  				       plane_type,
>  				       "plane %d%c", plane_id + 1,
> @@ -3120,7 +3117,6 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
>  {
>  	struct intel_plane *plane;
>  	const struct drm_plane_funcs *plane_funcs;
> -	unsigned long possible_crtcs;
>  	unsigned int supported_rotations;
>  	const u64 *modifiers;
>  	const u32 *formats;
> @@ -3205,10 +3201,8 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
>  	plane->id = PLANE_SPRITE0 + sprite;
>  	plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
>  
> -	possible_crtcs = BIT(pipe);
> -
>  	ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
> -				       possible_crtcs, plane_funcs,
> +				       0, plane_funcs,
>  				       formats, num_formats, modifiers,
>  				       DRM_PLANE_TYPE_OVERLAY,
>  				       "sprite %c", sprite_name(pipe, sprite));
> -- 
> 2.24.0

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

  reply	other threads:[~2020-02-28 13:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 12:39 [Intel-gfx] [PATCH v3 0/7] 3 display pipes combination system support Anshuman Gupta
2020-02-24 12:39 ` [Intel-gfx] [PATCH v3 1/7] drm/i915: Iterate over pipes and skip the disabled one Anshuman Gupta
2020-02-24 12:39 ` [Intel-gfx] [PATCH v3 2/7] drm/i915: Remove (pipe == crtc->index) assumption Anshuman Gupta
2020-02-24 12:40 ` [Intel-gfx] [PATCH v3 3/7] drm/i915: Fix broken transcoder err state Anshuman Gupta
2020-02-24 12:40 ` [Intel-gfx] [PATCH v3 4/7] drm/i915: Fix wrongly populated plane possible_crtcs bit mask Anshuman Gupta
2020-02-25 15:06   ` Ville Syrjälä
2020-02-26 15:09     ` Ville Syrjälä
2020-02-26 15:24       ` Anshuman Gupta
2020-02-26 17:27         ` Ville Syrjälä
2020-02-26 16:35   ` [Intel-gfx] [PATCH v4 " Anshuman Gupta
2020-02-28 13:50     ` Ville Syrjälä [this message]
2020-02-24 12:40 ` [Intel-gfx] [PATCH v3 5/7] drm/i915: Get first crtc instead of PIPE_A crtc Anshuman Gupta
2020-02-24 12:40 ` [Intel-gfx] [PATCH v3 6/7] drm/i915: Add WARN_ON in intel_get_crtc_for_pipe() Anshuman Gupta
2020-02-24 12:40 ` [Intel-gfx] [PATCH v3 7/7] drm/i915: Fix broken num_entries in skl_ddb_allocation_overlaps Anshuman Gupta
2020-02-24 17:05 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for 3 display pipes combination system support (rev4) Patchwork
2020-02-24 17:31 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-02-26  0:26 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-02-27  2:09 ` [Intel-gfx] ✓ Fi.CI.BAT: success for 3 display pipes combination system support (rev5) Patchwork
2020-02-27 19:45 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=20200228135014.GD13686@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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.