Re: [PATCH i-g-t 6/8] tests/kms_async_flips: Use designated initializers in wait_for_vblank()

Jani Nikula
2026-01-13T14:37:46Z

On Tue, 13 Jan 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Clean up wait_vblank() by using designated initializers.
> The non-blocking queue_vblank() counterpart already does
> it this way.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> tests/kms_async_flips.c | 16 ++++++----------
> 1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
> index 71570385c32e..92246037ca87 100644
> --- a/tests/kms_async_flips.c
> +++ b/tests/kms_async_flips.c
> @@ -555,18 +555,14 @@ static void test_async_flip(data_t *data)
>
> static void wait_for_vblank(data_t *data, unsigned long *vbl_time, unsigned int *seq)
> {
> - drmVBlank wait_vbl;
> - uint32_t pipe_id_flag;
> - int pipe;
> -
> - memset(&wait_vbl, 0, sizeof(wait_vbl));
> - pipe = kmstest_get_pipe_from_crtc_id(data->drm_fd, data->crtc_id);
> - pipe_id_flag = kmstest_get_vbl_flag(pipe);
> -
> - wait_vbl.request.type = DRM_VBLANK_RELATIVE | pipe_id_flag;
> - wait_vbl.request.sequence = 1;
> + int pipe = kmstest_get_pipe_from_crtc_id(data->drm_fd, data->crtc_id);
> + drmVBlank wait_vbl = {
> + .request.type = DRM_VBLANK_RELATIVE | kmstest_get_vbl_flag(pipe),

I'll note that passing pipe to kmstest_get_vbl_flag() is wrong, but the
patch at hand is just non-functional cleanup. We'll need to revisit
this.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> + .request.sequence = 1,
> + };
>
> do_ioctl(data->drm_fd, DRM_IOCTL_WAIT_VBLANK, &wait_vbl);
> +
> *vbl_time = wait_vbl.reply.tval_sec * 1000000 + wait_vbl.reply.tval_usec;
> *seq = wait_vbl.reply.sequence;
> }

--
Jani Nikula, Intel