mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 02:52:51 +03:00
gpu: nvgpu: move get_engines_mask_on_id from fifo to engine
Move get_engines_mask_on_id fifo hal to engine hal as get_mask_on_id Rename gk20a_fifo_engines_on_id to nvgpu_engine_get_mask_on_id JIRA NVGPU-1313 Change-Id: I3582195e0a0d6f6722e9f160331e77d1a338783e Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2084320 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
584e9dee8d
commit
d0f45117f1
@@ -693,3 +693,42 @@ u32 nvgpu_engine_mmu_fault_id_to_engine_id(struct gk20a *g, u32 fault_id)
|
||||
}
|
||||
return active_engine_id;
|
||||
}
|
||||
|
||||
u32 nvgpu_engine_get_mask_on_id(struct gk20a *g, u32 id, bool is_tsg)
|
||||
{
|
||||
unsigned int i;
|
||||
u32 engines = 0;
|
||||
struct nvgpu_engine_status_info engine_status;
|
||||
u32 ctx_id;
|
||||
u32 type;
|
||||
bool busy;
|
||||
|
||||
for (i = 0; i < g->fifo.num_engines; i++) {
|
||||
u32 active_engine_id = g->fifo.active_engines_list[i];
|
||||
|
||||
g->ops.engine_status.read_engine_status_info(g,
|
||||
active_engine_id, &engine_status);
|
||||
|
||||
if (nvgpu_engine_status_is_ctxsw_load(
|
||||
&engine_status)) {
|
||||
nvgpu_engine_status_get_next_ctx_id_type(
|
||||
&engine_status, &ctx_id, &type);
|
||||
} else {
|
||||
nvgpu_engine_status_get_ctx_id_type(
|
||||
&engine_status, &ctx_id, &type);
|
||||
}
|
||||
|
||||
busy = engine_status.is_busy;
|
||||
|
||||
if (busy && ctx_id == id) {
|
||||
if ((is_tsg && type ==
|
||||
ENGINE_STATUS_CTX_ID_TYPE_TSGID) ||
|
||||
(!is_tsg && type ==
|
||||
ENGINE_STATUS_CTX_ID_TYPE_CHID)) {
|
||||
engines |= BIT(active_engine_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return engines;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user