Skip to content

glx: fix build without dri3 and zink

Antoine Coutant requested to merge antco/mesa:add-guards-for-dri3-and-zink into main

What does this MR do and why?

This MR adds guards to prevent the use of dri3_priv.h header and dri3_check_multibuffer() function when DRI3 is disabled.

It also prevent automatic zink fallback when the zink gallium is not enabled at build time.

First commit

commit 1887368df41 ("glx/sw: check for modifier support in the kopper path")
added dri3_priv.h header and dri3_check_multibuffer() function in drisw that
can be build without dri3.

  i686-buildroot-linux-gnu/bin/ld: src/glx/libglx.a.p/drisw_glx.c.o: in function `driswCreateScreenDriver':
  drisw_glx.c:(.text.driswCreateScreenDriver+0x3a0): undefined reference to `dri3_check_multibuffer'
  collect2: error: ld returned 1 exit status

Add HAVE_DRI3 guard around dri3_priv.h header and the zink code using
dri3_check_multibuffer().

Fixes: 1887368df41 ("glx/sw: check for modifier support in the kopper path")

Signed-off-by: Romain Naour <romain.naour@smile.fr>

Second commit

Commit 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers")
added an automatic zink fallback even when the zink gallium is not
enabled at build time.

It leads to unexpected error log while loading drisw driver and
zink is not installed on the rootfs:

  MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so

Fixes: 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers")

Signed-off-by: Romain Naour <romain.naour@smile.fr>

Merge request reports