Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * (C) COPYRIGHT 2018 ARM Limited. All rights reserved.
0004  * Author: James.Qian.Wang <james.qian.wang@arm.com>
0005  *
0006  */
0007 #ifndef _KOMEDA_FRAMEBUFFER_H_
0008 #define _KOMEDA_FRAMEBUFFER_H_
0009 
0010 #include <drm/drm_framebuffer.h>
0011 #include "komeda_format_caps.h"
0012 
0013 /**
0014  * struct komeda_fb - Entending drm_framebuffer with komeda attribute
0015  */
0016 struct komeda_fb {
0017     /** @base: &drm_framebuffer */
0018     struct drm_framebuffer base;
0019     /**
0020      * @format_caps:
0021      * extends drm_format_info for komeda specific information
0022      */
0023     const struct komeda_format_caps *format_caps;
0024     /** @is_va: if smmu is enabled, it will be true */
0025     bool is_va;
0026     /** @aligned_w: aligned frame buffer width */
0027     u32 aligned_w;
0028     /** @aligned_h: aligned frame buffer height */
0029     u32 aligned_h;
0030     /** @afbc_size: minimum size of afbc */
0031     u32 afbc_size;
0032     /** @offset_payload: start of afbc body buffer */
0033     u32 offset_payload;
0034 };
0035 
0036 #define to_kfb(dfb) container_of(dfb, struct komeda_fb, base)
0037 
0038 struct drm_framebuffer *
0039 komeda_fb_create(struct drm_device *dev, struct drm_file *file,
0040         const struct drm_mode_fb_cmd2 *mode_cmd);
0041 int komeda_fb_check_src_coords(const struct komeda_fb *kfb,
0042                    u32 src_x, u32 src_y, u32 src_w, u32 src_h);
0043 dma_addr_t
0044 komeda_fb_get_pixel_addr(struct komeda_fb *kfb, int x, int y, int plane);
0045 bool komeda_fb_is_layer_supported(struct komeda_fb *kfb, u32 layer_type,
0046         u32 rot);
0047 
0048 #endif