gfxstream: nuke HOST_BUILD
The host build has been deprecated in favor of end2end tests.
BUG=311486792
TEST=compile
Change-Id: I45c529313c56f154b768ba3ca088588b7e305adc
diff --git a/guest/GoldfishAddressSpace/AddressSpaceStream.cpp b/guest/GoldfishAddressSpace/AddressSpaceStream.cpp
index 7068fab..d7262a8 100644
--- a/guest/GoldfishAddressSpace/AddressSpaceStream.cpp
+++ b/guest/GoldfishAddressSpace/AddressSpaceStream.cpp
@@ -592,7 +592,7 @@
}
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/guest/GoldfishAddressSpace/goldfish_address_space.cpp b/guest/GoldfishAddressSpace/goldfish_address_space.cpp
index 7bb628c..3618d32 100644
--- a/guest/GoldfishAddressSpace/goldfish_address_space.cpp
+++ b/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/guest/GoldfishAddressSpace/include/address_space.h b/guest/GoldfishAddressSpace/include/address_space.h
index e788e60..60bff6d 100644
--- a/guest/GoldfishAddressSpace/include/address_space.h
+++ b/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/guest/GoldfishAddressSpace/include/goldfish_address_space.h b/guest/GoldfishAddressSpace/include/goldfish_address_space.h
index d155688..bd61fd6 100644
--- a/guest/GoldfishAddressSpace/include/goldfish_address_space.h
+++ b/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/guest/GoldfishAddressSpace/include/goldfish_address_space_host.impl b/guest/GoldfishAddressSpace/include/goldfish_address_space_host.impl
deleted file mode 100644
index 51cd9f6..0000000
--- a/guest/GoldfishAddressSpace/include/goldfish_address_space_host.impl
+++ /dev/null
@@ -1,385 +0,0 @@
-// Copyright (C) 2019 The Android Open Source Project
-// Copyright (C) 2019 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "android/emulation/hostdevices/HostAddressSpace.h"
-
-#include <memory>
-
-#include <cutils/log.h>
-
-#include <errno.h>
-#include "goldfish_address_space.h"
-
-namespace {
-
-const int HOST_MEMORY_ALLOCATOR_COMMAND_ALLOCATE_ID = 1;
-const int HOST_MEMORY_ALLOCATOR_COMMAND_UNALLOCATE_ID = 2;
-
-} // namsepace
-
-using android::HostAddressSpaceDevice;
-using android::emulation::AddressSpaceDevicePingInfo;
-
-GoldfishAddressSpaceBlockProvider::GoldfishAddressSpaceBlockProvider(GoldfishAddressSpaceSubdeviceType subdevice)
- : m_handle(HostAddressSpaceDevice::get()->open())
-{
- if ((subdevice != GoldfishAddressSpaceSubdeviceType::NoSubdevice) && is_opened()) {
- AddressSpaceDevicePingInfo request;
- ::memset(&request, 0, sizeof(request));
- request.metadata = subdevice;
-
- HostAddressSpaceDevice::get()->ping(m_handle, &request);
- }
-}
-
-GoldfishAddressSpaceBlockProvider::~GoldfishAddressSpaceBlockProvider()
-{
- if (is_opened()) {
- HostAddressSpaceDevice::get()->close(m_handle);
- }
-}
-
-bool GoldfishAddressSpaceBlockProvider::is_opened() const
-{
- return m_handle > 0;
-}
-
-void GoldfishAddressSpaceBlockProvider::close()
-{
- if (is_opened()) {
- HostAddressSpaceDevice::get()->close(m_handle);
- m_handle = 0;
- }
-}
-
-address_space_handle_t GoldfishAddressSpaceBlockProvider::release()
-{
- address_space_handle_t handle = m_handle;
- m_handle = 0;
- return handle;
-}
-
-void GoldfishAddressSpaceBlockProvider::closeHandle(address_space_handle_t handle)
-{
- HostAddressSpaceDevice::get()->close(handle);
-}
-
-GoldfishAddressSpaceBlock::GoldfishAddressSpaceBlock()
- : m_handle(0)
- , m_mmaped_ptr(NULL)
- , m_phys_addr(0)
- , m_host_addr(0)
- , m_offset(0)
- , m_size(0)
- , m_is_shared_mapping(false) {}
-
-GoldfishAddressSpaceBlock::~GoldfishAddressSpaceBlock()
-{
- destroy();
-}
-
-GoldfishAddressSpaceBlock &GoldfishAddressSpaceBlock::operator=(const GoldfishAddressSpaceBlock &rhs)
-{
- m_mmaped_ptr = rhs.m_mmaped_ptr;
- m_phys_addr = rhs.m_phys_addr;
- m_host_addr = rhs.m_host_addr;
- m_offset = rhs.m_offset;
- m_size = rhs.m_size;
- m_is_shared_mapping = rhs.m_is_shared_mapping;
- m_handle = rhs.m_handle;
- return *this;
-}
-
-bool GoldfishAddressSpaceBlock::allocate(GoldfishAddressSpaceBlockProvider *provider, size_t size)
-{
- destroy();
-
- if (!provider->is_opened()) {
- return false;
- }
-
- m_size = size;
- m_offset =
- HostAddressSpaceDevice::get()->allocBlock(
- provider->m_handle, size, &m_phys_addr);
- m_handle = provider->m_handle;
- m_is_shared_mapping = false;
-
- return true;
-}
-
-bool GoldfishAddressSpaceBlock::claimShared(GoldfishAddressSpaceBlockProvider *provider, uint64_t offset, uint64_t size)
-{
- destroy();
-
- if (!provider->is_opened()) {
- return false;
- }
-
- int claimRes = HostAddressSpaceDevice::get()->claimShared(
- provider->m_handle, offset, size);
-
- if (claimRes) {
- ALOGE("%s: failed to claim shared region. Error: %d\n", __func__, claimRes);
- return false;
- }
-
- m_size = size;
- m_offset = offset;
- m_handle = provider->m_handle;
- m_is_shared_mapping = true;
- m_phys_addr = HostAddressSpaceDevice::get()->offsetToPhysAddr(m_offset);
-
- return true;
-}
-
-uint64_t GoldfishAddressSpaceBlock::physAddr() const
-{
- return m_phys_addr;
-}
-
-uint64_t GoldfishAddressSpaceBlock::hostAddr() const
-{
- return m_host_addr;
-}
-
-// In the host implementation:
-// mmap: is done by interpreting |host_addr| as the actual host address.
-void *GoldfishAddressSpaceBlock::mmap(uint64_t host_addr)
-{
- if (m_size == 0) {
- ALOGE("%s: called with zero size\n", __func__);
- return NULL;
- }
-
- if (m_mmaped_ptr != nullptr) {
- ALOGE("'mmap' called for an already mmaped address block 0x%llx %d", (unsigned long long)m_mmaped_ptr, nullptr == m_mmaped_ptr);
- ::abort();
- }
-
- m_mmaped_ptr = (void*)(uintptr_t)(host_addr & (~(PAGE_SIZE - 1)));
- m_host_addr = host_addr;
-
- return guestPtr();
-}
-
-void *GoldfishAddressSpaceBlock::guestPtr() const
-{
- return reinterpret_cast<char *>(m_mmaped_ptr) + (m_host_addr & (PAGE_SIZE - 1));
-}
-
-void GoldfishAddressSpaceBlock::destroy()
-{
- if (m_mmaped_ptr && m_size) {
- m_mmaped_ptr = NULL;
- }
-
- if (m_size) {
- if (m_is_shared_mapping) {
- HostAddressSpaceDevice::get()->unclaimShared(m_handle, m_offset);
- } else {
- HostAddressSpaceDevice::get()->freeBlock(m_handle, m_offset);
- }
- m_phys_addr = 0;
- m_host_addr = 0;
- m_offset = 0;
- m_size = 0;
- }
-}
-
-void GoldfishAddressSpaceBlock::release()
-{
- m_handle = 0;
- m_mmaped_ptr = NULL;
- m_phys_addr = 0;
- m_host_addr = 0;
- m_offset = 0;
- m_size = 0;
-}
-
-int GoldfishAddressSpaceBlock::memoryMap(void *addr,
- size_t,
- address_space_handle_t,
- uint64_t,
- void** dst) {
- *dst = addr;
- return 0;
-}
-
-void GoldfishAddressSpaceBlock::memoryUnmap(void *ptr, size_t size) {}
-
-GoldfishAddressSpaceHostMemoryAllocator::GoldfishAddressSpaceHostMemoryAllocator(bool useSharedSlots)
- : m_provider(useSharedSlots
- ? GoldfishAddressSpaceSubdeviceType::SharedSlotsHostMemoryAllocator
- : GoldfishAddressSpaceSubdeviceType::HostMemoryAllocator),
- m_useSharedSlots(useSharedSlots)
-{}
-
-bool GoldfishAddressSpaceHostMemoryAllocator::is_opened() const { return m_provider.is_opened(); }
-
-long GoldfishAddressSpaceHostMemoryAllocator::hostMalloc(GoldfishAddressSpaceBlock *block, size_t size)
-{
- if (size == 0) {
- return -EINVAL;
- }
- if (block->size() > 0) {
- return -EINVAL;
- }
- if (!m_provider.is_opened()) {
- return -ENODEV;
- }
-
- AddressSpaceDevicePingInfo request;
- if (m_useSharedSlots) {
- ::memset(&request, 0, sizeof(request));
- request.size = block->size();
- request.metadata = HOST_MEMORY_ALLOCATOR_COMMAND_ALLOCATE_ID;
-
- HostAddressSpaceDevice::get()->ping(m_provider.m_handle, &request);
-
- block->claimShared(&m_provider, request.phys_addr, request.size);
-
- void *hostPtr = HostAddressSpaceDevice::get()->getHostAddr(block->physAddr());
- block->mmap(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(hostPtr)));
- } else {
- if (!block->allocate(&m_provider, size)) {
- return -ENOMEM;
- }
-
- ::memset(&request, 0, sizeof(request));
- request.phys_addr = block->physAddr();
- request.size = block->size();
- request.metadata = HOST_MEMORY_ALLOCATOR_COMMAND_ALLOCATE_ID;
-
- HostAddressSpaceDevice::get()->ping(m_provider.m_handle, &request);
-
- void *hostPtr = HostAddressSpaceDevice::get()->getHostAddr(block->physAddr());
- block->mmap(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(hostPtr)));
- }
-
- return 0;
-}
-
-void GoldfishAddressSpaceHostMemoryAllocator::hostFree(GoldfishAddressSpaceBlock *block)
-{
- if (block->size() == 0) {
- return;
- }
-
- if (!m_provider.is_opened()) {
- ALOGE("%s: device is not available", __func__);
- ::abort();
- }
-
- if (block->guestPtr()) {
- AddressSpaceDevicePingInfo request;
- ::memset(&request, 0, sizeof(request));
- request.phys_addr = block->physAddr();
- request.metadata = HOST_MEMORY_ALLOCATOR_COMMAND_UNALLOCATE_ID;
-
- HostAddressSpaceDevice::get()->ping(m_provider.m_handle, &request);
- }
-
- block->replace(NULL);
-}
-
-address_space_handle_t goldfish_address_space_open() {
- return HostAddressSpaceDevice::get()->open();
-}
-
-void goldfish_address_space_close(address_space_handle_t handle) {
- HostAddressSpaceDevice::get()->close(handle);
-}
-
-bool goldfish_address_space_allocate(
- address_space_handle_t handle,
- size_t size, uint64_t* phys_addr, uint64_t* offset) {
-
- *offset =
- HostAddressSpaceDevice::get()->allocBlock(
- handle, size, phys_addr);
-
- return true;
-}
-
-bool goldfish_address_space_free(
- address_space_handle_t handle, uint64_t offset) {
- HostAddressSpaceDevice::get()->freeBlock(handle, offset);
- return true;
-}
-
-bool goldfish_address_space_claim_shared(
- address_space_handle_t handle, uint64_t offset, uint64_t size) {
-
- int claimRes = HostAddressSpaceDevice::get()->claimShared(
- handle, offset, size);
-
- if (claimRes) {
- ALOGE("%s: failed to claim shared region. Error: %d\n", __func__, claimRes);
- return false;
- }
-
- return true;
-}
-
-bool goldfish_address_space_unclaim_shared(
- address_space_handle_t handle, uint64_t offset) {
- HostAddressSpaceDevice::get()->unclaimShared(handle, offset);
- return true;
-}
-
-// pgoff is the offset into the page to return in the result
-void* goldfish_address_space_map(
- address_space_handle_t handle,
- uint64_t offset, uint64_t size,
- uint64_t pgoff) {
-
- (void)size;
-
- void* res = HostAddressSpaceDevice::get()->
- getHostAddr(
- HostAddressSpaceDevice::get()->offsetToPhysAddr(offset));
-
- if (!res) {
- ALOGE("%s: failed to map. errno: %d\n", __func__, errno);
- return nullptr;
- }
-
- return (void*)(((char*)res) + (uintptr_t)(pgoff & (PAGE_SIZE - 1)));
-}
-
-// same address space
-void goldfish_address_space_unmap(void*, uint64_t) { }
-
-bool goldfish_address_space_set_subdevice_type(
- address_space_handle_t handle, GoldfishAddressSpaceSubdeviceType type,
- address_space_handle_t* handle_out) {
- struct address_space_ping request;
- request.metadata = (uint64_t)type;
- *handle_out = handle;
- return goldfish_address_space_ping(handle, &request);
-}
-
-bool goldfish_address_space_ping(
- address_space_handle_t handle,
- struct address_space_ping* ping) {
-
- AddressSpaceDevicePingInfo* asHostPingInfo =
- reinterpret_cast<AddressSpaceDevicePingInfo*>(ping);
-
- HostAddressSpaceDevice::get()->ping(handle, asHostPingInfo);
-
- return true;
-}
diff --git a/guest/OpenglSystemCommon/HostConnection.cpp b/guest/OpenglSystemCommon/HostConnection.cpp
index 0415e05..0d855dd 100644
--- a/guest/OpenglSystemCommon/HostConnection.cpp
+++ b/guest/OpenglSystemCommon/HostConnection.cpp
@@ -30,9 +30,6 @@
#endif
#include "renderControl_types.h"
-#ifdef HOST_BUILD
-#include "aemu/base/Tracing.h"
-#endif
#include "aemu/base/Process.h"
#define DEBUG_HOSTCONNECTION 0
@@ -209,11 +206,7 @@
m_checksumHelper(),
m_hostExtensions(),
m_noHostError(true),
- m_rendernodeFd(-1) {
-#ifdef HOST_BUILD
- gfxstream::guest::initializeTracing();
-#endif
-}
+ m_rendernodeFd(-1) { }
HostConnection::~HostConnection()
{
diff --git a/guest/OpenglSystemCommon/HostConnection.h b/guest/OpenglSystemCommon/HostConnection.h
index 9dabe76..3f2a2d1 100644
--- a/guest/OpenglSystemCommon/HostConnection.h
+++ b/guest/OpenglSystemCommon/HostConnection.h
@@ -106,12 +106,7 @@
void setGLESMaxVersion(GLESMaxVersion ver) { m_featureInfo.glesMaxVersion = ver; }
GLESMaxVersion getGLESMaxVersion() const { return m_featureInfo.glesMaxVersion; }
bool hasDirectMem() const {
-#ifdef HOST_BUILD
- // unit tests do not support restoring "guest" ram because there is no VM
- return false;
-#else
return m_featureInfo.hasDirectMem;
-#endif
}
const EmulatorFeatureInfo* featureInfo_const() const { return &m_featureInfo; }
diff --git a/guest/android-emu/aemu/base/Tracing.cpp b/guest/android-emu/aemu/base/Tracing.cpp
index 2ba1dd9..c651759 100644
--- a/guest/android-emu/aemu/base/Tracing.cpp
+++ b/guest/android-emu/aemu/base/Tracing.cpp
@@ -14,7 +14,7 @@
// limitations under the License.
#include "aemu/base/Tracing.h"
-#if defined(__ANDROID__) || defined(HOST_BUILD)
+#if defined(__ANDROID__)
#include <cutils/trace.h>
#define TRACE_TAG ATRACE_TAG_GRAPHICS
@@ -31,7 +31,7 @@
namespace guest {
bool isTracingEnabled() {
-#if defined(__ANDROID__) || defined(HOST_BUILD)
+#if defined(__ANDROID__)
return atrace_is_tag_enabled(TRACE_TAG);
#else
// TODO: Fuchsia + Linux
@@ -40,7 +40,7 @@
}
void ScopedTraceGuest::beginTraceImpl(const char* name) {
-#if defined(__ANDROID__) || defined(HOST_BUILD)
+#if defined(__ANDROID__)
atrace_begin(TRACE_TAG, name);
#elif defined(__Fuchsia__) && !defined(FUCHSIA_NO_TRACE)
TRACE_DURATION_BEGIN(TRACE_TAG, name);
@@ -51,7 +51,7 @@
}
void ScopedTraceGuest::endTraceImpl(const char* name) {
-#if defined(__ANDROID__) || defined(HOST_BUILD)
+#if defined(__ANDROID__)
(void)name;
atrace_end(TRACE_TAG);
#elif defined(__Fuchsia__) && !defined(FUCHSIA_NO_TRACE)
diff --git a/guest/android-emu/aemu/base/Tracing.h b/guest/android-emu/aemu/base/Tracing.h
index 7f25205..125a622 100644
--- a/guest/android-emu/aemu/base/Tracing.h
+++ b/guest/android-emu/aemu/base/Tracing.h
@@ -20,28 +20,6 @@
namespace gfxstream {
namespace guest {
-#ifdef HOST_BUILD
-void initializeTracing();
-void enableTracing();
-void disableTracing();
-// Some platform tracing libraries such as Perfetto can be enabled/disabled at
-// runtime. Allow the user to query if they are disabled or not, and take
-// further action based on it. The use case is to enable/disable tracing on the
-// host alongside.
-bool isTracingEnabled();
-
-class ScopedTrace {
-public:
- ScopedTrace(const char* name);
- ~ScopedTrace();
-};
-
-class ScopedTraceDerived : public ScopedTrace {
-public:
- void* member = nullptr;
-};
-#endif
-
bool isTracingEnabled();
class ScopedTraceGuest {
@@ -67,8 +45,4 @@
#define __AEMU_GENSYM1(x,y) __AEMU_GENSYM2(x,y)
#define AEMU_GENSYM(x) __AEMU_GENSYM1(x,__COUNTER__)
-#ifdef HOST_BUILD
-#define AEMU_SCOPED_TRACE(tag) __attribute__ ((unused)) gfxstream::guest::ScopedTrace AEMU_GENSYM(aemuScopedTrace_)(tag)
-#else
#define AEMU_SCOPED_TRACE(tag) __attribute__ ((unused)) gfxstream::guest::ScopedTraceGuest AEMU_GENSYM(aemuScopedTrace_)(tag)
-#endif
diff --git a/guest/egl/eglDisplay.cpp b/guest/egl/eglDisplay.cpp
index 16ad925..f785107 100644
--- a/guest/egl/eglDisplay.cpp
+++ b/guest/egl/eglDisplay.cpp
@@ -17,11 +17,6 @@
#include "HostConnection.h"
#include "KeyedVectorUtils.h"
-#ifdef HOST_BUILD
-#include "android/base/files/PathUtils.cpp"
-#include "android/base/system/System.cpp"
-#endif
-
#include <string>
#include <vector>
@@ -264,14 +259,12 @@
#endif // !_WIN32 (linux)
#endif // !__APPLE__
-#ifndef HOST_BUILD
#define PARTITION "/system"
#if __LP64__
#define LIBDIR "/lib64/egl/"
#else
#define LIBDIR "/lib/egl/"
#endif // !__LP64__
-#endif // !HOST_BUILD
EGLClient_glesInterface *eglDisplay::loadGLESClientAPI(const char *basename,
EGLClient_eglInterface *eglIface,
diff --git a/guest/egl/goldfish_sync.h b/guest/egl/goldfish_sync.h
index a9e0594..497a15b 100644
--- a/guest/egl/goldfish_sync.h
+++ b/guest/egl/goldfish_sync.h
@@ -18,29 +18,6 @@
#define GOLDFISH_SYNC_VULKAN_SEMAPHORE_SYNC 0x00000001
#define GOLDFISH_SYNC_VULKAN_QSRI 0x00000002
-#ifdef HOST_BUILD
-
-static __inline__ int goldfish_sync_open() {
- return 0;
-}
-
-static __inline__ int goldfish_sync_close(int) {
- return 0;
-}
-
-static __inline__ int goldfish_sync_queue_work(int,
- uint64_t,
- uint64_t,
- int*) {
- return 0;
-}
-
-static __inline__ int goldfish_sync_signal(int goldfish_sync_fd) {
- return 0;
-}
-
-#else
-
#include <errno.h>
#include <linux/ioctl.h>
#include <linux/types.h>
@@ -109,6 +86,4 @@
return ioctl(goldfish_sync_fd, GOLDFISH_SYNC_IOC_SIGNAL, 0);
}
-#endif // !HOST_BUILD
-
#endif
diff --git a/guest/qemupipe/qemu_pipe_host.cpp b/guest/qemupipe/qemu_pipe_host.cpp
deleted file mode 100644
index 9dbeb64..0000000
--- a/guest/qemupipe/qemu_pipe_host.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2018 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include <qemu_pipe_bp.h>
-
-#include "host-common/HostGoldfishPipe.h"
-
-#include <cutils/log.h>
-
-#include <errno.h>
-
-using android::HostGoldfishPipeDevice;
-
-QEMU_PIPE_HANDLE qemu_pipe_open(const char* pipeName) {
- return HostGoldfishPipeDevice::get()->connect(pipeName);
-}
-
-void qemu_pipe_close(QEMU_PIPE_HANDLE pipe) {
- HostGoldfishPipeDevice::get()->close(pipe);
-}
-
-int qemu_pipe_read(QEMU_PIPE_HANDLE pipe, void* buffer, int len) {
- return HostGoldfishPipeDevice::get()->read(pipe, buffer, len);
-}
-
-int qemu_pipe_write(QEMU_PIPE_HANDLE pipe, const void* buffer, int len) {
- return HostGoldfishPipeDevice::get()->write(pipe, buffer, len);
-}
-
-int qemu_pipe_try_again(int ret) {
- if (ret < 0) {
- int err = HostGoldfishPipeDevice::get()->getErrno();
- return err == EINTR || err == EAGAIN;
- } else {
- return false;
- }
-}
-
-void qemu_pipe_print_error(QEMU_PIPE_HANDLE pipe) {
- int err = HostGoldfishPipeDevice::get()->getErrno();
- ALOGE("pipe error: pipe %d err %d", pipe, err);
-}
diff --git a/guest/vulkan_enc/AndroidHardwareBuffer.cpp b/guest/vulkan_enc/AndroidHardwareBuffer.cpp
index eac0caf..0cb7794 100644
--- a/guest/vulkan_enc/AndroidHardwareBuffer.cpp
+++ b/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 <drm_fourcc.h>
#define DRM_FORMAT_YVU420_ANDROID fourcc_code('9', '9', '9', '7')
#endif
-#endif
#include <assert.h>
@@ -135,7 +133,6 @@
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 @@
}
}
#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/guest/vulkan_enc/ResourceTracker.cpp b/guest/vulkan_enc/ResourceTracker.cpp
index 2cea97d..e51c795 100644
--- a/guest/vulkan_enc/ResourceTracker.cpp
+++ b/guest/vulkan_enc/ResourceTracker.cpp
@@ -50,22 +50,12 @@
#include <sys/mman.h>
#include <sys/syscall.h>
-#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
}