summaryrefslogtreecommitdiff
path: root/include/drm/drm_framebuffer.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_framebuffer.h
parentf2b816d78a94319b7230430c3d1f99d9f1cb5bd0 (diff)
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_framebuffer.h')
-rw-r--r--include/drm/drm_framebuffer.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/drm/drm_framebuffer.h b/include/drm/drm_framebuffer.h
index c0e0256e3e98..e9f1b0e2968d 100644
--- a/include/drm/drm_framebuffer.h
+++ b/include/drm/drm_framebuffer.h
@@ -297,4 +297,49 @@ int drm_framebuffer_plane_width(int width,
int drm_framebuffer_plane_height(int height,
const struct drm_framebuffer *fb, int plane);
+/**
+ * struct drm_afbc_framebuffer - a special afbc frame buffer object
+ *
+ * A derived class of struct drm_framebuffer, dedicated for afbc use cases.
+ */
+struct drm_afbc_framebuffer {
+ /**
+ * @base: base framebuffer structure.
+ */
+ struct drm_framebuffer base;
+ /**
+ * @block_widht: width of a single afbc block
+ */
+ u32 block_width;
+ /**
+ * @block_widht: height of a single afbc block
+ */
+ u32 block_height;
+ /**
+ * @aligned_width: aligned frame buffer width
+ */
+ u32 aligned_width;
+ /**
+ * @aligned_height: aligned frame buffer height
+ */
+ u32 aligned_height;
+ /**
+ * @offset: offset of the first afbc header
+ */
+ u32 offset;
+ /**
+ * @afbc_size: minimum size of afbc buffer
+ */
+ u32 afbc_size;
+ /**
+ * @bpp: bpp value for this afbc buffer
+ * To be removed when users such as malidp
+ * properly store the cpp in drm_format_info.
+ * New users should not start using this field.
+ */
+ u32 bpp;
+};
+
+#define fb_to_afbc_fb(x) container_of(x, struct drm_afbc_framebuffer, base)
+
#endif