1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
8 #include "dpu_hw_mdss.h"
9 #include "dpu_hw_util.h"
10 #include "dpu_hw_blk.h"
14 struct dpu_hw_mixer_cfg
{
21 struct dpu_hw_color3_cfg
{
22 u8 keep_fg
[DPU_STAGE_MAX
];
27 * struct dpu_hw_lm_ops : Interface to the mixer Hw driver functions
28 * Assumption is these functions will be called after clocks are enabled
30 struct dpu_hw_lm_ops
{
32 * Sets up mixer output width and height
33 * and border color if enabled
35 void (*setup_mixer_out
)(struct dpu_hw_mixer
*ctx
,
36 struct dpu_hw_mixer_cfg
*cfg
);
39 * Alpha blending configuration
40 * for the specified stage
42 void (*setup_blend_config
)(struct dpu_hw_mixer
*ctx
, uint32_t stage
,
43 uint32_t fg_alpha
, uint32_t bg_alpha
, uint32_t blend_op
);
46 * Alpha color component selection from either fg or bg
48 void (*setup_alpha_out
)(struct dpu_hw_mixer
*ctx
, uint32_t mixer_op
);
51 * setup_border_color : enable/disable border color
53 void (*setup_border_color
)(struct dpu_hw_mixer
*ctx
,
54 struct dpu_mdss_color
*color
,
59 struct dpu_hw_blk base
;
60 struct dpu_hw_blk_reg_map hw
;
64 const struct dpu_lm_cfg
*cap
;
65 const struct dpu_mdp_cfg
*mdp
;
66 const struct dpu_ctl_cfg
*ctl
;
69 struct dpu_hw_lm_ops ops
;
71 /* store mixer info specific to display */
72 struct dpu_hw_mixer_cfg cfg
;
76 * to_dpu_hw_mixer - convert base object dpu_hw_base to container
77 * @hw: Pointer to base hardware block
78 * return: Pointer to hardware block container
80 static inline struct dpu_hw_mixer
*to_dpu_hw_mixer(struct dpu_hw_blk
*hw
)
82 return container_of(hw
, struct dpu_hw_mixer
, base
);
86 * dpu_hw_lm_init(): Initializes the mixer hw driver object.
87 * should be called once before accessing every mixer.
88 * @idx: mixer index for which driver object is required
89 * @addr: mapped register io address of MDP
90 * @m : pointer to mdss catalog data
92 struct dpu_hw_mixer
*dpu_hw_lm_init(enum dpu_lm idx
,
94 const struct dpu_mdss_cfg
*m
);
97 * dpu_hw_lm_destroy(): Destroys layer mixer driver context
98 * @lm: Pointer to LM driver context
100 void dpu_hw_lm_destroy(struct dpu_hw_mixer
*lm
);
102 #endif /*_DPU_HW_LM_H */