Skip to contentSkip to conversation

tests/amdgpu/amd_abm: Fix ABM level setting

PATCH New Tom Chung 2 participants 3 messages Apr 3, 2024

lore
Share & tools
lore

Tom Chung

author
#0 lore raw

PATCH v2 1/1 tests/amdgpu/amd_abm: Fix ABM level setting

[Why]
The ABM level does not take effect right after do the ABM level set.

[How]
Trigger a full modeset to make new ABM level take effect right away by setting DPMS off -> on transition.

---
v2: Modify some comments

 tests/amdgpu/amd_abm.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
tests/amdgpu/amd_abm.c +18 -9
index e56000e02..2882c2c18 100644
@@ -104,13 +104,13 @@ static int backlight_write_brightness(int value)
 	return 0;
 }
 
-static void set_abm_level(char *connector_name, int level)
+static void set_abm_level(data_t *data, igt_output_t *output, int level)
 {
 	char buf[PATH_MAX];
 	int fd;
 
 	igt_assert(snprintf(buf, PATH_MAX, PANEL_POWER_SAVINGS_PATH,
-			    connector_name) < PATH_MAX);
+			    output->name) < PATH_MAX);
 
 	fd = open(buf, O_WRONLY);
 
@@ -120,6 +120,15 @@ static void set_abm_level(char *connector_name, int level)
 		      write(fd, buf, 1));
 
 	igt_assert_eq(close(fd), 0);
+
+	/**
+	 * We need to trigger a full modeset to have the new ABM level take effect.
+	 * DPMS off -> on transition is one of many approaches.
+	 */
+	kmstest_set_connector_dpms(data->drm_fd, output->config.connector,
+			 DRM_MODE_DPMS_OFF);
+	kmstest_set_connector_dpms(data->drm_fd, output->config.connector,
+			 DRM_MODE_DPMS_ON);
 }
 
 static int backlight_read_max_brightness(int *result)
@@ -183,7 +192,7 @@ static void backlight_dpms_cycle(data_t *data)
 		ret = backlight_read_max_brightness(&max_brightness);
 		igt_assert_eq(ret, 0);
 
-		set_abm_level(output->name, 0);
+		set_abm_level(data, output, 0);
 		backlight_write_brightness(max_brightness / 2);
 		usleep(100000);
 		pwm_1 = read_target_backlight_pwm(data->drm_fd, output->name);
@@ -214,7 +223,7 @@ static void backlight_monotonic_basic(data_t *data)
 
 		brightness_step = max_brightness / 10;
 
-		set_abm_level(output->name, 0);
+		set_abm_level(data, output, 0);
 		backlight_write_brightness(max_brightness);
 		usleep(100000);
 		prev_pwm = read_target_backlight_pwm(data->drm_fd, output->name);
@@ -248,7 +257,7 @@ static void backlight_monotonic_abm(data_t *data)
 
 		brightness_step = max_brightness / 10;
 		for (i = 1; i < 5; i++) {
-			set_abm_level(output->name, 0);
+			set_abm_level(data, output, 0);
 			backlight_write_brightness(max_brightness);
 			usleep(100000);
 			prev_pwm = read_target_backlight_pwm(data->drm_fd, output->name);
@@ -280,14 +289,14 @@ static void abm_enabled(data_t *data)
 		ret = backlight_read_max_brightness(&max_brightness);
 		igt_assert_eq(ret, 0);
 
-		set_abm_level(output->name, 0);
+		set_abm_level(data, output, 0);
 		backlight_write_brightness(max_brightness);
 		usleep(100000);
 		prev_pwm = read_target_backlight_pwm(data->drm_fd, output->name);
 		pwm_without_abm = prev_pwm;
 
 		for (i = 1; i < 5; i++) {
-			set_abm_level(output->name, i);
+			set_abm_level(data, output, i);
 			usleep(100000);
 			pwm = read_target_backlight_pwm(data->drm_fd, output->name);
 			igt_assert(pwm <= prev_pwm);
@@ -314,7 +323,7 @@ static void abm_gradual(data_t *data)
 
 		igt_assert_eq(ret, 0);
 
-		set_abm_level(output->name, 0);
+		set_abm_level(data, output, 0);
 		backlight_write_brightness(max_brightness);
 
 		sleep(convergence_delay);
@@ -322,7 +331,7 @@ static void abm_gradual(data_t *data)
 		curr = read_current_backlight_pwm(data->drm_fd, output->name);
 
 		igt_assert_eq(prev_pwm, curr);
-		set_abm_level(output->name, 4);
+		set_abm_level(data, output, 4);
 		for (i = 0; i < 10; i++) {
 			usleep(100000);
 			pwm = read_current_backlight_pwm(data->drm_fd, output->name);
Signature · 1 line
2.34.1
#1 lore raw

✓ CI.xeBAT: success for tests/amdgpu/amd_abm: Fix ABM level setting (rev2)

== Series Details ==

== Series Details ==

Series: tests/amdgpu/amd_abm: Fix ABM level setting (rev2)
URL : https://patchwork.freedesktop.org/series/131914/
State : success

== Summary ==

CI Bug Log - changes from XEIGT_7797_BAT -> XEIGTPW_10971_BAT
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Participating hosts (5 -> 5)
------------------------------

No changes in participating hosts

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

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

### IGT changes ###

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

[Intel XE#1416]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1416

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

* IGT: IGT_7797 -> IGTPW_10971

IGTPW_10971: 10971
IGT_7797: e88ebc17ec12b503aab380b08c1213af9cc7a97c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
xe-1029-f4b306bc42834d24085b45a5a3d1521a451b2abf: f4b306bc42834d24085b45a5a3d1521a451b2abf

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10971/index.html

#2 lore raw

✓ Fi.CI.BAT: success for tests/amdgpu/amd_abm: Fix ABM level setting (rev2)

In reply to Tom Chung
== Series Details ==

== Series Details ==

Series: tests/amdgpu/amd_abm: Fix ABM level setting (rev2)
URL : https://patchwork.freedesktop.org/series/131914/
State : success

== Summary ==

CI Bug Log - changes from IGT_7797 -> IGTPW_10971
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

Participating hosts (31 -> 33)
------------------------------

Additional (4): bat-kbl-2 bat-dg2-9 fi-bsw-nick bat-mtlp-8
Missing (2): bat-jsl-1 fi-snb-2520m

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

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

### IGT changes ###

#### Issues hit ####

* igt@debugfs_test@basic-hwmon:
- bat-mtlp-8: NOTRUN -> [SKIP][1] ([i915#9318])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@fbdev@info:
- bat-dg2-9: NOTRUN -> [SKIP][2] ([i915#1849] / [i915#2582])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-kbl-2: NOTRUN -> [SKIP][3] ([i915#1849])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-kbl-2/igt@[email protected]

* igt@fbdev@nullptr:
- bat-dg2-9: NOTRUN -> [SKIP][4] ([i915#2582]) +3 other tests skip
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]

* igt@gem_lmem_swapping@basic@lmem0:
- bat-dg2-8: [PASS][5] -> [FAIL][6] ([i915#10378])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7797/bat-dg2-8/igt@gem_lmem_swapping@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-8/igt@gem_lmem_swapping@[email protected]

* igt@gem_lmem_swapping@parallel-random-engines:
- fi-bsw-nick: NOTRUN -> [SKIP][7] +19 other tests skip
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/fi-bsw-nick/igt@[email protected]
- bat-kbl-2: NOTRUN -> [SKIP][8] +39 other tests skip
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-kbl-2/igt@[email protected]

* igt@gem_lmem_swapping@verify-random:
- bat-mtlp-8: NOTRUN -> [SKIP][9] ([i915#4613]) +3 other tests skip
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@gem_mmap@basic:
- bat-dg2-9: NOTRUN -> [SKIP][10] ([i915#4083])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][11] ([i915#4083])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@gem_mmap_gtt@basic:
- bat-dg2-9: NOTRUN -> [SKIP][12] ([i915#4077]) +2 other tests skip
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][13] ([i915#4077]) +2 other tests skip
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@gem_render_tiled_blits@basic:
- bat-dg2-9: NOTRUN -> [SKIP][14] ([i915#4079]) +1 other test skip
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][15] ([i915#4079]) +1 other test skip
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@i915_pm_rps@basic-api:
- bat-dg2-9: NOTRUN -> [SKIP][16] ([i915#6621])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][17] ([i915#6621])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@i915_selftest@live@coherency:
- bat-dg2-8: [PASS][18] -> [ABORT][19] ([i915#10366])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7797/bat-dg2-8/igt@i915_selftest@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-8/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@workarounds:
- bat-dg2-9: NOTRUN -> [DMESG-FAIL][20] ([i915#9500])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@i915_selftest@[email protected]

* igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- bat-dg2-9: NOTRUN -> [SKIP][21] ([i915#5190])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][22] ([i915#5190])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@kms_addfb_basic@basic-y-tiled-legacy:
- bat-dg2-9: NOTRUN -> [SKIP][23] ([i915#4215] / [i915#5190])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][24] ([i915#4212]) +8 other tests skip
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@kms_addfb_basic@framebuffer-vs-set-tiling:
- bat-dg2-9: NOTRUN -> [SKIP][25] ([i915#4212]) +7 other tests skip
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- bat-mtlp-8: NOTRUN -> [SKIP][26] ([i915#4213]) +1 other test skip
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@kms_cursor_legacy@basic-flip-after-cursor-atomic:
- bat-dg2-9: NOTRUN -> [SKIP][27] ([i915#9197]) +16 other tests skip
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]

* igt@kms_dsc@dsc-basic:
- bat-mtlp-8: NOTRUN -> [SKIP][28] ([i915#3555] / [i915#3840] / [i915#9159])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@kms_flip@basic-flip-vs-dpms:
- bat-dg2-9: NOTRUN -> [SKIP][29] ([i915#5354]) +5 other tests skip
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- bat-dg2-9: NOTRUN -> [SKIP][30]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][31]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@kms_force_connector_basic@prune-stale-modes:
- bat-dg2-9: NOTRUN -> [SKIP][32] ([i915#5274])
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][33] ([i915#5274])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@kms_psr@psr-primary-mmap-gtt@edp-1:
- bat-mtlp-8: NOTRUN -> [SKIP][34] ([i915#4077] / [i915#9688])
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@kms_psr@[email protected]

* igt@kms_psr@psr-sprite-plane-onoff:
- bat-dg2-9: NOTRUN -> [SKIP][35] ([i915#1072] / [i915#9673] / [i915#9732]) +3 other tests skip
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]

* igt@kms_setmode@basic-clone-single-crtc:
- bat-dg2-9: NOTRUN -> [SKIP][36] ([i915#3555])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][37] ([i915#3555] / [i915#8809])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@prime_vgem@basic-fence-flip:
- bat-dg2-9: NOTRUN -> [SKIP][38] ([i915#3708] / [i915#9197])
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]

* igt@prime_vgem@basic-fence-mmap:
- bat-dg2-9: NOTRUN -> [SKIP][39] ([i915#3708] / [i915#4077]) +1 other test skip
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][40] ([i915#3708] / [i915#4077]) +1 other test skip
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@prime_vgem@basic-fence-read:
- bat-mtlp-8: NOTRUN -> [SKIP][41] ([i915#3708]) +1 other test skip
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

* igt@prime_vgem@basic-write:
- bat-dg2-9: NOTRUN -> [SKIP][42] ([i915#3291] / [i915#3708]) +2 other tests skip
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-dg2-9/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][43] ([i915#10216] / [i915#3708])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-8/igt@[email protected]

#### Possible fixes ####

* igt@kms_flip@basic-plain-flip@a-dp6:
- {bat-mtlp-9}: [DMESG-WARN][44] ([i915#10435]) -> [PASS][45]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7797/bat-mtlp-9/igt@kms_flip@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10971/bat-mtlp-9/igt@kms_flip@[email protected]

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

[i915#10216]: https://gitlab.freedesktop.org/drm/intel/issues/10216
[i915#10366]: https://gitlab.freedesktop.org/drm/intel/issues/10366
[i915#10378]: https://gitlab.freedesktop.org/drm/intel/issues/10378
[i915#10435]: https://gitlab.freedesktop.org/drm/intel/issues/10435
[i915#10436]: https://gitlab.freedesktop.org/drm/intel/issues/10436
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
[i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#8809]: https://gitlab.freedesktop.org/drm/intel/issues/8809
[i915#9159]: https://gitlab.freedesktop.org/drm/intel/issues/9159
[i915#9197]: https://gitlab.freedesktop.org/drm/intel/issues/9197
[i915#9318]: https://gitlab.freedesktop.org/drm/intel/issues/9318
[i915#9500]: https://gitlab.freedesktop.org/drm/intel/issues/9500
[i915#9673]: https://gitlab.freedesktop.org/drm/intel/issues/9673
[i915#9688]: https://gitlab.freedesktop.org/drm/intel/issues/9688
[i915#9732]: https://gitlab.freedesktop.org/drm/intel/issues/9732

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

* CI: CI-20190529 -> None
* IGT: IGT_7797 -> IGTPW_10971

CI-20190529: 20190529
CI_DRM_14519: f4b306bc42834d24085b45a5a3d1521a451b2abf @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_10971: 10971
IGT_7797: e88ebc17ec12b503aab380b08c1213af9cc7a97c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

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