From: Daniel Vetter <daniel@ffwll.ch>
To: Nick Hoath <nicholas.hoath@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH 2/6] drm/i915: Break out common code from gen8_gt_irq_handler
Date: Tue, 20 Oct 2015 14:12:21 +0200 [thread overview]
Message-ID: <20151020121221.GX13786@phenom.ffwll.local> (raw)
In-Reply-To: <1445333036-22164-3-git-send-email-nicholas.hoath@intel.com>
On Tue, Oct 20, 2015 at 10:23:52AM +0100, Nick Hoath wrote:
> Break out common code from gen8_gt_irq_handler and put it in to
> an always inlined function. gcc optimises out the shift at compile
> time. (Thomas Daniel/Daniel Vetter/Chris Wilson)
>
> Issue: VIZ-4277
> Signed-off-by: Nick Hoath <nicholas.hoath@intel.com>
> Cc: Thomas Daniel <thomas.daniel@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
Merged the first two patches to dinq, thanks.
-Daniel
> ---
> drivers/gpu/drm/i915/i915_irq.c | 40 ++++++++++++++++++++--------------------
> 1 file changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index fbf9153..7837f5e 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1290,6 +1290,16 @@ static void snb_gt_irq_handler(struct drm_device *dev,
> ivybridge_parity_error_irq_handler(dev, gt_iir);
> }
>
> +static __always_inline void
> + gen8_cs_irq_handler(struct intel_engine_cs *ring, u32 iir,
> + int test_shift)
> +{
> + if (iir & (GT_RENDER_USER_INTERRUPT << test_shift))
> + notify_ring(ring);
> + if (iir & (GT_CONTEXT_SWITCH_INTERRUPT << test_shift))
> + intel_lrc_irq_handler(ring);
> +}
> +
> static irqreturn_t gen8_gt_irq_handler(struct drm_i915_private *dev_priv,
> u32 master_ctl)
> {
> @@ -1301,15 +1311,11 @@ static irqreturn_t gen8_gt_irq_handler(struct drm_i915_private *dev_priv,
> I915_WRITE_FW(GEN8_GT_IIR(0), iir);
> ret = IRQ_HANDLED;
>
> - if (iir & (GT_CONTEXT_SWITCH_INTERRUPT << GEN8_RCS_IRQ_SHIFT))
> - intel_lrc_irq_handler(&dev_priv->ring[RCS]);
> - if (iir & (GT_RENDER_USER_INTERRUPT << GEN8_RCS_IRQ_SHIFT))
> - notify_ring(&dev_priv->ring[RCS]);
> + gen8_cs_irq_handler(&dev_priv->ring[RCS],
> + iir, GEN8_RCS_IRQ_SHIFT);
>
> - if (iir & (GT_CONTEXT_SWITCH_INTERRUPT << GEN8_BCS_IRQ_SHIFT))
> - intel_lrc_irq_handler(&dev_priv->ring[BCS]);
> - if (iir & (GT_RENDER_USER_INTERRUPT << GEN8_BCS_IRQ_SHIFT))
> - notify_ring(&dev_priv->ring[BCS]);
> + gen8_cs_irq_handler(&dev_priv->ring[BCS],
> + iir, GEN8_BCS_IRQ_SHIFT);
> } else
> DRM_ERROR("The master control interrupt lied (GT0)!\n");
> }
> @@ -1320,15 +1326,11 @@ static irqreturn_t gen8_gt_irq_handler(struct drm_i915_private *dev_priv,
> I915_WRITE_FW(GEN8_GT_IIR(1), iir);
> ret = IRQ_HANDLED;
>
> - if (iir & (GT_CONTEXT_SWITCH_INTERRUPT << GEN8_VCS1_IRQ_SHIFT))
> - intel_lrc_irq_handler(&dev_priv->ring[VCS]);
> - if (iir & (GT_RENDER_USER_INTERRUPT << GEN8_VCS1_IRQ_SHIFT))
> - notify_ring(&dev_priv->ring[VCS]);
> + gen8_cs_irq_handler(&dev_priv->ring[VCS],
> + iir, GEN8_VCS1_IRQ_SHIFT);
>
> - if (iir & (GT_CONTEXT_SWITCH_INTERRUPT << GEN8_VCS2_IRQ_SHIFT))
> - intel_lrc_irq_handler(&dev_priv->ring[VCS2]);
> - if (iir & (GT_RENDER_USER_INTERRUPT << GEN8_VCS2_IRQ_SHIFT))
> - notify_ring(&dev_priv->ring[VCS2]);
> + gen8_cs_irq_handler(&dev_priv->ring[VCS2],
> + iir, GEN8_VCS2_IRQ_SHIFT);
> } else
> DRM_ERROR("The master control interrupt lied (GT1)!\n");
> }
> @@ -1339,10 +1341,8 @@ static irqreturn_t gen8_gt_irq_handler(struct drm_i915_private *dev_priv,
> I915_WRITE_FW(GEN8_GT_IIR(3), iir);
> ret = IRQ_HANDLED;
>
> - if (iir & (GT_CONTEXT_SWITCH_INTERRUPT << GEN8_VECS_IRQ_SHIFT))
> - intel_lrc_irq_handler(&dev_priv->ring[VECS]);
> - if (iir & (GT_RENDER_USER_INTERRUPT << GEN8_VECS_IRQ_SHIFT))
> - notify_ring(&dev_priv->ring[VECS]);
> + gen8_cs_irq_handler(&dev_priv->ring[VECS],
> + iir, GEN8_VECS_IRQ_SHIFT);
> } else
> DRM_ERROR("The master control interrupt lied (GT3)!\n");
> }
> --
> 1.9.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-10-20 12:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 9:23 [PATCH 0/6] lrc lifecycle cleanups Nick Hoath
2015-10-20 9:23 ` [PATCH 1/6] drm/i195: Rename gt_irq_handler variable Nick Hoath
2015-10-20 9:23 ` [PATCH 2/6] drm/i915: Break out common code from gen8_gt_irq_handler Nick Hoath
2015-10-20 12:12 ` Daniel Vetter [this message]
2015-10-20 12:40 ` Chris Wilson
2015-10-20 9:23 ` [PATCH 3/6] drm/i915: Unify execlist and legacy request life-cycles Nick Hoath
2015-10-20 9:53 ` Chris Wilson
2015-10-20 9:23 ` [PATCH 4/6] drm/i915: Improve dynamic management/eviction of lrc backing objects Nick Hoath
2015-10-20 9:54 ` Chris Wilson
2015-10-20 10:14 ` kbuild test robot
2015-10-20 9:23 ` [PATCH 5/6] drm/i915: Add the CPU mapping of the hw context to the pinned items Nick Hoath
2015-10-20 9:56 ` Chris Wilson
2015-10-20 9:23 ` [PATCH 6/6] drm/i915: Only update ringbuf address when necessary Nick Hoath
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=20151020121221.GX13786@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=nicholas.hoath@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