summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-11-11 16:35:35 -0800
committerIan Romanick <ian.d.romanick@intel.com>2013-11-15 13:39:39 -0800
commit7d2187176a3708e3bc00114a8172ec7cc73f39d3 (patch)
tree7b672f0f2a4f3983f025d128fe2ce37c42db4b8c
parent329a75511fe2ab454e487855a65f9a3943a11ec1 (diff)
dri: Remove redundant createNewContext function from __DRIimageDriverExtension
createContextAttribs is a superset of what createNewContext provides. Also remove the function typedef, since createNewContext is deprecated and no longer used in multiple interfaces. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit e0489531455623aa21aa565b2c890362d8437f23)
-rw-r--r--include/GL/internal/dri_interface.h12
-rw-r--r--src/glx/dri3_glx.c56
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c1
3 files changed, 15 insertions, 54 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index ed432576400..b012570ae13 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -783,12 +783,6 @@ typedef __DRIdrawable *
void *loaderPrivate);
typedef __DRIcontext *
-(*__DRIcreateNewContextFunc)(__DRIscreen *screen,
- const __DRIconfig *config,
- __DRIcontext *shared,
- void *loaderPrivate);
-
-typedef __DRIcontext *
(*__DRIcreateContextAttribsFunc)(__DRIscreen *screen,
int api,
const __DRIconfig *config,
@@ -949,7 +943,10 @@ struct __DRIdri2ExtensionRec {
void *loaderPrivate);
__DRIcreateNewDrawableFunc createNewDrawable;
- __DRIcreateNewContextFunc createNewContext;
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *loaderPrivate);
/* Since version 2 */
__DRIgetAPIMaskFunc getAPIMask;
@@ -1405,7 +1402,6 @@ struct __DRIimageDriverExtensionRec {
/* Common DRI functions, shared with DRI2 */
__DRIcreateNewScreen2Func createNewScreen2;
__DRIcreateNewDrawableFunc createNewDrawable;
- __DRIcreateNewContextFunc createNewContext;
__DRIcreateContextAttribsFunc createContextAttribs;
__DRIgetAPIMaskFunc getAPIMask;
};
diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c
index 0c8e0646298..b047cc880c8 100644
--- a/src/glx/dri3_glx.c
+++ b/src/glx/dri3_glx.c
@@ -160,51 +160,6 @@ dri3_unbind_context(struct glx_context *context, struct glx_context *new)
}
static struct glx_context *
-dri3_create_context(struct glx_screen *base,
- struct glx_config *config_base,
- struct glx_context *shareList, int renderType)
-{
- struct dri3_context *pcp, *pcp_shared;
- struct dri3_screen *psc = (struct dri3_screen *) base;
- __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base;
- __DRIcontext *shared = NULL;
-
- if (shareList) {
- /* If the shareList context is not a DRI3 context, we cannot possibly
- * create a DRI3 context that shares it.
- */
- if (shareList->vtable->destroy != dri3_destroy_context) {
- return NULL;
- }
-
- pcp_shared = (struct dri3_context *) shareList;
- shared = pcp_shared->driContext;
- }
-
- pcp = calloc(1, sizeof *pcp);
- if (pcp == NULL)
- return NULL;
-
- if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
- free(pcp);
- return NULL;
- }
-
- pcp->driContext =
- (*psc->image_driver->createNewContext) (psc->driScreen,
- config->driConfig, shared, pcp);
-
- if (pcp->driContext == NULL) {
- free(pcp);
- return NULL;
- }
-
- pcp->base.vtable = &dri3_context_vtable;
-
- return &pcp->base;
-}
-
-static struct glx_context *
dri3_create_context_attribs(struct glx_screen *base,
struct glx_config *config_base,
struct glx_context *shareList,
@@ -299,6 +254,17 @@ error_exit:
return NULL;
}
+static struct glx_context *
+dri3_create_context(struct glx_screen *base,
+ struct glx_config *config_base,
+ struct glx_context *shareList, int renderType)
+{
+ unsigned int error;
+
+ return dri3_create_context_attribs(base, config_base, shareList,
+ 0, NULL, &error);
+}
+
static void
dri3_destroy_drawable(__GLXDRIdrawable *base)
{
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 86cf24cb881..44e47f94f82 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -868,7 +868,6 @@ const __DRIimageDriverExtension driImageDriverExtension = {
.createNewScreen2 = driCreateNewScreen2,
.createNewDrawable = driCreateNewDrawable,
- .createNewContext = driCreateNewContext,
.getAPIMask = driGetAPIMask,
.createContextAttribs = driCreateContextAttribs,
};