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:
@@ -31,6 +31,7 @@
|
||||
#include "c11/threads.h"
|
||||
#include "util/rounding.h"
|
||||
#include "util/bitscan.h"
|
||||
#include "util/detect_os.h"
|
||||
#include "util/list.h"
|
||||
#include "util/log.h"
|
||||
#include "util/macros.h"
|
||||
|
@@ -273,7 +273,7 @@ get_device_extensions(const struct tu_physical_device *device,
|
||||
|
||||
/* For Graphics Flight Recorder (GFR) */
|
||||
.AMD_buffer_marker = true,
|
||||
#ifdef ANDROID
|
||||
#if DETECT_OS_ANDROID
|
||||
.ANDROID_native_buffer = true,
|
||||
#endif
|
||||
.ARM_rasterization_order_attachment_access = true,
|
||||
|
@@ -236,7 +236,7 @@ struct tu_pvtmem_bo {
|
||||
uint32_t per_fiber_size, per_sp_size;
|
||||
};
|
||||
|
||||
#ifdef ANDROID
|
||||
#if DETECT_OS_ANDROID
|
||||
enum tu_gralloc_type
|
||||
{
|
||||
TU_GRALLOC_UNKNOWN,
|
||||
@@ -379,7 +379,7 @@ struct tu_device
|
||||
struct tu_cs *dbg_cmdbuf_stomp_cs;
|
||||
struct tu_cs *dbg_renderpass_stomp_cs;
|
||||
|
||||
#ifdef ANDROID
|
||||
#if DETECT_OS_ANDROID
|
||||
const void *gralloc;
|
||||
enum tu_gralloc_type gralloc_type;
|
||||
#endif
|
||||
|
@@ -726,7 +726,7 @@ tu_CreateImage(VkDevice _device,
|
||||
modifier = DRM_FORMAT_MOD_LINEAR;
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
#if DETECT_OS_ANDROID
|
||||
const VkNativeBufferANDROID *gralloc_info =
|
||||
vk_find_struct_const(pCreateInfo->pNext, NATIVE_BUFFER_ANDROID);
|
||||
int dma_buf;
|
||||
@@ -746,7 +746,7 @@ tu_CreateImage(VkDevice _device,
|
||||
|
||||
*pImage = tu_image_to_handle(image);
|
||||
|
||||
#ifdef ANDROID
|
||||
#if DETECT_OS_ANDROID
|
||||
if (gralloc_info)
|
||||
return tu_import_memory_from_gralloc_handle(_device, dma_buf, alloc,
|
||||
*pImage);
|
||||
@@ -765,7 +765,7 @@ tu_DestroyImage(VkDevice _device,
|
||||
if (!image)
|
||||
return;
|
||||
|
||||
#ifdef ANDROID
|
||||
#if DETECT_OS_ANDROID
|
||||
if (image->owned_memory != VK_NULL_HANDLE)
|
||||
tu_FreeMemory(_device, image->owned_memory, pAllocator);
|
||||
#endif
|
||||
|
@@ -25,7 +25,7 @@ struct tu_image
|
||||
struct fdl_layout layout[3];
|
||||
uint32_t total_size;
|
||||
|
||||
#ifdef ANDROID
|
||||
#if DETECT_OS_ANDROID
|
||||
/* For VK_ANDROID_native_buffer, the WSI image owns the memory, */
|
||||
VkDeviceMemory owned_memory;
|
||||
#endif
|
||||
|
@@ -187,7 +187,7 @@ l1_dcache_size()
|
||||
return 0;
|
||||
|
||||
#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: */
|
||||
uint64_t ctr_el0;
|
||||
asm("mrs\t%x0, ctr_el0" : "=r"(ctr_el0));
|
||||
|
@@ -311,7 +311,7 @@ tu_perfetto_init(void)
|
||||
util_perfetto_init();
|
||||
|
||||
perfetto::DataSourceDescriptor dsd;
|
||||
#ifdef ANDROID
|
||||
#if DETECT_OS_ANDROID
|
||||
/* AGI requires this name */
|
||||
dsd.set_name("gpu.renderstages");
|
||||
#else
|
||||
|
Reference in New Issue
Block a user