summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorJerome Glisse <glisse@freedesktop.org>2007-12-06 23:36:58 +0100
committerJerome Glisse <glisse@freedesktop.org>2007-12-06 23:36:58 +0100
commita693e8ab12432787a3c02fa5b8f7649a08122012 (patch)
tree5cc72b92015ba2d11eb87c042f6376d69b020e26 /linux-core
parenta39560e767f8d66508f7cf98222199b2cc96fcaf (diff)
radeon_ms: fix fbcon by fixing palette
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/radeon_ms_fb.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/linux-core/radeon_ms_fb.c b/linux-core/radeon_ms_fb.c
index b629b9eb..fc9e99ec 100644
--- a/linux-core/radeon_ms_fb.c
+++ b/linux-core/radeon_ms_fb.c
@@ -52,12 +52,35 @@ static int radeonfb_setcolreg(unsigned regno, unsigned red,
unsigned transp, struct fb_info *info)
{
struct radeonfb_par *par = info->par;
+ struct drm_framebuffer *fb = par->crtc->fb;
struct drm_crtc *crtc = par->crtc;
- if (regno > 255)
+ if (regno > 255) {
return 1;
- if (crtc->funcs->gamma_set)
+ }
+ if (crtc->funcs->gamma_set) {
crtc->funcs->gamma_set(crtc, red, green, blue, regno);
+ }
+ if (regno < 16) {
+ switch (fb->depth) {
+ case 15:
+ fb->pseudo_palette[regno] = ((red & 0xf800) >> 1) |
+ ((green & 0xf800) >> 6) |
+ ((blue & 0xf800) >> 11);
+ break;
+ case 16:
+ fb->pseudo_palette[regno] = (red & 0xf800) |
+ ((green & 0xfc00) >> 5) |
+ ((blue & 0xf800) >> 11);
+ break;
+ case 24:
+ case 32:
+ fb->pseudo_palette[regno] = ((red & 0xff00) << 8) |
+ (green & 0xff00) |
+ ((blue & 0xff00) >> 8);
+ break;
+ }
+ }
return 0;
}