blob: a323781afc3f3a73a6c0bdbdd7ac1dfc5b10e9a0 [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,
Gabriel Krisman Bertazie4563f62017-02-02 14:26:40 -020019 unsigned int preferred_bpp, unsigned int max_conn_count,
20 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,
Gabriel Krisman Bertazie4563f62017-02-02 14:26:40 -020022 unsigned int preferred_bpp, unsigned int max_conn_count);
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020023void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma);
24
25void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
26void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);
Liviu Dudaud0a29872017-06-20 11:23:20 +010027void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, bool state);
Noralf Trønnesa4405b52017-01-22 19:11:09 +010028void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma,
Liviu Dudaud0a29872017-06-20 11:23:20 +010029 bool state);
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
Yannick Fertre4636ce92017-04-14 12:13:32 +020044dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb,
45 struct drm_plane_state *state,
46 unsigned int plane);
47
Marek Vasut14d7f962016-11-14 11:07:31 +010048int drm_fb_cma_prepare_fb(struct drm_plane *plane,
49 struct drm_plane_state *state);
50
Rob Clark6f646092012-12-10 10:46:43 -060051#ifdef CONFIG_DEBUG_FS
Maxime Ripard80588a82016-02-08 13:58:56 +010052struct seq_file;
53
Rob Clark6f646092012-12-10 10:46:43 -060054int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
55#endif
56
Lars-Peter Clausen2e3b3c42012-07-02 16:37:47 +020057#endif
58