sde_hw_sspp.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  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_pipe_line_insertion_cfg - line insertion config
  263. * @enable: line insertion is enabled
  264. * @dummy_lines: dummy lines before active lines
  265. * @first_active_lines: number of active lines before first dummy lines
  266. * @active_lines: active lines
  267. * @dst_h: total active lines plus dummy lines
  268. */
  269. struct sde_hw_pipe_line_insertion_cfg {
  270. bool enable;
  271. u32 dummy_lines;
  272. u32 first_active_lines;
  273. u32 active_lines;
  274. u32 dst_h;
  275. };
  276. /**
  277. * struct sde_hw_sspp_ops - interface to the SSPP Hw driver functions
  278. * Caller must call the init function to get the pipe context for each pipe
  279. * Assumption is these functions will be called after clocks are enabled
  280. */
  281. struct sde_hw_sspp_ops {
  282. /**
  283. * setup_format - setup pixel format cropping rectangle, flip
  284. * @ctx: Pointer to pipe context
  285. * @fmt: Pointer to sde_format structure
  286. * @blend_enabled: flag indicating blend enabled or disabled on plane
  287. * @flags: Extra flags for format config
  288. * @index: rectangle index in multirect
  289. */
  290. void (*setup_format)(struct sde_hw_pipe *ctx,
  291. const struct sde_format *fmt,
  292. bool blend_enabled, u32 flags,
  293. enum sde_sspp_multirect_index index);
  294. /**
  295. * setup_rects - setup pipe ROI rectangles
  296. * @ctx: Pointer to pipe context
  297. * @cfg: Pointer to pipe config structure
  298. * @index: rectangle index in multirect
  299. */
  300. void (*setup_rects)(struct sde_hw_pipe *ctx,
  301. struct sde_hw_pipe_cfg *cfg,
  302. enum sde_sspp_multirect_index index);
  303. /**
  304. * setup_pe - setup pipe pixel extension
  305. * @ctx: Pointer to pipe context
  306. * @pe_ext: Pointer to pixel ext settings
  307. */
  308. void (*setup_pe)(struct sde_hw_pipe *ctx,
  309. struct sde_hw_pixel_ext *pe_ext);
  310. /**
  311. * setup_excl_rect - setup pipe exclusion rectangle
  312. * @ctx: Pointer to pipe context
  313. * @excl_rect: Pointer to exclclusion rect structure
  314. * @index: rectangle index in multirect
  315. */
  316. void (*setup_excl_rect)(struct sde_hw_pipe *ctx,
  317. struct sde_rect *excl_rect,
  318. enum sde_sspp_multirect_index index);
  319. /**
  320. * setup_sourceaddress - setup pipe source addresses
  321. * @ctx: Pointer to pipe context
  322. * @cfg: Pointer to pipe config structure
  323. * @index: rectangle index in multirect
  324. */
  325. void (*setup_sourceaddress)(struct sde_hw_pipe *ctx,
  326. struct sde_hw_pipe_cfg *cfg,
  327. enum sde_sspp_multirect_index index);
  328. /* get_sourceaddress - get pipe current source addresses of a plane
  329. * @ctx: Pointer to pipe context
  330. * @is_virtual: If true get address programmed for R1 in multirect
  331. */
  332. u32 (*get_sourceaddress)(struct sde_hw_pipe *ctx, bool is_virtual);
  333. /**
  334. * setup_csc - setup color space conversion
  335. * @ctx: Pointer to pipe context
  336. * @data: Pointer to config structure
  337. */
  338. void (*setup_csc)(struct sde_hw_pipe *ctx, struct sde_csc_cfg *data);
  339. /**
  340. * setup_solidfill - enable/disable colorfill
  341. * @ctx: Pointer to pipe context
  342. * @const_color: Fill color value
  343. * @flags: Pipe flags
  344. * @index: rectangle index in multirect
  345. */
  346. void (*setup_solidfill)(struct sde_hw_pipe *ctx, u32 color,
  347. enum sde_sspp_multirect_index index);
  348. /**
  349. * update_multirect - update multirect configuration
  350. * @ctx: Pointer to pipe context
  351. * @enable: Boolean to indicate enable or disable of given config
  352. * @index: rectangle index in multirect
  353. * @mode: parallel fetch / time multiplex multirect mode
  354. */
  355. void (*update_multirect)(struct sde_hw_pipe *ctx,
  356. bool enable,
  357. enum sde_sspp_multirect_index index,
  358. enum sde_sspp_multirect_mode mode);
  359. /**
  360. * setup_sharpening - setup sharpening
  361. * @ctx: Pointer to pipe context
  362. * @cfg: Pointer to config structure
  363. */
  364. void (*setup_sharpening)(struct sde_hw_pipe *ctx,
  365. struct sde_hw_sharp_cfg *cfg);
  366. /**
  367. * setup_pa_hue(): Setup source hue adjustment
  368. * @ctx: Pointer to pipe context
  369. * @cfg: Pointer to hue data
  370. */
  371. void (*setup_pa_hue)(struct sde_hw_pipe *ctx, void *cfg);
  372. /**
  373. * setup_pa_sat(): Setup source saturation adjustment
  374. * @ctx: Pointer to pipe context
  375. * @cfg: Pointer to saturation data
  376. */
  377. void (*setup_pa_sat)(struct sde_hw_pipe *ctx, void *cfg);
  378. /**
  379. * setup_pa_val(): Setup source value adjustment
  380. * @ctx: Pointer to pipe context
  381. * @cfg: Pointer to value data
  382. */
  383. void (*setup_pa_val)(struct sde_hw_pipe *ctx, void *cfg);
  384. /**
  385. * setup_pa_cont(): Setup source contrast adjustment
  386. * @ctx: Pointer to pipe context
  387. * @cfg: Pointer contrast data
  388. */
  389. void (*setup_pa_cont)(struct sde_hw_pipe *ctx, void *cfg);
  390. /**
  391. * setup_pa_memcolor - setup source color processing
  392. * @ctx: Pointer to pipe context
  393. * @type: Memcolor type (Skin, sky or foliage)
  394. * @cfg: Pointer to memory color config data
  395. */
  396. void (*setup_pa_memcolor)(struct sde_hw_pipe *ctx,
  397. enum sde_memcolor_type type, void *cfg);
  398. /**
  399. * setup_vig_gamut - setup 3D LUT Gamut in VIG pipes
  400. * @ctx: Pointer to pipe context
  401. * @cfg: Pointer to vig gamut data
  402. */
  403. void (*setup_vig_gamut)(struct sde_hw_pipe *ctx, void *cfg);
  404. /**
  405. * setup_vig_igc - setup 1D LUT IGC in VIG pipes
  406. * @ctx: Pointer to pipe context
  407. * @cfg: Pointer to vig igc data
  408. */
  409. void (*setup_vig_igc)(struct sde_hw_pipe *ctx, void *cfg);
  410. /**
  411. * setup_dma_igc - setup 1D LUT IGC in DMA pipes
  412. * @ctx: Pointer to pipe context
  413. * @cfg: Pointer to dma igc data
  414. * @idx: multirect index
  415. */
  416. void (*setup_dma_igc)(struct sde_hw_pipe *ctx, void *cfg,
  417. enum sde_sspp_multirect_index idx);
  418. /**
  419. * setup_dma_gc - setup 1D LUT GC in DMA pipes
  420. * @ctx: Pointer to pipe context
  421. * @cfg: Pointer to dma gc data
  422. * @idx: multirect index
  423. */
  424. void (*setup_dma_gc)(struct sde_hw_pipe *ctx, void *cfg,
  425. enum sde_sspp_multirect_index idx);
  426. /**
  427. * setup_qos_lut - setup danger, safe, creq LUTs
  428. * @ctx: Pointer to pipe context
  429. * @cfg: Pointer to pipe QoS configuration
  430. *
  431. */
  432. void (*setup_qos_lut)(struct sde_hw_pipe *ctx,
  433. struct sde_hw_pipe_qos_cfg *cfg);
  434. /**
  435. * setup_qos_ctrl - setup QoS control
  436. * @ctx: Pointer to pipe context
  437. * @cfg: Pointer to pipe QoS configuration
  438. *
  439. */
  440. void (*setup_qos_ctrl)(struct sde_hw_pipe *ctx,
  441. struct sde_hw_pipe_qos_cfg *cfg);
  442. /**
  443. * setup_histogram - setup histograms
  444. * @ctx: Pointer to pipe context
  445. * @cfg: Pointer to histogram configuration
  446. */
  447. void (*setup_histogram)(struct sde_hw_pipe *ctx,
  448. void *cfg);
  449. /**
  450. * setup_scaler - setup scaler
  451. * @ctx: Pointer to pipe context
  452. * @pipe_cfg: Pointer to pipe configuration
  453. * @pe_cfg: Pointer to pixel extension configuration
  454. * @scaler_cfg: Pointer to scaler configuration
  455. */
  456. void (*setup_scaler)(struct sde_hw_pipe *ctx,
  457. struct sde_hw_pipe_cfg *pipe_cfg,
  458. struct sde_hw_pixel_ext *pe_cfg,
  459. void *scaler_cfg);
  460. /**
  461. * setup_scaler_lut - setup scaler lut
  462. * @buf: Defines structure for reg dma ops on the reg dma buffer.
  463. * @scaler3_cfg: QSEEDv3 configuration
  464. * @offset: Scaler Offset
  465. */
  466. void (*setup_scaler_lut)(struct sde_reg_dma_setup_ops_cfg *buf,
  467. struct sde_hw_scaler3_cfg *scaler3_cfg,
  468. u32 offset);
  469. /**
  470. * setup_pre_downscale - setup pre-downscaler for inline rotation
  471. * @ctx: Pointer to pipe context
  472. * @pre_down: Pointer to pre-downscaler configuration
  473. */
  474. void (*setup_pre_downscale)(struct sde_hw_pipe *ctx,
  475. struct sde_hw_inline_pre_downscale_cfg *pre_down);
  476. /**
  477. * setup_sys_cache - setup system cache configuration
  478. * @ctx: Pointer to pipe context
  479. * @cfg: Pointer to system cache configuration
  480. */
  481. void (*setup_sys_cache)(struct sde_hw_pipe *ctx,
  482. struct sde_hw_pipe_sc_cfg *cfg);
  483. /**
  484. * setup_uidle - set uidle configuration
  485. * @ctx: Pointer to pipe context
  486. * @cfg: Pointer to uidle configuration
  487. * @index: rectangle index in multirect
  488. */
  489. void (*setup_uidle)(struct sde_hw_pipe *ctx,
  490. struct sde_hw_pipe_uidle_cfg *cfg,
  491. enum sde_sspp_multirect_index index);
  492. /**
  493. * setup_uidle_fill_scale - set uidle fill scale factor
  494. * @ctx: Pointer to pipe context
  495. * @cfg: Pointer to uidle configuration
  496. */
  497. void (*setup_uidle_fill_scale)(struct sde_hw_pipe *ctx,
  498. struct sde_hw_pipe_uidle_cfg *cfg);
  499. /**
  500. * setup_ts_prefill - setup prefill traffic shaper
  501. * @ctx: Pointer to pipe context
  502. * @cfg: Pointer to traffic shaper configuration
  503. * @index: rectangle index in multirect
  504. */
  505. void (*setup_ts_prefill)(struct sde_hw_pipe *ctx,
  506. struct sde_hw_pipe_ts_cfg *cfg,
  507. enum sde_sspp_multirect_index index);
  508. /**
  509. * setup_cdp - setup client driven prefetch
  510. * @ctx: Pointer to pipe context
  511. * @cfg: Pointer to cdp configuration
  512. * @index: rectangle index in multirect
  513. */
  514. void (*setup_cdp)(struct sde_hw_pipe *ctx,
  515. struct sde_hw_pipe_cdp_cfg *cfg,
  516. enum sde_sspp_multirect_index index);
  517. /**
  518. * setup_secure_address - setup secureity status of the source address
  519. * @ctx: Pointer to pipe context
  520. * @index: rectangle index in multirect
  521. * @enable: enable content protected buffer state
  522. */
  523. void (*setup_secure_address)(struct sde_hw_pipe *ctx,
  524. enum sde_sspp_multirect_index index,
  525. bool enable);
  526. /**
  527. * set_src_split_order - setup source split order priority
  528. * @ctx: Pointer to pipe context
  529. * @index: rectangle index in multirect
  530. * @enable: enable src split order
  531. */
  532. void (*set_src_split_order)(struct sde_hw_pipe *ctx,
  533. enum sde_sspp_multirect_index index, bool enable);
  534. /**
  535. * setup_inverse_pma - enable/disable alpha unmultiply unit (PMA)
  536. * @ctx: Pointer to pipe context
  537. * @index: Rectangle index in multirect
  538. * @enable: PMA enable/disable settings
  539. */
  540. void (*setup_inverse_pma)(struct sde_hw_pipe *ctx,
  541. enum sde_sspp_multirect_index index, u32 enable);
  542. /**
  543. * setup_dgm_csc - setup DGM color space conversion block and update lut
  544. * @ctx: Pointer to pipe context
  545. * @index: Rectangle index in multirect
  546. * @data: Pointer to config structure
  547. */
  548. void (*setup_dgm_csc)(struct sde_hw_pipe *ctx,
  549. enum sde_sspp_multirect_index index, struct sde_csc_cfg *data);
  550. /**
  551. * clear_meta_error - clear the meta error-code registers
  552. * @ctx: Pointer to pipe context
  553. * @multirect_index: rec in use
  554. */
  555. void (*clear_meta_error)(struct sde_hw_pipe *ctx,
  556. enum sde_sspp_multirect_index multirect_index);
  557. /**
  558. * get_meta_error - get the meta error-code
  559. * @ctx: Pointer to pipe context
  560. * @multirect_index: rec in use
  561. */
  562. u32 (*get_meta_error)(struct sde_hw_pipe *ctx,
  563. enum sde_sspp_multirect_index multirect_index);
  564. /**
  565. * clear_ubwc_error - clear the ubwc error-code registers
  566. * @ctx: Pointer to pipe context
  567. * @multirect_index: rec in use
  568. */
  569. void (*clear_ubwc_error)(struct sde_hw_pipe *ctx,
  570. enum sde_sspp_multirect_index multirect_index);
  571. /**
  572. * get_ubwc_error - get the ubwc error-code
  573. * @ctx: Pointer to pipe context
  574. * @multirect_index: rec in use
  575. */
  576. u32 (*get_ubwc_error)(struct sde_hw_pipe *ctx,
  577. enum sde_sspp_multirect_index multirect_index);
  578. /**
  579. * get_ubwc_stats_data - get ubwc stats data
  580. * @ctx: Pointer to pipe context
  581. * @multirect_index: rec in use
  582. * @data: Pointer to ubwc data to populate
  583. */
  584. void (*get_ubwc_stats_data)(struct sde_hw_pipe *ctx,
  585. enum sde_sspp_multirect_index multirect_index,
  586. struct sde_drm_ubwc_stats_data *data);
  587. /**
  588. * set_ubwc_stats_roi - set ubwc stats roi
  589. * @ctx: Pointer to pipe context
  590. * @multirect_index: rec in use
  591. * @roi: roi to be programmed
  592. */
  593. void (*set_ubwc_stats_roi)(struct sde_hw_pipe *ctx,
  594. enum sde_sspp_multirect_index multirect_index,
  595. struct sde_drm_ubwc_stats_roi *roi);
  596. /**
  597. * setup_fp16_csc - set FP16 CSC cp block
  598. * @ctx: Pointer to pipe object
  599. * @index: Pipe rectangle to operate on
  600. * @data: Pointer to sde_hw_cp_cfg object holding drm_msm_fp16_csc data
  601. */
  602. void (*setup_fp16_csc)(struct sde_hw_pipe *ctx,
  603. enum sde_sspp_multirect_index index, void *data);
  604. /**
  605. * sde_setup_fp16_gcv1 - set FP16 GC cp block
  606. * @ctx: Pointer to pipe object
  607. * @index: Pipe rectangle to operate on
  608. * @data: Pointer to sde_hw_cp_cfg object holding drm_msm_fp16_gc data
  609. */
  610. void (*setup_fp16_gc)(struct sde_hw_pipe *ctx,
  611. enum sde_sspp_multirect_index index, void *data);
  612. /**
  613. * sde_setup_fp16_igcv1 - set FP16 IGC cp block
  614. * @ctx: Pointer to pipe object
  615. * @index: Pipe rectangle to operate on
  616. * @data: Pointer to sde_hw_cp_cfg object containing bool data
  617. */
  618. void (*setup_fp16_igc)(struct sde_hw_pipe *ctx,
  619. enum sde_sspp_multirect_index index, void *data);
  620. /**
  621. * sde_setup_fp16_unmultv1 - set FP16 UNMULT cp block
  622. * @ctx: Pointer to pipe object
  623. * @index: Pipe rectangle to operate on
  624. * @data: Pointer to sde_hw_cp_cfg object containing bool data
  625. */
  626. void (*setup_fp16_unmult)(struct sde_hw_pipe *ctx,
  627. enum sde_sspp_multirect_index index, void *data);
  628. /**
  629. * setup_line_insertion - setup line insertion
  630. * @ctx: Pointer to pipe context
  631. * @cfg: Pointer to line insertion configuration
  632. */
  633. void (*setup_line_insertion)(struct sde_hw_pipe *ctx,
  634. enum sde_sspp_multirect_index index,
  635. struct sde_hw_pipe_line_insertion_cfg *cfg);
  636. };
  637. /**
  638. * struct sde_hw_pipe - pipe description
  639. * @base: hardware block base structure
  640. * @hw: block hardware details
  641. * @catalog: back pointer to catalog
  642. * @mdp: pointer to associated mdp portion of the catalog
  643. * @idx: pipe index
  644. * @cap: pointer to layer_cfg
  645. * @ops: pointer to operations possible for this pipe
  646. */
  647. struct sde_hw_pipe {
  648. struct sde_hw_blk_reg_map hw;
  649. struct sde_mdss_cfg *catalog;
  650. struct sde_mdp_cfg *mdp;
  651. /* Pipe */
  652. enum sde_sspp idx;
  653. struct sde_sspp_cfg *cap;
  654. /* Ops */
  655. struct sde_hw_sspp_ops ops;
  656. struct sde_hw_ctl *ctl;
  657. };
  658. /**
  659. * sde_hw_sspp_init - initializes the sspp hw driver object.
  660. * Should be called once before accessing every pipe.
  661. * @idx: Pipe index for which driver object is required
  662. * @addr: Mapped register io address of MDP
  663. * @catalog : Pointer to mdss catalog data
  664. * @is_virtual_pipe: is this pipe virtual pipe
  665. * @client: Pointer to VBIF clock client info
  666. */
  667. struct sde_hw_pipe *sde_hw_sspp_init(enum sde_sspp idx,
  668. void __iomem *addr, struct sde_mdss_cfg *catalog,
  669. bool is_virtual_pipe, struct sde_vbif_clk_client *client);
  670. /**
  671. * sde_hw_sspp_destroy(): Destroys SSPP driver context
  672. * should be called during Hw pipe cleanup.
  673. * @ctx: Pointer to SSPP driver context returned by sde_hw_sspp_init
  674. */
  675. void sde_hw_sspp_destroy(struct sde_hw_pipe *ctx);
  676. #endif /*_SDE_HW_SSPP_H */