egl: move dri2_setup_device() after dri2_setup_extensions()
dri2_setup_device() will depend on the extensions being set up in
the next commit.
None of the code in-between depends on disp->Device AFAIU.
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Tested-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Alejandro Piñeiro <apinheiro@igalia.com>
Backport-to: 23.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26205>
(cherry picked from commit 9b70096f5e
)
This commit is contained in:

committed by
Eric Engestrom

parent
ef07bc116e
commit
62455a9a25
@@ -94,7 +94,7 @@
|
||||
"description": "egl: move dri2_setup_device() after dri2_setup_extensions()",
|
||||
"nominated": true,
|
||||
"nomination_type": 4,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
@@ -1504,13 +1504,13 @@ dri2_initialize_android(_EGLDisplay *disp)
|
||||
|
||||
dri2_dpy->fd_display_gpu = dri2_dpy->fd_render_gpu;
|
||||
|
||||
if (!dri2_setup_device(disp, false)) {
|
||||
err = "DRI2: failed to setup EGLDevice";
|
||||
if (!dri2_setup_extensions(disp)) {
|
||||
err = "DRI2: failed to setup extensions";
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!dri2_setup_extensions(disp)) {
|
||||
err = "DRI2: failed to setup extensions";
|
||||
if (!dri2_setup_device(disp, false)) {
|
||||
err = "DRI2: failed to setup EGLDevice";
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@@ -639,11 +639,6 @@ dri2_initialize_drm(_EGLDisplay *disp)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!dri2_setup_device(disp, dri2_dpy->gbm_dri->software)) {
|
||||
err = "DRI2: failed to setup EGLDevice";
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
dri2_dpy->driver_name = strdup(dri2_dpy->gbm_dri->driver_name);
|
||||
|
||||
if (!dri2_load_driver_dri3(disp)) {
|
||||
@@ -677,6 +672,11 @@ dri2_initialize_drm(_EGLDisplay *disp)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!dri2_setup_device(disp, dri2_dpy->gbm_dri->software)) {
|
||||
err = "DRI2: failed to setup EGLDevice";
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
dri2_setup_screen(disp);
|
||||
|
||||
if (!drm_add_configs_for_visuals(disp)) {
|
||||
|
@@ -2204,11 +2204,6 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp)
|
||||
loader_get_user_preferred_fd(&dri2_dpy->fd_render_gpu,
|
||||
&dri2_dpy->fd_display_gpu);
|
||||
|
||||
if (!dri2_setup_device(disp, false)) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (dri2_dpy->fd_render_gpu != dri2_dpy->fd_display_gpu) {
|
||||
free(dri2_dpy->device_name);
|
||||
dri2_dpy->device_name =
|
||||
@@ -2245,6 +2240,11 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp)
|
||||
if (!dri2_setup_extensions(disp))
|
||||
goto cleanup;
|
||||
|
||||
if (!dri2_setup_device(disp, false)) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
dri2_setup_screen(disp);
|
||||
|
||||
dri2_wl_setup_swap_interval(disp);
|
||||
@@ -2771,11 +2771,6 @@ dri2_initialize_wayland_swrast(_EGLDisplay *disp)
|
||||
if (disp->Options.Zink)
|
||||
dri2_initialize_wayland_drm_extensions(dri2_dpy);
|
||||
|
||||
if (!dri2_setup_device(disp, true)) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
dri2_dpy->driver_name = strdup(disp->Options.Zink ? "zink" : "swrast");
|
||||
if (!dri2_load_driver_swrast(disp))
|
||||
goto cleanup;
|
||||
@@ -2788,6 +2783,11 @@ dri2_initialize_wayland_swrast(_EGLDisplay *disp)
|
||||
if (!dri2_setup_extensions(disp))
|
||||
goto cleanup;
|
||||
|
||||
if (!dri2_setup_device(disp, true)) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
dri2_setup_screen(disp);
|
||||
|
||||
dri2_wl_setup_swap_interval(disp);
|
||||
|
@@ -1512,11 +1512,6 @@ dri2_initialize_x11_swrast(_EGLDisplay *disp)
|
||||
if (!dri2_get_xcb_connection(disp, dri2_dpy))
|
||||
goto cleanup;
|
||||
|
||||
if (!dri2_setup_device(disp, true)) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
* Every hardware driver_name is set using strdup. Doing the same in
|
||||
* here will allow is to simply free the memory at dri2_terminate().
|
||||
@@ -1536,6 +1531,11 @@ dri2_initialize_x11_swrast(_EGLDisplay *disp)
|
||||
if (!dri2_setup_extensions(disp))
|
||||
goto cleanup;
|
||||
|
||||
if (!dri2_setup_device(disp, true)) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
dri2_setup_screen(disp);
|
||||
|
||||
if (disp->Options.Zink) {
|
||||
@@ -1602,11 +1602,6 @@ dri2_initialize_x11_dri3(_EGLDisplay *disp)
|
||||
if (!dri3_x11_connect(dri2_dpy))
|
||||
goto cleanup;
|
||||
|
||||
if (!dri2_setup_device(disp, false)) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!dri2_load_driver_dri3(disp))
|
||||
goto cleanup;
|
||||
|
||||
@@ -1621,6 +1616,11 @@ dri2_initialize_x11_dri3(_EGLDisplay *disp)
|
||||
if (!dri2_setup_extensions(disp))
|
||||
goto cleanup;
|
||||
|
||||
if (!dri2_setup_device(disp, false)) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
dri2_setup_screen(disp);
|
||||
|
||||
dri2_x11_setup_swap_interval(disp);
|
||||
@@ -1707,11 +1707,6 @@ dri2_initialize_x11_dri2(_EGLDisplay *disp)
|
||||
if (!dri2_x11_connect(dri2_dpy))
|
||||
goto cleanup;
|
||||
|
||||
if (!dri2_setup_device(disp, false)) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!dri2_load_driver(disp))
|
||||
goto cleanup;
|
||||
|
||||
@@ -1729,6 +1724,11 @@ dri2_initialize_x11_dri2(_EGLDisplay *disp)
|
||||
if (!dri2_setup_extensions(disp))
|
||||
goto cleanup;
|
||||
|
||||
if (!dri2_setup_device(disp, false)) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
dri2_setup_screen(disp);
|
||||
|
||||
dri2_x11_setup_swap_interval(disp);
|
||||
|
Reference in New Issue
Block a user