From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E57EC2BB85 for ; Fri, 21 Jun 2024 08:55:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2420010F0DE; Fri, 21 Jun 2024 08:55:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="QzJfdJkN"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id B0EEA10F0DD for ; Fri, 21 Jun 2024 08:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718960122; x=1750496122; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vqe+qbgGrFyeHdz3+vo/k+sn295VzixT7joIEpQuPLo=; b=QzJfdJkN/gNnJSeGpkzXGXWX3B+wEenzlBHGBaxtUkxk4aoGlxWyU0xD 9axWuwA/on/J+DuWmUmLV7axnrer6/NZzGE4ZjnrB0O02X1p/mX9R7fhj FRpVW3vZ53IxDGqrVO2zzxWDuwN8jW5HCx0Pa23vC9njPGP2AEZz6+pIt ql+dmtCALfx3z3XUcEUBeDXCp1aBBDWNtPe4uJ+1Y/s6pxIZeP0aLCyMW qRwC9qIdi6WzSSPj5KhoxZXCeRB+xYZvYGYwPjSHy7RMnFRR8aNtK/okS 7lh05YGvFHXOPmvdC/yYFx09QTL59wVOZoCKvC0tDmNWsLlbip0wbXDvA Q==; X-CSE-ConnectionGUID: E4WXtkwfRmGOGY6BQLjWWQ== X-CSE-MsgGUID: krvXg0TuTiC+wUlzHcAiPw== X-IronPort-AV: E=McAfee;i="6700,10204,11109"; a="41387671" X-IronPort-AV: E=Sophos;i="6.08,254,1712646000"; d="scan'208";a="41387671" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2024 01:55:22 -0700 X-CSE-ConnectionGUID: jU3lfP9eQY2zrlYgsPB9Tg== X-CSE-MsgGUID: TwGG/TIWQfKnkTi0ne5Pnw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,254,1712646000"; d="scan'208";a="42609055" Received: from bhanu-nuclab.iind.intel.com ([10.145.169.172]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2024 01:55:20 -0700 From: Bhanuprakash Modem To: igt-dev@lists.freedesktop.org Cc: Bhanuprakash Modem , Manasi Navare , Mitul Golani Subject: [i-g-t 2/4] tests/kms_vrr: Fix hardcoded step size Date: Fri, 21 Jun 2024 14:17:09 +0530 Message-ID: <20240621084711.68444-3-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240621084711.68444-1-bhanuprakash.modem@intel.com> References: <20240621084711.68444-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" In seamless-virtual subtest we are trying different Vrefresh values between Vmin & Vmax by incrementing the Vrefresh by by 10 Hz (hardcoded). With this approach: - We'll achieve less no. of refresh rates if VRR range is low Ex: We can achieve only 1 step between 40 to 60 Hz. - Execution time will increase in case of high VRR range. Ex: We need 30 steps to reach 60 Hz to 360 Hz. Instead of hardcoding the step size (10 Hz), allow test to execute fixed number of steps (say 5 steps to reach Vmin to Vmax) will guarantee to test (5) different refresh rates between Vmin & Vmax irrespective of the VRR range. Cc: Manasi Navare Cc: Mitul Golani Signed-off-by: Bhanuprakash Modem --- tests/kms_vrr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c index 6fd04505e..2ea90cd8e 100644 --- a/tests/kms_vrr.c +++ b/tests/kms_vrr.c @@ -740,6 +740,7 @@ test_seamless_virtual_rr_basic(data_t *data, enum pipe pipe, igt_output_t *outpu uint32_t result; unsigned int vrefresh; uint64_t rate[] = {0}; + uint32_t step_size; igt_info("Use HIGH_RR Mode as default\n"); kmstest_dump_mode(&data->switch_modes[HIGH_RR_MODE]); @@ -759,8 +760,14 @@ test_seamless_virtual_rr_basic(data_t *data, enum pipe pipe, igt_output_t *outpu "Refresh rate (%u Hz) %"PRIu64"ns: Target threshold not reached, result was %u%%\n", data->switch_modes[HIGH_RR_MODE].vrefresh, rate[0], result); + /* + * Calculate step size by considering the no. of steps required to + * reach Vmin to Vmax as 5. + */ + step_size = (data->range.max - data->range.min) / 5; + /* Switch to Virtual RR */ - for (vrefresh = data->range.min + 10; vrefresh < data->range.max; vrefresh += 10) { + for (vrefresh = data->range.min + step_size; vrefresh < data->range.max; vrefresh += step_size) { drmModeModeInfo virtual_mode = virtual_rr_vrr_range_mode(output, vrefresh); igt_info("Requesting Virtual Mode with Refresh Rate (%u Hz): \n", vrefresh); -- 2.43.2