Add support for GuC-based SLPC
Subsystems (2)
cover Add support for GuC-based SLPC
SLPC (Single Loop Power Controller) is a replacement for some host-based power management features. The SLPC implementation runs in GuC firmware. This series has been tested with SKL/APL/KBL GuC firmware v9 and v10 which are yet to be released on 01.org.
The graphics power management features in SLPC are called GTPERF, BALANCER, and DCC.
1. GTPERF is a combination of DFPS (Dynamic FPS) and Turbo. DFPS adjusts requested graphics frequency to maintain target framerate. Turbo adjusts requested graphics frequency to maintain target GT busyness.
2. BALANCER adjusts balance between power budgets for IA and GT in power limited scenarios.
3. DCC (Duty Cycle Control) adjusts requested graphics frequency and stalls guc-scheduler to maintain actual graphics frequency in efficient range.
This series activates GTPERF Turbo and BALANCER in GuC SLPC. Patch to enable SLPC by default on platforms having support is removed from this series as there are following new changes to be added in future before we enable GuC/SLPC by default:
1. Link waitboost with SLPC.
2. Handle CPG as part of SLPC.
3. IA p-state logic update with GuC submission.
In order to enable CI/PnP testing of SLPC and to avoid frequent rebase, this series should be safe for merge with feature in disabled state.
v2: Addressed review comments on v1. Removed patch to enable SLPC by
default.
v3: Addressed WARNING in igt@drv_module_reload_basic flagged by trybot BAT.
Added change for sanitizing GT PM during reset. Added separate patch for sysfs interface to know HW requested frequency. Also, earlier patches did not go as series hence were not correctly picked up by BAT.
v4: Changes to multiple patches. CI BAT is passing. Performance run on SKL
GT2 done and shows perf at parity with Host Turbo. For BXT, SLPC improves performance when GuC is enabled compared to Host Turbo. This series keeps only support of 9.18 firmware for better readability. If needed, other SLPC interfaces for different GuC version will be added later.
v5: This series incorporates feedback from code reviews on earlier series
and adds following new changes:
1. More changes for separation of RPS and RC6 handling for Gen9.
2. Tied up SLPC enabling with GuC load/GuC submission sequence.
3. SLPC structures are defined explicitly for event input/output.
4. Definition of SLPC parameter control and task control functions agnostic to the underlying param definitions as they might change with GuC versions and prepared helpers for common tasks.
5. Transition of i915 overrides done through host to guc events to shared data and single reset event.
6. Handling SLPC status post reset through shared memory.
7. Derived helpers for setting frequency limits.
8. Removed sysfs interface to know RPNSWREQ as it is available in debugfs interface i915_frequency_info.
9. Simple igt test to verify SLPC configuration by i915 in various driver scenarios is prepared.
v6: This series adds following new changes:
1. Updated intel_guc_send for SLPC to receive output data from GuC.
2. Added task overrides and min frequency overrides in intel_slpc_init. min frequency is set to Rpe.
3. New debugfs interface added to set/unset/read SLPC parameters other than tasks and frequencies. SLPC reset post parameter update added.
4. SLPC parameters persist as part of i915-GuC shared data hence not overriding frequency limits while re-enabling SLPC.
5. Other minor fixes to clear pm_rps_events, clflush the shared data.
v7: This series adds following new changes:
1. Reordered patches. SLPC communication interfaces (structures and functions) are pulled into patches earlier in the series.
2. Eliminated dependency on i915.enable_slpc at various functions where rps_enabled is available.
3. s/i915_ggtt_offset/guc_ggtt_offset and sanitization of parameter in intel_uc_sanitize_options.
v8: Activated Balancer. Changed prototype of SLPC functions to accept
struct intel_slpc as parameter instead of drm_i915_private.
VIZ-6889, VIZ-6890
Sagar Arun Kamble (11):
drm/i915/debugfs: Create generic string tokenize function and update
CRC control parsing
drm/i915/gen9+: Separate RPS and RC6 handling drm/i915/slpc: Lay out SLPC init/enable/disable/cleanup helpers drm/i915/slpc: Add SLPC communication interfaces drm/i915/slpc: Allocate/Release/Initialize SLPC shared data drm/i915/slpc: Add parameter set/unset/get, task control/status
functions
drm/i915/slpc: Send RESET event to enable SLPC drm/i915/slpc: Add support for min/max frequency control drm/i915/slpc: Add debugfs support to read/write/revert the parameters drm/i915/slpc: Add SLPC banner to RPS debugfs interfaces. drm/i915/slpc: Add Kabylake SLPC support
Tom O'Rourke (9):
drm/i915/slpc: Add has_slpc capability flag drm/i915/slpc: Add enable_slpc module parameter drm/i915/slpc: Sanitize GuC version drm/i915/slpc: Enable SLPC in GuC if supported drm/i915/slpc: Send SHUTDOWN event drm/i915/slpc: Add enable/disable controls for SLPC tasks drm/i915/slpc: Add i915_slpc_info to debugfs drm/i915/slpc: Add SKL SLPC Support drm/i915/slpc: Add Broxton SLPC support
drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/i915_debugfs.c | 243 +++++++- drivers/gpu/drm/i915/i915_drv.c | 11 +- drivers/gpu/drm/i915/i915_drv.h | 24 +- drivers/gpu/drm/i915/i915_irq.c | 5 + drivers/gpu/drm/i915/i915_params.c | 6 + drivers/gpu/drm/i915/i915_params.h | 1 + drivers/gpu/drm/i915/i915_pci.c | 3 + drivers/gpu/drm/i915/i915_sysfs.c | 36 +- drivers/gpu/drm/i915/intel_csr.c | 15 +- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_guc.c | 26 +- drivers/gpu/drm/i915/intel_guc.h | 6 + drivers/gpu/drm/i915/intel_guc_loader.c | 18 + drivers/gpu/drm/i915/intel_pipe_crc.c | 88 +-- drivers/gpu/drm/i915/intel_pm.c | 117 +++- drivers/gpu/drm/i915/intel_slpc.c | 985 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 274 +++++++++ drivers/gpu/drm/i915/intel_uc.c | 39 ++ drivers/gpu/drm/i915/intel_uc_common.h | 2 + 20 files changed, 1806 insertions(+), 95 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_slpc.c create mode 100644 drivers/gpu/drm/i915/intel_slpc.h
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/20 drm/i915/debugfs: Create generic string tokenize function and update CRC control parsing
Input string parsing used in CRC control parameter parsing is generic and can be reused for other debugfs interfaces. Hence name it as buffer_tokenize instead of tieing to display_crc. Also fix the function desciption for CRC control parsing that was misplaced at tokenize function.
--- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_pipe_crc.c | 88 +++++++++++++++++------------------ 2 files changed, 45 insertions(+), 44 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -3801,6 +3801,7 @@ u32 i915_gem_fence_alignment(struct drm_i915_private *dev_priv, u32 size,int i915_debugfs_register (struct drm_i915_private *dev_priv);int i915_debugfs_connector_add (struct drm_connector *connector);void intel_display_crc_init (struct drm_i915_private *dev_priv); +int buffer_tokenize (char *buf,char *words[],int max_words);#else static inline int i915_debugfs_register (struct drm_i915_private *dev_priv) {return 0 ;}static inline int i915_debugfs_connector_add (struct drm_connector *connector)
drivers/gpu/drm/i915/intel_pipe_crc.c +44 -44
106 lines not on this page · raw message
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/20] drm/i915/debugfs: Create generic string tokenize function and update CRC control parsing
Quoted 3 lines · Sagar Arun Kamble
Input string parsing used in CRC control parameter parsing is generic and can be reused for other debugfs interfaces. Hence name it as
buffer_tokenizeinstead of tieing todisplay_crc. Also fix the function
s/tieing/tying ?
Quoted 1 line
desciption for CRC control parsing that was misplaced at tokenize function.
s/desciption/description
Quoted 3 lines
Cc Tomeu Vizoso <[email protected]>Signed-off-by Sagar Arun Kamble <[email protected]>
Don't you think we could try to review and merge this change as separate commit and not part of this series?
Some spelling mistakes, otherwise LGTM
-Radek
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/20 drm/i915/gen9+: Separate RPS and RC6 handling
In reply to Sagar Arun KambleWith GuC based SLPC, frequency control will be moved to GuC and Host will continue to control RC6 and Ring frequency setup. SLPC can be enabled in the GuC setup path and can happen in parallel in GuC with other i915 setup. Hence we can do away with deferred RPS enabling. This needs separate handling of RPS, RC6 and ring frequencies in driver flows. We can still use the *gt_powersave routines with separate status variables of RPS, RC6 and SLPC. With this patch, RC6 and ring frequencies setup(if applicable) can be tracked through rps.rc6_enabled and RPS through rps.rps_enabled. Also, Active RPS check in suspend flow is needed for platforms with RC6 and RPS enabling/disabling coupled together. RPM suspend depends only on RC6 though. Hence Active RPS check is done only for non-Gen9 platforms.
v2: Changing parameter to dev_priv for IS_GEN9 and HAS_RUNTIME_PM and line
spacing changes. (David)
and commit message update for checkpatch issues.
v3: Rebase.
v4: Commit message update.
v5: Updated intel_enable_gt_powersave and intel_disable_gt_powersave
routines with separated RPS and RC6 handling and rebase. Commit message update.(Sagar)
v6: Added comments at the definition of rc6_enabled.
v7: s/rps.enabled/rps.rps_enabled. With gen9 preproduction RPS disabling
changes removed, updating rps_enabled in enable/disable_gt_powersave. Added checks for rc6_enabled and rps_enabled for gen9+ platforms.
--- drivers/gpu/drm/i915/i915_debugfs.c | 4 +- drivers/gpu/drm/i915/i915_drv.c | 9 +++- drivers/gpu/drm/i915/i915_drv.h | 9 +++- drivers/gpu/drm/i915/intel_pm.c | 88 ++++++++++++++++++++++++++----------- 4 files changed, 80 insertions(+), 30 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +2 -2
@@ -2252,7 +2252,7 @@ static int i915_rps_boost_info(struct seq_file *m, void *data)struct drm_device *dev = &dev_priv->drm;struct drm_file *file; -seq_printf (m,"RPS enabled? %d\n" , dev_priv->rps.enabled); +seq_printf (m,"RPS enabled? %d\n" , dev_priv->rps.rps_enabled);seq_printf (m,"GPU busy? %s [%d requests]\n" ,yesno (dev_priv->gt.awake), dev_priv->gt.active_requests);seq_printf (m,"CPU waiting? %d\n" ,count_irq_waiters (dev_priv));
@@ -2288,7 +2288,7 @@ static int i915_rps_boost_info(struct seq_file *m, void *data)mutex_unlock (&dev->filelist_mutex);if (INTEL_GEN (dev_priv) >=6 && - dev_priv->rps.enabled && + dev_priv->rps.rps_enabled && dev_priv->gt.active_requests) {u32 rpup, rpupei;u32 rpdown, rpdownei;
drivers/gpu/drm/i915/i915_drv.c +8 -1
@@ -2468,9 +2468,16 @@ static int intel_runtime_suspend(struct device *kdev)struct drm_i915_private *dev_priv =to_i915 (dev);int ret; -if (WARN_ON_ONCE (!(dev_priv->rps.enabled &&intel_enable_rc6 ()))) +if (WARN_ON_ONCE (!intel_enable_rc6 ()))return -ENODEV ; +if (INTEL_GEN (dev_priv) >=9 ) { +if (WARN_ON_ONCE (!dev_priv->rps.rc6_enabled)) +return -ENODEV ; + }else if (WARN_ON_ONCE (!dev_priv->rps.rps_enabled)) { +return -ENODEV ; + } +if (WARN_ON_ONCE (!HAS_RUNTIME_PM (dev_priv)))return -ENODEV ;
drivers/gpu/drm/i915/i915_drv.h +7 -2
@@ -1336,7 +1336,12 @@ struct intel_gen6_power_mgmt {int last_adj;enum {LOW_POWER ,BETWEEN ,HIGH_POWER } power; -bool enabled; +/* +* For platforms prior to Gen9, RPS and RC6 status is tracked through +* "rps_enabled". For Gen9+, RC6 is tracked through "rc6_enabled". +*/ +bool rps_enabled; +bool rc6_enabled;struct delayed_work autoenable_work;atomic_t num_waiters;atomic_t boosts;
@@ -2376,7 +2381,7 @@ struct drm_i915_private {/* Cannot be determined by PCIID. You must always read a register. */ u32 edram_cap; -/* gen6+ rps state */ +/* gen6+ rps/rc6 state */ struct intel_gen6_power_mgmt rps;/* ilk-only ips/rps state. Everything in here is protected by the global
drivers/gpu/drm/i915/intel_pm.c +63 -25
181 lines not on this page · raw message
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/20] drm/i915/gen9+: Separate RPS and RC6 handling
Quoted 24 lines · Sagar Arun Kamble
With GuC based SLPC, frequency control will be moved to GuC and Host will continue to control RC6 and Ring frequency setup. SLPC can be enabled in the GuC setup path and can happen in parallel in GuC with other i915 setup. Hence we can do away with deferred RPS enabling. This needs separate handling of RPS, RC6 and ring frequencies in driver flows. We can still use the
*gt_powersaveroutines with separate status variables of RPS, RC6 and SLPC. With this patch, RC6 and ring frequencies setup(if applicable) can be tracked through rps.rc6_enabled and RPS through rps.rps_enabled. Also, Active RPS check in suspend flow is needed for platforms with RC6 and RPS enabling/disabling coupled together. RPM suspend depends only on RC6 though. Hence Active RPS check is done only for non-Gen9 platforms.v2: Changing parameter to
dev_privforIS_GEN9andHAS_RUNTIME_PMand line spacing changes. (David)
and commit message update for checkpatch issues.v3: Rebase.
v4: Commit message update.
v5: Updated
intel_enable_gt_powersaveandintel_disable_gt_powersaveroutines with separated RPS and RC6 handling and rebase. Commit message update.(Sagar)
Quoted 7 lines
v6: Added comments at the definition of
rc6_enabled.v7: s/rps.enabled/rps.rps_enabled. With gen9 preproduction RPS disabling changes removed, updating
rps_enabledin enable/disable_gt_powersave. Added checks forrc6_enabledandrps_enabledfor gen9+ platforms.Signed-off-by Sagar Arun Kamble <[email protected]>
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/20] drm/i915/gen9+: Separate RPS and RC6 handling
In reply to Sagar Arun KambleQuoting Sagar Arun Kamble (2017-09-01 08:25:05)
Quoted 47 lines
drivers/gpu/drm/i915/intel_pm.c +17
-11+/* +* This function enables RPS and RC6 for platforms prior to GEN9 and +* enables only RPS for GEN9+. +*/ +void __intel_enable_gt_powersave (struct drm_i915_private *dev_priv) {/* We shouldn't be disabling as we submit, so this should be less * racy than it appears! */ -if (READ_ONCE (dev_priv->rps.enabled)) +if (READ_ONCE (dev_priv->rps.rps_enabled))return ; -/* Powersaving is controlled by the host when inside a VM */ -if (intel_vgpu_active (dev_priv)) -return ; - -mutex_lock (&dev_priv->rps.hw_lock); -if (IS_CHERRYVIEW (dev_priv)) {cherryview_enable_rps (dev_priv); }else if (IS_VALLEYVIEW (dev_priv)) {valleyview_enable_rps (dev_priv); }else if (INTEL_GEN (dev_priv) >=9 ) { -gen9_enable_rc6 (dev_priv);gen9_enable_rps (dev_priv); -if (IS_GEN9_BC (dev_priv) ||IS_CANNONLAKE (dev_priv)) -gen6_update_ring_freq (dev_priv); }else if (IS_BROADWELL (dev_priv)) {gen8_enable_rps (dev_priv);gen6_update_ring_freq (dev_priv);@@ -7878,10 +7891,35 @@ void intel_enable_gt_powersave(struct drm_i915_private *dev_priv)WARN_ON (dev_priv->rps.efficient_freq < dev_priv->rps.min_freq);WARN_ON (dev_priv->rps.efficient_freq > dev_priv->rps.max_freq); - dev_priv->rps.enabled = true; + dev_priv->rps.rps_enabled = true; +} + +void intel_enable_gt_powersave (struct drm_i915_private *dev_priv) +{ +/* Powersaving is controlled by the host when inside a VM */ +if (intel_vgpu_active (dev_priv)) +return ; + +mutex_lock (&dev_priv->rps.hw_lock); +
drivers/gpu/drm/i915/intel_pm.c void intel_enable_gt_powersave(struct drm_i915_private *dev_priv) · line 7914
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +8
-0+if (INTEL_GEN (dev_priv) >=9 ) { +if (!READ_ONCE (dev_priv->rps.rc6_enabled)) +gen9_enable_rc6 (dev_priv); +if (IS_GEN9_BC (dev_priv) ||IS_CANNONLAKE (dev_priv)) +gen6_update_ring_freq (dev_priv); + } +__intel_enable_gt_powersave (dev_priv); +mutex_unlock (&dev_priv->rps.hw_lock); }
Ok, still nowhere close to being separate. Let's see if I can find the patches I had to start making rc6 separate from rps.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/20 drm/i915/slpc: Add has_slpc capability flag
In reply to Sagar Arun KambleFrom: Tom O'Rourke <Tom.O'[email protected]>
Add has_slpc capablity flag to indicate GuC firmware supports single loop power control (SLPC). SLPC is a replacement for some host-based power management features.
v1: fix whitespace (Sagar)
--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -793,6 +793,7 @@ struct intel_csr {func (has_rc6p); \func (has_resource_streamer); \func (has_runtime_pm); \ +func (has_slpc); \func (has_snoop); \func (unfenced_needs_alignment); \func (cursor_needs_physical); \
@@ -3105,6 +3106,7 @@ static inline struct scatterlist *__sg_next(struct scatterlist *sg)#define HAS_GUC_UCODE (dev_priv) (HAS_GUC(dev_priv))#define HAS_GUC_SCHED (dev_priv) (HAS_GUC(dev_priv))#define HAS_HUC_UCODE (dev_priv) (HAS_GUC(dev_priv)) +#define HAS_SLPC (dev_priv) ((dev_priv)->info.has_slpc)#define HAS_RESOURCE_STREAMER (dev_priv) ((dev_priv)->info.has_resource_streamer)
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/20 drm/i915/slpc: Add enable_slpc module parameter
In reply to Sagar Arun KambleFrom: Tom O'Rourke <Tom.O'[email protected]>
i915.enable_slpc is used to override the default for slpc usage. The expected values are -1=auto, 0=disabled [default], 1=enabled.
Sanitize i915.enable_slpc to either 0 or 1 based on HAS_SLPC() and GuC load and submission options.
v1: Add early call to sanitize enable_slpc in intel_guc_ucode_init
Remove sanitize enable_slpc call before firmware version check is performed. (ChrisW)
Version check is added in next patch and that will be done as part of slpc_enable_sanitize function in the next patch. (Sagar) Updated slpc option sanitize function call for platforms without GuC support. This was caught by CI BAT.
v2: Changed parameter to dev_priv for HAS_SLPC macro. (David)
Code indentation based on checkpatch.
v3: Rebase.
v4: Moved sanitization of SLPC option post GuC load.
v5: Removed function intel_slpc_enabled. Planning to rely only on
kernel parameter. Moved sanitization prior to GuC load to use the parameter during SLPC state setup during to GuC load. (Sagar)
v6: Commit message update. Rebase.
v7: Moved SLPC option sanitization to intel_uc_sanitize_options.
--- drivers/gpu/drm/i915/i915_params.c | 6 ++++++ drivers/gpu/drm/i915/i915_params.h | 1 + drivers/gpu/drm/i915/intel_uc.c | 13 +++++++++++++ 3 files changed, 20 insertions(+)
drivers/gpu/drm/i915/i915_params.c +6 -0
@@ -36,6 +36,7 @@ struct i915_params i915 __read_mostly = { .enable_dc = -1, .enable_fbc = -1, .enable_execlists = -1, + .enable_slpc = 0, .enable_hangcheck = true, .enable_ppgtt = -1, .enable_psr = -1,
@@ -146,6 +147,11 @@ struct i915_params i915 __read_mostly = {"Override execlists usage. " "(-1=auto [default], 0=disabled, 1=enabled)"); +module_param_named_unsafe (enable_slpc, i915.enable_slpc, int,0400 ); +MODULE_PARM_DESC (enable_slpc, +"Override single-loop-power-controller (slpc) usage. " +"(-1=auto, 0=disabled [default], 1=enabled)" ); +module_param_named_unsafe (enable_psr, i915.enable_psr, int,0600 );MODULE_PARM_DESC (enable_psr,"Enable PSR " "(0=disabled, 1=enabled - link mode chosen per-platform, 2=force link-standby mode, 3=force link-off mode) "
drivers/gpu/drm/i915/i915_params.h +1 -0
@@ -41,6 +41,7 @@func (int, enable_ppgtt); \func (int, enable_execlists); \func (int, enable_psr); \ +func (int, enable_slpc); \func (int, disable_power_well); \func (int, enable_ips); \func (int, invert_brightness); \
drivers/gpu/drm/i915/intel_uc.c +13 -0
@@ -68,6 +68,7 @@ void intel_uc_sanitize_options(struct drm_i915_private *dev_priv) i915.enable_guc_loading =0 ; i915.enable_guc_submission =0 ; + i915.enable_slpc =0 ;return ; }
@@ -91,6 +92,18 @@ void intel_uc_sanitize_options(struct drm_i915_private *dev_priv)/* A negative value means "use platform default" */ if (i915.enable_guc_submission <0 ) i915.enable_guc_submission =HAS_GUC_SCHED (dev_priv); + +/* slpc requires hardware support and compatible firmware */ +if (!HAS_SLPC (dev_priv)) + i915.enable_slpc =0 ; + +/* slpc requires guc loaded */ +if (!i915.enable_guc_loading) + i915.enable_slpc =0 ; + +/* slpc requires guc submission */ +if (!i915.enable_guc_submission) + i915.enable_slpc =0 ; }void intel_uc_init_early (struct drm_i915_private *dev_priv)
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/20 drm/i915/slpc: Sanitize GuC version
In reply to Sagar Arun KambleFrom: Tom O'Rourke <Tom.O'[email protected]>
The SLPC interface is dependent on GuC version. Only GuC versions known to be compatible are supported here.
SLPC with GuC firmware v9 is supported with this series.
v1: Updated with modified sanitize_slpc_option in earlier patch.
v2-v3: Rebase.
v4: Updated support for GuC firmware v9.
v5: Commit subject updated.
v6: Commit subject and message update. Add support condition as >=v9.
v7: Sanitizing GuC version in intel_uc_init_fw for SLPC compatibility.
Added info. print for needed version and pointer to 01.org.
v8: s/FIRMWARE_URL/I915_FIRMWARE_URL, Macro added for SLPC required GuC
Major version and rearrangement for sanitization. (MichalW, Joonas)
v9: Checking major_ver_found to sanitize SLPC option enable_slpc post
fetching the firmware as with Custom firmware loaded through guc_firmware_path parameter, major_ver_wanted are cleared. (Lukasz)
--- drivers/gpu/drm/i915/intel_csr.c | 15 ++++++--------- drivers/gpu/drm/i915/intel_guc.h | 1 + drivers/gpu/drm/i915/intel_guc_loader.c | 15 +++++++++++++++ drivers/gpu/drm/i915/intel_uc.c | 1 + drivers/gpu/drm/i915/intel_uc_common.h | 2 ++ 5 files changed, 25 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/intel_csr.c +6 -9
@@ -52,11 +52,6 @@MODULE_FIRMWARE (I915_CSR_BXT );#define BXT_CSR_VERSION_REQUIRED CSR_VERSION(1, 7) -#define FIRMWARE_URL "https://01.org/linuxgraphics/downloads/firmware" - - - -#define CSR_MAX_FW_SIZE 0x2FFF#define CSR_DEFAULT_FW_OFFSET 0xFFFFFFFF
@@ -309,11 +304,12 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,if (csr->version != required_version) {DRM_INFO ("Refusing to load DMC firmware v%u.%u," -" please use v%u.%u [" FIRMWARE_URL "].\n" , +" please use v%u.%u [%s].\n" ,CSR_VERSION_MAJOR (csr->version),CSR_VERSION_MINOR (csr->version),CSR_VERSION_MAJOR (required_version), -CSR_VERSION_MINOR (required_version)); +CSR_VERSION_MINOR (required_version), +I915_FIRMWARE_URL );return NULL ; }
@@ -420,8 +416,9 @@ static void csr_load_work_fn(struct work_struct *work) }else {dev_notice (dev_priv->drm.dev,"Failed to load DMC firmware" -" [" FIRMWARE_URL "]," -" disabling runtime power management.\n" ); +" [%s]," +" disabling runtime power management.\n" , +I915_FIRMWARE_URL ); }release_firmware (fw);
drivers/gpu/drm/i915/intel_guc.h +1 -0
@@ -186,6 +186,7 @@ static inline void intel_guc_notify(struct intel_guc *guc)int intel_guc_select_fw (struct intel_guc *guc);int intel_guc_init_hw (struct intel_guc *guc);u32 intel_guc_wopcm_size (struct drm_i915_private *dev_priv); +void intel_guc_fetch_sanitize_options (struct intel_guc *guc);/* i915_guc_submission.c */ int i915_guc_submission_init (struct drm_i915_private *dev_priv);
drivers/gpu/drm/i915/intel_guc_loader.c +15 -0
@@ -63,6 +63,8 @@#define GLK_FW_MAJOR 10#define GLK_FW_MINOR 56 +#define I915_SLPC_REQUIRED_GUC_MAJOR 9 +#define GUC_FW_PATH (platform, major, minor) \ "i915/" __stringify(platform) "_guc_ver" __stringify(major) "_" __stringify(minor) ".bin"
@@ -426,3 +428,16 @@ int intel_guc_select_fw(struct intel_guc *guc)return 0 ; } + +void intel_guc_fetch_sanitize_options (struct intel_guc *guc) +{ +if (guc->fw.major_ver_found < +I915_SLPC_REQUIRED_GUC_MAJOR ) { +DRM_INFO ("SLPC not supported with GuC firmware" +" v%u, please use v%u+ [%s].\n" , + guc->fw.major_ver_found, +I915_SLPC_REQUIRED_GUC_MAJOR , +I915_FIRMWARE_URL ); + i915.enable_slpc =0 ; + } +}
drivers/gpu/drm/i915/intel_uc.c +1 -0
@@ -195,6 +195,7 @@ static void fetch_uc_fw(struct drm_i915_private *dev_priv, } uc_fw->major_ver_found = css->guc.sw_version >>16 ; uc_fw->minor_ver_found = css->guc.sw_version &0xFFFF ; +intel_guc_fetch_sanitize_options (&dev_priv->guc);break ;case INTEL_UC_FW_TYPE_HUC :
drivers/gpu/drm/i915/intel_uc_common.h +2 -0
@@ -24,6 +24,8 @@#ifndef _INTEL_UC_COMMON_H_#define _INTEL_UC_COMMON_H_ +#define I915_FIRMWARE_URL "https://01.org/linuxgraphics/intel-linux-graphics-firmwares" +enum intel_uc_fw_status {INTEL_UC_FIRMWARE_FAIL =-1 , INTEL_UC_FIRMWARE_NONE = 0,
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/20 drm/i915/slpc: Lay out SLPC init/enable/disable/cleanup helpers
In reply to Sagar Arun KambleSLPC operates based on parameters setup in shared data between i915 and GuC SLPC. This is to be created/initialized in intel_slpc_init.
Quoted 1 line
From then onwards i915 can control the SLPC operations by Enabling,
Disabling complete SLPC or changing SLPC parameters. During cleanup SLPC shared data has to be freed.
With this patch on platforms with SLPC support we call intel_slpc_*() functions from GuC setup functions and do not use Host rps functions. With SLPC, intel_enable_gt_powersave will only handle RC6 and ring frequencies. In the later patch intel_init_gt_powersave will check if SLPC has started running through shared data and update initial state that i915 needs like frequency limits.
v1: Return void instead of ignored error code (Paulo)
enable/disable RC6 in SLPC flows (Sagar)
replace HAS_SLPC() use with intel_slpc_enabled()
or intel_slpc_active() (Paulo)
Fix for renaming gen9_disable_rps to gen9_disable_rc6 in "drm/i915/bxt: Explicitly clear the Turbo control register" Defer RC6 and SLPC enabling to intel_gen6_powersave_work. (Sagar) Performance drop with SLPC was happening as ring frequency table was not programmed when SLPC was enabled. This patch programs ring frequency table with SLPC. Initial reset of SLPC is based on kernel parameter as planning to add slpc state in intel_slpc_active. Cleanup is also based on kernel parameter as SLPC gets disabled in disable/suspend.(Sagar)
v2: Usage of INTEL_GEN instead of INTEL_INFO->gen (David)
Checkpatch update.
v3: Rebase
v4: Removed reset functions to comply with *_gt_powersave routines.
(Sagar)
v5: Removed intel_slpc_active. Relying on slpc.active for control flows
that are based on SLPC active status in GuC. State setup/cleanup needed for SLPC is handled using kernel parameter i915.enable_slpc. Moved SLPC init and enabling to GuC enable path as SLPC in GuC can start doing the setup post GuC init. Commit message update. (Sagar)
v6: Rearranged function definitions.
v7: Makefile rearrangement. Reducing usage of i915.enable_slpc and relying
mostly on rps.rps_enabled to bypass Host RPS flows. Commit message update.
v8: Changed parameters for SLPC functions to struct intel_slpc*.
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/i915_drv.h | 12 +++++++++++ drivers/gpu/drm/i915/i915_irq.c | 5 +++++ drivers/gpu/drm/i915/intel_guc.c | 5 +++++ drivers/gpu/drm/i915/intel_guc.h | 3 +++ drivers/gpu/drm/i915/intel_pm.c | 23 ++++++++++++++++++--- drivers/gpu/drm/i915/intel_slpc.c | 42 +++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 37 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uc.c | 25 +++++++++++++++++++++++ 9 files changed, 150 insertions(+), 3 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_slpc.c create mode 100644 drivers/gpu/drm/i915/intel_slpc.h
drivers/gpu/drm/i915/Makefile +1 -0
@@ -64,6 +64,7 @@ i915-y += intel_uc.o \ intel_guc_log.o \ intel_guc_loader.o \ intel_huc.o \ + intel_slpc.o \ i915_guc_submission.o # autogenerated null render state
drivers/gpu/drm/i915/i915_drv.h +12 -0
@@ -2710,6 +2710,18 @@ static inline struct drm_i915_private *guc_to_i915(struct intel_guc *guc) return container_of(guc, struct drm_i915_private, guc); } +static inline struct intel_guc *slpc_to_guc (struct intel_slpc *slpc) +{ + return container_of(slpc, struct intel_guc, slpc); +} + +static inline struct drm_i915_private *slpc_to_i915 (struct intel_slpc *slpc) +{ +struct intel_guc *guc =slpc_to_guc (slpc); + +return guc_to_i915 (guc); +} +static inline struct drm_i915_private *huc_to_i915 (struct intel_huc *huc) { return container_of(huc, struct drm_i915_private, huc);
drivers/gpu/drm/i915/i915_irq.c +5 -0
@@ -2620,6 +2620,11 @@ static void i915_reset_device(struct drm_i915_private *dev_priv)set_bit (I915_RESET_HANDOFF , &dev_priv->gpu_error.flags);wake_up_all (&dev_priv->gpu_error.wait_queue); +/* +* TODO: Enable SLPC with TDR indication to SLPC in case of +* Engine Reset. +*/ +/* Wait for anyone holding the lock to wakeup, without * blocking indefinitely on struct_mutex. */
drivers/gpu/drm/i915/intel_guc.c +5 -0
@@ -349,6 +349,11 @@ void intel_guc_fini(struct intel_guc *guc)struct drm_i915_private *dev_priv =guc_to_i915 (guc);struct drm_device *dev = &dev_priv->drm; +if (i915.enable_slpc) { +if (dev_priv->guc.slpc.active) +intel_slpc_disable (&dev_priv->guc.slpc); + } +if (i915.enable_guc_submission) {mutex_lock (&dev->struct_mutex);i915_guc_submission_disable (dev_priv);
drivers/gpu/drm/i915/intel_guc.h +3 -0
@@ -29,6 +29,7 @@#include "intel_ringbuffer.h" #include "intel_guc_ct.h" #include "i915_vma.h" +#include "intel_slpc.h" struct drm_i915_gem_request ;
@@ -136,6 +137,8 @@ struct intel_guc {enum forcewake_domains fw_domains; } send_regs; +struct intel_slpc slpc; +/* To serialize the intel_guc_send actions */ struct mutex send_mutex;
drivers/gpu/drm/i915/intel_pm.c +20 -3
@@ -6117,6 +6117,9 @@ static void vlv_set_rps_idle(struct drm_i915_private *dev_priv)void gen6_rps_busy (struct drm_i915_private *dev_priv) { +if (!dev_priv->rps.rps_enabled) +return ; +mutex_lock (&dev_priv->rps.hw_lock);if (dev_priv->rps.rps_enabled) {u8 freq;
@@ -6145,6 +6148,9 @@ void gen6_rps_busy(struct drm_i915_private *dev_priv)void gen6_rps_idle (struct drm_i915_private *dev_priv) { +if (!dev_priv->rps.rps_enabled) +return ; +/* Flush our bottom-half so that it does not race with us * setting the idle frequency and so that it is bounded by * our rpm wakeref. And then disable the interrupts to stop any
@@ -7808,6 +7814,12 @@ void intel_suspend_gt_powersave(struct drm_i915_private *dev_priv)intel_runtime_pm_put (dev_priv);/* gen6_rps_idle() will be called later to disable interrupts */ + +if (dev_priv->guc.slpc.active) { +intel_runtime_pm_get (dev_priv); +intel_slpc_disable (&dev_priv->guc.slpc); +intel_runtime_pm_put (dev_priv); + } }void intel_sanitize_gt_powersave (struct drm_i915_private *dev_priv)
@@ -7908,15 +7920,20 @@ void intel_enable_gt_powersave(struct drm_i915_private *dev_priv)if (IS_GEN9_BC (dev_priv) ||IS_CANNONLAKE (dev_priv))gen6_update_ring_freq (dev_priv); } -__intel_enable_gt_powersave (dev_priv); + +if (!i915.enable_slpc) +__intel_enable_gt_powersave (dev_priv);mutex_unlock (&dev_priv->rps.hw_lock); }#define GT_POWERSAVE_ENABLED (dev_priv) \ (((INTEL_GEN(dev_priv) >= 9) && \ - (READ_ONCE(dev_priv->rps.rps_enabled) && \ - READ_ONCE(dev_priv->rps.rc6_enabled))) || \ + ((!i915.enable_slpc && \ + READ_ONCE(dev_priv->rps.rps_enabled) && \ + READ_ONCE(dev_priv->rps.rc6_enabled)) || \ + (i915.enable_slpc && \ + READ_ONCE(dev_priv->rps.rc6_enabled)))) || \ ((INTEL_GEN(dev_priv) < 9) && \ READ_ONCE(dev_priv->rps.rps_enabled)))
drivers/gpu/drm/i915/intel_slpc.c new file +42 -0
42 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h new file +37 -0
@@ -0,0 +1,37 @@ +/* +* Copyright © 2017 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +* +*/ +#ifndef _INTEL_SLPC_H_ +#define _INTEL_SLPC_H_ + +struct intel_slpc { +bool active; +}; + +/* intel_slpc.c */ +void intel_slpc_init (struct intel_slpc *slpc); +void intel_slpc_cleanup (struct intel_slpc *slpc); +void intel_slpc_enable (struct intel_slpc *slpc); +void intel_slpc_disable (struct intel_slpc *slpc); + +#endif
drivers/gpu/drm/i915/intel_uc.c +25 -0
@@ -302,6 +302,9 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv) ret =i915_guc_submission_init (dev_priv);if (ret) goto err_guc; + +if (i915.enable_slpc) +intel_slpc_init (&dev_priv->guc.slpc); }/* init WOPCM */
@@ -345,6 +348,17 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv) goto err_log_capture;intel_huc_auth (huc); + +/* +* SLPC is enabled by setting up the shared data structure and +* sending reset event to GuC SLPC. Initial data is setup in +* intel_slpc_init. Here we send the reset event. SLPC enabling +* in GuC can happen in parallel in GuC with other initialization +* being done in i915. +*/ +if (i915.enable_slpc) +intel_slpc_enable (&dev_priv->guc.slpc); +if (i915.enable_guc_submission) {if (i915.guc_log_level >=0 )gen9_enable_guc_interrupts (dev_priv);
@@ -374,6 +388,12 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)if (i915.enable_guc_submission)i915_guc_submission_fini (dev_priv); err_guc: +if (i915.enable_slpc) { +if (dev_priv->guc.slpc.active) +intel_slpc_disable (&dev_priv->guc.slpc); +intel_slpc_cleanup (&dev_priv->guc.slpc); + } +i915_ggtt_disable_guc (dev_priv);DRM_ERROR ("GuC init failed\n" );
@@ -390,6 +410,8 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv) i915.enable_guc_loading =0 ;DRM_NOTE ("GuC firmware loading disabled\n" ); + i915.enable_slpc =0 ; +return ret; }
@@ -407,4 +429,7 @@ void intel_uc_cleanup_hw(struct drm_i915_private *dev_priv)if (i915.enable_guc_submission)i915_guc_submission_fini (dev_priv); + +if (i915.enable_slpc) +intel_slpc_cleanup (&dev_priv->guc.slpc); }
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/20 drm/i915/slpc: Enable SLPC in GuC if supported
In reply to Sagar Arun KambleFrom: Tom O'Rourke <Tom.O'[email protected]>
If slpc enabled, then add enable SLPC flag to guc
control parameter during guc load.
v1: Use intel_slpc_enabled() (Paulo)
v2-v4: Rebase.
v5: Changed intel_slpc_enabled() to i915.enable_slpc. (Sagar)
--- drivers/gpu/drm/i915/intel_guc_loader.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_guc_loader.c +3 -0
@@ -131,6 +131,9 @@ static void guc_params_init(struct drm_i915_private *dev_priv) params[GUC_CTL_FEATURE ] |=GUC_CTL_DISABLE_SCHEDULER |GUC_CTL_VCS2_ENABLED ; +if (i915.enable_slpc) + params[GUC_CTL_FEATURE ] |=GUC_CTL_ENABLE_SLPC ; + params[GUC_CTL_LOG_PARAMS ] = guc->log.flags;if (i915.guc_log_level >=0 ) {
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/20 drm/i915/slpc: Add SLPC communication interfaces
In reply to Sagar Arun KambleCommunication with SLPC is via Host to GuC interrupt through shared data and parameters. This patch defines the structure of shared data, parameters, data structure to be passed as input and received as output from SLPC. This patch also defines the events to be sent as input and status values output by GuC on processing SLPC events. SLPC shared data has details of SKU type, Slice count, IA Perf MSR values, SLPC state, Power source/plan, SLPC tasks status. Parameters allow overriding task control, frequency range etc.
v1: fix whitespace (Sagar)
v2-v3: Rebase.
v4: Updated with GuC firmware v9.
v5: Added definition of input and output data structures for SLPC events. Updated commit message.
v6: Removed definition of host2guc_slpc. Will be added in the next patch that uses it. Commit subject update. Rebase.
v7: Added definition of SLPC_RESET_FLAG_TDR_OCCURRED to be sent throgh SLPC reset in case of engine reset. Moved all Host/SLPC interfaces from later patches to this patch. Commit message update.
--- drivers/gpu/drm/i915/intel_slpc.c | 39 +++++++ drivers/gpu/drm/i915/intel_slpc.h | 207 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 246 insertions(+)
drivers/gpu/drm/i915/intel_slpc.c +39 -0
@@ -25,6 +25,45 @@#include "i915_drv.h" #include "intel_uc.h" +struct slpc_param slpc_paramlist[SLPC_MAX_PARAM ] = { + {SLPC_PARAM_TASK_ENABLE_GTPERF ,"Enable task GTPERF" }, + {SLPC_PARAM_TASK_DISABLE_GTPERF ,"Disable task GTPERF" }, + {SLPC_PARAM_TASK_ENABLE_BALANCER ,"Enable task BALANCER" }, + {SLPC_PARAM_TASK_DISABLE_BALANCER ,"Disable task BALANCER" }, + {SLPC_PARAM_TASK_ENABLE_DCC ,"Enable task DCC" }, + {SLPC_PARAM_TASK_DISABLE_DCC ,"Disable task DCC" }, + {SLPC_PARAM_GLOBAL_MIN_GT_UNSLICE_FREQ_MHZ , +"Minimum GT frequency request for unslice" }, + {SLPC_PARAM_GLOBAL_MAX_GT_UNSLICE_FREQ_MHZ , +"Maximum GT frequency request for unslice" }, + {SLPC_PARAM_GLOBAL_MIN_GT_SLICE_FREQ_MHZ , +"Minimum GT frequency request for slice" }, + {SLPC_PARAM_GLOBAL_MAX_GT_SLICE_FREQ_MHZ , +"Maximum GT frequency request for slice" }, + {SLPC_PARAM_GTPERF_THRESHOLD_MAX_FPS , +"If non-zero, algorithm will slow down " +"frame-based applications to this frame-rate" }, + {SLPC_PARAM_GLOBAL_DISABLE_GT_FREQ_MANAGEMENT , +"Lock GT frequency request to RPe" }, + {SLPC_PARAM_GTPERF_ENABLE_FRAMERATE_STALLING , +"Set to TRUE to enable slowing framerate" }, + {SLPC_PARAM_GLOBAL_DISABLE_RC6_MODE_CHANGE , +"Prevent from changing the RC mode" }, + {SLPC_PARAM_GLOBAL_OC_UNSLICE_FREQ_MHZ , +"Override fused value of unslice RP0" }, + {SLPC_PARAM_GLOBAL_OC_SLICE_FREQ_MHZ , +"Override fused value of slice RP0" }, + {SLPC_PARAM_GLOBAL_ENABLE_IA_GT_BALANCING , +"TRUE means enable Intelligent Bias Control" }, + {SLPC_PARAM_GLOBAL_ENABLE_ADAPTIVE_BURST_TURBO , +"TRUE = enable eval mode when transitioning " +"from idle to active." }, + {SLPC_PARAM_GLOBAL_ENABLE_EVAL_MODE , +"FALSE = disable eval mode completely" }, + {SLPC_PARAM_GLOBAL_ENABLE_BALANCER_IN_NON_GAMING_MODE , +"Enable IBC when non-Gaming Mode is enabled" } +}; +void intel_slpc_init (struct intel_slpc *slpc) { }
drivers/gpu/drm/i915/intel_slpc.h +207 -0
213 lines not on this page · raw message
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/20 drm/i915/slpc: Allocate/Release/Initialize SLPC shared data
In reply to Sagar Arun KamblePopulate SLPC shared data with required default values for Slice count, Power source/plan, IA Perf MSRs.
v1: Update for SLPC interface version 2015.2.4
intel_slpc_active() returns 1 if slpc initialized (Paulo) change default host_os to "Windows"
Spelling fixes (Sagar Kamble and Nick Hoath)
Added WARN for checking if upper 32bits of GTT offset of shared object are zero. (ChrisW)
Changed function call from gem_allocate/release_guc_obj to i915_guc_allocate/release_gem_obj. (Sagar)
Updated commit message and moved POWER_PLAN and POWER_SOURCE definition from later patch. (Akash)
Add struct_mutex locking while allocating/releasing slpc shared object. This was caught by CI BAT. Adding SLPC state variable to determine if it is active as it not just dependent on shared data setup.
Rebase with guc_allocate_vma related changes.
v2: WARN_ON for platform_sku validity and space changes.(David)
Checkpatch update.
v3: Fixing WARNING in igt@drv_module_reload_basic found in trybot BAT
with SLPC Enabled.
v4: Updated support for GuC v9. s/slice_total/hweight8(slice_mask)/(Dave).
v5: SLPC vma mapping changes and removed explicit type conversions.(Chris).
s/freq_unslice_max|min/unslice__max|min_freq.
v6: Commit message update. s/msr_value/val for reuse later.
v7: Set default values for tasks and min frequency parameters.
Moved initialization with allocation of data so that post GuC load earlier parameters persist.
v8: Added check for SLPC status during cleanup of shared data. SLPC
disabling is asynchronous and should complete within 10us.
v9: Enabling Balancer task in SLPC.
--- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_pm.c | 2 +- drivers/gpu/drm/i915/intel_slpc.c | 167 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 1 + 4 files changed, 170 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -1866,6 +1866,7 @@ bool chv_phy_powergate_ch(struct drm_i915_private *dev_priv, enum dpio_phy phy,void gen6_rps_idle (struct drm_i915_private *dev_priv);void gen6_rps_boost (struct drm_i915_gem_request *rq,struct intel_rps_client *rps); +void gen6_init_rps_frequencies (struct drm_i915_private *dev_priv);void g4x_wm_get_hw_state (struct drm_device *dev);void vlv_wm_get_hw_state (struct drm_device *dev);void ilk_wm_get_hw_state (struct drm_device *dev);
drivers/gpu/drm/i915/intel_pm.c +1 -1
@@ -6378,7 +6378,7 @@ int sanitize_rc6_option(struct drm_i915_private *dev_priv, int enable_rc6)return INTEL_RC6_ENABLE ; } -static void gen6_init_rps_frequencies (struct drm_i915_private *dev_priv) +void gen6_init_rps_frequencies (struct drm_i915_private *dev_priv) {/* All of these values are in units of 50MHz */
drivers/gpu/drm/i915/intel_slpc.c +167 -0
185 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h +1 -0
@@ -26,6 +26,7 @@struct intel_slpc {bool active; +struct i915_vma *vma; };enum slpc_status {
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/20 drm/i915/slpc: Add parameter set/unset/get, task control/status functions
In reply to Sagar Arun KambleSLPC behavior can be changed through set of parameters. These parameters can be updated and queried from i915 though Host to GuC SLPC events. This patch adds parameter update events for setting/unsetting/getting parameters. SLPC has various tasks for controlling different controls. This patch adds functions to control and query the task status.
v1: Use host2guc_slpc
update slcp_param_id enum values for SLPC 2015.2.4 return void instead of ignored error code (Paulo)
v2: Checkpatch update.
v3: Rebase.
v4: Updated with GuC firmware v9.
v5: Updated input structure to host2guc_slpc. Added functions
to update only parameters in the SLPC shared memory. This will allow to setup shared data with all parameters and send single event to SLPC take them into effect. Commit message update. (Sagar)
v6: Rearranged helpers to use them in slpc_shared_data_init.
Added definition of SLPC_KMD_MAX_PARAM.
v7: Added definition of host2guc_slpc with rearrangement of patches.
Added task control/status functions.
v8: Rebase w.r.t s/intel_guc_send/intel_guc_send_mmio.
--- drivers/gpu/drm/i915/intel_guc.c | 21 ++++- drivers/gpu/drm/i915/intel_guc.h | 2 + drivers/gpu/drm/i915/intel_slpc.c | 185 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 8 ++ 4 files changed, 215 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_guc.c +20 -1
@@ -75,9 +75,11 @@ void intel_guc_init_send_regs(struct intel_guc *guc)/* * This function implements the MMIO based host to GuC interface. */ -int intel_guc_send_mmio (struct intel_guc *guc,const u32 *action,u32 len) +int __intel_guc_send_mmio (struct intel_guc *guc,const u32 *action,u32 len, +u32 *output) {struct drm_i915_private *dev_priv =guc_to_i915 (guc); +union slpc_event_output_header header;u32 status;int i;int ret;
@@ -123,12 +125,29 @@ int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len) action[0], ret, status, I915_READ(SOFT_SCRATCH(15))); } +/* +* Output data from Host to GuC SLPC actions is populated in scratch +* registers SOFT_SCRATCH(1) to SOFT_SCRATCH(14) based on event. +* Currently only SLPC action status in GuC is meaningful as Host +* can query only overridden parameters and that are fetched from +* Host-GuC SLPC shared data. +*/ +if (output && !ret) { + output[0 ] = header.value =I915_READ (SOFT_SCRATCH (1 )); + ret = header.status; + } +intel_uncore_forcewake_put (dev_priv, guc->send_regs.fw_domains);mutex_unlock (&guc->send_mutex);return ret; } +int intel_guc_send_mmio (struct intel_guc *guc,const u32 *action,u32 len) +{ +return __intel_guc_send_mmio (guc, action, len,NULL ); +} +int intel_guc_sample_forcewake (struct intel_guc *guc) {struct drm_i915_private *dev_priv =guc_to_i915 (guc);
drivers/gpu/drm/i915/intel_guc.h +2 -0
@@ -163,6 +163,8 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)int intel_guc_sample_forcewake (struct intel_guc *guc);void intel_guc_init_send_regs (struct intel_guc *guc);int intel_guc_send_nop (struct intel_guc *guc,const u32 *action,u32 len); +int __intel_guc_send_mmio (struct intel_guc *guc,const u32 *action,u32 len, +u32 *output);int intel_guc_send_mmio (struct intel_guc *guc,const u32 *action,u32 len);void intel_guc_auth_huc (struct intel_guc *guc,struct intel_uc_fw *huc_fw);int intel_guc_enable_communication (struct intel_guc *guc);
drivers/gpu/drm/i915/intel_slpc.c +185 -0
191 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h +8 -0
@@ -237,6 +237,14 @@ struct slpc_param {#define SLPC_PARAM_TASK_UNKNOWN 3/* intel_slpc.c */ +void intel_slpc_set_param (struct intel_slpc *slpc,u32 id,u32 value); +void intel_slpc_unset_param (struct intel_slpc *slpc,u32 id); +void intel_slpc_get_param (struct intel_slpc *slpc,u32 id, +int *overriding,u32 *value); +int intel_slpc_task_control (struct intel_slpc *slpc,u64 val, +u32 enable_id,u32 disable_id); +int intel_slpc_task_status (struct intel_slpc *slpc,u64 *val, +u32 enable_id,u32 disable_id);void intel_slpc_init (struct intel_slpc *slpc);void intel_slpc_cleanup (struct intel_slpc *slpc);void intel_slpc_enable (struct intel_slpc *slpc);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 11/20 drm/i915/slpc: Send RESET event to enable SLPC
In reply to Sagar Arun KambleSend host2guc SLPC reset event to GuC post GuC load.
Post this, i915 can ascertain if SLPC has started running successfully through shared data. This check is done during intel_init_gt_powersave. This allows to get initial configuration setup by SLPC and if needed move to Host RPS if SLPC runs into issues.
v1: Extract host2guc_slpc to handle slpc status code
coding style changes (Paulo)
Removed WARN_ON for checking msb of gtt address of shared gem obj. (ChrisW)
host2guc_action to i915_guc_action change.(Sagar) Updating SLPC enabled status. (Sagar)
v2: Commit message update. (David)
v3: Rebase.
v4: Added DRM_INFO message when SLPC is enabled.
v5: Updated patch as host2guc_slpc is moved to earlier patch.
SLPC activation status message put after checking the state from shared data during intel_init_gt_powersave.
v6: Added definition of host2guc_slpc and clflush the shared data only
for required size. Setting state to NOT_RUNNING before sending RESET event. Output data for SLPC actions is to be retrieved during intel_guc_send with lock protection so created wrapper __intel_guc_send that outputs GuC output data if needed. Clearing pm_rps_events on confirming SLPC RUNNING status so that even if host touches any of the PM registers by mistake it should not have any effect. (Sagar)
v7: Added save/restore_default_rps as Uncore sanitize will clear the
RP_CONTROL setup by BIOS. s/i915_ggtt_offset/guc_ggtt_offset.
--- drivers/gpu/drm/i915/i915_drv.c | 2 + drivers/gpu/drm/i915/intel_pm.c | 10 +++ drivers/gpu/drm/i915/intel_slpc.c | 133 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 7 ++ 4 files changed, 152 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -1071,6 +1071,8 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)intel_sanitize_options (dev_priv); +intel_slpc_save_default_rps (&dev_priv->guc.slpc); + ret =i915_ggtt_probe_hw (dev_priv);if (ret)return ret;
drivers/gpu/drm/i915/intel_pm.c +10 -0
@@ -7741,6 +7741,16 @@ void intel_init_gt_powersave(struct drm_i915_private *dev_priv)intel_runtime_pm_get (dev_priv); } +if (i915.enable_slpc) { + dev_priv->guc.slpc.active = +intel_slpc_get_status (&dev_priv->guc.slpc); +if (!dev_priv->guc.slpc.active) { + i915.enable_slpc =0 ; +intel_sanitize_gt_powersave (dev_priv); + }else + dev_priv->pm_rps_events =0 ; + } +mutex_lock (&dev_priv->drm.struct_mutex);mutex_lock (&dev_priv->rps.hw_lock);
drivers/gpu/drm/i915/intel_slpc.c +133 -0
145 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h +7 -0
@@ -27,6 +27,8 @@struct intel_slpc {bool active;struct i915_vma *vma; + +u32 rp_control; };enum slpc_status {
@@ -245,6 +247,11 @@ int intel_slpc_task_control(struct intel_slpc *slpc, u64 val, u32 enable_id, u32 disable_id);int intel_slpc_task_status (struct intel_slpc *slpc,u64 *val,u32 enable_id,u32 disable_id); +void intel_slpc_read_shared_data (struct intel_slpc *slpc, +struct slpc_shared_data *data); +const char *intel_slpc_get_state_str (enum slpc_global_state state); +bool intel_slpc_get_status (struct intel_slpc *slpc); +void intel_slpc_save_default_rps (struct intel_slpc *slpc);void intel_slpc_init (struct intel_slpc *slpc);void intel_slpc_cleanup (struct intel_slpc *slpc);void intel_slpc_enable (struct intel_slpc *slpc);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 12/20 drm/i915/slpc: Send SHUTDOWN event
In reply to Sagar Arun KambleFrom: Tom O'Rourke <Tom.O'[email protected]>
Send SLPC shutdown event during disable, suspend, and reset operations. Sending shutdown event while already shutdown is OK.
v1: Return void instead of ignored error code (Paulo)
Removed WARN_ON for checking msb of gtt address of shared gem obj. (ChrisW)
Added SLPC state update during disable, suspend and reset. Changed semantics of reset. It is supposed to just disable. (Sagar)
v2-v4: Rebase.
v5: Updated the input data structure. (Sagar)
v6: Rebase.
v7: s/i915_ggtt_offset/guc_ggtt_offset.
--- drivers/gpu/drm/i915/intel_slpc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/gpu/drm/i915/intel_slpc.c +21 -0
@@ -414,6 +414,18 @@ static void host2guc_slpc_query_task_state(struct intel_slpc *slpc)host2guc_slpc (slpc, &data,4 ); } +static void host2guc_slpc_shutdown (struct intel_slpc *slpc) +{ +struct slpc_event_input data = {0 }; +u32 shared_data_gtt_offset =guc_ggtt_offset (slpc->vma); + + data.header.value =SLPC_EVENT (SLPC_EVENT_SHUTDOWN ,2 ); + data.args[0 ] = shared_data_gtt_offset; + data.args[1 ] =0 ; + +host2guc_slpc (slpc, &data,4 ); +} +void intel_slpc_query_task_state (struct intel_slpc *slpc) {if (slpc->active)
@@ -563,4 +575,13 @@ void intel_slpc_enable(struct intel_slpc *slpc)void intel_slpc_disable (struct intel_slpc *slpc) { +struct slpc_shared_data data; + +host2guc_slpc_shutdown (slpc); + +/* Ensure SLPC is not running prior to releasing Shared data */ +intel_slpc_read_shared_data (slpc, &data); +WARN_ON (data.global_state !=SLPC_GLOBAL_STATE_NOT_RUNNING ); + + slpc->active = false; }
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 13/20 drm/i915/slpc: Add support for min/max frequency control
In reply to Sagar Arun KambleUpdate sysfs and debugfs functions to set SLPC
parameters when setting max/min frequency.
v1: Update for SLPC 2015.2.4 (params for both slice and unslice)
Replace HAS_SLPC with intel_slpc_active() (Paulo)
v2-v4: Rebase.
v5: Removed typecasting the frequency values to u32. (Chris)
Changed intel_slpc_active to guc.slpc.enabled. Carved out SLPC helpers to set min and max frequencies.
v6: Rebase. Doing explicit SLPC reset on setting frequency to start sane
and covered with RPM get/put. Caching SLPC limits post enabling first.
--- drivers/gpu/drm/i915/i915_debugfs.c | 46 +++++++++++++++++++++++++++--- drivers/gpu/drm/i915/i915_sysfs.c | 36 ++++++++++++++++++++---- drivers/gpu/drm/i915/intel_slpc.c | 56 +++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 5 ++++ 4 files changed, 133 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +42 -4
@@ -4336,7 +4336,12 @@ static ssize_t cur_wm_latency_write(struct file *file, const char __user *ubuf,if (INTEL_GEN (dev_priv) <6 )return -ENODEV ; - *val =intel_gpu_freq (dev_priv, dev_priv->rps.max_freq_softlimit); +if (dev_priv->guc.slpc.active) + *val =intel_gpu_freq (dev_priv, + dev_priv->guc.slpc.max_unslice_freq); +else + *val =intel_gpu_freq (dev_priv, + dev_priv->rps.max_freq_softlimit);return 0 ; }
@@ -4352,20 +4357,32 @@ static ssize_t cur_wm_latency_write(struct file *file, const char __user *ubuf,DRM_DEBUG_DRIVER ("Manually setting max freq to %llu\n" , val); +intel_runtime_pm_get (dev_priv); + ret =mutex_lock_interruptible (&dev_priv->rps.hw_lock); -if (ret) +if (ret) { +intel_runtime_pm_put (dev_priv);return ret; + }/* * Turbo will still be enabled, but won't go above the set value. */ val =intel_freq_opcode (dev_priv, val); +if (dev_priv->guc.slpc.active) { + ret =intel_slpc_max_freq_set (&dev_priv->guc.slpc, val); +mutex_unlock (&dev_priv->rps.hw_lock); +intel_runtime_pm_put (dev_priv); +return ret; + } + hw_max = dev_priv->rps.max_freq; hw_min = dev_priv->rps.min_freq;if (val < hw_min || val > hw_max || val < dev_priv->rps.min_freq_softlimit) {mutex_unlock (&dev_priv->rps.hw_lock); +intel_runtime_pm_put (dev_priv);return -EINVAL ; }
@@ -4376,6 +4393,8 @@ static ssize_t cur_wm_latency_write(struct file *file, const char __user *ubuf,mutex_unlock (&dev_priv->rps.hw_lock); +intel_runtime_pm_put (dev_priv); +return 0 ; }
@@ -4391,7 +4410,12 @@ static ssize_t cur_wm_latency_write(struct file *file, const char __user *ubuf,if (INTEL_GEN (dev_priv) <6 )return -ENODEV ; - *val =intel_gpu_freq (dev_priv, dev_priv->rps.min_freq_softlimit); +if (dev_priv->guc.slpc.active) + *val =intel_gpu_freq (dev_priv, + dev_priv->guc.slpc.min_unslice_freq); +else + *val =intel_gpu_freq (dev_priv, + dev_priv->rps.min_freq_softlimit);return 0 ; }
@@ -4407,21 +4431,33 @@ static ssize_t cur_wm_latency_write(struct file *file, const char __user *ubuf,DRM_DEBUG_DRIVER ("Manually setting min freq to %llu\n" , val); +intel_runtime_pm_get (dev_priv); + ret =mutex_lock_interruptible (&dev_priv->rps.hw_lock); -if (ret) +if (ret) { +intel_runtime_pm_put (dev_priv);return ret; + }/* * Turbo will still be enabled, but won't go below the set value. */ val =intel_freq_opcode (dev_priv, val); +if (dev_priv->guc.slpc.active) { + ret =intel_slpc_min_freq_set (&dev_priv->guc.slpc, val); +mutex_unlock (&dev_priv->rps.hw_lock); +intel_runtime_pm_put (dev_priv); +return ret; + } + hw_max = dev_priv->rps.max_freq; hw_min = dev_priv->rps.min_freq;if (val < hw_min || val > hw_max || val > dev_priv->rps.max_freq_softlimit) {mutex_unlock (&dev_priv->rps.hw_lock); +intel_runtime_pm_put (dev_priv);return -EINVAL ; }
@@ -4432,6 +4468,8 @@ static ssize_t cur_wm_latency_write(struct file *file, const char __user *ubuf,mutex_unlock (&dev_priv->rps.hw_lock); +intel_runtime_pm_put (dev_priv); +return 0 ; }
drivers/gpu/drm/i915/i915_sysfs.c +30 -6
@@ -325,9 +325,14 @@ static ssize_t gt_max_freq_mhz_show(struct device *kdev, struct device_attribute {struct drm_i915_private *dev_priv =kdev_minor_to_i915 (kdev); -return snprintf (buf,PAGE_SIZE ,"%d\n" , -intel_gpu_freq (dev_priv, - dev_priv->rps.max_freq_softlimit)); +if (dev_priv->guc.slpc.active) +return snprintf (buf,PAGE_SIZE ,"%d\n" , +intel_gpu_freq (dev_priv, + dev_priv->guc.slpc.max_unslice_freq)); +else +return snprintf (buf,PAGE_SIZE ,"%d\n" , +intel_gpu_freq (dev_priv, + dev_priv->rps.max_freq_softlimit)); } static ssize_t gt_max_freq_mhz_store(struct device *kdev,
@@ -348,6 +353,13 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev, val =intel_freq_opcode (dev_priv, val); +if (dev_priv->guc.slpc.active) { + ret =intel_slpc_max_freq_set (&dev_priv->guc.slpc, val); +mutex_unlock (&dev_priv->rps.hw_lock); +intel_runtime_pm_put (dev_priv); +return ret ? ret : count; + } +if (val < dev_priv->rps.min_freq || val > dev_priv->rps.max_freq || val < dev_priv->rps.min_freq_softlimit) {
@@ -382,9 +394,14 @@ static ssize_t gt_min_freq_mhz_show(struct device *kdev, struct device_attribute {struct drm_i915_private *dev_priv =kdev_minor_to_i915 (kdev); -return snprintf (buf,PAGE_SIZE ,"%d\n" , -intel_gpu_freq (dev_priv, - dev_priv->rps.min_freq_softlimit)); +if (dev_priv->guc.slpc.active) +return snprintf (buf,PAGE_SIZE ,"%d\n" , +intel_gpu_freq (dev_priv, + dev_priv->guc.slpc.min_unslice_freq)); +else +return snprintf (buf,PAGE_SIZE ,"%d\n" , +intel_gpu_freq (dev_priv, + dev_priv->rps.min_freq_softlimit)); } static ssize_t gt_min_freq_mhz_store(struct device *kdev,
@@ -405,6 +422,13 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev, val =intel_freq_opcode (dev_priv, val); +if (dev_priv->guc.slpc.active) { + ret =intel_slpc_min_freq_set (&dev_priv->guc.slpc, val); +mutex_unlock (&dev_priv->rps.hw_lock); +intel_runtime_pm_put (dev_priv); +return ret ? ret : count; + } +if (val < dev_priv->rps.min_freq || val > dev_priv->rps.max_freq || val > dev_priv->rps.max_freq_softlimit) {
drivers/gpu/drm/i915/intel_slpc.c +56 -0
68 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h +5 -0
@@ -29,6 +29,9 @@ struct intel_slpc {struct i915_vma *vma;u32 rp_control; +/* i915 cached SLPC frequency limits */ +u32 min_unslice_freq; +u32 max_unslice_freq; };enum slpc_status {
@@ -252,6 +255,8 @@ void intel_slpc_read_shared_data(struct intel_slpc *slpc,const char *intel_slpc_get_state_str (enum slpc_global_state state);bool intel_slpc_get_status (struct intel_slpc *slpc);void intel_slpc_save_default_rps (struct intel_slpc *slpc); +int intel_slpc_max_freq_set (struct intel_slpc *slpc,u32 val); +int intel_slpc_min_freq_set (struct intel_slpc *slpc,u32 val);void intel_slpc_init (struct intel_slpc *slpc);void intel_slpc_cleanup (struct intel_slpc *slpc);void intel_slpc_enable (struct intel_slpc *slpc);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 14/20 drm/i915/slpc: Add debugfs support to read/write/revert the parameters
In reply to Sagar Arun KambleThis patch adds two debugfs interfaces:
1. i915_slpc_paramlist: List of all parameters that Host can configure. Currently listing id and description of each.
2. i915_slpc_param_ctl: This allows to change the parameters. Syntax is:
echo "write <id> <value>" > i915_slpc_param_ctl.
echo "read <id>" > i915_slpc_param_ctl; cat i915_slpc_param_ctl revert allows to set to default SLPC internal values. Syntax is:
echo "revert <id>" > i915_slpc_param_ctl.
Added support to set/read parameters and unset the parameters which will revert them to default SLPC internal values. Also added RPM ref. cover around set/unset calls. Explicit SLPC reset is needed on setting/unsetting some of the parameters.
--- drivers/gpu/drm/i915/i915_debugfs.c | 19 +++++ drivers/gpu/drm/i915/intel_slpc.c | 158 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 6 ++ 3 files changed, 183 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +19 -0
@@ -2359,6 +2359,23 @@ static int i915_huc_load_status_info(struct seq_file *m, void *data)return 0 ; } +static int i915_slpc_paramlist_info (struct seq_file *m,void *data) +{ +struct drm_i915_private *dev_priv =node_to_i915 (m->private); +int i; + +if (!dev_priv->guc.slpc.active) { +seq_puts (m,"SLPC not active\n" ); +return 0 ; + } + +seq_puts (m,"Param id\tParam description\n" ); +for (i =0 ; i <SLPC_MAX_PARAM ; i++) +seq_printf (m,"%8d\t%s\n" , slpc_paramlist[i].id, + slpc_paramlist[i].description); +return 0 ; +} +static int i915_guc_load_status_info (struct seq_file *m,void *data) {struct drm_i915_private *dev_priv =node_to_i915 (m->private);
@@ -4833,6 +4850,7 @@ static int i915_hpd_storm_ctl_open(struct inode *inode, struct file *file) {"i915_guc_load_err_log_dump", i915_guc_log_dump, 0, (void *)1}, {"i915_guc_stage_pool", i915_guc_stage_pool, 0}, {"i915_huc_load_status", i915_huc_load_status_info, 0}, + {"i915_slpc_paramlist", i915_slpc_paramlist_info, 0}, {"i915_frequency_info", i915_frequency_info, 0}, {"i915_hangcheck_info", i915_hangcheck_info, 0}, {"i915_reset_info", i915_reset_info, 0},
@@ -4896,6 +4914,7 @@ static int i915_hpd_storm_ctl_open(struct inode *inode, struct file *file) {"i915_dp_test_type", &i915_displayport_test_type_fops}, {"i915_dp_test_active", &i915_displayport_test_active_fops}, {"i915_guc_log_control", &i915_guc_log_control_fops}, + {"i915_slpc_param_ctl", &i915_slpc_param_ctl_fops}, {"i915_hpd_storm_ctl", &i915_hpd_storm_ctl_fops} };
drivers/gpu/drm/i915/intel_slpc.c +158 -0
167 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h +6 -0
@@ -32,6 +32,10 @@ struct intel_slpc {/* i915 cached SLPC frequency limits */ u32 min_unslice_freq;u32 max_unslice_freq; + +u32 debug_param_id; +u32 debug_param_value; +u32 debug_param_override; };enum slpc_status {
@@ -241,6 +245,8 @@ struct slpc_param {#define SLPC_PARAM_TASK_DISABLED 2#define SLPC_PARAM_TASK_UNKNOWN 3 +extern const struct file_operations i915_slpc_param_ctl_fops; +/* intel_slpc.c */ void intel_slpc_set_param (struct intel_slpc *slpc,u32 id,u32 value);void intel_slpc_unset_param (struct intel_slpc *slpc,u32 id);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 15/20 drm/i915/slpc: Add enable/disable controls for SLPC tasks
In reply to Sagar Arun KambleFrom: Tom O'Rourke <Tom.O'[email protected]>
Adds debugfs hooks for enabling/disabling each SLPC task.
The enable/disable debugfs files are i915_slpc_gtperf, i915_slpc_balancer, and i915_slpc_dcc.
Each of these can take the values:
"default", "enabled", or "disabled"
v1: update for SLPC v2015.2.4
dfps and turbo merged and renamed "gtperf"
ibc split out and renamed "balancer"
Avoid magic numbers (Jon Bloomfield)
v2-v3: Rebase.
v5: Moved slpc_enable_disable_set and slpc_enable_disable_get to
intel_slpc.c. s/slpc_enable_disable_get/intel_slpc_task_status and s/slpc_enable_disable_set/intel_slpc_task_control. Prepared separate functions to update the task status only in the SLPC shared memory. Passing dev_priv as parameter.
v6: Rebase. s/slpc_param_show|write/slpc_task_param_show|write.
Moved functions to intel_slpc.c. RPM Get/Put added before setting parameters and sending RESET event explicitly. (Sagar)
--- drivers/gpu/drm/i915/i915_debugfs.c | 3 + drivers/gpu/drm/i915/intel_slpc.c | 184 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 3 + 3 files changed, 190 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +3 -0
@@ -4894,6 +4894,9 @@ static int i915_hpd_storm_ctl_open(struct inode *inode, struct file *file)const struct file_operations *fops; } i915_debugfs_files[] = { {"i915_wedged", &i915_wedged_fops}, + {"i915_slpc_gtperf", &i915_slpc_gtperf_fops}, + {"i915_slpc_balancer", &i915_slpc_balancer_fops}, + {"i915_slpc_dcc", &i915_slpc_dcc_fops}, {"i915_max_freq", &i915_max_freq_fops}, {"i915_min_freq", &i915_min_freq_fops}, {"i915_cache_sharing", &i915_cache_sharing_fops},
drivers/gpu/drm/i915/intel_slpc.c +184 -0
187 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h +3 -0
@@ -246,6 +246,9 @@ struct slpc_param {#define SLPC_PARAM_TASK_UNKNOWN 3extern const struct file_operations i915_slpc_param_ctl_fops; +extern const struct file_operations i915_slpc_gtperf_fops; +extern const struct file_operations i915_slpc_balancer_fops; +extern const struct file_operations i915_slpc_dcc_fops;/* intel_slpc.c */ void intel_slpc_set_param (struct intel_slpc *slpc,u32 id,u32 value);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 16/20 drm/i915/slpc: Add i915_slpc_info to debugfs
In reply to Sagar Arun KambleFrom: Tom O'Rourke <Tom.O'[email protected]>
i915_slpc_info shows the contents of SLPC shared data parsed into text format.
v1: Reformat slpc info (Radek)
squashed query task state info
in slpc info, kunmap before seq_print (Paulo) return void instead of ignored return value (Paulo) Avoid magic numbers and use local variables (Jon Bloomfield) Removed WARN_ON for checking msb of gtt address of shared gem obj. (ChrisW)
Moved definition of power plan and power source to earlier patch in the series.
drm/i915/slpc: Allocate/Release/Initialize SLPC shared data (Akash)
v2-v3: Rebase.
v4: Updated with GuC firmware v9.
v5: Updated host2guc_slpc_query_task_state with struct slpc_input_event
structure. Removed unnecessary checks of vma from i915_slpc_info. Created helpers for reading the SLPC shared data and string form of SLPC state. (Sagar)
--- drivers/gpu/drm/i915/i915_debugfs.c | 165 ++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +165 -0
@@ -1022,6 +1022,170 @@ static int i915_error_state_open(struct inode *inode, struct file *file)NULL , i915_next_seqno_set, "0x%llx\n"); +static int i915_slpc_info (struct seq_file *m,void *unused) +{ +struct drm_i915_private *dev_priv =node_to_i915 (m->private); +int i, value; +struct slpc_shared_data data; +enum slpc_global_state global_state; +enum slpc_platform_sku platform_sku; +struct slpc_task_state_data *task_data; +enum slpc_power_plan power_plan; +enum slpc_power_source power_source; + +if (!dev_priv->guc.slpc.active) +return -ENODEV ; + +intel_runtime_pm_get (dev_priv); +mutex_lock (&dev_priv->rps.hw_lock); + +intel_slpc_read_shared_data (&dev_priv->guc.slpc, &data); + +mutex_unlock (&dev_priv->rps.hw_lock); +intel_runtime_pm_put (dev_priv); + +seq_printf (m,"shared data size: %d\n" , data.shared_data_size); + + global_state = (enum slpc_global_state ) data.global_state; +seq_printf (m,"global state: %d (" , global_state); +seq_printf (m,"%s)\n" ,intel_slpc_get_state_str (global_state)); + + platform_sku = (enum slpc_platform_sku ) + data.platform_info.platform_sku; +seq_printf (m,"sku: %d (" , platform_sku); +switch (platform_sku) { +case SLPC_PLATFORM_SKU_UNDEFINED : +seq_puts (m,"undefined)\n" ); +break ; +case SLPC_PLATFORM_SKU_ULX : +seq_puts (m,"ULX)\n" ); +break ; +case SLPC_PLATFORM_SKU_ULT : +seq_puts (m,"ULT)\n" ); +break ; +case SLPC_PLATFORM_SKU_T : +seq_puts (m,"T)\n" ); +break ; +case SLPC_PLATFORM_SKU_MOBL : +seq_puts (m,"Mobile)\n" ); +break ; +case SLPC_PLATFORM_SKU_DT : +seq_puts (m,"DT)\n" ); +break ; +case SLPC_PLATFORM_SKU_UNKNOWN : +default : +seq_puts (m,"unknown)\n" ); +break ; + } +seq_printf (m,"slice count: %d\n" , + data.platform_info.slice_count); + +seq_printf (m,"power plan/source: 0x%x\n\tplan:\t" , + data.platform_info.power_plan_source); + power_plan = (enum slpc_power_plan )SLPC_POWER_PLAN ( + data.platform_info.power_plan_source); + power_source = (enum slpc_power_source )SLPC_POWER_SOURCE ( + data.platform_info.power_plan_source); +switch (power_plan) { +case SLPC_POWER_PLAN_UNDEFINED : +seq_puts (m,"undefined" ); +break ; +case SLPC_POWER_PLAN_BATTERY_SAVER : +seq_puts (m,"battery saver" ); +break ; +case SLPC_POWER_PLAN_BALANCED : +seq_puts (m,"balanced" ); +break ; +case SLPC_POWER_PLAN_PERFORMANCE : +seq_puts (m,"performance" ); +break ; +case SLPC_POWER_PLAN_UNKNOWN : +default : +seq_puts (m,"unknown" ); +break ; + } +seq_puts (m,"\n\tsource:\t" ); +switch (power_source) { +case SLPC_POWER_SOURCE_UNDEFINED : +seq_puts (m,"undefined\n" ); +break ; +case SLPC_POWER_SOURCE_AC : +seq_puts (m,"AC\n" ); +break ; +case SLPC_POWER_SOURCE_DC : +seq_puts (m,"DC\n" ); +break ; +case SLPC_POWER_SOURCE_UNKNOWN : +default : +seq_puts (m,"unknown\n" ); +break ; + } + +seq_printf (m,"IA frequency (MHz):\n\tP0: %d\n\tP1: %d\n\tPe: %d\n\tPn: %d\n" , + data.platform_info.P0_freq *50 , + data.platform_info.P1_freq *50 , + data.platform_info.Pe_freq *50 , + data.platform_info.Pn_freq *50 ); + + task_data = &data.task_state_data; +seq_printf (m,"task state data: 0x%08x 0x%08x\n" , + task_data->bitfield1, task_data->bitfield2); + +seq_printf (m,"\tgtperf task active: %s\n" , +yesno (task_data->gtperf_task_active)); +seq_printf (m,"\tgtperf stall possible: %s\n" , +yesno (task_data->gtperf_stall_possible)); +seq_printf (m,"\tgtperf gaming mode: %s\n" , +yesno (task_data->gtperf_gaming_mode)); +seq_printf (m,"\tgtperf target fps: %d\n" , + task_data->gtperf_target_fps); + +seq_printf (m,"\tdcc task active: %s\n" , +yesno (task_data->dcc_task_active)); +seq_printf (m,"\tin dcc: %s\n" , +yesno (task_data->in_dcc)); +seq_printf (m,"\tin dct: %s\n" , +yesno (task_data->in_dct)); +seq_printf (m,"\tfreq switch active: %s\n" , +yesno (task_data->freq_switch_active)); + +seq_printf (m,"\tibc enabled: %s\n" , +yesno (task_data->ibc_enabled)); +seq_printf (m,"\tibc active: %s\n" , +yesno (task_data->ibc_active)); +seq_printf (m,"\tpg1 enabled: %s\n" , +yesno (task_data->pg1_enabled)); +seq_printf (m,"\tpg1 active: %s\n" , +yesno (task_data->pg1_active)); + +seq_printf (m,"\tunslice max freq: %dMHz\n" , +intel_gpu_freq (dev_priv, + task_data->max_unslice_freq *GEN9_FREQ_SCALER )); +seq_printf (m,"\tunslice min freq: %dMHz\n" , +intel_gpu_freq (dev_priv, + task_data->min_unslice_freq *GEN9_FREQ_SCALER )); +seq_printf (m,"\tslice max freq: %dMHz\n" , +intel_gpu_freq (dev_priv, + task_data->max_slice_freq *GEN9_FREQ_SCALER )); +seq_printf (m,"\tslice min freq: %dMHz\n" , +intel_gpu_freq (dev_priv, + task_data->min_slice_freq *GEN9_FREQ_SCALER )); + +seq_puts (m,"override parameter bitfield\n" ); +for (i =0 ; i <SLPC_OVERRIDE_BITFIELD_SIZE ; i++) +seq_printf (m,"%d: 0x%08x\n" , i, + data.override_parameters_set_bits[i]); + +seq_puts (m,"override parameters (only non-zero shown)\n" ); +for (i =0 ; i <SLPC_MAX_OVERRIDE_PARAMETERS ; i++) { + value = data.override_parameters_values[i]; +if (value) +seq_printf (m,"%d: 0x%8x\n" , i, value); + } + +return 0 ; +} +static int i915_frequency_info (struct seq_file *m,void *unused) {struct drm_i915_private *dev_priv =node_to_i915 (m->private);
@@ -4851,6 +5015,7 @@ static int i915_hpd_storm_ctl_open(struct inode *inode, struct file *file) {"i915_guc_stage_pool", i915_guc_stage_pool, 0}, {"i915_huc_load_status", i915_huc_load_status_info, 0}, {"i915_slpc_paramlist", i915_slpc_paramlist_info, 0}, + {"i915_slpc_info", i915_slpc_info, 0}, {"i915_frequency_info", i915_frequency_info, 0}, {"i915_hangcheck_info", i915_hangcheck_info, 0}, {"i915_reset_info", i915_reset_info, 0},
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 17/20 drm/i915/slpc: Add SLPC banner to RPS debugfs interfaces.
In reply to Sagar Arun KambleWhen SLPC is controlling frequency requests, RPS state related to autotuning is no longer valid. Make user aware through banner upfront. Value read from register RPNSWREQ likely has the frequency requested last by GuC SLPC.
v1: Replace HAS_SLPC with intel_slpc_active (Paulo)
Avoid magic numbers (Nick)
Use a function for repeated code (Jon)
v2: Add "SLPC Active" to i915_frequency_info output and
don't update cur_freq as it is driver internal request. (Chris)
v3: Removing sysfs interface gt_req_freq_mhz out of this patch
for proper division of functionality. (Sagar)
v4: idle_freq, boost_freq are also not used with SLPC.
v5: Added SLPC banner to i915_rps_boost_info and keep printing
driver internal values. (Chris)
v6: Commit message update.
--- drivers/gpu/drm/i915/i915_debugfs.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +6 -0
@@ -1193,6 +1193,9 @@ static int i915_frequency_info(struct seq_file *m, void *unused)intel_runtime_pm_get (dev_priv); +if (dev_priv->guc.slpc.active) +seq_puts (m,"SLPC Active\n" ); +if (IS_GEN5 (dev_priv)) {u16 rgvswctl =I915_READ16 (MEMSWCTL );u16 rgvstat =I915_READ16 (MEMSTAT_ILK );
@@ -2416,6 +2419,9 @@ static int i915_rps_boost_info(struct seq_file *m, void *data)struct drm_device *dev = &dev_priv->drm;struct drm_file *file; +if (dev_priv->guc.slpc.active) +seq_puts (m,"SLPC Active\n" ); +seq_printf (m,"RPS enabled? %d\n" , dev_priv->rps.rps_enabled);seq_printf (m,"GPU busy? %s [%d requests]\n" ,yesno (dev_priv->gt.awake), dev_priv->gt.active_requests);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 18/20 drm/i915/slpc: Add SKL SLPC Support
In reply to Sagar Arun KambleFrom: Tom O'Rourke <Tom.O'[email protected]>
This patch adds has_slpc to skylake info.
The SLPC interface has changed and could continue to change. Only GuC versions known to be compatible are supported here.
On Skylake, GuC firmware v6 is supported. Other
platforms and versions can be added here later.
v1: Move slpc_version_check to intel_guc_ucode_init.
fix whitespace (Sagar)
Moved version check to different patch as has_slpc should not be updated based on it. Instead module parameter should be updated based on version check. (Sagar) Added support to skylake_gt3 as well. (Sagar)
--- drivers/gpu/drm/i915/i915_pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/i915_pci.c +1 -0
@@ -356,6 +356,7 @@ .platform = INTEL_SKYLAKE, \ .has_csr = 1, \ .has_guc = 1, \ + .has_slpc = 1, \ .ddb_size = 896 static const struct intel_device_info intel_skylake_info = {
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 19/20 drm/i915/slpc: Add Broxton SLPC support
In reply to Sagar Arun KambleFrom: Tom O'Rourke <Tom.O'[email protected]>
Adds has_slpc to broxton info and adds broxton firmware version check to sanitize_slpc_option.
v1: Adjusted slpc version check for major version 8.
Added message if version mismatch happens for easier debug. (Sagar)
v2-v3: Rebase.
v4: Commit message update.
v5: Rebase. Updated check in sanitize_slpc_option.
--- drivers/gpu/drm/i915/i915_pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/i915_pci.c +1 -0
@@ -397,6 +397,7 @@static const struct intel_device_info intel_broxton_info = {GEN9_LP_FEATURES , + .has_slpc =1 , .platform =INTEL_BROXTON , .ddb_size =512 , };
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 20/20 drm/i915/slpc: Add Kabylake SLPC support
In reply to Sagar Arun KambleAdds has_slpc to kabylake info and adds kabylake firmware version check to sanitize_slpc_option.
--- drivers/gpu/drm/i915/i915_pci.c | 1 + drivers/gpu/drm/i915/intel_slpc.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_pci.c +1 -0
@@ -415,6 +415,7 @@ .platform = INTEL_KABYLAKE, \ .has_csr = 1, \ .has_guc = 1, \ + .has_slpc = 1, \ .ddb_size = 896 static const struct intel_device_info intel_kabylake_info = {
drivers/gpu/drm/i915/intel_slpc.c +2 -2
@@ -71,9 +71,9 @@ static unsigned int slpc_get_platform_sku(struct drm_i915_private *dev_priv) {enum slpc_platform_sku platform_sku; -if (IS_SKL_ULX (dev_priv)) +if (IS_SKL_ULX (dev_priv) ||IS_KBL_ULX (dev_priv)) platform_sku =SLPC_PLATFORM_SKU_ULX ; -else if (IS_SKL_ULT (dev_priv)) +else if (IS_SKL_ULT (dev_priv) ||IS_KBL_ULT (dev_priv)) platform_sku =SLPC_PLATFORM_SKU_ULT ;else platform_sku =SLPC_PLATFORM_SKU_DT ;
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 83 lines · Sagar Arun Kamble
SLPC (Single Loop Power Controller) is a replacement for some host-based power management features. The SLPC implementation runs in GuC firmware. This series has been tested with SKL/APL/KBL GuC firmware v9 and v10 which are yet to be released on 01.org.
The graphics power management features in SLPC are called GTPERF, BALANCER, and DCC.
1. GTPERF is a combination of DFPS (Dynamic FPS) and Turbo. DFPS adjusts requested graphics frequency to maintain target framerate. Turbo adjusts requested graphics frequency to maintain target GT busyness.
2. BALANCER adjusts balance between power budgets for IA and GT in power limited scenarios.
3. DCC (Duty Cycle Control) adjusts requested graphics frequency and stalls guc-scheduler to maintain actual graphics frequency in efficient range.This series activates GTPERF Turbo and BALANCER in GuC SLPC. Patch to enable SLPC by default on platforms having support is removed from this series as there are following new changes to be added in future before we enable GuC/SLPC by default:
1. Link waitboost with SLPC.
2. Handle CPG as part of SLPC.
3. IA p-state logic update with GuC submission.In order to enable CI/PnP testing of SLPC and to avoid frequent rebase, this series should be safe for merge with feature in disabled state.
v2: Addressed review comments on v1. Removed patch to enable SLPC by default.
v3: Addressed WARNING in igt@drv_module_reload_basic flagged by trybot BAT. Added change for sanitizing GT PM during reset. Added separate patch for sysfs interface to know HW requested frequency. Also, earlier patches did not go as series hence were not correctly picked up by BAT.
v4: Changes to multiple patches. CI BAT is passing. Performance run on SKL GT2 done and shows perf at parity with Host Turbo. For BXT, SLPC improves performance when GuC is enabled compared to Host Turbo. This series keeps only support of 9.18 firmware for better readability. If needed, other SLPC interfaces for different GuC version will be added later.
v5: This series incorporates feedback from code reviews on earlier series and adds following new changes:
1. More changes for separation of RPS and RC6 handling for Gen9.
2. Tied up SLPC enabling with GuC load/GuC submission sequence.
3. SLPC structures are defined explicitly for event input/output.
4. Definition of SLPC parameter control and task control functions agnostic to the underlying param definitions as they might change with GuC versions and prepared helpers for common tasks.
5. Transition of i915 overrides done through host to guc events to shared data and single reset event.
6. Handling SLPC status post reset through shared memory.
7. Derived helpers for setting frequency limits.
8. Removed sysfs interface to know RPNSWREQ as it is available in debugfs interfacei915_frequency_info.
9. Simple igt test to verify SLPC configuration by i915 in various driver scenarios is prepared.v6: This series adds following new changes:
1. Updatedintel_guc_sendfor SLPC to receive output data from GuC.
2. Added task overrides and min frequency overrides inintel_slpc_init. min frequency is set to Rpe.
3. New debugfs interface added to set/unset/read SLPC parameters other than tasks and frequencies. SLPC reset post parameter update added.
4. SLPC parameters persist as part of i915-GuC shared data hence not overriding frequency limits while re-enabling SLPC.
5. Other minor fixes to clearpm_rps_events, clflush the shared data.v7: This series adds following new changes:
1. Reordered patches. SLPC communication interfaces (structures and functions) are pulled into patches earlier in the series.
2. Eliminated dependency on i915.enable_slpc at various functions whererps_enabledis available.
3. s/i915_ggtt_offset/guc_ggtt_offset and sanitization of parameter inintel_uc_sanitize_options.v8: Activated Balancer. Changed prototype of SLPC functions to accept struct
intel_slpcas parameter instead ofdrm_i915_private.VIZ-6889, VIZ-6890
Quoted 8 lines
Cc Chris Wilson <[email protected]>Cc Daniel Vetter <[email protected]>Cc Beuchat, Marc <[email protected]>Cc Radoslaw Szwichtenberg <[email protected]>Cc Jeff McGee <[email protected]>Cc Arkadiusz Hiler <[email protected]>Cc Oscar Mateo <[email protected]>Cc Michał Winiarski <[email protected]>
I did enable SLPC on my machine and looks like everything is working fine. I will be spending more time reviewing whole series and also running some tests on my KBL to see if there are no functional problems.
-Radek
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerQuoted 93 lines · Radoslaw
Quoted 83 lines · Sagar Arun Kamble
SLPC (Single Loop Power Controller) is a replacement for some host-based power management features. The SLPC implementation runs in GuC firmware. This series has been tested with SKL/APL/KBL GuC firmware v9 and v10 which are yet to be released on 01.org.
The graphics power management features in SLPC are called GTPERF, BALANCER, and DCC.
1. GTPERF is a combination of DFPS (Dynamic FPS) and Turbo. DFPS adjusts requested graphics frequency to maintain target framerate. Turbo adjusts requested graphics frequency to maintain target GT busyness.
2. BALANCER adjusts balance between power budgets for IA and GT in power limited scenarios.
3. DCC (Duty Cycle Control) adjusts requested graphics frequency and stalls guc-scheduler to maintain actual graphics frequency in efficient range.This series activates GTPERF Turbo and BALANCER in GuC SLPC. Patch to enable SLPC by default on platforms having support is removed from this series as there are following new changes to be added in future before we enable GuC/SLPC by default:
1. Link waitboost with SLPC.
2. Handle CPG as part of SLPC.
3. IA p-state logic update with GuC submission.In order to enable CI/PnP testing of SLPC and to avoid frequent rebase, this series should be safe for merge with feature in disabled state.
v2: Addressed review comments on v1. Removed patch to enable SLPC by
default.v3: Addressed WARNING in igt@drv_module_reload_basic flagged by trybot BAT.
Added change for sanitizing GT PM during reset. Added separate patch for sysfs interface to know HW requested frequency. Also, earlier patches did not go as series hence were not correctly picked up by BAT.v4: Changes to multiple patches. CI BAT is passing. Performance run on SKL
GT2 done and shows perf at parity with Host Turbo. For BXT, SLPC improves performance when GuC is enabled compared to Host Turbo. This series keeps only support of 9.18 firmware for better readability. If needed, other SLPC interfaces for different GuC version will be added later.v5: This series incorporates feedback from code reviews on earlier series
and adds following new changes:
1. More changes for separation of RPS and RC6 handling for Gen9.
2. Tied up SLPC enabling with GuC load/GuC submission sequence.
3. SLPC structures are defined explicitly for event input/output.
4. Definition of SLPC parameter control and task control functions agnostic to the underlying param definitions as they might change with GuC versions and prepared helpers for common tasks.
5. Transition of i915 overrides done through host to guc events to shared data and single reset event.
6. Handling SLPC status post reset through shared memory.
7. Derived helpers for setting frequency limits.
8. Removed sysfs interface to know RPNSWREQ as it is available in debugfs interfacei915_frequency_info.
9. Simple igt test to verify SLPC configuration by i915 in various driver scenarios is prepared.v6: This series adds following new changes:
1. Updatedintel_guc_sendfor SLPC to receive output data from GuC.
2. Added task overrides and min frequency overrides inintel_slpc_init. min frequency is set to Rpe.
3. New debugfs interface added to set/unset/read SLPC parameters other than tasks and frequencies. SLPC reset post parameter update added.
4. SLPC parameters persist as part of i915-GuC shared data hence not overriding frequency limits while re-enabling SLPC.
5. Other minor fixes to clearpm_rps_events, clflush the shared data.v7: This series adds following new changes:
1. Reordered patches. SLPC communication interfaces (structures and functions) are pulled into patches earlier in the series.
2. Eliminated dependency on i915.enable_slpc at various functions whererps_enabledis available.
3. s/i915_ggtt_offset/guc_ggtt_offset and sanitization of parameter inintel_uc_sanitize_options.v8: Activated Balancer. Changed prototype of SLPC functions to accept
structintel_slpcas parameter instead ofdrm_i915_private.VIZ-6889, VIZ-6890
Quoted 8 lines
Cc Chris Wilson <[email protected]>Cc Daniel Vetter <[email protected]>Cc Beuchat, Marc <[email protected]>Cc Radoslaw Szwichtenberg <[email protected]>Cc Jeff McGee <[email protected]>Cc Arkadiusz Hiler <[email protected]>Cc Oscar Mateo <[email protected]>Cc Michał Winiarski <[email protected]>
Quoted 3 lines
I did enable SLPC on my machine and looks like everything is working fine. I will be spending more time reviewing whole series and also running some tests on my KBL to see if there are no functional problems.
This would be more of a "Tested-by:" than "Acked-by:".
Regards, Joonas
Quoted 6 lines
-Radek
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 93 lines · Joonas Lahtinen
Quoted 92 lines · Radoslaw
Quoted 91 lines · Sagar Arun Kamble
SLPC (Single Loop Power Controller) is a replacement for some host-based power management features. The SLPC implementation runs in GuC firmware. This series has been tested with SKL/APL/KBL GuC firmware v9 and v10 which are yet to be released on 01.org.
The graphics power management features in SLPC are called GTPERF, BALANCER, and DCC.
1. GTPERF is a combination of DFPS (Dynamic FPS) and Turbo. DFPS adjusts requested graphics frequency to maintain target framerate. Turbo adjusts requested graphics frequency to maintain target GT busyness.
2. BALANCER adjusts balance between power budgets for IA and GT in power limited scenarios.
3. DCC (Duty Cycle Control) adjusts requested graphics frequency and stalls guc-scheduler to maintain actual graphics frequency in efficient range.This series activates GTPERF Turbo and BALANCER in GuC SLPC. Patch to enable SLPC by default on platforms having support is removed from this series as there are following new changes to be added in future before we enable GuC/SLPC by default:
1. Link waitboost with SLPC.
2. Handle CPG as part of SLPC.
3. IA p-state logic update with GuC submission.In order to enable CI/PnP testing of SLPC and to avoid frequent rebase, this series should be safe for merge with feature in disabled state.
v2: Addressed review comments on v1. Removed patch to enable SLPC by
default.v3: Addressed WARNING in igt@drv_module_reload_basic flagged by trybot BAT.
Added change for sanitizing GT PM during reset. Added separate patch for sysfs interface to know HW requested frequency. Also, earlier patches did not go as series hence were not correctly picked up by BAT.v4: Changes to multiple patches. CI BAT is passing. Performance run on SKL
GT2 done and shows perf at parity with Host Turbo. For BXT, SLPC improves performance when GuC is enabled compared to Host Turbo. This series keeps only support of 9.18 firmware for better readability. If needed, other SLPC interfaces for different GuC version will be added later.v5: This series incorporates feedback from code reviews on earlier series
and adds following new changes:
1. More changes for separation of RPS and RC6 handling for Gen9.
2. Tied up SLPC enabling with GuC load/GuC submission sequence.
3. SLPC structures are defined explicitly for event input/output.
4. Definition of SLPC parameter control and task control functions agnostic to the underlying param definitions as they might change with GuC versions and prepared helpers for common tasks.
5. Transition of i915 overrides done through host to guc events to shared data and single reset event.
6. Handling SLPC status post reset through shared memory.
7. Derived helpers for setting frequency limits.
8. Removed sysfs interface to know RPNSWREQ as it is available in debugfs interfacei915_frequency_info.
9. Simple igt test to verify SLPC configuration by i915 in various driver scenarios is prepared.v6: This series adds following new changes:
1. Updatedintel_guc_sendfor SLPC to receive output data from GuC.
2. Added task overrides and min frequency overrides inintel_slpc_init. min frequency is set to Rpe.
3. New debugfs interface added to set/unset/read SLPC parameters other than tasks and frequencies. SLPC reset post parameter update added.
4. SLPC parameters persist as part of i915-GuC shared data hence not overriding frequency limits while re-enabling SLPC.
5. Other minor fixes to clearpm_rps_events, clflush the shared data.v7: This series adds following new changes:
1. Reordered patches. SLPC communication interfaces (structures and functions) are pulled into patches earlier in the series.
2. Eliminated dependency on i915.enable_slpc at various functions whererps_enabledis available.
3. s/i915_ggtt_offset/guc_ggtt_offset and sanitization of parameter inintel_uc_sanitize_options.v8: Activated Balancer. Changed prototype of SLPC functions to accept
structintel_slpcas parameter instead ofdrm_i915_private.VIZ-6889, VIZ-6890
Cc Chris Wilson <[email protected]>Cc Daniel Vetter <[email protected]>Cc Beuchat, Marc <[email protected]>Cc Radoslaw Szwichtenberg <[email protected]>Cc Jeff McGee <[email protected]>Cc Arkadiusz Hiler <[email protected]>Cc Oscar Mateo <[email protected]>Cc Michał Winiarski <[email protected]>
Quoted 6 lines
Quoted 3 lines
I did enable SLPC on my machine and looks like everything is working fine. I will be spending more time reviewing whole series and also running some tests on my KBL to see if there are no functional problems.
This would be more of a "Tested-by:" than "Acked-by:".
Regards, Joonas
Thanks Radek, Joonas.
Will update this in the next series.
Quoted 7 lines
Quoted 7 lines
-Radek
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx