From c1a19689b83a9569b30ba43c168fdca328cb9f2e Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 1 Jun 2010 04:06:52 +0100 Subject: gallium: Make all drm drivers use the new drm compat helper --- src/gallium/targets/egl-nouveau/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/targets/egl-nouveau/Makefile') diff --git a/src/gallium/targets/egl-nouveau/Makefile b/src/gallium/targets/egl-nouveau/Makefile index e3fa8937e83..3f0a373e43b 100644 --- a/src/gallium/targets/egl-nouveau/Makefile +++ b/src/gallium/targets/egl-nouveau/Makefile @@ -2,7 +2,7 @@ TOP = ../../../.. include $(TOP)/configs/current EGL_DRIVER_NAME = nouveau -EGL_DRIVER_SOURCES = dummy.c +EGL_DRIVER_SOURCES = target.c EGL_DRIVER_LIBS = -ldrm_nouveau EGL_DRIVER_PIPES = \ -- cgit v1.2.3 From 57d14f2fbbfc50656be76fa0f77e1ed505180204 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 24 Jun 2010 01:53:05 +0200 Subject: gallium: Use debugging helper in all drm targets --- src/gallium/targets/dri-i915/Makefile | 3 +++ src/gallium/targets/dri-i915/SConscript | 2 ++ src/gallium/targets/dri-i915/target.c | 11 ++++++++++- src/gallium/targets/dri-i965/Makefile | 2 +- src/gallium/targets/dri-i965/SConscript | 6 +++++- src/gallium/targets/dri-i965/target.c | 3 +++ src/gallium/targets/dri-nouveau/Makefile | 5 +++++ src/gallium/targets/dri-nouveau/target.c | 3 +++ src/gallium/targets/dri-r600/Makefile | 3 +++ src/gallium/targets/dri-r600/SConscript | 2 ++ src/gallium/targets/dri-r600/target.c | 3 +++ src/gallium/targets/dri-radeong/Makefile | 3 +++ src/gallium/targets/dri-radeong/SConscript | 2 ++ src/gallium/targets/dri-radeong/target.c | 11 ++++++++++- src/gallium/targets/dri-vmwgfx/Makefile | 3 +++ src/gallium/targets/dri-vmwgfx/SConscript | 2 ++ src/gallium/targets/dri-vmwgfx/target.c | 11 ++++++++++- src/gallium/targets/egl-i915/Makefile | 3 +++ src/gallium/targets/egl-i915/target.c | 11 ++++++++++- src/gallium/targets/egl-i965/Makefile | 2 +- src/gallium/targets/egl-i965/target.c | 3 +++ src/gallium/targets/egl-nouveau/Makefile | 5 +++++ src/gallium/targets/egl-nouveau/target.c | 3 +++ src/gallium/targets/egl-radeon/Makefile | 3 +++ src/gallium/targets/egl-radeon/target.c | 11 ++++++++++- src/gallium/targets/egl-vmwgfx/Makefile | 3 +++ src/gallium/targets/egl-vmwgfx/target.c | 11 ++++++++++- src/gallium/targets/xorg-i915/Makefile | 2 +- src/gallium/targets/xorg-i915/intel_target.c | 11 ++++++++++- src/gallium/targets/xorg-i965/Makefile | 3 ++- src/gallium/targets/xorg-i965/intel_target.c | 3 +++ src/gallium/targets/xorg-nouveau/Makefile | 4 +++- src/gallium/targets/xorg-nouveau/nouveau_target.c | 3 +++ src/gallium/targets/xorg-radeon/Makefile | 2 +- src/gallium/targets/xorg-radeon/radeon_target.c | 11 ++++++++++- src/gallium/targets/xorg-vmwgfx/Makefile | 3 +++ src/gallium/targets/xorg-vmwgfx/vmw_target.c | 11 ++++++++++- 37 files changed, 167 insertions(+), 16 deletions(-) (limited to 'src/gallium/targets/egl-nouveau/Makefile') diff --git a/src/gallium/targets/dri-i915/Makefile b/src/gallium/targets/dri-i915/Makefile index 24ef989ad2a..26726b24a05 100644 --- a/src/gallium/targets/dri-i915/Makefile +++ b/src/gallium/targets/dri-i915/Makefile @@ -17,6 +17,9 @@ C_SOURCES = \ $(COMMON_GALLIUM_SOURCES) \ $(DRIVER_SOURCES) +DRIVER_DEFINES = \ + -DGALLIUM_RBUG -DGALLIUM_TRACE + include ../Makefile.dri DRI_LIB_DEPS += -ldrm_intel diff --git a/src/gallium/targets/dri-i915/SConscript b/src/gallium/targets/dri-i915/SConscript index 5da2a0a4036..5659bc80275 100644 --- a/src/gallium/targets/dri-i915/SConscript +++ b/src/gallium/targets/dri-i915/SConscript @@ -8,6 +8,8 @@ env = drienv.Clone() env.ParseConfig('pkg-config --cflags --libs libdrm_intel') +env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE']) + env.Prepend(LIBS = [ st_dri, i915drm, diff --git a/src/gallium/targets/dri-i915/target.c b/src/gallium/targets/dri-i915/target.c index a79238f3a0f..8c8ef7e02b4 100644 --- a/src/gallium/targets/dri-i915/target.c +++ b/src/gallium/targets/dri-i915/target.c @@ -1,5 +1,6 @@ #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" @@ -7,11 +8,19 @@ 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; - return i915_screen_create(iws); + screen = i915_screen_create(iws); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; } DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen) diff --git a/src/gallium/targets/dri-i965/Makefile b/src/gallium/targets/dri-i965/Makefile index 76350caf9d7..3679c075b24 100644 --- a/src/gallium/targets/dri-i965/Makefile +++ b/src/gallium/targets/dri-i965/Makefile @@ -18,7 +18,7 @@ C_SOURCES = \ $(DRIVER_SOURCES) DRIVER_DEFINES = \ - -DGALLIUM_SOFTPIPE + -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE include ../Makefile.dri diff --git a/src/gallium/targets/dri-i965/SConscript b/src/gallium/targets/dri-i965/SConscript index da1a8654a86..7eb3c436a32 100644 --- a/src/gallium/targets/dri-i965/SConscript +++ b/src/gallium/targets/dri-i965/SConscript @@ -8,7 +8,11 @@ env = drienv.Clone() env.ParseConfig('pkg-config --cflags --libs libdrm_intel') -env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE') +env.Append(CPPDEFINES = [ + 'GALLIUM_SOFTPIPE', + 'GALLIUM_RBUG', + 'GALLIUM_TRACE' +]) env.Prepend(LIBS = [ st_dri, diff --git a/src/gallium/targets/dri-i965/target.c b/src/gallium/targets/dri-i965/target.c index 36424c60a11..ce97f820278 100644 --- a/src/gallium/targets/dri-i965/target.c +++ b/src/gallium/targets/dri-i965/target.c @@ -1,5 +1,6 @@ #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" @@ -21,6 +22,8 @@ create_screen(int fd) if (debug_get_bool_option("BRW_SOFTPIPE", FALSE)) screen = sw_screen_wrap(screen); + screen = debug_screen_wrap(screen); + return screen; } diff --git a/src/gallium/targets/dri-nouveau/Makefile b/src/gallium/targets/dri-nouveau/Makefile index bf594ce483e..2f64f312b84 100644 --- a/src/gallium/targets/dri-nouveau/Makefile +++ b/src/gallium/targets/dri-nouveau/Makefile @@ -6,6 +6,8 @@ LIBNAME = nouveau_dri.so PIPE_DRIVERS = \ $(TOP)/src/gallium/state_trackers/dri/drm/libdridrm.a \ $(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 @@ -15,6 +17,9 @@ C_SOURCES = \ $(COMMON_GALLIUM_SOURCES) \ $(DRIVER_SOURCES) +DRIVER_DEFINES = \ + -DGALLIUM_RBUG -DGALLIUM_TRACE + include ../Makefile.dri DRI_LIB_DEPS += $(shell pkg-config libdrm_nouveau --libs) diff --git a/src/gallium/targets/dri-nouveau/target.c b/src/gallium/targets/dri-nouveau/target.c index ca3ec53029a..e725a4d9b7a 100644 --- a/src/gallium/targets/dri-nouveau/target.c +++ b/src/gallium/targets/dri-nouveau/target.c @@ -1,4 +1,5 @@ +#include "target-helpers/inline_debug_helper.h" #include "state_tracker/drm_driver.h" #include "nouveau/drm/nouveau_drm_public.h" @@ -11,6 +12,8 @@ create_screen(int fd) if (!screen) return NULL; + screen = debug_screen_wrap(screen); + return screen; } diff --git a/src/gallium/targets/dri-r600/Makefile b/src/gallium/targets/dri-r600/Makefile index 136fbb260b4..932303d194e 100644 --- a/src/gallium/targets/dri-r600/Makefile +++ b/src/gallium/targets/dri-r600/Makefile @@ -16,6 +16,9 @@ C_SOURCES = \ $(COMMON_GALLIUM_SOURCES) \ $(DRIVER_SOURCES) +DRIVER_DEFINES = \ + -DGALLIUM_RBUG -DGALLIUM_TRACE + include ../Makefile.dri DRI_LIB_DEPS += -ldrm_radeon diff --git a/src/gallium/targets/dri-r600/SConscript b/src/gallium/targets/dri-r600/SConscript index d24251673c6..97c5df01fe2 100644 --- a/src/gallium/targets/dri-r600/SConscript +++ b/src/gallium/targets/dri-r600/SConscript @@ -8,6 +8,8 @@ env = drienv.Clone() env.ParseConfig('pkg-config --cflags --libs libdrm_radeon') +env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE']) + env.Prepend(LIBS = [ st_dri, r600drm, diff --git a/src/gallium/targets/dri-r600/target.c b/src/gallium/targets/dri-r600/target.c index 40ad8a09ca8..a01f4ed49fd 100644 --- a/src/gallium/targets/dri-r600/target.c +++ b/src/gallium/targets/dri-r600/target.c @@ -1,5 +1,6 @@ #include "state_tracker/drm_driver.h" +#include "target-helpers/inline_debug_helper.h" #include "r600/drm/r600_drm_public.h" #include "r600/r600_public.h" @@ -17,6 +18,8 @@ create_screen(int fd) if (!screen) return NULL; + screen = debug_screen_wrap(screen); + return screen; } diff --git a/src/gallium/targets/dri-radeong/Makefile b/src/gallium/targets/dri-radeong/Makefile index d67d7d7ac23..28647540b0a 100644 --- a/src/gallium/targets/dri-radeong/Makefile +++ b/src/gallium/targets/dri-radeong/Makefile @@ -16,6 +16,9 @@ C_SOURCES = \ $(COMMON_GALLIUM_SOURCES) \ $(DRIVER_SOURCES) +DRIVER_DEFINES = \ + -DGALLIUM_RBUG -DGALLIUM_TRACE + include ../Makefile.dri DRI_LIB_DEPS += -ldrm_radeon diff --git a/src/gallium/targets/dri-radeong/SConscript b/src/gallium/targets/dri-radeong/SConscript index c1d4eeecee6..ffac73af84e 100644 --- a/src/gallium/targets/dri-radeong/SConscript +++ b/src/gallium/targets/dri-radeong/SConscript @@ -8,6 +8,8 @@ env = drienv.Clone() env.ParseConfig('pkg-config --cflags --libs libdrm_radeon') +env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE']) + env.Prepend(LIBS = [ st_dri, radeonwinsys, diff --git a/src/gallium/targets/dri-radeong/target.c b/src/gallium/targets/dri-radeong/target.c index 2c1beb633ef..5a0a8dc5738 100644 --- a/src/gallium/targets/dri-radeong/target.c +++ b/src/gallium/targets/dri-radeong/target.c @@ -1,4 +1,5 @@ +#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" @@ -7,11 +8,19 @@ 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; - return r300_screen_create(sws); + screen = r300_screen_create(sws); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; } DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen) diff --git a/src/gallium/targets/dri-vmwgfx/Makefile b/src/gallium/targets/dri-vmwgfx/Makefile index 8e3cd6ff28a..97c703b3739 100644 --- a/src/gallium/targets/dri-vmwgfx/Makefile +++ b/src/gallium/targets/dri-vmwgfx/Makefile @@ -14,6 +14,9 @@ C_SOURCES = \ target.c \ $(COMMON_GALLIUM_SOURCES) +DRIVER_DEFINES = \ + -DGALLIUM_RBUG -DGALLIUM_TRACE + include ../Makefile.dri symlinks: diff --git a/src/gallium/targets/dri-vmwgfx/SConscript b/src/gallium/targets/dri-vmwgfx/SConscript index 3d0c5495da1..7afabc7429f 100644 --- a/src/gallium/targets/dri-vmwgfx/SConscript +++ b/src/gallium/targets/dri-vmwgfx/SConscript @@ -6,6 +6,8 @@ if not 'svga' in env['drivers']: env = drienv.Clone() +env.Append(CPPDEFINES = ['GALLIUM_RBUG', 'GALLIUM_TRACE']) + env.Prepend(LIBS = [ st_dri, svgadrm, diff --git a/src/gallium/targets/dri-vmwgfx/target.c b/src/gallium/targets/dri-vmwgfx/target.c index 5f69653582d..15089d6db26 100644 --- a/src/gallium/targets/dri-vmwgfx/target.c +++ b/src/gallium/targets/dri-vmwgfx/target.c @@ -1,4 +1,5 @@ +#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" @@ -7,11 +8,19 @@ 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; - return svga_screen_create(sws); + screen = svga_screen_create(sws); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; } DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen) diff --git a/src/gallium/targets/egl-i915/Makefile b/src/gallium/targets/egl-i915/Makefile index a118f169299..c3ffe78029d 100644 --- a/src/gallium/targets/egl-i915/Makefile +++ b/src/gallium/targets/egl-i915/Makefile @@ -5,6 +5,9 @@ EGL_DRIVER_NAME = i915 EGL_DRIVER_SOURCES = target.c EGL_DRIVER_LIBS = -ldrm_intel +EGL_DRIVER_DEFINES = \ + -DGALLIUM_RBUG -DGALLIUM_TRACE + EGL_DRIVER_PIPES = \ $(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \ $(TOP)/src/gallium/drivers/trace/libtrace.a \ diff --git a/src/gallium/targets/egl-i915/target.c b/src/gallium/targets/egl-i915/target.c index 28877166434..070e2c09648 100644 --- a/src/gallium/targets/egl-i915/target.c +++ b/src/gallium/targets/egl-i915/target.c @@ -1,5 +1,6 @@ #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" @@ -7,11 +8,19 @@ 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; - return i915_screen_create(iws); + screen = i915_screen_create(iws); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; } DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen) diff --git a/src/gallium/targets/egl-i965/Makefile b/src/gallium/targets/egl-i965/Makefile index fe3091190c1..44e435452e8 100644 --- a/src/gallium/targets/egl-i965/Makefile +++ b/src/gallium/targets/egl-i965/Makefile @@ -6,7 +6,7 @@ EGL_DRIVER_SOURCES = target.c EGL_DRIVER_LIBS = -ldrm_intel EGL_DRIVER_DEFINES = \ - -DGALLIUM_SOFTPIPE + -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE EGL_DRIVER_PIPES = \ $(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \ diff --git a/src/gallium/targets/egl-i965/target.c b/src/gallium/targets/egl-i965/target.c index ba1eeadd214..1195b510a07 100644 --- a/src/gallium/targets/egl-i965/target.c +++ b/src/gallium/targets/egl-i965/target.c @@ -1,5 +1,6 @@ #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" @@ -21,6 +22,8 @@ create_screen(int fd) if (debug_get_bool_option("BRW_SOFTPIPE", FALSE)) screen = sw_screen_wrap(screen); + screen = debug_screen_wrap(screen); + return screen; } diff --git a/src/gallium/targets/egl-nouveau/Makefile b/src/gallium/targets/egl-nouveau/Makefile index 3f0a373e43b..0e16f113246 100644 --- a/src/gallium/targets/egl-nouveau/Makefile +++ b/src/gallium/targets/egl-nouveau/Makefile @@ -5,8 +5,13 @@ 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 diff --git a/src/gallium/targets/egl-nouveau/target.c b/src/gallium/targets/egl-nouveau/target.c index 7d0b141e5a2..cf569ea62c8 100644 --- a/src/gallium/targets/egl-nouveau/target.c +++ b/src/gallium/targets/egl-nouveau/target.c @@ -1,4 +1,5 @@ +#include "target-helpers/inline_debug_helper.h" #include "state_tracker/drm_driver.h" #include "nouveau/drm/nouveau_drm_public.h" @@ -11,6 +12,8 @@ create_screen(int fd) if (!screen) return NULL; + screen = debug_screen_wrap(screen); + return screen; } diff --git a/src/gallium/targets/egl-radeon/Makefile b/src/gallium/targets/egl-radeon/Makefile index c988b48cd04..2adc027b8f0 100644 --- a/src/gallium/targets/egl-radeon/Makefile +++ b/src/gallium/targets/egl-radeon/Makefile @@ -5,6 +5,9 @@ EGL_DRIVER_NAME = radeon EGL_DRIVER_SOURCES = target.c EGL_DRIVER_LIBS = -ldrm_radeon +EGL_DRIVER_DEFINES = \ + -DGALLIUM_RBUG -DGALLIUM_TRACE + EGL_DRIVER_PIPES = \ $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \ $(TOP)/src/gallium/drivers/trace/libtrace.a \ diff --git a/src/gallium/targets/egl-radeon/target.c b/src/gallium/targets/egl-radeon/target.c index 5117eb86f9f..ce07327b8fc 100644 --- a/src/gallium/targets/egl-radeon/target.c +++ b/src/gallium/targets/egl-radeon/target.c @@ -1,4 +1,5 @@ +#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" @@ -7,11 +8,19 @@ 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; - return r300_screen_create(sws); + screen = r300_screen_create(sws); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; } DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen) diff --git a/src/gallium/targets/egl-vmwgfx/Makefile b/src/gallium/targets/egl-vmwgfx/Makefile index a25bf8885d4..92ec4cbdd61 100644 --- a/src/gallium/targets/egl-vmwgfx/Makefile +++ b/src/gallium/targets/egl-vmwgfx/Makefile @@ -5,6 +5,9 @@ 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 \ diff --git a/src/gallium/targets/egl-vmwgfx/target.c b/src/gallium/targets/egl-vmwgfx/target.c index 7dd0bb0dc2c..4e9f51c5dc4 100644 --- a/src/gallium/targets/egl-vmwgfx/target.c +++ b/src/gallium/targets/egl-vmwgfx/target.c @@ -1,4 +1,5 @@ +#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" @@ -7,11 +8,19 @@ 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; - return svga_screen_create(sws); + screen = svga_screen_create(sws); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; } DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen) diff --git a/src/gallium/targets/xorg-i915/Makefile b/src/gallium/targets/xorg-i915/Makefile index 4f9202b0520..3ab7285fb93 100644 --- a/src/gallium/targets/xorg-i915/Makefile +++ b/src/gallium/targets/xorg-i915/Makefile @@ -8,7 +8,7 @@ C_SOURCES = \ intel_xorg.c DRIVER_DEFINES = \ - -DHAVE_CONFIG_H + -DHAVE_CONFIG_H -DGALLIUM_RBUG -DGALLIUM_TRACE DRIVER_LINKS = \ $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \ diff --git a/src/gallium/targets/xorg-i915/intel_target.c b/src/gallium/targets/xorg-i915/intel_target.c index a79238f3a0f..8c8ef7e02b4 100644 --- a/src/gallium/targets/xorg-i915/intel_target.c +++ b/src/gallium/targets/xorg-i915/intel_target.c @@ -1,5 +1,6 @@ #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" @@ -7,11 +8,19 @@ 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; - return i915_screen_create(iws); + screen = i915_screen_create(iws); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; } DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen) diff --git a/src/gallium/targets/xorg-i965/Makefile b/src/gallium/targets/xorg-i965/Makefile index eede9f23254..9bb8252be20 100644 --- a/src/gallium/targets/xorg-i965/Makefile +++ b/src/gallium/targets/xorg-i965/Makefile @@ -8,7 +8,8 @@ C_SOURCES = \ intel_xorg.c DRIVER_DEFINES = \ - -DHAVE_CONFIG_H -DGALLIUM_SOFTPIPE + -DHAVE_CONFIG_H -DGALLIUM_SOFTPIPE \ + -DGALLIUM_RBUG -DGALLIUM_TRACE DRIVER_LINKS = \ $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \ diff --git a/src/gallium/targets/xorg-i965/intel_target.c b/src/gallium/targets/xorg-i965/intel_target.c index 36424c60a11..ce97f820278 100644 --- a/src/gallium/targets/xorg-i965/intel_target.c +++ b/src/gallium/targets/xorg-i965/intel_target.c @@ -1,5 +1,6 @@ #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" @@ -21,6 +22,8 @@ create_screen(int fd) if (debug_get_bool_option("BRW_SOFTPIPE", FALSE)) screen = sw_screen_wrap(screen); + screen = debug_screen_wrap(screen); + return screen; } diff --git a/src/gallium/targets/xorg-nouveau/Makefile b/src/gallium/targets/xorg-nouveau/Makefile index 066ec6a8130..93f53e63bfd 100644 --- a/src/gallium/targets/xorg-nouveau/Makefile +++ b/src/gallium/targets/xorg-nouveau/Makefile @@ -8,11 +8,13 @@ C_SOURCES = \ nouveau_xorg.c DRIVER_DEFINES = \ - -DHAVE_CONFIG_H + -DHAVE_CONFIG_H -DGALLIUM_RBUG -DGALLIUM_TRACE DRIVER_LINKS = \ $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \ $(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 \ diff --git a/src/gallium/targets/xorg-nouveau/nouveau_target.c b/src/gallium/targets/xorg-nouveau/nouveau_target.c index ca3ec53029a..e725a4d9b7a 100644 --- a/src/gallium/targets/xorg-nouveau/nouveau_target.c +++ b/src/gallium/targets/xorg-nouveau/nouveau_target.c @@ -1,4 +1,5 @@ +#include "target-helpers/inline_debug_helper.h" #include "state_tracker/drm_driver.h" #include "nouveau/drm/nouveau_drm_public.h" @@ -11,6 +12,8 @@ create_screen(int fd) if (!screen) return NULL; + screen = debug_screen_wrap(screen); + return screen; } diff --git a/src/gallium/targets/xorg-radeon/Makefile b/src/gallium/targets/xorg-radeon/Makefile index c438ec48473..ba7caea155c 100644 --- a/src/gallium/targets/xorg-radeon/Makefile +++ b/src/gallium/targets/xorg-radeon/Makefile @@ -8,7 +8,7 @@ C_SOURCES = \ radeon_xorg.c DRIVER_DEFINES = \ - -DHAVE_CONFIG_H + -DHAVE_CONFIG_H -DGALLIUM_RBUG -DGALLIUM_TRACE DRIVER_LINKS = \ $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \ diff --git a/src/gallium/targets/xorg-radeon/radeon_target.c b/src/gallium/targets/xorg-radeon/radeon_target.c index 2c1beb633ef..5a0a8dc5738 100644 --- a/src/gallium/targets/xorg-radeon/radeon_target.c +++ b/src/gallium/targets/xorg-radeon/radeon_target.c @@ -1,4 +1,5 @@ +#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" @@ -7,11 +8,19 @@ 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; - return r300_screen_create(sws); + screen = r300_screen_create(sws); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; } DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen) diff --git a/src/gallium/targets/xorg-vmwgfx/Makefile b/src/gallium/targets/xorg-vmwgfx/Makefile index 0cc9be212b4..73a2cea232e 100644 --- a/src/gallium/targets/xorg-vmwgfx/Makefile +++ b/src/gallium/targets/xorg-vmwgfx/Makefile @@ -16,8 +16,11 @@ DRIVER_INCLUDES = \ DRIVER_DEFINES = \ -std=gnu99 \ + -DGALLIUM_RBUG \ + -DGALLIUM_TRACE \ -DHAVE_CONFIG_H + DRIVER_LINKS = \ $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \ $(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \ diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_target.c b/src/gallium/targets/xorg-vmwgfx/vmw_target.c index 5f69653582d..15089d6db26 100644 --- a/src/gallium/targets/xorg-vmwgfx/vmw_target.c +++ b/src/gallium/targets/xorg-vmwgfx/vmw_target.c @@ -1,4 +1,5 @@ +#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" @@ -7,11 +8,19 @@ 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; - return svga_screen_create(sws); + screen = svga_screen_create(sws); + if (!screen) + return NULL; + + screen = debug_screen_wrap(screen); + + return screen; } DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen) -- 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 'src/gallium/targets/egl-nouveau/Makefile') diff --git a/configure.ac b/configure.ac index 09921176625..7583ab8595e 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 7bb53492b49..e117f15d930 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 683b74f62b2..0668f5c91ab 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 7934f257205..00000000000 --- 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 1275cc79b24..00000000000 --- 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 0ca3d1fb9e5..00000000000 --- 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 676300b0cc1..00000000000 --- 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 0c8de8992f3..00000000000 --- 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 87b3e65e239..00000000000 --- 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 e29a2374792..00000000000 --- 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 43c67a49c36..00000000000 --- 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 070e2c09648..00000000000 --- 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 44e435452e8..00000000000 --- 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 1195b510a07..00000000000 --- 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 0e16f113246..00000000000 --- 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 cf569ea62c8..00000000000 --- 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 cc7bb22952a..00000000000 --- 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 ce07327b8fc..00000000000 --- 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 7d4f5054983..00000000000 --- 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 213e5b3e6ce..00000000000 --- 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 24f77826d4c..00000000000 --- 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 92ec4cbdd61..00000000000 --- 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 4e9f51c5dc4..00000000000 --- 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 00000000000..364a31dc450 --- /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 00000000000..c743c26cf6f --- /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 00000000000..d19c83a47d3 --- /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 00000000000..cf569ea62c8 --- /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 00000000000..ce07327b8fc --- /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 00000000000..d8205c158e6 --- /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 00000000000..4e9f51c5dc4 --- /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 00000000000..676300b0cc1 --- /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 00000000000..0c8de8992f3 --- /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 00000000000..87b3e65e239 --- /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 00000000000..e29a2374792 --- /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