[Intel-gfx] [PATCH 06/10] drm/i915/icl: Mark TC port as safe when interruptions are disabled

Ville Syrjälä ville.syrjala at linux.intel.com
Wed Oct 10 17:15:45 UTC 2018


On Wed, Oct 10, 2018 at 12:55:07AM +0000, Souza, Jose wrote:
> On Tue, 2018-10-02 at 23:35 +0300, Ville Syrjälä wrote:
> > On Tue, Oct 02, 2018 at 10:50:50AM -0700, José Roberto de Souza
> > wrote:
> > > Before enter in power saving states or before unload the driver
> > > spec states that display driver is required to to mark TC ports as
> > > safe so hardware can do the disconnection flow without wait for
> > > display driver handshake.
> > > When driver is resumed or loaded again, if the TC live state is
> > > still set as connected driver will mark again TC port as not safe
> > > as
> > > required by spec.
> > > 
> > > BSpec: 2175
> > > 
> > > Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
> > > Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_irq.c | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_irq.c
> > > b/drivers/gpu/drm/i915/i915_irq.c
> > > index 2e242270e270..58616690f45f 100644
> > > --- a/drivers/gpu/drm/i915/i915_irq.c
> > > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > > @@ -3640,6 +3640,7 @@ static void gen11_irq_reset(struct drm_device
> > > *dev)
> > >  {
> > >  	struct drm_i915_private *dev_priv = dev->dev_private;
> > >  	int pipe;
> > > +	u32 val;
> > >  
> > >  	I915_WRITE(GEN11_GFX_MSTR_IRQ, 0);
> > >  	POSTING_READ(GEN11_GFX_MSTR_IRQ);
> > > @@ -3661,6 +3662,15 @@ static void gen11_irq_reset(struct
> > > drm_device *dev)
> > >  
> > >  	if (HAS_PCH_ICP(dev_priv))
> > >  		GEN3_IRQ_RESET(SDE);
> > > +
> > > +	/*
> > > +	 * Mark TC ports as safe so hardware can do the disconnect flow
> > > without
> > > +	 * wait for driver to do the handshake
> > > +	 */
> > > +	val = I915_READ(PORT_TX_DFLEXDPCSSS);
> > > +	for (pipe = 0; pipe < 4; pipe++)
> > > +		val &= ~(DP_PHY_MODE_STATUS_NOT_SAFE(pipe));
> > > +	I915_WRITE(PORT_TX_DFLEXDPCSSS, val);
> > 
> > Why would we have to do this here? The driver should relinquish
> > control
> > if and when it has shut down the pipes etc. Sounds like a bug if
> > we're
> > hanging on when we have no need for the port.
> 
> Right now we take control and only release it when port is
> disconnected.

Disconnection is totally asynchronous. Someone could be using the
port/aux for anything when the disconnect irq happens. Presumably
bad things will happen if we just go and yank the control away
when someone is doing stuff. I believe even the spec tells us
to properly shut things down during the disconnect flow and make
sure eg. the aux power wells have been fully shut down before
relinquishing control.

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list