Lines Matching refs:hw_ip

139 static unsigned int amdgpu_ctx_get_hw_prio(struct amdgpu_ctx *ctx, u32 hw_ip)  in amdgpu_ctx_get_hw_prio()  argument
148 switch (hw_ip) { in amdgpu_ctx_get_hw_prio()
162 hw_ip = array_index_nospec(hw_ip, AMDGPU_HW_IP_NUM); in amdgpu_ctx_get_hw_prio()
163 if (adev->gpu_sched[hw_ip][hw_prio].num_scheds == 0) in amdgpu_ctx_get_hw_prio()
204 static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip, in amdgpu_ctx_init_entity() argument
222 entity->hw_ip = hw_ip; in amdgpu_ctx_init_entity()
224 hw_prio = amdgpu_ctx_get_hw_prio(ctx, hw_ip); in amdgpu_ctx_init_entity()
227 hw_ip = array_index_nospec(hw_ip, AMDGPU_HW_IP_NUM); in amdgpu_ctx_init_entity()
230 scheds = adev->gpu_sched[hw_ip][hw_prio].sched; in amdgpu_ctx_init_entity()
231 num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds; in amdgpu_ctx_init_entity()
236 r = amdgpu_xcp_select_scheds(adev, hw_ip, hw_prio, fpriv, in amdgpu_ctx_init_entity()
243 if (hw_ip == AMDGPU_HW_IP_VCN_ENC || in amdgpu_ctx_init_entity()
244 hw_ip == AMDGPU_HW_IP_VCN_DEC || in amdgpu_ctx_init_entity()
245 hw_ip == AMDGPU_HW_IP_UVD_ENC || in amdgpu_ctx_init_entity()
246 hw_ip == AMDGPU_HW_IP_UVD) { in amdgpu_ctx_init_entity()
258 if (cmpxchg(&ctx->entities[hw_ip][ring], NULL, entity)) in amdgpu_ctx_init_entity()
434 int amdgpu_ctx_get_entity(struct amdgpu_ctx *ctx, u32 hw_ip, u32 instance, in amdgpu_ctx_get_entity() argument
440 if (hw_ip >= AMDGPU_HW_IP_NUM) { in amdgpu_ctx_get_entity()
441 DRM_ERROR("unknown HW IP type: %d\n", hw_ip); in amdgpu_ctx_get_entity()
451 if (ring >= amdgpu_ctx_num_entities[hw_ip]) { in amdgpu_ctx_get_entity()
452 DRM_DEBUG("invalid ring: %d %d\n", hw_ip, ring); in amdgpu_ctx_get_entity()
456 if (ctx->entities[hw_ip][ring] == NULL) { in amdgpu_ctx_get_entity()
457 r = amdgpu_ctx_init_entity(ctx, hw_ip, ring); in amdgpu_ctx_get_entity()
462 ctx_entity = &ctx->entities[hw_ip][ring]->entity; in amdgpu_ctx_get_entity()
778 &ctx->mgr->time_spend[centity->hw_ip]); in amdgpu_ctx_add_fence()
815 int hw_ip, in amdgpu_ctx_set_entity_priority() argument
828 if (hw_ip == AMDGPU_HW_IP_COMPUTE || hw_ip == AMDGPU_HW_IP_GFX) { in amdgpu_ctx_set_entity_priority()
829 hw_prio = amdgpu_ctx_get_hw_prio(ctx, hw_ip); in amdgpu_ctx_set_entity_priority()
831 scheds = adev->gpu_sched[hw_ip][hw_prio].sched; in amdgpu_ctx_set_entity_priority()
832 num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds; in amdgpu_ctx_set_entity_priority()
973 unsigned int hw_ip, i; in amdgpu_ctx_mgr_usage() local
982 for (hw_ip = 0; hw_ip < AMDGPU_HW_IP_NUM; ++hw_ip) { in amdgpu_ctx_mgr_usage()
983 uint64_t ns = atomic64_read(&mgr->time_spend[hw_ip]); in amdgpu_ctx_mgr_usage()
985 usage[hw_ip] = ns_to_ktime(ns); in amdgpu_ctx_mgr_usage()
989 for (hw_ip = 0; hw_ip < AMDGPU_HW_IP_NUM; ++hw_ip) { in amdgpu_ctx_mgr_usage()
990 for (i = 0; i < amdgpu_ctx_num_entities[hw_ip]; ++i) { in amdgpu_ctx_mgr_usage()
994 centity = ctx->entities[hw_ip][i]; in amdgpu_ctx_mgr_usage()
998 usage[hw_ip] = ktime_add(usage[hw_ip], spend); in amdgpu_ctx_mgr_usage()