From 63e9d8eb9ad80724f2567aaa7c05cb2c7acfd4b1 Mon Sep 17 00:00:00 2001 From: Aparna Das Date: Fri, 31 Jan 2020 12:34:07 -0800 Subject: gpu: nvgpu: vgpu: add mmu_debug_mode support Added two new IVC commands that set gr and fb mmu debug mode. Bug 2586624 Change-Id: I358fb04713a9754fb209c0a90d02130dd4a1caf6 Reviewed-on: https://git-master.nvidia.com/r/2204980 (cherry picked from commit db4e5b09891aff075dfffb7cc2fe0630a71ab9a6) Signed-off-by: Aparna Das Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2288347 Reviewed-by: Kajetan Dutka Reviewed-by: Yu-Huan Hsu Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: Kajetan Dutka Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/gr_vgpu.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/vgpu/gr_vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c index e3b1888e..cb4a441a 100644 --- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c @@ -1,7 +1,7 @@ /* * Virtualized GPU Graphics * - * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -1378,3 +1378,21 @@ int vgpu_gr_update_pc_sampling(struct channel_gk20a *ch, bool enable) return err ? err : msg.ret; } + +int vgpu_gr_set_mmu_debug_mode(struct gk20a *g, + struct channel_gk20a *ch, bool enable) +{ + struct tegra_vgpu_cmd_msg msg = {}; + struct tegra_vgpu_gr_set_mmu_debug_mode_params *p = + &msg.params.gr_set_mmu_debug_mode; + int err; + + msg.cmd = TEGRA_VGPU_CMD_GR_SET_MMU_DEBUG_MODE; + msg.handle = vgpu_get_handle(g); + p->ch_handle = ch->virt_ctx; + p->enable = enable ? 1U : 0U; + err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); + WARN_ON(err || msg.ret); + + return err ? err : msg.ret; +} -- cgit v1.2.2