diff --git a/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py b/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py index 5493d8a8ee6..4c29d23e464 100644 --- a/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py +++ b/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py @@ -56,8 +56,6 @@ decoder_snapshot_decl_postamble = """ decoder_snapshot_impl_preamble =""" -using emugl::GfxApiLogger; - namespace gfxstream { namespace vk { diff --git a/src/gfxstream/codegen/scripts/cerealgenerator.py b/src/gfxstream/codegen/scripts/cerealgenerator.py index 3c0f9b5513c..5c378bdf9f2 100644 --- a/src/gfxstream/codegen/scripts/cerealgenerator.py +++ b/src/gfxstream/codegen/scripts/cerealgenerator.py @@ -204,6 +204,22 @@ copyrightHeader = """// Copyright (C) 2018 The Android Open Source Project // limitations under the License. """ +coprightHeaderPy = """# Copyright (C) 2025 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. + +""" + # We put the long generated commands in a separate paragraph, so that the formatter won't mess up # with other texts. autogeneratedHeaderTemplate = """ @@ -281,8 +297,6 @@ class CerealGenerator(OutputGenerator): self.featureSupported = False self.supportedModules = None - self.utilsHeaderDirPrefix = "utils" - # The cereal variant should be an environmental variable of one of # the following: # - "guest" @@ -493,8 +507,8 @@ using DlSymFunc = void* (void*, const char*); #include #include "VkSnapshotApiCall.h" -#include "{self.utilsHeaderDirPrefix}/GfxApiLogger.h" #include "gfxstream/HealthMonitor.h" +#include "gfxstream/host/GfxApiLogger.h" #include "goldfish_vk_private_defs.h" """ decoderSnapshotImplIncludes = f""" @@ -650,7 +664,8 @@ class BumpPool; implOnly=True) self.addModule(cereal.PyScript(self.host_tag, "vulkan_printer", customAbsDir=Path( - self.host_script_destination) / "print_gfx_logs"), moduleName="ApiLogDecoder") + self.host_script_destination) / "print_gfx_logs"), moduleName="ApiLogDecoder", + extraHeader=coprightHeaderPy) self.addHostModule( "vulkan_gfxstream_structure_type", headerOnly=True, suppressFeatureGuards=True, moduleName="vulkan_gfxstream_structure_type_host", useNamespace=False, @@ -704,10 +719,12 @@ class BumpPool; suppressFeatureGuards=suppressFeatureGuards, moduleName=moduleName, suppressVulkanHeaders=suppressVulkanHeaders) - def addModule(self, module, moduleName=None): + def addModule(self, module, moduleName=None, extraHeader=None): if moduleName is None: moduleName = module.basename self.moduleList.append(moduleName) + if extraHeader: + module.preamble = extraHeader self.modules[moduleName] = module def addCppModule(