All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Goth <unununium@aircanopy.net>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] GSoC #07 VBE double buffering (vs r1885)
Date: Sun, 5 Oct 2008 14:17:42 -0500 (CDT)	[thread overview]
Message-ID: <1454803125.39941223234262084.JavaMail.root@aczmb1> (raw)
In-Reply-To: <1745824252.39921223234235570.JavaMail.root@aczmb1>

"Colin D Bennett" <colin@gibibit.com> 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}



       reply	other threads:[~2008-10-05 19:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1745824252.39921223234235570.JavaMail.root@aczmb1>
2008-10-05 19:17 ` Andy Goth [this message]
2008-10-05 19:47   ` [PATCH] GSoC #07 VBE double buffering (vs r1885) Colin D Bennett
2008-10-05 19:57     ` Andy Goth
2008-10-06 19:02       ` Vesa Jääskeläinen
2008-10-13 16:48         ` Colin D Bennett
2008-10-13 17:12           ` Colin D Bennett
2008-08-31  6:58 [PATCH] GSoC #07 VBE double buffering Colin D Bennett
2008-10-05  4:43 ` [PATCH] GSoC #07 VBE double buffering (vs r1885) Colin D Bennett
2008-10-05  8:52   ` Vesa Jääskeläinen
2008-10-05 16:16     ` Colin D Bennett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454803125.39941223234262084.JavaMail.root@aczmb1 \
    --to=unununium@aircanopy.net \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.