Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anshuman Gupta <anshuman.gupta@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: "Cc : Jani Nikula" <jani.nikula@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/7] drm/i915: Remove (pipe == crtc->index) assumption
Date: Wed, 5 Feb 2020 13:32:54 +0530	[thread overview]
Message-ID: <20200205080254.GJ24118@intel.com> (raw)
In-Reply-To: <20200204143617.GQ13686@intel.com>

On 2020-02-04 at 16:36:17 +0200, Ville Syrjälä wrote:
> On Tue, Feb 04, 2020 at 04:59:22PM +0530, Anshuman Gupta wrote:
> > we can't have (pipe == crtc->index) assumption in
> > driver in order to support 3 non-contiguous
> > display pipe system.
> > 
> > FIXME: Remove the WARN_ON(drm_crtc_index(&crtc->base) != crtc->pipe)
> > till we won't fix all such assumption.
> > 
> > changes since RFC:
> > - Added again removed (pipe == crtc->index) WARN_ON.
> > - Pass drm_crtc_index instead of intel pipe in order to
> >   call drm_handle_vblank() from gen8_de_irq_handler(),
> >   other legacy irq handlers also calls drm_handle_vblank()
> >   with intel pipe but those doesn't require this change.
> > 
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Cc: Jani Nikula <jani.nikula@intel.com>
> > Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_display.c       | 8 ++++----
> >  drivers/gpu/drm/i915/display/intel_display_types.h | 4 +++-
> >  drivers/gpu/drm/i915/i915_irq.c                    | 8 ++++++--
> >  3 files changed, 13 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 878d331b9e8c..5709e672151a 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -14070,11 +14070,11 @@ verify_single_dpll_state(struct drm_i915_private *dev_priv,
> >  	if (new_crtc_state->hw.active)
> >  		I915_STATE_WARN(!(pll->active_mask & crtc_mask),
> >  				"pll active mismatch (expected pipe %c in active mask 0x%02x)\n",
> > -				pipe_name(drm_crtc_index(&crtc->base)), pll->active_mask);
> > +				pipe_name(crtc->pipe), pll->active_mask);
> >  	else
> >  		I915_STATE_WARN(pll->active_mask & crtc_mask,
> >  				"pll active mismatch (didn't expect pipe %c in active mask 0x%02x)\n",
> > -				pipe_name(drm_crtc_index(&crtc->base)), pll->active_mask);
> > +				pipe_name(crtc->pipe), pll->active_mask);
> >  
> >  	I915_STATE_WARN(!(pll->state.crtc_mask & crtc_mask),
> >  			"pll enabled crtcs mismatch (expected 0x%x in 0x%02x)\n",
> > @@ -14103,10 +14103,10 @@ verify_shared_dpll_state(struct intel_crtc *crtc,
> >  
> >  		I915_STATE_WARN(pll->active_mask & crtc_mask,
> >  				"pll active mismatch (didn't expect pipe %c in active mask)\n",
> > -				pipe_name(drm_crtc_index(&crtc->base)));
> > +				pipe_name(crtc->pipe));
> >  		I915_STATE_WARN(pll->state.crtc_mask & crtc_mask,
> >  				"pll enabled crtcs mismatch (found %x in enabled mask)\n",
> > -				pipe_name(drm_crtc_index(&crtc->base)));
> > +				pipe_name(crtc->pipe));
> >  	}
> >  }
> >  
> > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> > index 33ba93863488..80a6460da852 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> > @@ -1618,7 +1618,9 @@ intel_crtc_has_dp_encoder(const struct intel_crtc_state *crtc_state)
> >  static inline void
> >  intel_wait_for_vblank(struct drm_i915_private *dev_priv, enum pipe pipe)
> >  {
> > -	drm_wait_one_vblank(&dev_priv->drm, pipe);
> > +	const struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
> > +
> > +	drm_wait_one_vblank(&dev_priv->drm, drm_crtc_index(&crtc->base));
> >  }
> >  static inline void
> >  intel_wait_for_vblank_if_active(struct drm_i915_private *dev_priv, enum pipe pipe)
> > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> > index 22ecd5bc407e..9f8b2566166a 100644
> > --- a/drivers/gpu/drm/i915/i915_irq.c
> > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > @@ -2311,6 +2311,8 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl)
> >  
> >  	for_each_pipe(dev_priv, pipe) {
> >  		u32 fault_errors;
> > +		struct intel_crtc *crtc =
> > +			intel_get_crtc_for_pipe(dev_priv, pipe);
> >  
> >  		if (!(master_ctl & GEN8_DE_PIPE_IRQ(pipe)))
> >  			continue;
> > @@ -2324,8 +2326,10 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl)
> >  		ret = IRQ_HANDLED;
> >  		I915_WRITE(GEN8_DE_PIPE_IIR(pipe), iir);
> >  
> > -		if (iir & GEN8_PIPE_VBLANK)
> > -			drm_handle_vblank(&dev_priv->drm, pipe);
> > +		if (iir & GEN8_PIPE_VBLANK) {
> > +			drm_handle_vblank(&dev_priv->drm,
> > +					  drm_crtc_index(&crtc->base));
> 
> Missed all the other places.
All other places were legcay handlers so i thought we don't require this change,
is it require do this change all places to keep same pattern.
Please correct me if i am wrong here.
> 
> Please just add intel_handle_vblank() which wraps the
> intel_get_crtc_for_pipe()+drm_handle_vblank().
jani has suggested to use drm_crtc_handle_vblank(), i think 
that would be simpler to replace it at all places instead of
intel_handle_vblank(), what is your opinion on that ?
Thanks,
Anshuman Gupta.
> 
> > +		}
> >  
> >  		if (iir & GEN8_PIPE_CDCLK_CRC_DONE)
> >  			hsw_pipe_crc_irq_handler(dev_priv, pipe);
> > -- 
> > 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-05  8:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 11:29 [Intel-gfx] [PATCH 0/7] 3 display pipes combination system support Anshuman Gupta
2020-02-04 11:29 ` [Intel-gfx] [PATCH 1/7] drm/i915: Iterate over pipe and skip the disabled one Anshuman Gupta
2020-02-04 11:29 ` [Intel-gfx] [PATCH 2/7] drm/i915: Remove (pipe == crtc->index) assumption Anshuman Gupta
2020-02-04 11:52   ` Jani Nikula
2020-02-04 14:36   ` Ville Syrjälä
2020-02-05  8:02     ` Anshuman Gupta [this message]
2020-02-05 11:07       ` Ville Syrjälä
2020-02-04 11:29 ` [Intel-gfx] [PATCH 3/7] drm/i915: Fix broken transcoder err state Anshuman Gupta
2020-02-04 14:28   ` Ville Syrjälä
2020-02-04 16:37     ` Jani Nikula
2020-02-06 10:23       ` Anshuman Gupta
2020-02-04 11:29 ` [Intel-gfx] [PATCH 4/7] drm/i915: Fix wrongly populated plane possible_crtcs bit mask Anshuman Gupta
2020-02-04 14:30   ` Ville Syrjälä
2020-02-04 16:44     ` Ville Syrjälä
2020-02-06 10:15       ` Anshuman Gupta
2020-02-04 11:29 ` [Intel-gfx] [PATCH 5/7] drm/i915: Get right max plane stride Anshuman Gupta
2020-02-04 14:30   ` Ville Syrjälä
2020-02-04 11:29 ` [Intel-gfx] [PATCH 6/7] drm/i915: Add WARN_ON in intel_get_crtc_for_pipe() Anshuman Gupta
2020-02-04 11:29 ` [Intel-gfx] [PATCH 7/7] drm/i915: Enable 3 display pipes support Anshuman Gupta
2020-02-04 14:35   ` Ville Syrjälä
2020-02-05  1:36 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for 3 display pipes combination system support (rev2) 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=20200205080254.GJ24118@intel.com \
    --to=anshuman.gupta@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox