gfxstream: Update codegen after many aemu -> gfxstream changes

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35323>
This commit is contained in:
Jason Macnak
2025-05-02 14:50:37 +00:00
committed by Marge Bot
parent 711606dff4
commit 524d9b0647
4 changed files with 21 additions and 22 deletions
@@ -70,12 +70,12 @@ decoder_impl_preamble ="""
namespace gfxstream {
namespace vk {
using android::base::MetricEventBadPacketLength;
using android::base::MetricEventDuplicateSequenceNum;
using gfxstream::base::MetricEventBadPacketLength;
using gfxstream::base::MetricEventDuplicateSequenceNum;
class VkDecoder::Impl {
public:
Impl() : m_logCalls(android::base::getEnvironmentVariable("ANDROID_EMU_VK_LOG_CALLS") == "1"),
Impl() : m_logCalls(gfxstream::base::getEnvironmentVariable("ANDROID_EMU_VK_LOG_CALLS") == "1"),
m_vk(vkDispatch()),
m_state(VkDecoderGlobalState::get()),
m_vkStream(nullptr, m_state->getFeatures()),
@@ -104,7 +104,7 @@ private:
VulkanMemReadingStream m_vkMemReadingStream;
BoxedHandleCreateMapping m_boxedHandleCreateMapping;
BoxedHandleUnwrapMapping m_boxedHandleUnwrapMapping;
android::base::BumpPool m_pool;
gfxstream::base::BumpPool m_pool;
std::optional<uint32_t> m_prevSeqno;
bool m_queueSubmitWithCommandsEnabled = false;
const bool m_snapshotsEnabled = false;
@@ -489,7 +489,7 @@ def emit_seqno_incr(api, cgen):
def emit_snapshot(typeInfo, api, cgen):
additionalParams = [ \
makeVulkanTypeSimple(False, "android::base::BumpPool", 1, "&m_pool"),
makeVulkanTypeSimple(False, "gfxstream::base::BumpPool", 1, "&m_pool"),
makeVulkanTypeSimple(True, "VkSnapshotApiCallInfo", 1, SNAPSHOT_API_CALL_INFO_VARNAME),
makeVulkanTypeSimple(True, "uint8_t", 1, "packet"),
makeVulkanTypeSimple(False, "size_t", 0, "packetLen"),
@@ -16,12 +16,11 @@ from dataclasses import dataclass
decoder_snapshot_decl_preamble = """
namespace android {
namespace gfxstream {
namespace base {
class BumpPool;
class Stream;
} // namespace base {
} // namespace android {
} // namespace gfxstream {
namespace gfxstream {
namespace vk {
@@ -494,7 +493,7 @@ class VulkanDecoderSnapshot(VulkanWrapperGenerator):
api = self.typeInfo.apis[name]
additionalParams = [ \
makeVulkanTypeSimple(False, "android::base::BumpPool", 1, "pool"),
makeVulkanTypeSimple(False, "gfxstream::base::BumpPool", 1, "pool"),
makeVulkanTypeSimple(False, "VkSnapshotApiCallInfo", 1, "apiCallInfo"),
makeVulkanTypeSimple(True, "uint8_t", 1, "apiCallPacket"),
makeVulkanTypeSimple(False, "size_t", 0, "apiCallPacketSize"),
@@ -344,7 +344,7 @@ class VulkanSubDecoder(VulkanWrapperGenerator):
self.cgen.stmt("auto& metricsLogger = *context.metricsLogger")
self.cgen.stmt("uint32_t count = 0")
self.cgen.stmt("unsigned char *buf = (unsigned char *)pSubDecodeData")
self.cgen.stmt("android::base::BumpPool* pool = readStream->pool()")
self.cgen.stmt("gfxstream::base::BumpPool* pool = readStream->pool()")
self.cgen.stmt("unsigned char *ptr = (unsigned char *)pSubDecodeData")
self.cgen.stmt(
"const unsigned char* const end = (const unsigned char*)buf + subDecodeDataSize")
@@ -281,7 +281,6 @@ class CerealGenerator(OutputGenerator):
self.featureSupported = False
self.supportedModules = None
self.baseLibDirPrefix = "aemu/base"
self.utilsHeaderDirPrefix = "utils"
# The cereal variant should be an environmental variable of one of
@@ -395,15 +394,15 @@ class IOStream;
#include "goldfish_vk_private_defs.h"
#include "%s.h"
#include "{self.baseLibDirPrefix}/files/StreamSerializing.h"
#include "aemu/base/files/StreamSerializing.h"
""" % VULKAN_STREAM_TYPE
poolInclude = f"""
{self.hostCommonExtraVulkanHeaders}
#include "goldfish_vk_private_defs.h"
#include "{self.baseLibDirPrefix}/BumpPool.h"
using android::base::Allocator;
using android::base::BumpPool;
#include "gfxstream/BumpPool.h"
using gfxstream::base::Allocator;
using gfxstream::base::BumpPool;
"""
transformIncludeGuest = """
#include "goldfish_vk_private_defs.h"
@@ -495,7 +494,8 @@ using DlSymFunc = void* (void*, const char*);
#include "VkSnapshotApiCall.h"
#include "{self.utilsHeaderDirPrefix}/GfxApiLogger.h"
#include "{self.baseLibDirPrefix}/HealthMonitor.h"
#include "aemu/base/files/Stream.h"
#include "gfxstream/HealthMonitor.h"
#include "goldfish_vk_private_defs.h"
"""
decoderSnapshotImplIncludes = f"""
@@ -505,7 +505,7 @@ using DlSymFunc = void* (void*, const char*);
#include "VulkanHandleMapping.h"
#include "VkDecoderGlobalState.h"
#include "VkReconstruction.h"
#include "{self.baseLibDirPrefix}/ThreadAnnotations.h"
#include "gfxstream/ThreadAnnotations.h"
"""
decoderHeaderIncludes = f"""
@@ -514,11 +514,11 @@ using DlSymFunc = void* (void*, const char*);
#include <memory>
namespace android {{
namespace gfxstream {{
namespace base {{
class BumpPool;
}} // namespace android
}} // namespace base
}} // namespace gfxstream
"""
@@ -528,9 +528,9 @@ class BumpPool;
#include "goldfish_vk_private_defs.h"
#include "common/goldfish_vk_transform.h"
#include "{self.baseLibDirPrefix}/BumpPool.h"
#include "{self.baseLibDirPrefix}/system/System.h"
#include "{self.baseLibDirPrefix}/Metrics.h"
#include "gfxstream/BumpPool.h"
#include "gfxstream/system/System.h"
#include "gfxstream/Metrics.h"
#include "FrameBuffer.h"
#include "gfxstream/host/Tracing.h"
#include "gfxstream/host/iostream.h"