Skip to contentSkip to conversation

Enabling PC8+ residency for all GEN9+ platforms v2

PATCH Superseded Anshuman Gupta 3 participants 6 messages Mar 26, 2019 – Mar 27, 2019

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

cover Enabling PC8+ residency for all GEN9+ platforms v2

This patch series enable PC8+ residency test, earlier these tests were only enabled for Haswell and Broadwell.

I have addressed the below review comment from old series (https://patchwork.freedesktop.org/series/57035/)

1. Made this test future proof to enable for all Gen9+ platform.
2. Added a pc8_needs_screen_off flag to distinguish between HSW/BDW and Gen9+ Platform.
3. Since Gen9 onwards PC8+ residency doesn't require display to be turned off, this patch series tests PC8 residency with all screens on.

Tested on Gen9 KBL Platform, unable to test on ICL, because ICL systems at local BA setup are not entering to PC2 itself.

Planning a separate series for a subtest to validate pc8 with multiple pipes usages and all planes enabled with max resolution, to create maximum memory bandwidth scenario.

Anshuman Gupta (2):
tests/i915/i915_pm_rpm: Enable PC8+ residency test for all Gen9+ tests/i915/i915_pm_rpm: modeset-pc8-residency-stress

 tests/i915/i915_pm_rpm.c | 77 ++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 68 insertions(+), 9 deletions(-)
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH 1/2 tests/i915/i915_pm_rpm: Enable PC8+ residency test for all Gen9+

Enabled has_pc8 global for ICL and Gen9+. Modified PC8+ residency sub-test with all screen enabled.

v2:Fixed the issue of skipped test on HSW.
Improved the code comment for MSR_PKG_CST_CONFIG_CONTROL mask and PC8 bits, it holds good for SKL/ICL and Goldmont microarchitecture. Code readabilty improvement.

---
 tests/i915/i915_pm_rpm.c | 77 +++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 69 insertions(+), 8 deletions(-)
tests/i915/i915_pm_rpm.c +69 -8
index be296f5..66d2a4e 100644
@@ -52,7 +52,7 @@
 #include "igt_device.h"
 
 #define MSR_PKG_CST_CONFIG_CONTROL	0xE2
-/* HSW/BDW: */
+/* HSW/BDW SKL/ICL and Goldmont */
 #define  PKG_CST_LIMIT_MASK		0xF
 #define  PKG_CST_LIMIT_C8		0x6
 
@@ -90,7 +90,7 @@ enum plane_type {
 
 int drm_fd, msr_fd, pc8_status_fd;
 int debugfs;
-bool has_runtime_pm, has_pc8;
+bool has_runtime_pm, has_pc8, connected_screens;
 struct mode_set_data ms_data;
 
 /* Stuff used when creating FBs and mode setting. */
@@ -98,8 +98,8 @@ struct mode_set_data {
 	drmModeResPtr res;
 	drmModeConnectorPtr connectors[MAX_CONNECTORS];
 	drmModePropertyBlobPtr edids[MAX_CONNECTORS];
-
 	uint32_t devid;
+	bool pc8_needs_screen_off;
 };
 
 /* Stuff we query at different times so we can compare. */
@@ -121,6 +121,7 @@ struct modeset_params {
 struct modeset_params lpsp_mode_params;
 struct modeset_params non_lpsp_mode_params;
 struct modeset_params *default_mode_params;
+struct modeset_params *screens_mode_params[MAX_CONNECTORS];
 
 static int8_t *pm_data = NULL;
 
@@ -297,6 +298,40 @@ static bool init_modeset_params_for_type(struct mode_set_data *data,
 	return true;
 }
 
+static bool init_modeset_params_for_all_screen(struct mode_set_data *data)
+{
+	drmModeConnectorPtr connector = NULL;
+	drmModeModeInfoPtr mode = NULL;
+	int screen = 0;
+
+	if (!data->res)
+		return false;
+
+	for (int i = 0; i < data->res->count_connectors; i++) {
+		drmModeConnectorPtr c = data->connectors[i];
+
+		if (c->connection == DRM_MODE_CONNECTED && c->count_modes) {
+			screens_mode_params[screen] =
+				malloc(sizeof(struct modeset_params));
+			connector = c;
+			mode = &c->modes[0];
+			igt_create_pattern_fb(drm_fd, mode->hdisplay, mode->vdisplay,
+			      DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
+			      &screens_mode_params[screen]->fb);
+			screens_mode_params[screen]->crtc_id =
+				kmstest_find_crtc_for_connector(drm_fd, data->res, connector, 0);
+			screens_mode_params[screen]->connector_id = connector->connector_id;
+			screens_mode_params[screen]->mode = mode;
+			screen++;
+		}
+	}
+
+	if (!connector)
+		return false;
+
+	return true;
+}
+
 static void init_modeset_cached_params(struct mode_set_data *data)
 {
 	bool lpsp, non_lpsp;
@@ -305,6 +340,7 @@ static void init_modeset_cached_params(struct mode_set_data *data)
 					    SCREEN_TYPE_LPSP);
 	non_lpsp = init_modeset_params_for_type(data, &non_lpsp_mode_params,
 						SCREEN_TYPE_NON_LPSP);
+	connected_screens = init_modeset_params_for_all_screen(data);
 
 	if (lpsp)
 		default_mode_params = &lpsp_mode_params;
@@ -353,6 +389,22 @@ static bool enable_one_screen_with_type(struct mode_set_data *data,
 	return set_mode_for_params(params);
 }
 
+static void enable_all_screens(struct mode_set_data *data)
+{
+	struct modeset_params *params = NULL;
+
+	/* SKIP if there are no connected screens. */
+	igt_require(connected_screens);
+
+	for (int i = 0; i < MAX_CONNECTORS ; i++) {
+		params = screens_mode_params[i];
+		if (params)
+			set_mode_for_params(params);
+		else
+			break;
+	}
+}
+
 static void enable_one_screen(struct mode_set_data *data)
 {
 	/* SKIP if there are no connected screens. */
@@ -685,8 +737,12 @@ static void setup_pc8(void)
 {
 	has_pc8 = false;
 
-	/* Only Haswell supports the PC8 feature. */
-	if (!IS_HASWELL(ms_data.devid) && !IS_BROADWELL(ms_data.devid))
+	if (IS_HASWELL(ms_data.devid) || IS_BROADWELL(ms_data.devid))
+		ms_data.pc8_needs_screen_off = true;
+	else if (AT_LEAST_GEN(ms_data.devid, 9))
+		ms_data.pc8_needs_screen_off = false;
+	/* Only Haswell supports the PC8 feature on lesser than GEN9. */
+	else
 		return;
 
 	/* Make sure our Kernel supports MSR and the module is loaded. */
@@ -778,7 +834,6 @@ static void teardown_environment(void)
 
 	igt_pm_restore_sata_link_power_management(pm_data);
 	free(pm_data);
-
 	fini_mode_set_data(&ms_data);
 
 	close(debugfs);
@@ -808,9 +863,15 @@ static void pc8_residency_subtest(void)
 		     "configuration.\n");
 
 	/* Make sure PC8+ residencies stop! */
-	enable_one_screen(&ms_data);
-	igt_assert_f(!pc8_plus_residency_changed(10),
+	if (ms_data.pc8_needs_screen_off) {
+		enable_one_screen(&ms_data);
+		igt_assert_f(!pc8_plus_residency_changed(10),
 		     "PC8+ residency didn't stop with screen enabled.\n");
+	} else {
+		enable_all_screens(&ms_data);
+		igt_assert_f(pc8_plus_residency_changed(10),
+		     "Machine is not reaching PC8+ states with all screen enabled.\n");
+	}
 }
 
 static void modeset_subtest(enum screen_type type, int rounds, int wait_flags)
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#3 lore raw

PATCH 2/2 tests/i915/i915_pm_rpm: modeset-pc8-residency-stress

In reply to Anshuman Gupta

Introduced pc8_needs_screen_off flag in order to differentiate between HASWELL/BROADWELL and AT_LEAST_GEN9. GEN9 onwards PC8+ residency does't require display to be turned on.

---
 tests/i915/i915_pm_rpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/i915/i915_pm_rpm.c +1 -1
index 66d2a4e..95a5c41 100644
@@ -902,7 +902,7 @@ static void modeset_subtest(enum screen_type type, int rounds, int wait_flags)
 		igt_require(enable_one_screen_with_type(&ms_data, type));
 		if (wait_flags & WAIT_STATUS)
 			igt_assert(wait_for_active());
-		if (wait_flags & WAIT_PC8_RES)
+		if (wait_flags & WAIT_PC8_RES && ms_data.pc8_needs_screen_off)
 			igt_assert(!pc8_plus_residency_changed(5));
 		if (wait_flags & WAIT_EXTRA)
 			sleep(5);
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#4 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for Enabling PC8+ residency for all GEN9+ platforms (rev2)

In reply to Anshuman Gupta
== Series Details ==

== Series Details ==

Series: Enabling PC8+ residency for all GEN9+ platforms (rev2)
URL : https://patchwork.freedesktop.org/series/57640/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5815 -> IGTPW_2709
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/57640/revisions/2/mbox/

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

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

### IGT changes ###

#### Issues hit ####

* igt@amdgpu/amd_basic@userptr:
- fi-kbl-8809g: PASS -> DMESG-WARN [fdo#108965]

* igt@gem_exec_suspend@basic-s4-devices:
- fi-blb-e6850: PASS -> INCOMPLETE [fdo#107718]

* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u3: PASS -> FAIL [fdo#103167]

#### Possible fixes ####

* igt@kms_frontbuffer_tracking@basic:
- fi-byt-clapper: FAIL [fdo#103167] -> PASS

* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
- fi-byt-clapper: FAIL [fdo#103191] / [fdo#107362] -> PASS +1

* igt@kms_pipe_crc_basic@read-crc-pipe-a:
- fi-byt-clapper: FAIL [fdo#107362] -> PASS

* igt@prime_vgem@basic-fence-flip:
- fi-ilk-650: FAIL [fdo#104008] -> PASS
- fi-gdg-551: FAIL [fdo#103182] -> PASS

[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#104008]: https://bugs.freedesktop.org/show_bug.cgi?id=104008
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108965]: https://bugs.freedesktop.org/show_bug.cgi?id=108965

Participating hosts (44 -> 39)
------------------------------

Missing (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-n3050 fi-bsw-cyan fi-bdw-samus

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

* IGT: IGT_4904 -> IGTPW_2709

CI_DRM_5815: 472ba88b1a76be18fb4ca6d688d6c5cda08cec81 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2709: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2709/
IGT_4904: b9cfd64009ca2536f7a997deabf34d88f2757511 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2709/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#5 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for Enabling PC8+ residency for all GEN9+ platforms (rev2)

In reply to Anshuman Gupta
== Series Details ==

== Series Details ==

Series: Enabling PC8+ residency for all GEN9+ platforms (rev2)
URL : https://patchwork.freedesktop.org/series/57640/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5815_full -> IGTPW_2709_full
====================================================

Summary
-------

**WARNING**

Minor unknown changes coming with IGTPW_2709_full need to be verified manually.

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

External URL: https://patchwork.freedesktop.org/api/1.0/series/57640/revisions/2/mbox/

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

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

### IGT changes ###

#### Warnings ####

* igt@i915_pm_rpm@modeset-pc8-residency-stress:
- shard-apl: SKIP [fdo#109271] -> FAIL +2
- shard-kbl: SKIP [fdo#109271] -> FAIL +2

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_params@no-blt:
- shard-snb: NOTRUN -> SKIP [fdo#109271] +186

* igt@gem_persistent_relocs@forked-faulting-reloc-thrash-inactive:
- shard-apl: PASS -> INCOMPLETE [fdo#103927]

* igt@gem_stolen@large-object-alloc:
- shard-hsw: NOTRUN -> SKIP [fdo#109271] +19

* igt@kms_atomic_transition@5x-modeset-transitions-nonblocking:
- shard-snb: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +21

* igt@kms_atomic_transition@6x-modeset-transitions-fencing:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

* igt@kms_busy@basic-flip-d:

    - shard-glk:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +1
    - shard-apl:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +3
    - shard-hsw:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +1

* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:

    - shard-kbl:          PASS -> DMESG-WARN [fdo#110222] +1
    - shard-snb:          PASS -> DMESG-WARN [fdo#110222]
    - shard-hsw:          PASS -> DMESG-WARN [fdo#110222]

* igt@kms_busy@extended-pageflip-hang-newfb-render-a:
- shard-apl: NOTRUN -> DMESG-WARN [fdo#110222] +1

* igt@kms_cursor_crc@cursor-64x21-onscreen:
- shard-glk: PASS -> FAIL [fdo#103232]

* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-glk: NOTRUN -> FAIL [fdo#103232]

* igt@kms_flip@2x-flip-vs-expired-vblank:
- shard-glk: PASS -> FAIL [fdo#105363]

* igt@kms_flip@flip-vs-expired-vblank:
- shard-glk: PASS -> FAIL [fdo#102887] / [fdo#105363]

* igt@kms_frontbuffer_tracking@fbcpsr-shrfb-scaledprimary:
- shard-apl: NOTRUN -> SKIP [fdo#109271] +38

* igt@kms_frontbuffer_tracking@psr-2p-primscrn-spr-indfb-draw-mmap-cpu:
- shard-glk: NOTRUN -> SKIP [fdo#109271] +31

* igt@kms_plane_alpha_blend@pipe-b-alpha-transparant-fb:
- shard-apl: NOTRUN -> FAIL [fdo#108145]

* igt@kms_plane_scaling@pipe-c-scaler-with-pixel-format:
- shard-glk: PASS -> SKIP [fdo#109271] / [fdo#109278]

* igt@kms_psr@sprite_mmap_cpu:
- shard-kbl: NOTRUN -> SKIP [fdo#109271]

* igt@kms_setmode@basic:
- shard-snb: NOTRUN -> FAIL [fdo#99912]

* igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm:
- shard-kbl: PASS -> FAIL [fdo#104894] +1

* igt@kms_vblank@pipe-c-ts-continuation-modeset-rpm:
- shard-apl: PASS -> FAIL [fdo#104894]

#### Possible fixes ####

* {igt@gem_exec_big@single}:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS

* igt@gem_softpin@noreloc-s3:
- shard-hsw: INCOMPLETE [fdo#103540] -> PASS
- shard-apl: INCOMPLETE [fdo#103927] -> PASS

* igt@kms_busy@extended-modeset-hang-newfb-render-c:
- shard-hsw: DMESG-WARN [fdo#110222] -> PASS +1

* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
- shard-kbl: DMESG-WARN [fdo#110222] -> PASS

* igt@kms_busy@extended-pageflip-hang-newfb-render-b:
- shard-glk: DMESG-WARN [fdo#110222] -> PASS

* igt@kms_color@pipe-b-ctm-0-5:
- shard-glk: INCOMPLETE [fdo#103359] / [k.org#198133] -> PASS

* igt@kms_cursor_crc@cursor-256x85-onscreen:
- shard-glk: FAIL [fdo#103232] -> PASS +2

* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
- shard-hsw: FAIL [fdo#105767] -> PASS

* igt@kms_frontbuffer_tracking@fbc-2p-shrfb-fliptrack:
- shard-glk: FAIL [fdo#103167] -> PASS

* igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb:

    - shard-kbl:          FAIL [fdo#108145] -> PASS
    - shard-apl:          FAIL [fdo#108145] -> PASS
    - shard-glk:          FAIL [fdo#108145] -> PASS

* igt@kms_plane_lowres@pipe-a-tiling-none:
- shard-snb: SKIP [fdo#109271] -> PASS +1

* igt@kms_rotation_crc@multiplane-rotation-cropping-bottom:
- shard-kbl: DMESG-FAIL [fdo#105763] -> PASS +1

* igt@kms_setmode@basic:
- shard-apl: FAIL [fdo#99912] -> PASS

* igt@kms_vblank@pipe-b-ts-continuation-modeset-hang:
- shard-apl: FAIL [fdo#104894] -> PASS +1

* igt@perf_pmu@rc6-runtime-pm:
- shard-kbl: FAIL [fdo#105010] -> PASS
- shard-hsw: FAIL [fdo#105010] -> PASS

* igt@tools_test@tools_test:
- shard-glk: SKIP [fdo#109271] -> PASS

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

[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
[fdo#105010]: https://bugs.freedesktop.org/show_bug.cgi?id=105010
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
[fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#110222]: https://bugs.freedesktop.org/show_bug.cgi?id=110222
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133

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

Missing (5): shard-skl pig-hsw-4770r pig-glk-j5005 shard-iclb pig-skl-6260u

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

* IGT: IGT_4904 -> IGTPW_2709
* Piglit: piglit_4509 -> None

CI_DRM_5815: 472ba88b1a76be18fb4ca6d688d6c5cda08cec81 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2709: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2709/
IGT_4904: b9cfd64009ca2536f7a997deabf34d88f2757511 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2709/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

Re: [igt-dev] [PATCH i-g-t 1/2] tests/i915/i915_pm_rpm: Enable PC8+ residency test for all Gen9+

In reply to Anshuman Gupta
Quoted 18 lines · Anshuman Gupta

Enabled has_pc8 global for ICL and Gen9+. Modified PC8+ residency sub-test with all screen enabled.

v2:Fixed the issue of skipped test on HSW.
Improved the code comment for MSR_PKG_CST_CONFIG_CONTROL mask and PC8 bits, it holds good for SKL/ICL and Goldmont microarchitecture. Code readabilty improvement.

---
  tests/i915/i915_pm_rpm.c | 77 +++++++++++++++++++++++++++++++++++++++++++-----
  1 file changed, 69 insertions(+), 8 deletions(-)
tests/i915/i915_pm_rpm.c +0 -0
index be296f5..66d2a4e 100644

tests/i915/i915_pm_rpm.c line 55

Quoted 5 lines
tests/i915/i915_pm_rpm.c +1 -1
@@ -52,7 +52,7 @@
  #include "igt_device.h"
 
  #define MSR_PKG_CST_CONFIG_CONTROL	0xE2
-/* HSW/BDW: */
+/* HSW/BDW SKL/ICL and Goldmont */

If PC8 is for all Gen9+, then these macro also for all Gen9+ along with HSW I hope. Why we have only few platforms mentioned here?

tests/i915/i915_pm_rpm.c enum plane_type { · line 93

Quoted 9 lines
tests/i915/i915_pm_rpm.c +1 -1
  #define  PKG_CST_LIMIT_MASK		0xF
  #define  PKG_CST_LIMIT_C8		0x6
 
@@ -90,7 +90,7 @@ enum plane_type {
 
  int drm_fd, msr_fd, pc8_status_fd;
  int debugfs;
-bool has_runtime_pm, has_pc8;
+bool has_runtime_pm, has_pc8, connected_screens;

we can do with out this flag too, as we can rely on validness of screens_mode_params[i]

tests/i915/i915_pm_rpm.c struct mode_set_data { · line 101

Quoted 8 lines
tests/i915/i915_pm_rpm.c +0 -1
  struct mode_set_data ms_data;
 
  /* Stuff used when creating FBs and mode setting. */
@@ -98,8 +98,8 @@ struct mode_set_data {
  	drmModeResPtr res;
  	drmModeConnectorPtr connectors[MAX_CONNECTORS];
  	drmModePropertyBlobPtr edids[MAX_CONNECTORS];
-

unwanted change.

tests/i915/i915_pm_rpm.c struct mode_set_data { · line 102

Quoted 2 lines
tests/i915/i915_pm_rpm.c +1 -0
  	uint32_t devid;
+	bool pc8_needs_screen_off;

If you see the other members of mode_set_data they are retrieved from the kernel. And all required flag like has_runtime_pm and has_pc8 are defined as global. So even pc8_needs_screen_off can be defined outside to mode_set_data!?

Quoted 16 lines
tests/i915/i915_pm_rpm.c +2 -0
  };
 
  /* Stuff we query at different times so we can compare. */
@@ -121,6 +121,7 @@ struct modeset_params {
  struct modeset_params lpsp_mode_params;
  struct modeset_params non_lpsp_mode_params;
  struct modeset_params *default_mode_params;
+struct modeset_params *screens_mode_params[MAX_CONNECTORS];
 
  static int8_t *pm_data = NULL;
 
@@ -297,6 +298,40 @@ static bool init_modeset_params_for_type(struct mode_set_data *data,
  	return true;
  }
 
+static bool init_modeset_params_for_all_screen(struct mode_set_data *data)

tests/i915/i915_pm_rpm.c static bool init_modeset_params_for_type(struct mode_set_data *data, · line 311

Quoted 10 lines
tests/i915/i915_pm_rpm.c +10 -0
+{
+	drmModeConnectorPtr connector = NULL;
+	drmModeModeInfoPtr mode = NULL;
+	int screen = 0;
+
+	if (!data->res)
+		return false;
+
+	for (int i = 0; i < data->res->count_connectors; i++) {
+		drmModeConnectorPtr c = data->connectors[i];

Could we reuse the connector itself?

tests/i915/i915_pm_rpm.c static bool init_modeset_params_for_type(struct mode_set_data *data, · line 320

Quoted 9 lines
tests/i915/i915_pm_rpm.c +9 -0
+
+		if (c->connection == DRM_MODE_CONNECTED && c->count_modes) {
+			screens_mode_params[screen] =
+				malloc(sizeof(struct modeset_params));
+			connector = c;
+			mode = &c->modes[0];
+			igt_create_pattern_fb(drm_fd, mode->hdisplay, mode->vdisplay,
+			      DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
+			      &screens_mode_params[screen]->fb);

Align wrapped parameters with open parenthesis.

Quoted 64 lines
tests/i915/i915_pm_rpm.c +37 -2
+			screens_mode_params[screen]->crtc_id =
+				kmstest_find_crtc_for_connector(drm_fd, data->res, connector, 0);
+			screens_mode_params[screen]->connector_id = connector->connector_id;
+			screens_mode_params[screen]->mode = mode;
+			screen++;
+		}
+	}
+
+	if (!connector)
+		return false;
+
+	return true;
+}
+
  static void init_modeset_cached_params(struct mode_set_data *data)
  {
  	bool lpsp, non_lpsp;
@@ -305,6 +340,7 @@ static void init_modeset_cached_params(struct mode_set_data *data)
  					    SCREEN_TYPE_LPSP);
  	non_lpsp = init_modeset_params_for_type(data, &non_lpsp_mode_params,
  						SCREEN_TYPE_NON_LPSP);
+	connected_screens = init_modeset_params_for_all_screen(data);
 
  	if (lpsp)
  		default_mode_params = &lpsp_mode_params;
@@ -353,6 +389,22 @@ static bool enable_one_screen_with_type(struct mode_set_data *data,
  	return set_mode_for_params(params);
  }
 
+static void enable_all_screens(struct mode_set_data *data)
+{
+	struct modeset_params *params = NULL;
+
+	/* SKIP if there are no connected screens. */
+	igt_require(connected_screens);
+
+	for (int i = 0; i < MAX_CONNECTORS ; i++) {
+		params = screens_mode_params[i];
+		if (params)
+			set_mode_for_params(params);
+		else
+			break;
+	}
+}
+
  static void enable_one_screen(struct mode_set_data *data)
  {
  	/* SKIP if there are no connected screens. */
@@ -685,8 +737,12 @@ static void setup_pc8(void)
  {
  	has_pc8 = false;
 
-	/* Only Haswell supports the PC8 feature. */
-	if (!IS_HASWELL(ms_data.devid) && !IS_BROADWELL(ms_data.devid))
+	if (IS_HASWELL(ms_data.devid) || IS_BROADWELL(ms_data.devid))
+		ms_data.pc8_needs_screen_off = true;
+	else if (AT_LEAST_GEN(ms_data.devid, 9))
+		ms_data.pc8_needs_screen_off = false;
+	/* Only Haswell supports the PC8 feature on lesser than GEN9. */
+	else
  		return;
 
  	/* Make sure our Kernel supports MSR and the module is loaded. */

tests/i915/i915_pm_rpm.c static void teardown_environment(void) · line 781

Quoted 4 lines
tests/i915/i915_pm_rpm.c +0 -1
@@ -778,7 +834,6 @@ static void teardown_environment(void)
 
  	igt_pm_restore_sata_link_power_management(pm_data);
  	free(pm_data);
-

unwanted diff?

tests/i915/i915_pm_rpm.c static void pc8_residency_subtest(void) · line 869

Quoted 13 lines
tests/i915/i915_pm_rpm.c +3 -2
  	fini_mode_set_data(&ms_data);
 
  	close(debugfs);
@@ -808,9 +863,15 @@ static void pc8_residency_subtest(void)
  		     "configuration.\n");
 
  	/* Make sure PC8+ residencies stop! */
-	enable_one_screen(&ms_data);
-	igt_assert_f(!pc8_plus_residency_changed(10),
+	if (ms_data.pc8_needs_screen_off) {
+		enable_one_screen(&ms_data);
+		igt_assert_f(!pc8_plus_residency_changed(10),
  		     "PC8+ residency didn't stop with screen enabled.\n");

Could we align this with open parenthesis?

tests/i915/i915_pm_rpm.c static void pc8_residency_subtest(void) · line 873

Quoted 4 lines
tests/i915/i915_pm_rpm.c +4 -0
+	} else {
+		enable_all_screens(&ms_data);
+		igt_assert_f(pc8_plus_residency_changed(10),
+		     "Machine is not reaching PC8+ states with all screen enabled.\n");

Could we align this with open parenthesis?

-Ram

tests/i915/i915_pm_rpm.c static void pc8_residency_subtest(void) · line 877

Quoted 4 lines
tests/i915/i915_pm_rpm.c +1 -0
+	}
  }
 
  static void modeset_subtest(enum screen_type type, int rounds, int wait_flags)

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev