From 4b69100bdcf26dbb5be4d600b7ca5f5cdf6e8f20 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Tue, 27 Apr 2010 11:04:51 -0400 Subject: dri: Add DRI entrypoints to create a context for a given API --- src/mesa/drivers/dri/intel/intel_context.c | 5 +++-- src/mesa/drivers/dri/intel/intel_context.h | 1 + src/mesa/drivers/dri/intel/intel_screen.c | 11 +++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src/mesa/drivers/dri/intel') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 2ccc12010ed..8922d574c11 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -586,6 +586,7 @@ intelInitDriverFunctions(struct dd_function_table *functions) GLboolean intelInitContext(struct intel_context *intel, + int api, const __GLcontextModes * mesaVis, __DRIcontext * driContextPriv, void *sharedContextPrivate, @@ -601,8 +602,8 @@ intelInitContext(struct intel_context *intel, if (intelScreen->bufmgr == NULL) return GL_FALSE; - if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx, - functions, (void *) intel)) { + if (!_mesa_initialize_context_for_api(&intel->ctx, api, mesaVis, shareCtx, + functions, (void *) intel)) { printf("%s: failed to init mesa context\n", __FUNCTION__); return GL_FALSE; } diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 75dabc554c6..02bb4d0d640 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -364,6 +364,7 @@ extern int INTEL_DEBUG; */ extern GLboolean intelInitContext(struct intel_context *intel, + int api, const __GLcontextModes * mesaVis, __DRIcontext * driContextPriv, void *sharedContextPrivate, diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index b27e7a34a76..9b7ae73e45b 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -356,10 +356,12 @@ extern GLboolean i830CreateContext(const __GLcontextModes * mesaVis, __DRIcontext * driContextPriv, void *sharedContextPrivate); -extern GLboolean i915CreateContext(const __GLcontextModes * mesaVis, +extern GLboolean i915CreateContext(int api, + const __GLcontextModes * mesaVis, __DRIcontext * driContextPriv, void *sharedContextPrivate); -extern GLboolean brwCreateContext(const __GLcontextModes * mesaVis, +extern GLboolean brwCreateContext(int api, + const __GLcontextModes * mesaVis, __DRIcontext * driContextPriv, void *sharedContextPrivate); @@ -375,7 +377,7 @@ intelCreateContext(gl_api api, #ifdef I915 if (IS_9XX(intelScreen->deviceID)) { if (!IS_965(intelScreen->deviceID)) { - return i915CreateContext(mesaVis, driContextPriv, + return i915CreateContext(api, mesaVis, driContextPriv, sharedContextPrivate); } } else { @@ -384,7 +386,8 @@ intelCreateContext(gl_api api, } #else if (IS_965(intelScreen->deviceID)) - return brwCreateContext(mesaVis, driContextPriv, sharedContextPrivate); + return brwCreateContext(api, mesaVis, + driContextPriv, sharedContextPrivate); #endif fprintf(stderr, "Unrecognized deviceID %x\n", intelScreen->deviceID); return GL_FALSE; -- cgit v1.2.3