diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-07-25 22:52:51 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-07-25 22:52:51 +0000 |
commit | 08cf98b3f221c27d944f194aeb9655856f4493e1 (patch) | |
tree | 1c9304148f4c73f2472954bb940342e72e96a3fe | |
parent | 4bc99b6f96a67bde5c4af477acff2edf763d6b07 (diff) | |
download | mpv-08cf98b3f221c27d944f194aeb9655856f4493e1.tar.bz2 mpv-08cf98b3f221c27d944f194aeb9655856f4493e1.tar.xz |
vide EQ fixed - lumactl register is not readable!
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6806 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | vidix/drivers/mga_vid.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/vidix/drivers/mga_vid.c b/vidix/drivers/mga_vid.c index eee5f10667..0c5ba8b72e 100644 --- a/vidix/drivers/mga_vid.c +++ b/vidix/drivers/mga_vid.c @@ -1435,11 +1435,6 @@ int vixSetGrKeys(const vidix_grkey_t *grkey) int vixPlaybackSetEq( const vidix_video_eq_t * eq) { - uint32_t luma = 0; - float factor = 256.0 / 2000; - static int32_t prev_br = 0; - static int32_t prev_c = 0; - /* contrast and brightness control isn't supported on G200 - alex */ if (!is_g400) { @@ -1447,22 +1442,27 @@ int vixPlaybackSetEq( const vidix_video_eq_t * eq) return(ENOTSUP); } - if (eq->cap & VEQ_CAP_BRIGHTNESS) { prev_br=eq->brightness; if ( prev_br == 1000 ) prev_br=999; } - if (eq->cap & VEQ_CAP_CONTRAST) { prev_c=eq->contrast; if ( prev_c == 1000 ) prev_c=999; } - - luma = ((int)(prev_br * factor) << 16) + ((int)(prev_c * factor) & 0xFFFF); - - regs.beslumactl = luma+0x80; - + // only brightness&contrast are supported: + if(!(eq->cap & (VEQ_CAP_BRIGHTNESS|VEQ_CAP_CONTRAST))) + return(ENOTSUP); + + //regs.beslumactl = readl(mga_mmio_base + BESLUMACTL); +// printf("LUMA = %08X \n",regs.beslumactl); + if (eq->cap & VEQ_CAP_BRIGHTNESS) { + regs.beslumactl &= 0xFFFF; + regs.beslumactl |= (eq->brightness*255/2000)<<16; + } + if (eq->cap & VEQ_CAP_CONTRAST) { + regs.beslumactl &= 0xFFFF0000; + regs.beslumactl |= (128+eq->contrast*255/2000)&0xFFFF; + } writel(regs.beslumactl,mga_mmio_base + BESLUMACTL); + return(0); } int vixPlaybackGetEq( vidix_video_eq_t * eq) { - uint32_t luma; - float factor = 2000.0 / 256; - /* contrast and brightness control isn't supported on G200 - alex */ if (!is_g400) { @@ -1470,12 +1470,13 @@ int vixPlaybackGetEq( vidix_video_eq_t * eq) return(ENOTSUP); } - regs.beslumactl = readl(mga_mmio_base + BESLUMACTL); - luma = regs.beslumactl-0x80; +// regs.beslumactl = readl(mga_mmio_base + BESLUMACTL); - eq->brightness = (signed short int)(luma >> 16) * factor; - eq->contrast = (signed short int)(luma & 0xFFFF) * factor; + eq->brightness = (signed short int)(regs.beslumactl >> 16) * 1000 / 128; + eq->contrast = (signed short int)(regs.beslumactl & 0xFFFF) * 1000 / 128 - 1000; eq->cap = VEQ_CAP_BRIGHTNESS | VEQ_CAP_CONTRAST; + + printf("MGA GET_EQ: br=%d c=%d \n",eq->brightness,eq->contrast); return(0); } |