egl: don't set ForceSoftware for all zink loading
sometimes this is desired, other times it isn't Reviewed-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25526>
This commit is contained in:
committed by
Marge Bot
parent
a2e96a86e1
commit
78f3db760d
@@ -220,7 +220,7 @@ static const __DRIextension *swrast_loader_extensions[] = {
|
||||
};
|
||||
|
||||
static bool
|
||||
surfaceless_probe_device(_EGLDisplay *disp, bool swrast)
|
||||
surfaceless_probe_device(_EGLDisplay *disp, bool swrast, bool zink)
|
||||
{
|
||||
const unsigned node_type = swrast ? DRM_NODE_PRIMARY : DRM_NODE_RENDER;
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
@@ -260,7 +260,7 @@ surfaceless_probe_device(_EGLDisplay *disp, bool swrast)
|
||||
}
|
||||
|
||||
if (dri2_dpy->driver_name && dri2_load_driver_dri3(disp)) {
|
||||
if (swrast)
|
||||
if (swrast || zink)
|
||||
dri2_dpy->loader_extensions = swrast_loader_extensions;
|
||||
else
|
||||
dri2_dpy->loader_extensions = image_loader_extensions;
|
||||
@@ -323,7 +323,8 @@ dri2_initialize_surfaceless(_EGLDisplay *disp)
|
||||
/* When ForceSoftware is false, we try the HW driver. When ForceSoftware
|
||||
* is true, we try kms_swrast and swrast in order.
|
||||
*/
|
||||
driver_loaded = surfaceless_probe_device(disp, disp->Options.ForceSoftware);
|
||||
driver_loaded = surfaceless_probe_device(disp, disp->Options.ForceSoftware,
|
||||
disp->Options.Zink);
|
||||
if (!driver_loaded && disp->Options.ForceSoftware) {
|
||||
_eglLog(_EGL_DEBUG, "Falling back to surfaceless swrast without DRM.");
|
||||
driver_loaded = surfaceless_probe_device_sw(disp);
|
||||
|
||||
@@ -2830,7 +2830,7 @@ cleanup:
|
||||
EGLBoolean
|
||||
dri2_initialize_wayland(_EGLDisplay *disp)
|
||||
{
|
||||
if (disp->Options.ForceSoftware)
|
||||
if (disp->Options.ForceSoftware || disp->Options.Zink)
|
||||
return dri2_initialize_wayland_swrast(disp);
|
||||
else
|
||||
return dri2_initialize_wayland_drm(disp);
|
||||
|
||||
@@ -1785,7 +1785,7 @@ cleanup:
|
||||
EGLBoolean
|
||||
dri2_initialize_x11(_EGLDisplay *disp)
|
||||
{
|
||||
if (disp->Options.ForceSoftware)
|
||||
if (disp->Options.ForceSoftware || disp->Options.Zink)
|
||||
return dri2_initialize_x11_swrast(disp);
|
||||
|
||||
#ifdef HAVE_DRI3
|
||||
|
||||
@@ -682,7 +682,6 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
|
||||
|
||||
const char *env = getenv("MESA_LOADER_DRIVER_OVERRIDE");
|
||||
disp->Options.Zink = env && !strcmp(env, "zink");
|
||||
disp->Options.ForceSoftware |= disp->Options.Zink;
|
||||
|
||||
const char *gallium_hud_env = getenv("GALLIUM_HUD");
|
||||
disp->Options.GalliumHudWarn =
|
||||
@@ -696,6 +695,7 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
|
||||
if (disp->Options.ForceSoftware)
|
||||
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
|
||||
else {
|
||||
disp->Options.Zink = EGL_FALSE;
|
||||
disp->Options.ForceSoftware = EGL_TRUE;
|
||||
if (!_eglDriver.Initialize(disp))
|
||||
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
|
||||
|
||||
Reference in New Issue
Block a user