diff options
author | Eric Anholt <eric@anholt.net> | 2013-09-26 12:01:56 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2013-10-10 16:34:30 -0700 |
commit | 083f66fdd6451648fe355b64b02b29a6a4389f0d (patch) | |
tree | 7965c2cd9f5b2f96ea1268ef6640d6e39ed55bff /src/mesa/drivers/dri/nouveau | |
parent | d81632fb1e809a0b1ee9310ae3a4733a1c0651b7 (diff) |
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/nouveau')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_context.c | 23 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_screen.c | 12 |
2 files changed, 12 insertions, 23 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index eab1aa23f47..0b648acb46f 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -61,29 +61,6 @@ nouveau_context_create(gl_api api, struct nouveau_context *nctx; struct gl_context *ctx; - switch (api) { - case API_OPENGL_COMPAT: - /* Do after-the-fact version checking (below). - */ - break; - case API_OPENGLES: - /* NV10 and NV20 can support OpenGL ES 1.0 only. Older chips - * cannot do even that. - */ - if ((screen->device->chipset & 0xf0) == 0x00) { - *error = __DRI_CTX_ERROR_BAD_API; - return GL_FALSE; - } else if (minor_version != 0) { - *error = __DRI_CTX_ERROR_BAD_VERSION; - return GL_FALSE; - } - break; - case API_OPENGLES2: - case API_OPENGL_CORE: - *error = __DRI_CTX_ERROR_BAD_API; - return GL_FALSE; - } - /* API and flag filtering is handled in dri2CreateContextAttribs. */ (void) flags; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c index ca39fff807a..6816406f539 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c @@ -93,6 +93,18 @@ nouveau_init_screen2(__DRIscreen *dri_screen) if (!screen) return NULL; + + /* Compat version validation will occur at context init after + * _mesa_compute_version(). + */ + dri_screen->max_gl_compat_version = 15; + + /* NV10 and NV20 can support OpenGL ES 1.0 only. Older chips + * cannot do even that. + */ + if ((screen->device->chipset & 0xf0) != 0x00) + dri_screen->max_gl_es1_version = 10; + dri_screen->driverPrivate = screen; dri_screen->extensions = nouveau_screen_extensions; screen->dri_screen = dri_screen; |