f2b816d78a
Allow allocating a specialized version of struct drm_framebuffer by moving the actual fb allocation out of drm_gem_fb_create_with_funcs(); the respective functions names are adjusted to reflect that fact. Please note, though, that standard size checks are performed on buffers, so the drm_gem_fb_init_with_funcs() is useful for cases where those standard size checks are appropriate or at least don't conflict the checks to be performed in the specialized case. Thanks to this change the drivers can call drm_gem_fb_init_with_funcs() having allocated their special version of struct drm_framebuffer, exactly the way the new version of drm_gem_fb_create_with_funcs() does. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: James Qian Wang <james.qian.wang@arm.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20200311145541.29186-2-andrzej.p@collabora.com
42 lines
1.5 KiB
C
42 lines
1.5 KiB
C
#ifndef __DRM_GEM_FB_HELPER_H__
|
|
#define __DRM_GEM_FB_HELPER_H__
|
|
|
|
struct drm_device;
|
|
struct drm_fb_helper_surface_size;
|
|
struct drm_file;
|
|
struct drm_framebuffer;
|
|
struct drm_framebuffer_funcs;
|
|
struct drm_gem_object;
|
|
struct drm_mode_fb_cmd2;
|
|
struct drm_plane;
|
|
struct drm_plane_state;
|
|
struct drm_simple_display_pipe;
|
|
|
|
struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb,
|
|
unsigned int plane);
|
|
void drm_gem_fb_destroy(struct drm_framebuffer *fb);
|
|
int drm_gem_fb_create_handle(struct drm_framebuffer *fb, struct drm_file *file,
|
|
unsigned int *handle);
|
|
|
|
int drm_gem_fb_init_with_funcs(struct drm_device *dev,
|
|
struct drm_framebuffer *fb,
|
|
struct drm_file *file,
|
|
const struct drm_mode_fb_cmd2 *mode_cmd,
|
|
const struct drm_framebuffer_funcs *funcs);
|
|
struct drm_framebuffer *
|
|
drm_gem_fb_create_with_funcs(struct drm_device *dev, struct drm_file *file,
|
|
const struct drm_mode_fb_cmd2 *mode_cmd,
|
|
const struct drm_framebuffer_funcs *funcs);
|
|
struct drm_framebuffer *
|
|
drm_gem_fb_create(struct drm_device *dev, struct drm_file *file,
|
|
const struct drm_mode_fb_cmd2 *mode_cmd);
|
|
struct drm_framebuffer *
|
|
drm_gem_fb_create_with_dirty(struct drm_device *dev, struct drm_file *file,
|
|
const struct drm_mode_fb_cmd2 *mode_cmd);
|
|
|
|
int drm_gem_fb_prepare_fb(struct drm_plane *plane,
|
|
struct drm_plane_state *state);
|
|
int drm_gem_fb_simple_display_pipe_prepare_fb(struct drm_simple_display_pipe *pipe,
|
|
struct drm_plane_state *plane_state);
|
|
#endif
|