Lines Matching refs:engs
71 if (eng_grp->engs[i].type) { in get_cores_bmap()
73 eng_grp->engs[i].bmap, in get_cores_bmap()
493 if (!eng_grp->engs[i].type) in find_engines_by_type()
496 if (eng_grp->engs[i].type == eng_type) in find_engines_by_type()
497 return &eng_grp->engs[i]; in find_engines_by_type()
511 struct otx_cpt_engs_rsvd *engs; in otx_cpt_eng_grp_has_eng_type() local
513 engs = find_engines_by_type(eng_grp, eng_type); in otx_cpt_eng_grp_has_eng_type()
515 return (engs != NULL ? 1 : 0); in otx_cpt_eng_grp_has_eng_type()
535 struct otx_cpt_engs_rsvd *engs; in print_engs_info() local
540 engs = &eng_grp->engs[i]; in print_engs_info()
541 if (!engs->type) in print_engs_info()
549 engs->type); in print_engs_info()
557 engs->count + mirrored_engs->count : engs->count, in print_engs_info()
558 get_eng_type_str(engs->type)); in print_engs_info()
563 engs->count <= 0 ? engs->count + in print_engs_info()
605 struct otx_cpt_engs_rsvd *engs; in print_dbg_info() local
631 engs = &grp->engs[j]; in print_dbg_info()
632 if (engs->type) { in print_dbg_info()
636 bitmap_to_arr32(mask, engs->bmap, in print_dbg_info()
653 struct otx_cpt_engs_rsvd *engs, int val) in update_engines_avail_count() argument
655 switch (engs->type) { in update_engines_avail_count()
665 dev_err(dev, "Invalid engine type %d\n", engs->type); in update_engines_avail_count()
674 struct otx_cpt_engs_rsvd *engs) in update_engines_offset() argument
676 switch (engs->type) { in update_engines_offset()
678 engs->offset = 0; in update_engines_offset()
682 engs->offset = avail->max_se_cnt; in update_engines_offset()
686 dev_err(dev, "Invalid engine type %d\n", engs->type); in update_engines_offset()
698 if (!grp->engs[i].type) in release_engines()
701 if (grp->engs[i].count > 0) { in release_engines()
703 &grp->engs[i], in release_engines()
704 grp->engs[i].count); in release_engines()
709 grp->engs[i].type = 0; in release_engines()
710 grp->engs[i].count = 0; in release_engines()
711 grp->engs[i].offset = 0; in release_engines()
712 grp->engs[i].ucode = NULL; in release_engines()
713 bitmap_zero(grp->engs[i].bmap, grp->g->engs_num); in release_engines()
723 struct otx_cpt_engs_rsvd *engs = NULL; in do_reserve_engines() local
727 if (!grp->engs[i].type) { in do_reserve_engines()
728 engs = &grp->engs[i]; in do_reserve_engines()
733 if (!engs) in do_reserve_engines()
736 engs->type = req_engs->type; in do_reserve_engines()
737 engs->count = req_engs->count; in do_reserve_engines()
739 ret = update_engines_offset(dev, &grp->g->avail, engs); in do_reserve_engines()
743 if (engs->count > 0) { in do_reserve_engines()
744 ret = update_engines_avail_count(dev, &grp->g->avail, engs, in do_reserve_engines()
745 -engs->count); in do_reserve_engines()
964 if (!eng_grp->engs[i].type) in disable_eng_grp()
967 eng_grp->engs[i].ucode = &eng_grp->ucode[0]; in disable_eng_grp()
1005 struct otx_cpt_engines *engs, int engs_cnt) in update_requested_engs() argument
1012 engs[i].type); in update_requested_engs()
1030 engs[i].count -= mirrored_engs->count; in update_requested_engs()
1071 struct otx_cpt_engs_rsvd *engs, *mirrored_engs; in eng_grp_update_masks() local
1077 engs = &eng_grp->engs[i]; in eng_grp_update_masks()
1078 if (!engs->type) in eng_grp_update_masks()
1080 if (engs->count <= 0) in eng_grp_update_masks()
1083 switch (engs->type) { in eng_grp_update_masks()
1093 dev_err(dev, "Invalid engine type %d\n", engs->type); in eng_grp_update_masks()
1097 cnt = engs->count; in eng_grp_update_masks()
1098 WARN_ON(engs->offset + max_cnt > OTX_CPT_MAX_ENGINES); in eng_grp_update_masks()
1100 for (j = engs->offset; j < engs->offset + max_cnt; j++) { in eng_grp_update_masks()
1112 bitmap_copy(engs->bmap, tmp_bmap.bits, eng_grp->g->engs_num); in eng_grp_update_masks()
1119 engs = &eng_grp->engs[i]; in eng_grp_update_masks()
1120 if (!engs->type) in eng_grp_update_masks()
1125 engs->type); in eng_grp_update_masks()
1126 WARN_ON(!mirrored_engs && engs->count <= 0); in eng_grp_update_masks()
1132 if (engs->count < 0) { in eng_grp_update_masks()
1135 bitmap_clear(tmp_bmap.bits, bit, -engs->count); in eng_grp_update_masks()
1137 bitmap_or(engs->bmap, engs->bmap, tmp_bmap.bits, in eng_grp_update_masks()
1184 struct otx_cpt_engines *engs, int engs_cnt) in validate_1_ucode_scenario() argument
1191 engs[i].type)) { in validate_1_ucode_scenario()
1195 get_eng_type_str(engs[i].type)); in validate_1_ucode_scenario()
1210 WARN_ON(!eng_grp->engs[0].type); in update_ucode_ptrs()
1211 eng_grp->engs[0].ucode = ucode; in update_ucode_ptrs()
1216 struct otx_cpt_engines *engs, int engs_cnt, in create_engine_group() argument
1230 if (!dev_supports_eng_type(eng_grps, engs[i].type)) { in create_engine_group()
1232 get_eng_type_str(engs[i].type)); in create_engine_group()
1258 ret = validate_1_ucode_scenario(dev, eng_grp, engs, engs_cnt); in create_engine_group()
1272 update_requested_engs(mirrored_eng_grp, engs, engs_cnt); in create_engine_group()
1276 ret = reserve_engines(dev, eng_grp, engs, engs_cnt); in create_engine_group()
1329 struct otx_cpt_engines engs[OTX_CPT_MAX_ETYPES_PER_GRP] = { {0} }; in ucode_load_store() local
1380 if (kstrtoint(strim(val), 10, &engs[grp_idx].count)) in ucode_load_store()
1382 engs[grp_idx++].type = OTX_CPT_SE_TYPES; in ucode_load_store()
1392 if (kstrtoint(strim(val), 10, &engs[grp_idx].count)) in ucode_load_store()
1394 engs[grp_idx++].type = OTX_CPT_AE_TYPES; in ucode_load_store()
1450 ret = create_engine_group(dev, eng_grps, engs, grp_idx, in ucode_load_store()
1474 struct otx_cpt_engines engs[OTX_CPT_MAX_ETYPES_PER_GRP] = {}; in otx_cpt_try_create_default_eng_grps() local
1519 engs[0].type = OTX_CPT_SE_TYPES; in otx_cpt_try_create_default_eng_grps()
1520 engs[0].count = eng_grps->avail.max_se_cnt; in otx_cpt_try_create_default_eng_grps()
1522 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in otx_cpt_try_create_default_eng_grps()
1536 engs[0].type = OTX_CPT_AE_TYPES; in otx_cpt_try_create_default_eng_grps()
1537 engs[0].count = eng_grps->avail.max_ae_cnt; in otx_cpt_try_create_default_eng_grps()
1539 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in otx_cpt_try_create_default_eng_grps()
1614 kfree(grp->engs[j].bmap); in otx_cpt_cleanup_eng_grps()
1615 grp->engs[j].bmap = NULL; in otx_cpt_cleanup_eng_grps()
1651 grp->engs[j].bmap = in otx_cpt_init_eng_grps()
1654 if (!grp->engs[j].bmap) { in otx_cpt_init_eng_grps()