From f5ba2cdeb902993b993187a958aad89c5ac79d6b Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 24 Mar 2010 10:58:45 +0100 Subject: [PATCH] gallium: Move egl drivers to targets Atteched output from git commit: rename src/gallium/{winsys/drm => targets}/Makefile.egl (100%) rename src/gallium/{winsys/drm/intel/egl => targets/egl-i915}/Makefile (86%) rename src/gallium/{winsys/drm/i965/egl => targets/egl-i915}/dummy.c (100%) rename src/gallium/{winsys/drm/i965/egl => targets/egl-i965}/Makefile (86%) rename src/gallium/{winsys/drm/intel/egl => targets/egl-i965}/dummy.c (100%) rename src/gallium/{winsys/drm/nouveau/egl => targets/egl-nouveau}/Makefile (88%) rename src/gallium/{winsys/drm/nouveau/egl => targets/egl-nouveau}/dummy.c (100%) rename src/gallium/{winsys/drm/radeon/egl => targets/egl-radeon}/Makefile (87%) rename src/gallium/{winsys/drm/radeon/egl => targets/egl-radeon}/dummy.c (100%) create mode 100644 src/gallium/targets/egl-swrast/Makefile create mode 100644 src/gallium/targets/egl-swrast/swrast_glue.c rename src/gallium/{winsys/drm/vmware/egl => targets/egl-vmwgfx}/Makefile (86%) rename src/gallium/{winsys/drm/swrast/egl => targets/egl-vmwgfx}/dummy.c (100%) delete mode 100644 src/gallium/winsys/drm/swrast/Makefile delete mode 100644 src/gallium/winsys/drm/swrast/core/Makefile delete mode 100644 src/gallium/winsys/drm/swrast/core/swrast_drm_api.c delete mode 100644 src/gallium/winsys/drm/swrast/egl/Makefile delete mode 100644 src/gallium/winsys/drm/vmware/egl/dummy.c --- configs/default | 2 +- configs/linux-dri | 2 +- configs/linux-opengl-es | 3 ++- configure.ac | 23 +++++++++++++++++-- .../{winsys/drm => targets}/Makefile.egl | 0 .../intel/egl => targets/egl-i915}/Makefile | 4 ++-- .../drm/i965/egl => targets/egl-i915}/dummy.c | 0 .../i965/egl => targets/egl-i965}/Makefile | 4 ++-- .../intel/egl => targets/egl-i965}/dummy.c | 0 .../egl => targets/egl-nouveau}/Makefile | 4 ++-- .../egl => targets/egl-nouveau}/dummy.c | 0 .../egl => targets/egl-radeon}/Makefile | 4 ++-- .../radeon/egl => targets/egl-radeon}/dummy.c | 0 src/gallium/targets/egl-swrast/Makefile | 12 ++++++++++ .../egl-swrast/swrast_glue.c} | 4 ++++ .../egl => targets/egl-vmwgfx}/Makefile | 4 ++-- .../swrast/egl => targets/egl-vmwgfx}/dummy.c | 0 src/gallium/winsys/drm/swrast/Makefile | 12 ---------- src/gallium/winsys/drm/swrast/core/Makefile | 10 -------- src/gallium/winsys/drm/swrast/egl/Makefile | 12 ---------- src/gallium/winsys/drm/vmware/egl/dummy.c | 3 --- 21 files changed, 51 insertions(+), 52 deletions(-) rename src/gallium/{winsys/drm => targets}/Makefile.egl (100%) rename src/gallium/{winsys/drm/intel/egl => targets/egl-i915}/Makefile (86%) rename src/gallium/{winsys/drm/i965/egl => targets/egl-i915}/dummy.c (100%) rename src/gallium/{winsys/drm/i965/egl => targets/egl-i965}/Makefile (86%) rename src/gallium/{winsys/drm/intel/egl => targets/egl-i965}/dummy.c (100%) rename src/gallium/{winsys/drm/nouveau/egl => targets/egl-nouveau}/Makefile (88%) rename src/gallium/{winsys/drm/nouveau/egl => targets/egl-nouveau}/dummy.c (100%) rename src/gallium/{winsys/drm/radeon/egl => targets/egl-radeon}/Makefile (87%) rename src/gallium/{winsys/drm/radeon/egl => targets/egl-radeon}/dummy.c (100%) create mode 100644 src/gallium/targets/egl-swrast/Makefile rename src/gallium/{winsys/drm/swrast/core/swrast_drm_api.c => targets/egl-swrast/swrast_glue.c} (60%) rename src/gallium/{winsys/drm/vmware/egl => targets/egl-vmwgfx}/Makefile (86%) rename src/gallium/{winsys/drm/swrast/egl => targets/egl-vmwgfx}/dummy.c (100%) delete mode 100644 src/gallium/winsys/drm/swrast/Makefile delete mode 100644 src/gallium/winsys/drm/swrast/core/Makefile delete mode 100644 src/gallium/winsys/drm/swrast/egl/Makefile delete mode 100644 src/gallium/winsys/drm/vmware/egl/dummy.c diff --git a/configs/default b/configs/default index 03feed973a2..65e9847bd20 100644 --- a/configs/default +++ b/configs/default @@ -100,7 +100,7 @@ GALLIUM_DIRS = auxiliary drivers state_trackers GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a GALLIUM_DRIVERS_DIRS = softpipe failover svga i915 i965 r300 trace identity GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a) -GALLIUM_WINSYS_DIRS = null xlib drm/swrast +GALLIUM_WINSYS_DIRS = null xlib GALLIUM_TARGET_DIRS = libgl-xlib GALLIUM_STATE_TRACKERS_DIRS = glx vega diff --git a/configs/linux-dri b/configs/linux-dri index e10021d7994..b11daeda7c2 100644 --- a/configs/linux-dri +++ b/configs/linux-dri @@ -59,7 +59,7 @@ EGL_DRIVERS_DIRS = glx DRIVER_DIRS = dri GALLIUM_WINSYS_DIRS = null xlib drm/vmware drm/intel drm/i965 -GALLIUM_TARGET_DIRS = +GALLIUM_TARGET_DIRS = egl-swrast GALLIUM_STATE_TRACKERS_DIRS = egl DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon \ diff --git a/configs/linux-opengl-es b/configs/linux-opengl-es index ddcb717f836..32fe40fb848 100644 --- a/configs/linux-opengl-es +++ b/configs/linux-opengl-es @@ -24,4 +24,5 @@ GALLIUM_STATE_TRACKERS_DIRS = es # build egl_x11_{swrast,i915}.so GALLIUM_DRIVERS_DIRS += trace i915 GALLIUM_STATE_TRACKERS_DIRS += egl -GALLIUM_WINSYS_DIRS += drm/intel drm/swrast +GALLIUM_WINSYS_DIRS += drm/intel +GALLIUM_TARGET_DIRS += egl-swrast egl-i915 diff --git a/configure.ac b/configure.ac index 51b480ff972..dccff6f7cc4 100644 --- a/configure.ac +++ b/configure.ac @@ -1320,6 +1320,9 @@ if test "x$enable_gallium_svga" = xyes; then GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm/vmware" GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-vmwgfx" fi + if test "x$enable_egl" = xyes; then + GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-vmwgfx" + fi GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga" elif test "x$enable_gallium_svga" = xauto; then GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga" @@ -1338,6 +1341,9 @@ if test "x$enable_gallium_intel" = xyes; then GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm/intel drm/i965" GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-i915 dri-i965" fi + if test "x$enable_egl" = xyes; then + GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-i915 egl-i965" + fi GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965" elif test "x$enable_gallium_intel" = xauto; then GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965" @@ -1356,6 +1362,9 @@ if test "x$enable_gallium_radeon" = xyes; then GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm/radeon" GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-radeong" fi + if test "x$enable_egl" = xyes; then + GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-radeon" + fi GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300" elif test "x$enable_gallium_radeon" = xauto; then GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300" @@ -1374,6 +1383,9 @@ if test "x$enable_gallium_nouveau" = xyes; then GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm/nouveau" GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-nouveau" fi + if test "x$enable_egl" = xyes; then + GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-nouveau" + fi GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50" fi @@ -1382,11 +1394,18 @@ dnl Gallium swrast configuration dnl AC_ARG_ENABLE([gallium-swrast], [AS_HELP_STRING([--enable-gallium-swrast], - [build gallium swrast @<:@default=disabled@:>@])], + [build gallium swrast @<:@default=auto@:>@])], [enable_gallium_swrast="$enableval"], [enable_gallium_swrast=auto]) if test "x$enable_gallium_swrast" = xyes; then - GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm/swrast" + if test "x$enable_egl" != xyes; then + AC_MSG_ERROR([EGL needs to be enabled for egl-swrast target]) + fi + GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-swrast" +elif test "x$enable_gallium_swrast" = xauto; then + if test "x$enable_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/winsys/drm/Makefile.egl b/src/gallium/targets/Makefile.egl similarity index 100% rename from src/gallium/winsys/drm/Makefile.egl rename to src/gallium/targets/Makefile.egl diff --git a/src/gallium/winsys/drm/intel/egl/Makefile b/src/gallium/targets/egl-i915/Makefile similarity index 86% rename from src/gallium/winsys/drm/intel/egl/Makefile rename to src/gallium/targets/egl-i915/Makefile index 60d675ca73d..596dd092f75 100644 --- a/src/gallium/winsys/drm/intel/egl/Makefile +++ b/src/gallium/targets/egl-i915/Makefile @@ -1,4 +1,4 @@ -TOP = ../../../../../.. +TOP = ../../../.. include $(TOP)/configs/current EGL_DRIVER_NAME = i915 @@ -11,4 +11,4 @@ EGL_DRIVER_PIPES = \ $(TOP)/src/gallium/drivers/trace/libtrace.a \ $(TOP)/src/gallium/drivers/i915/libi915.a -include ../../Makefile.egl +include ../Makefile.egl diff --git a/src/gallium/winsys/drm/i965/egl/dummy.c b/src/gallium/targets/egl-i915/dummy.c similarity index 100% rename from src/gallium/winsys/drm/i965/egl/dummy.c rename to src/gallium/targets/egl-i915/dummy.c diff --git a/src/gallium/winsys/drm/i965/egl/Makefile b/src/gallium/targets/egl-i965/Makefile similarity index 86% rename from src/gallium/winsys/drm/i965/egl/Makefile rename to src/gallium/targets/egl-i965/Makefile index 1c132582005..e4c1a88f4c6 100644 --- a/src/gallium/winsys/drm/i965/egl/Makefile +++ b/src/gallium/targets/egl-i965/Makefile @@ -1,4 +1,4 @@ -TOP = ../../../../../.. +TOP = ../../../.. include $(TOP)/configs/current EGL_DRIVER_NAME = i965 @@ -11,4 +11,4 @@ EGL_DRIVER_PIPES = \ $(TOP)/src/gallium/drivers/trace/libtrace.a \ $(TOP)/src/gallium/drivers/i965/libi965.a -include ../../Makefile.egl +include ../Makefile.egl diff --git a/src/gallium/winsys/drm/intel/egl/dummy.c b/src/gallium/targets/egl-i965/dummy.c similarity index 100% rename from src/gallium/winsys/drm/intel/egl/dummy.c rename to src/gallium/targets/egl-i965/dummy.c diff --git a/src/gallium/winsys/drm/nouveau/egl/Makefile b/src/gallium/targets/egl-nouveau/Makefile similarity index 88% rename from src/gallium/winsys/drm/nouveau/egl/Makefile rename to src/gallium/targets/egl-nouveau/Makefile index 47d11276155..46fcdf5e4b0 100644 --- a/src/gallium/winsys/drm/nouveau/egl/Makefile +++ b/src/gallium/targets/egl-nouveau/Makefile @@ -1,4 +1,4 @@ -TOP = ../../../../../.. +TOP = ../../../.. include $(TOP)/configs/current EGL_DRIVER_NAME = nouveau @@ -12,4 +12,4 @@ EGL_DRIVER_PIPES = \ $(TOP)/src/gallium/drivers/nouveau/libnouveau.a \ $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a -include ../../Makefile.egl +include ../Makefile.egl diff --git a/src/gallium/winsys/drm/nouveau/egl/dummy.c b/src/gallium/targets/egl-nouveau/dummy.c similarity index 100% rename from src/gallium/winsys/drm/nouveau/egl/dummy.c rename to src/gallium/targets/egl-nouveau/dummy.c diff --git a/src/gallium/winsys/drm/radeon/egl/Makefile b/src/gallium/targets/egl-radeon/Makefile similarity index 87% rename from src/gallium/winsys/drm/radeon/egl/Makefile rename to src/gallium/targets/egl-radeon/Makefile index cd4f9b20f06..56818365dda 100644 --- a/src/gallium/winsys/drm/radeon/egl/Makefile +++ b/src/gallium/targets/egl-radeon/Makefile @@ -1,4 +1,4 @@ -TOP = ../../../../../.. +TOP = ../../../.. include $(TOP)/configs/current EGL_DRIVER_NAME = radeon @@ -11,4 +11,4 @@ EGL_DRIVER_PIPES = \ $(TOP)/src/gallium/drivers/trace/libtrace.a \ $(TOP)/src/gallium/drivers/r300/libr300.a -include ../../Makefile.egl +include ../Makefile.egl diff --git a/src/gallium/winsys/drm/radeon/egl/dummy.c b/src/gallium/targets/egl-radeon/dummy.c similarity index 100% rename from src/gallium/winsys/drm/radeon/egl/dummy.c rename to src/gallium/targets/egl-radeon/dummy.c diff --git a/src/gallium/targets/egl-swrast/Makefile b/src/gallium/targets/egl-swrast/Makefile new file mode 100644 index 00000000000..937343defe5 --- /dev/null +++ b/src/gallium/targets/egl-swrast/Makefile @@ -0,0 +1,12 @@ +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 = $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a + +include ../Makefile.egl diff --git a/src/gallium/winsys/drm/swrast/core/swrast_drm_api.c b/src/gallium/targets/egl-swrast/swrast_glue.c similarity index 60% rename from src/gallium/winsys/drm/swrast/core/swrast_drm_api.c rename to src/gallium/targets/egl-swrast/swrast_glue.c index 8c9f80e2c15..9db8089a666 100644 --- a/src/gallium/winsys/drm/swrast/core/swrast_drm_api.c +++ b/src/gallium/targets/egl-swrast/swrast_glue.c @@ -11,3 +11,7 @@ drm_api_create() (void) swrast_drm_api; return NULL; } + +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/winsys/drm/vmware/egl/Makefile b/src/gallium/targets/egl-vmwgfx/Makefile similarity index 86% rename from src/gallium/winsys/drm/vmware/egl/Makefile rename to src/gallium/targets/egl-vmwgfx/Makefile index a3e73131c35..007158a6408 100644 --- a/src/gallium/winsys/drm/vmware/egl/Makefile +++ b/src/gallium/targets/egl-vmwgfx/Makefile @@ -1,4 +1,4 @@ -TOP = ../../../../../.. +TOP = ../../../.. include $(TOP)/configs/current EGL_DRIVER_NAME = vmwgfx @@ -11,4 +11,4 @@ EGL_DRIVER_PIPES = \ $(TOP)/src/gallium/drivers/trace/libtrace.a \ $(TOP)/src/gallium/drivers/svga/libsvga.a -include ../../Makefile.egl +include ../Makefile.egl diff --git a/src/gallium/winsys/drm/swrast/egl/dummy.c b/src/gallium/targets/egl-vmwgfx/dummy.c similarity index 100% rename from src/gallium/winsys/drm/swrast/egl/dummy.c rename to src/gallium/targets/egl-vmwgfx/dummy.c diff --git a/src/gallium/winsys/drm/swrast/Makefile b/src/gallium/winsys/drm/swrast/Makefile deleted file mode 100644 index 363b89584f2..00000000000 --- a/src/gallium/winsys/drm/swrast/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# src/gallium/winsys/drm/swrast/Makefile -TOP = ../../../../.. -include $(TOP)/configs/current - -SUBDIRS = core $(GALLIUM_STATE_TRACKERS_DIRS) - -default install clean: - @for dir in $(SUBDIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE) $@) || exit 1; \ - fi \ - done diff --git a/src/gallium/winsys/drm/swrast/core/Makefile b/src/gallium/winsys/drm/swrast/core/Makefile deleted file mode 100644 index 93931ae22b9..00000000000 --- a/src/gallium/winsys/drm/swrast/core/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# src/gallium/winsys/drm/swrast/core/Makefile - -TOP = ../../../../../.. -include $(TOP)/configs/current - -LIBNAME = swrastdrm - -C_SOURCES = swrast_drm_api.c - -include ../../../../Makefile.template diff --git a/src/gallium/winsys/drm/swrast/egl/Makefile b/src/gallium/winsys/drm/swrast/egl/Makefile deleted file mode 100644 index 26fe2d2805a..00000000000 --- a/src/gallium/winsys/drm/swrast/egl/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -TOP = ../../../../../.. -include $(TOP)/configs/current - -EGL_DRIVER_NAME = swrast -EGL_DRIVER_SOURCES = dummy.c -EGL_DRIVER_LIBS = - -EGL_DRIVER_PIPES = \ - $(TOP)/src/gallium/winsys/drm/swrast/core/libswrastdrm.a \ - $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a - -include ../../Makefile.egl diff --git a/src/gallium/winsys/drm/vmware/egl/dummy.c b/src/gallium/winsys/drm/vmware/egl/dummy.c deleted file mode 100644 index 3181d0ba7e8..00000000000 --- a/src/gallium/winsys/drm/vmware/egl/dummy.c +++ /dev/null @@ -1,3 +0,0 @@ -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; -- 2.30.2