diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2013-12-07 22:02:11 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2013-12-13 08:19:50 -0800 |
commit | 38366c0c6e715314367b15680702e382d5c46a4a (patch) | |
tree | 2196c7c662ea9940d356aa9824e7959ff572eccb /src/mesa/drivers/dri/common | |
parent | d6c8365795c4fb1af83b79f26f782e0834f6bdfc (diff) | |
download | external_mesa3d-38366c0c6e715314367b15680702e382d5c46a4a.zip external_mesa3d-38366c0c6e715314367b15680702e382d5c46a4a.tar.gz external_mesa3d-38366c0c6e715314367b15680702e382d5c46a4a.tar.bz2 |
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>
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.h | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index fd2eca7..d648211 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -438,16 +438,19 @@ driCreateContextAttribs(__DRIscreen *screen, int api, return NULL; } - struct gl_context *ctx = context->driverPrivate; + *error = __DRI_CTX_ERROR_SUCCESS; + return context; +} + +void +driContextSetFlags(struct gl_context *ctx, uint32_t flags) +{ if ((flags & __DRI_CTX_FLAG_FORWARD_COMPATIBLE) != 0) ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT; if ((flags & __DRI_CTX_FLAG_DEBUG) != 0) { ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_DEBUG_BIT; ctx->Debug.DebugOutput = GL_TRUE; } - - *error = __DRI_CTX_ERROR_SUCCESS; - return context; } static __DRIcontext * diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 4cfa75d..a79a4ed 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -292,6 +292,9 @@ dri2InvalidateDrawable(__DRIdrawable *drawable); extern void driUpdateFramebufferSize(struct gl_context *ctx, const __DRIdrawable *dPriv); +extern void +driContextSetFlags(struct gl_context *ctx, uint32_t flags); + extern const __DRIimageDriverExtension driImageDriverExtension; #endif /* _DRI_UTIL_H_ */ |