summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
diff options
context:
space:
mode:
authorAnup Mahindre <amahindre@nvidia.com>2018-09-05 08:06:46 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-09 20:23:06 -0400
commitb026c012963b135f8689c4409d12e79a76bb1156 (patch)
tree5bc8c5af18832f7d8264b22359aa68088381e0ce /drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
parente93a4ca50b6b24d3db1f8fdc0e5030fecb5ea8d2 (diff)
gpu: nvgpu: Return gr_ctx_resident from NVGPU_DBG_GPU_IOCTL_REG_OPS
NVGPU_DBG_GPU_IOCTL_REG_OPS currently doesn't return if the ctx was resident in engine or not. Regops are broken down into batches of 128 and each batch is executed together. Since there only 32 bits were available in IOCTL args, returning is ctx was resident isn't possible for all batches. Hence return if the ctx was resident for the first batch. Bug 200445575 Change-Id: Iff950be25893de0afadd523d4ea04842a8ddf2af Signed-off-by: Anup Mahindre <amahindre@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1812975 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/ioctl_dbg.c')
-rw-r--r--drivers/gpu/nvgpu/os/linux/ioctl_dbg.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
index 9ea681b1..1eace94b 100644
--- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
+++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
@@ -869,6 +869,9 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s,
869 struct gk20a *g = dbg_s->g; 869 struct gk20a *g = dbg_s->g;
870 struct channel_gk20a *ch; 870 struct channel_gk20a *ch;
871 871
872 bool is_current_ctx;
873
874
872 nvgpu_log_fn(g, "%d ops, max fragment %d", args->num_ops, g->dbg_regops_tmp_buf_ops); 875 nvgpu_log_fn(g, "%d ops, max fragment %d", args->num_ops, g->dbg_regops_tmp_buf_ops);
873 876
874 if (args->num_ops > NVGPU_IOCTL_DBG_REG_OPS_LIMIT) { 877 if (args->num_ops > NVGPU_IOCTL_DBG_REG_OPS_LIMIT) {
@@ -954,11 +957,15 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s,
954 break; 957 break;
955 958
956 err = g->ops.regops.exec_regops( 959 err = g->ops.regops.exec_regops(
957 dbg_s, g->dbg_regops_tmp_buf, num_ops); 960 dbg_s, g->dbg_regops_tmp_buf, num_ops, &is_current_ctx);
958 961
959 if (err) { 962 if (err) {
960 break; 963 break;
961 } 964 }
965
966 if (ops_offset == 0) {
967 args->gr_ctx_resident = is_current_ctx;
968 }
962 969
963 err = nvgpu_get_regops_data_linux(g->dbg_regops_tmp_buf, 970 err = nvgpu_get_regops_data_linux(g->dbg_regops_tmp_buf,
964 linux_fragment, num_ops); 971 linux_fragment, num_ops);