sti_plane.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (C) STMicroelectronics SA 2014
  3. * Author: Benjamin Gaignard <benjamin.gaignard@st.com> for STMicroelectronics.
  4. * License terms: GNU General Public License (GPL), version 2
  5. */
  6. #ifndef _STI_PLANE_H_
  7. #define _STI_PLANE_H_
  8. #include <drm/drmP.h>
  9. #include <drm/drm_atomic_helper.h>
  10. #include <drm/drm_plane_helper.h>
  11. extern struct drm_plane_funcs sti_plane_helpers_funcs;
  12. #define to_sti_plane(x) container_of(x, struct sti_plane, drm_plane)
  13. #define STI_PLANE_TYPE_SHIFT 8
  14. #define STI_PLANE_TYPE_MASK (~((1 << STI_PLANE_TYPE_SHIFT) - 1))
  15. enum sti_plane_type {
  16. STI_GDP = 1 << STI_PLANE_TYPE_SHIFT,
  17. STI_VDP = 2 << STI_PLANE_TYPE_SHIFT,
  18. STI_CUR = 3 << STI_PLANE_TYPE_SHIFT,
  19. STI_BCK = 4 << STI_PLANE_TYPE_SHIFT
  20. };
  21. enum sti_plane_id_of_type {
  22. STI_ID_0 = 0,
  23. STI_ID_1 = 1,
  24. STI_ID_2 = 2,
  25. STI_ID_3 = 3
  26. };
  27. enum sti_plane_desc {
  28. STI_GDP_0 = STI_GDP | STI_ID_0,
  29. STI_GDP_1 = STI_GDP | STI_ID_1,
  30. STI_GDP_2 = STI_GDP | STI_ID_2,
  31. STI_GDP_3 = STI_GDP | STI_ID_3,
  32. STI_HQVDP_0 = STI_VDP | STI_ID_0,
  33. STI_CURSOR = STI_CUR,
  34. STI_BACK = STI_BCK
  35. };
  36. enum sti_plane_status {
  37. STI_PLANE_READY,
  38. STI_PLANE_UPDATED,
  39. STI_PLANE_DISABLING,
  40. STI_PLANE_FLUSHING,
  41. STI_PLANE_DISABLED,
  42. };
  43. /**
  44. * STI plane structure
  45. *
  46. * @plane: drm plane it is bound to (if any)
  47. * @desc: plane type & id
  48. * @status: to know the status of the plane
  49. * @zorder: plane z-order
  50. */
  51. struct sti_plane {
  52. struct drm_plane drm_plane;
  53. enum sti_plane_desc desc;
  54. enum sti_plane_status status;
  55. int zorder;
  56. };
  57. const char *sti_plane_to_str(struct sti_plane *plane);
  58. void sti_plane_init_property(struct sti_plane *plane,
  59. enum drm_plane_type type);
  60. #endif