diff options
author | Eric Anholt <[email protected]> | 2013-09-26 17:08:28 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-10-10 16:34:30 -0700 |
commit | ee8983beccfd4690e4cdd9b1d818aa284656ce88 (patch) | |
tree | d0eb1d25b111c760b7c98e7928ade46e54450122 /src/mesa/drivers/dri/i965/brw_context.c | |
parent | 18a8f31070def704ad65c86166eaadc6e1c3349c (diff) |
i965: Clean up error handling for context creation.
The intel_screen.c used to be a dispatch to one of 3 driver functions, but
was down to 1, so it was kind of a waste. In addition, it was trying to
free all of the data that might have been partially freed in the kernel
3.6 check (which comes after intelInitContext, and thus might have had
driverPrivate set and result in intelDestroyContext() doing work on the
freed data). By moving the driverPrivate setup earlier, we can use
intelDestroyContext() consistently and avoid such problems in the future.
v2: Adjust the prototype of brwCreateContext to use the proper enum
(fixing a compiler warning in some builds)
Reviewed-by: Kenneth Graunke <[email protected]> (v1)
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_context.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 6 |
1 files changed, 3 insertions, 3 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; } } |