Hack against the blank console problem:

Leave the CLUT alone on ancient cards. At least this leaves us with a
semi working console (red and blue are flipped). Leave an example of what
seems to be happening but disable it because colors are better than 444 bit
greyscale.
This commit is contained in:
christos 2015-03-18 02:57:13 +00:00
parent 786a747d1e
commit 80cc774264
1 changed files with 30 additions and 6 deletions

View File

@ -181,12 +181,36 @@ static void legacy_crtc_load_lut(struct drm_crtc *crtc)
dac2_cntl |= RADEON_DAC2_PALETTE_ACC_CTL;
WREG32(RADEON_DAC_CNTL2, dac2_cntl);
WREG8(RADEON_PALETTE_INDEX, 0);
for (i = 0; i < 256; i++) {
WREG32(RADEON_PALETTE_30_DATA,
(radeon_crtc->lut_r[i] << 20) |
(radeon_crtc->lut_g[i] << 10) |
(radeon_crtc->lut_b[i] << 0));
/*
* At least the RV100 [vendor 1002 product 515e (rev. 0x02)]
* has an old style palette
*/
if (ASIC_IS_RV100(rdev)) {
#ifdef notyet
/*
* Leave CLUT alone for now. The code below gives us a
* nice 444 grayscale, but we are not in true color mode
* anymore and I don't have any docs how to do this right.
*/
WREG8(RADEON_PALETTE_INDEX, 0);
for (i = 0; i < 256; i++) {
#define R(x) (radeon_crtc->lut_r[i] >> 2)
#define G(x) (radeon_crtc->lut_g[i] >> 2)
#define B(x) (radeon_crtc->lut_b[i] >> 2)
WREG32(RADEON_PALETTE_DATA, ((R(i) << 16)
| (G(i) << 8) | B(i)) << 4);
}
#else
printf("%s: unknown DAC, can't set lookup table\n", __func__);
#endif
} else {
WREG8(RADEON_PALETTE_INDEX, 0);
for (i = 0; i < 256; i++) {
WREG32(RADEON_PALETTE_30_DATA,
(radeon_crtc->lut_r[i] << 20) |
(radeon_crtc->lut_g[i] << 10) |
(radeon_crtc->lut_b[i] << 0));
}
}
}