All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v5 0/5] lpsp platform agnostic support
@ 2020-04-09  5:39 Anshuman Gupta
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 1/5] tests/i915_pm_lpsp: Nuke the panel-fitter test Anshuman Gupta
                   ` (8 more replies)
  0 siblings, 9 replies; 22+ messages in thread
From: Anshuman Gupta @ 2020-04-09  5:39 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, martin.peres

This series adds lpsp igt val platform agnostic support.
This has been a big gap on igt validation side in order to 
validate low power single pipe use cases.

v5 has the incorporated the changes for debugfs entry i915_lpsp_capability
and i915_lpsp_status.

This should be test with i915 lpsp support, which adds
i915_lpsp_{capability,status} debugfs.

Anshuman Gupta (5):
  tests/i915_pm_lpsp: Nuke the panel-fitter test
  lib/igt_pm: Add lib func to get lpsp capability
  tests/i915_pm_lpsp: lpsp platform agnostic support
  tests/i915_pm_lpsp: screens-disabled subtest use igt_wait
  tests/i915_pm_rpm: lpsp/non-lpsp screen mode_set_data

 lib/igt_pm.c              |  37 +++++
 lib/igt_pm.h              |   1 +
 tests/i915/i915_pm_lpsp.c | 288 +++++++++++++++-----------------------
 tests/i915/i915_pm_rpm.c  |  53 ++++---
 4 files changed, 183 insertions(+), 196 deletions(-)

-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [igt-dev] [PATCH i-g-t v5 1/5] tests/i915_pm_lpsp: Nuke the panel-fitter test
  2020-04-09  5:39 [igt-dev] [PATCH i-g-t v5 0/5] lpsp platform agnostic support Anshuman Gupta
@ 2020-04-09  5:39 ` Anshuman Gupta
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 2/5] lib/igt_pm: Add lib func to get lpsp capability Anshuman Gupta
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 22+ messages in thread
From: Anshuman Gupta @ 2020-04-09  5:39 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, martin.peres

panel-fitter subtest is only applicable to HASWELL/BROADWELL.
It just tests non-lpsp(lpsp disabled) when panel fitter is
enforced by std 1024x768 mode.
There is no ROI to test non-lpsp kind of thing,
If HSW_GLOBAL power well is not enabled we would see
other display issues in other display tests.

Gen9+ platform has display scaling feature in built per
pipe, as lpsp is all about low power single pipe (PIPE A)
usage, gen9+ platforms also don't require panel-fitter subtest.
This should save some CI cycles.

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 tests/i915/i915_pm_lpsp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
index 42938e10..08f82e7c 100644
--- a/tests/i915/i915_pm_lpsp.c
+++ b/tests/i915/i915_pm_lpsp.c
@@ -219,8 +219,6 @@ igt_main
 		screens_disabled_subtest(drm_fd, drm_res);
 	igt_subtest("edp-native")
 		edp_subtest(drm_fd, drm_res, drm_connectors, devid, false);
-	igt_subtest("edp-panel-fitter")
-		edp_subtest(drm_fd, drm_res, drm_connectors, devid, true);
 	igt_subtest("non-edp")
 		non_edp_subtest(drm_fd, drm_res, drm_connectors);
 
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [igt-dev] [PATCH i-g-t v5 2/5] lib/igt_pm: Add lib func to get lpsp capability
  2020-04-09  5:39 [igt-dev] [PATCH i-g-t v5 0/5] lpsp platform agnostic support Anshuman Gupta
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 1/5] tests/i915_pm_lpsp: Nuke the panel-fitter test Anshuman Gupta
@ 2020-04-09  5:39 ` Anshuman Gupta
  2020-04-14 16:26   ` Manna, Animesh
  2020-04-15 12:48   ` Anshuman Gupta
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 3/5] tests/i915_pm_lpsp: lpsp platform agnostic support Anshuman Gupta
                   ` (6 subsequent siblings)
  8 siblings, 2 replies; 22+ messages in thread
From: Anshuman Gupta @ 2020-04-09  5:39 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, martin.peres

This lib function evaluate the lpsp capability from
the connector specific debugfs attribute i915_lpsp_info.

v2:
- changed the lib function prefix igt_output_is_lpsp_capable
  to i915_output_is_lpsp_capable. [Martin]
v3:
- early return for the connector which doesn't support
  lpsp on any platform.
v4:
- debugfs entry changed from i915_lpsp_info to i915_lpsp_capability.

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 lib/igt_pm.c | 37 +++++++++++++++++++++++++++++++++++++
 lib/igt_pm.h |  1 +
 2 files changed, 38 insertions(+)

diff --git a/lib/igt_pm.c b/lib/igt_pm.c
index 9d441e1b..3418b69a 100644
--- a/lib/igt_pm.c
+++ b/lib/igt_pm.c
@@ -37,6 +37,7 @@
 #include <dirent.h>
 
 #include "drmtest.h"
+#include "igt_kms.h"
 #include "igt_pm.h"
 #include "igt_aux.h"
 #include "igt_sysfs.h"
@@ -827,3 +828,39 @@ bool igt_pm_pc8_plus_residencies_enabled(int msr_fd)
 
 	return true;
 }
+
+/**
+ * i915_output_is_lpsp_capable:
+ * @drm_fd: fd to drm device
+ * @output: igt output for which lpsp capability need to be evaluated
+ * Check lpsp capability for a given output.
+ *
+ * Returns:
+ * True if given output is lpsp capable otherwise false.
+ */
+bool i915_output_is_lpsp_capable(int drm_fd, igt_output_t *output)
+{
+	drmModeConnectorPtr c = output->config.connector;
+	char buf[256];
+	int fd, len;
+
+	/* only eDP/DP/DSI/HDMI can support LPSP */
+	if (c->connector_type != DRM_MODE_CONNECTOR_eDP &&
+	    c->connector_type != DRM_MODE_CONNECTOR_DSI &&
+	    c->connector_type != DRM_MODE_CONNECTOR_DisplayPort &&
+	    c->connector_type != DRM_MODE_CONNECTOR_HDMIA &&
+	    c->connector_type != DRM_MODE_CONNECTOR_HDMIB)
+		return false;
+
+	fd = igt_debugfs_connector_dir(drm_fd, output->name, O_RDONLY);
+	igt_require(fd >= 0);
+	len = igt_debugfs_simple_read(fd, "i915_lpsp_capability",
+				      buf, sizeof(buf));
+
+	if (len < 0)
+		igt_assert_eq(len, -ENODEV);
+
+	close(fd);
+
+	return strstr(buf, "LPSP: capable");
+}
diff --git a/lib/igt_pm.h b/lib/igt_pm.h
index 5e438452..162d3ca3 100644
--- a/lib/igt_pm.h
+++ b/lib/igt_pm.h
@@ -53,5 +53,6 @@ enum igt_runtime_pm_status igt_get_runtime_pm_status(void);
 bool igt_wait_for_pm_status(enum igt_runtime_pm_status status);
 bool igt_pm_dmc_loaded(int debugfs);
 bool igt_pm_pc8_plus_residencies_enabled(int msr_fd);
+bool i915_output_is_lpsp_capable(int drm_fd, igt_output_t *output);
 
 #endif /* IGT_PM_H */
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [igt-dev] [PATCH i-g-t v5 3/5] tests/i915_pm_lpsp: lpsp platform agnostic support
  2020-04-09  5:39 [igt-dev] [PATCH i-g-t v5 0/5] lpsp platform agnostic support Anshuman Gupta
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 1/5] tests/i915_pm_lpsp: Nuke the panel-fitter test Anshuman Gupta
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 2/5] lib/igt_pm: Add lib func to get lpsp capability Anshuman Gupta
@ 2020-04-09  5:39 ` Anshuman Gupta
  2020-04-17 14:22   ` Manna, Animesh
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 4/5] tests/i915_pm_lpsp: screens-disabled subtest use igt_wait Anshuman Gupta
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 22+ messages in thread
From: Anshuman Gupta @ 2020-04-09  5:39 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, martin.peres

Current implementation of lpsp igt test, assumed that every non-edp
panel isn't a lpsp panel but it is not true on TGL anymore,
any HDMI/DP/DSI panel connected on pipe A and connected to PORT_{A,B,C}
can drive LPSP.
Even on older Gen9 platform a DP panel can drive lpsp on Port A.
This requires complete design change in current lpsp igt for a platform
agnostic support.

The new igt approach is relies on connector specific
i915_lpsp_capability and i915_lpsp_status debugfs attributes,
these debugfs exposes whether an output is capable of driving lpsp
and lpsp is enabled.

Nuking edp-native and non-edp test, introducing a new dynamic
igt subtest kms-lpsp, which validates lpsp on each connected output
and skip the subtest if output is not lpsp capable.

v2:
- CI failures fixup.
v3:
- removed unloading of snd_modules. [Martin]
v4:
- Don't test non-lpsp(if lpsp disabled), no ROI to test that.
- nuke panel-fitter test.
v5:
- Added dynamic subtest and igt changes according to kernel
  debugfs i915_lpsp_status changes.

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 tests/i915/i915_pm_lpsp.c | 285 +++++++++++++++-----------------------
 1 file changed, 114 insertions(+), 171 deletions(-)

diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
index 08f82e7c..7be23e6c 100644
--- a/tests/i915/i915_pm_lpsp.c
+++ b/tests/i915/i915_pm_lpsp.c
@@ -25,210 +25,153 @@
  */
 
 #include "igt.h"
+#include "igt_kmod.h"
+#include "igt_pm.h"
+#include "igt_sysfs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
 
+#define MAX_SINK_LPSP_INFO_BUF_LEN	4096
 
-static bool supports_lpsp(uint32_t devid)
-{
-	return IS_HASWELL(devid) || IS_BROADWELL(devid);
-}
+#define PWR_DOMAIN_INFO "i915_power_domain_info"
 
-static bool lpsp_is_enabled(int drm_fd)
+typedef struct {
+	int drm_fd;
+	int debugfs_fd;
+	uint32_t devid;
+	char *pwr_dmn_info;
+	igt_display_t display;
+	struct igt_fb fb;
+	drmModeModeInfo *mode;
+	igt_output_t *output;
+} data_t;
+
+static bool lpsp_is_enabled(data_t *data)
 {
-	uint32_t val;
+	char buf[MAX_SINK_LPSP_INFO_BUF_LEN];
+	int len;
 
-	val = INREG(HSW_PWR_WELL_CTL2);
-	return !(val & HSW_PWR_WELL_STATE_ENABLED);
-}
+	len = igt_debugfs_simple_read(data->debugfs_fd, "i915_lpsp_status",
+				      buf, sizeof(buf));
+	if (len < 0)
+		igt_assert_eq(len, -ENODEV);
 
-/* The LPSP mode is all about an enabled pipe, but we expect to also be in the
- * low power mode when no pipes are enabled, so do this check anyway. */
-static void screens_disabled_subtest(int drm_fd, drmModeResPtr drm_res)
-{
-	kmstest_unset_all_crtcs(drm_fd, drm_res);
-	igt_assert(lpsp_is_enabled(drm_fd));
+	return strstr(buf, "LPSP: enabled");
 }
 
-static uint32_t create_fb(int drm_fd, int width, int height)
+/*
+ * The LPSP mode is all about an enabled pipe, but we expect to also be in the
+ * low power mode when no pipes are enabled, so do this check anyway.
+ */
+static void screens_disabled_subtest(data_t *data)
 {
-	struct igt_fb fb;
+	igt_output_t *output;
+	int valid_output = 0;
+	enum pipe pipe;
+
+	for_each_pipe_with_single_output(&data->display, pipe, output) {
+		data->output = output;
+		igt_output_set_pipe(data->output, PIPE_NONE);
+		igt_display_commit(&data->display);
+		valid_output++;
+	}
 
-	return igt_create_pattern_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888,
-				     LOCAL_DRM_FORMAT_MOD_NONE, &fb);
+	igt_require_f(valid_output, "No connected output found\n");
+	igt_assert_f(lpsp_is_enabled(data), "lpsp is not enabled\n%s:\n%s\n",
+		     PWR_DOMAIN_INFO, data->pwr_dmn_info =
+		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
 }
 
-static void edp_subtest(int drm_fd, drmModeResPtr drm_res,
-			drmModeConnectorPtr *drm_connectors, uint32_t devid,
-			bool use_panel_fitter)
+static void setup_lpsp_output(data_t *data)
 {
-	int i, rc;
-	uint32_t crtc_id = 0, buffer_id = 0;
-	drmModeConnectorPtr connector = NULL;
-	drmModeModeInfoPtr mode = NULL;
-	drmModeModeInfo std_1024_mode = {
-		.clock = 65000,
-		.hdisplay = 1024,
-		.hsync_start = 1048,
-		.hsync_end = 1184,
-		.htotal = 1344,
-		.hskew = 0,
-		.vdisplay = 768,
-		.vsync_start = 771,
-		.vsync_end = 777,
-		.vtotal = 806,
-		.vscan = 0,
-		.vrefresh = 60,
-		.flags = 0xA,
-		.type = 0x40,
-		.name = "Custom 1024x768",
-	};
-
-	kmstest_unset_all_crtcs(drm_fd, drm_res);
-
-	for (i = 0; i < drm_res->count_connectors; i++) {
-		drmModeConnectorPtr c = drm_connectors[i];
-
-		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
-			continue;
-		if (c->connection != DRM_MODE_CONNECTED)
-			continue;
-
-		if (!use_panel_fitter && c->count_modes) {
-			connector = c;
-			mode = &c->modes[0];
-			break;
-		}
-		if (use_panel_fitter) {
-			connector = c;
-
-			/* This is one of the modes Xorg creates for panels, so
-			 * it should work just fine. Notice that Gens that
-			 * support LPSP are too new for panels with native
-			 * 1024x768 resolution, so this should force the panel
-			 * fitter. */
-			igt_assert(c->count_modes &&
-				   c->modes[0].hdisplay > 1024);
-			igt_assert(c->count_modes &&
-				   c->modes[0].vdisplay > 768);
-			mode = &std_1024_mode;
-			break;
-		}
-	}
-	igt_require(connector);
-
-	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
-						  0);
-	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
-
-	igt_assert(buffer_id);
-	igt_assert(connector);
-	igt_assert(mode);
-
-	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
-			    &connector->connector_id, 1, mode);
-	igt_assert_eq(rc, 0);
-
-	if (use_panel_fitter) {
-		if (IS_HASWELL(devid))
-			igt_assert(!lpsp_is_enabled(drm_fd));
-		else
-			igt_assert(lpsp_is_enabled(drm_fd));
-	} else {
-		igt_assert(lpsp_is_enabled(drm_fd));
-	}
+	igt_plane_t *primary;
+
+	/* set output pipe = PIPE_A for LPSP */
+	igt_output_set_pipe(data->output, PIPE_A);
+	primary = igt_output_get_plane_type(data->output,
+					    DRM_PLANE_TYPE_PRIMARY);
+	igt_plane_set_fb(primary, NULL);
+	igt_create_pattern_fb(data->drm_fd,
+			      data->mode->hdisplay, data->mode->vdisplay,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_DRM_FORMAT_MOD_NONE,
+			      &data->fb);
+	igt_plane_set_fb(primary, &data->fb);
+	igt_display_commit(&data->display);
 }
 
-static void non_edp_subtest(int drm_fd, drmModeResPtr drm_res,
-			    drmModeConnectorPtr *drm_connectors)
+static void test_cleanup(data_t *data)
 {
-	int i, rc;
-	uint32_t crtc_id = 0, buffer_id = 0;
-	drmModeConnectorPtr connector = NULL;
-	drmModeModeInfoPtr mode = NULL;
-
-	kmstest_unset_all_crtcs(drm_fd, drm_res);
-
-	for (i = 0; i < drm_res->count_connectors; i++) {
-		drmModeConnectorPtr c = drm_connectors[i];
-
-		if (c->connector_type == DRM_MODE_CONNECTOR_eDP)
-			continue;
-		if (c->connection != DRM_MODE_CONNECTED)
-			continue;
-
-		if (c->count_modes) {
-			connector = c;
-			mode = &c->modes[0];
-			break;
-		}
-	}
-	igt_require(connector);
-
-	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
-						  0);
-	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
-
-	igt_assert(buffer_id);
-	igt_assert(mode);
-
-	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
-			    &connector->connector_id, 1, mode);
-	igt_assert_eq(rc, 0);
-
-	igt_assert(!lpsp_is_enabled(drm_fd));
+	igt_plane_t *primary;
+
+	if (!data->output || data->output->pending_pipe == PIPE_NONE)
+		return;
+
+	primary = igt_output_get_plane_type(data->output,
+					    DRM_PLANE_TYPE_PRIMARY);
+	igt_plane_set_fb(primary, NULL);
+	igt_output_set_pipe(data->output, PIPE_NONE);
+	igt_display_commit(&data->display);
+	igt_remove_fb(data->drm_fd, &data->fb);
+	data->output = NULL;
 }
 
-#define MAX_CONNECTORS 32
+static void test_lpsp(data_t *data)
+{
+	/* LPSP is low power single pipe usages i.e. PIPE_A */
+	igt_require(igt_pipe_connector_valid(PIPE_A, data->output));
+	igt_require_f(i915_output_is_lpsp_capable(data->drm_fd, data->output),
+		      "output is not lpsp capable\n");
+
+	data->mode = igt_output_get_mode(data->output);
+	setup_lpsp_output(data);
+	igt_assert_f(lpsp_is_enabled(data), "%s: lpsp is not enabled\n%s:\n%s\n",
+		     data->output->name, PWR_DOMAIN_INFO, data->pwr_dmn_info =
+		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
+}
 
-int drm_fd;
-uint32_t devid;
-drmModeResPtr drm_res;
-drmModeConnectorPtr drm_connectors[MAX_CONNECTORS];
-struct intel_mmio_data mmio_data;
+IGT_TEST_DESCRIPTION("These tests validates display Low Power Single Pipe configurations");
 igt_main
 {
-	igt_fixture {
-		int i;
-
-		drm_fd = drm_open_driver_master(DRIVER_INTEL);
-		igt_require(drm_fd >= 0);
-
-		devid = intel_get_drm_devid(drm_fd);
-
-		drm_res = drmModeGetResources(drm_fd);
-		igt_require(drm_res);
-		igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
+	data_t data = {};
 
-		for (i = 0; i < drm_res->count_connectors; i++)
-			drm_connectors[i] = drmModeGetConnectorCurrent(drm_fd,
-							drm_res->connectors[i]);
+	igt_fixture {
 
+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
+		igt_require(data.drm_fd >= 0);
+		data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
+		igt_require(data.debugfs_fd >= 0);
 		igt_pm_enable_audio_runtime_pm();
-
-		igt_require(supports_lpsp(devid));
-
-		intel_register_access_init(&mmio_data, intel_get_pci_device(), 0, drm_fd);
-
 		kmstest_set_vt_graphics_mode();
+		data.devid = intel_get_drm_devid(data.drm_fd);
+		igt_display_require(&data.display, data.drm_fd);
+		igt_require(igt_pm_dmc_loaded(data.debugfs_fd));
 	}
 
+	igt_describe("This test validates lpsp while all crtc are disabled");
 	igt_subtest("screens-disabled")
-		screens_disabled_subtest(drm_fd, drm_res);
-	igt_subtest("edp-native")
-		edp_subtest(drm_fd, drm_res, drm_connectors, devid, false);
-	igt_subtest("non-edp")
-		non_edp_subtest(drm_fd, drm_res, drm_connectors);
+		screens_disabled_subtest(&data);
 
-	igt_fixture {
-		int i;
+	igt_describe("This test validates lpsp on all connected outputs on low power PIPE_A");
+	igt_subtest_with_dynamic_f("kms-lpsp") {
+		igt_display_t *display = &data.display;
+		igt_output_t *output;
 
-		intel_register_access_fini(&mmio_data);
-		for (i = 0; i < drm_res->count_connectors; i++)
-			drmModeFreeConnector(drm_connectors[i]);
-		drmModeFreeResources(drm_res);
-		close(drm_fd);
+		for_each_connected_output(display, output) {
+			igt_dynamic_f("kms-lpsp-%s", output->name) {
+				data.output = output;
+				test_lpsp(&data);
+			}
+
+			test_cleanup(&data);
+		}
+	}
+
+	igt_fixture {
+		free(data.pwr_dmn_info);
+		close(data.drm_fd);
+		igt_display_fini(&data.display);
 	}
 }
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [igt-dev] [PATCH i-g-t v5 4/5] tests/i915_pm_lpsp: screens-disabled subtest use igt_wait
  2020-04-09  5:39 [igt-dev] [PATCH i-g-t v5 0/5] lpsp platform agnostic support Anshuman Gupta
                   ` (2 preceding siblings ...)
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 3/5] tests/i915_pm_lpsp: lpsp platform agnostic support Anshuman Gupta
@ 2020-04-09  5:39 ` Anshuman Gupta
  2020-04-17 14:27   ` Manna, Animesh
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 5/5] tests/i915_pm_rpm: lpsp/non-lpsp screen mode_set_data Anshuman Gupta
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 22+ messages in thread
From: Anshuman Gupta @ 2020-04-09  5:39 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, martin.peres

When all screens are disabled, it takes some time to release
eDP/DP AUX IO power domain ref count. Also, delayed audio codec
disabling takes time to release AUDIO power domain ref-count,
using igt_wait to check lpsp after disabling all screens.

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 tests/i915/i915_pm_lpsp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
index 7be23e6c..e05d3791 100644
--- a/tests/i915/i915_pm_lpsp.c
+++ b/tests/i915/i915_pm_lpsp.c
@@ -79,7 +79,8 @@ static void screens_disabled_subtest(data_t *data)
 	}
 
 	igt_require_f(valid_output, "No connected output found\n");
-	igt_assert_f(lpsp_is_enabled(data), "lpsp is not enabled\n%s:\n%s\n",
+	igt_assert_f(igt_wait(lpsp_is_enabled(data), 1000, 100),
+		     "lpsp is not enabled\n%s:\n%s\n",
 		     PWR_DOMAIN_INFO, data->pwr_dmn_info =
 		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
 }
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [igt-dev] [PATCH i-g-t v5 5/5] tests/i915_pm_rpm: lpsp/non-lpsp screen mode_set_data
  2020-04-09  5:39 [igt-dev] [PATCH i-g-t v5 0/5] lpsp platform agnostic support Anshuman Gupta
                   ` (3 preceding siblings ...)
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 4/5] tests/i915_pm_lpsp: screens-disabled subtest use igt_wait Anshuman Gupta
@ 2020-04-09  5:39 ` Anshuman Gupta
  2020-04-09  6:41 ` [igt-dev] ✗ Fi.CI.BAT: failure for lpsp platform agnostic support (rev7) Patchwork
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 22+ messages in thread
From: Anshuman Gupta @ 2020-04-09  5:39 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, martin.peres

Initialize the mode set params for lpsp/non-lpsp screen
based upon their output lpsp capability instead
of edp/non-edp output type.

v2:
- CI failures fixup.
v3:
- changes according to lib function igt_output_is_lpsp_capable
  prefix chnaged to i915_output_is_lpsp_capable.

Acked-by: Martin Peres <martin.peres@linux.intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 tests/i915/i915_pm_rpm.c | 53 +++++++++++++++++++++++-----------------
 1 file changed, 30 insertions(+), 23 deletions(-)

diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
index 4f8124dc..e905cf91 100644
--- a/tests/i915/i915_pm_rpm.c
+++ b/tests/i915/i915_pm_rpm.c
@@ -94,6 +94,7 @@ struct mode_set_data {
 	drmModeResPtr res;
 	drmModeConnectorPtr connectors[MAX_CONNECTORS];
 	drmModePropertyBlobPtr edids[MAX_CONNECTORS];
+	igt_display_t display;
 
 	uint32_t devid;
 };
@@ -254,29 +255,29 @@ static bool init_modeset_params_for_type(struct mode_set_data *data,
 {
 	drmModeConnectorPtr connector = NULL;
 	drmModeModeInfoPtr mode = NULL;
+	igt_output_t *output = NULL;
+	igt_display_t *display = &data->display;
 
-	if (!data->res)
+	if (!data->res || !display)
 		return false;
 
-	for (int i = 0; i < data->res->count_connectors; i++) {
-		drmModeConnectorPtr c = data->connectors[i];
+	for_each_connected_output(display, output) {
+		drmModeConnectorPtr c = output->config.connector;
 
 		if (type == SCREEN_TYPE_LPSP &&
-		    c->connector_type != DRM_MODE_CONNECTOR_eDP)
+		     !i915_output_is_lpsp_capable(drm_fd, output))
 			continue;
 
 		if (type == SCREEN_TYPE_NON_LPSP &&
-		    c->connector_type == DRM_MODE_CONNECTOR_eDP)
+		    i915_output_is_lpsp_capable(drm_fd, output))
 			continue;
 
-		if (c->connection == DRM_MODE_CONNECTED && c->count_modes) {
-			connector = c;
-			mode = &c->modes[0];
-			break;
-		}
+		connector = c;
+		mode = igt_output_get_mode(output);
+		break;
 	}
 
-	if (!connector)
+	if (!connector || !mode)
 		return false;
 
 	igt_create_pattern_fb(drm_fd, mode->hdisplay, mode->vdisplay,
@@ -397,6 +398,7 @@ static void init_mode_set_data(struct mode_set_data *data)
 		kmstest_set_vt_graphics_mode();
 	}
 
+	igt_display_require(&data->display, drm_fd);
 	data->devid = intel_get_drm_devid(drm_fd);
 	init_modeset_cached_params(&ms_data);
 }
@@ -410,6 +412,8 @@ static void fini_mode_set_data(struct mode_set_data *data)
 		}
 		drmModeFreeResources(data->res);
 	}
+
+	igt_display_fini(&data->display);
 }
 
 static void get_drm_info(struct compare_data *data)
@@ -760,7 +764,7 @@ static void dump_file(int dir, const char *filename)
 	free(contents);
 }
 
-static bool setup_environment(void)
+static bool setup_environment(bool display_disabled)
 {
 	if (has_runtime_pm)
 		goto out;
@@ -772,7 +776,8 @@ static bool setup_environment(void)
 	debugfs = igt_debugfs_dir(drm_fd);
 	igt_require(debugfs != -1);
 
-	init_mode_set_data(&ms_data);
+	if (!display_disabled)
+		init_mode_set_data(&ms_data);
 
 	igt_pm_enable_sata_link_power_management();
 
@@ -785,13 +790,14 @@ static bool setup_environment(void)
 	igt_require(igt_pm_dmc_loaded(debugfs));
 
 out:
-	disable_all_screens(&ms_data);
+	if (!display_disabled)
+		disable_all_screens(&ms_data);
 	dump_file(debugfs, "i915_runtime_pm_status");
 
 	return wait_for_suspended();
 }
 
-static void teardown_environment(void)
+static void teardown_environment(bool display_disabled)
 {
 	close(msr_fd);
 	if (has_pc8)
@@ -801,7 +807,8 @@ static void teardown_environment(void)
 
 	igt_pm_restore_sata_link_power_management();
 
-	fini_mode_set_data(&ms_data);
+	if (!display_disabled)
+		fini_mode_set_data(&ms_data);
 
 	close(debugfs);
 	close(drm_fd);
@@ -2008,7 +2015,7 @@ static struct option long_options[] = {
 igt_main_args("", long_options, help_str, opt_handler, NULL)
 {
 	igt_subtest("basic-rte") {
-		igt_assert(setup_environment());
+		igt_assert(setup_environment(false));
 		basic_subtest();
 	}
 
@@ -2016,7 +2023,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
 	 * PC8+. We don't want bug reports from cases where the machine is just
 	 * not properly configured. */
 	igt_fixture
-		igt_require(setup_environment());
+		igt_require(setup_environment(false));
 
 	if (stay)
 		igt_subtest("stay")
@@ -2146,7 +2153,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
 	}
 
 	igt_fixture
-		teardown_environment();
+		teardown_environment(false);
 
 	igt_subtest("module-reload") {
 		igt_debug("Reload w/o display\n");
@@ -2155,9 +2162,9 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
 		igt_kmsg(KMSG_INFO "Reloading i915 w/o display\n");
 		igt_assert_eq(igt_i915_driver_load("disable_display=1 mmio_debug=-1"), 0);
 
-		igt_assert(setup_environment());
+		igt_assert(setup_environment(true));
 		igt_assert(igt_wait(device_in_pci_d3(), 2000, 100));
-		teardown_environment();
+		teardown_environment(true);
 
 		igt_debug("Reload as normal\n");
 		igt_i915_driver_unload();
@@ -2165,11 +2172,11 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
 		igt_kmsg(KMSG_INFO "Reloading i915 as normal\n");
 		igt_assert_eq(igt_i915_driver_load("mmio_debug=-1"), 0);
 
-		igt_assert(setup_environment());
+		igt_assert(setup_environment(false));
 		igt_assert(igt_wait(device_in_pci_d3(), 2000, 100));
 		if (enable_one_screen_with_type(&ms_data, SCREEN_TYPE_ANY))
 			drm_resources_equal_subtest();
-		teardown_environment();
+		teardown_environment(false);
 
 		/* Remove our mmio_debugging module */
 		igt_i915_driver_unload();
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for lpsp platform agnostic support (rev7)
  2020-04-09  5:39 [igt-dev] [PATCH i-g-t v5 0/5] lpsp platform agnostic support Anshuman Gupta
                   ` (4 preceding siblings ...)
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 5/5] tests/i915_pm_rpm: lpsp/non-lpsp screen mode_set_data Anshuman Gupta
@ 2020-04-09  6:41 ` Patchwork
  2020-04-15 13:54 ` [igt-dev] ✗ GitLab.Pipeline: warning for lpsp platform agnostic support (rev8) Patchwork
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2020-04-09  6:41 UTC (permalink / raw)
  To: Anshuman Gupta; +Cc: igt-dev

== Series Details ==

Series: lpsp platform agnostic support (rev7)
URL   : https://patchwork.freedesktop.org/series/74647/
State : failure

== Summary ==

CI Bug Log - changes from IGT_5582 -> IGTPW_4438
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_4438 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_4438, 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/IGTPW_4438/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-glk-dsi:         [PASS][1] -> [FAIL][2] +2 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-glk-dsi/igt@i915_pm_rpm@basic-pci-d3-state.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-glk-dsi/igt@i915_pm_rpm@basic-pci-d3-state.html
    - fi-hsw-peppy:       [PASS][3] -> [FAIL][4] +2 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-hsw-peppy/igt@i915_pm_rpm@basic-pci-d3-state.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-hsw-peppy/igt@i915_pm_rpm@basic-pci-d3-state.html
    - fi-icl-u2:          [PASS][5] -> [FAIL][6] +2 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-icl-u2/igt@i915_pm_rpm@basic-pci-d3-state.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-icl-u2/igt@i915_pm_rpm@basic-pci-d3-state.html
    - fi-kbl-r:           [PASS][7] -> [FAIL][8] +2 similar issues
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-kbl-r/igt@i915_pm_rpm@basic-pci-d3-state.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-kbl-r/igt@i915_pm_rpm@basic-pci-d3-state.html
    - fi-byt-n2820:       [PASS][9] -> [FAIL][10] +2 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-byt-n2820/igt@i915_pm_rpm@basic-pci-d3-state.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-byt-n2820/igt@i915_pm_rpm@basic-pci-d3-state.html
    - fi-icl-guc:         [PASS][11] -> [FAIL][12] +2 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-icl-guc/igt@i915_pm_rpm@basic-pci-d3-state.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-icl-guc/igt@i915_pm_rpm@basic-pci-d3-state.html
    - fi-bdw-5557u:       [PASS][13] -> [FAIL][14] +2 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-bdw-5557u/igt@i915_pm_rpm@basic-pci-d3-state.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-bdw-5557u/igt@i915_pm_rpm@basic-pci-d3-state.html
    - fi-kbl-soraka:      [PASS][15] -> [FAIL][16] +2 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-kbl-soraka/igt@i915_pm_rpm@basic-pci-d3-state.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-kbl-soraka/igt@i915_pm_rpm@basic-pci-d3-state.html

  * igt@i915_pm_rpm@basic-rte:
    - fi-kbl-7500u:       [PASS][17] -> [FAIL][18] +2 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-kbl-7500u/igt@i915_pm_rpm@basic-rte.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-kbl-7500u/igt@i915_pm_rpm@basic-rte.html
    - fi-skl-lmem:        [PASS][19] -> [FAIL][20] +2 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-skl-lmem/igt@i915_pm_rpm@basic-rte.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-skl-lmem/igt@i915_pm_rpm@basic-rte.html
    - fi-cml-u2:          [PASS][21] -> [FAIL][22] +2 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-cml-u2/igt@i915_pm_rpm@basic-rte.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-cml-u2/igt@i915_pm_rpm@basic-rte.html
    - fi-bxt-dsi:         [PASS][23] -> [FAIL][24] +2 similar issues
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-bxt-dsi/igt@i915_pm_rpm@basic-rte.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-bxt-dsi/igt@i915_pm_rpm@basic-rte.html
    - fi-byt-j1900:       [PASS][25] -> [FAIL][26] +2 similar issues
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-byt-j1900/igt@i915_pm_rpm@basic-rte.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-byt-j1900/igt@i915_pm_rpm@basic-rte.html
    - fi-whl-u:           [PASS][27] -> [FAIL][28] +1 similar issue
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-whl-u/igt@i915_pm_rpm@basic-rte.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-whl-u/igt@i915_pm_rpm@basic-rte.html
    - fi-kbl-x1275:       [PASS][29] -> [FAIL][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-kbl-x1275/igt@i915_pm_rpm@basic-rte.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-kbl-x1275/igt@i915_pm_rpm@basic-rte.html
    - fi-apl-guc:         [PASS][31] -> [FAIL][32] +2 similar issues
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-apl-guc/igt@i915_pm_rpm@basic-rte.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-apl-guc/igt@i915_pm_rpm@basic-rte.html

  * igt@i915_pm_rpm@module-reload:
    - fi-cfl-8109u:       [PASS][33] -> [FAIL][34] +2 similar issues
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-cfl-8109u/igt@i915_pm_rpm@module-reload.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-cfl-8109u/igt@i915_pm_rpm@module-reload.html
    - fi-skl-6600u:       [PASS][35] -> [FAIL][36] +2 similar issues
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-skl-6600u/igt@i915_pm_rpm@module-reload.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-skl-6600u/igt@i915_pm_rpm@module-reload.html
    - fi-tgl-y:           [PASS][37] -> [FAIL][38] +2 similar issues
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-tgl-y/igt@i915_pm_rpm@module-reload.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-tgl-y/igt@i915_pm_rpm@module-reload.html
    - fi-cfl-8700k:       [PASS][39] -> [FAIL][40] +2 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-cfl-8700k/igt@i915_pm_rpm@module-reload.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-cfl-8700k/igt@i915_pm_rpm@module-reload.html
    - fi-bsw-kefka:       [PASS][41] -> [FAIL][42] +2 similar issues
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-bsw-kefka/igt@i915_pm_rpm@module-reload.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-bsw-kefka/igt@i915_pm_rpm@module-reload.html
    - fi-icl-dsi:         [PASS][43] -> [FAIL][44] +2 similar issues
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-icl-dsi/igt@i915_pm_rpm@module-reload.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-icl-dsi/igt@i915_pm_rpm@module-reload.html
    - fi-skl-guc:         [PASS][45] -> [FAIL][46] +2 similar issues
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-skl-guc/igt@i915_pm_rpm@module-reload.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-skl-guc/igt@i915_pm_rpm@module-reload.html
    - fi-bsw-n3050:       [PASS][47] -> [FAIL][48] +2 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-bsw-n3050/igt@i915_pm_rpm@module-reload.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-bsw-n3050/igt@i915_pm_rpm@module-reload.html
    - fi-skl-6700k2:      [PASS][49] -> [FAIL][50] +2 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-skl-6700k2/igt@i915_pm_rpm@module-reload.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-skl-6700k2/igt@i915_pm_rpm@module-reload.html
    - fi-cfl-guc:         [PASS][51] -> [FAIL][52] +2 similar issues
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-cfl-guc/igt@i915_pm_rpm@module-reload.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-cfl-guc/igt@i915_pm_rpm@module-reload.html
    - fi-icl-y:           [PASS][53] -> [FAIL][54] +2 similar issues
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-icl-y/igt@i915_pm_rpm@module-reload.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-icl-y/igt@i915_pm_rpm@module-reload.html
    - fi-cml-s:           [PASS][55] -> [FAIL][56] +2 similar issues
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-cml-s/igt@i915_pm_rpm@module-reload.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-cml-s/igt@i915_pm_rpm@module-reload.html

  
#### Warnings ####

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-snb-2600:        [SKIP][57] ([fdo#109271]) -> [FAIL][58] +2 similar issues
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-snb-2600/igt@i915_pm_rpm@basic-pci-d3-state.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-snb-2600/igt@i915_pm_rpm@basic-pci-d3-state.html

  * igt@i915_pm_rpm@module-reload:
    - fi-ilk-650:         [SKIP][59] ([fdo#109271]) -> [FAIL][60] +2 similar issues
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-ilk-650/igt@i915_pm_rpm@module-reload.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-ilk-650/igt@i915_pm_rpm@module-reload.html
    - fi-elk-e7500:       [SKIP][61] ([fdo#109271]) -> [FAIL][62] +2 similar issues
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-elk-e7500/igt@i915_pm_rpm@module-reload.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-elk-e7500/igt@i915_pm_rpm@module-reload.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_pm_rpm@basic-rte:
    - {fi-ehl-1}:         [PASS][63] -> [FAIL][64] +2 similar issues
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-ehl-1/igt@i915_pm_rpm@basic-rte.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-ehl-1/igt@i915_pm_rpm@basic-rte.html
    - {fi-tgl-u}:         [PASS][65] -> [FAIL][66] +2 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-tgl-u/igt@i915_pm_rpm@basic-rte.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-tgl-u/igt@i915_pm_rpm@basic-rte.html
    - {fi-tgl-dsi}:       [PASS][67] -> [FAIL][68] +2 similar issues
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-tgl-dsi/igt@i915_pm_rpm@basic-rte.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-tgl-dsi/igt@i915_pm_rpm@basic-rte.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-whl-u:           [PASS][69] -> [FAIL][70] ([i915#95])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-whl-u/igt@i915_pm_rpm@basic-pci-d3-state.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-whl-u/igt@i915_pm_rpm@basic-pci-d3-state.html
    - fi-kbl-x1275:       [PASS][71] -> [FAIL][72] ([i915#62] / [i915#95])
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-kbl-x1275/igt@i915_pm_rpm@basic-pci-d3-state.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-kbl-x1275/igt@i915_pm_rpm@basic-pci-d3-state.html

  
#### Possible fixes ####

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-cml-u2:          [DMESG-WARN][73] ([IGT#4]) -> [PASS][74]
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-cml-u2/igt@kms_chamelium@common-hpd-after-suspend.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-cml-u2/igt@kms_chamelium@common-hpd-after-suspend.html

  
#### Warnings ####

  * igt@i915_pm_rpm@module-reload:
    - fi-kbl-x1275:       [SKIP][75] ([fdo#109271]) -> [FAIL][76] ([i915#62])
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5582/fi-kbl-x1275/igt@i915_pm_rpm@module-reload.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/fi-kbl-x1275/igt@i915_pm_rpm@module-reload.html

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

  [IGT#4]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/4
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (53 -> 45)
------------------------------

  Missing    (8): fi-ilk-m540 fi-hsw-4200u fi-skl-6770hq fi-byt-squawks fi-bsw-cyan fi-kbl-8809g fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5582 -> IGTPW_4438

  CI-20190529: 20190529
  CI_DRM_8281: 4d6c69198d6840226f92f2c4645e2c8260ca3e83 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4438: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/index.html
  IGT_5582: 66a7b20f4a1f95320c0d7c8c9704749001487783 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@i915_pm_lpsp@kms-lpsp
-igt@i915_pm_lpsp@edp-native
-igt@i915_pm_lpsp@edp-panel-fitter
-igt@i915_pm_lpsp@non-edp

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4438/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 2/5] lib/igt_pm: Add lib func to get lpsp capability
  2020-04-14 16:26   ` Manna, Animesh
@ 2020-04-14 16:25     ` Anshuman Gupta
  0 siblings, 0 replies; 22+ messages in thread
From: Anshuman Gupta @ 2020-04-14 16:25 UTC (permalink / raw)
  To: Manna, Animesh; +Cc: igt-dev, jani.nikula, martin.peres

On 2020-04-14 at 21:56:47 +0530, Manna, Animesh wrote:
> 
> On 09-04-2020 11:09, Anshuman Gupta wrote:
> >This lib function evaluate the lpsp capability from
> >the connector specific debugfs attribute i915_lpsp_info.
> >
> >v2:
> >- changed the lib function prefix igt_output_is_lpsp_capable
> >   to i915_output_is_lpsp_capable. [Martin]
> >v3:
> >- early return for the connector which doesn't support
> >   lpsp on any platform.
> >v4:
> >- debugfs entry changed from i915_lpsp_info to i915_lpsp_capability.
> >
> >Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> >---
> >  lib/igt_pm.c | 37 +++++++++++++++++++++++++++++++++++++
> >  lib/igt_pm.h |  1 +
> >  2 files changed, 38 insertions(+)
> >
> >diff --git a/lib/igt_pm.c b/lib/igt_pm.c
> >index 9d441e1b..3418b69a 100644
> >--- a/lib/igt_pm.c
> >+++ b/lib/igt_pm.c
> >@@ -37,6 +37,7 @@
> >  #include <dirent.h>
> >  #include "drmtest.h"
> >+#include "igt_kms.h"
> >  #include "igt_pm.h"
> >  #include "igt_aux.h"
> >  #include "igt_sysfs.h"
> >@@ -827,3 +828,39 @@ bool igt_pm_pc8_plus_residencies_enabled(int msr_fd)
> >  	return true;
> >  }
> >+
> >+/**
> >+ * i915_output_is_lpsp_capable:
> >+ * @drm_fd: fd to drm device
> >+ * @output: igt output for which lpsp capability need to be evaluated
> >+ * Check lpsp capability for a given output.
> >+ *
> >+ * Returns:
> >+ * True if given output is lpsp capable otherwise false.
> >+ */
> >+bool i915_output_is_lpsp_capable(int drm_fd, igt_output_t *output)
> >+{
> >+	drmModeConnectorPtr c = output->config.connector;
> >+	char buf[256];
> >+	int fd, len;
> >+
> >+	/* only eDP/DP/DSI/HDMI can support LPSP */
> >+	if (c->connector_type != DRM_MODE_CONNECTOR_eDP &&
> >+	    c->connector_type != DRM_MODE_CONNECTOR_DSI &&
> >+	    c->connector_type != DRM_MODE_CONNECTOR_DisplayPort &&
> >+	    c->connector_type != DRM_MODE_CONNECTOR_HDMIA &&
> >+	    c->connector_type != DRM_MODE_CONNECTOR_HDMIB)
> >+		return false;
> 
> We can avoid check for Connector type as already taken care in kernel... rt?
Thanks for review animesh.
kernel will not create the debugfs for legacy connector in that case there will
not be any entry, as there will not be any entry later this function assert on
the debugfs entry, which will fail the test.
That is why connector check is there to return the capability false, when
there is no entry. 
Thanks,
Anshuman Gupta.
> 
> Regards,
> Animesh
> 
> >+
> >+	fd = igt_debugfs_connector_dir(drm_fd, output->name, O_RDONLY);
> >+	igt_require(fd >= 0);
> >+	len = igt_debugfs_simple_read(fd, "i915_lpsp_capability",
> >+				      buf, sizeof(buf));
> >+
> >+	if (len < 0)
> >+		igt_assert_eq(len, -ENODEV);
> >+
> >+	close(fd);
> >+
> >+	return strstr(buf, "LPSP: capable");
> >+}
> >diff --git a/lib/igt_pm.h b/lib/igt_pm.h
> >index 5e438452..162d3ca3 100644
> >--- a/lib/igt_pm.h
> >+++ b/lib/igt_pm.h
> >@@ -53,5 +53,6 @@ enum igt_runtime_pm_status igt_get_runtime_pm_status(void);
> >  bool igt_wait_for_pm_status(enum igt_runtime_pm_status status);
> >  bool igt_pm_dmc_loaded(int debugfs);
> >  bool igt_pm_pc8_plus_residencies_enabled(int msr_fd);
> >+bool i915_output_is_lpsp_capable(int drm_fd, igt_output_t *output);
> >  #endif /* IGT_PM_H */
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 2/5] lib/igt_pm: Add lib func to get lpsp capability
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 2/5] lib/igt_pm: Add lib func to get lpsp capability Anshuman Gupta
@ 2020-04-14 16:26   ` Manna, Animesh
  2020-04-14 16:25     ` Anshuman Gupta
  2020-04-15 12:48   ` Anshuman Gupta
  1 sibling, 1 reply; 22+ messages in thread
From: Manna, Animesh @ 2020-04-14 16:26 UTC (permalink / raw)
  To: Anshuman Gupta, igt-dev; +Cc: jani.nikula, martin.peres


[-- Attachment #1.1: Type: text/plain, Size: 2719 bytes --]


On 09-04-2020 11:09, Anshuman Gupta wrote:
> This lib function evaluate the lpsp capability from
> the connector specific debugfs attribute i915_lpsp_info.
>
> v2:
> - changed the lib function prefix igt_output_is_lpsp_capable
>    to i915_output_is_lpsp_capable. [Martin]
> v3:
> - early return for the connector which doesn't support
>    lpsp on any platform.
> v4:
> - debugfs entry changed from i915_lpsp_info to i915_lpsp_capability.
>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>   lib/igt_pm.c | 37 +++++++++++++++++++++++++++++++++++++
>   lib/igt_pm.h |  1 +
>   2 files changed, 38 insertions(+)
>
> diff --git a/lib/igt_pm.c b/lib/igt_pm.c
> index 9d441e1b..3418b69a 100644
> --- a/lib/igt_pm.c
> +++ b/lib/igt_pm.c
> @@ -37,6 +37,7 @@
>   #include <dirent.h>
>   
>   #include "drmtest.h"
> +#include "igt_kms.h"
>   #include "igt_pm.h"
>   #include "igt_aux.h"
>   #include "igt_sysfs.h"
> @@ -827,3 +828,39 @@ bool igt_pm_pc8_plus_residencies_enabled(int msr_fd)
>   
>   	return true;
>   }
> +
> +/**
> + * i915_output_is_lpsp_capable:
> + * @drm_fd: fd to drm device
> + * @output: igt output for which lpsp capability need to be evaluated
> + * Check lpsp capability for a given output.
> + *
> + * Returns:
> + * True if given output is lpsp capable otherwise false.
> + */
> +bool i915_output_is_lpsp_capable(int drm_fd, igt_output_t *output)
> +{
> +	drmModeConnectorPtr c = output->config.connector;
> +	char buf[256];
> +	int fd, len;
> +
> +	/* only eDP/DP/DSI/HDMI can support LPSP */
> +	if (c->connector_type != DRM_MODE_CONNECTOR_eDP &&
> +	    c->connector_type != DRM_MODE_CONNECTOR_DSI &&
> +	    c->connector_type != DRM_MODE_CONNECTOR_DisplayPort &&
> +	    c->connector_type != DRM_MODE_CONNECTOR_HDMIA &&
> +	    c->connector_type != DRM_MODE_CONNECTOR_HDMIB)
> +		return false;

We can avoid check for Connector type as already taken care in kernel... rt?

Regards,
Animesh

> +
> +	fd = igt_debugfs_connector_dir(drm_fd, output->name, O_RDONLY);
> +	igt_require(fd >= 0);
> +	len = igt_debugfs_simple_read(fd, "i915_lpsp_capability",
> +				      buf, sizeof(buf));
> +
> +	if (len < 0)
> +		igt_assert_eq(len, -ENODEV);
> +
> +	close(fd);
> +
> +	return strstr(buf, "LPSP: capable");
> +}
> diff --git a/lib/igt_pm.h b/lib/igt_pm.h
> index 5e438452..162d3ca3 100644
> --- a/lib/igt_pm.h
> +++ b/lib/igt_pm.h
> @@ -53,5 +53,6 @@ enum igt_runtime_pm_status igt_get_runtime_pm_status(void);
>   bool igt_wait_for_pm_status(enum igt_runtime_pm_status status);
>   bool igt_pm_dmc_loaded(int debugfs);
>   bool igt_pm_pc8_plus_residencies_enabled(int msr_fd);
> +bool i915_output_is_lpsp_capable(int drm_fd, igt_output_t *output);
>   
>   #endif /* IGT_PM_H */

[-- Attachment #1.2: Type: text/html, Size: 3221 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [igt-dev] [PATCH i-g-t v5 2/5] lib/igt_pm: Add lib func to get lpsp capability
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 2/5] lib/igt_pm: Add lib func to get lpsp capability Anshuman Gupta
  2020-04-14 16:26   ` Manna, Animesh
@ 2020-04-15 12:48   ` Anshuman Gupta
  2020-04-17 14:08     ` Manna, Animesh
  1 sibling, 1 reply; 22+ messages in thread
From: Anshuman Gupta @ 2020-04-15 12:48 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, martin.peres

This lib function evaluate the lpsp capability from
the connector specific debugfs attribute i915_lpsp_info.

v2:
- changed the lib function prefix igt_output_is_lpsp_capable
  to i915_output_is_lpsp_capable. [Martin]
v3:
- early return for the connector which doesn't support
  lpsp on any platform.
v4:
- debugfs entry changed from i915_lpsp_info to i915_lpsp_capability.
v5:
- return lpsp capability false if i915_lpsp_capability debugfs is not
  present. [Animesh]

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 lib/igt_pm.c | 29 +++++++++++++++++++++++++++++
 lib/igt_pm.h |  1 +
 2 files changed, 30 insertions(+)

diff --git a/lib/igt_pm.c b/lib/igt_pm.c
index 9d441e1b..b409ec46 100644
--- a/lib/igt_pm.c
+++ b/lib/igt_pm.c
@@ -37,6 +37,7 @@
 #include <dirent.h>
 
 #include "drmtest.h"
+#include "igt_kms.h"
 #include "igt_pm.h"
 #include "igt_aux.h"
 #include "igt_sysfs.h"
@@ -827,3 +828,31 @@ bool igt_pm_pc8_plus_residencies_enabled(int msr_fd)
 
 	return true;
 }
+
+/**
+ * i915_output_is_lpsp_capable:
+ * @drm_fd: fd to drm device
+ * @output: igt output for which lpsp capability need to be evaluated
+ * Check lpsp capability for a given output.
+ *
+ * Returns:
+ * True if given output is lpsp capable otherwise false.
+ */
+bool i915_output_is_lpsp_capable(int drm_fd, igt_output_t *output)
+{
+	char buf[256];
+	int fd, len;
+
+	fd = igt_debugfs_connector_dir(drm_fd, output->name, O_RDONLY);
+	igt_require(fd >= 0);
+	len = igt_debugfs_simple_read(fd, "i915_lpsp_capability",
+				      buf, sizeof(buf));
+
+	/* if i915_lpsp_capability not present return the capability as false */
+	if (len < 0)
+		return false;
+
+	close(fd);
+
+	return strstr(buf, "LPSP: capable");
+}
diff --git a/lib/igt_pm.h b/lib/igt_pm.h
index 5e438452..162d3ca3 100644
--- a/lib/igt_pm.h
+++ b/lib/igt_pm.h
@@ -53,5 +53,6 @@ enum igt_runtime_pm_status igt_get_runtime_pm_status(void);
 bool igt_wait_for_pm_status(enum igt_runtime_pm_status status);
 bool igt_pm_dmc_loaded(int debugfs);
 bool igt_pm_pc8_plus_residencies_enabled(int msr_fd);
+bool i915_output_is_lpsp_capable(int drm_fd, igt_output_t *output);
 
 #endif /* IGT_PM_H */
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [igt-dev] ✗ GitLab.Pipeline: warning for lpsp platform agnostic support (rev8)
  2020-04-09  5:39 [igt-dev] [PATCH i-g-t v5 0/5] lpsp platform agnostic support Anshuman Gupta
                   ` (5 preceding siblings ...)
  2020-04-09  6:41 ` [igt-dev] ✗ Fi.CI.BAT: failure for lpsp platform agnostic support (rev7) Patchwork
@ 2020-04-15 13:54 ` Patchwork
  2020-04-15 14:02 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
  2020-04-16  9:10 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  8 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2020-04-15 13:54 UTC (permalink / raw)
  To: Anshuman Gupta; +Cc: igt-dev

== Series Details ==

Series: lpsp platform agnostic support (rev8)
URL   : https://patchwork.freedesktop.org/series/74647/
State : warning

== Summary ==

Did not get list of undocumented tests for this run, something is wrong!

Other than that, pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/132484 for the overview.

containers:igt has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/2289958):
  4a509257e8f228975e8d3a6dfc8662956aaa0621998b4a66e7670c2b2a996b57
  STEP 5: ENV LD_LIBRARY_PATH="/opt/igt/lib:/opt/igt/lib64:${LD_LIBRARY_PATH}"
  84516d96e31c8a35ae8211ab2ad9ba61fd77bf53e2e8d8c6c654f74049f30c89
  STEP 6: ENV IGT_TEST_ROOT="/opt/igt/libexec/igt-gpu-tools"
  c62a4309e9c2caafa4c80a1404cc5f87d4e1981418075642a6cbe5b984fd6c4c
  STEP 7: CMD docker-help.sh
  STEP 8: COMMIT registry.freedesktop.org/gfx-ci/igt-ci-tags/igt:commit-91cd832c8024bc4e03537095ea2ad473a8575675
  d1856d9fda721b5993623699fcf2a37aa6901d9b6a2374b2311f2fa156d2c412
  Getting image source signatures
  Copying blob sha256:2f6357b310fc9944464328923ebb6c912fccc71897166789e96d2894c07c6f44
  Copying blob sha256:3504a8337d3b7eaabfd338d6a971d02441d28ebef8bd81f730d87f936ed58079
  Copying blob sha256:12ed85123637d650138fcc3efcf9f20b41d76447302ffd104b28a3b2165dfedb
  Error: Error copying image to the remote destination: Error writing blob: Patch https://registry.freedesktop.org/v2/gfx-ci/igt-ci-tags/igt/blobs/uploads/f99ed8da-e6f7-49c6-853e-0b4dba4ddddb?_state=wUh9d9EcLzjRR7q2-qwhPEENFSUCXmhWs2iH4LYG98R7Ik5hbWUiOiJnZngtY2kvaWd0LWNpLXRhZ3MvaWd0IiwiVVVJRCI6ImY5OWVkOGRhLWU2ZjctNDljNi04NTNlLTBiNGRiYTRkZGRkYiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMC0wNC0xNVQxMzo1MToyNS41MzA5ODkwMjdaIn0%3D: EOF
  section_end:1586958701:build_script
  section_start:1586958701:after_script
  section_end:1586958703:after_script
  section_start:1586958703:upload_artifacts_on_failure
  section_end:1586958704:upload_artifacts_on_failure
  ERROR: Job failed: exit code 1

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/132484
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for lpsp platform agnostic support (rev8)
  2020-04-09  5:39 [igt-dev] [PATCH i-g-t v5 0/5] lpsp platform agnostic support Anshuman Gupta
                   ` (6 preceding siblings ...)
  2020-04-15 13:54 ` [igt-dev] ✗ GitLab.Pipeline: warning for lpsp platform agnostic support (rev8) Patchwork
@ 2020-04-15 14:02 ` Patchwork
  2020-04-16  9:10 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  8 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2020-04-15 14:02 UTC (permalink / raw)
  To: Anshuman Gupta; +Cc: igt-dev

== Series Details ==

Series: lpsp platform agnostic support (rev8)
URL   : https://patchwork.freedesktop.org/series/74647/
State : success

== Summary ==

CI Bug Log - changes from IGT_5591 -> IGTPW_4467
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_pm_rpm@basic-rte:
    - fi-icl-dsi:         [PASS][1] -> [INCOMPLETE][2] ([i915#189])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/fi-icl-dsi/igt@i915_pm_rpm@basic-rte.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/fi-icl-dsi/igt@i915_pm_rpm@basic-rte.html

  * igt@i915_pm_rpm@module-reload:
    - fi-kbl-8809g:       [PASS][3] -> [SKIP][4] ([fdo#109271])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/fi-kbl-8809g/igt@i915_pm_rpm@module-reload.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/fi-kbl-8809g/igt@i915_pm_rpm@module-reload.html

  
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#189]: https://gitlab.freedesktop.org/drm/intel/issues/189


Participating hosts (52 -> 44)
------------------------------

  Missing    (8): fi-bdw-samus fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-kbl-7560u fi-byt-clapper fi-skl-6600u 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5591 -> IGTPW_4467

  CI-20190529: 20190529
  CI_DRM_8301: 7d2bdd2df0d18945bb274de8bc7560e14779e346 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4467: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/index.html
  IGT_5591: f57b7fdbe8d04ce3edf0433a03c7d9d5c3d96680 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@i915_pm_lpsp@kms-lpsp
-igt@i915_pm_lpsp@edp-native
-igt@i915_pm_lpsp@edp-panel-fitter
-igt@i915_pm_lpsp@non-edp

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [igt-dev] ✗ Fi.CI.IGT: failure for lpsp platform agnostic support (rev8)
  2020-04-09  5:39 [igt-dev] [PATCH i-g-t v5 0/5] lpsp platform agnostic support Anshuman Gupta
                   ` (7 preceding siblings ...)
  2020-04-15 14:02 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
@ 2020-04-16  9:10 ` Patchwork
  8 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2020-04-16  9:10 UTC (permalink / raw)
  To: Anshuman Gupta; +Cc: igt-dev

== Series Details ==

Series: lpsp platform agnostic support (rev8)
URL   : https://patchwork.freedesktop.org/series/74647/
State : failure

== Summary ==

CI Bug Log - changes from IGT_5591_full -> IGTPW_4467_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_4467_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_4467_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://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-edp-1} (NEW):
    - shard-tglb:         NOTRUN -> [SKIP][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-tglb2/igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-edp-1.html
    - shard-iclb:         NOTRUN -> [SKIP][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-iclb6/igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-edp-1.html

  * igt@i915_pm_lpsp@screens-disabled:
    - shard-hsw:          [PASS][3] -> [FAIL][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-hsw4/igt@i915_pm_lpsp@screens-disabled.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-hsw1/igt@i915_pm_lpsp@screens-disabled.html

  * igt@i915_pm_rpm@dpms-lpsp:
    - shard-iclb:         [PASS][5] -> [SKIP][6] +4 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-iclb6/igt@i915_pm_rpm@dpms-lpsp.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-iclb7/igt@i915_pm_rpm@dpms-lpsp.html

  
#### Warnings ####

  * igt@i915_pm_lpsp@screens-disabled:
    - shard-tglb:         [SKIP][7] ([fdo#109301]) -> [FAIL][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-tglb7/igt@i915_pm_lpsp@screens-disabled.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-tglb1/igt@i915_pm_lpsp@screens-disabled.html
    - shard-snb:          [SKIP][9] ([fdo#109271]) -> [FAIL][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-snb5/igt@i915_pm_lpsp@screens-disabled.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-snb2/igt@i915_pm_lpsp@screens-disabled.html
    - shard-glk:          [SKIP][11] ([fdo#109271]) -> [FAIL][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-glk9/igt@i915_pm_lpsp@screens-disabled.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-glk4/igt@i915_pm_lpsp@screens-disabled.html
    - shard-iclb:         [SKIP][13] ([fdo#109301]) -> [FAIL][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-iclb7/igt@i915_pm_lpsp@screens-disabled.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-iclb4/igt@i915_pm_lpsp@screens-disabled.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * {igt@kms_flip@flip-vs-expired-vblank-interruptible@c-hdmi-a2}:
    - shard-glk:          [PASS][15] -> [FAIL][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-glk9/igt@kms_flip@flip-vs-expired-vblank-interruptible@c-hdmi-a2.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-glk5/igt@kms_flip@flip-vs-expired-vblank-interruptible@c-hdmi-a2.html

  
New tests
---------

  New tests have been introduced between IGT_5591_full and IGTPW_4467_full:

### New IGT tests (20) ###

  * igt@i915_pm_lpsp@kms-lpsp:
    - Statuses :
    - Exec time: [None] s

  * igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-edp-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-hdmi-a-2:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-vga-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_flip@2x-flip-vs-panning-interruptible@ab-hdmi-a1-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [10.56] s

  * igt@kms_flip@2x-flip-vs-panning-interruptible@ac-hdmi-a1-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [10.52] s

  * igt@kms_flip@2x-flip-vs-panning-interruptible@bc-hdmi-a1-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [10.46] s

  * igt@kms_flip@2x-single-buffer-flip-vs-dpms-off-vs-modeset-interruptible@ab-hdmi-a1-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [1.47] s

  * igt@kms_flip@2x-single-buffer-flip-vs-dpms-off-vs-modeset-interruptible@ac-hdmi-a1-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [1.19] s

  * igt@kms_flip@2x-single-buffer-flip-vs-dpms-off-vs-modeset-interruptible@bc-hdmi-a1-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [1.15] s

  * igt@kms_flip@dpms-off-confusion-interruptible@a-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [5.28] s

  * igt@kms_flip@dpms-off-confusion-interruptible@b-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [5.26] s

  * igt@kms_flip@dpms-off-confusion-interruptible@c-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [5.27] s

  * igt@kms_flip@dpms-off-confusion-interruptible@d-edp1:
    - Statuses : 1 pass(s)
    - Exec time: [8.70] s

  * igt@kms_flip@dpms-vs-vblank-race-interruptible@a-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [2.10] s

  * igt@kms_flip@dpms-vs-vblank-race-interruptible@b-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [2.27] s

  * igt@kms_flip@dpms-vs-vblank-race-interruptible@c-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [2.20] s

  * igt@kms_flip@dpms-vs-vblank-race-interruptible@d-edp1:
    - Statuses : 1 pass(s)
    - Exec time: [3.65] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_params@invalid-bsd-ring:
    - shard-iclb:         [PASS][17] -> [SKIP][18] ([fdo#109276])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-iclb4/igt@gem_exec_params@invalid-bsd-ring.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-iclb6/igt@gem_exec_params@invalid-bsd-ring.html

  * igt@i915_pm_rpm@gem-idle:
    - shard-iclb:         [PASS][19] -> [SKIP][20] ([i915#579])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-iclb3/igt@i915_pm_rpm@gem-idle.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-iclb4/igt@i915_pm_rpm@gem-idle.html
    - shard-glk:          [PASS][21] -> [SKIP][22] ([fdo#109271])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-glk6/igt@i915_pm_rpm@gem-idle.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-glk4/igt@i915_pm_rpm@gem-idle.html
    - shard-tglb:         [PASS][23] -> [SKIP][24] ([i915#579])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-tglb8/igt@i915_pm_rpm@gem-idle.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-tglb1/igt@i915_pm_rpm@gem-idle.html
    - shard-hsw:          [PASS][25] -> [SKIP][26] ([fdo#109271])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-hsw1/igt@i915_pm_rpm@gem-idle.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-hsw1/igt@i915_pm_rpm@gem-idle.html

  * igt@i915_pm_rpm@modeset-lpsp-stress:
    - shard-tglb:         [PASS][27] -> [SKIP][28] ([i915#1397]) +4 similar issues
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-tglb7/igt@i915_pm_rpm@modeset-lpsp-stress.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-tglb6/igt@i915_pm_rpm@modeset-lpsp-stress.html

  * igt@i915_suspend@sysfs-reader:
    - shard-apl:          [PASS][29] -> [DMESG-WARN][30] ([i915#180]) +3 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl6/igt@i915_suspend@sysfs-reader.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl1/igt@i915_suspend@sysfs-reader.html

  * igt@kms_cursor_crc@pipe-a-cursor-64x64-offscreen:
    - shard-kbl:          [PASS][31] -> [FAIL][32] ([i915#54] / [i915#93] / [i915#95]) +1 similar issue
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl1/igt@kms_cursor_crc@pipe-a-cursor-64x64-offscreen.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl6/igt@kms_cursor_crc@pipe-a-cursor-64x64-offscreen.html

  * igt@kms_cursor_crc@pipe-a-cursor-64x64-random:
    - shard-apl:          [PASS][33] -> [FAIL][34] ([i915#54] / [i915#95]) +1 similar issue
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl2/igt@kms_cursor_crc@pipe-a-cursor-64x64-random.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl1/igt@kms_cursor_crc@pipe-a-cursor-64x64-random.html

  * igt@kms_cursor_crc@pipe-a-cursor-suspend:
    - shard-kbl:          [PASS][35] -> [DMESG-WARN][36] ([i915#180]) +2 similar issues
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl3/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl1/igt@kms_cursor_crc@pipe-a-cursor-suspend.html

  * igt@kms_cursor_crc@pipe-c-cursor-64x21-sliding:
    - shard-glk:          [PASS][37] -> [FAIL][38] ([i915#54])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-glk5/igt@kms_cursor_crc@pipe-c-cursor-64x21-sliding.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-glk8/igt@kms_cursor_crc@pipe-c-cursor-64x21-sliding.html
    - shard-apl:          [PASS][39] -> [FAIL][40] ([i915#54])
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl6/igt@kms_cursor_crc@pipe-c-cursor-64x21-sliding.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl8/igt@kms_cursor_crc@pipe-c-cursor-64x21-sliding.html
    - shard-kbl:          [PASS][41] -> [FAIL][42] ([i915#54])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl3/igt@kms_cursor_crc@pipe-c-cursor-64x21-sliding.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl6/igt@kms_cursor_crc@pipe-c-cursor-64x21-sliding.html

  * igt@kms_draw_crc@draw-method-rgb565-pwrite-xtiled:
    - shard-glk:          [PASS][43] -> [FAIL][44] ([i915#52] / [i915#54])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-glk5/igt@kms_draw_crc@draw-method-rgb565-pwrite-xtiled.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-glk4/igt@kms_draw_crc@draw-method-rgb565-pwrite-xtiled.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
    - shard-apl:          [PASS][45] -> [FAIL][46] ([i915#49])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl3/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move.html
    - shard-kbl:          [PASS][47] -> [FAIL][48] ([i915#49])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - shard-kbl:          [PASS][49] -> [FAIL][50] ([i915#53] / [i915#93] / [i915#95])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl4/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl7/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
    - shard-apl:          [PASS][51] -> [FAIL][52] ([i915#53] / [i915#95])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl4/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl8/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html

  * igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
    - shard-apl:          [PASS][53] -> [FAIL][54] ([fdo#108145] / [i915#265] / [i915#95])
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl3/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl1/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html

  * igt@kms_prime@basic-crc:
    - shard-apl:          [PASS][55] -> [FAIL][56] ([i915#1031] / [i915#95])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl4/igt@kms_prime@basic-crc.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl6/igt@kms_prime@basic-crc.html
    - shard-kbl:          [PASS][57] -> [FAIL][58] ([i915#1031] / [i915#93] / [i915#95])
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl2/igt@kms_prime@basic-crc.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl7/igt@kms_prime@basic-crc.html

  * igt@perf@gen12-mi-rpc:
    - shard-tglb:         [PASS][59] -> [FAIL][60] ([i915#1085])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-tglb7/igt@perf@gen12-mi-rpc.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-tglb7/igt@perf@gen12-mi-rpc.html

  
#### Possible fixes ####

  * igt@gen9_exec_parse@allowed-all:
    - shard-kbl:          [DMESG-WARN][61] ([i915#716]) -> [PASS][62]
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl3/igt@gen9_exec_parse@allowed-all.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl7/igt@gen9_exec_parse@allowed-all.html

  * igt@i915_pm_dc@dc6-dpms:
    - shard-iclb:         [FAIL][63] ([i915#454]) -> [PASS][64]
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-iclb3/igt@i915_pm_dc@dc6-dpms.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-iclb2/igt@i915_pm_dc@dc6-dpms.html

  * igt@i915_pm_rpm@dpms-mode-unset-non-lpsp:
    - shard-tglb:         [SKIP][65] ([fdo#111644] / [i915#1397]) -> [PASS][66] +4 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-tglb7/igt@i915_pm_rpm@dpms-mode-unset-non-lpsp.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-tglb5/igt@i915_pm_rpm@dpms-mode-unset-non-lpsp.html

  * igt@i915_pm_rpm@modeset-non-lpsp:
    - shard-iclb:         [SKIP][67] ([fdo#110892]) -> [PASS][68] +4 similar issues
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-iclb3/igt@i915_pm_rpm@modeset-non-lpsp.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-iclb1/igt@i915_pm_rpm@modeset-non-lpsp.html

  * igt@kms_big_fb@linear-32bpp-rotate-180:
    - shard-apl:          [FAIL][69] ([i915#1119] / [i915#95]) -> [PASS][70] +1 similar issue
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl2/igt@kms_big_fb@linear-32bpp-rotate-180.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl7/igt@kms_big_fb@linear-32bpp-rotate-180.html
    - shard-kbl:          [FAIL][71] ([i915#1119] / [i915#93] / [i915#95]) -> [PASS][72] +1 similar issue
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl3/igt@kms_big_fb@linear-32bpp-rotate-180.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl2/igt@kms_big_fb@linear-32bpp-rotate-180.html

  * igt@kms_cursor_crc@pipe-a-cursor-64x21-onscreen:
    - shard-kbl:          [FAIL][73] ([i915#54] / [i915#93] / [i915#95]) -> [PASS][74] +2 similar issues
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl6/igt@kms_cursor_crc@pipe-a-cursor-64x21-onscreen.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl1/igt@kms_cursor_crc@pipe-a-cursor-64x21-onscreen.html

  * igt@kms_cursor_crc@pipe-b-cursor-suspend:
    - shard-apl:          [DMESG-WARN][75] ([i915#180]) -> [PASS][76] +1 similar issue
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl4/igt@kms_cursor_crc@pipe-b-cursor-suspend.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl7/igt@kms_cursor_crc@pipe-b-cursor-suspend.html

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
    - shard-glk:          [FAIL][77] ([i915#72]) -> [PASS][78]
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-glk6/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-glk7/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy.html

  * igt@kms_draw_crc@draw-method-rgb565-render-untiled:
    - shard-glk:          [FAIL][79] ([i915#52] / [i915#54]) -> [PASS][80] +6 similar issues
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-glk5/igt@kms_draw_crc@draw-method-rgb565-render-untiled.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-glk7/igt@kms_draw_crc@draw-method-rgb565-render-untiled.html

  * igt@kms_draw_crc@draw-method-xrgb8888-mmap-gtt-untiled:
    - shard-apl:          [FAIL][81] ([i915#52] / [i915#54] / [i915#95]) -> [PASS][82]
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl7/igt@kms_draw_crc@draw-method-xrgb8888-mmap-gtt-untiled.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl8/igt@kms_draw_crc@draw-method-xrgb8888-mmap-gtt-untiled.html

  * igt@kms_fbcon_fbt@psr-suspend:
    - shard-tglb:         [INCOMPLETE][83] ([i915#456] / [i915#460]) -> [PASS][84]
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-tglb8/igt@kms_fbcon_fbt@psr-suspend.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-tglb8/igt@kms_fbcon_fbt@psr-suspend.html

  * {igt@kms_flip@flip-vs-expired-vblank@a-hdmi-a1}:
    - shard-glk:          [FAIL][85] -> [PASS][86]
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-glk5/igt@kms_flip@flip-vs-expired-vblank@a-hdmi-a1.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-glk4/igt@kms_flip@flip-vs-expired-vblank@a-hdmi-a1.html

  * {igt@kms_flip@flip-vs-suspend-interruptible@a-dp1}:
    - shard-kbl:          [DMESG-WARN][87] ([i915#180]) -> [PASS][88] +7 similar issues
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl7/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl1/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-draw-mmap-cpu:
    - shard-glk:          [FAIL][89] ([i915#49]) -> [PASS][90]
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-glk4/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-draw-mmap-cpu.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-glk5/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-draw-mmap-cpu.html

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
    - shard-kbl:          [FAIL][91] ([i915#53] / [i915#93] / [i915#95]) -> [PASS][92]
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl1/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl2/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html
    - shard-apl:          [FAIL][93] ([i915#53] / [i915#95]) -> [PASS][94]
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl7/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl2/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html

  * igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
    - shard-kbl:          [FAIL][95] ([fdo#108145] / [i915#265] / [i915#93] / [i915#95]) -> [PASS][96]
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl6/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl4/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
    - shard-apl:          [FAIL][97] ([fdo#108145] / [i915#265] / [i915#95]) -> [PASS][98]
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl8/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl4/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html

  * igt@kms_psr@psr2_sprite_mmap_gtt:
    - shard-iclb:         [SKIP][99] ([fdo#109441]) -> [PASS][100] +1 similar issue
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-iclb3/igt@kms_psr@psr2_sprite_mmap_gtt.html
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_gtt.html

  
#### Warnings ####

  * igt@i915_pm_dc@dc6-psr:
    - shard-snb:          [INCOMPLETE][101] ([i915#82]) -> [SKIP][102] ([fdo#109271])
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-snb5/igt@i915_pm_dc@dc6-psr.html
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-snb6/igt@i915_pm_dc@dc6-psr.html

  * igt@kms_fbcon_fbt@fbc:
    - shard-apl:          [FAIL][103] ([i915#95]) -> [FAIL][104] ([i915#1525] / [i915#95])
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl2/igt@kms_fbcon_fbt@fbc.html
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl2/igt@kms_fbcon_fbt@fbc.html

  * igt@kms_fbcon_fbt@fbc-suspend:
    - shard-apl:          [FAIL][105] ([i915#95]) -> [DMESG-FAIL][106] ([i915#180] / [i915#95])
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-apl1/igt@kms_fbcon_fbt@fbc-suspend.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-apl8/igt@kms_fbcon_fbt@fbc-suspend.html
    - shard-kbl:          [FAIL][107] ([i915#93] / [i915#95]) -> [DMESG-FAIL][108] ([i915#180] / [i915#95])
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl4/igt@kms_fbcon_fbt@fbc-suspend.html
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl7/igt@kms_fbcon_fbt@fbc-suspend.html

  * igt@runner@aborted:
    - shard-kbl:          ([FAIL][109], [FAIL][110]) ([i915#1423] / [i915#716] / [i915#92]) -> [FAIL][111] ([i915#1423] / [i915#92])
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl4/igt@runner@aborted.html
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5591/shard-kbl3/igt@runner@aborted.html
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/shard-kbl4/igt@runner@aborted.html

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

  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109301]: https://bugs.freedesktop.org/show_bug.cgi?id=109301
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#110892]: https://bugs.freedesktop.org/show_bug.cgi?id=110892
  [fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
  [i915#1031]: https://gitlab.freedesktop.org/drm/intel/issues/1031
  [i915#1085]: https://gitlab.freedesktop.org/drm/intel/issues/1085
  [i915#1119]: https://gitlab.freedesktop.org/drm/intel/issues/1119
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#1423]: https://gitlab.freedesktop.org/drm/intel/issues/1423
  [i915#1525]: https://gitlab.freedesktop.org/drm/intel/issues/1525
  [i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#456]: https://gitlab.freedesktop.org/drm/intel/issues/456
  [i915#460]: https://gitlab.freedesktop.org/drm/intel/issues/460
  [i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
  [i915#52]: https://gitlab.freedesktop.org/drm/intel/issues/52
  [i915#53]: https://gitlab.freedesktop.org/drm/intel/issues/53
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#579]: https://gitlab.freedesktop.org/drm/intel/issues/579
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
  [i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
  [i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
  [i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (8 -> 8)
------------------------------

  No changes in participating hosts


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5591 -> IGTPW_4467

  CI-20190529: 20190529
  CI_DRM_8301: 7d2bdd2df0d18945bb274de8bc7560e14779e346 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4467: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/index.html
  IGT_5591: f57b7fdbe8d04ce3edf0433a03c7d9d5c3d96680 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4467/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 2/5] lib/igt_pm: Add lib func to get lpsp capability
  2020-04-15 12:48   ` Anshuman Gupta
@ 2020-04-17 14:08     ` Manna, Animesh
  0 siblings, 0 replies; 22+ messages in thread
From: Manna, Animesh @ 2020-04-17 14:08 UTC (permalink / raw)
  To: Anshuman Gupta, igt-dev; +Cc: jani.nikula, martin.peres


[-- Attachment #1.1: Type: text/plain, Size: 2441 bytes --]


On 15-04-2020 18:18, Anshuman Gupta wrote:
> This lib function evaluate the lpsp capability from
> the connector specific debugfs attribute i915_lpsp_info.
>
> v2:
> - changed the lib function prefix igt_output_is_lpsp_capable
>    to i915_output_is_lpsp_capable. [Martin]
> v3:
> - early return for the connector which doesn't support
>    lpsp on any platform.
> v4:
> - debugfs entry changed from i915_lpsp_info to i915_lpsp_capability.
> v5:
> - return lpsp capability false if i915_lpsp_capability debugfs is not
>    present. [Animesh]
>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>

looks good to me.
Reviewed-by: Animesh Manna <animesh.manna@intel.com>

> ---
>   lib/igt_pm.c | 29 +++++++++++++++++++++++++++++
>   lib/igt_pm.h |  1 +
>   2 files changed, 30 insertions(+)
>
> diff --git a/lib/igt_pm.c b/lib/igt_pm.c
> index 9d441e1b..b409ec46 100644
> --- a/lib/igt_pm.c
> +++ b/lib/igt_pm.c
> @@ -37,6 +37,7 @@
>   #include <dirent.h>
>   
>   #include "drmtest.h"
> +#include "igt_kms.h"
>   #include "igt_pm.h"
>   #include "igt_aux.h"
>   #include "igt_sysfs.h"
> @@ -827,3 +828,31 @@ bool igt_pm_pc8_plus_residencies_enabled(int msr_fd)
>   
>   	return true;
>   }
> +
> +/**
> + * i915_output_is_lpsp_capable:
> + * @drm_fd: fd to drm device
> + * @output: igt output for which lpsp capability need to be evaluated
> + * Check lpsp capability for a given output.
> + *
> + * Returns:
> + * True if given output is lpsp capable otherwise false.
> + */
> +bool i915_output_is_lpsp_capable(int drm_fd, igt_output_t *output)
> +{
> +	char buf[256];
> +	int fd, len;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, output->name, O_RDONLY);
> +	igt_require(fd >= 0);
> +	len = igt_debugfs_simple_read(fd, "i915_lpsp_capability",
> +				      buf, sizeof(buf));
> +
> +	/* if i915_lpsp_capability not present return the capability as false */
> +	if (len < 0)
> +		return false;
> +
> +	close(fd);
> +
> +	return strstr(buf, "LPSP: capable");
> +}
> diff --git a/lib/igt_pm.h b/lib/igt_pm.h
> index 5e438452..162d3ca3 100644
> --- a/lib/igt_pm.h
> +++ b/lib/igt_pm.h
> @@ -53,5 +53,6 @@ enum igt_runtime_pm_status igt_get_runtime_pm_status(void);
>   bool igt_wait_for_pm_status(enum igt_runtime_pm_status status);
>   bool igt_pm_dmc_loaded(int debugfs);
>   bool igt_pm_pc8_plus_residencies_enabled(int msr_fd);
> +bool i915_output_is_lpsp_capable(int drm_fd, igt_output_t *output);
>   
>   #endif /* IGT_PM_H */

[-- Attachment #1.2: Type: text/html, Size: 2981 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 3/5] tests/i915_pm_lpsp: lpsp platform agnostic support
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 3/5] tests/i915_pm_lpsp: lpsp platform agnostic support Anshuman Gupta
@ 2020-04-17 14:22   ` Manna, Animesh
  2020-04-17 15:28     ` Anshuman Gupta
  0 siblings, 1 reply; 22+ messages in thread
From: Manna, Animesh @ 2020-04-17 14:22 UTC (permalink / raw)
  To: Anshuman Gupta, igt-dev; +Cc: jani.nikula, martin.peres


[-- Attachment #1.1: Type: text/plain, Size: 11703 bytes --]


On 09-04-2020 11:09, Anshuman Gupta wrote:
> Current implementation of lpsp igt test, assumed that every non-edp
> panel isn't a lpsp panel but it is not true on TGL anymore,
> any HDMI/DP/DSI panel connected on pipe A and connected to PORT_{A,B,C}
> can drive LPSP.
> Even on older Gen9 platform a DP panel can drive lpsp on Port A.
> This requires complete design change in current lpsp igt for a platform
> agnostic support.
>
> The new igt approach is relies on connector specific
> i915_lpsp_capability and i915_lpsp_status debugfs attributes,
> these debugfs exposes whether an output is capable of driving lpsp
> and lpsp is enabled.
>
> Nuking edp-native and non-edp test, introducing a new dynamic
> igt subtest kms-lpsp, which validates lpsp on each connected output
> and skip the subtest if output is not lpsp capable.
>
> v2:
> - CI failures fixup.
> v3:
> - removed unloading of snd_modules. [Martin]
> v4:
> - Don't test non-lpsp(if lpsp disabled), no ROI to test that.
> - nuke panel-fitter test.
> v5:
> - Added dynamic subtest and igt changes according to kernel
>    debugfs i915_lpsp_status changes.
>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>   tests/i915/i915_pm_lpsp.c | 285 +++++++++++++++-----------------------
>   1 file changed, 114 insertions(+), 171 deletions(-)
>
> diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
> index 08f82e7c..7be23e6c 100644
> --- a/tests/i915/i915_pm_lpsp.c
> +++ b/tests/i915/i915_pm_lpsp.c
> @@ -25,210 +25,153 @@
>    */
>   
>   #include "igt.h"
> +#include "igt_kmod.h"
> +#include "igt_pm.h"
> +#include "igt_sysfs.h"
>   #include <sys/types.h>
>   #include <sys/stat.h>
>   #include <fcntl.h>
>   #include <unistd.h>
>   
> +#define MAX_SINK_LPSP_INFO_BUF_LEN	4096
>   
> -static bool supports_lpsp(uint32_t devid)
> -{
> -	return IS_HASWELL(devid) || IS_BROADWELL(devid);
> -}
> +#define PWR_DOMAIN_INFO "i915_power_domain_info"
>   
> -static bool lpsp_is_enabled(int drm_fd)
> +typedef struct {
> +	int drm_fd;
> +	int debugfs_fd;
> +	uint32_t devid;
> +	char *pwr_dmn_info;
> +	igt_display_t display;
> +	struct igt_fb fb;
> +	drmModeModeInfo *mode;
> +	igt_output_t *output;
> +} data_t;
> +
> +static bool lpsp_is_enabled(data_t *data)
>   {
> -	uint32_t val;
> +	char buf[MAX_SINK_LPSP_INFO_BUF_LEN];
> +	int len;
>   
> -	val = INREG(HSW_PWR_WELL_CTL2);
> -	return !(val & HSW_PWR_WELL_STATE_ENABLED);
> -}
> +	len = igt_debugfs_simple_read(data->debugfs_fd, "i915_lpsp_status",
> +				      buf, sizeof(buf));
> +	if (len < 0)
> +		igt_assert_eq(len, -ENODEV);
>   
> -/* The LPSP mode is all about an enabled pipe, but we expect to also be in the
> - * low power mode when no pipes are enabled, so do this check anyway. */
> -static void screens_disabled_subtest(int drm_fd, drmModeResPtr drm_res)
> -{
> -	kmstest_unset_all_crtcs(drm_fd, drm_res);
> -	igt_assert(lpsp_is_enabled(drm_fd));
> +	return strstr(buf, "LPSP: enabled");
>   }
>   
> -static uint32_t create_fb(int drm_fd, int width, int height)
> +/*
> + * The LPSP mode is all about an enabled pipe, but we expect to also be in the
> + * low power mode when no pipes are enabled, so do this check anyway.
> + */
All pipe disabled in not same as lpsp. I feel the idea behind lpsp is 
single pipe usage with least power consumption ... there maybe no 
display connected.
> +static void screens_disabled_subtest(data_t *data)
>   {
> -	struct igt_fb fb;
> +	igt_output_t *output;
> +	int valid_output = 0;
> +	enum pipe pipe;
> +
> +	for_each_pipe_with_single_output(&data->display, pipe, output) {
> +		data->output = output;
> +		igt_output_set_pipe(data->output, PIPE_NONE);

Passing PIPE_NONE and testing lpsp maybe not the right thing here. We 
may not have connector but need to enable a single pipe to test lpsp...  rt?

Regards,

Animesh

> +		igt_display_commit(&data->display);
> +		valid_output++;
> +	}
>   
> -	return igt_create_pattern_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888,
> -				     LOCAL_DRM_FORMAT_MOD_NONE, &fb);
> +	igt_require_f(valid_output, "No connected output found\n");
> +	igt_assert_f(lpsp_is_enabled(data), "lpsp is not enabled\n%s:\n%s\n",
> +		     PWR_DOMAIN_INFO, data->pwr_dmn_info =
> +		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
>   }
>   
> -static void edp_subtest(int drm_fd, drmModeResPtr drm_res,
> -			drmModeConnectorPtr *drm_connectors, uint32_t devid,
> -			bool use_panel_fitter)
> +static void setup_lpsp_output(data_t *data)
>   {
> -	int i, rc;
> -	uint32_t crtc_id = 0, buffer_id = 0;
> -	drmModeConnectorPtr connector = NULL;
> -	drmModeModeInfoPtr mode = NULL;
> -	drmModeModeInfo std_1024_mode = {
> -		.clock = 65000,
> -		.hdisplay = 1024,
> -		.hsync_start = 1048,
> -		.hsync_end = 1184,
> -		.htotal = 1344,
> -		.hskew = 0,
> -		.vdisplay = 768,
> -		.vsync_start = 771,
> -		.vsync_end = 777,
> -		.vtotal = 806,
> -		.vscan = 0,
> -		.vrefresh = 60,
> -		.flags = 0xA,
> -		.type = 0x40,
> -		.name = "Custom 1024x768",
> -	};
> -
> -	kmstest_unset_all_crtcs(drm_fd, drm_res);
> -
> -	for (i = 0; i < drm_res->count_connectors; i++) {
> -		drmModeConnectorPtr c = drm_connectors[i];
> -
> -		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
> -			continue;
> -		if (c->connection != DRM_MODE_CONNECTED)
> -			continue;
> -
> -		if (!use_panel_fitter && c->count_modes) {
> -			connector = c;
> -			mode = &c->modes[0];
> -			break;
> -		}
> -		if (use_panel_fitter) {
> -			connector = c;
> -
> -			/* This is one of the modes Xorg creates for panels, so
> -			 * it should work just fine. Notice that Gens that
> -			 * support LPSP are too new for panels with native
> -			 * 1024x768 resolution, so this should force the panel
> -			 * fitter. */
> -			igt_assert(c->count_modes &&
> -				   c->modes[0].hdisplay > 1024);
> -			igt_assert(c->count_modes &&
> -				   c->modes[0].vdisplay > 768);
> -			mode = &std_1024_mode;
> -			break;
> -		}
> -	}
> -	igt_require(connector);
> -
> -	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
> -						  0);
> -	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
> -
> -	igt_assert(buffer_id);
> -	igt_assert(connector);
> -	igt_assert(mode);
> -
> -	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
> -			    &connector->connector_id, 1, mode);
> -	igt_assert_eq(rc, 0);
> -
> -	if (use_panel_fitter) {
> -		if (IS_HASWELL(devid))
> -			igt_assert(!lpsp_is_enabled(drm_fd));
> -		else
> -			igt_assert(lpsp_is_enabled(drm_fd));
> -	} else {
> -		igt_assert(lpsp_is_enabled(drm_fd));
> -	}
> +	igt_plane_t *primary;
> +
> +	/* set output pipe = PIPE_A for LPSP */
> +	igt_output_set_pipe(data->output, PIPE_A);
> +	primary = igt_output_get_plane_type(data->output,
> +					    DRM_PLANE_TYPE_PRIMARY);
> +	igt_plane_set_fb(primary, NULL);
> +	igt_create_pattern_fb(data->drm_fd,
> +			      data->mode->hdisplay, data->mode->vdisplay,
> +			      DRM_FORMAT_XRGB8888,
> +			      LOCAL_DRM_FORMAT_MOD_NONE,
> +			      &data->fb);
> +	igt_plane_set_fb(primary, &data->fb);
> +	igt_display_commit(&data->display);
>   }
>   
> -static void non_edp_subtest(int drm_fd, drmModeResPtr drm_res,
> -			    drmModeConnectorPtr *drm_connectors)
> +static void test_cleanup(data_t *data)
>   {
> -	int i, rc;
> -	uint32_t crtc_id = 0, buffer_id = 0;
> -	drmModeConnectorPtr connector = NULL;
> -	drmModeModeInfoPtr mode = NULL;
> -
> -	kmstest_unset_all_crtcs(drm_fd, drm_res);
> -
> -	for (i = 0; i < drm_res->count_connectors; i++) {
> -		drmModeConnectorPtr c = drm_connectors[i];
> -
> -		if (c->connector_type == DRM_MODE_CONNECTOR_eDP)
> -			continue;
> -		if (c->connection != DRM_MODE_CONNECTED)
> -			continue;
> -
> -		if (c->count_modes) {
> -			connector = c;
> -			mode = &c->modes[0];
> -			break;
> -		}
> -	}
> -	igt_require(connector);
> -
> -	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
> -						  0);
> -	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
> -
> -	igt_assert(buffer_id);
> -	igt_assert(mode);
> -
> -	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
> -			    &connector->connector_id, 1, mode);
> -	igt_assert_eq(rc, 0);
> -
> -	igt_assert(!lpsp_is_enabled(drm_fd));
> +	igt_plane_t *primary;
> +
> +	if (!data->output || data->output->pending_pipe == PIPE_NONE)
> +		return;
> +
> +	primary = igt_output_get_plane_type(data->output,
> +					    DRM_PLANE_TYPE_PRIMARY);
> +	igt_plane_set_fb(primary, NULL);
> +	igt_output_set_pipe(data->output, PIPE_NONE);
> +	igt_display_commit(&data->display);
> +	igt_remove_fb(data->drm_fd, &data->fb);
> +	data->output = NULL;
>   }
>   
> -#define MAX_CONNECTORS 32
> +static void test_lpsp(data_t *data)
> +{
> +	/* LPSP is low power single pipe usages i.e. PIPE_A */
> +	igt_require(igt_pipe_connector_valid(PIPE_A, data->output));
> +	igt_require_f(i915_output_is_lpsp_capable(data->drm_fd, data->output),
> +		      "output is not lpsp capable\n");
> +
> +	data->mode = igt_output_get_mode(data->output);
> +	setup_lpsp_output(data);
> +	igt_assert_f(lpsp_is_enabled(data), "%s: lpsp is not enabled\n%s:\n%s\n",
> +		     data->output->name, PWR_DOMAIN_INFO, data->pwr_dmn_info =
> +		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
> +}
>   
> -int drm_fd;
> -uint32_t devid;
> -drmModeResPtr drm_res;
> -drmModeConnectorPtr drm_connectors[MAX_CONNECTORS];
> -struct intel_mmio_data mmio_data;
> +IGT_TEST_DESCRIPTION("These tests validates display Low Power Single Pipe configurations");
>   igt_main
>   {
> -	igt_fixture {
> -		int i;
> -
> -		drm_fd = drm_open_driver_master(DRIVER_INTEL);
> -		igt_require(drm_fd >= 0);
> -
> -		devid = intel_get_drm_devid(drm_fd);
> -
> -		drm_res = drmModeGetResources(drm_fd);
> -		igt_require(drm_res);
> -		igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
> +	data_t data = {};
>   
> -		for (i = 0; i < drm_res->count_connectors; i++)
> -			drm_connectors[i] = drmModeGetConnectorCurrent(drm_fd,
> -							drm_res->connectors[i]);
> +	igt_fixture {
>   
> +		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
> +		igt_require(data.drm_fd >= 0);
> +		data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
> +		igt_require(data.debugfs_fd >= 0);
>   		igt_pm_enable_audio_runtime_pm();
> -
> -		igt_require(supports_lpsp(devid));
> -
> -		intel_register_access_init(&mmio_data, intel_get_pci_device(), 0, drm_fd);
> -
>   		kmstest_set_vt_graphics_mode();
> +		data.devid = intel_get_drm_devid(data.drm_fd);
> +		igt_display_require(&data.display, data.drm_fd);
> +		igt_require(igt_pm_dmc_loaded(data.debugfs_fd));
>   	}
>   
> +	igt_describe("This test validates lpsp while all crtc are disabled");
>   	igt_subtest("screens-disabled")
> -		screens_disabled_subtest(drm_fd, drm_res);
> -	igt_subtest("edp-native")
> -		edp_subtest(drm_fd, drm_res, drm_connectors, devid, false);
> -	igt_subtest("non-edp")
> -		non_edp_subtest(drm_fd, drm_res, drm_connectors);
> +		screens_disabled_subtest(&data);
>   
> -	igt_fixture {
> -		int i;
> +	igt_describe("This test validates lpsp on all connected outputs on low power PIPE_A");
> +	igt_subtest_with_dynamic_f("kms-lpsp") {
> +		igt_display_t *display = &data.display;
> +		igt_output_t *output;
>   
> -		intel_register_access_fini(&mmio_data);
> -		for (i = 0; i < drm_res->count_connectors; i++)
> -			drmModeFreeConnector(drm_connectors[i]);
> -		drmModeFreeResources(drm_res);
> -		close(drm_fd);
> +		for_each_connected_output(display, output) {
> +			igt_dynamic_f("kms-lpsp-%s", output->name) {
> +				data.output = output;
> +				test_lpsp(&data);
> +			}
> +
> +			test_cleanup(&data);
> +		}
> +	}
> +
> +	igt_fixture {
> +		free(data.pwr_dmn_info);
> +		close(data.drm_fd);
> +		igt_display_fini(&data.display);
>   	}
>   }

[-- Attachment #1.2: Type: text/html, Size: 12274 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 4/5] tests/i915_pm_lpsp: screens-disabled subtest use igt_wait
  2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 4/5] tests/i915_pm_lpsp: screens-disabled subtest use igt_wait Anshuman Gupta
@ 2020-04-17 14:27   ` Manna, Animesh
  2020-04-17 15:30     ` Anshuman Gupta
  0 siblings, 1 reply; 22+ messages in thread
From: Manna, Animesh @ 2020-04-17 14:27 UTC (permalink / raw)
  To: Anshuman Gupta, igt-dev; +Cc: jani.nikula, martin.peres


[-- Attachment #1.1: Type: text/plain, Size: 1205 bytes --]


On 09-04-2020 11:09, Anshuman Gupta wrote:
> When all screens are disabled, it takes some time to release
> eDP/DP AUX IO power domain ref count. Also, delayed audio codec
> disabling takes time to release AUDIO power domain ref-count,
> using igt_wait to check lpsp after disabling all screens.
>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>   tests/i915/i915_pm_lpsp.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
> index 7be23e6c..e05d3791 100644
> --- a/tests/i915/i915_pm_lpsp.c
> +++ b/tests/i915/i915_pm_lpsp.c
> @@ -79,7 +79,8 @@ static void screens_disabled_subtest(data_t *data)
>   	}
>   
>   	igt_require_f(valid_output, "No connected output found\n");
> -	igt_assert_f(lpsp_is_enabled(data), "lpsp is not enabled\n%s:\n%s\n",
> +	igt_assert_f(igt_wait(lpsp_is_enabled(data), 1000, 100),

Better to add code-comment here how the above time is calculated. Is it based on observation or captured anywhere?

Regards,
Animesh

> +		     "lpsp is not enabled\n%s:\n%s\n",
>   		     PWR_DOMAIN_INFO, data->pwr_dmn_info =
>   		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
>   }

[-- Attachment #1.2: Type: text/html, Size: 1788 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 3/5] tests/i915_pm_lpsp: lpsp platform agnostic support
  2020-04-17 14:22   ` Manna, Animesh
@ 2020-04-17 15:28     ` Anshuman Gupta
  2020-04-17 16:27       ` Manna, Animesh
  0 siblings, 1 reply; 22+ messages in thread
From: Anshuman Gupta @ 2020-04-17 15:28 UTC (permalink / raw)
  To: Manna, Animesh; +Cc: igt-dev, jani.nikula, martin.peres

On 2020-04-17 at 19:52:00 +0530, Manna, Animesh wrote:
> 
> On 09-04-2020 11:09, Anshuman Gupta wrote:
> >Current implementation of lpsp igt test, assumed that every non-edp
> >panel isn't a lpsp panel but it is not true on TGL anymore,
> >any HDMI/DP/DSI panel connected on pipe A and connected to PORT_{A,B,C}
> >can drive LPSP.
> >Even on older Gen9 platform a DP panel can drive lpsp on Port A.
> >This requires complete design change in current lpsp igt for a platform
> >agnostic support.
> >
> >The new igt approach is relies on connector specific
> >i915_lpsp_capability and i915_lpsp_status debugfs attributes,
> >these debugfs exposes whether an output is capable of driving lpsp
> >and lpsp is enabled.
> >
> >Nuking edp-native and non-edp test, introducing a new dynamic
> >igt subtest kms-lpsp, which validates lpsp on each connected output
> >and skip the subtest if output is not lpsp capable.
> >
> >v2:
> >- CI failures fixup.
> >v3:
> >- removed unloading of snd_modules. [Martin]
> >v4:
> >- Don't test non-lpsp(if lpsp disabled), no ROI to test that.
> >- nuke panel-fitter test.
> >v5:
> >- Added dynamic subtest and igt changes according to kernel
> >   debugfs i915_lpsp_status changes.
> >
> >Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> >---
> >  tests/i915/i915_pm_lpsp.c | 285 +++++++++++++++-----------------------
> >  1 file changed, 114 insertions(+), 171 deletions(-)
> >
> >diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
> >index 08f82e7c..7be23e6c 100644
> >--- a/tests/i915/i915_pm_lpsp.c
> >+++ b/tests/i915/i915_pm_lpsp.c
> >@@ -25,210 +25,153 @@
> >   */
> >  #include "igt.h"
> >+#include "igt_kmod.h"
> >+#include "igt_pm.h"
> >+#include "igt_sysfs.h"
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> >  #include <fcntl.h>
> >  #include <unistd.h>
> >+#define MAX_SINK_LPSP_INFO_BUF_LEN	4096
> >-static bool supports_lpsp(uint32_t devid)
> >-{
> >-	return IS_HASWELL(devid) || IS_BROADWELL(devid);
> >-}
> >+#define PWR_DOMAIN_INFO "i915_power_domain_info"
> >-static bool lpsp_is_enabled(int drm_fd)
> >+typedef struct {
> >+	int drm_fd;
> >+	int debugfs_fd;
> >+	uint32_t devid;
> >+	char *pwr_dmn_info;
> >+	igt_display_t display;
> >+	struct igt_fb fb;
> >+	drmModeModeInfo *mode;
> >+	igt_output_t *output;
> >+} data_t;
> >+
> >+static bool lpsp_is_enabled(data_t *data)
> >  {
> >-	uint32_t val;
> >+	char buf[MAX_SINK_LPSP_INFO_BUF_LEN];
> >+	int len;
> >-	val = INREG(HSW_PWR_WELL_CTL2);
> >-	return !(val & HSW_PWR_WELL_STATE_ENABLED);
> >-}
> >+	len = igt_debugfs_simple_read(data->debugfs_fd, "i915_lpsp_status",
> >+				      buf, sizeof(buf));
> >+	if (len < 0)
> >+		igt_assert_eq(len, -ENODEV);
> >-/* The LPSP mode is all about an enabled pipe, but we expect to also be in the
> >- * low power mode when no pipes are enabled, so do this check anyway. */
> >-static void screens_disabled_subtest(int drm_fd, drmModeResPtr drm_res)
> >-{
> >-	kmstest_unset_all_crtcs(drm_fd, drm_res);
> >-	igt_assert(lpsp_is_enabled(drm_fd));
> >+	return strstr(buf, "LPSP: enabled");
> >  }
> >-static uint32_t create_fb(int drm_fd, int width, int height)
> >+/*
> >+ * The LPSP mode is all about an enabled pipe, but we expect to also be in the
> >+ * low power mode when no pipes are enabled, so do this check anyway.
> >+ */
> All pipe disabled in not same as lpsp. I feel the idea behind lpsp is single
> pipe usage with least power consumption ... there maybe no display
> connected.
Yes you are correct that is the same above comment has mentioned that "LPSP mode
is all about an enabled pipe", but here test method checks for lpsp when all screens 
are disbaled i.e. all crtc are disabled, that is almost same as there is no display
connected with respect to power consumption.
> >+static void screens_disabled_subtest(data_t *data)
> >  {
> >-	struct igt_fb fb;
> >+	igt_output_t *output;
> >+	int valid_output = 0;
> >+	enum pipe pipe;
> >+
> >+	for_each_pipe_with_single_output(&data->display, pipe, output) {
> >+		data->output = output;
> >+		igt_output_set_pipe(data->output, PIPE_NONE);
> 
> Passing PIPE_NONE and testing lpsp maybe not the right thing here. We may
> not have connector but need to enable a single pipe to test lpsp...  rt?
PIPE_NONE commit will disbale a crtc, when all crtc gets disbaled, all power well
except PG1 will be disbaled, PG1 is controlled by DMC.
So testing lpsp is here is one of the test case, i.e we want to test power well associated
to PIPE_B should be turned off. There may be a bug in driver that when all crtc are disbaled
PIPE_B  associated  power is not turned off, that is what this test validated.
Enabling a pipe for lpsp will get covered in kms-lpsp test.
Thanks,
Anshuman Gupta.
> 
> Regards,
> 
> Animesh
> 
> >+		igt_display_commit(&data->display);
> >+		valid_output++;
> >+	}
> >-	return igt_create_pattern_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888,
> >-				     LOCAL_DRM_FORMAT_MOD_NONE, &fb);
> >+	igt_require_f(valid_output, "No connected output found\n");
> >+	igt_assert_f(lpsp_is_enabled(data), "lpsp is not enabled\n%s:\n%s\n",
> >+		     PWR_DOMAIN_INFO, data->pwr_dmn_info =
> >+		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
> >  }
> >-static void edp_subtest(int drm_fd, drmModeResPtr drm_res,
> >-			drmModeConnectorPtr *drm_connectors, uint32_t devid,
> >-			bool use_panel_fitter)
> >+static void setup_lpsp_output(data_t *data)
> >  {
> >-	int i, rc;
> >-	uint32_t crtc_id = 0, buffer_id = 0;
> >-	drmModeConnectorPtr connector = NULL;
> >-	drmModeModeInfoPtr mode = NULL;
> >-	drmModeModeInfo std_1024_mode = {
> >-		.clock = 65000,
> >-		.hdisplay = 1024,
> >-		.hsync_start = 1048,
> >-		.hsync_end = 1184,
> >-		.htotal = 1344,
> >-		.hskew = 0,
> >-		.vdisplay = 768,
> >-		.vsync_start = 771,
> >-		.vsync_end = 777,
> >-		.vtotal = 806,
> >-		.vscan = 0,
> >-		.vrefresh = 60,
> >-		.flags = 0xA,
> >-		.type = 0x40,
> >-		.name = "Custom 1024x768",
> >-	};
> >-
> >-	kmstest_unset_all_crtcs(drm_fd, drm_res);
> >-
> >-	for (i = 0; i < drm_res->count_connectors; i++) {
> >-		drmModeConnectorPtr c = drm_connectors[i];
> >-
> >-		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
> >-			continue;
> >-		if (c->connection != DRM_MODE_CONNECTED)
> >-			continue;
> >-
> >-		if (!use_panel_fitter && c->count_modes) {
> >-			connector = c;
> >-			mode = &c->modes[0];
> >-			break;
> >-		}
> >-		if (use_panel_fitter) {
> >-			connector = c;
> >-
> >-			/* This is one of the modes Xorg creates for panels, so
> >-			 * it should work just fine. Notice that Gens that
> >-			 * support LPSP are too new for panels with native
> >-			 * 1024x768 resolution, so this should force the panel
> >-			 * fitter. */
> >-			igt_assert(c->count_modes &&
> >-				   c->modes[0].hdisplay > 1024);
> >-			igt_assert(c->count_modes &&
> >-				   c->modes[0].vdisplay > 768);
> >-			mode = &std_1024_mode;
> >-			break;
> >-		}
> >-	}
> >-	igt_require(connector);
> >-
> >-	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
> >-						  0);
> >-	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
> >-
> >-	igt_assert(buffer_id);
> >-	igt_assert(connector);
> >-	igt_assert(mode);
> >-
> >-	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
> >-			    &connector->connector_id, 1, mode);
> >-	igt_assert_eq(rc, 0);
> >-
> >-	if (use_panel_fitter) {
> >-		if (IS_HASWELL(devid))
> >-			igt_assert(!lpsp_is_enabled(drm_fd));
> >-		else
> >-			igt_assert(lpsp_is_enabled(drm_fd));
> >-	} else {
> >-		igt_assert(lpsp_is_enabled(drm_fd));
> >-	}
> >+	igt_plane_t *primary;
> >+
> >+	/* set output pipe = PIPE_A for LPSP */
> >+	igt_output_set_pipe(data->output, PIPE_A);
> >+	primary = igt_output_get_plane_type(data->output,
> >+					    DRM_PLANE_TYPE_PRIMARY);
> >+	igt_plane_set_fb(primary, NULL);
> >+	igt_create_pattern_fb(data->drm_fd,
> >+			      data->mode->hdisplay, data->mode->vdisplay,
> >+			      DRM_FORMAT_XRGB8888,
> >+			      LOCAL_DRM_FORMAT_MOD_NONE,
> >+			      &data->fb);
> >+	igt_plane_set_fb(primary, &data->fb);
> >+	igt_display_commit(&data->display);
> >  }
> >-static void non_edp_subtest(int drm_fd, drmModeResPtr drm_res,
> >-			    drmModeConnectorPtr *drm_connectors)
> >+static void test_cleanup(data_t *data)
> >  {
> >-	int i, rc;
> >-	uint32_t crtc_id = 0, buffer_id = 0;
> >-	drmModeConnectorPtr connector = NULL;
> >-	drmModeModeInfoPtr mode = NULL;
> >-
> >-	kmstest_unset_all_crtcs(drm_fd, drm_res);
> >-
> >-	for (i = 0; i < drm_res->count_connectors; i++) {
> >-		drmModeConnectorPtr c = drm_connectors[i];
> >-
> >-		if (c->connector_type == DRM_MODE_CONNECTOR_eDP)
> >-			continue;
> >-		if (c->connection != DRM_MODE_CONNECTED)
> >-			continue;
> >-
> >-		if (c->count_modes) {
> >-			connector = c;
> >-			mode = &c->modes[0];
> >-			break;
> >-		}
> >-	}
> >-	igt_require(connector);
> >-
> >-	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
> >-						  0);
> >-	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
> >-
> >-	igt_assert(buffer_id);
> >-	igt_assert(mode);
> >-
> >-	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
> >-			    &connector->connector_id, 1, mode);
> >-	igt_assert_eq(rc, 0);
> >-
> >-	igt_assert(!lpsp_is_enabled(drm_fd));
> >+	igt_plane_t *primary;
> >+
> >+	if (!data->output || data->output->pending_pipe == PIPE_NONE)
> >+		return;
> >+
> >+	primary = igt_output_get_plane_type(data->output,
> >+					    DRM_PLANE_TYPE_PRIMARY);
> >+	igt_plane_set_fb(primary, NULL);
> >+	igt_output_set_pipe(data->output, PIPE_NONE);
> >+	igt_display_commit(&data->display);
> >+	igt_remove_fb(data->drm_fd, &data->fb);
> >+	data->output = NULL;
> >  }
> >-#define MAX_CONNECTORS 32
> >+static void test_lpsp(data_t *data)
> >+{
> >+	/* LPSP is low power single pipe usages i.e. PIPE_A */
> >+	igt_require(igt_pipe_connector_valid(PIPE_A, data->output));
> >+	igt_require_f(i915_output_is_lpsp_capable(data->drm_fd, data->output),
> >+		      "output is not lpsp capable\n");
> >+
> >+	data->mode = igt_output_get_mode(data->output);
> >+	setup_lpsp_output(data);
> >+	igt_assert_f(lpsp_is_enabled(data), "%s: lpsp is not enabled\n%s:\n%s\n",
> >+		     data->output->name, PWR_DOMAIN_INFO, data->pwr_dmn_info =
> >+		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
> >+}
> >-int drm_fd;
> >-uint32_t devid;
> >-drmModeResPtr drm_res;
> >-drmModeConnectorPtr drm_connectors[MAX_CONNECTORS];
> >-struct intel_mmio_data mmio_data;
> >+IGT_TEST_DESCRIPTION("These tests validates display Low Power Single Pipe configurations");
> >  igt_main
> >  {
> >-	igt_fixture {
> >-		int i;
> >-
> >-		drm_fd = drm_open_driver_master(DRIVER_INTEL);
> >-		igt_require(drm_fd >= 0);
> >-
> >-		devid = intel_get_drm_devid(drm_fd);
> >-
> >-		drm_res = drmModeGetResources(drm_fd);
> >-		igt_require(drm_res);
> >-		igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
> >+	data_t data = {};
> >-		for (i = 0; i < drm_res->count_connectors; i++)
> >-			drm_connectors[i] = drmModeGetConnectorCurrent(drm_fd,
> >-							drm_res->connectors[i]);
> >+	igt_fixture {
> >+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
> >+		igt_require(data.drm_fd >= 0);
> >+		data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
> >+		igt_require(data.debugfs_fd >= 0);
> >  		igt_pm_enable_audio_runtime_pm();
> >-
> >-		igt_require(supports_lpsp(devid));
> >-
> >-		intel_register_access_init(&mmio_data, intel_get_pci_device(), 0, drm_fd);
> >-
> >  		kmstest_set_vt_graphics_mode();
> >+		data.devid = intel_get_drm_devid(data.drm_fd);
> >+		igt_display_require(&data.display, data.drm_fd);
> >+		igt_require(igt_pm_dmc_loaded(data.debugfs_fd));
> >  	}
> >+	igt_describe("This test validates lpsp while all crtc are disabled");
> >  	igt_subtest("screens-disabled")
> >-		screens_disabled_subtest(drm_fd, drm_res);
> >-	igt_subtest("edp-native")
> >-		edp_subtest(drm_fd, drm_res, drm_connectors, devid, false);
> >-	igt_subtest("non-edp")
> >-		non_edp_subtest(drm_fd, drm_res, drm_connectors);
> >+		screens_disabled_subtest(&data);
> >-	igt_fixture {
> >-		int i;
> >+	igt_describe("This test validates lpsp on all connected outputs on low power PIPE_A");
> >+	igt_subtest_with_dynamic_f("kms-lpsp") {
> >+		igt_display_t *display = &data.display;
> >+		igt_output_t *output;
> >-		intel_register_access_fini(&mmio_data);
> >-		for (i = 0; i < drm_res->count_connectors; i++)
> >-			drmModeFreeConnector(drm_connectors[i]);
> >-		drmModeFreeResources(drm_res);
> >-		close(drm_fd);
> >+		for_each_connected_output(display, output) {
> >+			igt_dynamic_f("kms-lpsp-%s", output->name) {
> >+				data.output = output;
> >+				test_lpsp(&data);
> >+			}
> >+
> >+			test_cleanup(&data);
> >+		}
> >+	}
> >+
> >+	igt_fixture {
> >+		free(data.pwr_dmn_info);
> >+		close(data.drm_fd);
> >+		igt_display_fini(&data.display);
> >  	}
> >  }
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 4/5] tests/i915_pm_lpsp: screens-disabled subtest use igt_wait
  2020-04-17 14:27   ` Manna, Animesh
@ 2020-04-17 15:30     ` Anshuman Gupta
  0 siblings, 0 replies; 22+ messages in thread
From: Anshuman Gupta @ 2020-04-17 15:30 UTC (permalink / raw)
  To: Manna, Animesh; +Cc: igt-dev, jani.nikula, martin.peres

On 2020-04-17 at 19:57:47 +0530, Manna, Animesh wrote:
> 
> On 09-04-2020 11:09, Anshuman Gupta wrote:
> >When all screens are disabled, it takes some time to release
> >eDP/DP AUX IO power domain ref count. Also, delayed audio codec
> >disabling takes time to release AUDIO power domain ref-count,
> >using igt_wait to check lpsp after disabling all screens.
> >
> >Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> >---
> >  tests/i915/i915_pm_lpsp.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> >diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
> >index 7be23e6c..e05d3791 100644
> >--- a/tests/i915/i915_pm_lpsp.c
> >+++ b/tests/i915/i915_pm_lpsp.c
> >@@ -79,7 +79,8 @@ static void screens_disabled_subtest(data_t *data)
> >  	}
> >  	igt_require_f(valid_output, "No connected output found\n");
> >-	igt_assert_f(lpsp_is_enabled(data), "lpsp is not enabled\n%s:\n%s\n",
> >+	igt_assert_f(igt_wait(lpsp_is_enabled(data), 1000, 100),
> 
> Better to add code-comment here how the above time is calculated. Is it based on observation or captured anywhere?
Thaks for review i will add a code comment here.
thanks,
Anshuman Gupta.
> 
> Regards,
> Animesh
> 
> >+		     "lpsp is not enabled\n%s:\n%s\n",
> >  		     PWR_DOMAIN_INFO, data->pwr_dmn_info =
> >  		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
> >  }
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 3/5] tests/i915_pm_lpsp: lpsp platform agnostic support
  2020-04-17 15:28     ` Anshuman Gupta
@ 2020-04-17 16:27       ` Manna, Animesh
  2020-04-17 16:44         ` Anshuman Gupta
  0 siblings, 1 reply; 22+ messages in thread
From: Manna, Animesh @ 2020-04-17 16:27 UTC (permalink / raw)
  To: Anshuman Gupta; +Cc: igt-dev, jani.nikula, martin.peres


[-- Attachment #1.1: Type: text/plain, Size: 13421 bytes --]


On 17-04-2020 20:58, Anshuman Gupta wrote:
> On 2020-04-17 at 19:52:00 +0530, Manna, Animesh wrote:
>> On 09-04-2020 11:09, Anshuman Gupta wrote:
>>> Current implementation of lpsp igt test, assumed that every non-edp
>>> panel isn't a lpsp panel but it is not true on TGL anymore,
>>> any HDMI/DP/DSI panel connected on pipe A and connected to PORT_{A,B,C}
>>> can drive LPSP.
>>> Even on older Gen9 platform a DP panel can drive lpsp on Port A.
>>> This requires complete design change in current lpsp igt for a platform
>>> agnostic support.
>>>
>>> The new igt approach is relies on connector specific
>>> i915_lpsp_capability and i915_lpsp_status debugfs attributes,
>>> these debugfs exposes whether an output is capable of driving lpsp
>>> and lpsp is enabled.
>>>
>>> Nuking edp-native and non-edp test, introducing a new dynamic
>>> igt subtest kms-lpsp, which validates lpsp on each connected output
>>> and skip the subtest if output is not lpsp capable.
>>>
>>> v2:
>>> - CI failures fixup.
>>> v3:
>>> - removed unloading of snd_modules. [Martin]
>>> v4:
>>> - Don't test non-lpsp(if lpsp disabled), no ROI to test that.
>>> - nuke panel-fitter test.
>>> v5:
>>> - Added dynamic subtest and igt changes according to kernel
>>>    debugfs i915_lpsp_status changes.
>>>
>>> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
>>> ---
>>>   tests/i915/i915_pm_lpsp.c | 285 +++++++++++++++-----------------------
>>>   1 file changed, 114 insertions(+), 171 deletions(-)
>>>
>>> diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
>>> index 08f82e7c..7be23e6c 100644
>>> --- a/tests/i915/i915_pm_lpsp.c
>>> +++ b/tests/i915/i915_pm_lpsp.c
>>> @@ -25,210 +25,153 @@
>>>    */
>>>   #include "igt.h"
>>> +#include "igt_kmod.h"
>>> +#include "igt_pm.h"
>>> +#include "igt_sysfs.h"
>>>   #include <sys/types.h>
>>>   #include <sys/stat.h>
>>>   #include <fcntl.h>
>>>   #include <unistd.h>
>>> +#define MAX_SINK_LPSP_INFO_BUF_LEN	4096
>>> -static bool supports_lpsp(uint32_t devid)
>>> -{
>>> -	return IS_HASWELL(devid) || IS_BROADWELL(devid);
>>> -}
>>> +#define PWR_DOMAIN_INFO "i915_power_domain_info"
>>> -static bool lpsp_is_enabled(int drm_fd)
>>> +typedef struct {
>>> +	int drm_fd;
>>> +	int debugfs_fd;
>>> +	uint32_t devid;
>>> +	char *pwr_dmn_info;
>>> +	igt_display_t display;
>>> +	struct igt_fb fb;
>>> +	drmModeModeInfo *mode;
>>> +	igt_output_t *output;
>>> +} data_t;
>>> +
>>> +static bool lpsp_is_enabled(data_t *data)
>>>   {
>>> -	uint32_t val;
>>> +	char buf[MAX_SINK_LPSP_INFO_BUF_LEN];
>>> +	int len;
>>> -	val = INREG(HSW_PWR_WELL_CTL2);
>>> -	return !(val & HSW_PWR_WELL_STATE_ENABLED);
>>> -}
>>> +	len = igt_debugfs_simple_read(data->debugfs_fd, "i915_lpsp_status",
>>> +				      buf, sizeof(buf));
>>> +	if (len < 0)
>>> +		igt_assert_eq(len, -ENODEV);
>>> -/* The LPSP mode is all about an enabled pipe, but we expect to also be in the
>>> - * low power mode when no pipes are enabled, so do this check anyway. */
>>> -static void screens_disabled_subtest(int drm_fd, drmModeResPtr drm_res)
>>> -{
>>> -	kmstest_unset_all_crtcs(drm_fd, drm_res);
>>> -	igt_assert(lpsp_is_enabled(drm_fd));
>>> +	return strstr(buf, "LPSP: enabled");
>>>   }
>>> -static uint32_t create_fb(int drm_fd, int width, int height)
>>> +/*
>>> + * The LPSP mode is all about an enabled pipe, but we expect to also be in the
>>> + * low power mode when no pipes are enabled, so do this check anyway.
>>> + */
>> All pipe disabled in not same as lpsp. I feel the idea behind lpsp is single
>> pipe usage with least power consumption ... there maybe no display
>> connected.
> Yes you are correct that is the same above comment has mentioned that "LPSP mode
> is all about an enabled pipe", but here test method checks for lpsp when all screens
> are disbaled i.e. all crtc are disabled, that is almost same as there is no display
> connected with respect to power consumption.
>>> +static void screens_disabled_subtest(data_t *data)
>>>   {
>>> -	struct igt_fb fb;
>>> +	igt_output_t *output;
>>> +	int valid_output = 0;
>>> +	enum pipe pipe;
>>> +
>>> +	for_each_pipe_with_single_output(&data->display, pipe, output) {
>>> +		data->output = output;
>>> +		igt_output_set_pipe(data->output, PIPE_NONE);
>> Passing PIPE_NONE and testing lpsp maybe not the right thing here. We may
>> not have connector but need to enable a single pipe to test lpsp...  rt?
> PIPE_NONE commit will disbale a crtc, when all crtc gets disbaled, all power well
> except PG1 will be disbaled, PG1 is controlled by DMC.

I do not think DC9 is controlled by DMC, during all crtc disable driver will disable all power-well and enter into DC9, no role of DMC here ... am I missing anything?

Regards,
Animesh

> So testing lpsp is here is one of the test case, i.e we want to test power well associated
> to PIPE_B should be turned off. There may be a bug in driver that when all crtc are disbaled
> PIPE_B  associated  power is not turned off, that is what this test validated.
> Enabling a pipe for lpsp will get covered in kms-lpsp test.
> Thanks,
> Anshuman Gupta.
>> Regards,
>>
>> Animesh
>>
>>> +		igt_display_commit(&data->display);
>>> +		valid_output++;
>>> +	}
>>> -	return igt_create_pattern_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888,
>>> -				     LOCAL_DRM_FORMAT_MOD_NONE, &fb);
>>> +	igt_require_f(valid_output, "No connected output found\n");
>>> +	igt_assert_f(lpsp_is_enabled(data), "lpsp is not enabled\n%s:\n%s\n",
>>> +		     PWR_DOMAIN_INFO, data->pwr_dmn_info =
>>> +		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
>>>   }
>>> -static void edp_subtest(int drm_fd, drmModeResPtr drm_res,
>>> -			drmModeConnectorPtr *drm_connectors, uint32_t devid,
>>> -			bool use_panel_fitter)
>>> +static void setup_lpsp_output(data_t *data)
>>>   {
>>> -	int i, rc;
>>> -	uint32_t crtc_id = 0, buffer_id = 0;
>>> -	drmModeConnectorPtr connector = NULL;
>>> -	drmModeModeInfoPtr mode = NULL;
>>> -	drmModeModeInfo std_1024_mode = {
>>> -		.clock = 65000,
>>> -		.hdisplay = 1024,
>>> -		.hsync_start = 1048,
>>> -		.hsync_end = 1184,
>>> -		.htotal = 1344,
>>> -		.hskew = 0,
>>> -		.vdisplay = 768,
>>> -		.vsync_start = 771,
>>> -		.vsync_end = 777,
>>> -		.vtotal = 806,
>>> -		.vscan = 0,
>>> -		.vrefresh = 60,
>>> -		.flags = 0xA,
>>> -		.type = 0x40,
>>> -		.name = "Custom 1024x768",
>>> -	};
>>> -
>>> -	kmstest_unset_all_crtcs(drm_fd, drm_res);
>>> -
>>> -	for (i = 0; i < drm_res->count_connectors; i++) {
>>> -		drmModeConnectorPtr c = drm_connectors[i];
>>> -
>>> -		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
>>> -			continue;
>>> -		if (c->connection != DRM_MODE_CONNECTED)
>>> -			continue;
>>> -
>>> -		if (!use_panel_fitter && c->count_modes) {
>>> -			connector = c;
>>> -			mode = &c->modes[0];
>>> -			break;
>>> -		}
>>> -		if (use_panel_fitter) {
>>> -			connector = c;
>>> -
>>> -			/* This is one of the modes Xorg creates for panels, so
>>> -			 * it should work just fine. Notice that Gens that
>>> -			 * support LPSP are too new for panels with native
>>> -			 * 1024x768 resolution, so this should force the panel
>>> -			 * fitter. */
>>> -			igt_assert(c->count_modes &&
>>> -				   c->modes[0].hdisplay > 1024);
>>> -			igt_assert(c->count_modes &&
>>> -				   c->modes[0].vdisplay > 768);
>>> -			mode = &std_1024_mode;
>>> -			break;
>>> -		}
>>> -	}
>>> -	igt_require(connector);
>>> -
>>> -	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
>>> -						  0);
>>> -	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
>>> -
>>> -	igt_assert(buffer_id);
>>> -	igt_assert(connector);
>>> -	igt_assert(mode);
>>> -
>>> -	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
>>> -			    &connector->connector_id, 1, mode);
>>> -	igt_assert_eq(rc, 0);
>>> -
>>> -	if (use_panel_fitter) {
>>> -		if (IS_HASWELL(devid))
>>> -			igt_assert(!lpsp_is_enabled(drm_fd));
>>> -		else
>>> -			igt_assert(lpsp_is_enabled(drm_fd));
>>> -	} else {
>>> -		igt_assert(lpsp_is_enabled(drm_fd));
>>> -	}
>>> +	igt_plane_t *primary;
>>> +
>>> +	/* set output pipe = PIPE_A for LPSP */
>>> +	igt_output_set_pipe(data->output, PIPE_A);
>>> +	primary = igt_output_get_plane_type(data->output,
>>> +					    DRM_PLANE_TYPE_PRIMARY);
>>> +	igt_plane_set_fb(primary, NULL);
>>> +	igt_create_pattern_fb(data->drm_fd,
>>> +			      data->mode->hdisplay, data->mode->vdisplay,
>>> +			      DRM_FORMAT_XRGB8888,
>>> +			      LOCAL_DRM_FORMAT_MOD_NONE,
>>> +			      &data->fb);
>>> +	igt_plane_set_fb(primary, &data->fb);
>>> +	igt_display_commit(&data->display);
>>>   }
>>> -static void non_edp_subtest(int drm_fd, drmModeResPtr drm_res,
>>> -			    drmModeConnectorPtr *drm_connectors)
>>> +static void test_cleanup(data_t *data)
>>>   {
>>> -	int i, rc;
>>> -	uint32_t crtc_id = 0, buffer_id = 0;
>>> -	drmModeConnectorPtr connector = NULL;
>>> -	drmModeModeInfoPtr mode = NULL;
>>> -
>>> -	kmstest_unset_all_crtcs(drm_fd, drm_res);
>>> -
>>> -	for (i = 0; i < drm_res->count_connectors; i++) {
>>> -		drmModeConnectorPtr c = drm_connectors[i];
>>> -
>>> -		if (c->connector_type == DRM_MODE_CONNECTOR_eDP)
>>> -			continue;
>>> -		if (c->connection != DRM_MODE_CONNECTED)
>>> -			continue;
>>> -
>>> -		if (c->count_modes) {
>>> -			connector = c;
>>> -			mode = &c->modes[0];
>>> -			break;
>>> -		}
>>> -	}
>>> -	igt_require(connector);
>>> -
>>> -	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
>>> -						  0);
>>> -	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
>>> -
>>> -	igt_assert(buffer_id);
>>> -	igt_assert(mode);
>>> -
>>> -	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
>>> -			    &connector->connector_id, 1, mode);
>>> -	igt_assert_eq(rc, 0);
>>> -
>>> -	igt_assert(!lpsp_is_enabled(drm_fd));
>>> +	igt_plane_t *primary;
>>> +
>>> +	if (!data->output || data->output->pending_pipe == PIPE_NONE)
>>> +		return;
>>> +
>>> +	primary = igt_output_get_plane_type(data->output,
>>> +					    DRM_PLANE_TYPE_PRIMARY);
>>> +	igt_plane_set_fb(primary, NULL);
>>> +	igt_output_set_pipe(data->output, PIPE_NONE);
>>> +	igt_display_commit(&data->display);
>>> +	igt_remove_fb(data->drm_fd, &data->fb);
>>> +	data->output = NULL;
>>>   }
>>> -#define MAX_CONNECTORS 32
>>> +static void test_lpsp(data_t *data)
>>> +{
>>> +	/* LPSP is low power single pipe usages i.e. PIPE_A */
>>> +	igt_require(igt_pipe_connector_valid(PIPE_A, data->output));
>>> +	igt_require_f(i915_output_is_lpsp_capable(data->drm_fd, data->output),
>>> +		      "output is not lpsp capable\n");
>>> +
>>> +	data->mode = igt_output_get_mode(data->output);
>>> +	setup_lpsp_output(data);
>>> +	igt_assert_f(lpsp_is_enabled(data), "%s: lpsp is not enabled\n%s:\n%s\n",
>>> +		     data->output->name, PWR_DOMAIN_INFO, data->pwr_dmn_info =
>>> +		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
>>> +}
>>> -int drm_fd;
>>> -uint32_t devid;
>>> -drmModeResPtr drm_res;
>>> -drmModeConnectorPtr drm_connectors[MAX_CONNECTORS];
>>> -struct intel_mmio_data mmio_data;
>>> +IGT_TEST_DESCRIPTION("These tests validates display Low Power Single Pipe configurations");
>>>   igt_main
>>>   {
>>> -	igt_fixture {
>>> -		int i;
>>> -
>>> -		drm_fd = drm_open_driver_master(DRIVER_INTEL);
>>> -		igt_require(drm_fd >= 0);
>>> -
>>> -		devid = intel_get_drm_devid(drm_fd);
>>> -
>>> -		drm_res = drmModeGetResources(drm_fd);
>>> -		igt_require(drm_res);
>>> -		igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
>>> +	data_t data = {};
>>> -		for (i = 0; i < drm_res->count_connectors; i++)
>>> -			drm_connectors[i] = drmModeGetConnectorCurrent(drm_fd,
>>> -							drm_res->connectors[i]);
>>> +	igt_fixture {
>>> +		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
>>> +		igt_require(data.drm_fd >= 0);
>>> +		data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
>>> +		igt_require(data.debugfs_fd >= 0);
>>>   		igt_pm_enable_audio_runtime_pm();
>>> -
>>> -		igt_require(supports_lpsp(devid));
>>> -
>>> -		intel_register_access_init(&mmio_data, intel_get_pci_device(), 0, drm_fd);
>>> -
>>>   		kmstest_set_vt_graphics_mode();
>>> +		data.devid = intel_get_drm_devid(data.drm_fd);
>>> +		igt_display_require(&data.display, data.drm_fd);
>>> +		igt_require(igt_pm_dmc_loaded(data.debugfs_fd));
>>>   	}
>>> +	igt_describe("This test validates lpsp while all crtc are disabled");
>>>   	igt_subtest("screens-disabled")
>>> -		screens_disabled_subtest(drm_fd, drm_res);
>>> -	igt_subtest("edp-native")
>>> -		edp_subtest(drm_fd, drm_res, drm_connectors, devid, false);
>>> -	igt_subtest("non-edp")
>>> -		non_edp_subtest(drm_fd, drm_res, drm_connectors);
>>> +		screens_disabled_subtest(&data);
>>> -	igt_fixture {
>>> -		int i;
>>> +	igt_describe("This test validates lpsp on all connected outputs on low power PIPE_A");
>>> +	igt_subtest_with_dynamic_f("kms-lpsp") {
>>> +		igt_display_t *display = &data.display;
>>> +		igt_output_t *output;
>>> -		intel_register_access_fini(&mmio_data);
>>> -		for (i = 0; i < drm_res->count_connectors; i++)
>>> -			drmModeFreeConnector(drm_connectors[i]);
>>> -		drmModeFreeResources(drm_res);
>>> -		close(drm_fd);
>>> +		for_each_connected_output(display, output) {
>>> +			igt_dynamic_f("kms-lpsp-%s", output->name) {
>>> +				data.output = output;
>>> +				test_lpsp(&data);
>>> +			}
>>> +
>>> +			test_cleanup(&data);
>>> +		}
>>> +	}
>>> +
>>> +	igt_fixture {
>>> +		free(data.pwr_dmn_info);
>>> +		close(data.drm_fd);
>>> +		igt_display_fini(&data.display);
>>>   	}
>>>   }

[-- Attachment #1.2: Type: text/html, Size: 13661 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 3/5] tests/i915_pm_lpsp: lpsp platform agnostic support
  2020-04-17 16:27       ` Manna, Animesh
@ 2020-04-17 16:44         ` Anshuman Gupta
  2020-04-20 11:01           ` Manna, Animesh
  0 siblings, 1 reply; 22+ messages in thread
From: Anshuman Gupta @ 2020-04-17 16:44 UTC (permalink / raw)
  To: Manna, Animesh; +Cc: igt-dev, jani.nikula, martin.peres

On 2020-04-17 at 21:57:25 +0530, Manna, Animesh wrote:
> 
> On 17-04-2020 20:58, Anshuman Gupta wrote:
> >On 2020-04-17 at 19:52:00 +0530, Manna, Animesh wrote:
> >>On 09-04-2020 11:09, Anshuman Gupta wrote:
> >>>Current implementation of lpsp igt test, assumed that every non-edp
> >>>panel isn't a lpsp panel but it is not true on TGL anymore,
> >>>any HDMI/DP/DSI panel connected on pipe A and connected to PORT_{A,B,C}
> >>>can drive LPSP.
> >>>Even on older Gen9 platform a DP panel can drive lpsp on Port A.
> >>>This requires complete design change in current lpsp igt for a platform
> >>>agnostic support.
> >>>
> >>>The new igt approach is relies on connector specific
> >>>i915_lpsp_capability and i915_lpsp_status debugfs attributes,
> >>>these debugfs exposes whether an output is capable of driving lpsp
> >>>and lpsp is enabled.
> >>>
> >>>Nuking edp-native and non-edp test, introducing a new dynamic
> >>>igt subtest kms-lpsp, which validates lpsp on each connected output
> >>>and skip the subtest if output is not lpsp capable.
> >>>
> >>>v2:
> >>>- CI failures fixup.
> >>>v3:
> >>>- removed unloading of snd_modules. [Martin]
> >>>v4:
> >>>- Don't test non-lpsp(if lpsp disabled), no ROI to test that.
> >>>- nuke panel-fitter test.
> >>>v5:
> >>>- Added dynamic subtest and igt changes according to kernel
> >>>   debugfs i915_lpsp_status changes.
> >>>
> >>>Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> >>>---
> >>>  tests/i915/i915_pm_lpsp.c | 285 +++++++++++++++-----------------------
> >>>  1 file changed, 114 insertions(+), 171 deletions(-)
> >>>
> >>>diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
> >>>index 08f82e7c..7be23e6c 100644
> >>>--- a/tests/i915/i915_pm_lpsp.c
> >>>+++ b/tests/i915/i915_pm_lpsp.c
> >>>@@ -25,210 +25,153 @@
> >>>   */
> >>>  #include "igt.h"
> >>>+#include "igt_kmod.h"
> >>>+#include "igt_pm.h"
> >>>+#include "igt_sysfs.h"
> >>>  #include <sys/types.h>
> >>>  #include <sys/stat.h>
> >>>  #include <fcntl.h>
> >>>  #include <unistd.h>
> >>>+#define MAX_SINK_LPSP_INFO_BUF_LEN	4096
> >>>-static bool supports_lpsp(uint32_t devid)
> >>>-{
> >>>-	return IS_HASWELL(devid) || IS_BROADWELL(devid);
> >>>-}
> >>>+#define PWR_DOMAIN_INFO "i915_power_domain_info"
> >>>-static bool lpsp_is_enabled(int drm_fd)
> >>>+typedef struct {
> >>>+	int drm_fd;
> >>>+	int debugfs_fd;
> >>>+	uint32_t devid;
> >>>+	char *pwr_dmn_info;
> >>>+	igt_display_t display;
> >>>+	struct igt_fb fb;
> >>>+	drmModeModeInfo *mode;
> >>>+	igt_output_t *output;
> >>>+} data_t;
> >>>+
> >>>+static bool lpsp_is_enabled(data_t *data)
> >>>  {
> >>>-	uint32_t val;
> >>>+	char buf[MAX_SINK_LPSP_INFO_BUF_LEN];
> >>>+	int len;
> >>>-	val = INREG(HSW_PWR_WELL_CTL2);
> >>>-	return !(val & HSW_PWR_WELL_STATE_ENABLED);
> >>>-}
> >>>+	len = igt_debugfs_simple_read(data->debugfs_fd, "i915_lpsp_status",
> >>>+				      buf, sizeof(buf));
> >>>+	if (len < 0)
> >>>+		igt_assert_eq(len, -ENODEV);
> >>>-/* The LPSP mode is all about an enabled pipe, but we expect to also be in the
> >>>- * low power mode when no pipes are enabled, so do this check anyway. */
> >>>-static void screens_disabled_subtest(int drm_fd, drmModeResPtr drm_res)
> >>>-{
> >>>-	kmstest_unset_all_crtcs(drm_fd, drm_res);
> >>>-	igt_assert(lpsp_is_enabled(drm_fd));
> >>>+	return strstr(buf, "LPSP: enabled");
> >>>  }
> >>>-static uint32_t create_fb(int drm_fd, int width, int height)
> >>>+/*
> >>>+ * The LPSP mode is all about an enabled pipe, but we expect to also be in the
> >>>+ * low power mode when no pipes are enabled, so do this check anyway.
> >>>+ */
> >>All pipe disabled in not same as lpsp. I feel the idea behind lpsp is single
> >>pipe usage with least power consumption ... there maybe no display
> >>connected.
> >Yes you are correct that is the same above comment has mentioned that "LPSP mode
> >is all about an enabled pipe", but here test method checks for lpsp when all screens
> >are disbaled i.e. all crtc are disabled, that is almost same as there is no display
> >connected with respect to power consumption.
> >>>+static void screens_disabled_subtest(data_t *data)
> >>>  {
> >>>-	struct igt_fb fb;
> >>>+	igt_output_t *output;
> >>>+	int valid_output = 0;
> >>>+	enum pipe pipe;
> >>>+
> >>>+	for_each_pipe_with_single_output(&data->display, pipe, output) {
> >>>+		data->output = output;
> >>>+		igt_output_set_pipe(data->output, PIPE_NONE);
> >>Passing PIPE_NONE and testing lpsp maybe not the right thing here. We may
> >>not have connector but need to enable a single pipe to test lpsp...  rt?
> >PIPE_NONE commit will disbale a crtc, when all crtc gets disbaled, all power well
> >except PG1 will be disbaled, PG1 is controlled by DMC.
> 
> I do not think DC9 is controlled by DMC, during all crtc disable driver will disable all power-well and enter into DC9, no role of DMC here ... am I missing anything?
yes DC9 is not controlled by DMC, and i915 program DC9 in case of runtime suspend or system wide suspend, so DC9 a deeper state depends on i915 suspend, let's think about a use case when all CRTC are disabled but gem has valid run time usages count or let's say i915 device is always on i.e (/sys/bus/pci/devices/0000\:00\:02.0/power/control attribute in on), in those cases runtime status will be always active, so i think test method to validate PIPE_B associated power well is valid here when all crtc are disbaled i.e. all display are off.
We want validate a intermediate power state here, which is a valid use case.
Please correct me if my thought process about test method is wrong.
Thanks ,
Anshuman Gupta.
> 
> Regards,
> Animesh
> 
> >So testing lpsp is here is one of the test case, i.e we want to test power well associated
> >to PIPE_B should be turned off. There may be a bug in driver that when all crtc are disbaled
> >PIPE_B  associated  power is not turned off, that is what this test validated.
> >Enabling a pipe for lpsp will get covered in kms-lpsp test.
> >Thanks,
> >Anshuman Gupta.
> >>Regards,
> >>
> >>Animesh
> >>
> >>>+		igt_display_commit(&data->display);
> >>>+		valid_output++;
> >>>+	}
> >>>-	return igt_create_pattern_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888,
> >>>-				     LOCAL_DRM_FORMAT_MOD_NONE, &fb);
> >>>+	igt_require_f(valid_output, "No connected output found\n");
> >>>+	igt_assert_f(lpsp_is_enabled(data), "lpsp is not enabled\n%s:\n%s\n",
> >>>+		     PWR_DOMAIN_INFO, data->pwr_dmn_info =
> >>>+		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
> >>>  }
> >>>-static void edp_subtest(int drm_fd, drmModeResPtr drm_res,
> >>>-			drmModeConnectorPtr *drm_connectors, uint32_t devid,
> >>>-			bool use_panel_fitter)
> >>>+static void setup_lpsp_output(data_t *data)
> >>>  {
> >>>-	int i, rc;
> >>>-	uint32_t crtc_id = 0, buffer_id = 0;
> >>>-	drmModeConnectorPtr connector = NULL;
> >>>-	drmModeModeInfoPtr mode = NULL;
> >>>-	drmModeModeInfo std_1024_mode = {
> >>>-		.clock = 65000,
> >>>-		.hdisplay = 1024,
> >>>-		.hsync_start = 1048,
> >>>-		.hsync_end = 1184,
> >>>-		.htotal = 1344,
> >>>-		.hskew = 0,
> >>>-		.vdisplay = 768,
> >>>-		.vsync_start = 771,
> >>>-		.vsync_end = 777,
> >>>-		.vtotal = 806,
> >>>-		.vscan = 0,
> >>>-		.vrefresh = 60,
> >>>-		.flags = 0xA,
> >>>-		.type = 0x40,
> >>>-		.name = "Custom 1024x768",
> >>>-	};
> >>>-
> >>>-	kmstest_unset_all_crtcs(drm_fd, drm_res);
> >>>-
> >>>-	for (i = 0; i < drm_res->count_connectors; i++) {
> >>>-		drmModeConnectorPtr c = drm_connectors[i];
> >>>-
> >>>-		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
> >>>-			continue;
> >>>-		if (c->connection != DRM_MODE_CONNECTED)
> >>>-			continue;
> >>>-
> >>>-		if (!use_panel_fitter && c->count_modes) {
> >>>-			connector = c;
> >>>-			mode = &c->modes[0];
> >>>-			break;
> >>>-		}
> >>>-		if (use_panel_fitter) {
> >>>-			connector = c;
> >>>-
> >>>-			/* This is one of the modes Xorg creates for panels, so
> >>>-			 * it should work just fine. Notice that Gens that
> >>>-			 * support LPSP are too new for panels with native
> >>>-			 * 1024x768 resolution, so this should force the panel
> >>>-			 * fitter. */
> >>>-			igt_assert(c->count_modes &&
> >>>-				   c->modes[0].hdisplay > 1024);
> >>>-			igt_assert(c->count_modes &&
> >>>-				   c->modes[0].vdisplay > 768);
> >>>-			mode = &std_1024_mode;
> >>>-			break;
> >>>-		}
> >>>-	}
> >>>-	igt_require(connector);
> >>>-
> >>>-	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
> >>>-						  0);
> >>>-	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
> >>>-
> >>>-	igt_assert(buffer_id);
> >>>-	igt_assert(connector);
> >>>-	igt_assert(mode);
> >>>-
> >>>-	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
> >>>-			    &connector->connector_id, 1, mode);
> >>>-	igt_assert_eq(rc, 0);
> >>>-
> >>>-	if (use_panel_fitter) {
> >>>-		if (IS_HASWELL(devid))
> >>>-			igt_assert(!lpsp_is_enabled(drm_fd));
> >>>-		else
> >>>-			igt_assert(lpsp_is_enabled(drm_fd));
> >>>-	} else {
> >>>-		igt_assert(lpsp_is_enabled(drm_fd));
> >>>-	}
> >>>+	igt_plane_t *primary;
> >>>+
> >>>+	/* set output pipe = PIPE_A for LPSP */
> >>>+	igt_output_set_pipe(data->output, PIPE_A);
> >>>+	primary = igt_output_get_plane_type(data->output,
> >>>+					    DRM_PLANE_TYPE_PRIMARY);
> >>>+	igt_plane_set_fb(primary, NULL);
> >>>+	igt_create_pattern_fb(data->drm_fd,
> >>>+			      data->mode->hdisplay, data->mode->vdisplay,
> >>>+			      DRM_FORMAT_XRGB8888,
> >>>+			      LOCAL_DRM_FORMAT_MOD_NONE,
> >>>+			      &data->fb);
> >>>+	igt_plane_set_fb(primary, &data->fb);
> >>>+	igt_display_commit(&data->display);
> >>>  }
> >>>-static void non_edp_subtest(int drm_fd, drmModeResPtr drm_res,
> >>>-			    drmModeConnectorPtr *drm_connectors)
> >>>+static void test_cleanup(data_t *data)
> >>>  {
> >>>-	int i, rc;
> >>>-	uint32_t crtc_id = 0, buffer_id = 0;
> >>>-	drmModeConnectorPtr connector = NULL;
> >>>-	drmModeModeInfoPtr mode = NULL;
> >>>-
> >>>-	kmstest_unset_all_crtcs(drm_fd, drm_res);
> >>>-
> >>>-	for (i = 0; i < drm_res->count_connectors; i++) {
> >>>-		drmModeConnectorPtr c = drm_connectors[i];
> >>>-
> >>>-		if (c->connector_type == DRM_MODE_CONNECTOR_eDP)
> >>>-			continue;
> >>>-		if (c->connection != DRM_MODE_CONNECTED)
> >>>-			continue;
> >>>-
> >>>-		if (c->count_modes) {
> >>>-			connector = c;
> >>>-			mode = &c->modes[0];
> >>>-			break;
> >>>-		}
> >>>-	}
> >>>-	igt_require(connector);
> >>>-
> >>>-	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
> >>>-						  0);
> >>>-	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
> >>>-
> >>>-	igt_assert(buffer_id);
> >>>-	igt_assert(mode);
> >>>-
> >>>-	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
> >>>-			    &connector->connector_id, 1, mode);
> >>>-	igt_assert_eq(rc, 0);
> >>>-
> >>>-	igt_assert(!lpsp_is_enabled(drm_fd));
> >>>+	igt_plane_t *primary;
> >>>+
> >>>+	if (!data->output || data->output->pending_pipe == PIPE_NONE)
> >>>+		return;
> >>>+
> >>>+	primary = igt_output_get_plane_type(data->output,
> >>>+					    DRM_PLANE_TYPE_PRIMARY);
> >>>+	igt_plane_set_fb(primary, NULL);
> >>>+	igt_output_set_pipe(data->output, PIPE_NONE);
> >>>+	igt_display_commit(&data->display);
> >>>+	igt_remove_fb(data->drm_fd, &data->fb);
> >>>+	data->output = NULL;
> >>>  }
> >>>-#define MAX_CONNECTORS 32
> >>>+static void test_lpsp(data_t *data)
> >>>+{
> >>>+	/* LPSP is low power single pipe usages i.e. PIPE_A */
> >>>+	igt_require(igt_pipe_connector_valid(PIPE_A, data->output));
> >>>+	igt_require_f(i915_output_is_lpsp_capable(data->drm_fd, data->output),
> >>>+		      "output is not lpsp capable\n");
> >>>+
> >>>+	data->mode = igt_output_get_mode(data->output);
> >>>+	setup_lpsp_output(data);
> >>>+	igt_assert_f(lpsp_is_enabled(data), "%s: lpsp is not enabled\n%s:\n%s\n",
> >>>+		     data->output->name, PWR_DOMAIN_INFO, data->pwr_dmn_info =
> >>>+		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
> >>>+}
> >>>-int drm_fd;
> >>>-uint32_t devid;
> >>>-drmModeResPtr drm_res;
> >>>-drmModeConnectorPtr drm_connectors[MAX_CONNECTORS];
> >>>-struct intel_mmio_data mmio_data;
> >>>+IGT_TEST_DESCRIPTION("These tests validates display Low Power Single Pipe configurations");
> >>>  igt_main
> >>>  {
> >>>-	igt_fixture {
> >>>-		int i;
> >>>-
> >>>-		drm_fd = drm_open_driver_master(DRIVER_INTEL);
> >>>-		igt_require(drm_fd >= 0);
> >>>-
> >>>-		devid = intel_get_drm_devid(drm_fd);
> >>>-
> >>>-		drm_res = drmModeGetResources(drm_fd);
> >>>-		igt_require(drm_res);
> >>>-		igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
> >>>+	data_t data = {};
> >>>-		for (i = 0; i < drm_res->count_connectors; i++)
> >>>-			drm_connectors[i] = drmModeGetConnectorCurrent(drm_fd,
> >>>-							drm_res->connectors[i]);
> >>>+	igt_fixture {
> >>>+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
> >>>+		igt_require(data.drm_fd >= 0);
> >>>+		data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
> >>>+		igt_require(data.debugfs_fd >= 0);
> >>>  		igt_pm_enable_audio_runtime_pm();
> >>>-
> >>>-		igt_require(supports_lpsp(devid));
> >>>-
> >>>-		intel_register_access_init(&mmio_data, intel_get_pci_device(), 0, drm_fd);
> >>>-
> >>>  		kmstest_set_vt_graphics_mode();
> >>>+		data.devid = intel_get_drm_devid(data.drm_fd);
> >>>+		igt_display_require(&data.display, data.drm_fd);
> >>>+		igt_require(igt_pm_dmc_loaded(data.debugfs_fd));
> >>>  	}
> >>>+	igt_describe("This test validates lpsp while all crtc are disabled");
> >>>  	igt_subtest("screens-disabled")
> >>>-		screens_disabled_subtest(drm_fd, drm_res);
> >>>-	igt_subtest("edp-native")
> >>>-		edp_subtest(drm_fd, drm_res, drm_connectors, devid, false);
> >>>-	igt_subtest("non-edp")
> >>>-		non_edp_subtest(drm_fd, drm_res, drm_connectors);
> >>>+		screens_disabled_subtest(&data);
> >>>-	igt_fixture {
> >>>-		int i;
> >>>+	igt_describe("This test validates lpsp on all connected outputs on low power PIPE_A");
> >>>+	igt_subtest_with_dynamic_f("kms-lpsp") {
> >>>+		igt_display_t *display = &data.display;
> >>>+		igt_output_t *output;
> >>>-		intel_register_access_fini(&mmio_data);
> >>>-		for (i = 0; i < drm_res->count_connectors; i++)
> >>>-			drmModeFreeConnector(drm_connectors[i]);
> >>>-		drmModeFreeResources(drm_res);
> >>>-		close(drm_fd);
> >>>+		for_each_connected_output(display, output) {
> >>>+			igt_dynamic_f("kms-lpsp-%s", output->name) {
> >>>+				data.output = output;
> >>>+				test_lpsp(&data);
> >>>+			}
> >>>+
> >>>+			test_cleanup(&data);
> >>>+		}
> >>>+	}
> >>>+
> >>>+	igt_fixture {
> >>>+		free(data.pwr_dmn_info);
> >>>+		close(data.drm_fd);
> >>>+		igt_display_fini(&data.display);
> >>>  	}
> >>>  }
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 3/5] tests/i915_pm_lpsp: lpsp platform agnostic support
  2020-04-17 16:44         ` Anshuman Gupta
@ 2020-04-20 11:01           ` Manna, Animesh
  2020-05-04  5:50             ` Anshuman Gupta
  0 siblings, 1 reply; 22+ messages in thread
From: Manna, Animesh @ 2020-04-20 11:01 UTC (permalink / raw)
  To: Anshuman Gupta; +Cc: igt-dev, jani.nikula, martin.peres


[-- Attachment #1.1: Type: text/plain, Size: 15225 bytes --]


On 17-04-2020 22:14, Anshuman Gupta wrote:
> On 2020-04-17 at 21:57:25 +0530, Manna, Animesh wrote:
>> On 17-04-2020 20:58, Anshuman Gupta wrote:
>>> On 2020-04-17 at 19:52:00 +0530, Manna, Animesh wrote:
>>>> On 09-04-2020 11:09, Anshuman Gupta wrote:
>>>>> Current implementation of lpsp igt test, assumed that every non-edp
>>>>> panel isn't a lpsp panel but it is not true on TGL anymore,
>>>>> any HDMI/DP/DSI panel connected on pipe A and connected to PORT_{A,B,C}
>>>>> can drive LPSP.
>>>>> Even on older Gen9 platform a DP panel can drive lpsp on Port A.
>>>>> This requires complete design change in current lpsp igt for a platform
>>>>> agnostic support.
>>>>>
>>>>> The new igt approach is relies on connector specific
>>>>> i915_lpsp_capability and i915_lpsp_status debugfs attributes,
>>>>> these debugfs exposes whether an output is capable of driving lpsp
>>>>> and lpsp is enabled.
>>>>>
>>>>> Nuking edp-native and non-edp test, introducing a new dynamic
>>>>> igt subtest kms-lpsp, which validates lpsp on each connected output
>>>>> and skip the subtest if output is not lpsp capable.
>>>>>
>>>>> v2:
>>>>> - CI failures fixup.
>>>>> v3:
>>>>> - removed unloading of snd_modules. [Martin]
>>>>> v4:
>>>>> - Don't test non-lpsp(if lpsp disabled), no ROI to test that.
>>>>> - nuke panel-fitter test.
>>>>> v5:
>>>>> - Added dynamic subtest and igt changes according to kernel
>>>>>    debugfs i915_lpsp_status changes.
>>>>>
>>>>> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
>>>>> ---
>>>>>   tests/i915/i915_pm_lpsp.c | 285 +++++++++++++++-----------------------
>>>>>   1 file changed, 114 insertions(+), 171 deletions(-)
>>>>>
>>>>> diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
>>>>> index 08f82e7c..7be23e6c 100644
>>>>> --- a/tests/i915/i915_pm_lpsp.c
>>>>> +++ b/tests/i915/i915_pm_lpsp.c
>>>>> @@ -25,210 +25,153 @@
>>>>>    */
>>>>>   #include "igt.h"
>>>>> +#include "igt_kmod.h"
>>>>> +#include "igt_pm.h"
>>>>> +#include "igt_sysfs.h"
>>>>>   #include <sys/types.h>
>>>>>   #include <sys/stat.h>
>>>>>   #include <fcntl.h>
>>>>>   #include <unistd.h>
>>>>> +#define MAX_SINK_LPSP_INFO_BUF_LEN	4096
>>>>> -static bool supports_lpsp(uint32_t devid)
>>>>> -{
>>>>> -	return IS_HASWELL(devid) || IS_BROADWELL(devid);
>>>>> -}
>>>>> +#define PWR_DOMAIN_INFO "i915_power_domain_info"
>>>>> -static bool lpsp_is_enabled(int drm_fd)
>>>>> +typedef struct {
>>>>> +	int drm_fd;
>>>>> +	int debugfs_fd;
>>>>> +	uint32_t devid;
>>>>> +	char *pwr_dmn_info;
>>>>> +	igt_display_t display;
>>>>> +	struct igt_fb fb;
>>>>> +	drmModeModeInfo *mode;
>>>>> +	igt_output_t *output;
>>>>> +} data_t;
>>>>> +
>>>>> +static bool lpsp_is_enabled(data_t *data)
>>>>>   {
>>>>> -	uint32_t val;
>>>>> +	char buf[MAX_SINK_LPSP_INFO_BUF_LEN];
>>>>> +	int len;
>>>>> -	val = INREG(HSW_PWR_WELL_CTL2);
>>>>> -	return !(val & HSW_PWR_WELL_STATE_ENABLED);
>>>>> -}
>>>>> +	len = igt_debugfs_simple_read(data->debugfs_fd, "i915_lpsp_status",
>>>>> +				      buf, sizeof(buf));
>>>>> +	if (len < 0)
>>>>> +		igt_assert_eq(len, -ENODEV);
>>>>> -/* The LPSP mode is all about an enabled pipe, but we expect to also be in the
>>>>> - * low power mode when no pipes are enabled, so do this check anyway. */
>>>>> -static void screens_disabled_subtest(int drm_fd, drmModeResPtr drm_res)
>>>>> -{
>>>>> -	kmstest_unset_all_crtcs(drm_fd, drm_res);
>>>>> -	igt_assert(lpsp_is_enabled(drm_fd));
>>>>> +	return strstr(buf, "LPSP: enabled");
>>>>>   }
>>>>> -static uint32_t create_fb(int drm_fd, int width, int height)
>>>>> +/*
>>>>> + * The LPSP mode is all about an enabled pipe, but we expect to also be in the
>>>>> + * low power mode when no pipes are enabled, so do this check anyway.
>>>>> + */
>>>> All pipe disabled in not same as lpsp. I feel the idea behind lpsp is single
>>>> pipe usage with least power consumption ... there maybe no display
>>>> connected.
>>> Yes you are correct that is the same above comment has mentioned that "LPSP mode
>>> is all about an enabled pipe", but here test method checks for lpsp when all screens
>>> are disbaled i.e. all crtc are disabled, that is almost same as there is no display
>>> connected with respect to power consumption.
>>>>> +static void screens_disabled_subtest(data_t *data)
>>>>>   {
>>>>> -	struct igt_fb fb;
>>>>> +	igt_output_t *output;
>>>>> +	int valid_output = 0;
>>>>> +	enum pipe pipe;
>>>>> +
>>>>> +	for_each_pipe_with_single_output(&data->display, pipe, output) {
>>>>> +		data->output = output;
>>>>> +		igt_output_set_pipe(data->output, PIPE_NONE);
>>>> Passing PIPE_NONE and testing lpsp maybe not the right thing here. We may
>>>> not have connector but need to enable a single pipe to test lpsp...  rt?
>>> PIPE_NONE commit will disbale a crtc, when all crtc gets disbaled, all power well
>>> except PG1 will be disbaled, PG1 is controlled by DMC.
>> I do not think DC9 is controlled by DMC, during all crtc disable driver will disable all power-well and enter into DC9, no role of DMC here ... am I missing anything?
> yes DC9 is not controlled by DMC, and i915 program DC9 in case of runtime suspend or system wide suspend, so DC9 a deeper state depends on i915 suspend, let's think about a use case when all CRTC are disabled but gem has valid run time usages count or let's say i915 device is always on i.e (/sys/bus/pci/devices/0000\:00\:02.0/power/control attribute in on), in those cases runtime status will be always active, so i think test method to validate PIPE_B associated power well is valid here when all crtc are disbaled i.e. all display are off.

As per the above example though DC9 is not triggered but all power-well will be disabled by driver as it is display engine specific. This is not lpsp.
Here valid testcase would be to check PG1 is enabled or not.

Regards,
Animesh

> We want validate a intermediate power state here, which is a valid use case.
> Please correct me if my thought process about test method is wrong.
> Thanks ,
> Anshuman Gupta.
>> Regards,
>> Animesh
>>
>>> So testing lpsp is here is one of the test case, i.e we want to test power well associated
>>> to PIPE_B should be turned off. There may be a bug in driver that when all crtc are disbaled
>>> PIPE_B  associated  power is not turned off, that is what this test validated.
>>> Enabling a pipe for lpsp will get covered in kms-lpsp test.
>>> Thanks,
>>> Anshuman Gupta.
>>>> Regards,
>>>>
>>>> Animesh
>>>>
>>>>> +		igt_display_commit(&data->display);
>>>>> +		valid_output++;
>>>>> +	}
>>>>> -	return igt_create_pattern_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888,
>>>>> -				     LOCAL_DRM_FORMAT_MOD_NONE, &fb);
>>>>> +	igt_require_f(valid_output, "No connected output found\n");
>>>>> +	igt_assert_f(lpsp_is_enabled(data), "lpsp is not enabled\n%s:\n%s\n",
>>>>> +		     PWR_DOMAIN_INFO, data->pwr_dmn_info =
>>>>> +		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
>>>>>   }
>>>>> -static void edp_subtest(int drm_fd, drmModeResPtr drm_res,
>>>>> -			drmModeConnectorPtr *drm_connectors, uint32_t devid,
>>>>> -			bool use_panel_fitter)
>>>>> +static void setup_lpsp_output(data_t *data)
>>>>>   {
>>>>> -	int i, rc;
>>>>> -	uint32_t crtc_id = 0, buffer_id = 0;
>>>>> -	drmModeConnectorPtr connector = NULL;
>>>>> -	drmModeModeInfoPtr mode = NULL;
>>>>> -	drmModeModeInfo std_1024_mode = {
>>>>> -		.clock = 65000,
>>>>> -		.hdisplay = 1024,
>>>>> -		.hsync_start = 1048,
>>>>> -		.hsync_end = 1184,
>>>>> -		.htotal = 1344,
>>>>> -		.hskew = 0,
>>>>> -		.vdisplay = 768,
>>>>> -		.vsync_start = 771,
>>>>> -		.vsync_end = 777,
>>>>> -		.vtotal = 806,
>>>>> -		.vscan = 0,
>>>>> -		.vrefresh = 60,
>>>>> -		.flags = 0xA,
>>>>> -		.type = 0x40,
>>>>> -		.name = "Custom 1024x768",
>>>>> -	};
>>>>> -
>>>>> -	kmstest_unset_all_crtcs(drm_fd, drm_res);
>>>>> -
>>>>> -	for (i = 0; i < drm_res->count_connectors; i++) {
>>>>> -		drmModeConnectorPtr c = drm_connectors[i];
>>>>> -
>>>>> -		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
>>>>> -			continue;
>>>>> -		if (c->connection != DRM_MODE_CONNECTED)
>>>>> -			continue;
>>>>> -
>>>>> -		if (!use_panel_fitter && c->count_modes) {
>>>>> -			connector = c;
>>>>> -			mode = &c->modes[0];
>>>>> -			break;
>>>>> -		}
>>>>> -		if (use_panel_fitter) {
>>>>> -			connector = c;
>>>>> -
>>>>> -			/* This is one of the modes Xorg creates for panels, so
>>>>> -			 * it should work just fine. Notice that Gens that
>>>>> -			 * support LPSP are too new for panels with native
>>>>> -			 * 1024x768 resolution, so this should force the panel
>>>>> -			 * fitter. */
>>>>> -			igt_assert(c->count_modes &&
>>>>> -				   c->modes[0].hdisplay > 1024);
>>>>> -			igt_assert(c->count_modes &&
>>>>> -				   c->modes[0].vdisplay > 768);
>>>>> -			mode = &std_1024_mode;
>>>>> -			break;
>>>>> -		}
>>>>> -	}
>>>>> -	igt_require(connector);
>>>>> -
>>>>> -	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
>>>>> -						  0);
>>>>> -	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
>>>>> -
>>>>> -	igt_assert(buffer_id);
>>>>> -	igt_assert(connector);
>>>>> -	igt_assert(mode);
>>>>> -
>>>>> -	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
>>>>> -			    &connector->connector_id, 1, mode);
>>>>> -	igt_assert_eq(rc, 0);
>>>>> -
>>>>> -	if (use_panel_fitter) {
>>>>> -		if (IS_HASWELL(devid))
>>>>> -			igt_assert(!lpsp_is_enabled(drm_fd));
>>>>> -		else
>>>>> -			igt_assert(lpsp_is_enabled(drm_fd));
>>>>> -	} else {
>>>>> -		igt_assert(lpsp_is_enabled(drm_fd));
>>>>> -	}
>>>>> +	igt_plane_t *primary;
>>>>> +
>>>>> +	/* set output pipe = PIPE_A for LPSP */
>>>>> +	igt_output_set_pipe(data->output, PIPE_A);
>>>>> +	primary = igt_output_get_plane_type(data->output,
>>>>> +					    DRM_PLANE_TYPE_PRIMARY);
>>>>> +	igt_plane_set_fb(primary, NULL);
>>>>> +	igt_create_pattern_fb(data->drm_fd,
>>>>> +			      data->mode->hdisplay, data->mode->vdisplay,
>>>>> +			      DRM_FORMAT_XRGB8888,
>>>>> +			      LOCAL_DRM_FORMAT_MOD_NONE,
>>>>> +			      &data->fb);
>>>>> +	igt_plane_set_fb(primary, &data->fb);
>>>>> +	igt_display_commit(&data->display);
>>>>>   }
>>>>> -static void non_edp_subtest(int drm_fd, drmModeResPtr drm_res,
>>>>> -			    drmModeConnectorPtr *drm_connectors)
>>>>> +static void test_cleanup(data_t *data)
>>>>>   {
>>>>> -	int i, rc;
>>>>> -	uint32_t crtc_id = 0, buffer_id = 0;
>>>>> -	drmModeConnectorPtr connector = NULL;
>>>>> -	drmModeModeInfoPtr mode = NULL;
>>>>> -
>>>>> -	kmstest_unset_all_crtcs(drm_fd, drm_res);
>>>>> -
>>>>> -	for (i = 0; i < drm_res->count_connectors; i++) {
>>>>> -		drmModeConnectorPtr c = drm_connectors[i];
>>>>> -
>>>>> -		if (c->connector_type == DRM_MODE_CONNECTOR_eDP)
>>>>> -			continue;
>>>>> -		if (c->connection != DRM_MODE_CONNECTED)
>>>>> -			continue;
>>>>> -
>>>>> -		if (c->count_modes) {
>>>>> -			connector = c;
>>>>> -			mode = &c->modes[0];
>>>>> -			break;
>>>>> -		}
>>>>> -	}
>>>>> -	igt_require(connector);
>>>>> -
>>>>> -	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
>>>>> -						  0);
>>>>> -	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
>>>>> -
>>>>> -	igt_assert(buffer_id);
>>>>> -	igt_assert(mode);
>>>>> -
>>>>> -	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
>>>>> -			    &connector->connector_id, 1, mode);
>>>>> -	igt_assert_eq(rc, 0);
>>>>> -
>>>>> -	igt_assert(!lpsp_is_enabled(drm_fd));
>>>>> +	igt_plane_t *primary;
>>>>> +
>>>>> +	if (!data->output || data->output->pending_pipe == PIPE_NONE)
>>>>> +		return;
>>>>> +
>>>>> +	primary = igt_output_get_plane_type(data->output,
>>>>> +					    DRM_PLANE_TYPE_PRIMARY);
>>>>> +	igt_plane_set_fb(primary, NULL);
>>>>> +	igt_output_set_pipe(data->output, PIPE_NONE);
>>>>> +	igt_display_commit(&data->display);
>>>>> +	igt_remove_fb(data->drm_fd, &data->fb);
>>>>> +	data->output = NULL;
>>>>>   }
>>>>> -#define MAX_CONNECTORS 32
>>>>> +static void test_lpsp(data_t *data)
>>>>> +{
>>>>> +	/* LPSP is low power single pipe usages i.e. PIPE_A */
>>>>> +	igt_require(igt_pipe_connector_valid(PIPE_A, data->output));
>>>>> +	igt_require_f(i915_output_is_lpsp_capable(data->drm_fd, data->output),
>>>>> +		      "output is not lpsp capable\n");
>>>>> +
>>>>> +	data->mode = igt_output_get_mode(data->output);
>>>>> +	setup_lpsp_output(data);
>>>>> +	igt_assert_f(lpsp_is_enabled(data), "%s: lpsp is not enabled\n%s:\n%s\n",
>>>>> +		     data->output->name, PWR_DOMAIN_INFO, data->pwr_dmn_info =
>>>>> +		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
>>>>> +}
>>>>> -int drm_fd;
>>>>> -uint32_t devid;
>>>>> -drmModeResPtr drm_res;
>>>>> -drmModeConnectorPtr drm_connectors[MAX_CONNECTORS];
>>>>> -struct intel_mmio_data mmio_data;
>>>>> +IGT_TEST_DESCRIPTION("These tests validates display Low Power Single Pipe configurations");
>>>>>   igt_main
>>>>>   {
>>>>> -	igt_fixture {
>>>>> -		int i;
>>>>> -
>>>>> -		drm_fd = drm_open_driver_master(DRIVER_INTEL);
>>>>> -		igt_require(drm_fd >= 0);
>>>>> -
>>>>> -		devid = intel_get_drm_devid(drm_fd);
>>>>> -
>>>>> -		drm_res = drmModeGetResources(drm_fd);
>>>>> -		igt_require(drm_res);
>>>>> -		igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
>>>>> +	data_t data = {};
>>>>> -		for (i = 0; i < drm_res->count_connectors; i++)
>>>>> -			drm_connectors[i] = drmModeGetConnectorCurrent(drm_fd,
>>>>> -							drm_res->connectors[i]);
>>>>> +	igt_fixture {
>>>>> +		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
>>>>> +		igt_require(data.drm_fd >= 0);
>>>>> +		data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
>>>>> +		igt_require(data.debugfs_fd >= 0);
>>>>>   		igt_pm_enable_audio_runtime_pm();
>>>>> -
>>>>> -		igt_require(supports_lpsp(devid));
>>>>> -
>>>>> -		intel_register_access_init(&mmio_data, intel_get_pci_device(), 0, drm_fd);
>>>>> -
>>>>>   		kmstest_set_vt_graphics_mode();
>>>>> +		data.devid = intel_get_drm_devid(data.drm_fd);
>>>>> +		igt_display_require(&data.display, data.drm_fd);
>>>>> +		igt_require(igt_pm_dmc_loaded(data.debugfs_fd));
>>>>>   	}
>>>>> +	igt_describe("This test validates lpsp while all crtc are disabled");
>>>>>   	igt_subtest("screens-disabled")
>>>>> -		screens_disabled_subtest(drm_fd, drm_res);
>>>>> -	igt_subtest("edp-native")
>>>>> -		edp_subtest(drm_fd, drm_res, drm_connectors, devid, false);
>>>>> -	igt_subtest("non-edp")
>>>>> -		non_edp_subtest(drm_fd, drm_res, drm_connectors);
>>>>> +		screens_disabled_subtest(&data);
>>>>> -	igt_fixture {
>>>>> -		int i;
>>>>> +	igt_describe("This test validates lpsp on all connected outputs on low power PIPE_A");
>>>>> +	igt_subtest_with_dynamic_f("kms-lpsp") {
>>>>> +		igt_display_t *display = &data.display;
>>>>> +		igt_output_t *output;
>>>>> -		intel_register_access_fini(&mmio_data);
>>>>> -		for (i = 0; i < drm_res->count_connectors; i++)
>>>>> -			drmModeFreeConnector(drm_connectors[i]);
>>>>> -		drmModeFreeResources(drm_res);
>>>>> -		close(drm_fd);
>>>>> +		for_each_connected_output(display, output) {
>>>>> +			igt_dynamic_f("kms-lpsp-%s", output->name) {
>>>>> +				data.output = output;
>>>>> +				test_lpsp(&data);
>>>>> +			}
>>>>> +
>>>>> +			test_cleanup(&data);
>>>>> +		}
>>>>> +	}
>>>>> +
>>>>> +	igt_fixture {
>>>>> +		free(data.pwr_dmn_info);
>>>>> +		close(data.drm_fd);
>>>>> +		igt_display_fini(&data.display);
>>>>>   	}
>>>>>   }

[-- Attachment #1.2: Type: text/html, Size: 15300 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v5 3/5] tests/i915_pm_lpsp: lpsp platform agnostic support
  2020-04-20 11:01           ` Manna, Animesh
@ 2020-05-04  5:50             ` Anshuman Gupta
  0 siblings, 0 replies; 22+ messages in thread
From: Anshuman Gupta @ 2020-05-04  5:50 UTC (permalink / raw)
  To: Manna, Animesh; +Cc: igt-dev, jani.nikula, martin.peres

On 2020-04-20 at 16:31:14 +0530, Manna, Animesh wrote:
> 
> On 17-04-2020 22:14, Anshuman Gupta wrote:
> >On 2020-04-17 at 21:57:25 +0530, Manna, Animesh wrote:
> >>On 17-04-2020 20:58, Anshuman Gupta wrote:
> >>>On 2020-04-17 at 19:52:00 +0530, Manna, Animesh wrote:
> >>>>On 09-04-2020 11:09, Anshuman Gupta wrote:
> >>>>>Current implementation of lpsp igt test, assumed that every non-edp
> >>>>>panel isn't a lpsp panel but it is not true on TGL anymore,
> >>>>>any HDMI/DP/DSI panel connected on pipe A and connected to PORT_{A,B,C}
> >>>>>can drive LPSP.
> >>>>>Even on older Gen9 platform a DP panel can drive lpsp on Port A.
> >>>>>This requires complete design change in current lpsp igt for a platform
> >>>>>agnostic support.
> >>>>>
> >>>>>The new igt approach is relies on connector specific
> >>>>>i915_lpsp_capability and i915_lpsp_status debugfs attributes,
> >>>>>these debugfs exposes whether an output is capable of driving lpsp
> >>>>>and lpsp is enabled.
> >>>>>
> >>>>>Nuking edp-native and non-edp test, introducing a new dynamic
> >>>>>igt subtest kms-lpsp, which validates lpsp on each connected output
> >>>>>and skip the subtest if output is not lpsp capable.
> >>>>>
> >>>>>v2:
> >>>>>- CI failures fixup.
> >>>>>v3:
> >>>>>- removed unloading of snd_modules. [Martin]
> >>>>>v4:
> >>>>>- Don't test non-lpsp(if lpsp disabled), no ROI to test that.
> >>>>>- nuke panel-fitter test.
> >>>>>v5:
> >>>>>- Added dynamic subtest and igt changes according to kernel
> >>>>>   debugfs i915_lpsp_status changes.
> >>>>>
> >>>>>Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> >>>>>---
> >>>>>  tests/i915/i915_pm_lpsp.c | 285 +++++++++++++++-----------------------
> >>>>>  1 file changed, 114 insertions(+), 171 deletions(-)
> >>>>>
> >>>>>diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
> >>>>>index 08f82e7c..7be23e6c 100644
> >>>>>--- a/tests/i915/i915_pm_lpsp.c
> >>>>>+++ b/tests/i915/i915_pm_lpsp.c
> >>>>>@@ -25,210 +25,153 @@
> >>>>>   */
> >>>>>  #include "igt.h"
> >>>>>+#include "igt_kmod.h"
> >>>>>+#include "igt_pm.h"
> >>>>>+#include "igt_sysfs.h"
> >>>>>  #include <sys/types.h>
> >>>>>  #include <sys/stat.h>
> >>>>>  #include <fcntl.h>
> >>>>>  #include <unistd.h>
> >>>>>+#define MAX_SINK_LPSP_INFO_BUF_LEN	4096
> >>>>>-static bool supports_lpsp(uint32_t devid)
> >>>>>-{
> >>>>>-	return IS_HASWELL(devid) || IS_BROADWELL(devid);
> >>>>>-}
> >>>>>+#define PWR_DOMAIN_INFO "i915_power_domain_info"
> >>>>>-static bool lpsp_is_enabled(int drm_fd)
> >>>>>+typedef struct {
> >>>>>+	int drm_fd;
> >>>>>+	int debugfs_fd;
> >>>>>+	uint32_t devid;
> >>>>>+	char *pwr_dmn_info;
> >>>>>+	igt_display_t display;
> >>>>>+	struct igt_fb fb;
> >>>>>+	drmModeModeInfo *mode;
> >>>>>+	igt_output_t *output;
> >>>>>+} data_t;
> >>>>>+
> >>>>>+static bool lpsp_is_enabled(data_t *data)
> >>>>>  {
> >>>>>-	uint32_t val;
> >>>>>+	char buf[MAX_SINK_LPSP_INFO_BUF_LEN];
> >>>>>+	int len;
> >>>>>-	val = INREG(HSW_PWR_WELL_CTL2);
> >>>>>-	return !(val & HSW_PWR_WELL_STATE_ENABLED);
> >>>>>-}
> >>>>>+	len = igt_debugfs_simple_read(data->debugfs_fd, "i915_lpsp_status",
> >>>>>+				      buf, sizeof(buf));
> >>>>>+	if (len < 0)
> >>>>>+		igt_assert_eq(len, -ENODEV);
> >>>>>-/* The LPSP mode is all about an enabled pipe, but we expect to also be in the
> >>>>>- * low power mode when no pipes are enabled, so do this check anyway. */
> >>>>>-static void screens_disabled_subtest(int drm_fd, drmModeResPtr drm_res)
> >>>>>-{
> >>>>>-	kmstest_unset_all_crtcs(drm_fd, drm_res);
> >>>>>-	igt_assert(lpsp_is_enabled(drm_fd));
> >>>>>+	return strstr(buf, "LPSP: enabled");
> >>>>>  }
> >>>>>-static uint32_t create_fb(int drm_fd, int width, int height)
> >>>>>+/*
> >>>>>+ * The LPSP mode is all about an enabled pipe, but we expect to also be in the
> >>>>>+ * low power mode when no pipes are enabled, so do this check anyway.
> >>>>>+ */
> >>>>All pipe disabled in not same as lpsp. I feel the idea behind lpsp is single
> >>>>pipe usage with least power consumption ... there maybe no display
> >>>>connected.
> >>>Yes you are correct that is the same above comment has mentioned that "LPSP mode
> >>>is all about an enabled pipe", but here test method checks for lpsp when all screens
> >>>are disbaled i.e. all crtc are disabled, that is almost same as there is no display
> >>>connected with respect to power consumption.
> >>>>>+static void screens_disabled_subtest(data_t *data)
> >>>>>  {
> >>>>>-	struct igt_fb fb;
> >>>>>+	igt_output_t *output;
> >>>>>+	int valid_output = 0;
> >>>>>+	enum pipe pipe;
> >>>>>+
> >>>>>+	for_each_pipe_with_single_output(&data->display, pipe, output) {
> >>>>>+		data->output = output;
> >>>>>+		igt_output_set_pipe(data->output, PIPE_NONE);
> >>>>Passing PIPE_NONE and testing lpsp maybe not the right thing here. We may
> >>>>not have connector but need to enable a single pipe to test lpsp...  rt?
> >>>PIPE_NONE commit will disbale a crtc, when all crtc gets disbaled, all power well
> >>>except PG1 will be disbaled, PG1 is controlled by DMC.
> >>I do not think DC9 is controlled by DMC, during all crtc disable driver will disable all power-well and enter into DC9, no role of DMC here ... am I missing anything?
> >yes DC9 is not controlled by DMC, and i915 program DC9 in case of runtime suspend or system wide suspend, so DC9 a deeper state depends on i915 suspend, let's think about a use case when all CRTC are disabled but gem has valid run time usages count or let's say i915 device is always on i.e (/sys/bus/pci/devices/0000\:00\:02.0/power/control attribute in on), in those cases runtime status will be always active, so i think test method to validate PIPE_B associated power well is valid here when all crtc are disbaled i.e. all display are off.
> 
> As per the above example though DC9 is not triggered but all power-well will be disabled by driver as it is display engine specific. This is not lpsp.
IMHO Code-comment here itself clears that LPSP is only about an enabled pipe so there shouldn't be any confusion.
> Here valid testcase would be to check PG1 is enabled or not.
I think it is not wrong if we validate PG2/PG3 i.e. LPSP associated power well in this test, PG1 is "Always On" on HSW/BDW and controlled by DMC gen9 onwards, 
validating PG1 is out of scope for LPSP test and not relevent for HSW/BDW.
AFAIU from ur comment, u might be in favour of nuke this test but HSW/BDW require this test.
I have not written this sub-test, this patch just modifies the test method, philosophy of sub-test is same as exisitng sub-test.
Please suggest how to take forward this igt-subtest.

Thanks,
Anshuman Gupta.
> 
> Regards,
> Animesh
> 
> >We want validate a intermediate power state here, which is a valid use case.
> >Please correct me if my thought process about test method is wrong.
> >Thanks ,
> >Anshuman Gupta.
> >>Regards,
> >>Animesh
> >>
> >>>So testing lpsp is here is one of the test case, i.e we want to test power well associated
> >>>to PIPE_B should be turned off. There may be a bug in driver that when all crtc are disbaled
> >>>PIPE_B  associated  power is not turned off, that is what this test validated.
> >>>Enabling a pipe for lpsp will get covered in kms-lpsp test.
> >>>Thanks,
> >>>Anshuman Gupta.
> >>>>Regards,
> >>>>
> >>>>Animesh
> >>>>
> >>>>>+		igt_display_commit(&data->display);
> >>>>>+		valid_output++;
> >>>>>+	}
> >>>>>-	return igt_create_pattern_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888,
> >>>>>-				     LOCAL_DRM_FORMAT_MOD_NONE, &fb);
> >>>>>+	igt_require_f(valid_output, "No connected output found\n");
> >>>>>+	igt_assert_f(lpsp_is_enabled(data), "lpsp is not enabled\n%s:\n%s\n",
> >>>>>+		     PWR_DOMAIN_INFO, data->pwr_dmn_info =
> >>>>>+		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
> >>>>>  }
> >>>>>-static void edp_subtest(int drm_fd, drmModeResPtr drm_res,
> >>>>>-			drmModeConnectorPtr *drm_connectors, uint32_t devid,
> >>>>>-			bool use_panel_fitter)
> >>>>>+static void setup_lpsp_output(data_t *data)
> >>>>>  {
> >>>>>-	int i, rc;
> >>>>>-	uint32_t crtc_id = 0, buffer_id = 0;
> >>>>>-	drmModeConnectorPtr connector = NULL;
> >>>>>-	drmModeModeInfoPtr mode = NULL;
> >>>>>-	drmModeModeInfo std_1024_mode = {
> >>>>>-		.clock = 65000,
> >>>>>-		.hdisplay = 1024,
> >>>>>-		.hsync_start = 1048,
> >>>>>-		.hsync_end = 1184,
> >>>>>-		.htotal = 1344,
> >>>>>-		.hskew = 0,
> >>>>>-		.vdisplay = 768,
> >>>>>-		.vsync_start = 771,
> >>>>>-		.vsync_end = 777,
> >>>>>-		.vtotal = 806,
> >>>>>-		.vscan = 0,
> >>>>>-		.vrefresh = 60,
> >>>>>-		.flags = 0xA,
> >>>>>-		.type = 0x40,
> >>>>>-		.name = "Custom 1024x768",
> >>>>>-	};
> >>>>>-
> >>>>>-	kmstest_unset_all_crtcs(drm_fd, drm_res);
> >>>>>-
> >>>>>-	for (i = 0; i < drm_res->count_connectors; i++) {
> >>>>>-		drmModeConnectorPtr c = drm_connectors[i];
> >>>>>-
> >>>>>-		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
> >>>>>-			continue;
> >>>>>-		if (c->connection != DRM_MODE_CONNECTED)
> >>>>>-			continue;
> >>>>>-
> >>>>>-		if (!use_panel_fitter && c->count_modes) {
> >>>>>-			connector = c;
> >>>>>-			mode = &c->modes[0];
> >>>>>-			break;
> >>>>>-		}
> >>>>>-		if (use_panel_fitter) {
> >>>>>-			connector = c;
> >>>>>-
> >>>>>-			/* This is one of the modes Xorg creates for panels, so
> >>>>>-			 * it should work just fine. Notice that Gens that
> >>>>>-			 * support LPSP are too new for panels with native
> >>>>>-			 * 1024x768 resolution, so this should force the panel
> >>>>>-			 * fitter. */
> >>>>>-			igt_assert(c->count_modes &&
> >>>>>-				   c->modes[0].hdisplay > 1024);
> >>>>>-			igt_assert(c->count_modes &&
> >>>>>-				   c->modes[0].vdisplay > 768);
> >>>>>-			mode = &std_1024_mode;
> >>>>>-			break;
> >>>>>-		}
> >>>>>-	}
> >>>>>-	igt_require(connector);
> >>>>>-
> >>>>>-	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
> >>>>>-						  0);
> >>>>>-	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
> >>>>>-
> >>>>>-	igt_assert(buffer_id);
> >>>>>-	igt_assert(connector);
> >>>>>-	igt_assert(mode);
> >>>>>-
> >>>>>-	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
> >>>>>-			    &connector->connector_id, 1, mode);
> >>>>>-	igt_assert_eq(rc, 0);
> >>>>>-
> >>>>>-	if (use_panel_fitter) {
> >>>>>-		if (IS_HASWELL(devid))
> >>>>>-			igt_assert(!lpsp_is_enabled(drm_fd));
> >>>>>-		else
> >>>>>-			igt_assert(lpsp_is_enabled(drm_fd));
> >>>>>-	} else {
> >>>>>-		igt_assert(lpsp_is_enabled(drm_fd));
> >>>>>-	}
> >>>>>+	igt_plane_t *primary;
> >>>>>+
> >>>>>+	/* set output pipe = PIPE_A for LPSP */
> >>>>>+	igt_output_set_pipe(data->output, PIPE_A);
> >>>>>+	primary = igt_output_get_plane_type(data->output,
> >>>>>+					    DRM_PLANE_TYPE_PRIMARY);
> >>>>>+	igt_plane_set_fb(primary, NULL);
> >>>>>+	igt_create_pattern_fb(data->drm_fd,
> >>>>>+			      data->mode->hdisplay, data->mode->vdisplay,
> >>>>>+			      DRM_FORMAT_XRGB8888,
> >>>>>+			      LOCAL_DRM_FORMAT_MOD_NONE,
> >>>>>+			      &data->fb);
> >>>>>+	igt_plane_set_fb(primary, &data->fb);
> >>>>>+	igt_display_commit(&data->display);
> >>>>>  }
> >>>>>-static void non_edp_subtest(int drm_fd, drmModeResPtr drm_res,
> >>>>>-			    drmModeConnectorPtr *drm_connectors)
> >>>>>+static void test_cleanup(data_t *data)
> >>>>>  {
> >>>>>-	int i, rc;
> >>>>>-	uint32_t crtc_id = 0, buffer_id = 0;
> >>>>>-	drmModeConnectorPtr connector = NULL;
> >>>>>-	drmModeModeInfoPtr mode = NULL;
> >>>>>-
> >>>>>-	kmstest_unset_all_crtcs(drm_fd, drm_res);
> >>>>>-
> >>>>>-	for (i = 0; i < drm_res->count_connectors; i++) {
> >>>>>-		drmModeConnectorPtr c = drm_connectors[i];
> >>>>>-
> >>>>>-		if (c->connector_type == DRM_MODE_CONNECTOR_eDP)
> >>>>>-			continue;
> >>>>>-		if (c->connection != DRM_MODE_CONNECTED)
> >>>>>-			continue;
> >>>>>-
> >>>>>-		if (c->count_modes) {
> >>>>>-			connector = c;
> >>>>>-			mode = &c->modes[0];
> >>>>>-			break;
> >>>>>-		}
> >>>>>-	}
> >>>>>-	igt_require(connector);
> >>>>>-
> >>>>>-	crtc_id = kmstest_find_crtc_for_connector(drm_fd, drm_res, connector,
> >>>>>-						  0);
> >>>>>-	buffer_id = create_fb(drm_fd, mode->hdisplay, mode->vdisplay);
> >>>>>-
> >>>>>-	igt_assert(buffer_id);
> >>>>>-	igt_assert(mode);
> >>>>>-
> >>>>>-	rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
> >>>>>-			    &connector->connector_id, 1, mode);
> >>>>>-	igt_assert_eq(rc, 0);
> >>>>>-
> >>>>>-	igt_assert(!lpsp_is_enabled(drm_fd));
> >>>>>+	igt_plane_t *primary;
> >>>>>+
> >>>>>+	if (!data->output || data->output->pending_pipe == PIPE_NONE)
> >>>>>+		return;
> >>>>>+
> >>>>>+	primary = igt_output_get_plane_type(data->output,
> >>>>>+					    DRM_PLANE_TYPE_PRIMARY);
> >>>>>+	igt_plane_set_fb(primary, NULL);
> >>>>>+	igt_output_set_pipe(data->output, PIPE_NONE);
> >>>>>+	igt_display_commit(&data->display);
> >>>>>+	igt_remove_fb(data->drm_fd, &data->fb);
> >>>>>+	data->output = NULL;
> >>>>>  }
> >>>>>-#define MAX_CONNECTORS 32
> >>>>>+static void test_lpsp(data_t *data)
> >>>>>+{
> >>>>>+	/* LPSP is low power single pipe usages i.e. PIPE_A */
> >>>>>+	igt_require(igt_pipe_connector_valid(PIPE_A, data->output));
> >>>>>+	igt_require_f(i915_output_is_lpsp_capable(data->drm_fd, data->output),
> >>>>>+		      "output is not lpsp capable\n");
> >>>>>+
> >>>>>+	data->mode = igt_output_get_mode(data->output);
> >>>>>+	setup_lpsp_output(data);
> >>>>>+	igt_assert_f(lpsp_is_enabled(data), "%s: lpsp is not enabled\n%s:\n%s\n",
> >>>>>+		     data->output->name, PWR_DOMAIN_INFO, data->pwr_dmn_info =
> >>>>>+		     igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
> >>>>>+}
> >>>>>-int drm_fd;
> >>>>>-uint32_t devid;
> >>>>>-drmModeResPtr drm_res;
> >>>>>-drmModeConnectorPtr drm_connectors[MAX_CONNECTORS];
> >>>>>-struct intel_mmio_data mmio_data;
> >>>>>+IGT_TEST_DESCRIPTION("These tests validates display Low Power Single Pipe configurations");
> >>>>>  igt_main
> >>>>>  {
> >>>>>-	igt_fixture {
> >>>>>-		int i;
> >>>>>-
> >>>>>-		drm_fd = drm_open_driver_master(DRIVER_INTEL);
> >>>>>-		igt_require(drm_fd >= 0);
> >>>>>-
> >>>>>-		devid = intel_get_drm_devid(drm_fd);
> >>>>>-
> >>>>>-		drm_res = drmModeGetResources(drm_fd);
> >>>>>-		igt_require(drm_res);
> >>>>>-		igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
> >>>>>+	data_t data = {};
> >>>>>-		for (i = 0; i < drm_res->count_connectors; i++)
> >>>>>-			drm_connectors[i] = drmModeGetConnectorCurrent(drm_fd,
> >>>>>-							drm_res->connectors[i]);
> >>>>>+	igt_fixture {
> >>>>>+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
> >>>>>+		igt_require(data.drm_fd >= 0);
> >>>>>+		data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
> >>>>>+		igt_require(data.debugfs_fd >= 0);
> >>>>>  		igt_pm_enable_audio_runtime_pm();
> >>>>>-
> >>>>>-		igt_require(supports_lpsp(devid));
> >>>>>-
> >>>>>-		intel_register_access_init(&mmio_data, intel_get_pci_device(), 0, drm_fd);
> >>>>>-
> >>>>>  		kmstest_set_vt_graphics_mode();
> >>>>>+		data.devid = intel_get_drm_devid(data.drm_fd);
> >>>>>+		igt_display_require(&data.display, data.drm_fd);
> >>>>>+		igt_require(igt_pm_dmc_loaded(data.debugfs_fd));
> >>>>>  	}
> >>>>>+	igt_describe("This test validates lpsp while all crtc are disabled");
> >>>>>  	igt_subtest("screens-disabled")
> >>>>>-		screens_disabled_subtest(drm_fd, drm_res);
> >>>>>-	igt_subtest("edp-native")
> >>>>>-		edp_subtest(drm_fd, drm_res, drm_connectors, devid, false);
> >>>>>-	igt_subtest("non-edp")
> >>>>>-		non_edp_subtest(drm_fd, drm_res, drm_connectors);
> >>>>>+		screens_disabled_subtest(&data);
> >>>>>-	igt_fixture {
> >>>>>-		int i;
> >>>>>+	igt_describe("This test validates lpsp on all connected outputs on low power PIPE_A");
> >>>>>+	igt_subtest_with_dynamic_f("kms-lpsp") {
> >>>>>+		igt_display_t *display = &data.display;
> >>>>>+		igt_output_t *output;
> >>>>>-		intel_register_access_fini(&mmio_data);
> >>>>>-		for (i = 0; i < drm_res->count_connectors; i++)
> >>>>>-			drmModeFreeConnector(drm_connectors[i]);
> >>>>>-		drmModeFreeResources(drm_res);
> >>>>>-		close(drm_fd);
> >>>>>+		for_each_connected_output(display, output) {
> >>>>>+			igt_dynamic_f("kms-lpsp-%s", output->name) {
> >>>>>+				data.output = output;
> >>>>>+				test_lpsp(&data);
> >>>>>+			}
> >>>>>+
> >>>>>+			test_cleanup(&data);
> >>>>>+		}
> >>>>>+	}
> >>>>>+
> >>>>>+	igt_fixture {
> >>>>>+		free(data.pwr_dmn_info);
> >>>>>+		close(data.drm_fd);
> >>>>>+		igt_display_fini(&data.display);
> >>>>>  	}
> >>>>>  }
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2020-05-04  5:59 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09  5:39 [igt-dev] [PATCH i-g-t v5 0/5] lpsp platform agnostic support Anshuman Gupta
2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 1/5] tests/i915_pm_lpsp: Nuke the panel-fitter test Anshuman Gupta
2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 2/5] lib/igt_pm: Add lib func to get lpsp capability Anshuman Gupta
2020-04-14 16:26   ` Manna, Animesh
2020-04-14 16:25     ` Anshuman Gupta
2020-04-15 12:48   ` Anshuman Gupta
2020-04-17 14:08     ` Manna, Animesh
2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 3/5] tests/i915_pm_lpsp: lpsp platform agnostic support Anshuman Gupta
2020-04-17 14:22   ` Manna, Animesh
2020-04-17 15:28     ` Anshuman Gupta
2020-04-17 16:27       ` Manna, Animesh
2020-04-17 16:44         ` Anshuman Gupta
2020-04-20 11:01           ` Manna, Animesh
2020-05-04  5:50             ` Anshuman Gupta
2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 4/5] tests/i915_pm_lpsp: screens-disabled subtest use igt_wait Anshuman Gupta
2020-04-17 14:27   ` Manna, Animesh
2020-04-17 15:30     ` Anshuman Gupta
2020-04-09  5:39 ` [igt-dev] [PATCH i-g-t v5 5/5] tests/i915_pm_rpm: lpsp/non-lpsp screen mode_set_data Anshuman Gupta
2020-04-09  6:41 ` [igt-dev] ✗ Fi.CI.BAT: failure for lpsp platform agnostic support (rev7) Patchwork
2020-04-15 13:54 ` [igt-dev] ✗ GitLab.Pipeline: warning for lpsp platform agnostic support (rev8) Patchwork
2020-04-15 14:02 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2020-04-16  9:10 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.