aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915/i830_context.c
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2012-11-21 16:22:19 -0800
committerIan Romanick <[email protected]>2013-01-15 13:45:51 -0800
commita11fe62058ad9d44170be9346111e3f6630a3327 (patch)
tree6783caeef31bd5636de40194901407f01bb44f67 /src/mesa/drivers/dri/i915/i830_context.c
parent4945086f36d3ccec041e499f1e2861dc1cc45a44 (diff)
intel: Move validation of context version into intelInitContext
Each driver (i830, i915, i965) used independent but similar code to validate the requested context version. With the rececnt arrival of GLES3, that logic has needed an update. Rather than apply identical updates to each drivers validation code, let's just move the validation into the shared routine intelInitContext. This refactor required some incidental changes to functions i830CreateContext and intelInitContext. For each function, this patch: - Adds context version parameters to the signature. - Adds a DRI_CTX_ERROR out param to the signature. - Sets the DRI_CTX_ERROR at each early return. Tested against gen6 with piglit egl-create-context-verify-gl-flavor. Verified that this patch does not change the set of exposed EGL context flavors. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i915/i830_context.c')
-rw-r--r--src/mesa/drivers/dri/i915/i830_context.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c
index e822660c635..288dfcc774a 100644
--- a/src/mesa/drivers/dri/i915/i830_context.c
+++ b/src/mesa/drivers/dri/i915/i830_context.c
@@ -52,23 +52,33 @@ i830InitDriverFunctions(struct dd_function_table *functions)
extern const struct tnl_pipeline_stage *intel_pipeline[];
bool
-i830CreateContext(const struct gl_config * mesaVis,
+i830CreateContext(int api,
+ const struct gl_config * mesaVis,
__DRIcontext * driContextPriv,
+ unsigned major_version,
+ unsigned minor_version,
+ unsigned *error,
void *sharedContextPrivate)
{
struct dd_function_table functions;
struct i830_context *i830 = rzalloc(NULL, struct i830_context);
struct intel_context *intel = &i830->intel;
struct gl_context *ctx = &intel->ctx;
- if (!i830)
+
+ if (!i830) {
+ *error = __DRI_CTX_ERROR_NO_MEMORY;
return false;
+ }
i830InitVtbl(i830);
i830InitDriverFunctions(&functions);
- if (!intelInitContext(intel, __DRI_API_OPENGL, mesaVis, driContextPriv,
- sharedContextPrivate, &functions)) {
- free(i830);
+ if (!intelInitContext(intel, __DRI_API_OPENGL,
+ major_version, minor_version,
+ mesaVis, driContextPriv,
+ sharedContextPrivate, &functions,
+ error)) {
+ ralloc_free(i830);
return false;
}