From da219f75b1ccba2bf6db15602d2c79cafacff317 Mon Sep 17 00:00:00 2001 From: Hunk Cui Date: Tue, 29 Jun 2010 17:09:45 +0800 Subject: [PATCH] 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 in Screensaver Operation *FreeDesktop Bugzilla #27853 Signed-off-by: Hunk Cui --- 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