public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh: split coherent pages
@ 2008-12-17  8:18 ` Magnus Damm
  2008-12-17  8:33   ` Paul Mundt
  0 siblings, 1 reply; 3+ messages in thread
From: Magnus Damm @ 2008-12-17  8:18 UTC (permalink / raw)
  To: linux-sh

From: Magnus Damm <damm@igel.co.jp>

Split pages returned by dma_alloc_coherent() and make sure
we free them one by one.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 arch/sh/mm/consistent.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- 0001/arch/sh/mm/consistent.c
+++ work/arch/sh/mm/consistent.c	2008-12-17 17:12:04.000000000 +0900
@@ -42,6 +42,8 @@ void *dma_alloc_coherent(struct device *
 		return NULL;
 	}
 
+	split_page(pfn_to_page(virt_to_phys(ret) >> PAGE_SHIFT), order);
+
 	*dma_handle = virt_to_phys(ret);
 	return ret_nocache;
 }
@@ -51,10 +53,13 @@ void dma_free_coherent(struct device *de
 			 void *vaddr, dma_addr_t dma_handle)
 {
 	int order = get_order(size);
+	unsigned long pfn = dma_handle >> PAGE_SHIFT;
+	int k;
 
 	if (!dma_release_from_coherent(dev, order, vaddr)) {
 		WARN_ON(irqs_disabled());	/* for portability */
-		free_pages((unsigned long)phys_to_virt(dma_handle), order);
+		for (k = 0; k < (1 << order); k++)
+			__free_pages(pfn_to_page(pfn + k), 0);
 		iounmap(vaddr);
 	}
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] sh_mobile_lcdc: use FB_SYS helpers instead of FB_CFB
@ 2008-12-17  8:29 Magnus Damm
  2008-12-17  8:18 ` [PATCH] sh: split coherent pages Magnus Damm
  0 siblings, 1 reply; 3+ messages in thread
From: Magnus Damm @ 2008-12-17  8:29 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: Magnus Damm, lethal, linux-sh

From: Magnus Damm <damm@igel.co.jp>

Since the sh_mobile_lcdc hardware has the framebuffer(s) in system RAM,
use FB_SYS instead of FB_CFB. Also hook in read and write helpers.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 drivers/video/Kconfig            |    8 ++++----
 drivers/video/sh_mobile_lcdcfb.c |    8 +++++---
 2 files changed, 9 insertions(+), 7 deletions(-)

--- 0001/drivers/video/Kconfig
+++ work/drivers/video/Kconfig	2008-12-17 14:02:59.000000000 +0900
@@ -1889,10 +1889,10 @@ config FB_W100
 config FB_SH_MOBILE_LCDC
 	tristate "SuperH Mobile LCDC framebuffer support"
 	depends on FB && SUPERH
-	select FB_CFB_FILLRECT
-	select FB_CFB_COPYAREA
-	select FB_CFB_IMAGEBLIT
-	default m
+	select FB_SYS_FILLRECT
+	select FB_SYS_COPYAREA
+	select FB_SYS_IMAGEBLIT
+	select FB_SYS_FOPS
 	---help---
 	  Frame buffer driver for the on-chip SH-Mobile LCD controller.
 
--- 0001/drivers/video/sh_mobile_lcdcfb.c
+++ work/drivers/video/sh_mobile_lcdcfb.c	2008-12-17 14:04:56.000000000 +0900
@@ -499,9 +499,11 @@ static struct fb_fix_screeninfo sh_mobil
 
 static struct fb_ops sh_mobile_lcdc_ops = {
 	.fb_setcolreg	= sh_mobile_lcdc_setcolreg,
-	.fb_fillrect	= cfb_fillrect,
-	.fb_copyarea	= cfb_copyarea,
-	.fb_imageblit	= cfb_imageblit,
+	.fb_read        = fb_sys_read,
+	.fb_write       = fb_sys_write,
+	.fb_fillrect	= sys_fillrect,
+	.fb_copyarea	= sys_copyarea,
+	.fb_imageblit	= sys_imageblit,
 };
 
 static int sh_mobile_lcdc_set_bpp(struct fb_var_screeninfo *var, int bpp)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sh: split coherent pages
  2008-12-17  8:18 ` [PATCH] sh: split coherent pages Magnus Damm
@ 2008-12-17  8:33   ` Paul Mundt
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2008-12-17  8:33 UTC (permalink / raw)
  To: Magnus Damm; +Cc: linux-sh, linux-fbdev-devel

On Wed, Dec 17, 2008 at 05:18:45PM +0900, Magnus Damm wrote:
> Split pages returned by dma_alloc_coherent() and make sure
> we free them one by one.
> 
> Signed-off-by: Magnus Damm <damm@igel.co.jp>

On Wed, Dec 17, 2008 at 05:29:49PM +0900, Magnus Damm wrote:
> Since the sh_mobile_lcdc hardware has the framebuffer(s) in system RAM,
> use FB_SYS instead of FB_CFB. Also hook in read and write helpers.
> 
> Signed-off-by: Magnus Damm <damm@igel.co.jp>

Both applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-17  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-17  8:29 [PATCH] sh_mobile_lcdc: use FB_SYS helpers instead of FB_CFB Magnus Damm
2008-12-17  8:18 ` [PATCH] sh: split coherent pages Magnus Damm
2008-12-17  8:33   ` Paul Mundt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox