All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: paulo.r.zanoni@intel.com
Subject: [Intel-gfx] [RFC 1/7] drm/i915: Define flip done functions and enable IER
Date: Fri,  6 Mar 2020 17:09:21 +0530	[thread overview]
Message-ID: <20200306113927.16904-2-karthik.b.s@intel.com> (raw)
In-Reply-To: <20200306113927.16904-1-karthik.b.s@intel.com>

Add enable/disable flip done functions and enable
the flip done interrupt in IER.

Flip done interrupt is used to send the page flip event as soon as the
surface address is written as per the requirement of async flips.

Signed-off-by: Karthik B S <karthik.b.s@intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 37 ++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/i915/i915_irq.h |  2 ++
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index ecf07b0faad2..5955e737a45d 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2626,6 +2626,27 @@ int bdw_enable_vblank(struct drm_crtc *crtc)
 	return 0;
 }
 
+void icl_enable_flip_done(struct drm_crtc *crtc)
+{
+	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
+	enum pipe pipe = to_intel_crtc(crtc)->pipe;
+	struct drm_vblank_crtc *vblank = &dev_priv->drm.vblank[pipe];
+	unsigned long irqflags;
+
+	/* Make sure that vblank is not enabled, as we are already sending
+	 * the page flip event in the flip_done_handler.
+	 */
+	if (atomic_read(&vblank->refcount) != 0)
+		drm_crtc_vblank_put(crtc);
+
+	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
+
+	bdw_enable_pipe_irq(dev_priv, pipe, GEN9_PIPE_PLANE1_FLIP_DONE);
+
+	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
+
+}
+
 /* Called from drm generic code, passed 'crtc' which
  * we use as a pipe index
  */
@@ -2686,6 +2707,20 @@ void bdw_disable_vblank(struct drm_crtc *crtc)
 	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
 }
 
+
+void icl_disable_flip_done(struct drm_crtc *crtc)
+{
+	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
+	enum pipe pipe = to_intel_crtc(crtc)->pipe;
+	unsigned long irqflags;
+
+	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
+
+	bdw_disable_pipe_irq(dev_priv, pipe, GEN9_PIPE_PLANE1_FLIP_DONE);
+
+	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
+}
+
 static void ibx_irq_reset(struct drm_i915_private *dev_priv)
 {
 	struct intel_uncore *uncore = &dev_priv->uncore;
@@ -3375,7 +3410,7 @@ static void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv)
 		de_port_masked |= CNL_AUX_CHANNEL_F;
 
 	de_pipe_enables = de_pipe_masked | GEN8_PIPE_VBLANK |
-					   GEN8_PIPE_FIFO_UNDERRUN;
+			  GEN8_PIPE_FIFO_UNDERRUN | GEN9_PIPE_PLANE1_FLIP_DONE;
 
 	de_port_enables = de_port_masked;
 	if (IS_GEN9_LP(dev_priv))
diff --git a/drivers/gpu/drm/i915/i915_irq.h b/drivers/gpu/drm/i915/i915_irq.h
index 812c47a9c2d6..6fc319980dd3 100644
--- a/drivers/gpu/drm/i915/i915_irq.h
+++ b/drivers/gpu/drm/i915/i915_irq.h
@@ -114,11 +114,13 @@ int i915gm_enable_vblank(struct drm_crtc *crtc);
 int i965_enable_vblank(struct drm_crtc *crtc);
 int ilk_enable_vblank(struct drm_crtc *crtc);
 int bdw_enable_vblank(struct drm_crtc *crtc);
+void icl_enable_flip_done(struct drm_crtc *crtc);
 void i8xx_disable_vblank(struct drm_crtc *crtc);
 void i915gm_disable_vblank(struct drm_crtc *crtc);
 void i965_disable_vblank(struct drm_crtc *crtc);
 void ilk_disable_vblank(struct drm_crtc *crtc);
 void bdw_disable_vblank(struct drm_crtc *crtc);
+void icl_disable_flip_done(struct drm_crtc *crtc);
 
 void gen2_irq_reset(struct intel_uncore *uncore);
 void gen3_irq_reset(struct intel_uncore *uncore, i915_reg_t imr,
-- 
2.22.0

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

  reply	other threads:[~2020-03-06 11:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 11:39 [Intel-gfx] [RFC 0/7] Asynchronous flip implementation for i915 Karthik B S
2020-03-06 11:39 ` Karthik B S [this message]
2020-03-09 23:17   ` [Intel-gfx] [RFC 1/7] drm/i915: Define flip done functions and enable IER Paulo Zanoni
2020-03-10 10:51     ` B S, Karthik
2020-03-06 11:39 ` [Intel-gfx] [RFC 2/7] drm/i915: Add support for async flips in I915 Karthik B S
2020-03-09 23:18   ` Paulo Zanoni
2020-03-10 10:54     ` B S, Karthik
2020-03-06 11:39 ` [Intel-gfx] [RFC 3/7] drm/i915: Make commit call blocking in case of async flips Karthik B S
2020-03-06 11:39 ` [Intel-gfx] [RFC 4/7] drm/i915: Add checks specific to " Karthik B S
2020-03-09 23:19   ` Paulo Zanoni
2020-03-10 12:51     ` B S, Karthik
2020-03-06 11:39 ` [Intel-gfx] [RFC 5/7] drm/i915: Add flip_done_handler definition Karthik B S
2020-03-09 23:19   ` Paulo Zanoni
2020-03-10 12:52     ` B S, Karthik
2020-03-06 11:39 ` [Intel-gfx] [RFC 6/7] drm/i915: Enable and handle flip done interrupt Karthik B S
2020-03-06 11:39 ` [Intel-gfx] [RFC 7/7] drm/i915: Do not call drm_crtc_arm_vblank_event in async flips Karthik B S
2020-03-06 19:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Asynchronous flip implementation for i915 Patchwork
2020-03-06 19:43 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-03-06 19:58 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2020-03-06 20:10 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2020-03-10  0:04 ` [Intel-gfx] [RFC 0/7] " Paulo Zanoni
2020-03-10 10:07   ` B S, Karthik

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=20200306113927.16904-2-karthik.b.s@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --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.