summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@code-monkey.de>2007-10-03 00:03:20 +0200
committerTilman Sauerbeck <tilman@code-monkey.de>2007-10-03 00:03:20 +0200
commitfda9377e5e45b4fc3190bad03e081cadc96fe231 (patch)
tree932ab9c7cc32553d48def07700e2d03e50245a1a
parent6695dc4222bb97c0f9dffce46a54456eeb5f4b5f (diff)
Bug #12598: Only write palette data when available.
When we're restoring a CRTC state from crtc_mode_set(), the palette data is initialized to zero. Don't write it to the hardware in that case.
-rw-r--r--src/mga_g_crtc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mga_g_crtc.c b/src/mga_g_crtc.c
index 7f3d90f..d428b3d 100644
--- a/src/mga_g_crtc.c
+++ b/src/mga_g_crtc.c
@@ -725,9 +725,10 @@ state_restore(xf86CrtcPtr crtc, MgaCrtcStatePtr state,
if (vga_flags & VGA_SR_FONTS)
MGAG200SERestoreFonts(scrn, vga);
} else
- vgaHWRestore(scrn, vga, vga_flags);
+ vgaHWRestore(scrn, vga, vga_flags & ~VGA_SR_CMAP);
- MGAGRestorePalette(scrn, vga->DAC);
+ if (vga_flags & VGA_SR_CMAP)
+ MGAGRestorePalette(scrn, vga->DAC);
/*
* this is needed to properly restore start address
@@ -853,7 +854,7 @@ crtc_restore(xf86CrtcPtr crtc)
MgaCrtcDataPtr data = MGACRTCDATAPTR(crtc);
MGAPtr pMga = MGAPTR(crtc->scrn);
vgaHWPtr vga = VGAHWPTR(crtc->scrn);
- int vga_flags = VGA_SR_MODE;
+ int vga_flags = VGA_SR_MODE | VGA_SR_CMAP;
if (pMga->Primary)
vga_flags |= VGA_SR_FONTS;