sti_mixer.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (C) STMicroelectronics SA 2014
  3. * Authors: Benjamin Gaignard <benjamin.gaignard@st.com>
  4. * Fabien Dessenne <fabien.dessenne@st.com>
  5. * for STMicroelectronics.
  6. * License terms: GNU General Public License (GPL), version 2
  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. * @pending_event: set if a flip event is pending on crtc
  26. * @status: to know the status of the mixer
  27. */
  28. struct sti_mixer {
  29. struct device *dev;
  30. void __iomem *regs;
  31. int id;
  32. struct drm_crtc drm_crtc;
  33. struct drm_pending_vblank_event *pending_event;
  34. enum sti_mixer_status status;
  35. };
  36. const char *sti_mixer_to_str(struct sti_mixer *mixer);
  37. struct sti_mixer *sti_mixer_create(struct device *dev, 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. /* depth in Cross-bar control = z order */
  46. #define GAM_MIXER_NB_DEPTH_LEVEL 6
  47. #define STI_MIXER_MAIN 0
  48. #define STI_MIXER_AUX 1
  49. #endif