From: Imre Deak <imre.deak@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 2/2] drm/i915: lock event_lock for drm_vblank_off()
Date: Thu, 1 Nov 2012 00:03:39 +0200 [thread overview]
Message-ID: <1351721019-8040-2-git-send-email-imre.deak@intel.com> (raw)
In-Reply-To: <1351721019-8040-1-git-send-email-imre.deak@intel.com>
drm_vblank_off() requires callers to hold the event_lock.
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b453901..56f1119 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3413,6 +3413,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
struct intel_encoder *encoder;
int pipe = intel_crtc->pipe;
int plane = intel_crtc->plane;
+ unsigned long flags;
u32 reg, temp;
@@ -3423,7 +3424,11 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
encoder->disable(encoder);
intel_crtc_wait_for_pending_flips(crtc);
+
+ spin_lock_irqsave(&dev->event_lock, flags);
drm_vblank_off(dev, pipe);
+ spin_unlock_irqrestore(&dev->event_lock, flags);
+
intel_crtc_update_cursor(crtc, false);
intel_disable_plane(dev_priv, plane, pipe);
@@ -3495,6 +3500,7 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
int plane = intel_crtc->plane;
enum transcoder cpu_transcoder = intel_crtc->cpu_transcoder;
bool is_pch_port;
+ unsigned long flags;
if (!intel_crtc->active)
return;
@@ -3505,7 +3511,11 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
encoder->disable(encoder);
intel_crtc_wait_for_pending_flips(crtc);
+
+ spin_lock_irqsave(&dev->event_lock, flags);
drm_vblank_off(dev, pipe);
+ spin_unlock_irqrestore(&dev->event_lock, flags);
+
intel_crtc_update_cursor(crtc, false);
intel_disable_plane(dev_priv, plane, pipe);
@@ -3617,6 +3627,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
struct intel_encoder *encoder;
int pipe = intel_crtc->pipe;
int plane = intel_crtc->plane;
+ unsigned long flags;
if (!intel_crtc->active)
@@ -3627,7 +3638,11 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
/* Give the overlay scaler a chance to disable if it's on this pipe */
intel_crtc_wait_for_pending_flips(crtc);
+
+ spin_lock_irqsave(&dev->event_lock, flags);
drm_vblank_off(dev, pipe);
+ spin_unlock_irqrestore(&dev->event_lock, flags);
+
intel_crtc_dpms_overlay(intel_crtc, false);
intel_crtc_update_cursor(crtc, false);
--
1.7.9.5
next prev parent reply other threads:[~2012-10-31 22:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-31 22:03 [PATCH 1/2] drm: fix order of event_lock wrt. vblank_time_clock Imre Deak
2012-10-31 22:03 ` Imre Deak [this message]
2012-10-31 22:46 ` [PATCH 2/2] drm/i915: lock event_lock for drm_vblank_off() Daniel Vetter
2012-11-01 9:34 ` Imre Deak
2012-11-01 9:22 ` [PATCH 1/2] drm: fix order of event_lock wrt. vblank_time_clock Imre Deak
2012-11-02 11:30 ` [PATCH v2 0/4] drm/exynos, intel: fix locking for flip/vbl event list Imre Deak
2012-11-07 9:31 ` Inki Dae
2012-11-07 10:43 ` [PATCH v2 0/4] drm/exynos,intel: " Imre Deak
2012-11-07 16:25 ` [PATCH v2 0/4] drm/exynos, intel: " Inki Dae
2012-11-07 16:28 ` Rob Clark
2012-11-07 16:42 ` Inki Dae
2012-11-02 11:30 ` [PATCH v2 1/4] drm/exynos: hold event_lock while accessing pageflip_event_list Imre Deak
2012-11-02 11:30 ` [PATCH v2 2/4] drm/exynos: call drm_vblank_put for each queued flip event Imre Deak
2012-11-02 11:30 ` [PATCH v2 3/4] drm/exynos: fix lockdep for event_lock wrt. vbl_time_lock Imre Deak
2012-11-02 11:30 ` [PATCH v2 4/4] drm: hold event_lock while accessing vblank_event_list Imre Deak
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=1351721019-8040-2-git-send-email-imre.deak@intel.com \
--to=imre.deak@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--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;
as well as URLs for NNTP newsgroup(s).