malidp_drv.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * (C) COPYRIGHT 2016 ARM Limited. All rights reserved.
  3. * Author: Liviu Dudau <Liviu.Dudau@arm.com>
  4. *
  5. * This program is free software and is provided to you under the terms of the
  6. * GNU General Public License version 2 as published by the Free Software
  7. * Foundation, and any use by you of this program is subject to the terms
  8. * of such GNU licence.
  9. *
  10. * ARM Mali DP500/DP550/DP650 KMS/DRM driver structures
  11. */
  12. #ifndef __MALIDP_DRV_H__
  13. #define __MALIDP_DRV_H__
  14. #include <linux/mutex.h>
  15. #include <linux/wait.h>
  16. #include "malidp_hw.h"
  17. struct malidp_drm {
  18. struct malidp_hw_device *dev;
  19. struct drm_fbdev_cma *fbdev;
  20. struct list_head event_list;
  21. struct drm_crtc crtc;
  22. wait_queue_head_t wq;
  23. atomic_t config_valid;
  24. };
  25. #define crtc_to_malidp_device(x) container_of(x, struct malidp_drm, crtc)
  26. struct malidp_plane {
  27. struct drm_plane base;
  28. struct malidp_hw_device *hwdev;
  29. const struct malidp_layer *layer;
  30. };
  31. struct malidp_plane_state {
  32. struct drm_plane_state base;
  33. /* size of the required rotation memory if plane is rotated */
  34. u32 rotmem_size;
  35. /* internal format ID */
  36. u8 format;
  37. u8 n_planes;
  38. };
  39. #define to_malidp_plane(x) container_of(x, struct malidp_plane, base)
  40. #define to_malidp_plane_state(x) container_of(x, struct malidp_plane_state, base)
  41. int malidp_de_planes_init(struct drm_device *drm);
  42. void malidp_de_planes_destroy(struct drm_device *drm);
  43. int malidp_crtc_init(struct drm_device *drm);
  44. /* often used combination of rotational bits */
  45. #define MALIDP_ROTATED_MASK (DRM_ROTATE_90 | DRM_ROTATE_270)
  46. #endif /* __MALIDP_DRV_H__ */