[Cbe-oss-dev] [PATCH 6/6] Cell: Draw SPE helper penguin logos

Geert Uytterhoeven Geert.Uytterhoeven at sonycom.com
Wed Jan 31 05:02:57 EST 2007


Let spu_management_ops.enumerate_spus() return the number of found SPEs
and use that information to draw some little helper penguin logos.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven at sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand at am.sony.com>

---
 arch/powerpc/platforms/cell/spu_base.c       |   11 +++++++++--
 arch/powerpc/platforms/cell/spu_priv1_mmio.c |    4 +++-
 arch/powerpc/platforms/ps3/spu.c             |    6 ++++--
 3 files changed, 16 insertions(+), 5 deletions(-)

--- geert-linux-src.orig/arch/powerpc/platforms/cell/spu_base.c
+++ geert-linux-src/arch/powerpc/platforms/cell/spu_base.c
@@ -31,6 +31,7 @@
 #include <linux/mm.h>
 #include <linux/io.h>
 #include <linux/mutex.h>
+#include <linux/linux_logo.h>
 #include <asm/spu.h>
 #include <asm/spu_priv1.h>
 #include <asm/xmon.h>
@@ -676,16 +677,22 @@ static int __init init_spu_base(void)
 
 	ret = spu_enumerate_spus(create_spu);
 
-	if (ret) {
+	if (ret < 0) {
 		printk(KERN_WARNING "%s: Error initializing spus\n",
 			__FUNCTION__);
 		cleanup_spu_base();
 		return ret;
 	}
+#ifdef CONFIG_LOGO
+	if (ret > 0) {
+		extern const struct linux_logo logo_spe_clut224;
+		fb_append_extra_logo(&logo_spe_clut224, ret);
+	}
+#endif
 
 	xmon_register_spus(&spu_full_list);
 
-	return ret;
+	return 0;
 }
 module_init(init_spu_base);
 
--- geert-linux-src.orig/arch/powerpc/platforms/cell/spu_priv1_mmio.c
+++ geert-linux-src/arch/powerpc/platforms/cell/spu_priv1_mmio.c
@@ -331,6 +331,7 @@ static int __init of_enumerate_spus(int 
 {
 	int ret;
 	struct device_node *node;
+	unsigned int n = 0;
 
 	ret = -ENODEV;
 	for (node = of_find_node_by_type(NULL, "spe");
@@ -341,8 +342,9 @@ static int __init of_enumerate_spus(int 
 				__FUNCTION__, node->name);
 			break;
 		}
+		n++;
 	}
-	return ret;
+	return ret ? ret : n;
 }
 
 static int __init of_create_spu(struct spu *spu, void *data)
--- geert-linux-src.orig/arch/powerpc/platforms/ps3/spu.c
+++ geert-linux-src/arch/powerpc/platforms/ps3/spu.c
@@ -437,11 +437,13 @@ static int __init ps3_enumerate_spus(int
 		}
 	}
 
-	if (result)
+	if (result) {
 		printk(KERN_WARNING "%s:%d: Error initializing spus\n",
 			__func__, __LINE__);
+		return result;
+	}
 
-	return result;
+	return num_resource_id;
 }
 
 const struct spu_management_ops spu_management_ps3_ops = {

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven at sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium



More information about the cbe-oss-dev mailing list