blob: fd0dde9f0a6d9f6bcbb3c69d14d7934d340f474d [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);
Noralf Trønnes199c7712016-04-28 17:18:35 +020026int drm_fbdev_cma_create_with_funcs(struct drm_fb_helper *helper,
27 struct drm_fb_helper_surface_size *sizes,
Noralf Trønnesfdce1842016-05-12 20:25:21 +020028 const struct drm_framebuffer_funcs *funcs);
Noralf Trønnes199c7712016-04-28 17:18:35 +020029
30void drm_fb_cma_destroy(struct drm_framebuffer *fb);
31int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
32 struct drm_file *file_priv, unsigned int *handle);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020033
Noralf Trønnes3995b392016-05-12 20:25:22 +020034struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device *dev,
35 struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd,
36 const struct drm_framebuffer_funcs *funcs);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020037struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
Ville Syrjälä1eb83452015-11-11 19:11:29 +020038 struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020039
40struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
41 unsigned int plane);
42
Rob Clark6f646092012-12-10 10:46:43 -060043#ifdef CONFIG_DEBUG_FS
Maxime Ripard80588a82016-02-08 13:58:56 +010044struct seq_file;
45
Rob Clark6f646092012-12-10 10:46:43 -060046int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
47#endif
48
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020049#endif
50