From f9ca193a60f4f5dbeb2deb3f127c8d10ba120af7 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Sun, 4 Nov 2018 22:28:21 -0800 Subject: [PATCH] gpu: nvgpu: vgpu: return is_current_ctx for regops The feature is required by ioctl API. is_current_ctx has been added to regops ivc command. Bug 2375942 Jira EVLR-3388 Change-Id: Ib46dc7609f6a7de6dcd26f59a36e6be77b599743 Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1943077 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: Nirav Patel Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h | 1 + drivers/gpu/nvgpu/vgpu/dbg_vgpu.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h b/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h index aa71e2951..0131db272 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h @@ -334,6 +334,7 @@ struct tegra_vgpu_reg_ops_params { u64 handle; u64 num_ops; u32 is_profiler; + u8 is_current_ctx; }; struct tegra_vgpu_channel_priority_params { diff --git a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c b/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c index fa82c5a6e..5c10bdcbd 100644 --- a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c @@ -70,8 +70,11 @@ int vgpu_exec_regops(struct dbg_session_gk20a *dbg_s, p->is_profiler = dbg_s->is_profiler; err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); err = err ? err : msg.ret; - if (!err) { + if (err == 0) { (void) memcpy(ops, oob, ops_size); + if (is_current_ctx != NULL) { + *is_current_ctx = p->is_current_ctx != 0u; + } } fail: