sde_hw_ctl.h 18 KB

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