sde_hw_catalog.h 48 KB

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