summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915/intel_context.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-09-26 12:01:56 -0700
committerEric Anholt <eric@anholt.net>2013-10-10 16:34:30 -0700
commit083f66fdd6451648fe355b64b02b29a6a4389f0d (patch)
tree7965c2cd9f5b2f96ea1268ef6640d6e39ed55bff /src/mesa/drivers/dri/i915/intel_context.c
parentd81632fb1e809a0b1ee9310ae3a4733a1c0651b7 (diff)
downloadexternal_mesa3d-083f66fdd6451648fe355b64b02b29a6a4389f0d.zip
external_mesa3d-083f66fdd6451648fe355b64b02b29a6a4389f0d.tar.gz
external_mesa3d-083f66fdd6451648fe355b64b02b29a6a4389f0d.tar.bz2
dri: Move API version validation into dri/common.
i965, i915, radeon, r200, swrast, and nouveau were mostly trying to do the same logic, except where they failed to. Notably, swrast had code that appeared to try to enable GLES1/2 but forgot to set api_mask (thus preventing any gles context from being created), and the non-intel drivers didn't support MESA_GL_VERSION_OVERRIDE. nouveau still relies on _mesa_compute_version(), because I don't know what its limits actually are, and gallium drivers don't declare limits up front at all. I think I've heard talk about doing so, though. v2: Compat max version should be 30 (noted by Ken) Drop r100's custom max version check, too (noted by Emil Velikov) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i915/intel_context.c')
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index f27e3d0..aff51e8 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -367,45 +367,6 @@ intelInitDriverFunctions(struct dd_function_table *functions)
intel_init_syncobj_functions(functions);
}
-static bool
-validate_context_version(struct intel_screen *screen,
- int mesa_api,
- unsigned major_version,
- unsigned minor_version,
- unsigned *dri_ctx_error)
-{
- unsigned req_version = 10 * major_version + minor_version;
- unsigned max_version = 0;
-
- switch (mesa_api) {
- case API_OPENGL_COMPAT:
- max_version = screen->max_gl_compat_version;
- break;
- case API_OPENGL_CORE:
- max_version = screen->max_gl_core_version;
- break;
- case API_OPENGLES:
- max_version = screen->max_gl_es1_version;
- break;
- case API_OPENGLES2:
- max_version = screen->max_gl_es2_version;
- break;
- default:
- max_version = 0;
- break;
- }
-
- if (max_version == 0) {
- *dri_ctx_error = __DRI_CTX_ERROR_BAD_API;
- return false;
- } else if (req_version > max_version) {
- *dri_ctx_error = __DRI_CTX_ERROR_BAD_VERSION;
- return false;
- }
-
- return true;
-}
-
bool
intelInitContext(struct intel_context *intel,
int api,
@@ -430,11 +391,6 @@ intelInitContext(struct intel_context *intel,
return false;
}
- if (!validate_context_version(intelScreen,
- api, major_version, minor_version,
- dri_ctx_error))
- return false;
-
/* Can't rely on invalidate events, fall back to glViewport hack */
if (!driContextPriv->driScreenPriv->dri2.useInvalidate) {
intel->saved_viewport = functions->Viewport;