sde_hw_catalog.h 68 KB

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