From d14ac1073cda7ea4f623f312eb469554c3041315 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 3 Sep 2009 11:31:17 +0800 Subject: st/es: Add OpenGL ES state trackers. Signed-off-by: Chia-I Wu --- src/gallium/state_trackers/es/Makefile | 88 ++++++++++++++++++++++++++++++++++ src/gallium/state_trackers/es/st_es1.c | 1 + src/gallium/state_trackers/es/st_es2.c | 1 + 3 files changed, 90 insertions(+) create mode 100644 src/gallium/state_trackers/es/Makefile create mode 100644 src/gallium/state_trackers/es/st_es1.c create mode 100644 src/gallium/state_trackers/es/st_es2.c (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/es/Makefile b/src/gallium/state_trackers/es/Makefile new file mode 100644 index 00000000000..41d4ccb1a60 --- /dev/null +++ b/src/gallium/state_trackers/es/Makefile @@ -0,0 +1,88 @@ +# src/gallium/state_trackers/es/Makefile + +# Build the ES 1/2 state tracker libraries +# This consists of core Mesa ES, plus GL/gallium state tracker. + +TOP = ../../../.. +include $(TOP)/configs/current + +GLES_1_VERSION_MAJOR = 1 +GLES_1_VERSION_MINOR = 1 +GLES_1_VERSION_PATCH = 0 + +GLES_2_VERSION_MAJOR = 2 +GLES_2_VERSION_MINOR = 0 +GLES_2_VERSION_PATCH = 0 + + +# Maybe move these into configs/default: +GLES_1_LIB = GLESv1_CM +GLES_1_LIB_NAME = lib$(GLES_1_LIB).so +GLES_2_LIB = GLESv2 +GLES_2_LIB_NAME = lib$(GLES_2_LIB).so + + +ES1_OBJECTS = st_es1.o +ES2_OBJECTS = st_es2.o + + +# we only need the gallium libs that the state trackers directly use: +GALLIUM_LIBS = \ + $(TOP)/src/gallium/auxiliary/cso_cache/libcso_cache.a \ + $(TOP)/src/gallium/auxiliary/rtasm/librtasm.a \ + $(TOP)/src/gallium/auxiliary/tgsi/libtgsi.a \ + $(TOP)/src/gallium/auxiliary/util/libutil.a + +ES1_LIBS = \ + $(TOP)/src/mesa/es/libes1gallium.a \ + $(TOP)/src/mesa/es/libes1api.a + +ES2_LIBS = \ + $(TOP)/src/mesa/es/libes2gallium.a \ + $(TOP)/src/mesa/es/libes2api.a + +SYS_LIBS = -lm -pthread + + +.c.o: + $(CC) -c $(CFLAGS) $< -o $@ + + +# Default: make both GL ES 1.1 and GL ES 2.0 libraries +default: $(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME) + +# Make the shared libs +$(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME): $(ES1_OBJECTS) $(ES1_LIBS) + $(TOP)/bin/mklib -o $(GLES_1_LIB) \ + -major $(GLES_1_VERSION_MAJOR) \ + -minor $(GLES_1_VERSION_MINOR) \ + -patch $(GLES_1_VERSION_PATCH) \ + -install $(TOP)/$(LIB_DIR) \ + $(ES1_OBJECTS) \ + -Wl,--whole-archive $(ES1_LIBS) -Wl,--no-whole-archive \ + -Wl,--start-group $(GALLIUM_LIBS) -Wl,--end-group \ + $(SYS_LIBS) + +$(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME): $(ES2_OBJECTS) $(ES1_LIBS) + $(TOP)/bin/mklib -o $(GLES_2_LIB) \ + -major $(GLES_2_VERSION_MAJOR) \ + -minor $(GLES_2_VERSION_MINOR) \ + -patch $(GLES_2_VERSION_PATCH) \ + -install $(TOP)/$(LIB_DIR) \ + $(ES2_OBJECTS) \ + -Wl,--whole-archive $(ES2_LIBS) -Wl,--no-whole-archive \ + -Wl,--start-group $(GALLIUM_LIBS) -Wl,--end-group \ + $(SYS_LIBS) + +install: default + $(INSTALL) -d $(INSTALL_DIR)/include/GLES + $(INSTALL) -m 644 $(TOP)/include/GLES/*.h $(INSTALL_DIR)/include/GLES + $(INSTALL) -d $(INSTALL_DIR)/include/GLES2 + $(INSTALL) -m 644 $(TOP)/include/GLES2/*.h $(INSTALL_DIR)/include/GLES2 + $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/libGLESv1* $(INSTALL_DIR)/$(LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/libGLESv2* $(INSTALL_DIR)/$(LIB_DIR) + +clean: + -rm -f *.o *~ + -rm -f $(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME)* $(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME)* diff --git a/src/gallium/state_trackers/es/st_es1.c b/src/gallium/state_trackers/es/st_es1.c new file mode 100644 index 00000000000..7f0c038957b --- /dev/null +++ b/src/gallium/state_trackers/es/st_es1.c @@ -0,0 +1 @@ +const int st_api_OpenGL_ES1 = 1; diff --git a/src/gallium/state_trackers/es/st_es2.c b/src/gallium/state_trackers/es/st_es2.c new file mode 100644 index 00000000000..78e3791fbea --- /dev/null +++ b/src/gallium/state_trackers/es/st_es2.c @@ -0,0 +1 @@ +const int st_api_OpenGL_ES2 = 1; -- cgit v1.2.3 From 1046f70a7d0592aaf10837ff9d2523de53910a31 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 6 Nov 2009 17:11:43 +0800 Subject: gallium: Allow state trackers to install files. State trackers like es or vega need to install their libraries. Signed-off-by: Chia-I Wu --- src/gallium/state_trackers/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/Makefile b/src/gallium/state_trackers/Makefile index 265ca468c2d..0900efc664f 100644 --- a/src/gallium/state_trackers/Makefile +++ b/src/gallium/state_trackers/Makefile @@ -21,5 +21,9 @@ clean: rm -f `find . -name depend` -# Dummy install target install: + @for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) $@) || exit 1 ; \ + fi \ + done -- 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/state_trackers') diff --git a/src/gallium/state_trackers/egl/egl_tracker.c b/src/gallium/state_trackers/egl/egl_tracker.c index 8d29bf490b1..1ad00977864 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 1397e9f7290..c9c92b69b65 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 00000000000..58c7af84e0a --- /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 6a1448d1b9b..2bd05a81750 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 00000000000..58c7af84e0a --- /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 From 182c38281383a3c0798c427b3d1f338dbf1e0533 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 5 Jan 2010 16:15:25 +0800 Subject: st/es: Fix build issue after merge. In c847a13d38d4e8c5f4c386d060dcc8ec09e491a3, auxiliaries becomes a single library; In e388d62b4712bcd75cecad53f5ca20a2bb6f89b1, the default build is changed to have -fvisibility=hidden. Signed-off-by: Chia-I Wu --- src/gallium/state_trackers/es/Makefile | 32 ++++++++++++++------------------ src/gallium/state_trackers/es/st_es1.c | 4 +++- src/gallium/state_trackers/es/st_es2.c | 4 +++- 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/es/Makefile b/src/gallium/state_trackers/es/Makefile index 41d4ccb1a60..b8ee0c83878 100644 --- a/src/gallium/state_trackers/es/Makefile +++ b/src/gallium/state_trackers/es/Makefile @@ -26,13 +26,6 @@ ES1_OBJECTS = st_es1.o ES2_OBJECTS = st_es2.o -# we only need the gallium libs that the state trackers directly use: -GALLIUM_LIBS = \ - $(TOP)/src/gallium/auxiliary/cso_cache/libcso_cache.a \ - $(TOP)/src/gallium/auxiliary/rtasm/librtasm.a \ - $(TOP)/src/gallium/auxiliary/tgsi/libtgsi.a \ - $(TOP)/src/gallium/auxiliary/util/libutil.a - ES1_LIBS = \ $(TOP)/src/mesa/es/libes1gallium.a \ $(TOP)/src/mesa/es/libes1api.a @@ -44,35 +37,36 @@ ES2_LIBS = \ SYS_LIBS = -lm -pthread +INCLUDE_DIRS = \ + -I$(TOP)/src/gallium/include + .c.o: - $(CC) -c $(CFLAGS) $< -o $@ + $(CC) -c $(INCLUDE_DIRS) $(DEFINES) $(CFLAGS) $< -o $@ # Default: make both GL ES 1.1 and GL ES 2.0 libraries default: $(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME) # Make the shared libs -$(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME): $(ES1_OBJECTS) $(ES1_LIBS) - $(TOP)/bin/mklib -o $(GLES_1_LIB) \ +$(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME): $(ES1_OBJECTS) $(ES1_LIBS) $(GALLIUM_AUXILIARIES) + $(MKLIB) -o $(GLES_1_LIB) \ -major $(GLES_1_VERSION_MAJOR) \ -minor $(GLES_1_VERSION_MINOR) \ -patch $(GLES_1_VERSION_PATCH) \ - -install $(TOP)/$(LIB_DIR) \ + -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ $(ES1_OBJECTS) \ -Wl,--whole-archive $(ES1_LIBS) -Wl,--no-whole-archive \ - -Wl,--start-group $(GALLIUM_LIBS) -Wl,--end-group \ - $(SYS_LIBS) + $(GALLIUM_AUXILIARIES) $(SYS_LIBS) -$(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME): $(ES2_OBJECTS) $(ES1_LIBS) - $(TOP)/bin/mklib -o $(GLES_2_LIB) \ +$(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME): $(ES2_OBJECTS) $(ES1_LIBS) $(GALLIUM_AUXILIARIES) + $(MKLIB) -o $(GLES_2_LIB) \ -major $(GLES_2_VERSION_MAJOR) \ -minor $(GLES_2_VERSION_MINOR) \ -patch $(GLES_2_VERSION_PATCH) \ - -install $(TOP)/$(LIB_DIR) \ + -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ $(ES2_OBJECTS) \ -Wl,--whole-archive $(ES2_LIBS) -Wl,--no-whole-archive \ - -Wl,--start-group $(GALLIUM_LIBS) -Wl,--end-group \ - $(SYS_LIBS) + $(GALLIUM_AUXILIARIES) $(SYS_LIBS) install: default $(INSTALL) -d $(INSTALL_DIR)/include/GLES @@ -86,3 +80,5 @@ install: default clean: -rm -f *.o *~ -rm -f $(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME)* $(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME)* + +depend: diff --git a/src/gallium/state_trackers/es/st_es1.c b/src/gallium/state_trackers/es/st_es1.c index 7f0c038957b..25bc53b21eb 100644 --- a/src/gallium/state_trackers/es/st_es1.c +++ b/src/gallium/state_trackers/es/st_es1.c @@ -1 +1,3 @@ -const int st_api_OpenGL_ES1 = 1; +#include "pipe/p_compiler.h" + +PUBLIC const int st_api_OpenGL_ES1 = 1; diff --git a/src/gallium/state_trackers/es/st_es2.c b/src/gallium/state_trackers/es/st_es2.c index 78e3791fbea..171ea62b97f 100644 --- a/src/gallium/state_trackers/es/st_es2.c +++ b/src/gallium/state_trackers/es/st_es2.c @@ -1 +1,3 @@ -const int st_api_OpenGL_ES2 = 1; +#include "pipe/p_compiler.h" + +PUBLIC const int st_api_OpenGL_ES2 = 1; -- cgit v1.2.3 From 3f3340ca16a07aff26a3bd27a7f5ae161d77b11d Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 11 Jan 2010 17:44:00 +0800 Subject: st/es: Clean up install target. Use DESTDIR and MINSTALL. Signed-off-by: Chia-I Wu --- src/gallium/state_trackers/es/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/es/Makefile b/src/gallium/state_trackers/es/Makefile index b8ee0c83878..095ffbb938c 100644 --- a/src/gallium/state_trackers/es/Makefile +++ b/src/gallium/state_trackers/es/Makefile @@ -69,13 +69,13 @@ $(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME): $(ES2_OBJECTS) $(ES1_LIBS) $(GALLIUM_AUXIL $(GALLIUM_AUXILIARIES) $(SYS_LIBS) install: default - $(INSTALL) -d $(INSTALL_DIR)/include/GLES - $(INSTALL) -m 644 $(TOP)/include/GLES/*.h $(INSTALL_DIR)/include/GLES - $(INSTALL) -d $(INSTALL_DIR)/include/GLES2 - $(INSTALL) -m 644 $(TOP)/include/GLES2/*.h $(INSTALL_DIR)/include/GLES2 - $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) - $(INSTALL) $(TOP)/$(LIB_DIR)/libGLESv1* $(INSTALL_DIR)/$(LIB_DIR) - $(INSTALL) $(TOP)/$(LIB_DIR)/libGLESv2* $(INSTALL_DIR)/$(LIB_DIR) + $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GLES + $(INSTALL) -m 644 $(TOP)/include/GLES/*.h $(DESTDIR)$(INSTALL_DIR)/include/GLES + $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GLES2 + $(INSTALL) -m 644 $(TOP)/include/GLES2/*.h $(DESTDIR)$(INSTALL_DIR)/include/GLES2 + $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) + $(MINSTALL) $(TOP)/$(LIB_DIR)/libGLESv1* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) + $(MINSTALL) $(TOP)/$(LIB_DIR)/libGLESv2* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) clean: -rm -f *.o *~ -- cgit v1.2.3