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. Signed-off-by: Robert Morell <rmorell@xxxxxxxxxx> --- drivers/video/tegra/fb.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index 15a4f5b..cc26c59 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -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); -- 1.7.2.2 -- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html