summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c6
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h2
-rw-r--r--src/mesa/drivers/dri/i965/intel_context.c6
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c28
4 files changed, 8 insertions, 34 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 776d2213934..c648d30cfaa 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -276,7 +276,7 @@ brw_initialize_context_constants(struct brw_context *brw)
}
bool
-brwCreateContext(int api,
+brwCreateContext(gl_api api,
const struct gl_config *mesaVis,
__DRIcontext *driContextPriv,
unsigned major_version,
@@ -311,7 +311,7 @@ brwCreateContext(int api,
mesaVis, driContextPriv,
sharedContextPrivate, &functions,
error)) {
- ralloc_free(brw);
+ intelDestroyContext(driContextPriv);
return false;
}
@@ -332,7 +332,7 @@ brwCreateContext(int api,
if (!brw->hw_ctx) {
fprintf(stderr, "Gen6+ requires Kernel 3.6 or later.\n");
- ralloc_free(brw);
+ intelDestroyContext(driContextPriv);
return false;
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index fee4e1a7734..28ae261a68a 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1410,7 +1410,7 @@ void brwInitVtbl( struct brw_context *brw );
/*======================================================================
* brw_context.c
*/
-bool brwCreateContext(int api,
+bool brwCreateContext(gl_api api,
const struct gl_config *mesaVis,
__DRIcontext *driContextPriv,
unsigned major_version,
diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c
index 3eb5b8b8dc7..850d9a0b0c0 100644
--- a/src/mesa/drivers/dri/i965/intel_context.c
+++ b/src/mesa/drivers/dri/i965/intel_context.c
@@ -426,6 +426,9 @@ intelInitContext(struct brw_context *brw,
brw->intelScreen = intelScreen;
brw->bufmgr = intelScreen->bufmgr;
+ driContextPriv->driverPrivate = brw;
+ brw->driContext = driContextPriv;
+
if (!_mesa_initialize_context(&brw->ctx, api, mesaVis, shareCtx,
functions)) {
*dri_ctx_error = __DRI_CTX_ERROR_NO_MEMORY;
@@ -433,9 +436,6 @@ intelInitContext(struct brw_context *brw,
return false;
}
- driContextPriv->driverPrivate = brw;
- brw->driContext = driContextPriv;
-
brw->gen = intelScreen->gen;
const int devID = intelScreen->deviceID;
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index aef3bbf7e76..b6b4275cc00 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -984,32 +984,6 @@ intelDestroyBuffer(__DRIdrawable * driDrawPriv)
_mesa_reference_framebuffer(&fb, NULL);
}
-static GLboolean
-intelCreateContext(gl_api api,
- const struct gl_config * mesaVis,
- __DRIcontext * driContextPriv,
- unsigned major_version,
- unsigned minor_version,
- uint32_t flags,
- unsigned *error,
- void *sharedContextPrivate)
-{
- bool success = false;
-
- success = brwCreateContext(api, mesaVis,
- driContextPriv,
- major_version, minor_version, flags,
- error, sharedContextPrivate);
-
- if (success)
- return true;
-
- if (driContextPriv->driverPrivate != NULL)
- intelDestroyContext(driContextPriv);
-
- return false;
-}
-
static bool
intel_init_bufmgr(struct intel_screen *intelScreen)
{
@@ -1371,7 +1345,7 @@ intelReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer)
const struct __DriverAPIRec driDriverAPI = {
.InitScreen = intelInitScreen2,
.DestroyScreen = intelDestroyScreen,
- .CreateContext = intelCreateContext,
+ .CreateContext = brwCreateContext,
.DestroyContext = intelDestroyContext,
.CreateBuffer = intelCreateBuffer,
.DestroyBuffer = intelDestroyBuffer,