Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MS48d-0005w0-3j for mharc-grub-devel@gnu.org; Sat, 18 Jul 2009 03:15:19 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MS48b-0005vt-Ro for grub-devel@gnu.org; Sat, 18 Jul 2009 03:15:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MS48W-0005vY-Ca for grub-devel@gnu.org; Sat, 18 Jul 2009 03:15:16 -0400 Received: from [199.232.76.173] (port=57828 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MS48W-0005vS-35 for grub-devel@gnu.org; Sat, 18 Jul 2009 03:15:12 -0400 Received: from mx20.gnu.org ([199.232.41.8]:5650) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MS48V-0002yR-Ki for grub-devel@gnu.org; Sat, 18 Jul 2009 03:15:11 -0400 Received: from mail-yx0-f172.google.com ([209.85.210.172]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MS48U-0006EP-2z for grub-devel@gnu.org; Sat, 18 Jul 2009 03:15:10 -0400 Received: by yxe2 with SMTP id 2so2387131yxe.14 for ; Sat, 18 Jul 2009 00:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:message-id :from:to:content-type:content-transfer-encoding:mime-version:subject :date:x-mailer; bh=5qJVjB4AB3AJrKkCrafh2YWsmBWbqHWi37AwH8Du53A=; b=RaeZBZn3p2BhWsep5in7ojUlW/O9hqm1GTvt84QCkvo71NCllY3s4U6T2acj3KXs5w I+VS/+hz0wKRoc/hiBeKztr6qj7U+iYoIBcMxiX32gvPEuJDZI9852CTYtZ/968TSSEY Jmu60esKZ3zTub8z7iUg4YCYOm1kfhMsydqB4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=KH+Nf/pVxCiC+0RtLBqjocUHqQOB6Favv9NVgawYVtupWDSrDwVMALuOIyYdNx8KXW UkblYgOaPuqjToAcbLHrNz6JsD1E/oV4oNFPbJAzwV5gWrktUIczUc28f0DqORezx8RL GoQi1n+rPyg5H7FtM8iPvlTPr7ksE4y9Pi2NI= Received: by 10.100.164.17 with SMTP id m17mr2743904ane.29.1247901308513; Sat, 18 Jul 2009 00:15:08 -0700 (PDT) Received: from mail.definitelynotsafe.com (cpe-66-75-249-204.san.res.rr.com [66.75.249.204]) by mx.google.com with ESMTPS id c14sm2883340ana.12.2009.07.18.00.15.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 18 Jul 2009 00:15:07 -0700 (PDT) Sender: Joe Auricchio Received: from [10.24.0.125] (unknown [10.24.0.1]) (Authenticated sender: jauricch) by mail.definitelynotsafe.com (Postfix) with ESMTPSA id 6D28916C50 for ; Sat, 18 Jul 2009 00:14:32 -0700 (PDT) Message-Id: <8FB98151-B0A2-4308-A065-15607AE9E8D8@gmail.com> From: Joe Auricchio To: grub-devel@gnu.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Sat, 18 Jul 2009 00:15:04 -0700 X-Mailer: Apple Mail (2.935.3) X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [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: Sat, 18 Jul 2009 07:15:17 -0000 Hi, My first patch! Please be nice. * src/term/gfxterm.c (grub_virtual_screen_setup): Clear out text_buffer instead of leaving it uninitialized. 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; }