blob: f313211f8ed52f1e1ecf0a7224a8dd3c26715367 [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;
15
Noralf Trønnes199c7712016-04-28 17:18:35 +020016struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev,
17 unsigned int preferred_bpp, unsigned int num_crtc,
18 unsigned int max_conn_count, const struct drm_fb_helper_funcs *funcs);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020019struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
20 unsigned int preferred_bpp, unsigned int num_crtc,
21 unsigned int max_conn_count);
22void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma);
23
24void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
25void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);
Stefan Agner917f4252016-02-11 17:30:14 -080026void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, int state);
Noralf Trønnes199c7712016-04-28 17:18:35 +020027int drm_fbdev_cma_create_with_funcs(struct drm_fb_helper *helper,
28 struct drm_fb_helper_surface_size *sizes,
Noralf Trønnesfdce1842016-05-12 20:25:21 +020029 const struct drm_framebuffer_funcs *funcs);
Noralf Trønnes199c7712016-04-28 17:18:35 +020030
31void drm_fb_cma_destroy(struct drm_framebuffer *fb);
32int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
33 struct drm_file *file_priv, unsigned int *handle);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020034
Noralf Trønnes3995b392016-05-12 20:25:22 +020035struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device *dev,
36 struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd,
37 const struct drm_framebuffer_funcs *funcs);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020038struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
Ville Syrjälä1eb83452015-11-11 19:11:29 +020039 struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020040
41struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
42 unsigned int plane);
43
Rob Clark6f646092012-12-10 10:46:43 -060044#ifdef CONFIG_DEBUG_FS
Maxime Ripard80588a82016-02-08 13:58:56 +010045struct seq_file;
46
Rob Clark6f646092012-12-10 10:46:43 -060047int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
48#endif
49
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020050#endif
51