rcar_du_crtc.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * rcar_du_crtc.h -- R-Car Display Unit CRTCs
  3. *
  4. * Copyright (C) 2013-2014 Renesas Electronics Corporation
  5. *
  6. * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. */
  13. #ifndef __RCAR_DU_CRTC_H__
  14. #define __RCAR_DU_CRTC_H__
  15. #include <linux/mutex.h>
  16. #include <drm/drmP.h>
  17. #include <drm/drm_crtc.h>
  18. struct rcar_du_group;
  19. struct rcar_du_plane;
  20. struct rcar_du_crtc {
  21. struct drm_crtc crtc;
  22. struct clk *clock;
  23. unsigned int mmio_offset;
  24. unsigned int index;
  25. bool started;
  26. struct drm_pending_vblank_event *event;
  27. unsigned int outputs;
  28. int dpms;
  29. struct rcar_du_group *group;
  30. struct rcar_du_plane *plane;
  31. };
  32. #define to_rcar_crtc(c) container_of(c, struct rcar_du_crtc, crtc)
  33. enum rcar_du_output {
  34. RCAR_DU_OUTPUT_DPAD0,
  35. RCAR_DU_OUTPUT_DPAD1,
  36. RCAR_DU_OUTPUT_LVDS0,
  37. RCAR_DU_OUTPUT_LVDS1,
  38. RCAR_DU_OUTPUT_TCON,
  39. RCAR_DU_OUTPUT_MAX,
  40. };
  41. int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index);
  42. void rcar_du_crtc_enable_vblank(struct rcar_du_crtc *rcrtc, bool enable);
  43. void rcar_du_crtc_cancel_page_flip(struct rcar_du_crtc *rcrtc,
  44. struct drm_file *file);
  45. void rcar_du_crtc_suspend(struct rcar_du_crtc *rcrtc);
  46. void rcar_du_crtc_resume(struct rcar_du_crtc *rcrtc);
  47. void rcar_du_crtc_route_output(struct drm_crtc *crtc,
  48. enum rcar_du_output output);
  49. void rcar_du_crtc_update_planes(struct drm_crtc *crtc);
  50. #endif /* __RCAR_DU_CRTC_H__ */