]> git.ipfire.org Git - thirdparty/plymouth.git/commit
frame-buffer: fix flush_area fast-path
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 24 Jun 2012 10:06:07 +0000 (12:06 +0200)
committerRay Strode <rstrode@redhat.com>
Mon, 25 Jun 2012 15:32:56 +0000 (11:32 -0400)
commit72b7e73490a4bbd1311d3b1046cfa4f1e7da9a0c
tree811af0dcb4d256d2100638253a189898cf18a62d
parent675553481d3335fe00bc70adebdee526be2bd90c
frame-buffer: fix flush_area fast-path

plymouth uses a shadow framebuffer to cache screen contents for
quick compositing.  This shadow framebuffer may or may not have
the same memory layout as the hardware framebuffer.  In cases
where the size and layout of pixels are the same between the shadow
framebuffer and the hardware framebuffer we can memcpy()
the pixels line-by-line to the hardware.  If the width of area being
flushed is the same number of bytes as the width of the hardware buffer,
then we can memcpy() the entire flush area in one call to memcpy.

The check for this latter fast-path has a miscalculation that tests
the number of pixels in the flush area width to number of bytes in the
buffer width. This commit adds the * 4 multiplier to correctly compare
bytes with bytes instead of pixels with bytes.

This commit also adds a sanity check to make sure the byte size of the
hardware framebuffer width is equal to the advertised row stride.
src/plugins/renderers/frame-buffer/plugin.c