All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Reddy Guddati, Santhosh" <santhosh.reddy.guddati@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: <igt-dev@lists.freedesktop.org>, <karthik.b.s@intel.com>,
	<swati2.sharma@intel.com>
Subject: Re: [PATCH i-g-t v1] tests/kms_async_flips: validate mode before proceeding with fb creation
Date: Thu, 26 Feb 2026 16:49:41 +0530	[thread overview]
Message-ID: <b81e0542-eae0-4983-8a5f-fa52c78a4f91@intel.com> (raw)
In-Reply-To: <aaAI0zP8UVB6TAjS@intel.com>



On 26-02-2026 14:18, Ville Syrjälä wrote:
> On Wed, Feb 25, 2026 at 04:35:10PM +0530, Santhosh Reddy Guddati wrote:
>> Validate mode before proceeding with creating frame buffers to avoid
>> passing invalid parameters to the ioctl.
>>
>> Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
>> ---
>>   tests/kms_async_flips.c | 18 ++++++++++++++++++
>>   1 file changed, 18 insertions(+)
>>
>> diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
>> index 014b7f347..d00b36544 100644
>> --- a/tests/kms_async_flips.c
>> +++ b/tests/kms_async_flips.c
>> @@ -298,6 +298,12 @@ static void test_init(data_t *data)
>>   	igt_display_commit(&data->display);
>>   
>>   	mode = igt_output_get_mode(data->output);
> 
> How would that even return some kind of invalid mode?
> And why would it be a problem only for kms_async_flips?

Please refer to below gitlab issue which occurs very sporadically 
(Closed now)
https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/7043

I agree this igt_output_get_mode() doesn't return an invalid mode but in 
the failure logs, fb creation is done with width=0, height=0 , so as a 
defensive checck, this is added to validate here rather asserting in 
xe_bo_create.

It is not specific to kms_async_flips, but it just exposed in this test 
path.

Thanks,
Santhosh

> 
>> +	igt_require_f(kmstest_mode_is_valid(mode),
>> +		      "Invalid mode on %s (%dx%d@%d)",
>> +		      data->output->name,
>> +		      mode ? mode->hdisplay : 0,
>> +		      mode ? mode->vdisplay : 0,
>> +		      mode ? mode->vrefresh : 0);
>>   
>>   	data->crtc_id = data->crtc->crtc_id;
>>   	data->refresh_rate = mode->vrefresh;
>> @@ -327,6 +333,12 @@ static void test_init_fbs(data_t *data)
>>   	drmModeModeInfo *mode;
>>   
>>   	mode = igt_output_get_mode(data->output);
>> +	igt_require_f(kmstest_mode_is_valid(mode),
>> +		      "Invalid mode on %s (%dx%d@%d)",
>> +		      data->output->name,
>> +		      mode ? mode->hdisplay : 0,
>> +		      mode ? mode->vdisplay : 0,
>> +		      mode ? mode->vrefresh : 0);
>>   	width = mode->hdisplay;
>>   	height = mode->vdisplay;
>>   
>> @@ -672,6 +684,12 @@ static void test_invalid(data_t *data)
>>   	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
>>   
>>   	mode = igt_output_get_mode(data->output);
>> +	igt_require_f(kmstest_mode_is_valid(mode),
>> +		      "Invalid mode on %s (%dx%d@%d)",
>> +		      data->output->name,
>> +		      mode ? mode->hdisplay : 0,
>> +		      mode ? mode->vdisplay : 0,
>> +		      mode ? mode->vrefresh : 0);
>>   	width = mode->hdisplay;
>>   	height = mode->vdisplay;
>>   
>> -- 
>> 2.34.1
> 


      reply	other threads:[~2026-02-26 11:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 11:05 [PATCH i-g-t v1] tests/kms_async_flips: validate mode before proceeding with fb creation Santhosh Reddy Guddati
2026-02-25 22:21 ` ✗ Xe.CI.BAT: failure for " Patchwork
2026-02-25 22:30 ` ✗ i915.CI.BAT: " Patchwork
2026-02-26  0:33 ` ✗ Xe.CI.FULL: " Patchwork
2026-02-26  8:48 ` [PATCH i-g-t v1] " Ville Syrjälä
2026-02-26 11:19   ` Reddy Guddati, Santhosh [this message]

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=b81e0542-eae0-4983-8a5f-fa52c78a4f91@intel.com \
    --to=santhosh.reddy.guddati@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@intel.com \
    --cc=swati2.sharma@intel.com \
    --cc=ville.syrjala@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 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.