Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MSw0n-0007xM-5a for mharc-grub-devel@gnu.org; Mon, 20 Jul 2009 12:46:49 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MSw0l-0007x3-Dl for grub-devel@gnu.org; Mon, 20 Jul 2009 12:46:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MSw0g-0007uS-Ku for grub-devel@gnu.org; Mon, 20 Jul 2009 12:46:46 -0400 Received: from [199.232.76.173] (port=53255 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MSw0g-0007uK-HX for grub-devel@gnu.org; Mon, 20 Jul 2009 12:46:42 -0400 Received: from mail-fx0-f213.google.com ([209.85.220.213]:34669) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MSw0g-0000eu-57 for grub-devel@gnu.org; Mon, 20 Jul 2009 12:46:42 -0400 Received: by fxm9 with SMTP id 9so204591fxm.42 for ; Mon, 20 Jul 2009 09:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=bA0o1TY+emCFdIJ5nrSCDkrEI9cihzGTSg69LkDWILc=; b=BkRj+AfbwzDzlLvM+OO70GyqTs556XlJsBGiaPhqSkD045v9kofk7PgnDNG/T3zIkm zK7KpQ7/C/b8eCtxGaNs6Dsc4XKT+BJAzksj3GJsLG0hggfRUWv6JbftWJiuEcFIAoP0 lSvIC3q9ElRcf6GM30JEwLTxotO65PlTLZn9E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=nN6sEX3ba7d/s0q41HYBsG4aShN4IiWIE4/eWEWK+IfsMVbUHGbIbWHHqWR52PF8Wb s0xcwwhEbZYn216VpSgAHVg2HfLbMcFQ5g+7ESjj5LCy1J+Dk5VmVcarmWiXAZcYPAU5 yYAK6aHgWJWaGBgm/ZQcx6ga7owesxiZPMTXo= MIME-Version: 1.0 Received: by 10.204.70.196 with SMTP id e4mr4531518bkj.65.1248108400008; Mon, 20 Jul 2009 09:46:40 -0700 (PDT) In-Reply-To: <8FB98151-B0A2-4308-A065-15607AE9E8D8@gmail.com> References: <8FB98151-B0A2-4308-A065-15607AE9E8D8@gmail.com> Date: Mon, 20 Jul 2009 18:46:39 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] Clear out gfxterm's virtual text_buffer - fixes junk at end of lines X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 16:46:47 -0000 On Sat, Jul 18, 2009 at 9:15 AM, Joe Auricchio 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 t= o > gfxterm and until your clear the screen or scroll, the last position of > every line has a random junk character in random foreground and backgroun= d > 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 ju= nk > 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 > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > > --- a/term/gfxterm.c =A0 =A02009-07-07 16:58:06.000000000 -0700 > +++ b/term/gfxterm.c =A0 =A02009-07-16 15:22:13.000000000 -0700 > @@ -225,6 +225,17 @@ > > =A0grub_video_set_active_render_target > (GRUB_VIDEO_RENDER_TARGET_DISPLAY); > > + =A0/* Clear out text buffer */ > + =A0unsigned int i; > + =A0for(i =3D 0; i < virtual_screen.columns * virtual_screen.rows; i++) > + =A0{ > + =A0 =A0 =A0virtual_screen.text_buffer[i].code =3D ' '; > + =A0 =A0 =A0virtual_screen.text_buffer[i].fg_color =3D virtual_screen.fg= _color; > + =A0 =A0 =A0virtual_screen.text_buffer[i].bg_color =3D virtual_screen.bg= _color; > + =A0 =A0 =A0virtual_screen.text_buffer[i].width =3D 0; > + =A0 =A0 =A0virtual_screen.text_buffer[i].index =3D 0; > + =A0} > + > =A0return grub_errno; > } > don't mix declarations and statements. Let 2 spaces before '{' and '}'. Other than this patch is good. Committed > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git