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/xorg-vmwgfx/Makefile | 1 + src/gallium/targets/xorg-vmwgfx/vmw_target.c | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 src/gallium/targets/xorg-vmwgfx/vmw_target.c (limited to 'src/gallium/targets/xorg-vmwgfx') diff --git a/src/gallium/targets/xorg-vmwgfx/Makefile b/src/gallium/targets/xorg-vmwgfx/Makefile index c0ff999116..0cc9be212b 100644 --- a/src/gallium/targets/xorg-vmwgfx/Makefile +++ b/src/gallium/targets/xorg-vmwgfx/Makefile @@ -8,6 +8,7 @@ C_SOURCES = \ vmw_video.c \ vmw_ioctl.c \ vmw_ctrl.c \ + vmw_target.c \ vmw_screen.c DRIVER_INCLUDES = \ diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_target.c b/src/gallium/targets/xorg-vmwgfx/vmw_target.c new file mode 100644 index 0000000000..3d1990fc1b --- /dev/null +++ b/src/gallium/targets/xorg-vmwgfx/vmw_target.c @@ -0,0 +1,4 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("vmwgfx", "vmwgfx") -- cgit v1.2.3 From 9ff10b67bc1d69bef96cb24627481ab939ec1aa6 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sun, 6 Jun 2010 11:13:49 +0100 Subject: svga: Move bootstrap code to targets --- src/gallium/drivers/svga/svga_public.h | 42 +++++++++++++++++++++++++++ src/gallium/drivers/svga/svga_screen.c | 1 + src/gallium/drivers/svga/svga_winsys.h | 3 -- src/gallium/targets/dri-vmwgfx/target.c | 17 +++++++++-- src/gallium/targets/egl-vmwgfx/target.c | 18 ++++++++++-- src/gallium/targets/xorg-vmwgfx/vmw_target.c | 17 +++++++++-- src/gallium/winsys/svga/drm/svga_drm_public.h | 41 ++++++++++++++++++++++++++ src/gallium/winsys/svga/drm/vmw_screen_dri.c | 39 +++++-------------------- 8 files changed, 138 insertions(+), 40 deletions(-) create mode 100644 src/gallium/drivers/svga/svga_public.h create mode 100644 src/gallium/winsys/svga/drm/svga_drm_public.h (limited to 'src/gallium/targets/xorg-vmwgfx') diff --git a/src/gallium/drivers/svga/svga_public.h b/src/gallium/drivers/svga/svga_public.h new file mode 100644 index 0000000000..ded2e2482a --- /dev/null +++ b/src/gallium/drivers/svga/svga_public.h @@ -0,0 +1,42 @@ +/********************************************************** + * 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. + * + **********************************************************/ + +/** + * @file + * VMware SVGA public interface. Used by targets to create a stack. + * + * @author Jakob Bornecrantz Fonseca + */ + +#ifndef SVGA_PUBLIC_H_ +#define SVGA_PUBLIC_H_ + +struct pipe_screen; +struct svga_winsys_screen; + +struct pipe_screen * +svga_screen_create(struct svga_winsys_screen *sws); + +#endif /* SVGA_PUBLIC_H_ */ diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index 54d9faeb72..077ff9a2cf 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -29,6 +29,7 @@ #include "util/u_math.h" #include "svga_winsys.h" +#include "svga_public.h" #include "svga_context.h" #include "svga_screen.h" #include "svga_resource_texture.h" diff --git a/src/gallium/drivers/svga/svga_winsys.h b/src/gallium/drivers/svga/svga_winsys.h index a2dcc84f7d..5e4bdeff2e 100644 --- a/src/gallium/drivers/svga/svga_winsys.h +++ b/src/gallium/drivers/svga/svga_winsys.h @@ -288,9 +288,6 @@ struct svga_winsys_screen }; -struct pipe_screen * -svga_screen_create(struct svga_winsys_screen *sws); - struct svga_winsys_screen * svga_winsys_screen(struct pipe_screen *screen); diff --git a/src/gallium/targets/dri-vmwgfx/target.c b/src/gallium/targets/dri-vmwgfx/target.c index 3d1990fc1b..5f69653582 100644 --- a/src/gallium/targets/dri-vmwgfx/target.c +++ b/src/gallium/targets/dri-vmwgfx/target.c @@ -1,4 +1,17 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "svga/drm/svga_drm_public.h" +#include "svga/svga_public.h" -DRM_API_COMPAT_STRUCT("vmwgfx", "vmwgfx") +static struct pipe_screen * +create_screen(int fd) +{ + struct svga_winsys_screen *sws; + sws = svga_drm_winsys_screen_create(fd); + if (!sws) + return NULL; + + return svga_screen_create(sws); +} + +DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen) diff --git a/src/gallium/targets/egl-vmwgfx/target.c b/src/gallium/targets/egl-vmwgfx/target.c index 39a829a230..7dd0bb0dc2 100644 --- a/src/gallium/targets/egl-vmwgfx/target.c +++ b/src/gallium/targets/egl-vmwgfx/target.c @@ -1,6 +1,20 @@ -#include "target-helpers/drm_api_compat.h" -DRM_API_COMPAT_STRUCT("vmwgfx", "vmwgfx") +#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; + sws = svga_drm_winsys_screen_create(fd); + if (!sws) + return NULL; + + return svga_screen_create(sws); +} + +DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen) /* A poor man's --whole-archive for EGL drivers */ void *_eglMain(void *); diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_target.c b/src/gallium/targets/xorg-vmwgfx/vmw_target.c index 3d1990fc1b..5f69653582 100644 --- a/src/gallium/targets/xorg-vmwgfx/vmw_target.c +++ b/src/gallium/targets/xorg-vmwgfx/vmw_target.c @@ -1,4 +1,17 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "svga/drm/svga_drm_public.h" +#include "svga/svga_public.h" -DRM_API_COMPAT_STRUCT("vmwgfx", "vmwgfx") +static struct pipe_screen * +create_screen(int fd) +{ + struct svga_winsys_screen *sws; + sws = svga_drm_winsys_screen_create(fd); + if (!sws) + return NULL; + + return svga_screen_create(sws); +} + +DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen) diff --git a/src/gallium/winsys/svga/drm/svga_drm_public.h b/src/gallium/winsys/svga/drm/svga_drm_public.h new file mode 100644 index 0000000000..e98c89da1e --- /dev/null +++ b/src/gallium/winsys/svga/drm/svga_drm_public.h @@ -0,0 +1,41 @@ +/********************************************************** + * 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. + * + **********************************************************/ + +/** + * @file + * VMware SVGA DRM winsys public interface. Used by targets to create a stack. + * + * @author Jakob Bornecrantz Fonseca + */ + +#ifndef SVGA_DRM_PUBLIC_H_ +#define SVGA_DRM_PUBLIC_H_ + +struct svga_winsys_screen; + +struct svga_winsys_screen * +svga_drm_winsys_screen_create(int fd); + +#endif /* SVGA_PUBLIC_H_ */ diff --git a/src/gallium/winsys/svga/drm/vmw_screen_dri.c b/src/gallium/winsys/svga/drm/vmw_screen_dri.c index fe28522691..1b0d10f60d 100644 --- a/src/gallium/winsys/svga/drm/vmw_screen_dri.c +++ b/src/gallium/winsys/svga/drm/vmw_screen_dri.c @@ -30,14 +30,14 @@ #include "util/u_format.h" #include "vmw_screen.h" -#include "trace/tr_drm.h" - #include "vmw_screen.h" #include "vmw_surface.h" #include "vmw_fence.h" #include "vmw_context.h" +#include "svga_drm_public.h" + +#include "state_tracker/drm_driver.h" -#include #include "vmwgfx_drm.h" #include @@ -84,15 +84,13 @@ vmw_dri1_check_version(const struct dri1_api_version *cur, return FALSE; } -/* This is actually the entrypoint to the entire driver, called by the - * libGL (or EGL, or ...) code via the drm_api_hooks table at the - * bottom of the file. +/* This is actually the entrypoint to the entire driver, + * called by the target bootstrap code. */ -static struct pipe_screen * -vmw_drm_create_screen(struct drm_api *drm_api, int fd) +struct svga_winsys_screen * +svga_drm_winsys_screen_create(int fd) { struct vmw_winsys_screen *vws; - struct pipe_screen *screen; boolean use_old_scanout_flag = FALSE; struct dri1_api_version drm_ver; @@ -123,16 +121,7 @@ vmw_drm_create_screen(struct drm_api *drm_api, int fd) vws->base.surface_from_handle = vmw_drm_surface_from_handle; vws->base.surface_get_handle = vmw_drm_surface_get_handle; - screen = svga_screen_create( &vws->base ); - if (!screen) - goto out_no_screen; - - return screen; - - /* Failure cases: - */ -out_no_screen: - vmw_winsys_destroy( vws ); + return &vws->base; out_no_vws: return NULL; @@ -253,15 +242,3 @@ vmw_drm_surface_get_handle(struct svga_winsys_screen *sws, return TRUE; } - -static struct drm_api vmw_drm_api_hooks = { - .name = "vmwgfx", - .driver_name = "vmwgfx", - .create_screen = vmw_drm_create_screen, - .destroy = NULL, -}; - -struct drm_api* drm_api_create() -{ - return trace_drm_create(&vmw_drm_api_hooks); -} -- 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/xorg-vmwgfx') diff --git a/src/gallium/targets/dri-i915/Makefile b/src/gallium/targets/dri-i915/Makefile index 24ef989ad2..26726b24a0 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 5da2a0a403..5659bc8027 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 a79238f3a0..8c8ef7e02b 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 76350caf9d..3679c075b2 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 da1a8654a8..7eb3c436a3 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 36424c60a1..ce97f82027 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 bf594ce483..2f64f312b8 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 ca3ec53029..e725a4d9b7 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 136fbb260b..932303d194 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 d24251673c..97c5df01fe 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 40ad8a09ca..a01f4ed49f 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 d67d7d7ac2..28647540b0 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 c1d4eeecee..ffac73af84 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 2c1beb633e..5a0a8dc573 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 8e3cd6ff28..97c703b373 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 3d0c5495da..7afabc7429 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 5f69653582..15089d6db2 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 a118f16929..c3ffe78029 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 2887716643..070e2c0964 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 fe3091190c..44e435452e 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 ba1eeadd21..1195b510a0 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 3f0a373e43..0e16f11324 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 7d0b141e5a..cf569ea62c 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 c988b48cd0..2adc027b8f 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 5117eb86f9..ce07327b8f 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 a25bf8885d..92ec4cbdd6 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 7dd0bb0dc2..4e9f51c5dc 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 4f9202b052..3ab7285fb9 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 a79238f3a0..8c8ef7e02b 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 eede9f2325..9bb8252be2 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 36424c60a1..ce97f82027 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 066ec6a813..93f53e63bf 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 ca3ec53029..e725a4d9b7 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 c438ec4847..ba7caea155 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 2c1beb633e..5a0a8dc573 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 0cc9be212b..73a2cea232 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 5f69653582..15089d6db2 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