sde_hw_mdss.h 17 KB

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