sde_hw_sspp.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  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_SSPP_H
  7. #define _SDE_HW_SSPP_H
  8. #include "sde_hw_catalog.h"
  9. #include "sde_hw_mdss.h"
  10. #include "sde_hw_util.h"
  11. #include "sde_reg_dma.h"
  12. #include "sde_formats.h"
  13. #include "sde_color_processing.h"
  14. #include "sde_hw_vbif.h"
  15. struct sde_hw_pipe;
  16. /**
  17. * Flags
  18. */
  19. #define SDE_SSPP_SECURE_OVERLAY_SESSION 0x1
  20. #define SDE_SSPP_FLIP_LR 0x2
  21. #define SDE_SSPP_FLIP_UD 0x4
  22. #define SDE_SSPP_SOURCE_ROTATED_90 0x8
  23. #define SDE_SSPP_ROT_90 0x10
  24. #define SDE_SSPP_SOLID_FILL 0x20
  25. #define SDE_SSPP_RIGHT 0x40
  26. /**
  27. * Define all scaler feature bits in catalog
  28. */
  29. #define SDE_SSPP_SCALER ((1UL << SDE_SSPP_SCALER_QSEED2) | \
  30. (1UL << SDE_SSPP_SCALER_QSEED3) | \
  31. (1UL << SDE_SSPP_SCALER_QSEED3LITE))
  32. /**
  33. * Component indices
  34. */
  35. enum {
  36. SDE_SSPP_COMP_0,
  37. SDE_SSPP_COMP_1_2,
  38. SDE_SSPP_COMP_2,
  39. SDE_SSPP_COMP_3,
  40. SDE_SSPP_COMP_MAX
  41. };
  42. /**
  43. * SDE_SSPP_RECT_SOLO - multirect disabled
  44. * SDE_SSPP_RECT_0 - rect0 of a multirect pipe
  45. * SDE_SSPP_RECT_1 - rect1 of a multirect pipe
  46. * SDE_SSPP_RECT_MAX - max enum of multirect pipe
  47. *
  48. * Note: HW supports multirect with either RECT0 or
  49. * RECT1. Considering no benefit of such configs over
  50. * SOLO mode and to keep the plane management simple,
  51. * we dont support single rect multirect configs.
  52. */
  53. enum sde_sspp_multirect_index {
  54. SDE_SSPP_RECT_SOLO = 0,
  55. SDE_SSPP_RECT_0,
  56. SDE_SSPP_RECT_1,
  57. SDE_SSPP_RECT_MAX,
  58. };
  59. enum sde_sspp_multirect_mode {
  60. SDE_SSPP_MULTIRECT_NONE = 0,
  61. SDE_SSPP_MULTIRECT_PARALLEL,
  62. SDE_SSPP_MULTIRECT_TIME_MX,
  63. };
  64. enum {
  65. SDE_FRAME_LINEAR,
  66. SDE_FRAME_TILE_A4X,
  67. SDE_FRAME_TILE_A5X,
  68. };
  69. enum sde_hw_filter {
  70. SDE_SCALE_FILTER_NEAREST = 0,
  71. SDE_SCALE_FILTER_BIL,
  72. SDE_SCALE_FILTER_PCMN,
  73. SDE_SCALE_FILTER_CA,
  74. SDE_SCALE_FILTER_MAX
  75. };
  76. enum sde_hw_filter_alpa {
  77. SDE_SCALE_ALPHA_PIXEL_REP,
  78. SDE_SCALE_ALPHA_BIL
  79. };
  80. enum sde_hw_filter_yuv {
  81. SDE_SCALE_2D_4X4,
  82. SDE_SCALE_2D_CIR,
  83. SDE_SCALE_1D_SEP,
  84. SDE_SCALE_BIL
  85. };
  86. struct sde_hw_sharp_cfg {
  87. u32 strength;
  88. u32 edge_thr;
  89. u32 smooth_thr;
  90. u32 noise_thr;
  91. };
  92. struct sde_hw_pixel_ext {
  93. /* scaling factors are enabled for this input layer */
  94. uint8_t enable_pxl_ext;
  95. int init_phase_x[SDE_MAX_PLANES];
  96. int phase_step_x[SDE_MAX_PLANES];
  97. int init_phase_y[SDE_MAX_PLANES];
  98. int phase_step_y[SDE_MAX_PLANES];
  99. /*
  100. * Number of pixels extension in left, right, top and bottom direction
  101. * for all color components. This pixel value for each color component
  102. * should be sum of fetch + repeat pixels.
  103. */
  104. int num_ext_pxls_left[SDE_MAX_PLANES];
  105. int num_ext_pxls_right[SDE_MAX_PLANES];
  106. int num_ext_pxls_top[SDE_MAX_PLANES];
  107. int num_ext_pxls_btm[SDE_MAX_PLANES];
  108. /*
  109. * Number of pixels needs to be overfetched in left, right, top and
  110. * bottom directions from source image for scaling.
  111. */
  112. int left_ftch[SDE_MAX_PLANES];
  113. int right_ftch[SDE_MAX_PLANES];
  114. int top_ftch[SDE_MAX_PLANES];
  115. int btm_ftch[SDE_MAX_PLANES];
  116. /*
  117. * Number of pixels needs to be repeated in left, right, top and
  118. * bottom directions for scaling.
  119. */
  120. int left_rpt[SDE_MAX_PLANES];
  121. int right_rpt[SDE_MAX_PLANES];
  122. int top_rpt[SDE_MAX_PLANES];
  123. int btm_rpt[SDE_MAX_PLANES];
  124. uint32_t roi_w[SDE_MAX_PLANES];
  125. uint32_t roi_h[SDE_MAX_PLANES];
  126. /*
  127. * Filter type to be used for scaling in horizontal and vertical
  128. * directions
  129. */
  130. enum sde_hw_filter horz_filter[SDE_MAX_PLANES];
  131. enum sde_hw_filter vert_filter[SDE_MAX_PLANES];
  132. };
  133. /**
  134. * struct sde_hw_pipe_cfg : Pipe description
  135. * @layout: format layout information for programming buffer to hardware
  136. * @src_rect: src ROI, caller takes into account the different operations
  137. * such as decimation, flip etc to program this field
  138. * @dest_rect: destination ROI.
  139. * @ horz_decimation : horizontal decimation factor( 0, 2, 4, 8, 16)
  140. * @ vert_decimation : vertical decimation factor( 0, 2, 4, 8, 16)
  141. * 2: Read 1 line/pixel drop 1 line/pixel
  142. * 4: Read 1 line/pixel drop 3 lines/pixels
  143. * 8: Read 1 line/pixel drop 7 lines/pixels
  144. * 16: Read 1 line/pixel drop 15 line/pixels
  145. */
  146. struct sde_hw_pipe_cfg {
  147. struct sde_hw_fmt_layout layout;
  148. struct sde_rect src_rect;
  149. struct sde_rect dst_rect;
  150. u8 horz_decimation;
  151. u8 vert_decimation;
  152. };
  153. /**
  154. * struct sde_hw_pipe_qos_cfg : Source pipe QoS configuration
  155. * @danger_lut: LUT for generate danger level based on fill level
  156. * @safe_lut: LUT for generate safe level based on fill level
  157. * @creq_lut: LUT for generate creq level based on fill level
  158. * @creq_vblank: creq value generated to vbif during vertical blanking
  159. * @danger_vblank: danger value generated during vertical blanking
  160. * @vblank_en: enable creq_vblank and danger_vblank during vblank
  161. * @danger_safe_en: enable danger safe generation
  162. */
  163. struct sde_hw_pipe_qos_cfg {
  164. u32 danger_lut;
  165. u32 safe_lut;
  166. u64 creq_lut;
  167. u32 creq_vblank;
  168. u32 danger_vblank;
  169. bool vblank_en;
  170. bool danger_safe_en;
  171. };
  172. /**
  173. * enum CDP preload ahead address size
  174. */
  175. enum {
  176. SDE_SSPP_CDP_PRELOAD_AHEAD_32,
  177. SDE_SSPP_CDP_PRELOAD_AHEAD_64
  178. };
  179. /**
  180. * struct sde_hw_pipe_cdp_cfg : CDP configuration
  181. * @enable: true to enable CDP
  182. * @ubwc_meta_enable: true to enable ubwc metadata preload
  183. * @tile_amortize_enable: true to enable amortization control for tile format
  184. * @preload_ahead: number of request to preload ahead
  185. * SDE_SSPP_CDP_PRELOAD_AHEAD_32,
  186. * SDE_SSPP_CDP_PRELOAD_AHEAD_64
  187. */
  188. struct sde_hw_pipe_cdp_cfg {
  189. bool enable;
  190. bool ubwc_meta_enable;
  191. bool tile_amortize_enable;
  192. u32 preload_ahead;
  193. };
  194. /**
  195. * enum system cache rotation operation mode
  196. */
  197. enum {
  198. SDE_PIPE_SC_OP_MODE_OFFLINE,
  199. SDE_PIPE_SC_OP_MODE_INLINE_SINGLE,
  200. SDE_PIPE_SC_OP_MODE_INLINE_LEFT,
  201. SDE_PIPE_SC_OP_MODE_INLINE_RIGHT,
  202. };
  203. /**
  204. * enum system cache read operation type
  205. */
  206. enum {
  207. SDE_PIPE_SC_RD_OP_TYPE_CACHEABLE,
  208. SDE_PIPE_SC_RD_OP_TYPE_RESERVED,
  209. SDE_PIPE_SC_RD_OP_TYPE_INVALIDATE,
  210. SDE_PIPE_SC_RD_OP_TYPE_EVICTION,
  211. };
  212. /**
  213. * struct sde_hw_pipe_sc_cfg - system cache configuration
  214. * @op_mode: rotation operating mode
  215. * @rd_en: system cache read enable
  216. * @rd_scid: system cache read block id
  217. * @rd_noallocate: system cache read no allocate attribute
  218. * @rd_op_type: system cache read operation type
  219. * @flags: dirty flags to change the configuration
  220. * @type: sys cache type
  221. */
  222. struct sde_hw_pipe_sc_cfg {
  223. u32 op_mode;
  224. bool rd_en;
  225. u32 rd_scid;
  226. bool rd_noallocate;
  227. u32 rd_op_type;
  228. u32 flags;
  229. enum sde_sys_cache_type type;
  230. };
  231. /**
  232. * struct sde_hw_pipe_uidle_cfg - uidle configuration
  233. * @enable: disables uidle
  234. * @fal_allowed_threshold: minimum fl to allow uidle
  235. * @fal10_exit_threshold: number of lines to indicate fal_10_exit is okay
  236. * @fal10_threshold: number of lines where fal_10_is okay
  237. * @fal1_threshold: number of lines where fal_1 is okay
  238. * @fill_level_scale: scale factor on the fal10 threshold
  239. */
  240. struct sde_hw_pipe_uidle_cfg {
  241. u32 enable;
  242. u32 fal_allowed_threshold;
  243. u32 fal10_exit_threshold;
  244. u32 fal10_threshold;
  245. u32 fal1_threshold;
  246. u32 fill_level_scale;
  247. };
  248. /**
  249. * struct sde_hw_pipe_ts_cfg - traffic shaper configuration
  250. * @size: size to prefill in bytes, or zero to disable
  251. * @time: time to prefill in usec, or zero to disable
  252. */
  253. struct sde_hw_pipe_ts_cfg {
  254. u64 size;
  255. u64 time;
  256. };
  257. /**
  258. * Maximum number of stream buffer plane
  259. */
  260. #define SDE_PIPE_SBUF_PLANE_NUM 2
  261. /**
  262. * struct sde_hw_sspp_ops - interface to the SSPP Hw driver functions
  263. * Caller must call the init function to get the pipe context for each pipe
  264. * Assumption is these functions will be called after clocks are enabled
  265. */
  266. struct sde_hw_sspp_ops {
  267. /**
  268. * setup_format - setup pixel format cropping rectangle, flip
  269. * @ctx: Pointer to pipe context
  270. * @fmt: Pointer to sde_format structure
  271. * @blend_enabled: flag indicating blend enabled or disabled on plane
  272. * @flags: Extra flags for format config
  273. * @index: rectangle index in multirect
  274. */
  275. void (*setup_format)(struct sde_hw_pipe *ctx,
  276. const struct sde_format *fmt,
  277. bool blend_enabled, u32 flags,
  278. enum sde_sspp_multirect_index index);
  279. /**
  280. * setup_rects - setup pipe ROI rectangles
  281. * @ctx: Pointer to pipe context
  282. * @cfg: Pointer to pipe config structure
  283. * @index: rectangle index in multirect
  284. */
  285. void (*setup_rects)(struct sde_hw_pipe *ctx,
  286. struct sde_hw_pipe_cfg *cfg,
  287. enum sde_sspp_multirect_index index);
  288. /**
  289. * setup_pe - setup pipe pixel extension
  290. * @ctx: Pointer to pipe context
  291. * @pe_ext: Pointer to pixel ext settings
  292. */
  293. void (*setup_pe)(struct sde_hw_pipe *ctx,
  294. struct sde_hw_pixel_ext *pe_ext);
  295. /**
  296. * setup_excl_rect - setup pipe exclusion rectangle
  297. * @ctx: Pointer to pipe context
  298. * @excl_rect: Pointer to exclclusion rect structure
  299. * @index: rectangle index in multirect
  300. */
  301. void (*setup_excl_rect)(struct sde_hw_pipe *ctx,
  302. struct sde_rect *excl_rect,
  303. enum sde_sspp_multirect_index index);
  304. /**
  305. * setup_sourceaddress - setup pipe source addresses
  306. * @ctx: Pointer to pipe context
  307. * @cfg: Pointer to pipe config structure
  308. * @index: rectangle index in multirect
  309. */
  310. void (*setup_sourceaddress)(struct sde_hw_pipe *ctx,
  311. struct sde_hw_pipe_cfg *cfg,
  312. enum sde_sspp_multirect_index index);
  313. /* get_sourceaddress - get pipe current source addresses of a plane
  314. * @ctx: Pointer to pipe context
  315. * @is_virtual: If true get address programmed for R1 in multirect
  316. */
  317. u32 (*get_sourceaddress)(struct sde_hw_pipe *ctx, bool is_virtual);
  318. /**
  319. * setup_csc - setup color space conversion
  320. * @ctx: Pointer to pipe context
  321. * @data: Pointer to config structure
  322. */
  323. void (*setup_csc)(struct sde_hw_pipe *ctx, struct sde_csc_cfg *data);
  324. /**
  325. * setup_solidfill - enable/disable colorfill
  326. * @ctx: Pointer to pipe context
  327. * @const_color: Fill color value
  328. * @flags: Pipe flags
  329. * @index: rectangle index in multirect
  330. */
  331. void (*setup_solidfill)(struct sde_hw_pipe *ctx, u32 color,
  332. enum sde_sspp_multirect_index index);
  333. /**
  334. * update_multirect - update multirect configuration
  335. * @ctx: Pointer to pipe context
  336. * @enable: Boolean to indicate enable or disable of given config
  337. * @index: rectangle index in multirect
  338. * @mode: parallel fetch / time multiplex multirect mode
  339. */
  340. void (*update_multirect)(struct sde_hw_pipe *ctx,
  341. bool enable,
  342. enum sde_sspp_multirect_index index,
  343. enum sde_sspp_multirect_mode mode);
  344. /**
  345. * setup_sharpening - setup sharpening
  346. * @ctx: Pointer to pipe context
  347. * @cfg: Pointer to config structure
  348. */
  349. void (*setup_sharpening)(struct sde_hw_pipe *ctx,
  350. struct sde_hw_sharp_cfg *cfg);
  351. /**
  352. * setup_pa_hue(): Setup source hue adjustment
  353. * @ctx: Pointer to pipe context
  354. * @cfg: Pointer to hue data
  355. */
  356. void (*setup_pa_hue)(struct sde_hw_pipe *ctx, void *cfg);
  357. /**
  358. * setup_pa_sat(): Setup source saturation adjustment
  359. * @ctx: Pointer to pipe context
  360. * @cfg: Pointer to saturation data
  361. */
  362. void (*setup_pa_sat)(struct sde_hw_pipe *ctx, void *cfg);
  363. /**
  364. * setup_pa_val(): Setup source value adjustment
  365. * @ctx: Pointer to pipe context
  366. * @cfg: Pointer to value data
  367. */
  368. void (*setup_pa_val)(struct sde_hw_pipe *ctx, void *cfg);
  369. /**
  370. * setup_pa_cont(): Setup source contrast adjustment
  371. * @ctx: Pointer to pipe context
  372. * @cfg: Pointer contrast data
  373. */
  374. void (*setup_pa_cont)(struct sde_hw_pipe *ctx, void *cfg);
  375. /**
  376. * setup_pa_memcolor - setup source color processing
  377. * @ctx: Pointer to pipe context
  378. * @type: Memcolor type (Skin, sky or foliage)
  379. * @cfg: Pointer to memory color config data
  380. */
  381. void (*setup_pa_memcolor)(struct sde_hw_pipe *ctx,
  382. enum sde_memcolor_type type, void *cfg);
  383. /**
  384. * setup_vig_gamut - setup 3D LUT Gamut in VIG pipes
  385. * @ctx: Pointer to pipe context
  386. * @cfg: Pointer to vig gamut data
  387. */
  388. void (*setup_vig_gamut)(struct sde_hw_pipe *ctx, void *cfg);
  389. /**
  390. * setup_vig_igc - setup 1D LUT IGC in VIG pipes
  391. * @ctx: Pointer to pipe context
  392. * @cfg: Pointer to vig igc data
  393. */
  394. void (*setup_vig_igc)(struct sde_hw_pipe *ctx, void *cfg);
  395. /**
  396. * setup_dma_igc - setup 1D LUT IGC in DMA pipes
  397. * @ctx: Pointer to pipe context
  398. * @cfg: Pointer to dma igc data
  399. * @idx: multirect index
  400. */
  401. void (*setup_dma_igc)(struct sde_hw_pipe *ctx, void *cfg,
  402. enum sde_sspp_multirect_index idx);
  403. /**
  404. * setup_dma_gc - setup 1D LUT GC in DMA pipes
  405. * @ctx: Pointer to pipe context
  406. * @cfg: Pointer to dma gc data
  407. * @idx: multirect index
  408. */
  409. void (*setup_dma_gc)(struct sde_hw_pipe *ctx, void *cfg,
  410. enum sde_sspp_multirect_index idx);
  411. /**
  412. * setup_qos_lut - setup danger, safe, creq LUTs
  413. * @ctx: Pointer to pipe context
  414. * @cfg: Pointer to pipe QoS configuration
  415. *
  416. */
  417. void (*setup_qos_lut)(struct sde_hw_pipe *ctx,
  418. struct sde_hw_pipe_qos_cfg *cfg);
  419. /**
  420. * setup_qos_ctrl - setup QoS control
  421. * @ctx: Pointer to pipe context
  422. * @cfg: Pointer to pipe QoS configuration
  423. *
  424. */
  425. void (*setup_qos_ctrl)(struct sde_hw_pipe *ctx,
  426. struct sde_hw_pipe_qos_cfg *cfg);
  427. /**
  428. * setup_histogram - setup histograms
  429. * @ctx: Pointer to pipe context
  430. * @cfg: Pointer to histogram configuration
  431. */
  432. void (*setup_histogram)(struct sde_hw_pipe *ctx,
  433. void *cfg);
  434. /**
  435. * setup_scaler - setup scaler
  436. * @ctx: Pointer to pipe context
  437. * @pipe_cfg: Pointer to pipe configuration
  438. * @pe_cfg: Pointer to pixel extension configuration
  439. * @scaler_cfg: Pointer to scaler configuration
  440. */
  441. void (*setup_scaler)(struct sde_hw_pipe *ctx,
  442. struct sde_hw_pipe_cfg *pipe_cfg,
  443. struct sde_hw_pixel_ext *pe_cfg,
  444. void *scaler_cfg);
  445. /**
  446. * setup_scaler_lut - setup scaler lut
  447. * @buf: Defines structure for reg dma ops on the reg dma buffer.
  448. * @scaler3_cfg: QSEEDv3 configuration
  449. * @offset: Scaler Offset
  450. */
  451. void (*setup_scaler_lut)(struct sde_reg_dma_setup_ops_cfg *buf,
  452. struct sde_hw_scaler3_cfg *scaler3_cfg,
  453. u32 offset);
  454. /**
  455. * setup_pre_downscale - setup pre-downscaler for inline rotation
  456. * @ctx: Pointer to pipe context
  457. * @pre_down: Pointer to pre-downscaler configuration
  458. */
  459. void (*setup_pre_downscale)(struct sde_hw_pipe *ctx,
  460. struct sde_hw_inline_pre_downscale_cfg *pre_down);
  461. /**
  462. * setup_sys_cache - setup system cache configuration
  463. * @ctx: Pointer to pipe context
  464. * @cfg: Pointer to system cache configuration
  465. */
  466. void (*setup_sys_cache)(struct sde_hw_pipe *ctx,
  467. struct sde_hw_pipe_sc_cfg *cfg);
  468. /**
  469. * setup_uidle - set uidle configuration
  470. * @ctx: Pointer to pipe context
  471. * @cfg: Pointer to uidle configuration
  472. * @index: rectangle index in multirect
  473. */
  474. void (*setup_uidle)(struct sde_hw_pipe *ctx,
  475. struct sde_hw_pipe_uidle_cfg *cfg,
  476. enum sde_sspp_multirect_index index);
  477. /**
  478. * setup_uidle_fill_scale - set uidle fill scale factor
  479. * @ctx: Pointer to pipe context
  480. * @cfg: Pointer to uidle configuration
  481. */
  482. void (*setup_uidle_fill_scale)(struct sde_hw_pipe *ctx,
  483. struct sde_hw_pipe_uidle_cfg *cfg);
  484. /**
  485. * setup_ts_prefill - setup prefill traffic shaper
  486. * @ctx: Pointer to pipe context
  487. * @cfg: Pointer to traffic shaper configuration
  488. * @index: rectangle index in multirect
  489. */
  490. void (*setup_ts_prefill)(struct sde_hw_pipe *ctx,
  491. struct sde_hw_pipe_ts_cfg *cfg,
  492. enum sde_sspp_multirect_index index);
  493. /**
  494. * setup_cdp - setup client driven prefetch
  495. * @ctx: Pointer to pipe context
  496. * @cfg: Pointer to cdp configuration
  497. * @index: rectangle index in multirect
  498. */
  499. void (*setup_cdp)(struct sde_hw_pipe *ctx,
  500. struct sde_hw_pipe_cdp_cfg *cfg,
  501. enum sde_sspp_multirect_index index);
  502. /**
  503. * setup_secure_address - setup secureity status of the source address
  504. * @ctx: Pointer to pipe context
  505. * @index: rectangle index in multirect
  506. * @enable: enable content protected buffer state
  507. */
  508. void (*setup_secure_address)(struct sde_hw_pipe *ctx,
  509. enum sde_sspp_multirect_index index,
  510. bool enable);
  511. /**
  512. * set_src_split_order - setup source split order priority
  513. * @ctx: Pointer to pipe context
  514. * @index: rectangle index in multirect
  515. * @enable: enable src split order
  516. */
  517. void (*set_src_split_order)(struct sde_hw_pipe *ctx,
  518. enum sde_sspp_multirect_index index, bool enable);
  519. /**
  520. * setup_inverse_pma - enable/disable alpha unmultiply unit (PMA)
  521. * @ctx: Pointer to pipe context
  522. * @index: Rectangle index in multirect
  523. * @enable: PMA enable/disable settings
  524. */
  525. void (*setup_inverse_pma)(struct sde_hw_pipe *ctx,
  526. enum sde_sspp_multirect_index index, u32 enable);
  527. /**
  528. * setup_dgm_csc - setup DGM color space conversion block and update lut
  529. * @ctx: Pointer to pipe context
  530. * @index: Rectangle index in multirect
  531. * @data: Pointer to config structure
  532. */
  533. void (*setup_dgm_csc)(struct sde_hw_pipe *ctx,
  534. enum sde_sspp_multirect_index index, struct sde_csc_cfg *data);
  535. /**
  536. * clear_meta_error - clear the meta error-code registers
  537. * @ctx: Pointer to pipe context
  538. * @multirect_index: rec in use
  539. */
  540. void (*clear_meta_error)(struct sde_hw_pipe *ctx,
  541. enum sde_sspp_multirect_index multirect_index);
  542. /**
  543. * get_meta_error - get the meta error-code
  544. * @ctx: Pointer to pipe context
  545. * @multirect_index: rec in use
  546. */
  547. u32 (*get_meta_error)(struct sde_hw_pipe *ctx,
  548. enum sde_sspp_multirect_index multirect_index);
  549. /**
  550. * clear_ubwc_error - clear the ubwc error-code registers
  551. * @ctx: Pointer to pipe context
  552. * @multirect_index: rec in use
  553. */
  554. void (*clear_ubwc_error)(struct sde_hw_pipe *ctx,
  555. enum sde_sspp_multirect_index multirect_index);
  556. /**
  557. * get_ubwc_error - get the ubwc error-code
  558. * @ctx: Pointer to pipe context
  559. * @multirect_index: rec in use
  560. */
  561. u32 (*get_ubwc_error)(struct sde_hw_pipe *ctx,
  562. enum sde_sspp_multirect_index multirect_index);
  563. /**
  564. * get_ubwc_stats_data - get ubwc stats data
  565. * @ctx: Pointer to pipe context
  566. * @multirect_index: rec in use
  567. * @data: Pointer to ubwc data to populate
  568. */
  569. void (*get_ubwc_stats_data)(struct sde_hw_pipe *ctx,
  570. enum sde_sspp_multirect_index multirect_index,
  571. struct sde_drm_ubwc_stats_data *data);
  572. /**
  573. * set_ubwc_stats_roi - set ubwc stats roi
  574. * @ctx: Pointer to pipe context
  575. * @multirect_index: rec in use
  576. * @roi: roi to be programmed
  577. */
  578. void (*set_ubwc_stats_roi)(struct sde_hw_pipe *ctx,
  579. enum sde_sspp_multirect_index multirect_index,
  580. struct sde_drm_ubwc_stats_roi *roi);
  581. /**
  582. * setup_fp16_csc - set FP16 CSC cp block
  583. * @ctx: Pointer to pipe object
  584. * @index: Pipe rectangle to operate on
  585. * @data: Pointer to sde_hw_cp_cfg object holding drm_msm_fp16_csc data
  586. */
  587. void (*setup_fp16_csc)(struct sde_hw_pipe *ctx,
  588. enum sde_sspp_multirect_index index, void *data);
  589. /**
  590. * sde_setup_fp16_gcv1 - set FP16 GC cp block
  591. * @ctx: Pointer to pipe object
  592. * @index: Pipe rectangle to operate on
  593. * @data: Pointer to sde_hw_cp_cfg object holding drm_msm_fp16_gc data
  594. */
  595. void (*setup_fp16_gc)(struct sde_hw_pipe *ctx,
  596. enum sde_sspp_multirect_index index, void *data);
  597. /**
  598. * sde_setup_fp16_igcv1 - set FP16 IGC cp block
  599. * @ctx: Pointer to pipe object
  600. * @index: Pipe rectangle to operate on
  601. * @data: Pointer to sde_hw_cp_cfg object containing bool data
  602. */
  603. void (*setup_fp16_igc)(struct sde_hw_pipe *ctx,
  604. enum sde_sspp_multirect_index index, void *data);
  605. /**
  606. * sde_setup_fp16_unmultv1 - set FP16 UNMULT cp block
  607. * @ctx: Pointer to pipe object
  608. * @index: Pipe rectangle to operate on
  609. * @data: Pointer to sde_hw_cp_cfg object containing bool data
  610. */
  611. void (*setup_fp16_unmult)(struct sde_hw_pipe *ctx,
  612. enum sde_sspp_multirect_index index, void *data);
  613. };
  614. /**
  615. * struct sde_hw_pipe - pipe description
  616. * @base: hardware block base structure
  617. * @hw: block hardware details
  618. * @catalog: back pointer to catalog
  619. * @mdp: pointer to associated mdp portion of the catalog
  620. * @idx: pipe index
  621. * @cap: pointer to layer_cfg
  622. * @ops: pointer to operations possible for this pipe
  623. */
  624. struct sde_hw_pipe {
  625. struct sde_hw_blk_reg_map hw;
  626. struct sde_mdss_cfg *catalog;
  627. struct sde_mdp_cfg *mdp;
  628. /* Pipe */
  629. enum sde_sspp idx;
  630. struct sde_sspp_cfg *cap;
  631. /* Ops */
  632. struct sde_hw_sspp_ops ops;
  633. struct sde_hw_ctl *ctl;
  634. };
  635. /**
  636. * sde_hw_sspp_init - initializes the sspp hw driver object.
  637. * Should be called once before accessing every pipe.
  638. * @idx: Pipe index for which driver object is required
  639. * @addr: Mapped register io address of MDP
  640. * @catalog : Pointer to mdss catalog data
  641. * @is_virtual_pipe: is this pipe virtual pipe
  642. * @client: Pointer to VBIF clock client info
  643. */
  644. struct sde_hw_pipe *sde_hw_sspp_init(enum sde_sspp idx,
  645. void __iomem *addr, struct sde_mdss_cfg *catalog,
  646. bool is_virtual_pipe, struct sde_vbif_clk_client *client);
  647. /**
  648. * sde_hw_sspp_destroy(): Destroys SSPP driver context
  649. * should be called during Hw pipe cleanup.
  650. * @ctx: Pointer to SSPP driver context returned by sde_hw_sspp_init
  651. */
  652. void sde_hw_sspp_destroy(struct sde_hw_pipe *ctx);
  653. #endif /*_SDE_HW_SSPP_H */