summaryrefslogtreecommitdiffstats
path: root/include/linux/tegra_vgpu.h
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2017-04-27 14:28:27 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-15 14:53:10 -0400
commit741e5c45179db066ddf5bed0be6f36e4d0d4010e (patch)
tree815f83070ae0fcf37a7b234caf8a2f86997f99bb /include/linux/tegra_vgpu.h
parent77e2cbab237637f71367df25384164b8c936a31a (diff)
gpu: nvgpu: hal for timestamps correlation
In order to perform timestamps correlation for FECS traces, we need to collect GPU / GPU timestamps samples. In virtualization case, it is possible for a guest to get GPU timestamps by using read_ptimer. However, if the CPU timestamp is read on guest side, and the GPU timestamp is read on vm-server side, then it introduces some latency that will create an artificial offset for GPU timestamps (~2 us in average). For better CPU / GPU timestamps correlation, Added a command to collect all timestamps on vm-server side. Bug 1900475 Change-Id: Idfdc6ae4c16c501dc5e00053a5b75932c55148d6 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: http://git-master/r/1472447 (cherry picked from commit 56f56b5cd9d2e75cf7d2613b5e115bfebdbee0ce) Reviewed-on: http://git-master/r/1489183 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include/linux/tegra_vgpu.h')
-rw-r--r--include/linux/tegra_vgpu.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/tegra_vgpu.h b/include/linux/tegra_vgpu.h
index daef7d98..67f51806 100644
--- a/include/linux/tegra_vgpu.h
+++ b/include/linux/tegra_vgpu.h
@@ -101,6 +101,7 @@ enum {
101 TEGRA_VGPU_CMD_RESUME_CONTEXTS = 67, 101 TEGRA_VGPU_CMD_RESUME_CONTEXTS = 67,
102 TEGRA_VGPU_CMD_CLEAR_SM_ERROR_STATE = 68, 102 TEGRA_VGPU_CMD_CLEAR_SM_ERROR_STATE = 68,
103 TEGRA_VGPU_CMD_PROF_MGT = 72, 103 TEGRA_VGPU_CMD_PROF_MGT = 72,
104 TEGRA_VGPU_CMD_GET_TIMESTAMPS_ZIPPER = 74,
104}; 105};
105 106
106struct tegra_vgpu_connect_params { 107struct tegra_vgpu_connect_params {
@@ -389,6 +390,22 @@ struct tegra_vgpu_read_ptimer_params {
389 u64 time; 390 u64 time;
390}; 391};
391 392
393#define TEGRA_VGPU_GET_TIMESTAMPS_ZIPPER_MAX_COUNT 16
394#define TEGRA_VGPU_GET_TIMESTAMPS_ZIPPER_SRC_ID_TSC 1
395struct tegra_vgpu_get_timestamps_zipper_params {
396 /* timestamp pairs */
397 struct {
398 /* gpu timestamp value */
399 u64 cpu_timestamp;
400 /* raw GPU counter (PTIMER) value */
401 u64 gpu_timestamp;
402 } samples[TEGRA_VGPU_GET_TIMESTAMPS_ZIPPER_MAX_COUNT];
403 /* number of pairs to read */
404 u32 count;
405 /* cpu clock source id */
406 u32 source_id;
407};
408
392struct tegra_vgpu_set_powergate_params { 409struct tegra_vgpu_set_powergate_params {
393 u32 mode; 410 u32 mode;
394}; 411};
@@ -518,6 +535,7 @@ struct tegra_vgpu_cmd_msg {
518 struct tegra_vgpu_suspend_resume_contexts resume_contexts; 535 struct tegra_vgpu_suspend_resume_contexts resume_contexts;
519 struct tegra_vgpu_clear_sm_error_state clear_sm_error_state; 536 struct tegra_vgpu_clear_sm_error_state clear_sm_error_state;
520 struct tegra_vgpu_prof_mgt_params prof_management; 537 struct tegra_vgpu_prof_mgt_params prof_management;
538 struct tegra_vgpu_get_timestamps_zipper_params get_timestamps_zipper;
521 char padding[192]; 539 char padding[192];
522 } params; 540 } params;
523}; 541};