From 7b67abb2edb606b9ad0d0ecf0d94a333770974b1 Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Wed, 16 Nov 2016 09:33:43 -0800 Subject: gpu: nvgpu: gv11b: support for new littler values Add support for new litter values: GPU_LIT_NUM_SUBCTX GPU_LIT_NUM_SM_PER_TPC Also updated get_litter_value api to use int instead of enum type. JIRA GV11B-21 Change-Id: Ide06245d03743e2d757d27d045701beb25b6707b Signed-off-by: seshendra Gadagottu Reviewed-on: http://git-master/r/1254857 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/gr_gv11b.c | 1 + drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 11 ++++++++--- include/linux/tegra_gpu_t19x.h | 24 ++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 include/linux/tegra_gpu_t19x.h diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index ca5e8dc0..f60337e2 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c @@ -31,6 +31,7 @@ #include "hw_mc_gv11b.h" #include "hw_gr_gv11b.h" #include +#include static bool gr_gv11b_is_valid_class(struct gk20a *g, u32 class_num) { diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index a11d6a71..3124f540 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -17,7 +17,7 @@ #include #include - +#include #include "gk20a/gk20a.h" #include "gv11b/hal_gv11b.h" @@ -40,8 +40,7 @@ static struct gpu_ops gv11b_ops; -static int gv11b_get_litter_value(struct gk20a *g, - enum nvgpu_litter_value value) +static int gv11b_get_litter_value(struct gk20a *g, int value) { int ret = EINVAL; switch (value) { @@ -57,6 +56,9 @@ static int gv11b_get_litter_value(struct gk20a *g, case GPU_LIT_NUM_TPC_PER_GPC: ret = proj_scal_litter_num_tpc_per_gpc_v(); break; + case GPU_LIT_NUM_SM_PER_TPC: + ret = proj_scal_litter_num_sm_per_tpc_v(); + break; case GPU_LIT_NUM_FBPS: ret = proj_scal_litter_num_fbps_v(); break; @@ -108,6 +110,9 @@ static int gv11b_get_litter_value(struct gk20a *g, case GPU_LIT_FBPA_STRIDE: ret = proj_fbpa_stride_v(); break; + case GPU_LIT_NUM_SUBCTX: + ret = proj_litter_num_subctx_v(); + break; default: break; } diff --git a/include/linux/tegra_gpu_t19x.h b/include/linux/tegra_gpu_t19x.h new file mode 100644 index 00000000..f6157c12 --- /dev/null +++ b/include/linux/tegra_gpu_t19x.h @@ -0,0 +1,24 @@ +/* + * Tegra GPU Virtualization Interfaces to Server + * + * Copyright (c) 2016, NVIDIA Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __TEGRA_GPU_T19X_H +#define __TEGRA_GPU_T19X_H + +#define GPU_LIT_NUM_SUBCTX 99 + +#endif -- cgit v1.2.2