sde_hw_ctl.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  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 flush mask
  257. * @ctx : ctl path ctx pointer
  258. * @clear : true to clear the flush mask
  259. */
  260. int (*clear_flush_mask)(struct sde_hw_ctl *ctx, bool clear);
  261. /**
  262. * Clear the value of the cached pending_flush_mask
  263. * No effect on hardware
  264. * @ctx : ctl path ctx pointer
  265. * @Return: error code
  266. */
  267. int (*clear_pending_flush)(struct sde_hw_ctl *ctx);
  268. /**
  269. * Query the value of the cached pending_flush_mask
  270. * No effect on hardware
  271. * @ctx : ctl path ctx pointer
  272. * @cfg : current flush configuration
  273. * @Return: error code
  274. */
  275. int (*get_pending_flush)(struct sde_hw_ctl *ctx,
  276. struct sde_ctl_flush_cfg *cfg);
  277. /**
  278. * OR in the given flushbits to the flush_cfg
  279. * No effect on hardware
  280. * @ctx : ctl path ctx pointer
  281. * @cfg : flush configuration pointer
  282. * @Return: error code
  283. */
  284. int (*update_pending_flush)(struct sde_hw_ctl *ctx,
  285. struct sde_ctl_flush_cfg *cfg);
  286. /**
  287. * Write the value of the pending_flush_mask to hardware
  288. * @ctx : ctl path ctx pointer
  289. * @Return: error code
  290. */
  291. int (*trigger_flush)(struct sde_hw_ctl *ctx);
  292. /**
  293. * Read the value of the flush register
  294. * @ctx : ctl path ctx pointer
  295. * @Return: value of the ctl flush register.
  296. */
  297. u32 (*get_flush_register)(struct sde_hw_ctl *ctx);
  298. /**
  299. * Setup ctl_path interface config
  300. * @ctx
  301. * @cfg : interface config structure pointer
  302. * @Return: error code
  303. */
  304. int (*setup_intf_cfg)(struct sde_hw_ctl *ctx,
  305. struct sde_hw_intf_cfg *cfg);
  306. /**
  307. * Reset ctl_path interface config
  308. * @ctx : ctl path ctx pointer
  309. * @cfg : interface config structure pointer
  310. * @merge_3d_idx : index of merge3d blk
  311. * @Return: error code
  312. */
  313. int (*reset_post_disable)(struct sde_hw_ctl *ctx,
  314. struct sde_hw_intf_cfg_v1 *cfg, u32 merge_3d_idx);
  315. /** update cwb for ctl_path
  316. * @ctx : ctl path ctx pointer
  317. * @cfg : interface config structure pointer
  318. * @enable : enable/disable the dynamic sub-blocks in interface cfg
  319. * @Return: error code
  320. */
  321. int (*update_intf_cfg)(struct sde_hw_ctl *ctx,
  322. struct sde_hw_intf_cfg_v1 *cfg, bool enable);
  323. /**
  324. * Setup ctl_path interface config for SDE_CTL_ACTIVE_CFG
  325. * @ctx : ctl path ctx pointer
  326. * @cfg : interface config structure pointer
  327. * @Return: error code
  328. */
  329. int (*setup_intf_cfg_v1)(struct sde_hw_ctl *ctx,
  330. struct sde_hw_intf_cfg_v1 *cfg);
  331. /**
  332. * Update the interface selection with input WB config
  333. * @ctx : ctl path ctx pointer
  334. * @cfg : pointer to input wb config
  335. * @enable : set if true, clear otherwise
  336. */
  337. void (*update_wb_cfg)(struct sde_hw_ctl *ctx,
  338. struct sde_hw_intf_cfg *cfg, bool enable);
  339. int (*reset)(struct sde_hw_ctl *c);
  340. /**
  341. * get_reset - check ctl reset status bit
  342. * @ctx : ctl path ctx pointer
  343. * Returns: current value of ctl reset status
  344. */
  345. u32 (*get_reset)(struct sde_hw_ctl *ctx);
  346. /**
  347. * get_scheduler_reset - check ctl scheduler status bit
  348. * @ctx : ctl path ctx pointer
  349. * Returns: current value of ctl scheduler and idle status
  350. */
  351. u32 (*get_scheduler_status)(struct sde_hw_ctl *ctx);
  352. /**
  353. * hard_reset - force reset on ctl_path
  354. * @ctx : ctl path ctx pointer
  355. * @enable : whether to enable/disable hard reset
  356. */
  357. void (*hard_reset)(struct sde_hw_ctl *c, bool enable);
  358. /*
  359. * wait_reset_status - checks ctl reset status
  360. * @ctx : ctl path ctx pointer
  361. *
  362. * This function checks the ctl reset status bit.
  363. * If the reset bit is set, it keeps polling the status till the hw
  364. * reset is complete.
  365. * Returns: 0 on success or -error if reset incomplete within interval
  366. */
  367. int (*wait_reset_status)(struct sde_hw_ctl *ctx);
  368. /**
  369. * update_bitmask_sspp: updates mask corresponding to sspp
  370. * @blk : blk id
  371. * @enable : true to enable, 0 to disable
  372. */
  373. int (*update_bitmask_sspp)(struct sde_hw_ctl *ctx,
  374. enum sde_sspp blk, bool enable);
  375. /**
  376. * update_bitmask_mixer: updates mask corresponding to mixer
  377. * @blk : blk id
  378. * @enable : true to enable, 0 to disable
  379. */
  380. int (*update_bitmask_mixer)(struct sde_hw_ctl *ctx,
  381. enum sde_lm blk, bool enable);
  382. /**
  383. * update_bitmask_dspp: updates mask corresponding to dspp
  384. * @blk : blk id
  385. * @enable : true to enable, 0 to disable
  386. */
  387. int (*update_bitmask_dspp)(struct sde_hw_ctl *ctx,
  388. enum sde_dspp blk, bool enable);
  389. /**
  390. * update_bitmask_dspp_pavlut: updates mask corresponding to dspp pav
  391. * @blk : blk id
  392. * @enable : true to enable, 0 to disable
  393. */
  394. int (*update_bitmask_dspp_pavlut)(struct sde_hw_ctl *ctx,
  395. enum sde_dspp blk, bool enable);
  396. /**
  397. * Program DSPP sub block specific bit of dspp flush register.
  398. * @ctx : ctl path ctx pointer
  399. * @dspp : HW block ID of dspp block
  400. * @sub_blk : enum of DSPP sub block to flush
  401. * @enable : true to enable, 0 to disable
  402. *
  403. * This API is for CTL with DSPP flush hierarchy registers.
  404. */
  405. int (*update_bitmask_dspp_subblk)(struct sde_hw_ctl *ctx,
  406. enum sde_dspp dspp, u32 sub_blk, bool enable);
  407. /**
  408. * update_bitmask_sspp: updates mask corresponding to sspp
  409. * @blk : blk id
  410. * @enable : true to enable, 0 to disable
  411. */
  412. int (*update_bitmask_rot)(struct sde_hw_ctl *ctx,
  413. enum sde_rot blk, bool enable);
  414. /**
  415. * update_bitmask: updates flush mask
  416. * @type : blk type to flush
  417. * @blk_idx : blk idx
  418. * @enable : true to enable, 0 to disable
  419. */
  420. int (*update_bitmask)(struct sde_hw_ctl *ctx,
  421. enum ctl_hw_flush_type type, u32 blk_idx, bool enable);
  422. /**
  423. * update_dnsc_blur_bitmask: updates dnsc_blur flush mask
  424. * @type : blk type to flush
  425. * @blk_idx : blk idx
  426. * @enable : true to enable, 0 to disable
  427. */
  428. void (*update_dnsc_blur_bitmask)(struct sde_hw_ctl *ctx, u32 blk_idx, bool enable);
  429. /**
  430. * get interfaces for the active CTL .
  431. * @ctx : ctl path ctx pointer
  432. * @return : bit mask with the active interfaces for the CTL
  433. */
  434. u32 (*get_ctl_intf)(struct sde_hw_ctl *ctx);
  435. /**
  436. * read CTL layers register value and return
  437. * the data.
  438. * @ctx : ctl path ctx pointer
  439. * @index : layer index for this ctl path
  440. * @return : CTL layers register value
  441. */
  442. u32 (*read_ctl_layers)(struct sde_hw_ctl *ctx, int index);
  443. /**
  444. * read active register configuration for this block
  445. * @ctx : ctl path ctx pointer
  446. * @blk : hw blk type, supported blocks are DSC, MERGE_3D, INTF,
  447. * CDM, WB
  448. * @index : blk index
  449. * @return : true if blk at idx is active or false
  450. */
  451. bool (*read_active_status)(struct sde_hw_ctl *ctx,
  452. enum sde_hw_blk_type blk, int index);
  453. /**
  454. * Set all blend stages to disabled
  455. * @ctx : ctl path ctx pointer
  456. */
  457. void (*clear_all_blendstages)(struct sde_hw_ctl *ctx);
  458. /**
  459. * Configure layer mixer to pipe configuration
  460. * @ctx : ctl path ctx pointer
  461. * @lm : layer mixer enumeration
  462. * @cfg : blend stage configuration
  463. * @disable_border: if true disable border, else enable border out
  464. */
  465. void (*setup_blendstage)(struct sde_hw_ctl *ctx,
  466. enum sde_lm lm, struct sde_hw_stage_cfg *cfg,
  467. bool disable_border);
  468. /**
  469. * Get all the sspp staged on a layer mixer
  470. * @ctx : ctl path ctx pointer
  471. * @lm : layer mixer enumeration
  472. * @info : structure to populate connected sspp index info
  473. * @Return: count of sspps info elements populated
  474. */
  475. u32 (*get_staged_sspp)(struct sde_hw_ctl *ctx, enum sde_lm lm,
  476. struct sde_sspp_index_info *info);
  477. /**
  478. * Flush the reg dma by sending last command.
  479. * @ctx : ctl path ctx pointer
  480. * @blocking : if set to true api will block until flush is done
  481. * @Return: error code
  482. */
  483. int (*reg_dma_flush)(struct sde_hw_ctl *ctx, bool blocking);
  484. /**
  485. * check if ctl start trigger state to confirm the frame pending
  486. * status
  487. * @ctx : ctl path ctx pointer
  488. * @Return: error code
  489. */
  490. int (*get_start_state)(struct sde_hw_ctl *ctx);
  491. /**
  492. * set the active fetch pipes attached to this CTL
  493. * @ctx : ctl path ctx pointer
  494. * @fetch_active: bitmap of enum sde_sspp pipes attached
  495. */
  496. void (*set_active_pipes)(struct sde_hw_ctl *ctx,
  497. unsigned long *fetch_active);
  498. /**
  499. * Get all the sspp marked for fetching on the control path.
  500. * @ctx : ctl path ctx pointer
  501. * @Return: bitmap of enum sde_sspp pipes found
  502. */
  503. u32 (*get_active_pipes)(struct sde_hw_ctl *ctx);
  504. };
  505. /**
  506. * struct sde_hw_ctl : CTL PATH driver object
  507. * @base: hardware block base structure
  508. * @hw: block register map object
  509. * @idx: control path index
  510. * @caps: control path capabilities
  511. * @mixer_count: number of mixers
  512. * @mixer_hw_caps: mixer hardware capabilities
  513. * @flush: storage for pending ctl_flush managed via ops
  514. * @ops: operation list
  515. */
  516. struct sde_hw_ctl {
  517. struct sde_hw_blk_reg_map hw;
  518. /* ctl path */
  519. int idx;
  520. const struct sde_ctl_cfg *caps;
  521. int mixer_count;
  522. const struct sde_lm_cfg *mixer_hw_caps;
  523. struct sde_ctl_flush_cfg flush;
  524. /* hw fence */
  525. struct sde_hw_fence_data hwfence_data;
  526. /* ops */
  527. struct sde_hw_ctl_ops ops;
  528. };
  529. /**
  530. * to_sde_hw_ctl - convert base hw object to sde_hw_ctl container
  531. * @hw: Pointer to hardware block register map object
  532. * return: Pointer to hardware block container
  533. */
  534. static inline struct sde_hw_ctl *to_sde_hw_ctl(struct sde_hw_blk_reg_map *hw)
  535. {
  536. return container_of(hw, struct sde_hw_ctl, hw);
  537. }
  538. /**
  539. * sde_hw_ctl_init(): Initializes the ctl_path hw driver object.
  540. * should be called before accessing every ctl path registers.
  541. * @idx: ctl_path index for which driver object is required
  542. * @addr: mapped register io address of MDP
  543. * @m : pointer to mdss catalog data
  544. */
  545. struct sde_hw_blk_reg_map *sde_hw_ctl_init(enum sde_ctl idx,
  546. void __iomem *addr,
  547. struct sde_mdss_cfg *m);
  548. /**
  549. * sde_hw_ctl_destroy(): Destroys ctl driver context
  550. * @hw: Pointer to hardware block register map object
  551. */
  552. void sde_hw_ctl_destroy(struct sde_hw_blk_reg_map *hw);
  553. #endif /*_SDE_HW_CTL_H */