sde_hw_mdss.h 17 KB

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