diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2012-07-18 14:37:28 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2012-08-06 15:37:04 -0700 |
commit | cb77f5dd1f6658fca671454c9b5be9a23c3bf3e4 (patch) | |
tree | 836134cc8180e92e6daa50b06e54166ac762961b /src/egl | |
parent | 05413ddb1da5d4f17b6da891fd2d76cff4947979 (diff) |
egl_dri2: Refactor dereference of dri2_ctx_shared
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 480268f349a..ffef3bfff4f 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -648,6 +648,8 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf, struct dri2_egl_context *dri2_ctx; struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_context *dri2_ctx_shared = dri2_egl_context(share_list); + __DRIcontext *shared = + dri2_ctx_shared ? dri2_ctx_shared->dri_context : NULL; struct dri2_egl_config *dri2_config = dri2_egl_config(conf); const __DRIconfig *dri_config; int api; @@ -713,15 +715,13 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf, dri2_dpy->dri2->createNewContextForAPI(dri2_dpy->dri_screen, api, dri_config, - dri2_ctx_shared ? - dri2_ctx_shared->dri_context : NULL, + shared, dri2_ctx); } else if (api == __DRI_API_OPENGL) { dri2_ctx->dri_context = dri2_dpy->dri2->createNewContext(dri2_dpy->dri_screen, dri_config, - dri2_ctx_shared ? - dri2_ctx_shared->dri_context : NULL, + shared, dri2_ctx); } else { /* fail */ @@ -732,8 +732,7 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf, dri2_dpy->swrast->createNewContextForAPI(dri2_dpy->dri_screen, api, dri_config, - dri2_ctx_shared ? - dri2_ctx_shared->dri_context : NULL, + shared, dri2_ctx); } |