gpu: nvgpu: update .channel.enable/disable to use runlist_id and chid

Moving to use IDs rather than struct makes it reusable on server side.

Jira GVSCI-15770

Change-Id: Ibd94ab8c9f0492bd6d20243525905d637eb8de66
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2863438
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Richard Zhao
2023-02-24 10:58:13 -08:00
committed by mobile promotions
parent d9c8d317f0
commit c8d6a91de6
17 changed files with 83 additions and 62 deletions

View File

@@ -68,7 +68,7 @@ int test_gk20a_channel_enable(struct unit_module *m,
privileged, getpid(), getpid());
unit_assert(ch, goto done);
gk20a_channel_enable(ch);
gk20a_channel_enable(g, ch->runlist->id, ch->chid);
unit_assert((nvgpu_readl(ch->g, ccsr_channel_r(ch->chid))
& ccsr_channel_enable_set_true_f()) != 0, goto done);
@@ -93,7 +93,7 @@ int test_gk20a_channel_disable(struct unit_module *m,
privileged, getpid(), getpid());
unit_assert(ch, goto done);
gk20a_channel_disable(ch);
gk20a_channel_disable(g, ch->runlist->id, ch->chid);
unit_assert((nvgpu_readl(ch->g, ccsr_channel_r(ch->chid))
& ccsr_channel_enable_clr_true_f()) != 0, goto done);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -96,9 +96,9 @@ static void subtest_setup(u32 branches)
#define branches_str test_fifo_flags_str
#define pruned test_fifo_subtest_pruned
static void stub_channel_enable(struct nvgpu_channel *ch)
static void stub_channel_enable(struct gk20a *g, u32 runlist_id, u32 chid)
{
stub[0].chid = ch->chid;
stub[0].chid = chid;
stub[0].count++;
}

View File

@@ -1090,10 +1090,10 @@ static const char *f_tsg_enable[] = {
"stub"
};
static void stub_channel_enable(struct nvgpu_channel *ch)
static void stub_channel_enable(struct gk20a *g, u32 runlist_id, u32 chid)
{
stub[0].name = __func__;
stub[0].chid = ch->chid;
stub[0].chid = chid;
stub[0].count++;
}
@@ -1104,10 +1104,10 @@ static void stub_usermode_ring_doorbell(struct nvgpu_channel *ch)
stub[1].count++;
}
static void stub_channel_disable(struct nvgpu_channel *ch)
static void stub_channel_disable(struct gk20a *g, u32 runlist_id, u32 chid)
{
stub[2].name = __func__;
stub[2].chid = ch->chid;
stub[2].chid = chid;
stub[2].count++;
}