From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KmZ6z-0008K9-Iq for mharc-grub-devel@gnu.org; Sun, 05 Oct 2008 15:17:49 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KmZ6x-0008I7-4v for grub-devel@gnu.org; Sun, 05 Oct 2008 15:17:47 -0400 Received: from [199.232.76.173] (port=44466 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KmZ6v-0008Hb-Md for grub-devel@gnu.org; Sun, 05 Oct 2008 15:17:45 -0400 Received: from smtp.aircanopy.net ([66.160.208.25]:43492) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KmZ6v-0002kI-Cx for grub-devel@gnu.org; Sun, 05 Oct 2008 15:17:45 -0400 X-ASG-Debug-ID: 1223234262-2c0b00190000-Td4drV X-Barracuda-URL: http://66.160.208.25:8000/cgi-bin/mark.cgi Received: from aczmr1.aircanopy.net (aczmr1.aircanopy.net [66.160.208.172]) by smtp.aircanopy.net (Spam Firewall) with ESMTP id A01A88774BA for ; Sun, 5 Oct 2008 14:17:42 -0500 (CDT) Received: from aczmr1.aircanopy.net (aczmr1.aircanopy.net [66.160.208.172]) by smtp.aircanopy.net with ESMTP id 9VL1jbM87gXidNEf for ; Sun, 05 Oct 2008 14:17:42 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by aczmr1.aircanopy.net (Postfix) with ESMTP id 8C5301D9FA for ; Sun, 5 Oct 2008 14:17:42 -0500 (CDT) X-Virus-Scanned: amavisd-new at X-Spam-Score: -1.609 Received: from aczmr1.aircanopy.net ([127.0.0.1]) by localhost (aczmr1.aircanopy.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uQoiZ22mPvaT for ; Sun, 5 Oct 2008 14:17:42 -0500 (CDT) Received: from aczmb1.aircanopy.net (aczmb1.aircanopy.net [66.160.208.170]) by aczmr1.aircanopy.net (Postfix) with ESMTP id 3405E18258 for ; Sun, 5 Oct 2008 14:17:42 -0500 (CDT) Date: Sun, 5 Oct 2008 14:17:42 -0500 (CDT) From: Andy Goth To: The development of GRUB 2 Message-ID: <1454803125.39941223234262084.JavaMail.root@aczmb1> In-Reply-To: <1745824252.39921223234235570.JavaMail.root@aczmb1> X-ASG-Orig-Subj: Re: [PATCH] GSoC #07 VBE double buffering (vs r1885) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [66.160.219.98] X-Mailer: Zimbra 5.0.8_GA_2462.SLES10_64 (ZimbraWebClient - FF2.0 (Linux)/5.0.8_GA_2462.SLES10_64) X-Barracuda-Connect: aczmr1.aircanopy.net[66.160.208.172] X-Barracuda-Start-Time: 1223234262 X-Barracuda-Virus-Scanned: by Aircanopy Spam Firewall at aircanopy.net X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.7322 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Subject: Re: [PATCH] GSoC #07 VBE double buffering (vs r1885) 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: Sun, 05 Oct 2008 19:17:47 -0000 "Colin D Bennett" wrote: > However, in double buffered mode the last rendered frame might > not be in the back buffer after calling swap_buffers, depending > on the double buffering strategy selected at runtime: > > 1. page flipping is in use > 2. back buffer is in main memory With a little bookkeeping you can avoid having to redraw the whole screen. Here are some strategies: (double buffering with page flipping and drawing to main memory) Draw to a buffer in main memory. Maintain a list of changed regions. This is your list of dirty rectangles. After completing a frame, blit the dirty rectangles to the page that's about to get flipped into view. Age all dirty rectangles by one frame, and remove all dirty rectangles that were previously aged. If the dirty rectangle list gets too long, just blit the whole screen. Clever algorithms can combine dirty rectangles to save memory. (double buffering with page flipping without drawing to main memory) Draw to the back buffer, and maintain a dirty rectangle list. Immediately after vertical retrace start, flip pages, and blit the dirty rectangles to the new back buffer from the (now being displayed) old back buffer. Empty the dirty rectangle list. (double buffering without page flipping) Draw to a buffer in main memory, and maintain a dirty rectangle list. During vertical retrace, blit the dirty rectangles to VRAM. Empty the dirty rectangle list. (single buffering with minimal shearing) Draw to VRAM. Wait for the start of vertical retrace before drawing. Hopefully all drawing can complete before the monitor gets repainted. (single buffering) Draw to VRAM. Disclaimer: I don't actually know what you're trying to do (plain text, drop shadows, animation, 3D graphics... no clue), so the stuff I suggest might be overkill. Nevertheless, I hope it is helpful. -- Andy Goth | http://andy.junkdrome.org/ unununium@{aircanopy.net,openverse.com}