gallium: Remove drm_api and all references to it
authorJakob Bornecrantz <jakob@vmware.com>
Wed, 23 Jun 2010 21:14:22 +0000 (23:14 +0200)
committerJakob Bornecrantz <jakob@vmware.com>
Thu, 24 Jun 2010 00:15:50 +0000 (02:15 +0200)
src/gallium/auxiliary/target-helpers/drm_api_compat.h [deleted file]
src/gallium/drivers/identity/Makefile
src/gallium/drivers/identity/SConscript
src/gallium/drivers/identity/id_drm.c [deleted file]
src/gallium/drivers/identity/id_drm.h [deleted file]
src/gallium/drivers/trace/Makefile
src/gallium/drivers/trace/SConscript
src/gallium/drivers/trace/tr_drm.c [deleted file]
src/gallium/drivers/trace/tr_drm.h [deleted file]
src/gallium/include/state_tracker/drm_api.h [deleted file]
src/gallium/targets/dri-swrast/swrast_drm_api.c

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 (file)
index 324c6f2..0000000
+++ /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
index e32b9102e597cddca45bc9b617a546d0a89040ff..74692d976105a7ae8e0599e32bdd7760911c5505 100644 (file)
@@ -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
index 2a68891c2844d9f3f4c51ee803dc54f4374981cd..b364e0acc84a4f97d95d94b3308b53021a52f271 100644 (file)
@@ -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 (file)
index 15d0151..0000000
+++ /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 (file)
index cf2ad2c..0000000
+++ /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 */
index 1b0c087a2a4193039cbe075e5a41980ee1333043..99e5fb81c2241a62019c65cb0b8438131041f5bf 100644 (file)
@@ -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
index 0dc43a9ec415e295488288ddf39be79837c89c61..06b0c4863a4572512846d7cd4ce5a3d5acb5aa91 100644 (file)
@@ -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 (file)
index e685033..0000000
+++ /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 (file)
index 845c66a..0000000
+++ /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 (file)
index 4572c7e..0000000
+++ /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
index 84142be80c8c16878cd9d60c4d7b459b239b17f0..ddf78406d530c46da3036c2bffef00809d58b61b 100644 (file)
@@ -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"