2017-08-13 07:31:44 -06:00
|
|
|
#ifndef __DRM_GEM_FB_HELPER_H__
|
|
|
|
#define __DRM_GEM_FB_HELPER_H__
|
|
|
|
|
2020-03-11 08:55:37 -06:00
|
|
|
struct drm_afbc_framebuffer;
|
2017-08-13 07:31:44 -06:00
|
|
|
struct drm_device;
|
|
|
|
struct drm_fb_helper_surface_size;
|
2017-09-11 10:37:45 -06:00
|
|
|
struct drm_file;
|
2017-08-13 07:31:44 -06:00
|
|
|
struct drm_framebuffer;
|
|
|
|
struct drm_framebuffer_funcs;
|
|
|
|
struct drm_gem_object;
|
|
|
|
struct drm_mode_fb_cmd2;
|
|
|
|
struct drm_plane;
|
|
|
|
struct drm_plane_state;
|
2018-04-05 09:44:42 -06:00
|
|
|
struct drm_simple_display_pipe;
|
2017-08-13 07:31:44 -06:00
|
|
|
|
2020-03-11 08:55:37 -06:00
|
|
|
#define AFBC_VENDOR_AND_TYPE_MASK GENMASK_ULL(63, 52)
|
|
|
|
|
2017-08-13 07:31:44 -06:00
|
|
|
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);
|
|
|
|
|
2020-03-11 08:55:36 -06:00
|
|
|
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);
|
2017-08-13 07:31:44 -06:00
|
|
|
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);
|
2019-01-14 21:36:39 -07:00
|
|
|
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);
|
2017-08-13 07:31:44 -06:00
|
|
|
|
2020-03-11 08:55:37 -06:00
|
|
|
#define drm_is_afbc(modifier) \
|
|
|
|
(((modifier) & AFBC_VENDOR_AND_TYPE_MASK) == DRM_FORMAT_MOD_ARM_AFBC(0))
|
|
|
|
|
|
|
|
int drm_gem_fb_afbc_init(struct drm_device *dev,
|
|
|
|
const struct drm_mode_fb_cmd2 *mode_cmd,
|
|
|
|
struct drm_afbc_framebuffer *afbc_fb);
|
|
|
|
|
2017-08-13 07:31:44 -06:00
|
|
|
int drm_gem_fb_prepare_fb(struct drm_plane *plane,
|
|
|
|
struct drm_plane_state *state);
|
2018-04-05 09:44:42 -06:00
|
|
|
int drm_gem_fb_simple_display_pipe_prepare_fb(struct drm_simple_display_pipe *pipe,
|
|
|
|
struct drm_plane_state *plane_state);
|
2017-08-13 07:31:44 -06:00
|
|
|
#endif
|