[igt-dev] [PATCH i-g-t v2 3/4] test: i915_pm_rpm: conditional initialization of igt_display_t
Dixit, Ashutosh
ashutosh.dixit at intel.com
Tue May 17 15:52:19 UTC 2022
On Wed, 11 May 2022 04:37:33 -0700, Anshuman Gupta wrote:
>
> Initialize igt_display_t display only in case of there are
> valid drm kms resources.
>
> v2:
> - Move igt_display_fini under the 'if (data->res)' cond. [Ashutosh]
Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
>
> Signed-off-by: Anshuman Gupta <anshuman.gupta at intel.com>
> ---
> tests/i915/i915_pm_rpm.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
> index b836656c2..a6035e60b 100644
> --- a/tests/i915/i915_pm_rpm.c
> +++ b/tests/i915/i915_pm_rpm.c
> @@ -406,9 +406,9 @@ static void init_mode_set_data(struct mode_set_data *data)
> }
>
> kmstest_set_vt_graphics_mode();
> + igt_display_require(&data->display, drm_fd);
> }
>
> - igt_display_require(&data->display, drm_fd);
> init_modeset_cached_params(&ms_data);
> }
>
> @@ -420,9 +420,8 @@ static void fini_mode_set_data(struct mode_set_data *data)
> drmModeFreePropertyBlob(data->edids[i]);
> }
> drmModeFreeResources(data->res);
> + igt_display_fini(&data->display);
> }
> -
> - igt_display_fini(&data->display);
> }
>
> static void get_drm_info(struct compare_data *data)
> --
> 2.26.2
>
More information about the igt-dev
mailing list