omapdss.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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_enable(enum omap_plane plane, bool enable);
  42. bool dispc_ovl_enabled(enum omap_plane plane);
  43. void dispc_ovl_set_channel_out(enum omap_plane plane,
  44. enum omap_channel channel);
  45. int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
  46. bool replication, const struct omap_video_timings *mgr_timings,
  47. bool mem_to_mem);
  48. enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel);
  49. struct dss_mgr_ops {
  50. int (*connect)(enum omap_channel channel,
  51. struct omap_dss_device *dst);
  52. void (*disconnect)(enum omap_channel channel,
  53. struct omap_dss_device *dst);
  54. void (*start_update)(enum omap_channel channel);
  55. int (*enable)(enum omap_channel channel);
  56. void (*disable)(enum omap_channel channel);
  57. void (*set_timings)(enum omap_channel channel,
  58. const struct omap_video_timings *timings);
  59. void (*set_lcd_config)(enum omap_channel channel,
  60. const struct dss_lcd_mgr_config *config);
  61. int (*register_framedone_handler)(enum omap_channel channel,
  62. void (*handler)(void *), void *data);
  63. void (*unregister_framedone_handler)(enum omap_channel channel,
  64. void (*handler)(void *), void *data);
  65. };
  66. int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
  67. void dss_uninstall_mgr_ops(void);
  68. int dss_mgr_connect(enum omap_channel channel,
  69. struct omap_dss_device *dst);
  70. void dss_mgr_disconnect(enum omap_channel channel,
  71. struct omap_dss_device *dst);
  72. void dss_mgr_set_timings(enum omap_channel channel,
  73. const struct omap_video_timings *timings);
  74. void dss_mgr_set_lcd_config(enum omap_channel channel,
  75. const struct dss_lcd_mgr_config *config);
  76. int dss_mgr_enable(enum omap_channel channel);
  77. void dss_mgr_disable(enum omap_channel channel);
  78. void dss_mgr_start_update(enum omap_channel channel);
  79. int dss_mgr_register_framedone_handler(enum omap_channel channel,
  80. void (*handler)(void *), void *data);
  81. void dss_mgr_unregister_framedone_handler(enum omap_channel channel,
  82. void (*handler)(void *), void *data);
  83. #endif /* __OMAP_DRM_DSS_H */