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