summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-08-27 11:20:26 +0100
committerEmil Velikov <[email protected]>2017-08-29 13:40:46 +0100
commit2f76dff65f83a28b335497ab216a8bb71e6c97a2 (patch)
treecc981aa978a1b2d4eea2c9ca4fb50b1674acb04c /src/egl
parent0ac78dc92582a59d4319ebce019b4caa41fb432d (diff)
egl: simplify refcounting after screen creation
If the specific initialize was successfull, dri2_egl_display() will return a non NULL pointer. Thus we can drop the check and flatten the codeflow. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Acked-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 83545bab227..02c187e5fe7 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -905,17 +905,13 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
return EGL_FALSE;
}
- if (ret) {
- dri2_dpy = dri2_egl_display(disp);
-
- if (!dri2_dpy) {
- return EGL_FALSE;
- }
+ if (!ret)
+ return EGL_FALSE;
- dri2_dpy->ref_count++;
- }
+ dri2_dpy = dri2_egl_display(disp);
+ dri2_dpy->ref_count++;
- return ret;
+ return EGL_TRUE;
}
/**