mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
egl/glx: make detecting explicit modifier support more explicit
explicit modifier usage is different from general modifier capability Reviewed-by: Marek Olšák <marek.olsak@amd.com> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11652, https://gitlab.freedesktop.org/mesa/mesa/-/issues/11663 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30662>
This commit is contained in:
parent
c20d6a9197
commit
694478025d
6 changed files with 12 additions and 8 deletions
|
|
@ -273,6 +273,7 @@ struct dri2_egl_display {
|
|||
|
||||
bool has_dmabuf_import;
|
||||
bool has_dmabuf_export;
|
||||
bool explicit_modifiers;
|
||||
bool multibuffers_available;
|
||||
#ifdef HAVE_X11_PLATFORM
|
||||
xcb_connection_t *conn;
|
||||
|
|
|
|||
|
|
@ -1783,7 +1783,7 @@ dri2_x11_check_multibuffers(_EGLDisplay *disp)
|
|||
|
||||
#ifdef HAVE_DRI3_MODIFIERS
|
||||
bool err;
|
||||
dri2_dpy->multibuffers_available = x11_dri3_check_multibuffer(dri2_dpy->conn, &err);
|
||||
dri2_dpy->multibuffers_available = x11_dri3_check_multibuffer(dri2_dpy->conn, &err, &dri2_dpy->explicit_modifiers);
|
||||
|
||||
if (disp->Options.Zink && !disp->Options.ForceSoftware &&
|
||||
!dri2_dpy->multibuffers_available &&
|
||||
|
|
|
|||
|
|
@ -598,6 +598,7 @@ struct glx_display
|
|||
|
||||
__glxHashTable *dri2Hash;
|
||||
bool has_multibuffer;
|
||||
bool has_explicit_modifiers;
|
||||
#endif
|
||||
#ifdef GLX_USE_WINDOWSGL
|
||||
__GLXDRIdisplay *windowsdriDisplay;
|
||||
|
|
|
|||
|
|
@ -978,7 +978,7 @@ __glXInitialize(Display * dpy)
|
|||
#if defined(GLX_USE_DRM)
|
||||
bool dri3_err = false;
|
||||
if (glx_direct && glx_accel && dri3)
|
||||
dpyPriv->has_multibuffer = x11_dri3_check_multibuffer(XGetXCBConnection(dpy), &dri3_err);
|
||||
dpyPriv->has_multibuffer = x11_dri3_check_multibuffer(XGetXCBConnection(dpy), &dri3_err, &dpyPriv->has_explicit_modifiers);
|
||||
if (glx_direct && glx_accel &&
|
||||
(!(glx_driver & GLX_DRIVER_ZINK_YES) || !kopper)) {
|
||||
#if defined(HAVE_DRI3)
|
||||
|
|
@ -1006,7 +1006,7 @@ __glXInitialize(Display * dpy)
|
|||
if (glx_direct)
|
||||
glx_driver |= GLX_DRIVER_SW;
|
||||
|
||||
if (!dpyPriv->has_multibuffer && glx_accel && !debug_get_bool_option("LIBGL_KOPPER_DRI2", false)) {
|
||||
if (!dpyPriv->has_explicit_modifiers && glx_accel && !debug_get_bool_option("LIBGL_KOPPER_DRI2", false)) {
|
||||
if (glx_driver & GLX_DRIVER_ZINK_YES) {
|
||||
/* only print error if zink was explicitly requested */
|
||||
CriticalErrorMessageF("DRI3 not available\n");
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ x11_dri3_open(xcb_connection_t *conn,
|
|||
#endif
|
||||
|
||||
bool
|
||||
x11_dri3_check_multibuffer(xcb_connection_t *c, bool *err)
|
||||
x11_dri3_check_multibuffer(xcb_connection_t *c, bool *err, bool *explicit_modifiers)
|
||||
{
|
||||
xcb_dri3_query_version_cookie_t dri3_cookie;
|
||||
xcb_dri3_query_version_reply_t *dri3_reply;
|
||||
|
|
@ -140,9 +140,11 @@ x11_dri3_check_multibuffer(xcb_connection_t *c, bool *err)
|
|||
free(present_reply);
|
||||
|
||||
#ifdef HAVE_DRI3_MODIFIERS
|
||||
if ((dri3Major > 1 || (dri3Major == 1 && dri3Minor >= 2)) &&
|
||||
(presentMajor > 1 || (presentMajor == 1 && presentMinor >= 2)))
|
||||
return true;
|
||||
if (presentMajor > 1 || (presentMajor == 1 && presentMinor >= 2)) {
|
||||
*explicit_modifiers = dri3Major > 1 || (dri3Major == 1 && dri3Minor >= 2);
|
||||
if (dri3Major >= 1)
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
error:
|
||||
|
|
|
|||
|
|
@ -27,6 +27,6 @@
|
|||
#include <xcb/xcb.h>
|
||||
#include <inttypes.h>
|
||||
int x11_dri3_open(xcb_connection_t *conn, xcb_window_t root, uint32_t provider);
|
||||
bool x11_dri3_check_multibuffer(xcb_connection_t *c, bool *err);
|
||||
bool x11_dri3_check_multibuffer(xcb_connection_t *c, bool *err, bool *explicit_modifiers);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue