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 <emil.velikov@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Emil Velikov 2017-08-27 11:20:26 +01:00 committed by Emil Velikov
parent 0ac78dc925
commit 2f76dff65f

View file

@ -905,17 +905,13 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
return EGL_FALSE;
}
if (ret) {
dri2_dpy = dri2_egl_display(disp);
if (!ret)
return EGL_FALSE;
if (!dri2_dpy) {
return EGL_FALSE;
}
dri2_dpy = dri2_egl_display(disp);
dri2_dpy->ref_count++;
dri2_dpy->ref_count++;
}
return ret;
return EGL_TRUE;
}
/**