turnip: refactor to use DETECT_OS_ANDROID instead of ANDROID

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27374>
This commit is contained in:
Yiwei Zhang
2024-01-30 13:44:29 -08:00
committed by Marge Bot
parent 5df083eff7
commit 5a37340689
7 changed files with 10 additions and 9 deletions

View File

@@ -31,6 +31,7 @@
#include "c11/threads.h" #include "c11/threads.h"
#include "util/rounding.h" #include "util/rounding.h"
#include "util/bitscan.h" #include "util/bitscan.h"
#include "util/detect_os.h"
#include "util/list.h" #include "util/list.h"
#include "util/log.h" #include "util/log.h"
#include "util/macros.h" #include "util/macros.h"

View File

@@ -273,7 +273,7 @@ get_device_extensions(const struct tu_physical_device *device,
/* For Graphics Flight Recorder (GFR) */ /* For Graphics Flight Recorder (GFR) */
.AMD_buffer_marker = true, .AMD_buffer_marker = true,
#ifdef ANDROID #if DETECT_OS_ANDROID
.ANDROID_native_buffer = true, .ANDROID_native_buffer = true,
#endif #endif
.ARM_rasterization_order_attachment_access = true, .ARM_rasterization_order_attachment_access = true,

View File

@@ -236,7 +236,7 @@ struct tu_pvtmem_bo {
uint32_t per_fiber_size, per_sp_size; uint32_t per_fiber_size, per_sp_size;
}; };
#ifdef ANDROID #if DETECT_OS_ANDROID
enum tu_gralloc_type enum tu_gralloc_type
{ {
TU_GRALLOC_UNKNOWN, TU_GRALLOC_UNKNOWN,
@@ -379,7 +379,7 @@ struct tu_device
struct tu_cs *dbg_cmdbuf_stomp_cs; struct tu_cs *dbg_cmdbuf_stomp_cs;
struct tu_cs *dbg_renderpass_stomp_cs; struct tu_cs *dbg_renderpass_stomp_cs;
#ifdef ANDROID #if DETECT_OS_ANDROID
const void *gralloc; const void *gralloc;
enum tu_gralloc_type gralloc_type; enum tu_gralloc_type gralloc_type;
#endif #endif

View File

@@ -726,7 +726,7 @@ tu_CreateImage(VkDevice _device,
modifier = DRM_FORMAT_MOD_LINEAR; modifier = DRM_FORMAT_MOD_LINEAR;
} }
#ifdef ANDROID #if DETECT_OS_ANDROID
const VkNativeBufferANDROID *gralloc_info = const VkNativeBufferANDROID *gralloc_info =
vk_find_struct_const(pCreateInfo->pNext, NATIVE_BUFFER_ANDROID); vk_find_struct_const(pCreateInfo->pNext, NATIVE_BUFFER_ANDROID);
int dma_buf; int dma_buf;
@@ -746,7 +746,7 @@ tu_CreateImage(VkDevice _device,
*pImage = tu_image_to_handle(image); *pImage = tu_image_to_handle(image);
#ifdef ANDROID #if DETECT_OS_ANDROID
if (gralloc_info) if (gralloc_info)
return tu_import_memory_from_gralloc_handle(_device, dma_buf, alloc, return tu_import_memory_from_gralloc_handle(_device, dma_buf, alloc,
*pImage); *pImage);
@@ -765,7 +765,7 @@ tu_DestroyImage(VkDevice _device,
if (!image) if (!image)
return; return;
#ifdef ANDROID #if DETECT_OS_ANDROID
if (image->owned_memory != VK_NULL_HANDLE) if (image->owned_memory != VK_NULL_HANDLE)
tu_FreeMemory(_device, image->owned_memory, pAllocator); tu_FreeMemory(_device, image->owned_memory, pAllocator);
#endif #endif

View File

@@ -25,7 +25,7 @@ struct tu_image
struct fdl_layout layout[3]; struct fdl_layout layout[3];
uint32_t total_size; uint32_t total_size;
#ifdef ANDROID #if DETECT_OS_ANDROID
/* For VK_ANDROID_native_buffer, the WSI image owns the memory, */ /* For VK_ANDROID_native_buffer, the WSI image owns the memory, */
VkDeviceMemory owned_memory; VkDeviceMemory owned_memory;
#endif #endif

View File

@@ -187,7 +187,7 @@ l1_dcache_size()
return 0; return 0;
#if DETECT_ARCH_AARCH64 && \ #if DETECT_ARCH_AARCH64 && \
(!defined(_SC_LEVEL1_DCACHE_LINESIZE) || defined(ANDROID)) (!defined(_SC_LEVEL1_DCACHE_LINESIZE) || DETECT_OS_ANDROID)
/* Bionic does not implement _SC_LEVEL1_DCACHE_LINESIZE properly: */ /* Bionic does not implement _SC_LEVEL1_DCACHE_LINESIZE properly: */
uint64_t ctr_el0; uint64_t ctr_el0;
asm("mrs\t%x0, ctr_el0" : "=r"(ctr_el0)); asm("mrs\t%x0, ctr_el0" : "=r"(ctr_el0));

View File

@@ -311,7 +311,7 @@ tu_perfetto_init(void)
util_perfetto_init(); util_perfetto_init();
perfetto::DataSourceDescriptor dsd; perfetto::DataSourceDescriptor dsd;
#ifdef ANDROID #if DETECT_OS_ANDROID
/* AGI requires this name */ /* AGI requires this name */
dsd.set_name("gpu.renderstages"); dsd.set_name("gpu.renderstages");
#else #else