dri: Move API version validation into dri/common.
authorEric Anholt <eric@anholt.net>
Thu, 26 Sep 2013 19:01:56 +0000 (12:01 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 10 Oct 2013 23:34:30 +0000 (16:34 -0700)
commit083f66fdd6451648fe355b64b02b29a6a4389f0d
tree7965c2cd9f5b2f96ea1268ef6640d6e39ed55bff
parentd81632fb1e809a0b1ee9310ae3a4733a1c0651b7
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>
16 files changed:
src/gallium/state_trackers/dri/common/dri_screen.c
src/gallium/state_trackers/dri/drm/dri2.c
src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/common/dri_util.h
src/mesa/drivers/dri/i915/intel_context.c
src/mesa/drivers/dri/i915/intel_screen.c
src/mesa/drivers/dri/i915/intel_screen.h
src/mesa/drivers/dri/i965/intel_context.c
src/mesa/drivers/dri/i965/intel_screen.c
src/mesa/drivers/dri/i965/intel_screen.h
src/mesa/drivers/dri/nouveau/nouveau_context.c
src/mesa/drivers/dri/nouveau/nouveau_screen.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/drivers/dri/radeon/radeon_screen.c
src/mesa/drivers/dri/swrast/swrast.c