0001
0002
0003
0004
0005
0006 #ifndef _DPU_HW_WB_H
0007 #define _DPU_HW_WB_H
0008
0009 #include "dpu_hw_catalog.h"
0010 #include "dpu_hw_mdss.h"
0011 #include "dpu_hw_top.h"
0012 #include "dpu_hw_util.h"
0013 #include "dpu_hw_pingpong.h"
0014
0015 struct dpu_hw_wb;
0016
0017 struct dpu_hw_wb_cfg {
0018 struct dpu_hw_fmt_layout dest;
0019 enum dpu_intf_mode intf_mode;
0020 struct drm_rect roi;
0021 struct drm_rect crop;
0022 };
0023
0024
0025
0026
0027 enum {
0028 DPU_WB_CDP_PRELOAD_AHEAD_32,
0029 DPU_WB_CDP_PRELOAD_AHEAD_64
0030 };
0031
0032
0033
0034
0035
0036
0037
0038
0039 struct dpu_hw_wb_qos_cfg {
0040 u32 danger_lut;
0041 u32 safe_lut;
0042 u64 creq_lut;
0043 bool danger_safe_en;
0044 };
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056 struct dpu_hw_wb_ops {
0057 void (*setup_outaddress)(struct dpu_hw_wb *ctx,
0058 struct dpu_hw_wb_cfg *wb);
0059
0060 void (*setup_outformat)(struct dpu_hw_wb *ctx,
0061 struct dpu_hw_wb_cfg *wb);
0062
0063 void (*setup_roi)(struct dpu_hw_wb *ctx,
0064 struct dpu_hw_wb_cfg *wb);
0065
0066 void (*setup_qos_lut)(struct dpu_hw_wb *ctx,
0067 struct dpu_hw_wb_qos_cfg *cfg);
0068
0069 void (*setup_cdp)(struct dpu_hw_wb *ctx,
0070 struct dpu_hw_cdp_cfg *cfg);
0071
0072 void (*bind_pingpong_blk)(struct dpu_hw_wb *ctx,
0073 bool enable, const enum dpu_pingpong pp);
0074 };
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085 struct dpu_hw_wb {
0086 struct dpu_hw_blk_reg_map hw;
0087 const struct dpu_mdp_cfg *mdp;
0088
0089
0090 int idx;
0091 const struct dpu_wb_cfg *caps;
0092
0093
0094 struct dpu_hw_wb_ops ops;
0095
0096 struct dpu_hw_mdp *hw_mdp;
0097 };
0098
0099
0100
0101
0102
0103
0104
0105 struct dpu_hw_wb *dpu_hw_wb_init(enum dpu_wb idx,
0106 void __iomem *addr,
0107 const struct dpu_mdss_cfg *m);
0108
0109
0110
0111
0112
0113 void dpu_hw_wb_destroy(struct dpu_hw_wb *hw_wb);
0114
0115 #endif