Commit 3b317c91 authored by Antonino Daplas's avatar Antonino Daplas Committed by Linus Torvalds

[PATCH] rivafb: directcolor mode and miscellaneous fixes

Although the rivafb advertises its capability as DirectColor, the hardware
is actually set in Truecolor (CLUT cannot be altered).  This mismatch
occasionally produces wrong colors, such as wrong logo colors at 32bpp and
gamma utilities (such as xgamma) does not work at all.

Changes:

1. Fixes the above problems by setting the hardware to accept changing
   of the CLUT.

2. Fixes color problems for NV_ARCH_03 (Riva128)

3. Build a private modelist from the EDID (for use by fbcon)

4. Mark several functions/data as __devinit/__initdata

5. Remove unused fields from struct riva_par 
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ebf4fd17
This diff is collapsed.
...@@ -1300,8 +1300,9 @@ static void CalcStateExt ...@@ -1300,8 +1300,9 @@ static void CalcStateExt
} }
/* Paul Richards: below if block borks things in kernel for some reason */ /* Paul Richards: below if block borks things in kernel for some reason */
/* if((bpp != 8) && (chip->Architecture != NV_ARCH_03)) /* Tony: Below is needed to set hardware in DirectColor */
state->general |= 0x00000030; */ if((bpp != 8) && (chip->Architecture != NV_ARCH_03))
state->general |= 0x00000030;
state->vpll = (p << 16) | (n << 8) | m; state->vpll = (p << 16) | (n << 8) | m;
state->repaint0 = (((width/8)*pixelDepth) & 0x700) >> 3; state->repaint0 = (((width/8)*pixelDepth) & 0x700) >> 3;
......
...@@ -105,8 +105,9 @@ static int riva_setup_i2c_bus(struct riva_i2c_chan *chan, const char *name) ...@@ -105,8 +105,9 @@ static int riva_setup_i2c_bus(struct riva_i2c_chan *chan, const char *name)
chan->algo.setscl = riva_gpio_setscl; chan->algo.setscl = riva_gpio_setscl;
chan->algo.getsda = riva_gpio_getsda; chan->algo.getsda = riva_gpio_getsda;
chan->algo.getscl = riva_gpio_getscl; chan->algo.getscl = riva_gpio_getscl;
chan->algo.udelay = 40; chan->algo.udelay = 5;
chan->algo.timeout = 20; chan->algo.mdelay = 5;
chan->algo.timeout = 10;
chan->algo.data = chan; chan->algo.data = chan;
i2c_set_adapdata(&chan->adapter, chan); i2c_set_adapdata(&chan->adapter, chan);
......
...@@ -44,7 +44,8 @@ struct riva_i2c_chan { ...@@ -44,7 +44,8 @@ struct riva_i2c_chan {
struct riva_par { struct riva_par {
RIVA_HW_INST riva; /* interface to riva_hw.c */ RIVA_HW_INST riva; /* interface to riva_hw.c */
u32 pseudo_palette[16]; /* default palette */
u32 palette[16]; /* for Riva128 */
caddr_t ctrl_base; /* virtual control register base addr */ caddr_t ctrl_base; /* virtual control register base addr */
unsigned dclk_max; /* max DCLK */ unsigned dclk_max; /* max DCLK */
...@@ -54,8 +55,6 @@ struct riva_par { ...@@ -54,8 +55,6 @@ struct riva_par {
struct vgastate state; struct vgastate state;
#endif #endif
atomic_t ref_count; atomic_t ref_count;
u32 cursor_data[32 * 32/4];
int cursor_reset;
unsigned char *EDID; unsigned char *EDID;
unsigned int Chipset; unsigned int Chipset;
int forceCRTC; int forceCRTC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment