summaryrefslogtreecommitdiff
path: root/gralloc4/src/mali_gralloc_buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'gralloc4/src/mali_gralloc_buffer.h')
-rw-r--r--gralloc4/src/mali_gralloc_buffer.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/gralloc4/src/mali_gralloc_buffer.h b/gralloc4/src/mali_gralloc_buffer.h
index 09461d7..891c507 100644
--- a/gralloc4/src/mali_gralloc_buffer.h
+++ b/gralloc4/src/mali_gralloc_buffer.h
@@ -97,7 +97,7 @@ typedef struct plane_info {
* For uncompressed allocations, byte_stride might contain additional
* padding beyond the alloc_width. For AFBC, alignment is zero.
*/
- uint32_t byte_stride;
+ uint64_t byte_stride;
/*
* Dimensions of plane (in pixels).
@@ -117,8 +117,8 @@ typedef struct plane_info {
* be wholly within the allocation dimensions. The crop region top-left
* will be relative to the start of allocation.
*/
- uint32_t alloc_width;
- uint32_t alloc_height;
+ uint64_t alloc_width;
+ uint64_t alloc_height;
} plane_info_t;
struct private_handle_t;
@@ -210,7 +210,7 @@ struct private_handle_t
*
* NOTE: 'stride' values sometimes vary significantly from plane_info[0].alloc_width.
*/
- int stride DEFAULT_INITIALIZER(0);
+ uint64_t stride DEFAULT_INITIALIZER(0);
/*
* Allocation properties.
@@ -264,7 +264,7 @@ struct private_handle_t
uint64_t _consumer_usage, uint64_t _producer_usage,
int _fds[MAX_FDS], int _fd_count,
int _req_format, uint64_t _alloc_format,
- int _width, int _height, int _stride,
+ int _width, int _height, uint64_t _stride,
uint64_t _layer_count, plane_info_t _plane_info[MAX_PLANES])
: private_handle_t()
{
@@ -396,10 +396,10 @@ struct private_handle_t
"wh(%d %d) "
"req_format(%#x) alloc_format(%#" PRIx64 ") "
"usage_pc(0x%" PRIx64 " 0x%" PRIx64 ") "
- "stride(%d) "
- "psize(%" PRIu64 ") byte_stride(%d) internal_wh(%d %d) "
- "psize1(%" PRIu64 ") byte_stride1(%d) internal_wh1(%d %d) "
- "psize2(%" PRIu64 ") byte_stride2(%d) internal_wh2(%d %d) "
+ "stride(%" PRIu64 ") "
+ "psize(%" PRIu64 ") byte_stride(%" PRIu64 ") internal_wh(%" PRIu64 " %" PRIu64 ") "
+ "psize1(%" PRIu64 ") byte_stride1(%" PRIu64 ") internal_wh1(%" PRIu64 " %" PRIu64 ") "
+ "psize2(%" PRIu64 ") byte_stride2(%" PRIu64 ") internal_wh2(%" PRIu64 " %" PRIu64 ") "
"alloc_format(0x%" PRIx64 ") "
"alloc_sizes(%" PRIu64 " %" PRIu64 " %" PRIu64 ") "
"layer_count(%d) "
@@ -442,4 +442,8 @@ struct private_handle_t
#pragma GCC diagnostic pop
#endif
+// The size of private_handle_t is calculated manually. This check ensures that private_handle_t has
+// the same layout for 32-bit and 64-bit processes.
+static_assert(sizeof(private_handle_t) == 328);
+
#endif /* MALI_GRALLOC_BUFFER_H_ */