<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>The update of the "Xorg-geode-screensaver bug"</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Hi,</FONT> <FONT SIZE=2 FACE="Arial">all,</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> </SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT COLOR="#000080" SIZE=2 FACE="Arial">Through compare the parts of "xf86ChangeGammaRamp" between VESA driver and Geode driver, in judge the "xf86_crtc_supports_gamma(pScrn)", the Geode driver is ture when the 'fading' option is set, but the VESA driver always are fa</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial">lse between 'fading' and 'not fading', it can only call the CMapColor. At the same time, the red, green and blue value are 0 from ProcXF86VidModeSetGammaRamp transfer the color parameter. So using code zero to represent black if no Gamma action. It is an</FONT> <FONT COLOR="#000080" SIZE=2 FACE="Arial">i</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial">ntegrated palette RAM for gamma-correction of the data stream. So I use the following methods to fix the bug, How do you think? But the xf86-video-intel driver use the "drmModeCrtcSetGamma" (in libdrm -> xf86drmMode.c) to deal with the events.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">In lx_displ</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial">ay.c -> lx_crtc_gamma_set function:</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">the change is:</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial"> </FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"> assert(size == 256);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial"> </FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">+ for (i = 0; i < size; i++) { //changed by Hunk</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">- for (i = 0; i < 256; i++) {</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial"> </FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"> unsigned int val = (*red << 8) | *green | (*blue >> 8);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial"> </FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial"> </FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"> df_s</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial">et_video_palette_entry(i, val);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">In cim_df.c -> df_set_video_palette_entry function:</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">the change is:</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">+++ cim/cim_df.c 2010-05-11 18:06:47.051406358 +0800</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">--- cim_df_old.c 2010-02-04 05:09:54.000000000 +0800</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial"> </FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"> /* SET A SINGLE ENTRY */</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial"> </FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">+ </FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"> if (palette != 0) //added by Hunk</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">+ {</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">+ WRITE_VID32(DF_PALETTE_ADDRESS, index); //Screensaver bug keypoint by Hunk //defined in LX_databook P428 Video Processor Register Description /belong to Table 6-71 </FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">+ WRITE_VID32(DF_PALE</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial">TTE_DATA, palette); //Screensaver bug keypoint by Hunk //defined in LX_databook P428 Video Processor Register Description /belong to Table 6-71</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">+ }</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">- WRITE_VID32(DF_PALETTE_ADDRESS, index);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">- WRITE_VID32(DF_PALETTE_DATA, palette);</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">-</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial"> </FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"> /* ENABLE THE VIDEO PALETTE */</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial"> </FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"> /* Ensure that the video palette has an effect by routing video data */</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial"> </FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"> /* through the palette RAM and clearing the 'Bypass Both' bit. */</FONT></SPAN></P>
<BR>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">Thanks,</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT COLOR="#000080" SIZE=2 FACE="Arial">Hunk Cu</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial">i</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>
</BODY>
</HTML>