Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / gpu / drm / msm / disp / dpu1 / dpu_hw_dspp.h
blob7fa189cfcb065f90b866b1ab1488f843b37e2cb4
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
3 */
5 #ifndef _DPU_HW_DSPP_H
6 #define _DPU_HW_DSPP_H
8 #include "dpu_hw_blk.h"
10 struct dpu_hw_dspp;
12 /**
13 * struct dpu_hw_pcc_coeff - PCC coefficient structure for each color
14 * component.
15 * @r: red coefficient.
16 * @g: green coefficient.
17 * @b: blue coefficient.
20 struct dpu_hw_pcc_coeff {
21 __u32 r;
22 __u32 g;
23 __u32 b;
26 /**
27 * struct dpu_hw_pcc - pcc feature structure
28 * @r: red coefficients.
29 * @g: green coefficients.
30 * @b: blue coefficients.
32 struct dpu_hw_pcc_cfg {
33 struct dpu_hw_pcc_coeff r;
34 struct dpu_hw_pcc_coeff g;
35 struct dpu_hw_pcc_coeff b;
38 /**
39 * struct dpu_hw_dspp_ops - interface to the dspp hardware driver functions
40 * Caller must call the init function to get the dspp context for each dspp
41 * Assumption is these functions will be called after clocks are enabled
43 struct dpu_hw_dspp_ops {
44 /**
45 * setup_pcc - setup dspp pcc
46 * @ctx: Pointer to dspp context
47 * @cfg: Pointer to configuration
49 void (*setup_pcc)(struct dpu_hw_dspp *ctx, struct dpu_hw_pcc_cfg *cfg);
53 /**
54 * struct dpu_hw_dspp - dspp description
55 * @base: Hardware block base structure
56 * @hw: Block hardware details
57 * @idx: DSPP index
58 * @cap: Pointer to layer_cfg
59 * @ops: Pointer to operations possible for this DSPP
61 struct dpu_hw_dspp {
62 struct dpu_hw_blk base;
63 struct dpu_hw_blk_reg_map hw;
65 /* dspp */
66 int idx;
67 const struct dpu_dspp_cfg *cap;
69 /* Ops */
70 struct dpu_hw_dspp_ops ops;
73 /**
74 * dpu_hw_dspp - convert base object dpu_hw_base to container
75 * @hw: Pointer to base hardware block
76 * return: Pointer to hardware block container
78 static inline struct dpu_hw_dspp *to_dpu_hw_dspp(struct dpu_hw_blk *hw)
80 return container_of(hw, struct dpu_hw_dspp, base);
83 /**
84 * dpu_hw_dspp_init - initializes the dspp hw driver object.
85 * should be called once before accessing every dspp.
86 * @idx: DSPP index for which driver object is required
87 * @addr: Mapped register io address of MDP
88 * @Return: pointer to structure or ERR_PTR
90 struct dpu_hw_dspp *dpu_hw_dspp_init(enum dpu_dspp idx,
91 void __iomem *addr, const struct dpu_mdss_cfg *m);
93 /**
94 * dpu_hw_dspp_destroy(): Destroys DSPP driver context
95 * @dspp: Pointer to DSPP driver context
97 void dpu_hw_dspp_destroy(struct dpu_hw_dspp *dspp);
99 #endif /*_DPU_HW_DSPP_H */