Merge 4.14.27 into android-4.14
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / include / drm / drm_fb_cma_helper.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
2e3b3c42
LPC
2#ifndef __DRM_FB_CMA_HELPER_H__
3#define __DRM_FB_CMA_HELPER_H__
4
5struct drm_fbdev_cma;
6struct drm_gem_cma_object;
7
199c7717
NT
8struct drm_fb_helper_surface_size;
9struct drm_framebuffer_funcs;
10struct drm_fb_helper_funcs;
2e3b3c42 11struct drm_framebuffer;
199c7717 12struct drm_fb_helper;
2e3b3c42
LPC
13struct drm_device;
14struct drm_file;
15struct drm_mode_fb_cmd2;
196594ef
MV
16struct drm_plane;
17struct drm_plane_state;
2e3b3c42 18
199c7717 19struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev,
e4563f6b
GKB
20 unsigned int preferred_bpp, unsigned int max_conn_count,
21 const struct drm_framebuffer_funcs *funcs);
2e3b3c42 22struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
e4563f6b 23 unsigned int preferred_bpp, unsigned int max_conn_count);
2e3b3c42
LPC
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);
d0a29878 28void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, bool state);
a4405b56 29void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma,
d0a29878 30 bool state);
199c7717
NT
31
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);
2e3b3c42 35
3995b395
NT
36struct 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);
2e3b3c42 39struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
1eb83451 40 struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd);
2e3b3c42
LPC
41
42struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
43 unsigned int plane);
44
4636ce93
YF
45dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb,
46 struct drm_plane_state *state,
47 unsigned int plane);
48
14d7f96f
MV
49int drm_fb_cma_prepare_fb(struct drm_plane *plane,
50 struct drm_plane_state *state);
51
6f646095 52#ifdef CONFIG_DEBUG_FS
80588a86
MR
53struct seq_file;
54
6f646095
RC
55int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
56#endif
57
2e3b3c42
LPC
58#endif
59