grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Clear out gfxterm's virtual text_buffer - fixes junk at end


From: Vladimir 'phcoder' Serbinenko
Subject: Re: [PATCH] Clear out gfxterm's virtual text_buffer - fixes junk at end of lines
Date: Mon, 20 Jul 2009 18:46:39 +0200

On Sat, Jul 18, 2009 at 9:15 AM, Joe Auricchio<address@hidden> wrote:
> Hi,
>
> My first patch! Please be nice.
Welcome aboard
>
> * src/term/gfxterm.c (grub_virtual_screen_setup): Clear out text_buffer
> instead of leaving it uninitialized.
>
No needfor "src" part
> This fixes a 100% reproducible and very annoying bug I've found: Switch to
> gfxterm and until your clear the screen or scroll, the last position of
> every line has a random junk character in random foreground and background
> color. I believe the root cause is that the virtual_screen's text_buffer is
> uninitialized; as the cursor reaches a new position, the uninitialized junk
> data is drawn to the screen. Really, the entire screen is junk, but it's
> never marked dirty so it's never drawn. So let's just clear out the whole
> text_buffer when we set up the screen.
>
> -joe
>
> -=-=-=-=-=-=-=-=-=-=-=-=-
>
> --- a/term/gfxterm.c    2009-07-07 16:58:06.000000000 -0700
> +++ b/term/gfxterm.c    2009-07-16 15:22:13.000000000 -0700
> @@ -225,6 +225,17 @@
>
>  grub_video_set_active_render_target
> (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
>
> +  /* Clear out text buffer */
> +  unsigned int i;
> +  for(i = 0; i < virtual_screen.columns * virtual_screen.rows; i++)
> +  {
> +      virtual_screen.text_buffer[i].code = ' ';
> +      virtual_screen.text_buffer[i].fg_color = virtual_screen.fg_color;
> +      virtual_screen.text_buffer[i].bg_color = virtual_screen.bg_color;
> +      virtual_screen.text_buffer[i].width = 0;
> +      virtual_screen.text_buffer[i].index = 0;
> +  }
> +
>  return grub_errno;
> }
>
don't mix declarations and statements. Let 2 spaces before '{' and
'}'. Other than this patch is good. Committed
>
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
>



-- 
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git




reply via email to

[Prev in Thread] Current Thread [Next in Thread]