From 7dce4f3c27881b4c40ab55e4a8641a3a58f9a210 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 11 Jun 2010 13:00:16 +0200 Subject: i915g: Create seperate option for i915g and i965g --- configure.ac | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 21123ecccc..7f5db0975d 100644 --- a/configure.ac +++ b/configure.ac @@ -1430,20 +1430,35 @@ elif test "x$enable_gallium_svga" = xauto; then fi dnl -dnl Gallium Intel configuration +dnl Gallium i915 configuration dnl -AC_ARG_ENABLE([gallium-intel], - [AS_HELP_STRING([--enable-gallium-intel], - [build gallium intel @<:@default=disabled@:>@])], - [enable_gallium_intel="$enableval"], - [enable_gallium_intel=auto]) -if test "x$enable_gallium_intel" = xyes; then +AC_ARG_ENABLE([gallium-i915], + [AS_HELP_STRING([--enable-gallium-i915], + [build gallium i915 @<:@default=disabled@:>@])], + [enable_gallium_i915="$enableval"], + [enable_gallium_i915=auto]) +if test "x$enable_gallium_i915" = xyes; then GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw" - GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965" - gallium_check_st "i915/drm i965/drm" "dri-i915 dri-i965" "egl-i915 egl-i965" "xorg-i915 xorg-i965" -elif test "x$enable_gallium_intel" = xauto; then + GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915" + gallium_check_st "i915/drm" "dri-i915" "egl-i915" "xorg-i915" +elif test "x$enable_gallium_i915" = xauto; then GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw" - GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965" + GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915" +fi + +dnl +dnl Gallium i965 configuration +dnl +AC_ARG_ENABLE([gallium-i965], + [AS_HELP_STRING([--enable-gallium-i965], + [build gallium i965 @<:@default=disabled@:>@])], + [enable_gallium_i965="$enableval"], + [enable_gallium_i965=auto]) +if test "x$enable_gallium_i965" = xyes; then + GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965" + gallium_check_st "i965/drm" "dri-i965" "egl-i965" "xorg-i965" +elif test "x$enable_gallium_i965" = xauto; then + GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965" fi dnl -- cgit v1.2.3 From 23a915e2cfbc95c018946155eb301ffad3a0d550 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 23 Jun 2010 03:31:18 +0200 Subject: gallium: Drop sw drm winsys Last user went away --- configure.ac | 2 +- src/gallium/winsys/sw/drm/Makefile | 12 ---- src/gallium/winsys/sw/drm/SConscript | 21 ------- src/gallium/winsys/sw/drm/sw_drm_api.c | 103 --------------------------------- src/gallium/winsys/sw/drm/sw_drm_api.h | 34 ----------- 5 files changed, 1 insertion(+), 171 deletions(-) delete mode 100644 src/gallium/winsys/sw/drm/Makefile delete mode 100644 src/gallium/winsys/sw/drm/SConscript delete mode 100644 src/gallium/winsys/sw/drm/sw_drm_api.c delete mode 100644 src/gallium/winsys/sw/drm/sw_drm_api.h (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 6fc0e2a55c..4a676d4abd 100644 --- a/configure.ac +++ b/configure.ac @@ -486,7 +486,7 @@ xlib) dri) SRC_DIRS="$SRC_DIRS glx" DRIVER_DIRS="dri" - GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri sw/drm" + GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri" ;; osmesa) DRIVER_DIRS="osmesa" diff --git a/src/gallium/winsys/sw/drm/Makefile b/src/gallium/winsys/sw/drm/Makefile deleted file mode 100644 index 79664536aa..0000000000 --- a/src/gallium/winsys/sw/drm/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = swdrm - -C_SOURCES = sw_drm_api.c - -LIBRARY_INCLUDES = - -LIBRARY_DEFINES = - -include ../../../Makefile.template diff --git a/src/gallium/winsys/sw/drm/SConscript b/src/gallium/winsys/sw/drm/SConscript deleted file mode 100644 index 15a2e05d5a..0000000000 --- a/src/gallium/winsys/sw/drm/SConscript +++ /dev/null @@ -1,21 +0,0 @@ -####################################################################### -# SConscript for xlib winsys - - -Import('*') - -env = env.Clone() - -env.Append(CPPPATH = [ - '#/src/gallium/include', - '#/src/gallium/auxiliary', - '#/src/gallium/drivers', -]) - -ws_drm = env.ConvenienceLibrary( - target = 'ws_drm', - source = [ - 'sw_drm_api.c', - ] -) -Export('ws_drm') diff --git a/src/gallium/winsys/sw/drm/sw_drm_api.c b/src/gallium/winsys/sw/drm/sw_drm_api.c deleted file mode 100644 index 7b86382619..0000000000 --- a/src/gallium/winsys/sw/drm/sw_drm_api.c +++ /dev/null @@ -1,103 +0,0 @@ -/********************************************************** - * Copyright 2010 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 THE AUTHORS OR COPYRIGHT HOLDERS - * 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 "util/u_memory.h" -#include "softpipe/sp_public.h" -#include "state_tracker/drm_api.h" -#include "../../sw/wrapper/wrapper_sw_winsys.h" -#include "sw_drm_api.h" - - -/* - * Defines - */ - - -struct sw_drm_api -{ - struct drm_api base; - struct drm_api *api; - struct sw_winsys *sw; -}; - -static INLINE struct sw_drm_api * -sw_drm_api(struct drm_api *api) -{ - return (struct sw_drm_api *)api; -} - - -/* - * Exported functions - */ - - -static struct pipe_screen * -sw_drm_create_screen(struct drm_api *_api, int drmFD) -{ - struct sw_drm_api *swapi = sw_drm_api(_api); - struct drm_api *api = swapi->api; - struct sw_winsys *sww; - struct pipe_screen *screen; - - screen = api->create_screen(api, drmFD); - if (!screen) - return NULL; - - sww = wrapper_sw_winsys_warp_pipe_screen(screen); - if (!sww) - return NULL; - - return softpipe_create_screen(sww); -} - -static void -sw_drm_destroy(struct drm_api *api) -{ - struct sw_drm_api *swapi = sw_drm_api(api); - if (swapi->api->destroy) - swapi->api->destroy(swapi->api); - - FREE(swapi); -} - -struct drm_api * -sw_drm_api_create(struct drm_api *api) -{ - struct sw_drm_api *swapi = CALLOC_STRUCT(sw_drm_api); - - if (!swapi) - return api; - - swapi->base.name = api->name; - swapi->base.driver_name = api->driver_name; - swapi->base.create_screen = sw_drm_create_screen; - swapi->base.destroy = sw_drm_destroy; - - swapi->api = api; - - return &swapi->base; -} diff --git a/src/gallium/winsys/sw/drm/sw_drm_api.h b/src/gallium/winsys/sw/drm/sw_drm_api.h deleted file mode 100644 index ce90a04ae0..0000000000 --- a/src/gallium/winsys/sw/drm/sw_drm_api.h +++ /dev/null @@ -1,34 +0,0 @@ -/********************************************************** - * Copyright 2010 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 THE AUTHORS OR COPYRIGHT HOLDERS - * 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 SW_DRM_API_H -#define SW_DRM_API_H - -struct drm_api; - -struct drm_api * sw_drm_api_create(struct drm_api *api); - -#endif -- cgit v1.2.3 From 256097858881323d0b6ece248be163bb157f43aa Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 22 Jun 2010 22:00:43 -0700 Subject: configure: Add galahad to default build. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7f5db0975d..5cfdd45eca 100644 --- a/configure.ac +++ b/configure.ac @@ -474,7 +474,7 @@ GLU_DIRS="sgi" GALLIUM_DIRS="auxiliary drivers state_trackers" GALLIUM_TARGET_DIRS="" GALLIUM_WINSYS_DIRS="sw" -GALLIUM_DRIVERS_DIRS="softpipe failover trace rbug identity" +GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug identity" GALLIUM_STATE_TRACKERS_DIRS="" case "$mesa_driver" in -- cgit v1.2.3 From d8e0e114567ec19fd59f974080a418dc959cc9b6 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 29 Jun 2010 14:04:27 +0800 Subject: st/egl: Reorganize targets. Merge all targets into targets/egl/. The target produces egl_gallium_.so for each pipe driver and st_.so for each client APIs. This enables us to further merge egl_gallium_.so into egl_gallium.so later. --- configure.ac | 22 +-- src/gallium/state_trackers/egl/Makefile | 2 +- src/gallium/state_trackers/egl/common/egl_g3d_st.c | 12 +- src/gallium/targets/Makefile.egl | 86 --------- src/gallium/targets/egl-apis/Makefile | 83 -------- src/gallium/targets/egl-apis/SConscript | 33 ---- src/gallium/targets/egl-apis/api_GL.c | 25 --- src/gallium/targets/egl-apis/api_GLESv1_CM.c | 7 - src/gallium/targets/egl-apis/api_GLESv2.c | 7 - src/gallium/targets/egl-apis/api_OpenVG.c | 8 - src/gallium/targets/egl-i915/Makefile | 18 -- src/gallium/targets/egl-i915/target.c | 30 --- src/gallium/targets/egl-i965/Makefile | 19 -- src/gallium/targets/egl-i965/target.c | 34 ---- src/gallium/targets/egl-nouveau/Makefile | 19 -- src/gallium/targets/egl-nouveau/target.c | 24 --- src/gallium/targets/egl-radeon/Makefile | 18 -- src/gallium/targets/egl-radeon/target.c | 30 --- src/gallium/targets/egl-swrast/Makefile | 12 -- src/gallium/targets/egl-swrast/SConscript | 30 --- src/gallium/targets/egl-swrast/swrast_glue.c | 12 -- src/gallium/targets/egl-vmwgfx/Makefile | 17 -- src/gallium/targets/egl-vmwgfx/target.c | 30 --- src/gallium/targets/egl/Makefile | 208 +++++++++++++++++++++ src/gallium/targets/egl/SConscript | 46 +++++ src/gallium/targets/egl/pipe_i965.c | 34 ++++ src/gallium/targets/egl/pipe_nouveau.c | 24 +++ src/gallium/targets/egl/pipe_radeon.c | 30 +++ src/gallium/targets/egl/pipe_swrast.c | 8 + src/gallium/targets/egl/pipe_vmwgfx.c | 30 +++ src/gallium/targets/egl/st_GL.c | 25 +++ src/gallium/targets/egl/st_GLESv1_CM.c | 7 + src/gallium/targets/egl/st_GLESv2.c | 7 + src/gallium/targets/egl/st_OpenVG.c | 8 + 34 files changed, 442 insertions(+), 563 deletions(-) delete mode 100644 src/gallium/targets/Makefile.egl delete mode 100644 src/gallium/targets/egl-apis/Makefile delete mode 100644 src/gallium/targets/egl-apis/SConscript delete mode 100644 src/gallium/targets/egl-apis/api_GL.c delete mode 100644 src/gallium/targets/egl-apis/api_GLESv1_CM.c delete mode 100644 src/gallium/targets/egl-apis/api_GLESv2.c delete mode 100644 src/gallium/targets/egl-apis/api_OpenVG.c delete mode 100644 src/gallium/targets/egl-i915/Makefile delete mode 100644 src/gallium/targets/egl-i915/target.c delete mode 100644 src/gallium/targets/egl-i965/Makefile delete mode 100644 src/gallium/targets/egl-i965/target.c delete mode 100644 src/gallium/targets/egl-nouveau/Makefile delete mode 100644 src/gallium/targets/egl-nouveau/target.c delete mode 100644 src/gallium/targets/egl-radeon/Makefile delete mode 100644 src/gallium/targets/egl-radeon/target.c delete mode 100644 src/gallium/targets/egl-swrast/Makefile delete mode 100644 src/gallium/targets/egl-swrast/SConscript delete mode 100644 src/gallium/targets/egl-swrast/swrast_glue.c delete mode 100644 src/gallium/targets/egl-vmwgfx/Makefile delete mode 100644 src/gallium/targets/egl-vmwgfx/target.c create mode 100644 src/gallium/targets/egl/Makefile create mode 100644 src/gallium/targets/egl/SConscript create mode 100644 src/gallium/targets/egl/pipe_i965.c create mode 100644 src/gallium/targets/egl/pipe_nouveau.c create mode 100644 src/gallium/targets/egl/pipe_radeon.c create mode 100644 src/gallium/targets/egl/pipe_swrast.c create mode 100644 src/gallium/targets/egl/pipe_vmwgfx.c create mode 100644 src/gallium/targets/egl/st_GL.c create mode 100644 src/gallium/targets/egl/st_GLESv1_CM.c create mode 100644 src/gallium/targets/egl/st_GLESv2.c create mode 100644 src/gallium/targets/egl/st_OpenVG.c (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 0992117662..7583ab8595 100644 --- a/configure.ac +++ b/configure.ac @@ -1292,7 +1292,7 @@ AC_SUBST([VG_LIB_DEPS]) AC_SUBST([EGL_CLIENT_APIS]) if test "x$HAVE_ST_EGL" = xyes; then - GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-apis" + GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl" fi if test "x$HAVE_ST_XORG" = xyes; then @@ -1399,18 +1399,15 @@ dnl dnl Gallium helper functions dnl gallium_check_st() { - if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_EGL" = xyes || test "x$HAVE_ST_XORG" = xyes; then + if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes; then GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1" fi if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2" fi - if test "x$HAVE_ST_EGL" = xyes && test "x$3" != x; then + if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3" fi - if test "x$HAVE_ST_XORG" = xyes && test "x$4" != x; then - GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4" - fi } @@ -1424,7 +1421,7 @@ AC_ARG_ENABLE([gallium-svga], [enable_gallium_svga=auto]) if test "x$enable_gallium_svga" = xyes; then GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga" - gallium_check_st "svga/drm" "dri-vmwgfx" "egl-vmwgfx" "xorg-vmwgfx" + gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx" elif test "x$enable_gallium_svga" = xauto; then GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga" fi @@ -1440,7 +1437,7 @@ AC_ARG_ENABLE([gallium-i915], if test "x$enable_gallium_i915" = xyes; then GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw" GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915" - gallium_check_st "i915/drm" "dri-i915" "egl-i915" "xorg-i915" + gallium_check_st "i915/drm" "dri-i915" "xorg-i915" elif test "x$enable_gallium_i915" = xauto; then GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw" GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915" @@ -1456,7 +1453,7 @@ AC_ARG_ENABLE([gallium-i965], [enable_gallium_i965=auto]) if test "x$enable_gallium_i965" = xyes; then GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965" - gallium_check_st "i965/drm" "dri-i965" "egl-i965" "xorg-i965" + gallium_check_st "i965/drm" "dri-i965" "xorg-i965" elif test "x$enable_gallium_i965" = xauto; then GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965" fi @@ -1471,7 +1468,7 @@ AC_ARG_ENABLE([gallium-radeon], [enable_gallium_radeon=auto]) if test "x$enable_gallium_radeon" = xyes; then GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300" - gallium_check_st "radeon/drm" "dri-radeong" "egl-radeon" "xorg-radeon" + gallium_check_st "radeon/drm" "dri-radeong" "xorg-radeon" elif test "x$enable_gallium_radeon" = xauto; then GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300" fi @@ -1499,7 +1496,7 @@ AC_ARG_ENABLE([gallium-nouveau], [enable_gallium_nouveau=no]) if test "x$enable_gallium_nouveau" = xyes; then GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50" - gallium_check_st "nouveau/drm" "dri-nouveau" "egl-nouveau" "xorg-nouveau" + gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" fi dnl @@ -1514,9 +1511,6 @@ if test "x$enable_gallium_swrast" = xyes || test "x$enable_gallium_swrast" = xau if test "x$HAVE_ST_DRI" = xyes; then GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast" fi - if test "x$HAVE_ST_EGL" = xyes; then - GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-swrast" - fi fi dnl prepend CORE_DIRS to SRC_DIRS diff --git a/src/gallium/state_trackers/egl/Makefile b/src/gallium/state_trackers/egl/Makefile index 7bb53492b4..e117f15d93 100644 --- a/src/gallium/state_trackers/egl/Makefile +++ b/src/gallium/state_trackers/egl/Makefile @@ -40,7 +40,7 @@ ALL_INCLUDES = $(common_INCLUDES) $(x11_INCLUDES) $(kms_INCLUDES) $(fbdev_INCLUD ALL_SOURCES = $(common_SOURCES) $(x11_SOURCES) $(kms_SOURCES) $(fbdev_SOURCES) EGL_OBJECTS = $(common_OBJECTS) -EGL_CPPFLAGS = $(common_INCLUDES) +EGL_CPPFLAGS = $(common_INCLUDES) -DST_MODULE_PREFIX=\"st_\" # add backends ifneq ($(findstring x11, $(EGL_PLATFORMS)),) diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_st.c b/src/gallium/state_trackers/egl/common/egl_g3d_st.c index 683b74f62b..0668f5c91a 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d_st.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d_st.c @@ -133,24 +133,24 @@ egl_g3d_init_st_apis(struct st_api *stapis[ST_API_COUNT]) case ST_API_OPENGL: skip_checks[api] = "glColor4d"; symbols[api] = ST_CREATE_OPENGL_SYMBOL; - filenames[api][count++] = "api_GL" ST_MODULE_SUFFIX; + filenames[api][count++] = ST_MODULE_PREFIX "GL" ST_MODULE_SUFFIX; break; case ST_API_OPENGL_ES1: skip_checks[api] = "glColor4x"; symbols[api] = ST_CREATE_OPENGL_ES1_SYMBOL; - filenames[api][count++] = "api_GLESv1_CM" ST_MODULE_SUFFIX; - filenames[api][count++] = "api_GL" ST_MODULE_SUFFIX; + filenames[api][count++] = ST_MODULE_PREFIX "GLESv1_CM" ST_MODULE_SUFFIX; + filenames[api][count++] = ST_MODULE_PREFIX "GL" ST_MODULE_SUFFIX; break; case ST_API_OPENGL_ES2: skip_checks[api] = "glShaderBinary"; symbols[api] = ST_CREATE_OPENGL_ES2_SYMBOL; - filenames[api][count++] = "api_GLESv2" ST_MODULE_SUFFIX; - filenames[api][count++] = "api_GL" ST_MODULE_SUFFIX; + filenames[api][count++] = ST_MODULE_PREFIX "GLESv2" ST_MODULE_SUFFIX; + filenames[api][count++] = ST_MODULE_PREFIX "GL" ST_MODULE_SUFFIX; break; case ST_API_OPENVG: skip_checks[api] = "vgClear"; symbols[api] = ST_CREATE_OPENVG_SYMBOL; - filenames[api][count++]= "api_OpenVG" ST_MODULE_SUFFIX; + filenames[api][count++]= ST_MODULE_PREFIX "OpenVG" ST_MODULE_SUFFIX; break; default: assert(!"Unknown API Type\n"); diff --git a/src/gallium/targets/Makefile.egl b/src/gallium/targets/Makefile.egl deleted file mode 100644 index 7934f25720..0000000000 --- a/src/gallium/targets/Makefile.egl +++ /dev/null @@ -1,86 +0,0 @@ -# src/gallium/winsys/drm/Makefile.egl - -# The driver Makefile should define -# -# EGL_DRIVER_NAME, the name of the driver -# EGL_DRIVER_SOURCES, the sources of the driver -# EGL_DRIVER_LIBS, extra libraries needed by the driver -# EGL_DRIVER_PIPES, the pipe drivers of the driver -# -# before including this file. - -EGL_DRIVER_OBJECTS = $(EGL_DRIVER_SOURCES:.c=.o) - -common_LIBS = -ldrm -lm -ldl -common_ST = \ - $(TOP)/src/gallium/state_trackers/egl/libegl.a \ - $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ - $(TOP)/src/gallium/drivers/identity/libidentity.a \ - $(TOP)/src/gallium/drivers/trace/libtrace.a \ - $(TOP)/src/gallium/drivers/rbug/librbug.a - -ifeq ($(MESA_LLVM),1) -common_ST += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a -common_LIBS += $(LLVM_LIBS) -LDFLAGS += $(LLVM_LDFLAGS) -endif - -ifeq ($(findstring x11, $(EGL_PLATFORMS)),x11) -common_LIBS += -lX11 -lXext -lXfixes -common_ST += $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a -endif - -ifeq ($(findstring kms, $(EGL_PLATFORMS)),kms) -endif - -ifeq ($(findstring fbdev, $(EGL_PLATFORMS)),fbdev) -common_ST += $(TOP)/src/gallium/winsys/sw/fbdev/libfbdev.a -endif - -### Include directories -INCLUDES = \ - -I$(TOP)/include \ - -I$(TOP)/src/gallium/include \ - -I$(TOP)/src/gallium/auxiliary \ - -I$(TOP)/src/gallium/drivers \ - -I$(TOP)/src/gallium/winsys \ - -I$(TOP)/src/egl/main \ - $(LIBDRM_CFLAGS) - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(EGL_DRIVER_DEFINES) $< -o $@ - - -##### TARGETS ##### - -EGL_LIB_DIR = $(TOP)/$(LIB_DIR)/egl - -# do not build the driver if the platform is KMS only and the driver is swrast -ifneq ($(EGL_PLATFORMS)-$(EGL_DRIVER_NAME),kms-swrast) -EGL_DRIVER = egl_gallium_$(EGL_DRIVER_NAME).so -endif - -default: $(EGL_LIB_DIR)/$(EGL_DRIVER) - -$(EGL_LIB_DIR)/$(EGL_DRIVER): $(EGL_DRIVER) - @$(INSTALL) -d $(EGL_LIB_DIR) - $(INSTALL) $< $(EGL_LIB_DIR) - -$(EGL_DRIVER): $(EGL_DRIVER_OBJECTS) $(common_ST) $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) Makefile - $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - $(MKLIB_OPTIONS) $(EGL_DRIVER_OBJECTS) \ - -Wl,--start-group $(common_ST) $(EGL_DRIVER_PIPES) \ - $(GALLIUM_AUXILIARIES) -Wl,--end-group \ - $(common_LIBS) $(EGL_DRIVER_LIBS) -L$(TOP)/$(LIB_DIR) -l$(EGL_LIB) - -clean: - -rm -f $(EGL_DRIVER_OBJECTS) - -rm -f $(EGL_DRIVER) - -install: $(EGL_LIB_DIR)/$(EGL_DRIVER) - $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR) - $(MINSTALL) -m 755 $< $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR) - -depend: diff --git a/src/gallium/targets/egl-apis/Makefile b/src/gallium/targets/egl-apis/Makefile deleted file mode 100644 index 1275cc79b2..0000000000 --- a/src/gallium/targets/egl-apis/Makefile +++ /dev/null @@ -1,83 +0,0 @@ -# src/gallium/targets/egl-apis - -TOP = ../../../.. -include $(TOP)/configs/current - -OUTPUT_PREFIX := api_ -OUTPUT_PATH := $(TOP)/$(LIB_DIR)/egl - -OUTPUTS := $(addsuffix .so, $(EGL_CLIENT_APIS)) -OUTPUTS := $(addprefix $(OUTPUT_PATH)/$(OUTPUT_PREFIX), $(OUTPUTS)) - -# include dirs -GL_INCLUDES := -I$(TOP)/src/mesa -I$(TOP)/src/gallium/include -GLESv1_CM_INCLUDES := $(GL_INCLUDES) -GLESv2_INCLUDES := $(GL_INCLUDES) -OpenVG_INCLUDES := -I$(TOP)/src/gallium/state_trackers/vega -I$(TOP)/src/gallium/include - -# cflags -GL_CFLAGS := $(API_DEFINES) -GLESv1_CM_CFLAGS := -GLESv2_CFLAGS := -OpenVG_CFLAGS := - -# system libs -GL_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -GLESv1_CM_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GLESv1_CM_LIB) -GLESv2_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GLESv2_LIB) -OpenVG_SYS := -lm -L$(TOP)/$(LIB_DIR) -l$(VG_LIB) - -# $(LLVM_LIBS) will be discarded except for OpenGL, which creates a private -# draw context for selection/feedback mode. -ifeq ($(MESA_LLVM),1) -GL_SYS += $(LLVM_LIBS) -GLESv1_CM_SYS += $(LLVM_LIBS) -GLESv2_SYS += $(LLVM_LIBS) -OpenVG_SYS += $(LLVM_LIBS) -LDFLAGS += $(LLVM_LDFLAGS) -endif - -# project libs -GL_LIBS := $(TOP)/src/mesa/libmesagallium.a -GLESv1_CM_LIBS := $(TOP)/src/mesa/libes1gallium.a -GLESv2_LIBS := $(TOP)/src/mesa/libes2gallium.a -OpenVG_LIBS := $(TOP)/src/gallium/state_trackers/vega/libvega.a - -# objects -GL_OBJECTS := api_GL.o -GLESv1_CM_OBJECTS := api_GLESv1_CM.o -GLESv2_OBJECTS := api_GLESv2.o -OpenVG_OBJECTS := api_OpenVG.o - -default: $(OUTPUTS) - -api_%.o: api_%.c - $(CC) -c -o $@ $< $($*_INCLUDES) $($*_CFLAGS) $(DEFINES) $(CFLAGS) - -define mklib -$(MKLIB) -o $(notdir $@) -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) \ - $($(1)_OBJECTS) $($(1)_LIBS) $(GALLIUM_AUXILIARIES) $($(1)_SYS) -endef - -$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(GL_LIB).so: $(GL_OBJECTS) $(GL_LIBS) - $(call mklib,GL) - -$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(GLESv1_CM_LIB).so: $(GLESv1_CM_OBJECTS) $(GLESv1_CM_LIBS) - $(call mklib,GLESv1_CM) - -$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(GLESv2_LIB).so: $(GLESv2_OBJECTS) $(GLESv2_LIBS) - $(call mklib,GLESv2) - -$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(VG_LIB).so: $(OpenVG_OBJECTS) $(OpenVG_LIBS) - $(call mklib,OpenVG) - -install: $(OUTPUTS) - $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR) - for out in $(OUTPUTS); do \ - $(MINSTALL) -m 755 "$$out" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \ - done - -clean: - -rm -f $(OUTPUTS) - -rm -f *.o diff --git a/src/gallium/targets/egl-apis/SConscript b/src/gallium/targets/egl-apis/SConscript deleted file mode 100644 index 0ca3d1fb9e..0000000000 --- a/src/gallium/targets/egl-apis/SConscript +++ /dev/null @@ -1,33 +0,0 @@ -####################################################################### -# SConscript for egl-apis target - -Import('*') - -if env['platform'] == 'windows': - - env = env.Clone() - - env.Append(CPPPATH = [ - '#/src/gallium/state_trackers/vega', - ]) - - env.Append(LIBS = [ - 'gdi32', - 'user32', - 'kernel32', - 'ws2_32', - ]) - - env['no_import_lib'] = 1 - - api_libs = { - 'OpenVG': vgapi + st_vega, - } - - for name in api_libs.keys(): - api = env.SharedLibrary( - target = 'api_' + name, - source = ['api_' + name + '.c'], - LIBS = api_libs[name] + gallium + env['LIBS'], - ) - env.InstallSharedLibrary(api) diff --git a/src/gallium/targets/egl-apis/api_GL.c b/src/gallium/targets/egl-apis/api_GL.c deleted file mode 100644 index 676300b0cc..0000000000 --- a/src/gallium/targets/egl-apis/api_GL.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "state_tracker/st_gl_api.h" - -#if FEATURE_GL -PUBLIC struct st_api * -st_api_create_OpenGL(void) -{ - return st_gl_api_create(); -} -#endif - -#if FEATURE_ES1 -PUBLIC struct st_api * -st_api_create_OpenGL_ES1(void) -{ - return st_gl_api_create_es1(); -} -#endif - -#if FEATURE_ES2 -PUBLIC struct st_api * -st_api_create_OpenGL_ES2(void) -{ - return st_gl_api_create_es2(); -} -#endif diff --git a/src/gallium/targets/egl-apis/api_GLESv1_CM.c b/src/gallium/targets/egl-apis/api_GLESv1_CM.c deleted file mode 100644 index 0c8de8992f..0000000000 --- a/src/gallium/targets/egl-apis/api_GLESv1_CM.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "state_tracker/st_gl_api.h" - -PUBLIC struct st_api * -st_api_create_OpenGL_ES1(void) -{ - return st_gl_api_create_es1(); -} diff --git a/src/gallium/targets/egl-apis/api_GLESv2.c b/src/gallium/targets/egl-apis/api_GLESv2.c deleted file mode 100644 index 87b3e65e23..0000000000 --- a/src/gallium/targets/egl-apis/api_GLESv2.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "state_tracker/st_gl_api.h" - -PUBLIC struct st_api * -st_api_create_OpenGL_ES2(void) -{ - return st_gl_api_create_es2(); -} diff --git a/src/gallium/targets/egl-apis/api_OpenVG.c b/src/gallium/targets/egl-apis/api_OpenVG.c deleted file mode 100644 index e29a237479..0000000000 --- a/src/gallium/targets/egl-apis/api_OpenVG.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "state_tracker/st_api.h" -#include "vg_api.h" - -PUBLIC struct st_api * -st_api_create_OpenVG(void) -{ - return (struct st_api *) vg_api_get(); -} diff --git a/src/gallium/targets/egl-i915/Makefile b/src/gallium/targets/egl-i915/Makefile deleted file mode 100644 index 43c67a49c3..0000000000 --- a/src/gallium/targets/egl-i915/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -TOP = ../../../.. -include $(TOP)/configs/current - -EGL_DRIVER_NAME = i915 -EGL_DRIVER_SOURCES = target.c -EGL_DRIVER_LIBS = -ldrm_intel - -EGL_DRIVER_DEFINES = \ - -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_GALAHAD - -EGL_DRIVER_PIPES = \ - $(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \ - $(TOP)/src/gallium/drivers/galahad/libgalahad.a \ - $(TOP)/src/gallium/drivers/trace/libtrace.a \ - $(TOP)/src/gallium/drivers/rbug/librbug.a \ - $(TOP)/src/gallium/drivers/i915/libi915.a - -include ../Makefile.egl diff --git a/src/gallium/targets/egl-i915/target.c b/src/gallium/targets/egl-i915/target.c deleted file mode 100644 index 070e2c0964..0000000000 --- a/src/gallium/targets/egl-i915/target.c +++ /dev/null @@ -1,30 +0,0 @@ - -#include "state_tracker/drm_driver.h" -#include "target-helpers/inline_debug_helper.h" -#include "i915/drm/i915_drm_public.h" -#include "i915/i915_public.h" - -static struct pipe_screen * -create_screen(int fd) -{ - struct i915_winsys *iws; - struct pipe_screen *screen; - - iws = i915_drm_winsys_create(fd); - if (!iws) - return NULL; - - screen = i915_screen_create(iws); - if (!screen) - return NULL; - - screen = debug_screen_wrap(screen); - - return screen; -} - -DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen) - -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl-i965/Makefile b/src/gallium/targets/egl-i965/Makefile deleted file mode 100644 index 44e435452e..0000000000 --- a/src/gallium/targets/egl-i965/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -TOP = ../../../.. -include $(TOP)/configs/current - -EGL_DRIVER_NAME = i965 -EGL_DRIVER_SOURCES = target.c -EGL_DRIVER_LIBS = -ldrm_intel - -EGL_DRIVER_DEFINES = \ - -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE - -EGL_DRIVER_PIPES = \ - $(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \ - $(TOP)/src/gallium/drivers/trace/libtrace.a \ - $(TOP)/src/gallium/drivers/rbug/librbug.a \ - $(TOP)/src/gallium/drivers/i965/libi965.a \ - $(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a \ - $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a - -include ../Makefile.egl diff --git a/src/gallium/targets/egl-i965/target.c b/src/gallium/targets/egl-i965/target.c deleted file mode 100644 index 1195b510a0..0000000000 --- a/src/gallium/targets/egl-i965/target.c +++ /dev/null @@ -1,34 +0,0 @@ - -#include "target-helpers/inline_wrapper_sw_helper.h" -#include "target-helpers/inline_debug_helper.h" -#include "state_tracker/drm_driver.h" -#include "i965/drm/i965_drm_public.h" -#include "i965/brw_public.h" - -static struct pipe_screen * -create_screen(int fd) -{ - struct brw_winsys_screen *bws; - struct pipe_screen *screen; - - bws = i965_drm_winsys_screen_create(fd); - if (!bws) - return NULL; - - screen = brw_screen_create(bws); - if (!screen) - return NULL; - - if (debug_get_bool_option("BRW_SOFTPIPE", FALSE)) - screen = sw_screen_wrap(screen); - - screen = debug_screen_wrap(screen); - - return screen; -} - -DRM_DRIVER_DESCRIPTOR("i915", "i965", create_screen) - -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl-nouveau/Makefile b/src/gallium/targets/egl-nouveau/Makefile deleted file mode 100644 index 0e16f11324..0000000000 --- a/src/gallium/targets/egl-nouveau/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -TOP = ../../../.. -include $(TOP)/configs/current - -EGL_DRIVER_NAME = nouveau -EGL_DRIVER_SOURCES = target.c -EGL_DRIVER_LIBS = -ldrm_nouveau - -EGL_DRIVER_DEFINES = \ - -DGALLIUM_RBUG -DGALLIUM_TRACE - -EGL_DRIVER_PIPES = \ - $(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \ - $(TOP)/src/gallium/drivers/trace/libtrace.a \ - $(TOP)/src/gallium/drivers/rbug/librbug.a \ - $(TOP)/src/gallium/drivers/nvfx/libnvfx.a \ - $(TOP)/src/gallium/drivers/nv50/libnv50.a \ - $(TOP)/src/gallium/drivers/nouveau/libnouveau.a - -include ../Makefile.egl diff --git a/src/gallium/targets/egl-nouveau/target.c b/src/gallium/targets/egl-nouveau/target.c deleted file mode 100644 index cf569ea62c..0000000000 --- a/src/gallium/targets/egl-nouveau/target.c +++ /dev/null @@ -1,24 +0,0 @@ - -#include "target-helpers/inline_debug_helper.h" -#include "state_tracker/drm_driver.h" -#include "nouveau/drm/nouveau_drm_public.h" - -static struct pipe_screen * -create_screen(int fd) -{ - struct pipe_screen *screen; - - screen = nouveau_drm_screen_create(fd); - if (!screen) - return NULL; - - screen = debug_screen_wrap(screen); - - return screen; -} - -DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen) - -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl-radeon/Makefile b/src/gallium/targets/egl-radeon/Makefile deleted file mode 100644 index cc7bb22952..0000000000 --- a/src/gallium/targets/egl-radeon/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -TOP = ../../../.. -include $(TOP)/configs/current - -EGL_DRIVER_NAME = radeon -EGL_DRIVER_SOURCES = target.c -EGL_DRIVER_LIBS = -ldrm_radeon - -EGL_DRIVER_DEFINES = \ - -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_GALAHAD - -EGL_DRIVER_PIPES = \ - $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \ - $(TOP)/src/gallium/drivers/galahad/libgalahad.a \ - $(TOP)/src/gallium/drivers/trace/libtrace.a \ - $(TOP)/src/gallium/drivers/rbug/librbug.a \ - $(TOP)/src/gallium/drivers/r300/libr300.a - -include ../Makefile.egl diff --git a/src/gallium/targets/egl-radeon/target.c b/src/gallium/targets/egl-radeon/target.c deleted file mode 100644 index ce07327b8f..0000000000 --- a/src/gallium/targets/egl-radeon/target.c +++ /dev/null @@ -1,30 +0,0 @@ - -#include "target-helpers/inline_debug_helper.h" -#include "state_tracker/drm_driver.h" -#include "radeon/drm/radeon_drm_public.h" -#include "r300/r300_public.h" - -static struct pipe_screen * -create_screen(int fd) -{ - struct r300_winsys_screen *sws; - struct pipe_screen *screen; - - sws = r300_drm_winsys_screen_create(fd); - if (!sws) - return NULL; - - screen = r300_screen_create(sws); - if (!screen) - return NULL; - - screen = debug_screen_wrap(screen); - - return screen; -} - -DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen) - -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl-swrast/Makefile b/src/gallium/targets/egl-swrast/Makefile deleted file mode 100644 index 7d4f505498..0000000000 --- a/src/gallium/targets/egl-swrast/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -TOP = ../../../.. -include $(TOP)/configs/current - -# Do propperly -CFLAGS+="-I$(TOP)/src/gallium/include" - -EGL_DRIVER_NAME = swrast -EGL_DRIVER_SOURCES = swrast_glue.c -EGL_DRIVER_LIBS = -EGL_DRIVER_PIPES = - -include ../Makefile.egl diff --git a/src/gallium/targets/egl-swrast/SConscript b/src/gallium/targets/egl-swrast/SConscript deleted file mode 100644 index 213e5b3e6c..0000000000 --- a/src/gallium/targets/egl-swrast/SConscript +++ /dev/null @@ -1,30 +0,0 @@ -####################################################################### -# SConscript for egl-swrast target - -Import('*') - -if env['platform'] == 'windows': - - env = env.Clone() - - env.Append(LIBS = [ - 'gdi32', - 'user32', - 'kernel32', - 'ws2_32', - ]) - - drivers = [softpipe] - if env['llvm']: - drivers += [llvmpipe] - drivers += [identity, trace, rbug] - - env['no_import_lib'] = 1 - - egl_gdi_swrast = env.SharedLibrary( - target ='egl_gdi_swrast', - source = 'swrast_glue.c', - LIBS = st_egl_gdi + ws_gdi + drivers + gallium + egl + env['LIBS'], - ) - - env.InstallSharedLibrary(egl_gdi_swrast) diff --git a/src/gallium/targets/egl-swrast/swrast_glue.c b/src/gallium/targets/egl-swrast/swrast_glue.c deleted file mode 100644 index 24f77826d4..0000000000 --- a/src/gallium/targets/egl-swrast/swrast_glue.c +++ /dev/null @@ -1,12 +0,0 @@ - -#include "state_tracker/drm_driver.h" - -struct drm_driver_descriptor drm_driver = { - .name = "swrast", - .driver_name = NULL, - .create_screen = NULL, -}; - -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl-vmwgfx/Makefile b/src/gallium/targets/egl-vmwgfx/Makefile deleted file mode 100644 index 92ec4cbdd6..0000000000 --- a/src/gallium/targets/egl-vmwgfx/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -TOP = ../../../.. -include $(TOP)/configs/current - -EGL_DRIVER_NAME = vmwgfx -EGL_DRIVER_SOURCES = target.c -EGL_DRIVER_LIBS = - -EGL_DRIVER_DEFINES = \ - -DGALLIUM_RBUG -DGALLIUM_TRACE - -EGL_DRIVER_PIPES = \ - $(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \ - $(TOP)/src/gallium/drivers/trace/libtrace.a \ - $(TOP)/src/gallium/drivers/rbug/librbug.a \ - $(TOP)/src/gallium/drivers/svga/libsvga.a - -include ../Makefile.egl diff --git a/src/gallium/targets/egl-vmwgfx/target.c b/src/gallium/targets/egl-vmwgfx/target.c deleted file mode 100644 index 4e9f51c5dc..0000000000 --- a/src/gallium/targets/egl-vmwgfx/target.c +++ /dev/null @@ -1,30 +0,0 @@ - -#include "target-helpers/inline_debug_helper.h" -#include "state_tracker/drm_driver.h" -#include "svga/drm/svga_drm_public.h" -#include "svga/svga_public.h" - -static struct pipe_screen * -create_screen(int fd) -{ - struct svga_winsys_screen *sws; - struct pipe_screen *screen; - - sws = svga_drm_winsys_screen_create(fd); - if (!sws) - return NULL; - - screen = svga_screen_create(sws); - if (!screen) - return NULL; - - screen = debug_screen_wrap(screen); - - return screen; -} - -DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen) - -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl/Makefile b/src/gallium/targets/egl/Makefile new file mode 100644 index 0000000000..364a31dc45 --- /dev/null +++ b/src/gallium/targets/egl/Makefile @@ -0,0 +1,208 @@ +# src/gallium/targets/egl/Makefile +# +# This is the Makefile for EGL Gallium driver package. The package consists of +# +# egl_gallium_.so - EGL drivers +# st_.so - client API state trackers +# +# The following variables are examined +# +# EGL_PLATFORMS - platforms to support +# GALLIUM_WINSYS_DIRS - pipe drivers to support +# EGL_CLIENT_APIS - state trackers to support +# + +TOP = ../../../.. +include $(TOP)/configs/current + +common_CPPFLAGS := \ + -I$(TOP)/src/gallium/auxiliary \ + -I$(TOP)/src/gallium/drivers \ + -I$(TOP)/src/gallium/include \ + -I$(TOP)/src/gallium/winsys +common_SYS := +common_LIBS := \ + $(TOP)/src/gallium/drivers/identity/libidentity.a \ + $(TOP)/src/gallium/drivers/trace/libtrace.a \ + $(TOP)/src/gallium/drivers/rbug/librbug.a \ + $(GALLIUM_AUXILIARIES) + +# EGL driver +egl_CPPFLAGS := \ + -I$(TOP)/src/gallium/state_trackers/egl \ + -I$(TOP)/src/egl/main +egl_SYS := -lm -ldl -lEGL +egl_LIBS := \ + $(TOP)/src/gallium/state_trackers/egl/libegl.a \ + $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a + +ifneq ($(findstring x11, $(EGL_PLATFORMS)),) +egl_SYS += -lX11 -lXext -lXfixes +egl_LIBS += $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a +endif +ifneq ($(findstring kms, $(EGL_PLATFORMS)),) +egl_SYS += -ldrm +endif +ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),) +egl_LIBS += $(TOP)/src/gallium/winsys/sw/fbdev/libfbdev.a +endif + +# LLVM +ifeq ($(MESA_LLVM),1) +common_SYS += $(LLVM_LIBS) +egl_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a +LDFLAGS += $(LLVM_LDFLAGS) +endif + +# i915 pipe driver +i915_CPPFLAGS := +i915_SYS := -ldrm_intel +i915_LIBS := \ + $(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \ + $(TOP)/src/gallium/drivers/i915/libi915.a + +# i965 pipe driver +i965_CPPFLAGS := +i965_SYS := -ldrm_intel +i965_LIBS := \ + $(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \ + $(TOP)/src/gallium/drivers/i965/libi965.a + +# nouveau pipe driver +nouveau_CPPFLAGS := +nouveau_SYS := -ldrm_nouveau +nouveau_LIBS := \ + $(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \ + $(TOP)/src/gallium/drivers/nvfx/libnvfx.a \ + $(TOP)/src/gallium/drivers/nv50/libnv50.a \ + $(TOP)/src/gallium/drivers/nouveau/libnouveau.a + +# radeon pipe driver +radeon_CPPFLAGS := +radeon_SYS := -ldrm -ldrm_radeon +radeon_LIBS := \ + $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \ + $(TOP)/src/gallium/drivers/r300/libr300.a + +# vmwgfx pipe driver +vmwgfx_CPPFLAGS := +vmwgfx_SYS := +vmwgfx_LIBS := \ + $(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \ + $(TOP)/src/gallium/drivers/svga/libsvga.a + +# swrast (pseudo) pipe driver +swrast_CPPFLAGS := +swrast_SYS := +swrast_LIBS := + +# OpenGL state tracker +GL_CPPFLAGS := -I$(TOP)/src/mesa $(API_DEFINES) +GL_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +GL_LIBS := $(TOP)/src/mesa/libmesagallium.a + +# OpenGL ES 1.x state tracker +GLESv1_CM_CPPFLAGS := -I$(TOP)/src/mesa +GLESv1_CM_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GLESv1_CM_LIB) +GLESv1_CM_LIBS := $(TOP)/src/mesa/libes1gallium.a + +# OpenGL ES 2.x state tracker +GLESv2_CPPFLAGS := -I$(TOP)/src/mesa +GLESv2_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GLESv2_LIB) +GLESv2_LIBS := $(TOP)/src/mesa/libes2gallium.a + +# OpenVG state tracker +OpenVG_CPPFLAGS := -I$(TOP)/src/gallium/state_trackers/vega +OpenVG_SYS := -lm -L$(TOP)/$(LIB_DIR) -l$(VG_LIB) +OpenVG_LIBS := $(TOP)/src/gallium/state_trackers/vega/libvega.a + + +OUTPUT_PATH := $(TOP)/$(LIB_DIR)/egl + +# determine the outputs +ifneq ($(findstring i915,$(GALLIUM_WINSYS_DIRS)),) +OUTPUTS += i915 +endif +ifneq ($(findstring i965,$(GALLIUM_WINSYS_DIRS)),) +OUTPUTS += i965 +endif +ifneq ($(findstring nouveau,$(GALLIUM_WINSYS_DIRS)),) +OUTPUTS += nouveau +endif +ifneq ($(findstring r300,$(GALLIUM_WINSYS_DIRS)),) +OUTPUTS += radeon +endif +ifneq ($(findstring svga,$(GALLIUM_WINSYS_DIRS)),) +OUTPUTS += vmwgfx +endif +OUTPUTS += swrast +OUTPUTS := $(addprefix egl_gallium_, $(OUTPUTS)) + +# state trackers +OUTPUTS += $(addprefix st_, $(EGL_CLIENT_APIS)) + +OUTPUTS := $(addsuffix .so, $(OUTPUTS)) +OUTPUTS := $(addprefix $(OUTPUT_PATH)/, $(OUTPUTS)) + +default: $(OUTPUTS) + +define mklib-egl +$(MKLIB) -o $(notdir $@) -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) $< \ + -Wl,--start-group $(common_LIBS) $(egl_LIBS) $($(1)_LIBS) -Wl,--end-group \ + $(common_SYS) $(egl_SYS) $($(1)_SYS) +endef + +define mklib +$(MKLIB) -o $(notdir $@) -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) $< \ + -Wl,--start-group $(common_LIBS) $($(1)_LIBS) -Wl,--end-group \ + $(common_SYS) $($(1)_SYS) +endef + +# EGL drivers +$(OUTPUT_PATH)/egl_gallium_i915.so: pipe_i915.o $(egl_LIBS) $(i915_LIBS) + $(call mklib-egl,i915) + +$(OUTPUT_PATH)/egl_gallium_i965.so: pipe_i965.o $(egl_LIBS) $(i965_LIBS) + $(call mklib-egl,i965) + +$(OUTPUT_PATH)/egl_gallium_nouveau.so: pipe_nouveau.o $(egl_LIBS) $(nouveau_LIBS) + $(call mklib-egl,nouveau) + +$(OUTPUT_PATH)/egl_gallium_radeon.so: pipe_radeon.o $(egl_LIBS) $(radeon_LIBS) + $(call mklib-egl,radeon) + +$(OUTPUT_PATH)/egl_gallium_vmwgfx.so: pipe_vmwgfx.o $(egl_LIBS) $(vmwgfx_LIBS) + $(call mklib-egl,vmwgfx) + +$(OUTPUT_PATH)/egl_gallium_swrast.so: pipe_swrast.o $(egl_LIBS) $(swrast_LIBS) + $(call mklib-egl,swrast) + +# state trackers +$(OUTPUT_PATH)/st_$(GL_LIB).so: st_GL.o $(GL_LIBS) + $(call mklib,GL) + +$(OUTPUT_PATH)/st_$(GLESv1_CM_LIB).so: st_GLESv1_CM.o $(GLESv1_CM_LIBS) + $(call mklib,GLESv1_CM) + +$(OUTPUT_PATH)/st_$(GLESv2_LIB).so: st_GLESv2.o $(GLESv2_LIBS) + $(call mklib,GLESv2) + +$(OUTPUT_PATH)/st_$(VG_LIB).so: st_OpenVG.o $(OpenVG_LIBS) + $(call mklib,OpenVG) + +pipe_%.o: pipe_%.c + $(CC) -c -o $@ $< $(common_CPPFLAGS) $($*_CPPFLAGS) $(DEFINES) $(CFLAGS) + +st_%.o: st_%.c + $(CC) -c -o $@ $< $(common_CPPFLAGS) $($*_CPPFLAGS) $(DEFINES) $(CFLAGS) + +install: $(OUTPUTS) + $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR) + for out in $(OUTPUTS); do \ + $(MINSTALL) -m 755 "$$out" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \ + done + +clean: + rm -f *.o diff --git a/src/gallium/targets/egl/SConscript b/src/gallium/targets/egl/SConscript new file mode 100644 index 0000000000..c743c26cf6 --- /dev/null +++ b/src/gallium/targets/egl/SConscript @@ -0,0 +1,46 @@ +####################################################################### +# SConscript for egl-apis target + +Import('*') + +if env['platform'] == 'windows': + + env = env.Clone() + + env.Append(CPPPATH = [ + '#/src/gallium/state_trackers/vega', + ]) + + env.Append(LIBS = [ + 'gdi32', + 'user32', + 'kernel32', + 'ws2_32', + ]) + + env['no_import_lib'] = 1 + + drivers = [softpipe] + if env['llvm']: + drivers += [llvmpipe] + drivers += [identity, trace, rbug] + + egl_gallium_swrast = env.SharedLibrary( + target ='egl_gallium_swrast', + source = 'pipe_swrast.c', + LIBS = st_egl_gdi + ws_gdi + drivers + gallium + egl + env['LIBS'], + ) + + env.InstallSharedLibrary(egl_gallium_swrast) + + api_libs = { + 'OpenVG': vgapi + st_vega, + } + + for name in api_libs.keys(): + api = env.SharedLibrary( + target = 'st_' + name, + source = ['st_' + name + '.c'], + LIBS = api_libs[name] + gallium + env['LIBS'], + ) + env.InstallSharedLibrary(api) diff --git a/src/gallium/targets/egl/pipe_i965.c b/src/gallium/targets/egl/pipe_i965.c new file mode 100644 index 0000000000..d19c83a47d --- /dev/null +++ b/src/gallium/targets/egl/pipe_i965.c @@ -0,0 +1,34 @@ + +#include "target-helpers/inline_wrapper_sw_helper.h" +#include "target-helpers/inline_debug_helper.h" +#include "state_tracker/drm_driver.h" +#include "i965/drm/i965_drm_public.h" +#include "i965/brw_public.h" + +static struct pipe_screen * +create_screen(int fd) +{ + struct brw_winsys_screen *bws; + struct pipe_screen *screen; + + bws = i965_drm_winsys_screen_create(fd); + if (!bws) + return NULL; + + screen = brw_screen_create(bws); + if (!screen) + return NULL; + + if (debug_get_bool_option("BRW_SOFTPIPE", FALSE)) + screen = sw_screen_wrap(screen); + + screen = debug_screen_wrap(screen); + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("i965", "i965", create_screen) + +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl/pipe_nouveau.c b/src/gallium/targets/egl/pipe_nouveau.c new file mode 100644 index 0000000000..cf569ea62c --- /dev/null +++ b/src/gallium/targets/egl/pipe_nouveau.c @@ -0,0 +1,24 @@ + +#include "target-helpers/inline_debug_helper.h" +#include "state_tracker/drm_driver.h" +#include "nouveau/drm/nouveau_drm_public.h" + +static struct pipe_screen * +create_screen(int fd) +{ + struct pipe_screen *screen; + + screen = nouveau_drm_screen_create(fd); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen) + +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl/pipe_radeon.c b/src/gallium/targets/egl/pipe_radeon.c new file mode 100644 index 0000000000..ce07327b8f --- /dev/null +++ b/src/gallium/targets/egl/pipe_radeon.c @@ -0,0 +1,30 @@ + +#include "target-helpers/inline_debug_helper.h" +#include "state_tracker/drm_driver.h" +#include "radeon/drm/radeon_drm_public.h" +#include "r300/r300_public.h" + +static struct pipe_screen * +create_screen(int fd) +{ + struct r300_winsys_screen *sws; + struct pipe_screen *screen; + + sws = r300_drm_winsys_screen_create(fd); + if (!sws) + return NULL; + + screen = r300_screen_create(sws); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen) + +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl/pipe_swrast.c b/src/gallium/targets/egl/pipe_swrast.c new file mode 100644 index 0000000000..d8205c158e --- /dev/null +++ b/src/gallium/targets/egl/pipe_swrast.c @@ -0,0 +1,8 @@ + +#include "state_tracker/drm_driver.h" + +DRM_DRIVER_DESCRIPTOR("swrast", NULL, NULL) + +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl/pipe_vmwgfx.c b/src/gallium/targets/egl/pipe_vmwgfx.c new file mode 100644 index 0000000000..4e9f51c5dc --- /dev/null +++ b/src/gallium/targets/egl/pipe_vmwgfx.c @@ -0,0 +1,30 @@ + +#include "target-helpers/inline_debug_helper.h" +#include "state_tracker/drm_driver.h" +#include "svga/drm/svga_drm_public.h" +#include "svga/svga_public.h" + +static struct pipe_screen * +create_screen(int fd) +{ + struct svga_winsys_screen *sws; + struct pipe_screen *screen; + + sws = svga_drm_winsys_screen_create(fd); + if (!sws) + return NULL; + + screen = svga_screen_create(sws); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen) + +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl/st_GL.c b/src/gallium/targets/egl/st_GL.c new file mode 100644 index 0000000000..676300b0cc --- /dev/null +++ b/src/gallium/targets/egl/st_GL.c @@ -0,0 +1,25 @@ +#include "state_tracker/st_gl_api.h" + +#if FEATURE_GL +PUBLIC struct st_api * +st_api_create_OpenGL(void) +{ + return st_gl_api_create(); +} +#endif + +#if FEATURE_ES1 +PUBLIC struct st_api * +st_api_create_OpenGL_ES1(void) +{ + return st_gl_api_create_es1(); +} +#endif + +#if FEATURE_ES2 +PUBLIC struct st_api * +st_api_create_OpenGL_ES2(void) +{ + return st_gl_api_create_es2(); +} +#endif diff --git a/src/gallium/targets/egl/st_GLESv1_CM.c b/src/gallium/targets/egl/st_GLESv1_CM.c new file mode 100644 index 0000000000..0c8de8992f --- /dev/null +++ b/src/gallium/targets/egl/st_GLESv1_CM.c @@ -0,0 +1,7 @@ +#include "state_tracker/st_gl_api.h" + +PUBLIC struct st_api * +st_api_create_OpenGL_ES1(void) +{ + return st_gl_api_create_es1(); +} diff --git a/src/gallium/targets/egl/st_GLESv2.c b/src/gallium/targets/egl/st_GLESv2.c new file mode 100644 index 0000000000..87b3e65e23 --- /dev/null +++ b/src/gallium/targets/egl/st_GLESv2.c @@ -0,0 +1,7 @@ +#include "state_tracker/st_gl_api.h" + +PUBLIC struct st_api * +st_api_create_OpenGL_ES2(void) +{ + return st_gl_api_create_es2(); +} diff --git a/src/gallium/targets/egl/st_OpenVG.c b/src/gallium/targets/egl/st_OpenVG.c new file mode 100644 index 0000000000..e29a237479 --- /dev/null +++ b/src/gallium/targets/egl/st_OpenVG.c @@ -0,0 +1,8 @@ +#include "state_tracker/st_api.h" +#include "vg_api.h" + +PUBLIC struct st_api * +st_api_create_OpenVG(void) +{ + return (struct st_api *) vg_api_get(); +} -- cgit v1.2.3 From 9617254a1e5522615c96ab25c9e0a70e0d63d7e7 Mon Sep 17 00:00:00 2001 From: John Hein <5qgu8gvshg@snkmail.com> Date: Thu, 1 Jul 2010 12:53:28 -0700 Subject: Use GLUT_CFLAGS when building glut Fix this build error (in MesaGLUT-7.6.1)... glut_cmap.c:23:66: error: X11/Xmu/StdCmap.h: No such file or directory ...by not preventing the cflags that pkg-config finds for glut dependencies (including 'xmu') from being used. Defining GLUT_CFLAGS before running the pkg-config prevents the cflags found by pkg-config from being used. This patch lets GLUT_CFLAGS that configure & pkg-config work so hard to set actually get used. Also make sure the generated configs/autoconf defines GLUT_CFLAGS used in (at least) src/glut/glx/Makefile. Signed-off-by: Dan Nicholson --- configs/autoconf.in | 1 + configure.ac | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/configs/autoconf.in b/configs/autoconf.in index 417138b2a1..4a86dc1bb5 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -31,6 +31,7 @@ X11_CFLAGS = @X11_CFLAGS@ LLVM_CFLAGS = @LLVM_CFLAGS@ LLVM_LDFLAGS = @LLVM_LDFLAGS@ LLVM_LIBS = @LLVM_LIBS@ +GLUT_CFLAGS = @GLUT_CFLAGS@ # Source selection diff --git a/configure.ac b/configure.ac index 7583ab8595..16fd1e43bb 100644 --- a/configure.ac +++ b/configure.ac @@ -1118,10 +1118,6 @@ fi if test "x$enable_glut" = xyes; then SRC_DIRS="$SRC_DIRS glut/glx" - GLUT_CFLAGS="" - if test "x$GCC" = xyes; then - GLUT_CFLAGS="-fexceptions" - fi if test "$x11_pkgconfig" = yes; then PKG_CHECK_MODULES([GLUT],[x11 xmu xi]) GLUT_PC_REQ_PRIV="x11 xmu xi" @@ -1132,6 +1128,9 @@ if test "x$enable_glut" = xyes; then GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS" GLUT_PC_CFLAGS="$X11_INCLUDES" fi + if test "x$GCC" = xyes; then + GLUT_CFLAGS="$GLUT_CFLAGS -fexceptions" + fi GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm" GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm" -- cgit v1.2.3 From cf588ab3f1edb89be4cd57045a3888ff482fa817 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 6 Jul 2010 14:34:43 +0800 Subject: st/egl: Add support for !GLX_DIRECT_RENDERING. st/egl uses GLX code for DRI2 support. It should honor GLX_DIRECT_RENDERING. Also updates configure.ac to define GLX_DIRECT_RENDERING for st/egl. --- configure.ac | 6 +- src/gallium/state_trackers/egl/x11/glxinit.c | 4 ++ src/gallium/state_trackers/egl/x11/native_dri2.c | 14 +++++ src/gallium/state_trackers/egl/x11/x11_screen.c | 76 ++++++++++++++---------- src/gallium/state_trackers/egl/x11/x11_screen.h | 26 ++++---- 5 files changed, 84 insertions(+), 42 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 16fd1e43bb..f66b93c791 100644 --- a/configure.ac +++ b/configure.ac @@ -680,7 +680,7 @@ AC_SUBST([DRI_DRIVER_SEARCH_DIR]) dnl Direct rendering or just indirect rendering AC_ARG_ENABLE([driglx-direct], [AS_HELP_STRING([--disable-driglx-direct], - [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])], + [enable direct rendering in GLX and EGL for DRI @<:@default=enabled@:>@])], [driglx_direct="$enableval"], [driglx_direct="yes"]) dnl Which drivers to build - default is chosen by platform @@ -1292,6 +1292,10 @@ AC_SUBST([EGL_CLIENT_APIS]) if test "x$HAVE_ST_EGL" = xyes; then GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl" + # define GLX_DIRECT_RENDERING even when the driver is not dri + if test "x$mesa_driver" != xdri -a "x$driglx_direct" = xyes; then + DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" + fi fi if test "x$HAVE_ST_XORG" = xyes; then diff --git a/src/gallium/state_trackers/egl/x11/glxinit.c b/src/gallium/state_trackers/egl/x11/glxinit.c index 1ed2afd345..dd351899e2 100644 --- a/src/gallium/state_trackers/egl/x11/glxinit.c +++ b/src/gallium/state_trackers/egl/x11/glxinit.c @@ -16,6 +16,8 @@ #include "glxinit.h" +#ifdef GLX_DIRECT_RENDERING + typedef struct GLXGenericGetString { CARD8 reqType; @@ -680,3 +682,5 @@ __glXInitialize(Display * dpy) return dpyPriv; } + +#endif /* GLX_DIRECT_RENDERING */ diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c index 1bef59d864..1be1e42468 100644 --- a/src/gallium/state_trackers/egl/x11/native_dri2.c +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c @@ -38,6 +38,8 @@ #include "native_x11.h" #include "x11_screen.h" +#ifdef GLX_DIRECT_RENDERING + enum dri2_surface_type { DRI2_SURFACE_TYPE_WINDOW, DRI2_SURFACE_TYPE_PIXMAP, @@ -784,3 +786,15 @@ x11_create_dri2_display(Display *dpy, return &dri2dpy->base; } + +#else /* GLX_DIRECT_RENDERING */ + +struct native_display * +x11_create_dri2_display(Display *dpy, + struct native_event_handler *event_handler, + void *user_data) +{ + return NULL; +} + +#endif /* GLX_DIRECT_RENDERING */ diff --git a/src/gallium/state_trackers/egl/x11/x11_screen.c b/src/gallium/state_trackers/egl/x11/x11_screen.c index 6bdff26ec0..6a22b30c4d 100644 --- a/src/gallium/state_trackers/egl/x11/x11_screen.c +++ b/src/gallium/state_trackers/egl/x11/x11_screen.c @@ -39,8 +39,10 @@ #include "glxinit.h" struct x11_screen { +#ifdef GLX_DIRECT_RENDERING /* dummy base class */ struct __GLXDRIdisplayRec base; +#endif Display *dpy; int number; @@ -103,15 +105,19 @@ x11_screen_destroy(struct x11_screen *xscr) if (xscr->dri_device) Xfree(xscr->dri_device); +#ifdef GLX_DIRECT_RENDERING /* xscr->glx_dpy will be destroyed with the X display */ if (xscr->glx_dpy) xscr->glx_dpy->dri2Display = NULL; +#endif if (xscr->visuals) XFree(xscr->visuals); FREE(xscr); } +#ifdef GLX_DIRECT_RENDERING + static boolean x11_screen_init_dri2(struct x11_screen *xscr) { @@ -133,6 +139,8 @@ x11_screen_init_glx(struct x11_screen *xscr) return (xscr->glx_dpy != NULL); } +#endif /* GLX_DIRECT_RENDERING */ + /** * Return true if the screen supports the extension. */ @@ -145,12 +153,14 @@ x11_screen_support(struct x11_screen *xscr, enum x11_screen_extension ext) case X11_SCREEN_EXTENSION_XSHM: supported = XShmQueryExtension(xscr->dpy); break; +#ifdef GLX_DIRECT_RENDERING case X11_SCREEN_EXTENSION_GLX: supported = x11_screen_init_glx(xscr); break; case X11_SCREEN_EXTENSION_DRI2: supported = x11_screen_init_dri2(xscr); break; +#endif default: break; } @@ -176,6 +186,39 @@ x11_screen_get_visuals(struct x11_screen *xscr, int *num_visuals) return xscr->visuals; } +/** + * Return the depth of a drawable. + * + * Unlike other drawable functions, the drawable needs not be a DRI2 drawable. + */ +uint +x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable) +{ + unsigned int depth; + + if (drawable != xscr->last_drawable) { + Window root; + int x, y; + unsigned int w, h, border; + Status ok; + + ok = XGetGeometry(xscr->dpy, drawable, &root, + &x, &y, &w, &h, &border, &depth); + if (!ok) + depth = 0; + + xscr->last_drawable = drawable; + xscr->last_depth = depth; + } + else { + depth = xscr->last_depth; + } + + return depth; +} + +#ifdef GLX_DIRECT_RENDERING + /** * Return the GLX fbconfigs. */ @@ -334,37 +377,6 @@ x11_drawable_get_buffers(struct x11_screen *xscr, Drawable drawable, return (struct x11_drawable_buffer *) dri2bufs; } -/** - * Return the depth of a drawable. - * - * Unlike other drawable functions, the drawable needs not be a DRI2 drawable. - */ -uint -x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable) -{ - unsigned int depth; - - if (drawable != xscr->last_drawable) { - Window root; - int x, y; - unsigned int w, h, border; - Status ok; - - ok = XGetGeometry(xscr->dpy, drawable, &root, - &x, &y, &w, &h, &border, &depth); - if (!ok) - depth = 0; - - xscr->last_drawable = drawable; - xscr->last_depth = depth; - } - else { - depth = xscr->last_depth; - } - - return depth; -} - /** * Create a mode list of the given size. */ @@ -432,3 +444,5 @@ dri2InvalidateBuffers(Display *dpy, XID drawable) xscr->dri_invalidate_buffers(xscr, drawable, xscr->dri_user_data); } + +#endif /* GLX_DIRECT_RENDERING */ diff --git a/src/gallium/state_trackers/egl/x11/x11_screen.h b/src/gallium/state_trackers/egl/x11/x11_screen.h index a3c5ee1491..bc0ef69ec6 100644 --- a/src/gallium/state_trackers/egl/x11/x11_screen.h +++ b/src/gallium/state_trackers/egl/x11/x11_screen.h @@ -67,20 +67,18 @@ x11_screen_support(struct x11_screen *xscr, enum x11_screen_extension ext); const XVisualInfo * x11_screen_get_visuals(struct x11_screen *xscr, int *num_visuals); +uint +x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable); + +#ifdef GLX_DIRECT_RENDERING + +/* GLX */ const __GLcontextModes * x11_screen_get_glx_configs(struct x11_screen *xscr); const __GLcontextModes * x11_screen_get_glx_visuals(struct x11_screen *xscr); -const char * -x11_screen_probe_dri2(struct x11_screen *xscr, int *major, int *minor); - -int -x11_screen_enable_dri2(struct x11_screen *xscr, - x11_drawable_invalidate_buffers invalidate_buffers, - void *user_data); - __GLcontextModes * x11_context_modes_create(unsigned count); @@ -90,6 +88,15 @@ x11_context_modes_destroy(__GLcontextModes *modes); unsigned x11_context_modes_count(const __GLcontextModes *modes); +/* DRI2 */ +const char * +x11_screen_probe_dri2(struct x11_screen *xscr, int *major, int *minor); + +int +x11_screen_enable_dri2(struct x11_screen *xscr, + x11_drawable_invalidate_buffers invalidate_buffers, + void *user_data); + void x11_drawable_enable_dri2(struct x11_screen *xscr, Drawable drawable, boolean on); @@ -104,7 +111,6 @@ x11_drawable_get_buffers(struct x11_screen *xscr, Drawable drawable, int *width, int *height, unsigned int *attachments, boolean with_format, int num_ins, int *num_outs); -uint -x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable); +#endif /* GLX_DIRECT_RENDERING */ #endif /* _X11_SCREEN_H_ */ -- cgit v1.2.3 From 2168b87b51e70e8ad914e547c6c922fc33af3a89 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 2 Jun 2010 22:48:06 -0400 Subject: egl_dri2: Support _EGL_PLATFORM_DRM This lets the egl_dri2 driver initialize on just a DRM fd. --- configs/autoconf.in | 6 +- configure.ac | 15 ++- src/egl/drivers/dri2/Makefile | 6 +- src/egl/drivers/dri2/egl_dri2.c | 257 ++++++++++++++++++++++++++++++++++------ 4 files changed, 240 insertions(+), 44 deletions(-) (limited to 'configure.ac') diff --git a/configs/autoconf.in b/configs/autoconf.in index 78fa0af6cc..5afd5627fe 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -178,8 +178,10 @@ EGL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@ EGL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@ EGL_PC_CFLAGS = @GL_PC_CFLAGS@ -EGL_DRI2_CFLAGS = @EGL_DRI2_CFLAGS@ -EGL_DRI2_LIBS = @EGL_DRI2_LIBS@ +XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@ +XCB_DRI2_LIBS = @XCB_DRI2_LIBS@ +LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ +LIBUDEV_LIBS = @LIBUDEV_LIBS@ MESA_LLVM = @MESA_LLVM@ diff --git a/configure.ac b/configure.ac index f66b93c791..7fcc9fbd92 100644 --- a/configure.ac +++ b/configure.ac @@ -962,11 +962,22 @@ if test "x$enable_egl" = xyes; then fi # build egl_dri2 when xcb-dri2 is available - PKG_CHECK_MODULES([EGL_DRI2], [x11-xcb xcb-dri2 xcb-xfixes libdrm], + PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes], [have_xcb_dri2=yes],[have_xcb_dri2=no]) + PKG_CHECK_MODULES([LIBUDEV], [libudev > 150], + [have_libudev=yes],[have_libudev=no]) + if test "$have_xcb_dri2" = yes; then - EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS dri2" + EGL_DRIVER_DRI2=dri2 + DEFINES="$DEFINES -DHAVE_XCB_DRI2" + fi + + if test "$have_libudev" = yes; then + EGL_DRIVER_DRI2=dri2 + DEFINES="$DEFINES -DHAVE_LIBUDEV" fi + + EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS $EGL_DRIVER_DRI2" fi fi AC_SUBST([EGL_LIB_DEPS]) diff --git a/src/egl/drivers/dri2/Makefile b/src/egl/drivers/dri2/Makefile index 4e760aec4c..8a3c9b6a0a 100644 --- a/src/egl/drivers/dri2/Makefile +++ b/src/egl/drivers/dri2/Makefile @@ -11,8 +11,10 @@ EGL_INCLUDES = \ -I$(TOP)/src/egl/main \ -I$(TOP)/src/mapi \ -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \ - $(EGL_DRI2_CFLAGS) + $(XCB_DRI2_CFLAGS) \ + $(LIBUDEV_CFLAGS) \ + $(LIBDRM_CFLAGS) -EGL_LIBS = $(EGL_DRI2_LIBS) +EGL_LIBS = $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(LIBDRM_LIBS) include ../Makefile.template diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index df79a605df..c6d79a64e8 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -40,6 +40,12 @@ #include #include #include +#include +#include + +#ifdef HAVE_LIBUDEV +#include +#endif #include #include "eglconfig.h" @@ -79,7 +85,6 @@ struct dri2_egl_display char *driver_name; __DRIdri2LoaderExtension loader_extension; - __DRIimageLookupExtension image_lookup_extension; const __DRIextension *extensions[3]; }; @@ -117,6 +122,10 @@ struct dri2_egl_image _EGL_DRIVER_STANDARD_TYPECASTS(dri2_egl) _EGL_DRIVER_TYPECAST(dri2_egl_image, _EGLImage, obj) +static const __DRIuseInvalidateExtension use_invalidate = { + { __DRI_USE_INVALIDATE, 1 } +}; + EGLint dri2_to_egl_attribute_map[] = { 0, EGL_BUFFER_SIZE, /* __DRI_ATTRIB_BUFFER_SIZE */ @@ -381,6 +390,11 @@ dri2_lookup_egl_image(__DRIcontext *context, void *image, void *data) return dri2_img->dri_image; } +static const __DRIimageLookupExtension image_lookup_extension = { + { __DRI_IMAGE_LOOKUP, 1 }, + dri2_lookup_egl_image +}; + static __DRIbuffer * dri2_get_buffers_with_format(__DRIdrawable * driDrawable, int *width, int *height, @@ -690,20 +704,53 @@ dri2_load_driver(_EGLDisplay *disp) return EGL_TRUE; } - -/** - * Called via eglInitialize(), GLX_drv->API.Initialize(). - */ static EGLBoolean -dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, - EGLint *major, EGLint *minor) +dri2_create_screen(_EGLDisplay *disp) { const __DRIextension **extensions; struct dri2_egl_display *dri2_dpy; unsigned int api_mask; - if (disp->Platform != _EGL_PLATFORM_X11) + dri2_dpy = disp->DriverData; + dri2_dpy->dri_screen = + dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions, + &dri2_dpy->driver_configs, dri2_dpy); + + if (dri2_dpy->dri_screen == NULL) { + _eglLog(_EGL_WARNING, "DRI2: failed to create dri screen"); return EGL_FALSE; + } + + extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen); + if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions)) + goto cleanup_dri_screen; + + if (dri2_dpy->dri2->base.version >= 2) + api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen); + else + api_mask = __DRI_API_OPENGL; + + disp->ClientAPIsMask = 0; + if (api_mask & (1 <<__DRI_API_OPENGL)) + disp->ClientAPIsMask |= EGL_OPENGL_BIT; + if (api_mask & (1 <<__DRI_API_GLES)) + disp->ClientAPIsMask |= EGL_OPENGL_ES_BIT; + if (api_mask & (1 << __DRI_API_GLES2)) + disp->ClientAPIsMask |= EGL_OPENGL_ES2_BIT; + + return EGL_TRUE; + + cleanup_dri_screen: + dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen); + + return EGL_FALSE; +} + +static EGLBoolean +dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp, + EGLint *major, EGLint *minor) +{ + struct dri2_egl_display *dri2_dpy; dri2_dpy = malloc(sizeof *dri2_dpy); if (!dri2_dpy) @@ -757,39 +804,12 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, dri2_dpy->loader_extension.getBuffersWithFormat = NULL; } - dri2_dpy->image_lookup_extension.base.name = __DRI_IMAGE_LOOKUP; - dri2_dpy->image_lookup_extension.base.version = 1; - dri2_dpy->image_lookup_extension.lookupEGLImage = dri2_lookup_egl_image; - dri2_dpy->extensions[0] = &dri2_dpy->loader_extension.base; - dri2_dpy->extensions[1] = &dri2_dpy->image_lookup_extension.base; + dri2_dpy->extensions[1] = &image_lookup_extension.base; dri2_dpy->extensions[2] = NULL; - dri2_dpy->dri_screen = - dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions, - &dri2_dpy->driver_configs, dri2_dpy); - - if (dri2_dpy->dri_screen == NULL) { - _eglLog(_EGL_WARNING, "DRI2: failed to create dri screen"); + if (!dri2_create_screen(disp)) goto cleanup_fd; - } - - extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen); - if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions)) - goto cleanup_dri_screen; - - if (dri2_dpy->dri2->base.version >= 2) - api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen); - else - api_mask = __DRI_API_OPENGL; - - disp->ClientAPIsMask = 0; - if (api_mask & (1 <<__DRI_API_OPENGL)) - disp->ClientAPIsMask |= EGL_OPENGL_BIT; - if (api_mask & (1 <<__DRI_API_GLES)) - disp->ClientAPIsMask |= EGL_OPENGL_ES_BIT; - if (api_mask & (1 << __DRI_API_GLES2)) - disp->ClientAPIsMask |= EGL_OPENGL_ES2_BIT; if (dri2_dpy->conn) { if (!dri2_add_configs_for_visuals(dri2_dpy, disp)) @@ -811,7 +831,6 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, cleanup_configs: _eglCleanupDisplay(disp); - cleanup_dri_screen: dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen); cleanup_fd: close(dri2_dpy->fd); @@ -826,6 +845,168 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, return EGL_FALSE; } +#ifdef HAVE_LIBUDEV + +struct dri2_driver_map { + int vendor_id; + const char *driver; + const int *chip_ids; + int num_chips_ids; +}; + +const int i915_chip_ids[] = { + 0x3577, /* PCI_CHIP_I830_M */ + 0x2562, /* PCI_CHIP_845_G */ + 0x3582, /* PCI_CHIP_I855_GM */ + 0x2572, /* PCI_CHIP_I865_G */ + 0x2582, /* PCI_CHIP_I915_G */ + 0x258a, /* PCI_CHIP_E7221_G */ + 0x2592, /* PCI_CHIP_I915_GM */ + 0x2772, /* PCI_CHIP_I945_G */ + 0x27a2, /* PCI_CHIP_I945_GM */ + 0x27ae, /* PCI_CHIP_I945_GME */ + 0x29b2, /* PCI_CHIP_Q35_G */ + 0x29c2, /* PCI_CHIP_G33_G */ + 0x29d2, /* PCI_CHIP_Q33_G */ +}; + +const int i965_chip_ids[] = { + 0x29a2, /* PCI_CHIP_I965_G */ + 0x2992, /* PCI_CHIP_I965_Q */ + 0x2982, /* PCI_CHIP_I965_G_1 */ + 0x2972, /* PCI_CHIP_I946_GZ */ + 0x2a02, /* PCI_CHIP_I965_GM */ + 0x2a12, /* PCI_CHIP_I965_GME */ + 0x2a42, /* PCI_CHIP_GM45_GM */ + 0x2e02, /* PCI_CHIP_IGD_E_G */ + 0x2e12, /* PCI_CHIP_Q45_G */ + 0x2e22, /* PCI_CHIP_G45_G */ + 0x2e32, /* PCI_CHIP_G41_G */ +}; + +const struct dri2_driver_map driver_map[] = { + { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, + { 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) }, +}; + +static char * +dri2_get_driver_for_fd(int fd) +{ + struct udev *udev; + struct udev_device *device, *parent; + struct stat buf; + const char *pci_id; + char *driver = NULL; + int vendor_id, chip_id, i, j; + + udev = udev_new(); + if (fstat(fd, &buf) < 0) { + _eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd); + goto out; + } + + device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev); + if (device == NULL) { + _eglLog(_EGL_WARNING, + "EGL-DRI2: could not create udev device for fd %d", fd); + goto out; + } + + parent = udev_device_get_parent(device); + if (parent == NULL) { + _eglLog(_EGL_WARNING, "DRI2: could not get parent device"); + goto out; + } + + pci_id = udev_device_get_property_value(parent, "PCI_ID"); + if (pci_id == NULL || sscanf(pci_id, "%x:%x", &vendor_id, &chip_id) != 2) { + _eglLog(_EGL_WARNING, "EGL-DRI2: malformed or no PCI ID"); + goto out; + } + + for (i = 0; i < ARRAY_SIZE(driver_map); i++) { + if (vendor_id != driver_map[i].vendor_id) + continue; + for (j = 0; j < driver_map[i].num_chips_ids; j++) + if (driver_map[i].chip_ids[j] == chip_id) { + driver = strdup(driver_map[i].driver); + _eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s", + fd, vendor_id, chip_id, driver); + goto out; + } + } + + out: + udev_device_unref(device); + udev_unref(udev); + + return driver; +} + +static EGLBoolean +dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp, + EGLint *major, EGLint *minor) +{ + struct dri2_egl_display *dri2_dpy; + + dri2_dpy = malloc(sizeof *dri2_dpy); + if (!dri2_dpy) + return _eglError(EGL_BAD_ALLOC, "eglInitialize"); + + disp->DriverData = (void *) dri2_dpy; + dri2_dpy->fd = (int) disp->PlatformDisplay; + + dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd); + if (dri2_dpy->driver_name == NULL) + return _eglError(EGL_BAD_ALLOC, "DRI2: failed to get driver name"); + + if (!dri2_load_driver(disp)) + goto cleanup_driver_name; + + dri2_dpy->extensions[0] = &image_lookup_extension.base; + dri2_dpy->extensions[1] = &use_invalidate.base; + dri2_dpy->extensions[2] = NULL; + + if (!dri2_create_screen(disp)) + goto cleanup_driver; + + disp->Extensions.KHR_image_base = EGL_TRUE; + disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE; + disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE; + + return EGL_TRUE; + + cleanup_driver: + dlclose(dri2_dpy->driver); + cleanup_driver_name: + free(dri2_dpy->driver_name); + + return EGL_FALSE; +} + +#endif + +/** + * Called via eglInitialize(), GLX_drv->API.Initialize(). + */ +static EGLBoolean +dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, + EGLint *major, EGLint *minor) +{ + switch (disp->Platform) { + case _EGL_PLATFORM_X11: + return dri2_initialize_x11(drv, disp, major, minor); + +#ifdef HAVE_LIBUDEV + case _EGL_PLATFORM_DRM: + return dri2_initialize_drm(drv, disp, major, minor); +#endif + + default: + return EGL_FALSE; + } +} + /** * Called via eglTerminate(), drv->API.Terminate(). */ -- cgit v1.2.3 From 4f956889b7c30282104b3409120f7561d89ab6d1 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 13 Jul 2010 07:40:47 -0700 Subject: st/xorg: When selecting st via configure make sure to test for xorg-server --- configure.ac | 1 + 1 file changed, 1 insertion(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7fcc9fbd92..f52c6db65a 100644 --- a/configure.ac +++ b/configure.ac @@ -1261,6 +1261,7 @@ yes) HAVE_ST_EGL="yes" ;; xorg) + PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0]) PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED]) PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED]) HAVE_ST_XORG="yes" -- cgit v1.2.3 From bb217ba76a9c3823e074ec7708f07233a85eb4ac Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 16 Jul 2010 19:39:58 +0800 Subject: egl: Build egl_dri2 only when xcb-dri2 is available. The driver does not build when xcb-dri2 is not available. --- configure.ac | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index f52c6db65a..1b116ae50e 100644 --- a/configure.ac +++ b/configure.ac @@ -970,12 +970,11 @@ if test "x$enable_egl" = xyes; then if test "$have_xcb_dri2" = yes; then EGL_DRIVER_DRI2=dri2 DEFINES="$DEFINES -DHAVE_XCB_DRI2" + if test "$have_libudev" = yes; then + DEFINES="$DEFINES -DHAVE_LIBUDEV" + fi fi - if test "$have_libudev" = yes; then - EGL_DRIVER_DRI2=dri2 - DEFINES="$DEFINES -DHAVE_LIBUDEV" - fi EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS $EGL_DRIVER_DRI2" fi -- cgit v1.2.3 From 39ae965783d43ecc4426d0340381c091518bdedb Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 16 Jul 2010 19:48:52 +0800 Subject: egl: Build egl_dri2 only when DRI drivers are built. That is, build egl_dri2 only when --with-driver=dri is given (the default). --- configure.ac | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 1b116ae50e..1214100a8f 100644 --- a/configure.ac +++ b/configure.ac @@ -961,20 +961,21 @@ if test "x$enable_egl" = xyes; then EGL_DRIVERS_DIRS="glx" fi - # build egl_dri2 when xcb-dri2 is available - PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes], - [have_xcb_dri2=yes],[have_xcb_dri2=no]) - PKG_CHECK_MODULES([LIBUDEV], [libudev > 150], - [have_libudev=yes],[have_libudev=no]) - - if test "$have_xcb_dri2" = yes; then - EGL_DRIVER_DRI2=dri2 - DEFINES="$DEFINES -DHAVE_XCB_DRI2" - if test "$have_libudev" = yes; then - DEFINES="$DEFINES -DHAVE_LIBUDEV" - fi - fi - + if test "$mesa_driver" = dri; then + # build egl_dri2 when xcb-dri2 is available + PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes], + [have_xcb_dri2=yes],[have_xcb_dri2=no]) + PKG_CHECK_MODULES([LIBUDEV], [libudev > 150], + [have_libudev=yes],[have_libudev=no]) + + if test "$have_xcb_dri2" = yes; then + EGL_DRIVER_DRI2=dri2 + DEFINES="$DEFINES -DHAVE_XCB_DRI2" + if test "$have_libudev" = yes; then + DEFINES="$DEFINES -DHAVE_LIBUDEV" + fi + fi + fi EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS $EGL_DRIVER_DRI2" fi -- cgit v1.2.3 From 08f4bc07e424aaeb35eb58736fdca64b1398c190 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 16 Jul 2010 20:09:29 +0800 Subject: st/egl: Fix build on FreeBSD. There is no libdl on FreeBSD. Based on patch from Thinker , which is against 7.8. This fixes fdo bug #29093. --- configs/autoconf.in | 2 ++ configs/default | 2 ++ configure.ac | 1 + src/gallium/targets/egl/Makefile | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configs/autoconf.in b/configs/autoconf.in index 5afd5627fe..7c6f123cac 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -34,6 +34,8 @@ LLVM_LIBS = @LLVM_LIBS@ GLW_CFLAGS = @GLW_CFLAGS@ GLUT_CFLAGS = @GLUT_CFLAGS@ +# dlopen +DLOPEN_LIBS = @DLOPEN_LIBS@ # Source selection MESA_ASM_SOURCES = @MESA_ASM_SOURCES@ diff --git a/configs/default b/configs/default index 3d9744409a..8711a382cc 100644 --- a/configs/default +++ b/configs/default @@ -131,6 +131,8 @@ VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread APP_LIB_DEPS = -lm X11_LIBS = -lX11 +DLOPEN_LIBS = -ldl + # Installation directories (for make install) INSTALL_DIR = /usr/local INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR) diff --git a/configure.ac b/configure.ac index 1214100a8f..96195976a0 100644 --- a/configure.ac +++ b/configure.ac @@ -410,6 +410,7 @@ dnl Check to see if dlopen is in default libraries (like Solaris, which dnl has it in libc), or if libdl is needed to get it. AC_CHECK_FUNC([dlopen], [], [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])]) +AC_SUBST([DLOPEN_LIBS]) dnl See if posix_memalign is available AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"]) diff --git a/src/gallium/targets/egl/Makefile b/src/gallium/targets/egl/Makefile index f1259a557a..1e4bb4d94c 100644 --- a/src/gallium/targets/egl/Makefile +++ b/src/gallium/targets/egl/Makefile @@ -37,7 +37,7 @@ egl_CPPFLAGS := \ -I$(TOP)/src/gallium/state_trackers/egl \ -I$(TOP)/src/egl/main \ -DPIPE_PREFIX=\"$(PIPE_PREFIX)\" -DST_PREFIX=\"$(ST_PREFIX)\" -egl_SYS := -lm -ldl -L$(TOP)/$(LIB_DIR) -lEGL +egl_SYS := -lm $(DLOPEN_LIBS) -L$(TOP)/$(LIB_DIR) -lEGL egl_LIBS := $(TOP)/src/gallium/state_trackers/egl/libegl.a ifneq ($(findstring x11, $(EGL_PLATFORMS)),) -- cgit v1.2.3