xref: /netbsd-src/sys/external/bsd/drm2/dist/include/drm/drm_gem_framebuffer_helper.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: drm_gem_framebuffer_helper.h,v 1.2 2021/12/18 23:45:46 riastradh Exp $	*/
2 
3 #ifndef __DRM_GEM_FB_HELPER_H__
4 #define __DRM_GEM_FB_HELPER_H__
5 
6 struct drm_device;
7 struct drm_fb_helper_surface_size;
8 struct drm_file;
9 struct drm_framebuffer;
10 struct drm_framebuffer_funcs;
11 struct drm_gem_object;
12 struct drm_mode_fb_cmd2;
13 struct drm_plane;
14 struct drm_plane_state;
15 struct drm_simple_display_pipe;
16 
17 struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb,
18 					  unsigned int plane);
19 void drm_gem_fb_destroy(struct drm_framebuffer *fb);
20 int drm_gem_fb_create_handle(struct drm_framebuffer *fb, struct drm_file *file,
21 			     unsigned int *handle);
22 
23 struct drm_framebuffer *
24 drm_gem_fb_create_with_funcs(struct drm_device *dev, struct drm_file *file,
25 			     const struct drm_mode_fb_cmd2 *mode_cmd,
26 			     const struct drm_framebuffer_funcs *funcs);
27 struct drm_framebuffer *
28 drm_gem_fb_create(struct drm_device *dev, struct drm_file *file,
29 		  const struct drm_mode_fb_cmd2 *mode_cmd);
30 struct drm_framebuffer *
31 drm_gem_fb_create_with_dirty(struct drm_device *dev, struct drm_file *file,
32 			     const struct drm_mode_fb_cmd2 *mode_cmd);
33 
34 int drm_gem_fb_prepare_fb(struct drm_plane *plane,
35 			  struct drm_plane_state *state);
36 int drm_gem_fb_simple_display_pipe_prepare_fb(struct drm_simple_display_pipe *pipe,
37 					      struct drm_plane_state *plane_state);
38 #endif
39