From 57fb527a7e33384341fc18f1f918d5a8225057f5 Mon Sep 17 00:00:00 2001 From: Peter Daifuku Date: Fri, 6 Oct 2017 16:27:14 -0700 Subject: gpu: nvgpu: vgpu: flatten out vgpu hal Instead of calling the native HAL init function then adding multiple layers of modification for VGPU, flatten out the sequence so that all entry points are set statically and visible in a single file. JIRA ESRM-30 Change-Id: Ie424abb48bce5038874851d399baac5e4bb7d27c Signed-off-by: Peter Daifuku Reviewed-on: https://git-master.nvidia.com/r/1574616 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/css_vgpu.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/css_vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/css_vgpu.c b/drivers/gpu/nvgpu/vgpu/css_vgpu.c index 0b3c6a25..bcb01fac 100644 --- a/drivers/gpu/nvgpu/vgpu/css_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/css_vgpu.c @@ -29,6 +29,7 @@ #include "gk20a/platform_gk20a.h" #include "gk20a/css_gr_gk20a.h" #include "vgpu.h" +#include "css_vgpu.h" static struct tegra_hv_ivm_cookie *css_cookie; @@ -93,7 +94,7 @@ fail: return err; } -static void vgpu_css_release_snapshot_buffer(struct gr_gk20a *gr) +void vgpu_css_release_snapshot_buffer(struct gr_gk20a *gr) { struct gk20a_cs_snapshot *data = gr->cs_data; @@ -108,7 +109,7 @@ static void vgpu_css_release_snapshot_buffer(struct gr_gk20a *gr) gk20a_dbg_info("cyclestats(vgpu): buffer for snapshots released\n"); } -static int vgpu_css_flush_snapshots(struct channel_gk20a *ch, +int vgpu_css_flush_snapshots(struct channel_gk20a *ch, u32 *pending, bool *hw_overflow) { struct gk20a *g = ch->g; @@ -164,7 +165,7 @@ static int vgpu_css_attach(struct channel_gk20a *ch, return err; } -static int vgpu_css_detach(struct channel_gk20a *ch, +int vgpu_css_detach(struct channel_gk20a *ch, struct gk20a_cs_snapshot_client *cs_client) { struct gk20a *g = ch->g; @@ -190,7 +191,7 @@ static int vgpu_css_detach(struct channel_gk20a *ch, return err; } -static int vgpu_css_enable_snapshot_buffer(struct channel_gk20a *ch, +int vgpu_css_enable_snapshot_buffer(struct channel_gk20a *ch, struct gk20a_cs_snapshot_client *cs_client) { int ret; @@ -202,17 +203,4 @@ static int vgpu_css_enable_snapshot_buffer(struct channel_gk20a *ch, ret = vgpu_css_init_snapshot_buffer(&ch->g->gr); return ret; } - -void vgpu_init_css_ops(struct gpu_ops *gops) -{ - gops->css.enable_snapshot = vgpu_css_enable_snapshot_buffer; - gops->css.disable_snapshot = vgpu_css_release_snapshot_buffer; - gops->css.check_data_available = vgpu_css_flush_snapshots; - gops->css.detach_snapshot = vgpu_css_detach; - - /* Following entries are not used when virtual, NULL them */ - gops->css.set_handled_snapshots = NULL; - gops->css.allocate_perfmon_ids = NULL; - gops->css.release_perfmon_ids = NULL; -} #endif /* CONFIG_GK20A_CYCLE_STATS */ -- cgit v1.2.2