sde_hw_catalog.h 50 KB

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