summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.lan>2008-05-07 14:46:52 -0700
committerZhenyu Wang <zhenyu.z.wang@intel.com>2008-05-08 09:18:52 +0800
commit3b8804d82266ffc01ac1573624387b0d1f9dfb94 (patch)
treeee44b2d33c130f784a9feb57346eeb5a31685cd1
parent0ab5cbc5310c2a60c10fd611fcf9a4791379f42b (diff)
Save/restore cursor registers
There are lots of good reasons for doing this, one of them is fdo bug #11305. (cherry picked from commit 33f033cbf346c13a687e469e8879579fcd5bb2fb)
-rw-r--r--src/i830.h6
-rw-r--r--src/i830_driver.c21
2 files changed, 27 insertions, 0 deletions
diff --git a/src/i830.h b/src/i830.h
index 431abb5c..28831e49 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -621,6 +621,12 @@ typedef struct _I830Rec {
uint32_t saveVCLK_DIVISOR_VGA1;
uint32_t saveVCLK_POST_DIV;
uint32_t saveVGACNTRL;
+ uint32_t saveCURSOR_A_CONTROL;
+ uint32_t saveCURSOR_A_BASE;
+ uint32_t saveCURSOR_A_POSITION;
+ uint32_t saveCURSOR_B_CONTROL;
+ uint32_t saveCURSOR_B_BASE;
+ uint32_t saveCURSOR_B_POSITION;
uint32_t saveADPA;
uint32_t saveLVDS;
uint32_t saveDVOA;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 0112e1de..ef898dc5 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2033,6 +2033,13 @@ SaveHWState(ScrnInfoPtr pScrn)
pI830->saveVCLK_POST_DIV = INREG(VCLK_POST_DIV);
pI830->saveVGACNTRL = INREG(VGACNTRL);
+ pI830->saveCURSOR_A_CONTROL = INREG(CURSOR_A_CONTROL);
+ pI830->saveCURSOR_A_POSITION = INREG(CURSOR_A_POSITION);
+ pI830->saveCURSOR_A_BASE = INREG(CURSOR_A_BASE);
+ pI830->saveCURSOR_B_CONTROL = INREG(CURSOR_B_CONTROL);
+ pI830->saveCURSOR_B_POSITION = INREG(CURSOR_B_POSITION);
+ pI830->saveCURSOR_B_BASE = INREG(CURSOR_B_BASE);
+
for(i = 0; i < 7; i++) {
pI830->saveSWF[i] = INREG(SWF0 + (i << 2));
pI830->saveSWF[i+7] = INREG(SWF00 + (i << 2));
@@ -2234,6 +2241,20 @@ RestoreHWState(ScrnInfoPtr pScrn)
OUTREG(VGACNTRL, pI830->saveVGACNTRL);
+ /*
+ * Restore cursors
+ * Even though the X cursor is hidden before we restore the hw state,
+ * we probably only disabled one cursor plane. If we're going from
+ * e.g. plane b to plane a here in RestoreHWState, we need to restore
+ * both cursor plane settings.
+ */
+ OUTREG(CURSOR_A_POSITION, pI830->saveCURSOR_A_POSITION);
+ OUTREG(CURSOR_A_BASE, pI830->saveCURSOR_A_BASE);
+ OUTREG(CURSOR_A_CONTROL, pI830->saveCURSOR_A_CONTROL);
+ OUTREG(CURSOR_B_POSITION, pI830->saveCURSOR_B_POSITION);
+ OUTREG(CURSOR_B_BASE, pI830->saveCURSOR_B_BASE);
+ OUTREG(CURSOR_B_CONTROL, pI830->saveCURSOR_B_CONTROL);
+
/* Restore outputs */
for (i = 0; i < xf86_config->num_output; i++) {
xf86OutputPtr output = xf86_config->output[i];