egl: move multibuffers check into platform_x11

there are no longer any extensions to bind, so this function has no
other purpose

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30494>
This commit is contained in:
Mike Blumenkrantz
2024-07-30 11:48:33 -04:00
committed by Marge Bot
parent 8407e674cc
commit f5a340058d
8 changed files with 27 additions and 57 deletions

View File

@@ -853,30 +853,6 @@ dri2_create_screen(_EGLDisplay *disp)
return EGL_TRUE;
}
EGLBoolean
dri2_setup_extensions(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
#ifdef HAVE_DRI3_MODIFIERS
#ifdef HAVE_X11_PLATFORM
if (dri2_dpy->conn) {
bool err;
dri2_dpy->multibuffers_available = x11_dri3_check_multibuffer(dri2_dpy->conn, &err);
}
#endif
if (disp->Options.Zink && !disp->Options.ForceSoftware &&
!dri2_dpy->multibuffers_available &&
/* this is enum _egl_platform_type */
(disp->Platform == _EGL_PLATFORM_X11 ||
disp->Platform == _EGL_PLATFORM_XCB) &&
!debug_get_bool_option("LIBGL_KOPPER_DRI2", false))
return EGL_FALSE;
#endif
return EGL_TRUE;
}
EGLBoolean
dri2_setup_device(_EGLDisplay *disp, EGLBoolean software)
{

View File

@@ -465,9 +465,6 @@ dri2_setup_swap_interval(_EGLDisplay *disp, int max_swap_interval);
EGLBoolean
dri2_create_screen(_EGLDisplay *disp);
EGLBoolean
dri2_setup_extensions(_EGLDisplay *disp);
EGLBoolean
dri2_setup_device(_EGLDisplay *disp, EGLBoolean software);

View File

@@ -1147,11 +1147,6 @@ dri2_initialize_android(_EGLDisplay *disp)
dri2_dpy->fd_display_gpu = dri2_dpy->fd_render_gpu;
if (!dri2_setup_extensions(disp)) {
err = "DRI2: failed to setup extensions";
goto cleanup;
}
if (!dri2_setup_device(disp, false)) {
err = "DRI2: failed to setup EGLDevice";
goto cleanup;

View File

@@ -364,11 +364,6 @@ dri2_initialize_device(_EGLDisplay *disp)
goto cleanup;
}
if (!dri2_setup_extensions(disp)) {
err = "DRI2: failed to find required DRI extensions";
goto cleanup;
}
dri2_setup_screen(disp);
#ifdef HAVE_WAYLAND_PLATFORM
dri2_dpy->device_name =

View File

@@ -657,11 +657,6 @@ dri2_initialize_drm(_EGLDisplay *disp)
dri2_dpy->gbm_dri->base.v0.surface_release_buffer = release_buffer;
dri2_dpy->gbm_dri->base.v0.surface_has_free_buffers = has_free_buffers;
if (!dri2_setup_extensions(disp)) {
err = "DRI2: failed to find required DRI extensions";
goto cleanup;
}
if (!dri2_setup_device(disp, dri2_dpy->gbm_dri->software)) {
err = "DRI2: failed to setup EGLDevice";
goto cleanup;

View File

@@ -348,11 +348,6 @@ dri2_initialize_surfaceless(_EGLDisplay *disp)
goto cleanup;
}
if (!dri2_setup_extensions(disp)) {
err = "DRI2: failed to find required DRI extensions";
goto cleanup;
}
dri2_setup_screen(disp);
#ifdef HAVE_WAYLAND_PLATFORM
dri2_dpy->device_name =

View File

@@ -2288,9 +2288,6 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp)
if (!dri2_create_screen(disp))
goto cleanup;
if (!dri2_setup_extensions(disp))
goto cleanup;
if (!dri2_setup_device(disp, false)) {
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
goto cleanup;
@@ -2964,9 +2961,6 @@ dri2_initialize_wayland_swrast(_EGLDisplay *disp)
if (!dri2_create_screen(disp))
goto cleanup;
if (!dri2_setup_extensions(disp))
goto cleanup;
if (!dri2_setup_device(disp, true)) {
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to setup EGLDevice");
goto cleanup;

View File

@@ -50,7 +50,7 @@
#include "util/log.h"
#include <sys/stat.h>
#include <sys/types.h>
#include "loader_x11.h"
#include "kopper_interface.h"
#include "loader.h"
#include "platform_x11.h"
@@ -1776,6 +1776,29 @@ check_xshm(struct dri2_egl_display *dri2_dpy)
return ret;
}
static EGLBoolean
dri2_x11_check_multibuffers(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
#ifdef HAVE_DRI3_MODIFIERS
#ifdef HAVE_X11_PLATFORM
if (dri2_dpy->conn) {
bool err;
dri2_dpy->multibuffers_available = x11_dri3_check_multibuffer(dri2_dpy->conn, &err);
}
#endif
if (disp->Options.Zink && !disp->Options.ForceSoftware &&
!dri2_dpy->multibuffers_available &&
/* this is enum _egl_platform_type */
(disp->Platform == _EGL_PLATFORM_X11 ||
disp->Platform == _EGL_PLATFORM_XCB) &&
!debug_get_bool_option("LIBGL_KOPPER_DRI2", false))
return EGL_FALSE;
#endif
return EGL_TRUE;
}
static EGLBoolean
dri2_initialize_x11_swrast(_EGLDisplay *disp)
@@ -1810,7 +1833,7 @@ dri2_initialize_x11_swrast(_EGLDisplay *disp)
if (!dri2_create_screen(disp))
goto cleanup;
if (!dri2_setup_extensions(disp))
if (!dri2_x11_check_multibuffers(disp))
goto cleanup;
if (!dri2_setup_device(disp, true)) {
@@ -1896,7 +1919,7 @@ dri2_initialize_x11_dri3(_EGLDisplay *disp)
if (!dri2_create_screen(disp))
goto cleanup;
if (!dri2_setup_extensions(disp))
if (!dri2_x11_check_multibuffers(disp))
goto cleanup;
if (!dri2_setup_device(disp, false)) {
@@ -1999,7 +2022,7 @@ dri2_initialize_x11_dri2(_EGLDisplay *disp)
if (!dri2_create_screen(disp))
goto cleanup;
if (!dri2_setup_extensions(disp))
if (!dri2_x11_check_multibuffers(disp))
goto cleanup;
if (!dri2_setup_device(disp, false)) {