mdp5_ctl.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (c) 2014 The Linux Foundation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef __MDP5_CTL_H__
  14. #define __MDP5_CTL_H__
  15. #include "msm_drv.h"
  16. /*
  17. * CTL Manager prototypes:
  18. * mdp5_ctlm_init() returns a ctlm (CTL Manager) handler,
  19. * which is then used to call the other mdp5_ctlm_*(ctlm, ...) functions.
  20. */
  21. struct mdp5_ctl_manager;
  22. struct mdp5_ctl_manager *mdp5_ctlm_init(struct drm_device *dev,
  23. void __iomem *mmio_base, struct mdp5_cfg_handler *cfg_hnd);
  24. void mdp5_ctlm_hw_reset(struct mdp5_ctl_manager *ctlm);
  25. void mdp5_ctlm_destroy(struct mdp5_ctl_manager *ctlm);
  26. /*
  27. * CTL prototypes:
  28. * mdp5_ctl_request(ctlm, ...) returns a ctl (CTL resource) handler,
  29. * which is then used to call the other mdp5_ctl_*(ctl, ...) functions.
  30. */
  31. struct mdp5_ctl *mdp5_ctlm_request(struct mdp5_ctl_manager *ctlm, int intf_num);
  32. int mdp5_ctl_get_ctl_id(struct mdp5_ctl *ctl);
  33. struct mdp5_interface;
  34. struct mdp5_pipeline;
  35. int mdp5_ctl_set_pipeline(struct mdp5_ctl *ctl, struct mdp5_pipeline *p);
  36. int mdp5_ctl_set_encoder_state(struct mdp5_ctl *ctl, struct mdp5_pipeline *p,
  37. bool enabled);
  38. int mdp5_ctl_set_cursor(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline,
  39. int cursor_id, bool enable);
  40. int mdp5_ctl_pair(struct mdp5_ctl *ctlx, struct mdp5_ctl *ctly, bool enable);
  41. #define MAX_PIPE_STAGE 2
  42. /*
  43. * mdp5_ctl_blend() - Blend multiple layers on a Layer Mixer (LM)
  44. *
  45. * @stage: array to contain the pipe num for each stage
  46. * @stage_cnt: valid stage number in stage array
  47. * @ctl_blend_op_flags: blender operation mode flags
  48. *
  49. * Note:
  50. * CTL registers need to be flushed after calling this function
  51. * (call mdp5_ctl_commit() with mdp_ctl_flush_mask_ctl() mask)
  52. */
  53. #define MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT BIT(0)
  54. int mdp5_ctl_blend(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline,
  55. enum mdp5_pipe stage[][MAX_PIPE_STAGE],
  56. enum mdp5_pipe r_stage[][MAX_PIPE_STAGE],
  57. u32 stage_cnt, u32 ctl_blend_op_flags);
  58. /**
  59. * mdp_ctl_flush_mask...() - Register FLUSH masks
  60. *
  61. * These masks are used to specify which block(s) need to be flushed
  62. * through @flush_mask parameter in mdp5_ctl_commit(.., flush_mask).
  63. */
  64. u32 mdp_ctl_flush_mask_lm(int lm);
  65. u32 mdp_ctl_flush_mask_pipe(enum mdp5_pipe pipe);
  66. u32 mdp_ctl_flush_mask_cursor(int cursor_id);
  67. u32 mdp_ctl_flush_mask_encoder(struct mdp5_interface *intf);
  68. /* @flush_mask: see CTL flush masks definitions below */
  69. u32 mdp5_ctl_commit(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline,
  70. u32 flush_mask, bool start);
  71. u32 mdp5_ctl_get_commit_status(struct mdp5_ctl *ctl);
  72. #endif /* __MDP5_CTL_H__ */