summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Braga <quic_cbraga@quicinc.com>2022-05-09 16:42:44 -0400
committerGerrit - the friendly Code Review server <code-review@localhost>2022-05-18 15:12:55 -0700
commit34fef9c4f6e22d97c52ff60ccd93fc404ea6a4cb (patch)
treed44ed59b6b63a700c03038ce97cdf581c930bb73
parent356602355d2973b24352903218c9eb0ffde12df0 (diff)
gralloc: Introduce custom content metadata region
Introduce a new dynamic memory region to store custom content metadata that has sizing requirements that exceeds the base 1KB region allocated. This region is dynamic to ensure a layer's memory requirements are only increased when absolutely needed. Change-Id: I774197ed0c4ec7a18cc09b24262b6548dc293e72
-rw-r--r--gralloc/QtiGralloc.h4
-rw-r--r--gralloc/QtiGrallocMetadata.h1
-rw-r--r--gralloc/QtiGrallocPriv.h9
3 files changed, 11 insertions, 3 deletions
diff --git a/gralloc/QtiGralloc.h b/gralloc/QtiGralloc.h
index c95368aa..ac96e7fa 100644
--- a/gralloc/QtiGralloc.h
+++ b/gralloc/QtiGralloc.h
@@ -131,6 +131,8 @@ static const MetadataType MetadataType_BufferPermission = {VENDOR_QTI, QTI_BUFFE
static const MetadataType MetadataType_MemHandle = {VENDOR_QTI, QTI_MEM_HANDLE};
static const MetadataType MetadataType_TimedRendering = {VENDOR_QTI, QTI_TIMED_RENDERING};
+static const MetadataType MetadataType_CustomContentMetadata = {VENDOR_QTI,
+ QTI_CUSTOM_CONTENT_METADATA};
// 0 is also used as invalid value in standard metadata
static const MetadataType MetadataType_Invalid = {VENDOR_QTI, 0};
@@ -165,6 +167,8 @@ Error decodeYUVPlaneInfoMetadata(hidl_vec<uint8_t> &in, qti_ycbcr *out);
Error encodeYUVPlaneInfoMetadata(qti_ycbcr *in, hidl_vec<uint8_t> *out);
Error decodeBufferPermission(hidl_vec<uint8_t> &in, BufferPermission *out);
Error encodeBufferPermission(BufferPermission *in, hidl_vec<uint8_t> *out);
+Error decodeCustomContentMetadata(hidl_vec<uint8_t> &in, void *out);
+Error encodeCustomContentMetadata(const void *in, hidl_vec<uint8_t> *out);
} // namespace qtigralloc
#endif //__QTIGRALLOC_H__
diff --git a/gralloc/QtiGrallocMetadata.h b/gralloc/QtiGrallocMetadata.h
index 506fd2e9..ccccaf63 100644
--- a/gralloc/QtiGrallocMetadata.h
+++ b/gralloc/QtiGrallocMetadata.h
@@ -70,6 +70,7 @@
#define QTI_BUFFER_PERMISSION 10026
#define QTI_MEM_HANDLE 10027
#define QTI_TIMED_RENDERING 10028
+#define QTI_CUSTOM_CONTENT_METADATA 10029
// Used to indicate to framework that internal definitions are used instead
#define COMPRESSION_QTI_UBWC 20001
diff --git a/gralloc/QtiGrallocPriv.h b/gralloc/QtiGrallocPriv.h
index 13d8f8b8..688d6df5 100644
--- a/gralloc/QtiGrallocPriv.h
+++ b/gralloc/QtiGrallocPriv.h
@@ -174,6 +174,7 @@ struct private_handle_t : public native_handle_t {
uint64_t base_metadata;
uint64_t gpuaddr;
unsigned int reserved_size;
+ unsigned int custom_content_md_reserved_size;
static const int kNumFds = 2;
static const int kMagic = 'gmsm';
@@ -202,7 +203,8 @@ struct private_handle_t : public native_handle_t {
base(0),
base_metadata(0),
gpuaddr(0),
- reserved_size(0) {
+ reserved_size(0),
+ custom_content_md_reserved_size(0) {
version = static_cast<int>(sizeof(native_handle));
numInts = NumInts();
numFds = kNumFds;
@@ -236,10 +238,11 @@ struct private_handle_t : public native_handle_t {
static void Dump(const private_handle_t *hnd) {
ALOGD("handle id:%" PRIu64
" wxh:%dx%d uwxuh:%dx%d size: %d fd:%d fd_meta:%d flags:0x%x "
- "usage:0x%" PRIx64 " format:0x%x layer_count: %d reserved_size = %d",
+ "usage:0x%" PRIx64 " format:0x%x layer_count: %d reserved_size = %d "
+ "custom_content_md_reserved_size = %u",
hnd->id, hnd->width, hnd->height, hnd->unaligned_width, hnd->unaligned_height, hnd->size,
hnd->fd, hnd->fd_metadata, hnd->flags, hnd->usage, hnd->format, hnd->layer_count,
- hnd->reserved_size);
+ hnd->reserved_size, hnd->custom_content_md_reserved_size);
}
};
#pragma pack(pop)