Prabhanjan Kandula | 96e9234 | 2016-03-24 21:03:35 +0530 | [diff] [blame] | 1 | /* |
Tharaga Balachandran | ed245fe | 2020-01-21 18:20:02 -0500 | [diff] [blame] | 2 | * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved. |
Prabhanjan Kandula | 96e9234 | 2016-03-24 21:03:35 +0530 | [diff] [blame] | 3 | * Not a Contribution |
| 4 | * |
| 5 | * Copyright (C) 2008 The Android Open Source Project |
| 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __GRALLOC_PRIV_H__ |
| 21 | #define __GRALLOC_PRIV_H__ |
| 22 | |
Soumil Shah | 345ae29 | 2018-02-02 10:37:24 -0800 | [diff] [blame] | 23 | #include <errno.h> |
Dileep Marchya | 5b4eaed | 2016-09-22 12:31:11 +0530 | [diff] [blame] | 24 | #include <unistd.h> |
Tharaga Balachandran | a069a7e | 2020-01-08 17:22:12 -0500 | [diff] [blame] | 25 | |
| 26 | #include "QtiGrallocDefs.h" |
Prabhanjan Kandula | 96e9234 | 2016-03-24 21:03:35 +0530 | [diff] [blame] | 27 | #include "gr_priv_handle.h" |
| 28 | |
Tharaga Balachandran | a069a7e | 2020-01-08 17:22:12 -0500 | [diff] [blame] | 29 | #pragma message "Warning: gralloc_priv.h is deprecated" |
| 30 | |
Uday Kiran Pichika | 89c36f4 | 2018-03-08 20:57:56 +0530 | [diff] [blame] | 31 | #define GRALLOC_PROP_PREFIX "vendor.gralloc." |
| 32 | #define GRALLOC_PROP(prop_name) GRALLOC_PROP_PREFIX prop_name |
| 33 | |
| 34 | #define DISABLE_UBWC_PROP GRALLOC_PROP("disable_ubwc") |
Mohan Pallaka | eb982e5 | 2018-09-14 12:10:57 -0700 | [diff] [blame] | 35 | #define DISABLE_AHARDWAREBUFFER_PROP GRALLOC_PROP("disable_ahardware_buffer") |
Uday Kiran Pichika | 89c36f4 | 2018-03-08 20:57:56 +0530 | [diff] [blame] | 36 | #define ENABLE_FB_UBWC_PROP GRALLOC_PROP("enable_fb_ubwc") |
| 37 | #define MAP_FB_MEMORY_PROP GRALLOC_PROP("map_fb_memory") |
Subash Chander | 001bc79 | 2018-07-09 18:48:08 +0530 | [diff] [blame] | 38 | #define USE_SYSTEM_HEAP_FOR_SENSORS GRALLOC_PROP("use_system_heap_for_sensors") |
Uday Kiran Pichika | 89c36f4 | 2018-03-08 20:57:56 +0530 | [diff] [blame] | 39 | |
Dileep Marchya | 5b4eaed | 2016-09-22 12:31:11 +0530 | [diff] [blame] | 40 | #define ROUND_UP_PAGESIZE(x) roundUpToPageSize(x) |
Naseer Ahmed | e69031e | 2016-11-22 20:05:16 -0500 | [diff] [blame] | 41 | inline int roundUpToPageSize(int x) { |
Naseer Ahmed | a422f35 | 2017-12-01 15:33:56 -0500 | [diff] [blame] | 42 | return (x + (getpagesize() - 1)) & ~(getpagesize() - 1); |
Dileep Marchya | 5b4eaed | 2016-09-22 12:31:11 +0530 | [diff] [blame] | 43 | } |
Prabhanjan Kandula | 96e9234 | 2016-03-24 21:03:35 +0530 | [diff] [blame] | 44 | |
Naseer Ahmed | a422f35 | 2017-12-01 15:33:56 -0500 | [diff] [blame] | 45 | /* Legacy gralloc1 definitions */ |
Naseer Ahmed | e69031e | 2016-11-22 20:05:16 -0500 | [diff] [blame] | 46 | /* Some clients may still be using the old flags */ |
Naseer Ahmed | a422f35 | 2017-12-01 15:33:56 -0500 | [diff] [blame] | 47 | #define GRALLOC1_PRODUCER_USAGE_PRIVATE_ADSP_HEAP GRALLOC_USAGE_PRIVATE_ADSP_HEAP |
| 48 | #define GRALLOC1_PRODUCER_USAGE_PRIVATE_ALLOC_UBWC GRALLOC_USAGE_PRIVATE_ALLOC_UBWC |
| 49 | #define GRALLOC1_PRODUCER_USAGE_PRIVATE_UNCACHED GRALLOC_USAGE_PRIVATE_UNCACHED |
| 50 | #define GRALLOC1_CONSUMER_USAGE_PRIVATE_SECURE_DISPLAY GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY |
| 51 | #define GRALLOC1_PRODUCER_USAGE_PRIVATE_MM_HEAP GRALLOC_USAGE_PRIVATE_MM_HEAP |
| 52 | #define GRALLOC1_PRODUCER_USAGE_PRIVATE_10BIT GRALLOC_USAGE_PRIVATE_10BIT |
| 53 | #define GRALLOC1_PRODUCER_USAGE_PRIVATE_10BIT_TP GRALLOC_USAGE_PRIVATE_10BIT_TP |
| 54 | #define GRALLOC1_CONSUMER_USAGE_PRIVATE_10BIT_TP GRALLOC_USAGE_PRIVATE_10BIT_TP |
Mohan Pallaka | 5d81443 | 2018-08-01 10:40:13 -0700 | [diff] [blame] | 55 | #define GRALLOC1_PRODUCER_USAGE_PRIVATE_VIDEO_NV21_ENCODER GRALLOC_USAGE_PRIVATE_VIDEO_NV21_ENCODER |
Prabhanjan Kandula | 96e9234 | 2016-03-24 21:03:35 +0530 | [diff] [blame] | 56 | |
| 57 | // for PERFORM API : |
Prabhanjan Kandula | 96e9234 | 2016-03-24 21:03:35 +0530 | [diff] [blame] | 58 | #define GRALLOC_MODULE_PERFORM_CREATE_HANDLE_FROM_BUFFER 1 |
| 59 | #define GRALLOC_MODULE_PERFORM_GET_STRIDE 2 |
| 60 | #define GRALLOC_MODULE_PERFORM_GET_CUSTOM_STRIDE_FROM_HANDLE 3 |
| 61 | #define GRALLOC_MODULE_PERFORM_GET_CUSTOM_STRIDE_AND_HEIGHT_FROM_HANDLE 4 |
| 62 | #define GRALLOC_MODULE_PERFORM_GET_ATTRIBUTES 5 |
| 63 | #define GRALLOC_MODULE_PERFORM_GET_COLOR_SPACE_FROM_HANDLE 6 |
| 64 | #define GRALLOC_MODULE_PERFORM_GET_YUV_PLANE_INFO 7 |
| 65 | #define GRALLOC_MODULE_PERFORM_GET_MAP_SECURE_BUFFER_INFO 8 |
| 66 | #define GRALLOC_MODULE_PERFORM_GET_UBWC_FLAG 9 |
| 67 | #define GRALLOC_MODULE_PERFORM_GET_RGB_DATA_ADDRESS 10 |
| 68 | #define GRALLOC_MODULE_PERFORM_GET_IGC 11 |
| 69 | #define GRALLOC_MODULE_PERFORM_SET_IGC 12 |
| 70 | #define GRALLOC_MODULE_PERFORM_SET_SINGLE_BUFFER_MODE 13 |
Naseer Ahmed | e69031e | 2016-11-22 20:05:16 -0500 | [diff] [blame] | 71 | #define GRALLOC1_MODULE_PERFORM_GET_BUFFER_SIZE_AND_DIMENSIONS 14 |
Ramkumar Radhakrishnan | 4f12b50 | 2017-09-22 17:13:37 -0700 | [diff] [blame] | 72 | #define GRALLOC1_MODULE_PERFORM_GET_INTERLACE_FLAG 15 |
Mohan Pallaka | 5d81443 | 2018-08-01 10:40:13 -0700 | [diff] [blame] | 73 | #define GRALLOC_MODULE_PERFORM_GET_GRAPHICS_METADATA 16 |
Prabhanjan Kandula | 96e9234 | 2016-03-24 21:03:35 +0530 | [diff] [blame] | 74 | |
Prabhanjan Kandula | 96e9234 | 2016-03-24 21:03:35 +0530 | [diff] [blame] | 75 | /* possible values for inverse gamma correction */ |
| 76 | #define HAL_IGC_NOT_SPECIFIED 0 |
| 77 | #define HAL_IGC_s_RGB 1 |
| 78 | |
Arun Kumar K.R | c18263e | 2016-10-03 21:26:10 -0700 | [diff] [blame] | 79 | /* Color Space: Values maps to ColorSpace_t in qdMetadata.h */ |
Naseer Ahmed | a422f35 | 2017-12-01 15:33:56 -0500 | [diff] [blame] | 80 | #define HAL_CSC_ITU_R_601 0 |
| 81 | #define HAL_CSC_ITU_R_601_FR 1 |
| 82 | #define HAL_CSC_ITU_R_709 2 |
| 83 | #define HAL_CSC_ITU_R_2020 3 |
| 84 | #define HAL_CSC_ITU_R_2020_FR 4 |
Arun Kumar K.R | c18263e | 2016-10-03 21:26:10 -0700 | [diff] [blame] | 85 | |
Prabhanjan Kandula | 96e9234 | 2016-03-24 21:03:35 +0530 | [diff] [blame] | 86 | /* possible formats for 3D content*/ |
| 87 | enum { |
| 88 | HAL_NO_3D = 0x0, |
| 89 | HAL_3D_SIDE_BY_SIDE_L_R = 0x1, |
| 90 | HAL_3D_SIDE_BY_SIDE_R_L = 0x2, |
| 91 | HAL_3D_TOP_BOTTOM = 0x4, |
| 92 | HAL_3D_IN_SIDE_BY_SIDE_L_R = 0x10000, // unused legacy format |
| 93 | }; |
| 94 | |
Ashish Kumar | 453ab5c | 2019-05-27 22:43:03 +0530 | [diff] [blame] | 95 | /* Flag to determine interlaced content |
| 96 | * Value maps to Flags presents in types.hal of QtiMapperextensions |
| 97 | */ |
| 98 | enum { |
| 99 | LAYOUT_INTERLACED_FLAG = 1 << 0, |
| 100 | }; |
| 101 | |
Prabhanjan Kandula | 96e9234 | 2016-03-24 21:03:35 +0530 | [diff] [blame] | 102 | #endif // __GRALLOC_PRIV_H__ |