sde_hw_catalog.h 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _SDE_HW_CATALOG_H
  6. #define _SDE_HW_CATALOG_H
  7. #include <linux/kernel.h>
  8. #include <linux/bug.h>
  9. #include <linux/bitmap.h>
  10. #include <linux/err.h>
  11. #include <linux/of_fdt.h>
  12. #include <drm/drmP.h>
  13. #include "sde_hw_mdss.h"
  14. /**
  15. * Max hardware block count: For ex: max 12 SSPP pipes or
  16. * 5 ctl paths. In all cases, it can have max 12 hardware blocks
  17. * based on current design
  18. */
  19. #define MAX_BLOCKS 12
  20. #define SDE_HW_VER(MAJOR, MINOR, STEP) (((MAJOR & 0xF) << 28) |\
  21. ((MINOR & 0xFFF) << 16) |\
  22. (STEP & 0xFFFF))
  23. #define SDE_HW_MAJOR(rev) ((rev) >> 28)
  24. #define SDE_HW_MINOR(rev) (((rev) >> 16) & 0xFFF)
  25. #define SDE_HW_STEP(rev) ((rev) & 0xFFFF)
  26. #define SDE_HW_MAJOR_MINOR(rev) ((rev) >> 16)
  27. #define SDE_HW_VER_170 SDE_HW_VER(1, 7, 0) /* 8996 */
  28. #define SDE_HW_VER_300 SDE_HW_VER(3, 0, 0) /* 8998 */
  29. #define SDE_HW_VER_400 SDE_HW_VER(4, 0, 0) /* sdm845 */
  30. #define SDE_HW_VER_410 SDE_HW_VER(4, 1, 0) /* sdm670 */
  31. #define SDE_HW_VER_500 SDE_HW_VER(5, 0, 0) /* sm8150 */
  32. #define SDE_HW_VER_510 SDE_HW_VER(5, 1, 0) /* sdmshrike */
  33. #define SDE_HW_VER_520 SDE_HW_VER(5, 2, 0) /* sdmmagpie */
  34. #define SDE_HW_VER_530 SDE_HW_VER(5, 3, 0) /* sm6150 */
  35. #define SDE_HW_VER_540 SDE_HW_VER(5, 4, 0) /* sdmtrinket */
  36. #define SDE_HW_VER_600 SDE_HW_VER(6, 0, 0) /* kona */
  37. #define SDE_HW_VER_610 SDE_HW_VER(6, 1, 0) /* sm7250 */
  38. #define SDE_HW_VER_630 SDE_HW_VER(6, 3, 0) /* bengal */
  39. #define SDE_HW_VER_700 SDE_HW_VER(7, 0, 0) /* lahaina */
  40. /* Avoid using below IS_XXX macros outside catalog, use feature bit instead */
  41. #define IS_SDE_MAJOR_SAME(rev1, rev2) \
  42. (SDE_HW_MAJOR((rev1)) == SDE_HW_MAJOR((rev2)))
  43. #define IS_SDE_MAJOR_MINOR_SAME(rev1, rev2) \
  44. (SDE_HW_MAJOR_MINOR((rev1)) == SDE_HW_MAJOR_MINOR((rev2)))
  45. #define IS_MSM8996_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_170)
  46. #define IS_MSM8998_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_300)
  47. #define IS_SDM845_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_400)
  48. #define IS_SDM670_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_410)
  49. #define IS_SM8150_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_500)
  50. #define IS_SDMSHRIKE_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_510)
  51. #define IS_SDMMAGPIE_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_520)
  52. #define IS_SM6150_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_530)
  53. #define IS_SDMTRINKET_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_540)
  54. #define IS_KONA_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_600)
  55. #define IS_SAIPAN_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_610)
  56. #define IS_BENGAL_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_630)
  57. #define IS_LAHAINA_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_700)
  58. #define SDE_HW_BLK_NAME_LEN 16
  59. /* default size of valid register space for MDSS_HW block (offset 0) */
  60. #define DEFAULT_MDSS_HW_BLOCK_SIZE 0x5C
  61. #define MAX_IMG_WIDTH 0x3fff
  62. #define MAX_IMG_HEIGHT 0x3fff
  63. #define CRTC_DUAL_MIXERS 2
  64. #define SDE_COLOR_PROCESS_VER(MAJOR, MINOR) \
  65. ((((MAJOR) & 0xFFFF) << 16) | (((MINOR) & 0xFFFF)))
  66. #define SDE_COLOR_PROCESS_MAJOR(version) (((version) & 0xFFFF0000) >> 16)
  67. #define SDE_COLOR_PROCESS_MINOR(version) ((version) & 0xFFFF)
  68. #define MAX_XIN_COUNT 16
  69. #define SSPP_SUBBLK_COUNT_MAX 2
  70. #define LIMIT_SUBBLK_COUNT_MAX 10
  71. #define SDE_CTL_CFG_VERSION_1_0_0 0x100
  72. #define MAX_INTF_PER_CTL_V1 2
  73. #define MAX_DSC_PER_CTL_V1 2
  74. #define MAX_CWB_PER_CTL_V1 2
  75. #define MAX_MERGE_3D_PER_CTL_V1 2
  76. #define MAX_WB_PER_CTL_V1 1
  77. #define MAX_CDM_PER_CTL_V1 1
  78. #define MAX_VDC_PER_CTL_V1 1
  79. #define IS_SDE_CTL_REV_100(rev) \
  80. ((rev) == SDE_CTL_CFG_VERSION_1_0_0)
  81. /**
  82. * True inline rotation supported versions
  83. */
  84. #define SDE_INLINE_ROT_VERSION_1_0_0 0x100
  85. #define SDE_INLINE_ROT_VERSION_2_0_0 0x200
  86. #define IS_SDE_INLINE_ROT_REV_100(rev) \
  87. ((rev) == SDE_INLINE_ROT_VERSION_1_0_0)
  88. #define IS_SDE_INLINE_ROT_REV_200(rev) \
  89. ((rev) == SDE_INLINE_ROT_VERSION_2_0_0)
  90. /*
  91. * UIDLE supported versions
  92. */
  93. #define SDE_UIDLE_VERSION_1_0_0 0x100
  94. #define SDE_UIDLE_VERSION_1_0_1 0x101
  95. #define IS_SDE_UIDLE_REV_100(rev) \
  96. ((rev) == SDE_UIDLE_VERSION_1_0_0)
  97. #define IS_SDE_UIDLE_REV_101(rev) \
  98. ((rev) == SDE_UIDLE_VERSION_1_0_1)
  99. #define SDE_UIDLE_MAJOR(rev) ((rev) >> 8)
  100. #define SDE_HW_UBWC_VER(rev) \
  101. SDE_HW_VER((((rev) >> 8) & 0xF), (((rev) >> 4) & 0xF), ((rev) & 0xF))
  102. /**
  103. * Supported UBWC feature versions
  104. */
  105. enum {
  106. SDE_HW_UBWC_VER_10 = SDE_HW_UBWC_VER(0x100),
  107. SDE_HW_UBWC_VER_20 = SDE_HW_UBWC_VER(0x200),
  108. SDE_HW_UBWC_VER_30 = SDE_HW_UBWC_VER(0x300),
  109. SDE_HW_UBWC_VER_40 = SDE_HW_UBWC_VER(0x400),
  110. };
  111. #define IS_UBWC_10_SUPPORTED(rev) \
  112. IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_UBWC_VER_10)
  113. #define IS_UBWC_20_SUPPORTED(rev) \
  114. IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_UBWC_VER_20)
  115. #define IS_UBWC_30_SUPPORTED(rev) \
  116. IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_UBWC_VER_30)
  117. #define IS_UBWC_40_SUPPORTED(rev) \
  118. IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_UBWC_VER_40)
  119. /**
  120. * Supported SSPP system cache settings
  121. */
  122. #define SSPP_SYS_CACHE_EN_FLAG BIT(0)
  123. #define SSPP_SYS_CACHE_SCID BIT(1)
  124. #define SSPP_SYS_CACHE_OP_MODE BIT(2)
  125. #define SSPP_SYS_CACHE_OP_TYPE BIT(3)
  126. #define SSPP_SYS_CACHE_NO_ALLOC BIT(4)
  127. /**
  128. * All INTRs relevant for a specific target should be enabled via
  129. * _add_to_irq_offset_list()
  130. */
  131. enum sde_intr_hwblk_type {
  132. SDE_INTR_HWBLK_TOP,
  133. SDE_INTR_HWBLK_INTF,
  134. SDE_INTR_HWBLK_AD4,
  135. SDE_INTR_HWBLK_INTF_TEAR,
  136. SDE_INTR_HWBLK_LTM,
  137. SDE_INTR_HWBLK_MAX
  138. };
  139. enum sde_intr_top_intr {
  140. SDE_INTR_TOP_INTR = 1,
  141. SDE_INTR_TOP_INTR2,
  142. SDE_INTR_TOP_HIST_INTR,
  143. SDE_INTR_TOP_MAX
  144. };
  145. struct sde_intr_irq_offsets {
  146. struct list_head list;
  147. enum sde_intr_hwblk_type type;
  148. u32 instance_idx;
  149. u32 base_offset;
  150. };
  151. /**
  152. * MDP TOP BLOCK features
  153. * @SDE_MDP_PANIC_PER_PIPE Panic configuration needs to be be done per pipe
  154. * @SDE_MDP_10BIT_SUPPORT, Chipset supports 10 bit pixel formats
  155. * @SDE_MDP_BWC, MDSS HW supports Bandwidth compression.
  156. * @SDE_MDP_UBWC_1_0, This chipsets supports Universal Bandwidth
  157. * compression initial revision
  158. * @SDE_MDP_UBWC_1_5, Universal Bandwidth compression version 1.5
  159. * @SDE_MDP_VSYNC_SEL Vsync selection for command mode panels
  160. * @SDE_MDP_DHDR_MEMPOOL Dynamic HDR Metadata mempool present
  161. * @SDE_MDP_DHDR_MEMPOOL_4K Dynamic HDR mempool is 4k aligned
  162. * @SDE_MDP_MAX Maximum value
  163. */
  164. enum {
  165. SDE_MDP_PANIC_PER_PIPE = 0x1,
  166. SDE_MDP_10BIT_SUPPORT,
  167. SDE_MDP_BWC,
  168. SDE_MDP_UBWC_1_0,
  169. SDE_MDP_UBWC_1_5,
  170. SDE_MDP_VSYNC_SEL,
  171. SDE_MDP_DHDR_MEMPOOL,
  172. SDE_MDP_DHDR_MEMPOOL_4K,
  173. SDE_MDP_MAX
  174. };
  175. /**
  176. * SSPP sub-blocks/features
  177. * @SDE_SSPP_SRC Src and fetch part of the pipes,
  178. * @SDE_SSPP_SCALER_QSEED2, QSEED2 algorithm support
  179. * @SDE_SSPP_SCALER_QSEED3, QSEED3 alogorithm support
  180. * @SDE_SSPP_SCALER_RGB, RGB Scaler, supported by RGB pipes
  181. * @SDE_SSPP_CSC, Support of Color space converion
  182. * @SDE_SSPP_CSC_10BIT, Support of 10-bit Color space conversion
  183. * @SDE_SSPP_HSIC, Global HSIC control
  184. * @SDE_SSPP_MEMCOLOR Memory Color Support
  185. * @SDE_SSPP_PCC, Color correction support
  186. * @SDE_SSPP_CURSOR, SSPP can be used as a cursor layer
  187. * @SDE_SSPP_EXCL_RECT, SSPP supports exclusion rect
  188. * @SDE_SSPP_SMART_DMA_V1, SmartDMA 1.0 support
  189. * @SDE_SSPP_SMART_DMA_V2, SmartDMA 2.0 support
  190. * @SDE_SSPP_SMART_DMA_V2p5, SmartDMA 2.5 support
  191. * @SDE_SSPP_VIG_IGC, VIG 1D LUT IGC
  192. * @SDE_SSPP_VIG_GAMUT, VIG 3D LUT Gamut
  193. * @SDE_SSPP_DMA_IGC, DMA 1D LUT IGC
  194. * @SDE_SSPP_DMA_GC, DMA 1D LUT GC
  195. * @SDE_SSPP_INVERSE_PMA Alpha unmultiply (PMA) support
  196. * @SDE_SSPP_DGM_INVERSE_PMA Alpha unmultiply (PMA) support in DGM block
  197. * @SDE_SSPP_DGM_CSC Support of color space conversion in DGM block
  198. * @SDE_SSPP_SEC_UI_ALLOWED Allows secure-ui layers
  199. * @SDE_SSPP_BLOCK_SEC_UI Blocks secure-ui layers
  200. * @SDE_SSPP_SCALER_QSEED3LITE Qseed3lite algorithm support
  201. * @SDE_SSPP_TRUE_INLINE_ROT Support of SSPP true inline rotation v1
  202. * @SDE_SSPP_PREDOWNSCALE Support pre-downscale X-direction by 2 for inline
  203. * @SDE_SSPP_PREDOWNSCALE_Y Support pre-downscale Y-direction for inline
  204. * @SDE_SSPP_INLINE_CONST_CLR Inline rotation requires const clr disabled
  205. * @SDE_SSPP_MAX maximum value
  206. */
  207. enum {
  208. SDE_SSPP_SRC = 0x1,
  209. SDE_SSPP_SCALER_QSEED2,
  210. SDE_SSPP_SCALER_QSEED3,
  211. SDE_SSPP_SCALER_RGB,
  212. SDE_SSPP_CSC,
  213. SDE_SSPP_CSC_10BIT,
  214. SDE_SSPP_HSIC,
  215. SDE_SSPP_MEMCOLOR,
  216. SDE_SSPP_PCC,
  217. SDE_SSPP_CURSOR,
  218. SDE_SSPP_EXCL_RECT,
  219. SDE_SSPP_SMART_DMA_V1,
  220. SDE_SSPP_SMART_DMA_V2,
  221. SDE_SSPP_SMART_DMA_V2p5,
  222. SDE_SSPP_VIG_IGC,
  223. SDE_SSPP_VIG_GAMUT,
  224. SDE_SSPP_DMA_IGC,
  225. SDE_SSPP_DMA_GC,
  226. SDE_SSPP_INVERSE_PMA,
  227. SDE_SSPP_DGM_INVERSE_PMA,
  228. SDE_SSPP_DGM_CSC,
  229. SDE_SSPP_SEC_UI_ALLOWED,
  230. SDE_SSPP_BLOCK_SEC_UI,
  231. SDE_SSPP_SCALER_QSEED3LITE,
  232. SDE_SSPP_TRUE_INLINE_ROT,
  233. SDE_SSPP_PREDOWNSCALE,
  234. SDE_SSPP_PREDOWNSCALE_Y,
  235. SDE_SSPP_INLINE_CONST_CLR,
  236. SDE_SSPP_MAX
  237. };
  238. /**
  239. * SDE performance features
  240. * @SDE_PERF_SSPP_QOS, SSPP support QoS control, danger/safe/creq
  241. * @SDE_PERF_SSPP_QOS_8LVL, SSPP support 8-level QoS control
  242. * @SDE_PERF_SSPP_TS_PREFILL Supports prefill with traffic shaper
  243. * @SDE_PERF_SSPP_TS_PREFILL_REC1 Supports prefill with traffic shaper multirec
  244. * @SDE_PERF_SSPP_CDP Supports client driven prefetch
  245. * @SDE_PERF_SSPP_SYS_CACHE, SSPP supports system cache
  246. * @SDE_PERF_SSPP_UIDLE, sspp supports uidle
  247. * @SDE_PERF_SSPP_MAX Maximum value
  248. */
  249. enum {
  250. SDE_PERF_SSPP_QOS = 0x1,
  251. SDE_PERF_SSPP_QOS_8LVL,
  252. SDE_PERF_SSPP_TS_PREFILL,
  253. SDE_PERF_SSPP_TS_PREFILL_REC1,
  254. SDE_PERF_SSPP_CDP,
  255. SDE_PERF_SSPP_SYS_CACHE,
  256. SDE_PERF_SSPP_UIDLE,
  257. SDE_PERF_SSPP_MAX
  258. };
  259. /*
  260. * MIXER sub-blocks/features
  261. * @SDE_MIXER_LAYER Layer mixer layer blend configuration,
  262. * @SDE_MIXER_SOURCESPLIT Layer mixer supports source-split configuration
  263. * @SDE_MIXER_GC Gamma correction block
  264. * @SDE_DIM_LAYER Layer mixer supports dim layer
  265. * @SDE_DISP_CWB_PREF Layer mixer preferred for CWB
  266. * @SDE_DISP_PRIMARY_PREF Layer mixer preferred for primary display
  267. * @SDE_DISP_SECONDARY_PREF Layer mixer preferred for secondary display
  268. * @SDE_MIXER_COMBINED_ALPHA Layer mixer bg and fg alpha in single register
  269. * @SDE_MIXER_MAX maximum value
  270. */
  271. enum {
  272. SDE_MIXER_LAYER = 0x1,
  273. SDE_MIXER_SOURCESPLIT,
  274. SDE_MIXER_GC,
  275. SDE_DIM_LAYER,
  276. SDE_DISP_PRIMARY_PREF,
  277. SDE_DISP_SECONDARY_PREF,
  278. SDE_DISP_CWB_PREF,
  279. SDE_MIXER_COMBINED_ALPHA,
  280. SDE_MIXER_MAX
  281. };
  282. /**
  283. * DSPP sub-blocks
  284. * @SDE_DSPP_IGC DSPP Inverse gamma correction block
  285. * @SDE_DSPP_PCC Panel color correction block
  286. * @SDE_DSPP_GC Gamma correction block
  287. * @SDE_DSPP_HSIC Global HSIC block
  288. * @SDE_DSPP_MEMCOLOR Memory Color block
  289. * @SDE_DSPP_SIXZONE Six zone block
  290. * @SDE_DSPP_GAMUT Gamut block
  291. * @SDE_DSPP_DITHER Dither block
  292. * @SDE_DSPP_HIST Histogram block
  293. * @SDE_DSPP_VLUT PA VLUT block
  294. * @SDE_DSPP_AD AD block
  295. * @SDE_DSPP_LTM LTM block
  296. * @SDE_DSPP_SPR SPR block
  297. * @SDE_DSPP_DEMURA Demura block
  298. * @SDE_DSPP_RC RC block
  299. * @SDE_DSPP_SB SB LUT DMA
  300. * @SDE_DSPP_MAX maximum value
  301. */
  302. enum {
  303. SDE_DSPP_IGC = 0x1,
  304. SDE_DSPP_PCC,
  305. SDE_DSPP_GC,
  306. SDE_DSPP_HSIC,
  307. SDE_DSPP_MEMCOLOR,
  308. SDE_DSPP_SIXZONE,
  309. SDE_DSPP_GAMUT,
  310. SDE_DSPP_DITHER,
  311. SDE_DSPP_HIST,
  312. SDE_DSPP_VLUT,
  313. SDE_DSPP_AD,
  314. SDE_DSPP_LTM,
  315. SDE_DSPP_SPR,
  316. SDE_DSPP_DEMURA,
  317. SDE_DSPP_RC,
  318. SDE_DSPP_SB,
  319. SDE_DSPP_MAX
  320. };
  321. /**
  322. * LTM sub-features
  323. * @SDE_LTM_INIT LTM INIT feature
  324. * @SDE_LTM_ROI LTM ROI feature
  325. * @SDE_LTM_VLUT LTM VLUT feature
  326. * @SDE_LTM_MAX maximum value
  327. */
  328. enum {
  329. SDE_LTM_INIT = 0x1,
  330. SDE_LTM_ROI,
  331. SDE_LTM_VLUT,
  332. SDE_LTM_MAX
  333. };
  334. /**
  335. * PINGPONG sub-blocks
  336. * @SDE_PINGPONG_TE Tear check block
  337. * @SDE_PINGPONG_TE2 Additional tear check block for split pipes
  338. * @SDE_PINGPONG_SPLIT PP block supports split fifo
  339. * @SDE_PINGPONG_SLAVE PP block is a suitable slave for split fifo
  340. * @SDE_PINGPONG_DSC, Display stream compression blocks
  341. * @SDE_PINGPONG_DITHER, Dither blocks
  342. * @SDE_PINGPONG_DITHER_LUMA, Dither sub-blocks and features
  343. * @SDE_PINGPONG_MERGE_3D, Separate MERGE_3D block exists
  344. * @SDE_PINGPONG_MAX
  345. */
  346. enum {
  347. SDE_PINGPONG_TE = 0x1,
  348. SDE_PINGPONG_TE2,
  349. SDE_PINGPONG_SPLIT,
  350. SDE_PINGPONG_SLAVE,
  351. SDE_PINGPONG_DSC,
  352. SDE_PINGPONG_DITHER,
  353. SDE_PINGPONG_DITHER_LUMA,
  354. SDE_PINGPONG_MERGE_3D,
  355. SDE_PINGPONG_MAX
  356. };
  357. /** DSC sub-blocks/features
  358. * @SDE_DSC_OUTPUT_CTRL Supports the control of the pp id which gets
  359. * the pixel output from this DSC.
  360. * @SDE_DSC_HW_REV_1_1 dsc block supports dsc 1.1 only
  361. * @SDE_DSC_HW_REV_1_2 dsc block supports dsc 1.1 and 1.2
  362. * @SDE_DSC_NATIVE_422_EN, Supports native422 and native420 encoding
  363. * @SDE_DSC_ENC, DSC encoder sub block
  364. * @SDE_DSC_CTL, DSC ctl sub block
  365. * @SDE_DSC_MAX
  366. */
  367. enum {
  368. SDE_DSC_OUTPUT_CTRL = 0x1,
  369. SDE_DSC_HW_REV_1_1,
  370. SDE_DSC_HW_REV_1_2,
  371. SDE_DSC_NATIVE_422_EN,
  372. SDE_DSC_ENC,
  373. SDE_DSC_CTL,
  374. SDE_DSC_MAX
  375. };
  376. /** VDC sub-blocks/features
  377. * @SDE_VDC_HW_REV_1_1 vdc block supports vdc 1.1 only
  378. * @SDE_VDC_ENC vdc encoder sub block
  379. * @SDE_VDC_CTL vdc ctl sub block
  380. * @SDE_VDC_MAX
  381. */
  382. enum {
  383. SDE_VDC_HW_REV_1_1,
  384. SDE_VDC_ENC,
  385. SDE_VDC_CTL,
  386. SDE_VDC_MAX
  387. };
  388. /**
  389. * CTL sub-blocks
  390. * @SDE_CTL_SPLIT_DISPLAY CTL supports video mode split display
  391. * @SDE_CTL_PINGPONG_SPLIT CTL supports pingpong split
  392. * @SDE_CTL_PRIMARY_PREF CTL preferred for primary display
  393. * @SDE_CTL_ACTIVE_CFG CTL configuration is specified using active
  394. * blocks
  395. * @SDE_CTL_UIDLE CTL supports uidle
  396. * @SDE_CTL_UNIFIED_DSPP_FLUSH CTL supports only one flush bit for DSPP
  397. * @SDE_CTL_MAX
  398. */
  399. enum {
  400. SDE_CTL_SPLIT_DISPLAY = 0x1,
  401. SDE_CTL_PINGPONG_SPLIT,
  402. SDE_CTL_PRIMARY_PREF,
  403. SDE_CTL_ACTIVE_CFG,
  404. SDE_CTL_UIDLE,
  405. SDE_CTL_UNIFIED_DSPP_FLUSH,
  406. SDE_CTL_MAX
  407. };
  408. /**
  409. * INTF sub-blocks
  410. * @SDE_INTF_INPUT_CTRL Supports the setting of pp block from which
  411. * pixel data arrives to this INTF
  412. * @SDE_INTF_TE INTF block has TE configuration support
  413. * @SDE_INTF_TE_ALIGN_VSYNC INTF block has POMS Align vsync support
  414. * @SDE_INTF_MAX
  415. */
  416. enum {
  417. SDE_INTF_INPUT_CTRL = 0x1,
  418. SDE_INTF_TE,
  419. SDE_INTF_TE_ALIGN_VSYNC,
  420. SDE_INTF_MAX
  421. };
  422. /**
  423. * WB sub-blocks and features
  424. * @SDE_WB_LINE_MODE Writeback module supports line/linear mode
  425. * @SDE_WB_BLOCK_MODE Writeback module supports block mode read
  426. * @SDE_WB_ROTATE rotation support,this is available if writeback
  427. * supports block mode read
  428. * @SDE_WB_CSC Writeback color conversion block support
  429. * @SDE_WB_CHROMA_DOWN, Writeback chroma down block,
  430. * @SDE_WB_DOWNSCALE, Writeback integer downscaler,
  431. * @SDE_WB_DITHER, Dither block
  432. * @SDE_WB_TRAFFIC_SHAPER, Writeback traffic shaper bloc
  433. * @SDE_WB_UBWC, Writeback Universal bandwidth compression
  434. * @SDE_WB_YUV_CONFIG Writeback supports output of YUV colorspace
  435. * @SDE_WB_PIPE_ALPHA Writeback supports pipe alpha
  436. * @SDE_WB_XY_ROI_OFFSET Writeback supports x/y-offset of out ROI in
  437. * the destination image
  438. * @SDE_WB_QOS, Writeback supports QoS control, danger/safe/creq
  439. * @SDE_WB_QOS_8LVL, Writeback supports 8-level QoS control
  440. * @SDE_WB_CDP Writeback supports client driven prefetch
  441. * @SDE_WB_INPUT_CTRL Writeback supports from which pp block input pixel
  442. * data arrives.
  443. * @SDE_WB_HAS_CWB Writeback block supports concurrent writeback
  444. * @SDE_WB_CWB_CTRL Separate CWB control is available for configuring
  445. * @SDE_WB_MAX maximum value
  446. */
  447. enum {
  448. SDE_WB_LINE_MODE = 0x1,
  449. SDE_WB_BLOCK_MODE,
  450. SDE_WB_ROTATE = SDE_WB_BLOCK_MODE,
  451. SDE_WB_CSC,
  452. SDE_WB_CHROMA_DOWN,
  453. SDE_WB_DOWNSCALE,
  454. SDE_WB_DITHER,
  455. SDE_WB_TRAFFIC_SHAPER,
  456. SDE_WB_UBWC,
  457. SDE_WB_YUV_CONFIG,
  458. SDE_WB_PIPE_ALPHA,
  459. SDE_WB_XY_ROI_OFFSET,
  460. SDE_WB_QOS,
  461. SDE_WB_QOS_8LVL,
  462. SDE_WB_CDP,
  463. SDE_WB_INPUT_CTRL,
  464. SDE_WB_HAS_CWB,
  465. SDE_WB_CWB_CTRL,
  466. SDE_WB_MAX
  467. };
  468. /* CDM features
  469. * @SDE_CDM_INPUT_CTRL CDM supports from which pp block intput pixel data
  470. * arrives
  471. * @SDE_CDM_MAX maximum value
  472. */
  473. enum {
  474. SDE_CDM_INPUT_CTRL = 0x1,
  475. SDE_CDM_MAX
  476. };
  477. /**
  478. * VBIF sub-blocks and features
  479. * @SDE_VBIF_QOS_OTLIM VBIF supports OT Limit
  480. * @SDE_VBIF_QOS_REMAP VBIF supports QoS priority remap
  481. * @SDE_VBIF_DISABLE_SHAREABLE: VBIF requires inner/outer shareables disabled
  482. * @SDE_VBIF_MAX maximum value
  483. */
  484. enum {
  485. SDE_VBIF_QOS_OTLIM = 0x1,
  486. SDE_VBIF_QOS_REMAP,
  487. SDE_VBIF_DISABLE_SHAREABLE,
  488. SDE_VBIF_MAX
  489. };
  490. /**
  491. * uidle features
  492. * @SDE_UIDLE_QACTIVE_OVERRIDE uidle sends qactive signal
  493. * @SDE_UIDLE_MAX maximum value
  494. */
  495. enum {
  496. SDE_UIDLE_QACTIVE_OVERRIDE = 0x1,
  497. SDE_UIDLE_MAX
  498. };
  499. /**
  500. * MACRO SDE_HW_BLK_INFO - information of HW blocks inside SDE
  501. * @name: string name for debug purposes
  502. * @id: enum identifying this block
  503. * @base: register base offset to mdss
  504. * @len: length of hardware block
  505. * @features bit mask identifying sub-blocks/features
  506. * @perf_features bit mask identifying performance sub-blocks/features
  507. */
  508. #define SDE_HW_BLK_INFO \
  509. char name[SDE_HW_BLK_NAME_LEN]; \
  510. u32 id; \
  511. u32 base; \
  512. u32 len; \
  513. unsigned long features; \
  514. unsigned long perf_features
  515. /**
  516. * MACRO SDE_HW_SUBBLK_INFO - information of HW sub-block inside SDE
  517. * @name: string name for debug purposes
  518. * @id: enum identifying this sub-block
  519. * @base: offset of this sub-block relative to the block
  520. * offset
  521. * @len register block length of this sub-block
  522. */
  523. #define SDE_HW_SUBBLK_INFO \
  524. char name[SDE_HW_BLK_NAME_LEN]; \
  525. u32 id; \
  526. u32 base; \
  527. u32 len
  528. /**
  529. * struct sde_src_blk: SSPP part of the source pipes
  530. * @info: HW register and features supported by this sub-blk
  531. */
  532. struct sde_src_blk {
  533. SDE_HW_SUBBLK_INFO;
  534. };
  535. /**
  536. * struct sde_scaler_blk: Scaler information
  537. * @info: HW register and features supported by this sub-blk
  538. * @version: qseed block revision
  539. * @h_preload: horizontal preload
  540. * @v_preload: vertical preload
  541. */
  542. struct sde_scaler_blk {
  543. SDE_HW_SUBBLK_INFO;
  544. u32 version;
  545. u32 h_preload;
  546. u32 v_preload;
  547. };
  548. struct sde_csc_blk {
  549. SDE_HW_SUBBLK_INFO;
  550. };
  551. /**
  552. * struct sde_pp_blk : Pixel processing sub-blk information
  553. * @info: HW register and features supported by this sub-blk
  554. * @version: HW Algorithm version
  555. */
  556. struct sde_pp_blk {
  557. SDE_HW_SUBBLK_INFO;
  558. u32 version;
  559. };
  560. /**
  561. * struct sde_dsc_blk : DSC Encoder sub-blk information
  562. * @info: HW register and features supported by this sub-blk
  563. */
  564. struct sde_dsc_blk {
  565. SDE_HW_SUBBLK_INFO;
  566. };
  567. /**
  568. * struct sde_vdc_blk : VDC Encoder sub-blk information
  569. * @info: HW register and features supported by this sub-blk
  570. */
  571. struct sde_vdc_blk {
  572. SDE_HW_SUBBLK_INFO;
  573. };
  574. /**
  575. * struct sde_format_extended - define sde specific pixel format+modifier
  576. * @fourcc_format: Base FOURCC pixel format code
  577. * @modifier: 64-bit drm format modifier, same modifier must be applied to all
  578. * framebuffer planes
  579. */
  580. struct sde_format_extended {
  581. uint32_t fourcc_format;
  582. uint64_t modifier;
  583. };
  584. /**
  585. * enum sde_qos_lut_usage - define QoS LUT use cases
  586. */
  587. enum sde_qos_lut_usage {
  588. SDE_QOS_LUT_USAGE_LINEAR,
  589. SDE_QOS_LUT_USAGE_MACROTILE,
  590. SDE_QOS_LUT_USAGE_NRT,
  591. SDE_QOS_LUT_USAGE_CWB,
  592. SDE_QOS_LUT_USAGE_MACROTILE_QSEED,
  593. SDE_QOS_LUT_USAGE_LINEAR_QSEED,
  594. SDE_QOS_LUT_USAGE_MAX,
  595. };
  596. /**
  597. * struct sde_sspp_sub_blks : SSPP sub-blocks
  598. * @maxdwnscale: max downscale ratio supported(without DECIMATION)
  599. * @maxupscale: maxupscale ratio supported
  600. * @maxwidth: max pixelwidth supported by this pipe
  601. * @creq_vblank: creq priority during vertical blanking
  602. * @danger_vblank: danger priority during vertical blanking
  603. * @pixel_ram_size: size of latency hiding and de-tiling buffer in bytes
  604. * @smart_dma_priority: hw priority of rect1 of multirect pipe
  605. * @max_per_pipe_bw: maximum allowable bandwidth of this pipe in kBps
  606. * @max_per_pipe_bw_high: maximum allowable bandwidth of this pipe in kBps
  607. * in case of no VFE
  608. * @src_blk:
  609. * @scaler_blk:
  610. * @csc_blk:
  611. * @hsic:
  612. * @memcolor:
  613. * @pcc_blk:
  614. * @gamut_blk: 3D LUT gamut block
  615. * @num_igc_blk: number of IGC block
  616. * @igc_blk: 1D LUT IGC block
  617. * @num_gc_blk: number of GC block
  618. * @gc_blk: 1D LUT GC block
  619. * @num_dgm_csc_blk: number of DGM CSC blocks
  620. * @dgm_csc_blk: DGM CSC blocks
  621. * @format_list: Pointer to list of supported formats
  622. * @virt_format_list: Pointer to list of supported formats for virtual planes
  623. * @in_rot_format_list: Pointer to list of supported formats for inline rotation
  624. * @in_rot_maxdwnscale_rt_num: max downscale ratio for inline rotation
  625. * rt clients - numerator
  626. * @in_rot_maxdwnscale_rt_denom: max downscale ratio for inline rotation
  627. * rt clients - denominator
  628. * @in_rot_maxdwnscale_nrt: max downscale ratio for inline rotation nrt clients
  629. * @in_rot_maxdwnscale_rt_nopd_num: downscale threshold for when pre-downscale
  630. * must be enabled on HW with this support.
  631. * @in_rot_maxdwnscale_rt_nopd_denom: downscale threshold for when pre-downscale
  632. * must be enabled on HW with this support.
  633. * @in_rot_maxheight: max pre rotated height for inline rotation
  634. * @llcc_scid: scid for the system cache
  635. * @llcc_slice size: slice size of the system cache
  636. */
  637. struct sde_sspp_sub_blks {
  638. u32 maxlinewidth;
  639. u32 creq_vblank;
  640. u32 danger_vblank;
  641. u32 pixel_ram_size;
  642. u32 maxdwnscale;
  643. u32 maxupscale;
  644. u32 maxhdeciexp; /* max decimation is 2^value */
  645. u32 maxvdeciexp; /* max decimation is 2^value */
  646. u32 smart_dma_priority;
  647. u32 max_per_pipe_bw;
  648. u32 max_per_pipe_bw_high;
  649. struct sde_src_blk src_blk;
  650. struct sde_scaler_blk scaler_blk;
  651. struct sde_pp_blk csc_blk;
  652. struct sde_pp_blk hsic_blk;
  653. struct sde_pp_blk memcolor_blk;
  654. struct sde_pp_blk pcc_blk;
  655. struct sde_pp_blk gamut_blk;
  656. u32 num_igc_blk;
  657. struct sde_pp_blk igc_blk[SSPP_SUBBLK_COUNT_MAX];
  658. u32 num_gc_blk;
  659. struct sde_pp_blk gc_blk[SSPP_SUBBLK_COUNT_MAX];
  660. u32 num_dgm_csc_blk;
  661. struct sde_pp_blk dgm_csc_blk[SSPP_SUBBLK_COUNT_MAX];
  662. const struct sde_format_extended *format_list;
  663. const struct sde_format_extended *virt_format_list;
  664. const struct sde_format_extended *in_rot_format_list;
  665. u32 in_rot_maxdwnscale_rt_num;
  666. u32 in_rot_maxdwnscale_rt_denom;
  667. u32 in_rot_maxdwnscale_nrt;
  668. u32 in_rot_maxdwnscale_rt_nopd_num;
  669. u32 in_rot_maxdwnscale_rt_nopd_denom;
  670. u32 in_rot_maxheight;
  671. int llcc_scid;
  672. size_t llcc_slice_size;
  673. };
  674. /**
  675. * struct sde_lm_sub_blks: information of mixer block
  676. * @maxwidth: Max pixel width supported by this mixer
  677. * @maxblendstages: Max number of blend-stages supported
  678. * @blendstage_base: Blend-stage register base offset
  679. * @gc: gamma correction block
  680. */
  681. struct sde_lm_sub_blks {
  682. u32 maxwidth;
  683. u32 maxblendstages;
  684. u32 blendstage_base[MAX_BLOCKS];
  685. struct sde_pp_blk gc;
  686. };
  687. /**
  688. * struct sde_dspp_rc: Pixel processing rounded corner sub-blk information
  689. * @info: HW register and features supported by this sub-blk.
  690. * @version: HW Algorithm version.
  691. * @idx: HW block instance id.
  692. * @mem_total_size: data memory size.
  693. */
  694. struct sde_dspp_rc {
  695. SDE_HW_SUBBLK_INFO;
  696. u32 version;
  697. u32 idx;
  698. u32 mem_total_size;
  699. };
  700. struct sde_dspp_sub_blks {
  701. struct sde_pp_blk igc;
  702. struct sde_pp_blk pcc;
  703. struct sde_pp_blk gc;
  704. struct sde_pp_blk hsic;
  705. struct sde_pp_blk memcolor;
  706. struct sde_pp_blk sixzone;
  707. struct sde_pp_blk gamut;
  708. struct sde_pp_blk dither;
  709. struct sde_pp_blk hist;
  710. struct sde_pp_blk ad;
  711. struct sde_pp_blk ltm;
  712. struct sde_pp_blk spr;
  713. struct sde_pp_blk vlut;
  714. struct sde_dspp_rc rc;
  715. struct sde_pp_blk demura;
  716. };
  717. struct sde_pingpong_sub_blks {
  718. struct sde_pp_blk te;
  719. struct sde_pp_blk te2;
  720. struct sde_pp_blk dsc;
  721. struct sde_pp_blk dither;
  722. };
  723. /**
  724. * struct sde_dsc_sub_blks : DSC sub-blks
  725. *
  726. */
  727. struct sde_dsc_sub_blks {
  728. struct sde_dsc_blk enc;
  729. struct sde_dsc_blk ctl;
  730. };
  731. /**
  732. * struct sde_vdc_sub_blks : VDC sub-blks
  733. *
  734. */
  735. struct sde_vdc_sub_blks {
  736. struct sde_vdc_blk enc;
  737. struct sde_vdc_blk ctl;
  738. };
  739. struct sde_wb_sub_blocks {
  740. u32 maxlinewidth;
  741. };
  742. struct sde_mdss_base_cfg {
  743. SDE_HW_BLK_INFO;
  744. };
  745. /**
  746. * sde_clk_ctrl_type - Defines top level clock control signals
  747. */
  748. enum sde_clk_ctrl_type {
  749. SDE_CLK_CTRL_NONE,
  750. SDE_CLK_CTRL_VIG0,
  751. SDE_CLK_CTRL_VIG1,
  752. SDE_CLK_CTRL_VIG2,
  753. SDE_CLK_CTRL_VIG3,
  754. SDE_CLK_CTRL_VIG4,
  755. SDE_CLK_CTRL_RGB0,
  756. SDE_CLK_CTRL_RGB1,
  757. SDE_CLK_CTRL_RGB2,
  758. SDE_CLK_CTRL_RGB3,
  759. SDE_CLK_CTRL_DMA0,
  760. SDE_CLK_CTRL_DMA1,
  761. SDE_CLK_CTRL_CURSOR0,
  762. SDE_CLK_CTRL_CURSOR1,
  763. SDE_CLK_CTRL_WB0,
  764. SDE_CLK_CTRL_WB1,
  765. SDE_CLK_CTRL_WB2,
  766. SDE_CLK_CTRL_LUTDMA,
  767. SDE_CLK_CTRL_MAX,
  768. };
  769. /* struct sde_clk_ctrl_reg : Clock control register
  770. * @reg_off: register offset
  771. * @bit_off: bit offset
  772. */
  773. struct sde_clk_ctrl_reg {
  774. u32 reg_off;
  775. u32 bit_off;
  776. };
  777. /* struct sde_mdp_cfg : MDP TOP-BLK instance info
  778. * @id: index identifying this block
  779. * @base: register base offset to mdss
  780. * @features bit mask identifying sub-blocks/features
  781. * @highest_bank_bit: UBWC parameter
  782. * @ubwc_static: ubwc static configuration
  783. * @ubwc_swizzle: ubwc default swizzle setting
  784. * @has_dest_scaler: indicates support of destination scaler
  785. * @smart_panel_align_mode: split display smart panel align modes
  786. * @clk_ctrls clock control register definition
  787. */
  788. struct sde_mdp_cfg {
  789. SDE_HW_BLK_INFO;
  790. u32 highest_bank_bit;
  791. u32 ubwc_static;
  792. u32 ubwc_swizzle;
  793. bool has_dest_scaler;
  794. u32 smart_panel_align_mode;
  795. struct sde_clk_ctrl_reg clk_ctrls[SDE_CLK_CTRL_MAX];
  796. };
  797. /* struct sde_uidle_cfg : MDP TOP-BLK instance info
  798. * @id: index identifying this block
  799. * @base: register base offset to mdss
  800. * @features: bit mask identifying sub-blocks/features
  801. * @fal10_exit_cnt: fal10 exit counter
  802. * @fal10_exit_danger: fal10 exit danger level
  803. * @fal10_danger: fal10 danger level
  804. * @fal10_target_idle_time: fal10 targeted time in uS
  805. * @fal1_target_idle_time: fal1 targeted time in uS
  806. * @fal10_threshold: fal10 threshold value
  807. * @max_downscale: maximum downscaling ratio x1000.
  808. * This ratio is multiplied x1000 to allow
  809. * 3 decimal precision digits.
  810. * @max_fps: maximum fps to allow micro idle
  811. * @uidle_rev: uidle revision supported by the target,
  812. * zero if no support
  813. * @debugfs_perf: enable/disable performance counters and status
  814. * logging
  815. * @debugfs_ctrl: uidle is enabled/disabled through debugfs
  816. * @perf_cntr_en: performance counters are enabled/disabled
  817. */
  818. struct sde_uidle_cfg {
  819. SDE_HW_BLK_INFO;
  820. /* global settings */
  821. u32 fal10_exit_cnt;
  822. u32 fal10_exit_danger;
  823. u32 fal10_danger;
  824. /* per-pipe settings */
  825. u32 fal10_target_idle_time;
  826. u32 fal1_target_idle_time;
  827. u32 fal10_threshold;
  828. u32 max_dwnscale;
  829. u32 max_fps;
  830. u32 uidle_rev;
  831. u32 debugfs_perf;
  832. bool debugfs_ctrl;
  833. bool perf_cntr_en;
  834. };
  835. /* struct sde_mdp_cfg : MDP TOP-BLK instance info
  836. * @id: index identifying this block
  837. * @base: register base offset to mdss
  838. * @features bit mask identifying sub-blocks/features
  839. */
  840. struct sde_ctl_cfg {
  841. SDE_HW_BLK_INFO;
  842. };
  843. /**
  844. * struct sde_sspp_cfg - information of source pipes
  845. * @id: index identifying this block
  846. * @base register offset of this block
  847. * @features bit mask identifying sub-blocks/features
  848. * @sblk: SSPP sub-blocks information
  849. * @xin_id: bus client identifier
  850. * @clk_ctrl clock control identifier
  851. * @type sspp type identifier
  852. */
  853. struct sde_sspp_cfg {
  854. SDE_HW_BLK_INFO;
  855. struct sde_sspp_sub_blks *sblk;
  856. u32 xin_id;
  857. enum sde_clk_ctrl_type clk_ctrl;
  858. u32 type;
  859. };
  860. /**
  861. * struct sde_lm_cfg - information of layer mixer blocks
  862. * @id: index identifying this block
  863. * @base register offset of this block
  864. * @features bit mask identifying sub-blocks/features
  865. * @sblk: LM Sub-blocks information
  866. * @dspp: ID of connected DSPP, DSPP_MAX if unsupported
  867. * @pingpong: ID of connected PingPong, PINGPONG_MAX if unsupported
  868. * @ds: ID of connected DS, DS_MAX if unsupported
  869. * @lm_pair_mask: Bitmask of LMs that can be controlled by same CTL
  870. */
  871. struct sde_lm_cfg {
  872. SDE_HW_BLK_INFO;
  873. const struct sde_lm_sub_blks *sblk;
  874. u32 dspp;
  875. u32 pingpong;
  876. u32 ds;
  877. unsigned long lm_pair_mask;
  878. };
  879. /**
  880. * struct sde_dspp_cfg - information of DSPP top block
  881. * @id enum identifying this block
  882. * @base register offset of this block
  883. * @features bit mask identifying sub-blocks/features
  884. * supported by this block
  885. */
  886. struct sde_dspp_top_cfg {
  887. SDE_HW_BLK_INFO;
  888. };
  889. /**
  890. * struct sde_dspp_cfg - information of DSPP blocks
  891. * @id enum identifying this block
  892. * @base register offset of this block
  893. * @features bit mask identifying sub-blocks/features
  894. * supported by this block
  895. * @sblk sub-blocks information
  896. */
  897. struct sde_dspp_cfg {
  898. SDE_HW_BLK_INFO;
  899. struct sde_dspp_sub_blks *sblk;
  900. };
  901. /**
  902. * struct sde_ds_top_cfg - information of dest scaler top
  903. * @id enum identifying this block
  904. * @base register offset of this block
  905. * @features bit mask identifying features
  906. * @version hw version of dest scaler
  907. * @maxinputwidth maximum input line width
  908. * @maxoutputwidth maximum output line width
  909. * @maxupscale maximum upscale ratio
  910. */
  911. struct sde_ds_top_cfg {
  912. SDE_HW_BLK_INFO;
  913. u32 version;
  914. u32 maxinputwidth;
  915. u32 maxoutputwidth;
  916. u32 maxupscale;
  917. };
  918. /**
  919. * struct sde_ds_cfg - information of dest scaler blocks
  920. * @id enum identifying this block
  921. * @base register offset wrt DS top offset
  922. * @features bit mask identifying features
  923. * @version hw version of the qseed block
  924. * @top DS top information
  925. */
  926. struct sde_ds_cfg {
  927. SDE_HW_BLK_INFO;
  928. u32 version;
  929. const struct sde_ds_top_cfg *top;
  930. };
  931. /**
  932. * struct sde_pingpong_cfg - information of PING-PONG blocks
  933. * @id enum identifying this block
  934. * @base register offset of this block
  935. * @features bit mask identifying sub-blocks/features
  936. * @sblk sub-blocks information
  937. * @merge_3d_id merge_3d block id
  938. */
  939. struct sde_pingpong_cfg {
  940. SDE_HW_BLK_INFO;
  941. const struct sde_pingpong_sub_blks *sblk;
  942. int merge_3d_id;
  943. };
  944. /**
  945. * struct sde_dsc_cfg - information of DSC blocks
  946. * @id enum identifying this block
  947. * @base register offset of this block
  948. * @len: length of hardware block
  949. * @features bit mask identifying sub-blocks/features
  950. * @dsc_pair_mask: Bitmask of DSCs that can be controlled by same CTL
  951. */
  952. struct sde_dsc_cfg {
  953. SDE_HW_BLK_INFO;
  954. DECLARE_BITMAP(dsc_pair_mask, DSC_MAX);
  955. struct sde_dsc_sub_blks *sblk;
  956. };
  957. /**
  958. * struct sde_vdc_cfg - information of VDC blocks
  959. * @id enum identifying this block
  960. * @base register offset of this block
  961. * @len: length of hardware block
  962. * @features bit mask identifying sub-blocks/features
  963. * @enc VDC encoder register offset(relative to VDC base)
  964. * @ctl VDC Control register offset(relative to VDC base)
  965. */
  966. struct sde_vdc_cfg {
  967. SDE_HW_BLK_INFO;
  968. struct sde_vdc_sub_blks *sblk;
  969. };
  970. /**
  971. * struct sde_cdm_cfg - information of chroma down blocks
  972. * @id enum identifying this block
  973. * @base register offset of this block
  974. * @features bit mask identifying sub-blocks/features
  975. * @intf_connect Bitmask of INTF IDs this CDM can connect to
  976. * @wb_connect: Bitmask of Writeback IDs this CDM can connect to
  977. */
  978. struct sde_cdm_cfg {
  979. SDE_HW_BLK_INFO;
  980. unsigned long intf_connect;
  981. unsigned long wb_connect;
  982. };
  983. /**
  984. * struct sde_intf_cfg - information of timing engine blocks
  985. * @id enum identifying this block
  986. * @base register offset of this block
  987. * @features bit mask identifying sub-blocks/features
  988. * @type: Interface type(DSI, DP, HDMI)
  989. * @controller_id: Controller Instance ID in case of multiple of intf type
  990. * @prog_fetch_lines_worst_case Worst case latency num lines needed to prefetch
  991. * @te_irq_offset: Register offset for INTF TE IRQ block
  992. */
  993. struct sde_intf_cfg {
  994. SDE_HW_BLK_INFO;
  995. u32 type; /* interface type*/
  996. u32 controller_id;
  997. u32 prog_fetch_lines_worst_case;
  998. u32 te_irq_offset;
  999. };
  1000. /**
  1001. * struct sde_wb_cfg - information of writeback blocks
  1002. * @id enum identifying this block
  1003. * @base register offset of this block
  1004. * @features bit mask identifying sub-blocks/features
  1005. * @sblk sub-block information
  1006. * @format_list: Pointer to list of supported formats
  1007. * @vbif_idx vbif identifier
  1008. * @xin_id client interface identifier
  1009. * @clk_ctrl clock control identifier
  1010. */
  1011. struct sde_wb_cfg {
  1012. SDE_HW_BLK_INFO;
  1013. const struct sde_wb_sub_blocks *sblk;
  1014. const struct sde_format_extended *format_list;
  1015. u32 vbif_idx;
  1016. u32 xin_id;
  1017. enum sde_clk_ctrl_type clk_ctrl;
  1018. };
  1019. /**
  1020. * struct sde_merge_3d_cfg - information of merge_3d blocks
  1021. * @id enum identifying this block
  1022. * @base register offset of this block
  1023. * @len: length of hardware block
  1024. * @features bit mask identifying sub-blocks/features
  1025. */
  1026. struct sde_merge_3d_cfg {
  1027. SDE_HW_BLK_INFO;
  1028. };
  1029. /**
  1030. * struct sde_qdss_cfg - information of qdss blocks
  1031. * @id enum identifying this block
  1032. * @base register offset of this block
  1033. * @len: length of hardware block
  1034. * @features bit mask identifying sub-blocks/features
  1035. */
  1036. struct sde_qdss_cfg {
  1037. SDE_HW_BLK_INFO;
  1038. };
  1039. /*
  1040. * struct sde_vbif_dynamic_ot_cfg - dynamic OT setting
  1041. * @pps pixel per seconds
  1042. * @ot_limit OT limit to use up to specified pixel per second
  1043. */
  1044. struct sde_vbif_dynamic_ot_cfg {
  1045. u64 pps;
  1046. u32 ot_limit;
  1047. };
  1048. /**
  1049. * struct sde_vbif_dynamic_ot_tbl - dynamic OT setting table
  1050. * @count length of cfg
  1051. * @cfg pointer to array of configuration settings with
  1052. * ascending requirements
  1053. */
  1054. struct sde_vbif_dynamic_ot_tbl {
  1055. u32 count;
  1056. struct sde_vbif_dynamic_ot_cfg *cfg;
  1057. };
  1058. /**
  1059. * struct sde_vbif_qos_tbl - QoS priority table
  1060. * @npriority_lvl num of priority level
  1061. * @priority_lvl pointer to array of priority level in ascending order
  1062. */
  1063. struct sde_vbif_qos_tbl {
  1064. u32 npriority_lvl;
  1065. u32 *priority_lvl;
  1066. };
  1067. /**
  1068. * enum sde_vbif_client_type
  1069. * @VBIF_RT_CLIENT: real time client
  1070. * @VBIF_NRT_CLIENT: non-realtime clients like writeback
  1071. * @VBIF_CWB_CLIENT: concurrent writeback client
  1072. * @VBIF_LUTDMA_CLIENT: LUTDMA client
  1073. * @VBIF_MAX_CLIENT: max number of clients
  1074. */
  1075. enum sde_vbif_client_type {
  1076. VBIF_RT_CLIENT,
  1077. VBIF_NRT_CLIENT,
  1078. VBIF_CWB_CLIENT,
  1079. VBIF_LUTDMA_CLIENT,
  1080. VBIF_MAX_CLIENT
  1081. };
  1082. /**
  1083. * struct sde_vbif_cfg - information of VBIF blocks
  1084. * @id enum identifying this block
  1085. * @base register offset of this block
  1086. * @features bit mask identifying sub-blocks/features
  1087. * @ot_rd_limit default OT read limit
  1088. * @ot_wr_limit default OT write limit
  1089. * @xin_halt_timeout maximum time (in usec) for xin to halt
  1090. * @dynamic_ot_rd_tbl dynamic OT read configuration table
  1091. * @dynamic_ot_wr_tbl dynamic OT write configuration table
  1092. * @qos_tbl Array of QoS priority table
  1093. * @memtype_count number of defined memtypes
  1094. * @memtype array of xin memtype definitions
  1095. */
  1096. struct sde_vbif_cfg {
  1097. SDE_HW_BLK_INFO;
  1098. u32 default_ot_rd_limit;
  1099. u32 default_ot_wr_limit;
  1100. u32 xin_halt_timeout;
  1101. struct sde_vbif_dynamic_ot_tbl dynamic_ot_rd_tbl;
  1102. struct sde_vbif_dynamic_ot_tbl dynamic_ot_wr_tbl;
  1103. struct sde_vbif_qos_tbl qos_tbl[VBIF_MAX_CLIENT];
  1104. u32 memtype_count;
  1105. u32 memtype[MAX_XIN_COUNT];
  1106. };
  1107. /**
  1108. * enum sde_reg_dma_type - defines reg dma block type
  1109. * @REG_DMA_TYPE_DB: DB LUT DMA block
  1110. * @REG_DMA_TYPE_SB: SB LUT DMA block
  1111. * @REG_DMA_TYPE_MAX: invalid selection
  1112. */
  1113. enum sde_reg_dma_type {
  1114. REG_DMA_TYPE_DB,
  1115. REG_DMA_TYPE_SB,
  1116. REG_DMA_TYPE_MAX,
  1117. };
  1118. /**
  1119. * struct sde_reg_dma_blk_info - definition of lut dma block.
  1120. * @valid bool indicating if the definiton is valid.
  1121. * @base register offset of this block.
  1122. * @features bit mask identifying sub-blocks/features.
  1123. */
  1124. struct sde_reg_dma_blk_info {
  1125. bool valid;
  1126. u32 base;
  1127. u32 features;
  1128. };
  1129. /**
  1130. * struct sde_reg_dma_cfg - overall config struct of lut dma blocks.
  1131. * @reg_dma_blks Reg DMA blk info for each possible block type
  1132. * @version version of lutdma hw blocks
  1133. * @trigger_sel_off offset to trigger select registers of lutdma
  1134. * @broadcast_disabled flag indicating if broadcast usage should be avoided
  1135. * @xin_id VBIF xin client-id for LUTDMA
  1136. * @vbif_idx VBIF id (RT/NRT)
  1137. * @clk_ctrl VBIF xin client clk-ctrl
  1138. */
  1139. struct sde_reg_dma_cfg {
  1140. struct sde_reg_dma_blk_info reg_dma_blks[REG_DMA_TYPE_MAX];
  1141. u32 version;
  1142. u32 trigger_sel_off;
  1143. u32 broadcast_disabled;
  1144. u32 xin_id;
  1145. u32 vbif_idx;
  1146. enum sde_clk_ctrl_type clk_ctrl;
  1147. };
  1148. /**
  1149. * Define CDP use cases
  1150. * @SDE_PERF_CDP_UDAGE_RT: real-time use cases
  1151. * @SDE_PERF_CDP_USAGE_NRT: non real-time use cases such as WFD
  1152. */
  1153. enum {
  1154. SDE_PERF_CDP_USAGE_RT,
  1155. SDE_PERF_CDP_USAGE_NRT,
  1156. SDE_PERF_CDP_USAGE_MAX
  1157. };
  1158. /**
  1159. * struct sde_perf_cdp_cfg - define CDP use case configuration
  1160. * @rd_enable: true if read pipe CDP is enabled
  1161. * @wr_enable: true if write pipe CDP is enabled
  1162. */
  1163. struct sde_perf_cdp_cfg {
  1164. bool rd_enable;
  1165. bool wr_enable;
  1166. };
  1167. /**
  1168. * struct sde_sc_cfg - define system cache configuration
  1169. * @has_sys_cache: true if system cache is enabled
  1170. * @llcc_scid: scid for the system cache
  1171. * @llcc_slice_size: slice size of the system cache
  1172. */
  1173. struct sde_sc_cfg {
  1174. bool has_sys_cache;
  1175. int llcc_scid;
  1176. size_t llcc_slice_size;
  1177. };
  1178. /**
  1179. * struct sde_perf_cfg - performance control settings
  1180. * @max_bw_low low threshold of maximum bandwidth (kbps)
  1181. * @max_bw_high high threshold of maximum bandwidth (kbps)
  1182. * @min_core_ib minimum bandwidth for core (kbps)
  1183. * @min_core_ib minimum mnoc ib vote in kbps
  1184. * @min_llcc_ib minimum llcc ib vote in kbps
  1185. * @min_dram_ib minimum dram ib vote in kbps
  1186. * @core_ib_ff core instantaneous bandwidth fudge factor
  1187. * @core_clk_ff core clock fudge factor
  1188. * @comp_ratio_rt string of 0 or more of <fourcc>/<ven>/<mod>/<comp ratio>
  1189. * @comp_ratio_nrt string of 0 or more of <fourcc>/<ven>/<mod>/<comp ratio>
  1190. * @undersized_prefill_lines undersized prefill in lines
  1191. * @xtra_prefill_lines extra prefill latency in lines
  1192. * @dest_scale_prefill_lines destination scaler latency in lines
  1193. * @macrotile_perfill_lines macrotile latency in lines
  1194. * @yuv_nv12_prefill_lines yuv_nv12 latency in lines
  1195. * @linear_prefill_lines linear latency in lines
  1196. * @downscaling_prefill_lines downscaling latency in lines
  1197. * @amortizable_theshold minimum y position for traffic shaping prefill
  1198. * @min_prefill_lines minimum pipeline latency in lines
  1199. * @danger_lut: liner, linear_qseed, macrotile, etc. danger luts
  1200. * @sfe_lut: linear, macrotile, macrotile_qseed, etc. safe luts
  1201. * @creq_lut: linear, macrotile, non_realtime, cwb, etc. creq luts
  1202. * @qos_refresh_count: total refresh count for possible different luts
  1203. * @qos_refresh_rate: different refresh rates for luts
  1204. * @cdp_cfg cdp use case configurations
  1205. * @cpu_mask: pm_qos cpu mask value
  1206. * @cpu_mask_perf: pm_qos cpu silver core mask value
  1207. * @cpu_dma_latency: pm_qos cpu dma latency value
  1208. * @axi_bus_width: axi bus width value in bytes
  1209. * @num_mnoc_ports: number of mnoc ports
  1210. */
  1211. struct sde_perf_cfg {
  1212. u32 max_bw_low;
  1213. u32 max_bw_high;
  1214. u32 min_core_ib;
  1215. u32 min_llcc_ib;
  1216. u32 min_dram_ib;
  1217. const char *core_ib_ff;
  1218. const char *core_clk_ff;
  1219. const char *comp_ratio_rt;
  1220. const char *comp_ratio_nrt;
  1221. u32 undersized_prefill_lines;
  1222. u32 xtra_prefill_lines;
  1223. u32 dest_scale_prefill_lines;
  1224. u32 macrotile_prefill_lines;
  1225. u32 yuv_nv12_prefill_lines;
  1226. u32 linear_prefill_lines;
  1227. u32 downscaling_prefill_lines;
  1228. u32 amortizable_threshold;
  1229. u32 min_prefill_lines;
  1230. u64 *danger_lut;
  1231. u64 *safe_lut;
  1232. u64 *creq_lut;
  1233. u32 qos_refresh_count;
  1234. u32 *qos_refresh_rate;
  1235. struct sde_perf_cdp_cfg cdp_cfg[SDE_PERF_CDP_USAGE_MAX];
  1236. unsigned long cpu_mask;
  1237. unsigned long cpu_mask_perf;
  1238. u32 cpu_dma_latency;
  1239. u32 axi_bus_width;
  1240. u32 num_mnoc_ports;
  1241. };
  1242. /**
  1243. * struct limit_vector_cfg - information on the usecase for each limit
  1244. * @usecase: usecase for each limit
  1245. * @value: id corresponding to each usecase
  1246. */
  1247. struct limit_vector_cfg {
  1248. const char *usecase;
  1249. u32 value;
  1250. };
  1251. /**
  1252. * struct limit_value_cfg - information on the value of usecase
  1253. * @use_concur: usecase for each limit
  1254. * @value: value corresponding to usecase for each limit
  1255. */
  1256. struct limit_value_cfg {
  1257. u32 use_concur;
  1258. u32 value;
  1259. };
  1260. /**
  1261. * struct sde_limit_cfg - information om different mdp limits
  1262. * @name: name of the limit property
  1263. * @lmt_vec_cnt: number of vector values for each limit
  1264. * @lmt_case_cnt: number of usecases for each limit
  1265. * @vector_cfg: pointer to the vector entries containing info on usecase
  1266. * @value_cfg: pointer to the value of each vector entry
  1267. */
  1268. struct sde_limit_cfg {
  1269. const char *name;
  1270. u32 lmt_vec_cnt;
  1271. u32 lmt_case_cnt;
  1272. struct limit_vector_cfg *vector_cfg;
  1273. struct limit_value_cfg *value_cfg;
  1274. };
  1275. /**
  1276. * struct sde_mdss_cfg - information of MDSS HW
  1277. * This is the main catalog data structure representing
  1278. * this HW version. Contains number of instances,
  1279. * register offsets, capabilities of the all MDSS HW sub-blocks.
  1280. *
  1281. * @max_sspp_linewidth max source pipe line width support.
  1282. * @vig_sspp_linewidth max vig source pipe line width support.
  1283. * @max_mixer_width max layer mixer line width support.
  1284. * @max_mixer_blendstages max layer mixer blend stages or
  1285. * supported z order
  1286. * @max_wb_linewidth max writeback line width support.
  1287. * @max_display_width maximum display width support.
  1288. * @max_display_height maximum display height support.
  1289. * @max_lm_per_display maximum layer mixer per display
  1290. * @min_display_width minimum display width support.
  1291. * @min_display_height minimum display height support.
  1292. * @qseed_type qseed2 or qseed3 support.
  1293. * @csc_type csc or csc_10bit support.
  1294. * @smart_dma_rev Supported version of SmartDMA feature.
  1295. * @ctl_rev supported version of control path.
  1296. * @has_src_split source split feature status
  1297. * @has_cdp Client driven prefetch feature status
  1298. * @has_wb_ubwc UBWC feature supported on WB
  1299. * @has_cwb_support indicates if device supports primary capture through CWB
  1300. * @cwb_blk_off CWB offset address
  1301. * @cwb_blk_stride offset between each CWB blk
  1302. * @ubwc_version UBWC feature version (0x0 for not supported)
  1303. * @ubwc_bw_calc_version indicate how UBWC BW has to be calculated
  1304. * @has_idle_pc indicate if idle power collapse feature is supported
  1305. * @has_hdr HDR feature support
  1306. * @has_hdr_plus HDR10+ feature support
  1307. * @dma_formats Supported formats for dma pipe
  1308. * @cursor_formats Supported formats for cursor pipe
  1309. * @vig_formats Supported formats for vig pipe
  1310. * @wb_formats Supported formats for wb
  1311. * @virt_vig_formats Supported formats for virtual vig pipe
  1312. * @vbif_qos_nlvl number of vbif QoS priority level
  1313. * @ts_prefill_rev prefill traffic shaper feature revision
  1314. * @true_inline_rot_rev inline rotator feature revision
  1315. * @macrotile_mode UBWC parameter for macro tile channel distribution
  1316. * @pipe_order_type indicate if it is required to specify pipe order
  1317. * @delay_prg_fetch_start indicates if throttling the fetch start is required
  1318. * @has_qsync Supports qsync feature
  1319. * @has_3d_merge_reset Supports 3D merge reset
  1320. * @has_decimation Supports decimation
  1321. * @has_mixer_combined_alpha Mixer has single register for FG & BG alpha
  1322. * @vbif_disable_inner_outer_shareable VBIF requires disabling shareables
  1323. * @inline_disable_const_clr Disable constant color during inline rotate
  1324. * @dither_luma_mode_support Enables dither luma mode
  1325. * @has_base_layer Supports staging layer as base layer
  1326. * @demura_supported Demura pipe support flag(~0x00 - Not supported)
  1327. * @sc_cfg: system cache configuration
  1328. * @uidle_cfg Settings for uidle feature
  1329. * @sui_misr_supported indicate if secure-ui-misr is supported
  1330. * @sui_block_xin_mask mask of all the xin-clients to be blocked during
  1331. * secure-ui when secure-ui-misr feature is supported
  1332. * @sec_sid_mask_count number of SID masks
  1333. * @sec_sid_mask SID masks used during the scm_call for transition
  1334. * between secure/non-secure sessions
  1335. * @sui_ns_allowed flag to indicate non-secure context banks are allowed
  1336. * during secure-ui session
  1337. * @sui_supported_blendstage secure-ui supported blendstage
  1338. * @has_sui_blendstage flag to indicate secure-ui has a blendstage restriction
  1339. * @has_cursor indicates if hardware cursor is supported
  1340. * @has_vig_p010 indicates if vig pipe supports p010 format
  1341. * @mdss_hw_block_size Max offset of MDSS_HW block (0 offset), used for debug
  1342. * @inline_rot_formats formats supported by the inline rotator feature
  1343. * @irq_offset_list list of sde_intr_irq_offsets to initialize irq table
  1344. * @rc_count number of rounded corner hardware instances
  1345. * @demura_count number of demura hardware instances
  1346. */
  1347. struct sde_mdss_cfg {
  1348. u32 hwversion;
  1349. u32 max_sspp_linewidth;
  1350. u32 vig_sspp_linewidth;
  1351. u32 max_mixer_width;
  1352. u32 max_mixer_blendstages;
  1353. u32 max_wb_linewidth;
  1354. u32 max_display_width;
  1355. u32 max_display_height;
  1356. u32 min_display_width;
  1357. u32 min_display_height;
  1358. u32 max_lm_per_display;
  1359. u32 qseed_type;
  1360. u32 csc_type;
  1361. u32 smart_dma_rev;
  1362. u32 ctl_rev;
  1363. bool has_src_split;
  1364. bool has_cdp;
  1365. bool has_dim_layer;
  1366. bool has_wb_ubwc;
  1367. bool has_cwb_support;
  1368. u32 cwb_blk_off;
  1369. u32 cwb_blk_stride;
  1370. u32 ubwc_version;
  1371. u32 ubwc_bw_calc_version;
  1372. bool has_idle_pc;
  1373. u32 vbif_qos_nlvl;
  1374. u32 ts_prefill_rev;
  1375. u32 true_inline_rot_rev;
  1376. u32 macrotile_mode;
  1377. u32 pipe_order_type;
  1378. bool delay_prg_fetch_start;
  1379. bool has_qsync;
  1380. bool has_3d_merge_reset;
  1381. bool has_decimation;
  1382. bool has_mixer_combined_alpha;
  1383. bool vbif_disable_inner_outer_shareable;
  1384. bool inline_disable_const_clr;
  1385. bool dither_luma_mode_support;
  1386. bool has_base_layer;
  1387. bool has_demura;
  1388. u32 demura_supported[SSPP_MAX][2];
  1389. struct sde_sc_cfg sc_cfg;
  1390. bool sui_misr_supported;
  1391. u32 sui_block_xin_mask;
  1392. u32 sec_sid_mask_count;
  1393. u32 sec_sid_mask[MAX_BLOCKS];
  1394. u32 sui_ns_allowed;
  1395. u32 sui_supported_blendstage;
  1396. bool has_sui_blendstage;
  1397. bool has_hdr;
  1398. bool has_hdr_plus;
  1399. bool has_cursor;
  1400. bool has_vig_p010;
  1401. u32 mdss_hw_block_size;
  1402. u32 mdss_count;
  1403. struct sde_mdss_base_cfg mdss[MAX_BLOCKS];
  1404. u32 mdp_count;
  1405. struct sde_mdp_cfg mdp[MAX_BLOCKS];
  1406. /* uidle is a singleton */
  1407. struct sde_uidle_cfg uidle_cfg;
  1408. u32 ctl_count;
  1409. struct sde_ctl_cfg ctl[MAX_BLOCKS];
  1410. u32 sspp_count;
  1411. struct sde_sspp_cfg sspp[MAX_BLOCKS];
  1412. u32 mixer_count;
  1413. struct sde_lm_cfg mixer[MAX_BLOCKS];
  1414. struct sde_dspp_top_cfg dspp_top;
  1415. u32 dspp_count;
  1416. struct sde_dspp_cfg dspp[MAX_BLOCKS];
  1417. u32 ds_count;
  1418. struct sde_ds_cfg ds[MAX_BLOCKS];
  1419. u32 pingpong_count;
  1420. struct sde_pingpong_cfg pingpong[MAX_BLOCKS];
  1421. u32 dsc_count;
  1422. struct sde_dsc_cfg dsc[MAX_BLOCKS];
  1423. u32 vdc_count;
  1424. struct sde_vdc_cfg vdc[MAX_BLOCKS];
  1425. u32 cdm_count;
  1426. struct sde_cdm_cfg cdm[MAX_BLOCKS];
  1427. u32 intf_count;
  1428. struct sde_intf_cfg intf[MAX_BLOCKS];
  1429. u32 wb_count;
  1430. struct sde_wb_cfg wb[MAX_BLOCKS];
  1431. u32 vbif_count;
  1432. struct sde_vbif_cfg vbif[MAX_BLOCKS];
  1433. u32 reg_dma_count;
  1434. struct sde_reg_dma_cfg dma_cfg;
  1435. u32 ad_count;
  1436. u32 ltm_count;
  1437. u32 rc_count;
  1438. u32 spr_count;
  1439. u32 demura_count;
  1440. u32 merge_3d_count;
  1441. struct sde_merge_3d_cfg merge_3d[MAX_BLOCKS];
  1442. u32 qdss_count;
  1443. struct sde_qdss_cfg qdss[MAX_BLOCKS];
  1444. u32 limit_count;
  1445. struct sde_limit_cfg limit_cfg[LIMIT_SUBBLK_COUNT_MAX];
  1446. /* Add additional block data structures here */
  1447. struct sde_perf_cfg perf;
  1448. struct sde_format_extended *dma_formats;
  1449. struct sde_format_extended *cursor_formats;
  1450. struct sde_format_extended *vig_formats;
  1451. struct sde_format_extended *wb_formats;
  1452. struct sde_format_extended *virt_vig_formats;
  1453. struct sde_format_extended *inline_rot_formats;
  1454. struct list_head irq_offset_list;
  1455. };
  1456. struct sde_mdss_hw_cfg_handler {
  1457. u32 major;
  1458. u32 minor;
  1459. struct sde_mdss_cfg* (*cfg_init)(u32 data);
  1460. };
  1461. /*
  1462. * Access Macros
  1463. */
  1464. #define BLK_MDP(s) ((s)->mdp)
  1465. #define BLK_CTL(s) ((s)->ctl)
  1466. #define BLK_VIG(s) ((s)->vig)
  1467. #define BLK_RGB(s) ((s)->rgb)
  1468. #define BLK_DMA(s) ((s)->dma)
  1469. #define BLK_CURSOR(s) ((s)->cursor)
  1470. #define BLK_MIXER(s) ((s)->mixer)
  1471. #define BLK_DSPP(s) ((s)->dspp)
  1472. #define BLK_DS(s) ((s)->ds)
  1473. #define BLK_PINGPONG(s) ((s)->pingpong)
  1474. #define BLK_CDM(s) ((s)->cdm)
  1475. #define BLK_INTF(s) ((s)->intf)
  1476. #define BLK_WB(s) ((s)->wb)
  1477. #define BLK_AD(s) ((s)->ad)
  1478. #define BLK_LTM(s) ((s)->ltm)
  1479. #define BLK_RC(s) ((s)->rc)
  1480. /**
  1481. * sde_hw_set_preference: populate the individual hw lm preferences,
  1482. * overwrite if exists
  1483. * @sde_cfg: pointer to sspp cfg
  1484. * @num_lm: num lms to set preference
  1485. * @disp_type: is the given display primary/secondary
  1486. */
  1487. void sde_hw_mixer_set_preference(struct sde_mdss_cfg *sde_cfg, u32 num_lm,
  1488. uint32_t disp_type);
  1489. /**
  1490. * sde_hw_catalog_init - sde hardware catalog init API parses dtsi property
  1491. * and stores all parsed offset, hardware capabilities in config structure.
  1492. * @dev: drm device node.
  1493. * @hw_rev: caller needs provide the hardware revision before parsing.
  1494. *
  1495. * Return: parsed sde config structure
  1496. */
  1497. struct sde_mdss_cfg *sde_hw_catalog_init(struct drm_device *dev, u32 hw_rev);
  1498. /**
  1499. * sde_hw_catalog_deinit - sde hardware catalog cleanup
  1500. * @sde_cfg: pointer returned from init function
  1501. */
  1502. void sde_hw_catalog_deinit(struct sde_mdss_cfg *sde_cfg);
  1503. /**
  1504. * sde_hw_catalog_irq_offset_list_delete - delete the irq_offset_list
  1505. * maintained by the catalog
  1506. * @head: pointer to the catalog's irq_offset_list
  1507. */
  1508. static inline void sde_hw_catalog_irq_offset_list_delete(
  1509. struct list_head *head)
  1510. {
  1511. struct sde_intr_irq_offsets *item, *tmp;
  1512. list_for_each_entry_safe(item, tmp, head, list) {
  1513. list_del(&item->list);
  1514. kfree(item);
  1515. }
  1516. }
  1517. /**
  1518. * sde_hw_sspp_multirect_enabled - check multirect enabled for the sspp
  1519. * @cfg: pointer to sspp cfg
  1520. */
  1521. static inline bool sde_hw_sspp_multirect_enabled(const struct sde_sspp_cfg *cfg)
  1522. {
  1523. return test_bit(SDE_SSPP_SMART_DMA_V1, &cfg->features) ||
  1524. test_bit(SDE_SSPP_SMART_DMA_V2, &cfg->features) ||
  1525. test_bit(SDE_SSPP_SMART_DMA_V2p5, &cfg->features);
  1526. }
  1527. #endif /* _SDE_HW_CATALOG_H */