diff options
| author | Andrzej Pietrasiewicz <[email protected]> | 2020-03-11 14:55:37 +0000 |
|---|---|---|
| committer | Andrzej Pietrasiewicz <[email protected]> | 2020-03-18 10:22:05 +0000 |
| commit | 55f7f72753abdd46f35d027a25b43969dba56fac (patch) | |
| tree | 6dee98cd03188b360d3ac017ccf93f55e137c86c /include/drm/drm_framebuffer.h | |
| parent | drm/core: Allow drivers allocate a subclass of struct drm_framebuffer (diff) | |
| download | kernel-55f7f72753abdd46f35d027a25b43969dba56fac.tar.gz kernel-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 <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Reviewed-by: James Qian Wang <[email protected]>
Acked-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'include/drm/drm_framebuffer.h')
| -rw-r--r-- | include/drm/drm_framebuffer.h | 45 |
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 |
