Re: [PATCH i-g-t 7/8] tests/intel/kms_pipe_stress: Eliminate double display.drm_fd initialization

Jani Nikula
2026-01-13T14:39:32Z

On Tue, 13 Jan 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Stop initializing display.drm_fd twice. The first one
> is done explicitly and the second time is done by
> igt_display_require(). Just rely on igt_display_require().
>
> Note that a bunch of other tests do still do something similar

-do

> by completely omitting the local fd varaible/member and just

*variable

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

> using display.drm_fd everywhere. It's a somewhat strange way
> to do things, but I decided to leave those alone at least for
> now.
>
> Done with cocci:
> #include "scripts/iterators.cocci"
>
> @@
> expression DISPLAY;
> expression FD, E;
> @@
> - FD = DISPLAY.drm_fd = E;
> + FD = E;
> ...
> (
> igt_display_require(&DISPLAY, FD)
> |
> igt_display_require(&DISPLAY,
> - DISPLAY.drm_fd
> + FD
> )
> )
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> tests/intel/kms_pipe_stress.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/intel/kms_pipe_stress.c b/tests/intel/kms_pipe_stress.c
> index e8e01556ba25..33ccac9fcee3 100644
> --- a/tests/intel/kms_pipe_stress.c
> +++ b/tests/intel/kms_pipe_stress.c
> @@ -862,11 +862,11 @@ int igt_main() {
> uint8_t format_idx = 0, tiling_idx = 0;
>
> igt_fixture() {
> - data.drm_fd = data.display.drm_fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_XE);
> + data.drm_fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_XE);
>
> kmstest_set_vt_graphics_mode();
>
> - igt_display_require(&data.display, data.display.drm_fd);
> + igt_display_require(&data.display, data.drm_fd);
> igt_require(data.display.is_atomic);
> igt_display_require_output(&data.display);
> data.devid = intel_get_drm_devid(data.drm_fd);

--
Jani Nikula, Intel