sde_hw_ctl.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  5. */
  6. #ifndef _SDE_HW_CTL_H
  7. #define _SDE_HW_CTL_H
  8. #include "sde_hw_mdss.h"
  9. #include "sde_hw_util.h"
  10. #include "sde_hw_catalog.h"
  11. #include "sde_hw_sspp.h"
  12. #include "sde_fence.h"
  13. #define INVALID_CTL_STATUS 0xfffff88e
  14. #define CTL_MAX_DSPP_COUNT (DSPP_MAX - DSPP_0)
  15. /**
  16. * sde_ctl_mode_sel: Interface mode selection
  17. * SDE_CTL_MODE_SEL_VID: Video mode interface
  18. * SDE_CTL_MODE_SEL_CMD: Command mode interface
  19. */
  20. enum sde_ctl_mode_sel {
  21. SDE_CTL_MODE_SEL_VID = 0,
  22. SDE_CTL_MODE_SEL_CMD
  23. };
  24. /**
  25. * sde_ctl_rot_op_mode - inline rotation mode
  26. * SDE_CTL_ROT_OP_MODE_OFFLINE: offline rotation
  27. * SDE_CTL_ROT_OP_MODE_RESERVED: reserved
  28. * SDE_CTL_ROT_OP_MODE_INLINE_SYNC: inline rotation synchronous mode
  29. * SDE_CTL_ROT_OP_MODE_INLINE_ASYNC: inline rotation asynchronous mode
  30. */
  31. enum sde_ctl_rot_op_mode {
  32. SDE_CTL_ROT_OP_MODE_OFFLINE,
  33. SDE_CTL_ROT_OP_MODE_RESERVED,
  34. SDE_CTL_ROT_OP_MODE_INLINE_SYNC,
  35. SDE_CTL_ROT_OP_MODE_INLINE_ASYNC,
  36. };
  37. /**
  38. * ctl_hw_flush_type - active ctl hw types
  39. * SDE_HW_FLUSH_WB: WB block
  40. * SDE_HW_FLUSH_DSC: DSC block
  41. * SDE_HW_FLUSH_VDC: VDC bits of DSC block
  42. * SDE_HW_FLUSH_MERGE_3D: Merge 3D block
  43. * SDE_HW_FLUSH_CDM: CDM block
  44. * SDE_HW_FLUSH_CWB: CWB block
  45. * SDE_HW_FLUSH_PERIPH: Peripheral
  46. * SDE_HW_FLUSH_INTF: Interface
  47. */
  48. enum ctl_hw_flush_type {
  49. SDE_HW_FLUSH_WB,
  50. SDE_HW_FLUSH_DSC,
  51. SDE_HW_FLUSH_VDC,
  52. SDE_HW_FLUSH_MERGE_3D,
  53. SDE_HW_FLUSH_CDM,
  54. SDE_HW_FLUSH_CWB,
  55. SDE_HW_FLUSH_PERIPH,
  56. SDE_HW_FLUSH_INTF,
  57. SDE_HW_FLUSH_MAX
  58. };
  59. struct sde_hw_ctl;
  60. /**
  61. * struct sde_hw_stage_cfg - blending stage cfg
  62. * @stage : SSPP_ID at each stage
  63. * @multirect_index: index of the rectangle of SSPP.
  64. */
  65. struct sde_hw_stage_cfg {
  66. enum sde_sspp stage[SDE_STAGE_MAX][PIPES_PER_STAGE];
  67. enum sde_sspp_multirect_index multirect_index
  68. [SDE_STAGE_MAX][PIPES_PER_STAGE];
  69. };
  70. /**
  71. * struct sde_hw_intf_cfg :Describes how the SDE writes data to output interface
  72. * @intf : Interface id
  73. * @wb: Writeback id
  74. * @mode_3d: 3d mux configuration
  75. * @intf_mode_sel: Interface mode, cmd / vid
  76. * @stream_sel: Stream selection for multi-stream interfaces
  77. */
  78. struct sde_hw_intf_cfg {
  79. enum sde_intf intf;
  80. enum sde_wb wb;
  81. enum sde_3d_blend_mode mode_3d;
  82. enum sde_ctl_mode_sel intf_mode_sel;
  83. int stream_sel;
  84. };
  85. /**
  86. * struct sde_hw_intf_cfg_v1 :Describes the data strcuture to configure the
  87. * output interfaces for a particular display on a
  88. * platform which supports ctl path version 1.
  89. * @intf_count: No. of active interfaces for this display
  90. * @intf : Interface ids of active interfaces
  91. * @intf_mode_sel: Interface mode, cmd / vid
  92. * @intf_master: Master interface for split display
  93. * @wb_count: No. of active writebacks
  94. * @wb: Writeback ids of active writebacks
  95. * @merge_3d_count No. of active merge_3d blocks
  96. * @merge_3d: Id of the active merge 3d blocks
  97. * @cwb_count: No. of active concurrent writebacks
  98. * @cwb: Id of active cwb blocks
  99. * @cdm_count: No. of active chroma down module
  100. * @cdm: Id of active cdm blocks
  101. * @dsc_count: No. of active dsc blocks
  102. * @dsc: Id of active dsc blocks
  103. * @vdc_count: No. of active vdc blocks
  104. * @vdc: Id of active vdc blocks
  105. * @dnsc_blur_count: No. of active downscale blur blocks
  106. * @dnsc_blur: Id of active downscale blur blocks
  107. */
  108. struct sde_hw_intf_cfg_v1 {
  109. uint32_t intf_count;
  110. enum sde_intf intf[MAX_INTF_PER_CTL_V1];
  111. enum sde_ctl_mode_sel intf_mode_sel;
  112. enum sde_intf intf_master;
  113. uint32_t wb_count;
  114. enum sde_wb wb[MAX_WB_PER_CTL_V1];
  115. uint32_t merge_3d_count;
  116. enum sde_merge_3d merge_3d[MAX_MERGE_3D_PER_CTL_V1];
  117. uint32_t cwb_count;
  118. enum sde_cwb cwb[MAX_CWB_PER_CTL_V1];
  119. uint32_t cdm_count;
  120. enum sde_cdm cdm[MAX_CDM_PER_CTL_V1];
  121. uint32_t dsc_count;
  122. enum sde_dsc dsc[MAX_DSC_PER_CTL_V1];
  123. uint32_t vdc_count;
  124. enum sde_vdc vdc[MAX_VDC_PER_CTL_V1];
  125. uint32_t dnsc_blur_count;
  126. enum sde_dnsc_blur dnsc_blur[MAX_VDC_PER_CTL_V1];
  127. };
  128. /**
  129. * struct sde_ctl_flush_cfg - struct describing flush configuration managed
  130. * via set, trigger and clear ops.
  131. * set ops corresponding to the hw_block is called, when the block's
  132. * configuration is changed and needs to be committed on Hw. Flush mask caches
  133. * the different bits for the ongoing commit.
  134. * clear ops clears the bitmask and cancels the update to the corresponding
  135. * hw block.
  136. * trigger op will trigger the update on the hw for the blocks cached in the
  137. * pending flush mask.
  138. *
  139. * @pending_flush_mask: pending ctl_flush
  140. * CTL path version SDE_CTL_CFG_VERSION_1_0_0 has * two level flush mechanism
  141. * for lower pipe controls. individual control should be flushed before
  142. * exercising top level flush
  143. * @pending_hw_flush_mask: pending flush mask for each active HW blk
  144. * @pending_dspp_flush_masks: pending flush masks for sub-blks of each DSPP
  145. */
  146. struct sde_ctl_flush_cfg {
  147. u32 pending_flush_mask;
  148. u32 pending_hw_flush_mask[SDE_HW_FLUSH_MAX];
  149. u32 pending_dspp_flush_masks[CTL_MAX_DSPP_COUNT];
  150. };
  151. /**
  152. * struct sde_hw_ctl_ops - Interface to the wb Hw driver functions
  153. * Assumption is these functions will be called after clocks are enabled
  154. */
  155. struct sde_hw_ctl_ops {
  156. /**
  157. * hw fence control
  158. * @ctx : ctl path ctx pointer
  159. */
  160. void (*hw_fence_ctrl)(struct sde_hw_ctl *ctx, bool sw_set, bool sw_clear, u32 mode);
  161. /**
  162. * override to trigger the signal for the output hw-fence
  163. * @ctx : ctl path ctx pointer
  164. */
  165. void (*trigger_output_fence_override)(struct sde_hw_ctl *ctx);
  166. /**
  167. * trigger hw fence fence-ready sw override
  168. * @ctx : ctl path ctx pointer
  169. */
  170. void (*hw_fence_trigger_sw_override)(struct sde_hw_ctl *ctx);
  171. /**
  172. * enable or clear hw fence output fence timestamps
  173. * @ctx : ctl path ctx pointer
  174. * @enable : indicates if timestamps should be enabled
  175. * @clear : indicates if timestamps should be cleared
  176. */
  177. void (*hw_fence_output_timestamp_ctrl)(struct sde_hw_ctl *ctx, bool enable, bool clear);
  178. /**
  179. * get hw fence output fence timestamps and clear them
  180. * @ctx : ctl path ctx pointer
  181. * @val_start : pointer to start timestamp value
  182. * @val_end : pointer to end timestamp value
  183. * @Return: error code
  184. */
  185. int (*hw_fence_output_status)(struct sde_hw_ctl *ctx, u64 *val_start, u64 *val_end);
  186. /**
  187. * configure output hw fence trigger
  188. * @ctx : ctl path ctx pointer
  189. * @trigger_sel : select upon which event the output trigger will happen
  190. */
  191. void (*hw_fence_trigger_output_fence)(struct sde_hw_ctl *ctx, u32 trigger_sel);
  192. /**
  193. * get hw fence status
  194. * @ctx : ctl path ctx pointer
  195. * @Return: fence status
  196. */
  197. int (*get_hw_fence_status)(struct sde_hw_ctl *ctx);
  198. /**
  199. * update output hw fence ipcc client_id and signal_id
  200. * @ctx : ctl path ctx pointer
  201. * @client_id : value to write to update the client_id
  202. * @signal_id : value to write to update the signal_id
  203. */
  204. void (*hw_fence_update_output_fence)(struct sde_hw_ctl *ctx, u32 client_id, u32 signal_id);
  205. /**
  206. * update address, data size, and mask values for output fence direct writes
  207. * @ctx : ctl path ctx pointer
  208. * @addr : address value to write
  209. * @size : size value to write
  210. * @mask : mask value to write
  211. */
  212. void (*hw_fence_output_fence_dir_write_init)(struct sde_hw_ctl *ctx, u32 *addr, u32 size,
  213. u32 mask);
  214. /**
  215. * update data value for output_fence direct writes
  216. * @ctx : ctl path ctx pointer
  217. * @data : data value to write
  218. */
  219. void (*hw_fence_output_fence_dir_write_data)(struct sde_hw_ctl *ctx, u32 data);
  220. /**
  221. * update input hw fence ipcc client_id and signal_id
  222. * @ctx : ctl path ctx pointer
  223. * @client_id : value to write to update the client_id
  224. * @signal_id : value to write to update the signal_id
  225. */
  226. void (*hw_fence_update_input_fence)(struct sde_hw_ctl *ctx, u32 client_id, u32 signal_id);
  227. /**
  228. * kickoff hw operation for Sw controlled interfaces
  229. * DSI cmd mode and WB interface are SW controlled
  230. * @ctx : ctl path ctx pointer
  231. * @Return: error code
  232. */
  233. int (*trigger_start)(struct sde_hw_ctl *ctx);
  234. /**
  235. * kickoff prepare is in progress hw operation for sw
  236. * controlled interfaces: DSI cmd mode and WB interface
  237. * are SW controlled
  238. * @ctx : ctl path ctx pointer
  239. * @Return: error code
  240. */
  241. int (*trigger_pending)(struct sde_hw_ctl *ctx);
  242. /**
  243. * kickoff rotator operation for Sw controlled interfaces
  244. * DSI cmd mode and WB interface are SW controlled
  245. * @ctx : ctl path ctx pointer
  246. * @Return: error code
  247. */
  248. int (*trigger_rot_start)(struct sde_hw_ctl *ctx);
  249. /**
  250. * enable/disable UIDLE feature
  251. * @ctx : ctl path ctx pointer
  252. * @enable: true to enable the feature
  253. */
  254. void (*uidle_enable)(struct sde_hw_ctl *ctx, bool enable);
  255. /**
  256. * Clear the value of the cached pending_flush_mask
  257. * No effect on hardware
  258. * @ctx : ctl path ctx pointer
  259. * @Return: error code
  260. */
  261. int (*clear_pending_flush)(struct sde_hw_ctl *ctx);
  262. /**
  263. * Query the value of the cached pending_flush_mask
  264. * No effect on hardware
  265. * @ctx : ctl path ctx pointer
  266. * @cfg : current flush configuration
  267. * @Return: error code
  268. */
  269. int (*get_pending_flush)(struct sde_hw_ctl *ctx,
  270. struct sde_ctl_flush_cfg *cfg);
  271. /**
  272. * OR in the given flushbits to the flush_cfg
  273. * No effect on hardware
  274. * @ctx : ctl path ctx pointer
  275. * @cfg : flush configuration pointer
  276. * @Return: error code
  277. */
  278. int (*update_pending_flush)(struct sde_hw_ctl *ctx,
  279. struct sde_ctl_flush_cfg *cfg);
  280. /**
  281. * Write the value of the pending_flush_mask to hardware
  282. * @ctx : ctl path ctx pointer
  283. * @Return: error code
  284. */
  285. int (*trigger_flush)(struct sde_hw_ctl *ctx);
  286. /**
  287. * Read the value of the flush register
  288. * @ctx : ctl path ctx pointer
  289. * @Return: value of the ctl flush register.
  290. */
  291. u32 (*get_flush_register)(struct sde_hw_ctl *ctx);
  292. /**
  293. * Setup ctl_path interface config
  294. * @ctx
  295. * @cfg : interface config structure pointer
  296. * @Return: error code
  297. */
  298. int (*setup_intf_cfg)(struct sde_hw_ctl *ctx,
  299. struct sde_hw_intf_cfg *cfg);
  300. /**
  301. * Reset ctl_path interface config
  302. * @ctx : ctl path ctx pointer
  303. * @cfg : interface config structure pointer
  304. * @merge_3d_idx : index of merge3d blk
  305. * @Return: error code
  306. */
  307. int (*reset_post_disable)(struct sde_hw_ctl *ctx,
  308. struct sde_hw_intf_cfg_v1 *cfg, u32 merge_3d_idx);
  309. /** update cwb for ctl_path
  310. * @ctx : ctl path ctx pointer
  311. * @cfg : interface config structure pointer
  312. * @enable : enable/disable the dynamic sub-blocks in interface cfg
  313. * @Return: error code
  314. */
  315. int (*update_intf_cfg)(struct sde_hw_ctl *ctx,
  316. struct sde_hw_intf_cfg_v1 *cfg, bool enable);
  317. /**
  318. * Setup ctl_path interface config for SDE_CTL_ACTIVE_CFG
  319. * @ctx : ctl path ctx pointer
  320. * @cfg : interface config structure pointer
  321. * @Return: error code
  322. */
  323. int (*setup_intf_cfg_v1)(struct sde_hw_ctl *ctx,
  324. struct sde_hw_intf_cfg_v1 *cfg);
  325. /**
  326. * Update the interface selection with input WB config
  327. * @ctx : ctl path ctx pointer
  328. * @cfg : pointer to input wb config
  329. * @enable : set if true, clear otherwise
  330. */
  331. void (*update_wb_cfg)(struct sde_hw_ctl *ctx,
  332. struct sde_hw_intf_cfg *cfg, bool enable);
  333. int (*reset)(struct sde_hw_ctl *c);
  334. /**
  335. * get_reset - check ctl reset status bit
  336. * @ctx : ctl path ctx pointer
  337. * Returns: current value of ctl reset status
  338. */
  339. u32 (*get_reset)(struct sde_hw_ctl *ctx);
  340. /**
  341. * get_scheduler_reset - check ctl scheduler status bit
  342. * @ctx : ctl path ctx pointer
  343. * Returns: current value of ctl scheduler and idle status
  344. */
  345. u32 (*get_scheduler_status)(struct sde_hw_ctl *ctx);
  346. /**
  347. * hard_reset - force reset on ctl_path
  348. * @ctx : ctl path ctx pointer
  349. * @enable : whether to enable/disable hard reset
  350. */
  351. void (*hard_reset)(struct sde_hw_ctl *c, bool enable);
  352. /*
  353. * wait_reset_status - checks ctl reset status
  354. * @ctx : ctl path ctx pointer
  355. *
  356. * This function checks the ctl reset status bit.
  357. * If the reset bit is set, it keeps polling the status till the hw
  358. * reset is complete.
  359. * Returns: 0 on success or -error if reset incomplete within interval
  360. */
  361. int (*wait_reset_status)(struct sde_hw_ctl *ctx);
  362. /**
  363. * update_bitmask_sspp: updates mask corresponding to sspp
  364. * @blk : blk id
  365. * @enable : true to enable, 0 to disable
  366. */
  367. int (*update_bitmask_sspp)(struct sde_hw_ctl *ctx,
  368. enum sde_sspp blk, bool enable);
  369. /**
  370. * update_bitmask_mixer: updates mask corresponding to mixer
  371. * @blk : blk id
  372. * @enable : true to enable, 0 to disable
  373. */
  374. int (*update_bitmask_mixer)(struct sde_hw_ctl *ctx,
  375. enum sde_lm blk, bool enable);
  376. /**
  377. * update_bitmask_dspp: updates mask corresponding to dspp
  378. * @blk : blk id
  379. * @enable : true to enable, 0 to disable
  380. */
  381. int (*update_bitmask_dspp)(struct sde_hw_ctl *ctx,
  382. enum sde_dspp blk, bool enable);
  383. /**
  384. * update_bitmask_dspp_pavlut: updates mask corresponding to dspp pav
  385. * @blk : blk id
  386. * @enable : true to enable, 0 to disable
  387. */
  388. int (*update_bitmask_dspp_pavlut)(struct sde_hw_ctl *ctx,
  389. enum sde_dspp blk, bool enable);
  390. /**
  391. * Program DSPP sub block specific bit of dspp flush register.
  392. * @ctx : ctl path ctx pointer
  393. * @dspp : HW block ID of dspp block
  394. * @sub_blk : enum of DSPP sub block to flush
  395. * @enable : true to enable, 0 to disable
  396. *
  397. * This API is for CTL with DSPP flush hierarchy registers.
  398. */
  399. int (*update_bitmask_dspp_subblk)(struct sde_hw_ctl *ctx,
  400. enum sde_dspp dspp, u32 sub_blk, bool enable);
  401. /**
  402. * update_bitmask_sspp: updates mask corresponding to sspp
  403. * @blk : blk id
  404. * @enable : true to enable, 0 to disable
  405. */
  406. int (*update_bitmask_rot)(struct sde_hw_ctl *ctx,
  407. enum sde_rot blk, bool enable);
  408. /**
  409. * update_bitmask: updates flush mask
  410. * @type : blk type to flush
  411. * @blk_idx : blk idx
  412. * @enable : true to enable, 0 to disable
  413. */
  414. int (*update_bitmask)(struct sde_hw_ctl *ctx,
  415. enum ctl_hw_flush_type type, u32 blk_idx, bool enable);
  416. /**
  417. * update_dnsc_blur_bitmask: updates dnsc_blur flush mask
  418. * @type : blk type to flush
  419. * @blk_idx : blk idx
  420. * @enable : true to enable, 0 to disable
  421. */
  422. void (*update_dnsc_blur_bitmask)(struct sde_hw_ctl *ctx, u32 blk_idx, bool enable);
  423. /**
  424. * get interfaces for the active CTL .
  425. * @ctx : ctl path ctx pointer
  426. * @return : bit mask with the active interfaces for the CTL
  427. */
  428. u32 (*get_ctl_intf)(struct sde_hw_ctl *ctx);
  429. /**
  430. * read CTL layers register value and return
  431. * the data.
  432. * @ctx : ctl path ctx pointer
  433. * @index : layer index for this ctl path
  434. * @return : CTL layers register value
  435. */
  436. u32 (*read_ctl_layers)(struct sde_hw_ctl *ctx, int index);
  437. /**
  438. * read active register configuration for this block
  439. * @ctx : ctl path ctx pointer
  440. * @blk : hw blk type, supported blocks are DSC, MERGE_3D, INTF,
  441. * CDM, WB
  442. * @index : blk index
  443. * @return : true if blk at idx is active or false
  444. */
  445. bool (*read_active_status)(struct sde_hw_ctl *ctx,
  446. enum sde_hw_blk_type blk, int index);
  447. /**
  448. * Set all blend stages to disabled
  449. * @ctx : ctl path ctx pointer
  450. */
  451. void (*clear_all_blendstages)(struct sde_hw_ctl *ctx);
  452. /**
  453. * Configure layer mixer to pipe configuration
  454. * @ctx : ctl path ctx pointer
  455. * @lm : layer mixer enumeration
  456. * @cfg : blend stage configuration
  457. * @disable_border: if true disable border, else enable border out
  458. */
  459. void (*setup_blendstage)(struct sde_hw_ctl *ctx,
  460. enum sde_lm lm, struct sde_hw_stage_cfg *cfg,
  461. bool disable_border);
  462. /**
  463. * Get all the sspp staged on a layer mixer
  464. * @ctx : ctl path ctx pointer
  465. * @lm : layer mixer enumeration
  466. * @info : structure to populate connected sspp index info
  467. * @Return: count of sspps info elements populated
  468. */
  469. u32 (*get_staged_sspp)(struct sde_hw_ctl *ctx, enum sde_lm lm,
  470. struct sde_sspp_index_info *info);
  471. /**
  472. * Flush the reg dma by sending last command.
  473. * @ctx : ctl path ctx pointer
  474. * @blocking : if set to true api will block until flush is done
  475. * @Return: error code
  476. */
  477. int (*reg_dma_flush)(struct sde_hw_ctl *ctx, bool blocking);
  478. /**
  479. * check if ctl start trigger state to confirm the frame pending
  480. * status
  481. * @ctx : ctl path ctx pointer
  482. * @Return: error code
  483. */
  484. int (*get_start_state)(struct sde_hw_ctl *ctx);
  485. /**
  486. * set the active fetch pipes attached to this CTL
  487. * @ctx : ctl path ctx pointer
  488. * @fetch_active: bitmap of enum sde_sspp pipes attached
  489. */
  490. void (*set_active_pipes)(struct sde_hw_ctl *ctx,
  491. unsigned long *fetch_active);
  492. /**
  493. * Get all the sspp marked for fetching on the control path.
  494. * @ctx : ctl path ctx pointer
  495. * @Return: bitmap of enum sde_sspp pipes found
  496. */
  497. u32 (*get_active_pipes)(struct sde_hw_ctl *ctx);
  498. };
  499. /**
  500. * struct sde_hw_ctl : CTL PATH driver object
  501. * @base: hardware block base structure
  502. * @hw: block register map object
  503. * @idx: control path index
  504. * @caps: control path capabilities
  505. * @mixer_count: number of mixers
  506. * @mixer_hw_caps: mixer hardware capabilities
  507. * @flush: storage for pending ctl_flush managed via ops
  508. * @ops: operation list
  509. */
  510. struct sde_hw_ctl {
  511. struct sde_hw_blk_reg_map hw;
  512. /* ctl path */
  513. int idx;
  514. const struct sde_ctl_cfg *caps;
  515. int mixer_count;
  516. const struct sde_lm_cfg *mixer_hw_caps;
  517. struct sde_ctl_flush_cfg flush;
  518. /* hw fence */
  519. struct sde_hw_fence_data hwfence_data;
  520. /* ops */
  521. struct sde_hw_ctl_ops ops;
  522. };
  523. /**
  524. * to_sde_hw_ctl - convert base hw object to sde_hw_ctl container
  525. * @hw: Pointer to hardware block register map object
  526. * return: Pointer to hardware block container
  527. */
  528. static inline struct sde_hw_ctl *to_sde_hw_ctl(struct sde_hw_blk_reg_map *hw)
  529. {
  530. return container_of(hw, struct sde_hw_ctl, hw);
  531. }
  532. /**
  533. * sde_hw_ctl_init(): Initializes the ctl_path hw driver object.
  534. * should be called before accessing every ctl path registers.
  535. * @idx: ctl_path index for which driver object is required
  536. * @addr: mapped register io address of MDP
  537. * @m : pointer to mdss catalog data
  538. */
  539. struct sde_hw_blk_reg_map *sde_hw_ctl_init(enum sde_ctl idx,
  540. void __iomem *addr,
  541. struct sde_mdss_cfg *m);
  542. /**
  543. * sde_hw_ctl_destroy(): Destroys ctl driver context
  544. * @hw: Pointer to hardware block register map object
  545. */
  546. void sde_hw_ctl_destroy(struct sde_hw_blk_reg_map *hw);
  547. #endif /*_SDE_HW_CTL_H */