aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/drm/drm_gem_framebuffer_helper.h
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@collabora.com>2020-03-11 15:55:37 +0100
committerAndrzej Pietrasiewicz <andrzej.p@collabora.com>2020-03-18 11:22:05 +0100
commit55f7f72753abdd46f35d027a25b43969dba56fac (patch)
tree6dee98cd03188b360d3ac017ccf93f55e137c86c /include/drm/drm_gem_framebuffer_helper.h
parentdrm/core: Allow drivers allocate a subclass of struct drm_framebuffer (diff)
downloadwireguard-linux-55f7f72753abdd46f35d027a25b43969dba56fac.tar.xz
wireguard-linux-55f7f72753abdd46f35d027a25b43969dba56fac.zip
drm/core: Add drm_afbc_framebuffer and a corresponding helper
The new struct contains afbc-specific data. The new function can be used by drivers which support afbc to complete the preparation of struct drm_afbc_framebuffer. It must be called after allocating the said struct and calling drm_gem_fb_init_with_funcs(). 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-3-andrzej.p@collabora.com
Diffstat (limited to 'include/drm/drm_gem_framebuffer_helper.h')
-rw-r--r--include/drm/drm_gem_framebuffer_helper.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/drm/drm_gem_framebuffer_helper.h b/include/drm/drm_gem_framebuffer_helper.h
index c029c1618661..6b013154911d 100644
--- a/include/drm/drm_gem_framebuffer_helper.h
+++ b/include/drm/drm_gem_framebuffer_helper.h
@@ -1,6 +1,7 @@
#ifndef __DRM_GEM_FB_HELPER_H__
#define __DRM_GEM_FB_HELPER_H__
+struct drm_afbc_framebuffer;
struct drm_device;
struct drm_fb_helper_surface_size;
struct drm_file;
@@ -12,6 +13,8 @@ struct drm_plane;
struct drm_plane_state;
struct drm_simple_display_pipe;
+#define AFBC_VENDOR_AND_TYPE_MASK GENMASK_ULL(63, 52)
+
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);
@@ -34,6 +37,13 @@ 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);
+#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);
+
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,