1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved
9 #include "dpu_hw_catalog.h"
10 #include "dpu_hw_mdss.h"
11 #include "dpu_hw_top.h"
12 #include "dpu_hw_util.h"
13 #include "dpu_hw_pingpong.h"
17 struct dpu_hw_wb_cfg {
18 struct dpu_hw_fmt_layout dest;
19 enum dpu_intf_mode intf_mode;
26 * struct dpu_hw_wb_ops : Interface to the wb hw driver functions
27 * Assumption is these functions will be called after clocks are enabled
28 * @setup_outaddress: setup output address from the writeback job
29 * @setup_outformat: setup output format of writeback block from writeback job
30 * @setup_qos_lut: setup qos LUT for writeback block based on input
31 * @setup_cdp: setup chroma down prefetch block for writeback block
32 * @setup_clk_force_ctrl: setup clock force control
33 * @bind_pingpong_blk: enable/disable the connection with ping-pong block
35 struct dpu_hw_wb_ops {
36 void (*setup_outaddress)(struct dpu_hw_wb *ctx,
37 struct dpu_hw_wb_cfg *wb);
39 void (*setup_outformat)(struct dpu_hw_wb *ctx,
40 struct dpu_hw_wb_cfg *wb,
41 const struct msm_format *fmt);
43 void (*setup_roi)(struct dpu_hw_wb *ctx,
44 struct dpu_hw_wb_cfg *wb);
46 void (*setup_qos_lut)(struct dpu_hw_wb *ctx,
47 struct dpu_hw_qos_cfg *cfg);
49 void (*setup_cdp)(struct dpu_hw_wb *ctx,
50 const struct msm_format *fmt,
53 bool (*setup_clk_force_ctrl)(struct dpu_hw_wb *ctx,
56 void (*bind_pingpong_blk)(struct dpu_hw_wb *ctx,
57 const enum dpu_pingpong pp);
61 * struct dpu_hw_wb : WB driver object
62 * @hw: block hardware details
63 * @idx: hardware index number within type
64 * @wb_hw_caps: hardware capabilities
65 * @ops: function pointers
68 struct dpu_hw_blk_reg_map hw;
72 const struct dpu_wb_cfg *caps;
75 struct dpu_hw_wb_ops ops;
79 * dpu_hw_wb_init() - Initializes the writeback hw driver object.
80 * @dev: Corresponding device for devres management
81 * @cfg: wb_path catalog entry for which driver object is required
82 * @addr: mapped register io address of MDP
83 * @mdss_rev: dpu core's major and minor versions
84 * Return: Error code or allocated dpu_hw_wb context
86 struct dpu_hw_wb *dpu_hw_wb_init(struct drm_device *dev,
87 const struct dpu_wb_cfg *cfg,
89 const struct dpu_mdss_version *mdss_rev);
91 #endif /*_DPU_HW_WB_H */