Subject: please test patch for nVidea driver (4.2.0)
To: None <tech-x11@netbsd.org>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: tech-x11
Date: 06/26/2002 12:56:23
This is a multipart MIME message.
--==_Exmh_65206929966200
Content-Type: text/plain; charset=us-ascii
Are there still problems with the nv driver not restoring
fonts and/or colormap after a screen switch?
There was a fix in nv_driver.c rev. 1.3 (end of may) which
should make sure that the fonts are saved/restored properly.
If the screen is still black, it might be a colormap issue.
There is a piece of code in the driver which looks dangerous
to me. I don't see any problem with a Geforce2 MX. If anyone
feels affected, could he please try the appended patch?
best regards
Matthias
--==_Exmh_65206929966200
Content-Type: text/plain ; name="nvpatch"; charset=us-ascii
Content-Description: nvpatch
Content-Disposition: attachment; filename="nvpatch"
*** nv_dac.c.~1.4.~ Tue Apr 9 17:58:49 2002
--- nv_dac.c Wed Jun 26 11:52:16 2002
***************
*** 241,246 ****
--- 241,247 ----
int i, index;
NVPtr pNv = NVPTR(pScrn);
vgaRegPtr pVga;
+ char *savDAC;
pVga = &VGAHWPTR(pScrn)->ModeReg;
***************
*** 250,255 ****
--- 251,261 ----
(pNv->CurrentLayout.depth != 8))
return;
+ savDAC = malloc(768);
+ if (!savDAC)
+ return; /* XXX error? */
+ memcpy(savDAC, pVga->DAC, 768);
+
switch(pNv->CurrentLayout.depth) {
case 15:
for(i = 0; i < numColors; i++) {
***************
*** 279,284 ****
--- 285,293 ----
break;
}
vgaHWRestore(pScrn, pVga, VGA_SR_CMAP);
+
+ memcpy(pVga->DAC, savDAC, 768);
+ free(savDAC);
}
/*
--==_Exmh_65206929966200--