From 6678f597e7c9ba784c9af0c86cfc6821558bcaa7 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 15 Oct 2009 18:25:24 +0800 Subject: gallium/xlib: Fix missing symbols when GLX_INDIRECT_RENDERING is defined. When GLX_INDIRECT_RENDERING is defined, some symbols are used in libglapi.a but are not defined. Define them through the help of glapitemp.h. Signed-off-by: Chia-I Wu --- src/gallium/winsys/xlib/xlib.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/gallium/winsys') diff --git a/src/gallium/winsys/xlib/xlib.c b/src/gallium/winsys/xlib/xlib.c index 163cc8863c..bf2fb230eb 100644 --- a/src/gallium/winsys/xlib/xlib.c +++ b/src/gallium/winsys/xlib/xlib.c @@ -112,3 +112,33 @@ extern void (*linker_foo(const unsigned char *procName))() { return glXGetProcAddress(procName); } + + +/** + * When GLX_INDIRECT_RENDERING is defined, some symbols are missing in + * libglapi.a. We need to define them here. + */ +#ifdef GLX_INDIRECT_RENDERING + +#define GL_GLEXT_PROTOTYPES +#include "GL/gl.h" +#include "glapi/glapi.h" +#include "glapi/dispatch.h" + +#if defined(USE_MGL_NAMESPACE) +#define NAME(func) mgl##func +#else +#define NAME(func) gl##func +#endif + +#define DISPATCH(FUNC, ARGS, MESSAGE) \ + CALL_ ## FUNC(GET_DISPATCH(), ARGS); + +#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ + return CALL_ ## FUNC(GET_DISPATCH(), ARGS); + +/* skip normal ones */ +#define _GLAPI_SKIP_NORMAL_ENTRY_POINTS +#include "glapi/glapitemp.h" + +#endif /* GLX_INDIRECT_RENDERING */ -- cgit v1.2.3 From 5f0ea53747c14b1cd9686bcf650b96504128116e Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 10 Nov 2009 13:10:55 +0800 Subject: egl_softpipe: Clean up Makefile. Fix generation of depend. Link to the dynamic libraries used. Signed-off-by: Chia-I Wu --- src/gallium/winsys/egl_xlib/Makefile | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/gallium/winsys') diff --git a/src/gallium/winsys/egl_xlib/Makefile b/src/gallium/winsys/egl_xlib/Makefile index 3efb7ed4af..06c1fb0b91 100644 --- a/src/gallium/winsys/egl_xlib/Makefile +++ b/src/gallium/winsys/egl_xlib/Makefile @@ -29,13 +29,7 @@ WINSYS_OBJECTS = $(WINSYS_SOURCES:.c=.o) LIBS = \ $(GALLIUM_DRIVERS) \ $(GALLIUM_AUXILIARIES) - -# XXX temporary (should create a separate lib with the GL API funcs and -# mesa code, as done for ES 1.x, 2.x, OpenVG, etc) -UNUSED_LIBS = \ - $(TOP)/src/mesa/libglapi.a \ - $(TOP)/src/mesa/libmesagallium.a \ - +LIB_DEPS = $(EGL_LIB_DEPS) -lm -lX11 LOCAL_CFLAGS = @@ -60,14 +54,15 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(WINSYS_OBJECTS) $(LIBS) -noprefix \ -install $(TOP)/$(LIB_DIR) \ $(MKLIB_OPTIONS) $(WINSYS_OBJECTS) \ - -Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive + -Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive \ + $(LIB_DEPS) -depend: $(ALL_SOURCES) +depend: $(WINSYS_SOURCES) @ echo "running $(MKDEP)" @ rm -f depend # workaround oops on gutsy?!? @ touch depend - @ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \ + @ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(WINSYS_SOURCES) \ > /dev/null 2>/dev/null -- cgit v1.2.3 From 4b9cc50345b5b10bb998ce5ce6f7cb37b72f354f Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 9 Nov 2009 10:54:19 +0800 Subject: st/egl: Allow APIs other than OpenGL. This is done by stopping linking to libmesagallium.a and removing DRI related stuff. The state tracker an application links to decides the API supported. Signed-off-by: Chia-I Wu --- src/gallium/state_trackers/egl/egl_tracker.c | 2 -- src/gallium/winsys/drm/intel/egl/Makefile | 29 ++++++++++++++++++---------- src/gallium/winsys/drm/intel/egl/dummy.c | 1 + src/gallium/winsys/drm/radeon/egl/Makefile | 28 +++++++++++++++++++-------- src/gallium/winsys/drm/radeon/egl/dummy.c | 1 + 5 files changed, 41 insertions(+), 20 deletions(-) create mode 100644 src/gallium/winsys/drm/intel/egl/dummy.c create mode 100644 src/gallium/winsys/drm/radeon/egl/dummy.c (limited to 'src/gallium/winsys') diff --git a/src/gallium/state_trackers/egl/egl_tracker.c b/src/gallium/state_trackers/egl/egl_tracker.c index 8d29bf490b..1ad0097786 100644 --- a/src/gallium/state_trackers/egl/egl_tracker.c +++ b/src/gallium/state_trackers/egl/egl_tracker.c @@ -167,8 +167,6 @@ drm_initialize(_EGLDriver *drv, _EGLDisplay *disp, EGLint *major, EGLint *minor) goto err_screen; dev->winsys = dev->screen->winsys; - driInitExtensions(NULL, NULL, GL_FALSE); - drm_update_res(dev); res = dev->res; if (res) diff --git a/src/gallium/winsys/drm/intel/egl/Makefile b/src/gallium/winsys/drm/intel/egl/Makefile index 1397e9f729..c9c92b69b6 100644 --- a/src/gallium/winsys/drm/intel/egl/Makefile +++ b/src/gallium/winsys/drm/intel/egl/Makefile @@ -2,7 +2,7 @@ TOP = ../../../../../.. GALLIUMDIR = ../../../.. include $(TOP)/configs/current -LIBNAME = EGL_i915.so +LIBNAME = egl_i915.so PIPE_DRIVERS = \ $(TOP)/src/gallium/state_trackers/egl/libegldrm.a \ @@ -11,19 +11,28 @@ PIPE_DRIVERS = \ $(TOP)/src/gallium/drivers/trace/libtrace.a \ $(TOP)/src/gallium/drivers/i915/libi915.a -DRIVER_SOURCES = +DRIVER_EXTRAS = -lm -lpthread -ldrm_intel -C_SOURCES = \ - $(COMMON_GALLIUM_SOURCES) \ - $(DRIVER_SOURCES) +OBJECTS = dummy.o -DRIVER_EXTRAS = -ldrm_intel +default: $(TOP)/$(LIB_DIR)/$(LIBNAME) -ASM_SOURCES = +$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) + @mkdir -p $(TOP)/$(LIB_DIR) + $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) -DRIVER_DEFINES = -I../gem $(shell pkg-config libdrm --atleast-version=2.3.1 \ - && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP") +$(LIBNAME): $(OBJECTS) $(GALLIUM_AUXILIARIES) $(PIPE_DRIVERS) Makefile + $(MKLIB) -noprefix -o $@ $(OBJECTS) \ + -Wl,--whole-archive $(PIPE_DRIVERS) -Wl,--no-whole-archive \ + -Wl,--start-group $(GALLIUM_AUXILIARIES) -Wl,--end-group \ + $(DRI_LIB_DEPS) $(DRIVER_EXTRAS) -include ../../Makefile.template +clean: + -rm -f *.o *.so *~ + +depend: symlinks: + +install: $(LIBNAME) + $(MINSTALL) -m 755 $(LIBNAME) $(INSTALL_DIR)/$(LIB_DIR) diff --git a/src/gallium/winsys/drm/intel/egl/dummy.c b/src/gallium/winsys/drm/intel/egl/dummy.c new file mode 100644 index 0000000000..58c7af84e0 --- /dev/null +++ b/src/gallium/winsys/drm/intel/egl/dummy.c @@ -0,0 +1 @@ +/* mklib expects at least one .o is given */ diff --git a/src/gallium/winsys/drm/radeon/egl/Makefile b/src/gallium/winsys/drm/radeon/egl/Makefile index 6a1448d1b9..2bd05a8175 100644 --- a/src/gallium/winsys/drm/radeon/egl/Makefile +++ b/src/gallium/winsys/drm/radeon/egl/Makefile @@ -2,7 +2,7 @@ TOP = ../../../../../.. GALLIUMDIR = ../../../.. include $(TOP)/configs/current -LIBNAME = EGL_r300.so +LIBNAME = egl_r300.so PIPE_DRIVERS = \ $(TOP)/src/gallium/state_trackers/egl/libegldrm.a \ @@ -11,16 +11,28 @@ PIPE_DRIVERS = \ $(TOP)/src/gallium/drivers/trace/libtrace.a \ $(TOP)/src/gallium/drivers/r300/libr300.a -DRIVER_SOURCES = +DRIVER_EXTRAS = -lm -lpthread -ldrm_radeon -C_SOURCES = \ - $(COMMON_GALLIUM_SOURCES) \ - $(DRIVER_SOURCES) +OBJECTS = dummy.o -DRIVER_EXTRAS = -ldrm_radeon +default: $(TOP)/$(LIB_DIR)/$(LIBNAME) -ASM_SOURCES = +$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) + @mkdir -p $(TOP)/$(LIB_DIR) + $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) -include ../../Makefile.template +$(LIBNAME): $(OBJECTS) $(GALLIUM_AUXILIARIES) $(PIPE_DRIVERS) Makefile + $(MKLIB) -noprefix -o $@ $(OBJECTS) \ + -Wl,--whole-archive $(PIPE_DRIVERS) -Wl,--no-whole-archive \ + -Wl,--start-group $(GALLIUM_AUXILIARIES) -Wl,--end-group \ + $(DRI_LIB_DEPS) $(DRIVER_EXTRAS) + +clean: + -rm -f *.o *.so *~ + +depend: symlinks: + +install: $(LIBNAME) + $(MINSTALL) -m 755 $(LIBNAME) $(INSTALL_DIR)/$(LIB_DIR) diff --git a/src/gallium/winsys/drm/radeon/egl/dummy.c b/src/gallium/winsys/drm/radeon/egl/dummy.c new file mode 100644 index 0000000000..58c7af84e0 --- /dev/null +++ b/src/gallium/winsys/drm/radeon/egl/dummy.c @@ -0,0 +1 @@ +/* mklib expects at least one .o is given */ -- cgit v1.2.3