sun4i_layer.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2015 Free Electrons
  3. * Copyright (C) 2015 NextThing Co
  4. *
  5. * Maxime Ripard <maxime.ripard@free-electrons.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. */
  12. #ifndef _SUN4I_LAYER_H_
  13. #define _SUN4I_LAYER_H_
  14. struct sunxi_engine;
  15. struct sun4i_layer {
  16. struct drm_plane plane;
  17. struct sun4i_drv *drv;
  18. struct sun4i_backend *backend;
  19. int id;
  20. };
  21. struct sun4i_layer_state {
  22. struct drm_plane_state state;
  23. unsigned int pipe;
  24. bool uses_frontend;
  25. };
  26. static inline struct sun4i_layer *
  27. plane_to_sun4i_layer(struct drm_plane *plane)
  28. {
  29. return container_of(plane, struct sun4i_layer, plane);
  30. }
  31. static inline struct sun4i_layer_state *
  32. state_to_sun4i_layer_state(struct drm_plane_state *state)
  33. {
  34. return container_of(state, struct sun4i_layer_state, state);
  35. }
  36. struct drm_plane **sun4i_layers_init(struct drm_device *drm,
  37. struct sunxi_engine *engine);
  38. #endif /* _SUN4I_LAYER_H_ */