Mercurial > mplayer.hg
changeset 4250:49746d2bfda7
gamma correction (preliminary version).
author | nick |
---|---|
date | Sat, 19 Jan 2002 08:19:00 +0000 |
parents | dff73bc0eefc |
children | 05affdf4bdcd |
files | vidix/drivers/mga_vid.c |
diffstat | 1 files changed, 27 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/vidix/drivers/mga_vid.c Sat Jan 19 08:18:09 2002 +0000 +++ b/vidix/drivers/mga_vid.c Sat Jan 19 08:19:00 2002 +0000 @@ -1457,3 +1457,30 @@ memcpy(&mga_grkey, grkey, sizeof(vidix_grkey_t)); return(0); } + +#ifdef TEST_ME_PLEASE +vidix_video_eq_t equal = { 0, 0, 0, 0, 0, 0, 0, 0 }; +int vixPlaybackSetEq( const vidix_video_eq_t * eq) +{ + uint32_t beslumactl; + int brightness,contrast; + memcpy(&equal,eq,sizeof(vidix_video_eq_t)); + //Enable contrast and brightness control + writel(readl(mga_mmio_base + BESGLOBCTL) & ~((1<<5) + (1<<7)),mga_mmio_base + BESGLOBCTL); + brightness = (equal.brightness * 128) / 1000; + if(brightness < -128) brightness = -128; + if(brightness > 127) brightness = 127; + contrast = ((equal.contrast + 1000) * 128) / 1000; + if(contrast < 0) contrast = 0; + if(contrast > 255) contrast = 255; + beslumactl = ((brightness & 0xff) << 16) | (contrast & 0xff); + writel(beslumactl,mga_mmio_base + BESLUMACTL); + return 0; +} + +int vixPlaybackGetEq( vidix_video_eq_t * eq) +{ + memcpy(eq,&equal,sizeof(vidix_video_eq_t)); + return 0; +} +#endif