summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2011-10-05 12:27:27 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2011-10-07 09:25:58 -0400
commit1af966f36e7f1bd219bd3b8d107de94281dbfe7d (patch)
tree9159355b2a904c661a79cdcef897f15db9a8274b
parentc667c25a5ba704882e00cf63679c41f33cae9e1b (diff)
Reset non-primary device out of CloseScreen().rhel62
Otherwise, client windows will linger even after the server shuts down. Don't reset the primary device so that we can preserve the fonts etc.
-rw-r--r--src/qxl_driver.c66
1 files changed, 38 insertions, 28 deletions
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 026ec24..8146cfd 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -310,33 +310,6 @@ qxl_restore_state(ScrnInfoPtr pScrn)
vgaHWRestoreFonts(pScrn, &qxl->vgaRegs);
}
-static Bool
-qxl_close_screen(int scrnIndex, ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- qxl_screen_t *qxl = pScrn->driverPrivate;
- Bool result;
-
- ErrorF ("Freeing %p\n", qxl->fb);
- free(qxl->fb);
- qxl->fb = NULL;
-
- pScreen->CreateScreenResources = qxl->create_screen_resources;
- pScreen->CloseScreen = qxl->close_screen;
-
-
-
- result = pScreen->CloseScreen(scrnIndex, pScreen);
-
- if (pScrn->vtSema) {
- qxl_restore_state(pScrn);
- qxl_unmap_memory(qxl, scrnIndex);
- }
- pScrn->vtSema = FALSE;
-
- return result;
-}
-
static void
qxl_reset (qxl_screen_t *qxl)
{
@@ -402,6 +375,41 @@ qxl_reset (qxl_screen_t *qxl)
slot->high_bits = high_bits;
}
+static Bool
+qxl_close_screen(int scrnIndex, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ qxl_screen_t *qxl = pScrn->driverPrivate;
+ Bool result;
+
+ ErrorF ("Freeing %p\n", qxl->fb);
+ free(qxl->fb);
+ qxl->fb = NULL;
+
+ pScreen->CreateScreenResources = qxl->create_screen_resources;
+ pScreen->CloseScreen = qxl->close_screen;
+
+ result = pScreen->CloseScreen(scrnIndex, pScreen);
+
+ if (!xf86IsPrimaryPci (qxl->pci) && qxl->primary)
+ {
+ ErrorF ("Resetting %d\n", scrnIndex);
+ qxl_reset (qxl);
+ }
+
+ if (pScrn->vtSema)
+ {
+ if (xf86IsPrimaryPci (qxl->pci))
+ qxl_restore_state(pScrn);
+
+ qxl_unmap_memory(qxl, scrnIndex);
+ }
+
+ pScrn->vtSema = FALSE;
+
+ return result;
+}
+
static void
set_screen_pixmap_header (ScreenPtr pScreen)
{
@@ -846,7 +854,9 @@ qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
printf ("ram_header at %d\n", qxl->rom->ram_header_offset);
printf ("surf0 size: %d\n", qxl->rom->surface0_area_size);
- qxl_save_state(pScrn);
+ if (xf86IsPrimaryPci (qxl->pci))
+ qxl_save_state(pScrn);
+
qxl_blank_screen(pScreen, SCREEN_SAVER_ON);
miClearVisualTypes();