dri_util: Don't assume __DRIcontext->driverPrivate is a gl_context
authorKristian Høgsberg <krh@bitplanet.net>
Sun, 8 Dec 2013 06:02:11 +0000 (22:02 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 13 Dec 2013 16:19:50 +0000 (08:19 -0800)
commit38366c0c6e715314367b15680702e382d5c46a4a
tree2196c7c662ea9940d356aa9824e7959ff572eccb
parentd6c8365795c4fb1af83b79f26f782e0834f6bdfc
dri_util: Don't assume __DRIcontext->driverPrivate is a gl_context

The driverPrivate pointer is opaque to the driver and we can't assume
it's a struct gl_context in dri_util.c.  Instead provide a helper function
to set the struct gl_context flags from the incoming DRI context flags.

v2 (idr): Modify the other classic drivers to also use
driContextSetFlags.  I ran all the piglit GLX_ARB_create_context tests
with i965 and classic swrast without regressions.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu> [v1 on Gallium nouveau]
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
14 files changed:
src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/common/dri_util.h
src/mesa/drivers/dri/i915/i830_context.c
src/mesa/drivers/dri/i915/i830_context.h
src/mesa/drivers/dri/i915/i915_context.c
src/mesa/drivers/dri/i915/i915_context.h
src/mesa/drivers/dri/i915/intel_context.c
src/mesa/drivers/dri/i915/intel_context.h
src/mesa/drivers/dri/i915/intel_screen.c
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/nouveau/nouveau_context.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/drivers/dri/swrast/swrast.c