sde_hw_catalog.h 50 KB

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