summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2015-10-26 23:50:59 +0000
committerRussell King <rmk@arm.linux.org.uk>2015-11-08 20:09:04 +0000
commit8ce6f85a1a221ace10d01d8ac737d88ab0dbecf6 (patch)
tree912171a3d3dbcb71fe337027b9a7f211af61fde7
parente2990dc335a6cb3354db1249a208a3a3aa1f67aa (diff)
src: common_drm_covering_crtc() returns NULL if !vtSema
When we've been switched away, the X server no longer owns the CRTC, so reporting the CRTC which a pixmap is on is not appropriate. Return NULL (indicating no CRTC) when we're switched away. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--src/common_drm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common_drm.c b/src/common_drm.c
index 19110d1..263301e 100644
--- a/src/common_drm.c
+++ b/src/common_drm.c
@@ -1329,6 +1329,10 @@ xf86CrtcPtr common_drm_covering_crtc(ScrnInfoPtr pScrn, BoxPtr box,
BoxRec crtc_box, cover_box;
int coverage, best_coverage, c;
+ /* If we do not own the VT, we do not own the CRTC */
+ if (!pScrn->vtSema)
+ return NULL;
+
best_crtc = NULL;
best_coverage = 0;
box_ret->x1 = box_ret->x2 = box_ret->y1 = box_ret->y2 = 0;