From: Anshuman Gupta <anshuman.gupta@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v6 2/4] igt/i915/i915_pm_lpsp check lpsp relevance on non edp panel.
Date: Thu, 30 May 2019 17:51:29 +0530 [thread overview]
Message-ID: <20190530122131.7634-3-anshuman.gupta@intel.com> (raw)
In-Reply-To: <20190530122131.7634-1-anshuman.gupta@intel.com>
Earlier on HSW/BDW it was assumed that only eDP panel will act
as lpsp. But that is not true now.
So checking whether a non edp panel can act as lpsp or not.
v2: CI igt fixures.
v3: CI igt fixture.
v4: Changed macro LPSP_PORT to SKL_LPSP_PORT. [Animesh]
Cc: imre.deak@intel.com
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
tests/i915/i915_pm_lpsp.c | 69 +++++++++++++++++++++++++++++++++++++--
1 file changed, 66 insertions(+), 3 deletions(-)
diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
index 5885ed5f..53cb7843 100644
--- a/tests/i915/i915_pm_lpsp.c
+++ b/tests/i915/i915_pm_lpsp.c
@@ -35,6 +35,9 @@
#define SKL_PW_CTL_PW_2_MASK (0x1 << 30)
#define ICL_PW_CTL_PW_3_MASK (0x1 << 4)
+/* DDI A port will be LPSP on non-edp panel till Gen11 */
+#define SKL_LPSP_PORT 'A'
+
#define DUMP_DBGFS(file1, file2, fd) \
"%s:\n%s\n%s:\n%s\n", file1, \
igt_sysfs_get(fd, file1), file2, \
@@ -73,6 +76,55 @@ static bool lpsp_is_enabled(uint32_t devid)
return !(val & mask);
}
+static bool is_non_edp_ddia_port(FILE *file, char *info)
+{
+ int ret;
+ char ddi[256];
+ char port;
+ bool ddi_a_port = false;
+
+ while (fgets(info, 256, file)) {
+ if (strstr(info, "encoder")) {
+ ret = sscanf(info, "%*s %*s %*s %s %c", ddi, &port);
+ igt_assert_eq(ret, 2);
+ if (!strcmp(ddi, "DDI") && port == SKL_LPSP_PORT)
+ ddi_a_port = true;
+ }
+ if (strstr(info, "connector") && strstr(info, "eDP"))
+ ddi_a_port = false;
+ }
+ return ddi_a_port;
+}
+
+static bool non_edp_lpsp_check(int device)
+{
+ char tmp[256];
+ FILE *file;
+ int line;
+ int fd;
+ bool is_lpsp = false;
+
+ fd = igt_debugfs_open(device, "i915_display_info", O_RDONLY);
+ file = fdopen(fd, "r");
+ igt_skip_on(!file);
+
+ line = 0;
+ while (fgets(tmp, 256, file)) {
+ if (strstr(tmp, "CRTC") && line > 0) {
+ if (strstr(tmp, "pipe: A") &&
+ strstr(tmp, "active=yes")) {
+ is_lpsp = is_non_edp_ddia_port(file, tmp);
+ break;
+ }
+ }
+ line++;
+ }
+
+ fclose(file);
+ close(fd);
+ return is_lpsp;
+}
+
/* 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,
@@ -215,9 +267,20 @@ static void non_edp_subtest(int drm_fd, drmModeResPtr drm_res, uint32_t devid,
rc = drmModeSetCrtc(drm_fd, crtc_id, buffer_id, 0, 0,
&connector->connector_id, 1, mode);
igt_assert_eq(rc, 0);
- igt_assert_f(!lpsp_is_enabled(devid),
- DUMP_DBGFS("i915_runtime_pm_status",
- "i915_power_domain_info", fd));
+
+ if (non_edp_lpsp_check(drm_fd) ||
+ connector->connector_type == DRM_MODE_CONNECTOR_DSI)
+ /* Some times delayed audio codec disabling causes to fail the.
+ * the test. Using igt_wait to check lpsp after
+ * drm_mode_setcrtc().
+ */
+ igt_assert_f(igt_wait(lpsp_is_enabled(devid), 1000, 100),
+ DUMP_DBGFS("i915_runtime_pm_status",
+ "i915_power_domain_info", fd));
+ else
+ igt_assert_f(!lpsp_is_enabled(devid),
+ DUMP_DBGFS("i915_runtime_pm_status",
+ "i915_power_domain_info", fd));
}
#define MAX_CONNECTORS 32
--
2.21.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-05-30 12:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 12:21 [igt-dev] [PATCH i-g-t v6 0/4] enable pm_lpsp for platforms till Gen11 v6 Anshuman Gupta
2019-05-30 12:21 ` [igt-dev] [PATCH i-g-t v6 1/4] igt/i915/i915_pm_lpsp enable pm_lpsp for platforms till Gen11 Anshuman Gupta
2019-05-30 12:21 ` Anshuman Gupta [this message]
2019-05-30 12:21 ` [igt-dev] [PATCH i-g-t v6 3/4] igt/i915/i915_pm_lpsp: panel-fitter subtest modifications Anshuman Gupta
2019-05-30 12:21 ` [igt-dev] [PATCH i-g-t v6 4/4] DO_NOT_MERGE add i915_pm_lpsp subtests to CI fast feedback list Anshuman Gupta
2019-05-31 10:26 ` [igt-dev] ✗ Fi.CI.BAT: failure for enable pm_lpsp for platforms till Gen11 v6 Patchwork
2019-07-04 17:09 ` [igt-dev] ✗ Fi.CI.BAT: failure for enable pm_lpsp for platforms till Gen11 v6 (rev2) Patchwork
2019-08-14 11:49 ` [igt-dev] ✗ Fi.CI.BAT: failure for enable pm_lpsp for platforms till Gen11 v6 (rev3) Patchwork
2019-08-18 12:58 ` Gupta, Anshuman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190530122131.7634-3-anshuman.gupta@intel.com \
--to=anshuman.gupta@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox