summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHunk Cui <Hunk.Cui@amd.com>2010-07-12 12:57:39 +0800
committerMartin-Éric Racine <q-funk@iki.fi>2010-08-06 17:35:34 +0300
commit2bcbc0b64091218d348ad9f699370e4bfde3948b (patch)
treee8edf2094dc686649eb7f2683eebca6e065890bd /src
parentecb741f27de4ca66555d312a4699efc22f873d0e (diff)
Gamma Correction for fading operation
*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@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/cim/cim_df.c9
-rw-r--r--src/lx_display.c10
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);
}