Add support for GuC-based SLPC
Subsystems (2)
v6 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 firmware on GuC. This series has been tested with SKL/APL/KBL GuC firmware v9.
The graphics power management features in SLPC in this version are called GTPERF, BALANCER, and DCC.
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.
BALANCER adjusts balance between power budgets for IA and GT in power limited scenarios.
DCC (Duty Cycle Control) adjusts requested graphics frequency and stalls guc-scheduler to maintain actual graphics frequency in efficient range.
This patch series activates only GTPERF Turbo in GuC SLPC.
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.
VIZ-6889, VIZ-6890
Sagar Arun Kamble (12):
drm/i915/debugfs: Create generic string tokenize function and update
CRC control parsing
drm/i915/gen9: Separate RPS and RC6 handling drm/i915/slpc: Use intel_slpc_* functions if supported drm/i915/slpc: Allocate/Release/Initialize SLPC shared data drm/i915/slpc: Add SLPC banner to RPS debugfs interfaces. drm/i915/slpc: Add SLPC communication interfaces drm/i915/slpc: Send RESET event to enable SLPC drm/i915/slpc: Add parameter set/unset/get functions drm/i915/slpc: Add debugfs support to read/write/revert the parameters drm/i915/slpc: Add support for min/max frequency control drm/i915/slpc: Set default values for tasks and min frequency
parameters
drm/i915/slpc: Add Kabylake SLPC support
Tom O'Rourke (11):
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: If using SLPC, do not set frequency 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 drm/i915/slpc: Enable SLPC, where supported
drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_debugfs.c | 240 ++++++- drivers/gpu/drm/i915/i915_drv.c | 8 +- drivers/gpu/drm/i915/i915_drv.h | 8 + drivers/gpu/drm/i915/i915_gem.c | 8 + drivers/gpu/drm/i915/i915_guc_submission.c | 3 + drivers/gpu/drm/i915/i915_params.c | 6 + drivers/gpu/drm/i915/i915_params.h | 1 + drivers/gpu/drm/i915/i915_pci.c | 5 + drivers/gpu/drm/i915/i915_sysfs.c | 36 +- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_guc_loader.c | 3 + drivers/gpu/drm/i915/intel_pipe_crc.c | 88 +-- drivers/gpu/drm/i915/intel_pm.c | 109 +++- drivers/gpu/drm/i915/intel_slpc.c | 962 +++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 268 ++++++++ drivers/gpu/drm/i915/intel_uc.c | 65 +- drivers/gpu/drm/i915/intel_uc.h | 5 + 18 files changed, 1746 insertions(+), 73 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 v6 1/23 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
@@ -3599,6 +3599,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
PATCH v6 2/23 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) are tracked through rps.rc6_enabled and RPS through 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. Moved setting of rps.enabled to platform level functions as there is case of disabling of RPS in gen9_enable_rps.
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.
--- drivers/gpu/drm/i915/i915_drv.c | 6 ++++- drivers/gpu/drm/i915/i915_drv.h | 5 ++++ drivers/gpu/drm/i915/intel_pm.c | 54 +++++++++++++++++++++++++++++++++-------- 3 files changed, 54 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +5 -1
@@ -2358,7 +2358,11 @@ 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 (WARN_ON_ONCE ((IS_GEN9 (dev_priv) && !dev_priv->rps.rc6_enabled) || + (!IS_GEN9 (dev_priv) && !dev_priv->rps.enabled)))return -ENODEV ;if (WARN_ON_ONCE (!HAS_RUNTIME_PM (dev_priv)))
drivers/gpu/drm/i915/i915_drv.h +5 -0
@@ -1372,7 +1372,12 @@ struct intel_gen6_power_mgmt {struct list_head clients;bool client_boost; +/* +* For platforms prior to Gen9, RPS and RC6 status is tracked +* through "enabled". For Gen9, RC6 is tracked through "rc6_enabled". +*/ bool enabled; +bool rc6_enabled;struct delayed_work autoenable_work;unsigned boosts;
drivers/gpu/drm/i915/intel_pm.c +44 -10
160 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 v6 02/23] drm/i915/gen9: Separate RPS and RC6 handling
Quoted 57 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) are tracked through rps.rc6_enabled and RPS through 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. Moved setting of rps.enabled to platform level functions as there is case of disabling of RPS ingen9_enable_rps.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_powersave
routines with separated RPS and RC6 handling and rebase. Commit message update.(Sagar)v6: Added comments at the definition of
rc6_enabled.Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/i915_drv.c | 6 ++++- drivers/gpu/drm/i915/i915_drv.h | 5 ++++ drivers/gpu/drm/i915/intel_pm.c | 54 +++++++++++++++++++++++++++++++++-------- 3 files changed, 54 insertions(+), 11 deletions(-)drivers/gpu/drm/i915/i915_drv.c +5
-1@@ -2358,7 +2358,11 @@ 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 (WARN_ON_ONCE ((IS_GEN9 (dev_priv) && !dev_priv->rps.rc6_enabled) || + (!IS_GEN9 (dev_priv) && !dev_priv->rps.enabled)))return -ENODEV ;if (WARN_ON_ONCE (!HAS_RUNTIME_PM (dev_priv)))drivers/gpu/drm/i915/i915_drv.h +0
-0
drivers/gpu/drm/i915/i915_drv.h struct intel_gen6_power_mgmt { · line 1380
Quoted 9 lines
drivers/gpu/drm/i915/i915_drv.h +5
-0@@ -1372,7 +1372,12 @@ struct intel_gen6_power_mgmt {struct list_head clients;bool client_boost; +/* +* For platforms prior to Gen9, RPS and RC6 status is tracked +* through "enabled". For Gen9, RC6 is tracked through "rc6_enabled". +*/ bool enabled; +bool rc6_enabled;
Does that sound sane?
Let's have rc6_enabled mean rc6_enabled whatever the gen, and rps_enabled mean rps_enabled whatever the gen. -Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 3/23 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
@@ -845,6 +845,7 @@ struct intel_csr {func (has_rc6p); \func (has_resource_streamer); \func (has_runtime_pm); \ +func (has_slpc); \func (has_snoop); \func (cursor_needs_physical); \func (hws_needs_physical); \
@@ -2930,6 +2931,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 v6 4/23 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.
slpc_enable_sanitize() converts i915.enable_slpc to either 0 or 1. Interpretation of default value is based on HAS_SLPC(), after slpc_version_check(). This function also enforces the requirement that guc_submission is required for slpc.
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.
--- drivers/gpu/drm/i915/i915_params.c | 6 ++++++ drivers/gpu/drm/i915/i915_params.h | 1 + drivers/gpu/drm/i915/intel_uc.c | 17 +++++++++++++++++ 3 files changed, 24 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,
@@ -142,6 +143,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
@@ -40,6 +40,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 +17 -0
@@ -81,6 +81,21 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv)mutex_init (&dev_priv->guc.send_mutex); } +void sanitize_slpc_option (struct drm_i915_private *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_fw (struct drm_i915_private *dev_priv) {if (dev_priv->huc.fw.path)
@@ -88,6 +103,8 @@ void intel_uc_init_fw(struct drm_i915_private *dev_priv)if (dev_priv->guc.fw.path)intel_uc_prepare_fw (dev_priv, &dev_priv->guc.fw); + +sanitize_slpc_option (dev_priv); }int intel_uc_init_hw (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 v6 5/23 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. Other platforms and corresponding checks added later in the 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.
--- drivers/gpu/drm/i915/intel_uc.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/intel_uc.c +7 -0
@@ -83,6 +83,8 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv)void sanitize_slpc_option (struct drm_i915_private *dev_priv) { +struct intel_uc_fw *guc_fw = &dev_priv->guc.fw; +/* slpc requires hardware support and compatible firmware */ if (!HAS_SLPC (dev_priv)) i915.enable_slpc =0 ;
@@ -94,6 +96,11 @@ void sanitize_slpc_option(struct drm_i915_private *dev_priv)/* slpc requires guc submission */ if (!i915.enable_guc_submission) i915.enable_slpc =0 ; + +if (guc_fw->major_ver_found <9 ) { +DRM_INFO ("SLPC not supported with current GuC firmware\n" ); + i915.enable_slpc =0 ; + } }void intel_uc_init_fw (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
Re: [PATCH v6 05/23] drm/i915/slpc: Sanitize GuC version
Quoted 38 lines · Sagar Arun Kamble
From: 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. Other platforms and corresponding checks added later in the series.
v1: Updated with modified
sanitize_slpc_optionin 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.
Signed-off-by Tom O'Rourke <Tom.O'[email protected]>Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_uc.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/i915/intel_uc.c +2
-0@@ -83,6 +83,8 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv)void sanitize_slpc_option (struct drm_i915_private *dev_priv) { +struct intel_uc_fw *guc_fw = &dev_priv->guc.fw; +/* slpc requires hardware support and compatible firmware */ if (!HAS_SLPC (dev_priv)) i915.enable_slpc =0 ;
drivers/gpu/drm/i915/intel_uc.c void sanitize_slpc_option(struct drm_i915_private *dev_priv) · line 101
Quoted 6 lines
drivers/gpu/drm/i915/intel_uc.c +3
-0@@ -94,6 +96,11 @@ void sanitize_slpc_option(struct drm_i915_private *dev_priv)/* slpc requires guc submission */ if (!i915.enable_guc_submission) i915.enable_slpc =0 ; + +if (guc_fw->major_ver_found <9 ) { +DRM_INFO ("SLPC not supported with current GuC firmware\n" );
Say the actual version found, the requirement and the likely consequence. Is it important enough to direct the user to 01.org?
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v6 05/23] drm/i915/slpc: Sanitize GuC version
Quoted 40 lines · Chris Wilson
Quoted 39 lines · Sagar Arun Kamble
From: 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. Other platforms and corresponding checks added later in the series.
v1: Updated with modified
sanitize_slpc_optionin 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.
Signed-off-by Tom O'Rourke <Tom.O'[email protected]>Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_uc.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/i915/intel_uc.c +2
-0@@ -83,6 +83,8 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv)void sanitize_slpc_option (struct drm_i915_private *dev_priv) { +struct intel_uc_fw *guc_fw = &dev_priv->guc.fw; +/* slpc requires hardware support and compatible firmware */ if (!HAS_SLPC (dev_priv)) i915.enable_slpc =0 ;@@ -94,6 +96,11 @@ void sanitize_slpc_option(struct drm_i915_private *dev_priv)/* slpc requires guc submission */
Quoted 8 lines
drivers/gpu/drm/i915/intel_uc.c void sanitize_slpc_option(struct drm_i915_private *dev_priv) · line 101
Quoted 5 lines
drivers/gpu/drm/i915/intel_uc.c +3
-0if (!i915.enable_guc_submission) i915.enable_slpc =0 ; + +if (guc_fw->major_ver_found <9 ) { +DRM_INFO ("SLPC not supported with current GuC firmware\n" );Say the actual version found, the requirement and the likely consequence. Is it important enough to direct the user to 01.org?
-Chris
Ok. Will update this. Will add details of firmware needed from 01.org.
Thanks
Sagar
Quoted 1 line
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 6/23 drm/i915/slpc: Use intel_slpc_* functions if supported
In reply to Sagar Arun KambleOn platforms with SLPC support: call intel_slpc_*() functions from intel_*_gt_powersave() functions and GuC setup functions and do not use rps functions. intel_slpc_enable is tied to GuC setup. With SLPC, intel_enable_gt_powersave will only handle RC6 and ring frequencies. intel_init_gt_powersave will check if SLPC has started running through shared data and update initial state that i915 needs like frequency limits.
Host will not manage GT frequency with this change.
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.
--- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_drv.c | 2 ++ drivers/gpu/drm/i915/i915_gem.c | 8 +++++ drivers/gpu/drm/i915/i915_guc_submission.c | 3 ++ drivers/gpu/drm/i915/intel_pm.c | 51 ++++++++++++++++++++++++------ drivers/gpu/drm/i915/intel_slpc.c | 46 +++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 38 ++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uc.c | 11 +++++++ drivers/gpu/drm/i915/intel_uc.h | 3 ++ 9 files changed, 154 insertions(+), 11 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 +2 -1
@@ -60,7 +60,8 @@ i915-y += intel_uc.o \ intel_guc_log.o \ intel_guc_loader.o \ intel_huc.o \ - i915_guc_submission.o + i915_guc_submission.o \ + intel_slpc.o # autogenerated null render state i915-y += intel_renderstate_gen6.o \
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -1762,6 +1762,8 @@ static int i915_drm_resume_early(struct drm_device *dev)hsw_disable_pc8 (dev_priv); } + dev_priv->guc.slpc.active = false; +intel_uncore_sanitize (dev_priv); if (IS_GEN9_LP(dev_priv) ||
drivers/gpu/drm/i915/i915_gem.c +8 -0
@@ -2900,6 +2900,14 @@ void i915_gem_reset(struct drm_i915_private *dev_priv)i915_gem_restore_fences (dev_priv); +/* +* GPU is reset at this point, Hence mark SLPC as inactive to +* not send h2g action to shutdown SLPC as that will fail. +* enable_gt_powersave will setup RC6 and ring frequencies and +* SLPC will be enabled post GuC initialization. +*/ + dev_priv->guc.slpc.active = false; +if (dev_priv->gt.awake) {intel_sanitize_gt_powersave (dev_priv);intel_enable_gt_powersave (dev_priv);
drivers/gpu/drm/i915/i915_guc_submission.c +3 -0
@@ -902,6 +902,9 @@ int i915_guc_submission_init(struct drm_i915_private *dev_priv)intel_guc_log_create (guc);guc_addon_create (guc); +if (i915.enable_slpc) +intel_slpc_init (dev_priv); + guc->execbuf_client = guc_client_alloc(dev_priv, INTEL_INFO(dev_priv)->ring_mask, GUC_CTX_PRIORITY_KMD_NORMAL,
drivers/gpu/drm/i915/intel_pm.c +41 -10
132 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.c new file +46 -0
46 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Copyright © 2016 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 drm_i915_private *dev_priv); +void intel_slpc_cleanup (struct drm_i915_private *dev_priv); +void intel_slpc_enable (struct drm_i915_private *dev_priv); +void intel_slpc_suspend (struct drm_i915_private *dev_priv); +void intel_slpc_disable (struct drm_i915_private *dev_priv); + +#endif
drivers/gpu/drm/i915/intel_uc.c +11 -0
@@ -163,6 +163,17 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv) goto err_submission;intel_guc_auth_huc (dev_priv); + +/* +* 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); +if (i915.enable_guc_submission) {if (i915.guc_log_level >=0 )gen9_enable_guc_interrupts (dev_priv);
drivers/gpu/drm/i915/intel_uc.h +3 -0
@@ -27,6 +27,7 @@#include "intel_guc_fwif.h" #include "i915_guc_reg.h" #include "intel_ringbuffer.h" +#include "intel_slpc.h" #include "i915_vma.h"
@@ -172,6 +173,8 @@ struct intel_guc {uint64_t submissions[I915_NUM_ENGINES ];uint32_t last_seqno[I915_NUM_ENGINES ]; +struct intel_slpc slpc; +/* To serialize the intel_guc_send actions */ struct mutex send_mutex; };
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v6 06/23] drm/i915/slpc: Use intel_slpc_* functions if supported
Quoted 60 lines · Sagar Arun Kamble
On platforms with SLPC support: call intel_slpc_*() functions from intel_*_gt_powersave() functions and GuC setup functions and do not use rps functions.
intel_slpc_enableis tied to GuC setup. With SLPC,intel_enable_gt_powersavewill only handle RC6 and ring frequencies.intel_init_gt_powersavewill check if SLPC has started running through shared data and update initial state that i915 needs like frequency limits.
Host will not manage GT frequency with this change.v1: Return void instead of ignored error code (Paulo)
enable/disable RC6 in SLPC flows (Sagar)
replaceHAS_SLPC()use withintel_slpc_enabled()
orintel_slpc_active()(Paulo)
Fix for renaminggen9_disable_rpstogen9_disable_rc6in "drm/i915/bxt: Explicitly clear the Turbo control register" Defer RC6 and SLPC enabling tointel_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 inintel_slpc_active. Cleanup is also based on kernel parameter as SLPC gets disabled in disable/suspend.(Sagar)v2: Usage of
INTEL_GENinstead ofINTEL_INFO->gen(David)
Checkpatch update.v3: Rebase
v4: Removed reset functions to comply with
*_gt_powersaveroutines.(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.
Signed-off-by Tom O'Rourke <Tom.O'[email protected]>Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_drv.c | 2 ++ drivers/gpu/drm/i915/i915_gem.c | 8 +++++ drivers/gpu/drm/i915/i915_guc_submission.c | 3 ++ drivers/gpu/drm/i915/intel_pm.c | 51 ++++++++++++++++++++++++------ drivers/gpu/drm/i915/intel_slpc.c | 46 +++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 38 ++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uc.c | 11 +++++++ drivers/gpu/drm/i915/intel_uc.h | 3 ++ 9 files changed, 154 insertions(+), 11 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_slpc.c create mode 100644 drivers/gpu/drm/i915/intel_slpc.hdrivers/gpu/drm/i915/Makefile +0
-0
drivers/gpu/drm/i915/Makefile i915-y += intel_uc.o \ · line 64
Quoted 6 lines
drivers/gpu/drm/i915/Makefile +2
-1@@ -60,7 +60,8 @@ i915-y += intel_uc.o \ intel_guc_log.o \ intel_guc_loader.o \ intel_huc.o \ - i915_guc_submission.o + i915_guc_submission.o \ + intel_slpc.o
Something here is not in alphabetical order.
Quoted 21 lines
drivers/gpu/drm/i915/Makefile +0
-0# autogenerated null render state i915-y += intel_renderstate_gen6.o \drivers/gpu/drm/i915/i915_drv.c +2
-0@@ -1762,6 +1762,8 @@ static int i915_drm_resume_early(struct drm_device *dev)hsw_disable_pc8 (dev_priv); } + dev_priv->guc.slpc.active = false; +intel_uncore_sanitize (dev_priv); if (IS_GEN9_LP(dev_priv) ||drivers/gpu/drm/i915/i915_gem.c +0
-0
drivers/gpu/drm/i915/i915_gem.c void i915_gem_reset(struct drm_i915_private *dev_priv) · line 2904
Quoted 5 lines
drivers/gpu/drm/i915/i915_gem.c +2
-0@@ -2900,6 +2900,14 @@ void i915_gem_reset(struct drm_i915_private *dev_priv)i915_gem_restore_fences (dev_priv); +/* +* GPU is reset at this point, Hence mark SLPC as inactive to
First sentence is redundant.
drivers/gpu/drm/i915/i915_gem.c void i915_gem_reset(struct drm_i915_private *dev_priv) · line 2909
Quoted 5 lines
drivers/gpu/drm/i915/i915_gem.c +5
-0+* not send h2g action to shutdown SLPC as that will fail. +* enable_gt_powersave will setup RC6 and ring frequencies and +* SLPC will be enabled post GuC initialization. +*/ + dev_priv->guc.slpc.active = false;
It suggests we should be hooking guc into the reset prepare/do/finish more thoroughly.
Quoted 9 lines
drivers/gpu/drm/i915/i915_gem.c +1
-0+if (dev_priv->gt.awake) {intel_sanitize_gt_powersave (dev_priv);intel_enable_gt_powersave (dev_priv);drivers/gpu/drm/i915/i915_guc_submission.c +0
-0
drivers/gpu/drm/i915/i915_guc_submission.c int i915_guc_submission_init(struct drm_i915_private *dev_priv) · line 906
Quoted 5 lines
drivers/gpu/drm/i915/i915_guc_submission.c +2
-0@@ -902,6 +902,9 @@ int i915_guc_submission_init(struct drm_i915_private *dev_priv)intel_guc_log_create (guc);guc_addon_create (guc); +if (i915.enable_slpc) +intel_slpc_init (dev_priv);
This is not a hotpath, move the test to the callee.
drivers/gpu/drm/i915/intel_pm.c static void vlv_set_rps_idle(struct drm_i915_private *dev_priv) · line 5287
Quoted 13 lines
drivers/gpu/drm/i915/i915_guc_submission.c +0
-0guc->execbuf_client = guc_client_alloc(dev_priv, INTEL_INFO(dev_priv)->ring_mask, GUC_CTX_PRIORITY_KMD_NORMAL,drivers/gpu/drm/i915/intel_pm.c +2
-0@@ -5283,6 +5283,9 @@ static void vlv_set_rps_idle(struct drm_i915_private *dev_priv)void gen6_rps_busy (struct drm_i915_private *dev_priv) { +if (i915.enable_slpc) +return ;
Feels very wrong. Anticipating this should be more akin to disabling at the intel_set_rps() (or a nop callback), or just using rps.enabled to skip.
drivers/gpu/drm/i915/intel_pm.c void intel_suspend_gt_powersave(struct drm_i915_private *dev_priv) · line 7029
Quoted 5 lines
drivers/gpu/drm/i915/intel_pm.c +2
-1void intel_sanitize_gt_powersave (struct drm_i915_private *dev_priv) { - dev_priv->rps.enabled = true;/* force disabling */ +if (!i915.enable_slpc) + dev_priv->rps.enabled = true;/* force disabling */
Nope. Please consider the point of this function to ensure that whatever we inherit from the BIOS is cleared.
drivers/gpu/drm/i915/intel_pm.c void intel_suspend_gt_powersave(struct drm_i915_private *dev_priv) · line 7018
Quoted 12 lines
drivers/gpu/drm/i915/intel_pm.c +3
-2dev_priv->rps.rc6_enabled = true; +intel_disable_gt_powersave (dev_priv); -gen6_reset_rps_interrupts (dev_priv); +if (!i915.enable_slpc) +gen6_reset_rps_interrupts (dev_priv); }void intel_disable_gt_powersave (struct drm_i915_private *dev_priv) { -if (!READ_ONCE (dev_priv->rps.enabled)) {
So what is preventing us from just not marking rps.enabled as enabled under slpc?
In all, i915.enable_slpc should be rare.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v6 06/23] drm/i915/slpc: Use intel_slpc_* functions if supported
Quoted 56 lines · Chris Wilson
Quoted 55 lines · Sagar Arun Kamble
On platforms with SLPC support: call intel_slpc_*() functions from intel_*_gt_powersave() functions and GuC setup functions and do not use rps functions.
intel_slpc_enableis tied to GuC setup. With SLPC,intel_enable_gt_powersavewill only handle RC6 and ring frequencies.intel_init_gt_powersavewill check if SLPC has started running through shared data and update initial state that i915 needs like frequency limits.
Host will not manage GT frequency with this change.v1: Return void instead of ignored error code (Paulo)
enable/disable RC6 in SLPC flows (Sagar)
replaceHAS_SLPC()use withintel_slpc_enabled()
orintel_slpc_active()(Paulo)
Fix for renaminggen9_disable_rpstogen9_disable_rc6in "drm/i915/bxt: Explicitly clear the Turbo control register" Defer RC6 and SLPC enabling tointel_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 inintel_slpc_active. Cleanup is also based on kernel parameter as SLPC gets disabled in disable/suspend.(Sagar)v2: Usage of
INTEL_GENinstead ofINTEL_INFO->gen(David)
Checkpatch update.v3: Rebase
v4: Removed reset functions to comply with
*_gt_powersaveroutines.(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.
Signed-off-by Tom O'Rourke <Tom.O'[email protected]>Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_drv.c | 2 ++ drivers/gpu/drm/i915/i915_gem.c | 8 +++++ drivers/gpu/drm/i915/i915_guc_submission.c | 3 ++ drivers/gpu/drm/i915/intel_pm.c | 51 ++++++++++++++++++++++++------ drivers/gpu/drm/i915/intel_slpc.c | 46 +++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 38 ++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uc.c | 11 +++++++ drivers/gpu/drm/i915/intel_uc.h | 3 ++ 9 files changed, 154 insertions(+), 11 deletions(-)create mode 100644
drivers/gpu/drm/i915/intel_slpc.ccreate mode 100644drivers/gpu/drm/i915/intel_slpc.h
Quoted 12 lines
drivers/gpu/drm/i915/Makefile i915-y += intel_uc.o \ · line 64
Quoted 11 lines
drivers/gpu/drm/i915/Makefile +2
-1@@ -60,7 +60,8 @@ i915-y += intel_uc.o \ intel_guc_log.o \ intel_guc_loader.o \ intel_huc.o \ - i915_guc_submission.o + i915_guc_submission.o \ + intel_slpc.oSomething here is not in alphabetical order.
Yes. Will fix this.
Quoted 23 lines
Quoted 23 lines
drivers/gpu/drm/i915/Makefile +0
-0# autogenerated null render state i915-y += intel_renderstate_gen6.o \drivers/gpu/drm/i915/i915_drv.c +2
-0@@ -1762,6 +1762,8 @@ static int i915_drm_resume_early(struct drm_device *dev)hsw_disable_pc8 (dev_priv); } + dev_priv->guc.slpc.active = false; +intel_uncore_sanitize (dev_priv); if (IS_GEN9_LP(dev_priv) ||drivers/gpu/drm/i915/i915_gem.c +0
-0@@ -2900,6 +2900,14 @@ void i915_gem_reset(struct drm_i915_private *dev_priv)
Quoted 5 lines
drivers/gpu/drm/i915/i915_gem.c void i915_gem_reset(struct drm_i915_private *dev_priv) · line 2904
Quoted 4 lines
drivers/gpu/drm/i915/i915_gem.c +2
-0i915_gem_restore_fences (dev_priv); +/* +* GPU is reset at this point, Hence mark SLPC as inactive to First sentence is redundant.
Will fix this.
Quoted 8 lines
drivers/gpu/drm/i915/i915_gem.c void i915_gem_reset(struct drm_i915_private *dev_priv) · line 2909
Quoted 6 lines
drivers/gpu/drm/i915/i915_gem.c +5
-0+* not send h2g action to shutdown SLPC as that will fail. +* enable_gt_powersave will setup RC6 and ring frequencies and +* SLPC will be enabled post GuC initialization. +*/ + dev_priv->guc.slpc.active = false;It suggests we should be hooking guc into the reset prepare/do/finish more thoroughly.
Yes. Might have to rework w.r.t these flows. Will update.
Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/i915/i915_gem.c +1
-0+if (dev_priv->gt.awake) {intel_sanitize_gt_powersave (dev_priv);intel_enable_gt_powersave (dev_priv);drivers/gpu/drm/i915/i915_guc_submission.c +0
-0@@ -902,6 +902,9 @@ int i915_guc_submission_init(struct drm_i915_private *dev_priv)intel_guc_log_create (guc);guc_addon_create (guc);
Quoted 3 lines
drivers/gpu/drm/i915/i915_guc_submission.c int i915_guc_submission_init(struct drm_i915_private *dev_priv) · line 906
Quoted 2 lines
drivers/gpu/drm/i915/i915_guc_submission.c +2
-0+if (i915.enable_slpc) +intel_slpc_init (dev_priv);This is not a hotpath, move the test to the callee.
Ok. Will update.
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/i915/i915_guc_submission.c +0
-0guc->execbuf_client = guc_client_alloc(dev_priv, INTEL_INFO(dev_priv)->ring_mask, GUC_CTX_PRIORITY_KMD_NORMAL,drivers/gpu/drm/i915/intel_pm.c +0
-0@@ -5283,6 +5283,9 @@ static void vlv_set_rps_idle(struct drm_i915_private *dev_priv)
Quoted 7 lines
drivers/gpu/drm/i915/intel_pm.c static void vlv_set_rps_idle(struct drm_i915_private *dev_priv) · line 5287
Quoted 4 lines
drivers/gpu/drm/i915/intel_pm.c +2
-0void gen6_rps_busy (struct drm_i915_private *dev_priv) { +if (i915.enable_slpc) +return ;Feels very wrong. Anticipating this should be more akin to disabling at the
intel_set_rps()(or a nop callback), or just using rps.enabled to skip.
Will make this return based on rps.enabled.
Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c void intel_suspend_gt_powersave(struct drm_i915_private *dev_priv) · line 7029
Quoted 6 lines
drivers/gpu/drm/i915/intel_pm.c +2
-1void intel_sanitize_gt_powersave (struct drm_i915_private *dev_priv) { - dev_priv->rps.enabled = true;/* force disabling */ +if (!i915.enable_slpc) + dev_priv->rps.enabled = true;/* force disabling */ Nope. Please consider the point of this function to ensure that whatever we inherit from the BIOS is cleared.
Forceful disabling here clears the RP_CONTROL register which controls the SLPC frequency requests.
Would need to preserve the BIOS set value so will copy prior to clearing here and set again when enabling SLPC.
Quoted 10 lines
Quoted 10 lines
dev_priv->rps.rc6_enabled = true;drivers/gpu/drm/i915/intel_pm.c +3
-1+intel_disable_gt_powersave (dev_priv); -gen6_reset_rps_interrupts (dev_priv); +if (!i915.enable_slpc) +gen6_reset_rps_interrupts (dev_priv); }
Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c void intel_suspend_gt_powersave(struct drm_i915_private *dev_priv) · line 7018
Quoted 3 lines
void intel_disable_gt_powersave(struct drm_i915_private *dev_priv) {drivers/gpu/drm/i915/intel_pm.c +0
-1-if (!READ_ONCE (dev_priv->rps.enabled)) {So what is preventing us from just not marking rps.enabled as enabled under slpc?
In all, i915.enable_slpc should be rare.
-Chris
RP_CONTROL clearing was the issue. Will update to rely on rps.enabled as much as possible. Will hopefully be able to reduce the i915.enable_slpc occurrences.
Thanks for the review.
Thanks
Sagar
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 7/23 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
@@ -140,6 +140,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 v6 8/23 drm/i915/slpc: If using SLPC, do not set frequency
In reply to Sagar Arun KambleFrom: Tom O'Rourke <Tom.O'[email protected]>
When frequency requests are made by SLPC, host driver should not attempt to make frequency requests due to potential conflicts.
Host-based turbo operations are already avoided when SLPC is used. This change covers other frequency requests such as from sysfs or debugfs interfaces.
A later patch in this series updates sysfs/debugfs interfaces for setting max/min frequencies with SLPC.
v1: Use intel_slpc_active instead of HAS_SLPC (Paulo)
v2-v4: Rebase.
v5: Changed intel_slpc_active to i915.enable_slpc. (Sagar)
--- drivers/gpu/drm/i915/intel_pm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +3 -0
@@ -5385,6 +5385,9 @@ int intel_set_rps(struct drm_i915_private *dev_priv, u8 val) {int err; +if (i915.enable_slpc) +return 0 ; +lockdep_assert_held (&dev_priv->rps.hw_lock);GEM_BUG_ON (val > dev_priv->rps.max_freq);GEM_BUG_ON (val < dev_priv->rps.min_freq);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 9/23 drm/i915/slpc: Allocate/Release/Initialize SLPC shared data
In reply to Sagar Arun KambleSLPC shared data is used to pass information to/from GuC SLPC. This has details of SKU type, Slice count, IA Perf MSR values, state etc.
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.
--- drivers/gpu/drm/i915/intel_slpc.c | 83 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 95 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+)
drivers/gpu/drm/i915/intel_slpc.c +83 -0
@@ -22,15 +22,98 @@* */ #include <linux/firmware.h> +#include <asm/msr-index.h> #include "i915_drv.h" #include "intel_uc.h" +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)) + platform_sku =SLPC_PLATFORM_SKU_ULX ; +else if (IS_SKL_ULT (dev_priv)) + platform_sku =SLPC_PLATFORM_SKU_ULT ; +else + platform_sku =SLPC_PLATFORM_SKU_DT ; + +WARN_ON (platform_sku >0xFF ); + +return platform_sku; +} + +static unsigned int slpc_get_slice_count (struct drm_i915_private *dev_priv) +{ +unsigned int slice_count =1 ; + +if (IS_SKYLAKE (dev_priv)) + slice_count =hweight8 (INTEL_INFO (dev_priv)->sseu.slice_mask); + +return slice_count; +} + +static void slpc_shared_data_init (struct drm_i915_private *dev_priv) +{ +struct page *page; +struct slpc_shared_data *data; +u64 val; + + page =i915_vma_first_page (dev_priv->guc.slpc.vma); + data =kmap_atomic (page); + +memset (data,0 ,sizeof (struct slpc_shared_data )); + + data->shared_data_size =sizeof (struct slpc_shared_data ); + data->global_state =SLPC_GLOBAL_STATE_NOT_RUNNING ; + data->platform_info.platform_sku = +slpc_get_platform_sku (dev_priv); + data->platform_info.slice_count = +slpc_get_slice_count (dev_priv); + data->platform_info.power_plan_source = +SLPC_POWER_PLAN_SOURCE (SLPC_POWER_PLAN_BALANCED , +SLPC_POWER_SOURCE_AC ); +rdmsrl (MSR_TURBO_RATIO_LIMIT , val); + data->platform_info.P0_freq = val; +rdmsrl (MSR_PLATFORM_INFO , val); + data->platform_info.P1_freq = val >>8 ; + data->platform_info.Pe_freq = val >>40 ; + data->platform_info.Pn_freq = val >>48 ; + +kunmap_atomic (data); +} +void intel_slpc_init (struct drm_i915_private *dev_priv) { +struct intel_guc *guc = &dev_priv->guc; +struct i915_vma *vma; + + dev_priv->guc.slpc.active = false; + +/* Allocate shared data structure */ + vma = dev_priv->guc.slpc.vma; +if (!vma) { + vma =intel_guc_allocate_vma (guc, +PAGE_ALIGN (sizeof (struct slpc_shared_data ))); +if (IS_ERR (vma)) { +DRM_ERROR ("slpc_shared_data allocation failed\n" ); + i915.enable_slpc =0 ; +return ; + } + + dev_priv->guc.slpc.vma = vma; + } + +slpc_shared_data_init (dev_priv); }void intel_slpc_cleanup (struct drm_i915_private *dev_priv) { +struct intel_guc *guc = &dev_priv->guc; + +/* Release shared data structure */ +mutex_lock (&dev_priv->drm.struct_mutex); +i915_vma_unpin_and_release (&guc->slpc.vma); +mutex_unlock (&dev_priv->drm.struct_mutex); }void intel_slpc_enable (struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/intel_slpc.h +95 -0
103 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 v6 10/23 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 | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +7 -0
@@ -1081,6 +1081,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 );
@@ -2268,6 +2271,10 @@ 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.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 v6 11/23 drm/i915/slpc: Add SLPC communication interfaces
In reply to Sagar Arun KambleCommunication with SLPC is via Host to GuC interrupt. This patch defines the 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.
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.
--- drivers/gpu/drm/i915/intel_slpc.h | 71 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+)
drivers/gpu/drm/i915/intel_slpc.h +71 -0
@@ -123,6 +123,77 @@ struct intel_slpc {struct i915_vma *vma; }; +#define SLPC_EVENT_MAX_INPUT_ARGS 7 +#define SLPC_EVENT_MAX_OUTPUT_ARGS 1 + +union slpc_event_input_header { +u32 value; +struct { +u32 num_args:8 ; +u32 event_id:8 ; + }; +}; + +struct slpc_event_input { +u32 h2g_action_id; +union slpc_event_input_header header; +u32 args[SLPC_EVENT_MAX_INPUT_ARGS ]; +} __packed; + +union slpc_event_output_header { +u32 value; +struct { +u32 num_args:8 ; +u32 event_id:8 ; +u32 status:16 ; + }; +}; + +struct slpc_event_output { +u32 reserved; +union slpc_event_output_header header; +u32 args[SLPC_EVENT_MAX_OUTPUT_ARGS ]; +} __packed; + +enum slpc_event_id { +SLPC_EVENT_RESET =0 , +SLPC_EVENT_SHUTDOWN =1 , +SLPC_EVENT_PLATFORM_INFO_CHANGE =2 , +SLPC_EVENT_DISPLAY_MODE_CHANGE =3 , +SLPC_EVENT_FLIP_COMPLETE =4 , +SLPC_EVENT_QUERY_TASK_STATE =5 , +SLPC_EVENT_PARAMETER_SET =6 , +SLPC_EVENT_PARAMETER_UNSET =7 , +}; + +#define SLPC_EVENT (id, argc) ((u32) (id) << 8 | (argc)) + +enum slpc_status { +SLPC_STATUS_OK =0 , +SLPC_STATUS_ERROR =1 , +SLPC_STATUS_ILLEGAL_COMMAND =2 , +SLPC_STATUS_INVALID_ARGS =3 , +SLPC_STATUS_INVALID_PARAMS =4 , +SLPC_STATUS_INVALID_DATA =5 , +SLPC_STATUS_OUT_OF_RANGE =6 , +SLPC_STATUS_NOT_SUPPORTED =7 , +SLPC_STATUS_NOT_IMPLEMENTED =8 , +SLPC_STATUS_NO_DATA =9 , +SLPC_STATUS_EVENT_NOT_REGISTERED =10 , +SLPC_STATUS_REGISTER_LOCKED =11 , +SLPC_STATUS_TEMPORARILY_UNAVAILABLE =12 , +SLPC_STATUS_VALUE_ALREADY_SET =13 , +SLPC_STATUS_VALUE_ALREADY_UNSET =14 , +SLPC_STATUS_VALUE_NOT_CHANGED =15 , +SLPC_STATUS_MEMIO_ERROR =16 , +SLPC_STATUS_EVENT_QUEUED_REQ_DPC =17 , +SLPC_STATUS_EVENT_QUEUED_NOREQ_DPC =18 , +SLPC_STATUS_NO_EVENT_QUEUED =19 , +SLPC_STATUS_OUT_OF_SPACE =20 , +SLPC_STATUS_TIMEOUT =21 , +SLPC_STATUS_NO_LOCK =22 , +}; +/* intel_slpc.c */ void intel_slpc_init (struct drm_i915_private *dev_priv);void intel_slpc_cleanup (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 v6 12/23 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)
--- drivers/gpu/drm/i915/intel_pm.c | 9 +++ drivers/gpu/drm/i915/intel_slpc.c | 137 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 4 ++ drivers/gpu/drm/i915/intel_uc.c | 21 +++++- drivers/gpu/drm/i915/intel_uc.h | 2 + 5 files changed, 172 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +9 -0
@@ -6941,6 +6941,15 @@ 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); +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 +137 -0
149 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h +4 -0
@@ -195,6 +195,10 @@ enum slpc_status { };/* intel_slpc.c */ +void intel_slpc_read_shared_data (struct drm_i915_private *dev_priv, +struct slpc_shared_data *data); +const char *intel_slpc_get_state_str (enum slpc_global_state state); +bool intel_slpc_get_status (struct drm_i915_private *dev_priv);void intel_slpc_init (struct drm_i915_private *dev_priv);void intel_slpc_cleanup (struct drm_i915_private *dev_priv);void intel_slpc_enable (struct drm_i915_private *dev_priv);
drivers/gpu/drm/i915/intel_uc.c +20 -1
@@ -228,9 +228,11 @@ static bool intel_guc_recv(struct intel_guc *guc, u32 *status)return INTEL_GUC_RECV_IS_RESPONSE (val); } -int intel_guc_send (struct intel_guc *guc,const u32 *action,u32 len) +int __intel_guc_send (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;
@@ -277,12 +279,29 @@ int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len) } dev_priv->guc.action_status = status; +/* +* 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,FORCEWAKE_ALL );mutex_unlock (&guc->send_mutex);return ret; } +int intel_guc_send (struct intel_guc *guc,const u32 *action,u32 len) +{ +return __intel_guc_send (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_uc.h +2 -0
@@ -193,6 +193,8 @@ struct intel_huc {int intel_uc_init_hw (struct drm_i915_private *dev_priv);void intel_uc_prepare_fw (struct drm_i915_private *dev_priv,struct intel_uc_fw *uc_fw); +int __intel_guc_send (struct intel_guc *guc,const u32 *action,u32 len, +u32 *output);int intel_guc_send (struct intel_guc *guc,const u32 *action,u32 len);int intel_guc_sample_forcewake (struct intel_guc *guc);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 13/23 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)
--- drivers/gpu/drm/i915/intel_slpc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/gpu/drm/i915/intel_slpc.c +16 -0
@@ -132,6 +132,18 @@ static void host2guc_slpc_query_task_state(struct drm_i915_private *dev_priv)host2guc_slpc (dev_priv, &data,4 ); } +static void host2guc_slpc_shutdown (struct drm_i915_private *dev_priv) +{ +struct slpc_event_input data = {0 }; +u32 shared_data_gtt_offset =i915_ggtt_offset (dev_priv->guc.slpc.vma); + + data.header.value =SLPC_EVENT (SLPC_EVENT_SHUTDOWN ,2 ); + data.args[0 ] = shared_data_gtt_offset; + data.args[1 ] =0 ; + +host2guc_slpc (dev_priv, &data,4 ); +} +void intel_slpc_query_task_state (struct drm_i915_private *dev_priv) {if (dev_priv->guc.slpc.active)
@@ -259,8 +271,12 @@ void intel_slpc_enable(struct drm_i915_private *dev_priv)void intel_slpc_suspend (struct drm_i915_private *dev_priv) { +host2guc_slpc_shutdown (dev_priv); + dev_priv->guc.slpc.active = false; }void intel_slpc_disable (struct drm_i915_private *dev_priv) { +host2guc_slpc_shutdown (dev_priv); + dev_priv->guc.slpc.active = false; }
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 14/23 drm/i915/slpc: Add parameter set/unset/get 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 add parameter values and events for setting/unsetting parameters.
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.
--- drivers/gpu/drm/i915/intel_slpc.c | 104 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 29 +++++++++++ 2 files changed, 133 insertions(+)
drivers/gpu/drm/i915/intel_slpc.c +104 -0
@@ -52,6 +52,23 @@ static unsigned int slpc_get_slice_count(struct drm_i915_private *dev_priv)return slice_count; } +void slpc_mem_set_param (struct slpc_shared_data *data, +u32 id, +u32 value) +{ + data->override_parameters_set_bits[id >>5 ] + |= (1 << (id %32 )); + data->override_parameters_values[id] = value; +} + +void slpc_mem_unset_param (struct slpc_shared_data *data, +u32 id) +{ + data->override_parameters_set_bits[id >>5 ] + &= (~(1 << (id %32 ))); + data->override_parameters_values[id] =0 ; +} +static void slpc_shared_data_init (struct drm_i915_private *dev_priv) {struct page *page;
@@ -144,6 +161,29 @@ static void host2guc_slpc_shutdown(struct drm_i915_private *dev_priv)host2guc_slpc (dev_priv, &data,4 ); } +static void host2guc_slpc_set_param (struct drm_i915_private *dev_priv, +u32 id,u32 value) +{ +struct slpc_event_input data = {0 }; + + data.header.value =SLPC_EVENT (SLPC_EVENT_PARAMETER_SET ,2 ); + data.args[0 ] = id; + data.args[1 ] = value; + +host2guc_slpc (dev_priv, &data,4 ); +} + +static void host2guc_slpc_unset_param (struct drm_i915_private *dev_priv, +u32 id) +{ +struct slpc_event_input data = {0 }; + + data.header.value =SLPC_EVENT (SLPC_EVENT_PARAMETER_UNSET ,1 ); + data.args[0 ] = id; + +host2guc_slpc (dev_priv, &data,3 ); +} +void intel_slpc_query_task_state (struct drm_i915_private *dev_priv) {if (dev_priv->guc.slpc.active)
@@ -221,6 +261,70 @@ bool intel_slpc_get_status(struct drm_i915_private *dev_priv)return ret; } +void intel_slpc_set_param (struct drm_i915_private *dev_priv, +u32 id, +u32 value) +{ +struct page *page; +struct slpc_shared_data *data =NULL ; + +WARN_ON (id >=SLPC_MAX_PARAM ); + +if (!dev_priv->guc.slpc.vma) +return ; + + page =i915_vma_first_page (dev_priv->guc.slpc.vma); + data =kmap_atomic (page); +slpc_mem_set_param (data, id, value); +kunmap_atomic (data); + +host2guc_slpc_set_param (dev_priv, id, value); +} + +void intel_slpc_unset_param (struct drm_i915_private *dev_priv, +u32 id) +{ +struct page *page; +struct slpc_shared_data *data =NULL ; + +WARN_ON (id >=SLPC_MAX_PARAM ); + +if (!dev_priv->guc.slpc.vma) +return ; + + page =i915_vma_first_page (dev_priv->guc.slpc.vma); + data =kmap_atomic (page); +slpc_mem_unset_param (data, id); +kunmap_atomic (data); + +host2guc_slpc_unset_param (dev_priv, id); +} + +void intel_slpc_get_param (struct drm_i915_private *dev_priv, +u32 id, +int *overriding,u32 *value) +{ +struct page *page; +struct slpc_shared_data *data =NULL ; +u32 bits; + +WARN_ON (id >=SLPC_MAX_PARAM ); + +if (!dev_priv->guc.slpc.vma) +return ; + + page =i915_vma_first_page (dev_priv->guc.slpc.vma); + data =kmap_atomic (page); +if (overriding) { + bits = data->override_parameters_set_bits[id >>5 ]; + *overriding = (0 != (bits & (1 << (id %32 )))); + } +if (value) + *value = data->override_parameters_values[id]; + +kunmap_atomic (data); +} +void intel_slpc_init (struct drm_i915_private *dev_priv) {struct intel_guc *guc = &dev_priv->guc;
drivers/gpu/drm/i915/intel_slpc.h +29 -0
@@ -194,11 +194,40 @@ enum slpc_status { SLPC_STATUS_NO_LOCK = 22, }; +enum slpc_param_id { +SLPC_PARAM_TASK_ENABLE_GTPERF =0 , +SLPC_PARAM_TASK_DISABLE_GTPERF =1 , +SLPC_PARAM_TASK_ENABLE_BALANCER =2 , +SLPC_PARAM_TASK_DISABLE_BALANCER =3 , +SLPC_PARAM_TASK_ENABLE_DCC =4 , +SLPC_PARAM_TASK_DISABLE_DCC =5 , +SLPC_PARAM_GLOBAL_MIN_GT_UNSLICE_FREQ_MHZ =6 , +SLPC_PARAM_GLOBAL_MAX_GT_UNSLICE_FREQ_MHZ =7 , +SLPC_PARAM_GLOBAL_MIN_GT_SLICE_FREQ_MHZ =8 , +SLPC_PARAM_GLOBAL_MAX_GT_SLICE_FREQ_MHZ =9 , +SLPC_PARAM_GTPERF_THRESHOLD_MAX_FPS =10 , +SLPC_PARAM_GLOBAL_DISABLE_GT_FREQ_MANAGEMENT =11 , +SLPC_PARAM_GTPERF_ENABLE_FRAMERATE_STALLING =12 , +SLPC_PARAM_GLOBAL_DISABLE_RC6_MODE_CHANGE =13 , +SLPC_PARAM_GLOBAL_OC_UNSLICE_FREQ_MHZ =14 , +SLPC_PARAM_GLOBAL_OC_SLICE_FREQ_MHZ =15 , +SLPC_PARAM_GLOBAL_ENABLE_IA_GT_BALANCING =16 , +SLPC_PARAM_GLOBAL_ENABLE_ADAPTIVE_BURST_TURBO =17 , +SLPC_PARAM_GLOBAL_ENABLE_EVAL_MODE =18 , +SLPC_PARAM_GLOBAL_ENABLE_BALANCER_IN_NON_GAMING_MODE =19 , +SLPC_MAX_PARAM , +SLPC_KMD_MAX_PARAM =32 , +}; +/* intel_slpc.c */ void intel_slpc_read_shared_data (struct drm_i915_private *dev_priv,struct slpc_shared_data *data);const char *intel_slpc_get_state_str (enum slpc_global_state state);bool intel_slpc_get_status (struct drm_i915_private *dev_priv); +void intel_slpc_set_param (struct drm_i915_private *dev_priv,u32 id,u32 value); +void intel_slpc_unset_param (struct drm_i915_private *dev_priv,u32 id); +void intel_slpc_get_param (struct drm_i915_private *dev_priv,u32 id, +int *overriding,u32 *value);void intel_slpc_init (struct drm_i915_private *dev_priv);void intel_slpc_cleanup (struct drm_i915_private *dev_priv);void intel_slpc_enable (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 v6 15/23 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 names.
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:
"revert <id>" > i915_slpc_param_ctl; cat 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 | 198 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 13 +++ 3 files changed, 230 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +19 -0
@@ -2382,6 +2382,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 name\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);
@@ -4760,6 +4777,7 @@ static int i915_hpd_storm_ctl_open(struct inode *inode, struct file *file) {"i915_guc_load_status", i915_guc_load_status_info, 0}, {"i915_guc_log_dump", i915_guc_log_dump, 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_drpc_info", i915_drpc_info, 0},
@@ -4822,6 +4840,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 +198 -0
204 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h +13 -0
@@ -121,6 +121,9 @@ struct slpc_shared_data {struct intel_slpc {bool active;struct i915_vma *vma; +u32 debug_param_id; +u32 debug_param_value; +u32 debug_param_override; };#define SLPC_EVENT_MAX_INPUT_ARGS 7
@@ -219,6 +222,16 @@ enum slpc_param_id { SLPC_KMD_MAX_PARAM = 32, }; +/* Structures for exposing parameter details to user. */ +#define MAX_PARAM_DESCRIPTION_SIZE 160 +struct slpc_param { +enum slpc_param_id id; +char description[MAX_PARAM_DESCRIPTION_SIZE ]; +}; + +extern struct slpc_param slpc_paramlist[]; +extern const struct file_operations i915_slpc_param_ctl_fops; +/* intel_slpc.c */ void intel_slpc_read_shared_data (struct drm_i915_private *dev_priv,struct slpc_shared_data *data);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 16/23 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 | 55 +++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 6 ++++ 4 files changed, 133 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +42 -4
@@ -4319,7 +4319,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 ; }
@@ -4335,20 +4340,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, 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 ; }
@@ -4359,6 +4376,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 ; }
@@ -4374,7 +4393,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 ; }
@@ -4390,21 +4414,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, 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 ; }
@@ -4415,6 +4451,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
@@ -351,9 +351,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,
@@ -374,6 +379,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, 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) {
@@ -408,9 +420,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,
@@ -431,6 +448,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, 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 +55 -0
73 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h +6 -0
@@ -124,6 +124,10 @@ struct intel_slpc {u32 debug_param_id;u32 debug_param_value;u32 debug_param_override; + +/* i915 cached SLPC frequency limits */ +u32 min_unslice_freq; +u32 max_unslice_freq; };#define SLPC_EVENT_MAX_INPUT_ARGS 7
@@ -241,6 +245,8 @@ void intel_slpc_read_shared_data(struct drm_i915_private *dev_priv,void intel_slpc_unset_param (struct drm_i915_private *dev_priv,u32 id);void intel_slpc_get_param (struct drm_i915_private *dev_priv,u32 id,int *overriding,u32 *value); +int intel_slpc_max_freq_set (struct drm_i915_private *dev_priv,u32 val); +int intel_slpc_min_freq_set (struct drm_i915_private *dev_priv,u32 val);void intel_slpc_init (struct drm_i915_private *dev_priv);void intel_slpc_cleanup (struct drm_i915_private *dev_priv);void intel_slpc_enable (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 v6 17/23 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 | 277 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_slpc.h | 12 ++ 3 files changed, 292 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +3 -0
@@ -4858,6 +4858,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 +277 -0
295 lines not on this page · raw message
drivers/gpu/drm/i915/intel_slpc.h +12 -0
@@ -235,6 +235,14 @@ struct slpc_param {extern struct slpc_param slpc_paramlist[];extern 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; + +#define SLPC_PARAM_TASK_DEFAULT 0 +#define SLPC_PARAM_TASK_ENABLED 1 +#define SLPC_PARAM_TASK_DISABLED 2 +#define SLPC_PARAM_TASK_UNKNOWN 3/* intel_slpc.c */ void intel_slpc_read_shared_data(struct drm_i915_private *dev_priv,
@@ -247,6 +255,10 @@ void intel_slpc_get_param(struct drm_i915_private *dev_priv, u32 id, int *overriding, u32 *value);int intel_slpc_max_freq_set (struct drm_i915_private *dev_priv,u32 val);int intel_slpc_min_freq_set (struct drm_i915_private *dev_priv,u32 val); +int intel_slpc_task_control (struct drm_i915_private *dev_priv,u64 val, +u32 enable_id,u32 disable_id); +int intel_slpc_task_status (struct drm_i915_private *dev_priv,u64 *val, +u32 enable_id,u32 disable_id);void intel_slpc_init (struct drm_i915_private *dev_priv);void intel_slpc_cleanup (struct drm_i915_private *dev_priv);void intel_slpc_enable (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 v6 18/23 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
@@ -1074,6 +1074,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, &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);
@@ -4816,6 +4980,7 @@ static int i915_hpd_storm_ctl_open(struct inode *inode, struct file *file) {"i915_guc_log_dump", i915_guc_log_dump, 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_drpc_info", i915_drpc_info, 0},
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 19/23 drm/i915/slpc: Set default values for tasks and min frequency parameters
In reply to Sagar Arun Kamblev1: Updated tasks and frequency post reset.
Added DFPS param update for MAX_FPS and FPS Stall.
v2-v3: Rebase.
v4: Updated with GuC firmware v9.
v5: Rebase. Replaced H2G interrupts for parameter override with memory
setup with required parameters.
v6: Moved task override to intel_slpc_init. Added override of min frequency
to Rpe. Commit subject update.
--- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_pm.c | 2 +- drivers/gpu/drm/i915/intel_slpc.c | 46 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -1816,6 +1816,7 @@ bool chv_phy_powergate_ch(struct drm_i915_private *dev_priv, enum dpio_phy phy,void gen6_rps_boost (struct drm_i915_private *dev_priv,struct intel_rps_client *rps,unsigned long submitted); +void gen6_init_rps_frequencies (struct drm_i915_private *dev_priv);void intel_queue_rps_boost_for_request (struct drm_i915_gem_request *req);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
@@ -5569,7 +5569,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 +46 -0
58 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 v6 19/23] drm/i915/slpc: Set default values for tasks and min frequency parameters
drivers/gpu/drm/i915/intel_slpc.c void intel_slpc_init(struct drm_i915_private *dev_priv) · line 909
Quoted 7 lines · Sagar Arun Kamble
drivers/gpu/drm/i915/intel_slpc.c +3
-0@@ -862,6 +904,10 @@ void intel_slpc_init(struct drm_i915_private *dev_priv) dev_priv->guc.slpc.active = false; +mutex_lock (&dev_priv->rps.hw_lock); +gen6_init_rps_frequencies (dev_priv); +mutex_unlock (&dev_priv->rps.hw_lock);
Maybe you shouldn't have broken it earlier?
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v6 19/23] drm/i915/slpc: Set default values for tasks and min frequency parameters
Quoted 10 lines · Chris Wilson
drivers/gpu/drm/i915/intel_slpc.c void intel_slpc_init(struct drm_i915_private *dev_priv) · line 909
Quoted 7 lines · Sagar Arun Kamble
drivers/gpu/drm/i915/intel_slpc.c +3
-0@@ -862,6 +904,10 @@ void intel_slpc_init(struct drm_i915_private *dev_priv) dev_priv->guc.slpc.active = false; +mutex_lock (&dev_priv->rps.hw_lock); +gen6_init_rps_frequencies (dev_priv); +mutex_unlock (&dev_priv->rps.hw_lock);Maybe you shouldn't have broken it earlier?
-Chris
This change is to override SLPC defaults so tasks that are not needed are marked OFF and frequency limits are set with min=Rpe Should i move this change to below commit:
drm/i915/slpc: Allocate/Release/Initialize SLPC shared data
Quoted 1 line
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 20/23 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 | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/i915_pci.c +2 -0
@@ -352,6 +352,7 @@ .gen = 9, .has_csr = 1, .has_guc = 1, + .has_slpc = 1, .ddb_size = 896, };
@@ -361,6 +362,7 @@ .gen = 9, .has_csr = 1, .has_guc = 1, + .has_slpc = 1, .ddb_size = 896, .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING, };
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 21/23 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 v6 22/23 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 | 2 ++ drivers/gpu/drm/i915/intel_slpc.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_pci.c +2 -0
@@ -416,6 +416,7 @@ .gen = 9, .has_csr = 1, .has_guc = 1, + .has_slpc = 1, .ddb_size = 896, };
@@ -425,6 +426,7 @@ .gen = 9, .has_csr = 1, .has_guc = 1, + .has_slpc = 1, .ddb_size = 896, .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING, };
drivers/gpu/drm/i915/intel_slpc.c +2 -2
@@ -411,9 +411,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
PATCH v6 23/23 drm/i915/slpc: Enable SLPC, where supported
In reply to Sagar Arun KambleFrom: Tom O'Rourke <Tom.O'[email protected]>
This patch makes SLPC enabled by default on
platforms with hardware/firmware support.
v1: Removing warning "enable_slpc < 0" as it is set to -1 with this patch now. This was caught by CI BAT.
v2-v4: Rebase.
v5: Sanitizing SLPC option based on capabilities earlier in driver load for handling uncore sanitization properly.
Testcase: igt/pm_slpc
--- drivers/gpu/drm/i915/i915_params.c | 4 ++-- drivers/gpu/drm/i915/intel_uc.c | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_params.c +2 -2
@@ -36,7 +36,7 @@ struct i915_params i915 __read_mostly = { .enable_dc = -1, .enable_fbc = -1, .enable_execlists = -1, - .enable_slpc = 0, + .enable_slpc = -1, .enable_hangcheck = true, .enable_ppgtt = -1, .enable_psr = -1,
@@ -146,7 +146,7 @@ struct i915_params i915 __read_mostly = {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)" ); +"(-1=auto [default], 0=disabled, 1=enabled)" );module_param_named_unsafe (enable_psr, i915.enable_psr, int,0600 ); MODULE_PARM_DESC(enable_psr, "Enable PSR "
drivers/gpu/drm/i915/intel_uc.c +9 -0
@@ -74,6 +74,15 @@ void intel_uc_sanitize_options(struct drm_i915_private *dev_priv)if (intel_guc_select_fw (&dev_priv->guc)) i915.enable_guc_loading =0 ; } + +/* +* SLPC runs in GuC and hence depends on GuC parameters. For platforms +* with GuC, this option will be sanitized further in intel_guc_init. +* Sanitize here for all platforms so that gt_powersave/sanitize +* routines get to know whether SLPC or RPS is going to be operational. +*/ +if (i915.enable_slpc <0 ) + i915.enable_slpc =HAS_SLPC (dev_priv); }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
Re: [PATCH v6 23/23] drm/i915/slpc: Enable SLPC, where supported
Quoted 4 lines · Sagar Arun Kamble
From: Tom O'Rourke <Tom.O'[email protected]>
This patch makes SLPC enabled by default on
platforms with hardware/firmware support.
Still requires justification here.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for Add support for GuC-based SLPC (rev8)
In reply to Sagar Arun Kamble== Series Details ==
== Series Details ==
Series: Add support for GuC-based SLPC (rev8)
URL : https://patchwork.freedesktop.org/series/2691/
State : success
== Summary ==
Series 2691v8 Add support for GuC-based SLPC
https://patchwork.freedesktop.org/api/1.0/series/2691/revisions/8/mbox/
Test gem_exec_fence:
Subgroup await-hang-default:
pass -> INCOMPLETE (fi-hsw-4770) fdo#99726fdo#99726 https://bugs.freedesktop.org/show_bug.cgi?id=99726
fi-bdw-5557u total:278 pass:267 dwarn:0 dfail:0 fail:0 skip:11 time: 456s fi-bsw-n3050 total:278 pass:239 dwarn:0 dfail:0 fail:0 skip:39 time: 572s fi-bxt-j4205 total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time: 536s fi-bxt-t5700 total:278 pass:258 dwarn:0 dfail:0 fail:0 skip:20 time: 555s fi-byt-j1900 total:278 pass:251 dwarn:0 dfail:0 fail:0 skip:27 time: 501s fi-byt-n2820 total:278 pass:247 dwarn:0 dfail:0 fail:0 skip:31 time: 495s fi-hsw-4770 total:48 pass:41 dwarn:0 dfail:0 fail:0 skip:6 time: 0s fi-hsw-4770r total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 434s fi-ilk-650 total:278 pass:228 dwarn:0 dfail:0 fail:0 skip:50 time: 434s fi-ivb-3520m total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 513s fi-ivb-3770 total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 492s fi-kbl-7500u total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 481s fi-skl-6260u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 475s fi-skl-6700hq total:278 pass:261 dwarn:0 dfail:0 fail:0 skip:17 time: 595s fi-skl-6700k total:278 pass:256 dwarn:4 dfail:0 fail:0 skip:18 time: 479s fi-skl-6770hq total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 519s fi-snb-2520m total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time: 556s fi-snb-2600 total:278 pass:249 dwarn:0 dfail:0 fail:0 skip:29 time: 419s
da5a30c70988b681c2a75b81d283bc66470a2216 drm-tip: 2017y-03m-16d-16h-30m-22s UTC integration manifest 9acf394 drm/i915/slpc: Add Kabylake SLPC support
4b07dfa drm/i915/slpc: Add Broxton SLPC support
4c4de0b drm/i915/slpc: Add SKL SLPC Support
bb41c7b drm/i915/slpc: Set default values for tasks and min frequency parameters cf174b9 drm/i915/slpc: Add i915_slpc_info to debugfs
f26a771 drm/i915/slpc: Add enable/disable controls for SLPC tasks
00a0df9 drm/i915/slpc: Add support for min/max frequency control
5c1cf98 drm/i915/slpc: Add debugfs support to read/write/revert the parameters b6f17da drm/i915/slpc: Add parameter set/unset/get functions
74b6b8a drm/i915/slpc: Send SHUTDOWN event
aecaea4 drm/i915/slpc: Send RESET event to enable SLPC
7e9b093 drm/i915/slpc: Add SLPC communication interfaces
ae088eb drm/i915/slpc: Add SLPC banner to RPS debugfs interfaces.
8629df0 drm/i915/slpc: Allocate/Release/Initialize SLPC shared data
199d0f4 drm/i915/slpc: If using SLPC, do not set frequency
c585c1e drm/i915/slpc: Enable SLPC in GuC if supported
5f1a21e drm/i915/slpc: Use intel_slpc_* functions if supported
689ffb4 drm/i915/slpc: Sanitize GuC version
3f19965 drm/i915/slpc: Add enable_slpc module parameter
aec2f27 drm/i915/slpc: Add has_slpc capability flag
73f2a58 drm/i915/gen9: Separate RPS and RC6 handling
4239137 drm/i915/debugfs: Create generic string tokenize function and update CRC control parsing
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4208/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx