diff options
author | Vinay Belgaumkar <vinay.belgaumkar@intel.com> | 2021-11-01 18:26:06 -0700 |
---|---|---|
committer | John Harrison <John.C.Harrison@Intel.com> | 2021-11-03 17:44:02 -0700 |
commit | 292e4fb05f14d54c90cb165335c6d4dfaf1cfb32 (patch) | |
tree | 36b4852481b74a7a1a588030b5e630e5dca54363 /drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h | |
parent | drm/i915: Rename GT_STEP to GRAPHICS_STEP (diff) | |
download | linux-dev-292e4fb05f14d54c90cb165335c6d4dfaf1cfb32.tar.xz linux-dev-292e4fb05f14d54c90cb165335c6d4dfaf1cfb32.zip |
drm/i915/guc/slpc: Define and initialize boost frequency
Define helpers and struct members required to record boost info.
Boost frequency is initialized to RP0 at SLPC init. Also define num_waiters
which can track the pending boost requests.
Boost will be done by scheduling a worker thread. This will avoid
the need to make H2G calls inside an interrupt context. Initialize the
worker function during SLPC init as well. Had to move intel_guc_slpc_init
a few lines below to accommodate this.
v2: Add a workqueue to handle waitboost
v3: Code review comments (Ashutosh)
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211102012608.8609-2-vinay.belgaumkar@intel.com
Diffstat (limited to '')
-rw-r--r-- | drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h index 41d13527666f..bf5b9a563c09 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h @@ -6,6 +6,9 @@ #ifndef _INTEL_GUC_SLPC_TYPES_H_ #define _INTEL_GUC_SLPC_TYPES_H_ +#include <linux/atomic.h> +#include <linux/workqueue.h> +#include <linux/mutex.h> #include <linux/types.h> #define SLPC_RESET_TIMEOUT_MS 5 @@ -20,10 +23,20 @@ struct intel_guc_slpc { u32 min_freq; u32 rp0_freq; u32 rp1_freq; + u32 boost_freq; /* frequency softlimits */ u32 min_freq_softlimit; u32 max_freq_softlimit; + + /* Protects set/reset of boost freq + * and value of num_waiters + */ + struct mutex lock; + + struct work_struct boost_work; + atomic_t num_waiters; + u32 num_boosts; }; #endif |