From: Anshuman Gupta <anshuman.gupta@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 1/2] igt/i915/i915_pm_lpsp enable pm_lpsp for platforms till Gen11.
Date: Fri, 5 Apr 2019 14:21:54 +0530 [thread overview]
Message-ID: <1554454315-20605-2-git-send-email-anshuman.gupta@intel.com> (raw)
In-Reply-To: <1554454315-20605-1-git-send-email-anshuman.gupta@intel.com>
Enabling i915_pm_lpsp igt tests for all platforms till Gen11.
Earlier these test were enabled only on haswell and broadwell
platforms.
Cc: imre.deak@intel.com
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
tests/i915/i915_pm_lpsp.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/tests/i915/i915_pm_lpsp.c b/tests/i915/i915_pm_lpsp.c
index b319dbe..020f8b3 100644
--- a/tests/i915/i915_pm_lpsp.c
+++ b/tests/i915/i915_pm_lpsp.c
@@ -30,18 +30,43 @@
#include <fcntl.h>
#include <unistd.h>
+#define HSW_PW_CTL_IDX_GLOBAL 15
+#define SKL_PW_CTL_IDX_PW_2 15
+#define ICL_PW_CTL_IDX_PW_3 2
+
+#define HSW_PWR_WELL_CTL_REQ(pw_idx) (0x2 << ((pw_idx) * 2))
+#define HSW_PWR_WELL_CTL_STATE(pw_idx) (0x1 << ((pw_idx) * 2))
+
+int no_lpsp_pw_idx;
static bool supports_lpsp(uint32_t devid)
{
- return IS_HASWELL(devid) || IS_BROADWELL(devid);
+ return IS_HASWELL(devid) || IS_BROADWELL(devid)
+ || AT_LEAST_GEN(devid, 9);
+}
+
+static bool get_no_lpsp_pw_idx(uint32_t devid)
+{
+ if (IS_HASWELL(devid) || IS_BROADWELL(devid))
+ no_lpsp_pw_idx = HSW_PW_CTL_IDX_GLOBAL;
+ else if (IS_GEN(devid, 11))
+ no_lpsp_pw_idx = ICL_PW_CTL_IDX_PW_3;
+ else if (AT_LEAST_GEN(devid, 9))
+ no_lpsp_pw_idx = SKL_PW_CTL_IDX_PW_2;
+ else
+ return false;
+
+ return true;
}
static bool lpsp_is_enabled(int drm_fd)
{
uint32_t val;
+ uint32_t mask = HSW_PWR_WELL_CTL_REQ(no_lpsp_pw_idx) |
+ HSW_PWR_WELL_CTL_STATE(no_lpsp_pw_idx);
val = INREG(HSW_PWR_WELL_CTL2);
- return !(val & HSW_PWR_WELL_STATE_ENABLED);
+ return !((val & mask) == mask);
}
/* The LPSP mode is all about an enabled pipe, but we expect to also be in the
@@ -212,6 +237,7 @@ igt_main
intel_register_access_init(intel_get_pci_device(), 0, drm_fd);
+ igt_require(get_no_lpsp_pw_idx(devid));
kmstest_set_vt_graphics_mode();
}
--
2.7.4
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-04-05 8:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-05 8:51 [igt-dev] [PATCH i-g-t v2 0/2] igt/i915/i915_pm_lpsp enable pm_lpsp for platforms till Gen11 v2 Anshuman Gupta
2019-04-05 8:51 ` Anshuman Gupta [this message]
2019-04-05 8:51 ` [igt-dev] [PATCH i-g-t v2 2/2] DO_NOT_MERGE add i915_pm_lpsp subtests to CI fast feedback list Anshuman Gupta
2019-04-05 10:19 ` [igt-dev] ✗ Fi.CI.BAT: failure for igt/i915/i915_pm_lpsp enable pm_lpsp for platforms till Gen11 v2 Patchwork
2019-04-09 12:41 ` Gupta, Anshuman
2019-04-10 15:55 ` Imre Deak
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=1554454315-20605-2-git-send-email-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