[Spice-devel] [PATCH xf86-drv-qxl F14-branch] Don't access the qxl device when our vt is not focussed

Hans de Goede hdegoede at redhat.com
Mon Oct 11 04:24:59 PDT 2010


Trying to do so causes the X-server to segfault as it has
dropped iopl permission, which is, erm, undesirable :)
---
 src/qxl.h         |    6 +-----
 src/qxl_surface.c |    4 ++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/qxl.h b/src/qxl.h
index e126546..0f9927b 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -697,11 +697,7 @@ struct _qxl_screen_t
 static inline Bool
 in_vga_mode (qxl_screen_t *qxl)
 {
-    /* FIXME: The ability to detect whether we are in VGA
-     * mode has been remvoed in newer devices.
-     */
-    
-    return FALSE;
+    return !qxl->pScrn->vtSema;
 }
 
 static uint64_t
diff --git a/src/qxl_surface.c b/src/qxl_surface.c
index 3b177fe..23ec1fe 100644
--- a/src/qxl_surface.c
+++ b/src/qxl_surface.c
@@ -439,8 +439,12 @@ qxl_surface_prepare_access (qxl_surface_t  *surface,
     int n_boxes;
     BoxPtr boxes;
     ScreenPtr pScreen = pixmap->drawable.pScreen;
+    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
     RegionRec new;
 
+    if (!pScrn->vtSema)
+        return FALSE;
+
     REGION_INIT (NULL, &new, (BoxPtr)NULL, 0);
     REGION_SUBTRACT (NULL, &new, region, &surface->access_region);
 
-- 
1.7.2.2



More information about the Spice-devel mailing list