gpu: nvgpu: vgpu: add TEGRA_VGPU_ATTRIB_MAX_SUBCTX_COUNT

Get max subctx count from RM server.

Jira VFND-3797

Change-Id: I95de2271a77bedfa8703231fa45da05c7d2da3e6
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1543018
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Richard Zhao
2017-08-21 15:36:11 -07:00
committed by mobile promotions
parent 866165749a
commit 1ac8f6477d
2 changed files with 21 additions and 1 deletions

View File

@@ -14,13 +14,31 @@
#include <gk20a/gk20a.h> #include <gk20a/gk20a.h>
#include <vgpu/gp10b/vgpu_fifo_gp10b.h> #include <vgpu/gp10b/vgpu_fifo_gp10b.h>
#include "vgpu/vgpu.h"
#include "vgpu_fifo_gv11b.h" #include "vgpu_fifo_gv11b.h"
#include "vgpu_subctx_gv11b.h" #include "vgpu_subctx_gv11b.h"
static int vgpu_gv11b_init_fifo_setup_hw(struct gk20a *g)
{
struct fifo_gk20a *f = &g->fifo;
int err;
err = vgpu_get_attribute(vgpu_get_handle(g),
TEGRA_VGPU_ATTRIB_MAX_SUBCTX_COUNT,
&f->t19x.max_subctx_count);
if (err) {
nvgpu_err(g, "get max_subctx_count failed %d", err);
return err;
}
return 0;
}
void vgpu_gv11b_init_fifo_ops(struct gpu_ops *gops) void vgpu_gv11b_init_fifo_ops(struct gpu_ops *gops)
{ {
vgpu_gp10b_init_fifo_ops(gops); vgpu_gp10b_init_fifo_ops(gops);
gops->fifo.init_fifo_setup_hw = NULL; gops->fifo.init_fifo_setup_hw = vgpu_gv11b_init_fifo_setup_hw;
gops->fifo.free_channel_ctx_header = vgpu_gv11b_free_subctx_header; gops->fifo.free_channel_ctx_header = vgpu_gv11b_free_subctx_header;
} }

View File

@@ -31,4 +31,6 @@ union tegra_vgpu_t19x_params {
struct tegra_vgpu_free_ctx_header_params free_ctx_header; struct tegra_vgpu_free_ctx_header_params free_ctx_header;
}; };
#define TEGRA_VGPU_ATTRIB_MAX_SUBCTX_COUNT 100
#endif #endif