rcar_du_group.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * rcar_du_group.c -- R-Car Display Unit Planes and CRTCs Group
  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_GROUP_H__
  14. #define __RCAR_DU_GROUP_H__
  15. #include <linux/mutex.h>
  16. #include "rcar_du_plane.h"
  17. struct rcar_du_device;
  18. /*
  19. * struct rcar_du_group - CRTCs and planes group
  20. * @dev: the DU device
  21. * @mmio_offset: registers offset in the device memory map
  22. * @index: group index
  23. * @num_crtcs: number of CRTCs in this group (1 or 2)
  24. * @use_count: number of users of the group (rcar_du_group_(get|put))
  25. * @used_crtcs: number of CRTCs currently in use
  26. * @lock: protects the dptsr_planes field and the DPTSR register
  27. * @dptsr_planes: bitmask of planes driven by dot-clock and timing generator 1
  28. * @num_planes: number of planes in the group
  29. * @planes: planes handled by the group
  30. */
  31. struct rcar_du_group {
  32. struct rcar_du_device *dev;
  33. unsigned int mmio_offset;
  34. unsigned int index;
  35. unsigned int num_crtcs;
  36. unsigned int use_count;
  37. unsigned int used_crtcs;
  38. struct mutex lock;
  39. unsigned int dptsr_planes;
  40. unsigned int num_planes;
  41. struct rcar_du_plane planes[RCAR_DU_NUM_KMS_PLANES];
  42. };
  43. u32 rcar_du_group_read(struct rcar_du_group *rgrp, u32 reg);
  44. void rcar_du_group_write(struct rcar_du_group *rgrp, u32 reg, u32 data);
  45. int rcar_du_group_get(struct rcar_du_group *rgrp);
  46. void rcar_du_group_put(struct rcar_du_group *rgrp);
  47. void rcar_du_group_start_stop(struct rcar_du_group *rgrp, bool start);
  48. void rcar_du_group_restart(struct rcar_du_group *rgrp);
  49. int rcar_du_group_set_routing(struct rcar_du_group *rgrp);
  50. #endif /* __RCAR_DU_GROUP_H__ */