summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/galahad/Makefile3
-rw-r--r--src/gallium/drivers/galahad/SConscript1
-rw-r--r--src/gallium/drivers/galahad/glhd_drm.c96
-rw-r--r--src/gallium/drivers/i915/i915_public.h13
-rw-r--r--src/gallium/drivers/i915/i915_screen.c1
-rw-r--r--src/gallium/drivers/i915/i915_winsys.h7
-rw-r--r--src/gallium/drivers/i965/brw_public.h13
-rw-r--r--src/gallium/drivers/i965/brw_screen.c9
-rw-r--r--src/gallium/drivers/i965/brw_winsys.h7
-rw-r--r--src/gallium/drivers/identity/Makefile3
-rw-r--r--src/gallium/drivers/identity/SConscript1
-rw-r--r--src/gallium/drivers/identity/id_drm.c93
-rw-r--r--src/gallium/drivers/identity/id_drm.h35
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.c2
-rw-r--r--src/gallium/drivers/r300/r300_public.h9
-rw-r--r--src/gallium/drivers/r300/r300_screen.c3
-rw-r--r--src/gallium/drivers/r300/r300_texture.c5
-rw-r--r--src/gallium/drivers/r300/r300_winsys.h3
-rw-r--r--src/gallium/drivers/r600/r600_buffer.c2
-rw-r--r--src/gallium/drivers/r600/r600_public.h9
-rw-r--r--src/gallium/drivers/r600/r600_screen.c3
-rw-r--r--src/gallium/drivers/r600/r600_texture.c2
-rw-r--r--src/gallium/drivers/r600/radeon.h2
-rw-r--r--src/gallium/drivers/svga/svga_public.h42
-rw-r--r--src/gallium/drivers/svga/svga_screen.c1
-rw-r--r--src/gallium/drivers/svga/svga_winsys.h3
-rw-r--r--src/gallium/drivers/trace/Makefile1
-rw-r--r--src/gallium/drivers/trace/SConscript1
-rw-r--r--src/gallium/drivers/trace/tr_drm.c101
-rw-r--r--src/gallium/drivers/trace/tr_drm.h35
30 files changed, 107 insertions, 399 deletions
diff --git a/src/gallium/drivers/galahad/Makefile b/src/gallium/drivers/galahad/Makefile
index 67d08745662..e9c4f7e28c8 100644
--- a/src/gallium/drivers/galahad/Makefile
+++ b/src/gallium/drivers/galahad/Makefile
@@ -6,7 +6,6 @@ LIBNAME = galahad
C_SOURCES = \
glhd_objects.c \
glhd_context.c \
- glhd_screen.c \
- glhd_drm.c
+ glhd_screen.c
include ../../Makefile.template
diff --git a/src/gallium/drivers/galahad/SConscript b/src/gallium/drivers/galahad/SConscript
index fc668facaf5..ca6213cfff1 100644
--- a/src/gallium/drivers/galahad/SConscript
+++ b/src/gallium/drivers/galahad/SConscript
@@ -6,7 +6,6 @@ identity = env.ConvenienceLibrary(
target = 'identity',
source = [
'glhd_context.c',
- 'glhd_drm.c',
'glhd_objects.c',
'glhd_screen.c',
])
diff --git a/src/gallium/drivers/galahad/glhd_drm.c b/src/gallium/drivers/galahad/glhd_drm.c
deleted file mode 100644
index d62f6f4f7bc..00000000000
--- a/src/gallium/drivers/galahad/glhd_drm.c
+++ /dev/null
@@ -1,96 +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 "glhd_drm.h"
-#include "glhd_screen.h"
-#include "glhd_public.h"
-
-struct galahad_drm_api
-{
- struct drm_api base;
-
- struct drm_api *api;
-};
-
-static INLINE struct galahad_drm_api *
-galahad_drm_api(struct drm_api *_api)
-{
- return (struct galahad_drm_api *)_api;
-}
-
-static struct pipe_screen *
-galahad_drm_create_screen(struct drm_api *_api, int fd)
-{
- struct galahad_drm_api *glhd_api = galahad_drm_api(_api);
- struct drm_api *api = glhd_api->api;
- struct pipe_screen *screen;
-
- screen = api->create_screen(api, fd);
-
- return galahad_screen_create(screen);
-}
-
-static void
-galahad_drm_destroy(struct drm_api *_api)
-{
- struct galahad_drm_api *glhd_api = galahad_drm_api(_api);
- struct drm_api *api = glhd_api->api;
- api->destroy(api);
-
- FREE(glhd_api);
-}
-
-struct drm_api *
-galahad_drm_create(struct drm_api *api)
-{
- struct galahad_drm_api *glhd_api;
-
- if (!api)
- goto error;
-
- if (!debug_get_option("GALAHAD", FALSE))
- goto error;
-
- glhd_api = CALLOC_STRUCT(galahad_drm_api);
-
- if (!glhd_api)
- goto error;
-
- glhd_api->base.name = api->name;
- glhd_api->base.driver_name = api->driver_name;
- glhd_api->base.create_screen = galahad_drm_create_screen;
- glhd_api->base.destroy = galahad_drm_destroy;
- glhd_api->api = api;
-
- return &glhd_api->base;
-
-error:
- return api;
-}
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 255538ebaa4..77345d5f711 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -37,6 +37,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/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 50a446db917..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, uint pci_id)
+brw_screen_create(struct brw_winsys_screen *sws)
{
struct brw_screen *bscreen;
struct brw_chipset chipset;
@@ -365,9 +366,9 @@ brw_create_screen(struct brw_winsys_screen *sws, uint pci_id)
memset(&chipset, 0, sizeof chipset);
- chipset.pci_id = pci_id;
+ chipset.pci_id = sws->pci_id;
- switch (pci_id) {
+ switch (chipset.pci_id) {
case PCI_CHIP_I965_G:
case PCI_CHIP_I965_Q:
case PCI_CHIP_I965_G_1:
@@ -393,7 +394,7 @@ brw_create_screen(struct brw_winsys_screen *sws, uint pci_id)
default:
debug_printf("%s: unknown pci id 0x%x, cannot create screen\n",
- __FUNCTION__, pci_id);
+ __FUNCTION__, chipset.pci_id);
return NULL;
}
diff --git a/src/gallium/drivers/i965/brw_winsys.h b/src/gallium/drivers/i965/brw_winsys.h
index f30c7f18132..a06f8bb7d61 100644
--- a/src/gallium/drivers/i965/brw_winsys.h
+++ b/src/gallium/drivers/i965/brw_winsys.h
@@ -147,6 +147,7 @@ static INLINE void make_reloc(struct brw_winsys_reloc *reloc,
struct brw_winsys_screen {
+ unsigned pci_id;
/**
* Buffer functions.
@@ -261,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, unsigned pci_id);
-
-
/*************************************************************************
* Cooperative dumping between winsys and driver. TODO: make this
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/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index 60bdd7276aa..6fe1eb69530 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -15,7 +15,7 @@
#include "nouveau_screen.h"
/* XXX this should go away */
-#include "state_tracker/drm_api.h"
+#include "state_tracker/drm_driver.h"
#include "util/u_simple_screen.h"
static const char *
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 d3d36a782c5..5bba55906c3 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.
@@ -381,7 +382,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_texture.c b/src/gallium/drivers/r300/r300_texture.c
index ddb66000561..6206570fca4 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -36,7 +36,9 @@
#include "util/u_memory.h"
#include "pipe/p_screen.h"
-#include "state_tracker/drm_api.h"
+
+/* XXX NO! just no! */
+#include "state_tracker/drm_driver.h"
enum r300_dim {
DIM_WIDTH = 0,
@@ -1081,6 +1083,7 @@ r300_texture_from_handle(struct pipe_screen* screen,
return NULL;
}
+ /* XXX make the winsys return the stride_override, see i915_resource_texture.c:830 */
buffer = rws->buffer_from_handle(rws, whandle->handle);
if (!buffer) {
return NULL;
diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h
index 77c1c13ef9a..3b5e9eec602 100644
--- a/src/gallium/drivers/r300/r300_winsys.h
+++ b/src/gallium/drivers/r300/r300_winsys.h
@@ -162,7 +162,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/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 <util/u_math.h>
#include <util/u_inlines.h>
#include <util/u_memory.h>
-#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 <stdio.h>
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 <util/u_math.h>
#include <util/u_inlines.h>
#include <util/u_memory.h>
-#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/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 <[email protected]>
+ */
+
+#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/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 */