sde_hw_catalog.h 57 KB

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