1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __DRM_FB_CMA_HELPER_H__
3 #define __DRM_FB_CMA_HELPER_H__
6 struct drm_gem_cma_object;
8 struct drm_fb_helper_surface_size;
9 struct drm_framebuffer_funcs;
10 struct drm_fb_helper_funcs;
11 struct drm_framebuffer;
15 struct drm_mode_fb_cmd2;
17 struct drm_plane_state;
19 int drm_fb_cma_fbdev_init_with_funcs(struct drm_device *dev,
20 unsigned int preferred_bpp, unsigned int max_conn_count,
21 const struct drm_framebuffer_funcs *funcs);
22 int drm_fb_cma_fbdev_init(struct drm_device *dev, unsigned int preferred_bpp,
23 unsigned int max_conn_count);
24 void drm_fb_cma_fbdev_fini(struct drm_device *dev);
26 struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev,
27 unsigned int preferred_bpp, unsigned int max_conn_count,
28 const struct drm_framebuffer_funcs *funcs);
29 struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
30 unsigned int preferred_bpp, unsigned int max_conn_count);
31 void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma);
33 void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
34 void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);
35 void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, bool state);
36 void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma,
39 struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
42 dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb,
43 struct drm_plane_state *state,