sde_hw_catalog.h 58 KB

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