From: "André Almeida" <andrealmeid@igalia.com>
To: Melissa Wen <mwen@igalia.com>
Cc: igt-dev@lists.freedesktop.org, Jeevan B <jeevan.b@intel.com>,
Kamil Konieczny <kamil.konieczny@linux.intel.com>,
kernel-dev@igalia.com, Vitaly Prosyak <vitaly.prosyak@amd.com>,
Alex Hung <alex.hung@amd.com>,
Rodrigo Siqueira <siqueira@igalia.com>
Subject: Re: [PATCH v6 2/4] tests/kms_async_flips: Check for atomic async flip cap
Date: Tue, 8 Apr 2025 13:07:33 -0300 [thread overview]
Message-ID: <c0b93100-cc37-4f24-8324-3ad4a26d0908@igalia.com> (raw)
In-Reply-To: <j2kam7redmh5qqqbbunyuoyl235vg3bw32yoqq4azbb4mfrztw@aaepkfnv5u5f>
Em 08/04/2025 13:01, Melissa Wen escreveu:
> On 04/07, André Almeida wrote:
>> If a driver doesn't support doing an async flip through the atomic uAPI,
>> the atomic tests fails. Instead of failing, create a function that
>> checks for this capability and skip the test if is unsupported.
>>
>> Signed-off-by: André Almeida <andrealmeid@igalia.com>
>> Reviewed-by: Melissa Wen <mwen@igalia.com>
>> ---
>> tests/kms_async_flips.c | 14 ++++++++++++++
>> 1 file changed, 14 insertions(+)
>>
>> diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
>> index 126b96d6b..fc9cbd3f1 100644
>> --- a/tests/kms_async_flips.c
>> +++ b/tests/kms_async_flips.c
>> @@ -209,6 +209,14 @@ static void require_monotonic_timestamp(int fd)
>> igt_require_f(ret, "Monotonic timestamps not supported\n");
>> }
>>
>> +static void require_atomic_async_cap(data_t *data)
>> +{
>> + int ret = igt_has_drm_cap(data->drm_fd, DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP);
>> +
>> + igt_assert(ret >= 0);
>> + igt_require_f(ret, "Atomic async flip not supported\n");
>
> Hmmm.. I don't think we want an assert here. Otherwise, the test aborts
> instead of skipping if the cap wasn't introduced yet in a target kernel
> version.
>
> drm_get_cap return -EINVAL if this capability doesn't exist in a kernel
> version and zero if it exists but isn't supported by the specific
> driver. Perhaps two igt_require_f makes sense, as below?
>
> + igt_require_f(ret > 0, "Atomic async flip cap doesn't exist in
> this kernel\n");
Maybe should be like this:
igt_require_f(ret >= 0, "Atomic async flip cap doesn't exist in this
kernel; or bad fd\n");
> + igt_require_f(ret, "Atomic async flip not supported by this
> driver\n");
>
> WDYT?
>
You are right, I initially understood that drm_get_cap() would return 0
if the CAP didn't exist but a quick look in the kernel function
drm_getcap() shows that this is not the case. I will fix that.
next prev parent reply other threads:[~2025-04-08 16:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 0:02 [PATCH v6 0/4] tests/kms_async_flips: Create subtest for overlay planes André Almeida
2025-04-08 0:02 ` [PATCH v6 1/4] lib/ioctl_wrappers: let the caller handle capability check result André Almeida
2025-04-08 12:08 ` Kamil Konieczny
2025-04-08 16:09 ` Melissa Wen
2025-04-08 0:02 ` [PATCH v6 2/4] tests/kms_async_flips: Check for atomic async flip cap André Almeida
2025-04-08 16:01 ` Melissa Wen
2025-04-08 16:07 ` André Almeida [this message]
2025-04-08 18:48 ` Melissa Wen
2025-04-08 0:02 ` [PATCH v6 3/4] kms_async_flips: Refactor data options André Almeida
2025-04-08 0:02 ` [PATCH v6 4/4] tests/kms_async_flips: Create subtest for overlay planes André Almeida
2025-04-08 16:16 ` Melissa Wen
2025-04-08 18:53 ` Alex Hung
2025-04-08 19:26 ` André Almeida
2025-04-08 20:45 ` André Almeida
2025-04-08 21:46 ` Alex Hung
2025-04-08 0:05 ` [PATCH v6 0/4] " André Almeida
2025-04-08 1:02 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-04-08 1:12 ` ✓ i915.CI.BAT: " Patchwork
2025-04-08 3:06 ` ✗ i915.CI.Full: failure " Patchwork
2025-04-08 8:01 ` ✗ Xe.CI.Full: " Patchwork
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=c0b93100-cc37-4f24-8324-3ad4a26d0908@igalia.com \
--to=andrealmeid@igalia.com \
--cc=alex.hung@amd.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jeevan.b@intel.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=kernel-dev@igalia.com \
--cc=mwen@igalia.com \
--cc=siqueira@igalia.com \
--cc=vitaly.prosyak@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.