mdp3_ctrl.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #ifndef MDP3_CTRL_H
  14. #define MDP3_CTRL_H
  15. #include <linux/types.h>
  16. #include <linux/mutex.h>
  17. #include <linux/completion.h>
  18. #include <linux/timer.h>
  19. #include "mdp3.h"
  20. #include "mdp3_dma.h"
  21. #include "mdss_fb.h"
  22. #include "mdss_panel.h"
  23. #define MDP3_MAX_BUF_QUEUE 8
  24. struct mdp3_buffer_queue {
  25. struct mdp3_img_data img_data[MDP3_MAX_BUF_QUEUE];
  26. int count;
  27. int push_idx;
  28. int pop_idx;
  29. };
  30. struct mdp3_session_data {
  31. struct mutex lock;
  32. int status;
  33. struct mdp3_dma *dma;
  34. struct mdss_panel_data *panel;
  35. struct mdp3_intf *intf;
  36. struct msm_fb_data_type *mfd;
  37. ktime_t vsync_time;
  38. struct timer_list vsync_timer;
  39. int vsync_period;
  40. struct sysfs_dirent *vsync_event_sd;
  41. struct mdp_overlay overlay;
  42. struct mdp_overlay req_overlay;
  43. struct mdp3_buffer_queue bufq_in;
  44. struct mdp3_buffer_queue bufq_out;
  45. struct work_struct clk_off_work;
  46. struct work_struct dma_done_work;
  47. atomic_t dma_done_cnt;
  48. int histo_status;
  49. struct mutex histo_lock;
  50. int lut_sel;
  51. int cc_vect_sel;
  52. bool vsync_before_commit;
  53. bool first_commit;
  54. int clk_on;
  55. struct blocking_notifier_head notifier_head;
  56. int vsync_enabled;
  57. atomic_t vsync_countdown; /* Used to count down */
  58. bool in_splash_screen;
  59. bool dma_active;
  60. struct completion dma_completion;
  61. int (*wait_for_dma_done)(struct mdp3_session_data *session);
  62. };
  63. int mdp3_ctrl_init(struct msm_fb_data_type *mfd);
  64. #endif /* MDP3_CTRL_H */