summaryrefslogtreecommitdiff
path: root/cros_gralloc/cros_gralloc_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'cros_gralloc/cros_gralloc_helpers.h')
-rw-r--r--cros_gralloc/cros_gralloc_helpers.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/cros_gralloc/cros_gralloc_helpers.h b/cros_gralloc/cros_gralloc_helpers.h
index fe72165..e8dd0a5 100644
--- a/cros_gralloc/cros_gralloc_helpers.h
+++ b/cros_gralloc/cros_gralloc_helpers.h
@@ -10,6 +10,8 @@
#include "../drv.h"
#include "cros_gralloc_handle.h"
+#include <aidl/android/hardware/graphics/common/BlendMode.h>
+#include <aidl/android/hardware/graphics/common/Dataspace.h>
#include <log/log.h>
#include <system/graphics.h>
#include <system/window.h>
@@ -24,6 +26,8 @@
// Adopt BufferUsage::FRONT_BUFFER from api level 33
#define BUFFER_USAGE_FRONT_RENDERING_MASK (BUFFER_USAGE_FRONT_RENDERING | (1ULL << 32))
+#define CROS_GRALLOC_BUFFER_METADATA_MAX_NAME_SIZE 1024
+
struct cros_gralloc_buffer_descriptor {
uint32_t width;
uint32_t height;
@@ -31,8 +35,16 @@ struct cros_gralloc_buffer_descriptor {
int64_t droid_usage;
uint32_t drm_format;
uint64_t use_flags;
- uint64_t reserved_region_size;
+ // If true, allocate an additional shared memory region for buffer metadata.
+ bool enable_metadata_fd = false;
+ // If the additional shared memory region for buffer metadata is present, the
+ // additional amount of space reserved for client use.
+ uint64_t client_metadata_size = 0;
std::string name;
+ aidl::android::hardware::graphics::common::Dataspace dataspace =
+ aidl::android::hardware::graphics::common::Dataspace::UNKNOWN;
+ aidl::android::hardware::graphics::common::BlendMode blend =
+ aidl::android::hardware::graphics::common::BlendMode::INVALID;
};
constexpr uint32_t cros_gralloc_magic = 0xABCDDCBA;