summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2019-04-30 20:19:51 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2020-01-30 02:41:45 -0500
commitdc281d6a9ebadaeb66dab092b40b7d6f4559ee39 (patch)
treecbe2c286c1549c2824eade89a25c033a86a7dd6e /drivers/gpu/nvgpu/vgpu
parent6e91ecaae77d769955e5e1f34ded90c064e9c245 (diff)
gpu: nvgpu: add SET_CTX_MMU_DEBUG_MODE ioctl
Added NVGPU_DBG_GPU_IOCTL_SET_CTX_MMU_DEBUG_MODE ioctl to set MMU debug mode for a given context. Added gr.set_mmu_debug_mode HAL to change NV_PGPC_PRI_MMU_DEBUG_CTRL for a given channel. HAL implementation for native case is gm20b_gr_set_mmu_debug_mode. It internally uses regops, which directly writes to the register if the context is resident, or writes to gr context otherwise. Added NVGPU_SUPPORT_SET_CTX_MMU_DEBUG_MODE to enable the feature. NV_PGPC_PRI_MMU_DEBUG_CTRL has to be context switched in FECS ucode, so the feature is only enabled on TU104 for now. Bug 2515097 But 2713590 Change-Id: Ib4efaf06fc47a8539b4474f94c68c20ce225263f Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2110720 (cherry-picked from commit af2ccb811d3de06f052b1dee39bd9ffa863ac8ce) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2208767 Reviewed-by: Kajetan Dutka <kdutka@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: Kajetan Dutka <kdutka@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu')
-rw-r--r--drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c3
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gv11b.c1
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c3
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.c3
4 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c
index 7c800d5f..917ac638 100644
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c
+++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2015-2020, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"), 5 * copy of this software and associated documentation files (the "Software"),
@@ -234,6 +234,7 @@ static const struct gpu_ops vgpu_gp10b_ops = {
234 .get_offset_in_gpccs_segment = 234 .get_offset_in_gpccs_segment =
235 gr_gk20a_get_offset_in_gpccs_segment, 235 gr_gk20a_get_offset_in_gpccs_segment,
236 .set_debug_mode = gm20b_gr_set_debug_mode, 236 .set_debug_mode = gm20b_gr_set_debug_mode,
237 .set_mmu_debug_mode = NULL,
237 }, 238 },
238 .fb = { 239 .fb = {
239 .init_hw = NULL, 240 .init_hw = NULL,
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gv11b.c
index baddae13..2190478e 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gv11b.c
+++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gv11b.c
@@ -44,6 +44,7 @@ int vgpu_gv11b_init_gpu_characteristics(struct gk20a *g)
44 __nvgpu_set_enabled(g, NVGPU_SUPPORT_SYNCPOINT_ADDRESS, true); 44 __nvgpu_set_enabled(g, NVGPU_SUPPORT_SYNCPOINT_ADDRESS, true);
45 __nvgpu_set_enabled(g, NVGPU_SUPPORT_USER_SYNCPOINT, true); 45 __nvgpu_set_enabled(g, NVGPU_SUPPORT_USER_SYNCPOINT, true);
46 __nvgpu_set_enabled(g, NVGPU_SUPPORT_PLATFORM_ATOMIC, true); 46 __nvgpu_set_enabled(g, NVGPU_SUPPORT_PLATFORM_ATOMIC, true);
47 __nvgpu_set_enabled(g, NVGPU_SUPPORT_SET_CTX_MMU_DEBUG_MODE, false);
47 48
48 return 0; 49 return 0;
49} 50}
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c
index 78ea5643..41850c91 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c
+++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"), 5 * copy of this software and associated documentation files (the "Software"),
@@ -189,6 +189,7 @@ static const struct gpu_ops vgpu_gv11b_ops = {
189 .get_hw_accessor_stream_out_mode = 189 .get_hw_accessor_stream_out_mode =
190 gr_gv100_get_hw_accessor_stream_out_mode, 190 gr_gv100_get_hw_accessor_stream_out_mode,
191 .update_hwpm_ctxsw_mode = vgpu_gr_update_hwpm_ctxsw_mode, 191 .update_hwpm_ctxsw_mode = vgpu_gr_update_hwpm_ctxsw_mode,
192 .set_mmu_debug_mode = NULL,
192 .record_sm_error_state = gv11b_gr_record_sm_error_state, 193 .record_sm_error_state = gv11b_gr_record_sm_error_state,
193 .clear_sm_error_state = vgpu_gr_clear_sm_error_state, 194 .clear_sm_error_state = vgpu_gr_clear_sm_error_state,
194 .suspend_contexts = vgpu_gr_suspend_contexts, 195 .suspend_contexts = vgpu_gr_suspend_contexts,
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c
index 5a3f0046..e193ace9 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"), 5 * copy of this software and associated documentation files (the "Software"),
@@ -282,6 +282,7 @@ int vgpu_init_gpu_characteristics(struct gk20a *g)
282 282
283 /* features vgpu does not support */ 283 /* features vgpu does not support */
284 __nvgpu_set_enabled(g, NVGPU_SUPPORT_RESCHEDULE_RUNLIST, false); 284 __nvgpu_set_enabled(g, NVGPU_SUPPORT_RESCHEDULE_RUNLIST, false);
285 __nvgpu_set_enabled(g, NVGPU_SUPPORT_SET_CTX_MMU_DEBUG_MODE, false);
285 286
286 return 0; 287 return 0;
287} 288}