abeykun | b85a5e3 | 2016-08-24 13:51:40 -0400 | [diff] [blame] | 1 | /* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef _SDE_HW_CATALOG_H |
| 14 | #define _SDE_HW_CATALOG_H |
| 15 | |
| 16 | #include <linux/kernel.h> |
| 17 | #include <linux/bug.h> |
| 18 | #include <linux/bitmap.h> |
| 19 | #include <linux/err.h> |
Alan Kwong | 67a3f79 | 2016-11-01 23:16:53 -0400 | [diff] [blame] | 20 | #include <linux/msm-bus.h> |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 21 | #include <drm/drmP.h> |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 22 | |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 23 | /** |
| 24 | * Max hardware block count: For ex: max 12 SSPP pipes or |
| 25 | * 5 ctl paths. In all cases, it can have max 12 hardware blocks |
| 26 | * based on current design |
| 27 | */ |
| 28 | #define MAX_BLOCKS 12 |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 29 | |
| 30 | #define SDE_HW_VER(MAJOR, MINOR, STEP) (((MAJOR & 0xF) << 28) |\ |
| 31 | ((MINOR & 0xFFF) << 16) |\ |
| 32 | (STEP & 0xFFFF)) |
| 33 | |
| 34 | #define SDE_HW_MAJOR(rev) ((rev) >> 28) |
abeykun | b85a5e3 | 2016-08-24 13:51:40 -0400 | [diff] [blame] | 35 | #define SDE_HW_MINOR(rev) (((rev) >> 16) & 0xFFF) |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 36 | #define SDE_HW_STEP(rev) ((rev) & 0xFFFF) |
| 37 | #define SDE_HW_MAJOR_MINOR(rev) ((rev) >> 16) |
| 38 | |
| 39 | #define IS_SDE_MAJOR_MINOR_SAME(rev1, rev2) \ |
| 40 | (SDE_HW_MAJOR_MINOR((rev1)) == SDE_HW_MAJOR_MINOR((rev2))) |
| 41 | |
| 42 | #define SDE_HW_VER_170 SDE_HW_VER(1, 7, 0) /* 8996 v1.0 */ |
| 43 | #define SDE_HW_VER_171 SDE_HW_VER(1, 7, 1) /* 8996 v2.0 */ |
| 44 | #define SDE_HW_VER_172 SDE_HW_VER(1, 7, 2) /* 8996 v3.0 */ |
| 45 | #define SDE_HW_VER_300 SDE_HW_VER(3, 0, 0) /* 8998 v1.0 */ |
Lloyd Atkinson | 274cc46 | 2017-02-21 11:52:06 -0500 | [diff] [blame] | 46 | #define SDE_HW_VER_301 SDE_HW_VER(3, 0, 1) /* 8998 v1.1 */ |
Kyle Yan | 6a20fae | 2017-02-14 13:34:41 -0800 | [diff] [blame] | 47 | #define SDE_HW_VER_400 SDE_HW_VER(4, 0, 0) /* sdm845 v1.0 */ |
abeykun | b85a5e3 | 2016-08-24 13:51:40 -0400 | [diff] [blame] | 48 | |
Kyle Yan | 6a20fae | 2017-02-14 13:34:41 -0800 | [diff] [blame] | 49 | #define IS_SDM845_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_400) |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 50 | |
Lloyd Atkinson | 7715873 | 2016-10-23 13:02:00 -0400 | [diff] [blame] | 51 | #define SDE_HW_BLK_NAME_LEN 16 |
| 52 | |
Dhaval Patel | 47302cf | 2016-08-18 15:04:28 -0700 | [diff] [blame] | 53 | #define MAX_IMG_WIDTH 0x3fff |
| 54 | #define MAX_IMG_HEIGHT 0x3fff |
| 55 | |
Dhaval Patel | 44f1247 | 2016-08-29 12:19:47 -0700 | [diff] [blame] | 56 | #define CRTC_DUAL_MIXERS 2 |
| 57 | |
Gopikrishnaiah Anandan | e3842f3 | 2015-11-05 12:18:41 -0800 | [diff] [blame] | 58 | #define SDE_COLOR_PROCESS_VER(MAJOR, MINOR) \ |
| 59 | ((((MAJOR) & 0xFFFF) << 16) | (((MINOR) & 0xFFFF))) |
| 60 | #define SDE_COLOR_PROCESS_MAJOR(version) (((version) & 0xFFFF0000) >> 16) |
| 61 | #define SDE_COLOR_PROCESS_MINOR(version) ((version) & 0xFFFF) |
| 62 | |
Clarence Ip | 7f0de63 | 2017-05-31 14:59:14 -0400 | [diff] [blame] | 63 | #define MAX_XIN_COUNT 16 |
| 64 | |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 65 | /** |
Clarence Ip | 32bcb00 | 2017-03-13 12:26:44 -0700 | [diff] [blame] | 66 | * Supported UBWC feature versions |
| 67 | */ |
| 68 | enum { |
| 69 | SDE_HW_UBWC_VER_10 = 0x100, |
| 70 | SDE_HW_UBWC_VER_20 = 0x200, |
| 71 | SDE_HW_UBWC_VER_30 = 0x300, |
| 72 | }; |
| 73 | |
| 74 | #define IS_UBWC_20_SUPPORTED(rev) ((rev) >= SDE_HW_UBWC_VER_20) |
| 75 | |
| 76 | /** |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 77 | * MDP TOP BLOCK features |
| 78 | * @SDE_MDP_PANIC_PER_PIPE Panic configuration needs to be be done per pipe |
| 79 | * @SDE_MDP_10BIT_SUPPORT, Chipset supports 10 bit pixel formats |
| 80 | * @SDE_MDP_BWC, MDSS HW supports Bandwidth compression. |
| 81 | * @SDE_MDP_UBWC_1_0, This chipsets supports Universal Bandwidth |
| 82 | * compression initial revision |
| 83 | * @SDE_MDP_UBWC_1_5, Universal Bandwidth compression version 1.5 |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 84 | * @SDE_MDP_MAX Maximum value |
| 85 | |
| 86 | */ |
| 87 | enum { |
| 88 | SDE_MDP_PANIC_PER_PIPE = 0x1, |
| 89 | SDE_MDP_10BIT_SUPPORT, |
| 90 | SDE_MDP_BWC, |
| 91 | SDE_MDP_UBWC_1_0, |
| 92 | SDE_MDP_UBWC_1_5, |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 93 | SDE_MDP_MAX |
| 94 | }; |
| 95 | |
| 96 | /** |
| 97 | * SSPP sub-blocks/features |
| 98 | * @SDE_SSPP_SRC Src and fetch part of the pipes, |
Clarence Ip | e78efb7 | 2016-06-24 18:35:21 -0400 | [diff] [blame] | 99 | * @SDE_SSPP_SCALER_QSEED2, QSEED2 algorithm support |
| 100 | * @SDE_SSPP_SCALER_QSEED3, QSEED3 alogorithm support |
| 101 | * @SDE_SSPP_SCALER_RGB, RGB Scaler, supported by RGB pipes |
| 102 | * @SDE_SSPP_CSC, Support of Color space converion |
abeykun | 6257614 | 2016-08-25 17:44:05 -0400 | [diff] [blame] | 103 | * @SDE_SSPP_CSC_10BIT, Support of 10-bit Color space conversion |
Gopikrishnaiah Anandan | e3842f3 | 2015-11-05 12:18:41 -0800 | [diff] [blame] | 104 | * @SDE_SSPP_HSIC, Global HSIC control |
| 105 | * @SDE_SSPP_MEMCOLOR Memory Color Support |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 106 | * @SDE_SSPP_IGC, Inverse gamma correction |
| 107 | * @SDE_SSPP_PCC, Color correction support |
| 108 | * @SDE_SSPP_CURSOR, SSPP can be used as a cursor layer |
Alan Kwong | 1a00e4d | 2016-07-18 09:42:30 -0400 | [diff] [blame] | 109 | * @SDE_SSPP_QOS, SSPP support QoS control, danger/safe/creq |
Alan Kwong | dce56da | 2017-04-27 15:50:34 -0700 | [diff] [blame] | 110 | * @SDE_SSPP_QOS_8LVL, SSPP support 8-level QoS control |
Veera Sundaram Sankaran | 02dd6ac | 2016-12-22 15:08:29 -0800 | [diff] [blame] | 111 | * @SDE_SSPP_EXCL_RECT, SSPP supports exclusion rect |
Jeykumar Sankaran | 2e65503 | 2017-02-04 14:05:45 -0800 | [diff] [blame] | 112 | * @SDE_SSPP_SMART_DMA_V1, SmartDMA 1.0 support |
| 113 | * @SDE_SSPP_SMART_DMA_V2, SmartDMA 2.0 support |
Alan Kwong | 4dd64c8 | 2017-02-04 18:41:51 -0800 | [diff] [blame] | 114 | * @SDE_SSPP_SBUF, SSPP support inline stream buffer |
Alan Kwong | 2349d74 | 2017-04-20 08:27:30 -0700 | [diff] [blame] | 115 | * @SDE_SSPP_TS_PREFILL Supports prefill with traffic shaper |
| 116 | * @SDE_SSPP_TS_PREFILL_REC1 Supports prefill with traffic shaper multirec |
Alan Kwong | 143f50c | 2017-04-28 07:34:28 -0700 | [diff] [blame] | 117 | * @SDE_SSPP_CDP Supports client driven prefetch |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 118 | * @SDE_SSPP_MAX maximum value |
| 119 | */ |
| 120 | enum { |
| 121 | SDE_SSPP_SRC = 0x1, |
Clarence Ip | e78efb7 | 2016-06-24 18:35:21 -0400 | [diff] [blame] | 122 | SDE_SSPP_SCALER_QSEED2, |
| 123 | SDE_SSPP_SCALER_QSEED3, |
| 124 | SDE_SSPP_SCALER_RGB, |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 125 | SDE_SSPP_CSC, |
abeykun | 6257614 | 2016-08-25 17:44:05 -0400 | [diff] [blame] | 126 | SDE_SSPP_CSC_10BIT, |
Gopikrishnaiah Anandan | e3842f3 | 2015-11-05 12:18:41 -0800 | [diff] [blame] | 127 | SDE_SSPP_HSIC, |
| 128 | SDE_SSPP_MEMCOLOR, |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 129 | SDE_SSPP_IGC, |
| 130 | SDE_SSPP_PCC, |
| 131 | SDE_SSPP_CURSOR, |
Alan Kwong | 1a00e4d | 2016-07-18 09:42:30 -0400 | [diff] [blame] | 132 | SDE_SSPP_QOS, |
Alan Kwong | dce56da | 2017-04-27 15:50:34 -0700 | [diff] [blame] | 133 | SDE_SSPP_QOS_8LVL, |
Veera Sundaram Sankaran | 02dd6ac | 2016-12-22 15:08:29 -0800 | [diff] [blame] | 134 | SDE_SSPP_EXCL_RECT, |
Jeykumar Sankaran | 2e65503 | 2017-02-04 14:05:45 -0800 | [diff] [blame] | 135 | SDE_SSPP_SMART_DMA_V1, |
| 136 | SDE_SSPP_SMART_DMA_V2, |
Alan Kwong | 4dd64c8 | 2017-02-04 18:41:51 -0800 | [diff] [blame] | 137 | SDE_SSPP_SBUF, |
Alan Kwong | 2349d74 | 2017-04-20 08:27:30 -0700 | [diff] [blame] | 138 | SDE_SSPP_TS_PREFILL, |
| 139 | SDE_SSPP_TS_PREFILL_REC1, |
Alan Kwong | 143f50c | 2017-04-28 07:34:28 -0700 | [diff] [blame] | 140 | SDE_SSPP_CDP, |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 141 | SDE_SSPP_MAX |
| 142 | }; |
| 143 | |
| 144 | /* |
| 145 | * MIXER sub-blocks/features |
| 146 | * @SDE_MIXER_LAYER Layer mixer layer blend configuration, |
| 147 | * @SDE_MIXER_SOURCESPLIT Layer mixer supports source-split configuration |
| 148 | * @SDE_MIXER_GC Gamma correction block |
Veera Sundaram Sankaran | 3171ff8 | 2017-01-04 14:34:47 -0800 | [diff] [blame] | 149 | * @SDE_DIM_LAYER Layer mixer supports dim layer |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 150 | * @SDE_MIXER_MAX maximum value |
| 151 | */ |
| 152 | enum { |
| 153 | SDE_MIXER_LAYER = 0x1, |
| 154 | SDE_MIXER_SOURCESPLIT, |
| 155 | SDE_MIXER_GC, |
Veera Sundaram Sankaran | 3171ff8 | 2017-01-04 14:34:47 -0800 | [diff] [blame] | 156 | SDE_DIM_LAYER, |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 157 | SDE_MIXER_MAX |
| 158 | }; |
| 159 | |
| 160 | /** |
| 161 | * DSPP sub-blocks |
| 162 | * @SDE_DSPP_IGC DSPP Inverse gamma correction block |
| 163 | * @SDE_DSPP_PCC Panel color correction block |
| 164 | * @SDE_DSPP_GC Gamma correction block |
Gopikrishnaiah Anandan | e3842f3 | 2015-11-05 12:18:41 -0800 | [diff] [blame] | 165 | * @SDE_DSPP_HSIC Global HSIC block |
| 166 | * @SDE_DSPP_MEMCOLOR Memory Color block |
| 167 | * @SDE_DSPP_SIXZONE Six zone block |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 168 | * @SDE_DSPP_GAMUT Gamut bloc |
| 169 | * @SDE_DSPP_DITHER Dither block |
Gopikrishnaiah Anandan | b67b0d1 | 2016-06-23 11:43:08 -0700 | [diff] [blame] | 170 | * @SDE_DSPP_HIST Histogram block |
| 171 | * @SDE_DSPP_VLUT PA VLUT block |
| 172 | * @SDE_DSPP_AD AD block |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 173 | * @SDE_DSPP_MAX maximum value |
| 174 | */ |
| 175 | enum { |
| 176 | SDE_DSPP_IGC = 0x1, |
| 177 | SDE_DSPP_PCC, |
| 178 | SDE_DSPP_GC, |
Gopikrishnaiah Anandan | e3842f3 | 2015-11-05 12:18:41 -0800 | [diff] [blame] | 179 | SDE_DSPP_HSIC, |
| 180 | SDE_DSPP_MEMCOLOR, |
| 181 | SDE_DSPP_SIXZONE, |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 182 | SDE_DSPP_GAMUT, |
| 183 | SDE_DSPP_DITHER, |
| 184 | SDE_DSPP_HIST, |
Gopikrishnaiah Anandan | b67b0d1 | 2016-06-23 11:43:08 -0700 | [diff] [blame] | 185 | SDE_DSPP_VLUT, |
Gopikrishnaiah Anandan | 41980b4 | 2016-06-21 16:01:33 -0700 | [diff] [blame] | 186 | SDE_DSPP_AD, |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 187 | SDE_DSPP_MAX |
| 188 | }; |
| 189 | |
| 190 | /** |
| 191 | * PINGPONG sub-blocks |
| 192 | * @SDE_PINGPONG_TE Tear check block |
| 193 | * @SDE_PINGPONG_TE2 Additional tear check block for split pipes |
| 194 | * @SDE_PINGPONG_SPLIT PP block supports split fifo |
Clarence Ip | 8e69ad0 | 2016-12-09 09:43:57 -0500 | [diff] [blame] | 195 | * @SDE_PINGPONG_SLAVE PP block is a suitable slave for split fifo |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 196 | * @SDE_PINGPONG_DSC, Display stream compression blocks |
Ping Li | 8430ee1 | 2017-02-24 14:14:44 -0800 | [diff] [blame] | 197 | * @SDE_PINGPONG_DITHER, Dither blocks |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 198 | * @SDE_PINGPONG_MAX |
| 199 | */ |
| 200 | enum { |
| 201 | SDE_PINGPONG_TE = 0x1, |
| 202 | SDE_PINGPONG_TE2, |
| 203 | SDE_PINGPONG_SPLIT, |
Clarence Ip | 8e69ad0 | 2016-12-09 09:43:57 -0500 | [diff] [blame] | 204 | SDE_PINGPONG_SLAVE, |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 205 | SDE_PINGPONG_DSC, |
Ping Li | 8430ee1 | 2017-02-24 14:14:44 -0800 | [diff] [blame] | 206 | SDE_PINGPONG_DITHER, |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 207 | SDE_PINGPONG_MAX |
| 208 | }; |
| 209 | |
| 210 | /** |
Lloyd Atkinson | cf8996b | 2016-08-23 09:34:13 -0400 | [diff] [blame] | 211 | * CTL sub-blocks |
| 212 | * @SDE_CTL_SPLIT_DISPLAY CTL supports video mode split display |
| 213 | * @SDE_CTL_PINGPONG_SPLIT CTL supports pingpong split |
Alan Kwong | 4dd64c8 | 2017-02-04 18:41:51 -0800 | [diff] [blame] | 214 | * @SDE_CTL_SBUF CTL supports inline stream buffer |
Lloyd Atkinson | cf8996b | 2016-08-23 09:34:13 -0400 | [diff] [blame] | 215 | * @SDE_CTL_MAX |
| 216 | */ |
| 217 | enum { |
| 218 | SDE_CTL_SPLIT_DISPLAY = 0x1, |
| 219 | SDE_CTL_PINGPONG_SPLIT, |
Alan Kwong | 4dd64c8 | 2017-02-04 18:41:51 -0800 | [diff] [blame] | 220 | SDE_CTL_SBUF, |
Lloyd Atkinson | cf8996b | 2016-08-23 09:34:13 -0400 | [diff] [blame] | 221 | SDE_CTL_MAX |
| 222 | }; |
| 223 | |
| 224 | /** |
Alan Kwong | 4aacd53 | 2017-02-04 18:51:33 -0800 | [diff] [blame] | 225 | * INTF sub-blocks |
| 226 | * @SDE_INTF_ROT_START INTF supports rotator start trigger |
| 227 | * @SDE_INTF_MAX |
| 228 | */ |
| 229 | enum { |
| 230 | SDE_INTF_ROT_START = 0x1, |
| 231 | SDE_INTF_MAX |
| 232 | }; |
| 233 | |
| 234 | /** |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 235 | * WB sub-blocks and features |
| 236 | * @SDE_WB_LINE_MODE Writeback module supports line/linear mode |
| 237 | * @SDE_WB_BLOCK_MODE Writeback module supports block mode read |
| 238 | * @SDE_WB_ROTATE rotation support,this is available if writeback |
| 239 | * supports block mode read |
| 240 | * @SDE_WB_CSC Writeback color conversion block support |
| 241 | * @SDE_WB_CHROMA_DOWN, Writeback chroma down block, |
| 242 | * @SDE_WB_DOWNSCALE, Writeback integer downscaler, |
| 243 | * @SDE_WB_DITHER, Dither block |
| 244 | * @SDE_WB_TRAFFIC_SHAPER, Writeback traffic shaper bloc |
Clarence Ip | 32bcb00 | 2017-03-13 12:26:44 -0700 | [diff] [blame] | 245 | * @SDE_WB_UBWC, Writeback Universal bandwidth compression |
Alan Kwong | 3232ca5 | 2016-07-29 02:27:47 -0400 | [diff] [blame] | 246 | * @SDE_WB_YUV_CONFIG Writeback supports output of YUV colorspace |
Alan Kwong | 9ffcd59 | 2016-09-27 07:41:56 -0400 | [diff] [blame] | 247 | * @SDE_WB_PIPE_ALPHA Writeback supports pipe alpha |
abeykun | f1539f7 | 2016-08-24 16:08:03 -0400 | [diff] [blame] | 248 | * @SDE_WB_XY_ROI_OFFSET Writeback supports x/y-offset of out ROI in |
| 249 | * the destination image |
Alan Kwong | dce56da | 2017-04-27 15:50:34 -0700 | [diff] [blame] | 250 | * @SDE_WB_QOS, Writeback supports QoS control, danger/safe/creq |
| 251 | * @SDE_WB_QOS_8LVL, Writeback supports 8-level QoS control |
Alan Kwong | 143f50c | 2017-04-28 07:34:28 -0700 | [diff] [blame] | 252 | * @SDE_WB_CDP Writeback supports client driven prefetch |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 253 | * @SDE_WB_MAX maximum value |
| 254 | */ |
| 255 | enum { |
| 256 | SDE_WB_LINE_MODE = 0x1, |
| 257 | SDE_WB_BLOCK_MODE, |
| 258 | SDE_WB_ROTATE = SDE_WB_BLOCK_MODE, |
| 259 | SDE_WB_CSC, |
| 260 | SDE_WB_CHROMA_DOWN, |
| 261 | SDE_WB_DOWNSCALE, |
| 262 | SDE_WB_DITHER, |
| 263 | SDE_WB_TRAFFIC_SHAPER, |
Clarence Ip | 32bcb00 | 2017-03-13 12:26:44 -0700 | [diff] [blame] | 264 | SDE_WB_UBWC, |
Alan Kwong | 3232ca5 | 2016-07-29 02:27:47 -0400 | [diff] [blame] | 265 | SDE_WB_YUV_CONFIG, |
Alan Kwong | 9ffcd59 | 2016-09-27 07:41:56 -0400 | [diff] [blame] | 266 | SDE_WB_PIPE_ALPHA, |
abeykun | f1539f7 | 2016-08-24 16:08:03 -0400 | [diff] [blame] | 267 | SDE_WB_XY_ROI_OFFSET, |
Alan Kwong | dce56da | 2017-04-27 15:50:34 -0700 | [diff] [blame] | 268 | SDE_WB_QOS, |
| 269 | SDE_WB_QOS_8LVL, |
Alan Kwong | 143f50c | 2017-04-28 07:34:28 -0700 | [diff] [blame] | 270 | SDE_WB_CDP, |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 271 | SDE_WB_MAX |
| 272 | }; |
| 273 | |
| 274 | /** |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 275 | * VBIF sub-blocks and features |
| 276 | * @SDE_VBIF_QOS_OTLIM VBIF supports OT Limit |
Alan Kwong | a62eeb8 | 2017-04-19 08:57:55 -0700 | [diff] [blame] | 277 | * @SDE_VBIF_QOS_REMAP VBIF supports QoS priority remap |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 278 | * @SDE_VBIF_MAX maximum value |
| 279 | */ |
| 280 | enum { |
| 281 | SDE_VBIF_QOS_OTLIM = 0x1, |
Alan Kwong | a62eeb8 | 2017-04-19 08:57:55 -0700 | [diff] [blame] | 282 | SDE_VBIF_QOS_REMAP, |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 283 | SDE_VBIF_MAX |
| 284 | }; |
| 285 | |
| 286 | /** |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 287 | * MACRO SDE_HW_BLK_INFO - information of HW blocks inside SDE |
Lloyd Atkinson | 7715873 | 2016-10-23 13:02:00 -0400 | [diff] [blame] | 288 | * @name: string name for debug purposes |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 289 | * @id: enum identifying this block |
| 290 | * @base: register base offset to mdss |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 291 | * @len: length of hardware block |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 292 | * @features bit mask identifying sub-blocks/features |
| 293 | */ |
| 294 | #define SDE_HW_BLK_INFO \ |
Lloyd Atkinson | 7715873 | 2016-10-23 13:02:00 -0400 | [diff] [blame] | 295 | char name[SDE_HW_BLK_NAME_LEN]; \ |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 296 | u32 id; \ |
| 297 | u32 base; \ |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 298 | u32 len; \ |
| 299 | unsigned long features; \ |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 300 | |
| 301 | /** |
| 302 | * MACRO SDE_HW_SUBBLK_INFO - information of HW sub-block inside SDE |
Lloyd Atkinson | 7715873 | 2016-10-23 13:02:00 -0400 | [diff] [blame] | 303 | * @name: string name for debug purposes |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 304 | * @id: enum identifying this sub-block |
| 305 | * @base: offset of this sub-block relative to the block |
| 306 | * offset |
| 307 | * @len register block length of this sub-block |
| 308 | */ |
| 309 | #define SDE_HW_SUBBLK_INFO \ |
Lloyd Atkinson | 7715873 | 2016-10-23 13:02:00 -0400 | [diff] [blame] | 310 | char name[SDE_HW_BLK_NAME_LEN]; \ |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 311 | u32 id; \ |
| 312 | u32 base; \ |
| 313 | u32 len |
| 314 | |
| 315 | /** |
| 316 | * struct sde_src_blk: SSPP part of the source pipes |
| 317 | * @info: HW register and features supported by this sub-blk |
| 318 | */ |
| 319 | struct sde_src_blk { |
| 320 | SDE_HW_SUBBLK_INFO; |
| 321 | }; |
| 322 | |
| 323 | /** |
Clarence Ip | e78efb7 | 2016-06-24 18:35:21 -0400 | [diff] [blame] | 324 | * struct sde_scaler_blk: Scaler information |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 325 | * @info: HW register and features supported by this sub-blk |
abeykun | 48f407a | 2016-08-25 12:06:44 -0400 | [diff] [blame] | 326 | * @version: qseed block revision |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 327 | */ |
Clarence Ip | e78efb7 | 2016-06-24 18:35:21 -0400 | [diff] [blame] | 328 | struct sde_scaler_blk { |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 329 | SDE_HW_SUBBLK_INFO; |
abeykun | 48f407a | 2016-08-25 12:06:44 -0400 | [diff] [blame] | 330 | u32 version; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 331 | }; |
| 332 | |
| 333 | struct sde_csc_blk { |
| 334 | SDE_HW_SUBBLK_INFO; |
| 335 | }; |
| 336 | |
| 337 | /** |
| 338 | * struct sde_pp_blk : Pixel processing sub-blk information |
| 339 | * @info: HW register and features supported by this sub-blk |
| 340 | * @version: HW Algorithm version |
| 341 | */ |
| 342 | struct sde_pp_blk { |
| 343 | SDE_HW_SUBBLK_INFO; |
| 344 | u32 version; |
| 345 | }; |
| 346 | |
| 347 | /** |
Clarence Ip | ea3d626 | 2016-07-15 16:20:11 -0400 | [diff] [blame] | 348 | * struct sde_format_extended - define sde specific pixel format+modifier |
| 349 | * @fourcc_format: Base FOURCC pixel format code |
| 350 | * @modifier: 64-bit drm format modifier, same modifier must be applied to all |
| 351 | * framebuffer planes |
| 352 | */ |
| 353 | struct sde_format_extended { |
| 354 | uint32_t fourcc_format; |
| 355 | uint64_t modifier; |
| 356 | }; |
| 357 | |
| 358 | /** |
Alan Kwong | dce56da | 2017-04-27 15:50:34 -0700 | [diff] [blame] | 359 | * enum sde_qos_lut_usage - define QoS LUT use cases |
| 360 | */ |
| 361 | enum sde_qos_lut_usage { |
| 362 | SDE_QOS_LUT_USAGE_LINEAR, |
| 363 | SDE_QOS_LUT_USAGE_MACROTILE, |
| 364 | SDE_QOS_LUT_USAGE_NRT, |
| 365 | SDE_QOS_LUT_USAGE_CWB, |
| 366 | SDE_QOS_LUT_USAGE_MAX, |
| 367 | }; |
| 368 | |
| 369 | /** |
| 370 | * struct sde_qos_lut_entry - define QoS LUT table entry |
| 371 | * @fl: fill level, or zero on last entry to indicate default lut |
| 372 | * @lut: lut to use if equal to or less than fill level |
| 373 | */ |
| 374 | struct sde_qos_lut_entry { |
| 375 | u32 fl; |
| 376 | u64 lut; |
| 377 | }; |
| 378 | |
| 379 | /** |
| 380 | * struct sde_qos_lut_tbl - define QoS LUT table |
| 381 | * @nentry: number of entry in this table |
| 382 | * @entries: Pointer to table entries |
| 383 | */ |
| 384 | struct sde_qos_lut_tbl { |
| 385 | u32 nentry; |
| 386 | struct sde_qos_lut_entry *entries; |
| 387 | }; |
| 388 | |
| 389 | /** |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 390 | * struct sde_sspp_sub_blks : SSPP sub-blocks |
| 391 | * @maxdwnscale: max downscale ratio supported(without DECIMATION) |
| 392 | * @maxupscale: maxupscale ratio supported |
| 393 | * @maxwidth: max pixelwidth supported by this pipe |
Alan Kwong | 1a00e4d | 2016-07-18 09:42:30 -0400 | [diff] [blame] | 394 | * @creq_vblank: creq priority during vertical blanking |
| 395 | * @danger_vblank: danger priority during vertical blanking |
| 396 | * @pixel_ram_size: size of latency hiding and de-tiling buffer in bytes |
Jeykumar Sankaran | 2e65503 | 2017-02-04 14:05:45 -0800 | [diff] [blame] | 397 | * @smart_dma_priority: hw priority of rect1 of multirect pipe |
Steve Cohen | 5742817 | 2017-07-18 10:57:17 -0400 | [diff] [blame] | 398 | * @max_per_pipe_bw: maximum allowable bandwidth of this pipe in kBps |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 399 | * @src_blk: |
Clarence Ip | e78efb7 | 2016-06-24 18:35:21 -0400 | [diff] [blame] | 400 | * @scaler_blk: |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 401 | * @csc_blk: |
Gopikrishnaiah Anandan | e3842f3 | 2015-11-05 12:18:41 -0800 | [diff] [blame] | 402 | * @hsic: |
| 403 | * @memcolor: |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 404 | * @pcc_blk: |
Gopikrishnaiah Anandan | e3842f3 | 2015-11-05 12:18:41 -0800 | [diff] [blame] | 405 | * @igc_blk: |
Clarence Ip | ea3d626 | 2016-07-15 16:20:11 -0400 | [diff] [blame] | 406 | * @format_list: Pointer to list of supported formats |
Steve Cohen | 5742817 | 2017-07-18 10:57:17 -0400 | [diff] [blame] | 407 | * @virt_format_list: Pointer to list of supported formats for virtual planes |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 408 | */ |
| 409 | struct sde_sspp_sub_blks { |
| 410 | u32 maxlinewidth; |
Alan Kwong | 1a00e4d | 2016-07-18 09:42:30 -0400 | [diff] [blame] | 411 | u32 creq_vblank; |
| 412 | u32 danger_vblank; |
| 413 | u32 pixel_ram_size; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 414 | u32 maxdwnscale; |
| 415 | u32 maxupscale; |
Clarence Ip | 5e2a922 | 2016-06-26 22:38:24 -0400 | [diff] [blame] | 416 | u32 maxhdeciexp; /* max decimation is 2^value */ |
| 417 | u32 maxvdeciexp; /* max decimation is 2^value */ |
Jeykumar Sankaran | 2e65503 | 2017-02-04 14:05:45 -0800 | [diff] [blame] | 418 | u32 smart_dma_priority; |
Alan Kwong | 6259a38 | 2017-04-04 06:18:02 -0700 | [diff] [blame] | 419 | u32 max_per_pipe_bw; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 420 | struct sde_src_blk src_blk; |
Clarence Ip | e78efb7 | 2016-06-24 18:35:21 -0400 | [diff] [blame] | 421 | struct sde_scaler_blk scaler_blk; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 422 | struct sde_pp_blk csc_blk; |
Benet Clark | 37809e6 | 2016-10-24 10:14:00 -0700 | [diff] [blame] | 423 | struct sde_pp_blk hsic_blk; |
| 424 | struct sde_pp_blk memcolor_blk; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 425 | struct sde_pp_blk pcc_blk; |
Gopikrishnaiah Anandan | e3842f3 | 2015-11-05 12:18:41 -0800 | [diff] [blame] | 426 | struct sde_pp_blk igc_blk; |
Clarence Ip | ea3d626 | 2016-07-15 16:20:11 -0400 | [diff] [blame] | 427 | |
| 428 | const struct sde_format_extended *format_list; |
Steve Cohen | 5742817 | 2017-07-18 10:57:17 -0400 | [diff] [blame] | 429 | const struct sde_format_extended *virt_format_list; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 430 | }; |
| 431 | |
| 432 | /** |
| 433 | * struct sde_lm_sub_blks: information of mixer block |
| 434 | * @maxwidth: Max pixel width supported by this mixer |
| 435 | * @maxblendstages: Max number of blend-stages supported |
| 436 | * @blendstage_base: Blend-stage register base offset |
Gopikrishnaiah Anandan | e3842f3 | 2015-11-05 12:18:41 -0800 | [diff] [blame] | 437 | * @gc: gamma correction block |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 438 | */ |
| 439 | struct sde_lm_sub_blks { |
| 440 | u32 maxwidth; |
| 441 | u32 maxblendstages; |
| 442 | u32 blendstage_base[MAX_BLOCKS]; |
Gopikrishnaiah Anandan | e3842f3 | 2015-11-05 12:18:41 -0800 | [diff] [blame] | 443 | struct sde_pp_blk gc; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 444 | }; |
| 445 | |
| 446 | struct sde_dspp_sub_blks { |
| 447 | struct sde_pp_blk igc; |
| 448 | struct sde_pp_blk pcc; |
| 449 | struct sde_pp_blk gc; |
Gopikrishnaiah Anandan | e3842f3 | 2015-11-05 12:18:41 -0800 | [diff] [blame] | 450 | struct sde_pp_blk hsic; |
| 451 | struct sde_pp_blk memcolor; |
| 452 | struct sde_pp_blk sixzone; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 453 | struct sde_pp_blk gamut; |
| 454 | struct sde_pp_blk dither; |
| 455 | struct sde_pp_blk hist; |
Gopikrishnaiah Anandan | 41980b4 | 2016-06-21 16:01:33 -0700 | [diff] [blame] | 456 | struct sde_pp_blk ad; |
Gopikrishnaiah Anandan | b67b0d1 | 2016-06-23 11:43:08 -0700 | [diff] [blame] | 457 | struct sde_pp_blk vlut; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 458 | }; |
| 459 | |
| 460 | struct sde_pingpong_sub_blks { |
| 461 | struct sde_pp_blk te; |
| 462 | struct sde_pp_blk te2; |
| 463 | struct sde_pp_blk dsc; |
Ping Li | 8430ee1 | 2017-02-24 14:14:44 -0800 | [diff] [blame] | 464 | struct sde_pp_blk dither; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 465 | }; |
| 466 | |
| 467 | struct sde_wb_sub_blocks { |
| 468 | u32 maxlinewidth; |
| 469 | }; |
| 470 | |
Ben Chan | 78647cd | 2016-06-26 22:02:47 -0400 | [diff] [blame] | 471 | struct sde_mdss_base_cfg { |
| 472 | SDE_HW_BLK_INFO; |
| 473 | }; |
| 474 | |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 475 | /** |
| 476 | * sde_clk_ctrl_type - Defines top level clock control signals |
| 477 | */ |
| 478 | enum sde_clk_ctrl_type { |
| 479 | SDE_CLK_CTRL_NONE, |
| 480 | SDE_CLK_CTRL_VIG0, |
| 481 | SDE_CLK_CTRL_VIG1, |
| 482 | SDE_CLK_CTRL_VIG2, |
| 483 | SDE_CLK_CTRL_VIG3, |
| 484 | SDE_CLK_CTRL_VIG4, |
| 485 | SDE_CLK_CTRL_RGB0, |
| 486 | SDE_CLK_CTRL_RGB1, |
| 487 | SDE_CLK_CTRL_RGB2, |
| 488 | SDE_CLK_CTRL_RGB3, |
| 489 | SDE_CLK_CTRL_DMA0, |
| 490 | SDE_CLK_CTRL_DMA1, |
| 491 | SDE_CLK_CTRL_CURSOR0, |
| 492 | SDE_CLK_CTRL_CURSOR1, |
| 493 | SDE_CLK_CTRL_WB0, |
| 494 | SDE_CLK_CTRL_WB1, |
| 495 | SDE_CLK_CTRL_WB2, |
Veera Sundaram Sankaran | 1e71ccb | 2017-05-24 18:48:50 -0700 | [diff] [blame] | 496 | SDE_CLK_CTRL_INLINE_ROT0_SSPP, |
| 497 | SDE_CLK_CTRL_INLINE_ROT0_WB, |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 498 | SDE_CLK_CTRL_MAX, |
| 499 | }; |
| 500 | |
| 501 | /* struct sde_clk_ctrl_reg : Clock control register |
| 502 | * @reg_off: register offset |
| 503 | * @bit_off: bit offset |
| 504 | */ |
| 505 | struct sde_clk_ctrl_reg { |
| 506 | u32 reg_off; |
| 507 | u32 bit_off; |
| 508 | }; |
| 509 | |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 510 | /* struct sde_mdp_cfg : MDP TOP-BLK instance info |
| 511 | * @id: index identifying this block |
| 512 | * @base: register base offset to mdss |
| 513 | * @features bit mask identifying sub-blocks/features |
| 514 | * @highest_bank_bit: UBWC parameter |
Clarence Ip | 32bcb00 | 2017-03-13 12:26:44 -0700 | [diff] [blame] | 515 | * @ubwc_static: ubwc static configuration |
| 516 | * @ubwc_swizzle: ubwc default swizzle setting |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 517 | * @clk_ctrls clock control register definition |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 518 | */ |
| 519 | struct sde_mdp_cfg { |
| 520 | SDE_HW_BLK_INFO; |
| 521 | u32 highest_bank_bit; |
Clarence Ip | 32bcb00 | 2017-03-13 12:26:44 -0700 | [diff] [blame] | 522 | u32 ubwc_static; |
| 523 | u32 ubwc_swizzle; |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 524 | struct sde_clk_ctrl_reg clk_ctrls[SDE_CLK_CTRL_MAX]; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 525 | }; |
| 526 | |
| 527 | /* struct sde_mdp_cfg : MDP TOP-BLK instance info |
| 528 | * @id: index identifying this block |
| 529 | * @base: register base offset to mdss |
| 530 | * @features bit mask identifying sub-blocks/features |
| 531 | */ |
| 532 | struct sde_ctl_cfg { |
| 533 | SDE_HW_BLK_INFO; |
| 534 | }; |
| 535 | |
| 536 | /** |
| 537 | * struct sde_sspp_cfg - information of source pipes |
| 538 | * @id: index identifying this block |
| 539 | * @base register offset of this block |
| 540 | * @features bit mask identifying sub-blocks/features |
Lloyd Atkinson | 350bb41 | 2016-07-06 10:47:29 -0400 | [diff] [blame] | 541 | * @sblk: SSPP sub-blocks information |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 542 | * @xin_id: bus client identifier |
| 543 | * @clk_ctrl clock control identifier |
abeykun | f35ff33 | 2016-12-20 13:06:09 -0500 | [diff] [blame] | 544 | * @type sspp type identifier |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 545 | */ |
| 546 | struct sde_sspp_cfg { |
| 547 | SDE_HW_BLK_INFO; |
| 548 | const struct sde_sspp_sub_blks *sblk; |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 549 | u32 xin_id; |
| 550 | enum sde_clk_ctrl_type clk_ctrl; |
abeykun | f35ff33 | 2016-12-20 13:06:09 -0500 | [diff] [blame] | 551 | u32 type; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 552 | }; |
| 553 | |
| 554 | /** |
| 555 | * struct sde_lm_cfg - information of layer mixer blocks |
| 556 | * @id: index identifying this block |
| 557 | * @base register offset of this block |
| 558 | * @features bit mask identifying sub-blocks/features |
Lloyd Atkinson | 350bb41 | 2016-07-06 10:47:29 -0400 | [diff] [blame] | 559 | * @sblk: LM Sub-blocks information |
| 560 | * @dspp: ID of connected DSPP, DSPP_MAX if unsupported |
| 561 | * @pingpong: ID of connected PingPong, PINGPONG_MAX if unsupported |
| 562 | * @lm_pair_mask: Bitmask of LMs that can be controlled by same CTL |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 563 | */ |
| 564 | struct sde_lm_cfg { |
| 565 | SDE_HW_BLK_INFO; |
| 566 | const struct sde_lm_sub_blks *sblk; |
Lloyd Atkinson | 350bb41 | 2016-07-06 10:47:29 -0400 | [diff] [blame] | 567 | u32 dspp; |
| 568 | u32 pingpong; |
Lloyd Atkinson | 6b3b9dd | 2016-08-10 18:45:31 -0400 | [diff] [blame] | 569 | unsigned long lm_pair_mask; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 570 | }; |
| 571 | |
| 572 | /** |
Rajesh Yadav | ec93afb | 2017-06-08 19:28:33 +0530 | [diff] [blame] | 573 | * struct sde_dspp_cfg - information of DSPP top block |
| 574 | * @id enum identifying this block |
| 575 | * @base register offset of this block |
| 576 | * @features bit mask identifying sub-blocks/features |
| 577 | * supported by this block |
| 578 | */ |
| 579 | struct sde_dspp_top_cfg { |
| 580 | SDE_HW_BLK_INFO; |
| 581 | }; |
| 582 | |
| 583 | /** |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 584 | * struct sde_dspp_cfg - information of DSPP blocks |
| 585 | * @id enum identifying this block |
| 586 | * @base register offset of this block |
| 587 | * @features bit mask identifying sub-blocks/features |
| 588 | * supported by this block |
| 589 | * @sblk sub-blocks information |
| 590 | */ |
| 591 | struct sde_dspp_cfg { |
| 592 | SDE_HW_BLK_INFO; |
| 593 | const struct sde_dspp_sub_blks *sblk; |
| 594 | }; |
| 595 | |
| 596 | /** |
| 597 | * struct sde_pingpong_cfg - information of PING-PONG blocks |
| 598 | * @id enum identifying this block |
| 599 | * @base register offset of this block |
| 600 | * @features bit mask identifying sub-blocks/features |
| 601 | * @sblk sub-blocks information |
| 602 | */ |
| 603 | struct sde_pingpong_cfg { |
| 604 | SDE_HW_BLK_INFO; |
| 605 | const struct sde_pingpong_sub_blks *sblk; |
| 606 | }; |
| 607 | |
| 608 | /** |
Jeykumar Sankaran | 5c2f070 | 2017-03-09 18:03:15 -0800 | [diff] [blame] | 609 | * struct sde_dsc_cfg - information of DSC blocks |
| 610 | * @id enum identifying this block |
| 611 | * @base register offset of this block |
| 612 | * @features bit mask identifying sub-blocks/features |
| 613 | */ |
| 614 | struct sde_dsc_cfg { |
| 615 | SDE_HW_BLK_INFO; |
| 616 | }; |
| 617 | |
| 618 | /** |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 619 | * struct sde_cdm_cfg - information of chroma down blocks |
| 620 | * @id enum identifying this block |
| 621 | * @base register offset of this block |
| 622 | * @features bit mask identifying sub-blocks/features |
Lloyd Atkinson | 6b3b9dd | 2016-08-10 18:45:31 -0400 | [diff] [blame] | 623 | * @intf_connect Bitmask of INTF IDs this CDM can connect to |
| 624 | * @wb_connect: Bitmask of Writeback IDs this CDM can connect to |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 625 | */ |
| 626 | struct sde_cdm_cfg { |
| 627 | SDE_HW_BLK_INFO; |
Lloyd Atkinson | 6b3b9dd | 2016-08-10 18:45:31 -0400 | [diff] [blame] | 628 | unsigned long intf_connect; |
| 629 | unsigned long wb_connect; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 630 | }; |
| 631 | |
| 632 | /** |
| 633 | * struct sde_intf_cfg - information of timing engine blocks |
| 634 | * @id enum identifying this block |
| 635 | * @base register offset of this block |
| 636 | * @features bit mask identifying sub-blocks/features |
| 637 | * @type: Interface type(DSI, DP, HDMI) |
Lloyd Atkinson | 2d4e766 | 2015-11-05 15:52:07 -0500 | [diff] [blame] | 638 | * @controller_id: Controller Instance ID in case of multiple of intf type |
Lloyd Atkinson | f30546e | 2016-06-26 10:08:25 -0400 | [diff] [blame] | 639 | * @prog_fetch_lines_worst_case Worst case latency num lines needed to prefetch |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 640 | */ |
| 641 | struct sde_intf_cfg { |
| 642 | SDE_HW_BLK_INFO; |
| 643 | u32 type; /* interface type*/ |
Lloyd Atkinson | 2d4e766 | 2015-11-05 15:52:07 -0500 | [diff] [blame] | 644 | u32 controller_id; |
Lloyd Atkinson | f30546e | 2016-06-26 10:08:25 -0400 | [diff] [blame] | 645 | u32 prog_fetch_lines_worst_case; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 646 | }; |
| 647 | |
| 648 | /** |
| 649 | * struct sde_wb_cfg - information of writeback blocks |
| 650 | * @id enum identifying this block |
| 651 | * @base register offset of this block |
| 652 | * @features bit mask identifying sub-blocks/features |
Alan Kwong | bb27c09 | 2016-07-20 16:41:25 -0400 | [diff] [blame] | 653 | * @sblk sub-block information |
| 654 | * @format_list: Pointer to list of supported formats |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 655 | * @vbif_idx vbif identifier |
| 656 | * @xin_id client interface identifier |
| 657 | * @clk_ctrl clock control identifier |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 658 | */ |
| 659 | struct sde_wb_cfg { |
| 660 | SDE_HW_BLK_INFO; |
Alan Kwong | bb27c09 | 2016-07-20 16:41:25 -0400 | [diff] [blame] | 661 | const struct sde_wb_sub_blocks *sblk; |
| 662 | const struct sde_format_extended *format_list; |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 663 | u32 vbif_idx; |
| 664 | u32 xin_id; |
| 665 | enum sde_clk_ctrl_type clk_ctrl; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 666 | }; |
| 667 | |
| 668 | /** |
Veera Sundaram Sankaran | 1e71ccb | 2017-05-24 18:48:50 -0700 | [diff] [blame] | 669 | * struct sde_rot_vbif_cfg - inline rotator vbif configs |
| 670 | * @xin_id xin client id |
| 671 | * @num enum identifying this block |
| 672 | * @is_read indicates read/write client |
| 673 | * @clk_ctrl index to clk control |
| 674 | */ |
| 675 | struct sde_rot_vbif_cfg { |
| 676 | u32 xin_id; |
| 677 | u32 num; |
| 678 | bool is_read; |
| 679 | enum sde_clk_ctrl_type clk_ctrl; |
| 680 | }; |
| 681 | |
| 682 | /** |
Alan Kwong | 4dd64c8 | 2017-02-04 18:41:51 -0800 | [diff] [blame] | 683 | * struct sde_rot_cfg - information of rotator blocks |
| 684 | * @id enum identifying this block |
| 685 | * @base register offset of this block |
| 686 | * @len length of hardware block |
| 687 | * @features bit mask identifying sub-blocks/features |
| 688 | * @pdev private device handle |
| 689 | * @scid subcache identifier |
| 690 | * @slice_size subcache slice size |
Veera Sundaram Sankaran | 1e71ccb | 2017-05-24 18:48:50 -0700 | [diff] [blame] | 691 | * @vbif_idx vbif identifier |
| 692 | * @xin_count number of xin clients |
| 693 | * @vbif_cfg vbif settings related to rotator |
Alan Kwong | 4dd64c8 | 2017-02-04 18:41:51 -0800 | [diff] [blame] | 694 | */ |
| 695 | struct sde_rot_cfg { |
| 696 | SDE_HW_BLK_INFO; |
| 697 | void *pdev; |
| 698 | int scid; |
| 699 | size_t slice_size; |
Veera Sundaram Sankaran | 1e71ccb | 2017-05-24 18:48:50 -0700 | [diff] [blame] | 700 | u32 vbif_idx; |
| 701 | |
| 702 | u32 xin_count; |
| 703 | struct sde_rot_vbif_cfg vbif_cfg[MAX_BLOCKS]; |
Alan Kwong | 4dd64c8 | 2017-02-04 18:41:51 -0800 | [diff] [blame] | 704 | }; |
| 705 | |
| 706 | /** |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 707 | * struct sde_vbif_dynamic_ot_cfg - dynamic OT setting |
| 708 | * @pps pixel per seconds |
| 709 | * @ot_limit OT limit to use up to specified pixel per second |
| 710 | */ |
| 711 | struct sde_vbif_dynamic_ot_cfg { |
| 712 | u64 pps; |
| 713 | u32 ot_limit; |
| 714 | }; |
| 715 | |
| 716 | /** |
| 717 | * struct sde_vbif_dynamic_ot_tbl - dynamic OT setting table |
| 718 | * @count length of cfg |
| 719 | * @cfg pointer to array of configuration settings with |
| 720 | * ascending requirements |
| 721 | */ |
| 722 | struct sde_vbif_dynamic_ot_tbl { |
| 723 | u32 count; |
Alan Kwong | b9d2f6f | 2016-10-12 00:27:07 -0400 | [diff] [blame] | 724 | struct sde_vbif_dynamic_ot_cfg *cfg; |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 725 | }; |
| 726 | |
| 727 | /** |
Alan Kwong | a62eeb8 | 2017-04-19 08:57:55 -0700 | [diff] [blame] | 728 | * struct sde_vbif_qos_tbl - QoS priority table |
| 729 | * @npriority_lvl num of priority level |
| 730 | * @priority_lvl pointer to array of priority level in ascending order |
| 731 | */ |
| 732 | struct sde_vbif_qos_tbl { |
| 733 | u32 npriority_lvl; |
| 734 | u32 *priority_lvl; |
| 735 | }; |
| 736 | |
| 737 | /** |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 738 | * struct sde_vbif_cfg - information of VBIF blocks |
| 739 | * @id enum identifying this block |
| 740 | * @base register offset of this block |
| 741 | * @features bit mask identifying sub-blocks/features |
| 742 | * @ot_rd_limit default OT read limit |
| 743 | * @ot_wr_limit default OT write limit |
| 744 | * @xin_halt_timeout maximum time (in usec) for xin to halt |
| 745 | * @dynamic_ot_rd_tbl dynamic OT read configuration table |
| 746 | * @dynamic_ot_wr_tbl dynamic OT write configuration table |
Alan Kwong | a62eeb8 | 2017-04-19 08:57:55 -0700 | [diff] [blame] | 747 | * @qos_rt_tbl real-time QoS priority table |
| 748 | * @qos_nrt_tbl non-real-time QoS priority table |
Clarence Ip | 7f0de63 | 2017-05-31 14:59:14 -0400 | [diff] [blame] | 749 | * @memtype_count number of defined memtypes |
| 750 | * @memtype array of xin memtype definitions |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 751 | */ |
| 752 | struct sde_vbif_cfg { |
| 753 | SDE_HW_BLK_INFO; |
| 754 | u32 default_ot_rd_limit; |
| 755 | u32 default_ot_wr_limit; |
| 756 | u32 xin_halt_timeout; |
| 757 | struct sde_vbif_dynamic_ot_tbl dynamic_ot_rd_tbl; |
| 758 | struct sde_vbif_dynamic_ot_tbl dynamic_ot_wr_tbl; |
Alan Kwong | a62eeb8 | 2017-04-19 08:57:55 -0700 | [diff] [blame] | 759 | struct sde_vbif_qos_tbl qos_rt_tbl; |
| 760 | struct sde_vbif_qos_tbl qos_nrt_tbl; |
Clarence Ip | 7f0de63 | 2017-05-31 14:59:14 -0400 | [diff] [blame] | 761 | u32 memtype_count; |
| 762 | u32 memtype[MAX_XIN_COUNT]; |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 763 | }; |
Gopikrishnaiah Anandan | 031d8ff | 2016-12-15 16:58:45 -0800 | [diff] [blame] | 764 | /** |
| 765 | * struct sde_reg_dma_cfg - information of lut dma blocks |
| 766 | * @id enum identifying this block |
| 767 | * @base register offset of this block |
| 768 | * @features bit mask identifying sub-blocks/features |
| 769 | * @version version of lutdma hw block |
| 770 | * @trigger_sel_off offset to trigger select registers of lutdma |
| 771 | */ |
| 772 | struct sde_reg_dma_cfg { |
| 773 | SDE_HW_BLK_INFO; |
| 774 | u32 version; |
| 775 | u32 trigger_sel_off; |
| 776 | }; |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 777 | |
| 778 | /** |
Alan Kwong | 143f50c | 2017-04-28 07:34:28 -0700 | [diff] [blame] | 779 | * Define CDP use cases |
| 780 | * @SDE_PERF_CDP_UDAGE_RT: real-time use cases |
| 781 | * @SDE_PERF_CDP_USAGE_NRT: non real-time use cases such as WFD |
| 782 | */ |
| 783 | enum { |
| 784 | SDE_PERF_CDP_USAGE_RT, |
| 785 | SDE_PERF_CDP_USAGE_NRT, |
| 786 | SDE_PERF_CDP_USAGE_MAX |
| 787 | }; |
| 788 | |
| 789 | /** |
| 790 | * struct sde_perf_cdp_cfg - define CDP use case configuration |
| 791 | * @rd_enable: true if read pipe CDP is enabled |
| 792 | * @wr_enable: true if write pipe CDP is enabled |
| 793 | */ |
| 794 | struct sde_perf_cdp_cfg { |
| 795 | bool rd_enable; |
| 796 | bool wr_enable; |
| 797 | }; |
| 798 | |
| 799 | /** |
Alan Kwong | 9aa061c | 2016-11-06 21:17:12 -0500 | [diff] [blame] | 800 | * struct sde_perf_cfg - performance control settings |
| 801 | * @max_bw_low low threshold of maximum bandwidth (kbps) |
| 802 | * @max_bw_high high threshold of maximum bandwidth (kbps) |
Alan Kwong | 6259a38 | 2017-04-04 06:18:02 -0700 | [diff] [blame] | 803 | * @core_ib_ff core instantaneous bandwidth fudge factor |
| 804 | * @core_clk_ff core clock fudge factor |
| 805 | * @comp_ratio_rt string of 0 or more of <fourcc>/<ven>/<mod>/<comp ratio> |
| 806 | * @comp_ratio_nrt string of 0 or more of <fourcc>/<ven>/<mod>/<comp ratio> |
| 807 | * @undersized_prefill_lines undersized prefill in lines |
| 808 | * @xtra_prefill_lines extra prefill latency in lines |
| 809 | * @dest_scale_prefill_lines destination scaler latency in lines |
| 810 | * @macrotile_perfill_lines macrotile latency in lines |
| 811 | * @yuv_nv12_prefill_lines yuv_nv12 latency in lines |
| 812 | * @linear_prefill_lines linear latency in lines |
| 813 | * @downscaling_prefill_lines downscaling latency in lines |
| 814 | * @amortizable_theshold minimum y position for traffic shaping prefill |
| 815 | * @min_prefill_lines minimum pipeline latency in lines |
Alan Kwong | dce56da | 2017-04-27 15:50:34 -0700 | [diff] [blame] | 816 | * @safe_lut_tbl: LUT tables for safe signals |
| 817 | * @danger_lut_tbl: LUT tables for danger signals |
| 818 | * @qos_lut_tbl: LUT tables for QoS signals |
Alan Kwong | 143f50c | 2017-04-28 07:34:28 -0700 | [diff] [blame] | 819 | * @cdp_cfg cdp use case configurations |
Alan Kwong | 9aa061c | 2016-11-06 21:17:12 -0500 | [diff] [blame] | 820 | */ |
| 821 | struct sde_perf_cfg { |
| 822 | u32 max_bw_low; |
| 823 | u32 max_bw_high; |
Alan Kwong | 6259a38 | 2017-04-04 06:18:02 -0700 | [diff] [blame] | 824 | const char *core_ib_ff; |
| 825 | const char *core_clk_ff; |
| 826 | const char *comp_ratio_rt; |
| 827 | const char *comp_ratio_nrt; |
| 828 | u32 undersized_prefill_lines; |
| 829 | u32 xtra_prefill_lines; |
| 830 | u32 dest_scale_prefill_lines; |
| 831 | u32 macrotile_prefill_lines; |
| 832 | u32 yuv_nv12_prefill_lines; |
| 833 | u32 linear_prefill_lines; |
| 834 | u32 downscaling_prefill_lines; |
| 835 | u32 amortizable_threshold; |
| 836 | u32 min_prefill_lines; |
Alan Kwong | dce56da | 2017-04-27 15:50:34 -0700 | [diff] [blame] | 837 | u32 safe_lut_tbl[SDE_QOS_LUT_USAGE_MAX]; |
| 838 | u32 danger_lut_tbl[SDE_QOS_LUT_USAGE_MAX]; |
| 839 | struct sde_qos_lut_tbl qos_lut_tbl[SDE_QOS_LUT_USAGE_MAX]; |
Alan Kwong | 143f50c | 2017-04-28 07:34:28 -0700 | [diff] [blame] | 840 | struct sde_perf_cdp_cfg cdp_cfg[SDE_PERF_CDP_USAGE_MAX]; |
Alan Kwong | 9aa061c | 2016-11-06 21:17:12 -0500 | [diff] [blame] | 841 | }; |
| 842 | |
| 843 | /** |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 844 | * struct sde_mdss_cfg - information of MDSS HW |
| 845 | * This is the main catalog data structure representing |
| 846 | * this HW version. Contains number of instances, |
| 847 | * register offsets, capabilities of the all MDSS HW sub-blocks. |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 848 | * |
| 849 | * @max_sspp_linewidth max source pipe line width support. |
| 850 | * @max_mixer_width max layer mixer line width support. |
| 851 | * @max_mixer_blendstages max layer mixer blend stages or |
| 852 | * supported z order |
| 853 | * @max_wb_linewidth max writeback line width support. |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 854 | * @qseed_type qseed2 or qseed3 support. |
Dhaval Patel | 5aad745 | 2017-01-12 09:59:31 -0800 | [diff] [blame] | 855 | * @csc_type csc or csc_10bit support. |
Jeykumar Sankaran | 2e65503 | 2017-02-04 14:05:45 -0800 | [diff] [blame] | 856 | * @smart_dma_rev Supported version of SmartDMA feature. |
Dhaval Patel | 1964fb9 | 2016-10-13 19:28:08 -0700 | [diff] [blame] | 857 | * @has_src_split source split feature status |
Alan Kwong | 143f50c | 2017-04-28 07:34:28 -0700 | [diff] [blame] | 858 | * @has_cdp Client driven prefetch feature status |
Clarence Ip | 32bcb00 | 2017-03-13 12:26:44 -0700 | [diff] [blame] | 859 | * @has_wb_ubwc UBWC feature supported on WB |
| 860 | * @ubwc_version UBWC feature version (0x0 for not supported) |
Alan Kwong | 4dd64c8 | 2017-02-04 18:41:51 -0800 | [diff] [blame] | 861 | * @has_sbuf indicate if stream buffer is available |
| 862 | * @sbuf_headroom stream buffer headroom in lines |
Veera Sundaram Sankaran | c9efbec | 2017-03-29 18:59:05 -0700 | [diff] [blame] | 863 | * @has_idle_pc indicate if idle power collapse feature is supported |
abeykun | f35ff33 | 2016-12-20 13:06:09 -0500 | [diff] [blame] | 864 | * @dma_formats Supported formats for dma pipe |
| 865 | * @cursor_formats Supported formats for cursor pipe |
| 866 | * @vig_formats Supported formats for vig pipe |
| 867 | * @wb_formats Supported formats for wb |
Alan Kwong | a62eeb8 | 2017-04-19 08:57:55 -0700 | [diff] [blame] | 868 | * @vbif_qos_nlvl number of vbif QoS priority level |
Alan Kwong | 2349d74 | 2017-04-20 08:27:30 -0700 | [diff] [blame] | 869 | * @ts_prefill_rev prefill traffic shaper feature revision |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 870 | */ |
| 871 | struct sde_mdss_cfg { |
| 872 | u32 hwversion; |
| 873 | |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 874 | u32 max_sspp_linewidth; |
| 875 | u32 max_mixer_width; |
| 876 | u32 max_mixer_blendstages; |
| 877 | u32 max_wb_linewidth; |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 878 | u32 qseed_type; |
Dhaval Patel | 5aad745 | 2017-01-12 09:59:31 -0800 | [diff] [blame] | 879 | u32 csc_type; |
Jeykumar Sankaran | 2e65503 | 2017-02-04 14:05:45 -0800 | [diff] [blame] | 880 | u32 smart_dma_rev; |
Dhaval Patel | 1964fb9 | 2016-10-13 19:28:08 -0700 | [diff] [blame] | 881 | bool has_src_split; |
| 882 | bool has_cdp; |
Veera Sundaram Sankaran | 3171ff8 | 2017-01-04 14:34:47 -0800 | [diff] [blame] | 883 | bool has_dim_layer; |
Clarence Ip | 32bcb00 | 2017-03-13 12:26:44 -0700 | [diff] [blame] | 884 | bool has_wb_ubwc; |
| 885 | u32 ubwc_version; |
Alan Kwong | 4dd64c8 | 2017-02-04 18:41:51 -0800 | [diff] [blame] | 886 | bool has_sbuf; |
| 887 | u32 sbuf_headroom; |
Veera Sundaram Sankaran | c9efbec | 2017-03-29 18:59:05 -0700 | [diff] [blame] | 888 | bool has_idle_pc; |
Alan Kwong | a62eeb8 | 2017-04-19 08:57:55 -0700 | [diff] [blame] | 889 | u32 vbif_qos_nlvl; |
Alan Kwong | 2349d74 | 2017-04-20 08:27:30 -0700 | [diff] [blame] | 890 | u32 ts_prefill_rev; |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 891 | |
Ben Chan | 78647cd | 2016-06-26 22:02:47 -0400 | [diff] [blame] | 892 | u32 mdss_count; |
| 893 | struct sde_mdss_base_cfg mdss[MAX_BLOCKS]; |
| 894 | |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 895 | u32 mdp_count; |
| 896 | struct sde_mdp_cfg mdp[MAX_BLOCKS]; |
| 897 | |
| 898 | u32 ctl_count; |
| 899 | struct sde_ctl_cfg ctl[MAX_BLOCKS]; |
| 900 | |
| 901 | u32 sspp_count; |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 902 | struct sde_sspp_cfg sspp[MAX_BLOCKS]; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 903 | |
| 904 | u32 mixer_count; |
| 905 | struct sde_lm_cfg mixer[MAX_BLOCKS]; |
| 906 | |
Rajesh Yadav | ec93afb | 2017-06-08 19:28:33 +0530 | [diff] [blame] | 907 | struct sde_dspp_top_cfg dspp_top; |
| 908 | |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 909 | u32 dspp_count; |
| 910 | struct sde_dspp_cfg dspp[MAX_BLOCKS]; |
| 911 | |
| 912 | u32 pingpong_count; |
| 913 | struct sde_pingpong_cfg pingpong[MAX_BLOCKS]; |
| 914 | |
Jeykumar Sankaran | 5c2f070 | 2017-03-09 18:03:15 -0800 | [diff] [blame] | 915 | u32 dsc_count; |
| 916 | struct sde_dsc_cfg dsc[MAX_BLOCKS]; |
| 917 | |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 918 | u32 cdm_count; |
| 919 | struct sde_cdm_cfg cdm[MAX_BLOCKS]; |
| 920 | |
| 921 | u32 intf_count; |
| 922 | struct sde_intf_cfg intf[MAX_BLOCKS]; |
| 923 | |
| 924 | u32 wb_count; |
| 925 | struct sde_wb_cfg wb[MAX_BLOCKS]; |
| 926 | |
Alan Kwong | 4dd64c8 | 2017-02-04 18:41:51 -0800 | [diff] [blame] | 927 | u32 rot_count; |
| 928 | struct sde_rot_cfg rot[MAX_BLOCKS]; |
| 929 | |
Alan Kwong | 5d324e4 | 2016-07-28 22:56:18 -0400 | [diff] [blame] | 930 | u32 vbif_count; |
| 931 | struct sde_vbif_cfg vbif[MAX_BLOCKS]; |
Gopikrishnaiah Anandan | 031d8ff | 2016-12-15 16:58:45 -0800 | [diff] [blame] | 932 | |
| 933 | u32 reg_dma_count; |
| 934 | struct sde_reg_dma_cfg dma_cfg; |
Gopikrishnaiah Anandan | 9ba4378 | 2017-01-31 18:23:08 -0800 | [diff] [blame] | 935 | |
| 936 | u32 ad_count; |
| 937 | |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 938 | /* Add additional block data structures here */ |
Alan Kwong | 9aa061c | 2016-11-06 21:17:12 -0500 | [diff] [blame] | 939 | |
| 940 | struct sde_perf_cfg perf; |
abeykun | f35ff33 | 2016-12-20 13:06:09 -0500 | [diff] [blame] | 941 | struct sde_format_extended *dma_formats; |
| 942 | struct sde_format_extended *cursor_formats; |
| 943 | struct sde_format_extended *vig_formats; |
| 944 | struct sde_format_extended *wb_formats; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 945 | }; |
| 946 | |
| 947 | struct sde_mdss_hw_cfg_handler { |
| 948 | u32 major; |
| 949 | u32 minor; |
| 950 | struct sde_mdss_cfg* (*cfg_init)(u32); |
| 951 | }; |
| 952 | |
| 953 | /* |
| 954 | * Access Macros |
| 955 | */ |
| 956 | #define BLK_MDP(s) ((s)->mdp) |
| 957 | #define BLK_CTL(s) ((s)->ctl) |
| 958 | #define BLK_VIG(s) ((s)->vig) |
| 959 | #define BLK_RGB(s) ((s)->rgb) |
| 960 | #define BLK_DMA(s) ((s)->dma) |
| 961 | #define BLK_CURSOR(s) ((s)->cursor) |
| 962 | #define BLK_MIXER(s) ((s)->mixer) |
| 963 | #define BLK_DSPP(s) ((s)->dspp) |
| 964 | #define BLK_PINGPONG(s) ((s)->pingpong) |
| 965 | #define BLK_CDM(s) ((s)->cdm) |
| 966 | #define BLK_INTF(s) ((s)->intf) |
| 967 | #define BLK_WB(s) ((s)->wb) |
| 968 | #define BLK_AD(s) ((s)->ad) |
| 969 | |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 970 | /** |
Clarence Ip | 17162b5 | 2016-11-24 17:06:29 -0500 | [diff] [blame] | 971 | * sde_hw_catalog_init - sde hardware catalog init API parses dtsi property |
Dhaval Patel | 8bf7ff3 | 2016-07-20 18:13:24 -0700 | [diff] [blame] | 972 | * and stores all parsed offset, hardware capabilities in config structure. |
| 973 | * @dev: drm device node. |
| 974 | * @hw_rev: caller needs provide the hardware revision before parsing. |
| 975 | * |
| 976 | * Return: parsed sde config structure |
| 977 | */ |
| 978 | struct sde_mdss_cfg *sde_hw_catalog_init(struct drm_device *dev, u32 hw_rev); |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 979 | |
Clarence Ip | 17162b5 | 2016-11-24 17:06:29 -0500 | [diff] [blame] | 980 | /** |
| 981 | * sde_hw_catalog_deinit - sde hardware catalog cleanup |
| 982 | * @sde_cfg: pointer returned from init function |
| 983 | */ |
| 984 | void sde_hw_catalog_deinit(struct sde_mdss_cfg *sde_cfg); |
| 985 | |
Jeykumar Sankaran | 2e65503 | 2017-02-04 14:05:45 -0800 | [diff] [blame] | 986 | /** |
| 987 | * sde_hw_sspp_multirect_enabled - check multirect enabled for the sspp |
| 988 | * @cfg: pointer to sspp cfg |
| 989 | */ |
| 990 | static inline bool sde_hw_sspp_multirect_enabled(const struct sde_sspp_cfg *cfg) |
| 991 | { |
| 992 | return test_bit(SDE_SSPP_SMART_DMA_V1, &cfg->features) || |
| 993 | test_bit(SDE_SSPP_SMART_DMA_V2, &cfg->features); |
| 994 | } |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 995 | #endif /* _SDE_HW_CATALOG_H */ |