From: Ben Widawsky <ben@bwidawsk.net>
To: Intel GFX <intel-gfx@lists.freedesktop.org>
Cc: Ben Widawsky <ben@bwidawsk.net>
Subject: [PATCH 15/18] [v3] drm/i915: Enable vebox interrupts
Date: Tue, 28 May 2013 19:22:31 -0700 [thread overview]
Message-ID: <1369794154-1639-16-git-send-email-ben@bwidawsk.net> (raw)
In-Reply-To: <1369794154-1639-1-git-send-email-ben@bwidawsk.net>
Similar to a patch originally written by:
v2: Reversed the meanings of masked and enabled (Haihao)
Made non-destructive writes in case enable/disabler rps runs first
(Haihao)
v3: Reword error message (Damien)
Modify postinstall to do the right thing based on previous fixup. (Ben)
CC: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
drivers/gpu/drm/i915/i915_irq.c | 31 +++++++++++++++++++++++++------
drivers/gpu/drm/i915/i915_reg.h | 3 +++
drivers/gpu/drm/i915/intel_ringbuffer.c | 3 ++-
3 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 4f7a12f..560465d 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -944,8 +944,15 @@ static void hsw_pm_irq_handler(struct drm_i915_private *dev_priv,
}
spin_unlock_irqrestore(&dev_priv->rps.lock, flags);
- if (pm_iir & ~GEN6_PM_RPS_EVENTS)
- DRM_ERROR("Unexpected PM interrupted\n");
+ if (pm_iir & ~GEN6_PM_RPS_EVENTS) {
+ if (pm_iir & PM_VEBOX_USER_INTERRUPT)
+ notify_ring(dev_priv->dev, &dev_priv->ring[VECS]);
+
+ if (pm_iir & PM_VEBOX_CS_ERROR_INTERRUPT) {
+ DRM_ERROR("VEBOX CS error interrupt 0x%08x\n", pm_iir);
+ i915_handle_error(dev_priv->dev, false);
+ }
+ }
}
static irqreturn_t valleyview_irq_handler(int irq, void *arg)
@@ -2690,6 +2697,7 @@ static int ivybridge_irq_postinstall(struct drm_device *dev)
DE_PLANEA_FLIP_DONE_IVB |
DE_AUX_CHANNEL_A_IVB |
DE_ERR_INT_IVB;
+ u32 pm_irqs = GEN6_PM_RPS_EVENTS;
u32 gt_irqs;
dev_priv->irq_mask = ~display_mask;
@@ -2715,10 +2723,21 @@ static int ivybridge_irq_postinstall(struct drm_device *dev)
I915_WRITE(GTIER, gt_irqs);
POSTING_READ(GTIER);
- /* Power management */
- I915_WRITE(GEN6_PMIMR, ~GEN6_PM_RPS_EVENTS);
- I915_WRITE(GEN6_PMIER, GEN6_PM_RPS_EVENTS);
- POSTING_READ(GEN6_PMIMR);
+ I915_WRITE(GEN6_PMIIR, I915_READ(GEN6_PMIIR));
+ if (HAS_VEBOX(dev))
+ pm_irqs |= PM_VEBOX_USER_INTERRUPT |
+ PM_VEBOX_CS_ERROR_INTERRUPT;
+
+ /* Our enable/disable rps functions may touch these registers so
+ * make sure to set a known state for only the non-RPS bits.
+ * The RMW is extra paranoia since this should be called after being set
+ * to a known state in preinstall.
+ * */
+ I915_WRITE(GEN6_PMIMR,
+ (I915_READ(GEN6_PMIMR) | ~GEN6_PM_RPS_EVENTS) & ~pm_irqs);
+ I915_WRITE(GEN6_PMIER,
+ (I915_READ(GEN6_PMIER) & GEN6_PM_RPS_EVENTS) | pm_irqs);
+ POSTING_READ(GEN6_PMIER);
ibx_irq_postinstall(dev);
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index b740f0d..73348ba 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -886,6 +886,9 @@
#define GT_RENDER_DEBUG_INTERRUPT (1 << 1)
#define GT_RENDER_USER_INTERRUPT (1 << 0)
+#define PM_VEBOX_CS_ERROR_INTERRUPT (1 << 12) /* hsw+ */
+#define PM_VEBOX_USER_INTERRUPT (1 << 10) /* hsw+ */
+
/* These are all the "old" interrupts */
#define ILK_BSD_USER_INTERRUPT (1<<5)
#define I915_PIPE_CONTROL_NOTIFY_INTERRUPT (1<<18)
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 8a6a0ee..0e72da6 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1969,7 +1969,8 @@ int intel_init_vebox_ring_buffer(struct drm_device *dev)
ring->add_request = gen6_add_request;
ring->get_seqno = gen6_ring_get_seqno;
ring->set_seqno = ring_set_seqno;
- ring->irq_enable_mask = 0;
+ ring->irq_enable_mask = PM_VEBOX_USER_INTERRUPT |
+ PM_VEBOX_CS_ERROR_INTERRUPT;
ring->irq_get = hsw_vebox_get_irq;
ring->irq_put = hsw_vebox_put_irq;
ring->dispatch_execbuffer = gen6_ring_dispatch_execbuffer;
--
1.8.3
next prev parent reply other threads:[~2013-05-29 2:21 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-28 0:59 [PATCH 00/18] Introduce the Haswell VECS Ben Widawsky
2013-04-28 0:59 ` [PATCH 01/18] drm/i915: Comments for semaphore clarification Ben Widawsky
2013-05-07 13:54 ` Damien Lespiau
2013-05-07 16:51 ` Ben Widawsky
2013-05-07 17:00 ` Ben Widawsky
2013-04-28 0:59 ` [PATCH 02/18] drm/i915: Semaphore MBOX update generalization Ben Widawsky
2013-05-07 15:34 ` Damien Lespiau
2013-05-08 5:17 ` Ben Widawsky
2013-04-28 0:59 ` [PATCH 03/18] drm/i915: Introduce VECS: the 4th ring Ben Widawsky
2013-05-07 15:35 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 04/18] drm/i915: Add VECS semaphore bits Ben Widawsky
2013-05-07 14:49 ` Damien Lespiau
2013-05-08 5:59 ` Ben Widawsky
2013-04-28 0:59 ` [PATCH 05/18] drm/i915: Rename ring flush functions Ben Widawsky
2013-05-07 17:28 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 06/18] drm/i915: add HAS_VEBOX Ben Widawsky
2013-05-07 14:59 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 07/18] drm/i915: Vebox ringbuffer init Ben Widawsky
2013-05-07 17:16 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 08/18] drm/i915: Create a more generic pm handler for hsw+ Ben Widawsky
2013-05-28 13:00 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 09/18] drm/i915: make PM interrupt writes non-destructive Ben Widawsky
2013-05-28 13:30 ` Damien Lespiau
2013-05-28 18:02 ` Ben Widawsky
2013-04-28 0:59 ` [PATCH 10/18] drm/i915: Create an ivybridge_irq_preinstall Ben Widawsky
2013-05-28 13:37 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 11/18] drm/i915: Add PM regs to pre install Ben Widawsky
2013-05-28 13:38 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 12/18] drm/i915: Convert irq_refounct to struct Ben Widawsky
2013-05-28 13:40 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 13/18] drm/i915: consolidate interrupt naming scheme Ben Widawsky
2013-05-28 14:01 ` Damien Lespiau
2013-05-28 18:50 ` Ben Widawsky
2013-05-29 15:51 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 14/18] drm/i915: vebox interrupt get/put Ben Widawsky
2013-05-28 14:38 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 15/18] drm/i915: Enable vebox interrupts Ben Widawsky
2013-05-28 14:52 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 16/18] drm/i915: add VEBOX into debugfs Ben Widawsky
2013-05-28 15:06 ` Damien Lespiau
2013-05-28 18:44 ` Ben Widawsky
2013-04-28 0:59 ` [PATCH 17/18] drm/i915: add I915_EXEC_VEBOX to i915_gem_do_execbuffer() Ben Widawsky
2013-05-28 15:08 ` Damien Lespiau
2013-04-28 0:59 ` [PATCH 18/18] drm/i915: add I915_PARAM_HAS_VEBOX to i915_getparam Ben Widawsky
2013-05-28 15:10 ` Damien Lespiau
2013-04-30 21:25 ` [PATCH 00/18] Introduce the Haswell VECS Jesse Barnes
2013-05-08 6:13 ` Ben Widawsky
2013-05-09 9:07 ` Li, Zhong
2013-05-29 2:22 ` [PATCH 00/18] Introduce the Haswell VECS v2 Ben Widawsky
2013-05-29 2:22 ` [PATCH 01/18] [v2] drm/i915: Comments for semaphore clarification Ben Widawsky
2013-05-29 16:02 ` Damien Lespiau
2013-05-29 2:22 ` [PATCH 02/18] drm/i915: Semaphore MBOX update generalization Ben Widawsky
2013-05-29 16:05 ` Damien Lespiau
2013-05-29 2:22 ` [PATCH 03/18] drm/i915: Introduce VECS: the 4th ring Ben Widawsky
2013-05-29 19:10 ` Daniel Vetter
2013-05-29 2:22 ` [PATCH 04/18] [v2] drm/i915: Add VECS semaphore bits Ben Widawsky
2013-05-29 16:06 ` Damien Lespiau
2013-05-29 2:22 ` [PATCH 05/18] drm/i915: Rename ring flush functions Ben Widawsky
2013-05-29 2:22 ` [PATCH 06/18] drm/i915: add HAS_VEBOX Ben Widawsky
2013-05-29 2:22 ` [PATCH 07/18] [v2] drm/i915: Vebox ringbuffer init Ben Widawsky
2013-05-29 2:22 ` [PATCH 08/18] drm/i915: Create a more generic pm handler for hsw+ Ben Widawsky
2013-05-29 19:19 ` Daniel Vetter
2013-05-31 18:25 ` Daniel Vetter
2013-05-29 2:22 ` [PATCH 09/18] [v2] drm/i915: Create an ivybridge_irq_preinstall Ben Widawsky
2013-05-29 16:23 ` Damien Lespiau
2013-05-29 19:48 ` Daniel Vetter
2013-05-29 2:22 ` [PATCH 10/18] [v2] drm/i915: Add PM regs to pre/post install Ben Widawsky
2013-05-29 17:04 ` Damien Lespiau
2013-05-29 2:22 ` [PATCH 11/18] [v5] drm/i915: make PM interrupt writes non-destructive Ben Widawsky
2013-05-29 17:02 ` Damien Lespiau
2013-05-29 2:22 ` [PATCH 12/18] drm/i915: Convert irq_refounct to struct Ben Widawsky
2013-05-29 2:22 ` [PATCH 13/18] [v2] drm/i915: consolidate interrupt naming scheme Ben Widawsky
2013-05-29 2:22 ` [PATCH 14/18] [v2] drm/i915: vebox interrupt get/put Ben Widawsky
2013-05-29 2:22 ` Ben Widawsky [this message]
2013-05-29 2:22 ` [PATCH 16/18] [v2] drm/i915: add VEBOX into debugfs Ben Widawsky
2013-05-29 16:22 ` [PATCH 16/18] [v3] " Ben Widawsky
2013-05-29 16:44 ` Damien Lespiau
2013-05-29 2:22 ` [PATCH 17/18] drm/i915: add I915_EXEC_VEBOX to i915_gem_do_execbuffer() Ben Widawsky
2013-05-29 2:22 ` [PATCH 18/18] drm/i915: add I915_PARAM_HAS_VEBOX to i915_getparam Ben Widawsky
2013-05-31 18:52 ` Daniel Vetter
2013-05-31 19:52 ` Ben Widawsky
2013-05-31 20:08 ` Daniel Vetter
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=1369794154-1639-16-git-send-email-ben@bwidawsk.net \
--to=ben@bwidawsk.net \
--cc=intel-gfx@lists.freedesktop.org \
/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