gpu: nvgpu: vgpu: profiler reservation support

Support for hwpm reservations in the virtual case:

- Add session ops for checking and setting global and context reservations, and
  releasing reservations
- in the native case, these just update reservation counts and flags
- in the vgpu case, when the reservation count is 0, check with the RM server
  that a reservation is possible: for global reservations, no other guest
  can have a reservation; for context reservations, no other guest can have
  a global reservation
- in the vgpu case, when the reservation count is decremented to 0, notify
  the RM server that the guest no longer has any reservations

Bug 1775465
JIRA VFND-3428

Change-Id: Idf115b730e465e35d0745c96a8f8ab6b645c7cae
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: http://git-master/r/1326166
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Peter Daifuku
2017-03-17 11:36:19 -07:00
committed by mobile promotions
parent 2fce77c286
commit 42db3e1879
4 changed files with 183 additions and 34 deletions

View File

@@ -105,6 +105,7 @@ enum {
TEGRA_VGPU_CMD_GET_GPU_CLK_RATE = 69,
TEGRA_VGPU_CMD_GET_GPU_FREQ_TABLE = 70,
TEGRA_VGPU_CMD_CAP_GPU_CLK_RATE = 71,
TEGRA_VGPU_CMD_PROF_MGT = 72,
};
struct tegra_vgpu_connect_params {
@@ -479,6 +480,16 @@ struct tegra_vgpu_get_gpu_freq_table_params {
u32 freqs[TEGRA_VGPU_GPU_FREQ_TABLE_SIZE]; /* in kHz */
};
enum {
TEGRA_VGPU_PROF_GET_GLOBAL = 0,
TEGRA_VGPU_PROF_GET_CONTEXT,
TEGRA_VGPU_PROF_RELEASE
};
struct tegra_vgpu_prof_mgt_params {
u32 mode;
};
struct tegra_vgpu_cmd_msg {
u32 cmd;
int ret;
@@ -529,6 +540,7 @@ struct tegra_vgpu_cmd_msg {
struct tegra_vgpu_suspend_resume_contexts resume_contexts;
struct tegra_vgpu_clear_sm_error_state clear_sm_error_state;
struct tegra_vgpu_get_gpu_freq_table_params get_gpu_freq_table;
struct tegra_vgpu_prof_mgt_params prof_management;
char padding[192];
} params;
};