From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id CB21410F088 for ; Tue, 17 May 2022 15:52:20 +0000 (UTC) Date: Tue, 17 May 2022 08:52:19 -0700 Message-ID: <87pmkcf970.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Anshuman Gupta In-Reply-To: <20220511113734.27776-4-anshuman.gupta@intel.com> References: <20220511113734.27776-1-anshuman.gupta@intel.com> <20220511113734.27776-4-anshuman.gupta@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [igt-dev] [PATCH i-g-t v2 3/4] test: i915_pm_rpm: conditional initialization of igt_display_t List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, petri.latvala@intel.com, badal.nilawar@intel.com Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: 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 > > Signed-off-by: Anshuman Gupta > --- > 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 >