Skip to contentSkip to conversation

drm/i915: Add i915.enable_sagv modparam

PATCH In review Ville Syrjala 3 participants 7 messages Mar 22, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Add i915.enable_sagv modparam

From: Ville Syrjälä <[email protected]>

Currently we have no sane way to forcibly disable SAGV, which makes debugging things a PITA. Manually poking at the pcode mailbox with it's various SAGV/QGV/PSF formats is no fun, and likely to be clobbered by the driver anyway.

Let's add a modparam for this.

---
 drivers/gpu/drm/i915/display/skl_watermark.c | 4 ++++
 drivers/gpu/drm/i915/i915_params.c           | 3 +++
 drivers/gpu/drm/i915/i915_params.h           | 1 +
 3 files changed, 8 insertions(+)
drivers/gpu/drm/i915/display/skl_watermark.c +4 -0
index 50a9a6adbe32..ff70225c0263 100644
@@ -411,6 +411,9 @@ static bool intel_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
 
+	if (!i915->params.enable_sagv)
+		return false;
+
 	if (DISPLAY_VER(i915) >= 12)
 		return tgl_crtc_can_enable_sagv(crtc_state);
 	else
@@ -3696,6 +3699,7 @@ static int intel_sagv_status_show(struct seq_file *m, void *unused)
 	};
 
 	seq_printf(m, "SAGV available: %s\n", str_yes_no(intel_has_sagv(i915)));
+	seq_printf(m, "SAGV modparam: %s\n", str_enabled_disabled(i915->params.enable_sagv));
 	seq_printf(m, "SAGV status: %s\n", sagv_status[i915->display.sagv.status]);
 	seq_printf(m, "SAGV block time: %d usec\n", i915->display.sagv.block_time_us);
 
drivers/gpu/drm/i915/i915_params.c +3 -0
index ade744cccfea..66141906ea05 100644
@@ -121,6 +121,9 @@ i915_param_named_unsafe(enable_psr2_sel_fetch, bool, 0400,
 	"(0=disabled, 1=enabled) "
 	"Default: 0");
 
+i915_param_named_unsafe(enable_sagv, bool, 0600,
+	"Enable system agent voltage/frequency scaling (SAGV) (default: true)");
+
 i915_param_named_unsafe(force_probe, charp, 0400,
 	"Force probe options for specified supported devices. "
 	"See CONFIG_DRM_I915_FORCE_PROBE for details.");
drivers/gpu/drm/i915/i915_params.h +1 -0
index 3f51f90145b6..6798b5c2363d 100644
@@ -56,6 +56,7 @@ struct drm_printer;
 	param(int, enable_psr, -1, 0600) \
 	param(bool, psr_safest_params, false, 0400) \
 	param(bool, enable_psr2_sel_fetch, true, 0400) \
+	param(bool, enable_sagv, true, 0600) \
 	param(int, disable_power_well, -1, 0400) \
 	param(int, enable_ips, 1, 0600) \
 	param(int, invert_brightness, 0, 0600) \
Signature · 1 line
2.39.2
#1 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add i915.enable_sagv modparam

== Series Details ==

== Series Details ==

Series: drm/i915: Add i915.enable_sagv modparam
URL : https://patchwork.freedesktop.org/series/115523/
State : warning

== Summary ==

Error: dim checkpatch failed
0c284872ae1b drm/i915: Add i915.enable_sagv modparam
-:49: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #49: FILE: drivers/gpu/drm/i915/i915_params.c:125:
+i915_param_named_unsafe(enable_sagv, bool, 0600,
+ "Enable system agent voltage/frequency scaling (SAGV) (default: true)");

total: 0 errors, 0 warnings, 1 checks, 32 lines checked

#3 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Add i915.enable_sagv modparam

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: drm/i915: Add i915.enable_sagv modparam
URL : https://patchwork.freedesktop.org/series/115523/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12898 -> Patchwork_115523v1
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_115523v1 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_115523v1, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/index.html

Participating hosts (37 -> 36)
------------------------------

Missing (1): fi-snb-2520m

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_115523v1:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@slpc:
- bat-dg2-11: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12898/bat-dg2-11/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-dg2-11/igt@i915_selftest@[email protected]

* igt@kms_pipe_crc_basic@compare-crc-sanitycheck@pipe-d-dp-1:
- bat-dg2-8: [PASS][3] -> [FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12898/bat-dg2-8/igt@kms_pipe_crc_basic@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-dg2-8/igt@kms_pipe_crc_basic@[email protected]

Known issues
------------

Here are the changes found in Patchwork_115523v1 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live@mman:
- bat-rpls-2: [PASS][5] -> [TIMEOUT][6] ([i915#6794])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12898/bat-rpls-2/igt@i915_selftest@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-rpls-2/igt@i915_selftest@[email protected]
- bat-rpls-1: [PASS][7] -> [TIMEOUT][8] ([i915#6794])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12898/bat-rpls-1/igt@i915_selftest@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-rpls-1/igt@i915_selftest@[email protected]

* igt@kms_chamelium_hpd@common-hpd-after-suspend:
- bat-rpls-2: NOTRUN -> [SKIP][9] ([i915#7828])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-rpls-2/igt@[email protected]
- bat-jsl-3: NOTRUN -> [SKIP][10] ([i915#7828])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-jsl-3/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence:
- bat-dg2-11: NOTRUN -> [SKIP][11] ([i915#5354]) +1 similar issue
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-dg2-11/igt@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc:
- bat-rpls-2: NOTRUN -> [SKIP][12] ([i915#1845])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-rpls-2/igt@[email protected]

#### Possible fixes ####

* igt@i915_pm_rpm@module-reload:
- bat-jsl-3: [INCOMPLETE][13] -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12898/bat-jsl-3/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-jsl-3/igt@[email protected]

* igt@i915_pm_rps@basic-api:
- bat-dg2-11: [FAIL][15] -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12898/bat-dg2-11/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-dg2-11/igt@[email protected]

* igt@i915_selftest@live@gt_heartbeat:
- {bat-kbl-2}: [DMESG-FAIL][17] ([i915#7872]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12898/bat-kbl-2/igt@i915_selftest@live@gt_heartbeat.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-kbl-2/igt@i915_selftest@live@gt_heartbeat.html
- fi-glk-j4005: [DMESG-FAIL][19] ([i915#5334]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12898/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html

* igt@i915_selftest@live@gt_pm:
- fi-tgl-1115g4: [DMESG-WARN][21] ([i915#2867]) -> [PASS][22] +16 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12898/fi-tgl-1115g4/igt@i915_selftest@live@gt_pm.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/fi-tgl-1115g4/igt@i915_selftest@live@gt_pm.html

* igt@i915_suspend@basic-s2idle-without-i915:
- fi-tgl-1115g4: [DMESG-WARN][23] -> [PASS][24] +1 similar issue
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12898/fi-tgl-1115g4/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/fi-tgl-1115g4/igt@[email protected]
- bat-rpls-2: [ABORT][25] -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12898/bat-rpls-2/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/bat-rpls-2/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#6794]: https://gitlab.freedesktop.org/drm/intel/issues/6794
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7872]: https://gitlab.freedesktop.org/drm/intel/issues/7872

Build changes
-------------

* Linux: CI_DRM_12898 -> Patchwork_115523v1

CI-20190529: 20190529
CI_DRM_12898: 9a9dac47731f0f0b37f2aa741f92984d2e42f830 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7211: c0cc1de7b2f4041ca68960362aa55f881d416bac @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_115523v1: 9a9dac47731f0f0b37f2aa741f92984d2e42f830 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

b0fa2550c37a drm/i915: Add i915.enable_sagv modparam

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115523v1/index.html

maintainer Reviewed-by on v1 1/1
#4 lore raw
In reply to Ville Syrjala
Quoted 21 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have no sane way to forcibly disable SAGV, which makes debugging things a PITA. Manually poking at the pcode mailbox with it's various SAGV/QGV/PSF formats is no fun, and likely to be clobbered by the driver anyway.

Let's add a modparam for this.

---
 drivers/gpu/drm/i915/display/skl_watermark.c | 4 ++++
 drivers/gpu/drm/i915/i915_params.c           | 3 +++
 drivers/gpu/drm/i915/i915_params.h           | 1 +
 3 files changed, 8 insertions(+)
drivers/gpu/drm/i915/display/skl_watermark.c +0 -0
index 50a9a6adbe32..ff70225c0263 100644

drivers/gpu/drm/i915/display/skl_watermark.c static bool intel_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state · line 415

Quoted 5 lines
drivers/gpu/drm/i915/display/skl_watermark.c +2 -0
@@ -411,6 +411,9 @@ static bool intel_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
 
+	if (!i915->params.enable_sagv)
+		return false;

would this be one more ifdef for xe?
should we hide this on a HAS_SAGV?

anyway, let's move on:

Quoted 41 lines
drivers/gpu/drm/i915/display/skl_watermark.c +2 -0
+
 	if (DISPLAY_VER(i915) >= 12)
 		return tgl_crtc_can_enable_sagv(crtc_state);
 	else
@@ -3696,6 +3699,7 @@ static int intel_sagv_status_show(struct seq_file *m, void *unused)
 	};
 
 	seq_printf(m, "SAGV available: %s\n", str_yes_no(intel_has_sagv(i915)));
+	seq_printf(m, "SAGV modparam: %s\n", str_enabled_disabled(i915->params.enable_sagv));
 	seq_printf(m, "SAGV status: %s\n", sagv_status[i915->display.sagv.status]);
 	seq_printf(m, "SAGV block time: %d usec\n", i915->display.sagv.block_time_us);
 
drivers/gpu/drm/i915/i915_params.c +3 -0
index ade744cccfea..66141906ea05 100644
@@ -121,6 +121,9 @@ i915_param_named_unsafe(enable_psr2_sel_fetch, bool, 0400,
 	"(0=disabled, 1=enabled) "
 	"Default: 0");
 
+i915_param_named_unsafe(enable_sagv, bool, 0600,
+	"Enable system agent voltage/frequency scaling (SAGV) (default: true)");
+
 i915_param_named_unsafe(force_probe, charp, 0400,
 	"Force probe options for specified supported devices. "
 	"See CONFIG_DRM_I915_FORCE_PROBE for details.");
drivers/gpu/drm/i915/i915_params.h +1 -0
index 3f51f90145b6..6798b5c2363d 100644
@@ -56,6 +56,7 @@ struct drm_printer;
 	param(int, enable_psr, -1, 0600) \
 	param(bool, psr_safest_params, false, 0400) \
 	param(bool, enable_psr2_sel_fetch, true, 0400) \
+	param(bool, enable_sagv, true, 0600) \
 	param(int, disable_power_well, -1, 0400) \
 	param(int, enable_ips, 1, 0600) \
 	param(int, invert_brightness, 0, 0600) \
Signature · 1 line
2.39.2
#5 lore raw
Quoted 25 lines · Rodrigo Vivi
Quoted 24 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have no sane way to forcibly disable SAGV, which makes debugging things a PITA. Manually poking at the pcode mailbox with it's various SAGV/QGV/PSF formats is no fun, and likely to be clobbered by the driver anyway.

Let's add a modparam for this.

---
 drivers/gpu/drm/i915/display/skl_watermark.c | 4 ++++
 drivers/gpu/drm/i915/i915_params.c           | 3 +++
 drivers/gpu/drm/i915/i915_params.h           | 1 +
 3 files changed, 8 insertions(+)
drivers/gpu/drm/i915/display/skl_watermark.c +0 -0
index 50a9a6adbe32..ff70225c0263 100644
@@ -411,6 +411,9 @@ static bool intel_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
 
Quoted 4 lines

drivers/gpu/drm/i915/display/skl_watermark.c static bool intel_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state · line 415

Quoted 2 lines
drivers/gpu/drm/i915/display/skl_watermark.c +2 -0
+	if (!i915->params.enable_sagv)
+		return false;

would this be one more ifdef for xe?

Why? xe needs it just as much.

Quoted 1 line

should we hide this on a HAS_SAGV?

If we have no sagv then we're not going to enable sagv anyway. Doesn't matter if it's blocked a few lines earlier by the modparam rather than falling through to checking the other stuff.

Quoted 4 lines

anyway, let's move on:

Thanks

Quoted 43 lines
Quoted 43 lines
drivers/gpu/drm/i915/display/skl_watermark.c +2 -0
+
 	if (DISPLAY_VER(i915) >= 12)
 		return tgl_crtc_can_enable_sagv(crtc_state);
 	else
@@ -3696,6 +3699,7 @@ static int intel_sagv_status_show(struct seq_file *m, void *unused)
 	};
 
 	seq_printf(m, "SAGV available: %s\n", str_yes_no(intel_has_sagv(i915)));
+	seq_printf(m, "SAGV modparam: %s\n", str_enabled_disabled(i915->params.enable_sagv));
 	seq_printf(m, "SAGV status: %s\n", sagv_status[i915->display.sagv.status]);
 	seq_printf(m, "SAGV block time: %d usec\n", i915->display.sagv.block_time_us);
 
drivers/gpu/drm/i915/i915_params.c +3 -0
index ade744cccfea..66141906ea05 100644
@@ -121,6 +121,9 @@ i915_param_named_unsafe(enable_psr2_sel_fetch, bool, 0400,
 	"(0=disabled, 1=enabled) "
 	"Default: 0");
 
+i915_param_named_unsafe(enable_sagv, bool, 0600,
+	"Enable system agent voltage/frequency scaling (SAGV) (default: true)");
+
 i915_param_named_unsafe(force_probe, charp, 0400,
 	"Force probe options for specified supported devices. "
 	"See CONFIG_DRM_I915_FORCE_PROBE for details.");
drivers/gpu/drm/i915/i915_params.h +1 -0
index 3f51f90145b6..6798b5c2363d 100644
@@ -56,6 +56,7 @@ struct drm_printer;
 	param(int, enable_psr, -1, 0600) \
 	param(bool, psr_safest_params, false, 0400) \
 	param(bool, enable_psr2_sel_fetch, true, 0400) \
+	param(bool, enable_sagv, true, 0600) \
 	param(int, disable_power_well, -1, 0400) \
 	param(int, enable_ips, 1, 0600) \
 	param(int, invert_brightness, 0, 0600) \
Signature · 1 line
2.39.2
Signature · 2 lines
Ville Syrjälä
Intel
maintainer
#6 lore raw
Quoted 26 lines · Ville Syrjälä
Quoted 25 lines · Rodrigo Vivi
Quoted 24 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have no sane way to forcibly disable SAGV, which makes debugging things a PITA. Manually poking at the pcode mailbox with it's various SAGV/QGV/PSF formats is no fun, and likely to be clobbered by the driver anyway.

Let's add a modparam for this.

---
 drivers/gpu/drm/i915/display/skl_watermark.c | 4 ++++
 drivers/gpu/drm/i915/i915_params.c           | 3 +++
 drivers/gpu/drm/i915/i915_params.h           | 1 +
 3 files changed, 8 insertions(+)
drivers/gpu/drm/i915/display/skl_watermark.c +0 -0
index 50a9a6adbe32..ff70225c0263 100644
@@ -411,6 +411,9 @@ static bool intel_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
 
Quoted 6 lines
Quoted 4 lines

drivers/gpu/drm/i915/display/skl_watermark.c static bool intel_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state · line 415

Quoted 2 lines
drivers/gpu/drm/i915/display/skl_watermark.c +2 -0
+	if (!i915->params.enable_sagv)
+		return false;

would this be one more ifdef for xe?

Why? xe needs it just as much.

yes, I know... but the param will be different...
open like this we need to have ifdef, or we need to hide in a macro, or have it in a xe/ext/display/ duplicated file...

it was a comment more to raise the thoughts around items like this that impacts xe... definitely not a blocker or anything like that...

Quoted 62 lines
Quoted 2 lines

should we hide this on a HAS_SAGV?

If we have no sagv then we're not going to enable sagv anyway. Doesn't matter if it's blocked a few lines earlier by the modparam rather than falling through to checking the other stuff.

Quoted 4 lines

anyway, let's move on:

Thanks

Quoted 43 lines
Quoted 43 lines
drivers/gpu/drm/i915/display/skl_watermark.c +2 -0
+
 	if (DISPLAY_VER(i915) >= 12)
 		return tgl_crtc_can_enable_sagv(crtc_state);
 	else
@@ -3696,6 +3699,7 @@ static int intel_sagv_status_show(struct seq_file *m, void *unused)
 	};
 
 	seq_printf(m, "SAGV available: %s\n", str_yes_no(intel_has_sagv(i915)));
+	seq_printf(m, "SAGV modparam: %s\n", str_enabled_disabled(i915->params.enable_sagv));
 	seq_printf(m, "SAGV status: %s\n", sagv_status[i915->display.sagv.status]);
 	seq_printf(m, "SAGV block time: %d usec\n", i915->display.sagv.block_time_us);
 
drivers/gpu/drm/i915/i915_params.c +3 -0
index ade744cccfea..66141906ea05 100644
@@ -121,6 +121,9 @@ i915_param_named_unsafe(enable_psr2_sel_fetch, bool, 0400,
 	"(0=disabled, 1=enabled) "
 	"Default: 0");
 
+i915_param_named_unsafe(enable_sagv, bool, 0600,
+	"Enable system agent voltage/frequency scaling (SAGV) (default: true)");
+
 i915_param_named_unsafe(force_probe, charp, 0400,
 	"Force probe options for specified supported devices. "
 	"See CONFIG_DRM_I915_FORCE_PROBE for details.");
drivers/gpu/drm/i915/i915_params.h +1 -0
index 3f51f90145b6..6798b5c2363d 100644
@@ -56,6 +56,7 @@ struct drm_printer;
 	param(int, enable_psr, -1, 0600) \
 	param(bool, psr_safest_params, false, 0400) \
 	param(bool, enable_psr2_sel_fetch, true, 0400) \
+	param(bool, enable_sagv, true, 0600) \
 	param(int, disable_power_well, -1, 0400) \
 	param(int, enable_ips, 1, 0600) \
 	param(int, invert_brightness, 0, 0600) \
Signature · 1 line
2.39.2
Signature · 2 lines
Ville Syrjälä
Intel