From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/5] drm/i915: Grab uncore.lock around enabling vblank evasion
Date: Fri, 9 Feb 2018 10:54:01 +0100 [thread overview]
Message-ID: <20180209095404.76418-3-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20180209095404.76418-1-maarten.lankhorst@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/i915_irq.c | 2 +-
drivers/gpu/drm/i915/intel_drv.h | 1 +
drivers/gpu/drm/i915/intel_sprite.c | 10 ++++++----
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index b886bd459acc..eda9543a0199 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -845,7 +845,7 @@ static u32 __intel_get_crtc_scanline_from_timestamp(struct intel_crtc *crtc)
}
/* I915_READ_FW, only for fast reads of display block, no need for forcewake etc. */
-static int __intel_get_crtc_scanline(struct intel_crtc *crtc)
+int __intel_get_crtc_scanline(struct intel_crtc *crtc)
{
struct drm_device *dev = crtc->base.dev;
struct drm_i915_private *dev_priv = to_i915(dev);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 468ec1e90e16..fbdbbe741b2f 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1340,6 +1340,7 @@ static inline bool intel_irqs_enabled(struct drm_i915_private *dev_priv)
}
int intel_get_crtc_scanline(struct intel_crtc *crtc);
+int __intel_get_crtc_scanline(struct intel_crtc *crtc);
void gen8_irq_power_well_post_enable(struct drm_i915_private *dev_priv,
u8 pipe_mask);
void gen8_irq_power_well_pre_disable(struct drm_i915_private *dev_priv,
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 971a1ea0db45..3a34be4fd956 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -119,6 +119,7 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state)
crtc->debug.max_vbl = max;
trace_i915_pipe_update_start(crtc);
+ spin_lock(&dev_priv->uncore.lock);
for (;;) {
/*
* prepare_to_wait() has a memory barrier, which guarantees
@@ -127,7 +128,7 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state)
*/
prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
- scanline = intel_get_crtc_scanline(crtc);
+ scanline = __intel_get_crtc_scanline(crtc);
if (scanline < min || scanline > max)
break;
@@ -137,11 +138,11 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state)
break;
}
- local_irq_enable();
+ spin_unlock_irq(&dev_priv->uncore.lock);
timeout = schedule_timeout(timeout);
- local_irq_disable();
+ spin_lock_irq(&dev_priv->uncore.lock);
}
finish_wait(wq, &wait);
@@ -162,8 +163,9 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state)
* FIXME figure out if BXT+ DSI suffers from this as well
*/
while (need_vlv_dsi_wa && scanline == vblank_start)
- scanline = intel_get_crtc_scanline(crtc);
+ scanline = __intel_get_crtc_scanline(crtc);
+ spin_unlock(&dev_priv->uncore.lock);
crtc->debug.scanline_start = scanline;
crtc->debug.start_vbl_time = ktime_get();
crtc->debug.start_vbl_count = intel_crtc_get_vblank_counter(crtc);
--
2.16.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-02-09 9:54 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 9:53 [PATCH 0/5] drm/i915: Grab the vblank evasion lock around the entire evasion Maarten Lankhorst
2018-02-09 9:54 ` [PATCH 1/5] drm/i915: Keep vblank irq enabled during vblank evasion Maarten Lankhorst
2018-02-12 15:10 ` Chris Wilson
2018-02-12 15:16 ` Maarten Lankhorst
2018-02-12 15:22 ` Chris Wilson
2018-02-12 15:27 ` Maarten Lankhorst
2018-02-12 15:31 ` Chris Wilson
2018-02-12 15:41 ` Maarten Lankhorst
2018-02-12 16:55 ` Ville Syrjälä
2018-02-12 17:24 ` Chris Wilson
2018-02-12 18:06 ` Ville Syrjälä
2018-02-12 20:55 ` Chris Wilson
2018-02-13 8:59 ` Maarten Lankhorst
2018-02-09 9:54 ` Maarten Lankhorst [this message]
2018-02-12 15:16 ` [PATCH 2/5] drm/i915: Grab uncore.lock around enabling " Chris Wilson
2018-02-09 9:54 ` [PATCH 3/5] drm/i915: Call i915_pipe_update_start with uncore.lock held Maarten Lankhorst
2018-02-09 23:08 ` James Ausmus
2018-02-10 8:46 ` Maarten Lankhorst
2018-02-10 9:05 ` Chris Wilson
2018-02-12 15:19 ` Chris Wilson
2018-02-12 15:39 ` Maarten Lankhorst
2018-02-12 15:44 ` Chris Wilson
2018-02-12 16:41 ` Maarten Lankhorst
2018-02-09 9:54 ` [PATCH 4/5] drm/i915: Move all locking for plane updates to caller Maarten Lankhorst
2018-02-09 9:54 ` [PATCH 5/5] drm/i915: Use DOUBLE_BUFFER_CTL on top of vblank evasion for GEN9+ Maarten Lankhorst
2018-02-09 10:04 ` [PATCH 0/5] drm/i915: Grab the vblank evasion lock around the entire evasion Chris Wilson
2018-02-09 17:21 ` Maarten Lankhorst
2018-02-12 17:01 ` Ville Syrjälä
2018-02-13 10:19 ` Maarten Lankhorst
2018-02-13 10:40 ` Chris Wilson
2018-02-09 14:24 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-02-12 15:02 ` ✓ Fi.CI.BAT: success " Patchwork
2018-02-12 16:56 ` ✗ Fi.CI.IGT: warning " 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=20180209095404.76418-3-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--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