mdp5_ctl.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2014 The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __MDP5_CTL_H__
  6. #define __MDP5_CTL_H__
  7. #include "msm_drv.h"
  8. /*
  9. * CTL Manager prototypes:
  10. * mdp5_ctlm_init() returns a ctlm (CTL Manager) handler,
  11. * which is then used to call the other mdp5_ctlm_*(ctlm, ...) functions.
  12. */
  13. struct mdp5_ctl_manager;
  14. struct mdp5_ctl_manager *mdp5_ctlm_init(struct drm_device *dev,
  15. void __iomem *mmio_base, struct mdp5_cfg_handler *cfg_hnd);
  16. void mdp5_ctlm_hw_reset(struct mdp5_ctl_manager *ctlm);
  17. /*
  18. * CTL prototypes:
  19. * mdp5_ctl_request(ctlm, ...) returns a ctl (CTL resource) handler,
  20. * which is then used to call the other mdp5_ctl_*(ctl, ...) functions.
  21. */
  22. struct mdp5_ctl *mdp5_ctlm_request(struct mdp5_ctl_manager *ctlm, int intf_num);
  23. int mdp5_ctl_get_ctl_id(struct mdp5_ctl *ctl);
  24. struct mdp5_interface;
  25. struct mdp5_pipeline;
  26. int mdp5_ctl_set_pipeline(struct mdp5_ctl *ctl, struct mdp5_pipeline *p);
  27. int mdp5_ctl_set_encoder_state(struct mdp5_ctl *ctl, struct mdp5_pipeline *p,
  28. bool enabled);
  29. int mdp5_ctl_set_cursor(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline,
  30. int cursor_id, bool enable);
  31. int mdp5_ctl_pair(struct mdp5_ctl *ctlx, struct mdp5_ctl *ctly, bool enable);
  32. #define MAX_PIPE_STAGE 2
  33. /*
  34. * mdp5_ctl_blend() - Blend multiple layers on a Layer Mixer (LM)
  35. *
  36. * @stage: array to contain the pipe num for each stage
  37. * @stage_cnt: valid stage number in stage array
  38. * @ctl_blend_op_flags: blender operation mode flags
  39. *
  40. * Note:
  41. * CTL registers need to be flushed after calling this function
  42. * (call mdp5_ctl_commit() with mdp_ctl_flush_mask_ctl() mask)
  43. */
  44. #define MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT BIT(0)
  45. int mdp5_ctl_blend(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline,
  46. enum mdp5_pipe stage[][MAX_PIPE_STAGE],
  47. enum mdp5_pipe r_stage[][MAX_PIPE_STAGE],
  48. u32 stage_cnt, u32 ctl_blend_op_flags);
  49. /**
  50. * mdp_ctl_flush_mask...() - Register FLUSH masks
  51. *
  52. * These masks are used to specify which block(s) need to be flushed
  53. * through @flush_mask parameter in mdp5_ctl_commit(.., flush_mask).
  54. */
  55. u32 mdp_ctl_flush_mask_lm(int lm);
  56. u32 mdp_ctl_flush_mask_pipe(enum mdp5_pipe pipe);
  57. u32 mdp_ctl_flush_mask_cursor(int cursor_id);
  58. u32 mdp_ctl_flush_mask_encoder(struct mdp5_interface *intf);
  59. /* @flush_mask: see CTL flush masks definitions below */
  60. u32 mdp5_ctl_commit(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline,
  61. u32 flush_mask, bool start);
  62. u32 mdp5_ctl_get_commit_status(struct mdp5_ctl *ctl);
  63. #endif /* __MDP5_CTL_H__ */