diff options
Diffstat (limited to 'mesalib')
27 files changed, 283 insertions, 675 deletions
diff --git a/mesalib/configs/autoconf.in b/mesalib/configs/autoconf.in index 9ea7588a1..3e5da796f 100644 --- a/mesalib/configs/autoconf.in +++ b/mesalib/configs/autoconf.in @@ -15,7 +15,6 @@ ASM_FLAGS = @ASM_FLAGS@ PIC_FLAGS = @PIC_FLAGS@ DEFINES = @DEFINES@ API_DEFINES = @API_DEFINES@ -SHARED_GLAPI = @SHARED_GLAPI@ CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \ $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \ diff --git a/mesalib/configs/freebsd-dri b/mesalib/configs/freebsd-dri index b18ac51e3..00a11d45c 100644 --- a/mesalib/configs/freebsd-dri +++ b/mesalib/configs/freebsd-dri @@ -46,6 +46,3 @@ SRC_DIRS = glx gallium mesa glu DRIVER_DIRS = dri DRM_SOURCE_PATH=$(TOP)/../drm - -DRI_DIRS = i915 i965 r200 radeon - diff --git a/mesalib/configs/linux-dri b/mesalib/configs/linux-dri index dde640897..a5efea25d 100644 --- a/mesalib/configs/linux-dri +++ b/mesalib/configs/linux-dri @@ -62,7 +62,7 @@ GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel svga/drm GALLIUM_TARGET_DIRS = dri-vmwgfx GALLIUM_STATE_TRACKERS_DIRS = egl dri -DRI_DIRS = i915 nouveau r200 radeon swrast +DRI_DIRS = swrast INTEL_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_intel) INTEL_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_intel) diff --git a/mesalib/configs/linux-dri-debug b/mesalib/configs/linux-dri-debug index a1a4465d8..4ee5d71ee 100644 --- a/mesalib/configs/linux-dri-debug +++ b/mesalib/configs/linux-dri-debug @@ -6,9 +6,3 @@ include $(TOP)/configs/linux-dri CONFIG_NAME = linux-dri-debug OPT_FLAGS = -O0 -g ARCH_FLAGS = -DDEBUG - -# Helpful to reduce the amount of stuff that gets built sometimes: -#DRI_DIRS = i915tex i915 -#DRI_DIRS = i965 -#DRI_DIRS = radeon r200 - diff --git a/mesalib/configs/linux-dri-ppc b/mesalib/configs/linux-dri-ppc index 5dd3615ff..fdf3c5c7a 100644 --- a/mesalib/configs/linux-dri-ppc +++ b/mesalib/configs/linux-dri-ppc @@ -7,11 +7,3 @@ CONFIG_NAME = linux-dri-ppc OPT_FLAGS = -Os -mcpu=603 PIC_FLAGS = -fPIC - -ASM_FLAGS = -DUSE_PPC_ASM -DUSE_VMX_ASM -MESA_ASM_SOURCES = $(PPC_SOURCES) - -# Build only the drivers for cards that exist on PowerPC. At some point MGA -# will be added, but not yet. -DRI_DIRS = r200 radeon - diff --git a/mesalib/configs/linux-dri-x86-64 b/mesalib/configs/linux-dri-x86-64 index c1dff630f..6cd629407 100644 --- a/mesalib/configs/linux-dri-x86-64 +++ b/mesalib/configs/linux-dri-x86-64 @@ -15,6 +15,3 @@ LIB_DIR = lib64 # Library/program dependencies EXTRA_LIB_PATH=-L/usr/X11R6/lib64 - -DRI_DIRS = i915 i965 r200 radeon - diff --git a/mesalib/configs/linux-dri-xcb b/mesalib/configs/linux-dri-xcb index 85665207b..fd72c683f 100644 --- a/mesalib/configs/linux-dri-xcb +++ b/mesalib/configs/linux-dri-xcb @@ -52,4 +52,3 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \ SRC_DIRS = glx gallium mesa glu DRIVER_DIRS = dri -DRI_DIRS = i915 r200 radeon diff --git a/mesalib/configure.ac b/mesalib/configure.ac index f3f5e3e94..959956862 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -47,6 +47,7 @@ AC_PROG_CXX AC_CHECK_PROGS([MAKE], [gmake make]) AC_CHECK_PROGS([PYTHON2], [python2 python]) AC_PROG_SED +AC_PROG_MKDIR_P AC_PATH_PROG([MKDEP], [makedepend]) if test "x$MKDEP" = "x"; then @@ -176,9 +177,6 @@ esac dnl Add flags for gcc and g++ if test "x$GCC" = xyes; then CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99" - if test "x$CLANG" = "xno"; then - CFLAGS="$CFLAGS -ffast-math" - fi # Enable -fvisibility=hidden if using a gcc that supports it save_CFLAGS="$CFLAGS" @@ -522,11 +520,6 @@ if test "x$enable_asm" = xyes; then GLAPI_ASM_SOURCES='$(X86-64_API)' AC_MSG_RESULT([yes, x86_64]) ;; - ppc) - ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM" - MESA_ASM_SOURCES='$(PPC_SOURCES)' - AC_MSG_RESULT([yes, ppc]) - ;; sparc) ASM_FLAGS="-DUSE_SPARC_ASM" MESA_ASM_SOURCES='$(SPARC_SOURCES)' @@ -714,18 +707,6 @@ if test "x$enable_gles2" = xyes; then fi AC_SUBST([API_DEFINES]) -AC_ARG_ENABLE([shared-glapi], - [AS_HELP_STRING([--enable-shared-glapi], - [EXPERIMENTAL. Enable shared glapi for OpenGL @<:@default=no@:>@])], - [enable_shared_glapi="$enableval"], - [enable_shared_glapi=no]) - -SHARED_GLAPI="0" -if test "x$enable_shared_glapi" = xyes; then - SHARED_GLAPI="1" -fi -AC_SUBST([SHARED_GLAPI]) - dnl dnl Driver configuration. Options are xlib, dri and osmesa right now. dnl More later: fbdev, ... @@ -809,7 +790,7 @@ dnl Driver specific build directories dnl dnl this variable will be prepended to SRC_DIRS and is not exported -CORE_DIRS="" +CORE_DIRS="mapi/shared-glapi" SRC_DIRS="" GLU_DIRS="sgi" @@ -819,13 +800,6 @@ GALLIUM_WINSYS_DIRS="sw" GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity" GALLIUM_STATE_TRACKERS_DIRS="" -# build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled -case "x$enable_shared_glapi$enable_gles1$enable_gles2" in -x*yes*) - CORE_DIRS="$CORE_DIRS mapi/shared-glapi" - ;; -esac - # build glapi if OpenGL is enabled if test "x$enable_opengl" = xyes; then CORE_DIRS="$CORE_DIRS mapi/glapi" @@ -1086,26 +1060,14 @@ DRI_CXXFLAGS='$(CXXFLAGS)' DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a' MESA_MODULES='$(TOP)/src/mesa/libmesa.a' -AC_ARG_ENABLE([shared-dricore], - [AS_HELP_STRING([--enable-shared-dricore], - [link DRI modules with shared core DRI routines @<:@default=disabled@:>@])], - [enable_dricore="$enableval"], - [enable_dricore=no]) if test "x$enable_dri" = xyes ; then - if test "$enable_dricore" = yes ; then - if test "$GCC$GXX" != yesyes ; then - AC_MSG_WARN([Shared dricore requires GCC-compatible rpath handling. Disabling shared dricore]) - enable_dricore=no - else - DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so' - DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so' - DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl' - DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore -lglsl' - DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE' - DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE' - MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)' - fi - fi + DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so' + DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so' + DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl' + DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore -lglsl' + DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE' + DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE' + MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)' fi AC_SUBST([DRICORE_LIBS]) AC_SUBST([DRICORE_GLSL_LIBS]) @@ -1280,7 +1242,7 @@ if test "x$enable_dri" = xyes; then fi fi - # put all the necessary libs together, including possibly libdricore + # put all the necessary libs together DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS" fi AC_SUBST([DRI_DIRS]) @@ -1291,29 +1253,57 @@ case $DRI_DIRS in *i915*|*i965*) PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED]) - case $DRI_DIRS in - *i965*) - HAVE_I965_DRI=yes; - ;; - esac + for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do + case $d in + i915) + HAVE_I915_DRI=yes; + ;; + i965) + HAVE_I965_DRI=yes; + ;; + esac + done ;; esac -AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes) - case $DRI_DIRS in *nouveau*) PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED]) + HAVE_NOUVEAU_DRI=yes; ;; esac case $DRI_DIRS in *radeon*|*r200*) PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) + + for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do + case $d in + radeon) + HAVE_RADEON_DRI=yes; + ;; + r200) + HAVE_R200_DRI=yes; + ;; + esac + done + ;; esac +case $DRI_DIRS in +*swrast*) + HAVE_SWRAST_DRI=yes; + ;; +esac + +AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes) +AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes) +AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes) +AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes) +AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes) +AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes) dnl dnl OSMesa configuration @@ -1380,9 +1370,6 @@ if test "x$enable_gbm" = xyes; then if test "x$enable_dri" = xyes; then GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri" - if test "$SHARED_GLAPI" -eq 0; then - AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi]) - fi fi fi AC_SUBST([GBM_LIB_DEPS]) @@ -1941,7 +1928,14 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS" dnl Substitute the config AC_CONFIG_FILES([configs/autoconf + src/mesa/drivers/dri/dri.pc + src/mesa/drivers/dri/Makefile + src/mesa/drivers/dri/i915/Makefile src/mesa/drivers/dri/i965/Makefile + src/mesa/drivers/dri/nouveau/Makefile + src/mesa/drivers/dri/r200/Makefile + src/mesa/drivers/dri/radeon/Makefile + src/mesa/drivers/dri/swrast/Makefile tests/Makefile tests/glx/Makefile]) @@ -1992,7 +1986,6 @@ if test "x$enable_dri" != xno; then echo " DRI drivers: $dri_dirs" fi echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR" - echo " Shared dricore: $enable_dricore" fi case "x$enable_glx$enable_xlib_glx" in diff --git a/mesalib/src/glsl/glsl_types.cpp b/mesalib/src/glsl/glsl_types.cpp index d4385a644..1489aae6d 100644 --- a/mesalib/src/glsl/glsl_types.cpp +++ b/mesalib/src/glsl/glsl_types.cpp @@ -147,12 +147,12 @@ glsl_type::sampler_index() const return TEXTURE_RECT_INDEX; case GLSL_SAMPLER_DIM_BUF: assert(!"FINISHME: Implement ARB_texture_buffer_object"); - break; + return TEXTURE_BUFFER_INDEX; case GLSL_SAMPLER_DIM_EXTERNAL: return TEXTURE_EXTERNAL_INDEX; default: assert(!"Should not get here."); - break; + return TEXTURE_BUFFER_INDEX; } } diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp index adedfe6f3..509575192 100644 --- a/mesalib/src/glsl/linker.cpp +++ b/mesalib/src/glsl/linker.cpp @@ -1388,9 +1388,10 @@ public: static bool is_same(const tfeedback_decl &x, const tfeedback_decl &y); bool assign_location(struct gl_context *ctx, struct gl_shader_program *prog, ir_variable *output_var); + bool accumulate_num_outputs(struct gl_shader_program *prog, unsigned *count); bool store(struct gl_context *ctx, struct gl_shader_program *prog, struct gl_transform_feedback_info *info, unsigned buffer, - unsigned varying) const; + unsigned varying, const unsigned max_outputs) const; /** @@ -1624,16 +1625,9 @@ tfeedback_decl::assign_location(struct gl_context *ctx, } -/** - * Update gl_transform_feedback_info to reflect this tfeedback_decl. - * - * If an error occurs, the error is reported through linker_error() and false - * is returned. - */ bool -tfeedback_decl::store(struct gl_context *ctx, struct gl_shader_program *prog, - struct gl_transform_feedback_info *info, - unsigned buffer, unsigned varying) const +tfeedback_decl::accumulate_num_outputs(struct gl_shader_program *prog, + unsigned *count) { if (!this->is_assigned()) { /* From GL_EXT_transform_feedback: @@ -1648,6 +1642,28 @@ tfeedback_decl::store(struct gl_context *ctx, struct gl_shader_program *prog, return false; } + unsigned translated_size = this->size; + if (this->is_clip_distance_mesa) + translated_size = (translated_size + 3) / 4; + + *count += translated_size * this->matrix_columns; + + return true; +} + + +/** + * Update gl_transform_feedback_info to reflect this tfeedback_decl. + * + * If an error occurs, the error is reported through linker_error() and false + * is returned. + */ +bool +tfeedback_decl::store(struct gl_context *ctx, struct gl_shader_program *prog, + struct gl_transform_feedback_info *info, + unsigned buffer, + unsigned varying, const unsigned max_outputs) const +{ /* From GL_EXT_transform_feedback: * A program will fail to link if: * @@ -1663,19 +1679,6 @@ tfeedback_decl::store(struct gl_context *ctx, struct gl_shader_program *prog, return false; } - /* Verify that the checks on MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS - * and MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS are sufficient to prevent - * overflow of info->Outputs[]. In worst case we generate one entry in - * Outputs[] per component so a conservative check is to verify that the - * size of the array is greater than or equal to both - * MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS and - * MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS. - */ - assert(Elements(info->Outputs) >= - ctx->Const.MaxTransformFeedbackInterleavedComponents); - assert(Elements(info->Outputs) >= - ctx->Const.MaxTransformFeedbackSeparateComponents); - unsigned translated_size = this->size; if (this->is_clip_distance_mesa) translated_size = (translated_size + 3) / 4; @@ -1683,6 +1686,7 @@ tfeedback_decl::store(struct gl_context *ctx, struct gl_shader_program *prog, for (unsigned index = 0; index < translated_size; ++index) { for (unsigned v = 0; v < this->matrix_columns; ++v) { unsigned num_components = this->vector_elements; + assert(info->NumOutputs < max_outputs); info->Outputs[info->NumOutputs].ComponentOffset = 0; if (this->is_clip_distance_mesa) { if (this->is_subscripted) { @@ -1976,6 +1980,7 @@ store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog, prog->TransformFeedback.BufferMode == GL_SEPARATE_ATTRIBS; ralloc_free(prog->LinkedTransformFeedback.Varyings); + ralloc_free(prog->LinkedTransformFeedback.Outputs); memset(&prog->LinkedTransformFeedback, 0, sizeof(prog->LinkedTransformFeedback)); @@ -1988,12 +1993,23 @@ store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog, struct gl_transform_feedback_varying_info, num_tfeedback_decls); + unsigned num_outputs = 0; + for (unsigned i = 0; i < num_tfeedback_decls; ++i) + if (!tfeedback_decls[i].accumulate_num_outputs(prog, &num_outputs)) + return false; + + prog->LinkedTransformFeedback.Outputs = + rzalloc_array(prog, + struct gl_transform_feedback_output, + num_outputs); + for (unsigned i = 0; i < num_tfeedback_decls; ++i) { unsigned buffer = separate_attribs_mode ? i : 0; if (!tfeedback_decls[i].store(ctx, prog, &prog->LinkedTransformFeedback, - buffer, i)) + buffer, i, num_outputs)) return false; } + assert(prog->LinkedTransformFeedback.NumOutputs == num_outputs); return true; } diff --git a/mesalib/src/mapi/glapi/Makefile b/mesalib/src/mapi/glapi/Makefile index 9f1d42f88..37b178eee 100644 --- a/mesalib/src/mapi/glapi/Makefile +++ b/mesalib/src/mapi/glapi/Makefile @@ -1,77 +1,64 @@ -# src/mapi/glapi/Makefile
-
-TOP = ../../..
-include $(TOP)/configs/current
-
-TARGET = glapi
-
-MAPI = $(TOP)/src/mapi/mapi
-
-include sources.mak
-include $(MAPI)/sources.mak
-
-glapi_CPPFLAGS := \
- -I$(TOP)/include \
- -I$(TOP)/src/mapi \
- -I$(TOP)/src/mesa
-
-ifeq ($(SHARED_GLAPI),1)
-glapi_CPPFLAGS += \
- -DMAPI_MODE_BRIDGE \
- -DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
-glapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_SOURCES))
-
-glapi_GLAPI_OBJECTS :=
-glapi_ASM_OBJECTS :=
-glapi_MAPI_OBJECTS := $(MAPI_BRIDGE_SOURCES:.c=.o)
-else
-glapi_CPPFLAGS += -DMAPI_MODE_UTIL
-glapi_SOURCES := $(GLAPI_SOURCES) $(addprefix $(MAPI)/, $(MAPI_UTIL_SOURCES))
-
-glapi_GLAPI_OBJECTS := $(GLAPI_SOURCES:.c=.o)
-glapi_ASM_OBJECTS := $(GLAPI_ASM_SOURCES:.S=.o)
-glapi_MAPI_OBJECTS := $(MAPI_UTIL_SOURCES:.c=.o)
-endif # SHARED_GLAPI
-
-glapi_OBJECTS := \
- $(glapi_GLAPI_OBJECTS) \
- $(glapi_ASM_OBJECTS) \
- $(glapi_MAPI_OBJECTS)
-
-default: depend lib$(TARGET).a
-
-lib$(TARGET).a: $(glapi_OBJECTS)
- @$(MKLIB) -o $(TARGET) -static $(glapi_OBJECTS)
-
-$(glapi_GLAPI_OBJECTS): %.o: %.c
- $(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@
-
-$(glapi_ASM_OBJECTS): %.o: %.S
- $(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@
-
-$(glapi_MAPI_OBJECTS): %.o: $(MAPI)/%.c
- $(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@
-
-install:
-
-clean:
- -rm -f $(glapi_OBJECTS)
- -rm -f lib$(TARGET).a
- -rm -f depend depend.bak
-
-ifeq ($(SHARED_GLAPI),1)
-# workaround a bug in makedepend
-makedepend_CPPFLAGS := \
- $(filter-out -DMAPI_ABI_HEADER=%, $(glapi_CPPFLAGS))
-$(glapi_OBJECTS): glapi_mapi_tmp.h
-else
-makedepend_CPPFLAGS := $(glapi_CPPFLAGS)
-endif
-
-depend: $(glapi_SOURCES)
- @ echo "running $(MKDEP)"
- @ touch depend
- @$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(makedepend_CPPFLAGS) \
- $(glapi_SOURCES) 2>/dev/null | sed -e 's,^$(MAPI)/,,' > depend
-
--include depend
+# src/mapi/glapi/Makefile + +TOP = ../../.. +include $(TOP)/configs/current + +TARGET = glapi + +MAPI = $(TOP)/src/mapi/mapi + +include sources.mak +include $(MAPI)/sources.mak + +glapi_CPPFLAGS := \ + -I$(TOP)/include \ + -I$(TOP)/src/mapi \ + -I$(TOP)/src/mesa + +glapi_CPPFLAGS += \ + -DMAPI_MODE_BRIDGE \ + -DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\" +glapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_SOURCES)) + +glapi_GLAPI_OBJECTS := +glapi_ASM_OBJECTS := +glapi_MAPI_OBJECTS := $(MAPI_BRIDGE_SOURCES:.c=.o) + +glapi_OBJECTS := \ + $(glapi_GLAPI_OBJECTS) \ + $(glapi_ASM_OBJECTS) \ + $(glapi_MAPI_OBJECTS) + +default: depend lib$(TARGET).a + +lib$(TARGET).a: $(glapi_OBJECTS) + @$(MKLIB) -o $(TARGET) -static $(glapi_OBJECTS) + +$(glapi_GLAPI_OBJECTS): %.o: %.c + $(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@ + +$(glapi_ASM_OBJECTS): %.o: %.S + $(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@ + +$(glapi_MAPI_OBJECTS): %.o: $(MAPI)/%.c + $(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@ + +install: + +clean: + -rm -f $(glapi_OBJECTS) + -rm -f lib$(TARGET).a + -rm -f depend depend.bak + +# workaround a bug in makedepend +makedepend_CPPFLAGS := \ + $(filter-out -DMAPI_ABI_HEADER=%, $(glapi_CPPFLAGS)) +$(glapi_OBJECTS): glapi_mapi_tmp.h + +depend: $(glapi_SOURCES) + @ echo "running $(MKDEP)" + @ touch depend + @$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(makedepend_CPPFLAGS) \ + $(glapi_SOURCES) 2>/dev/null | sed -e 's,^$(MAPI)/,,' > depend + +-include depend diff --git a/mesalib/src/mapi/glapi/gen/glX_proto_send.py b/mesalib/src/mapi/glapi/gen/glX_proto_send.py index bec022218..29bf0808b 100644 --- a/mesalib/src/mapi/glapi/gen/glX_proto_send.py +++ b/mesalib/src/mapi/glapi/gen/glX_proto_send.py @@ -361,8 +361,6 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; procs[n] = func.static_glx_name(n) print """ -#ifdef GLX_SHARED_GLAPI - static const struct proc_pair { const char *name; @@ -396,8 +394,6 @@ __indirect_get_proc_address(const char *name) return (pair) ? pair->proc : NULL; } - -#endif /* GLX_SHARED_GLAPI */ """ return @@ -1051,9 +1047,7 @@ extern _X_HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( break print '' - print '#ifdef GLX_SHARED_GLAPI' print 'extern _X_HIDDEN void (*__indirect_get_proc_address(const char *name))(void);' - print '#endif' def show_usage(): diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript index 4754fbfc8..e9b1f6aaf 100644 --- a/mesalib/src/mesa/SConscript +++ b/mesalib/src/mesa/SConscript @@ -423,14 +423,6 @@ if env['gcc'] and env['platform'] != 'windows': 'x86-64/x86-64.c', 'x86-64/xform4.S', ] - elif env['machine'] == 'ppc': - env.Append(CPPDEFINES = [ - 'USE_PPC_ASM', - 'USE_VMX_ASM', - ]) - mesa_sources += [ - 'ppc/common_ppc.c', - ] elif env['machine'] == 'sparc': mesa_sources += [ 'sparc/sparc.c', diff --git a/mesalib/src/mesa/drivers/dri/Makefile b/mesalib/src/mesa/drivers/dri/Makefile deleted file mode 100644 index 264648c3f..000000000 --- a/mesalib/src/mesa/drivers/dri/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# src/mesa/drivers/dri/Makefile - -TOP = ../../../.. - -include $(TOP)/configs/current - - - -default: $(TOP)/$(LIB_DIR) subdirs dri.pc - - -$(TOP)/$(LIB_DIR): - -mkdir $(TOP)/$(LIB_DIR) - - -subdirs: - @for dir in $(DRI_DIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE)) || exit 1 ; \ - fi \ - done - -pcedit = sed \ - -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ - -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ - -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ - -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \ - -e 's,@DRI_DRIVER_DIR@,$(DRI_DRIVER_INSTALL_DIR),' \ - -e 's,@DRI_PC_REQ_PRIV@,$(DRI_PC_REQ_PRIV),' - -dri.pc: dri.pc.in - $(pcedit) $< > $@ - - -install: dri.pc - @for dir in $(DRI_DIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE) install) || exit 1 ; \ - fi \ - done - $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal - $(INSTALL) -m 0644 $(TOP)/include/GL/internal/dri_interface.h \ - $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal - $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - $(INSTALL) -m 0644 dri.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - - -clean: - -@for dir in $(DRI_DIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE) clean) ; \ - fi \ - done - -rm -f common/*.o - -rm -f *.pc diff --git a/mesalib/src/mesa/drivers/dri/Makefile.defines b/mesalib/src/mesa/drivers/dri/Makefile.defines deleted file mode 100644 index 6ff8df5c0..000000000 --- a/mesalib/src/mesa/drivers/dri/Makefile.defines +++ /dev/null @@ -1,27 +0,0 @@ -# -*-makefile-*- - -# Import mesa_dri_common_* -include ../common/Makefile.sources - -COMMON_GALLIUM_SOURCES = \ - $(addprefix ../common/, $(mesa_dri_common_gallium_SOURCES)) - -COMMON_SOURCES = \ - $(addprefix ../common/, $(mesa_dri_common_SOURCES)) - -INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) - -OBJECTS = $(C_SOURCES:.c=.o) \ - $(CXX_SOURCES:.cpp=.o) \ - $(ASM_SOURCES:.S=.o) - - -### Include directories -SHARED_INCLUDES = \ - -I. \ - -Iserver \ - $(addprefix -I$(TOP)/, $(mesa_dri_common_INCLUDES)) \ - $(LIBDRM_CFLAGS) - -INCLUDES += $(API_DEFINES) -CXXFLAGS += $(API_DEFINES) diff --git a/mesalib/src/mesa/drivers/dri/Makefile.targets b/mesalib/src/mesa/drivers/dri/Makefile.targets deleted file mode 100644 index 436b2a3c4..000000000 --- a/mesalib/src/mesa/drivers/dri/Makefile.targets +++ /dev/null @@ -1,78 +0,0 @@ -# -*-makefile-*- - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@ - -.cpp.o: - $(CC) -c $(INCLUDES) $(DRI_CXXFLAGS) $(DRIVER_DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@ - - -#### TARGETS ##### - -default: subdirs lib - - -.PHONY: lib -lib: symlinks subdirs depend - @$(MAKE) $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) - -$(LIBNAME): $(OBJECTS) $(EXTRA_MODULES) $(MESA_MODULES) Makefile \ - $(TOP)/src/mesa/drivers/dri/Makefile.targets $(TOP)/src/mesa/drivers/dri/common/dri_test.o - $(MKLIB) -o $@.tmp -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \ - $(OBJECTS) $(EXTRA_MODULES) $(DRI_LIB_DEPS) - $(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS) - @rm -f $@.test - mv -f $@.tmp $@ - - -$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) - $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) - - -# If the Makefile defined SUBDIRS, run make in each -.PHONY: subdirs -subdirs: - @if test -n "$(SUBDIRS)" ; then \ - for dir in $(SUBDIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE)) || exit 1; \ - fi \ - done \ - fi - - -.PHONY: symlinks -symlinks: - - -depend: $(C_SOURCES) $(CXX_SOURCES) $(ASM_SOURCES) $(SYMLINKS) - @ echo "running $(MKDEP)" - @ rm -f depend - @ touch depend - @ $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) \ - $(C_SOURCES) $(CXX_SOURCES) \ - $(ASM_SOURCES) > /dev/null 2>/dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -# Remove .o and backup files -clean: - -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS) - -rm -f depend depend.bak - - -install: $(LIBNAME) - $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR) - $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR) - - --include depend diff --git a/mesalib/src/mesa/drivers/dri/dri.pc.in b/mesalib/src/mesa/drivers/dri/dri.pc.in index 695aa6cfd..de6e08a4a 100644 --- a/mesalib/src/mesa/drivers/dri/dri.pc.in +++ b/mesalib/src/mesa/drivers/dri/dri.pc.in @@ -1,8 +1,8 @@ -prefix=@INSTALL_DIR@ -exec_prefix=${prefix} -libdir=@INSTALL_LIB_DIR@ -includedir=@INSTALL_INC_DIR@ -dridriverdir=@DRI_DRIVER_DIR@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +dridriverdir=@DRI_DRIVER_INSTALL_DIR@ Name: dri Description: Direct Rendering Infrastructure diff --git a/mesalib/src/mesa/drivers/dri/swrast/Makefile b/mesalib/src/mesa/drivers/dri/swrast/Makefile deleted file mode 100644 index 509fa28b6..000000000 --- a/mesalib/src/mesa/drivers/dri/swrast/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# src/mesa/drivers/dri/swrast/Makefile - -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = swrast_dri.so - -include ../Makefile.defines - -DRIVER_DEFINES = -D__NOT_HAVE_DRM_H - -DRIVER_SOURCES = \ - swrast.c \ - swrast_span.c - -C_SOURCES = \ - $(SWRAST_COMMON_SOURCES) \ - $(DRIVER_SOURCES) - -ASM_SOURCES = - -SWRAST_COMMON_SOURCES = \ - ../common/utils.c \ - ../common/drisw_util.c - -include ../Makefile.targets - diff --git a/mesalib/src/mesa/main/cpuinfo.c b/mesalib/src/mesa/main/cpuinfo.c index d19aef91b..0d7971bcc 100644 --- a/mesalib/src/mesa/main/cpuinfo.c +++ b/mesalib/src/mesa/main/cpuinfo.c @@ -1,109 +1,91 @@ -/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 2009 VMware, Inc. 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#include "main/compiler.h"
-#include "main/cpuinfo.h"
-
-
-/**
- * This function should be called before the various "cpu_has_foo" macros
- * are used.
- */
-void
-_mesa_get_cpu_features(void)
-{
-#ifdef USE_X86_ASM
- _mesa_get_x86_features();
-#endif
-}
-
-
-/**
- * Return a string describing the CPU architexture and extensions that
- * Mesa is using (such as SSE or Altivec).
- * \return information string, free it with free()
- */
-char *
-_mesa_get_cpu_string(void)
-{
-#define MAX_STRING 50
- char *buffer;
-
- buffer = (char *) malloc(MAX_STRING);
- if (!buffer)
- return NULL;
-
- buffer[0] = 0;
-
-#ifdef USE_X86_ASM
-
- if (_mesa_x86_cpu_features) {
- strcat(buffer, "x86");
- }
-
-# ifdef USE_MMX_ASM
- if (cpu_has_mmx) {
- strcat(buffer, (cpu_has_mmxext) ? "/MMX+" : "/MMX");
- }
-# endif
-# ifdef USE_3DNOW_ASM
- if (cpu_has_3dnow) {
- strcat(buffer, (cpu_has_3dnowext) ? "/3DNow!+" : "/3DNow!");
- }
-# endif
-# ifdef USE_SSE_ASM
- if (cpu_has_xmm) {
- strcat(buffer, (cpu_has_xmm2) ? "/SSE2" : "/SSE");
- }
-# endif
-
-#elif defined(USE_SPARC_ASM)
-
- strcat(buffer, "SPARC");
-
-#elif defined(USE_PPC_ASM)
-
- if (_mesa_ppc_cpu_features) {
- strcat(buffer, (cpu_has_64) ? "PowerPC 64" : "PowerPC");
- }
-
-# ifdef USE_VMX_ASM
-
- if (cpu_has_vmx) {
- strcat(buffer, "/Altivec");
- }
-
-# endif
-
- if (! cpu_has_fpu) {
- strcat(buffer, "/No FPU");
- }
-
-#endif
-
- assert(strlen(buffer) < MAX_STRING);
-
- return buffer;
-}
+/* + * Mesa 3-D graphics library + * Version: 7.5 + * + * Copyright (C) 2009 VMware, Inc. 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, sublicense, + * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL 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. + */ + + +#include "main/compiler.h" +#include "main/cpuinfo.h" + + +/** + * This function should be called before the various "cpu_has_foo" macros + * are used. + */ +void +_mesa_get_cpu_features(void) +{ +#ifdef USE_X86_ASM + _mesa_get_x86_features(); +#endif +} + + +/** + * Return a string describing the CPU architexture and extensions that + * Mesa is using (such as SSE or Altivec). + * \return information string, free it with free() + */ +char * +_mesa_get_cpu_string(void) +{ +#define MAX_STRING 50 + char *buffer; + + buffer = (char *) malloc(MAX_STRING); + if (!buffer) + return NULL; + + buffer[0] = 0; + +#ifdef USE_X86_ASM + + if (_mesa_x86_cpu_features) { + strcat(buffer, "x86"); + } + +# ifdef USE_MMX_ASM + if (cpu_has_mmx) { + strcat(buffer, (cpu_has_mmxext) ? "/MMX+" : "/MMX"); + } +# endif +# ifdef USE_3DNOW_ASM + if (cpu_has_3dnow) { + strcat(buffer, (cpu_has_3dnowext) ? "/3DNow!+" : "/3DNow!"); + } +# endif +# ifdef USE_SSE_ASM + if (cpu_has_xmm) { + strcat(buffer, (cpu_has_xmm2) ? "/SSE2" : "/SSE"); + } +# endif + +#elif defined(USE_SPARC_ASM) + + strcat(buffer, "SPARC"); + +#endif + + assert(strlen(buffer) < MAX_STRING); + + return buffer; +} diff --git a/mesalib/src/mesa/main/cpuinfo.h b/mesalib/src/mesa/main/cpuinfo.h index c41a90b07..bf846ef40 100644 --- a/mesalib/src/mesa/main/cpuinfo.h +++ b/mesalib/src/mesa/main/cpuinfo.h @@ -31,10 +31,6 @@ #include "x86/common_x86_asm.h" #endif -#if defined(USE_PPC_ASM) -#include "ppc/common_ppc_features.h" -#endif - extern void _mesa_get_cpu_features(void); diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index 052495907..2b3ac2e25 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -2709,9 +2709,13 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, if ((readRb == NULL) || (drawRb == NULL)) { mask &= ~GL_STENCIL_BUFFER_BIT; } - else if (readRb->Format != drawRb->Format) { + else if (_mesa_get_format_bits(readRb->Format, GL_STENCIL_BITS) != + _mesa_get_format_bits(drawRb->Format, GL_STENCIL_BITS)) { + /* There is no need to check the stencil datatype here, because + * there is only one: GL_UNSIGNED_INT. + */ _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlitFramebufferEXT(stencil buffer format mismatch)"); + "glBlitFramebufferEXT(stencil buffer size mismatch)"); return; } } @@ -2731,7 +2735,10 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, if ((readRb == NULL) || (drawRb == NULL)) { mask &= ~GL_DEPTH_BUFFER_BIT; } - else if (readRb->Format != drawRb->Format) { + else if ((_mesa_get_format_bits(readRb->Format, GL_DEPTH_BITS) != + _mesa_get_format_bits(drawRb->Format, GL_DEPTH_BITS)) || + (_mesa_get_format_datatype(readRb->Format) != + _mesa_get_format_datatype(drawRb->Format))) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(depth buffer format mismatch)"); return; diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index f8ef01d4e..2ff608596 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -1827,6 +1827,22 @@ struct gl_transform_feedback_varying_info { GLint Size; }; +struct gl_transform_feedback_output { + unsigned OutputRegister; + unsigned OutputBuffer; + unsigned NumComponents; + + /** offset (in DWORDs) of this output within the interleaved structure */ + unsigned DstOffset; + + /** + * Offset into the output register of the data to output. For example, + * if NumComponents is 2 and ComponentOffset is 1, then the data to + * offset is in the y and z components of the output register. + */ + unsigned ComponentOffset; +}; + /** Post-link transform feedback info. */ struct gl_transform_feedback_info { unsigned NumOutputs; @@ -1836,21 +1852,7 @@ struct gl_transform_feedback_info { */ unsigned NumBuffers; - struct { - unsigned OutputRegister; - unsigned OutputBuffer; - unsigned NumComponents; - - /** offset (in DWORDs) of this output within the interleaved structure */ - unsigned DstOffset; - - /** - * Offset into the output register of the data to output. For example, - * if NumComponents is 2 and ComponentOffset is 1, then the data to - * offset is in the y and z components of the output register. - */ - unsigned ComponentOffset; - } Outputs[MAX_PROGRAM_OUTPUTS]; + struct gl_transform_feedback_output *Outputs; /** Transform feedback varyings used for the linking of this shader program. * diff --git a/mesalib/src/mesa/main/state.c b/mesalib/src/mesa/main/state.c index adbb0c32b..39d7294f7 100644 --- a/mesalib/src/mesa/main/state.c +++ b/mesalib/src/mesa/main/state.c @@ -33,6 +33,7 @@ #include "glheader.h" #include "mtypes.h" +#include "arrayobj.h" #include "context.h" #include "debug.h" #include "macros.h" diff --git a/mesalib/src/mesa/math/m_xform.c b/mesalib/src/mesa/math/m_xform.c index 369f2c6e9..61ad3c753 100644 --- a/mesalib/src/mesa/math/m_xform.c +++ b/mesalib/src/mesa/math/m_xform.c @@ -58,10 +58,6 @@ #include "sparc/sparc.h" #endif -#ifdef USE_PPC_ASM -#include "ppc/common_ppc_features.h" -#endif - clip_func _mesa_clip_tab[5]; clip_func _mesa_clip_np_tab[5]; dotprod_func _mesa_dotprod_tab[5]; @@ -120,8 +116,6 @@ _math_init_transformation( void ) _mesa_init_all_x86_transform_asm(); #elif defined( USE_SPARC_ASM ) _mesa_init_all_sparc_transform_asm(); -#elif defined( USE_PPC_ASM ) - _mesa_init_all_ppc_transform_asm(); #elif defined( USE_X86_64_ASM ) _mesa_init_all_x86_64_transform_asm(); #endif diff --git a/mesalib/src/mesa/ppc/common_ppc.c b/mesalib/src/mesa/ppc/common_ppc.c deleted file mode 100644 index c7cec96e5..000000000 --- a/mesalib/src/mesa/ppc/common_ppc.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2004 - * 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 - * on 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 - * IBM AND/OR THEIR 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. - */ - -/** - * \file common_ppc.c - * Check CPU capabilities & initialize optimized funtions for this particular - * processor. - * - * \author Ian Romanick <idr@us.ibm.com> - */ - -#include <stdio.h> -#include <unistd.h> -#include <sys/types.h> - -#ifdef USE_PPC_ASM -#include <elf.h> -#endif - -#include "common_ppc_features.h" - - -unsigned long _mesa_ppc_cpu_features = 0; - -/** - * Detect CPU features and install optimized transform and lighting routines. - * Currently, CPU features are only detected. The optimized routines have - * yet to be written. - * - * \bug - * This routine is highly specific to Linux kernel 2.6. I'm still waiting - * to hear back from the glibc folk on how to do this "right". - */ - -void _mesa_init_all_ppc_transform_asm( void ) -{ -#ifdef USE_PPC_ASM - const pid_t my_pid = getpid(); - char file_name[32]; - FILE * f; -#ifdef __powerpc64__ - Elf64_auxv_t v; -#else - Elf32_auxv_t v; -#endif - - sprintf( file_name, "/proc/%u/auxv", (unsigned) my_pid ); - f = fopen( file_name, "rb" ); - if ( f != NULL ) { - while( 1 ) { - ssize_t elem = fread( & v, sizeof( v ), 1, f ); - - if ( elem < 1 ) { - break; - } - - if ( v.a_type == AT_HWCAP ) { - _mesa_ppc_cpu_features = v.a_un.a_val; - break; - } - } - - fclose( f ); - } - -# ifndef USE_VMX_ASM - _mesa_ppc_cpu_features &= ~PPC_FEATURE_HAS_ALTIVEC; -# endif -#endif -} diff --git a/mesalib/src/mesa/ppc/common_ppc_features.h b/mesalib/src/mesa/ppc/common_ppc_features.h deleted file mode 100644 index 9cde422d7..000000000 --- a/mesalib/src/mesa/ppc/common_ppc_features.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2004 - * 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 - * on 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 - * IBM AND/OR THEIR 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. - */ - -/** - * \file common_ppc_features.h - * Interface for determining which CPU features were detected. - * - * \author Ian Romanick <idr@us.ibm.com> - */ - -#ifndef COMMON_PPC_FEATURES_H -#define COMMON_PPC_FEATURES_H - -#ifdef USE_PPC_ASM -#include <asm/cputable.h> - -extern unsigned long _mesa_ppc_cpu_features; - - -/* The PPC_FEATURE_* values come from asm/cputable.h. Should we define - * versions of them here if that file does not exist? This will only - * matter once these code paths are supported on non-Linux platforms. - */ - -#define cpu_has_64 ((_mesa_ppc_cpu_features & PPC_FEATURE_64) != 0) -#define cpu_has_vmx ((_mesa_ppc_cpu_features & PPC_FEATURE_HAS_ALTIVEC) != 0) -#define cpu_has_fpu ((_mesa_ppc_cpu_features & PPC_FEATURE_HAS_FPU) != 0) - -#endif /* USE_PPC_ASM */ - -extern void _mesa_init_all_ppc_transform_asm( void ); - -#endif /* COMMON_PPC_FEATURES_H */ diff --git a/mesalib/src/mesa/sources.mak b/mesalib/src/mesa/sources.mak index 165a6c85e..b57a10e4d 100644 --- a/mesalib/src/mesa/sources.mak +++ b/mesalib/src/mesa/sources.mak @@ -277,7 +277,6 @@ ASM_C_SOURCES = \ x86/sse.c \ x86/rtasm/x86sse.c \ sparc/sparc.c \ - ppc/common_ppc.c \ x86-64/x86-64.c X86_SOURCES = \ @@ -336,7 +335,6 @@ MESA_GALLIUM_SOURCES = \ $(VBO_SOURCES) \ $(STATETRACKER_SOURCES) \ $(PROGRAM_SOURCES) \ - ppc/common_ppc.c \ x86/common_x86.c MESA_GALLIUM_CXX_SOURCES = \ |