summaryrefslogtreecommitdiff
path: root/src/radeon_driver.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-03-13 17:51:56 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-03-13 17:58:06 -0400
commit1db81afe4f8db55e02a65cd22ad84c6bbb27e8ef (patch)
tree7df77b815947f7fb6b276e50257abb7346ebbc92 /src/radeon_driver.c
parent5bb326c64ad3bf5c93943280dcbcb25c8910d1aa (diff)
radeon: add support for 30 bit LUTs
All radeons have them. Thanks to Yang Zhao for figuring this out.
Diffstat (limited to 'src/radeon_driver.c')
-rw-r--r--src/radeon_driver.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 2e4967f1..d1b2f540 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3122,9 +3122,9 @@ static void RADEONLoadPalette(ScrnInfoPtr pScrn, int numColors,
RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
for (i = 0 ; i < 256; i++) {
- lut_r[i] = radeon_crtc->lut_r[i] << 8;
- lut_g[i] = radeon_crtc->lut_g[i] << 8;
- lut_b[i] = radeon_crtc->lut_b[i] << 8;
+ lut_r[i] = radeon_crtc->lut_r[i] << 6;
+ lut_g[i] = radeon_crtc->lut_g[i] << 6;
+ lut_b[i] = radeon_crtc->lut_b[i] << 6;
}
switch (info->CurrentLayout.depth) {
@@ -3132,9 +3132,9 @@ static void RADEONLoadPalette(ScrnInfoPtr pScrn, int numColors,
for (i = 0; i < numColors; i++) {
index = indices[i];
for (j = 0; j < 8; j++) {
- lut_r[index * 8 + j] = colors[index].red << 8;
- lut_g[index * 8 + j] = colors[index].green << 8;
- lut_b[index * 8 + j] = colors[index].blue << 8;
+ lut_r[index * 8 + j] = colors[index].red << 6;
+ lut_g[index * 8 + j] = colors[index].green << 6;
+ lut_b[index * 8 + j] = colors[index].blue << 6;
}
}
case 16:
@@ -3143,21 +3143,21 @@ static void RADEONLoadPalette(ScrnInfoPtr pScrn, int numColors,
if (i <= 31) {
for (j = 0; j < 8; j++) {
- lut_r[index * 8 + j] = colors[index].red << 8;
- lut_b[index * 8 + j] = colors[index].blue << 8;
+ lut_r[index * 8 + j] = colors[index].red << 6;
+ lut_b[index * 8 + j] = colors[index].blue << 6;
}
}
-
+
for (j = 0; j < 4; j++) {
- lut_g[index * 4 + j] = colors[index].green << 8;
+ lut_g[index * 4 + j] = colors[index].green << 6;
}
}
default:
for (i = 0; i < numColors; i++) {
index = indices[i];
- lut_r[index] = colors[index].red << 8;
- lut_g[index] = colors[index].green << 8;
- lut_b[index] = colors[index].blue << 8;
+ lut_r[index] = colors[index].red << 6;
+ lut_g[index] = colors[index].green << 6;
+ lut_b[index] = colors[index].blue << 6;
}
break;
}
@@ -3749,7 +3749,8 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Initializing color map\n");
if (!miCreateDefColormap(pScreen)) return FALSE;
- if (!xf86HandleColormaps(pScreen, 256, info->dac6bits ? 6 : 8,
+ /* all radeons support 10 bit CLUTs */
+ if (!xf86HandleColormaps(pScreen, 256, 10,
RADEONLoadPalette, NULL,
CMAP_PALETTED_TRUECOLOR
#if 0 /* This option messes up text mode! (eich@suse.de) */