Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 1 | /* |
Gousemoodhin Nadaf | 328aaed | 2019-01-08 15:13:35 +0530 | [diff] [blame] | 2 | * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without modification, are permitted |
| 5 | * provided that the following conditions are met: |
| 6 | * * Redistributions of source code must retain the above copyright notice, this list of |
| 7 | * conditions and the following disclaimer. |
| 8 | * * Redistributions in binary form must reproduce the above copyright notice, this list of |
| 9 | * conditions and the following disclaimer in the documentation and/or other materials provided |
| 10 | * with the distribution. |
| 11 | * * Neither the name of The Linux Foundation nor the names of its contributors may be used to |
| 12 | * endorse or promote products derived from this software without specific prior written |
| 13 | * permission. |
| 14 | * |
| 15 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 16 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 17 | * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE |
| 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 19 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 20 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 21 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 22 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 | */ |
| 24 | |
| 25 | #ifndef __HW_INFO_TYPES_H__ |
| 26 | #define __HW_INFO_TYPES_H__ |
| 27 | |
| 28 | #include <stdint.h> |
| 29 | #include <core/display_interface.h> |
Prabhanjan Kandula | 8f8f6c7 | 2015-10-05 14:40:36 +0530 | [diff] [blame] | 30 | #include <core/core_interface.h> |
Varun Arora | 7c8ee54 | 2018-05-01 20:58:16 -0700 | [diff] [blame] | 31 | #include <utils/locker.h> |
| 32 | #include <utils/debug.h> |
Dileep Marchya | 7290bd2 | 2016-06-09 11:37:20 +0530 | [diff] [blame] | 33 | #include <bitset> |
Mathew Joseph Karimpanal | 031934b | 2018-12-19 14:28:00 +0530 | [diff] [blame] | 34 | #include <map> |
Arun Kumar K.R | c033f94 | 2018-01-05 12:25:47 +0530 | [diff] [blame] | 35 | #include <memory> |
Mathew Joseph Karimpanal | 031934b | 2018-12-19 14:28:00 +0530 | [diff] [blame] | 36 | #include <set> |
| 37 | #include <string> |
| 38 | #include <vector> |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 39 | |
| 40 | namespace sdm { |
Ramkumar Radhakrishnan | 9d68cdf | 2016-06-02 19:14:57 -0700 | [diff] [blame] | 41 | using std::string; |
| 42 | |
Rajavenu Kyatham | 7ac8368 | 2016-10-10 18:31:13 +0530 | [diff] [blame] | 43 | const int kMaxSDELayers = 16; // Maximum number of layers that can be handled by MDP5 hardware |
| 44 | // in a given layer stack. |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 45 | #define MAX_PLANES 4 |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 46 | #define MAX_DETAIL_ENHANCE_CURVE 3 |
Ramkumar Radhakrishnan | 2389c6b | 2017-10-03 11:21:18 -0700 | [diff] [blame] | 47 | #define MAJOR 28 |
| 48 | #define MINOR 16 |
| 49 | #define SDEVERSION(major, minor, hw_rev) ((major) << MAJOR) | ((minor) << MINOR) | (hw_rev) |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 50 | |
Arun Kumar K.R | c033f94 | 2018-01-05 12:25:47 +0530 | [diff] [blame] | 51 | // CSC Max Size |
| 52 | #define MAX_CSC_MATRIX_COEFF_SIZE 9 |
| 53 | #define MAX_CSC_CLAMP_SIZE 6 |
| 54 | #define MAX_CSC_BIAS_SIZE 3 |
| 55 | |
Alex Sarraf | 4ec5f61 | 2018-10-29 14:02:45 -0700 | [diff] [blame] | 56 | #define MAX_SPLIT_COUNT 2 |
| 57 | |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 58 | enum HWDeviceType { |
Mathew Joseph Karimpanal | 731bc93 | 2017-11-22 10:04:56 +0530 | [diff] [blame] | 59 | kDeviceBuiltIn, |
| 60 | kDevicePluggable, |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 61 | kDeviceVirtual, |
| 62 | kDeviceRotator, |
| 63 | kDeviceMax, |
| 64 | }; |
| 65 | |
| 66 | enum HWBlockType { |
Mathew Joseph Karimpanal | 731bc93 | 2017-11-22 10:04:56 +0530 | [diff] [blame] | 67 | kHWBuiltIn, |
| 68 | kHWPluggable, |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 69 | kHWWriteback0, |
| 70 | kHWWriteback1, |
| 71 | kHWWriteback2, |
| 72 | kHWBlockMax |
| 73 | }; |
| 74 | |
| 75 | enum HWDisplayMode { |
| 76 | kModeDefault, |
| 77 | kModeVideo, |
| 78 | kModeCommand, |
| 79 | }; |
| 80 | |
Sushil Chauhan | 2e2830c | 2016-01-15 16:51:41 -0800 | [diff] [blame] | 81 | enum PipeType { |
| 82 | kPipeTypeUnused, |
| 83 | kPipeTypeVIG, |
| 84 | kPipeTypeRGB, |
| 85 | kPipeTypeDMA, |
| 86 | kPipeTypeCursor, |
| 87 | }; |
| 88 | |
Ramkumar Radhakrishnan | eb97bc9 | 2016-01-21 14:29:36 -0800 | [diff] [blame] | 89 | enum HWSubBlockType { |
| 90 | kHWVIGPipe, |
| 91 | kHWRGBPipe, |
| 92 | kHWDMAPipe, |
| 93 | kHWCursorPipe, |
| 94 | kHWRotatorInput, |
| 95 | kHWRotatorOutput, |
| 96 | kHWWBIntfOutput, |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 97 | kHWDestinationScalar, |
Ramkumar Radhakrishnan | eb97bc9 | 2016-01-21 14:29:36 -0800 | [diff] [blame] | 98 | kHWSubBlockMax, |
| 99 | }; |
| 100 | |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 101 | enum HWAlphaInterpolation { |
| 102 | kInterpolationPixelRepeat, |
| 103 | kInterpolationBilinear, |
Rohit Kulkarni | bfa855c | 2017-06-29 17:52:10 -0700 | [diff] [blame] | 104 | kInterpolation2D, |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 105 | kInterpolationMax, |
| 106 | }; |
| 107 | |
| 108 | enum HWBlendingFilter { |
| 109 | kBlendFilterCircular, |
| 110 | kBlendFilterSeparable, |
| 111 | kBlendFilterMax, |
| 112 | }; |
| 113 | |
Sushil Chauhan | 8bf69fb | 2016-04-05 11:56:32 -0700 | [diff] [blame] | 114 | enum HWPipeFlags { |
Arun Kumar K.R | 08f8d03 | 2018-07-10 08:22:40 +0530 | [diff] [blame] | 115 | kIGC = 1 << 0, |
| 116 | kMultiRect = 1 << 1, |
| 117 | kMultiRectParallelMode = 1 << 2, |
| 118 | kFlipVertical = 1 << 5, |
| 119 | kFlipHorizontal = 1 << 6, |
| 120 | kSecure = 1 << 7, |
| 121 | kDisplaySecure = 1 << 8, |
| 122 | kCameraSecure = 1 << 9, |
| 123 | kInterlaced = 1 << 10, |
| 124 | kUpdating = 1 < 11, |
| 125 | kSolidFill = 1 << 12, |
| 126 | kTonemap1d = 1 << 13, |
| 127 | kTonemap3d = 1 << 14, |
Sushil Chauhan | 8bf69fb | 2016-04-05 11:56:32 -0700 | [diff] [blame] | 128 | }; |
| 129 | |
Ramkumar Radhakrishnan | 14a1fc6 | 2016-07-14 20:29:12 -0700 | [diff] [blame] | 130 | enum HWAVRModes { |
| 131 | kContinuousMode, // Mode to enable AVR feature for every frame. |
| 132 | kOneShotMode, // Mode to enable AVR feature for particular frame. |
| 133 | }; |
| 134 | |
Ramkumar Radhakrishnan | 0563371 | 2017-09-01 11:35:29 -0700 | [diff] [blame] | 135 | enum HWTopology { |
| 136 | kUnknown, |
| 137 | kSingleLM, |
| 138 | kSingleLMDSC, |
| 139 | kDualLM, |
| 140 | kDualLMDSC, |
| 141 | kDualLMMerge, |
| 142 | kDualLMMergeDSC, |
| 143 | kDualLMDSCMerge, |
| 144 | kPPSplit, |
| 145 | }; |
| 146 | |
Sushil Chauhan | f863d0b | 2018-01-12 15:52:13 -0800 | [diff] [blame] | 147 | enum HwHdrEotf { |
| 148 | kHdrEOTFInvalid = 0, |
| 149 | kHdrEOTFSDR = 0x1, |
| 150 | kHdrEOTFHdrLumRange = 0x2, |
| 151 | kHdrEOTFHDR10 = 0x4, |
| 152 | kHdrEOTFHLG = 0x8, |
| 153 | }; |
Ramkumar Radhakrishnan | 0563371 | 2017-09-01 11:35:29 -0700 | [diff] [blame] | 154 | |
Gousemoodhin Nadaf | 47b82be | 2019-05-09 15:30:11 +0530 | [diff] [blame^] | 155 | enum HwColorspace { |
| 156 | kColorspaceXvycc601 = (1 << 0), |
| 157 | kColorspaceXvycc709 = (1 << 1), |
| 158 | kColorspaceSycc601 = (1 << 2), |
| 159 | kColorspaceAdobeycc601 = (1 << 3), |
| 160 | kColorspaceAdobergb = (1 << 4), |
| 161 | kColorspaceBt2020cycc = (1 << 5), |
| 162 | kColorspaceBt2020ycc = (1 << 6), |
| 163 | kColorspaceBt2020rgb = (1 << 7), |
| 164 | kColorspaceDcip3 = (1 << 15) |
| 165 | }; |
| 166 | |
Arun Kumar K.R | c033f94 | 2018-01-05 12:25:47 +0530 | [diff] [blame] | 167 | enum HWSrcTonemap { |
Sushil Chauhan | 7f298f8 | 2019-05-15 18:38:58 -0700 | [diff] [blame] | 168 | kSrcTonemapNone, |
Arun Kumar K.R | c033f94 | 2018-01-05 12:25:47 +0530 | [diff] [blame] | 169 | kSrcTonemap1d, // DMA |
| 170 | kSrcTonemap3d, // VIG |
| 171 | }; |
| 172 | |
| 173 | enum HWToneMapLut { |
| 174 | kLutNone, // No valid lut |
| 175 | kDma1dIgc, // DMA IGC Lut |
| 176 | kDma1dGc, // DMA GC Lut |
| 177 | kVig1dIgc, // VIG IGC Lut |
| 178 | kVig3dGamut, // 3D Gamut Lut |
| 179 | }; |
| 180 | |
| 181 | enum HWWriteOperation { |
| 182 | kNoOp, // No-op, previously set config holds good |
| 183 | kSet, // Sets the new config |
| 184 | kReset, // Resets/Clears the previously set config |
| 185 | }; |
| 186 | |
Varun Arora | 7c8ee54 | 2018-05-01 20:58:16 -0700 | [diff] [blame] | 187 | enum class HWRecoveryEvent : uint32_t { |
| 188 | kSuccess, // driver succeeded recovery |
| 189 | kCapture, // driver PP_TIMEOUT, capture logs |
| 190 | kDisplayPowerReset, // driver requesting display power cycle |
| 191 | }; |
| 192 | |
Ramkumar Radhakrishnan | eb97bc9 | 2016-01-21 14:29:36 -0800 | [diff] [blame] | 193 | typedef std::map<HWSubBlockType, std::vector<LayerBufferFormat>> FormatsMap; |
Ramkumar Radhakrishnan | 9ed1fd8 | 2017-03-09 18:46:41 -0800 | [diff] [blame] | 194 | typedef std::map<LayerBufferFormat, float> CompRatioMap; |
Ramkumar Radhakrishnan | eb97bc9 | 2016-01-21 14:29:36 -0800 | [diff] [blame] | 195 | |
Arun Kumar K.R | d07ff31 | 2018-01-02 10:44:48 +0530 | [diff] [blame] | 196 | // Base Postprocessing features information. |
| 197 | class PPFeatureInfo { |
| 198 | public: |
| 199 | uint32_t enable_flags_ = 0; // bitmap to indicate subset of parameters enabling or not. |
| 200 | uint32_t feature_version_ = 0; |
| 201 | uint32_t feature_id_ = 0; |
| 202 | uint32_t disp_id_ = 0; |
| 203 | uint32_t pipe_id_ = 0; |
| 204 | |
| 205 | virtual ~PPFeatureInfo() {} |
| 206 | virtual void *GetConfigData(void) const = 0; |
| 207 | }; |
| 208 | |
Prabhanjan Kandula | 8f8f6c7 | 2015-10-05 14:40:36 +0530 | [diff] [blame] | 209 | struct HWDynBwLimitInfo { |
Alex Sarraf | 2092d78 | 2019-06-07 17:32:21 -0700 | [diff] [blame] | 210 | uint32_t cur_mode = kBwVFEOn; |
Ramkumar Radhakrishnan | 9ed1fd8 | 2017-03-09 18:46:41 -0800 | [diff] [blame] | 211 | uint64_t total_bw_limit[kBwModeMax] = { 0 }; |
| 212 | uint64_t pipe_bw_limit[kBwModeMax] = { 0 }; |
Prabhanjan Kandula | 8f8f6c7 | 2015-10-05 14:40:36 +0530 | [diff] [blame] | 213 | }; |
| 214 | |
Sushil Chauhan | 2e2830c | 2016-01-15 16:51:41 -0800 | [diff] [blame] | 215 | struct HWPipeCaps { |
| 216 | PipeType type = kPipeTypeUnused; |
| 217 | uint32_t id = 0; |
Prabhanjan Kandula | e6dfab9 | 2017-03-14 11:02:49 -0700 | [diff] [blame] | 218 | uint32_t master_pipe_id = 0; |
Sushil Chauhan | 9964fc0 | 2016-02-10 17:47:49 -0800 | [diff] [blame] | 219 | uint32_t max_rects = 1; |
Arun Kumar K.R | c033f94 | 2018-01-05 12:25:47 +0530 | [diff] [blame] | 220 | bool inverse_pma = 0; |
| 221 | uint32_t dgm_csc_version = 0; |
| 222 | std::map<HWToneMapLut, uint32_t> tm_lut_version_map = {}; |
Ramkumar Radhakrishnan | 4a26975 | 2018-03-08 14:53:15 -0800 | [diff] [blame] | 223 | bool block_sec_ui = false; |
Sushil Chauhan | 2e2830c | 2016-01-15 16:51:41 -0800 | [diff] [blame] | 224 | }; |
| 225 | |
Saurabh Shah | cdd3895 | 2015-11-13 17:44:02 -0800 | [diff] [blame] | 226 | struct HWRotatorInfo { |
Saurabh Shah | cdd3895 | 2015-11-13 17:44:02 -0800 | [diff] [blame] | 227 | uint32_t num_rotator = 0; |
| 228 | bool has_downscale = false; |
| 229 | std::string device_path = ""; |
Sushil Chauhan | fcdb6ac | 2016-11-10 14:15:56 -0800 | [diff] [blame] | 230 | float min_downscale = 2.0f; |
Sushil Chauhan | 5e4ae0c | 2016-12-06 11:58:32 -0800 | [diff] [blame] | 231 | bool downscale_compression = false; |
Ramakant Singh | 6ce715e | 2018-11-12 19:42:25 +0530 | [diff] [blame] | 232 | uint64_t max_line_width = 0; |
Saurabh Shah | cdd3895 | 2015-11-13 17:44:02 -0800 | [diff] [blame] | 233 | }; |
| 234 | |
Rohit Kulkarni | bfa855c | 2017-06-29 17:52:10 -0700 | [diff] [blame] | 235 | enum HWQseedStepVersion { |
| 236 | kQseed3v2, |
| 237 | kQseed3v3, |
| 238 | kQseed3v4, |
Ramakant Singh | 1ba882f | 2018-06-06 10:23:21 +0530 | [diff] [blame] | 239 | kQseed3litev4, |
| 240 | kQseed3litev5, |
Rohit Kulkarni | bfa855c | 2017-06-29 17:52:10 -0700 | [diff] [blame] | 241 | }; |
| 242 | |
Ramkumar Radhakrishnan | 6884047 | 2016-05-09 13:01:25 -0700 | [diff] [blame] | 243 | struct HWDestScalarInfo { |
| 244 | uint32_t count = 0; |
| 245 | uint32_t max_input_width = 0; |
| 246 | uint32_t max_output_width = 0; |
| 247 | uint32_t max_scale_up = 1; |
Ramkumar Radhakrishnan | 9ed1fd8 | 2017-03-09 18:46:41 -0800 | [diff] [blame] | 248 | uint32_t prefill_lines = 4; |
Ramkumar Radhakrishnan | 6884047 | 2016-05-09 13:01:25 -0700 | [diff] [blame] | 249 | }; |
| 250 | |
Prabhanjan Kandula | e6dfab9 | 2017-03-14 11:02:49 -0700 | [diff] [blame] | 251 | enum SmartDMARevision { |
| 252 | V1, |
| 253 | V2, |
Mathew Joseph Karimpanal | 1f8a21c | 2017-10-20 20:47:42 +0530 | [diff] [blame] | 254 | V2p5 |
Prabhanjan Kandula | e6dfab9 | 2017-03-14 11:02:49 -0700 | [diff] [blame] | 255 | }; |
| 256 | |
Rohit Kulkarni | 2d7151c | 2017-12-14 22:17:49 -0800 | [diff] [blame] | 257 | enum InlineRotationVersion { |
| 258 | kInlineRotationNone, |
| 259 | kInlineRotationV1, |
Alex Sarraf | 4ec5f61 | 2018-10-29 14:02:45 -0700 | [diff] [blame] | 260 | }; |
| 261 | |
| 262 | struct InlineRotationInfo { |
| 263 | InlineRotationVersion inrot_version = kInlineRotationNone; |
| 264 | std::vector<LayerBufferFormat> inrot_fmts_supported; |
| 265 | float max_downscale_rt = 2.2f; // max downscale real time display |
Rohit Kulkarni | 2d7151c | 2017-12-14 22:17:49 -0800 | [diff] [blame] | 266 | }; |
| 267 | |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 268 | struct HWResourceInfo { |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 269 | uint32_t hw_version = 0; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 270 | uint32_t num_dma_pipe = 0; |
| 271 | uint32_t num_vig_pipe = 0; |
| 272 | uint32_t num_rgb_pipe = 0; |
| 273 | uint32_t num_cursor_pipe = 0; |
| 274 | uint32_t num_blending_stages = 0; |
Prabhanjan Kandula | dbc8aed | 2017-03-24 14:43:16 -0700 | [diff] [blame] | 275 | uint32_t num_solidfill_stages = 0; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 276 | uint32_t max_scale_up = 1; |
| 277 | uint32_t max_scale_down = 1; |
| 278 | uint64_t max_bandwidth_low = 0; |
| 279 | uint64_t max_bandwidth_high = 0; |
| 280 | uint32_t max_mixer_width = 2048; |
| 281 | uint32_t max_pipe_width = 2048; |
Mathew Joseph Karimpanal | 1f8a21c | 2017-10-20 20:47:42 +0530 | [diff] [blame] | 282 | uint32_t max_scaler_pipe_width = 2560; |
Alex Sarraf | 4ec5f61 | 2018-10-29 14:02:45 -0700 | [diff] [blame] | 283 | uint32_t max_rotation_pipe_width = 1088; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 284 | uint32_t max_cursor_size = 0; |
Ramkumar Radhakrishnan | 9ed1fd8 | 2017-03-09 18:46:41 -0800 | [diff] [blame] | 285 | uint64_t max_pipe_bw = 0; |
Alex Sarraf | 2092d78 | 2019-06-07 17:32:21 -0700 | [diff] [blame] | 286 | uint64_t max_pipe_bw_high = 0; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 287 | uint32_t max_sde_clk = 0; |
| 288 | float clk_fudge_factor = 1.0f; |
| 289 | uint32_t macrotile_nv12_factor = 0; |
| 290 | uint32_t macrotile_factor = 0; |
| 291 | uint32_t linear_factor = 0; |
| 292 | uint32_t scale_factor = 0; |
| 293 | uint32_t extra_fudge_factor = 0; |
Sushil Chauhan | d87e811 | 2016-03-08 14:40:47 -0800 | [diff] [blame] | 294 | uint32_t amortizable_threshold = 0; |
| 295 | uint32_t system_overhead_lines = 0; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 296 | bool has_ubwc = false; |
| 297 | bool has_decimation = false; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 298 | bool has_non_scalar_rgb = false; |
| 299 | bool is_src_split = false; |
Sushil Chauhan | 48c0356 | 2016-02-19 12:44:36 -0800 | [diff] [blame] | 300 | bool separate_rotator = false; |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 301 | bool has_qseed3 = false; |
Saurabh Shah | 3c3258c | 2016-03-28 17:08:19 -0700 | [diff] [blame] | 302 | bool has_concurrent_writeback = false; |
Dileep Marchya | 3065a27 | 2016-09-30 23:24:43 +0530 | [diff] [blame] | 303 | bool has_ppp = false; |
Namit Solanki | 6d0d806 | 2017-11-30 17:29:48 +0530 | [diff] [blame] | 304 | bool has_excl_rect = false; |
Saurabh Shah | 3c3258c | 2016-03-28 17:08:19 -0700 | [diff] [blame] | 305 | uint32_t writeback_index = kHWBlockMax; |
Prabhanjan Kandula | 8f8f6c7 | 2015-10-05 14:40:36 +0530 | [diff] [blame] | 306 | HWDynBwLimitInfo dyn_bw_info; |
Sushil Chauhan | 2e2830c | 2016-01-15 16:51:41 -0800 | [diff] [blame] | 307 | std::vector<HWPipeCaps> hw_pipes; |
Ramkumar Radhakrishnan | eb97bc9 | 2016-01-21 14:29:36 -0800 | [diff] [blame] | 308 | FormatsMap supported_formats_map; |
Saurabh Shah | cdd3895 | 2015-11-13 17:44:02 -0800 | [diff] [blame] | 309 | HWRotatorInfo hw_rot_info; |
Ramkumar Radhakrishnan | 6884047 | 2016-05-09 13:01:25 -0700 | [diff] [blame] | 310 | HWDestScalarInfo hw_dest_scalar_info; |
Rajesh Yadav | e0636f3 | 2016-12-06 20:25:19 +0530 | [diff] [blame] | 311 | bool has_hdr = false; |
Prabhanjan Kandula | e6dfab9 | 2017-03-14 11:02:49 -0700 | [diff] [blame] | 312 | SmartDMARevision smart_dma_rev = SmartDMARevision::V1; |
Ramkumar Radhakrishnan | 9ed1fd8 | 2017-03-09 18:46:41 -0800 | [diff] [blame] | 313 | float ib_fudge_factor = 1.0f; |
| 314 | uint32_t undersized_prefill_lines = 0; |
| 315 | CompRatioMap comp_ratio_rt_map; |
| 316 | CompRatioMap comp_ratio_nrt_map; |
Rohit Kulkarni | 8622e36 | 2017-01-30 18:14:10 -0800 | [diff] [blame] | 317 | uint32_t cache_size = 0; // cache size in bytes |
Rohit Kulkarni | bfa855c | 2017-06-29 17:52:10 -0700 | [diff] [blame] | 318 | HWQseedStepVersion pipe_qseed3_version = kQseed3v2; // only valid when has_qseed3=true |
Pullakavi Srinivas | 3e2c040 | 2017-12-05 17:50:15 +0530 | [diff] [blame] | 319 | uint32_t min_prefill_lines = 0; |
Alex Sarraf | 4ec5f61 | 2018-10-29 14:02:45 -0700 | [diff] [blame] | 320 | InlineRotationInfo inline_rot_info; |
Arun Kumar K.R | c033f94 | 2018-01-05 12:25:47 +0530 | [diff] [blame] | 321 | std::bitset<32> src_tone_map = 0; //!< Stores the bit mask of src tone map capability |
Ramkumar Radhakrishnan | a38b760 | 2018-03-15 14:49:52 -0700 | [diff] [blame] | 322 | int secure_disp_blend_stage = -1; |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 323 | }; |
| 324 | |
| 325 | struct HWSplitInfo { |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 326 | uint32_t left_split = 0; |
| 327 | uint32_t right_split = 0; |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 328 | |
| 329 | bool operator !=(const HWSplitInfo &split_info) { |
Saurabh Shah | 401ac51 | 2015-09-03 10:41:24 -0700 | [diff] [blame] | 330 | return ((left_split != split_info.left_split) || (right_split != split_info.right_split)); |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 331 | } |
| 332 | |
| 333 | bool operator ==(const HWSplitInfo &split_info) { |
| 334 | return !(operator !=(split_info)); |
| 335 | } |
| 336 | }; |
| 337 | |
Rajesh Yadav | e0636f3 | 2016-12-06 20:25:19 +0530 | [diff] [blame] | 338 | struct HWColorPrimaries { |
| 339 | uint32_t white_point[2] = {}; // White point |
| 340 | uint32_t red[2] = {}; // Red color primary |
| 341 | uint32_t green[2] = {}; // Green color primary |
| 342 | uint32_t blue[2] = {}; // Blue color primary |
| 343 | }; |
| 344 | |
Pullakavi Srinivas | 1494a93 | 2016-12-30 12:51:06 +0530 | [diff] [blame] | 345 | struct HWPanelOrientation { |
| 346 | bool rotation = false; |
| 347 | bool flip_horizontal = false; |
| 348 | bool flip_vertical = false; |
| 349 | }; |
| 350 | |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 351 | struct HWPanelInfo { |
Ramkumar Radhakrishnan | 9d68cdf | 2016-06-02 19:14:57 -0700 | [diff] [blame] | 352 | DisplayPort port = kPortDefault; // Display port |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 353 | HWDisplayMode mode = kModeDefault; // Display mode |
| 354 | bool partial_update = false; // Partial update feature |
Ramkumar Radhakrishnan | 4cf3fa4 | 2017-03-03 18:24:19 -0800 | [diff] [blame] | 355 | int left_align = 1; // ROI left alignment restriction |
| 356 | int width_align = 1; // ROI width alignment restriction |
| 357 | int top_align = 1; // ROI top alignment restriction |
| 358 | int height_align = 1; // ROI height alignment restriction |
| 359 | int min_roi_width = 1; // Min width needed for ROI |
| 360 | int min_roi_height = 1; // Min height needed for ROI |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 361 | bool needs_roi_merge = false; // Merge ROI's of both the DSI's |
| 362 | bool dynamic_fps = false; // Panel Supports dynamic fps |
Ramkumar Radhakrishnan | 14a1fc6 | 2016-07-14 20:29:12 -0700 | [diff] [blame] | 363 | bool dfps_porch_mode = false; // dynamic fps VFP or HFP mode |
Arun Kumar K.R | 92e1e47 | 2016-08-29 18:43:44 -0700 | [diff] [blame] | 364 | bool ping_pong_split = false; // Supports Ping pong split |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 365 | uint32_t min_fps = 0; // Min fps supported by panel |
| 366 | uint32_t max_fps = 0; // Max fps supported by panel |
| 367 | bool is_primary_panel = false; // Panel is primary display |
Ramakant Singh | d60fa36 | 2015-11-20 15:51:58 +0530 | [diff] [blame] | 368 | bool is_pluggable = false; // Panel is pluggable |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 369 | HWSplitInfo split_info; // Panel split configuration |
Dileep Marchya | 50ff0bb | 2015-10-21 10:28:41 -0700 | [diff] [blame] | 370 | char panel_name[256] = {0}; // Panel name |
Varun Arora | 75c05f0 | 2019-05-14 14:53:37 -0700 | [diff] [blame] | 371 | float panel_max_brightness = 255.0f; // Max panel brightness |
| 372 | float panel_min_brightness = 1.0f; // Min panel brightness |
Ramkumar Radhakrishnan | 249e03b | 2016-10-12 14:13:53 -0700 | [diff] [blame] | 373 | uint32_t left_roi_count = 1; // Number if ROI supported on left panel |
| 374 | uint32_t right_roi_count = 1; // Number if ROI supported on right panel |
Rajesh Yadav | e0636f3 | 2016-12-06 20:25:19 +0530 | [diff] [blame] | 375 | bool hdr_enabled = false; // HDR feature supported |
Mathew Joseph Karimpanal | 031934b | 2018-12-19 14:28:00 +0530 | [diff] [blame] | 376 | bool hdr_plus_enabled = false; // HDR10+ feature supported |
Srikanth Rajagopalan | ce0f7cb | 2017-06-12 15:14:26 -0700 | [diff] [blame] | 377 | bool hdr_metadata_type_one = false; // Static HDR metadata type one |
| 378 | uint32_t hdr_eotf = 0; // Electro optical transfer function |
Sushil Chauhan | aa8be83 | 2018-08-31 13:38:20 -0700 | [diff] [blame] | 379 | float peak_luminance = 0.0f; // Panel's peak luminance level |
| 380 | float average_luminance = 0.0f; // Panel's average luminance level |
| 381 | float blackness_level = 0.0f; // Panel's blackness level |
Rajesh Yadav | e0636f3 | 2016-12-06 20:25:19 +0530 | [diff] [blame] | 382 | HWColorPrimaries primaries = {}; // WRGB color primaries |
Pullakavi Srinivas | 1494a93 | 2016-12-30 12:51:06 +0530 | [diff] [blame] | 383 | HWPanelOrientation panel_orientation = {}; // Panel Orientation |
Pullakavi Srinivas | 9189e60 | 2018-12-19 16:58:07 +0530 | [diff] [blame] | 384 | uint32_t transfer_time_us = 0; // transfer time in micro seconds to panel's active region |
| 385 | bool qsync_support = false; // Specifies panel supports qsync feature or not. |
| 386 | bool dyn_bitclk_support = false; // Bit clk can be updated to avoid RF interference. |
| 387 | std::vector<uint64_t> bitclk_rates; // Supported bit clk levels. |
Gousemoodhin Nadaf | 47b82be | 2019-05-09 15:30:11 +0530 | [diff] [blame^] | 388 | uint32_t supported_colorspaces = 0; // supported_colorspaces for DP displays. |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 389 | |
| 390 | bool operator !=(const HWPanelInfo &panel_info) { |
| 391 | return ((port != panel_info.port) || (mode != panel_info.mode) || |
| 392 | (partial_update != panel_info.partial_update) || |
| 393 | (left_align != panel_info.left_align) || (width_align != panel_info.width_align) || |
| 394 | (top_align != panel_info.top_align) || (height_align != panel_info.height_align) || |
| 395 | (min_roi_width != panel_info.min_roi_width) || |
| 396 | (min_roi_height != panel_info.min_roi_height) || |
| 397 | (needs_roi_merge != panel_info.needs_roi_merge) || |
| 398 | (dynamic_fps != panel_info.dynamic_fps) || (min_fps != panel_info.min_fps) || |
Ramkumar Radhakrishnan | 14a1fc6 | 2016-07-14 20:29:12 -0700 | [diff] [blame] | 399 | (dfps_porch_mode != panel_info.dfps_porch_mode) || |
Arun Kumar K.R | 92e1e47 | 2016-08-29 18:43:44 -0700 | [diff] [blame] | 400 | (ping_pong_split != panel_info.ping_pong_split) || |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 401 | (max_fps != panel_info.max_fps) || (is_primary_panel != panel_info.is_primary_panel) || |
Gousemoodhin Nadaf | c81fd0b | 2019-01-16 14:40:39 +0530 | [diff] [blame] | 402 | (split_info != panel_info.split_info) || |
Ramkumar Radhakrishnan | 249e03b | 2016-10-12 14:13:53 -0700 | [diff] [blame] | 403 | (left_roi_count != panel_info.left_roi_count) || |
Ramkumar Radhakrishnan | 5c94f05 | 2017-07-06 11:59:14 -0700 | [diff] [blame] | 404 | (right_roi_count != panel_info.right_roi_count) || |
Sushil Chauhan | 8f514a5 | 2018-02-27 17:35:44 -0800 | [diff] [blame] | 405 | (transfer_time_us != panel_info.transfer_time_us) || |
Pullakavi Srinivas | 9189e60 | 2018-12-19 16:58:07 +0530 | [diff] [blame] | 406 | (qsync_support != panel_info.qsync_support) || |
| 407 | (dyn_bitclk_support != panel_info.dyn_bitclk_support) || |
| 408 | (bitclk_rates != panel_info.bitclk_rates)); |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 409 | } |
| 410 | |
| 411 | bool operator ==(const HWPanelInfo &panel_info) { |
| 412 | return !(operator !=(panel_info)); |
| 413 | } |
| 414 | }; |
| 415 | |
| 416 | struct HWSessionConfig { |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 417 | LayerRect src_rect {}; |
| 418 | LayerRect dst_rect {}; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 419 | uint32_t buffer_count = 0; |
| 420 | bool secure = false; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 421 | uint32_t frame_rate = 0; |
Saurabh Shah | cdd3895 | 2015-11-13 17:44:02 -0800 | [diff] [blame] | 422 | LayerTransform transform; |
Sushil Chauhan | dfe55a2 | 2016-09-12 15:48:29 -0700 | [diff] [blame] | 423 | bool secure_camera = false; |
Saurabh Shah | cdd3895 | 2015-11-13 17:44:02 -0800 | [diff] [blame] | 424 | |
| 425 | bool operator==(const HWSessionConfig& config) const { |
| 426 | return (src_rect == config.src_rect && |
| 427 | dst_rect == config.dst_rect && |
| 428 | buffer_count == config.buffer_count && |
| 429 | secure == config.secure && |
| 430 | frame_rate == config.frame_rate && |
Sushil Chauhan | dfe55a2 | 2016-09-12 15:48:29 -0700 | [diff] [blame] | 431 | transform == config.transform && |
| 432 | secure_camera == config.secure_camera); |
Saurabh Shah | cdd3895 | 2015-11-13 17:44:02 -0800 | [diff] [blame] | 433 | } |
| 434 | |
| 435 | bool operator!=(const HWSessionConfig& config) const { |
| 436 | return !operator==(config); |
| 437 | } |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 438 | }; |
| 439 | |
Rohit Kulkarni | 8622e36 | 2017-01-30 18:14:10 -0800 | [diff] [blame] | 440 | enum HWRotatorMode { |
| 441 | kRotatorNone, |
| 442 | kRotatorOffline, |
| 443 | kRotatorInline |
| 444 | }; |
| 445 | |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 446 | struct HWRotateInfo { |
Saurabh Shah | cdd3895 | 2015-11-13 17:44:02 -0800 | [diff] [blame] | 447 | int pipe_id = -1; // Not actual pipe id, but the relative DMA id |
| 448 | int writeback_id = -1; // Writeback block id, but this is the same as DMA id |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 449 | LayerRect src_roi {}; // Source crop of each split |
| 450 | LayerRect dst_roi {}; // Destination crop of each split |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 451 | bool valid = false; |
Saurabh Shah | cdd3895 | 2015-11-13 17:44:02 -0800 | [diff] [blame] | 452 | int rotate_id = -1; // Actual rotator session id with driver |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 453 | }; |
| 454 | |
| 455 | struct HWRotatorSession { |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 456 | HWRotateInfo hw_rotate_info[kMaxRotatePerLayer] {}; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 457 | uint32_t hw_block_count = 0; // number of rotator hw blocks used by rotator session |
Saurabh Shah | cdd3895 | 2015-11-13 17:44:02 -0800 | [diff] [blame] | 458 | int session_id = -1; // A handle with Session Manager |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 459 | HWSessionConfig hw_session_config {}; |
| 460 | LayerBuffer input_buffer {}; // Input to rotator |
| 461 | LayerBuffer output_buffer {}; // Output of rotator, crop width and stride are same |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 462 | float input_compression = 1.0f; |
| 463 | float output_compression = 1.0f; |
| 464 | bool is_buffer_cached = false; |
Rohit Kulkarni | 8622e36 | 2017-01-30 18:14:10 -0800 | [diff] [blame] | 465 | HWRotatorMode mode = kRotatorNone; |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 466 | }; |
| 467 | |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 468 | struct HWScaleLutInfo { |
| 469 | uint32_t dir_lut_size = 0; |
| 470 | uint32_t cir_lut_size = 0; |
| 471 | uint32_t sep_lut_size = 0; |
| 472 | uint64_t dir_lut = 0; |
| 473 | uint64_t cir_lut = 0; |
| 474 | uint64_t sep_lut = 0; |
| 475 | }; |
| 476 | |
Ramkumar Radhakrishnan | 5f57d11 | 2016-05-31 12:07:14 -0700 | [diff] [blame] | 477 | struct HWDetailEnhanceData : DisplayDetailEnhancerData { |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 478 | uint16_t prec_shift = 0; |
| 479 | int16_t adjust_a[MAX_DETAIL_ENHANCE_CURVE] = {0}; |
| 480 | int16_t adjust_b[MAX_DETAIL_ENHANCE_CURVE] = {0}; |
| 481 | int16_t adjust_c[MAX_DETAIL_ENHANCE_CURVE] = {0}; |
| 482 | }; |
| 483 | |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 484 | struct HWPixelExtension { |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 485 | int32_t extension = 0; // Number of pixels extension in left, right, top and bottom directions |
| 486 | // for all color components. This pixel value for each color component |
| 487 | // should be sum of fetch and repeat pixels. |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 488 | |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 489 | int32_t overfetch = 0; // Number of pixels need to be overfetched in left, right, top and bottom |
| 490 | // directions from source image for scaling. |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 491 | |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 492 | int32_t repeat = 0; // Number of pixels need to be repeated in left, right, top and bottom |
| 493 | // directions for scaling. |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 494 | }; |
| 495 | |
| 496 | struct HWPlane { |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 497 | int32_t init_phase_x = 0; |
| 498 | int32_t phase_step_x = 0; |
| 499 | int32_t init_phase_y = 0; |
| 500 | int32_t phase_step_y = 0; |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 501 | HWPixelExtension left {}; |
| 502 | HWPixelExtension top {}; |
| 503 | HWPixelExtension right {}; |
| 504 | HWPixelExtension bottom {}; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 505 | uint32_t roi_width = 0; |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 506 | int32_t preload_x = 0; |
| 507 | int32_t preload_y = 0; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 508 | uint32_t src_width = 0; |
| 509 | uint32_t src_height = 0; |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 510 | }; |
| 511 | |
Arun Kumar K.R | c033f94 | 2018-01-05 12:25:47 +0530 | [diff] [blame] | 512 | struct HWCsc { |
| 513 | int64_t ctm_coeff[MAX_CSC_MATRIX_COEFF_SIZE] = {0}; |
| 514 | uint32_t pre_bias[MAX_CSC_BIAS_SIZE] = {0}; |
| 515 | uint32_t post_bias[MAX_CSC_BIAS_SIZE] = {0}; |
| 516 | uint32_t pre_clamp[MAX_CSC_CLAMP_SIZE] = {0}; |
| 517 | uint32_t post_clamp[MAX_CSC_CLAMP_SIZE] = {0}; |
| 518 | }; |
| 519 | |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 520 | struct HWScaleData { |
| 521 | struct enable { |
| 522 | uint8_t scale = 0; |
| 523 | uint8_t direction_detection = 0; |
| 524 | uint8_t detail_enhance = 0; |
Gousemoodhin Nadaf | dd0236e | 2018-09-05 20:17:21 +0530 | [diff] [blame] | 525 | uint8_t dyn_exp_disable = 0; // RGB format dynamic pixel expansion disable. |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 526 | } enable; |
| 527 | uint32_t dst_width = 0; |
| 528 | uint32_t dst_height = 0; |
Ramakant Singh | 1ba882f | 2018-06-06 10:23:21 +0530 | [diff] [blame] | 529 | uint32_t dir_weight = 0; |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 530 | HWPlane plane[MAX_PLANES] {}; |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 531 | // scale_v2_data fields |
Ramkumar Radhakrishnan | 5f57d11 | 2016-05-31 12:07:14 -0700 | [diff] [blame] | 532 | ScalingFilterConfig y_rgb_filter_cfg = kFilterEdgeDirected; |
| 533 | ScalingFilterConfig uv_filter_cfg = kFilterEdgeDirected; |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 534 | HWAlphaInterpolation alpha_filter_cfg = kInterpolationPixelRepeat; |
| 535 | HWBlendingFilter blend_cfg = kBlendFilterCircular; |
| 536 | |
| 537 | struct lut_flags { |
| 538 | uint8_t lut_swap = 0; |
| 539 | uint8_t lut_dir_wr = 0; |
| 540 | uint8_t lut_y_cir_wr = 0; |
| 541 | uint8_t lut_uv_cir_wr = 0; |
| 542 | uint8_t lut_y_sep_wr = 0; |
| 543 | uint8_t lut_uv_sep_wr = 0; |
| 544 | } lut_flag; |
| 545 | |
| 546 | uint32_t dir_lut_idx = 0; |
| 547 | /* for Y(RGB) and UV planes*/ |
| 548 | uint32_t y_rgb_cir_lut_idx = 0; |
| 549 | uint32_t uv_cir_lut_idx = 0; |
| 550 | uint32_t y_rgb_sep_lut_idx = 0; |
| 551 | uint32_t uv_sep_lut_idx = 0; |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 552 | HWDetailEnhanceData detail_enhance {}; |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 553 | }; |
| 554 | |
Ramkumar Radhakrishnan | 6884047 | 2016-05-09 13:01:25 -0700 | [diff] [blame] | 555 | struct HWDestScaleInfo { |
| 556 | uint32_t mixer_width = 0; |
| 557 | uint32_t mixer_height = 0; |
| 558 | bool scale_update = false; |
| 559 | HWScaleData scale_data = {}; |
Ramkumar Radhakrishnan | 7d4d748 | 2017-02-02 18:21:10 -0800 | [diff] [blame] | 560 | LayerRect panel_roi = {}; |
Ramkumar Radhakrishnan | 6884047 | 2016-05-09 13:01:25 -0700 | [diff] [blame] | 561 | }; |
| 562 | |
| 563 | typedef std::map<uint32_t, HWDestScaleInfo *> DestScaleInfoMap; |
| 564 | |
Ramkumar Radhakrishnan | 14a1fc6 | 2016-07-14 20:29:12 -0700 | [diff] [blame] | 565 | struct HWAVRInfo { |
| 566 | bool enable = false; // Flag to Enable AVR feature |
| 567 | HWAVRModes mode = kContinuousMode; // Specifies the AVR mode |
| 568 | }; |
| 569 | |
Arun Kumar K.R | c033f94 | 2018-01-05 12:25:47 +0530 | [diff] [blame] | 570 | struct HWPipeCscInfo { |
| 571 | HWWriteOperation op = kNoOp; |
| 572 | HWCsc csc = {}; |
| 573 | }; |
| 574 | |
| 575 | struct HWPipeTonemapLutInfo { |
| 576 | HWWriteOperation op = kNoOp; |
| 577 | HWToneMapLut type = kLutNone; |
| 578 | std::shared_ptr<PPFeatureInfo> pay_load = nullptr; |
| 579 | }; |
| 580 | |
| 581 | struct HWPipeTonemapInversePma { |
| 582 | HWWriteOperation op = kNoOp; |
| 583 | bool inverse_pma = false; |
| 584 | }; |
| 585 | |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 586 | struct HWPipeInfo { |
Ramkumar Radhakrishnan | 9ed1fd8 | 2017-03-09 18:46:41 -0800 | [diff] [blame] | 587 | HWPipeInfo *pair = NULL; |
Namit Solanki | 5a7c985 | 2017-03-03 16:03:54 +0530 | [diff] [blame] | 588 | uint8_t rect = 255; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 589 | uint32_t pipe_id = 0; |
Arun Kumar K.R | a21cee8 | 2016-02-05 19:18:11 -0800 | [diff] [blame] | 590 | HWSubBlockType sub_block_type = kHWSubBlockMax; |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 591 | LayerRect src_roi {}; |
| 592 | LayerRect dst_roi {}; |
| 593 | LayerRect excl_rect {}; // exclusion rectangle per pipe rectangle |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 594 | uint8_t horizontal_decimation = 0; |
| 595 | uint8_t vertical_decimation = 0; |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 596 | HWScaleData scale_data {}; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 597 | uint32_t z_order = 0; |
Arun Kumar K.R | 08f8d03 | 2018-07-10 08:22:40 +0530 | [diff] [blame] | 598 | uint32_t flags = 0; |
Dileep Marchya | 1a7e1f1 | 2015-09-25 19:11:57 -0700 | [diff] [blame] | 599 | bool valid = false; |
Ramkumar Radhakrishnan | e769e8e | 2017-12-05 01:20:02 -0800 | [diff] [blame] | 600 | bool is_virtual = 0; |
Arun Kumar K.R | c033f94 | 2018-01-05 12:25:47 +0530 | [diff] [blame] | 601 | HWPipeTonemapInversePma inverse_pma_info = {}; |
| 602 | HWPipeCscInfo dgm_csc_info = {}; |
| 603 | std::vector<HWPipeTonemapLutInfo> lut_info = {}; |
Ramkumar Radhakrishnan | 6f09e9e | 2019-04-25 18:37:15 -0700 | [diff] [blame] | 604 | LayerTransform transform; |
Sushil Chauhan | 7f298f8 | 2019-05-15 18:38:58 -0700 | [diff] [blame] | 605 | HWSrcTonemap tonemap = kSrcTonemapNone; |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 606 | }; |
| 607 | |
Prabhanjan Kandula | dbc8aed | 2017-03-24 14:43:16 -0700 | [diff] [blame] | 608 | struct HWSolidfillStage { |
| 609 | uint32_t z_order = kMaxSDELayers; |
| 610 | uint32_t color = 0; |
| 611 | LayerRect roi = {}; |
| 612 | bool is_exclusion_rect = false; |
Gopikrishnaiah Anandan | cc12306 | 2017-07-31 17:21:03 -0700 | [diff] [blame] | 613 | LayerSolidFill solid_fill_info = {}; |
Prabhanjan Kandula | dbc8aed | 2017-03-24 14:43:16 -0700 | [diff] [blame] | 614 | }; |
| 615 | |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 616 | struct HWLayerConfig { |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 617 | HWPipeInfo left_pipe {}; // pipe for left side of output |
| 618 | HWPipeInfo right_pipe {}; // pipe for right side of output |
| 619 | HWRotatorSession hw_rotator_session {}; |
Alex Sarraf | 4ec5f61 | 2018-10-29 14:02:45 -0700 | [diff] [blame] | 620 | bool use_inline_rot = false; // keep track of which layers inline rotation |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 621 | HWSolidfillStage hw_solidfill_stage {}; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 622 | float compression = 1.0f; |
Prabhanjan Kandula | dbc8aed | 2017-03-24 14:43:16 -0700 | [diff] [blame] | 623 | bool use_solidfill_stage = false; |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 624 | }; |
| 625 | |
Arun Kumar K.R | d6962cd | 2017-02-01 18:08:28 -0800 | [diff] [blame] | 626 | struct HWHDRLayerInfo { |
| 627 | enum HDROperation { |
| 628 | kNoOp, // No-op. |
| 629 | kSet, // Sets the HDR MetaData - Start of HDR |
| 630 | kReset, // resets the previously set HDR Metadata, End of HDR |
| 631 | }; |
| 632 | |
| 633 | int32_t layer_index = -1; |
| 634 | HDROperation operation = kNoOp; |
Mathew Joseph Karimpanal | 031934b | 2018-12-19 14:28:00 +0530 | [diff] [blame] | 635 | bool in_hdr_mode = false; // True if already in HDR mode with static metadata. |
| 636 | bool blend_space_layer_changed = false; // True if HDR layer's index changed. |
| 637 | std::set<uint32_t> hdr_layers; // Non-tonemapped HDR layer indices. |
| 638 | std::vector<uint8_t> dyn_hdr_vsif_payload; // Dynamic HDR VSIF data. |
Arun Kumar K.R | d6962cd | 2017-02-01 18:08:28 -0800 | [diff] [blame] | 639 | }; |
| 640 | |
Namit Solanki | 6d0d806 | 2017-11-30 17:29:48 +0530 | [diff] [blame] | 641 | struct LayerExt { |
| 642 | std::vector<LayerRect> excl_rects = {}; // list of exclusion rects |
| 643 | }; |
| 644 | |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 645 | struct HWLayersInfo { |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 646 | LayerStack *stack = NULL; // Input layer stack. Set by the caller. |
Dileep Marchya | da3f632 | 2016-08-05 15:08:49 +0530 | [diff] [blame] | 647 | uint32_t app_layer_count = 0; // Total number of app layers. Must not be 0. |
| 648 | uint32_t gpu_target_index = 0; // GPU target layer index. 0 if not present. |
Arun Kumar K.R | 2a419be | 2018-04-27 12:43:58 +0530 | [diff] [blame] | 649 | std::vector<ColorPrimaries> wide_color_primaries = {}; // list of wide color primaries |
| 650 | |
Arun Kumar K.R | 9c19cdd | 2016-11-21 16:48:43 -0800 | [diff] [blame] | 651 | std::vector<Layer> hw_layers = {}; // Layers which need to be programmed on the HW |
Namit Solanki | 6d0d806 | 2017-11-30 17:29:48 +0530 | [diff] [blame] | 652 | std::vector<LayerExt> layer_exts = {}; // Extention layer having list of |
| 653 | // exclusion rectangles for each layer |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 654 | std::vector<uint32_t> index {}; // Indexes of the layers from the layer stack which need to |
Pullakavi Srinivas | ed091e6 | 2017-10-20 12:12:46 +0530 | [diff] [blame] | 655 | // be programmed on hardware. |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 656 | std::vector<uint32_t> roi_index {}; // Stores the ROI index where the layers are visible. |
Dileep Marchya | b06308d | 2017-02-13 09:45:01 +0530 | [diff] [blame] | 657 | int sync_handle = -1; // Release fence id for current draw cycle. |
| 658 | int set_idle_time_ms = -1; // Set idle time to the new specified value. |
| 659 | // -1 indicates no change in idle time since last set value. |
Dileep Marchya | 42be6d2 | 2017-01-23 21:16:14 +0530 | [diff] [blame] | 660 | std::vector<LayerRect> left_frame_roi = {}; // Left ROI. |
| 661 | std::vector<LayerRect> right_frame_roi = {}; // Right ROI. |
| 662 | LayerRect partial_fb_roi = {}; // Damaged area in framebuffer. |
Ramkumar Radhakrishnan | 249e03b | 2016-10-12 14:13:53 -0700 | [diff] [blame] | 663 | bool roi_split = false; // Indicates separated left and right ROI |
Saurabh Shah | a4af3de | 2017-04-19 17:15:24 -0700 | [diff] [blame] | 664 | bool async_cursor_updates = false; // Cursor layer allowed to have async updates |
Sushil Chauhan | 7bd2066 | 2018-08-20 17:51:32 -0700 | [diff] [blame] | 665 | bool fast_path_composition = false; // Indicates frame has fast path composition |
Ramkumar Radhakrishnan | 6884047 | 2016-05-09 13:01:25 -0700 | [diff] [blame] | 666 | DestScaleInfoMap dest_scale_info_map = {}; |
Arun Kumar K.R | d6962cd | 2017-02-01 18:08:28 -0800 | [diff] [blame] | 667 | HWHDRLayerInfo hdr_layer_info = {}; |
Rajavenu Kyatham | 7ac8368 | 2016-10-10 18:31:13 +0530 | [diff] [blame] | 668 | Handle pvt_data = NULL; // Private data used by sdm extension only. |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 669 | }; |
| 670 | |
Ramkumar Radhakrishnan | 3c4de11 | 2017-05-24 22:38:30 -0700 | [diff] [blame] | 671 | struct HWQosData { |
| 672 | uint64_t core_ab_bps = 0; |
| 673 | uint64_t core_ib_bps = 0; |
| 674 | uint64_t llcc_ab_bps = 0; |
| 675 | uint64_t llcc_ib_bps = 0; |
| 676 | uint64_t dram_ab_bps = 0; |
| 677 | uint64_t dram_ib_bps = 0; |
Ramkumar Radhakrishnan | b791044 | 2017-12-11 13:32:47 -0800 | [diff] [blame] | 678 | uint64_t rot_prefill_bw_bps = 0; |
Ramkumar Radhakrishnan | 3c4de11 | 2017-05-24 22:38:30 -0700 | [diff] [blame] | 679 | uint32_t clock_hz = 0; |
| 680 | uint32_t rot_clock_hz = 0; |
| 681 | }; |
| 682 | |
Sushil Chauhan | ec4eb57 | 2019-02-07 13:29:42 -0800 | [diff] [blame] | 683 | enum UpdateType { |
| 684 | kUpdateResources, // Indicates Strategy & RM execution, which can update resources. |
| 685 | kUpdateMax, |
| 686 | }; |
| 687 | |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 688 | struct HWLayers { |
Saurabh Shah | f91da70 | 2018-01-12 11:41:47 -0800 | [diff] [blame] | 689 | HWLayersInfo info {}; |
| 690 | HWLayerConfig config[kMaxSDELayers] {}; |
Sushil Chauhan | e94e78c | 2015-08-08 02:03:25 -0700 | [diff] [blame] | 691 | float output_compression = 1.0f; |
Ramkumar Radhakrishnan | 3c4de11 | 2017-05-24 22:38:30 -0700 | [diff] [blame] | 692 | HWQosData qos_data = {}; |
Ramkumar Radhakrishnan | 14a1fc6 | 2016-07-14 20:29:12 -0700 | [diff] [blame] | 693 | HWAVRInfo hw_avr_info = {}; |
Sushil Chauhan | ec4eb57 | 2019-02-07 13:29:42 -0800 | [diff] [blame] | 694 | std::bitset<kUpdateMax> updates_mask = 0; |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 695 | }; |
| 696 | |
| 697 | struct HWDisplayAttributes : DisplayConfigVariableInfo { |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 698 | bool is_device_split = false; |
Naseer Ahmed | e6c7d30 | 2015-07-23 14:25:36 -0400 | [diff] [blame] | 699 | uint32_t v_front_porch = 0; //!< Vertical front porch of panel |
| 700 | uint32_t v_back_porch = 0; //!< Vertical back porch of panel |
| 701 | uint32_t v_pulse_width = 0; //!< Vertical pulse width of panel |
| 702 | uint32_t h_total = 0; //!< Total width of panel (hActive + hFP + hBP + hPulseWidth) |
Saurabh Shah | 7d476ed | 2016-06-27 16:40:58 -0700 | [diff] [blame] | 703 | uint32_t v_total = 0; //!< Total height of panel (vActive + vFP + vBP + vPulseWidth) |
Ramkumar Radhakrishnan | 0563371 | 2017-09-01 11:35:29 -0700 | [diff] [blame] | 704 | uint32_t clock_khz = 0; //!< Stores the pixel clock of panel in khz |
| 705 | HWTopology topology = kUnknown; //!< Stores the topology information. |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 706 | |
Ramkumar Radhakrishnan | 6884047 | 2016-05-09 13:01:25 -0700 | [diff] [blame] | 707 | bool operator !=(const HWDisplayAttributes &display_attributes) { |
| 708 | return ((is_device_split != display_attributes.is_device_split) || |
| 709 | (x_pixels != display_attributes.x_pixels) || |
| 710 | (y_pixels != display_attributes.y_pixels) || |
| 711 | (x_dpi != display_attributes.x_dpi) || |
| 712 | (y_dpi != display_attributes.y_dpi) || |
| 713 | (fps != display_attributes.fps) || |
| 714 | (vsync_period_ns != display_attributes.vsync_period_ns) || |
| 715 | (v_front_porch != display_attributes.v_front_porch) || |
| 716 | (v_back_porch != display_attributes.v_back_porch) || |
| 717 | (v_pulse_width != display_attributes.v_pulse_width) || |
Saurabh Shah | 7d476ed | 2016-06-27 16:40:58 -0700 | [diff] [blame] | 718 | (h_total != display_attributes.h_total) || |
Ramkumar Radhakrishnan | 0563371 | 2017-09-01 11:35:29 -0700 | [diff] [blame] | 719 | (is_yuv != display_attributes.is_yuv) || |
Ramkumar Radhakrishnan | 0563371 | 2017-09-01 11:35:29 -0700 | [diff] [blame] | 720 | (clock_khz != display_attributes.clock_khz) || |
| 721 | (topology != display_attributes.topology)); |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 722 | } |
| 723 | |
Ramkumar Radhakrishnan | 6884047 | 2016-05-09 13:01:25 -0700 | [diff] [blame] | 724 | bool operator ==(const HWDisplayAttributes &display_attributes) { |
| 725 | return !(operator !=(display_attributes)); |
| 726 | } |
Sushil Chauhan | bd68212 | 2019-03-04 15:37:23 -0800 | [diff] [blame] | 727 | |
| 728 | bool OnlyFpsChanged(const HWDisplayAttributes &display_attributes) { |
| 729 | return ((fps != display_attributes.fps) && |
| 730 | (vsync_period_ns != display_attributes.vsync_period_ns) && |
| 731 | (x_pixels == display_attributes.x_pixels) && |
| 732 | (y_pixels == display_attributes.y_pixels) && |
| 733 | (x_dpi == display_attributes.x_dpi) && |
| 734 | (y_dpi == display_attributes.y_dpi) && |
| 735 | (topology == display_attributes.topology) && |
| 736 | (is_device_split == display_attributes.is_device_split) && |
| 737 | (v_front_porch == display_attributes.v_front_porch) && |
| 738 | (v_back_porch == display_attributes.v_back_porch) && |
| 739 | (v_pulse_width == display_attributes.v_pulse_width) && |
| 740 | (h_total == display_attributes.h_total) && |
| 741 | (is_yuv == display_attributes.is_yuv) && |
| 742 | (clock_khz == display_attributes.clock_khz)); |
| 743 | } |
Ramkumar Radhakrishnan | 6884047 | 2016-05-09 13:01:25 -0700 | [diff] [blame] | 744 | }; |
| 745 | |
| 746 | struct HWMixerAttributes { |
| 747 | uint32_t width = 0; // Layer mixer width |
| 748 | uint32_t height = 0; // Layer mixer height |
| 749 | uint32_t split_left = 0; |
| 750 | LayerBufferFormat output_format = kFormatRGB101010; // Layer mixer output format |
| 751 | |
| 752 | bool operator !=(const HWMixerAttributes &mixer_attributes) { |
| 753 | return ((width != mixer_attributes.width) || |
| 754 | (height != mixer_attributes.height) || |
| 755 | (output_format != mixer_attributes.output_format) || |
| 756 | (split_left != mixer_attributes.split_left)); |
| 757 | } |
| 758 | |
| 759 | bool operator ==(const HWMixerAttributes &mixer_attributes) { |
| 760 | return !(operator !=(mixer_attributes)); |
| 761 | } |
| 762 | |
| 763 | bool IsValid() { |
| 764 | return (width > 0 && height > 0); |
Dileep Marchya | 73d002e | 2015-05-08 18:58:33 -0700 | [diff] [blame] | 765 | } |
| 766 | }; |
| 767 | |
| 768 | } // namespace sdm |
| 769 | |
| 770 | #endif // __HW_INFO_TYPES_H__ |
| 771 | |