sde_hw_catalog.h 66 KB

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