sti_compositor.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) STMicroelectronics SA 2014
  4. * Authors: Benjamin Gaignard <benjamin.gaignard@st.com>
  5. * Fabien Dessenne <fabien.dessenne@st.com>
  6. * for STMicroelectronics.
  7. */
  8. #ifndef _STI_COMPOSITOR_H_
  9. #define _STI_COMPOSITOR_H_
  10. #include <linux/clk.h>
  11. #include <linux/kernel.h>
  12. #include "sti_mixer.h"
  13. #include "sti_plane.h"
  14. #define WAIT_NEXT_VSYNC_MS 50 /*ms*/
  15. #define STI_MAX_MIXER 2
  16. #define STI_MAX_VID 1
  17. enum sti_compositor_subdev_type {
  18. STI_MIXER_MAIN_SUBDEV,
  19. STI_MIXER_AUX_SUBDEV,
  20. STI_GPD_SUBDEV,
  21. STI_VID_SUBDEV,
  22. STI_CURSOR_SUBDEV,
  23. };
  24. struct sti_compositor_subdev_descriptor {
  25. enum sti_compositor_subdev_type type;
  26. int id;
  27. unsigned int offset;
  28. };
  29. /**
  30. * STI Compositor data structure
  31. *
  32. * @nb_subdev: number of subdevices supported by the compositor
  33. * @subdev_desc: subdev list description
  34. */
  35. #define MAX_SUBDEV 9
  36. struct sti_compositor_data {
  37. unsigned int nb_subdev;
  38. struct sti_compositor_subdev_descriptor subdev_desc[MAX_SUBDEV];
  39. };
  40. /**
  41. * STI Compositor structure
  42. *
  43. * @dev: driver device
  44. * @regs: registers (main)
  45. * @data: device data
  46. * @clk_compo_main: clock for main compo
  47. * @clk_compo_aux: clock for aux compo
  48. * @clk_pix_main: pixel clock for main path
  49. * @clk_pix_aux: pixel clock for aux path
  50. * @rst_main: reset control of the main path
  51. * @rst_aux: reset control of the aux path
  52. * @mixer: array of mixers
  53. * @vid: array of vids
  54. * @vtg: array of vtgs
  55. * @vtg_vblank_nb: array of callbacks for VTG VSYNC notification
  56. */
  57. struct sti_compositor {
  58. struct device *dev;
  59. void __iomem *regs;
  60. struct sti_compositor_data data;
  61. struct clk *clk_compo_main;
  62. struct clk *clk_compo_aux;
  63. struct clk *clk_pix_main;
  64. struct clk *clk_pix_aux;
  65. struct reset_control *rst_main;
  66. struct reset_control *rst_aux;
  67. struct sti_mixer *mixer[STI_MAX_MIXER];
  68. struct sti_vid *vid[STI_MAX_VID];
  69. struct sti_vtg *vtg[STI_MAX_MIXER];
  70. struct notifier_block vtg_vblank_nb[STI_MAX_MIXER];
  71. };
  72. void sti_compositor_debugfs_init(struct sti_compositor *compo,
  73. struct drm_minor *minor);
  74. #endif