From f29b92a46d928408e316dccd9c18629bb71d526d Mon Sep 17 00:00:00 2001 From: Lei Huang Date: Mon, 8 Jun 2026 09:06:12 +0800 Subject: [PATCH] amd/virtio: enable Android amdgpu-virtio build option Android builds need to pass the Meson amdgpu-virtio option explicitly. Add BOARD_MESA3D_AMDGPU_VIRTIO handling and forward it to Meson, defaulting to false when the board flag is not set. Use the same quoted amdgpu.h include style as the other AMD virtio headers so the Android build resolves the header through Mesa's configured include paths. Signed-off-by: Lei Huang Reviewed-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Valentine Burley Part-of: --- android/mesa3d_cross.mk | 1 + src/amd/common/virtio/amdgpu_virtio.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/android/mesa3d_cross.mk b/android/mesa3d_cross.mk index ddb29151df3..8e709a435ab 100644 --- a/android/mesa3d_cross.mk +++ b/android/mesa3d_cross.mk @@ -94,6 +94,7 @@ MESON_GEN_NINJA := \ -Dgbm-backends-path=/vendor/$(MESA3D_LIB_DIR) \ -Degl=$(if $(BOARD_MESA3D_GALLIUM_DRIVERS),enabled,disabled) \ -Dllvm=$(if $(MESON_GEN_LLVM_STUB),enabled,disabled) \ + -Damdgpu-virtio=$(if $(filter true,$(BOARD_MESA3D_AMDGPU_VIRTIO)),true,false)\ -Dcpp_rtti=false \ -Dlmsensors=disabled \ -Dandroid-libbacktrace=disabled \ diff --git a/src/amd/common/virtio/amdgpu_virtio.c b/src/amd/common/virtio/amdgpu_virtio.c index 12d7b6cb5d3..00494d6a750 100644 --- a/src/amd/common/virtio/amdgpu_virtio.c +++ b/src/amd/common/virtio/amdgpu_virtio.c @@ -13,7 +13,7 @@ #include #include -#include +#include "amdgpu.h" #include "amdgpu_virtio_private.h" #include "drm-uapi/amdgpu_drm.h" @@ -531,4 +531,4 @@ amdvgpu_va_range_alloc(amdvgpu_device_handle dev, bool amdvgpu_has_vm_always_valid(amdvgpu_device_handle dev) { return dev->vdev->caps.u.amdgpu.has_vm_always_valid; -} \ No newline at end of file +}