From: "Murthy, Arun R" <arun.r.murthy@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
<igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t] tests/kms_atomic: Read the error msg on atomic_ioctl failure
Date: Thu, 19 Feb 2026 08:35:30 +0530 [thread overview]
Message-ID: <c021816b-3229-4b12-8a45-5ebb719d8048@intel.com> (raw)
In-Reply-To: <20260218131818.6t72iirnh2cqwxvv@kamilkon-DESK.igk.intel.com>
Hi Kamil,
Thanks for the review.
Sorry I forgot to add [DO_NOT_REVIEW] tag for this patch.
This patch was pushed just to get to know the usage from user for
reviewing the KMD patch.
I will be enhance the test and will push the patch for review.
Thanks and Regards,
Arun R Murthy
--------------------
On 18-02-2026 18:48, Kamil Konieczny wrote:
> Hi Arun,
> On 2026-02-10 at 14:23:33 +0530, Arun R Murthy wrote:
>> On atomic_ioctl failure compare the failure flag with the expected
>> invalid reason and pass if same else fail the test.
>>
>> The corresponding KMD changes are pushed for review @
>> https://patchwork.freedesktop.org/series/152276/
>>
>> Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
>> ---
>> tests/kms_atomic.c | 12 ++++++++++--
>> 1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
>> index fa321cc3c..a609a9f14 100644
>> --- a/tests/kms_atomic.c
>> +++ b/tests/kms_atomic.c
>> @@ -1041,13 +1041,17 @@ static void crtc_invalid_params_fence(data_t *data, igt_output_t *output)
>> static void atomic_invalid_params(data_t *data, igt_output_t *output)
>> {
>> struct drm_mode_atomic ioc;
>> + struct drm_mode_atomic_err_code *err_code;
>> uint32_t obj_raw[16]; /* array of objects (sized by count_objs) */
>> uint32_t num_props_raw[16]; /* array of num props per obj (ditto) */
>> uint32_t props_raw[256]; /* array of props (sum of count_props) */
>> uint64_t values_raw[256]; /* array of values for properties (ditto) */
>> int i;
>>
>> + err_code = malloc(sizeof(struct drm_mode_atomic_err_code));
>> + memset(err_code, 0, sizeof(struct drm_mode_atomic_err_code));
> Use calloc.
>
>> memset(&ioc, 0, sizeof(ioc));
>> + ioc.reserved = (uintptr_t)err_code;
> It is better using function to_user_pointer()
>
>>
>> /* An empty request should do nothing. */
>> do_ioctl(data->drm_fd, DRM_IOCTL_MODE_ATOMIC, &ioc);
>> @@ -1076,14 +1080,18 @@ static void atomic_invalid_params(data_t *data, igt_output_t *output)
>> /* Nonsense flags. */
>> ioc.flags = 0xdeadbeef;
>> do_ioctl_err(data->drm_fd, DRM_IOCTL_MODE_ATOMIC, &ioc, EINVAL);
>> + if (igt_has_drm_cap(data->drm_fd, DRM_CAP_ATOMIC_ERROR_REPORTING))
>> + igt_assert_eq(err_code->failure_code, DRM_MODE_ATOMIC_INVALID_API_USAGE);
>>
>> ioc.flags = 0;
>> /* Safety check that flags is reset properly. */
>> do_ioctl(data->drm_fd, DRM_IOCTL_MODE_ATOMIC, &ioc);
>>
>> /* Reserved/MBZ. */
>> - ioc.reserved = 1;
>> - do_ioctl_err(data->drm_fd, DRM_IOCTL_MODE_ATOMIC, &ioc, EINVAL);
>> + if (!igt_has_drm_cap(data->drm_fd, DRM_CAP_ATOMIC_ERROR_REPORTING)) {
>> + ioc.reserved = 1;
>> + do_ioctl_err(data->drm_fd, DRM_IOCTL_MODE_ATOMIC, &ioc, EINVAL);
>> + }
>> ioc.reserved = 0;
>> do_ioctl(data->drm_fd, DRM_IOCTL_MODE_ATOMIC, &ioc);
> Where is free(err_code)?
>
> Regards,
> Kamil
>>
>> --
>> 2.25.1
>>
next prev parent reply other threads:[~2026-02-19 3:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 6:55 [PATCH i-g-t] tests/kms_atomic: Read the error msg on atomic_ioctl failure Arun R Murthy
2026-02-10 8:53 ` Arun R Murthy
2026-02-18 13:18 ` Kamil Konieczny
2026-02-19 3:05 ` Murthy, Arun R [this message]
2026-03-31 10:29 ` [PATCH i-g-t 1/3] include/drm-uapi: Add atomic_ioctl error codes Arun R Murthy
2026-03-31 10:29 ` [PATCH i-g-t 2/3] include/drm-uapi: Add ERROR_REPORTING capability Arun R Murthy
2026-03-31 10:29 ` [PATCH i-g-t 3/3] tests/kms_atomic: Read the error msg on atomic_ioctl failure Arun R Murthy
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=c021816b-3229-4b12-8a45-5ebb719d8048@intel.com \
--to=arun.r.murthy@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.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