We need to be able to identify if the issue is feature related
or caused by another bug.

Also this feature allow users to have a visual feedback of what to
expect when running the test case for real.

Signed-off-by: Rodrigo Vivi <[email protected]>
---
 tests/kms_frontbuffer_tracking.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 1cc1c9e..312c08e 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -238,6 +238,7 @@ struct {
        bool fbc_check_last_action;
        bool no_edp;
        bool no_suspend;
+       bool psr_disabled;
        bool small_modes;
        bool show_hidden;
        int step;
@@ -252,6 +253,7 @@ struct {
        .fbc_check_last_action = true,
        .no_edp = false,
        .no_suspend = false,
+       .psr_disabled = false,
        .small_modes = false,
        .show_hidden= false,
        .step = 0,
@@ -1617,7 +1619,7 @@ static int adjust_assertion_flags(const struct test_mode 
*t, int flags)
        }                                                               \
                                                                        \
        if (flags_ & ASSERT_PSR_ENABLED) {                              \
-               if (!psr_wait_until_enabled()) {                        \
+               if (!opt.psr_disabled && !psr_wait_until_enabled()) {   \
                        psr_print_status();                             \
                        igt_assert_f(false, "PSR disabled\n");          \
                }                                                       \
@@ -1717,8 +1719,13 @@ static void enable_features_for_test(const struct 
test_mode *t)
 {
        if (t->feature & FEATURE_FBC)
                fbc_enable();
-       if (t->feature & FEATURE_PSR)
-               psr_enable();
+       if (t->feature & FEATURE_PSR) {
+               if (opt.psr_disabled) {
+                       igt_info("WARNING: Running with PSR disabled\n");
+                       psr_disable();
+               } else
+                       psr_enable();
+       }
 }
 
 static void check_test_requirements(const struct test_mode *t)
@@ -2957,6 +2964,9 @@ static int opt_handler(int option, int option_index, void 
*data)
        case 'r':
                opt.no_suspend = true;
                break;
+       case 'R':
+               opt.psr_disabled = true;
+               break;
        case 'm':
                opt.small_modes = true;
                break;
@@ -3000,6 +3010,7 @@ const char *help_str =
 "  --no-fbc-action-check       Don't check for the FBC last action\n"
 "  --no-edp                    Don't use eDP monitors\n"
 "  --no-suspend                Don't run Suspend/Resume test cases\n"
+"  --psr-disabled              Dry-run. Run tests with PSR feature disabled.\n"
 "  --use-small-modes           Use smaller resolutions for the modes\n"
 "  --show-hidden               Show hidden subtests\n"
 "  --step                      Stop on each step so you can check the screen\n"
@@ -3126,6 +3137,7 @@ int main(int argc, char *argv[])
                { "no-fbc-action-check",      0, 0, 'a'},
                { "no-edp",                   0, 0, 'e'},
                { "no-suspend",               0, 0, 'r'},
+               { "psr-disabled",             0, 0, 'R'},
                { "use-small-modes",          0, 0, 'm'},
                { "show-hidden",              0, 0, 'i'},
                { "step",                     0, 0, 't'},
-- 
2.4.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to