Thread (3 messages) 3 messages, 2 authors, 2005-11-25

Re: RFC: bitmap line alignment

From: "Antonino A. Daplas" <adaplas@gmail.com>
Date: 2005-11-25 12:36:52

Knut Petersen wrote:
Hi everybody

I learned the hard way that image->width*image->height is not equal to the
number of bits consumed by the image bitmap. Every single line of bits is
aligned to a byte boundary.

Wouldn´t it be much more efficient to align every line to an u32 boundary?
Despite the obvious advantages of aligned cpu access to large arrays it
would also help to simplify the code for at least the cyberblade
acceleration
engine.
If you create your own info->pixmap and an info->pixmap.scan_align = 4, the
driver will be fed a bitmap that have a scanline that is 32-bit aligned.
The default if you don't specify anything, of course, will be an 8-bit
aligned bitmap which, for the sake of code efficiency, is the alignment
assumed by the cfb_* drawing functions.

(An example usage is in the patch I attached just a few days ago when
I commented how the cyberblade should be intelligent enough to handle
bitmaps with variable widths.)
The cyberblade always requires 32 bit quantities, so if the width of the
image
is eg. 33, I have to feed _two_ u32 to it for every pixel line. Is the
same true
for other acceleration engines?
Yes, nvidiafb, rivafb and savagefb all require a scan_align of 4, the
i810fb needs u16 (scan_align = 2).

Tony


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help