Skip to content

Commit 25a2965

Browse files
Abhinav Kumarlumag
authored andcommitted
drm/msm/dpu: add writeback blocks to DPU RM
Add writeback blocks to DPU resource manager so that the encoders can directly request them through RM. changes in v4: - absorb dpu_rm.h header change from [1] - since its a trivial change absorbed from an approved patch, preserving the previous ack on this [1] https://patchwork.freedesktop.org/patch/483099/?series=102964&rev=2 Signed-off-by: Abhinav Kumar <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/483508/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 84a33d0 commit 25a2965

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "dpu_hw_ctl.h"
1010
#include "dpu_hw_pingpong.h"
1111
#include "dpu_hw_intf.h"
12+
#include "dpu_hw_wb.h"
1213
#include "dpu_hw_dspp.h"
1314
#include "dpu_hw_merge3d.h"
1415
#include "dpu_hw_dsc.h"
@@ -87,6 +88,9 @@ int dpu_rm_destroy(struct dpu_rm *rm)
8788
}
8889
}
8990

91+
for (i = 0; i < ARRAY_SIZE(rm->hw_wb); i++)
92+
dpu_hw_wb_destroy(rm->hw_wb[i]);
93+
9094
return 0;
9195
}
9296

@@ -186,6 +190,24 @@ int dpu_rm_init(struct dpu_rm *rm,
186190
rm->hw_intf[intf->id - INTF_0] = hw;
187191
}
188192

193+
for (i = 0; i < cat->wb_count; i++) {
194+
struct dpu_hw_wb *hw;
195+
const struct dpu_wb_cfg *wb = &cat->wb[i];
196+
197+
if (wb->id < WB_0 || wb->id >= WB_MAX) {
198+
DPU_ERROR("skip intf %d with invalid id\n", wb->id);
199+
continue;
200+
}
201+
202+
hw = dpu_hw_wb_init(wb->id, mmio, cat);
203+
if (IS_ERR(hw)) {
204+
rc = PTR_ERR(hw);
205+
DPU_ERROR("failed wb object creation: err %d\n", rc);
206+
goto fail;
207+
}
208+
rm->hw_wb[wb->id - WB_0] = hw;
209+
}
210+
189211
for (i = 0; i < cat->ctl_count; i++) {
190212
struct dpu_hw_ctl *hw;
191213
const struct dpu_ctl_cfg *ctl = &cat->ctl[i];

drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ struct dpu_global_state;
1919
* @mixer_blks: array of layer mixer hardware resources
2020
* @ctl_blks: array of ctl hardware resources
2121
* @hw_intf: array of intf hardware resources
22+
* @hw_wb: array of wb hardware resources
2223
* @dspp_blks: array of dspp hardware resources
2324
*/
2425
struct dpu_rm {
2526
struct dpu_hw_blk *pingpong_blks[PINGPONG_MAX - PINGPONG_0];
2627
struct dpu_hw_blk *mixer_blks[LM_MAX - LM_0];
2728
struct dpu_hw_blk *ctl_blks[CTL_MAX - CTL_0];
2829
struct dpu_hw_intf *hw_intf[INTF_MAX - INTF_0];
30+
struct dpu_hw_wb *hw_wb[WB_MAX - WB_0];
2931
struct dpu_hw_blk *dspp_blks[DSPP_MAX - DSPP_0];
3032
struct dpu_hw_blk *merge_3d_blks[MERGE_3D_MAX - MERGE_3D_0];
3133
struct dpu_hw_blk *dsc_blks[DSC_MAX - DSC_0];
@@ -96,5 +98,15 @@ static inline struct dpu_hw_intf *dpu_rm_get_intf(struct dpu_rm *rm, enum dpu_in
9698
return rm->hw_intf[intf_idx - INTF_0];
9799
}
98100

101+
/**
102+
* dpu_rm_get_wb - Return a struct dpu_hw_wb instance given it's index.
103+
* @rm: DPU Resource Manager handle
104+
* @wb_idx: WB index
105+
*/
106+
static inline struct dpu_hw_wb *dpu_rm_get_wb(struct dpu_rm *rm, enum dpu_wb wb_idx)
107+
{
108+
return rm->hw_wb[wb_idx - WB_0];
109+
}
110+
99111
#endif /* __DPU_RM_H__ */
100112

0 commit comments

Comments
 (0)