1 /* SPDX-License-Identifier: GPL-2.0 */
3 * (C) COPYRIGHT 2018 ARM Limited. All rights reserved.
4 * Author: James.Qian.Wang <james.qian.wang@arm.com>
7 #ifndef _KOMEDA_FRAMEBUFFER_H_
8 #define _KOMEDA_FRAMEBUFFER_H_
10 #include <drm/drm_framebuffer.h>
11 #include "komeda_format_caps.h"
14 * struct komeda_fb - Entending drm_framebuffer with komeda attribute
17 /** @base: &drm_framebuffer */
18 struct drm_framebuffer base;
21 * extends drm_format_info for komeda specific information
23 const struct komeda_format_caps *format_caps;
24 /** @is_va: if smmu is enabled, it will be true */
26 /** @aligned_w: aligned frame buffer width */
28 /** @aligned_h: aligned frame buffer height */
30 /** @afbc_size: minimum size of afbc */
32 /** @offset_payload: start of afbc body buffer */
36 #define to_kfb(dfb) container_of(dfb, struct komeda_fb, base)
38 struct drm_framebuffer *
39 komeda_fb_create(struct drm_device *dev, struct drm_file *file,
40 const struct drm_mode_fb_cmd2 *mode_cmd);
41 int komeda_fb_check_src_coords(const struct komeda_fb *kfb,
42 u32 src_x, u32 src_y, u32 src_w, u32 src_h);
44 komeda_fb_get_pixel_addr(struct komeda_fb *kfb, int x, int y, int plane);
45 bool komeda_fb_is_layer_supported(struct komeda_fb *kfb, u32 layer_type,