From c4bb19d46e1c9121a0948fa506098cbf2f64e2a6 Mon Sep 17 00:00:00 2001 From: David Nieto Date: Fri, 7 Oct 2016 16:25:04 -0700 Subject: nvgpu: gpu: arbiter for vf switch management JIRA DNVGPU-143 The arbiter is charged with selecting the proper frequencies when multiple applications submit simultaneously clock change requests On the current implementation, the arbiter guarantees that the selected frequency will be always higher or equal to the request, as long as the request is in range. The current code is not yet realtime friendly, as requests are not pre-allocated. Summary of changes: (1) pstate/vf switch no longer selects boot frequency (2) changed mclk code change to accept input freq (3) added arbiter (4) now a single session can submit concurrent requests the last request is the one that applies for that session (5) modified locking mechanism to reduce lock contention (6) Added callback to notify the arbiter that the VF table has changed and is no longer valid (PMU/Thermals must call this when VF table is invalid) (7) changed internal API to work with MHz (8) added debugfs for stats Change-Id: I6a7b05c9447761e8536f84ef86b5ab0793164d63 Signed-off-by: David Nieto Reviewed-on: http://git-master/r/1239461 Reviewed-by: Thomas Fleury GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-on: http://git-master/r/1267120 Reviewed-by: Automatic_Commit_Validation_User --- drivers/gpu/nvgpu/clk/clk_mclk.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/clk/clk_mclk.h') diff --git a/drivers/gpu/nvgpu/clk/clk_mclk.h b/drivers/gpu/nvgpu/clk/clk_mclk.h index 9d193c96..e3e6c1ee 100644 --- a/drivers/gpu/nvgpu/clk/clk_mclk.h +++ b/drivers/gpu/nvgpu/clk/clk_mclk.h @@ -22,9 +22,12 @@ enum gk20a_mclk_speed { gk20a_mclk_high_speed, }; -#define DEFAULT_BOOT_MCLK_SPEED gk20a_mclk_high_speed #define MCLK_LOW_SPEED_LIMIT 405 #define MCLK_MID_SPEED_LIMIT 810 +#define MCLK_HIGH_SPEED_LIMIT 3003 + +#define DEFAULT_BOOT_MCLK_SPEED MCLK_HIGH_SPEED_LIMIT + struct clk_mclk_state { enum gk20a_mclk_speed speed; struct mutex mclk_mutex; @@ -32,7 +35,7 @@ struct clk_mclk_state { bool init; /* function pointers */ - int (*change)(struct gk20a *g, enum gk20a_mclk_speed speed); + int (*change)(struct gk20a *g, u16 val); #ifdef CONFIG_DEBUG_FS s64 switch_max; @@ -45,7 +48,6 @@ struct clk_mclk_state { }; int clk_mclkseq_init_mclk_gddr5(struct gk20a *g); -int clk_mclkseq_change_mclk_gddr5(struct gk20a *g, - enum gk20a_mclk_speed speed); +int clk_mclkseq_change_mclk_gddr5(struct gk20a *g, u16 val); #endif -- cgit v1.2.2