I sumitted this bug report to [EMAIL PROTECTED], but haven't heard back...
Any comments from the XFree86 team as to whether this patch is acceptable?

Thanks, Ross
[EMAIL PROTECTED]


Regarding: Offscreen pixmap corruption can occur when switching virtual
consoles
Email: [EMAIL PROTECTED]
------------------------------------------------------------
XFree86 Version: 4.2.1

OS: Red Hat Linux 7.1 (2.4.2-2 kernel)

Area: mga_drv.o Matrox graphics driver

Server: XFree86 (The XFree86 4.x server)

Server: XFree86 4.2.1

Video Card:

Matrox MGA G400 AGP rev 130 Dual-Head
mgag400 chipset
16 MB of Video RAM


Description:

With the above Matrox adapter, pixmap's can become corrupted when switching
virtual consoles on Linux.  The problem is that one of the Matrox specific
variables that control's the source addresses for pixmap blits isn't being
reset when returning to X.  (see below for details)

(*X output log snipped*)

Repeat By:

1. Edit the /etc/X11/XF86Config-4 file and in the Section "Device" include:

Option "XaaNoMono8x8PatternFillRect" "on"

This will cause the MGA SubsequentScreenToScreenCopy()routine to be used to
paint a solid color background.

Also, configure this file to use an 8 bit color depth.

2.  Create a ~/.xinitrc file with the contents "exec fvwm2"
3.  run "startx"
4.  Once X has come up, press Ctrl-Alt-F1 to return to a text virtual
console.
5.  Then press Alt-F7 to return back to X.

The root window/background will appear corrupted, and will not display the
initial color background in its original form.

-------------

Here is a technical explanation of the problem's source:

The cause of the video corruption is that the Matrox video adapter's SRCORG
register has an incorrect value when switching from the text console back
into X.  This register determines the base source address for the upcoming
copy/blit operation.  If the value is inaccurate, the offsets will be
applied to the wrong base address, and the wrong content will be copied
(hence the corruption).

This register is reset to 0x0 in the MGAStormEngineInit() routine (which is
invoked when switching back to X from a text console); however, the problem
is that the pMga->SrcOrg variable is not.  This variable is used in the
SubsequentScreenToScreenCopy() and SubsequentScreenToScreenColorExpandFill
() routines to determine whether the SRCORG register is current, and its
value should correspond to the current SRCORG register value.  The patch is
to simply reset this variable to 0x0 in the MGAStormEngineInit() routine.

I have tested the following patch, and it does indeed correct the
situation.  In addition, I have corresponded with Matrox, and they agree
that the patch below addresses this problem.  Please consider including it
into your source code tree so this behavior will be fixed in future
releases of XFree86.

Many thanks,

-Ross

Here is the patch:

--- programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c Wed Sep 25 16:04:36
2002
+++ programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c.fix     Wed Sep 25
16:04:29 2002
@@ -1170,6 +1170,7 @@
     case PCI_CHIP_MGAG400:
     case PCI_CHIP_MGAG200:
     case PCI_CHIP_MGAG200_PCI:
+       pMga->SrcOrg = 0;
        OUTREG(MGAREG_SRCORG, pMga->realSrcOrg);
        OUTREG(MGAREG_DSTORG, pMga->DstOrg);
        break;



Ross A. Mikosh
Software Engineer, Linux Change Team
IBM Global Services
[EMAIL PROTECTED], (512) 823-5606, T/L:  523-5606



_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to