sti_mixer.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_MIXER_H_
  9. #define _STI_MIXER_H_
  10. #include <drm/drmP.h>
  11. #include "sti_plane.h"
  12. #define to_sti_mixer(x) container_of(x, struct sti_mixer, drm_crtc)
  13. enum sti_mixer_status {
  14. STI_MIXER_READY,
  15. STI_MIXER_DISABLING,
  16. STI_MIXER_DISABLED,
  17. };
  18. /**
  19. * STI Mixer subdevice structure
  20. *
  21. * @dev: driver device
  22. * @regs: mixer registers
  23. * @id: id of the mixer
  24. * @drm_crtc: crtc object link to the mixer
  25. * @status: to know the status of the mixer
  26. */
  27. struct sti_mixer {
  28. struct device *dev;
  29. void __iomem *regs;
  30. int id;
  31. struct drm_crtc drm_crtc;
  32. enum sti_mixer_status status;
  33. };
  34. const char *sti_mixer_to_str(struct sti_mixer *mixer);
  35. struct sti_mixer *sti_mixer_create(struct device *dev,
  36. struct drm_device *drm_dev,
  37. int id,
  38. void __iomem *baseaddr);
  39. int sti_mixer_set_plane_status(struct sti_mixer *mixer,
  40. struct sti_plane *plane, bool status);
  41. int sti_mixer_set_plane_depth(struct sti_mixer *mixer, struct sti_plane *plane);
  42. int sti_mixer_active_video_area(struct sti_mixer *mixer,
  43. struct drm_display_mode *mode);
  44. void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable);
  45. int sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor);
  46. /* depth in Cross-bar control = z order */
  47. #define GAM_MIXER_NB_DEPTH_LEVEL 6
  48. #define STI_MIXER_MAIN 0
  49. #define STI_MIXER_AUX 1
  50. #endif