summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_context.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2012-08-07 11:26:19 -0700
committerIan Romanick <ian.d.romanick@intel.com>2012-08-13 17:17:12 -0700
commit70f47505a2e5d4cf949b7c2650f3d9f6559bacb3 (patch)
treee68e75ad6891bf9faf3189deff29d189de704269 /src/mesa/drivers/dri/radeon/radeon_context.c
parent7e81f553bccda66fafa769f8456b4918d088181a (diff)
dri: Pass API_OPENGL_CORE through to the drivers
This forces the drivers to do at least some validation of context API and version before creating the context. In r100 and r200 drivers, this means that they don't do any post-hoc validation. v2: Actually reject compatibility profile 3.2+ contexts. Thanks Ken. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_context.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_context.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index 34c392ef8b..e17c7860b1 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -178,9 +178,22 @@ r100CreateContext( gl_api api,
int i;
int tcl_mode, fthrottle_mode;
- /* API and flag filtering is handled in dri2CreateContextAttribs.
+ switch (api) {
+ case API_OPENGL:
+ if (major_version > 1 || minor_version > 3) {
+ *error = __DRI_CTX_ERROR_BAD_VERSION;
+ return GL_FALSE;
+ }
+ break;
+ case API_OPENGLES:
+ break;
+ default:
+ *error = __DRI_CTX_ERROR_BAD_API;
+ return GL_FALSE;
+ }
+
+ /* Flag filtering is handled in dri2CreateContextAttribs.
*/
- (void) api;
(void) flags;
assert(glVisual);
@@ -402,11 +415,6 @@ r100CreateContext( gl_api api,
}
_mesa_compute_version(ctx);
- if (ctx->Version < major_version * 10 + minor_version) {
- radeonDestroyContext(driContextPriv);
- *error = __DRI_CTX_ERROR_BAD_VERSION;
- return GL_FALSE;
- }
*error = __DRI_CTX_ERROR_SUCCESS;
return GL_TRUE;