Re: Penguin logo and scrollback

Kurt Garloff (garloff@kg1.ping.de)
Mon, 16 Nov 1998 16:00:36 +0100


--uZ3hkaAS1mZxFaxD
Content-Type: text/plain; charset=us-ascii

On Mon, Nov 16, 1998 at 03:14:39AM +0000, H. Peter Anvin wrote:
> Hi folks,
>
> I just got 2.1.129-pre2 with the Matrox framebuffer device, and I have
> two questions about it, which I do not seem to be able to find docs for:
>
> 1. The penguins are somewhat neat, but they make scrollback of the
> bootup messages impossible (all you see is a pair of penguin
> heads.) This is, IMNSHO, not acceptable. How do I make this more
> reasonable?

I created a patch to fix this, some time ago. I posted it to Linux-Kernel,
but to my great astonishment, no one answered.

Of course, I still have it in my tree ...

What the patch does:
* Move logos to the upper RIGHT corner
* Only copy logo area when scrolling, so the beginning of the lines is not
deleted and can be scrolled back.

It's appended.

-- 
Kurt Garloff <K.Garloff@ping.de>  (Dortmund, FRG)
PGP key on http://student.physik.uni-dortmund.de/homepages/garloff
Unix IS user friendly - it's just selective about who its friends are!

--uZ3hkaAS1mZxFaxD Content-Type: text/plain; charset=us-ascii Content-Description: 21125-fbcon-logo-scroll.diff Content-Disposition: attachment; filename="21125-fbcon-logo-scroll.diff"

--- linux/drivers/video/fbcon.c.orig Wed Oct 21 00:22:30 1998 +++ linux/drivers/video/fbcon.c Thu Oct 22 01:33:48 1998 @@ -481,7 +481,7 @@ nr_cols = p->var.xres/fontwidth(p); nr_rows = p->var.yres/fontheight(p); - + if (logo) { /* Need to make room for the logo */ int cnt; @@ -490,17 +490,17 @@ logo_lines = (LOGO_H + fontheight(p) - 1) / fontheight(p); q = (unsigned short *)(conp->vc_origin + conp->vc_size_row * old_rows); step = logo_lines * old_cols; - for (r = q - logo_lines * old_cols; r < q; r++) - if (*r != conp->vc_video_erase_char) - break; + for (r = q - logo_lines * old_cols; r < q; r++) + if (*r != conp->vc_video_erase_char) + break; if (r != q && nr_rows >= old_rows + logo_lines) { save = kmalloc(logo_lines * nr_cols * 2, GFP_KERNEL); if (save) { - int i = old_cols < nr_cols ? old_cols : nr_cols; - scr_memsetw(save, conp->vc_video_erase_char, logo_lines * nr_cols * 2); - r = q - step; - for (cnt = 0; cnt < logo_lines; cnt++, r += i) - scr_memcpyw_to(save + cnt * nr_cols, r, 2 * i); + int i = old_cols < nr_cols ? old_cols : nr_cols; + scr_memsetw(save, conp->vc_video_erase_char, logo_lines * nr_cols * 2); + r = q - step; + for (cnt = 0; cnt < logo_lines; cnt++, r += i) + scr_memcpyw_to(save + cnt * nr_cols, r, 2 * i); r = q; } } @@ -942,6 +942,7 @@ int unit = conp->vc_num; struct display *p = &fb_display[unit]; int is_txt = (p->type == FB_TYPE_TEXT); + int logos_left = 0; int logos_width = conp->vc_cols; if (!p->can_soft_blank && console_blanked) return 0; @@ -959,6 +960,18 @@ switch (dir) { case SM_UP: + /* K.Garloff@ping.de, 98/10/21: If logo is diplayed, only save logo + * and not the hole top region. In combination with the logo being + * displayed on the right side, this allows scrollback feature + * when bootlogo is displayed. */ + if (t != 0 && logo_shown == fg_console) { + int unit = conp->vc_num; + struct display *p = &fb_display[unit]; + int lw = (smp_num_cpus * (LOGO_W + 8) - 7) / fontwidth(p) + 1; + logos_left = conp->vc_cols - lw; + if (logos_left < 0) logos_left = 0; + else logos_width = lw; + } if (count > conp->vc_rows) /* Maximum realistic size */ count = conp->vc_rows; switch (p->scrollmode & __SCROLL_YMASK) { @@ -970,11 +983,10 @@ break; case __SCROLL_YWRAP: - if (b-t-count > 3*conp->vc_rows>>2) { + if (b-t-count > 2*conp->vc_rows/3) { if (t > 0) - fbcon_bmove(conp, 0, 0, count, 0, t, - conp->vc_cols); - ywrap_up(unit, conp, p, count); + fbcon_bmove(conp, 0, logos_left, count, logos_left, t, logos_width); + ywrap_up(unit, conp, p, count); if (conp->vc_rows-b > 0) fbcon_bmove(conp, b-count, 0, b, 0, conp->vc_rows-b, conp->vc_cols); @@ -988,10 +1000,9 @@ case __SCROLL_YPAN: if (( is_txt && (b-t == conp->vc_rows)) || - (!is_txt && (b-t-count > 3*conp->vc_rows>>2))) { + (!is_txt && (b-t-count > 2*conp->vc_rows/3))) { if (t > 0) - fbcon_bmove(conp, 0, 0, count, 0, t, - conp->vc_cols); + fbcon_bmove(conp, 0, logos_left, count, logos_left, t, logos_width); ypan_up(unit, conp, p, count); if (conp->vc_rows-b > 0) fbcon_bmove(conp, b-count, 0, b, 0, @@ -1670,8 +1681,8 @@ logo_depth = 1; } - for (x = 0; x < smp_num_cpus * (LOGO_W + 8) && - x < p->var.xres - (LOGO_W + 8); x += (LOGO_W + 8)) { + for (x = p->var.xres - LOGO_W; x > 0 && x > p->var.xres + - smp_num_cpus * (LOGO_W + 8); x -= (LOGO_W + 8)) { #if defined(CONFIG_FBCON_CFB16) || defined(CONFIG_FBCON_CFB24) || \ defined(CONFIG_FBCON_CFB32) || defined(CONFIG_FB_SBUS)

--uZ3hkaAS1mZxFaxD--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/