Lines Matching refs:hw_ip

138 static unsigned int amdgpu_ctx_get_hw_prio(struct amdgpu_ctx *ctx, u32 hw_ip)  in amdgpu_ctx_get_hw_prio()  argument
147 switch (hw_ip) { in amdgpu_ctx_get_hw_prio()
161 hw_ip = array_index_nospec(hw_ip, AMDGPU_HW_IP_NUM); in amdgpu_ctx_get_hw_prio()
162 if (adev->gpu_sched[hw_ip][hw_prio].num_scheds == 0) in amdgpu_ctx_get_hw_prio()
203 static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip, in amdgpu_ctx_init_entity() argument
221 entity->hw_ip = hw_ip; in amdgpu_ctx_init_entity()
223 hw_prio = amdgpu_ctx_get_hw_prio(ctx, hw_ip); in amdgpu_ctx_init_entity()
226 hw_ip = array_index_nospec(hw_ip, AMDGPU_HW_IP_NUM); in amdgpu_ctx_init_entity()
229 scheds = adev->gpu_sched[hw_ip][hw_prio].sched; in amdgpu_ctx_init_entity()
230 num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds; in amdgpu_ctx_init_entity()
235 r = amdgpu_xcp_select_scheds(adev, hw_ip, hw_prio, fpriv, in amdgpu_ctx_init_entity()
242 if (hw_ip == AMDGPU_HW_IP_VCN_ENC || in amdgpu_ctx_init_entity()
243 hw_ip == AMDGPU_HW_IP_VCN_DEC || in amdgpu_ctx_init_entity()
244 hw_ip == AMDGPU_HW_IP_UVD_ENC || in amdgpu_ctx_init_entity()
245 hw_ip == AMDGPU_HW_IP_UVD) { in amdgpu_ctx_init_entity()
257 if (cmpxchg(&ctx->entities[hw_ip][ring], NULL, entity)) in amdgpu_ctx_init_entity()
433 int amdgpu_ctx_get_entity(struct amdgpu_ctx *ctx, u32 hw_ip, u32 instance, in amdgpu_ctx_get_entity() argument
439 if (hw_ip >= AMDGPU_HW_IP_NUM) { in amdgpu_ctx_get_entity()
440 DRM_ERROR("unknown HW IP type: %d\n", hw_ip); in amdgpu_ctx_get_entity()
450 if (ring >= amdgpu_ctx_num_entities[hw_ip]) { in amdgpu_ctx_get_entity()
451 DRM_DEBUG("invalid ring: %d %d\n", hw_ip, ring); in amdgpu_ctx_get_entity()
455 if (ctx->entities[hw_ip][ring] == NULL) { in amdgpu_ctx_get_entity()
456 r = amdgpu_ctx_init_entity(ctx, hw_ip, ring); in amdgpu_ctx_get_entity()
461 ctx_entity = &ctx->entities[hw_ip][ring]->entity; in amdgpu_ctx_get_entity()
769 &ctx->mgr->time_spend[centity->hw_ip]); in amdgpu_ctx_add_fence()
806 int hw_ip, in amdgpu_ctx_set_entity_priority() argument
819 if (hw_ip == AMDGPU_HW_IP_COMPUTE || hw_ip == AMDGPU_HW_IP_GFX) { in amdgpu_ctx_set_entity_priority()
820 hw_prio = amdgpu_ctx_get_hw_prio(ctx, hw_ip); in amdgpu_ctx_set_entity_priority()
822 scheds = adev->gpu_sched[hw_ip][hw_prio].sched; in amdgpu_ctx_set_entity_priority()
823 num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds; in amdgpu_ctx_set_entity_priority()
964 unsigned int hw_ip, i; in amdgpu_ctx_mgr_usage() local
973 for (hw_ip = 0; hw_ip < AMDGPU_HW_IP_NUM; ++hw_ip) { in amdgpu_ctx_mgr_usage()
974 uint64_t ns = atomic64_read(&mgr->time_spend[hw_ip]); in amdgpu_ctx_mgr_usage()
976 usage[hw_ip] = ns_to_ktime(ns); in amdgpu_ctx_mgr_usage()
980 for (hw_ip = 0; hw_ip < AMDGPU_HW_IP_NUM; ++hw_ip) { in amdgpu_ctx_mgr_usage()
981 for (i = 0; i < amdgpu_ctx_num_entities[hw_ip]; ++i) { in amdgpu_ctx_mgr_usage()
985 centity = ctx->entities[hw_ip][i]; in amdgpu_ctx_mgr_usage()
989 usage[hw_ip] = ktime_add(usage[hw_ip], spend); in amdgpu_ctx_mgr_usage()