sde_hw_catalog.h 57 KB

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