Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 1 | #ifndef __DRM_FB_CMA_HELPER_H__ |
| 2 | #define __DRM_FB_CMA_HELPER_H__ |
| 3 | |
| 4 | struct drm_fbdev_cma; |
| 5 | struct drm_gem_cma_object; |
| 6 | |
Noralf Trønnes | 199c771 | 2016-04-28 17:18:35 +0200 | [diff] [blame] | 7 | struct drm_fb_helper_surface_size; |
| 8 | struct drm_framebuffer_funcs; |
| 9 | struct drm_fb_helper_funcs; |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 10 | struct drm_framebuffer; |
Noralf Trønnes | 199c771 | 2016-04-28 17:18:35 +0200 | [diff] [blame] | 11 | struct drm_fb_helper; |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 12 | struct drm_device; |
| 13 | struct drm_file; |
| 14 | struct drm_mode_fb_cmd2; |
Marek Vasut | 196594e | 2016-11-15 11:55:29 +0100 | [diff] [blame] | 15 | struct drm_plane; |
| 16 | struct drm_plane_state; |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 17 | |
Noralf Trønnes | 199c771 | 2016-04-28 17:18:35 +0200 | [diff] [blame] | 18 | struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev, |
Gabriel Krisman Bertazi | e4563f6 | 2017-02-02 14:26:40 -0200 | [diff] [blame] | 19 | unsigned int preferred_bpp, unsigned int max_conn_count, |
| 20 | const struct drm_framebuffer_funcs *funcs); |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 21 | struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev, |
Gabriel Krisman Bertazi | e4563f6 | 2017-02-02 14:26:40 -0200 | [diff] [blame] | 22 | unsigned int preferred_bpp, unsigned int max_conn_count); |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 23 | void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma); |
| 24 | |
| 25 | void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma); |
| 26 | void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma); |
Liviu Dudau | d0a2987 | 2017-06-20 11:23:20 +0100 | [diff] [blame] | 27 | void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, bool state); |
Noralf Trønnes | a4405b5 | 2017-01-22 19:11:09 +0100 | [diff] [blame] | 28 | void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma, |
Liviu Dudau | d0a2987 | 2017-06-20 11:23:20 +0100 | [diff] [blame] | 29 | bool state); |
Noralf Trønnes | 199c771 | 2016-04-28 17:18:35 +0200 | [diff] [blame] | 30 | |
| 31 | void drm_fb_cma_destroy(struct drm_framebuffer *fb); |
| 32 | int drm_fb_cma_create_handle(struct drm_framebuffer *fb, |
| 33 | struct drm_file *file_priv, unsigned int *handle); |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 34 | |
Noralf Trønnes | 3995b39 | 2016-05-12 20:25:22 +0200 | [diff] [blame] | 35 | struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device *dev, |
| 36 | struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd, |
| 37 | const struct drm_framebuffer_funcs *funcs); |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 38 | struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev, |
Ville Syrjälä | 1eb8345 | 2015-11-11 19:11:29 +0200 | [diff] [blame] | 39 | struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd); |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 40 | |
| 41 | struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, |
| 42 | unsigned int plane); |
| 43 | |
Yannick Fertre | 4636ce9 | 2017-04-14 12:13:32 +0200 | [diff] [blame] | 44 | dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb, |
| 45 | struct drm_plane_state *state, |
| 46 | unsigned int plane); |
| 47 | |
Marek Vasut | 14d7f96 | 2016-11-14 11:07:31 +0100 | [diff] [blame] | 48 | int drm_fb_cma_prepare_fb(struct drm_plane *plane, |
| 49 | struct drm_plane_state *state); |
| 50 | |
Rob Clark | 6f64609 | 2012-12-10 10:46:43 -0600 | [diff] [blame] | 51 | #ifdef CONFIG_DEBUG_FS |
Maxime Ripard | 80588a8 | 2016-02-08 13:58:56 +0100 | [diff] [blame] | 52 | struct seq_file; |
| 53 | |
Rob Clark | 6f64609 | 2012-12-10 10:46:43 -0600 | [diff] [blame] | 54 | int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg); |
| 55 | #endif |
| 56 | |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 57 | #endif |
| 58 | |