1 /* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. 2 * 3 * Redistribution and use in source and binary forms, with or without 4 * modification, are permitted provided that the following conditions are 5 * met: 6 * * Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 8 * * Redistributions in binary form must reproduce the above 9 * copyright notice, this list of conditions and the following 10 * disclaimer in the documentation and/or other materials provided 11 * with the distribution. 12 * * Neither the name of The Linux Foundation nor the names of its 13 * contributors may be used to endorse or promote products derived 14 * from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 */ 29 30 #ifndef __QCAMERA3VENDORTAGS_H__ 31 #define __QCAMERA3VENDORTAGS_H__ 32 33 namespace qcamera { 34 35 enum qcamera3_ext_section { 36 QCAMERA3_PRIVATEDATA = VENDOR_SECTION, 37 QCAMERA3_CDS, 38 QCAMERA3_OPAQUE_RAW, 39 QCAMERA3_CROP, 40 QCAMERA3_TUNING_META_DATA, 41 QCAMERA3_AV_TIMER, 42 QCAMERA3_SENSOR_META_DATA, 43 QCAMERA3_TEMPORAL_DENOISE, 44 NEXUS_EXPERIMENTAL_2015, 45 NEXUS_EXPERIMENTAL_2016, 46 QCAMERA3_SECTIONS_END 47 }; 48 49 enum qcamera3_ext_section_ranges { 50 QCAMERA3_PRIVATEDATA_START = QCAMERA3_PRIVATEDATA << 16, 51 QCAMERA3_CDS_START = QCAMERA3_CDS << 16, 52 QCAMERA3_OPAQUE_RAW_START = QCAMERA3_OPAQUE_RAW << 16, 53 QCAMERA3_CROP_START = QCAMERA3_CROP << 16, 54 QCAMERA3_TUNING_META_DATA_START = QCAMERA3_TUNING_META_DATA << 16, 55 QCAMERA3_AV_TIMER_START = QCAMERA3_AV_TIMER << 16, 56 QCAMERA3_SENSOR_META_DATA_START = QCAMERA3_SENSOR_META_DATA << 16, 57 QCAMERA3_TEMPORAL_DENOISE_START = QCAMERA3_TEMPORAL_DENOISE << 16, 58 NEXUS_EXPERIMENTAL_2015_START = NEXUS_EXPERIMENTAL_2015 <<16, 59 NEXUS_EXPERIMENTAL_2016_START = NEXUS_EXPERIMENTAL_2016 <<16, 60 }; 61 62 enum qcamera3_ext_tags { 63 QCAMERA3_PRIVATEDATA_REPROCESS = QCAMERA3_PRIVATEDATA_START, 64 QCAMERA3_PRIVATEDATA_END, 65 QCAMERA3_CDS_MODE = QCAMERA3_CDS_START, 66 QCAMERA3_CDS_INFO, 67 QCAMERA3_CDS_END, 68 69 //Property Name: org.codeaurora.qcamera3.opaque_raw.opaque_raw_strides 70 // 71 //Type: int32 * n * 3 [public] 72 // 73 //Description: Distance in bytes from the beginning of one row of opaque 74 //raw image data to the beginning of next row. 75 // 76 //Details: The strides are listed as (raw_width, raw_height, stride) 77 //triplets. For each supported raw size, there will be a stride associated 78 //with it. 79 QCAMERA3_OPAQUE_RAW_STRIDES = QCAMERA3_OPAQUE_RAW_START, 80 81 //Property Name: org.codeaurora.qcamera3.opaque_raw.opaque_raw_format 82 // 83 //Type: byte(enum) [public] 84 // * LEGACY - The legacy raw format where 8, 10, or 12-bit 85 // raw data is packed into a 64-bit word. 86 // * MIPI - raw format matching the data packing described 87 // in MIPI CSI-2 specification. In memory, the data 88 // is constructed by packing sequentially received pixels 89 // into least significant parts of the words first. 90 // Within each pixel, the least significant bits are also 91 // placed towards the least significant part of the word. 92 // 93 //Details: Lay out of opaque raw data in memory is decided by two factors: 94 // opaque_raw_format and bit depth (implied by whiteLevel). Below 95 // list illustrates their relationship: 96 // LEGACY8: P7(7:0) P6(7:0) P5(7:0) P4(7:0) P3(7:0) P2(7:0) P1(7:0) P0(7:0) 97 // 8 pixels occupy 8 bytes, no padding needed 98 // min_stride = CEILING8(raw_width) 99 // LEGACY10: 0000 P5(9:0) P4(9:0) P3(9:0) P2(9:0) P1(9:0) P0(9:0) 100 // 6 pixels occupy 8 bytes, 4 bits padding at MSB 101 // min_stride = (raw_width+5)/6 * 8 102 // LEGACY12: 0000 P4(11:0) P3(11:0) P2(11:0) P1(11:0) P0(11:0) 103 // 5 pixels occupy 8 bytes, 4 bits padding at MSB 104 // min_stride = (raw_width+4)/5 * 8 105 // MIPI8: P0(7:0) 106 // 1 pixel occupy 1 byte 107 // min_stride = raw_width 108 // MIPI10: P3(1:0) P2(1:0) P1(1:0) P0(1:0) P3(9:2) P2(9:2) P1(9:2) P0(9:2) 109 // 4 pixels occupy 5 bytes 110 // min_stride = (raw_width+3)/4 * 5 111 // MIPI12: P1(3:0) P0(3:0) P1(11:4) P0(11:4) 112 // 2 pixels occupy 3 bytes 113 // min_stride = (raw_width+1)/2 * 3 114 //Note that opaque_raw_stride needs to be at least the required minimum 115 //stride from the table above. ISP hardware may need more generous stride 116 //setting. For example, for LEGACY8, the actual stride may be 117 //CEILING16(raw_width) due to bus burst length requirement. 118 QCAMERA3_OPAQUE_RAW_FORMAT, 119 QCAMERA3_OPAQUE_RAW_END, 120 121 QCAMERA3_CROP_COUNT_REPROCESS = QCAMERA3_CROP_START, 122 QCAMERA3_CROP_REPROCESS, 123 QCAMERA3_CROP_ROI_MAP_REPROCESS, 124 QCAMERA3_CROP_END, 125 126 QCAMERA3_TUNING_META_DATA_BLOB = QCAMERA3_TUNING_META_DATA_START, 127 QCAMERA3_TUNING_META_DATA_END, 128 129 QCAMERA3_USE_AV_TIMER = QCAMERA3_AV_TIMER_START, 130 QCAMERA3_AV_TIMER_END, 131 132 QCAMERA3_SENSOR_DYNAMIC_BLACK_LEVEL_PATTERN = QCAMERA3_SENSOR_META_DATA_START, 133 QCAMERA3_SENSOR_META_DATA_END, 134 135 QCAMERA3_TEMPORAL_DENOISE_ENABLE = QCAMERA3_TEMPORAL_DENOISE_START, 136 QCAMERA3_TEMPORAL_DENOISE_PROCESS_TYPE, 137 QCAMERA3_TEMPORAL_DENOISE_END, 138 139 NEXUS_EXPERIMENTAL_2015_SENSOR_DYNAMIC_BLACK_LEVEL = NEXUS_EXPERIMENTAL_2015_START, 140 NEXUS_EXPERIMENTAL_2015_SENSOR_INFO_OPTICALLY_SHIELDED_REGIONS, 141 NEXUS_EXPERIMENTAL_2015_END, 142 143 NEXUS_EXPERIMENTAL_2016_HYBRID_AE_ENABLE = NEXUS_EXPERIMENTAL_2016_START, 144 NEXUS_EXPERIMENTAL_2016_END, 145 }; 146 147 // QCAMERA3_OPAQUE_RAW_FORMAT 148 typedef enum qcamera3_ext_opaque_raw_format { 149 QCAMERA3_OPAQUE_RAW_FORMAT_LEGACY, 150 QCAMERA3_OPAQUE_RAW_FORMAT_MIPI 151 } qcamera3_ext_opaque_raw_format_t; 152 153 class QCamera3VendorTags { 154 155 public: 156 static void get_vendor_tag_ops(vendor_tag_ops_t* ops); 157 static int get_tag_count( 158 const vendor_tag_ops_t *ops); 159 static void get_all_tags( 160 const vendor_tag_ops_t *ops, 161 uint32_t *tag_array); 162 static const char* get_section_name( 163 const vendor_tag_ops_t *ops, 164 uint32_t tag); 165 static const char* get_tag_name( 166 const vendor_tag_ops_t *ops, 167 uint32_t tag); 168 static int get_tag_type( 169 const vendor_tag_ops_t *ops, 170 uint32_t tag); 171 172 static const vendor_tag_ops_t *Ops; 173 }; 174 175 }; // namespace qcamera 176 177 #endif /* __QCAMERA3VENDORTAGS_H__ */ 178