From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1D6A410E7E6 for ; Thu, 7 Dec 2023 06:59:59 +0000 (UTC) From: Bhanuprakash Modem To: igt-dev@lists.freedesktop.org, ville.syrjala@linux.intel.com, mitulkumar.ajitkumar.golani@intel.com Date: Thu, 7 Dec 2023 12:18:53 +0530 Message-Id: <20231207064900.3328723-4-bhanuprakash.modem@intel.com> In-Reply-To: <20231207064900.3328723-1-bhanuprakash.modem@intel.com> References: <20231207064900.3328723-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [i-g-t V6 03/10] tests/kms_vrr: Move all config constaints to new function List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: No functional change, cleanup only. Move all config checks to new function. Signed-off-by: Bhanuprakash Modem --- tests/kms_vrr.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c index 13e7f3ca6..df241aa6c 100644 --- a/tests/kms_vrr.c +++ b/tests/kms_vrr.c @@ -483,6 +483,21 @@ static void test_cleanup(data_t *data, enum pipe pipe, igt_output_t *output) igt_remove_fb(data->drm_fd, &data->fb0); } +static bool config_constraint(igt_output_t *output, uint32_t flags) +{ + if (!has_vrr(output)) + return false; + + /* For Negative tests, panel should be non-vrr. */ + if ((flags & TEST_NEGATIVE) && vrr_capable(output)) + return false; + + if ((flags & ~TEST_NEGATIVE) && !vrr_capable(output)) + return false; + + return true; +} + /* Runs tests on outputs that are VRR capable. */ static void run_vrr_test(data_t *data, test_t test, uint32_t flags) @@ -492,14 +507,7 @@ run_vrr_test(data_t *data, test_t test, uint32_t flags) for_each_connected_output(&data->display, output) { enum pipe pipe; - if (!has_vrr(output)) - continue; - - /* For Negative tests, panel should be non-vrr. */ - if ((flags & TEST_NEGATIVE) && vrr_capable(output)) - continue; - - if ((flags & ~TEST_NEGATIVE) && !vrr_capable(output)) + if (!config_constraint(output, flags)) continue; for_each_pipe(&data->display, pipe) { -- 2.40.0