mtk_drm_drv.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (c) 2015 MediaTek Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef MTK_DRM_DRV_H
  14. #define MTK_DRM_DRV_H
  15. #include <linux/io.h>
  16. #include "mtk_drm_ddp_comp.h"
  17. #define MAX_CRTC 3
  18. #define MAX_CONNECTOR 2
  19. struct device;
  20. struct device_node;
  21. struct drm_crtc;
  22. struct drm_device;
  23. struct drm_fb_helper;
  24. struct drm_property;
  25. struct regmap;
  26. struct mtk_mmsys_driver_data {
  27. const enum mtk_ddp_comp_id *main_path;
  28. unsigned int main_len;
  29. const enum mtk_ddp_comp_id *ext_path;
  30. unsigned int ext_len;
  31. const enum mtk_ddp_comp_id *third_path;
  32. unsigned int third_len;
  33. bool shadow_register;
  34. };
  35. struct mtk_drm_private {
  36. struct drm_device *drm;
  37. struct device *dma_dev;
  38. unsigned int num_pipes;
  39. struct device_node *mutex_node;
  40. struct device *mutex_dev;
  41. void __iomem *config_regs;
  42. struct device_node *comp_node[DDP_COMPONENT_ID_MAX];
  43. struct mtk_ddp_comp *ddp_comp[DDP_COMPONENT_ID_MAX];
  44. const struct mtk_mmsys_driver_data *data;
  45. struct {
  46. struct drm_atomic_state *state;
  47. struct work_struct work;
  48. struct mutex lock;
  49. } commit;
  50. struct drm_atomic_state *suspend_state;
  51. bool dma_parms_allocated;
  52. };
  53. extern struct platform_driver mtk_ddp_driver;
  54. extern struct platform_driver mtk_disp_color_driver;
  55. extern struct platform_driver mtk_disp_ovl_driver;
  56. extern struct platform_driver mtk_disp_rdma_driver;
  57. extern struct platform_driver mtk_dpi_driver;
  58. extern struct platform_driver mtk_dsi_driver;
  59. extern struct platform_driver mtk_mipi_tx_driver;
  60. #endif /* MTK_DRM_DRV_H */