blob: 8dd6e5585e513eb898145adf173da166b2fd89bc [file] [log] [blame]
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +02001#ifndef __DRM_FB_CMA_HELPER_H__
2#define __DRM_FB_CMA_HELPER_H__
3
4struct drm_fbdev_cma;
5struct drm_gem_cma_object;
6
Noralf Trønnes199c7712016-04-28 17:18:35 +02007struct drm_fb_helper_surface_size;
8struct drm_framebuffer_funcs;
9struct drm_fb_helper_funcs;
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020010struct drm_framebuffer;
Noralf Trønnes199c7712016-04-28 17:18:35 +020011struct drm_fb_helper;
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020012struct drm_device;
13struct drm_file;
14struct drm_mode_fb_cmd2;
Marek Vasut196594e2016-11-15 11:55:29 +010015struct drm_plane;
16struct drm_plane_state;
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020017
Noralf Trønnes199c7712016-04-28 17:18:35 +020018struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev,
19 unsigned int preferred_bpp, unsigned int num_crtc,
Daniel Vetterb1124812016-12-29 21:48:31 +010020 unsigned int max_conn_count, const struct drm_framebuffer_funcs *funcs);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020021struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
22 unsigned int preferred_bpp, unsigned int num_crtc,
23 unsigned int max_conn_count);
24void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma);
25
26void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
27void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);
Stefan Agner917f4252016-02-11 17:30:14 -080028void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, int state);
Noralf Trønnesa4405b52017-01-22 19:11:09 +010029void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma,
30 int state);
Noralf Trønnes199c7712016-04-28 17:18:35 +020031
32void drm_fb_cma_destroy(struct drm_framebuffer *fb);
33int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
34 struct drm_file *file_priv, unsigned int *handle);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020035
Noralf Trønnes3995b392016-05-12 20:25:22 +020036struct 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);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020039struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
Ville Syrjälä1eb83452015-11-11 19:11:29 +020040 struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020041
42struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
43 unsigned int plane);
44
Marek Vasut14d7f962016-11-14 11:07:31 +010045int drm_fb_cma_prepare_fb(struct drm_plane *plane,
46 struct drm_plane_state *state);
47
Rob Clark6f646092012-12-10 10:46:43 -060048#ifdef CONFIG_DEBUG_FS
Maxime Ripard80588a82016-02-08 13:58:56 +010049struct seq_file;
50
Rob Clark6f646092012-12-10 10:46:43 -060051int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
52#endif
53
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020054#endif
55