From 6b90684ceec6c32aed7491a059b3972b1f1be5f4 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Sat, 30 Dec 2017 13:04:19 -0800 Subject: gpu: nvgpu: vgpu: get virtual SMs mapping On gv11b we can have multiple SMs per TPC. Add sm_per_tpc in vgpu constants to properly dimension the virtual SM to TPC/GPC mapping in virtualization case. Use TEGRA_VGPU_CMD_GET_SMS_MAPPING to query current mapping. Bug 2039676 Change-Id: I817be18f9a28cfb9bd8af207d7d6341a2ec3994b Signed-off-by: Thomas Fleury Reviewed-on: https://git-master.nvidia.com/r/1631203 Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/linux/tegra_vgpu.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'include/linux/tegra_vgpu.h') diff --git a/include/linux/tegra_vgpu.h b/include/linux/tegra_vgpu.h index 7b5c9e11..74148294 100644 --- a/include/linux/tegra_vgpu.h +++ b/include/linux/tegra_vgpu.h @@ -1,7 +1,7 @@ /* * Tegra GPU Virtualization Interfaces to Server * - * Copyright (c) 2014-2017, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2014-2018, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -111,6 +111,7 @@ enum { TEGRA_VGPU_CMD_PERFBUF_MGT = 73, TEGRA_VGPU_CMD_GET_TIMESTAMPS_ZIPPER = 74, TEGRA_VGPU_CMD_TSG_RELEASE = 75, + TEGRA_VGPU_CMD_GET_VSMS_MAPPING = 76, }; struct tegra_vgpu_connect_params { @@ -482,6 +483,7 @@ struct tegra_vgpu_constants_params { u32 channel_base; struct tegra_vgpu_engines_info engines_info; u32 num_pce; + u32 sm_per_tpc; }; struct tegra_vgpu_channel_cyclestats_snapshot_params { @@ -530,6 +532,17 @@ struct tegra_vgpu_get_gpu_freq_table_params { u32 freqs[TEGRA_VGPU_GPU_FREQ_TABLE_SIZE]; /* in kHz */ }; +struct tegra_vgpu_vsms_mapping_params { + u32 num_sm; +}; + +struct tegra_vgpu_vsms_mapping_entry { + u32 gpc_index; + u32 tpc_index; + u32 sm_index; + u32 global_tpc_index; +}; + struct tegra_vgpu_cmd_msg { u32 cmd; int ret; @@ -584,6 +597,7 @@ struct tegra_vgpu_cmd_msg { struct tegra_vgpu_perfbuf_mgt_params perfbuf_management; struct tegra_vgpu_get_timestamps_zipper_params get_timestamps_zipper; struct tegra_vgpu_get_gpu_freq_table_params get_gpu_freq_table; + struct tegra_vgpu_vsms_mapping_params vsms_mapping; #ifdef CONFIG_TEGRA_19x_GPU union tegra_vgpu_t19x_params t19x; #endif -- cgit v1.2.2