public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 02/19] tests/kms_async_flips: Remove redundant data.crtc_id
Date: Wed, 25 Feb 2026 15:58:22 +0200	[thread overview]
Message-ID: <ac2a4c0875f8bf0586bc926aafc9aa1389ef3036@intel.com> (raw)
In-Reply-To: <20260225125108.31119-3-ville.syrjala@linux.intel.com>

On Wed, 25 Feb 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> kms_async_flips already tacks the entire crtc as data.crtc.

*tracks

> data.crtc_id is completely redundant, and just serves to
> confuse things. Get rid of it.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  tests/kms_async_flips.c | 29 +++++++++++------------------
>  1 file changed, 11 insertions(+), 18 deletions(-)
>
> diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
> index 014b7f3476be..53990917c9e4 100644
> --- a/tests/kms_async_flips.c
> +++ b/tests/kms_async_flips.c
> @@ -124,7 +124,6 @@ IGT_TEST_DESCRIPTION("Test asynchronous page flips.");
>  
>  typedef struct {
>  	int drm_fd;
> -	uint32_t crtc_id;
>  	uint32_t refresh_rate;
>  	struct igt_fb bufs[NUM_FBS];
>  	struct igt_fb bufs_overlay[NUM_FBS];
> @@ -299,11 +298,9 @@ static void test_init(data_t *data)
>  
>  	mode = igt_output_get_mode(data->output);
>  
> -	data->crtc_id = data->crtc->crtc_id;
>  	data->refresh_rate = mode->vrefresh;
>  
> -	igt_output_set_crtc(data->output,
> -		            data->crtc);
> +	igt_output_set_crtc(data->output, data->crtc);
>  
>  	data->plane = igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY);
>  	if (data->overlay_path)
> @@ -398,7 +395,7 @@ static int perform_flip(data_t *data, int frame, int flags)
>  	bufs = data->overlay_path ? data->bufs_overlay : data->bufs;
>  
>  	if (!data->atomic_path) {
> -		ret = drmModePageFlip(data->drm_fd, data->crtc_id,
> +		ret = drmModePageFlip(data->drm_fd, data->crtc->crtc_id,
>  				     bufs[frame % NUM_FBS].fb_id, flags, data);
>  	} else {
>  		igt_plane_set_fb(plane, &bufs[frame % NUM_FBS]);
> @@ -555,9 +552,8 @@ static void test_async_flip(data_t *data)
>  
>  static void wait_for_vblank(data_t *data, unsigned long *vbl_time, unsigned int *seq)
>  {
> -	int crtc_index = kmstest_get_crtc_index_from_id(data->drm_fd, data->crtc_id);
>  	drmVBlank wait_vbl = {
> -		.request.type = DRM_VBLANK_RELATIVE | kmstest_get_vbl_flag(crtc_index),
> +		.request.type = DRM_VBLANK_RELATIVE | kmstest_get_vbl_flag(data->crtc->crtc_index),
>  		.request.sequence = 1,
>  	};
>  
> @@ -581,7 +577,7 @@ static void test_timestamp(data_t *data)
>  	 * So flip timestamp can be verified only from the second flip.
>  	 * The first async flip just enables the async address update.
>  	 */
> -	ret = drmModePageFlip(data->drm_fd, data->crtc_id,
> +	ret = drmModePageFlip(data->drm_fd, data->crtc->crtc_id,
>  			      data->bufs[0].fb_id,
>  			      flags, data);
>  
> @@ -591,7 +587,7 @@ static void test_timestamp(data_t *data)
>  
>  	wait_for_vblank(data, &vbl_time, &seq);
>  
> -	ret = drmModePageFlip(data->drm_fd, data->crtc_id,
> +	ret = drmModePageFlip(data->drm_fd, data->crtc->crtc_id,
>  			      data->bufs[0].fb_id,
>  			      flags, data);
>  
> @@ -639,7 +635,7 @@ static void test_cursor(data_t *data)
>  			    DRM_FORMAT_MOD_LINEAR, 1., 1., 1., &cursor_fb);
>  
>  	cur.flags = DRM_MODE_CURSOR_BO;
> -	cur.crtc_id = data->crtc_id;
> +	cur.crtc_id = data->crtc->crtc_id;
>  	cur.width = width;
>  	cur.height = height;
>  	cur.handle = cursor_fb.gem_handle;
> @@ -700,13 +696,13 @@ static void test_invalid(data_t *data)
>  	 */
>  	if (!data->atomic_path) {
>  		/* first async flip is expected to allow modifier changes */
> -		ret = drmModePageFlip(data->drm_fd, data->crtc_id, fb[1].fb_id, flags, data);
> +		ret = drmModePageFlip(data->drm_fd, data->crtc->crtc_id, fb[1].fb_id, flags, data);
>  		igt_assert_eq(ret, 0);
>  
>  		wait_flip_event(data);
>  
>  		/* subsequent async flips should reject modifier changes */
> -		ret = drmModePageFlip(data->drm_fd, data->crtc_id, fb[0].fb_id, flags, data);
> +		ret = drmModePageFlip(data->drm_fd, data->crtc->crtc_id, fb[0].fb_id, flags, data);
>  		igt_assert(ret == -EINVAL);
>  	} else {
>  		igt_plane_set_fb(data->plane, &fb[1]);
> @@ -728,10 +724,9 @@ static void test_invalid(data_t *data)
>  
>  static void queue_vblank(data_t *data)
>  {
> -	int crtc_index = kmstest_get_crtc_index_from_id(data->drm_fd, data->crtc_id);
>  	drmVBlank wait_vbl = {
>  		.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT |
> -			kmstest_get_vbl_flag(crtc_index),
> +			kmstest_get_vbl_flag(data->crtc->crtc_index),
>  		.request.sequence = 1,
>  		.request.signal = (long)data,
>  	};
> @@ -827,7 +822,6 @@ static void paint_fb(data_t *data, struct igt_fb *fb,
>  
>  static void test_crc(data_t *data)
>  {
> -	igt_display_t *display = &data->display;
>  	unsigned int frame = 0;
>  	unsigned int start;
>  	int ret, width, height;
> @@ -847,12 +841,11 @@ static void test_crc(data_t *data)
>  	paint_fb(data, &data->bufs[frame], width, height, 0xff0000ff);
>  	paint_fb(data, &data->bufs[!frame], width, height, 0xff0000ff);
>  
> -	ret = drmModeSetCrtc(data->drm_fd, data->crtc_id, data->bufs[frame].fb_id, 0, 0,
> +	ret = drmModeSetCrtc(data->drm_fd, data->crtc->crtc_id, data->bufs[frame].fb_id, 0, 0,
>  			     &data->output->config.connector->connector_id, 1, mode);
>  	igt_assert_eq(ret, 0);
>  
> -	data->pipe_crc = igt_crtc_crc_new(igt_crtc_for_pipe(display, kmstest_get_crtc_index_from_id(data->drm_fd, data->crtc_id)),
> -					  IGT_PIPE_CRC_SOURCE_AUTO);
> +	data->pipe_crc = igt_crtc_crc_new(data->crtc, IGT_PIPE_CRC_SOURCE_AUTO);
>  
>  	igt_pipe_crc_start(data->pipe_crc);
>  	igt_pipe_crc_get_single(data->pipe_crc, &data->ref_crc);

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-02-25 13:58 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 12:50 [PATCH i-g-t 00/19] lib/kms: Clean up more of igt_kms API Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 01/19] tests/kms_plane_multiple: Clean up n_planes stuff Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 02/19] tests/kms_async_flips: Remove redundant data.crtc_id Ville Syrjala
2026-02-25 13:58   ` Jani Nikula [this message]
2026-02-25 12:50 ` [PATCH i-g-t 03/19] tests/kms_lease: Consolidate igt_crtc_for_pipe() calls Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 04/19] tests/kms: " Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 05/19] lib/kms: Introduce igt_first_crtc_with_single_output() Ville Syrjala
2026-02-25 13:59   ` Jani Nikula
2026-02-25 12:50 ` [PATCH i-g-t 06/19] tests/kms: Use igt_first_crtc_with_single_output() Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 07/19] lib/kms: Introduce and use igt_first_crtc() Ville Syrjala
2026-02-25 14:00   ` Jani Nikula
2026-02-25 12:50 ` [PATCH i-g-t 08/19] tests/kms: Stop using igt_require_pipe() Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 09/19] lib/kms: Replace get_num_scalers() with igt_crtc_num_scalers() Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 10/19] lib/kms: Pass igt_crtc_t* to igt_max_bpc_constraint() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 11/19] lib/kms: Introduce for_each_plane_on_crtc() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 12/19] tests/kms: Use for_each_plane_on_crtc() Ville Syrjala
2026-02-25 13:53   ` Jani Nikula
2026-02-25 12:51 ` [PATCH i-g-t 13/19] lib/kms: Nuke for_each_plane_on_pipe() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 14/19] tests/kms: Switch to for_each_valid_output_on_crtc_local() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 15/19] tests/kms: Replace igt_pipe_connector_valid() with igt_crtc_connector_valid() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 16/19] lib/kms: Intreoduce for_each_valid_output_on_crtc() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 17/19] tests/intel/kms_frontbuffer_tracking: Use for_each_valid_output_on_crtc() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 18/19] tests/kms: " Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 19/19] lib/kms: Nuke for_each_valid_output_on_pipe() Ville Syrjala
2026-02-25 14:06   ` Jani Nikula
2026-02-25 14:07 ` [PATCH i-g-t 00/19] lib/kms: Clean up more of igt_kms API Jani Nikula
2026-02-25 23:34 ` ✗ Xe.CI.BAT: failure for " Patchwork
2026-02-26  0:05 ` ✓ i915.CI.BAT: success " Patchwork
2026-02-26  1:57 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-02-26 22:06 ` ✓ Xe.CI.BAT: success for lib/kms: Clean up more of igt_kms API (rev2) Patchwork
2026-02-26 22:09 ` ✓ i915.CI.BAT: " Patchwork
2026-02-27  2:55 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-02-27  4:24 ` ✗ i915.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=ac2a4c0875f8bf0586bc926aafc9aa1389ef3036@intel.com \
    --to=jani.nikula@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox