Skip to content

Commit c47ee9d

Browse files
committed
Avoid blanking console when not in palettised mode
1 parent 14ad68c commit c47ee9d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

drivers/video/bcm2708_fb.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -275,23 +275,23 @@ static int bcm2708_fb_setcolreg(unsigned int regno, unsigned int red,
275275
struct bcm2708_fb *fb = to_bcm2708(info);
276276

277277
/*pr_info("BCM2708FB: setcolreg %d:(%02x,%02x,%02x,%02x) %x\n", regno, red, green, blue, transp, fb->fb.fix.visual);*/
278-
if (regno < 16)
278+
if (fb->fb.var.bits_per_pixel <= 8) {
279+
if (regno < 256) {
280+
/* blue [0:4], green [5:10], red [11:15] */
281+
fb->info->cmap[regno] = ((red >> (16-5)) & 0x1f) << 11 |
282+
((green >> (16-6)) & 0x3f) << 5 |
283+
((blue >> (16-5)) & 0x1f) << 0;
284+
}
285+
/* Hack: we need to tell GPU the palette has changed, but currently bcm2708_fb_set_par takes noticable time when called for every (256) colour */
286+
/* So just call it for what looks like the last colour in a list for now. */
287+
if (regno == 15 || regno == 255)
288+
bcm2708_fb_set_par(info);
289+
} else if (regno < 16) {
279290
fb->cmap[regno] = convert_bitfield(transp, &fb->fb.var.transp) |
280291
convert_bitfield(blue, &fb->fb.var.blue) |
281292
convert_bitfield(green, &fb->fb.var.green) |
282293
convert_bitfield(red, &fb->fb.var.red);
283-
284-
if (regno < 256) {
285-
/* blue [0:4], green [5:10], red [11:15] */
286-
fb->info->cmap[regno] = ((red >> (16-5)) & 0x1f) << 11 |
287-
((green >> (16-6)) & 0x3f) << 5 |
288-
((blue >> (16-5)) & 0x1f) << 0;
289294
}
290-
/* Hack: we need to tell GPU the palette has changed, but currently bcm2708_fb_set_par takes noticable time when called for every (256) colour */
291-
/* So just call it for what looks like the last colour in a list for now. */
292-
if (regno == 15 || regno == 255)
293-
bcm2708_fb_set_par(info);
294-
295295
return regno > 255;
296296
}
297297

0 commit comments

Comments
 (0)