}
bool
-brwCreateContext(int api,
+brwCreateContext(gl_api api,
const struct gl_config *mesaVis,
__DRIcontext *driContextPriv,
unsigned major_version,
mesaVis, driContextPriv,
sharedContextPrivate, &functions,
error)) {
- ralloc_free(brw);
+ intelDestroyContext(driContextPriv);
return false;
}
if (!brw->hw_ctx) {
fprintf(stderr, "Gen6+ requires Kernel 3.6 or later.\n");
- ralloc_free(brw);
+ intelDestroyContext(driContextPriv);
return false;
}
}
/*======================================================================
* brw_context.c
*/
-bool brwCreateContext(int api,
+bool brwCreateContext(gl_api api,
const struct gl_config *mesaVis,
__DRIcontext *driContextPriv,
unsigned major_version,
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;
return false;
}
- driContextPriv->driverPrivate = brw;
- brw->driContext = driContextPriv;
-
brw->gen = intelScreen->gen;
const int devID = intelScreen->deviceID;
_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)
{
const struct __DriverAPIRec driDriverAPI = {
.InitScreen = intelInitScreen2,
.DestroyScreen = intelDestroyScreen,
- .CreateContext = intelCreateContext,
+ .CreateContext = brwCreateContext,
.DestroyContext = intelDestroyContext,
.CreateBuffer = intelCreateBuffer,
.DestroyBuffer = intelDestroyBuffer,