1 /* 2 * Copyright 2022 The Chromium OS Authors. All rights reserved. 3 * Use of this source code is governed by a BSD-style license that can be 4 * found in the LICENSE file. 5 */ 6 7 #ifndef CROSGRALLOC4METADATA_H 8 #define CROSGRALLOC4METADATA_H 9 10 #include <aidl/android/hardware/graphics/common/BlendMode.h> 11 #include <aidl/android/hardware/graphics/common/Cta861_3.h> 12 #include <aidl/android/hardware/graphics/common/Dataspace.h> 13 #include <aidl/android/hardware/graphics/common/Smpte2086.h> 14 15 #define CROS_GRALLOC4_METADATA_MAX_NAME_SIZE 1024 16 17 /* 18 * The metadata for cros_gralloc_buffer-s that should reside in a shared memory region 19 * instead of directly in cros_gralloc_handle-s. 20 * 21 * Any metadata that is mutable must be stored in this shared memory region as 22 * cros_gralloc_handle-s can not be tracked and updated across processes. 23 */ 24 struct CrosGralloc4Metadata { 25 /* 26 * Name is stored in the shared memory metadata to simplify cros_gralloc_handle 27 * creation. This allows us to keep handles small while avoiding variable sized 28 * handles. 29 */ 30 char name[CROS_GRALLOC4_METADATA_MAX_NAME_SIZE]; 31 aidl::android::hardware::graphics::common::BlendMode blendMode; 32 aidl::android::hardware::graphics::common::Dataspace dataspace; 33 std::optional<aidl::android::hardware::graphics::common::Cta861_3> cta861_3; 34 std::optional<aidl::android::hardware::graphics::common::Smpte2086> smpte2086; 35 }; 36 37 #endif 38