i965: Validate requested GLES context version in brwCreateContext
i965: Validate requested GLES context version in brwCreateContext

For GLES1 and GLES2, brwCreateContext neglected to validate the requested
context version received from the DRI layer. If DRI requested an OpenGL
ES2 context with version 3.9, we provided it one.

Before this fix, the switch statement that validated the requested GL
context flavor was an ugly #ifdef copy-paste mess. Instead of reproducing
the copy-past-mess for GLES1 and GLES2, I first refactored it.  Now the
switch statement is readable.

Reviewed-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>
Signed-off-by: Chad Versace <a557f7f75bf28dc19ac99107f5cc7cd6b3fbdb1a@linux.intel.com>

bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,zz85/glsl-optimizer,metora/MesaGLSLCompiler,metora/MesaGLSLCompiler,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,jbarczak/glsl-optimizer,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,mcanthony/glsl-optimizer,mapbox/glsl-optimizer,zeux/glsl-optimizer,djreep81/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,djreep81/glsl-optimizer,metora/MesaGLSLCompiler,zeux/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,mapbox/glsl-optimizer,zeux/glsl-optimizer,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,mcanthony/glsl-optimizer,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,mcanthony/glsl-optimizer,tokyovigilante/glsl-optimizer,benaadams/glsl-optimizer,wolf96/glsl-optimizer,jbarczak/glsl-optimizer,jbarczak/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,dellis1972/glsl-optimizer,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,benaadams/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,mapbox/glsl-optimizer