dri2: protect glamor_egl_get_driver_name call with proper conditionnal

From 1.20.7 build:

aarch64-shadow-linux-libtool: compile:  aarch64-shadow-linux-gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/gitlab-runner/builds/1b4b81df/0/blade-group/dev/clients/boxes/meta-shadow-os/build/tmp/work/aarch64-shadow-linux/xserver-xorg/2_1.20.7-r0.shadow.1/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../../../../git/hw/xfree86/drivers/modesetting -I../../../../include -I../../../../../git/hw/xfree86 -I../../../../../git/hw/xfree86/include -I../../../../../git/hw/xfree86/common -I../../../../../git/hw/xfree86/os-support -I../../../../../git/hw/xfree86/os-support/bus -I../../../../../git/os -I../../../../../git/glamor -I../../../../../git/exa -I../../../../../git/dri3 -I../../../../../git/hw/xfree86/drivers/modesetting/../../ddc -I../../../../../git/hw/xfree86/drivers/modesetting/../../dri2 -I../../../../../git/hw/xfree86/drivers/modesetting/../../i2c -I../../../../../git/hw/xfree86/drivers/modesetting/../../modes -I../../../../../git/hw/xfree86/drivers/modesetting/../../parser -I../../../../../git/hw/xfree86/drivers/modesetting/../../ramdac -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wlogical-op -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -fno-strict-aliasing -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/home/gitlab-runner/builds/1b4b81df/0/blade-group/dev/clients/boxes/meta-shadow-os/build/tmp/work/aarch64-shadow-linux/xserver-xorg/2_1.20.7-r0.shadow.1/recipe-sysroot/usr/include/pixman-1 -I/home/gitlab-runner/builds/1b4b81df/0/blade-group/dev/clients/boxes/meta-shadow-os/build/tmp/work/aarch64-shadow-linux/xserver-xorg/2_1.20.7-r0.shadow.1/recipe-sysroot/usr/include/freetype2 -I/home/gitlab-runner/builds/1b4b81df/0/blade-group/dev/clients/boxes/meta-shadow-os/build/tmp/work/aarch64-shadow-linux/xserver-xorg/2_1.20.7-r0.shadow.1/recipe-sysroot/usr/include/libpng16 -I../../../../../git/include -I../../../../include -I../../../../../git/Xext -I../../../../../git/composite -I../../../../../git/damageext -I../../../../../git/xfixes -I../../../../../git/Xi -I../../../../../git/mi -I../../../../../git/miext/sync -I../../../../../git/miext/shadow -I../../../../../git/miext/damage -I../../../../../git/render -I../../../../../git/randr -I../../../../../git/fb -I../../../../../git/dbe -I../../../../../git/present -fvisibility=hidden -DHAVE_XORG_CONFIG_H -fvisibility=hidden -I/home/gitlab-runner/builds/1b4b81df/0/blade-group/dev/clients/boxes/meta-shadow-os/build/tmp/work/aarch64-shadow-linux/xserver-xorg/2_1.20.7-r0.shadow.1/recipe-sysroot/usr/include/libdrm -I/home/gitlab-runner/builds/1b4b81df/0/blade-group/dev/clients/boxes/meta-shadow-os/build/tmp/work/aarch64-shadow-linux/xserver-xorg/2_1.20.7-r0.shadow.1/recipe-sysroot/usr/include/libdrm -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wlogical-op -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/gitlab-runner/builds/1b4b81df/0/blade-group/dev/clients/boxes/meta-shadow-os/build/tmp/work/aarch64-shadow-linux/xserver-xorg/2_1.20.7-r0.shadow.1=/usr/src/debug/xserver-xorg/2_1.20.7-r0.shadow.1 -fdebug-prefix-map=/home/gitlab-runner/builds/1b4b81df/0/blade-group/dev/clients/boxes/meta-shadow-os/build/tmp/work/aarch64-shadow-linux/xserver-xorg/2_1.20.7-r0.shadow.1=/usr/src/debug/xserver-xorg/2_1.20.7-r0.shadow.1 -fdebug-prefix-map=/home/gitlab-runner/builds/1b4b81df/0/blade-group/dev/clients/boxes/meta-shadow-os/build/tmp/work/aarch64-shadow-linux/xserver-xorg/2_1.20.7-r0.shadow.1/recipe-sysroot= -fdebug-prefix-map=/home/gitlab-runner/builds/1b4b81df/0/blade-group/dev/clients/boxes/meta-shadow-os/build/tmp/work/aarch64-shadow-linux/xserver-xorg/2_1.20.7-r0.shadow.1/recipe-sysroot-native= -fcommon -pthread -c ../../../../../git/hw/xfree86/drivers/modesetting/dri2.c  -fPIC -DPIC -o .libs/dri2.o
    ../../../../../git/hw/xfree86/drivers/modesetting/dri2.c: In function 'ms_dri2_screen_init':
    ../../../../../git/hw/xfree86/drivers/modesetting/dri2.c:1089:23: error: implicit declaration of function 'glamor_egl_get_driver_name' [-Werror=implicit-function-declaration]
     1089 |     driver_names[0] = glamor_egl_get_driver_name(screen);
          |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../git/hw/xfree86/drivers/modesetting/dri2.c:1089:23: warning: nested extern declaration of 'glamor_egl_get_driver_name' [-Wnested-externs]
    ../../../../../git/hw/xfree86/drivers/modesetting/dri2.c:1089:21: warning: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     1089 |     driver_names[0] = glamor_egl_get_driver_name(screen);
          |                     ^
    cc1: some warnings being treated as errors
    Makefile:794: recipe for target 'dri2.lo' failed
    make[5]: *** [dri2.lo] Error 1
    make[5]: Leaving directory '/home/gitlab-runner/builds/1b4b81df/0/blade-group/dev/clients/boxes/meta-shadow-os/build/tmp/work/aarch64-shadow-linux/xserver-xorg/2_1.20.7-r0.shadow.1/build/hw/xfree86/drivers/modesetting'
3 jobs for fix-dri2-build in 9 minutes and 47 seconds (queued for 1 second)
latest
Status Job ID Name Coverage
  Docker Image
passed #2952335
debian-testing

00:01:00

 
  Build And Test
passed #2952336
autotools-build-and-test

00:08:46

passed #2952337
meson-build-and-test

00:01:10