mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
video: tegra: Scale colors in pseudopalette
This fixes incorrect colors drawn by clients such as fbconsole. As described by skeletonfb's fb_setcolreg: "The values supplied have a 16 bit magnitude which needs to be scaled in this function for the hardware." Tested with both r8g8b8 and r5g6b5 pixel depths and fbconsole. Change-Id: Ie3c3579502ddab8843a8a4dc7049c6efaa5d0ac1 Signed-off-by: Robert Morell <rmorell@nvidia.com> Acked-by: Erik Gilling <konkers@android.com>
This commit is contained in:
committed by
Erik Gilling
parent
a60ea58ebe
commit
d340f9224d
@@ -198,6 +198,10 @@ static int tegra_fb_setcolreg(unsigned regno, unsigned red, unsigned green,
|
||||
if (regno >= 16)
|
||||
return -EINVAL;
|
||||
|
||||
red = (red >> (16 - info->var.red.length));
|
||||
green = (green >> (16 - info->var.green.length));
|
||||
blue = (blue >> (16 - info->var.blue.length));
|
||||
|
||||
v = (red << var->red.offset) |
|
||||
(green << var->green.offset) |
|
||||
(blue << var->blue.offset);
|
||||
|
||||
Reference in New Issue
Block a user