All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Souza, Jose" <jose.souza@intel.com>,
	Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
Subject: Re: [PATCH v2 1/3] drm/i915/bdw+: Move misc display IRQ handling to it own function
Date: Fri, 12 Apr 2019 15:53:57 -0700	[thread overview]
Message-ID: <20190412225357.GG19065@intel.com> (raw)
In-Reply-To: <a79c9f1cbf0605bcb755a046a2dcdbbf8a64535f.camel@intel.com>

On Fri, Apr 12, 2019 at 10:45:16PM +0000, Souza, Jose wrote:
> On Fri, 2019-04-12 at 15:40 -0700, Rodrigo Vivi wrote:
> > On Fri, Apr 12, 2019 at 03:29:07PM -0700, José Roberto de Souza
> > wrote:
> > > Just moving it to reduce the tabs and avoid break code lines.
> > > No behavior changes intended here.
> > 
> > this function is indeed big and deserves a split.
> > I wonder why haven't you moved the entire de_misc block to a
> > separated
> > function instead only the middle of the handling...
> > 
> > i mean, including reg read above and error message below.
> 
> It was reading and writing GEN8_DE_MISC_IIR inside of
> gen8_de_misc_irq_handler() but to keep consistent with the other
> handlers Dhinakaran suggested this change.

oh, I think I prefer your v1 instead... and for consistency we
change the rest later hehe

but I won't block... we need to start to clean-up this function
from somewhere...

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(preferred for v1, but feel free to use on this)

I hope this doesn't conflict with the reworks around irc Paulo is doing.
his patches is on my todo list for review.

Cc: Paulo

> 
> > 
> > > v2:
> > > - Reading misc display IRQ outside of gen8_de_misc_irq_handler() as
> > > other irq handlers (Dhinakaran)
> > > 
> > > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_irq.c | 45 ++++++++++++++++++-----------
> > > ----
> > >  1 file changed, 25 insertions(+), 20 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_irq.c
> > > b/drivers/gpu/drm/i915/i915_irq.c
> > > index d934545445e1..820d89300454 100644
> > > --- a/drivers/gpu/drm/i915/i915_irq.c
> > > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > > @@ -2740,6 +2740,28 @@ static u32 gen8_de_port_aux_mask(struct
> > > drm_i915_private *dev_priv)
> > >  	return mask;
> > >  }
> > >  
> > > +static void
> > > +gen8_de_misc_irq_handler(struct drm_i915_private *dev_priv, u32
> > > iir)
> > > +{
> > > +	bool found = false;
> > > +
> > > +	if (iir & GEN8_DE_MISC_GSE) {
> > > +		intel_opregion_asle_intr(dev_priv);
> > > +		found = true;
> > > +	}
> > > +
> > > +	if (iir & GEN8_DE_EDP_PSR) {
> > > +		u32 psr_iir = I915_READ(EDP_PSR_IIR);
> > > +
> > > +		intel_psr_irq_handler(dev_priv, psr_iir);
> > > +		I915_WRITE(EDP_PSR_IIR, psr_iir);
> > > +		found = true;
> > > +	}
> > > +
> > > +	if (!found)
> > > +		DRM_ERROR("Unexpected DE Misc interrupt\n");
> > > +}
> > > +
> > >  static irqreturn_t
> > >  gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32
> > > master_ctl)
> > >  {
> > > @@ -2750,29 +2772,12 @@ gen8_de_irq_handler(struct drm_i915_private
> > > *dev_priv, u32 master_ctl)
> > >  	if (master_ctl & GEN8_DE_MISC_IRQ) {
> > >  		iir = I915_READ(GEN8_DE_MISC_IIR);
> > >  		if (iir) {
> > > -			bool found = false;
> > > -
> > >  			I915_WRITE(GEN8_DE_MISC_IIR, iir);
> > >  			ret = IRQ_HANDLED;
> > > -
> > > -			if (iir & GEN8_DE_MISC_GSE) {
> > > -				intel_opregion_asle_intr(dev_priv);
> > > -				found = true;
> > > -			}
> > > -
> > > -			if (iir & GEN8_DE_EDP_PSR) {
> > > -				u32 psr_iir = I915_READ(EDP_PSR_IIR);
> > > -
> > > -				intel_psr_irq_handler(dev_priv,
> > > psr_iir);
> > > -				I915_WRITE(EDP_PSR_IIR, psr_iir);
> > > -				found = true;
> > > -			}
> > > -
> > > -			if (!found)
> > > -				DRM_ERROR("Unexpected DE Misc
> > > interrupt\n");
> > > -		}
> > > -		else
> > > +			gen8_de_misc_irq_handler(dev_priv, iir);
> > > +		} else {
> > >  			DRM_ERROR("The master control interrupt lied
> > > (DE MISC)!\n");
> > > +		}
> > >  	}
> > >  
> > >  	if (INTEL_GEN(dev_priv) >= 11 && (master_ctl &
> > > GEN11_DE_HPD_IRQ)) {
> > > -- 
> > > 2.21.0
> > > 
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx



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

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

  reply	other threads:[~2019-04-12 22:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 22:29 [PATCH v2 1/3] drm/i915/bdw+: Move misc display IRQ handling to it own function José Roberto de Souza
2019-04-12 22:29 ` [PATCH v2 2/3] drm/i915/psr: Remove partial PSR support on multiple transcoders José Roberto de Souza
2019-04-12 22:42   ` Rodrigo Vivi
2019-04-12 22:29 ` [PATCH v2 3/3] drm/i915: Make PSR registers relative to transcoders José Roberto de Souza
2019-04-12 22:45   ` Rodrigo Vivi
2019-04-12 22:40 ` [PATCH v2 1/3] drm/i915/bdw+: Move misc display IRQ handling to it own function Rodrigo Vivi
2019-04-12 22:45   ` Souza, Jose
2019-04-12 22:53     ` Rodrigo Vivi [this message]
2019-04-12 23:24 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [v2,1/3] " Patchwork
2019-04-12 23:26 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-04-12 23:53 ` ✗ Fi.CI.BAT: failure " 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=20190412225357.GG19065@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jose.souza@intel.com \
    --cc=paulo.r.zanoni@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.