gfxstream: Replace pre-processor (LINUX && !ANDROID) checks with LINUX_GUEST_BUILD

My understanding is that (Linux && !Android) is practically what is meant by
LINUX_GUEST_BUILD. Let's be consistent about this.

Reviewed-By: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33364>
This commit is contained in:
Aaron Ruby 2025-01-30 17:26:16 -05:00 committed by Marge Bot
parent bb6d371c0e
commit 4ea4b6c98b

View file

@ -1791,7 +1791,7 @@ VkResult ResourceTracker::on_vkEnumerateDeviceExtensionProperties(
"VK_KHR_external_fence_fd",
"VK_EXT_device_memory_report",
#endif
#if DETECT_OS_LINUX && !defined(VK_USE_PLATFORM_ANDROID_KHR)
#ifdef LINUX_GUEST_BUILD
"VK_KHR_imageless_framebuffer",
#endif
// Vulkan 1.3
@ -1894,7 +1894,7 @@ VkResult ResourceTracker::on_vkEnumerateDeviceExtensionProperties(
filteredExts.push_back(VkExtensionProperties{"VK_FUCHSIA_external_memory", 1});
filteredExts.push_back(VkExtensionProperties{"VK_FUCHSIA_buffer_collection", 1});
#endif
#if !defined(VK_USE_PLATFORM_ANDROID_KHR) && DETECT_OS_LINUX
#ifdef LINUX_GUEST_BUILD
filteredExts.push_back(VkExtensionProperties{"VK_KHR_external_memory_fd", 1});
filteredExts.push_back(VkExtensionProperties{"VK_EXT_external_memory_dma_buf", 1});
// In case the host doesn't support format modifiers, they are emulated
@ -2066,7 +2066,7 @@ VkResult ResourceTracker::on_vkEnumeratePhysicalDevices(void* context, VkResult,
void ResourceTracker::on_vkGetPhysicalDeviceProperties(void*, VkPhysicalDevice,
VkPhysicalDeviceProperties* pProperties) {
#if DETECT_OS_LINUX && !defined(VK_USE_PLATFORM_ANDROID_KHR)
#ifdef LINUX_GUEST_BUILD
if (pProperties) {
if (VK_PHYSICAL_DEVICE_TYPE_CPU == pProperties->deviceType) {
/* For Linux guest: Even if host driver reports DEVICE_TYPE_CPU,
@ -3297,7 +3297,7 @@ VkResult ResourceTracker::on_vkAllocateMemory(void* context, VkResult input_resu
void* ahw = nullptr;
#endif
#if DETECT_OS_LINUX && !defined(VK_USE_PLATFORM_ANDROID_KHR)
#ifdef LINUX_GUEST_BUILD
const VkImportMemoryFdInfoKHR* importFdInfoPtr =
vk_find_struct_const(pAllocateInfo, IMPORT_MEMORY_FD_INFO_KHR);
#else
@ -5830,7 +5830,7 @@ VkResult ResourceTracker::on_vkImportSemaphoreFdKHR(
VkResult ResourceTracker::on_vkGetMemoryFdPropertiesKHR(
void* context, VkResult, VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd,
VkMemoryFdPropertiesKHR* pMemoryFdProperties) {
#if DETECT_OS_LINUX && !defined(VK_USE_PLATFORM_ANDROID_KHR)
#ifdef LINUX_GUEST_BUILD
if (!(handleType & VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT)) {
mesa_loge("%s: VK_KHR_external_memory_fd behavior not defined for handleType: 0x%x\n",
__func__, handleType);
@ -5865,7 +5865,7 @@ VkResult ResourceTracker::on_vkGetMemoryFdPropertiesKHR(
VkResult ResourceTracker::on_vkGetMemoryFdKHR(void* context, VkResult, VkDevice device,
const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd) {
#if DETECT_OS_LINUX && !defined(VK_USE_PLATFORM_ANDROID_KHR)
#ifdef LINUX_GUEST_BUILD
if (!pGetFdInfo) return VK_ERROR_OUT_OF_HOST_MEMORY;
if (!pGetFdInfo->memory) return VK_ERROR_OUT_OF_HOST_MEMORY;