From 90ee7a41443a971d6ff2e0a6e90997806c28d11b Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 7 Aug 2007 10:18:04 +0100 Subject: Gutsy oopses on touch of existing file. Workaround. --- Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9a6557571c..4bd340f212 100644 --- a/Makefile +++ b/Makefile @@ -25,15 +25,13 @@ clean: realclean: - touch $(TOP)/configs/current - $(MAKE) clean - -rm -rf lib* - -rm -f $(TOP)/configs/current -rm -f `find . -name \*.o` -rm -f `find . -name \*.a` -rm -f `find . -name \*.so` -rm -f `find . -name depend` - + -rm -rf lib* + $(MAKE) clean + -rm -f $(TOP)/configs/current install: -- cgit v1.2.3 From 83a674a7af4e58f677a56aae2111d2cbdbf1e21d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 19 Sep 2007 23:43:36 +0100 Subject: Update linux-profile config. --- Makefile | 1 + configs/linux-profile | 27 +++------------------------ configs/linux-static | 3 ++- 3 files changed, 6 insertions(+), 25 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4bd340f212..f65aa60d57 100644 --- a/Makefile +++ b/Makefile @@ -115,6 +115,7 @@ linux-osmesa16-static \ linux-osmesa32 \ linux-ppc \ linux-ppc-static \ +linux-profile \ linux-solo \ linux-solo-x86 \ linux-solo-ia64 \ diff --git a/configs/linux-profile b/configs/linux-profile index 75b245779a..3efdcf5e05 100644 --- a/configs/linux-profile +++ b/configs/linux-profile @@ -1,29 +1,8 @@ # Configuration for profiling on Linux with gprof -include $(TOP)/configs/default +include $(TOP)/configs/linux-static CONFIG_NAME = linux-profile -# Compiler and flags -CC = gcc -CXX = g++ - -CFLAGS = -pg -O -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG - -CXXFLAGS = -pg -O -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG - -GLUT_CFLAGS = -fexceptions - -# Need to have -L/usr/X11R6/lib in these: -GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -L/usr/X11R6/lib -lX11 - -# Need to make static libs for profiling: -MKLIB_OPTIONS = -static -GL_LIB_NAME = lib$(GL_LIB).a -GLU_LIB_NAME = lib$(GLU_LIB).a -GLUT_LIB_NAME = lib$(GLUT_LIB).a -GLW_LIB_NAME = lib$(GLW_LIB).a -OSMESA_LIB_NAME = lib$(OSMesa).a -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread +OPT_FLAGS = -pg -g -O2 -DNDEBUG +DEFINES += -DNDEBUG diff --git a/configs/linux-static b/configs/linux-static index 85141ea643..d5fbe9cf65 100644 --- a/configs/linux-static +++ b/configs/linux-static @@ -21,6 +21,7 @@ GLUT_LIB_DEPS = GLW_LIB_DEPS = # Need to specify all libraries we may need -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm \ +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -Wl,--start-group \ + -l$(GL_LIB) $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a -Wl,--end-group -lm \ -L/usr/X11R6/lib/ -lX11 -lXmu -lXi -lpthread -- cgit v1.2.3 From ae58f38feebed6c468a20d3ae45fbf83b6e3b457 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 21 Sep 2007 16:47:00 +0100 Subject: Fix the doxygen target in the top-level Makefile. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f65aa60d57..4f8cc20390 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,10 @@ default: $(TOP)/configs/current doxygen: - (cd doxygen ; make) ; \ + cd doxygen && $(MAKE) + +.PHONY: doxygen + clean: @for dir in $(SUBDIRS) ; do \ -- cgit v1.2.3 From 59424e2d34b791100d7924069df261b8147c3bff Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 28 Sep 2007 17:17:11 +0000 Subject: Update x86's static and profile configs. --- Makefile | 2 ++ configs/linux-profile | 2 +- configs/linux-x86-64-profile | 8 ++++++++ configs/linux-x86-64-static | 5 ++++- configs/linux-x86-profile | 8 ++++++++ configs/linux-x86-static | 5 ++++- 6 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 configs/linux-x86-64-profile create mode 100644 configs/linux-x86-profile (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4f8cc20390..a058e9839f 100644 --- a/Makefile +++ b/Makefile @@ -132,8 +132,10 @@ linux-x86-debug \ linux-x86-32 \ linux-x86-64 \ linux-x86-64-debug \ +linux-x86-64-profile \ linux-x86-64-static \ linux-x86-glide \ +linux-x86-profile \ linux-x86-static \ netbsd \ openbsd \ diff --git a/configs/linux-profile b/configs/linux-profile index 3efdcf5e05..e3895dd8be 100644 --- a/configs/linux-profile +++ b/configs/linux-profile @@ -4,5 +4,5 @@ include $(TOP)/configs/linux-static CONFIG_NAME = linux-profile -OPT_FLAGS = -pg -g -O2 -DNDEBUG +OPT_FLAGS = -pg -g -O2 DEFINES += -DNDEBUG diff --git a/configs/linux-x86-64-profile b/configs/linux-x86-64-profile new file mode 100644 index 0000000000..6eb9c6844b --- /dev/null +++ b/configs/linux-x86-64-profile @@ -0,0 +1,8 @@ +# Configuration for profiling on Linux for 64-bit X86 (Opteron) with gprof + +include $(TOP)/configs/linux-x86-64-static + +CONFIG_NAME = linux-x86-64-profile + +OPT_FLAGS = -pg -g -O2 +DEFINES += -DNDEBUG diff --git a/configs/linux-x86-64-static b/configs/linux-x86-64-static index 02574303a9..909965da36 100644 --- a/configs/linux-x86-64-static +++ b/configs/linux-x86-64-static @@ -19,5 +19,8 @@ OSMESA_LIB_DEPS = GLU_LIB_DEPS = GLUT_LIB_DEPS = GLW_LIB_DEPS = -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \ + +# Need to specify all libraries we may need +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -Wl,--start-group \ + -l$(GL_LIB) $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a -Wl,--end-group \ $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm diff --git a/configs/linux-x86-profile b/configs/linux-x86-profile new file mode 100644 index 0000000000..987b5f0cf9 --- /dev/null +++ b/configs/linux-x86-profile @@ -0,0 +1,8 @@ +# Configuration for profiling on Linux with x86 optimizations with gprof + +include $(TOP)/configs/linux-x86-static + +CONFIG_NAME = linux-x86-profile + +OPT_FLAGS = -pg -g -O2 +DEFINES += -DNDEBUG diff --git a/configs/linux-x86-static b/configs/linux-x86-static index 9915987da3..3b281e6685 100644 --- a/configs/linux-x86-static +++ b/configs/linux-x86-static @@ -19,5 +19,8 @@ OSMESA_LIB_DEPS = GLU_LIB_DEPS = GLUT_LIB_DEPS = GLW_LIB_DEPS = -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \ + +# Need to specify all libraries we may need +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -Wl,--start-group \ + -l$(GL_LIB) $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a -Wl,--end-group \ $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm -- cgit v1.2.3 From b04430efd963ca541c435c6c1007feccf5474040 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 22 Oct 2007 11:00:28 -0400 Subject: Introduce linux-llvm target. Remove the llvm code from the default build for now. Cleanup some of the debugging output. --- Makefile | 1 + configs/default | 25 +++------------------ configs/linux-llvm | 31 +++++++++++++++++++++++++ src/mesa/pipe/llvm/llvmtgsi.cpp | 50 ++++++++++++++++++++++++++++++++--------- src/mesa/pipe/llvm/llvmtgsi.h | 11 ++++----- 5 files changed, 78 insertions(+), 40 deletions(-) create mode 100644 configs/linux-llvm (limited to 'Makefile') diff --git a/Makefile b/Makefile index a058e9839f..c4ffea85a2 100644 --- a/Makefile +++ b/Makefile @@ -112,6 +112,7 @@ linux-ia64-icc \ linux-ia64-icc-static \ linux-icc \ linux-icc-static \ +linux-llvm \ linux-osmesa \ linux-osmesa16 \ linux-osmesa16-static \ diff --git a/configs/default b/configs/default index bb8f9a1808..9379833a9c 100644 --- a/configs/default +++ b/configs/default @@ -40,6 +40,8 @@ GLUT_LIB = glut GLW_LIB = GLw OSMESA_LIB = OSMesa +LLVM_CFLAGS=-DMESA_NO_LLVM=1 +LLVM_CXXFLAGS=-DMESA_NO_LLVM=1 # Library names (actual file names) GL_LIB_NAME = lib$(GL_LIB).so @@ -65,30 +67,9 @@ DRIVER_DIRS = x11 osmesa # Which subdirs under $(TOP)/progs/ to enter: PROGRAM_DIRS = demos redbook samples glsl xdemos -LLVM_VERSION := $(shell llvm-config --version) - -ifeq ($(LLVM_VERSION),) - $(warning Could not find LLVM! Make Sure 'llvm-config' is in the path) - MESA_NO_LLVM=1 -else - MESA_NO_LLVM=0 - $(info Using LLVM version: $(LLVM_VERSION)) -endif - -ifeq ($(MESA_NO_LLVM),0) -# LLVM_CFLAGS=`llvm-config --cflags` -DMESA_NO_LLVM=0 - LLVM_CFLAGS=-DMESA_NO_LLVM=0 - LLVM_CXXFLAGS=`llvm-config --cxxflags` -DMESA_NO_LLVM=0 -Wno-long-long - LLVM_LDFLAGS=`llvm-config --ldflags` - LLVM_LIBS=`llvm-config --libs` -else - LLVM_CFLAGS=-DMESA_NO_LLVM=1 - LLVM_CXXFLAGS=-DMESA_NO_LLVM=1 -endif - # Library/program dependencies #EXTRA_LIB_PATH ?= -GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lm diff --git a/configs/linux-llvm b/configs/linux-llvm new file mode 100644 index 0000000000..addefaa511 --- /dev/null +++ b/configs/linux-llvm @@ -0,0 +1,31 @@ +# Configuration for debugging on Linux + +include $(TOP)/configs/linux + +CONFIG_NAME = linux-debug + +OPT_FLAGS = -g -ansi -pedantic +DEFINES += -DDEBUG -DDEBUG_MATH + +LLVM_VERSION := $(shell llvm-config --version) + +ifeq ($(LLVM_VERSION),) + $(warning Could not find LLVM! Make Sure 'llvm-config' is in the path) + MESA_NO_LLVM=1 +else + MESA_NO_LLVM=0 + $(info Using LLVM version: $(LLVM_VERSION)) +endif + +ifeq ($(MESA_NO_LLVM),0) +# LLVM_CFLAGS=`llvm-config --cflags` -DMESA_NO_LLVM=0 + LLVM_CFLAGS=-DMESA_NO_LLVM=0 + LLVM_CXXFLAGS=`llvm-config --cxxflags` -DMESA_NO_LLVM=0 -Wno-long-long + LLVM_LDFLAGS=`llvm-config --ldflags` + LLVM_LIBS=`llvm-config --libs` +else + LLVM_CFLAGS=-DMESA_NO_LLVM=1 + LLVM_CXXFLAGS=-DMESA_NO_LLVM=1 +endif + +GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread diff --git a/src/mesa/pipe/llvm/llvmtgsi.cpp b/src/mesa/pipe/llvm/llvmtgsi.cpp index 00f8b86efc..e1bb281a94 100644 --- a/src/mesa/pipe/llvm/llvmtgsi.cpp +++ b/src/mesa/pipe/llvm/llvmtgsi.cpp @@ -33,9 +33,17 @@ #include #include +#include #include +struct ga_llvm_prog { + void *module; + void *function; + int num_consts; + int id; +}; + using namespace llvm; #include "llvm_base_shader.cpp" @@ -134,7 +142,7 @@ translate_instruction(llvm::Module *module, inputs[1] = 0; inputs[2] = 0; inputs[3] = 0; - printf("translate instr START\n"); + for (int i = 0; i < inst->Instruction.NumSrcRegs; ++i) { struct tgsi_full_src_register *src = &inst->FullSrcRegisters[i]; llvm::Value *val = 0; @@ -176,7 +184,6 @@ translate_instruction(llvm::Module *module, /*if (inputs[0]) instr->printVector(inputs[0]);*/ llvm::Value *out = 0; - printf("Opcode is %d\n", inst->Instruction.Opcode); switch (inst->Instruction.Opcode) { case TGSI_OPCODE_ARL: break; @@ -485,7 +492,6 @@ translate_instruction(llvm::Module *module, case TGSI_OPCODE_KIL: break; case TGSI_OPCODE_END: - printf("translate instr END\n"); return; break; default: @@ -525,7 +531,6 @@ translate_instruction(llvm::Module *module, fprintf(stderr, "ERROR: unsupported LLVM destination!"); } } - printf("translate instr END\n"); } static llvm::Module * @@ -590,10 +595,6 @@ tgsi_to_llvm(struct ga_llvm_prog *prog, const struct tgsi_token *tokens) tgsi_parse_free(&parse); prog->num_consts = storage.numConsts(); - - std::cout<<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<id = GLOBAL_ID; - fprintf(stderr, "----- TGSI Start ---- \n"); tgsi_dump(tokens, 0); - fprintf(stderr, "----- TGSI End ---- \n"); llvm::Module *mod = tgsi_to_llvm(ga_llvm, tokens); /* Run optimization passes over it */ @@ -630,6 +629,8 @@ ga_llvm_from_tgsi(struct pipe_context *pipe, const struct tgsi_token *tokens) Function *func = mod->getFunction("run_vertex_shader"); ga_llvm->function = ee->getPointerToFunctionOrStub(func); + ga_llvm_prog_dump(ga_llvm, 0); + return ga_llvm; } @@ -638,7 +639,6 @@ void ga_llvm_prog_delete(struct ga_llvm_prog *prog) llvm::Module *mod = static_cast(prog->module); delete mod; prog->module = 0; - prog->engine = 0; prog->function = 0; free(prog); } @@ -665,3 +665,31 @@ int ga_llvm_prog_exec(struct ga_llvm_prog *prog, return 0; } + +void ga_llvm_prog_dump(struct ga_llvm_prog *prog, const char *file_prefix) +{ + llvm::Module *mod; + if (!prog || !prog->module) + return; + + mod = static_cast(prog->module); + + if (file_prefix) { + std::ostringstream stream; + stream << file_prefix; + stream << prog->id; + stream << ".ll"; + std::string name = stream.str(); + std::ofstream out(name.c_str()); + if (!out) { + std::cerr<<"Can't open file : "<id<id< Date: Sun, 2 Dec 2007 15:23:51 -0700 Subject: Initial Cell driver infrastructure. No real code yet. Just stand-ins and make/build infrastructure. --- Makefile | 1 + configs/linux-cell | 37 +++++++++++++++++ src/mesa/Makefile | 9 ++++- src/mesa/pipe/Makefile | 26 ++++++++++-- src/mesa/pipe/cell/Makefile | 12 ++++++ src/mesa/pipe/cell/common.h | 13 ++++++ src/mesa/pipe/cell/ppu/Makefile | 39 ++++++++++++++++++ src/mesa/pipe/cell/ppu/cell_context.c | 76 +++++++++++++++++++++++++++++++++++ src/mesa/pipe/cell/ppu/cell_context.h | 46 +++++++++++++++++++++ src/mesa/pipe/cell/ppu/cell_surface.c | 9 +++++ src/mesa/pipe/cell/spu/Makefile | 42 +++++++++++++++++++ src/mesa/pipe/cell/spu/main.c | 29 +++++++++++++ src/mesa/pipe/cell/spu/tri.c | 9 +++++ src/mesa/pipe/cell/spu/tri.h | 4 ++ 14 files changed, 346 insertions(+), 6 deletions(-) create mode 100644 configs/linux-cell create mode 100644 src/mesa/pipe/cell/Makefile create mode 100644 src/mesa/pipe/cell/common.h create mode 100644 src/mesa/pipe/cell/ppu/Makefile create mode 100644 src/mesa/pipe/cell/ppu/cell_context.c create mode 100644 src/mesa/pipe/cell/ppu/cell_context.h create mode 100644 src/mesa/pipe/cell/ppu/cell_surface.c create mode 100644 src/mesa/pipe/cell/spu/Makefile create mode 100644 src/mesa/pipe/cell/spu/main.c create mode 100644 src/mesa/pipe/cell/spu/tri.c create mode 100644 src/mesa/pipe/cell/spu/tri.h (limited to 'Makefile') diff --git a/Makefile b/Makefile index c4ffea85a2..6e92858ad5 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,7 @@ irix6-o32-static \ linux \ linux-alpha \ linux-alpha-static \ +linux-cell \ linux-debug \ linux-directfb \ linux-dri \ diff --git a/configs/linux-cell b/configs/linux-cell new file mode 100644 index 0000000000..8bedca9246 --- /dev/null +++ b/configs/linux-cell @@ -0,0 +1,37 @@ +# linux-cell + +include $(TOP)/configs/default + +CONFIG_NAME = linux-cell + + +# Compiler and flags +CC = /usr/bin/ppu32-gcc +CXX = /usr/bin/ppu32-g++ + +# Cell SDK location +SDK = /opt/ibm/cell-sdk/prototype/sysroot/usr + + +CFLAGS = -g -W -Wall -Winline -m32 -mabi=altivec -maltivec -I. -I/usr/include -I$(SDK)/include -include altivec.h + +CXXFLAGS = $(CFLAGS) + +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread \ + -L$(SDK)/lib -m32 -Wl,-m,elf32ppc -R$(SDK)/lib -lspe + + + +### SPU stuff + +SPU_CC = /usr/bin/spu-gcc + +SPU_CFLAGS = -g -W -Wall -Winline -Wno-main -I. -I $(SDK)/spu/include -include spu_intrinsics.h -I $(TOP)/src/mesa/ + +SPU_LFLAGS = -L$(SDK)/spu/lib -Wl,-N -lmisc + +SPU_AR = /usr/bin/ar +SPU_AR_FLAGS = -qcs + +SPU_EMBED = /usr/bin/embedspu +SPU_EMBED_FLAGS = -m32 diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 521cbeb606..6f0877d335 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -13,6 +13,11 @@ GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) SOFTPIPE_LIB = $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a +ifeq ($(CONFIG_NAME), linux-cell) +CELL_LIB = $(TOP)/src/mesa/pipe/cell/ppu/libcell.a +endif + + .SUFFIXES : .cpp .c.o: @@ -112,12 +117,12 @@ stand-alone: depend subdirs $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$ osmesa-only: depend subdirs $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) # Make the GL library -$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS) $(SOFTPIPE_LIB) +$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS) $(SOFTPIPE_LIB) $(CELL_LIB) @ $(TOP)/bin/mklib -o $(GL_LIB) \ -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \ -install $(TOP)/$(LIB_DIR) \ $(MKLIB_OPTIONS) $(STAND_ALONE_OBJECTS) \ - $(SOFTPIPE_LIB) $(GL_LIB_DEPS) + $(SOFTPIPE_LIB) $(CELL_LIB)$(GL_LIB_DEPS) # Make the OSMesa library $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS) diff --git a/src/mesa/pipe/Makefile b/src/mesa/pipe/Makefile index d448f3f5a6..a9dc393417 100644 --- a/src/mesa/pipe/Makefile +++ b/src/mesa/pipe/Makefile @@ -1,7 +1,25 @@ -default: - cd softpipe ; make - cd i915simple ; make - cd failover ; make + +TOP = ../../.. +include $(TOP)/configs/current + + +ifeq ($(CONFIG_NAME), linux-cell) +CELL_DIR = cell +endif + +SUBDIRS = softpipe i915simple failover $(CELL_DIR) + + +default: subdirs + + +subdirs: + @for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE)) || exit 1 ; \ + fi \ + done + clean: rm -f `find . -name \*.[oa]` \ No newline at end of file diff --git a/src/mesa/pipe/cell/Makefile b/src/mesa/pipe/cell/Makefile new file mode 100644 index 0000000000..47aef7b05f --- /dev/null +++ b/src/mesa/pipe/cell/Makefile @@ -0,0 +1,12 @@ +# Cell Gallium driver Makefile + + +default: + ( cd spu ; make ) + ( cd ppu ; make ) + + + +clean: + ( cd spu ; make clean ) + ( cd ppu ; make clean ) diff --git a/src/mesa/pipe/cell/common.h b/src/mesa/pipe/cell/common.h new file mode 100644 index 0000000000..c4bad4194a --- /dev/null +++ b/src/mesa/pipe/cell/common.h @@ -0,0 +1,13 @@ + +#ifndef CELL_COMMON_H +#define CELL_COMMON_H + + +struct init_info +{ + int foo; + int bar; +}; + + +#endif /* CELL_COMMON_H */ 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 +#include +#include +#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 + + +void cell_create_surface(void) +{ + printf("cell_create_surface\n"); + +} diff --git a/src/mesa/pipe/cell/spu/Makefile b/src/mesa/pipe/cell/spu/Makefile new file mode 100644 index 0000000000..00f931e1c1 --- /dev/null +++ b/src/mesa/pipe/cell/spu/Makefile @@ -0,0 +1,42 @@ +# Gallium3D Cell driver: PPU code + +# This makefile builds the g3d_spu.a file that's linked into the +# PPU code/library. + + +TOP = ../../../../.. +include $(TOP)/configs/linux-cell + + +PROG = g3d + +PROG_SPU = $(PROG)_spu +PROG_SPU_A = $(PROG)_spu.a +PROG_SPU_EMBED_O = $(PROG)_spu-embed.o + + +SPU_OBJECTS = main.o tri.o + + +# The .a file will be linked into the main/PPU executable +default: $(PROG_SPU_A) + +$(PROG_SPU_A): $(PROG_SPU_EMBED_O) + $(SPU_AR) $(SPU_AR_FLAGS) $(PROG_SPU_A) $(PROG_SPU_EMBED_O) + +$(PROG_SPU_EMBED_O): $(PROG_SPU) + $(SPU_EMBED) $(SPU_EMBED_FLAGS) $(PROG_SPU) $(PROG_SPU) $(PROG_SPU_EMBED_O) + +$(PROG_SPU): $(SPU_OBJECTS) + $(SPU_CC) -o $(PROG_SPU) $(SPU_OBJECTS) $(SPU_LFLAGS) + + +main.o: main.c + $(SPU_CC) $(SPU_CFLAGS) -c main.c + +tri.o: tri.c + $(SPU_CC) $(SPU_CFLAGS) -c tri.c + + +clean: + rm -f *.o *.a *.d $(PROG_SPU) diff --git a/src/mesa/pipe/cell/spu/main.c b/src/mesa/pipe/cell/spu/main.c new file mode 100644 index 0000000000..e8d5fdccbf --- /dev/null +++ b/src/mesa/pipe/cell/spu/main.c @@ -0,0 +1,29 @@ +/* main.c for cell SPU code */ + + +#include +#include +#include + +#include "tri.h" +#include "pipe/cell/common.h" + + +static struct init_info init; + + +int +main(unsigned long long speid, + unsigned long long argp, + unsigned long long envp) +{ + int tag = 0; + + mfc_get(&init, (unsigned int) argp, sizeof(struct init_info), tag, 0, 0); + + printf("Enter spu main(): init.foo=%d\n", init.foo); + + draw_triangle(0, 1, 2); + + return 0; +} diff --git a/src/mesa/pipe/cell/spu/tri.c b/src/mesa/pipe/cell/spu/tri.c new file mode 100644 index 0000000000..949c3b4c8e --- /dev/null +++ b/src/mesa/pipe/cell/spu/tri.c @@ -0,0 +1,9 @@ + +#include "tri.h" + +void +draw_triangle(int v1, int v2, int v3) +{ + + +} diff --git a/src/mesa/pipe/cell/spu/tri.h b/src/mesa/pipe/cell/spu/tri.h new file mode 100644 index 0000000000..6a915de60d --- /dev/null +++ b/src/mesa/pipe/cell/spu/tri.h @@ -0,0 +1,4 @@ + + +extern void +draw_triangle(int v1, int v2, int v3); -- cgit v1.2.3 From 9df478d2f8269a439024fadf82170814d24acd19 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 18 Feb 2008 16:47:35 +0900 Subject: Add an "all" target alias for "default" target. "all" is more commonly expected, expecially by many IDEs. --- Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6e92858ad5..1ec8ce7cba 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,8 @@ default: $(TOP)/configs/current fi \ done +all: default + doxygen: cd doxygen && $(MAKE) -- cgit v1.2.3 From 9395fb6e8d341d7a3f923b5ec03630ab656c8f2f Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 22 May 2008 16:24:51 +0200 Subject: mesa: Added linux-egl target, that only builds the i915simple driver and egl drivers --- Makefile | 1 + configs/linux-egl | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 configs/linux-egl (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1ec8ce7cba..9b3be43d50 100644 --- a/Makefile +++ b/Makefile @@ -108,6 +108,7 @@ linux-dri-x86 \ linux-dri-x86-64 \ linux-dri-ppc \ linux-dri-xcb \ +linux-egl \ linux-indirect \ linux-fbdev \ linux-glide \ diff --git a/configs/linux-egl b/configs/linux-egl new file mode 100644 index 0000000000..e906806f4b --- /dev/null +++ b/configs/linux-egl @@ -0,0 +1,65 @@ +# -*-makefile-*- +# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others + +include $(TOP)/configs/default + +CONFIG_NAME = linux-dri + +# Compiler and flags +CC = gcc +CXX = g++ + +#MKDEP = /usr/X11R6/bin/makedepend +#MKDEP = gcc -M +#MKDEP_OPTIONS = -MF depend + +OPT_FLAGS = -O -g +PIC_FLAGS = -fPIC + +# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. +ARCH_FLAGS ?= + +DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ + -D_BSD_SOURCE -D_GNU_SOURCE \ + -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ + -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \ + -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN + +X11_INCLUDES = -I/usr/X11R6/include + +CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \ + $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS) + +CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) + + +MESA_ASM_SOURCES = + +# Library/program dependencies +EXTRA_LIB_PATH=-L/usr/X11R6/lib + +LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm) +LIBDRM_LIB = $(shell pkg-config --libs libdrm) +DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB) +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \ + -lm -lpthread -ldl \ + $(LIBDRM_LIB) + + +# This is now 0 by default since it seems to confuse the hell out of people +# and generate a lot of extra noise on bugzilla. If you need to build with +# EGL, do 'make linux-dri USING_EGL=1' + +USING_EGL=0 + +# Directories +SRC_DIRS = gallium mesa gallium/winsys glu egl +PROGRAM_DIRS = egl + +DRIVER_DIRS = dri +WINDOW_SYSTEM = dri +GALLIUM_WINSYS_DIRS = egl_drm + +# gamma are missing because they have not been converted to use the new +# interface. +DRI_DIRS = intel -- cgit v1.2.3 From a9345511d8c9f0707b0dc49f772b3740878f1bd3 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 29 Aug 2008 11:17:24 +0100 Subject: remove depend.bak in realclean --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9b3be43d50..684126135d 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ realclean: -rm -f `find . -name \*.a` -rm -f `find . -name \*.so` -rm -f `find . -name depend` + -rm -f `find . -name depend.bak` -rm -rf lib* $(MAKE) clean -rm -f $(TOP)/configs/current -- cgit v1.2.3 From ab93aa774e2fc09b5f579eb13ce94cf22796902b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 3 Sep 2008 09:08:19 -0600 Subject: Cell: added linux-cell-debug config linux-cell is now the optimized configuration. Remove some Cell-specific stuff from winsys/xlib/Makefile. --- Makefile | 1 + configs/linux-cell | 6 ++++-- configs/linux-cell-debug | 10 ++++++++++ src/gallium/winsys/xlib/Makefile | 5 +---- 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 configs/linux-cell-debug (limited to 'Makefile') diff --git a/Makefile b/Makefile index 684126135d..b6b8bce3e7 100644 --- a/Makefile +++ b/Makefile @@ -101,6 +101,7 @@ linux \ linux-alpha \ linux-alpha-static \ linux-cell \ +linux-cell-debug \ linux-debug \ linux-directfb \ linux-dri \ diff --git a/configs/linux-cell b/configs/linux-cell index 1f02e80edb..cdaa17c663 100644 --- a/configs/linux-cell +++ b/configs/linux-cell @@ -1,4 +1,4 @@ -# linux-cell +# linux-cell (non-debug build) include $(TOP)/configs/default @@ -13,7 +13,7 @@ CC = ppu32-gcc CXX = ppu32-g++ HOST_CC = gcc -OPT_FLAGS = -g +OPT_FLAGS = -O3 # Cell SDK location ## For SDK 2.1: (plus, remove -DSPU_MAIN_PARAM_LONG_LONG below) @@ -39,6 +39,8 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread \ -L$(SDK)/lib -m32 -Wl,-m,elf32ppc -R$(SDK)/lib -lspe2 +CELL_SPU_LIB = $(TOP)/src/gallium/drivers/cell/spu/g3d_spu.a + ### SPU stuff diff --git a/configs/linux-cell-debug b/configs/linux-cell-debug new file mode 100644 index 0000000000..ba333bba68 --- /dev/null +++ b/configs/linux-cell-debug @@ -0,0 +1,10 @@ +# linux-cell-debug + +include $(TOP)/configs/linux-cell + +# just override name and OPT_FLAGS here: + +CONFIG_NAME = linux-cell-debug + +OPT_FLAGS = -g + diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index ec92c79068..11c7632411 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -33,10 +33,7 @@ XLIB_WINSYS_SOURCES = \ XLIB_WINSYS_OBJECTS = $(XLIB_WINSYS_SOURCES:.c=.o) -ifeq ($(CONFIG_NAME), linux-cell) -# The SPU code is in a separate .a file, unfortunately -CELL_SPU_LIB = $(TOP)/src/gallium/drivers/cell/spu/g3d_spu.a -endif +# Note: CELL_SPU_LIB is only defined for cell configs LIBS = \ $(GALLIUM_DRIVERS) \ -- cgit v1.2.3 From ffe7bda603132e95f4d8a4de369bd3134d51b455 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 8 Jan 2009 17:21:20 -0700 Subject: mesa: 7.3-rc-1 Makefile changes --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3e41173ce5..0668ea3256 100644 --- a/Makefile +++ b/Makefile @@ -182,10 +182,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-7.1-rc4 -LIB_NAME = MesaLib-7.1-rc4 -DEMO_NAME = MesaDemos-7.1-rc4 -GLUT_NAME = MesaGLUT-7.1-rc4 +DIRECTORY = Mesa-7.3-rc1 +LIB_NAME = MesaLib-7.3-rc1 +DEMO_NAME = MesaDemos-7.3-rc1 +GLUT_NAME = MesaGLUT-7.3-rc1 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ -- cgit v1.2.3 From 93cbb2c2056d52a86f84417fe8fee81b563144e4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 10:14:04 -0700 Subject: mesa: set version to 7.3 --- Makefile | 8 ++++---- src/mesa/main/version.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c1581a0bd2..bee73e6535 100644 --- a/Makefile +++ b/Makefile @@ -182,10 +182,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-7.3-rc3 -LIB_NAME = MesaLib-7.3-rc3 -DEMO_NAME = MesaDemos-7.3-rc3 -GLUT_NAME = MesaGLUT-7.3-rc3 +DIRECTORY = Mesa-7.3 +LIB_NAME = MesaLib-7.3 +DEMO_NAME = MesaDemos-7.3 +GLUT_NAME = MesaGLUT-7.3 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 3d874c8ba8..62cd03f5e2 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -31,7 +31,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 3 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.3-rc3" +#define MESA_VERSION_STRING "7.3" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From e98ef303512a460c41d2a90455dd8e515924e0ef Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 10:19:39 -0700 Subject: mesa: set version to 7.4 for mesa_7_4_branch --- Makefile | 8 ++++---- src/mesa/main/version.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index bee73e6535..875f93bd4a 100644 --- a/Makefile +++ b/Makefile @@ -182,10 +182,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-7.3 -LIB_NAME = MesaLib-7.3 -DEMO_NAME = MesaDemos-7.3 -GLUT_NAME = MesaGLUT-7.3 +DIRECTORY = Mesa-7.4 +LIB_NAME = MesaLib-7.4 +DEMO_NAME = MesaDemos-7.4 +GLUT_NAME = MesaGLUT-7.4 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 62cd03f5e2..84dcb263c6 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.3 + * Version: 7.4 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * @@ -29,9 +29,9 @@ /* Mesa version */ #define MESA_MAJOR 7 -#define MESA_MINOR 3 +#define MESA_MINOR 4 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.3" +#define MESA_VERSION_STRING "7.4" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3