Bug 2150 - "violation" of VESA standard that causes problems
Summary: "violation" of VESA standard that causes problems
Status: RESOLVED DUPLICATE of bug 3247
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/Vesa (show other bugs)
Version: git
Hardware: x86 (IA32) All
: high normal
Assignee: Xorg Project Team
QA Contact:
URL: http://www.vesa.org/Public/VBE/vbe3.pdf
Whiteboard:
Keywords:
: 3247 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-25 13:14 UTC by Jonas Lund
Modified: 2006-06-03 02:47 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch to fix the colormap problem (752 bytes, patch)
2005-03-09 14:17 UTC, David Sterratt
no flags Details | Splinter Review

Description Jonas Lund 2004-12-25 13:14:49 UTC
i have a toshiba R100 laptop that has a trident XP4 graphics card.
i reported a problem back in april when i first found it, the XFree86
distribution has fixed this but not XOrg.

when the vesa driver tries to set a highcolor(16/32bpp) the adapter colors gets
garbled.

the cause of this is that in the file:
xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c
in the function: VESASetMode a call is made that is not specified to be valid
according to the vesa standard.

in the end of the function there's a statement written like this:
  if (pScrn->bitsPerPixel >= 8 && pVesa->vbeInfo->Capabilities[0] & 0x01)
	VBESetGetDACPaletteFormat(pVesa->pVbe, 8);

the VESA specifications says:
"This function will return failure code AH=03h if called in direct color or YUV
mode."

the XFree86 server changed this (after i sent a notice of this bug) so that this
function is called only if "pScrn->bitsPerPixel == 8", this fixes this
particular problem but is still wrong. (the function should not be called at all
in direct color and YUV modes).

so, i suggest that you fix this bug properly (skip the call in directColor and
YUV modes) or use the quick-n-dirty patch that XFree86 used.

the q-n-d patch ( >= becomes == ) should work in 99% of the cases as i doubt
there are many cards that has 8bpp directcolor modes, but there could possibly
be cards with higher than 8bpp modes that has palettized modes that will fail.
or cards with lower bpp that "needs" 8 bits of color accuracy per channel.

please fix this. (xfree86 already has ;)

/ Jonas Lund
Comment 1 David Sterratt 2005-03-09 14:17:00 UTC
Created attachment 2065 [details] [review]
Patch to fix the colormap problem

This patch prevents calling of VBESetGetDACPaletteFormat(pVesa->pVbe, 8) if
called in direct color or YUV mode. I applied it to xorg-6.8.2 on an ubuntu
hoary system. (If building a deb, the patch can be place in debian/patches with
it's current file name). It seems to work on my Toshiba R100. Though I haven't
tested it extensively yet, I should have thought that if it works once it
should always work, especially given that it is fulfilling the vesa standard
more exactly.
Comment 2 Adam Jackson 2005-11-16 08:20:04 UTC

*** This bug has been marked as a duplicate of 3247 ***
Comment 3 Daniel Stone 2006-06-03 02:40:23 UTC
*** Bug 3247 has been marked as a duplicate of this bug. ***
Comment 4 Daniel Stone 2006-06-03 02:47:19 UTC
committed to HEAD, xf86-video-vesa 1.2.1 released.  sorry about the twisty maze
of duplicates.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.