summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-28 20:23:11 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-28 20:23:11 -0200
commita2352ff23787f37530dff68e03028dd78925e4b4 (patch)
treee423af6a0a840da8f02b2dd2a6f7d969caf83f23 /src
parent5a65559e12452a47f9848c47cfa6e30cfb871f0b (diff)
Properly restore console on the smi 501/502.
The current kernel framebuffer module expects accelerations registers in the default boot state, otherwise, it will display some corruption, or not correctly clear the screen, among other side effects. Now it should be restoring everything the kernel framebuffer relies on not being modified.
Diffstat (limited to 'src')
-rw-r--r--src/smi_501.c32
-rw-r--r--src/smi_501.h44
2 files changed, 74 insertions, 2 deletions
diff --git a/src/smi_501.c b/src/smi_501.c
index f1a5804..465b8f3 100644
--- a/src/smi_501.c
+++ b/src/smi_501.c
@@ -131,6 +131,21 @@ SMI501_Save(ScrnInfoPtr pScrn)
save->alpha_plane_tl.value = READ_SCR(pSmi, ALPHA_PLANE_TL);
save->alpha_plane_br.value = READ_SCR(pSmi, ALPHA_PLANE_BR);
save->alpha_chroma_key.value = READ_SCR(pSmi, ALPHA_CHROMA_KEY);
+
+ /* Also save accel state to properly restore kernel framebuffer */
+ save->accel_src = READ_SCR(pSmi, ACCEL_SRC);
+ save->accel_dst = READ_SCR(pSmi, ACCEL_DST);
+ save->accel_dim = READ_SCR(pSmi, ACCEL_DIM);
+ save->accel_ctl = READ_SCR(pSmi, ACCEL_CTL);
+ save->accel_pitch = READ_SCR(pSmi, ACCEL_PITCH);
+ save->accel_fmt = READ_SCR(pSmi, ACCEL_FMT);
+ save->accel_clip_tl = READ_SCR(pSmi, ACCEL_CLIP_TL);
+ save->accel_clip_br = READ_SCR(pSmi, ACCEL_CLIP_BR);
+ save->accel_pat_lo = READ_SCR(pSmi, ACCEL_PAT_LO);
+ save->accel_pat_hi = READ_SCR(pSmi, ACCEL_PAT_HI);
+ save->accel_wwidth = READ_SCR(pSmi, ACCEL_WWIDTH);
+ save->accel_src_base = READ_SCR(pSmi, ACCEL_SRC_BASE);
+ save->accel_dst_base = READ_SCR(pSmi, ACCEL_DST_BASE);
}
void
@@ -353,12 +368,29 @@ SMI501_WriteMode_alpha(ScrnInfoPtr pScrn, MSOCRegPtr mode)
void
SMI501_WriteMode(ScrnInfoPtr pScrn, MSOCRegPtr restore)
{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
SMI501_WriteMode_common(pScrn, restore);
SMI501_WriteMode_lcd(pScrn, restore);
SMI501_WriteMode_crt(pScrn, restore);
#if SMI_CURSOR_ALPHA_PLANE
SMI501_WriteMode_alpha(pScrn, restore);
#endif
+
+ /* This function should be called when switching to virtual console */
+ WRITE_SCR(pSmi, ACCEL_SRC, restore->accel_src);
+ WRITE_SCR(pSmi, ACCEL_DST, restore->accel_dst);
+ WRITE_SCR(pSmi, ACCEL_DIM, restore->accel_dim);
+ WRITE_SCR(pSmi, ACCEL_CTL, restore->accel_ctl);
+ WRITE_SCR(pSmi, ACCEL_PITCH, restore->accel_pitch);
+ WRITE_SCR(pSmi, ACCEL_FMT, restore->accel_fmt);
+ WRITE_SCR(pSmi, ACCEL_CLIP_TL, restore->accel_clip_tl);
+ WRITE_SCR(pSmi, ACCEL_CLIP_BR, restore->accel_clip_br);
+ WRITE_SCR(pSmi, ACCEL_PAT_LO, restore->accel_pat_lo);
+ WRITE_SCR(pSmi, ACCEL_PAT_HI, restore->accel_pat_hi);
+ WRITE_SCR(pSmi, ACCEL_WWIDTH, restore->accel_wwidth);
+ WRITE_SCR(pSmi, ACCEL_SRC_BASE, restore->accel_src_base);
+ WRITE_SCR(pSmi, ACCEL_DST_BASE, restore->accel_dst_base);
}
void
diff --git a/src/smi_501.h b/src/smi_501.h
index 8f46a0d..c79b75c 100644
--- a/src/smi_501.h
+++ b/src/smi_501.h
@@ -954,12 +954,52 @@ typedef struct _MSOCRegRec {
} f;
int32_t value;
} crt_detect;
-} MSOCRegRec, *MSOCRegPtr;
-
#define PANEL_PALETTE 0x080400
#define CRT_PALETTE 0x080c00
+#define ACCEL_SRC 0x100000
+ int32_t accel_src;
+
+#define ACCEL_DST 0x100004
+ int32_t accel_dst;
+
+#define ACCEL_DIM 0x100008
+ int32_t accel_dim;
+
+#define ACCEL_CTL 0x10000c
+ int32_t accel_ctl;
+
+#define ACCEL_PITCH 0x100010
+ int32_t accel_pitch;
+
+#define ACCEL_FMT 0x10001c
+ int32_t accel_fmt;
+
+#define ACCEL_CLIP_TL 0x10002c
+ int32_t accel_clip_tl;
+
+#define ACCEL_CLIP_BR 0x100030
+ int32_t accel_clip_br;
+
+#define ACCEL_PAT_LO 0x100034
+ int32_t accel_pat_lo;
+
+#define ACCEL_PAT_HI 0x100038
+ int32_t accel_pat_hi;
+
+#define ACCEL_WWIDTH 0x10003c
+ int32_t accel_wwidth;
+
+#define ACCEL_SRC_BASE 0x100040
+ int32_t accel_src_base;
+
+#define ACCEL_DST_BASE 0x100044
+ int32_t accel_dst_base;
+
+} MSOCRegRec, *MSOCRegPtr;
+
+
/* In Kb - documentation says it is 64Kb... */
#define FB_RESERVE4USB 512