Lines Matching full:rm

38 		struct dpu_rm *rm,  in dpu_rm_init()  argument
45 if (!rm || !cat || !mmio) { in dpu_rm_init()
51 memset(rm, 0, sizeof(*rm)); in dpu_rm_init()
64 rm->mixer_blks[lm->id - LM_0] = &hw->base; in dpu_rm_init()
78 rm->merge_3d_blks[merge_3d->id - MERGE_3D_0] = &hw->base; in dpu_rm_init()
93 hw->merge_3d = to_dpu_hw_merge_3d(rm->merge_3d_blks[pp->merge_3d - MERGE_3D_0]); in dpu_rm_init()
94 rm->pingpong_blks[pp->id - PINGPONG_0] = &hw->base; in dpu_rm_init()
107 rm->hw_intf[intf->id - INTF_0] = hw; in dpu_rm_init()
120 rm->hw_wb[wb->id - WB_0] = hw; in dpu_rm_init()
133 rm->ctl_blks[ctl->id - CTL_0] = &hw->base; in dpu_rm_init()
146 rm->dspp_blks[dspp->id - DSPP_0] = &hw->base; in dpu_rm_init()
163 rm->dsc_blks[dsc->id - DSC_0] = &hw->base; in dpu_rm_init()
176 rm->hw_sspp[sspp->id - SSPP_NONE] = hw; in dpu_rm_init()
188 rm->cdm_blk = &hw->base; in dpu_rm_init()
204 * @rm: dpu resource manager handle
205 * @primary_idx: index of primary mixer in rm->mixer_blks[]
209 static int _dpu_rm_get_lm_peer(struct dpu_rm *rm, int primary_idx) in _dpu_rm_get_lm_peer() argument
213 prim_lm_cfg = to_dpu_hw_mixer(rm->mixer_blks[primary_idx])->cap; in _dpu_rm_get_lm_peer()
224 * @rm: dpu resource manager handle
227 * @lm_idx: index of proposed layer mixer in rm->mixer_blks[], function checks
231 * mixer in rm->pingpong_blks[].
233 * mixer in rm->dspp_blks[].
234 * @reqs: input parameter, rm requirements for HW blocks needed in the
238 static bool _dpu_rm_check_lm_and_get_connected_blks(struct dpu_rm *rm, in _dpu_rm_check_lm_and_get_connected_blks() argument
252 lm_cfg = to_dpu_hw_mixer(rm->mixer_blks[lm_idx])->cap; in _dpu_rm_check_lm_and_get_connected_blks()
254 if (idx < 0 || idx >= ARRAY_SIZE(rm->pingpong_blks)) { in _dpu_rm_check_lm_and_get_connected_blks()
270 if (idx < 0 || idx >= ARRAY_SIZE(rm->dspp_blks)) { in _dpu_rm_check_lm_and_get_connected_blks()
285 static int _dpu_rm_reserve_lms(struct dpu_rm *rm, in _dpu_rm_reserve_lms() argument
302 for (i = 0; i < ARRAY_SIZE(rm->mixer_blks) && in _dpu_rm_reserve_lms()
304 if (!rm->mixer_blks[i]) in _dpu_rm_reserve_lms()
310 if (!_dpu_rm_check_lm_and_get_connected_blks(rm, global_state, in _dpu_rm_reserve_lms()
320 int j = _dpu_rm_get_lm_peer(rm, i); in _dpu_rm_reserve_lms()
326 if (!rm->mixer_blks[j]) in _dpu_rm_reserve_lms()
329 if (!_dpu_rm_check_lm_and_get_connected_blks(rm, in _dpu_rm_reserve_lms()
360 struct dpu_rm *rm, in _dpu_rm_reserve_ctls() argument
374 for (j = 0; j < ARRAY_SIZE(rm->ctl_blks); j++) { in _dpu_rm_reserve_ctls()
379 if (!rm->ctl_blks[j]) in _dpu_rm_reserve_ctls()
384 ctl = to_dpu_hw_ctl(rm->ctl_blks[j]); in _dpu_rm_reserve_ctls()
438 static int _dpu_rm_dsc_alloc(struct dpu_rm *rm, in _dpu_rm_dsc_alloc() argument
448 for (dsc_idx = 0; dsc_idx < ARRAY_SIZE(rm->dsc_blks) && in _dpu_rm_dsc_alloc()
450 if (!rm->dsc_blks[dsc_idx]) in _dpu_rm_dsc_alloc()
478 static int _dpu_rm_dsc_alloc_pair(struct dpu_rm *rm, in _dpu_rm_dsc_alloc_pair() argument
488 for (dsc_idx = 0; dsc_idx < ARRAY_SIZE(rm->dsc_blks) && in _dpu_rm_dsc_alloc_pair()
490 if (!rm->dsc_blks[dsc_idx] || in _dpu_rm_dsc_alloc_pair()
491 !rm->dsc_blks[dsc_idx + 1]) in _dpu_rm_dsc_alloc_pair()
534 static int _dpu_rm_reserve_dsc(struct dpu_rm *rm, in _dpu_rm_reserve_dsc() argument
556 return _dpu_rm_dsc_alloc_pair(rm, global_state, enc_id, top); in _dpu_rm_reserve_dsc()
558 return _dpu_rm_dsc_alloc(rm, global_state, enc_id, top); in _dpu_rm_reserve_dsc()
563 static int _dpu_rm_reserve_cdm(struct dpu_rm *rm, in _dpu_rm_reserve_cdm() argument
568 if (!rm->cdm_blk) { in _dpu_rm_reserve_cdm()
584 struct dpu_rm *rm, in _dpu_rm_make_reservation() argument
591 ret = _dpu_rm_reserve_lms(rm, global_state, enc->base.id, reqs); in _dpu_rm_make_reservation()
597 ret = _dpu_rm_reserve_ctls(rm, global_state, enc->base.id, in _dpu_rm_make_reservation()
604 ret = _dpu_rm_reserve_dsc(rm, global_state, enc, &reqs->topology); in _dpu_rm_make_reservation()
609 ret = _dpu_rm_reserve_cdm(rm, global_state, enc); in _dpu_rm_make_reservation()
661 struct dpu_rm *rm, in dpu_rm_reserve() argument
688 ret = _dpu_rm_make_reservation(rm, global_state, enc, &reqs); in dpu_rm_reserve()
697 int dpu_rm_get_assigned_resources(struct dpu_rm *rm, in dpu_rm_get_assigned_resources() argument
707 hw_blks = rm->pingpong_blks; in dpu_rm_get_assigned_resources()
709 max_blks = ARRAY_SIZE(rm->pingpong_blks); in dpu_rm_get_assigned_resources()
712 hw_blks = rm->mixer_blks; in dpu_rm_get_assigned_resources()
714 max_blks = ARRAY_SIZE(rm->mixer_blks); in dpu_rm_get_assigned_resources()
717 hw_blks = rm->ctl_blks; in dpu_rm_get_assigned_resources()
719 max_blks = ARRAY_SIZE(rm->ctl_blks); in dpu_rm_get_assigned_resources()
722 hw_blks = rm->dspp_blks; in dpu_rm_get_assigned_resources()
724 max_blks = ARRAY_SIZE(rm->dspp_blks); in dpu_rm_get_assigned_resources()
727 hw_blks = rm->dsc_blks; in dpu_rm_get_assigned_resources()
729 max_blks = ARRAY_SIZE(rm->dsc_blks); in dpu_rm_get_assigned_resources()
732 hw_blks = &rm->cdm_blk; in dpu_rm_get_assigned_resources()
737 DPU_ERROR("blk type %d not managed by rm\n", type); in dpu_rm_get_assigned_resources()
778 const struct dpu_rm *rm = global_state->rm; in dpu_rm_print_state() local
784 dpu_rm_print_state_helper(p, rm->pingpong_blks[i], in dpu_rm_print_state()
790 dpu_rm_print_state_helper(p, rm->mixer_blks[i], in dpu_rm_print_state()
796 dpu_rm_print_state_helper(p, rm->ctl_blks[i], in dpu_rm_print_state()
802 dpu_rm_print_state_helper(p, rm->dspp_blks[i], in dpu_rm_print_state()
808 dpu_rm_print_state_helper(p, rm->dsc_blks[i], in dpu_rm_print_state()
813 dpu_rm_print_state_helper(p, rm->cdm_blk, in dpu_rm_print_state()