egl: refactor dri2_create_screen() into three separate functions

Split the create_screen into:
 - create screen
 - setup/bind extensions
 - setup screen

This will allow us to reuse the latter two on egl/drm. Said platform
does create its own screen and attempts to reinvent the later two
functions itself.

Since the GBM ones tend to get out of sync quite often, and there is no
distinct reason why it does so we'll drop them with latter commits.

v2: disp -> dpy for the Android platform.
v3: use correct goto label (Rob)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Rob Herring <robh@kernel.org>
This commit is contained in:
Emil Velikov
2017-05-11 16:20:04 +01:00
parent ee3b32696f
commit 2c341f2bda
6 changed files with 58 additions and 19 deletions

View File

@@ -320,6 +320,13 @@ dri2_initialize_surfaceless(_EGLDriver *drv, _EGLDisplay *disp)
goto cleanup;
}
if (!dri2_setup_extensions(disp)) {
err = "DRI2: failed to find required DRI extensions";
goto cleanup;
}
dri2_setup_screen(disp);
if (!surfaceless_add_configs_for_visuals(drv, disp)) {
err = "DRI2: failed to add configs";
goto cleanup;