[Xorg-driver-geode] [PATCH 1/2] Gamma Correction for fading operation

Cui, Hunk Hunk.Cui at amd.com
Wed Jun 30 19:25:49 PDT 2010


From: Hunk Cui <Hunk.Cui at amd.com>

*Modify integrated palette RAM for gamma-correction of the data stream
*Let Graphic data passes through the Gamma Correction RAM
*Special in Screensaver Operation
*FreeDesktop Bugzilla #27853

Signed-off-by: Hunk Cui <Hunk.Cui at amd.com>
---
 src/cim/cim_df.c |    5 ++++-
 src/lx_display.c |   10 +++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/cim/cim_df.c b/src/cim/cim_df.c
index 242603a..b662f44 100644
--- a/src/cim/cim_df.c
+++ b/src/cim/cim_df.c
@@ -981,7 +981,10 @@ df_set_video_palette_entry(unsigned long index,
unsigned long palette)
     dcfg = READ_VID32(DF_DISPLAY_CONFIG);
     misc = READ_VID32(DF_VID_MISC);
 
-    dcfg |= DF_DCFG_GV_PAL_BYP;
+    /* Ensure that the Graphic data passes through the Gamma Correction
RAM */
+    dcfg &= ~DF_DCFG_GV_PAL_BYP;
+
+    /* The graphics and video data are passed through gamma correction
RAM */
     misc &= ~DF_GAMMA_BYPASS_BOTH;
 
     WRITE_VID32(DF_DISPLAY_CONFIG, dcfg);
diff --git a/src/lx_display.c b/src/lx_display.c
index b950203..e36fe59 100644
--- a/src/lx_display.c
+++ b/src/lx_display.c
@@ -339,8 +339,16 @@ lx_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 * red,
CARD16 * green,
 
     assert(size == 256);
 
+    /* We need the Gamma Correction for video - fading operation,
+     * the values address should be plused for every cycle.
+     * Special for Screensaver Operation.
+     */
+
     for (i = 0; i < 256; i++) {
-	unsigned int val = (*red << 8) | *green | (*blue >> 8);
+	(*red) &= 0xff00;
+	(*green) &= 0xff00;
+	(*blue) &= 0xff00;
+	unsigned int val = (*(red++) << 8) | *(green++) | (*(blue++) >>
8);
 
 	df_set_video_palette_entry(i, val);
     }
-- 
1.7.1




More information about the Xorg-driver-geode mailing list