Thread (13 messages) flat view 13 messages, 4 authors, 2008-07-30

Re: [RFC 2.6.26-rc9 1/5] pxafb: add shared framebuffer interface

From: Russell King - ARM Linux <hidden>
Date: 2008-07-21 11:12:20

On Sun, Jul 20, 2008 at 02:10:29AM -0400, Jaya Kumar wrote:
 	if (fbi->map_cpu) {
 		/* prevent initial garbage on screen */
 		memset(fbi->map_cpu, 0, fbi->map_size);
-		fbi->fb.screen_base = fbi->map_cpu + fbi->video_offset;
+		fbi->fb.screen_base = (char __force __iomem *) fbi->map_cpu
+					+ fbi->video_offset;
I'm not sure this has any benefits - the use of __force in drivers is
definitely frowned upon.

It's well known that FB doesn't sit well with all the MMIO sparse checking
so it's probably a good idea not to try and make it work.
quoted hunk ↗ jump to hunk
@@ -1357,6 +1379,8 @@ static void pxafb_decode_mode_info(struct pxafb_info *fbi,
 		smemlen = modes[i].xres * modes[i].yres * modes[i].bpp / 8;
 		if (smemlen > fbi->fb.fix.smem_len)
 			fbi->fb.fix.smem_len = smemlen;
+		if (inf->custom_xfer_div)
+			fbi->fb.fix.smem_len /= inf->custom_xfer_div;
I don't understand this.  If you have a 640x480 display with 8 bits of
memory per pixel, then it's 307200 bytes no matter whether you're only
using the lower 4 bits and the upper 4 are unused.

If, on the other hand, the lower 4 bits contain one pixel and the upper
4 bits contain the other pixel, then you have a 4 bit per pixel
framebuffer, so 'bpp' should be 4.  In which case the original calculation
gives the correct answer.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help