blob: 3b00f6480b838b38ecb1ac253009f44d332898df [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 Vasut4b593e62016-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,
20 unsigned int max_conn_count, const struct drm_fb_helper_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ønnes199c7712016-04-28 17:18:35 +020029int drm_fbdev_cma_create_with_funcs(struct drm_fb_helper *helper,
30 struct drm_fb_helper_surface_size *sizes,
Noralf Trønnesfdce1842016-05-12 20:25:21 +020031 const struct drm_framebuffer_funcs *funcs);
Noralf Trønnes199c7712016-04-28 17:18:35 +020032
33void drm_fb_cma_destroy(struct drm_framebuffer *fb);
34int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
35 struct drm_file *file_priv, unsigned int *handle);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020036
Noralf Trønnes3995b392016-05-12 20:25:22 +020037struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device *dev,
38 struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd,
39 const struct drm_framebuffer_funcs *funcs);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020040struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
Ville Syrjälä1eb83452015-11-11 19:11:29 +020041 struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020042
43struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
44 unsigned int plane);
45
Marek Vasutcdf014c2016-11-14 11:07:31 +010046int drm_fb_cma_prepare_fb(struct drm_plane *plane,
47 struct drm_plane_state *state);
48
Rob Clark6f646092012-12-10 10:46:43 -060049#ifdef CONFIG_DEBUG_FS
Maxime Ripard80588a82016-02-08 13:58:56 +010050struct seq_file;
51
Rob Clark6f646092012-12-10 10:46:43 -060052int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
53#endif
54
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020055#endif
56