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 <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1593682
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2017-11-07 08:43:23 -08:00
committed by mobile promotions
parent e620bbccdd
commit e7c4547889
4 changed files with 7 additions and 3 deletions

View File

@@ -33,6 +33,7 @@
#include <nvgpu/linux/vidmem.h>
#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;

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
}