Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 2 | #ifndef __DRM_FB_CMA_HELPER_H__ |
| 3 | #define __DRM_FB_CMA_HELPER_H__ |
| 4 | |
| 5 | struct drm_fbdev_cma; |
| 6 | struct drm_gem_cma_object; |
| 7 | |
Noralf Trønnes | 199c771 | 2016-04-28 17:18:35 +0200 | [diff] [blame] | 8 | struct drm_fb_helper_surface_size; |
| 9 | struct drm_framebuffer_funcs; |
| 10 | struct drm_fb_helper_funcs; |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 11 | struct drm_framebuffer; |
Noralf Trønnes | 199c771 | 2016-04-28 17:18:35 +0200 | [diff] [blame] | 12 | struct drm_fb_helper; |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 13 | struct drm_device; |
| 14 | struct drm_file; |
| 15 | struct drm_mode_fb_cmd2; |
Marek Vasut | 196594e | 2016-11-15 11:55:29 +0100 | [diff] [blame] | 16 | struct drm_plane; |
| 17 | struct drm_plane_state; |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 18 | |
Noralf Trønnes | 41b676e | 2017-11-15 15:19:41 +0100 | [diff] [blame] | 19 | int drm_fb_cma_fbdev_init(struct drm_device *dev, unsigned int preferred_bpp, |
| 20 | unsigned int max_conn_count); |
| 21 | void drm_fb_cma_fbdev_fini(struct drm_device *dev); |
| 22 | |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 23 | 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] | 24 | unsigned int preferred_bpp, unsigned int max_conn_count); |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 25 | void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma); |
| 26 | |
| 27 | void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma); |
| 28 | void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma); |
Liviu Dudau | d0a2987 | 2017-06-20 11:23:20 +0100 | [diff] [blame] | 29 | 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] | 30 | 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] | 31 | bool state); |
Noralf Trønnes | 199c771 | 2016-04-28 17:18:35 +0200 | [diff] [blame] | 32 | |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 33 | struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, |
| 34 | unsigned int plane); |
| 35 | |
Yannick Fertre | 4636ce9 | 2017-04-14 12:13:32 +0200 | [diff] [blame] | 36 | dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb, |
| 37 | struct drm_plane_state *state, |
| 38 | unsigned int plane); |
| 39 | |
Lars-Peter Clausen | 2e3b3c4 | 2012-07-02 16:37:47 +0200 | [diff] [blame] | 40 | #endif |
| 41 | |