rcar_du_plane.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * rcar_du_plane.h -- R-Car Display Unit Planes
  3. *
  4. * Copyright (C) 2013 Renesas 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_PLANE_H__
  14. #define __RCAR_DU_PLANE_H__
  15. struct drm_crtc;
  16. struct drm_framebuffer;
  17. struct rcar_du_device;
  18. struct rcar_du_format_info;
  19. /* The RCAR DU has 8 hardware planes, shared between KMS planes and CRTCs. As
  20. * using KMS planes requires at least one of the CRTCs being enabled, no more
  21. * than 7 KMS planes can be available. We thus create 7 KMS planes and
  22. * 9 software planes (one for each KMS planes and one for each CRTC).
  23. */
  24. #define RCAR_DU_NUM_KMS_PLANES 7
  25. #define RCAR_DU_NUM_HW_PLANES 8
  26. #define RCAR_DU_NUM_SW_PLANES 9
  27. struct rcar_du_plane {
  28. struct rcar_du_device *dev;
  29. struct drm_crtc *crtc;
  30. bool enabled;
  31. int hwindex; /* 0-based, -1 means unused */
  32. unsigned int alpha;
  33. unsigned int colorkey;
  34. unsigned int zpos;
  35. const struct rcar_du_format_info *format;
  36. unsigned long dma[2];
  37. unsigned int pitch;
  38. unsigned int width;
  39. unsigned int height;
  40. unsigned int src_x;
  41. unsigned int src_y;
  42. unsigned int dst_x;
  43. unsigned int dst_y;
  44. };
  45. int rcar_du_plane_init(struct rcar_du_device *rcdu);
  46. int rcar_du_plane_register(struct rcar_du_device *rcdu);
  47. void rcar_du_plane_setup(struct rcar_du_plane *plane);
  48. void rcar_du_plane_update_base(struct rcar_du_plane *plane);
  49. void rcar_du_plane_compute_base(struct rcar_du_plane *plane,
  50. struct drm_framebuffer *fb);
  51. int rcar_du_plane_reserve(struct rcar_du_plane *plane,
  52. const struct rcar_du_format_info *format);
  53. void rcar_du_plane_release(struct rcar_du_plane *plane);
  54. #endif /* __RCAR_DU_PLANE_H__ */