File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
drivers/gpu/drm/msm/disp/dpu1 Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 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 ];
Original file line number Diff line number Diff 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 */
2425struct 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
You can’t perform that action at this time.
0 commit comments