sde_hw_catalog.h 69 KB

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