All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: Knut Petersen <Knut_Petersen@t-online.de>
Subject: Re: RFC: bitmap line alignment
Date: Fri, 25 Nov 2005 20:36:39 +0800	[thread overview]
Message-ID: <43870557.2090005@gmail.com> (raw)
In-Reply-To: <438700A3.3070503@t-online.de>

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

  reply	other threads:[~2005-11-25 12:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-25 12:16 RFC: bitmap line alignment Knut Petersen
2005-11-25 12:36 ` Antonino A. Daplas [this message]
2005-11-25 14:10   ` Knut Petersen

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=43870557.2090005@gmail.com \
    --to=adaplas@gmail.com \
    --cc=Knut_Petersen@t-online.de \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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.