• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
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 
8 struct drm_fb_helper_surface_size;
9 struct drm_framebuffer_funcs;
10 struct drm_fb_helper_funcs;
11 struct drm_framebuffer;
12 struct drm_fb_helper;
13 struct drm_device;
14 struct drm_file;
15 struct drm_mode_fb_cmd2;
16 struct drm_plane;
17 struct drm_plane_state;
18 
19 struct drm_fbdev_cma *drm_fbdev_cma_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 struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
23 	unsigned int preferred_bpp, unsigned int max_conn_count);
24 void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma);
25 
26 void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
27 void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);
28 void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, bool state);
29 void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma,
30 					bool state);
31 
32 void drm_fb_cma_destroy(struct drm_framebuffer *fb);
33 int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
34 	struct drm_file *file_priv, unsigned int *handle);
35 
36 struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device *dev,
37 	struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd,
38 	const struct drm_framebuffer_funcs *funcs);
39 struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
40 	struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd);
41 
42 struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
43 	unsigned int plane);
44 
45 dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb,
46 				   struct drm_plane_state *state,
47 				   unsigned int plane);
48 
49 int drm_fb_cma_prepare_fb(struct drm_plane *plane,
50 			  struct drm_plane_state *state);
51 
52 #ifdef CONFIG_DEBUG_FS
53 struct seq_file;
54 
55 int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
56 #endif
57 
58 #endif
59 
60