diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-17 17:54:58 +0100 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2012-04-24 10:48:42 -0400 |
commit | 78ed626ce105a32d129c1e065e8e6e13da1db670 (patch) | |
tree | 04b036e3d40603d89bd1ace59bea82b241fdecde | |
parent | 7e56ce9900ce6dc490e964c3ab44410c197e0ee3 (diff) |
Don't issue a scanline wait while VT switchedintel-2.18-fedora-branch
Be paranoid and check that we own the VT before emitting a scanline
wait. If we attempt to wait on a fb/pipe that we do not own, we may
issue an illegal command and cause a lockup.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit b817200371bfe16f44b879a793cf4a75ad17bc5c)
-rw-r--r-- | src/intel_dri.c | 3 | ||||
-rw-r--r-- | src/intel_video.c | 2 | ||||
-rw-r--r-- | src/sna/sna_display.c | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/intel_dri.c b/src/intel_dri.c index f6f0c863..a5ed5453 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -553,7 +553,8 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion, ValidateGC(dst, gc); /* Wait for the scanline to be outside the region to be copied */ - if (pixmap_is_scanout(get_drawable_pixmap(dst)) && + if (scrn->vtSema && + pixmap_is_scanout(get_drawable_pixmap(dst)) && intel->swapbuffers_wait && INTEL_INFO(intel)->gen < 60) { BoxPtr box; BoxRec crtcbox; diff --git a/src/intel_video.c b/src/intel_video.c index 25f64836..0834bb23 100644 --- a/src/intel_video.c +++ b/src/intel_video.c @@ -1285,7 +1285,7 @@ intel_wait_for_scanline(ScrnInfoPtr scrn, PixmapPtr pixmap, int y1, y2; pipe = -1; - if (pixmap_is_scanout(pixmap)) + if (scrn->vtSema && pixmap_is_scanout(pixmap)) pipe = intel_crtc_to_pipe(crtc); if (pipe < 0) return; diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 676125d0..3e4f17f5 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -1993,6 +1993,10 @@ sna_covering_crtc(ScrnInfoPtr scrn, int best_coverage, c; BoxRec best_crtc_box; + /* If we do not own the VT, we do not own the CRTC either */ + if (!scrn->vtSema) + return NULL; + DBG(("%s for box=(%d, %d), (%d, %d)\n", __FUNCTION__, box->x1, box->y1, box->x2, box->y2)); |