sde_hw_catalog.h 52 KB

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