blob: d182269621e7334ec54ac3e43bf0a88d70e592e8 [file] [log] [blame]
Dileep Marchya73d002e2015-05-08 18:58:33 -07001/*
Gousemoodhin Nadaf328aaed2019-01-08 15:13:35 +05302* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
Dileep Marchya73d002e2015-05-08 18:58:33 -07003*
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 Kandula8f8f6c72015-10-05 14:40:36 +053030#include <core/core_interface.h>
Varun Arora7c8ee542018-05-01 20:58:16 -070031#include <utils/locker.h>
32#include <utils/debug.h>
Dileep Marchya7290bd22016-06-09 11:37:20 +053033#include <bitset>
Mathew Joseph Karimpanal031934b2018-12-19 14:28:00 +053034#include <map>
Arun Kumar K.Rc033f942018-01-05 12:25:47 +053035#include <memory>
Mathew Joseph Karimpanal031934b2018-12-19 14:28:00 +053036#include <set>
37#include <string>
38#include <vector>
Dileep Marchya73d002e2015-05-08 18:58:33 -070039
40namespace sdm {
Ramkumar Radhakrishnan9d68cdf2016-06-02 19:14:57 -070041using std::string;
42
Rajavenu Kyatham7ac83682016-10-10 18:31:13 +053043const int kMaxSDELayers = 16; // Maximum number of layers that can be handled by MDP5 hardware
44 // in a given layer stack.
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -080045#define MAX_PLANES 4
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -080046#define MAX_DETAIL_ENHANCE_CURVE 3
Ramkumar Radhakrishnan2389c6b2017-10-03 11:21:18 -070047#define MAJOR 28
48#define MINOR 16
49#define SDEVERSION(major, minor, hw_rev) ((major) << MAJOR) | ((minor) << MINOR) | (hw_rev)
Dileep Marchya73d002e2015-05-08 18:58:33 -070050
Arun Kumar K.Rc033f942018-01-05 12:25:47 +053051// 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 Sarraf4ec5f612018-10-29 14:02:45 -070056#define MAX_SPLIT_COUNT 2
57
Dileep Marchya73d002e2015-05-08 18:58:33 -070058enum HWDeviceType {
Mathew Joseph Karimpanal731bc932017-11-22 10:04:56 +053059 kDeviceBuiltIn,
60 kDevicePluggable,
Dileep Marchya73d002e2015-05-08 18:58:33 -070061 kDeviceVirtual,
62 kDeviceRotator,
63 kDeviceMax,
64};
65
66enum HWBlockType {
Mathew Joseph Karimpanal731bc932017-11-22 10:04:56 +053067 kHWBuiltIn,
68 kHWPluggable,
Dileep Marchya73d002e2015-05-08 18:58:33 -070069 kHWWriteback0,
70 kHWWriteback1,
71 kHWWriteback2,
72 kHWBlockMax
73};
74
75enum HWDisplayMode {
76 kModeDefault,
77 kModeVideo,
78 kModeCommand,
79};
80
Sushil Chauhan2e2830c2016-01-15 16:51:41 -080081enum PipeType {
82 kPipeTypeUnused,
83 kPipeTypeVIG,
84 kPipeTypeRGB,
85 kPipeTypeDMA,
86 kPipeTypeCursor,
87};
88
Ramkumar Radhakrishnaneb97bc92016-01-21 14:29:36 -080089enum HWSubBlockType {
90 kHWVIGPipe,
91 kHWRGBPipe,
92 kHWDMAPipe,
93 kHWCursorPipe,
94 kHWRotatorInput,
95 kHWRotatorOutput,
96 kHWWBIntfOutput,
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -080097 kHWDestinationScalar,
Ramkumar Radhakrishnaneb97bc92016-01-21 14:29:36 -080098 kHWSubBlockMax,
99};
100
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800101enum HWAlphaInterpolation {
102 kInterpolationPixelRepeat,
103 kInterpolationBilinear,
Rohit Kulkarnibfa855c2017-06-29 17:52:10 -0700104 kInterpolation2D,
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800105 kInterpolationMax,
106};
107
108enum HWBlendingFilter {
109 kBlendFilterCircular,
110 kBlendFilterSeparable,
111 kBlendFilterMax,
112};
113
Sushil Chauhan8bf69fb2016-04-05 11:56:32 -0700114enum HWPipeFlags {
Arun Kumar K.R08f8d032018-07-10 08:22:40 +0530115 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 Chauhan8bf69fb2016-04-05 11:56:32 -0700128};
129
Ramkumar Radhakrishnan14a1fc62016-07-14 20:29:12 -0700130enum HWAVRModes {
131 kContinuousMode, // Mode to enable AVR feature for every frame.
132 kOneShotMode, // Mode to enable AVR feature for particular frame.
133};
134
Ramkumar Radhakrishnan05633712017-09-01 11:35:29 -0700135enum HWTopology {
136 kUnknown,
137 kSingleLM,
138 kSingleLMDSC,
139 kDualLM,
140 kDualLMDSC,
141 kDualLMMerge,
142 kDualLMMergeDSC,
143 kDualLMDSCMerge,
144 kPPSplit,
145};
146
Sushil Chauhanf863d0b2018-01-12 15:52:13 -0800147enum HwHdrEotf {
148 kHdrEOTFInvalid = 0,
149 kHdrEOTFSDR = 0x1,
150 kHdrEOTFHdrLumRange = 0x2,
151 kHdrEOTFHDR10 = 0x4,
152 kHdrEOTFHLG = 0x8,
153};
Ramkumar Radhakrishnan05633712017-09-01 11:35:29 -0700154
Gousemoodhin Nadaf47b82be2019-05-09 15:30:11 +0530155enum 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.Rc033f942018-01-05 12:25:47 +0530167enum HWSrcTonemap {
Sushil Chauhan7f298f82019-05-15 18:38:58 -0700168 kSrcTonemapNone,
Arun Kumar K.Rc033f942018-01-05 12:25:47 +0530169 kSrcTonemap1d, // DMA
170 kSrcTonemap3d, // VIG
171};
172
173enum 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
181enum 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 Arora7c8ee542018-05-01 20:58:16 -0700187enum 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 Radhakrishnaneb97bc92016-01-21 14:29:36 -0800193typedef std::map<HWSubBlockType, std::vector<LayerBufferFormat>> FormatsMap;
Ramkumar Radhakrishnan9ed1fd82017-03-09 18:46:41 -0800194typedef std::map<LayerBufferFormat, float> CompRatioMap;
Ramkumar Radhakrishnaneb97bc92016-01-21 14:29:36 -0800195
Arun Kumar K.Rd07ff312018-01-02 10:44:48 +0530196// Base Postprocessing features information.
197class 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 Kandula8f8f6c72015-10-05 14:40:36 +0530209struct HWDynBwLimitInfo {
Alex Sarraf2092d782019-06-07 17:32:21 -0700210 uint32_t cur_mode = kBwVFEOn;
Ramkumar Radhakrishnan9ed1fd82017-03-09 18:46:41 -0800211 uint64_t total_bw_limit[kBwModeMax] = { 0 };
212 uint64_t pipe_bw_limit[kBwModeMax] = { 0 };
Prabhanjan Kandula8f8f6c72015-10-05 14:40:36 +0530213};
214
Sushil Chauhan2e2830c2016-01-15 16:51:41 -0800215struct HWPipeCaps {
216 PipeType type = kPipeTypeUnused;
217 uint32_t id = 0;
Prabhanjan Kandulae6dfab92017-03-14 11:02:49 -0700218 uint32_t master_pipe_id = 0;
Sushil Chauhan9964fc02016-02-10 17:47:49 -0800219 uint32_t max_rects = 1;
Arun Kumar K.Rc033f942018-01-05 12:25:47 +0530220 bool inverse_pma = 0;
221 uint32_t dgm_csc_version = 0;
222 std::map<HWToneMapLut, uint32_t> tm_lut_version_map = {};
Ramkumar Radhakrishnan4a269752018-03-08 14:53:15 -0800223 bool block_sec_ui = false;
Sushil Chauhan2e2830c2016-01-15 16:51:41 -0800224};
225
Saurabh Shahcdd38952015-11-13 17:44:02 -0800226struct HWRotatorInfo {
Saurabh Shahcdd38952015-11-13 17:44:02 -0800227 uint32_t num_rotator = 0;
228 bool has_downscale = false;
229 std::string device_path = "";
Sushil Chauhanfcdb6ac2016-11-10 14:15:56 -0800230 float min_downscale = 2.0f;
Sushil Chauhan5e4ae0c2016-12-06 11:58:32 -0800231 bool downscale_compression = false;
Ramakant Singh6ce715e2018-11-12 19:42:25 +0530232 uint64_t max_line_width = 0;
Saurabh Shahcdd38952015-11-13 17:44:02 -0800233};
234
Rohit Kulkarnibfa855c2017-06-29 17:52:10 -0700235enum HWQseedStepVersion {
236 kQseed3v2,
237 kQseed3v3,
238 kQseed3v4,
Ramakant Singh1ba882f2018-06-06 10:23:21 +0530239 kQseed3litev4,
240 kQseed3litev5,
Rohit Kulkarnibfa855c2017-06-29 17:52:10 -0700241};
242
Ramkumar Radhakrishnan68840472016-05-09 13:01:25 -0700243struct 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 Radhakrishnan9ed1fd82017-03-09 18:46:41 -0800248 uint32_t prefill_lines = 4;
Ramkumar Radhakrishnan68840472016-05-09 13:01:25 -0700249};
250
Prabhanjan Kandulae6dfab92017-03-14 11:02:49 -0700251enum SmartDMARevision {
252 V1,
253 V2,
Mathew Joseph Karimpanal1f8a21c2017-10-20 20:47:42 +0530254 V2p5
Prabhanjan Kandulae6dfab92017-03-14 11:02:49 -0700255};
256
Rohit Kulkarni2d7151c2017-12-14 22:17:49 -0800257enum InlineRotationVersion {
258 kInlineRotationNone,
259 kInlineRotationV1,
Alex Sarraf4ec5f612018-10-29 14:02:45 -0700260};
261
262struct 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 Kulkarni2d7151c2017-12-14 22:17:49 -0800266};
267
Dileep Marchya73d002e2015-05-08 18:58:33 -0700268struct HWResourceInfo {
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400269 uint32_t hw_version = 0;
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400270 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 Kanduladbc8aed2017-03-24 14:43:16 -0700275 uint32_t num_solidfill_stages = 0;
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400276 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 Karimpanal1f8a21c2017-10-20 20:47:42 +0530282 uint32_t max_scaler_pipe_width = 2560;
Alex Sarraf4ec5f612018-10-29 14:02:45 -0700283 uint32_t max_rotation_pipe_width = 1088;
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400284 uint32_t max_cursor_size = 0;
Ramkumar Radhakrishnan9ed1fd82017-03-09 18:46:41 -0800285 uint64_t max_pipe_bw = 0;
Alex Sarraf2092d782019-06-07 17:32:21 -0700286 uint64_t max_pipe_bw_high = 0;
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400287 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 Chauhand87e8112016-03-08 14:40:47 -0800294 uint32_t amortizable_threshold = 0;
295 uint32_t system_overhead_lines = 0;
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400296 bool has_ubwc = false;
297 bool has_decimation = false;
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400298 bool has_non_scalar_rgb = false;
299 bool is_src_split = false;
Sushil Chauhan48c03562016-02-19 12:44:36 -0800300 bool separate_rotator = false;
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800301 bool has_qseed3 = false;
Saurabh Shah3c3258c2016-03-28 17:08:19 -0700302 bool has_concurrent_writeback = false;
Dileep Marchya3065a272016-09-30 23:24:43 +0530303 bool has_ppp = false;
Namit Solanki6d0d8062017-11-30 17:29:48 +0530304 bool has_excl_rect = false;
Saurabh Shah3c3258c2016-03-28 17:08:19 -0700305 uint32_t writeback_index = kHWBlockMax;
Prabhanjan Kandula8f8f6c72015-10-05 14:40:36 +0530306 HWDynBwLimitInfo dyn_bw_info;
Sushil Chauhan2e2830c2016-01-15 16:51:41 -0800307 std::vector<HWPipeCaps> hw_pipes;
Ramkumar Radhakrishnaneb97bc92016-01-21 14:29:36 -0800308 FormatsMap supported_formats_map;
Saurabh Shahcdd38952015-11-13 17:44:02 -0800309 HWRotatorInfo hw_rot_info;
Ramkumar Radhakrishnan68840472016-05-09 13:01:25 -0700310 HWDestScalarInfo hw_dest_scalar_info;
Rajesh Yadave0636f32016-12-06 20:25:19 +0530311 bool has_hdr = false;
Prabhanjan Kandulae6dfab92017-03-14 11:02:49 -0700312 SmartDMARevision smart_dma_rev = SmartDMARevision::V1;
Ramkumar Radhakrishnan9ed1fd82017-03-09 18:46:41 -0800313 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 Kulkarni8622e362017-01-30 18:14:10 -0800317 uint32_t cache_size = 0; // cache size in bytes
Rohit Kulkarnibfa855c2017-06-29 17:52:10 -0700318 HWQseedStepVersion pipe_qseed3_version = kQseed3v2; // only valid when has_qseed3=true
Pullakavi Srinivas3e2c0402017-12-05 17:50:15 +0530319 uint32_t min_prefill_lines = 0;
Alex Sarraf4ec5f612018-10-29 14:02:45 -0700320 InlineRotationInfo inline_rot_info;
Arun Kumar K.Rc033f942018-01-05 12:25:47 +0530321 std::bitset<32> src_tone_map = 0; //!< Stores the bit mask of src tone map capability
Ramkumar Radhakrishnana38b7602018-03-15 14:49:52 -0700322 int secure_disp_blend_stage = -1;
Dileep Marchya73d002e2015-05-08 18:58:33 -0700323};
324
325struct HWSplitInfo {
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400326 uint32_t left_split = 0;
327 uint32_t right_split = 0;
Dileep Marchya73d002e2015-05-08 18:58:33 -0700328
329 bool operator !=(const HWSplitInfo &split_info) {
Saurabh Shah401ac512015-09-03 10:41:24 -0700330 return ((left_split != split_info.left_split) || (right_split != split_info.right_split));
Dileep Marchya73d002e2015-05-08 18:58:33 -0700331 }
332
333 bool operator ==(const HWSplitInfo &split_info) {
334 return !(operator !=(split_info));
335 }
336};
337
Rajesh Yadave0636f32016-12-06 20:25:19 +0530338struct 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 Srinivas1494a932016-12-30 12:51:06 +0530345struct HWPanelOrientation {
346 bool rotation = false;
347 bool flip_horizontal = false;
348 bool flip_vertical = false;
349};
350
Dileep Marchya73d002e2015-05-08 18:58:33 -0700351struct HWPanelInfo {
Ramkumar Radhakrishnan9d68cdf2016-06-02 19:14:57 -0700352 DisplayPort port = kPortDefault; // Display port
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400353 HWDisplayMode mode = kModeDefault; // Display mode
354 bool partial_update = false; // Partial update feature
Ramkumar Radhakrishnan4cf3fa42017-03-03 18:24:19 -0800355 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 Ahmede6c7d302015-07-23 14:25:36 -0400361 bool needs_roi_merge = false; // Merge ROI's of both the DSI's
362 bool dynamic_fps = false; // Panel Supports dynamic fps
Ramkumar Radhakrishnan14a1fc62016-07-14 20:29:12 -0700363 bool dfps_porch_mode = false; // dynamic fps VFP or HFP mode
Arun Kumar K.R92e1e472016-08-29 18:43:44 -0700364 bool ping_pong_split = false; // Supports Ping pong split
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400365 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 Singhd60fa362015-11-20 15:51:58 +0530368 bool is_pluggable = false; // Panel is pluggable
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400369 HWSplitInfo split_info; // Panel split configuration
Dileep Marchya50ff0bb2015-10-21 10:28:41 -0700370 char panel_name[256] = {0}; // Panel name
Varun Arora75c05f02019-05-14 14:53:37 -0700371 float panel_max_brightness = 255.0f; // Max panel brightness
372 float panel_min_brightness = 1.0f; // Min panel brightness
Ramkumar Radhakrishnan249e03b2016-10-12 14:13:53 -0700373 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 Yadave0636f32016-12-06 20:25:19 +0530375 bool hdr_enabled = false; // HDR feature supported
Mathew Joseph Karimpanal031934b2018-12-19 14:28:00 +0530376 bool hdr_plus_enabled = false; // HDR10+ feature supported
Srikanth Rajagopalance0f7cb2017-06-12 15:14:26 -0700377 bool hdr_metadata_type_one = false; // Static HDR metadata type one
378 uint32_t hdr_eotf = 0; // Electro optical transfer function
Sushil Chauhanaa8be832018-08-31 13:38:20 -0700379 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 Yadave0636f32016-12-06 20:25:19 +0530382 HWColorPrimaries primaries = {}; // WRGB color primaries
Pullakavi Srinivas1494a932016-12-30 12:51:06 +0530383 HWPanelOrientation panel_orientation = {}; // Panel Orientation
Pullakavi Srinivas9189e602018-12-19 16:58:07 +0530384 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 Nadaf47b82be2019-05-09 15:30:11 +0530388 uint32_t supported_colorspaces = 0; // supported_colorspaces for DP displays.
Dileep Marchya73d002e2015-05-08 18:58:33 -0700389
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 Radhakrishnan14a1fc62016-07-14 20:29:12 -0700399 (dfps_porch_mode != panel_info.dfps_porch_mode) ||
Arun Kumar K.R92e1e472016-08-29 18:43:44 -0700400 (ping_pong_split != panel_info.ping_pong_split) ||
Dileep Marchya73d002e2015-05-08 18:58:33 -0700401 (max_fps != panel_info.max_fps) || (is_primary_panel != panel_info.is_primary_panel) ||
Gousemoodhin Nadafc81fd0b2019-01-16 14:40:39 +0530402 (split_info != panel_info.split_info) ||
Ramkumar Radhakrishnan249e03b2016-10-12 14:13:53 -0700403 (left_roi_count != panel_info.left_roi_count) ||
Ramkumar Radhakrishnan5c94f052017-07-06 11:59:14 -0700404 (right_roi_count != panel_info.right_roi_count) ||
Sushil Chauhan8f514a52018-02-27 17:35:44 -0800405 (transfer_time_us != panel_info.transfer_time_us) ||
Pullakavi Srinivas9189e602018-12-19 16:58:07 +0530406 (qsync_support != panel_info.qsync_support) ||
407 (dyn_bitclk_support != panel_info.dyn_bitclk_support) ||
408 (bitclk_rates != panel_info.bitclk_rates));
Dileep Marchya73d002e2015-05-08 18:58:33 -0700409 }
410
411 bool operator ==(const HWPanelInfo &panel_info) {
412 return !(operator !=(panel_info));
413 }
414};
415
416struct HWSessionConfig {
Saurabh Shahf91da702018-01-12 11:41:47 -0800417 LayerRect src_rect {};
418 LayerRect dst_rect {};
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400419 uint32_t buffer_count = 0;
420 bool secure = false;
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400421 uint32_t frame_rate = 0;
Saurabh Shahcdd38952015-11-13 17:44:02 -0800422 LayerTransform transform;
Sushil Chauhandfe55a22016-09-12 15:48:29 -0700423 bool secure_camera = false;
Saurabh Shahcdd38952015-11-13 17:44:02 -0800424
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 Chauhandfe55a22016-09-12 15:48:29 -0700431 transform == config.transform &&
432 secure_camera == config.secure_camera);
Saurabh Shahcdd38952015-11-13 17:44:02 -0800433 }
434
435 bool operator!=(const HWSessionConfig& config) const {
436 return !operator==(config);
437 }
Dileep Marchya73d002e2015-05-08 18:58:33 -0700438};
439
Rohit Kulkarni8622e362017-01-30 18:14:10 -0800440enum HWRotatorMode {
441 kRotatorNone,
442 kRotatorOffline,
443 kRotatorInline
444};
445
Dileep Marchya73d002e2015-05-08 18:58:33 -0700446struct HWRotateInfo {
Saurabh Shahcdd38952015-11-13 17:44:02 -0800447 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 Shahf91da702018-01-12 11:41:47 -0800449 LayerRect src_roi {}; // Source crop of each split
450 LayerRect dst_roi {}; // Destination crop of each split
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400451 bool valid = false;
Saurabh Shahcdd38952015-11-13 17:44:02 -0800452 int rotate_id = -1; // Actual rotator session id with driver
Dileep Marchya73d002e2015-05-08 18:58:33 -0700453};
454
455struct HWRotatorSession {
Saurabh Shahf91da702018-01-12 11:41:47 -0800456 HWRotateInfo hw_rotate_info[kMaxRotatePerLayer] {};
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400457 uint32_t hw_block_count = 0; // number of rotator hw blocks used by rotator session
Saurabh Shahcdd38952015-11-13 17:44:02 -0800458 int session_id = -1; // A handle with Session Manager
Saurabh Shahf91da702018-01-12 11:41:47 -0800459 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 Ahmede6c7d302015-07-23 14:25:36 -0400462 float input_compression = 1.0f;
463 float output_compression = 1.0f;
464 bool is_buffer_cached = false;
Rohit Kulkarni8622e362017-01-30 18:14:10 -0800465 HWRotatorMode mode = kRotatorNone;
Dileep Marchya73d002e2015-05-08 18:58:33 -0700466};
467
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800468struct 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 Radhakrishnan5f57d112016-05-31 12:07:14 -0700477struct HWDetailEnhanceData : DisplayDetailEnhancerData {
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800478 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 Marchya73d002e2015-05-08 18:58:33 -0700484struct HWPixelExtension {
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800485 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 Marchya73d002e2015-05-08 18:58:33 -0700488
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800489 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 Marchya73d002e2015-05-08 18:58:33 -0700491
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800492 int32_t repeat = 0; // Number of pixels need to be repeated in left, right, top and bottom
493 // directions for scaling.
Dileep Marchya73d002e2015-05-08 18:58:33 -0700494};
495
496struct HWPlane {
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800497 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 Shahf91da702018-01-12 11:41:47 -0800501 HWPixelExtension left {};
502 HWPixelExtension top {};
503 HWPixelExtension right {};
504 HWPixelExtension bottom {};
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400505 uint32_t roi_width = 0;
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800506 int32_t preload_x = 0;
507 int32_t preload_y = 0;
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400508 uint32_t src_width = 0;
509 uint32_t src_height = 0;
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800510};
511
Arun Kumar K.Rc033f942018-01-05 12:25:47 +0530512struct 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.Ra21cee82016-02-05 19:18:11 -0800520struct HWScaleData {
521 struct enable {
522 uint8_t scale = 0;
523 uint8_t direction_detection = 0;
524 uint8_t detail_enhance = 0;
Gousemoodhin Nadafdd0236e2018-09-05 20:17:21 +0530525 uint8_t dyn_exp_disable = 0; // RGB format dynamic pixel expansion disable.
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800526 } enable;
527 uint32_t dst_width = 0;
528 uint32_t dst_height = 0;
Ramakant Singh1ba882f2018-06-06 10:23:21 +0530529 uint32_t dir_weight = 0;
Saurabh Shahf91da702018-01-12 11:41:47 -0800530 HWPlane plane[MAX_PLANES] {};
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800531 // scale_v2_data fields
Ramkumar Radhakrishnan5f57d112016-05-31 12:07:14 -0700532 ScalingFilterConfig y_rgb_filter_cfg = kFilterEdgeDirected;
533 ScalingFilterConfig uv_filter_cfg = kFilterEdgeDirected;
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800534 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 Shahf91da702018-01-12 11:41:47 -0800552 HWDetailEnhanceData detail_enhance {};
Dileep Marchya73d002e2015-05-08 18:58:33 -0700553};
554
Ramkumar Radhakrishnan68840472016-05-09 13:01:25 -0700555struct HWDestScaleInfo {
556 uint32_t mixer_width = 0;
557 uint32_t mixer_height = 0;
558 bool scale_update = false;
559 HWScaleData scale_data = {};
Ramkumar Radhakrishnan7d4d7482017-02-02 18:21:10 -0800560 LayerRect panel_roi = {};
Ramkumar Radhakrishnan68840472016-05-09 13:01:25 -0700561};
562
563typedef std::map<uint32_t, HWDestScaleInfo *> DestScaleInfoMap;
564
Ramkumar Radhakrishnan14a1fc62016-07-14 20:29:12 -0700565struct HWAVRInfo {
566 bool enable = false; // Flag to Enable AVR feature
567 HWAVRModes mode = kContinuousMode; // Specifies the AVR mode
568};
569
Arun Kumar K.Rc033f942018-01-05 12:25:47 +0530570struct HWPipeCscInfo {
571 HWWriteOperation op = kNoOp;
572 HWCsc csc = {};
573};
574
575struct HWPipeTonemapLutInfo {
576 HWWriteOperation op = kNoOp;
577 HWToneMapLut type = kLutNone;
578 std::shared_ptr<PPFeatureInfo> pay_load = nullptr;
579};
580
581struct HWPipeTonemapInversePma {
582 HWWriteOperation op = kNoOp;
583 bool inverse_pma = false;
584};
585
Dileep Marchya73d002e2015-05-08 18:58:33 -0700586struct HWPipeInfo {
Ramkumar Radhakrishnan9ed1fd82017-03-09 18:46:41 -0800587 HWPipeInfo *pair = NULL;
Namit Solanki5a7c9852017-03-03 16:03:54 +0530588 uint8_t rect = 255;
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400589 uint32_t pipe_id = 0;
Arun Kumar K.Ra21cee82016-02-05 19:18:11 -0800590 HWSubBlockType sub_block_type = kHWSubBlockMax;
Saurabh Shahf91da702018-01-12 11:41:47 -0800591 LayerRect src_roi {};
592 LayerRect dst_roi {};
593 LayerRect excl_rect {}; // exclusion rectangle per pipe rectangle
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400594 uint8_t horizontal_decimation = 0;
595 uint8_t vertical_decimation = 0;
Saurabh Shahf91da702018-01-12 11:41:47 -0800596 HWScaleData scale_data {};
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400597 uint32_t z_order = 0;
Arun Kumar K.R08f8d032018-07-10 08:22:40 +0530598 uint32_t flags = 0;
Dileep Marchya1a7e1f12015-09-25 19:11:57 -0700599 bool valid = false;
Ramkumar Radhakrishnane769e8e2017-12-05 01:20:02 -0800600 bool is_virtual = 0;
Arun Kumar K.Rc033f942018-01-05 12:25:47 +0530601 HWPipeTonemapInversePma inverse_pma_info = {};
602 HWPipeCscInfo dgm_csc_info = {};
603 std::vector<HWPipeTonemapLutInfo> lut_info = {};
Ramkumar Radhakrishnan6f09e9e2019-04-25 18:37:15 -0700604 LayerTransform transform;
Sushil Chauhan7f298f82019-05-15 18:38:58 -0700605 HWSrcTonemap tonemap = kSrcTonemapNone;
Dileep Marchya73d002e2015-05-08 18:58:33 -0700606};
607
Prabhanjan Kanduladbc8aed2017-03-24 14:43:16 -0700608struct HWSolidfillStage {
609 uint32_t z_order = kMaxSDELayers;
610 uint32_t color = 0;
611 LayerRect roi = {};
612 bool is_exclusion_rect = false;
Gopikrishnaiah Anandancc123062017-07-31 17:21:03 -0700613 LayerSolidFill solid_fill_info = {};
Prabhanjan Kanduladbc8aed2017-03-24 14:43:16 -0700614};
615
Dileep Marchya73d002e2015-05-08 18:58:33 -0700616struct HWLayerConfig {
Saurabh Shahf91da702018-01-12 11:41:47 -0800617 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 Sarraf4ec5f612018-10-29 14:02:45 -0700620 bool use_inline_rot = false; // keep track of which layers inline rotation
Saurabh Shahf91da702018-01-12 11:41:47 -0800621 HWSolidfillStage hw_solidfill_stage {};
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400622 float compression = 1.0f;
Prabhanjan Kanduladbc8aed2017-03-24 14:43:16 -0700623 bool use_solidfill_stage = false;
Dileep Marchya73d002e2015-05-08 18:58:33 -0700624};
625
Arun Kumar K.Rd6962cd2017-02-01 18:08:28 -0800626struct 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 Karimpanal031934b2018-12-19 14:28:00 +0530635 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.Rd6962cd2017-02-01 18:08:28 -0800639};
640
Namit Solanki6d0d8062017-11-30 17:29:48 +0530641struct LayerExt {
642 std::vector<LayerRect> excl_rects = {}; // list of exclusion rects
643};
644
Dileep Marchya73d002e2015-05-08 18:58:33 -0700645struct HWLayersInfo {
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400646 LayerStack *stack = NULL; // Input layer stack. Set by the caller.
Dileep Marchyada3f6322016-08-05 15:08:49 +0530647 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.R2a419be2018-04-27 12:43:58 +0530649 std::vector<ColorPrimaries> wide_color_primaries = {}; // list of wide color primaries
650
Arun Kumar K.R9c19cdd2016-11-21 16:48:43 -0800651 std::vector<Layer> hw_layers = {}; // Layers which need to be programmed on the HW
Namit Solanki6d0d8062017-11-30 17:29:48 +0530652 std::vector<LayerExt> layer_exts = {}; // Extention layer having list of
653 // exclusion rectangles for each layer
Saurabh Shahf91da702018-01-12 11:41:47 -0800654 std::vector<uint32_t> index {}; // Indexes of the layers from the layer stack which need to
Pullakavi Srinivased091e62017-10-20 12:12:46 +0530655 // be programmed on hardware.
Saurabh Shahf91da702018-01-12 11:41:47 -0800656 std::vector<uint32_t> roi_index {}; // Stores the ROI index where the layers are visible.
Dileep Marchyab06308d2017-02-13 09:45:01 +0530657 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 Marchya42be6d22017-01-23 21:16:14 +0530660 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 Radhakrishnan249e03b2016-10-12 14:13:53 -0700663 bool roi_split = false; // Indicates separated left and right ROI
Saurabh Shaha4af3de2017-04-19 17:15:24 -0700664 bool async_cursor_updates = false; // Cursor layer allowed to have async updates
Sushil Chauhan7bd20662018-08-20 17:51:32 -0700665 bool fast_path_composition = false; // Indicates frame has fast path composition
Ramkumar Radhakrishnan68840472016-05-09 13:01:25 -0700666 DestScaleInfoMap dest_scale_info_map = {};
Arun Kumar K.Rd6962cd2017-02-01 18:08:28 -0800667 HWHDRLayerInfo hdr_layer_info = {};
Rajavenu Kyatham7ac83682016-10-10 18:31:13 +0530668 Handle pvt_data = NULL; // Private data used by sdm extension only.
Dileep Marchya73d002e2015-05-08 18:58:33 -0700669};
670
Ramkumar Radhakrishnan3c4de112017-05-24 22:38:30 -0700671struct 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 Radhakrishnanb7910442017-12-11 13:32:47 -0800678 uint64_t rot_prefill_bw_bps = 0;
Ramkumar Radhakrishnan3c4de112017-05-24 22:38:30 -0700679 uint32_t clock_hz = 0;
680 uint32_t rot_clock_hz = 0;
681};
682
Sushil Chauhanec4eb572019-02-07 13:29:42 -0800683enum UpdateType {
684 kUpdateResources, // Indicates Strategy & RM execution, which can update resources.
685 kUpdateMax,
686};
687
Dileep Marchya73d002e2015-05-08 18:58:33 -0700688struct HWLayers {
Saurabh Shahf91da702018-01-12 11:41:47 -0800689 HWLayersInfo info {};
690 HWLayerConfig config[kMaxSDELayers] {};
Sushil Chauhane94e78c2015-08-08 02:03:25 -0700691 float output_compression = 1.0f;
Ramkumar Radhakrishnan3c4de112017-05-24 22:38:30 -0700692 HWQosData qos_data = {};
Ramkumar Radhakrishnan14a1fc62016-07-14 20:29:12 -0700693 HWAVRInfo hw_avr_info = {};
Sushil Chauhanec4eb572019-02-07 13:29:42 -0800694 std::bitset<kUpdateMax> updates_mask = 0;
Dileep Marchya73d002e2015-05-08 18:58:33 -0700695};
696
697struct HWDisplayAttributes : DisplayConfigVariableInfo {
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400698 bool is_device_split = false;
Naseer Ahmede6c7d302015-07-23 14:25:36 -0400699 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 Shah7d476ed2016-06-27 16:40:58 -0700703 uint32_t v_total = 0; //!< Total height of panel (vActive + vFP + vBP + vPulseWidth)
Ramkumar Radhakrishnan05633712017-09-01 11:35:29 -0700704 uint32_t clock_khz = 0; //!< Stores the pixel clock of panel in khz
705 HWTopology topology = kUnknown; //!< Stores the topology information.
Dileep Marchya73d002e2015-05-08 18:58:33 -0700706
Ramkumar Radhakrishnan68840472016-05-09 13:01:25 -0700707 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 Shah7d476ed2016-06-27 16:40:58 -0700718 (h_total != display_attributes.h_total) ||
Ramkumar Radhakrishnan05633712017-09-01 11:35:29 -0700719 (is_yuv != display_attributes.is_yuv) ||
Ramkumar Radhakrishnan05633712017-09-01 11:35:29 -0700720 (clock_khz != display_attributes.clock_khz) ||
721 (topology != display_attributes.topology));
Dileep Marchya73d002e2015-05-08 18:58:33 -0700722 }
723
Ramkumar Radhakrishnan68840472016-05-09 13:01:25 -0700724 bool operator ==(const HWDisplayAttributes &display_attributes) {
725 return !(operator !=(display_attributes));
726 }
Sushil Chauhanbd682122019-03-04 15:37:23 -0800727
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 Radhakrishnan68840472016-05-09 13:01:25 -0700744};
745
746struct 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 Marchya73d002e2015-05-08 18:58:33 -0700765 }
766};
767
768} // namespace sdm
769
770#endif // __HW_INFO_TYPES_H__
771