mtk_drm_plane.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2015 MediaTek Inc.
  3. * Author: CK Hu <ck.hu@mediatek.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef _MTK_DRM_PLANE_H_
  15. #define _MTK_DRM_PLANE_H_
  16. #include <drm/drm_crtc.h>
  17. #include <linux/types.h>
  18. struct mtk_plane_pending_state {
  19. bool config;
  20. bool enable;
  21. dma_addr_t addr;
  22. unsigned int pitch;
  23. unsigned int format;
  24. unsigned int x;
  25. unsigned int y;
  26. unsigned int width;
  27. unsigned int height;
  28. bool dirty;
  29. };
  30. struct mtk_plane_state {
  31. struct drm_plane_state base;
  32. struct mtk_plane_pending_state pending;
  33. };
  34. static inline struct mtk_plane_state *
  35. to_mtk_plane_state(struct drm_plane_state *state)
  36. {
  37. return container_of(state, struct mtk_plane_state, base);
  38. }
  39. int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane,
  40. unsigned long possible_crtcs, enum drm_plane_type type);
  41. #endif