summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/ppu
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-12-02 15:23:51 -0700
committerBrian <brian.paul@tungstengraphics.com>2007-12-02 15:23:51 -0700
commit88b715b049efa81f4021d642a963b58113a875cf (patch)
treeace902bbc0480836b8d1e17cfb37528c5715db0f /src/mesa/pipe/cell/ppu
parent233c374d02a99ecd0c2ddc6f11f305ae8783fc97 (diff)
Initial Cell driver infrastructure.
No real code yet. Just stand-ins and make/build infrastructure.
Diffstat (limited to 'src/mesa/pipe/cell/ppu')
-rw-r--r--src/mesa/pipe/cell/ppu/Makefile39
-rw-r--r--src/mesa/pipe/cell/ppu/cell_context.c76
-rw-r--r--src/mesa/pipe/cell/ppu/cell_context.h46
-rw-r--r--src/mesa/pipe/cell/ppu/cell_surface.c9
4 files changed, 170 insertions, 0 deletions
diff --git a/src/mesa/pipe/cell/ppu/Makefile b/src/mesa/pipe/cell/ppu/Makefile
new file mode 100644
index 0000000000..ede341abca
--- /dev/null
+++ b/src/mesa/pipe/cell/ppu/Makefile
@@ -0,0 +1,39 @@
+# Gallium3D Cell driver: PPU code
+
+# This makefile builds the g3dcell.a library which gets pulled into
+# the main libGL.so library
+
+
+TOP = ../../../../..
+include $(TOP)/configs/linux-cell
+
+
+#PROG = gl4
+
+CELL_LIB = libcell.a
+
+SPU_CODE_MODULE = ../spu/g3d_spu.a
+
+OBJECTS = cell_context.o cell_surface.o
+
+INCLUDE_DIRS = -I$(TOP)/src/mesa
+
+
+.c.o:
+ $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
+
+
+
+default: $(CELL_LIB)
+
+
+$(CELL_LIB): $(OBJECTS) $(SPU_CODE_MODULE)
+ ar -ru $(CELL_LIB) $(OBJECTS) $(SPU_CODE_MODULE)
+
+#$(PROG): $(PPU_OBJECTS)
+# $(CC) -o $(PROG) $(PPU_OBJECTS) $(SPU_CODE_MODULE) $(PPU_LFLAGS)
+
+
+
+clean:
+ rm -f *.o $(CELL_LIB)
diff --git a/src/mesa/pipe/cell/ppu/cell_context.c b/src/mesa/pipe/cell/ppu/cell_context.c
new file mode 100644
index 0000000000..a8f6cba2fa
--- /dev/null
+++ b/src/mesa/pipe/cell/ppu/cell_context.c
@@ -0,0 +1,76 @@
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/**
+ * Authors
+ * Brian Paul
+ */
+
+
+#include <stdio.h>
+#include <libspe.h>
+#include <libmisc.h>
+#include "pipe/cell/ppu/cell_context.h"
+#include "pipe/cell/common.h"
+
+#define NUM_SPUS 6
+
+
+extern spe_program_handle_t g3d_spu;
+
+static speid_t speid[NUM_SPUS];
+static struct init_info inits[NUM_SPUS];
+
+
+static void
+start_spus(void)
+{
+ int i;
+
+ for (i = 0; i < NUM_SPUS; i++) {
+ inits[i].foo = i;
+ inits[i].bar = i * 10;
+
+ speid[i] = spe_create_thread(0, /* gid */
+ &g3d_spu, /* spe program handle */
+ &inits[i], /* argp */
+ NULL, /* envp */
+ -1, /* mask */
+ 0 ); /* flags */
+ }
+}
+
+
+
+void cell_create_context(void)
+{
+ printf("cell_create_context\n");
+
+ start_spus();
+
+ /* TODO: do something with the SPUs! */
+}
diff --git a/src/mesa/pipe/cell/ppu/cell_context.h b/src/mesa/pipe/cell/ppu/cell_context.h
new file mode 100644
index 0000000000..b4d93d1414
--- /dev/null
+++ b/src/mesa/pipe/cell/ppu/cell_context.h
@@ -0,0 +1,46 @@
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#ifndef CELL_CONTEXT_H
+#define CELL_CONTEXT_H
+
+
+#include "pipe/p_context.h"
+
+
+
+struct cell_context
+{
+ struct pipe_context pipe;
+
+ int spu_info;
+};
+
+
+
+#endif /* CELL_CONTEXT_H */
diff --git a/src/mesa/pipe/cell/ppu/cell_surface.c b/src/mesa/pipe/cell/ppu/cell_surface.c
new file mode 100644
index 0000000000..2c4b6e640b
--- /dev/null
+++ b/src/mesa/pipe/cell/ppu/cell_surface.c
@@ -0,0 +1,9 @@
+
+#include <stdio.h>
+
+
+void cell_create_surface(void)
+{
+ printf("cell_create_surface\n");
+
+}