mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: array of pointers to runlists
Currently a fifo_runlist_info_gk20a structure is allocated and initialized for each possible runlist. But only a few runlists are actually used. Use an array of pointers to runlists in fifo_gk20a. The array keeps existing indexing by runlist_id. In this patch a context is still allocated for each possible runlist, but follow up patch will allow to skip context allocation for inactive runlists. Bug 2470115 Change-Id: I1615043cea84db35a270ade64695d51f85c1193a Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2025203 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
0a0120c18b
commit
5fdda1b075
@@ -35,10 +35,11 @@ static void setup_fifo(struct gk20a *g, unsigned long *tsg_map,
|
||||
unsigned long *ch_map, struct tsg_gk20a *tsgs,
|
||||
struct channel_gk20a *chs, unsigned int num_tsgs,
|
||||
unsigned int num_channels,
|
||||
struct fifo_runlist_info_gk20a *runlist, u32 *rl_data,
|
||||
struct fifo_runlist_info_gk20a **runlists, u32 *rl_data,
|
||||
bool interleave)
|
||||
{
|
||||
struct fifo_gk20a *f = &g->fifo;
|
||||
struct fifo_runlist_info_gk20a *runlist = runlists[0];
|
||||
|
||||
/* we only use the runlist 0 here */
|
||||
runlist->mem[0].cpu_va = rl_data;
|
||||
@@ -53,7 +54,7 @@ static void setup_fifo(struct gk20a *g, unsigned long *tsg_map,
|
||||
f->tsg = tsgs;
|
||||
f->channel = chs;
|
||||
f->num_channels = num_channels;
|
||||
f->runlist_info = runlist;
|
||||
f->runlist_info = runlists;
|
||||
|
||||
/*
|
||||
* For testing the runlist entry order format, these simpler dual-u32
|
||||
@@ -117,7 +118,7 @@ static int run_format_test(struct unit_module *m, struct fifo_gk20a *f,
|
||||
setup_tsg_multich(tsg, chs, 0, prio, 5, n_ch);
|
||||
|
||||
/* entry capacity: tsg header and some channels */
|
||||
n = nvgpu_runlist_construct_locked(f, f->runlist_info, 0, 1 + n_ch);
|
||||
n = nvgpu_runlist_construct_locked(f, f->runlist_info[0], 0, 1 + n_ch);
|
||||
if (n != 1 + n_ch) {
|
||||
unit_return_fail(m, "number of entries mismatch %d\n", n);
|
||||
}
|
||||
@@ -160,6 +161,7 @@ static int test_tsg_format_gen(struct unit_module *m, struct gk20a *g,
|
||||
{
|
||||
struct fifo_gk20a *f = &g->fifo;
|
||||
struct fifo_runlist_info_gk20a runlist;
|
||||
struct fifo_runlist_info_gk20a *runlists = &runlist;
|
||||
unsigned long active_tsgs_map = 0;
|
||||
unsigned long active_chs_map = 0;
|
||||
struct tsg_gk20a tsgs[1] = {{0}};
|
||||
@@ -172,7 +174,7 @@ static int test_tsg_format_gen(struct unit_module *m, struct gk20a *g,
|
||||
(void)test_args->timeslice;
|
||||
|
||||
setup_fifo(g, &active_tsgs_map, &active_chs_map, tsgs, chs, 1, 5,
|
||||
&runlist, rl_data, false);
|
||||
&runlists, rl_data, false);
|
||||
|
||||
active_chs_map = test_args->chs_bitmap;
|
||||
|
||||
@@ -220,6 +222,7 @@ static int test_common_gen(struct unit_module *m, struct gk20a *g,
|
||||
{
|
||||
struct fifo_gk20a *f = &g->fifo;
|
||||
struct fifo_runlist_info_gk20a runlist;
|
||||
struct fifo_runlist_info_gk20a *runlists = &runlist;
|
||||
unsigned long active_tsgs_map = 0;
|
||||
unsigned long active_chs_map = 0;
|
||||
struct tsg_gk20a tsgs[6] = {{0}};
|
||||
@@ -233,7 +236,7 @@ static int test_common_gen(struct unit_module *m, struct gk20a *g,
|
||||
u32 i = 0;
|
||||
|
||||
setup_fifo(g, &active_tsgs_map, &active_chs_map, tsgs, chs,
|
||||
levels_count, 6, &runlist, rl_data, interleave);
|
||||
levels_count, 6, &runlists, rl_data, interleave);
|
||||
|
||||
for (i = 0; i < levels_count; i++) {
|
||||
setup_tsg(tsgs, chs, i, levels[i]);
|
||||
|
||||
Reference in New Issue
Block a user