gallium: Do not include offscreen winsys if glx is disabled

Offscreen winsys introduced in Mesa 22.2 depends on glx(dri) and libswkmsdri.

The error message is:
/usr/bin/ld: src/gallium/auxiliary/libgalliumvlwinsys.a.p/vl_vl_winsys_dri_vgem.c.o: in function `vl_vgem_drm_screen_create':
vl_winsys_dri_vgem.c:(.text.vl_vgem_drm_screen_create+0x28): undefined reference to `kms_dri_create_winsys'

Fixes: 31dcb396 (gallium/vl: Add software winsys and offscreen winsys)

Cc: mesa-stable
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18843>
(cherry picked from commit ae201bcd42a7b5efe5b21270e081d242d2a97aad)
This commit is contained in:
nyanmisaka 2022-09-28 02:38:42 +08:00 committed by Dylan Baker
parent 5a4a4f8f8e
commit 71b0b79e58
3 changed files with 6 additions and 2 deletions

View File

@ -427,7 +427,7 @@
"description": "gallium: Do not include offscreen winsys if glx is disabled",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "31dcb39615a5d1541a7e5b27e19566b48aac381d"
},

View File

@ -474,7 +474,7 @@ endif
if with_glx == 'xlib' or with_glx == 'gallium-xlib'
files_libgalliumvlwinsys += files('vl/vl_winsys_xlib_swrast.c')
else
elif with_gallium_drisw_kms
files_libgalliumvlwinsys += files('vl/vl_winsys_dri_vgem.c')
endif

View File

@ -35,7 +35,9 @@
#include "vl/vl_winsys.h"
#include "va_private.h"
#ifdef HAVE_DRISW_KMS
#include "loader/loader.h"
#endif
#include <va/va_drmcommon.h>
@ -142,12 +144,14 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
FREE(drv);
return VA_STATUS_ERROR_INVALID_PARAMETER;
}
#ifdef HAVE_DRISW_KMS
char* drm_driver_name = loader_get_driver_for_fd(drm_info->fd);
if(drm_driver_name) {
if (strcmp(drm_driver_name, "vgem") == 0)
drv->vscreen = vl_vgem_drm_screen_create(drm_info->fd);
FREE(drm_driver_name);
}
#endif
if(!drv->vscreen)
drv->vscreen = vl_drm_screen_create(drm_info->fd);
break;