diff options
Diffstat (limited to 'gralloc/gr_utils.h')
-rw-r--r-- | gralloc/gr_utils.h | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/gralloc/gr_utils.h b/gralloc/gr_utils.h index bdde659c..e21f92b8 100644 --- a/gralloc/gr_utils.h +++ b/gralloc/gr_utils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2016,2018-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016,2018-2020, The Linux Foundation. All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -63,11 +63,44 @@ struct BufferInfo { uint64_t usage; }; +struct GrallocProperties { + bool use_system_heap_for_sensors = true; + bool ubwc_disable = false; + bool ahardware_buffer_disable = false; +}; + template <class Type1, class Type2> inline Type1 ALIGN(Type1 x, Type2 align) { return (Type1)((x + (Type1)align - 1) & ~((Type1)align - 1)); } +enum class Error : int32_t { + /** + * No error. + */ + NONE = 0, + /** + * Invalid BufferDescriptor. + */ + BAD_DESCRIPTOR = 1, + /** + * Invalid buffer handle. + */ + BAD_BUFFER = 2, + /** + * Invalid HardwareBufferDescription. + */ + BAD_VALUE = 3, + /** + * Resource unavailable. + */ + NO_RESOURCES = 5, + /** + * Permanent failure. + */ + UNSUPPORTED = 7, +}; + enum PlaneComponent { /* luma */ PLANE_COMPONENT_Y = 1 << 0, @@ -183,6 +216,9 @@ int GetCustomFormatFlags(int format, uint64_t usage, int *custom_format, uint64_ int GetBufferType(int inputFormat); bool IsGPUFlagSupported(uint64_t usage); bool HasAlphaComponent(int32_t format); + +void GetDRMFormat(uint32_t format, uint32_t flags, uint32_t *drm_format, + uint64_t *drm_format_modifier); } // namespace gralloc #endif // __GR_UTILS_H__ |