xf86-video-intel: 2 commits - src/sna/sna_display.c src/sna/sna.h

Chris Wilson ickle at kemper.freedesktop.org
Sat Sep 7 14:09:39 PDT 2013


 src/sna/sna.h         |   20 +++++++++++++++-----
 src/sna/sna_display.c |    4 ++++
 2 files changed, 19 insertions(+), 5 deletions(-)

New commits:
commit 6a6517c748c33a73c92ca67cae9bfb00d48d2382
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Sep 7 22:07:04 2013 +0100

    sna: Only update the CRTCs after a resize if master
    
    It appears possible to race the framebuffer resize with a VT switch and
    so end up attempting to update the CRTCs whilst master. The code
    complains, but in reality we can just ignore the requested change until
    we VT switch back and then apply the updates upon restoration of master.
    
    Reported-by: Jiri Slaby <jirislaby at gmail.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 7bbf40f..be02a78 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2782,6 +2782,10 @@ sna_mode_resize(ScrnInfoPtr scrn, int width, int height)
 	scrn->virtualY = height;
 	scrn->displayWidth = width;
 
+	/* Only update the CRTCs if we are in control */
+	if (!scrn->vtSema)
+		return TRUE;
+
 	for (i = 0; i < xf86_config->num_crtc; i++) {
 		xf86CrtcPtr crtc = xf86_config->crtc[i];
 
commit 7ee7e373f24b0c4604dbf67f7ff82bdb7edc55d1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Sep 7 17:27:20 2013 +0100

    sna: Split get_drawable_deltas()
    
    In some cases we know we only have a window, and so may skip a
    conditional.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna.h b/src/sna/sna.h
index a4037c6..bd2cd48 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -435,14 +435,24 @@ CARD32 sna_render_format_for_depth(int depth);
 void sna_debug_flush(struct sna *sna);
 
 static inline bool
+get_window_deltas(PixmapPtr pixmap, int16_t *x, int16_t *y)
+{
+#ifdef COMPOSITE
+	*x = -pixmap->screen_x;
+	*y = -pixmap->screen_y;
+	return pixmap->screen_x | pixmap->screen_y;
+#else
+	*x = *y = 0;
+	return false;
+#endif
+}
+
+static inline bool
 get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, int16_t *x, int16_t *y)
 {
 #ifdef COMPOSITE
-	if (drawable->type == DRAWABLE_WINDOW) {
-		*x = -pixmap->screen_x;
-		*y = -pixmap->screen_y;
-		return pixmap->screen_x | pixmap->screen_y;
-	}
+	if (drawable->type == DRAWABLE_WINDOW)
+		return get_window_deltas(pixmap, x, y);
 #endif
 	*x = *y = 0;
 	return false;


More information about the xorg-commit mailing list