omapdss.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Copyright (C) 2016 Texas Instruments
  3. * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 as published by
  7. * the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef __OMAP_DRM_DSS_H
  18. #define __OMAP_DRM_DSS_H
  19. #include <video/omapdss.h>
  20. u32 dispc_read_irqstatus(void);
  21. void dispc_clear_irqstatus(u32 mask);
  22. u32 dispc_read_irqenable(void);
  23. void dispc_write_irqenable(u32 mask);
  24. int dispc_request_irq(irq_handler_t handler, void *dev_id);
  25. void dispc_free_irq(void *dev_id);
  26. int dispc_runtime_get(void);
  27. void dispc_runtime_put(void);
  28. void dispc_mgr_enable(enum omap_channel channel, bool enable);
  29. bool dispc_mgr_is_enabled(enum omap_channel channel);
  30. u32 dispc_mgr_get_vsync_irq(enum omap_channel channel);
  31. u32 dispc_mgr_get_framedone_irq(enum omap_channel channel);
  32. u32 dispc_mgr_get_sync_lost_irq(enum omap_channel channel);
  33. bool dispc_mgr_go_busy(enum omap_channel channel);
  34. void dispc_mgr_go(enum omap_channel channel);
  35. void dispc_mgr_set_lcd_config(enum omap_channel channel,
  36. const struct dss_lcd_mgr_config *config);
  37. void dispc_mgr_set_timings(enum omap_channel channel,
  38. const struct omap_video_timings *timings);
  39. void dispc_mgr_setup(enum omap_channel channel,
  40. const struct omap_overlay_manager_info *info);
  41. int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel,
  42. const struct omap_overlay_info *oi,
  43. const struct omap_video_timings *timings,
  44. int *x_predecim, int *y_predecim);
  45. int dispc_ovl_enable(enum omap_plane plane, bool enable);
  46. bool dispc_ovl_enabled(enum omap_plane plane);
  47. void dispc_ovl_set_channel_out(enum omap_plane plane,
  48. enum omap_channel channel);
  49. int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
  50. bool replication, const struct omap_video_timings *mgr_timings,
  51. bool mem_to_mem);
  52. enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel);
  53. struct dss_mgr_ops {
  54. int (*connect)(struct omap_overlay_manager *mgr,
  55. struct omap_dss_device *dst);
  56. void (*disconnect)(struct omap_overlay_manager *mgr,
  57. struct omap_dss_device *dst);
  58. void (*start_update)(struct omap_overlay_manager *mgr);
  59. int (*enable)(struct omap_overlay_manager *mgr);
  60. void (*disable)(struct omap_overlay_manager *mgr);
  61. void (*set_timings)(struct omap_overlay_manager *mgr,
  62. const struct omap_video_timings *timings);
  63. void (*set_lcd_config)(struct omap_overlay_manager *mgr,
  64. const struct dss_lcd_mgr_config *config);
  65. int (*register_framedone_handler)(struct omap_overlay_manager *mgr,
  66. void (*handler)(void *), void *data);
  67. void (*unregister_framedone_handler)(struct omap_overlay_manager *mgr,
  68. void (*handler)(void *), void *data);
  69. };
  70. int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
  71. void dss_uninstall_mgr_ops(void);
  72. int dss_mgr_connect(struct omap_overlay_manager *mgr,
  73. struct omap_dss_device *dst);
  74. void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
  75. struct omap_dss_device *dst);
  76. void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
  77. const struct omap_video_timings *timings);
  78. void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
  79. const struct dss_lcd_mgr_config *config);
  80. int dss_mgr_enable(struct omap_overlay_manager *mgr);
  81. void dss_mgr_disable(struct omap_overlay_manager *mgr);
  82. void dss_mgr_start_update(struct omap_overlay_manager *mgr);
  83. int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
  84. void (*handler)(void *), void *data);
  85. void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
  86. void (*handler)(void *), void *data);
  87. #endif /* __OMAP_DRM_DSS_H */