mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
gpu: nvgpu: unit: stub userd.setup_sw
Regular USERD init requires bar1.vm to be initialized Use a stub in unit tests, since it will be disabled in safety build anyway. Jira NVGPU-3476 Change-Id: I9bc3ab8ca1ab578a90dbc66167ee535046faae92 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2122297 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> 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
dfdd05a3d6
commit
1456c788f3
@@ -30,6 +30,7 @@
|
||||
#include <nvgpu/channel.h>
|
||||
#include <nvgpu/tsg.h>
|
||||
#include <nvgpu/gk20a.h>
|
||||
#include <nvgpu/fifo/userd.h>
|
||||
|
||||
#include "hal/fifo/tsg_gk20a.h"
|
||||
|
||||
@@ -52,6 +53,24 @@ static u32 test_gv11b_gr_init_get_no_of_sm(struct gk20a *g)
|
||||
return 8;
|
||||
}
|
||||
|
||||
#ifdef NVGPU_USERD
|
||||
static int stub_userd_setup_sw(struct gk20a *g)
|
||||
{
|
||||
struct nvgpu_fifo *f = &g->fifo;
|
||||
int err;
|
||||
|
||||
f->userd_entry_size = g->ops.userd.entry_size(g);
|
||||
|
||||
err = nvgpu_userd_init_slabs(g);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g, "failed to init userd support");
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int test_fifo_init_support(struct unit_module *m,
|
||||
struct gk20a *g, void *args)
|
||||
{
|
||||
@@ -76,6 +95,15 @@ static int test_fifo_init_support(struct unit_module *m,
|
||||
g->ops.fifo.init_fifo_setup_hw = NULL;
|
||||
nvgpu_set_enabled(g, NVGPU_IS_FMODEL, false);
|
||||
|
||||
#ifdef NVGPU_USERD
|
||||
/*
|
||||
* Regular USERD init requires bar1.vm to be initialized
|
||||
* Use a stub in unit tests, since it will be disabled in
|
||||
* safety build anyway.
|
||||
*/
|
||||
g->ops.userd.setup_sw = stub_userd_setup_sw;
|
||||
#endif
|
||||
|
||||
err = nvgpu_fifo_init_support(g);
|
||||
if (err != 0) {
|
||||
test_fifo_cleanup_gv11b_reg_space(m, g);
|
||||
|
||||
Reference in New Issue
Block a user