summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
authorBoyan Ding <[email protected]>2015-07-21 23:43:57 +0800
committerEmil Velikov <[email protected]>2015-09-09 11:25:55 +0100
commit6345d2da60eb6eace23bc9b5a6e606726c3caea2 (patch)
tree7ee7561d30cdeb8910241aaf23b9096f9281b97f /src/egl
parentb9ea608c1a0f3356f5c4e13bdd7307b726dc42ba (diff)
egl_dri2: Use createContextAttribs if swrast version >= 3
v2: Change return type of the new function from int to bool Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Boyan Ding <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 91b5a7cf50f..34348620a47 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1064,12 +1064,33 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
}
} else {
assert(dri2_dpy->swrast);
- dri2_ctx->dri_context =
- dri2_dpy->swrast->createNewContextForAPI(dri2_dpy->dri_screen,
- api,
- dri_config,
- shared,
- dri2_ctx);
+ if (dri2_dpy->swrast->base.version >= 3) {
+ unsigned error;
+ unsigned num_attribs = 8;
+ uint32_t ctx_attribs[8];
+
+ if (!dri2_fill_context_attribs(dri2_ctx, dri2_dpy, ctx_attribs,
+ &num_attribs))
+ goto cleanup;
+
+ dri2_ctx->dri_context =
+ dri2_dpy->swrast->createContextAttribs(dri2_dpy->dri_screen,
+ api,
+ dri_config,
+ shared,
+ num_attribs / 2,
+ ctx_attribs,
+ & error,
+ dri2_ctx);
+ dri2_create_context_attribs_error(error);
+ } else {
+ dri2_ctx->dri_context =
+ dri2_dpy->swrast->createNewContextForAPI(dri2_dpy->dri_screen,
+ api,
+ dri_config,
+ shared,
+ dri2_ctx);
+ }
}
if (!dri2_ctx->dri_context)