Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Melissa Wen <mwen@igalia.com>
To: Development mailing list for IGT GPU Tools
	<igt-dev@lists.freedesktop.org>,
	 Petri Latvala <adrinael@adrinael.net>,
	Arkadiusz Hiler <arek@hiler.eu>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Bhanuprakash Modem <bhanuprakash.modem@gmail.com>,
	Ashutosh Dixit <ashutosh.dixit@intel.com>,
	Karthik B S <karthik.b.s@intel.com>
Cc: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>,
	Rodrigo Siqueira <siqueira@igalia.com>,
	Andre Almeida <andrealmeid@igalia.com>,
	Alex Hung <alex.hung@amd.com>, Leo Li <sunpeng.li@amd.com>,
	Simon Ser <contact@emersion.fr>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Ville Syrjala <ville.syrjala@linux.intel.com>,
	Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Xaver Hugl <xaver.hugl@gmail.com>,
	kernel-dev@igalia.com
Subject: [PATCH i-g-t] tests/kms_async_flip: skip subtest if invalid driver-specific condition
Date: Tue, 15 Apr 2025 16:47:54 -0300	[thread overview]
Message-ID: <20250415200529.31722-1-mwen@igalia.com> (raw)

Async page flips can fail for any driver-specific reasons, i.e. when the
driver can't commit to async page flip request for hw limitations, the
commit is rejected with -EINVAL since there is one or more conditions
that make the request invalid. These limitations varies between vendors
and hw versions. Skip a subtest if any invalid driver-specific condition
happens. This behavior is in line with userspace expectations and fits
better the plurality of drivers in the DRM subsystem.

Signed-off-by: Melissa Wen <mwen@igalia.com>

---

Hi,

Recent changes to async page flip conditions and limitations in the DRM
subsystem shed light on unexpected restrictions of async page flip
tests. The current approach doesn't make the test generic enough to
correctly deal with the diversity of reasons for a async page flip being
rejected by drivers of any HW vendor.

As an example, AMD display driver can't perform async flip when the
memory type changes [1][2][3]. After further investigation performed by
my colleague Thadeu Cascardo, he elucidated that this situation can
happen whenever there is not enough space for FBs in VRAM, so they are
allocated in GTT. Moreover, the space available in VRAM varies between
hw families and other system needs. Therefore, the driver rejects the
async flip due to memory type change, instead of silently downgrade the
page flip from async to sync - which seems correct.

The userspace expects the rejection (-EINVAL), but not the downgrade.
So, I understand the test_async_flip should just validate if async page
flips aren't downgrade in acceptable conditions and skip for any invalid
driver-specific condition.

[1] https://lore.kernel.org/amd-gfx/20230621202459.979661-2-andrealmeid@igalia.com/
[2] https://lore.kernel.org/amd-gfx/20230804182054.142988-1-hamza.mahfooz@amd.com/
[3] https://lore.kernel.org/amd-gfx/20250107152855.2953302-17-chiahsuan.chung@amd.com/

Let me know your thoughts!

Melissa

---
 tests/kms_async_flips.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 031417ed8..0de299c2b 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -397,8 +397,10 @@ static void test_async_flip(data_t *data)
 
 		ret = perform_flip(data, frame, flags);
 
-		if (frame == 1 && data->allow_fail)
-			igt_skip_on(ret == -EINVAL);
+		if (data->allow_fail)
+			igt_skip_on_f(ret == -EINVAL,
+				      "Skipping, async flip not supported at frame %d " \
+				      "due to invalid driver-specific conditions.\n", frame);
 		else
 			igt_assert_eq(ret, 0);
 
@@ -768,7 +770,7 @@ static void run_test(data_t *data, void (*test)(data_t *))
 			continue;
 
 		test_init(data);
-		data->allow_fail = false;
+		data->allow_fail = true;
 		data->modifier = default_modifier(data);
 		igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) {
 			/*
-- 
2.47.2


             reply	other threads:[~2025-04-15 20:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15 19:47 Melissa Wen [this message]
2025-04-16  1:22 ` ✓ i915.CI.BAT: success for tests/kms_async_flip: skip subtest if invalid driver-specific condition Patchwork
2025-04-16  1:43 ` ✓ Xe.CI.BAT: " Patchwork
2025-04-16  6:05 ` ✗ i915.CI.Full: failure " Patchwork
2025-04-16 11:59 ` ✗ Xe.CI.Full: " Patchwork
2025-04-17 11:01 ` [PATCH i-g-t] " Karthik B S
2025-04-21 15:04   ` Melissa Wen
2025-04-21 16:59     ` Borah, Chaitanya Kumar
2025-05-01 17:13       ` Melissa Wen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250415200529.31722-1-mwen@igalia.com \
    --to=mwen@igalia.com \
    --cc=adrinael@adrinael.net \
    --cc=alex.hung@amd.com \
    --cc=andrealmeid@igalia.com \
    --cc=arek@hiler.eu \
    --cc=ashutosh.dixit@intel.com \
    --cc=bhanuprakash.modem@gmail.com \
    --cc=cascardo@igalia.com \
    --cc=chaitanya.kumar.borah@intel.com \
    --cc=contact@emersion.fr \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=juhapekka.heikkila@gmail.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=karthik.b.s@intel.com \
    --cc=kernel-dev@igalia.com \
    --cc=santhosh.reddy.guddati@intel.com \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    --cc=ville.syrjala@linux.intel.com \
    --cc=xaver.hugl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox