diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-17 17:54:58 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-17 17:56:05 +0100 |
commit | b817200371bfe16f44b879a793cf4a75ad17bc5c (patch) | |
tree | ec4001dd07530b08e76b7bb12ea5d70c276b217f | |
parent | af4a6e8cb52ace594934446e6d8a7aaa1945a9b0 (diff) |
Don't issue a scanline wait while VT switched
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>
-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 ef3b0f96..cb051b08 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -2018,6 +2018,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)); |