sde_hw_mdss.h 16 KB

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