* [PATCH] fbdev: Shift pixel value before entering loop in cfbimageblit
@ 2005-11-19 1:53 Antonino A. Daplas
0 siblings, 0 replies; only message in thread
From: Antonino A. Daplas @ 2005-11-19 1:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Fbdev development list
In slow imageblit, the pixel value is shifted by a certain amount
(dependent on the bpp and endianness) for each iteration. This is
inefficient. Better do the shifting once before going into the loop.
Signed-off-by: Antonino Daplas <adaplas@pol.net>
---
drivers/video/cfbimgblt.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/video/cfbimgblt.c b/drivers/video/cfbimgblt.c
index a7770c4..7a01742 100644
--- a/drivers/video/cfbimgblt.c
+++ b/drivers/video/cfbimgblt.c
@@ -162,6 +162,8 @@ static inline void slow_imageblit(const
u32 i, j, l;
dst2 = (u32 __iomem *) dst1;
+ fgcolor <<= LEFT_POS(bpp);
+ bgcolor <<= LEFT_POS(bpp);
for (i = image->height; i--; ) {
shift = val = 0;
@@ -180,7 +182,6 @@ static inline void slow_imageblit(const
while (j--) {
l--;
color = (*s & 1 << (BIT_NR(l))) ? fgcolor : bgcolor;
- color <<= LEFT_POS(bpp);
val |= SHIFT_HIGH(color, shift);
/* Did the bitshift spill bits to the next long? */
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2005-11-19 2:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-19 1:53 [PATCH] fbdev: Shift pixel value before entering loop in cfbimageblit Antonino A. Daplas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).