mtk_drm_plane.h 972 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2015 MediaTek Inc.
  4. * Author: CK Hu <ck.hu@mediatek.com>
  5. */
  6. #ifndef _MTK_DRM_PLANE_H_
  7. #define _MTK_DRM_PLANE_H_
  8. #include <drm/drm_crtc.h>
  9. #include <linux/types.h>
  10. struct mtk_plane_pending_state {
  11. bool config;
  12. bool enable;
  13. dma_addr_t addr;
  14. unsigned int pitch;
  15. unsigned int format;
  16. unsigned int x;
  17. unsigned int y;
  18. unsigned int width;
  19. unsigned int height;
  20. unsigned int rotation;
  21. bool dirty;
  22. bool async_dirty;
  23. bool async_config;
  24. };
  25. struct mtk_plane_state {
  26. struct drm_plane_state base;
  27. struct mtk_plane_pending_state pending;
  28. };
  29. static inline struct mtk_plane_state *
  30. to_mtk_plane_state(struct drm_plane_state *state)
  31. {
  32. return container_of(state, struct mtk_plane_state, base);
  33. }
  34. int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane,
  35. unsigned long possible_crtcs, enum drm_plane_type type,
  36. unsigned int supported_rotations);
  37. #endif