sde_hw_sspp.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _SDE_HW_SSPP_H
  6. #define _SDE_HW_SSPP_H
  7. #include "sde_hw_catalog.h"
  8. #include "sde_hw_mdss.h"
  9. #include "sde_hw_util.h"
  10. #include "sde_reg_dma.h"
  11. #include "sde_hw_blk.h"
  12. #include "sde_formats.h"
  13. #include "sde_color_processing.h"
  14. struct sde_hw_pipe;
  15. /**
  16. * Flags
  17. */
  18. #define SDE_SSPP_SECURE_OVERLAY_SESSION 0x1
  19. #define SDE_SSPP_FLIP_LR 0x2
  20. #define SDE_SSPP_FLIP_UD 0x4
  21. #define SDE_SSPP_SOURCE_ROTATED_90 0x8
  22. #define SDE_SSPP_ROT_90 0x10
  23. #define SDE_SSPP_SOLID_FILL 0x20
  24. #define SDE_SSPP_RIGHT 0x40
  25. /**
  26. * Define all scaler feature bits in catalog
  27. */
  28. #define SDE_SSPP_SCALER ((1UL << SDE_SSPP_SCALER_RGB) | \
  29. (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. * @index: index of the rectangle of SSPP
  146. * @mode: parallel or time multiplex multirect mode
  147. */
  148. struct sde_hw_pipe_cfg {
  149. struct sde_hw_fmt_layout layout;
  150. struct sde_rect src_rect;
  151. struct sde_rect dst_rect;
  152. u8 horz_decimation;
  153. u8 vert_decimation;
  154. enum sde_sspp_multirect_index index;
  155. enum sde_sspp_multirect_mode mode;
  156. };
  157. /**
  158. * struct sde_hw_pipe_qos_cfg : Source pipe QoS configuration
  159. * @danger_lut: LUT for generate danger level based on fill level
  160. * @safe_lut: LUT for generate safe level based on fill level
  161. * @creq_lut: LUT for generate creq level based on fill level
  162. * @creq_vblank: creq value generated to vbif during vertical blanking
  163. * @danger_vblank: danger value generated during vertical blanking
  164. * @vblank_en: enable creq_vblank and danger_vblank during vblank
  165. * @danger_safe_en: enable danger safe generation
  166. */
  167. struct sde_hw_pipe_qos_cfg {
  168. u32 danger_lut;
  169. u32 safe_lut;
  170. u64 creq_lut;
  171. u32 creq_vblank;
  172. u32 danger_vblank;
  173. bool vblank_en;
  174. bool danger_safe_en;
  175. };
  176. /**
  177. * enum CDP preload ahead address size
  178. */
  179. enum {
  180. SDE_SSPP_CDP_PRELOAD_AHEAD_32,
  181. SDE_SSPP_CDP_PRELOAD_AHEAD_64
  182. };
  183. /**
  184. * struct sde_hw_pipe_cdp_cfg : CDP configuration
  185. * @enable: true to enable CDP
  186. * @ubwc_meta_enable: true to enable ubwc metadata preload
  187. * @tile_amortize_enable: true to enable amortization control for tile format
  188. * @preload_ahead: number of request to preload ahead
  189. * SDE_SSPP_CDP_PRELOAD_AHEAD_32,
  190. * SDE_SSPP_CDP_PRELOAD_AHEAD_64
  191. */
  192. struct sde_hw_pipe_cdp_cfg {
  193. bool enable;
  194. bool ubwc_meta_enable;
  195. bool tile_amortize_enable;
  196. u32 preload_ahead;
  197. };
  198. /**
  199. * enum system cache rotation operation mode
  200. */
  201. enum {
  202. SDE_PIPE_SC_OP_MODE_OFFLINE,
  203. SDE_PIPE_SC_OP_MODE_INLINE_SINGLE,
  204. SDE_PIPE_SC_OP_MODE_INLINE_LEFT,
  205. SDE_PIPE_SC_OP_MODE_INLINE_RIGHT,
  206. };
  207. /**
  208. * enum system cache read operation type
  209. */
  210. enum {
  211. SDE_PIPE_SC_RD_OP_TYPE_CACHEABLE,
  212. SDE_PIPE_SC_RD_OP_TYPE_INVALIDATE,
  213. SDE_PIPE_SC_RD_OP_TYPE_EVICTION,
  214. };
  215. /**
  216. * struct sde_hw_pipe_sc_cfg - system cache configuration
  217. * @op_mode: rotation operating mode
  218. * @rd_en: system cache read enable
  219. * @rd_scid: system cache read block id
  220. * @rd_noallocate: system cache read no allocate attribute
  221. * @rd_op_type: system cache read operation type
  222. * @flags: dirty flags to change the configuration
  223. */
  224. struct sde_hw_pipe_sc_cfg {
  225. u32 op_mode;
  226. bool rd_en;
  227. u32 rd_scid;
  228. bool rd_noallocate;
  229. u32 rd_op_type;
  230. u32 flags;
  231. };
  232. /**
  233. * struct sde_hw_pipe_uidle_cfg - uidle configuration
  234. * @enable: disables uidle
  235. * @fal_allowed_threshold: minimum fl to allow uidle
  236. * @fal10_exit_threshold: number of lines to indicate fal_10_exit is okay
  237. * @fal10_threshold: number of lines where fal_10_is okay
  238. * @fal1_threshold: number of lines where fal_1 is okay
  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. };
  247. /**
  248. * struct sde_hw_pipe_ts_cfg - traffic shaper configuration
  249. * @size: size to prefill in bytes, or zero to disable
  250. * @time: time to prefill in usec, or zero to disable
  251. */
  252. struct sde_hw_pipe_ts_cfg {
  253. u64 size;
  254. u64 time;
  255. };
  256. /**
  257. * Maximum number of stream buffer plane
  258. */
  259. #define SDE_PIPE_SBUF_PLANE_NUM 2
  260. /**
  261. * struct sde_hw_sspp_ops - interface to the SSPP Hw driver functions
  262. * Caller must call the init function to get the pipe context for each pipe
  263. * Assumption is these functions will be called after clocks are enabled
  264. */
  265. struct sde_hw_sspp_ops {
  266. /**
  267. * setup_format - setup pixel format cropping rectangle, flip
  268. * @ctx: Pointer to pipe context
  269. * @fmt: Pointer to sde_format structure
  270. * @blend_enabled: flag indicating blend enabled or disabled on plane
  271. * @flags: Extra flags for format config
  272. * @index: rectangle index in multirect
  273. */
  274. void (*setup_format)(struct sde_hw_pipe *ctx,
  275. const struct sde_format *fmt,
  276. bool blend_enabled, u32 flags,
  277. enum sde_sspp_multirect_index index);
  278. /**
  279. * setup_rects - setup pipe ROI rectangles
  280. * @ctx: Pointer to pipe context
  281. * @cfg: Pointer to pipe config structure
  282. * @index: rectangle index in multirect
  283. */
  284. void (*setup_rects)(struct sde_hw_pipe *ctx,
  285. struct sde_hw_pipe_cfg *cfg,
  286. enum sde_sspp_multirect_index index);
  287. /**
  288. * setup_pe - setup pipe pixel extension
  289. * @ctx: Pointer to pipe context
  290. * @pe_ext: Pointer to pixel ext settings
  291. */
  292. void (*setup_pe)(struct sde_hw_pipe *ctx,
  293. struct sde_hw_pixel_ext *pe_ext);
  294. /**
  295. * setup_excl_rect - setup pipe exclusion rectangle
  296. * @ctx: Pointer to pipe context
  297. * @excl_rect: Pointer to exclclusion rect structure
  298. * @index: rectangle index in multirect
  299. */
  300. void (*setup_excl_rect)(struct sde_hw_pipe *ctx,
  301. struct sde_rect *excl_rect,
  302. enum sde_sspp_multirect_index index);
  303. /**
  304. * setup_sourceaddress - setup pipe source addresses
  305. * @ctx: Pointer to pipe context
  306. * @cfg: Pointer to pipe config structure
  307. * @index: rectangle index in multirect
  308. */
  309. void (*setup_sourceaddress)(struct sde_hw_pipe *ctx,
  310. struct sde_hw_pipe_cfg *cfg,
  311. enum sde_sspp_multirect_index index);
  312. /* get_sourceaddress - get pipe current source addresses of a plane
  313. * @ctx: Pointer to pipe context
  314. * @is_virtual: If true get address programmed for R1 in multirect
  315. */
  316. u32 (*get_sourceaddress)(struct sde_hw_pipe *ctx, bool is_virtual);
  317. /**
  318. * setup_csc - setup color space conversion
  319. * @ctx: Pointer to pipe context
  320. * @data: Pointer to config structure
  321. */
  322. void (*setup_csc)(struct sde_hw_pipe *ctx, struct sde_csc_cfg *data);
  323. /**
  324. * setup_solidfill - enable/disable colorfill
  325. * @ctx: Pointer to pipe context
  326. * @const_color: Fill color value
  327. * @flags: Pipe flags
  328. * @index: rectangle index in multirect
  329. */
  330. void (*setup_solidfill)(struct sde_hw_pipe *ctx, u32 color,
  331. enum sde_sspp_multirect_index index);
  332. /**
  333. * setup_multirect - setup multirect configuration
  334. * @ctx: Pointer to pipe context
  335. * @index: rectangle index in multirect
  336. * @mode: parallel fetch / time multiplex multirect mode
  337. */
  338. void (*setup_multirect)(struct sde_hw_pipe *ctx,
  339. enum sde_sspp_multirect_index index,
  340. enum sde_sspp_multirect_mode mode);
  341. /**
  342. * setup_sharpening - setup sharpening
  343. * @ctx: Pointer to pipe context
  344. * @cfg: Pointer to config structure
  345. */
  346. void (*setup_sharpening)(struct sde_hw_pipe *ctx,
  347. struct sde_hw_sharp_cfg *cfg);
  348. /**
  349. * setup_pa_hue(): Setup source hue adjustment
  350. * @ctx: Pointer to pipe context
  351. * @cfg: Pointer to hue data
  352. */
  353. void (*setup_pa_hue)(struct sde_hw_pipe *ctx, void *cfg);
  354. /**
  355. * setup_pa_sat(): Setup source saturation adjustment
  356. * @ctx: Pointer to pipe context
  357. * @cfg: Pointer to saturation data
  358. */
  359. void (*setup_pa_sat)(struct sde_hw_pipe *ctx, void *cfg);
  360. /**
  361. * setup_pa_val(): Setup source value adjustment
  362. * @ctx: Pointer to pipe context
  363. * @cfg: Pointer to value data
  364. */
  365. void (*setup_pa_val)(struct sde_hw_pipe *ctx, void *cfg);
  366. /**
  367. * setup_pa_cont(): Setup source contrast adjustment
  368. * @ctx: Pointer to pipe context
  369. * @cfg: Pointer contrast data
  370. */
  371. void (*setup_pa_cont)(struct sde_hw_pipe *ctx, void *cfg);
  372. /**
  373. * setup_pa_memcolor - setup source color processing
  374. * @ctx: Pointer to pipe context
  375. * @type: Memcolor type (Skin, sky or foliage)
  376. * @cfg: Pointer to memory color config data
  377. */
  378. void (*setup_pa_memcolor)(struct sde_hw_pipe *ctx,
  379. enum sde_memcolor_type type, void *cfg);
  380. /**
  381. * setup_vig_gamut - setup 3D LUT Gamut in VIG pipes
  382. * @ctx: Pointer to pipe context
  383. * @cfg: Pointer to vig gamut data
  384. */
  385. void (*setup_vig_gamut)(struct sde_hw_pipe *ctx, void *cfg);
  386. /**
  387. * setup_vig_igc - setup 1D LUT IGC in VIG pipes
  388. * @ctx: Pointer to pipe context
  389. * @cfg: Pointer to vig igc data
  390. */
  391. void (*setup_vig_igc)(struct sde_hw_pipe *ctx, void *cfg);
  392. /**
  393. * setup_dma_igc - setup 1D LUT IGC in DMA pipes
  394. * @ctx: Pointer to pipe context
  395. * @cfg: Pointer to dma igc data
  396. * @idx: multirect index
  397. */
  398. void (*setup_dma_igc)(struct sde_hw_pipe *ctx, void *cfg,
  399. enum sde_sspp_multirect_index idx);
  400. /**
  401. * setup_dma_gc - setup 1D LUT GC in DMA pipes
  402. * @ctx: Pointer to pipe context
  403. * @cfg: Pointer to dma gc data
  404. * @idx: multirect index
  405. */
  406. void (*setup_dma_gc)(struct sde_hw_pipe *ctx, void *cfg,
  407. enum sde_sspp_multirect_index idx);
  408. /**
  409. * setup_danger_safe_lut - setup danger safe LUTs
  410. * @ctx: Pointer to pipe context
  411. * @cfg: Pointer to pipe QoS configuration
  412. *
  413. */
  414. void (*setup_danger_safe_lut)(struct sde_hw_pipe *ctx,
  415. struct sde_hw_pipe_qos_cfg *cfg);
  416. /**
  417. * setup_creq_lut - setup CREQ LUT
  418. * @ctx: Pointer to pipe context
  419. * @cfg: Pointer to pipe QoS configuration
  420. *
  421. */
  422. void (*setup_creq_lut)(struct sde_hw_pipe *ctx,
  423. struct sde_hw_pipe_qos_cfg *cfg);
  424. /**
  425. * setup_qos_ctrl - setup QoS control
  426. * @ctx: Pointer to pipe context
  427. * @cfg: Pointer to pipe QoS configuration
  428. *
  429. */
  430. void (*setup_qos_ctrl)(struct sde_hw_pipe *ctx,
  431. struct sde_hw_pipe_qos_cfg *cfg);
  432. /**
  433. * setup_histogram - setup histograms
  434. * @ctx: Pointer to pipe context
  435. * @cfg: Pointer to histogram configuration
  436. */
  437. void (*setup_histogram)(struct sde_hw_pipe *ctx,
  438. void *cfg);
  439. /**
  440. * setup_scaler - setup scaler
  441. * @ctx: Pointer to pipe context
  442. * @pipe_cfg: Pointer to pipe configuration
  443. * @pe_cfg: Pointer to pixel extension configuration
  444. * @scaler_cfg: Pointer to scaler configuration
  445. */
  446. void (*setup_scaler)(struct sde_hw_pipe *ctx,
  447. struct sde_hw_pipe_cfg *pipe_cfg,
  448. struct sde_hw_pixel_ext *pe_cfg,
  449. void *scaler_cfg);
  450. /**
  451. * setup_scaler_lut - setup scaler lut
  452. * @buf: Defines structure for reg dma ops on the reg dma buffer.
  453. * @scaler3_cfg: QSEEDv3 configuration
  454. * @offset: Scaler Offset
  455. */
  456. void (*setup_scaler_lut)(struct sde_reg_dma_setup_ops_cfg *buf,
  457. struct sde_hw_scaler3_cfg *scaler3_cfg,
  458. u32 offset);
  459. /**
  460. * get_scaler_ver - get scaler h/w version
  461. * @ctx: Pointer to pipe context
  462. */
  463. u32 (*get_scaler_ver)(struct sde_hw_pipe *ctx);
  464. /**
  465. * setup_sys_cache - setup system cache configuration
  466. * @ctx: Pointer to pipe context
  467. * @cfg: Pointer to system cache configuration
  468. */
  469. void (*setup_sys_cache)(struct sde_hw_pipe *ctx,
  470. struct sde_hw_pipe_sc_cfg *cfg);
  471. /**
  472. * setup_uidle - set uidle configuration
  473. * @ctx: Pointer to pipe context
  474. * @cfg: Pointer to uidle configuration
  475. * @index: rectangle index in multirect
  476. */
  477. void (*setup_uidle)(struct sde_hw_pipe *ctx,
  478. struct sde_hw_pipe_uidle_cfg *cfg,
  479. enum sde_sspp_multirect_index index);
  480. /**
  481. * setup_ts_prefill - setup prefill traffic shaper
  482. * @ctx: Pointer to pipe context
  483. * @cfg: Pointer to traffic shaper configuration
  484. * @index: rectangle index in multirect
  485. */
  486. void (*setup_ts_prefill)(struct sde_hw_pipe *ctx,
  487. struct sde_hw_pipe_ts_cfg *cfg,
  488. enum sde_sspp_multirect_index index);
  489. /**
  490. * setup_cdp - setup client driven prefetch
  491. * @ctx: Pointer to pipe context
  492. * @cfg: Pointer to cdp configuration
  493. * @index: rectangle index in multirect
  494. */
  495. void (*setup_cdp)(struct sde_hw_pipe *ctx,
  496. struct sde_hw_pipe_cdp_cfg *cfg,
  497. enum sde_sspp_multirect_index index);
  498. /**
  499. * setup_secure_address - setup secureity status of the source address
  500. * @ctx: Pointer to pipe context
  501. * @index: rectangle index in multirect
  502. * @enable: enable content protected buffer state
  503. */
  504. void (*setup_secure_address)(struct sde_hw_pipe *ctx,
  505. enum sde_sspp_multirect_index index,
  506. bool enable);
  507. /**
  508. * set_src_split_order - setup source split order priority
  509. * @ctx: Pointer to pipe context
  510. * @index: rectangle index in multirect
  511. * @enable: enable src split order
  512. */
  513. void (*set_src_split_order)(struct sde_hw_pipe *ctx,
  514. enum sde_sspp_multirect_index index, bool enable);
  515. /**
  516. * setup_inverse_pma - enable/disable alpha unmultiply unit (PMA)
  517. * @ctx: Pointer to pipe context
  518. * @index: Rectangle index in multirect
  519. * @enable: PMA enable/disable settings
  520. */
  521. void (*setup_inverse_pma)(struct sde_hw_pipe *ctx,
  522. enum sde_sspp_multirect_index index, u32 enable);
  523. /**
  524. * setup_dgm_csc - setup DGM color space conversion block and update lut
  525. * @ctx: Pointer to pipe context
  526. * @index: Rectangle index in multirect
  527. * @data: Pointer to config structure
  528. */
  529. void (*setup_dgm_csc)(struct sde_hw_pipe *ctx,
  530. enum sde_sspp_multirect_index index, struct sde_csc_cfg *data);
  531. /**
  532. * clear_ubwc_error - clear the ubwc error-code registers
  533. * @ctx: Pointer to pipe context
  534. */
  535. void (*clear_ubwc_error)(struct sde_hw_pipe *ctx);
  536. /**
  537. * get_ubwc_error - get the ubwc error-code
  538. * @ctx: Pointer to pipe context
  539. */
  540. u32 (*get_ubwc_error)(struct sde_hw_pipe *ctx);
  541. };
  542. /**
  543. * struct sde_hw_pipe - pipe description
  544. * @base: hardware block base structure
  545. * @hw: block hardware details
  546. * @catalog: back pointer to catalog
  547. * @mdp: pointer to associated mdp portion of the catalog
  548. * @idx: pipe index
  549. * @cap: pointer to layer_cfg
  550. * @ops: pointer to operations possible for this pipe
  551. */
  552. struct sde_hw_pipe {
  553. struct sde_hw_blk base;
  554. struct sde_hw_blk_reg_map hw;
  555. struct sde_mdss_cfg *catalog;
  556. struct sde_mdp_cfg *mdp;
  557. /* Pipe */
  558. enum sde_sspp idx;
  559. struct sde_sspp_cfg *cap;
  560. /* Ops */
  561. struct sde_hw_sspp_ops ops;
  562. struct sde_hw_ctl *ctl;
  563. };
  564. /**
  565. * sde_hw_pipe - convert base object sde_hw_base to container
  566. * @hw: Pointer to base hardware block
  567. * return: Pointer to hardware block container
  568. */
  569. static inline struct sde_hw_pipe *to_sde_hw_pipe(struct sde_hw_blk *hw)
  570. {
  571. return container_of(hw, struct sde_hw_pipe, base);
  572. }
  573. /**
  574. * sde_hw_sspp_init - initializes the sspp hw driver object.
  575. * Should be called once before accessing every pipe.
  576. * @idx: Pipe index for which driver object is required
  577. * @addr: Mapped register io address of MDP
  578. * @catalog : Pointer to mdss catalog data
  579. * @is_virtual_pipe: is this pipe virtual pipe
  580. */
  581. struct sde_hw_pipe *sde_hw_sspp_init(enum sde_sspp idx,
  582. void __iomem *addr, struct sde_mdss_cfg *catalog,
  583. bool is_virtual_pipe);
  584. /**
  585. * sde_hw_sspp_destroy(): Destroys SSPP driver context
  586. * should be called during Hw pipe cleanup.
  587. * @ctx: Pointer to SSPP driver context returned by sde_hw_sspp_init
  588. */
  589. void sde_hw_sspp_destroy(struct sde_hw_pipe *ctx);
  590. #endif /*_SDE_HW_SSPP_H */