From c5ced9e43033115100d72f48b127981a13e866c8 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Mon, 22 Jan 2024 10:19:40 -0800 Subject: [PATCH] gfxstream: nuke HOST_BUILD The host build has been deprecated in favor of end2end tests. Reviewed-by: Aaron Ruby Acked-by: Yonggang Luo Acked-by: Adam Jackson Part-of: --- .../GoldfishAddressSpace/AddressSpaceStream.cpp | 2 +- .../goldfish_address_space.cpp | 4 +--- .../GoldfishAddressSpace/include/address_space.h | 2 -- .../include/goldfish_address_space.h | 10 ---------- .../guest/vulkan_enc/AndroidHardwareBuffer.cpp | 5 ----- .../guest/vulkan_enc/ResourceTracker.cpp | 16 +++------------- 6 files changed, 5 insertions(+), 34 deletions(-) diff --git a/src/gfxstream/guest/GoldfishAddressSpace/AddressSpaceStream.cpp b/src/gfxstream/guest/GoldfishAddressSpace/AddressSpaceStream.cpp index 7068fab8af3..d7262a84a2d 100644 --- a/src/gfxstream/guest/GoldfishAddressSpace/AddressSpaceStream.cpp +++ b/src/gfxstream/guest/GoldfishAddressSpace/AddressSpaceStream.cpp @@ -592,7 +592,7 @@ int AddressSpaceStream::type1Write(uint32_t bufferOffset, size_t size) { } void AddressSpaceStream::backoff() { -#if defined(HOST_BUILD) || defined(__APPLE__) || defined(__MACOSX) || defined(__Fuchsia__) || defined(__linux__) +#if defined(__APPLE__) || defined(__MACOSX) || defined(__Fuchsia__) || defined(__linux__) static const uint32_t kBackoffItersThreshold = 50000000; static const uint32_t kBackoffFactorDoublingIncrement = 50000000; #elif defined(__ANDROID__) diff --git a/src/gfxstream/guest/GoldfishAddressSpace/goldfish_address_space.cpp b/src/gfxstream/guest/GoldfishAddressSpace/goldfish_address_space.cpp index 7bb628c5638..3618d325e4c 100644 --- a/src/gfxstream/guest/GoldfishAddressSpace/goldfish_address_space.cpp +++ b/src/gfxstream/guest/GoldfishAddressSpace/goldfish_address_space.cpp @@ -13,9 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if defined(HOST_BUILD) -#include "goldfish_address_space_host.impl" -#elif defined(__Fuchsia__) +#if defined(__Fuchsia__) #include "goldfish_address_space_fuchsia.impl" #else #include "goldfish_address_space_android.impl" diff --git a/src/gfxstream/guest/GoldfishAddressSpace/include/address_space.h b/src/gfxstream/guest/GoldfishAddressSpace/include/address_space.h index e788e608071..60bff6daa3d 100644 --- a/src/gfxstream/guest/GoldfishAddressSpace/include/address_space.h +++ b/src/gfxstream/guest/GoldfishAddressSpace/include/address_space.h @@ -19,8 +19,6 @@ #if defined(__Fuchsia__) typedef void* address_space_handle_t; -#elif defined(HOST_BUILD) - typedef uint32_t address_space_handle_t; #else typedef int address_space_handle_t; #endif diff --git a/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space.h b/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space.h index d15568829fc..bd61fd61976 100644 --- a/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space.h +++ b/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space.h @@ -27,16 +27,6 @@ class GoldfishAddressSpaceBlock; class GoldfishAddressSpaceHostMemoryAllocator; -#ifdef HOST_BUILD - -namespace android { - -class HostAddressSpaceDevice; - -} // namespace android - -#endif - using GoldfishAddressSpaceSubdeviceType = AddressSpaceSubdeviceType; class GoldfishAddressSpaceBlockProvider { diff --git a/src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.cpp b/src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.cpp index eac0cafb3a6..0cb77949a6e 100644 --- a/src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.cpp +++ b/src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.cpp @@ -14,12 +14,10 @@ // limitations under the License. #include "AndroidHardwareBuffer.h" -#if !defined(HOST_BUILD) #if defined(__ANDROID__) || defined(__linux__) #include #define DRM_FORMAT_YVU420_ANDROID fourcc_code('9', '9', '9', '7') #endif -#endif #include @@ -135,7 +133,6 @@ VkResult getAndroidHardwareBufferPropertiesANDROID( ahbFormatProps->samplerYcbcrConversionComponents.b = VK_COMPONENT_SWIZZLE_IDENTITY; ahbFormatProps->samplerYcbcrConversionComponents.a = VK_COMPONENT_SWIZZLE_IDENTITY; -#if !defined(HOST_BUILD) #if defined(__ANDROID__) || defined(__linux__) if (android_format_is_yuv(format)) { uint32_t drmFormat = grallocHelper->getFormatDrmFourcc(buffer); @@ -193,8 +190,6 @@ VkResult getAndroidHardwareBufferPropertiesANDROID( } } #endif -#endif - ahbFormatProps->suggestedYcbcrModel = android_format_is_yuv(format) ? VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601 : VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY; diff --git a/src/gfxstream/guest/vulkan_enc/ResourceTracker.cpp b/src/gfxstream/guest/vulkan_enc/ResourceTracker.cpp index 2cea97d81d9..e51c795ad39 100644 --- a/src/gfxstream/guest/vulkan_enc/ResourceTracker.cpp +++ b/src/gfxstream/guest/vulkan_enc/ResourceTracker.cpp @@ -50,22 +50,12 @@ #include #include -#ifdef HOST_BUILD -#include "android/utils/tempfile.h" -#endif static inline int inline_memfd_create(const char* name, unsigned int flags) { -#ifdef HOST_BUILD - TempFile* tmpFile = tempfile_create(); - return open(tempfile_path(tmpFile), O_RDWR); - // TODO: Windows is not suppose to support VkSemaphoreGetFdInfoKHR -#elif !defined(__ANDROID__) - (void)name; - (void)flags; - ALOGE("Not yet supported."); - abort(); -#else +#if defined(__ANDROID__) return syscall(SYS_memfd_create, name, flags); +#else + return -1; #endif }