From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4868E10E2C0 for ; Mon, 4 Dec 2023 07:52:11 +0000 (UTC) From: Bhanuprakash Modem To: igt-dev@lists.freedesktop.org, vidya.srinivas@intel.com Date: Mon, 4 Dec 2023 13:11:05 +0530 Message-Id: <20231204074111.3167784-4-bhanuprakash.modem@intel.com> In-Reply-To: <20231204074111.3167784-1-bhanuprakash.modem@intel.com> References: <20231204074111.3167784-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [i-g-t V5 3/9] 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 1765991c6..4cad663e4 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