virtio/vdrm: add ENABLE_DRM_AMDGPU for c_args

ENABLE_DRM_AMDGPU must be defined when amdgpu_virtio is enabled;
otherwise, vdrm and amdgpu_virtio will have different definitions of
struct virgl_renderer_capset_drm. As a result, on amdgpu_virtio side,
the content of struct vdrm_device will be corrupted.

Thanks Honglei Huang <honglei1.huang@amd.com> for pointing out the
different definitions of struct virgl_renderer_capset_drm.

Cc: mesa-stable
Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37023>
This commit is contained in:
Trigger Huang 2025-08-27 19:09:19 +08:00 committed by Marge Bot
parent 6bc70a0e8f
commit 5736280730

View file

@ -3,6 +3,10 @@
inc_virtio_vdrm = include_directories('.')
libvdrm_c_args = [no_override_init_args]
if with_amdgpu_virtio
libvdrm_c_args += ['-DENABLE_DRM_AMDGPU']
endif
libvdrm = static_library(
'libvdrm',
[
@ -17,7 +21,7 @@ libvdrm = static_library(
inc_virtio,
inc_virtio_gpu,
],
c_args : [ no_override_init_args ],
c_args : libvdrm_c_args,
gnu_symbol_visibility: 'hidden',
dependencies: [
dep_libdrm,