* SM501: Align PANEL fb to PAGE_SIZE
@ 2008-07-17 10:43 Ben Dooks
0 siblings, 0 replies; only message in thread
From: Ben Dooks @ 2008-07-17 10:43 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: akpm, Ben Dooks
[-- Attachment #1: simtec/simtec-drivers-fb-sm501-pagealign.patch --]
[-- Type: text/plain, Size: 1383 bytes --]
Some programs, such as anything linked with directfb get
the drawing wrong if given an screen start which is not
aligned to PAGE_SIZE. Change the allocator to always return
an properly aligned address when asked for PANEL memory.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.26-quilt1/drivers/video/sm501fb.c
===================================================================
--- linux-2.6.26-quilt1.orig/drivers/video/sm501fb.c 2008-07-16 15:02:59.000000000 +0100
+++ linux-2.6.26-quilt1/drivers/video/sm501fb.c 2008-07-16 15:06:12.000000000 +0100
@@ -162,6 +162,13 @@ static int sm501_alloc_mem(struct sm501f
ptr = inf->fbmem_len - size;
fbi = inf->fb[HEAD_CRT];
+ /* round down, some programs such as directfb do not draw
+ * 0,0 correctly unless the start is aligned to a page start.
+ */
+
+ if (ptr > 0)
+ ptr &= ~(PAGE_SIZE - 1);
+
if (fbi && ptr < fbi->fix.smem_len)
return -ENOMEM;
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
-------------------------------------------------------------------------
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=/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-07-17 10:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-17 10:43 SM501: Align PANEL fb to PAGE_SIZE Ben Dooks
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).