sde_hw_catalog.h 58 KB

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