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

Cui, Hunk Hunk.Cui at amd.com
Thu Jul 1 00:42:16 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 for Screensaver Operation
*FreeDesktop Bugzilla #27853

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

diff --git a/src/cim/cim_df.c b/src/cim/cim_df.c
index 242603a..676ef3c 100644
--- a/src/cim/cim_df.c
+++ b/src/cim/cim_df.c
@@ -981,7 +981,14 @@ 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..856ad95 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.6.0.6




More information about the Xorg-driver-geode mailing list