diff options
author | Ian Romanick <[email protected]> | 2012-07-18 14:41:28 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-08-14 15:41:02 -0700 |
commit | ce55741cbc0837338b73f9112ab4d84363ebaee1 (patch) | |
tree | 8cef6632aaa8cb4bdad84384e031d2f6b82c4a2e /src | |
parent | 38f91f2b08e2457fa637c631490fe713e8ee5429 (diff) |
egl_dri2: Use createContextAttribs if DRI2 version >= 3
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index cc37bf02932..3bf46aa2185 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -697,7 +697,23 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf, dri_config = NULL; if (dri2_dpy->dri2) { - { + if (dri2_dpy->dri2->base.version >= 3) { + unsigned error; + const uint32_t ctx_attribs[2] = { + __DRI_CTX_ATTRIB_MAJOR_VERSION, + dri2_ctx->base.ClientVersion + }; + + dri2_ctx->dri_context = + dri2_dpy->dri2->createContextAttribs(dri2_dpy->dri_screen, + api, + dri_config, + shared, + 1, + ctx_attribs, + & error, + dri2_ctx); + } else { dri2_ctx->dri_context = dri2_dpy->dri2->createNewContextForAPI(dri2_dpy->dri_screen, api, |