sde_hw_catalog.h 67 KB

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