From e7c45478895a359bd122b359c1f29b7e64116caf Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 7 Nov 2017 08:43:23 -0800 Subject: gpu: nvgpu: Hard code regops max batch size We set the regops limit in common code to a hard coded value and access it in Linux code. Change the responsibility so that regops limit is set in Linux code in the GPU characteristics query to a hard coded value and just use the same hard coded value in the IOCTL limit check. JIRA NVGPU-259 Change-Id: I2f78a7ea8f1cb68a08633a2dc74b71b3b001e5c9 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1593682 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Seshendra Gadagottu Reviewed-by: Peter Daifuku Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 2 ++ drivers/gpu/nvgpu/common/linux/ioctl_dbg.c | 2 +- drivers/gpu/nvgpu/common/linux/ioctl_dbg.h | 4 ++++ drivers/gpu/nvgpu/gk20a/gk20a.c | 2 -- 4 files changed, 7 insertions(+), 3 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index 02dedc9f..83282b87 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c @@ -33,6 +33,7 @@ #include #include "ioctl_ctrl.h" +#include "ioctl_dbg.h" #ifdef CONFIG_TEGRA_19x_GPU #include "common/linux/ioctl_ctrl_t19x.h" #endif @@ -207,6 +208,7 @@ gk20a_ctrl_ioctl_gpu_characteristics( pgpu->arch = g->params.gpu_arch; pgpu->impl = g->params.gpu_impl; pgpu->rev = g->params.gpu_rev; + pgpu->reg_ops_limit = NVGPU_IOCTL_DBG_REG_OPS_LIMIT; pgpu->vbios_version = g->bios.vbios_version; pgpu->vbios_oem_version = g->bios.vbios_oem_version; diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c index c8d7468e..304fd71f 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_dbg.c @@ -607,7 +607,7 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, gk20a_dbg_fn("%d ops, max fragment %d", args->num_ops, g->dbg_regops_tmp_buf_ops); - if (args->num_ops > g->gpu_characteristics.reg_ops_limit) { + if (args->num_ops > NVGPU_IOCTL_DBG_REG_OPS_LIMIT) { nvgpu_err(g, "regops limit exceeded"); return -EINVAL; } diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_dbg.h b/drivers/gpu/nvgpu/common/linux/ioctl_dbg.h index 810555a8..bd76045b 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_dbg.h +++ b/drivers/gpu/nvgpu/common/linux/ioctl_dbg.h @@ -21,6 +21,10 @@ #include "gk20a/dbg_gpu_gk20a.h" +/* NVGPU_DBG_GPU_IOCTL_REG_OPS: the upper limit for the number + * of regops */ +#define NVGPU_IOCTL_DBG_REG_OPS_LIMIT 1024 + struct dbg_session_gk20a_linux { struct device *dev; struct dbg_session_gk20a dbg_s; diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index a9ee65d0..2d7266ce 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -488,8 +488,6 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) gpu->pci_class = g->pci_class; gpu->pci_revision = g->pci_revision; - gpu->reg_ops_limit = 1024; - return 0; } -- cgit v1.2.2