sti_mixer.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_layer.h"
  12. #define to_sti_mixer(x) container_of(x, struct sti_mixer, drm_crtc)
  13. /**
  14. * STI Mixer subdevice structure
  15. *
  16. * @dev: driver device
  17. * @regs: mixer registers
  18. * @id: id of the mixer
  19. * @drm_crtc: crtc object link to the mixer
  20. * @pending_event: set if a flip event is pending on crtc
  21. * @enabled: to know if the mixer is active or not
  22. */
  23. struct sti_mixer {
  24. struct device *dev;
  25. void __iomem *regs;
  26. int id;
  27. struct drm_crtc drm_crtc;
  28. struct drm_pending_vblank_event *pending_event;
  29. bool enabled;
  30. };
  31. const char *sti_mixer_to_str(struct sti_mixer *mixer);
  32. struct sti_mixer *sti_mixer_create(struct device *dev, int id,
  33. void __iomem *baseaddr);
  34. int sti_mixer_set_layer_status(struct sti_mixer *mixer,
  35. struct sti_layer *layer, bool status);
  36. void sti_mixer_clear_all_layers(struct sti_mixer *mixer);
  37. int sti_mixer_set_layer_depth(struct sti_mixer *mixer, struct sti_layer *layer);
  38. int sti_mixer_active_video_area(struct sti_mixer *mixer,
  39. struct drm_display_mode *mode);
  40. void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable);
  41. /* depth in Cross-bar control = z order */
  42. #define GAM_MIXER_NB_DEPTH_LEVEL 7
  43. #define STI_MIXER_MAIN 0
  44. #define STI_MIXER_AUX 1
  45. #endif