Am 31.07.2013 11:37, schrieb Egbert Eich:
> xf86HandleColormaps() needs to know the RAMDAC depth.
> Ask BIOS about its current value if BIOS has indicated
> that RAMDAC supports 8-bit.
>
> Signed-off-by: Egbert Eich <[email protected]>
> ---
> src/vesa.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/vesa.c b/src/vesa.c
> index 8de1983..93b4909 100644
> --- a/src/vesa.c
> +++ b/src/vesa.c
> @@ -1096,7 +1096,8 @@ VESAScreenInit(SCREEN_INIT_ARGS_DECL)
> flags = CMAP_RELOAD_ON_MODE_SWITCH;
>
> if(!xf86HandleColormaps(pScreen, 256,
> - pVesa->vbeInfo->Capabilities[0] & 0x01 ? 8 : 6,
> + (pVesa->vbeInfo->Capabilities[0] & 0x01
> + && VBESetGetDACPaletteFormat(pVesa->pVbe, 0) == 8)
> ? 8 : 6,
> VESALoadPalette, NULL, flags))
I would suggest to use the opportunity to make that more readable.
int get_dep(pVesa)
{
int cap, fmt;
cap=pVesa->vbeInfo->Capabilities[0] & 0x1;
fmt=VBESetGetDACPaletteFormat(pVesa->pVbe, 0):
if (cap == 1 && fmt==8 ) return 8;
return 6;
}
ret = xf86HandleColormaps(pScreen, 256,get_dep(pVesa),VESALoadPalette, NULL,
flags):
if (!ret) return (FALSE);
re,
wh
> return (FALSE);
>
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel