summaryrefslogtreecommitdiff
path: root/tests/i915/i915_pm_dc.c
diff options
context:
space:
mode:
authorAnshuman Gupta <anshuman.gupta@intel.com>2019-10-29 18:59:10 +0530
committerRamalingam C <ramalingam.c@intel.com>2019-11-05 10:42:10 +0530
commit2abdaf0353ef12acf72a2f842898e24eaac3293d (patch)
tree98bfd8c1989a5bcac3862c92a72f4dd791bbf191 /tests/i915/i915_pm_dc.c
parent6c3bae1455c373c49fe744ea037e33b11e8daf1e (diff)
DC3CO PSR2 helpers
Add DC3CO IGT validation prerequisites stuff so we can enable DC3CO IGT test. v2: Removed psr2_idle_wait_entry and get_psr2_status function. v3: Changed macro definition and removed extra line. v4: Simplified edp_psr2_enabled function as per Arek's comments. v5: Simplified read_dc_counter function as per Arek's comments. Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com> Signed-off-by: Jeevan B <jeevan.b@intel.com> Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Animesh Manna <animesh.manna@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Link: https://patchwork.freedesktop.org/patch/338130/?series=66648&rev=8
Diffstat (limited to 'tests/i915/i915_pm_dc.c')
-rw-r--r--tests/i915/i915_pm_dc.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/tests/i915/i915_pm_dc.c b/tests/i915/i915_pm_dc.c
index ce3319b7..6132ebd5 100644
--- a/tests/i915/i915_pm_dc.c
+++ b/tests/i915/i915_pm_dc.c
@@ -34,8 +34,9 @@
#include "limits.h"
/* DC State Flags */
-#define CHECK_DC5 1
-#define CHECK_DC6 2
+#define CHECK_DC5 (1 << 0)
+#define CHECK_DC6 (1 << 1)
+#define CHECK_DC3CO (1 << 2)
typedef struct {
int drm_fd;
@@ -88,6 +89,16 @@ static bool edp_psr_sink_support(data_t *data)
return strstr(buf, "Sink support: yes");
}
+static bool edp_psr2_enabled(data_t *data)
+{
+ char buf[512];
+
+ igt_debugfs_simple_read(data->debugfs_fd, "i915_edp_psr_status",
+ buf, sizeof(buf));
+
+ return strstr(buf, "PSR mode: PSR2 enabled") != NULL;
+}
+
static void cleanup_dc_psr(data_t *data)
{
igt_plane_t *primary;
@@ -137,16 +148,17 @@ static uint32_t read_dc_counter(uint32_t drm_fd, int dc_flag)
igt_debugfs_read(drm_fd, "i915_dmc_info", buf);
- if (dc_flag & CHECK_DC5)
+ if (dc_flag & CHECK_DC5) {
str = strstr(buf, "DC3 -> DC5 count");
- else if (dc_flag & CHECK_DC6)
+ igt_skip_on_f(!str, "DC5 counter is not available\n");
+ } else if (dc_flag & CHECK_DC6) {
str = strstr(buf, "DC5 -> DC6 count");
+ igt_skip_on_f(!str, "DC6 counter is not available\n");
+ } else if (dc_flag & CHECK_DC3CO) {
+ str = strstr(buf, "DC3CO count");
+ igt_skip_on_f(!str, "DC3CO counter is not available\n");
+ }
- /* Check DC5/DC6 counter is available for the platform.
- * Skip the test if counter is not available.
- */
- igt_skip_on_f(!str, "DC%d counter is not available\n",
- dc_flag & CHECK_DC5 ? 5 : 6);
return get_dc_counter(str);
}
@@ -158,9 +170,12 @@ static bool dc_state_wait_entry(int drm_fd, int dc_flag, int prev_dc_count)
static void check_dc_counter(int drm_fd, int dc_flag, uint32_t prev_dc_count)
{
+ char tmp[64];
+
+ snprintf(tmp, sizeof(tmp), "%s", dc_flag & CHECK_DC3CO ? "DC3CO" :
+ (dc_flag & CHECK_DC5 ? "DC5" : "DC6"));
igt_assert_f(dc_state_wait_entry(drm_fd, dc_flag, prev_dc_count),
- "DC%d state is not achieved\n",
- dc_flag & CHECK_DC5 ? 5 : 6);
+ "%s state is not achieved\n", tmp);
}
static void test_dc_state_psr(data_t *data, int dc_flag)