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

Geert Uytterhoeven Geert.Uytterhoeven at sonycom.com
Wed Jan 31 23:44:19 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       |    7 +++++--
 arch/powerpc/platforms/cell/spu_priv1_mmio.c |    4 +++-
 arch/powerpc/platforms/ps3/spu.c             |    6 ++++--
 3 files changed, 12 insertions(+), 5 deletions(-)

--- ps3-linux-2.6.20-rc7.orig/arch/powerpc/platforms/cell/spu_base.c
+++ ps3-linux-2.6.20-rc7/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,18 @@ 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;
 	}
+	if (ret > 0)
+		fb_append_extra_logo(&logo_spe_clut224, ret);
 
 	xmon_register_spus(&spu_full_list);
 
-	return ret;
+	return 0;
 }
 module_init(init_spu_base);
 
--- ps3-linux-2.6.20-rc7.orig/arch/powerpc/platforms/cell/spu_priv1_mmio.c
+++ ps3-linux-2.6.20-rc7/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)
--- ps3-linux-2.6.20-rc7.orig/arch/powerpc/platforms/ps3/spu.c
+++ ps3-linux-2.6.20-rc7/arch/powerpc/platforms/ps3/spu.c
@@ -438,11 +438,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