From f9d9574913c5edb92191ac3f5e8d011452427852 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 27 May 2010 00:38:30 +0200 Subject: gallium: Convert state trackers to drm driver interface --- src/gallium/targets/xorg-radeon/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gallium/targets') diff --git a/src/gallium/targets/xorg-radeon/Makefile b/src/gallium/targets/xorg-radeon/Makefile index a4951c4bba0..c438ec48473 100644 --- a/src/gallium/targets/xorg-radeon/Makefile +++ b/src/gallium/targets/xorg-radeon/Makefile @@ -4,6 +4,7 @@ include $(TOP)/configs/current LIBNAME = radeon_drv.so C_SOURCES = \ + radeon_target.c \ radeon_xorg.c DRIVER_DEFINES = \ -- cgit v1.2.3 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/dri-i915/Makefile | 1 + src/gallium/targets/dri-i915/SConscript | 2 +- src/gallium/targets/dri-i915/dummy.c | 0 src/gallium/targets/dri-i915/target.c | 4 ++++ src/gallium/targets/dri-i965/Makefile | 1 + src/gallium/targets/dri-i965/SConscript | 2 +- src/gallium/targets/dri-i965/dummy.c | 0 src/gallium/targets/dri-i965/target.c | 4 ++++ src/gallium/targets/dri-nouveau/Makefile | 1 + src/gallium/targets/dri-nouveau/target.c | 4 ++++ src/gallium/targets/dri-r600/Makefile | 1 + src/gallium/targets/dri-r600/SConscript | 2 +- src/gallium/targets/dri-r600/dummy.c | 0 src/gallium/targets/dri-r600/target.c | 4 ++++ src/gallium/targets/dri-radeong/Makefile | 1 + src/gallium/targets/dri-radeong/SConscript | 2 +- src/gallium/targets/dri-radeong/dummy.c | 0 src/gallium/targets/dri-radeong/target.c | 4 ++++ src/gallium/targets/dri-vmwgfx/Makefile | 1 + src/gallium/targets/dri-vmwgfx/SConscript | 2 +- src/gallium/targets/dri-vmwgfx/dummy.c | 0 src/gallium/targets/dri-vmwgfx/target.c | 4 ++++ src/gallium/targets/egl-i915/Makefile | 2 +- src/gallium/targets/egl-i915/dummy.c | 3 --- src/gallium/targets/egl-i915/target.c | 8 ++++++++ src/gallium/targets/egl-i965/Makefile | 2 +- src/gallium/targets/egl-i965/dummy.c | 3 --- src/gallium/targets/egl-i965/target.c | 8 ++++++++ src/gallium/targets/egl-nouveau/Makefile | 2 +- src/gallium/targets/egl-nouveau/dummy.c | 3 --- src/gallium/targets/egl-nouveau/target.c | 8 ++++++++ src/gallium/targets/egl-radeon/Makefile | 2 +- src/gallium/targets/egl-radeon/dummy.c | 3 --- src/gallium/targets/egl-radeon/target.c | 8 ++++++++ src/gallium/targets/egl-vmwgfx/Makefile | 2 +- src/gallium/targets/egl-vmwgfx/dummy.c | 3 --- src/gallium/targets/egl-vmwgfx/target.c | 7 +++++++ src/gallium/targets/xorg-i915/Makefile | 1 + src/gallium/targets/xorg-i915/intel_target.c | 4 ++++ src/gallium/targets/xorg-i965/Makefile | 1 + src/gallium/targets/xorg-i965/intel_target.c | 4 ++++ src/gallium/targets/xorg-nouveau/Makefile | 1 + src/gallium/targets/xorg-nouveau/nouveau_target.c | 4 ++++ src/gallium/targets/xorg-radeon/radeon_target.c | 4 ++++ src/gallium/targets/xorg-vmwgfx/Makefile | 1 + src/gallium/targets/xorg-vmwgfx/vmw_target.c | 4 ++++ 46 files changed, 103 insertions(+), 25 deletions(-) delete mode 100644 src/gallium/targets/dri-i915/dummy.c create mode 100644 src/gallium/targets/dri-i915/target.c delete mode 100644 src/gallium/targets/dri-i965/dummy.c create mode 100644 src/gallium/targets/dri-i965/target.c create mode 100644 src/gallium/targets/dri-nouveau/target.c delete mode 100644 src/gallium/targets/dri-r600/dummy.c create mode 100644 src/gallium/targets/dri-r600/target.c delete mode 100644 src/gallium/targets/dri-radeong/dummy.c create mode 100644 src/gallium/targets/dri-radeong/target.c delete mode 100644 src/gallium/targets/dri-vmwgfx/dummy.c create mode 100644 src/gallium/targets/dri-vmwgfx/target.c delete mode 100644 src/gallium/targets/egl-i915/dummy.c create mode 100644 src/gallium/targets/egl-i915/target.c delete mode 100644 src/gallium/targets/egl-i965/dummy.c create mode 100644 src/gallium/targets/egl-i965/target.c delete mode 100644 src/gallium/targets/egl-nouveau/dummy.c create mode 100644 src/gallium/targets/egl-nouveau/target.c delete mode 100644 src/gallium/targets/egl-radeon/dummy.c create mode 100644 src/gallium/targets/egl-radeon/target.c delete mode 100644 src/gallium/targets/egl-vmwgfx/dummy.c create mode 100644 src/gallium/targets/egl-vmwgfx/target.c create mode 100644 src/gallium/targets/xorg-i915/intel_target.c create mode 100644 src/gallium/targets/xorg-i965/intel_target.c create mode 100644 src/gallium/targets/xorg-nouveau/nouveau_target.c create mode 100644 src/gallium/targets/xorg-radeon/radeon_target.c create mode 100644 src/gallium/targets/xorg-vmwgfx/vmw_target.c (limited to 'src/gallium/targets') diff --git a/src/gallium/targets/dri-i915/Makefile b/src/gallium/targets/dri-i915/Makefile index fdcfd08c227..24ef989ad2a 100644 --- a/src/gallium/targets/dri-i915/Makefile +++ b/src/gallium/targets/dri-i915/Makefile @@ -13,6 +13,7 @@ PIPE_DRIVERS = \ $(TOP)/src/gallium/drivers/i915/libi915.a C_SOURCES = \ + target.c \ $(COMMON_GALLIUM_SOURCES) \ $(DRIVER_SOURCES) diff --git a/src/gallium/targets/dri-i915/SConscript b/src/gallium/targets/dri-i915/SConscript index 65c42398875..5da2a0a4036 100644 --- a/src/gallium/targets/dri-i915/SConscript +++ b/src/gallium/targets/dri-i915/SConscript @@ -22,6 +22,6 @@ env.Prepend(LIBS = [ env.LoadableModule( target = 'i915_dri.so', - source = 'dummy.c', + source = 'target.c', SHLIBPREFIX = '', ) diff --git a/src/gallium/targets/dri-i915/dummy.c b/src/gallium/targets/dri-i915/dummy.c deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/gallium/targets/dri-i915/target.c b/src/gallium/targets/dri-i915/target.c new file mode 100644 index 00000000000..8fd73088933 --- /dev/null +++ b/src/gallium/targets/dri-i915/target.c @@ -0,0 +1,4 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("i915", "i915") diff --git a/src/gallium/targets/dri-i965/Makefile b/src/gallium/targets/dri-i965/Makefile index 13987c643e2..b068430ecf7 100644 --- a/src/gallium/targets/dri-i965/Makefile +++ b/src/gallium/targets/dri-i965/Makefile @@ -15,6 +15,7 @@ PIPE_DRIVERS = \ $(TOP)/src/gallium/drivers/i965/libi965.a C_SOURCES = \ + target.c \ $(COMMON_GALLIUM_SOURCES) \ $(DRIVER_SOURCES) diff --git a/src/gallium/targets/dri-i965/SConscript b/src/gallium/targets/dri-i965/SConscript index 13ac5a2d8ea..9e12c61aabc 100644 --- a/src/gallium/targets/dri-i965/SConscript +++ b/src/gallium/targets/dri-i965/SConscript @@ -24,6 +24,6 @@ env.Prepend(LIBS = [ env.LoadableModule( target = 'i965_dri.so', - source = 'dummy.c', + source = 'target.c', SHLIBPREFIX = '', ) diff --git a/src/gallium/targets/dri-i965/dummy.c b/src/gallium/targets/dri-i965/dummy.c deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/gallium/targets/dri-i965/target.c b/src/gallium/targets/dri-i965/target.c new file mode 100644 index 00000000000..9fe2227edd7 --- /dev/null +++ b/src/gallium/targets/dri-i965/target.c @@ -0,0 +1,4 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("i965", "i915") diff --git a/src/gallium/targets/dri-nouveau/Makefile b/src/gallium/targets/dri-nouveau/Makefile index 74d352c6a70..bf594ce483e 100644 --- a/src/gallium/targets/dri-nouveau/Makefile +++ b/src/gallium/targets/dri-nouveau/Makefile @@ -11,6 +11,7 @@ PIPE_DRIVERS = \ $(TOP)/src/gallium/drivers/nouveau/libnouveau.a C_SOURCES = \ + target.c \ $(COMMON_GALLIUM_SOURCES) \ $(DRIVER_SOURCES) diff --git a/src/gallium/targets/dri-nouveau/target.c b/src/gallium/targets/dri-nouveau/target.c new file mode 100644 index 00000000000..e16e86cd3d8 --- /dev/null +++ b/src/gallium/targets/dri-nouveau/target.c @@ -0,0 +1,4 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("nouveau", "nouveau") diff --git a/src/gallium/targets/dri-r600/Makefile b/src/gallium/targets/dri-r600/Makefile index 0213200fbcc..136fbb260b4 100644 --- a/src/gallium/targets/dri-r600/Makefile +++ b/src/gallium/targets/dri-r600/Makefile @@ -12,6 +12,7 @@ PIPE_DRIVERS = \ $(TOP)/src/gallium/drivers/r600/libr600.a C_SOURCES = \ + target.c \ $(COMMON_GALLIUM_SOURCES) \ $(DRIVER_SOURCES) diff --git a/src/gallium/targets/dri-r600/SConscript b/src/gallium/targets/dri-r600/SConscript index 6c23c050eb8..d24251673c6 100644 --- a/src/gallium/targets/dri-r600/SConscript +++ b/src/gallium/targets/dri-r600/SConscript @@ -22,6 +22,6 @@ env.Prepend(LIBS = [ env.SharedLibrary( target ='r600_dri.so', - source = 'dummy.c', + source = 'target.c', SHLIBPREFIX = '', ) diff --git a/src/gallium/targets/dri-r600/dummy.c b/src/gallium/targets/dri-r600/dummy.c deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/gallium/targets/dri-r600/target.c b/src/gallium/targets/dri-r600/target.c new file mode 100644 index 00000000000..3f09a7c5a92 --- /dev/null +++ b/src/gallium/targets/dri-r600/target.c @@ -0,0 +1,4 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("r600", "radeon") diff --git a/src/gallium/targets/dri-radeong/Makefile b/src/gallium/targets/dri-radeong/Makefile index 8ef24c08215..d67d7d7ac23 100644 --- a/src/gallium/targets/dri-radeong/Makefile +++ b/src/gallium/targets/dri-radeong/Makefile @@ -12,6 +12,7 @@ PIPE_DRIVERS = \ $(TOP)/src/gallium/drivers/r300/libr300.a C_SOURCES = \ + target.c \ $(COMMON_GALLIUM_SOURCES) \ $(DRIVER_SOURCES) diff --git a/src/gallium/targets/dri-radeong/SConscript b/src/gallium/targets/dri-radeong/SConscript index 4c6cfb84eba..c1d4eeecee6 100644 --- a/src/gallium/targets/dri-radeong/SConscript +++ b/src/gallium/targets/dri-radeong/SConscript @@ -22,6 +22,6 @@ env.Prepend(LIBS = [ env.SharedLibrary( target ='radeon_dri.so', - source = 'dummy.c', + source = 'target.c', SHLIBPREFIX = '', ) diff --git a/src/gallium/targets/dri-radeong/dummy.c b/src/gallium/targets/dri-radeong/dummy.c deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/gallium/targets/dri-radeong/target.c b/src/gallium/targets/dri-radeong/target.c new file mode 100644 index 00000000000..06b64820cf8 --- /dev/null +++ b/src/gallium/targets/dri-radeong/target.c @@ -0,0 +1,4 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("radeon", "radeon") diff --git a/src/gallium/targets/dri-vmwgfx/Makefile b/src/gallium/targets/dri-vmwgfx/Makefile index b5b679f3c7c..8e3cd6ff28a 100644 --- a/src/gallium/targets/dri-vmwgfx/Makefile +++ b/src/gallium/targets/dri-vmwgfx/Makefile @@ -11,6 +11,7 @@ PIPE_DRIVERS = \ $(TOP)/src/gallium/drivers/svga/libsvga.a C_SOURCES = \ + target.c \ $(COMMON_GALLIUM_SOURCES) include ../Makefile.dri diff --git a/src/gallium/targets/dri-vmwgfx/SConscript b/src/gallium/targets/dri-vmwgfx/SConscript index 09a0c254c30..3d0c5495da1 100644 --- a/src/gallium/targets/dri-vmwgfx/SConscript +++ b/src/gallium/targets/dri-vmwgfx/SConscript @@ -20,6 +20,6 @@ env.Prepend(LIBS = [ env.LoadableModule( target = 'vmwgfx_dri.so', - source = 'dummy.c', + source = 'target.c', SHLIBPREFIX = '', ) diff --git a/src/gallium/targets/dri-vmwgfx/dummy.c b/src/gallium/targets/dri-vmwgfx/dummy.c deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/gallium/targets/dri-vmwgfx/target.c b/src/gallium/targets/dri-vmwgfx/target.c new file mode 100644 index 00000000000..3d1990fc1b8 --- /dev/null +++ b/src/gallium/targets/dri-vmwgfx/target.c @@ -0,0 +1,4 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("vmwgfx", "vmwgfx") diff --git a/src/gallium/targets/egl-i915/Makefile b/src/gallium/targets/egl-i915/Makefile index a4b41842ff7..a118f169299 100644 --- a/src/gallium/targets/egl-i915/Makefile +++ b/src/gallium/targets/egl-i915/Makefile @@ -2,7 +2,7 @@ TOP = ../../../.. include $(TOP)/configs/current EGL_DRIVER_NAME = i915 -EGL_DRIVER_SOURCES = dummy.c +EGL_DRIVER_SOURCES = target.c EGL_DRIVER_LIBS = -ldrm_intel EGL_DRIVER_PIPES = \ diff --git a/src/gallium/targets/egl-i915/dummy.c b/src/gallium/targets/egl-i915/dummy.c deleted file mode 100644 index 3181d0ba7e8..00000000000 --- a/src/gallium/targets/egl-i915/dummy.c +++ /dev/null @@ -1,3 +0,0 @@ -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl-i915/target.c b/src/gallium/targets/egl-i915/target.c new file mode 100644 index 00000000000..fd68c4bd454 --- /dev/null +++ b/src/gallium/targets/egl-i915/target.c @@ -0,0 +1,8 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("i915", "i915") + +/* 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 index d4730824a5b..542200481d1 100644 --- a/src/gallium/targets/egl-i965/Makefile +++ b/src/gallium/targets/egl-i965/Makefile @@ -2,7 +2,7 @@ TOP = ../../../.. include $(TOP)/configs/current EGL_DRIVER_NAME = i965 -EGL_DRIVER_SOURCES = dummy.c +EGL_DRIVER_SOURCES = target.c EGL_DRIVER_LIBS = -ldrm_intel EGL_DRIVER_PIPES = \ diff --git a/src/gallium/targets/egl-i965/dummy.c b/src/gallium/targets/egl-i965/dummy.c deleted file mode 100644 index 3181d0ba7e8..00000000000 --- a/src/gallium/targets/egl-i965/dummy.c +++ /dev/null @@ -1,3 +0,0 @@ -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl-i965/target.c b/src/gallium/targets/egl-i965/target.c new file mode 100644 index 00000000000..2f97bcecf2e --- /dev/null +++ b/src/gallium/targets/egl-i965/target.c @@ -0,0 +1,8 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("i965", "i915") + +/* 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 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 = \ diff --git a/src/gallium/targets/egl-nouveau/dummy.c b/src/gallium/targets/egl-nouveau/dummy.c deleted file mode 100644 index 3181d0ba7e8..00000000000 --- a/src/gallium/targets/egl-nouveau/dummy.c +++ /dev/null @@ -1,3 +0,0 @@ -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl-nouveau/target.c b/src/gallium/targets/egl-nouveau/target.c new file mode 100644 index 00000000000..49545c63e11 --- /dev/null +++ b/src/gallium/targets/egl-nouveau/target.c @@ -0,0 +1,8 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("nouveau", "nouveau") + +/* 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 index 8fcca268265..c988b48cd04 100644 --- a/src/gallium/targets/egl-radeon/Makefile +++ b/src/gallium/targets/egl-radeon/Makefile @@ -2,7 +2,7 @@ TOP = ../../../.. include $(TOP)/configs/current EGL_DRIVER_NAME = radeon -EGL_DRIVER_SOURCES = dummy.c +EGL_DRIVER_SOURCES = target.c EGL_DRIVER_LIBS = -ldrm_radeon EGL_DRIVER_PIPES = \ diff --git a/src/gallium/targets/egl-radeon/dummy.c b/src/gallium/targets/egl-radeon/dummy.c deleted file mode 100644 index 3181d0ba7e8..00000000000 --- a/src/gallium/targets/egl-radeon/dummy.c +++ /dev/null @@ -1,3 +0,0 @@ -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl-radeon/target.c b/src/gallium/targets/egl-radeon/target.c new file mode 100644 index 00000000000..03b982ae831 --- /dev/null +++ b/src/gallium/targets/egl-radeon/target.c @@ -0,0 +1,8 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("radeon", "radeon") + +/* 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 index a9f6874b981..a25bf8885d4 100644 --- a/src/gallium/targets/egl-vmwgfx/Makefile +++ b/src/gallium/targets/egl-vmwgfx/Makefile @@ -2,7 +2,7 @@ TOP = ../../../.. include $(TOP)/configs/current EGL_DRIVER_NAME = vmwgfx -EGL_DRIVER_SOURCES = dummy.c +EGL_DRIVER_SOURCES = target.c EGL_DRIVER_LIBS = EGL_DRIVER_PIPES = \ diff --git a/src/gallium/targets/egl-vmwgfx/dummy.c b/src/gallium/targets/egl-vmwgfx/dummy.c deleted file mode 100644 index 3181d0ba7e8..00000000000 --- a/src/gallium/targets/egl-vmwgfx/dummy.c +++ /dev/null @@ -1,3 +0,0 @@ -/* A poor man's --whole-archive for EGL drivers */ -void *_eglMain(void *); -void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/egl-vmwgfx/target.c b/src/gallium/targets/egl-vmwgfx/target.c new file mode 100644 index 00000000000..39a829a2305 --- /dev/null +++ b/src/gallium/targets/egl-vmwgfx/target.c @@ -0,0 +1,7 @@ +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("vmwgfx", "vmwgfx") + +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/targets/xorg-i915/Makefile b/src/gallium/targets/xorg-i915/Makefile index 18f07d6d8f2..4f9202b0520 100644 --- a/src/gallium/targets/xorg-i915/Makefile +++ b/src/gallium/targets/xorg-i915/Makefile @@ -4,6 +4,7 @@ include $(TOP)/configs/current LIBNAME = modesetting_drv.so C_SOURCES = \ + intel_target.c \ intel_xorg.c DRIVER_DEFINES = \ diff --git a/src/gallium/targets/xorg-i915/intel_target.c b/src/gallium/targets/xorg-i915/intel_target.c new file mode 100644 index 00000000000..4eff93c0740 --- /dev/null +++ b/src/gallium/targets/xorg-i915/intel_target.c @@ -0,0 +1,4 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("modesetting", "i915") diff --git a/src/gallium/targets/xorg-i965/Makefile b/src/gallium/targets/xorg-i965/Makefile index 2b0c7d6fdf6..b23a2deab99 100644 --- a/src/gallium/targets/xorg-i965/Makefile +++ b/src/gallium/targets/xorg-i965/Makefile @@ -4,6 +4,7 @@ include $(TOP)/configs/current LIBNAME = i965g_drv.so C_SOURCES = \ + intel_target.c \ intel_xorg.c DRIVER_DEFINES = \ diff --git a/src/gallium/targets/xorg-i965/intel_target.c b/src/gallium/targets/xorg-i965/intel_target.c new file mode 100644 index 00000000000..2b0f5458771 --- /dev/null +++ b/src/gallium/targets/xorg-i965/intel_target.c @@ -0,0 +1,4 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("i965g", "i915") diff --git a/src/gallium/targets/xorg-nouveau/Makefile b/src/gallium/targets/xorg-nouveau/Makefile index f50872362f6..066ec6a8130 100644 --- a/src/gallium/targets/xorg-nouveau/Makefile +++ b/src/gallium/targets/xorg-nouveau/Makefile @@ -4,6 +4,7 @@ include $(TOP)/configs/current LIBNAME = modesetting_drv.so C_SOURCES = \ + nouveau_target.c \ nouveau_xorg.c DRIVER_DEFINES = \ diff --git a/src/gallium/targets/xorg-nouveau/nouveau_target.c b/src/gallium/targets/xorg-nouveau/nouveau_target.c new file mode 100644 index 00000000000..e16e86cd3d8 --- /dev/null +++ b/src/gallium/targets/xorg-nouveau/nouveau_target.c @@ -0,0 +1,4 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("nouveau", "nouveau") diff --git a/src/gallium/targets/xorg-radeon/radeon_target.c b/src/gallium/targets/xorg-radeon/radeon_target.c new file mode 100644 index 00000000000..06b64820cf8 --- /dev/null +++ b/src/gallium/targets/xorg-radeon/radeon_target.c @@ -0,0 +1,4 @@ + +#include "target-helpers/drm_api_compat.h" + +DRM_API_COMPAT_STRUCT("radeon", "radeon") diff --git a/src/gallium/targets/xorg-vmwgfx/Makefile b/src/gallium/targets/xorg-vmwgfx/Makefile index c0ff9991165..0cc9be212b4 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 00000000000..3d1990fc1b8 --- /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 16fa300d55f789cfd71b1d61e3ff74d2eafd12ab Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 1 Jun 2010 07:56:33 +0100 Subject: swrastg: Use new drm_driver interface in EGL The EGL state tracker is really weird in how it does software, in the past we would just not return a drm_api struct but now, there is no callback to get a function so we just set the create_screen hock to NULL to make it switch to software. --- src/gallium/targets/egl-swrast/swrast_glue.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/gallium/targets') diff --git a/src/gallium/targets/egl-swrast/swrast_glue.c b/src/gallium/targets/egl-swrast/swrast_glue.c index defd11c6878..3c29be83a7c 100644 --- a/src/gallium/targets/egl-swrast/swrast_glue.c +++ b/src/gallium/targets/egl-swrast/swrast_glue.c @@ -1,10 +1,11 @@ -#include "state_tracker/drm_api.h" -struct drm_api * -drm_api_create() -{ - return NULL; -} +#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 *); -- 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') diff --git a/src/gallium/drivers/svga/svga_public.h b/src/gallium/drivers/svga/svga_public.h new file mode 100644 index 00000000000..ded2e2482a7 --- /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 54d9faeb72a..077ff9a2cf6 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 a2dcc84f7da..5e4bdeff2ee 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 3d1990fc1b8..5f69653582d 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 39a829a2305..7dd0bb0dc2c 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 3d1990fc1b8..5f69653582d 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 00000000000..e98c89da1e1 --- /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 fe285226918..1b0d10f60d6 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 c7015877beedd9831402755dbc58afddcbbd5339 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 1 Jun 2010 04:38:24 +0100 Subject: i915g: Move bootstrap code to targets --- src/gallium/drivers/i915/i915_public.h | 13 +++++++++++++ src/gallium/drivers/i915/i915_screen.c | 1 + src/gallium/drivers/i915/i915_winsys.h | 7 ------- src/gallium/targets/dri-i915/target.c | 17 +++++++++++++++-- src/gallium/targets/egl-i915/target.c | 17 +++++++++++++++-- src/gallium/targets/xorg-i915/intel_target.c | 17 +++++++++++++++-- src/gallium/winsys/i915/drm/i915_drm_buffer.c | 2 +- src/gallium/winsys/i915/drm/i915_drm_public.h | 9 +++++++++ src/gallium/winsys/i915/drm/i915_drm_winsys.c | 27 +++++---------------------- src/gallium/winsys/i915/drm/i915_drm_winsys.h | 1 - src/gallium/winsys/i915/sw/i915_sw_public.h | 9 +++++++++ src/gallium/winsys/i915/sw/i915_sw_winsys.c | 8 ++++---- src/gallium/winsys/i915/sw/i915_sw_winsys.h | 1 - 13 files changed, 87 insertions(+), 42 deletions(-) create mode 100644 src/gallium/drivers/i915/i915_public.h create mode 100644 src/gallium/winsys/i915/drm/i915_drm_public.h create mode 100644 src/gallium/winsys/i915/sw/i915_sw_public.h (limited to 'src/gallium/targets') diff --git a/src/gallium/drivers/i915/i915_public.h b/src/gallium/drivers/i915/i915_public.h new file mode 100644 index 00000000000..588654d6083 --- /dev/null +++ b/src/gallium/drivers/i915/i915_public.h @@ -0,0 +1,13 @@ + +#ifndef I915_PUBLIC_H +#define I915_PUBLIC_H + +struct i915_winsys; +struct pipe_screen; + +/** + * Create i915 pipe_screen. + */ +struct pipe_screen * i915_screen_create(struct i915_winsys *iws); + +#endif diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index f82426520cd..bb0b85d74c7 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -36,6 +36,7 @@ #include "i915_surface.h" #include "i915_resource.h" #include "i915_winsys.h" +#include "i915_public.h" /* diff --git a/src/gallium/drivers/i915/i915_winsys.h b/src/gallium/drivers/i915/i915_winsys.h index 3aba19fe6a3..5385e403d22 100644 --- a/src/gallium/drivers/i915/i915_winsys.h +++ b/src/gallium/drivers/i915/i915_winsys.h @@ -222,11 +222,4 @@ struct i915_winsys { void (*destroy)(struct i915_winsys *iws); }; - -/** - * Create i915 pipe_screen. - */ -struct pipe_screen *i915_screen_create(struct i915_winsys *iws); - - #endif diff --git a/src/gallium/targets/dri-i915/target.c b/src/gallium/targets/dri-i915/target.c index 8fd73088933..a79238f3a0f 100644 --- a/src/gallium/targets/dri-i915/target.c +++ b/src/gallium/targets/dri-i915/target.c @@ -1,4 +1,17 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "i915/drm/i915_drm_public.h" +#include "i915/i915_public.h" -DRM_API_COMPAT_STRUCT("i915", "i915") +static struct pipe_screen * +create_screen(int fd) +{ + struct i915_winsys *iws; + iws = i915_drm_winsys_create(fd); + if (!iws) + return NULL; + + return i915_screen_create(iws); +} + +DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen) diff --git a/src/gallium/targets/egl-i915/target.c b/src/gallium/targets/egl-i915/target.c index fd68c4bd454..28877166434 100644 --- a/src/gallium/targets/egl-i915/target.c +++ b/src/gallium/targets/egl-i915/target.c @@ -1,7 +1,20 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "i915/drm/i915_drm_public.h" +#include "i915/i915_public.h" -DRM_API_COMPAT_STRUCT("i915", "i915") +static struct pipe_screen * +create_screen(int fd) +{ + struct i915_winsys *iws; + iws = i915_drm_winsys_create(fd); + if (!iws) + return NULL; + + return i915_screen_create(iws); +} + +DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen) /* A poor man's --whole-archive for EGL drivers */ void *_eglMain(void *); diff --git a/src/gallium/targets/xorg-i915/intel_target.c b/src/gallium/targets/xorg-i915/intel_target.c index 4eff93c0740..a79238f3a0f 100644 --- a/src/gallium/targets/xorg-i915/intel_target.c +++ b/src/gallium/targets/xorg-i915/intel_target.c @@ -1,4 +1,17 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "i915/drm/i915_drm_public.h" +#include "i915/i915_public.h" -DRM_API_COMPAT_STRUCT("modesetting", "i915") +static struct pipe_screen * +create_screen(int fd) +{ + struct i915_winsys *iws; + iws = i915_drm_winsys_create(fd); + if (!iws) + return NULL; + + return i915_screen_create(iws); +} + +DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen) diff --git a/src/gallium/winsys/i915/drm/i915_drm_buffer.c b/src/gallium/winsys/i915/drm/i915_drm_buffer.c index 3bd85026b21..6b06e7ae995 100644 --- a/src/gallium/winsys/i915/drm/i915_drm_buffer.c +++ b/src/gallium/winsys/i915/drm/i915_drm_buffer.c @@ -1,5 +1,5 @@ -#include "state_tracker/drm_api.h" +#include "state_tracker/drm_driver.h" #include "i915_drm_winsys.h" #include "util/u_memory.h" diff --git a/src/gallium/winsys/i915/drm/i915_drm_public.h b/src/gallium/winsys/i915/drm/i915_drm_public.h new file mode 100644 index 00000000000..b828d8d670c --- /dev/null +++ b/src/gallium/winsys/i915/drm/i915_drm_public.h @@ -0,0 +1,9 @@ + +#ifndef I915_DRM_PUBLIC_H +#define I915_DRM_PUBLIC_H + +struct i915_winsys; + +struct i915_winsys * i915_drm_winsys_create(int drmFD); + +#endif diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.c b/src/gallium/winsys/i915/drm/i915_drm_winsys.c index 5a6b45e6c9f..83651b4c47c 100644 --- a/src/gallium/winsys/i915/drm/i915_drm_winsys.c +++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.c @@ -1,14 +1,11 @@ #include -#include "state_tracker/drm_api.h" +#include "state_tracker/drm_driver.h" #include "i915_drm_winsys.h" +#include "i915_drm_public.h" #include "util/u_memory.h" -#include "i915/i915_context.h" -#include "i915/i915_screen.h" - -#include "trace/tr_drm.h" /* * Helper functions @@ -48,8 +45,8 @@ i915_drm_winsys_destroy(struct i915_winsys *iws) FREE(idws); } -static struct pipe_screen * -i915_drm_create_screen(struct drm_api *api, int drmFD) +struct i915_winsys * +i915_drm_winsys_create(int drmFD) { struct i915_drm_winsys *idws; unsigned int deviceID; @@ -75,19 +72,5 @@ i915_drm_create_screen(struct drm_api *api, int drmFD) idws->dump_cmd = debug_get_bool_option("INTEL_DUMP_CMD", FALSE); - return i915_screen_create(&idws->base); -} - -static struct drm_api i915_drm_api = -{ - .name = "i915", - .driver_name = "i915", - .create_screen = i915_drm_create_screen, - .destroy = NULL, -}; - -struct drm_api * -drm_api_create() -{ - return trace_drm_create(&i915_drm_api); + return &idws->base; } diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.h b/src/gallium/winsys/i915/drm/i915_drm_winsys.h index 99667bde4ef..1b93ddc734c 100644 --- a/src/gallium/winsys/i915/drm/i915_drm_winsys.h +++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.h @@ -34,7 +34,6 @@ i915_drm_winsys(struct i915_winsys *iws) return (struct i915_drm_winsys *)iws; } -struct i915_drm_winsys * i915_drm_winsys_create(int fd, unsigned pci_id); struct pipe_fence_handle * i915_drm_fence_create(drm_intel_bo *bo); void i915_drm_winsys_init_batchbuffer_functions(struct i915_drm_winsys *idws); diff --git a/src/gallium/winsys/i915/sw/i915_sw_public.h b/src/gallium/winsys/i915/sw/i915_sw_public.h new file mode 100644 index 00000000000..e951a32917f --- /dev/null +++ b/src/gallium/winsys/i915/sw/i915_sw_public.h @@ -0,0 +1,9 @@ + +#ifndef I915_SW_PUBLIC_H +#define I915_SW_PUBLIC_H + +struct i915_winsys; + +struct i915_winsys * i915_sw_winsys_create(void); + +#endif diff --git a/src/gallium/winsys/i915/sw/i915_sw_winsys.c b/src/gallium/winsys/i915/sw/i915_sw_winsys.c index bb1c107c056..058ddc44aaf 100644 --- a/src/gallium/winsys/i915/sw/i915_sw_winsys.c +++ b/src/gallium/winsys/i915/sw/i915_sw_winsys.c @@ -1,5 +1,6 @@ #include "i915_sw_winsys.h" +#include "i915_sw_public.h" #include "util/u_memory.h" @@ -28,8 +29,8 @@ i915_sw_destroy(struct i915_winsys *iws) */ -struct pipe_screen * -i915_sw_create_screen() +struct i915_winsys * +i915_sw_winsys_create() { struct i915_sw_winsys *isws; unsigned int deviceID; @@ -51,6 +52,5 @@ i915_sw_create_screen() isws->dump_cmd = debug_get_bool_option("INTEL_DUMP_CMD", FALSE); - /* XXX so this will leak winsys:es */ - return i915_screen_create(&isws->base); + return &isws->base; } diff --git a/src/gallium/winsys/i915/sw/i915_sw_winsys.h b/src/gallium/winsys/i915/sw/i915_sw_winsys.h index b8aa9ef4ac5..b7b43669f30 100644 --- a/src/gallium/winsys/i915/sw/i915_sw_winsys.h +++ b/src/gallium/winsys/i915/sw/i915_sw_winsys.h @@ -25,7 +25,6 @@ i915_sw_winsys(struct i915_winsys *iws) return (struct i915_sw_winsys *)iws; } -struct pipe_screen* i915_sw_create_screen(void); struct pipe_fence_handle * i915_sw_fence_create(void); void i915_sw_winsys_init_batchbuffer_functions(struct i915_sw_winsys *idws); -- cgit v1.2.3 From 6e3fc2de2a185775a721b3633f420aa3d2c9a949 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sun, 6 Jun 2010 11:56:23 +0100 Subject: r300g: Move bootstrap code to targets --- src/gallium/drivers/r300/r300_public.h | 9 +++++++++ src/gallium/drivers/r300/r300_screen.c | 3 ++- src/gallium/drivers/r300/r300_winsys.h | 3 --- src/gallium/targets/dri-radeong/target.c | 17 +++++++++++++++-- src/gallium/targets/egl-radeon/target.c | 17 +++++++++++++++-- src/gallium/targets/xorg-radeon/radeon_target.c | 17 +++++++++++++++-- src/gallium/winsys/radeon/drm/radeon_drm.c | 18 +++--------------- src/gallium/winsys/radeon/drm/radeon_drm.h | 7 +------ src/gallium/winsys/radeon/drm/radeon_drm_public.h | 9 +++++++++ src/gallium/winsys/radeon/drm/radeon_r300.c | 2 +- 10 files changed, 70 insertions(+), 32 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_public.h create mode 100644 src/gallium/winsys/radeon/drm/radeon_drm_public.h (limited to 'src/gallium/targets') diff --git a/src/gallium/drivers/r300/r300_public.h b/src/gallium/drivers/r300/r300_public.h new file mode 100644 index 00000000000..8e7a963c55d --- /dev/null +++ b/src/gallium/drivers/r300/r300_public.h @@ -0,0 +1,9 @@ + +#ifndef R300_PUBLIC_H +#define R300_PUBLIC_H + +struct r300_winsys_screen; + +struct pipe_screen* r300_screen_create(struct r300_winsys_screen *rws); + +#endif diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 497e24b7605..fd522b84e1a 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -30,6 +30,7 @@ #include "r300_screen_buffer.h" #include "r300_state_inlines.h" #include "r300_winsys.h" +#include "r300_public.h" /* Return the identifier behind whom the brave coders responsible for this * amalgamation of code, sweat, and duct tape, routinely obscure their names. @@ -366,7 +367,7 @@ static int r300_fence_finish(struct pipe_screen *screen, return 0; /* 0 == success */ } -struct pipe_screen* r300_create_screen(struct r300_winsys_screen *rws) +struct pipe_screen* r300_screen_create(struct r300_winsys_screen *rws) { struct r300_screen *r300screen = CALLOC_STRUCT(r300_screen); diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h index 6ce218923b1..8a8888d4813 100644 --- a/src/gallium/drivers/r300/r300_winsys.h +++ b/src/gallium/drivers/r300/r300_winsys.h @@ -180,7 +180,4 @@ struct r300_winsys_screen { struct r300_winsys_screen * r300_winsys_screen(struct pipe_screen *screen); -/* Creates a new r300 screen. */ -struct pipe_screen* r300_create_screen(struct r300_winsys_screen *rws); - #endif /* R300_WINSYS_H */ diff --git a/src/gallium/targets/dri-radeong/target.c b/src/gallium/targets/dri-radeong/target.c index 06b64820cf8..2c1beb633ef 100644 --- a/src/gallium/targets/dri-radeong/target.c +++ b/src/gallium/targets/dri-radeong/target.c @@ -1,4 +1,17 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "radeon/drm/radeon_drm_public.h" +#include "r300/r300_public.h" -DRM_API_COMPAT_STRUCT("radeon", "radeon") +static struct pipe_screen * +create_screen(int fd) +{ + struct r300_winsys_screen *sws; + sws = r300_drm_winsys_screen_create(fd); + if (!sws) + return NULL; + + return r300_screen_create(sws); +} + +DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen) diff --git a/src/gallium/targets/egl-radeon/target.c b/src/gallium/targets/egl-radeon/target.c index 03b982ae831..5117eb86f9f 100644 --- a/src/gallium/targets/egl-radeon/target.c +++ b/src/gallium/targets/egl-radeon/target.c @@ -1,7 +1,20 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "radeon/drm/radeon_drm_public.h" +#include "r300/r300_public.h" -DRM_API_COMPAT_STRUCT("radeon", "radeon") +static struct pipe_screen * +create_screen(int fd) +{ + struct r300_winsys_screen *sws; + sws = r300_drm_winsys_screen_create(fd); + if (!sws) + return NULL; + + return r300_screen_create(sws); +} + +DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen) /* A poor man's --whole-archive for EGL drivers */ void *_eglMain(void *); diff --git a/src/gallium/targets/xorg-radeon/radeon_target.c b/src/gallium/targets/xorg-radeon/radeon_target.c index 06b64820cf8..2c1beb633ef 100644 --- a/src/gallium/targets/xorg-radeon/radeon_target.c +++ b/src/gallium/targets/xorg-radeon/radeon_target.c @@ -1,4 +1,17 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "radeon/drm/radeon_drm_public.h" +#include "r300/r300_public.h" -DRM_API_COMPAT_STRUCT("radeon", "radeon") +static struct pipe_screen * +create_screen(int fd) +{ + struct r300_winsys_screen *sws; + sws = r300_drm_winsys_screen_create(fd); + if (!sws) + return NULL; + + return r300_screen_create(sws); +} + +DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen) diff --git a/src/gallium/winsys/radeon/drm/radeon_drm.c b/src/gallium/winsys/radeon/drm/radeon_drm.c index 59f1b10230e..e9a276362f3 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm.c @@ -32,9 +32,9 @@ #include "radeon_drm.h" #include "radeon_r300.h" #include "radeon_buffer.h" +#include "radeon_drm_public.h" #include "r300_winsys.h" -#include "trace/tr_drm.h" #include "util/u_memory.h" @@ -153,7 +153,7 @@ static void do_ioctls(int fd, struct radeon_libdrm_winsys* winsys) } /* Create a pipe_screen. */ -struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB) +struct r300_winsys_screen* r300_drm_winsys_screen_create(int drmFB) { struct radeon_libdrm_winsys* rws; boolean ret; @@ -171,22 +171,10 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB) ret = radeon_setup_winsys(drmFB, rws); if (ret == FALSE) goto fail; - return r300_create_screen(&rws->base); + return &rws->base; } fail: FREE(rws); return NULL; } - -static struct drm_api radeon_drm_api_hooks = { - .name = "radeon", - .driver_name = "radeon", - .create_screen = radeon_create_screen, - .destroy = NULL, -}; - -struct drm_api* drm_api_create() -{ - return trace_drm_create(&radeon_drm_api_hooks); -} diff --git a/src/gallium/winsys/radeon/drm/radeon_drm.h b/src/gallium/winsys/radeon/drm/radeon_drm.h index 3544c926d99..df6dd91ad54 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm.h +++ b/src/gallium/winsys/radeon/drm/radeon_drm.h @@ -30,12 +30,7 @@ #ifndef RADEON_DRM_H #define RADEON_DRM_H -#include "state_tracker/drm_api.h" - - -struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB); - -void radeon_destroy_drm_api(struct drm_api* api); +#include "state_tracker/drm_driver.h" /* Guess at whether this chipset should use r300g. * diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_public.h b/src/gallium/winsys/radeon/drm/radeon_drm_public.h new file mode 100644 index 00000000000..0d96ae8c470 --- /dev/null +++ b/src/gallium/winsys/radeon/drm/radeon_drm_public.h @@ -0,0 +1,9 @@ + +#ifndef RADEON_DRM_PUBLIC_H +#define RADEON_DRM_PUBLIC_H + +struct r300_winsys_screen; + +struct r300_winsys_screen *r300_drm_winsys_screen_create(int drmFD); + +#endif diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c index 70ae01a694b..a9b36578ef8 100644 --- a/src/gallium/winsys/radeon/drm/radeon_r300.c +++ b/src/gallium/winsys/radeon/drm/radeon_r300.c @@ -25,7 +25,7 @@ #include "radeon_bo_gem.h" #include "radeon_cs_gem.h" -#include "state_tracker/drm_api.h" +#include "state_tracker/drm_driver.h" static struct r300_winsys_buffer * radeon_r300_winsys_buffer_create(struct r300_winsys_screen *rws, -- cgit v1.2.3 From 0ee7a17d0ca14ddbf4ef48da764627851eca048c Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 14 Jun 2010 17:37:21 +0200 Subject: swrastg: Fix glue file --- src/gallium/targets/egl-swrast/swrast_glue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gallium/targets') diff --git a/src/gallium/targets/egl-swrast/swrast_glue.c b/src/gallium/targets/egl-swrast/swrast_glue.c index 3c29be83a7c..24f77826d4c 100644 --- a/src/gallium/targets/egl-swrast/swrast_glue.c +++ b/src/gallium/targets/egl-swrast/swrast_glue.c @@ -2,9 +2,9 @@ #include "state_tracker/drm_driver.h" struct drm_driver_descriptor drm_driver = { - .name = "swrast"; - .driver_name = NULL; - .create_screen = NULL; + .name = "swrast", + .driver_name = NULL, + .create_screen = NULL, }; /* A poor man's --whole-archive for EGL drivers */ -- cgit v1.2.3 From 41e0f6bc2f943a05766872d419e4398ddd37b42a Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 18 Jun 2010 19:07:26 +0200 Subject: i965g: Move bootstrap code to targets --- src/gallium/drivers/i965/brw_public.h | 13 ++++++++++ src/gallium/drivers/i965/brw_screen.c | 3 ++- src/gallium/drivers/i965/brw_winsys.h | 6 ----- src/gallium/targets/dri-i965/Makefile | 5 ++-- src/gallium/targets/dri-i965/SConscript | 2 ++ src/gallium/targets/dri-i965/target.c | 27 ++++++++++++++++++-- src/gallium/targets/egl-i965/Makefile | 4 ++- src/gallium/targets/egl-i965/target.c | 27 ++++++++++++++++++-- src/gallium/targets/xorg-i965/Makefile | 3 ++- src/gallium/targets/xorg-i965/intel_target.c | 27 ++++++++++++++++++-- src/gallium/winsys/i965/drm/i965_drm_public.h | 9 +++++++ src/gallium/winsys/i965/drm/i965_drm_winsys.c | 36 +++------------------------ src/gallium/winsys/i965/drm/i965_drm_winsys.h | 2 -- 13 files changed, 113 insertions(+), 51 deletions(-) create mode 100644 src/gallium/drivers/i965/brw_public.h create mode 100644 src/gallium/winsys/i965/drm/i965_drm_public.h (limited to 'src/gallium/targets') diff --git a/src/gallium/drivers/i965/brw_public.h b/src/gallium/drivers/i965/brw_public.h new file mode 100644 index 00000000000..be2cd6b5c4d --- /dev/null +++ b/src/gallium/drivers/i965/brw_public.h @@ -0,0 +1,13 @@ + +#ifndef BRW_PUBLIC_H +#define BRW_PUBLIC_H + +struct brw_winsys_screen; +struct pipe_screen; + +/** + * Create brw AKA i965 pipe_screen. + */ +struct pipe_screen * brw_screen_create(struct brw_winsys_screen *bws); + +#endif diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c index eb75427eb42..bdfead73cc8 100644 --- a/src/gallium/drivers/i965/brw_screen.c +++ b/src/gallium/drivers/i965/brw_screen.c @@ -34,6 +34,7 @@ #include "brw_context.h" #include "brw_screen.h" #include "brw_winsys.h" +#include "brw_public.h" #include "brw_debug.h" #include "brw_resource.h" @@ -350,7 +351,7 @@ brw_destroy_screen(struct pipe_screen *screen) * Create a new brw_screen object */ struct pipe_screen * -brw_create_screen(struct brw_winsys_screen *sws) +brw_screen_create(struct brw_winsys_screen *sws) { struct brw_screen *bscreen; struct brw_chipset chipset; diff --git a/src/gallium/drivers/i965/brw_winsys.h b/src/gallium/drivers/i965/brw_winsys.h index adb0006c382..a06f8bb7d61 100644 --- a/src/gallium/drivers/i965/brw_winsys.h +++ b/src/gallium/drivers/i965/brw_winsys.h @@ -262,12 +262,6 @@ bo_reference(struct brw_winsys_buffer **ptr, struct brw_winsys_buffer *buf) } -/** - * Create brw pipe_screen. - */ -struct pipe_screen *brw_create_screen(struct brw_winsys_screen *iws); - - /************************************************************************* * Cooperative dumping between winsys and driver. TODO: make this diff --git a/src/gallium/targets/dri-i965/Makefile b/src/gallium/targets/dri-i965/Makefile index b068430ecf7..76350caf9d7 100644 --- a/src/gallium/targets/dri-i965/Makefile +++ b/src/gallium/targets/dri-i965/Makefile @@ -8,10 +8,8 @@ PIPE_DRIVERS = \ $(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/winsys/sw/drm/libswdrm.a \ $(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a \ $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ - $(TOP)/src/gallium/drivers/identity/libidentity.a \ $(TOP)/src/gallium/drivers/i965/libi965.a C_SOURCES = \ @@ -19,6 +17,9 @@ C_SOURCES = \ $(COMMON_GALLIUM_SOURCES) \ $(DRIVER_SOURCES) +DRIVER_DEFINES = \ + -DGALLIUM_SOFTPIPE + include ../Makefile.dri DRI_LIB_DEPS += -ldrm_intel diff --git a/src/gallium/targets/dri-i965/SConscript b/src/gallium/targets/dri-i965/SConscript index 9e12c61aabc..da1a8654a86 100644 --- a/src/gallium/targets/dri-i965/SConscript +++ b/src/gallium/targets/dri-i965/SConscript @@ -8,6 +8,8 @@ env = drienv.Clone() env.ParseConfig('pkg-config --cflags --libs libdrm_intel') +env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE') + env.Prepend(LIBS = [ st_dri, i965drm, diff --git a/src/gallium/targets/dri-i965/target.c b/src/gallium/targets/dri-i965/target.c index 9fe2227edd7..36424c60a11 100644 --- a/src/gallium/targets/dri-i965/target.c +++ b/src/gallium/targets/dri-i965/target.c @@ -1,4 +1,27 @@ -#include "target-helpers/drm_api_compat.h" +#include "target-helpers/inline_wrapper_sw_helper.h" +#include "state_tracker/drm_driver.h" +#include "i965/drm/i965_drm_public.h" +#include "i965/brw_public.h" -DRM_API_COMPAT_STRUCT("i965", "i915") +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); + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("i915", "i965", create_screen) diff --git a/src/gallium/targets/egl-i965/Makefile b/src/gallium/targets/egl-i965/Makefile index 542200481d1..fe3091190c1 100644 --- a/src/gallium/targets/egl-i965/Makefile +++ b/src/gallium/targets/egl-i965/Makefile @@ -5,12 +5,14 @@ EGL_DRIVER_NAME = i965 EGL_DRIVER_SOURCES = target.c EGL_DRIVER_LIBS = -ldrm_intel +EGL_DRIVER_DEFINES = \ + -DGALLIUM_SOFTPIPE + 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/drm/libswdrm.a \ $(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a \ $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a diff --git a/src/gallium/targets/egl-i965/target.c b/src/gallium/targets/egl-i965/target.c index 2f97bcecf2e..ba1eeadd214 100644 --- a/src/gallium/targets/egl-i965/target.c +++ b/src/gallium/targets/egl-i965/target.c @@ -1,7 +1,30 @@ -#include "target-helpers/drm_api_compat.h" +#include "target-helpers/inline_wrapper_sw_helper.h" +#include "state_tracker/drm_driver.h" +#include "i965/drm/i965_drm_public.h" +#include "i965/brw_public.h" -DRM_API_COMPAT_STRUCT("i965", "i915") +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); + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("i915", "i965", create_screen) /* A poor man's --whole-archive for EGL drivers */ void *_eglMain(void *); diff --git a/src/gallium/targets/xorg-i965/Makefile b/src/gallium/targets/xorg-i965/Makefile index b23a2deab99..eede9f23254 100644 --- a/src/gallium/targets/xorg-i965/Makefile +++ b/src/gallium/targets/xorg-i965/Makefile @@ -8,7 +8,7 @@ C_SOURCES = \ intel_xorg.c DRIVER_DEFINES = \ - -DHAVE_CONFIG_H + -DHAVE_CONFIG_H -DGALLIUM_SOFTPIPE DRIVER_LINKS = \ $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \ @@ -16,6 +16,7 @@ DRIVER_LINKS = \ $(TOP)/src/gallium/drivers/i965/libi965.a \ $(TOP)/src/gallium/drivers/trace/libtrace.a \ $(TOP)/src/gallium/drivers/rbug/librbug.a \ + $(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a \ $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ $(GALLIUM_AUXILIARIES) \ $(shell pkg-config --libs libdrm libdrm_intel) diff --git a/src/gallium/targets/xorg-i965/intel_target.c b/src/gallium/targets/xorg-i965/intel_target.c index 2b0f5458771..36424c60a11 100644 --- a/src/gallium/targets/xorg-i965/intel_target.c +++ b/src/gallium/targets/xorg-i965/intel_target.c @@ -1,4 +1,27 @@ -#include "target-helpers/drm_api_compat.h" +#include "target-helpers/inline_wrapper_sw_helper.h" +#include "state_tracker/drm_driver.h" +#include "i965/drm/i965_drm_public.h" +#include "i965/brw_public.h" -DRM_API_COMPAT_STRUCT("i965g", "i915") +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); + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("i915", "i965", create_screen) diff --git a/src/gallium/winsys/i965/drm/i965_drm_public.h b/src/gallium/winsys/i965/drm/i965_drm_public.h new file mode 100644 index 00000000000..2913b079747 --- /dev/null +++ b/src/gallium/winsys/i965/drm/i965_drm_public.h @@ -0,0 +1,9 @@ + +#ifndef I965_DRM_PUBLIC_H +#define I965_DRM_PUBLIC_H + +struct brw_winsys_screen; + +struct brw_winsys_screen * i965_drm_winsys_screen_create(int drmFD); + +#endif diff --git a/src/gallium/winsys/i965/drm/i965_drm_winsys.c b/src/gallium/winsys/i965/drm/i965_drm_winsys.c index 124dc26606b..dfb36604395 100644 --- a/src/gallium/winsys/i965/drm/i965_drm_winsys.c +++ b/src/gallium/winsys/i965/drm/i965_drm_winsys.c @@ -3,15 +3,9 @@ #include "state_tracker/drm_api.h" #include "i965_drm_winsys.h" +#include "i965_drm_public.h" #include "util/u_memory.h" -#include "i965/brw_context.h" /* XXX: shouldn't be doing this */ -#include "i965/brw_screen.h" /* XXX: shouldn't be doing this */ - -#include "trace/tr_drm.h" - -#include "../../sw/drm/sw_drm_api.h" - /* * Helper functions */ @@ -52,8 +46,8 @@ i965_libdrm_winsys_destroy(struct brw_winsys_screen *iws) FREE(idws); } -static struct pipe_screen * -i965_libdrm_create_screen(struct drm_api *api, int drmFD) +struct brw_winsys_screen * +i965_drm_winsys_screen_create(int drmFD) { struct i965_libdrm_winsys *idws; @@ -76,27 +70,5 @@ i965_libdrm_create_screen(struct drm_api *api, int drmFD) idws->send_cmd = !debug_get_bool_option("BRW_NO_HW", FALSE); - return brw_create_screen(&idws->base); -} - -struct drm_api i965_libdrm_api = -{ - .name = "i965", - .driver_name = "i915", - .create_screen = i965_libdrm_create_screen, - .destroy = NULL, -}; - -struct drm_api * -drm_api_create() -{ - struct drm_api *api = NULL; - - if (api == NULL && debug_get_bool_option("BRW_SOFTPIPE", FALSE)) - api = sw_drm_api_create(&i965_libdrm_api); - - if (api == NULL) - api = &i965_libdrm_api; - - return trace_drm_create(api); + return &idws->base; } diff --git a/src/gallium/winsys/i965/drm/i965_drm_winsys.h b/src/gallium/winsys/i965/drm/i965_drm_winsys.h index 3856e1c87f0..82dbe61cc51 100644 --- a/src/gallium/winsys/i965/drm/i965_drm_winsys.h +++ b/src/gallium/winsys/i965/drm/i965_drm_winsys.h @@ -30,8 +30,6 @@ i965_libdrm_winsys(struct brw_winsys_screen *iws) return (struct i965_libdrm_winsys *)iws; } -struct i965_libdrm_winsys *i965_libdrm_winsys_create(int fd, unsigned pci_id); - void i965_libdrm_winsys_init_buffer_functions(struct i965_libdrm_winsys *idws); -- cgit v1.2.3 From cf91accc93b9f172b2f7c970f39e69b268a5bb26 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 23 Jun 2010 23:03:28 +0200 Subject: nouveau: Move bootstrap code to targets Well sorta, at least I removed the drm_api dependancy and the target can layer anything it wants to now. --- src/gallium/targets/dri-nouveau/target.c | 17 +++++++++++++++-- src/gallium/targets/egl-nouveau/target.c | 17 +++++++++++++++-- src/gallium/targets/xorg-nouveau/nouveau_target.c | 17 +++++++++++++++-- src/gallium/winsys/nouveau/drm/nouveau_drm_public.h | 9 +++++++++ src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c | 18 +++--------------- src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.h | 2 -- 6 files changed, 57 insertions(+), 23 deletions(-) create mode 100644 src/gallium/winsys/nouveau/drm/nouveau_drm_public.h (limited to 'src/gallium/targets') diff --git a/src/gallium/targets/dri-nouveau/target.c b/src/gallium/targets/dri-nouveau/target.c index e16e86cd3d8..ca3ec53029a 100644 --- a/src/gallium/targets/dri-nouveau/target.c +++ b/src/gallium/targets/dri-nouveau/target.c @@ -1,4 +1,17 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "nouveau/drm/nouveau_drm_public.h" -DRM_API_COMPAT_STRUCT("nouveau", "nouveau") +static struct pipe_screen * +create_screen(int fd) +{ + struct pipe_screen *screen; + + screen = nouveau_drm_screen_create(fd); + if (!screen) + return NULL; + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen) diff --git a/src/gallium/targets/egl-nouveau/target.c b/src/gallium/targets/egl-nouveau/target.c index 49545c63e11..7d0b141e5a2 100644 --- a/src/gallium/targets/egl-nouveau/target.c +++ b/src/gallium/targets/egl-nouveau/target.c @@ -1,7 +1,20 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "nouveau/drm/nouveau_drm_public.h" -DRM_API_COMPAT_STRUCT("nouveau", "nouveau") +static struct pipe_screen * +create_screen(int fd) +{ + struct pipe_screen *screen; + + screen = nouveau_drm_screen_create(fd); + if (!screen) + return NULL; + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen) /* A poor man's --whole-archive for EGL drivers */ void *_eglMain(void *); diff --git a/src/gallium/targets/xorg-nouveau/nouveau_target.c b/src/gallium/targets/xorg-nouveau/nouveau_target.c index e16e86cd3d8..ca3ec53029a 100644 --- a/src/gallium/targets/xorg-nouveau/nouveau_target.c +++ b/src/gallium/targets/xorg-nouveau/nouveau_target.c @@ -1,4 +1,17 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "nouveau/drm/nouveau_drm_public.h" -DRM_API_COMPAT_STRUCT("nouveau", "nouveau") +static struct pipe_screen * +create_screen(int fd) +{ + struct pipe_screen *screen; + + screen = nouveau_drm_screen_create(fd); + if (!screen) + return NULL; + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen) diff --git a/src/gallium/winsys/nouveau/drm/nouveau_drm_public.h b/src/gallium/winsys/nouveau/drm/nouveau_drm_public.h new file mode 100644 index 00000000000..67b7c4429df --- /dev/null +++ b/src/gallium/winsys/nouveau/drm/nouveau_drm_public.h @@ -0,0 +1,9 @@ + +#ifndef __NOUVEAU_DRM_PUBLIC_H__ +#define __NOUVEAU_DRM_PUBLIC_H__ + +struct pipe_screen; + +struct pipe_screen *nouveau_drm_screen_create(int drmFD); + +#endif diff --git a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c index 418f1d708a7..660dbd0c332 100644 --- a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c +++ b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c @@ -5,6 +5,7 @@ #include "util/u_inlines.h" #include "nouveau_drm_winsys.h" +#include "nouveau_drm_public.h" #include "nouveau_drmif.h" #include "nouveau_channel.h" @@ -22,8 +23,8 @@ nouveau_drm_destroy_winsys(struct pipe_winsys *s) FREE(nv_winsys); } -static struct pipe_screen * -nouveau_drm_create_screen(struct drm_api *api, int fd) +struct pipe_screen * +nouveau_drm_screen_create(int fd) { struct nouveau_winsys *nvws; struct pipe_winsys *ws; @@ -70,16 +71,3 @@ nouveau_drm_create_screen(struct drm_api *api, int fd) return nvws->pscreen; } - -static struct drm_api nouveau_drm_api_hooks = { - .name = "nouveau", - .driver_name = "nouveau", - .create_screen = nouveau_drm_create_screen, - .destroy = NULL, -}; - -struct drm_api * -drm_api_create() { - return &nouveau_drm_api_hooks; -} - diff --git a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.h b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.h index ae3ab17d743..9e529ecad3d 100644 --- a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.h +++ b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.h @@ -1,8 +1,6 @@ #ifndef __NOUVEAU_DRM_WINSYS_H__ #define __NOUVEAU_DRM_WINSYS_H__ -#include "state_tracker/drm_api.h" - #include "util/u_simple_screen.h" #include "nouveau_dri.h" -- cgit v1.2.3 From 92fde20de33d9ffb4ddce9b03eebbfbffe9d93bc Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 24 Jun 2010 02:10:18 +0200 Subject: r600g: Move bootstrap code to target --- src/gallium/drivers/r600/r600_buffer.c | 2 +- src/gallium/drivers/r600/r600_public.h | 9 +++++++ src/gallium/drivers/r600/r600_screen.c | 3 ++- src/gallium/drivers/r600/r600_texture.c | 2 +- src/gallium/drivers/r600/radeon.h | 2 -- src/gallium/targets/dri-r600/target.c | 23 ++++++++++++++++-- src/gallium/winsys/r600/drm/r600_drm.c | 34 ++++----------------------- src/gallium/winsys/r600/drm/r600_drm_public.h | 9 +++++++ 8 files changed, 48 insertions(+), 36 deletions(-) create mode 100644 src/gallium/drivers/r600/r600_public.h create mode 100644 src/gallium/winsys/r600/drm/r600_drm_public.h (limited to 'src/gallium/targets') diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c index 272f4dd6730..bc6e336ba7b 100644 --- a/src/gallium/drivers/r600/r600_buffer.c +++ b/src/gallium/drivers/r600/r600_buffer.c @@ -29,7 +29,7 @@ #include #include #include -#include "state_tracker/drm_api.h" +#include "state_tracker/drm_driver.h" #include "r600_screen.h" #include "r600_context.h" diff --git a/src/gallium/drivers/r600/r600_public.h b/src/gallium/drivers/r600/r600_public.h new file mode 100644 index 00000000000..1d89c9f9f61 --- /dev/null +++ b/src/gallium/drivers/r600/r600_public.h @@ -0,0 +1,9 @@ + +#ifndef R600_PUBLIC_H +#define R600_PUBLIC_H + +struct radeon; + +struct pipe_screen* r600_screen_create(struct radeon *rw); + +#endif diff --git a/src/gallium/drivers/r600/r600_screen.c b/src/gallium/drivers/r600/r600_screen.c index 1d83383fd95..20758b049c5 100644 --- a/src/gallium/drivers/r600/r600_screen.c +++ b/src/gallium/drivers/r600/r600_screen.c @@ -31,6 +31,7 @@ #include "r600_screen.h" #include "r600_texture.h" #include "r600_context.h" +#include "r600_public.h" #include static const char* r600_get_vendor(struct pipe_screen* pscreen) @@ -240,7 +241,7 @@ static void r600_destroy_screen(struct pipe_screen* pscreen) FREE(rscreen); } -struct pipe_screen *radeon_create_screen(struct radeon *rw) +struct pipe_screen *r600_screen_create(struct radeon *rw) { struct r600_screen* rscreen; diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 7d94bbe510f..903cfad80a8 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -29,7 +29,7 @@ #include #include #include -#include "state_tracker/drm_api.h" +#include "state_tracker/drm_driver.h" #include "r600_screen.h" #include "r600_texture.h" diff --git a/src/gallium/drivers/r600/radeon.h b/src/gallium/drivers/r600/radeon.h index ec94b112d69..2a82aadd8ce 100644 --- a/src/gallium/drivers/r600/radeon.h +++ b/src/gallium/drivers/r600/radeon.h @@ -28,8 +28,6 @@ typedef uint8_t u8; struct radeon; -struct pipe_screen *radeon_create_screen(struct radeon *rw); - enum radeon_family { CHIP_UNKNOWN, CHIP_R100, diff --git a/src/gallium/targets/dri-r600/target.c b/src/gallium/targets/dri-r600/target.c index 3f09a7c5a92..40ad8a09ca8 100644 --- a/src/gallium/targets/dri-r600/target.c +++ b/src/gallium/targets/dri-r600/target.c @@ -1,4 +1,23 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "r600/drm/r600_drm_public.h" +#include "r600/r600_public.h" -DRM_API_COMPAT_STRUCT("r600", "radeon") +static struct pipe_screen * +create_screen(int fd) +{ + struct radeon *rw; + struct pipe_screen *screen; + + rw = r600_drm_winsys_create(fd); + if (!rw) + return NULL; + + screen = r600_screen_create(rw); + if (!screen) + return NULL; + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen) diff --git a/src/gallium/winsys/r600/drm/r600_drm.c b/src/gallium/winsys/r600/drm/r600_drm.c index b772ff0dd9f..469f1446d05 100644 --- a/src/gallium/winsys/r600/drm/r600_drm.c +++ b/src/gallium/winsys/r600/drm/r600_drm.c @@ -26,21 +26,18 @@ * Joakim Sindholt */ #include -#include "trace/tr_drm.h" #include "util/u_inlines.h" #include "util/u_debug.h" -#include "state_tracker/drm_api.h" #include "radeon_priv.h" #include "r600_screen.h" #include "r600_texture.h" +#include "r600_public.h" +#include "r600_drm_public.h" +#include "state_tracker/drm_driver.h" -static struct pipe_screen *r600_drm_create_screen(struct drm_api* api, int drmfd) +struct radeon *r600_drm_winsys_create(int drmfd) { - struct radeon *rw = radeon_new(drmfd, 0); - - if (rw == NULL) - return NULL; - return radeon_create_screen(rw); + return radeon_new(drmfd, 0); } boolean r600_buffer_get_handle(struct radeon *rw, @@ -63,24 +60,3 @@ boolean r600_buffer_get_handle(struct radeon *rw, whandle->handle = rbuffer->flink; return TRUE; } - -static void r600_drm_api_destroy(struct drm_api *api) -{ - return; -} - -struct drm_api drm_api_hooks = { - .name = "r600", - .driver_name = "r600", - .create_screen = r600_drm_create_screen, - .destroy = r600_drm_api_destroy, -}; - -struct drm_api* drm_api_create() -{ -#ifdef DEBUG - return trace_drm_create(&drm_api_hooks); -#else - return &drm_api_hooks; -#endif -} diff --git a/src/gallium/winsys/r600/drm/r600_drm_public.h b/src/gallium/winsys/r600/drm/r600_drm_public.h new file mode 100644 index 00000000000..84f2dce437a --- /dev/null +++ b/src/gallium/winsys/r600/drm/r600_drm_public.h @@ -0,0 +1,9 @@ + +#ifndef R600_DRM_PUBLIC_H +#define R600_DRM_PUBLIC_H + +struct radeon; + +struct radeon *r600_drm_winsys_create(int drmFD); + +#endif -- cgit v1.2.3 From e47d32d721a76b5df3b640ccdc9bad15dffb8450 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 23 Jun 2010 23:14:22 +0200 Subject: gallium: Remove drm_api and all references to it --- .../auxiliary/target-helpers/drm_api_compat.h | 46 ---------- src/gallium/drivers/identity/Makefile | 3 +- src/gallium/drivers/identity/SConscript | 1 - src/gallium/drivers/identity/id_drm.c | 93 ------------------- src/gallium/drivers/identity/id_drm.h | 35 ------- src/gallium/drivers/trace/Makefile | 1 - src/gallium/drivers/trace/SConscript | 1 - src/gallium/drivers/trace/tr_drm.c | 101 --------------------- src/gallium/drivers/trace/tr_drm.h | 35 ------- src/gallium/include/state_tracker/drm_api.h | 57 ------------ src/gallium/targets/dri-swrast/swrast_drm_api.c | 1 - 11 files changed, 1 insertion(+), 373 deletions(-) delete mode 100644 src/gallium/auxiliary/target-helpers/drm_api_compat.h delete mode 100644 src/gallium/drivers/identity/id_drm.c delete mode 100644 src/gallium/drivers/identity/id_drm.h delete mode 100644 src/gallium/drivers/trace/tr_drm.c delete mode 100644 src/gallium/drivers/trace/tr_drm.h delete mode 100644 src/gallium/include/state_tracker/drm_api.h (limited to 'src/gallium/targets') diff --git a/src/gallium/auxiliary/target-helpers/drm_api_compat.h b/src/gallium/auxiliary/target-helpers/drm_api_compat.h deleted file mode 100644 index 324c6f2ba94..00000000000 --- a/src/gallium/auxiliary/target-helpers/drm_api_compat.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file contain a small backwards compatible shim between - * the old depricated drm_api and the drm_driver interface. - */ - -#ifndef DRM_API_COMPAT_H -#define DRM_API_COMPAT_H - -#ifdef _DRM_API_H_ -#error "Included drm_api.h before drm_api_compat.h" -#endif - -#include "state_tracker/drm_driver.h" - -/* - * XXX Hack, can't include both drm_api and drm_driver. Due to name - * collition of winsys_handle, just use a define to rename it. - */ -#define winsys_handle HACK_winsys_handle -#include "state_tracker/drm_api.h" -#undef winsys_handle - -static INLINE struct pipe_screen * -drm_api_compat_create_screen(int fd) -{ - static struct drm_api *api; - if (!api) - api = drm_api_create(); - - if (!api) - return NULL; - - return api->create_screen(api, fd); -} - -/** - * Instanciate a drm_driver descriptor. - */ -#define DRM_API_COMPAT_STRUCT(name_str, driver_name_str) \ -struct drm_driver_descriptor driver_descriptor = { \ - .name = name_str, \ - .driver_name = driver_name_str, \ - .create_screen = drm_api_compat_create_screen, \ -}; - -#endif diff --git a/src/gallium/drivers/identity/Makefile b/src/gallium/drivers/identity/Makefile index e32b9102e59..74692d97610 100644 --- a/src/gallium/drivers/identity/Makefile +++ b/src/gallium/drivers/identity/Makefile @@ -6,7 +6,6 @@ LIBNAME = identity C_SOURCES = \ id_objects.c \ id_context.c \ - id_screen.c \ - id_drm.c + id_screen.c include ../../Makefile.template diff --git a/src/gallium/drivers/identity/SConscript b/src/gallium/drivers/identity/SConscript index 2a68891c284..b364e0acc84 100644 --- a/src/gallium/drivers/identity/SConscript +++ b/src/gallium/drivers/identity/SConscript @@ -6,7 +6,6 @@ identity = env.ConvenienceLibrary( target = 'identity', source = [ 'id_context.c', - 'id_drm.c', 'id_objects.c', 'id_screen.c', ]) diff --git a/src/gallium/drivers/identity/id_drm.c b/src/gallium/drivers/identity/id_drm.c deleted file mode 100644 index 15d01519f80..00000000000 --- a/src/gallium/drivers/identity/id_drm.c +++ /dev/null @@ -1,93 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 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, sub license, 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 (including the - * next paragraph) 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 NON-INFRINGEMENT. - * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#include "state_tracker/drm_api.h" - -#include "util/u_memory.h" -#include "id_drm.h" -#include "id_screen.h" -#include "id_public.h" - -struct identity_drm_api -{ - struct drm_api base; - - struct drm_api *api; -}; - -static INLINE struct identity_drm_api * -identity_drm_api(struct drm_api *_api) -{ - return (struct identity_drm_api *)_api; -} - -static struct pipe_screen * -identity_drm_create_screen(struct drm_api *_api, int fd) -{ - struct identity_drm_api *id_api = identity_drm_api(_api); - struct drm_api *api = id_api->api; - struct pipe_screen *screen; - - screen = api->create_screen(api, fd); - - return identity_screen_create(screen); -} - -static void -identity_drm_destroy(struct drm_api *_api) -{ - struct identity_drm_api *id_api = identity_drm_api(_api); - struct drm_api *api = id_api->api; - api->destroy(api); - - FREE(id_api); -} - -struct drm_api * -identity_drm_create(struct drm_api *api) -{ - struct identity_drm_api *id_api; - - if (!api) - goto error; - - id_api = CALLOC_STRUCT(identity_drm_api); - - if (!id_api) - goto error; - - id_api->base.name = api->name; - id_api->base.driver_name = api->driver_name; - id_api->base.create_screen = identity_drm_create_screen; - id_api->base.destroy = identity_drm_destroy; - id_api->api = api; - - return &id_api->base; - -error: - return api; -} diff --git a/src/gallium/drivers/identity/id_drm.h b/src/gallium/drivers/identity/id_drm.h deleted file mode 100644 index cf2ad2ce07f..00000000000 --- a/src/gallium/drivers/identity/id_drm.h +++ /dev/null @@ -1,35 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 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, sub license, 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 (including the - * next paragraph) 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 NON-INFRINGEMENT. - * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#ifndef ID_DRM_H -#define ID_DRM_H - -struct drm_api; - -struct drm_api* identity_drm_create(struct drm_api *api); - -#endif /* ID_DRM_H */ diff --git a/src/gallium/drivers/trace/Makefile b/src/gallium/drivers/trace/Makefile index 1b0c087a2a4..99e5fb81c22 100644 --- a/src/gallium/drivers/trace/Makefile +++ b/src/gallium/drivers/trace/Makefile @@ -8,7 +8,6 @@ C_SOURCES = \ tr_dump.c \ tr_dump_state.c \ tr_screen.c \ - tr_drm.c \ tr_texture.c include ../../Makefile.template diff --git a/src/gallium/drivers/trace/SConscript b/src/gallium/drivers/trace/SConscript index 0dc43a9ec41..06b0c4863a4 100644 --- a/src/gallium/drivers/trace/SConscript +++ b/src/gallium/drivers/trace/SConscript @@ -6,7 +6,6 @@ trace = env.ConvenienceLibrary( target = 'trace', source = [ 'tr_context.c', - 'tr_drm.c', 'tr_dump.c', 'tr_dump_state.c', 'tr_screen.c', diff --git a/src/gallium/drivers/trace/tr_drm.c b/src/gallium/drivers/trace/tr_drm.c deleted file mode 100644 index e6850332121..00000000000 --- a/src/gallium/drivers/trace/tr_drm.c +++ /dev/null @@ -1,101 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 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, sub license, 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 (including the - * next paragraph) 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 NON-INFRINGEMENT. - * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#include "state_tracker/drm_api.h" - -#include "util/u_memory.h" -#include "rbug/rbug_public.h" -#include "tr_drm.h" -#include "tr_screen.h" -#include "tr_public.h" - -struct trace_drm_api -{ - struct drm_api base; - - struct drm_api *api; -}; - -static INLINE struct trace_drm_api * -trace_drm_api(struct drm_api *_api) -{ - return (struct trace_drm_api *)_api; -} - -static struct pipe_screen * -trace_drm_create_screen(struct drm_api *_api, int fd) -{ - struct trace_drm_api *tr_api = trace_drm_api(_api); - struct drm_api *api = tr_api->api; - struct pipe_screen *screen; - - /* TODO trace call */ - - screen = api->create_screen(api, fd); - - return trace_screen_create(rbug_screen_create(screen)); -} - -static void -trace_drm_destroy(struct drm_api *_api) -{ - struct trace_drm_api *tr_api = trace_drm_api(_api); - struct drm_api *api = tr_api->api; - - if (api->destroy) - api->destroy(api); - - FREE(tr_api); -} - -struct drm_api * -trace_drm_create(struct drm_api *api) -{ - struct trace_drm_api *tr_api; - - if (!api) - goto error; - - if (!trace_enabled() && !rbug_enabled()) - goto error; - - tr_api = CALLOC_STRUCT(trace_drm_api); - - if (!tr_api) - goto error; - - tr_api->base.name = api->name; - tr_api->base.driver_name = api->driver_name; - tr_api->base.create_screen = trace_drm_create_screen; - tr_api->base.destroy = trace_drm_destroy; - tr_api->api = api; - - return &tr_api->base; - -error: - return api; -} diff --git a/src/gallium/drivers/trace/tr_drm.h b/src/gallium/drivers/trace/tr_drm.h deleted file mode 100644 index 845c66a32aa..00000000000 --- a/src/gallium/drivers/trace/tr_drm.h +++ /dev/null @@ -1,35 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 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, sub license, 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 (including the - * next paragraph) 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 NON-INFRINGEMENT. - * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#ifndef TR_DRM_H -#define TR_DRM_H - -struct drm_api; - -struct drm_api* trace_drm_create(struct drm_api *api); - -#endif /* ID_DRM_H */ diff --git a/src/gallium/include/state_tracker/drm_api.h b/src/gallium/include/state_tracker/drm_api.h deleted file mode 100644 index 4572c7e0423..00000000000 --- a/src/gallium/include/state_tracker/drm_api.h +++ /dev/null @@ -1,57 +0,0 @@ - -#ifndef _DRM_API_H_ -#define _DRM_API_H_ - -#include "pipe/p_compiler.h" - -struct pipe_screen; -struct pipe_winsys; -struct pipe_context; -struct pipe_resource; - -#define DRM_API_HANDLE_TYPE_SHARED 0 -#define DRM_API_HANDLE_TYPE_KMS 1 - -/** - * For use with pipe_screen::{texture_from_handle|texture_get_handle}. - */ -struct winsys_handle -{ - /** - * Unused for texture_from_handle, always - * DRM_API_HANDLE_TYPE_SHARED. Input to texture_get_handle, - * use TEXTURE_USAGE to select handle for kms or ipc. - */ - unsigned type; - /** - * Input to texture_from_handle. - * Output for texture_get_handle. - */ - unsigned handle; - /** - * Input to texture_from_handle. - * Output for texture_get_handle. - */ - unsigned stride; -}; - -struct drm_api -{ - void (*destroy)(struct drm_api *api); - - const char *name; - - /** - * Kernel driver name, as accepted by drmOpenByName. - */ - const char *driver_name; - - /** - * Create a pipe srcreen. - */ - struct pipe_screen* (*create_screen)(struct drm_api *api, int drm_fd); -}; - -extern struct drm_api * drm_api_create(void); - -#endif diff --git a/src/gallium/targets/dri-swrast/swrast_drm_api.c b/src/gallium/targets/dri-swrast/swrast_drm_api.c index 84142be80c8..ddf78406d53 100644 --- a/src/gallium/targets/dri-swrast/swrast_drm_api.c +++ b/src/gallium/targets/dri-swrast/swrast_drm_api.c @@ -28,7 +28,6 @@ #include "pipe/p_compiler.h" #include "util/u_memory.h" -#include "state_tracker/drm_api.h" #include "state_tracker/sw_winsys.h" #include "dri_sw_winsys.h" #include "trace/tr_public.h" -- cgit v1.2.3 From 59981d418f14f684c9e8d86358e7520abf34a7c9 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 23 Jun 2010 23:51:52 +0200 Subject: gallium: Fix scons build --- src/gallium/targets/SConscript.dri | 1 + src/gallium/winsys/SConscript | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/targets') diff --git a/src/gallium/targets/SConscript.dri b/src/gallium/targets/SConscript.dri index 74b53e5023f..e5981c2461e 100644 --- a/src/gallium/targets/SConscript.dri +++ b/src/gallium/targets/SConscript.dri @@ -13,6 +13,7 @@ drienv.Replace(CPPPATH = [ '#src/gallium/include', '#src/gallium/auxiliary', '#src/gallium/drivers', + '#src/gallium/winsys', '#src/mesa', '#src/mesa/main', '#src/mesa/glapi', diff --git a/src/gallium/winsys/SConscript b/src/gallium/winsys/SConscript index 907ac90bf04..65b12287df7 100644 --- a/src/gallium/winsys/SConscript +++ b/src/gallium/winsys/SConscript @@ -17,7 +17,6 @@ if 'gdi' in env['winsys']: if env['dri']: SConscript([ - 'sw/drm/SConscript', 'sw/dri/SConscript', ]) -- 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') 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 44c64596d17423dc560434dcbd209997d87b2a29 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 24 Jun 2010 00:44:53 +0200 Subject: swrastg: Use target-helpers --- src/gallium/targets/dri-swrast/Makefile | 4 +- src/gallium/targets/dri-swrast/SConscript | 6 ++- src/gallium/targets/dri-swrast/swrast_drm_api.c | 57 +++---------------------- 3 files changed, 13 insertions(+), 54 deletions(-) (limited to 'src/gallium/targets') diff --git a/src/gallium/targets/dri-swrast/Makefile b/src/gallium/targets/dri-swrast/Makefile index 0a53eb56c45..948c45abe5c 100644 --- a/src/gallium/targets/dri-swrast/Makefile +++ b/src/gallium/targets/dri-swrast/Makefile @@ -3,7 +3,9 @@ include $(TOP)/configs/current LIBNAME = swrastg_dri.so -DRIVER_DEFINES = -D__NOT_HAVE_DRM_H -DGALLIUM_SOFTPIPE +DRIVER_DEFINES = \ + -D__NOT_HAVE_DRM_H -DGALLIUM_SOFTPIPE \ + -DGALLIUM_RBUG -DGALLIUM_TRACE PIPE_DRIVERS = \ $(TOP)/src/gallium/state_trackers/dri/sw/libdrisw.a \ diff --git a/src/gallium/targets/dri-swrast/SConscript b/src/gallium/targets/dri-swrast/SConscript index 679afab41c7..d8143471194 100644 --- a/src/gallium/targets/dri-swrast/SConscript +++ b/src/gallium/targets/dri-swrast/SConscript @@ -18,7 +18,11 @@ env.Prepend(LIBS = [ ]) if True: - env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE') + env.Append(CPPDEFINES = [ + 'GALLIUM_SOFTPIPE', + 'GALLIUM_RBUG', + 'GALLIUM_TRACE', + ]) env.Prepend(LIBS = [softpipe]) if env['llvm']: diff --git a/src/gallium/targets/dri-swrast/swrast_drm_api.c b/src/gallium/targets/dri-swrast/swrast_drm_api.c index ddf78406d53..8d741c6343c 100644 --- a/src/gallium/targets/dri-swrast/swrast_drm_api.c +++ b/src/gallium/targets/dri-swrast/swrast_drm_api.c @@ -28,60 +28,11 @@ #include "pipe/p_compiler.h" #include "util/u_memory.h" -#include "state_tracker/sw_winsys.h" #include "dri_sw_winsys.h" -#include "trace/tr_public.h" -/* Copied from targets/libgl-xlib */ +#include "target-helpers/inline_debug_helper.h" +#include "target-helpers/inline_sw_helper.h" -#ifdef GALLIUM_SOFTPIPE -#include "softpipe/sp_public.h" -#endif - -#ifdef GALLIUM_LLVMPIPE -#include "llvmpipe/lp_public.h" -#endif - -#ifdef GALLIUM_CELL -#include "cell/ppu/cell_public.h" -#endif - -static struct pipe_screen * -swrast_create_screen(struct sw_winsys *winsys) -{ - const char *default_driver; - const char *driver; - struct pipe_screen *screen = NULL; - -#if defined(GALLIUM_CELL) - default_driver = "cell"; -#elif defined(GALLIUM_LLVMPIPE) - default_driver = "llvmpipe"; -#elif defined(GALLIUM_SOFTPIPE) - default_driver = "softpipe"; -#else - default_driver = ""; -#endif - - driver = debug_get_option("GALLIUM_DRIVER", default_driver); - -#if defined(GALLIUM_CELL) - if (screen == NULL && strcmp(driver, "cell") == 0) - screen = cell_create_screen( winsys ); -#endif - -#if defined(GALLIUM_LLVMPIPE) - if (screen == NULL && strcmp(driver, "llvmpipe") == 0) - screen = llvmpipe_create_screen( winsys ); -#endif - -#if defined(GALLIUM_SOFTPIPE) - if (screen == NULL) - screen = softpipe_create_screen( winsys ); -#endif - - return trace_screen_create(screen);; -} struct pipe_screen * drisw_create_screen(struct drisw_loader_funcs *lf) @@ -93,10 +44,12 @@ drisw_create_screen(struct drisw_loader_funcs *lf) if (winsys == NULL) return NULL; - screen = swrast_create_screen(winsys); + screen = sw_screen_create(winsys); if (!screen) goto fail; + screen = debug_screen_wrap(screen); + return screen; fail: -- cgit v1.2.3