gpu: nvgpu: move generic preempt hals to common

- Move fifo.preempt_runlists_for_rc and fifo.preempt_tsg hals to common
source file as nvgpu_fifo_preempt_runlists_for_rc and
nvgpu_fifo_preempt_tsg.

Jira NVGPU-4881

Change-Id: I31f7973276c075130d8a0ac684c6c99e35be6017
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2323866
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vedashree Vidwans
2020-04-10 08:59:46 -07:00
committed by Alex Waterman
parent fa73b73ba7
commit c6908922e5
16 changed files with 215 additions and 189 deletions

View File

@@ -32,6 +32,7 @@
#include <nvgpu/gk20a.h>
#include <nvgpu/fifo.h>
#include <nvgpu/runlist.h>
#include <nvgpu/preempt.h>
#include <nvgpu/soc.h>
#include <nvgpu/pbdma_status.h>
#include <nvgpu/hw/gv11b/hw_fifo_gv11b.h>
@@ -135,7 +136,7 @@ int test_gv11b_fifo_preempt_runlists_for_rc(struct unit_module *m,
0U, 0U);
reg_val = nvgpu_readl(g, fifo_runlist_preempt_r());
gv11b_fifo_preempt_runlists_for_rc(g, runlist_mask);
nvgpu_fifo_preempt_runlists_for_rc(g, runlist_mask);
unit_assert(nvgpu_readl(g, fifo_runlist_preempt_r()) ==
(reg_val | runlist_mask), goto done);
@@ -345,7 +346,7 @@ done:
}
static void stub_fifo_preempt_trigger(struct gk20a *g, u32 id,
unsigned int id_type)
unsigned int id_type)
{
}
@@ -419,7 +420,7 @@ int test_gv11b_fifo_preempt_tsg(struct unit_module *m, struct gk20a *g,
branches & F_PREEMPT_TSG_PLATFORM_SILICON ?
true : false;
err = EXPECT_BUG(gv11b_fifo_preempt_tsg(g, tsg));
err = EXPECT_BUG(nvgpu_fifo_preempt_tsg(g, tsg));
if (branches & F_PREEMPT_TSG_PREEMPT_LOCKED_FAIL) {
if (branches & F_PREEMPT_TSG_PLATFORM_SILICON) {

View File

@@ -699,10 +699,6 @@ static void mock_runlist_write_state(struct gk20a *g, u32 runlist_mask,
{
}
static void mock_fifo_preempt_runlists_for_rc(struct gk20a *g, u32 runlist_mask)
{
}
int test_quiesce(struct unit_module *m, struct gk20a *g, void *args)
{
int ret = UNIT_SUCCESS;
@@ -733,7 +729,6 @@ int test_quiesce(struct unit_module *m, struct gk20a *g, void *args)
/* mock out fifo HALs called during quiesce */
g->ops.runlist.write_state = mock_runlist_write_state;
g->ops.fifo.preempt_runlists_for_rc = mock_fifo_preempt_runlists_for_rc;
nvgpu_sw_quiesce(g);
/* wait for quiesce thread to complete */

View File

@@ -36,6 +36,7 @@
#include <nvgpu/vm.h>
#include <nvgpu/tsg.h>
#include <nvgpu/engines.h>
#include <nvgpu/preempt.h>
#include <nvgpu/nvgpu_init.h>
#include <nvgpu/hw/gv11b/hw_fb_gv11b.h>
#include <nvgpu/hw/gv11b/hw_gmmu_gv11b.h>
@@ -645,7 +646,7 @@ int test_handle_mmu_fault_common(struct unit_module *m,
g->ops.channel.unbind = gv11b_channel_unbind;
g->ops.channel.free_inst = nvgpu_channel_free_inst;
g->ops.tsg.disable = nvgpu_tsg_disable;
g->ops.fifo.preempt_tsg = gv11b_fifo_preempt_tsg;
g->ops.fifo.preempt_tsg = nvgpu_fifo_preempt_tsg;
g->aggressive_sync_destroy_thresh = 0U;
g->fifo.g = g;