All of lore.kernel.org
 help / color / mirror / Atom feed
* - ps3-preallocate-bootmem-memory-for-ps3fb.patch removed from -mm tree
@ 2007-02-12 22:50 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2007-02-12 22:50 UTC (permalink / raw)
  To: Geert.Uytterhoeven, benh, geoffrey.levand, jsimmons, paulus, mm-commits


The patch titled
     ps3: Preallocate bootmem memory for ps3fb
has been removed from the -mm tree.  Its filename was
     ps3-preallocate-bootmem-memory-for-ps3fb.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: ps3: Preallocate bootmem memory for ps3fb
From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>

Preallocate bootmem memory for the PS3 frame buffer device, which needs a
large block of physically-contiguous memory. The size of this memory block is
configurable:
  - The config option CONFIG_FB_PS3_DEFAULT_SIZE_M allows to specify the
    default amount of memory (in MiB) allocated to the virtual frame buffer.
  - The early boot parameter `ps3fb=xxx' allows to override the default value.
    It will be rounded up to a multiple of 1 MiB, if needed.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/platforms/ps3/setup.c |   42 +++++++++++++++++++++++++++
 include/asm-powerpc/ps3.h          |    9 +++++
 2 files changed, 51 insertions(+)

diff -puN arch/powerpc/platforms/ps3/setup.c~ps3-preallocate-bootmem-memory-for-ps3fb arch/powerpc/platforms/ps3/setup.c
--- a/arch/powerpc/platforms/ps3/setup.c~ps3-preallocate-bootmem-memory-for-ps3fb
+++ a/arch/powerpc/platforms/ps3/setup.c
@@ -24,6 +24,7 @@
 #include <linux/root_dev.h>
 #include <linux/console.h>
 #include <linux/kexec.h>
+#include <linux/bootmem.h>
 
 #include <asm/machdep.h>
 #include <asm/firmware.h>
@@ -80,6 +81,46 @@ static void ps3_panic(char *str)
 	for (;;) ;
 }
 
+
+static void prealloc(struct ps3_prealloc *p)
+{
+	if (!p->size)
+		return;
+
+	p->address = __alloc_bootmem(p->size, p->align, __pa(MAX_DMA_ADDRESS));
+	if (!p->address) {
+		printk(KERN_ERR "%s: Cannot allocate %s\n", __FUNCTION__,
+		       p->name);
+		return;
+	}
+
+	printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size,
+	       p->address);
+}
+
+#ifdef CONFIG_FB_PS3
+struct ps3_prealloc ps3fb_videomemory = {
+    .name = "ps3fb videomemory",
+    .size = CONFIG_FB_PS3_DEFAULT_SIZE_M*1024*1024,
+    .align = 1024*1024			/* the GPU requires 1 MiB alignment */
+};
+#define prealloc_ps3fb_videomemory()	prealloc(&ps3fb_videomemory)
+
+static int __init early_parse_ps3fb(char *p)
+{
+	if (!p)
+		return 1;
+
+	ps3fb_videomemory.size = _ALIGN_UP(memparse(p, &p),
+					   ps3fb_videomemory.align);
+	return 0;
+}
+early_param("ps3fb", early_parse_ps3fb);
+#else
+#define prealloc_ps3fb_videomemory()	do { } while (0)
+#endif
+
+
 static void __init ps3_setup_arch(void)
 {
 	union ps3_firmware_version v;
@@ -101,6 +142,7 @@ static void __init ps3_setup_arch(void)
 	conswitchp = &dummy_con;
 #endif
 
+	prealloc_ps3fb_videomemory();
 	ppc_md.power_save = ps3_power_save;
 
 	DBG(" <- %s:%d\n", __func__, __LINE__);
diff -puN include/asm-powerpc/ps3.h~ps3-preallocate-bootmem-memory-for-ps3fb include/asm-powerpc/ps3.h
--- a/include/asm-powerpc/ps3.h~ps3-preallocate-bootmem-memory-for-ps3fb
+++ a/include/asm-powerpc/ps3.h
@@ -388,4 +388,13 @@ struct ps3_vuart_port_device {
 
 int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev);
 
+struct ps3_prealloc {
+    const char *name;
+    void *address;
+    unsigned long size;
+    unsigned long align;
+};
+
+extern struct ps3_prealloc ps3fb_videomemory;
+
 #endif
_

Patches currently in -mm which might be from Geert.Uytterhoeven@sonycom.com are

origin.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-12 22:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-12 22:50 - ps3-preallocate-bootmem-memory-for-ps3fb.patch removed from -mm tree akpm

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.