sde_hw_mdss.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _SDE_HW_MDSS_H
  6. #define _SDE_HW_MDSS_H
  7. #include <linux/kernel.h>
  8. #include <linux/err.h>
  9. #include "msm_drv.h"
  10. #define SDE_DBG_NAME "sde"
  11. #define SDE_NONE 0
  12. #ifndef SDE_CSC_MATRIX_COEFF_SIZE
  13. #define SDE_CSC_MATRIX_COEFF_SIZE 9
  14. #endif
  15. #ifndef SDE_CSC_CLAMP_SIZE
  16. #define SDE_CSC_CLAMP_SIZE 6
  17. #endif
  18. #ifndef SDE_CSC_BIAS_SIZE
  19. #define SDE_CSC_BIAS_SIZE 3
  20. #endif
  21. #ifndef SDE_MAX_PLANES
  22. #define SDE_MAX_PLANES 4
  23. #endif
  24. #define PIPES_PER_STAGE 2
  25. #ifndef SDE_MAX_DE_CURVES
  26. #define SDE_MAX_DE_CURVES 3
  27. #endif
  28. #define MAX_DSI_DISPLAYS 2
  29. #define MAX_DATA_PATH_PER_DSIPLAY 2
  30. enum sde_format_flags {
  31. SDE_FORMAT_FLAG_YUV_BIT,
  32. SDE_FORMAT_FLAG_DX_BIT,
  33. SDE_FORMAT_FLAG_COMPRESSED_BIT,
  34. SDE_FORMAT_FLAG_BIT_MAX,
  35. };
  36. #define SDE_FORMAT_FLAG_YUV BIT(SDE_FORMAT_FLAG_YUV_BIT)
  37. #define SDE_FORMAT_FLAG_DX BIT(SDE_FORMAT_FLAG_DX_BIT)
  38. #define SDE_FORMAT_FLAG_COMPRESSED BIT(SDE_FORMAT_FLAG_COMPRESSED_BIT)
  39. #define SDE_FORMAT_IS_YUV(X) \
  40. (test_bit(SDE_FORMAT_FLAG_YUV_BIT, (X)->flag))
  41. #define SDE_FORMAT_IS_DX(X) \
  42. (test_bit(SDE_FORMAT_FLAG_DX_BIT, (X)->flag))
  43. #define SDE_FORMAT_IS_LINEAR(X) ((X)->fetch_mode == SDE_FETCH_LINEAR)
  44. #define SDE_FORMAT_IS_TILE(X) \
  45. (((X)->fetch_mode == SDE_FETCH_UBWC) && \
  46. !test_bit(SDE_FORMAT_FLAG_COMPRESSED_BIT, (X)->flag))
  47. #define SDE_FORMAT_IS_UBWC(X) \
  48. (((X)->fetch_mode == SDE_FETCH_UBWC) && \
  49. test_bit(SDE_FORMAT_FLAG_COMPRESSED_BIT, (X)->flag))
  50. #define SDE_BLEND_FG_ALPHA_FG_CONST (0 << 0)
  51. #define SDE_BLEND_FG_ALPHA_BG_CONST (1 << 0)
  52. #define SDE_BLEND_FG_ALPHA_FG_PIXEL (2 << 0)
  53. #define SDE_BLEND_FG_ALPHA_BG_PIXEL (3 << 0)
  54. #define SDE_BLEND_FG_INV_ALPHA (1 << 2)
  55. #define SDE_BLEND_FG_MOD_ALPHA (1 << 3)
  56. #define SDE_BLEND_FG_INV_MOD_ALPHA (1 << 4)
  57. #define SDE_BLEND_FG_TRANSP_EN (1 << 5)
  58. #define SDE_BLEND_BG_ALPHA_FG_CONST (0 << 8)
  59. #define SDE_BLEND_BG_ALPHA_BG_CONST (1 << 8)
  60. #define SDE_BLEND_BG_ALPHA_FG_PIXEL (2 << 8)
  61. #define SDE_BLEND_BG_ALPHA_BG_PIXEL (3 << 8)
  62. #define SDE_BLEND_BG_INV_ALPHA (1 << 10)
  63. #define SDE_BLEND_BG_MOD_ALPHA (1 << 11)
  64. #define SDE_BLEND_BG_INV_MOD_ALPHA (1 << 12)
  65. #define SDE_BLEND_BG_TRANSP_EN (1 << 13)
  66. #define SDE_VSYNC0_SOURCE_GPIO 0
  67. #define SDE_VSYNC1_SOURCE_GPIO 1
  68. #define SDE_VSYNC2_SOURCE_GPIO 2
  69. #define SDE_VSYNC_SOURCE_INTF_0 3
  70. #define SDE_VSYNC_SOURCE_INTF_1 4
  71. #define SDE_VSYNC_SOURCE_INTF_2 5
  72. #define SDE_VSYNC_SOURCE_INTF_3 6
  73. #define SDE_VSYNC_SOURCE_WD_TIMER_4 11
  74. #define SDE_VSYNC_SOURCE_WD_TIMER_3 12
  75. #define SDE_VSYNC_SOURCE_WD_TIMER_2 13
  76. #define SDE_VSYNC_SOURCE_WD_TIMER_1 14
  77. #define SDE_VSYNC_SOURCE_WD_TIMER_0 15
  78. enum sde_hw_blk_type {
  79. SDE_HW_BLK_TOP = 0,
  80. SDE_HW_BLK_SSPP,
  81. SDE_HW_BLK_LM,
  82. SDE_HW_BLK_DSPP,
  83. SDE_HW_BLK_DS,
  84. SDE_HW_BLK_CTL,
  85. SDE_HW_BLK_CDM,
  86. SDE_HW_BLK_PINGPONG,
  87. SDE_HW_BLK_INTF,
  88. SDE_HW_BLK_WB,
  89. SDE_HW_BLK_DSC,
  90. SDE_HW_BLK_MERGE_3D,
  91. SDE_HW_BLK_MAX,
  92. };
  93. enum sde_uidle {
  94. UIDLE = 0x1,
  95. UIDLE_MAX,
  96. };
  97. enum sde_mdp {
  98. MDP_TOP = 0x1,
  99. MDP_MAX,
  100. };
  101. enum sde_sspp {
  102. SSPP_NONE,
  103. SSPP_VIG0,
  104. SSPP_VIG1,
  105. SSPP_VIG2,
  106. SSPP_VIG3,
  107. SSPP_RGB0,
  108. SSPP_RGB1,
  109. SSPP_RGB2,
  110. SSPP_RGB3,
  111. SSPP_DMA0,
  112. SSPP_DMA1,
  113. SSPP_DMA2,
  114. SSPP_DMA3,
  115. SSPP_CURSOR0,
  116. SSPP_CURSOR1,
  117. SSPP_MAX
  118. };
  119. enum sde_sspp_type {
  120. SSPP_TYPE_VIG,
  121. SSPP_TYPE_RGB,
  122. SSPP_TYPE_DMA,
  123. SSPP_TYPE_CURSOR,
  124. SSPP_TYPE_MAX
  125. };
  126. enum sde_lm {
  127. LM_0 = 1,
  128. LM_1,
  129. LM_2,
  130. LM_3,
  131. LM_4,
  132. LM_5,
  133. LM_6,
  134. LM_MAX
  135. };
  136. enum sde_stage {
  137. SDE_STAGE_BASE = 0,
  138. SDE_STAGE_0,
  139. SDE_STAGE_1,
  140. SDE_STAGE_2,
  141. SDE_STAGE_3,
  142. SDE_STAGE_4,
  143. SDE_STAGE_5,
  144. SDE_STAGE_6,
  145. SDE_STAGE_7,
  146. SDE_STAGE_8,
  147. SDE_STAGE_9,
  148. SDE_STAGE_10,
  149. SDE_STAGE_MAX
  150. };
  151. enum sde_dspp {
  152. DSPP_0 = 1,
  153. DSPP_1,
  154. DSPP_2,
  155. DSPP_3,
  156. DSPP_MAX
  157. };
  158. enum sde_ltm {
  159. LTM_0 = DSPP_0,
  160. LTM_1,
  161. LTM_MAX
  162. };
  163. enum sde_ds {
  164. DS_TOP,
  165. DS_0,
  166. DS_1,
  167. DS_MAX
  168. };
  169. enum sde_ctl {
  170. CTL_0 = 1,
  171. CTL_1,
  172. CTL_2,
  173. CTL_3,
  174. CTL_4,
  175. CTL_5,
  176. CTL_MAX
  177. };
  178. enum sde_cdm {
  179. CDM_0 = 1,
  180. CDM_1,
  181. CDM_MAX
  182. };
  183. enum sde_pingpong {
  184. PINGPONG_0 = 1,
  185. PINGPONG_1,
  186. PINGPONG_2,
  187. PINGPONG_3,
  188. PINGPONG_4,
  189. PINGPONG_5,
  190. PINGPONG_S0,
  191. PINGPONG_MAX
  192. };
  193. enum sde_dsc {
  194. DSC_NONE = 0,
  195. DSC_0,
  196. DSC_1,
  197. DSC_2,
  198. DSC_3,
  199. DSC_4,
  200. DSC_5,
  201. DSC_MAX
  202. };
  203. enum sde_intf {
  204. INTF_0 = 1,
  205. INTF_1,
  206. INTF_2,
  207. INTF_3,
  208. INTF_4,
  209. INTF_5,
  210. INTF_6,
  211. INTF_MAX
  212. };
  213. enum sde_intf_type {
  214. INTF_NONE = 0x0,
  215. INTF_DSI = 0x1,
  216. INTF_HDMI = 0x3,
  217. INTF_LCDC = 0x5,
  218. INTF_EDP = 0x9,
  219. INTF_DP = 0xa,
  220. INTF_TYPE_MAX,
  221. /* virtual interfaces */
  222. INTF_WB = 0x100,
  223. };
  224. enum sde_intf_mode {
  225. INTF_MODE_NONE = 0,
  226. INTF_MODE_CMD,
  227. INTF_MODE_VIDEO,
  228. INTF_MODE_WB_BLOCK,
  229. INTF_MODE_WB_LINE,
  230. INTF_MODE_MAX
  231. };
  232. enum sde_wb {
  233. WB_0 = 1,
  234. WB_1,
  235. WB_2,
  236. WB_3,
  237. WB_MAX
  238. };
  239. enum sde_ad {
  240. AD_0 = 0x1,
  241. AD_1,
  242. AD_MAX
  243. };
  244. enum sde_cwb {
  245. CWB_0 = 0x1,
  246. CWB_1,
  247. CWB_2,
  248. CWB_3,
  249. CWB_4,
  250. CWB_5,
  251. CWB_MAX
  252. };
  253. enum sde_wd_timer {
  254. WD_TIMER_0 = 0x1,
  255. WD_TIMER_1,
  256. WD_TIMER_2,
  257. WD_TIMER_3,
  258. WD_TIMER_4,
  259. WD_TIMER_5,
  260. WD_TIMER_MAX
  261. };
  262. enum sde_vbif {
  263. VBIF_0,
  264. VBIF_1,
  265. VBIF_MAX,
  266. VBIF_RT = VBIF_0,
  267. VBIF_NRT = VBIF_1
  268. };
  269. enum sde_iommu_domain {
  270. SDE_IOMMU_DOMAIN_UNSECURE,
  271. SDE_IOMMU_DOMAIN_SECURE,
  272. SDE_IOMMU_DOMAIN_MAX
  273. };
  274. enum sde_rot {
  275. ROT_0 = 1,
  276. ROT_MAX
  277. };
  278. enum sde_merge_3d {
  279. MERGE_3D_0 = 1,
  280. MERGE_3D_1,
  281. MERGE_3D_2,
  282. MERGE_3D_MAX
  283. };
  284. /**
  285. * SDE HW,Component order color map
  286. */
  287. enum {
  288. C0_G_Y = 0,
  289. C1_B_Cb = 1,
  290. C2_R_Cr = 2,
  291. C3_ALPHA = 3
  292. };
  293. /**
  294. * enum sde_plane_type - defines how the color component pixel packing
  295. * @SDE_PLANE_INTERLEAVED : Color components in single plane
  296. * @SDE_PLANE_PLANAR : Color component in separate planes
  297. * @SDE_PLANE_PSEUDO_PLANAR : Chroma components interleaved in separate plane
  298. */
  299. enum sde_plane_type {
  300. SDE_PLANE_INTERLEAVED,
  301. SDE_PLANE_PLANAR,
  302. SDE_PLANE_PSEUDO_PLANAR,
  303. };
  304. /**
  305. * enum sde_chroma_samp_type - chroma sub-samplng type
  306. * @SDE_CHROMA_RGB : No chroma subsampling
  307. * @SDE_CHROMA_H2V1 : Chroma pixels are horizontally subsampled
  308. * @SDE_CHROMA_H1V2 : Chroma pixels are vertically subsampled
  309. * @SDE_CHROMA_420 : 420 subsampling
  310. */
  311. enum sde_chroma_samp_type {
  312. SDE_CHROMA_RGB,
  313. SDE_CHROMA_H2V1,
  314. SDE_CHROMA_H1V2,
  315. SDE_CHROMA_420
  316. };
  317. /**
  318. * sde_fetch_type - Defines How SDE HW fetches data
  319. * @SDE_FETCH_LINEAR : fetch is line by line
  320. * @SDE_FETCH_TILE : fetches data in Z order from a tile
  321. * @SDE_FETCH_UBWC : fetch and decompress data
  322. */
  323. enum sde_fetch_type {
  324. SDE_FETCH_LINEAR,
  325. SDE_FETCH_TILE,
  326. SDE_FETCH_UBWC
  327. };
  328. /**
  329. * Value of enum chosen to fit the number of bits
  330. * expected by the HW programming.
  331. */
  332. enum {
  333. COLOR_ALPHA_1BIT = 0,
  334. COLOR_ALPHA_4BIT = 1,
  335. COLOR_4BIT = 0,
  336. COLOR_5BIT = 1, /* No 5-bit Alpha */
  337. COLOR_6BIT = 2, /* 6-Bit Alpha also = 2 */
  338. COLOR_8BIT = 3, /* 8-Bit Alpha also = 3 */
  339. };
  340. /**
  341. * enum sde_3d_blend_mode
  342. * Desribes how the 3d data is blended
  343. * @BLEND_3D_NONE : 3d blending not enabled
  344. * @BLEND_3D_FRAME_INT : Frame interleaving
  345. * @BLEND_3D_H_ROW_INT : Horizontal row interleaving
  346. * @BLEND_3D_V_ROW_INT : vertical row interleaving
  347. * @BLEND_3D_COL_INT : column interleaving
  348. * @BLEND_3D_MAX :
  349. */
  350. enum sde_3d_blend_mode {
  351. BLEND_3D_NONE = 0,
  352. BLEND_3D_FRAME_INT,
  353. BLEND_3D_H_ROW_INT,
  354. BLEND_3D_V_ROW_INT,
  355. BLEND_3D_COL_INT,
  356. BLEND_3D_MAX
  357. };
  358. /** struct sde_format - defines the format configuration which
  359. * allows SDE HW to correctly fetch and decode the format
  360. * @base: base msm_format struture containing fourcc code
  361. * @fetch_planes: how the color components are packed in pixel format
  362. * @element: element color ordering
  363. * @bits: element bit widths
  364. * @chroma_sample: chroma sub-samplng type
  365. * @unpack_align_msb: unpack aligned, 0 to LSB, 1 to MSB
  366. * @unpack_tight: 0 for loose, 1 for tight
  367. * @unpack_count: 0 = 1 component, 1 = 2 component
  368. * @bpp: bytes per pixel
  369. * @alpha_enable: whether the format has an alpha channel
  370. * @num_planes: number of planes (including meta data planes)
  371. * @fetch_mode: linear, tiled, or ubwc hw fetch behavior
  372. * @is_yuv: is format a yuv variant
  373. * @flag: usage bit flags
  374. * @tile_width: format tile width
  375. * @tile_height: format tile height
  376. */
  377. struct sde_format {
  378. struct msm_format base;
  379. enum sde_plane_type fetch_planes;
  380. u8 element[SDE_MAX_PLANES];
  381. u8 bits[SDE_MAX_PLANES];
  382. enum sde_chroma_samp_type chroma_sample;
  383. u8 unpack_align_msb;
  384. u8 unpack_tight;
  385. u8 unpack_count;
  386. u8 bpp;
  387. u8 alpha_enable;
  388. u8 num_planes;
  389. enum sde_fetch_type fetch_mode;
  390. DECLARE_BITMAP(flag, SDE_FORMAT_FLAG_BIT_MAX);
  391. u16 tile_width;
  392. u16 tile_height;
  393. };
  394. #define to_sde_format(x) container_of(x, struct sde_format, base)
  395. /**
  396. * struct sde_hw_fmt_layout - format information of the source pixel data
  397. * @format: pixel format parameters
  398. * @num_planes: number of planes (including meta data planes)
  399. * @width: image width
  400. * @height: image height
  401. * @total_size: total size in bytes
  402. * @plane_addr: address of each plane
  403. * @plane_size: length of each plane
  404. * @plane_pitch: pitch of each plane
  405. */
  406. struct sde_hw_fmt_layout {
  407. const struct sde_format *format;
  408. uint32_t num_planes;
  409. uint32_t width;
  410. uint32_t height;
  411. uint32_t total_size;
  412. uint32_t plane_addr[SDE_MAX_PLANES];
  413. uint32_t plane_size[SDE_MAX_PLANES];
  414. uint32_t plane_pitch[SDE_MAX_PLANES];
  415. };
  416. struct sde_rect {
  417. u16 x;
  418. u16 y;
  419. u16 w;
  420. u16 h;
  421. };
  422. struct sde_csc_cfg {
  423. /* matrix coefficients in S15.16 format */
  424. uint32_t csc_mv[SDE_CSC_MATRIX_COEFF_SIZE];
  425. uint32_t csc_pre_bv[SDE_CSC_BIAS_SIZE];
  426. uint32_t csc_post_bv[SDE_CSC_BIAS_SIZE];
  427. uint32_t csc_pre_lv[SDE_CSC_CLAMP_SIZE];
  428. uint32_t csc_post_lv[SDE_CSC_CLAMP_SIZE];
  429. };
  430. /**
  431. * struct sde_mdss_color - mdss color description
  432. * color 0 : green
  433. * color 1 : blue
  434. * color 2 : red
  435. * color 3 : alpha
  436. */
  437. struct sde_mdss_color {
  438. u32 color_0;
  439. u32 color_1;
  440. u32 color_2;
  441. u32 color_3;
  442. };
  443. /*
  444. * Define bit masks for h/w logging.
  445. */
  446. #define SDE_DBG_MASK_NONE (1 << 0)
  447. #define SDE_DBG_MASK_CDM (1 << 1)
  448. #define SDE_DBG_MASK_DSPP (1 << 2)
  449. #define SDE_DBG_MASK_INTF (1 << 3)
  450. #define SDE_DBG_MASK_LM (1 << 4)
  451. #define SDE_DBG_MASK_CTL (1 << 5)
  452. #define SDE_DBG_MASK_PINGPONG (1 << 6)
  453. #define SDE_DBG_MASK_SSPP (1 << 7)
  454. #define SDE_DBG_MASK_WB (1 << 8)
  455. #define SDE_DBG_MASK_TOP (1 << 9)
  456. #define SDE_DBG_MASK_VBIF (1 << 10)
  457. #define SDE_DBG_MASK_DSC (1 << 11)
  458. #define SDE_DBG_MASK_ROT (1 << 12)
  459. #define SDE_DBG_MASK_DS (1 << 13)
  460. #define SDE_DBG_MASK_REGDMA (1 << 14)
  461. #define SDE_DBG_MASK_UIDLE (1 << 15)
  462. #define SDE_DBG_MASK_SID (1 << 15)
  463. /**
  464. * struct sde_hw_cp_cfg: hardware dspp/lm feature payload.
  465. * @payload: Feature specific payload.
  466. * @len: Length of the payload.
  467. * @ctl: control pointer associated with dspp/lm.
  468. * @last_feature: last feature that will be set.
  469. * @num_of_mixers: number of layer mixers for the display.
  470. * @mixer_info: mixer info pointer associated with lm.
  471. * @displayv: height of the display.
  472. * @displayh: width of the display.
  473. * @dspp[DSPP_MAX]: array of hw_dspp pointers associated with crtc.
  474. * @broadcast_disabled: flag indicating if broadcast should be avoided when
  475. * using LUTDMA
  476. */
  477. struct sde_hw_cp_cfg {
  478. void *payload;
  479. u32 len;
  480. void *ctl;
  481. u32 last_feature;
  482. u32 num_of_mixers;
  483. void *mixer_info;
  484. u32 displayv;
  485. u32 displayh;
  486. struct sde_hw_dspp *dspp[DSPP_MAX];
  487. bool broadcast_disabled;
  488. };
  489. /**
  490. * struct sde_hw_dim_layer: dim layer configs
  491. * @flags: Flag to represent INCLUSIVE/EXCLUSIVE
  492. * @stage: Blending stage of dim layer
  493. * @color_fill: Color fill to be used for the layer
  494. * @rect: Dim layer coordinates
  495. */
  496. struct sde_hw_dim_layer {
  497. uint32_t flags;
  498. uint32_t stage;
  499. struct sde_mdss_color color_fill;
  500. struct sde_rect rect;
  501. };
  502. /**
  503. * struct sde_splash_mem - Struct contains splah memory info
  504. * @splash_buf_size: Indicates the size of the memory region
  505. * @splash_buf_base: Address of specific splash memory region
  506. * @ramdump_size: Size of ramdump buffer region
  507. * @ramdump_base: Address of ramdump region reserved by bootloader
  508. * @ref_cnt: Tracks the map count to help in sharing splash memory
  509. */
  510. struct sde_splash_mem {
  511. u32 splash_buf_size;
  512. unsigned long splash_buf_base;
  513. u32 ramdump_size;
  514. unsigned long ramdump_base;
  515. u32 ref_cnt;
  516. };
  517. /**
  518. * struct sde_sspp_index_info - Struct containing sspp identifier info
  519. * @sspp: Enum value indicates sspp id
  520. * @is_virtual: Boolean to identify if virtual or base
  521. */
  522. struct sde_sspp_index_info {
  523. enum sde_sspp sspp;
  524. bool is_virtual;
  525. };
  526. /**
  527. * struct sde_splash_data - Struct contains details of resources and hw blocks
  528. * used in continuous splash on a specific display.
  529. * @cont_splash_enabled: Stores the cont_splash status (enabled/disabled)
  530. * @single_flush_en: Stores if the single flush is enabled
  531. * @encoder: Pointer to the drm encoder object used for this display
  532. * @splash: Pointer to struct sde_splash_mem used for this display
  533. * @ctl_ids: Stores the valid MDSS ctl block ids for the current mode
  534. * @lm_ids: Stores the valid MDSS layer mixer block ids for the current mode
  535. * @dsc_ids: Stores the valid MDSS DSC block ids for the current mode
  536. * @pipes: Array of sspp info detected on this display
  537. * @ctl_cnt: Stores the active number of MDSS "top" blks of the current mode
  538. * @lm_cnt: Stores the active number of MDSS "LM" blks for the current mode
  539. * @dsc_cnt: Stores the active number of MDSS "dsc" blks for the current mode
  540. * @pipe_cnt: Stores the active number of "sspp" blks connected
  541. */
  542. struct sde_splash_display {
  543. bool cont_splash_enabled;
  544. bool single_flush_en;
  545. struct drm_encoder *encoder;
  546. struct sde_splash_mem *splash;
  547. u8 ctl_ids[MAX_DATA_PATH_PER_DSIPLAY];
  548. u8 lm_ids[MAX_DATA_PATH_PER_DSIPLAY];
  549. u8 dsc_ids[MAX_DATA_PATH_PER_DSIPLAY];
  550. struct sde_sspp_index_info pipes[MAX_DATA_PATH_PER_DSIPLAY];
  551. u8 ctl_cnt;
  552. u8 lm_cnt;
  553. u8 dsc_cnt;
  554. u8 pipe_cnt;
  555. };
  556. /**
  557. * struct sde_splash_data - Struct contains details of continuous splash
  558. * for all the displays connected by probe time
  559. * @num_splash_regions: Indicates number of splash memory regions from dtsi
  560. * @num_splash_displays: Indicates count of active displays in continuous splash
  561. * @splash_mem: Array of all struct sde_splash_mem listed from dtsi
  562. * @splash_display: Array of all struct sde_splash_display
  563. */
  564. struct sde_splash_data {
  565. u32 num_splash_regions;
  566. u32 num_splash_displays;
  567. struct sde_splash_mem splash_mem[MAX_DSI_DISPLAYS];
  568. struct sde_splash_display splash_display[MAX_DSI_DISPLAYS];
  569. };
  570. /**
  571. * struct sde_hw_tear_check - Struct contains parameters to configure
  572. * tear-effect module. This structure is used to configure tear-check
  573. * logic present either in ping-pong or in interface module.
  574. * @vsync_count: Ratio of MDP VSYNC clk freq(Hz) to refresh rate divided
  575. * by no of lines
  576. * @sync_cfg_height: Total vertical lines (display height - 1)
  577. * @vsync_init_val: Init value to which the read pointer gets loaded at
  578. * vsync edge
  579. * @sync_threshold_start: Read pointer threshold start ROI for write operation
  580. * @sync_threshold_continue: The minimum number of lines the write pointer
  581. * needs to be above the read pointer
  582. * @start_pos: The position from which the start_threshold value is added
  583. * @rd_ptr_irq: The read pointer line at which interrupt has to be generated
  584. * @hw_vsync_mode: Sync with external frame sync input
  585. */
  586. struct sde_hw_tear_check {
  587. u32 vsync_count;
  588. u32 sync_cfg_height;
  589. u32 vsync_init_val;
  590. u32 sync_threshold_start;
  591. u32 sync_threshold_continue;
  592. u32 start_pos;
  593. u32 rd_ptr_irq;
  594. u8 hw_vsync_mode;
  595. };
  596. /**
  597. * struct sde_hw_autorefresh - Struct contains parameters to configure
  598. * auto-refresh mode for command mode panels
  599. * @enable: Enalbe or disable the auto-refresh mode
  600. * @frame_count: Auto-refresh frame counter at which update occurs
  601. */
  602. struct sde_hw_autorefresh {
  603. bool enable;
  604. u32 frame_count;
  605. };
  606. /**
  607. * struct sde_hw_pp_vsync_info - Struct contains parameters to configure
  608. * read and write pointers for command mode panels
  609. * @rd_ptr_init_val: Value of rd pointer at vsync edge
  610. * @rd_ptr_frame_count: num frames sent since enabling interface
  611. * @rd_ptr_line_count: current line on panel (rd ptr)
  612. * @wr_ptr_line_count: current line within pp fifo (wr ptr)
  613. */
  614. struct sde_hw_pp_vsync_info {
  615. u32 rd_ptr_init_val;
  616. u32 rd_ptr_frame_count;
  617. u32 rd_ptr_line_count;
  618. u32 wr_ptr_line_count;
  619. };
  620. #endif /* _SDE_HW_MDSS_H */