summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsapountzis@gmail.com>2010-04-08 18:58:35 +0300
committerGeorge Sapountzis <gsapountzis@gmail.com>2010-07-18 17:51:35 +0300
commit3a3a28182db0a41cbb4ba2d0efdf5d598ec04193 (patch)
tree9fcba91eb04abe554e324a19c38742d88c5c9162
parent14e362c79aedd9b463c74ef2e56ad96101ceb2af (diff)
st/dri: mv driDriverAPI to backends
-rw-r--r--src/gallium/state_trackers/dri/common/dri_screen.c44
-rw-r--r--src/gallium/state_trackers/dri/common/dri_screen.h3
-rw-r--r--src/gallium/state_trackers/dri/drm/dri2.c29
-rw-r--r--src/gallium/state_trackers/dri/drm/dri2.h37
-rw-r--r--src/gallium/state_trackers/dri/sw/drisw.c23
-rw-r--r--src/gallium/state_trackers/dri/sw/drisw.h43
6 files changed, 49 insertions, 130 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index 25cad8d46c4c..a2bccefd6c59 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -30,20 +30,12 @@
*/
#include "utils.h"
-#ifndef __NOT_HAVE_DRM_H
-#include "vblank.h"
-#endif
#include "xmlpool.h"
#include "dri_screen.h"
#include "dri_context.h"
#include "dri_drawable.h"
#include "dri1_helper.h"
-#ifndef __NOT_HAVE_DRM_H
-#include "dri2.h"
-#else
-#include "drisw.h"
-#endif
#include "util/u_inlines.h"
#include "pipe/p_screen.h"
@@ -366,7 +358,7 @@ dri_destroy_screen_helper(struct dri_screen * screen)
dri_destroy_option_cache(screen);
}
-static void
+void
dri_destroy_screen(__DRIscreen * sPriv)
{
struct dri_screen *screen = dri_screen(sPriv);
@@ -402,38 +394,4 @@ dri_init_screen_helper(struct dri_screen *screen,
return dri_fill_in_modes(screen, pixel_bits);
}
-/**
- * DRI driver virtual function table.
- *
- * DRI versions differ in their implementation of init_screen and swap_buffers.
- */
-const struct __DriverAPIRec driDriverAPI = {
- .DestroyScreen = dri_destroy_screen,
- .CreateContext = dri_create_context,
- .DestroyContext = dri_destroy_context,
- .CreateBuffer = dri_create_buffer,
- .DestroyBuffer = dri_destroy_buffer,
- .MakeCurrent = dri_make_current,
- .UnbindContext = dri_unbind_context,
-
-#ifndef __NOT_HAVE_DRM_H
-
- .GetSwapInfo = NULL,
- .GetDrawableMSC = NULL,
- .WaitForMSC = NULL,
- .InitScreen2 = dri2_init_screen,
-
- .InitScreen = NULL,
- .SwapBuffers = NULL,
- .CopySubBuffer = NULL,
-
-#else
-
- .InitScreen = drisw_init_screen,
- .SwapBuffers = drisw_swap_buffers,
-
-#endif
-
-};
-
/* vim: set sw=3 ts=8 sts=3 expandtab: */
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.h b/src/gallium/state_trackers/dri/common/dri_screen.h
index 087ae8d2a4a2..cfbebb3341c5 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.h
+++ b/src/gallium/state_trackers/dri/common/dri_screen.h
@@ -132,6 +132,9 @@ dri_init_screen_helper(struct dri_screen *screen,
void
dri_destroy_screen_helper(struct dri_screen * screen);
+void
+dri_destroy_screen(__DRIscreen * sPriv);
+
#endif
/* vim: set sw=3 ts=8 sts=3 expandtab: */
diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
index ca06d4a5e348..89174fc34529 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -38,9 +38,6 @@
#include "dri_screen.h"
#include "dri_context.h"
#include "dri_drawable.h"
-#include "dri2.h"
-
-#include "GL/internal/dri_interface.h"
/**
* DRI2 flush extension.
@@ -498,7 +495,7 @@ static const __DRIextension *dri_screen_extensions[] = {
*
* Returns the __GLcontextModes supported by this driver.
*/
-const __DRIconfig **
+static const __DRIconfig **
dri2_init_screen(__DRIscreen * sPriv)
{
const __DRIconfig **configs;
@@ -535,6 +532,30 @@ fail:
return NULL;
}
+/**
+ * DRI driver virtual function table.
+ *
+ * DRI versions differ in their implementation of init_screen and swap_buffers.
+ */
+const struct __DriverAPIRec driDriverAPI = {
+ .DestroyScreen = dri_destroy_screen,
+ .CreateContext = dri_create_context,
+ .DestroyContext = dri_destroy_context,
+ .CreateBuffer = dri_create_buffer,
+ .DestroyBuffer = dri_destroy_buffer,
+ .MakeCurrent = dri_make_current,
+ .UnbindContext = dri_unbind_context,
+
+ .GetSwapInfo = NULL,
+ .GetDrawableMSC = NULL,
+ .WaitForMSC = NULL,
+ .InitScreen2 = dri2_init_screen,
+
+ .InitScreen = NULL,
+ .SwapBuffers = NULL,
+ .CopySubBuffer = NULL,
+};
+
/* This is the table of extensions that the loader will dlsym() for. */
PUBLIC const __DRIextension *__driDriverExtensions[] = {
&driCoreExtension.base,
diff --git a/src/gallium/state_trackers/dri/drm/dri2.h b/src/gallium/state_trackers/dri/drm/dri2.h
deleted file mode 100644
index 07adfe4f6c55..000000000000
--- a/src/gallium/state_trackers/dri/drm/dri2.h
+++ /dev/null
@@ -1,37 +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 DRI2_H
-#define DRI2_H
-
-#include "dri_drawable.h"
-#include "dri_wrapper.h"
-
-const __DRIconfig **
-dri2_init_screen(__DRIscreen * sPriv);
-
-#endif /* DRI2_H */
diff --git a/src/gallium/state_trackers/dri/sw/drisw.c b/src/gallium/state_trackers/dri/sw/drisw.c
index 23e99aa0adde..bc23a990af5c 100644
--- a/src/gallium/state_trackers/dri/sw/drisw.c
+++ b/src/gallium/state_trackers/dri/sw/drisw.c
@@ -44,7 +44,6 @@
#include "dri_context.h"
#include "dri_drawable.h"
#include "dri1_helper.h"
-#include "drisw.h"
static INLINE void
@@ -128,7 +127,7 @@ drisw_copy_to_front(__DRIdrawable * dPriv,
* Backend functions for st_framebuffer interface and swap_buffers.
*/
-void
+static void
drisw_swap_buffers(__DRIdrawable *dPriv)
{
struct dri_context *ctx = dri_get_current(dPriv->driScreenPriv);
@@ -244,7 +243,7 @@ static struct drisw_loader_funcs drisw_lf = {
.put_image = drisw_put_image
};
-const __DRIconfig **
+static const __DRIconfig **
drisw_init_screen(__DRIscreen * sPriv)
{
const __DRIconfig **configs;
@@ -278,6 +277,24 @@ fail:
return NULL;
}
+/**
+ * DRI driver virtual function table.
+ *
+ * DRI versions differ in their implementation of init_screen and swap_buffers.
+ */
+const struct __DriverAPIRec driDriverAPI = {
+ .DestroyScreen = dri_destroy_screen,
+ .CreateContext = dri_create_context,
+ .DestroyContext = dri_destroy_context,
+ .CreateBuffer = dri_create_buffer,
+ .DestroyBuffer = dri_destroy_buffer,
+ .MakeCurrent = dri_make_current,
+ .UnbindContext = dri_unbind_context,
+
+ .InitScreen = drisw_init_screen,
+ .SwapBuffers = drisw_swap_buffers,
+};
+
/* This is the table of extensions that the loader will dlsym() for. */
PUBLIC const __DRIextension *__driDriverExtensions[] = {
&driCoreExtension.base,
diff --git a/src/gallium/state_trackers/dri/sw/drisw.h b/src/gallium/state_trackers/dri/sw/drisw.h
deleted file mode 100644
index 6c6c891f356c..000000000000
--- a/src/gallium/state_trackers/dri/sw/drisw.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2009, VMware, Inc.
- * All Rights Reserved.
- * Copyright 2010 George Sapountzis <gsapountzis@gmail.com>
- *
- * 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 DRISW_H
-#define DRISW_H
-
-#include "dri_context.h"
-#include "dri_drawable.h"
-
-#include "state_tracker/st_api.h"
-#include "dri_wrapper.h"
-
-const __DRIconfig **
-drisw_init_screen(__DRIscreen * sPriv);
-
-void drisw_swap_buffers(__DRIdrawable * dPriv);
-
-#endif /* DRISW_H */