Cell: Draw SPE helper penguin logos
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Tue, 17 Jul 2007 11:05:52 +0000 (04:05 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 17 Jul 2007 17:23:13 +0000 (10:23 -0700)
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@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-By: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/powerpc/platforms/cell/spu_base.c
arch/powerpc/platforms/cell/spu_manage.c
arch/powerpc/platforms/ps3/spu.c
drivers/video/logo/Kconfig

index e4d0c9f42abdba0b0034ed8ad87c591fff7f6b7a..96a8f609690ce846b1d7c58fa04f39b6f1206c02 100644 (file)
@@ -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>
@@ -656,12 +657,24 @@ 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__);
                goto out_unregister_sysdev_class;
        }
 
+       if (ret > 0) {
+               /*
+                * We cannot put the forward declaration in
+                * <linux/linux_logo.h> because of conflicting session type
+                * conflicts for const and __initdata with different compiler
+                * versions
+                */
+               extern const struct linux_logo logo_spe_clut224;
+
+               fb_append_extra_logo(&logo_spe_clut224, ret);
+       }
+
        xmon_register_spus(&spu_full_list);
 
        spu_add_sysdev_attr(&attr_stat);
index 1d4562ae463dd90ff4e1459cf8514c6fa044008f..75ed50fcc3dbaf70903fc74b00ab75b3e7d99ad3 100644 (file)
@@ -279,6 +279,7 @@ static int __init of_enumerate_spus(int (*fn)(void *data))
 {
        int ret;
        struct device_node *node;
+       unsigned int n = 0;
 
        ret = -ENODEV;
        for (node = of_find_node_by_type(NULL, "spe");
@@ -289,8 +290,9 @@ static int __init of_enumerate_spus(int (*fn)(void *data))
                                __FUNCTION__, node->name);
                        break;
                }
+               n++;
        }
-       return ret;
+       return ret ? ret : n;
 }
 
 static int __init of_create_spu(struct spu *spu, void *data)
index c7f734c894625b272205c7829cdc980ede866b88..502d80ed982bf657b6e08cc2ba511ef3baade432 100644 (file)
@@ -405,11 +405,13 @@ static int __init ps3_enumerate_spus(int (*fn)(void *data))
                }
        }
 
-       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 = {
index 5bb78e4807cd5b3c4be971b9dd69aed2993673d2..da219c043c9997a98d49bd894441e3f2304b9d0c 100644 (file)
@@ -13,6 +13,7 @@ if LOGO
 config FB_LOGO_EXTRA
        bool
        depends on FB
+       default y if SPU_BASE
 
 config LOGO_LINUX_MONO
        bool "Standard black and white Linux logo"