summaryrefslogtreecommitdiff
path: root/tests/i915/i915_pm_dc.c
diff options
context:
space:
mode:
authorJigar Bhatt <jigar.bhatt@intel.com>2021-03-24 16:32:02 +0530
committerAshutosh Dixit <ashutosh.dixit@intel.com>2021-03-24 11:19:54 -0700
commit064b35bce0d265e8e9560e823c678e67630e9d7a (patch)
treec39b783f817d1209eb8d1675f16019b1fb0ff904 /tests/i915/i915_pm_dc.c
parent1a972788619509276061e3405671777ae9d28962 (diff)
tests/i915/i915_pm_dc: Fix misc warnings
Fix the mixed declarations compile warning. Fix comment indentation in check_dc9(). Fix checkpatch.pl warnings. Fixes: 529e182e3011 ("tests/i915/i915_pm_dc: Add DC9 igt test") Signed-off-by: Jigar Bhatt <jigar.bhatt@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Diffstat (limited to 'tests/i915/i915_pm_dc.c')
-rw-r--r--tests/i915/i915_pm_dc.c67
1 files changed, 34 insertions, 33 deletions
diff --git a/tests/i915/i915_pm_dc.c b/tests/i915/i915_pm_dc.c
index 17ae6622..0301fecc 100644
--- a/tests/i915/i915_pm_dc.c
+++ b/tests/i915/i915_pm_dc.c
@@ -386,48 +386,49 @@ static void test_dc_state_dpms(data_t *data, int dc_flag)
static bool support_dc6(int debugfs_fd)
{
- char buf[4096];
+ char buf[4096];
- igt_debugfs_simple_read(debugfs_fd, "i915_dmc_info",
- buf, sizeof(buf));
- return strstr(buf, "DC5 -> DC6 count");
+ igt_debugfs_simple_read(debugfs_fd, "i915_dmc_info",
+ buf, sizeof(buf));
+ return strstr(buf, "DC5 -> DC6 count");
}
static bool check_dc9(uint32_t debugfs_fd, int prev_dc, bool dc6_supported, int seconds)
{
-/*
- * Since we do not have DC9 Counter,
- * So we rely on dc5/dc6 counter reset to check if Display Engine was in DC9.
- */
- return igt_wait(dc6_supported ? read_dc_counter(debugfs_fd, CHECK_DC6) <
- prev_dc : read_dc_counter(debugfs_fd, CHECK_DC5) <
- prev_dc, seconds, 100);
+ /*
+ * since we do not have DC9 counter,
+ * so we rely on dc5/dc6 counter reset to check if display engine was in DC9.
+ */
+ return igt_wait(dc6_supported ? read_dc_counter(debugfs_fd, CHECK_DC6) <
+ prev_dc : read_dc_counter(debugfs_fd, CHECK_DC5) <
+ prev_dc, seconds, 100);
}
static void setup_dc9_dpms(data_t *data, int prev_dc, bool dc6_supported)
{
- setup_dc_dpms(data);
- dpms_off(data);
- igt_skip_on_f(!(igt_wait(dc6_supported ? read_dc_counter(data->debugfs_fd, CHECK_DC6) >
- prev_dc : read_dc_counter(data->debugfs_fd, CHECK_DC5) >
- prev_dc, 3000, 100)), "Unable to enters shallow DC states\n");
- dpms_on(data);
- cleanup_dc_dpms(data);
+ setup_dc_dpms(data);
+ dpms_off(data);
+ igt_skip_on_f(!(igt_wait(dc6_supported ? read_dc_counter(data->debugfs_fd, CHECK_DC6) >
+ prev_dc : read_dc_counter(data->debugfs_fd, CHECK_DC5) >
+ prev_dc, 3000, 100)), "Unable to enters shallow DC states\n");
+ dpms_on(data);
+ cleanup_dc_dpms(data);
}
static void test_dc9_dpms(data_t *data)
{
- require_dc_counter(data->debugfs_fd, CHECK_DC5);
- bool dc6_supported = support_dc6(data->debugfs_fd);
-
- setup_dc9_dpms(data, dc6_supported ? read_dc_counter(data->debugfs_fd, CHECK_DC6) :
- read_dc_counter(data->debugfs_fd, CHECK_DC5), dc6_supported);
- dpms_off(data);
- igt_assert_f(check_dc9(data->debugfs_fd, dc6_supported ?
- read_dc_counter(data->debugfs_fd, CHECK_DC6) :
- read_dc_counter(data->debugfs_fd, CHECK_DC5),
- dc6_supported, 3000), "Not in DC9\n");
- dpms_on(data);
+ bool dc6_supported;
+
+ require_dc_counter(data->debugfs_fd, CHECK_DC5);
+ dc6_supported = support_dc6(data->debugfs_fd);
+ setup_dc9_dpms(data, dc6_supported ? read_dc_counter(data->debugfs_fd, CHECK_DC6) :
+ read_dc_counter(data->debugfs_fd, CHECK_DC5), dc6_supported);
+ dpms_off(data);
+ igt_assert_f(check_dc9(data->debugfs_fd, dc6_supported ?
+ read_dc_counter(data->debugfs_fd, CHECK_DC6) :
+ read_dc_counter(data->debugfs_fd, CHECK_DC5),
+ dc6_supported, 3000), "Not in DC9\n");
+ dpms_on(data);
}
IGT_TEST_DESCRIPTION("These tests validate Display Power DC states");
@@ -497,10 +498,10 @@ int main(int argc, char *argv[])
igt_describe("This test validates display engine entry to DC9 state");
igt_subtest("dc9-dpms") {
- igt_require_f(igt_pm_pc8_plus_residencies_enabled(data.msr_fd),
- "PC8+ residencies not supported\n");
- test_dc9_dpms(&data);
- }
+ igt_require_f(igt_pm_pc8_plus_residencies_enabled(data.msr_fd),
+ "PC8+ residencies not supported\n");
+ test_dc9_dpms(&data);
+ }
igt_fixture {
free(data.pwr_dmn_info);