sti_mixer.h 1.6 KB

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