sun4i_layer.h 915 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2015 Free Electrons
  4. * Copyright (C) 2015 NextThing Co
  5. *
  6. * Maxime Ripard <maxime.ripard@free-electrons.com>
  7. */
  8. #ifndef _SUN4I_LAYER_H_
  9. #define _SUN4I_LAYER_H_
  10. struct sunxi_engine;
  11. struct sun4i_layer {
  12. struct drm_plane plane;
  13. struct sun4i_drv *drv;
  14. struct sun4i_backend *backend;
  15. int id;
  16. };
  17. struct sun4i_layer_state {
  18. struct drm_plane_state state;
  19. unsigned int pipe;
  20. bool uses_frontend;
  21. };
  22. static inline struct sun4i_layer *
  23. plane_to_sun4i_layer(struct drm_plane *plane)
  24. {
  25. return container_of(plane, struct sun4i_layer, plane);
  26. }
  27. static inline struct sun4i_layer_state *
  28. state_to_sun4i_layer_state(struct drm_plane_state *state)
  29. {
  30. return container_of(state, struct sun4i_layer_state, state);
  31. }
  32. struct drm_plane **sun4i_layers_init(struct drm_device *drm,
  33. struct sunxi_engine *engine);
  34. #endif /* _SUN4I_LAYER_H_ */