From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id D640B10E3BB for ; Sat, 4 Jun 2022 01:25:16 +0000 (UTC) Date: Fri, 03 Jun 2022 18:25:15 -0700 Message-ID: <87leud9q4k.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Jessica Zhang In-Reply-To: <20220603183257.145-1-quic_jesszhan@quicinc.com> References: <20220603183257.145-1-quic_jesszhan@quicinc.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 v1] lib/igt_kms: Call get_assigned_primary only if display is initialized List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, quic_aravindh@quicinc.com, petri.latvala@intel.com Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Fri, 03 Jun 2022 11:32:57 -0700, Jessica Zhang wrote: > > Move code for getting the driver-assigned primary plane to before the > `out` tag. This will avoid any crashes in cases where the display > resources haven't been initialized. We hit this issue and were considering an indentical fix so: Reviewed-by: Ashutosh Dixit And will merge this right now too. > Signed-off-by: Jessica Zhang > --- > lib/igt_kms.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/lib/igt_kms.c b/lib/igt_kms.c > index af4fb85b9a7b..36dfcfcb886d 100644 > --- a/lib/igt_kms.c > +++ b/lib/igt_kms.c > @@ -2528,9 +2528,6 @@ void igt_display_require(igt_display_t *display, int drm_fd) > /* Set reasonable default values for every object in the display. */ > igt_display_reset(display); > > -out: > - LOG_UNINDENT(display); > - > for_each_pipe(display, i) { > igt_pipe_t *pipe = &display->pipes[i]; > igt_output_t *output; > @@ -2565,6 +2562,9 @@ out: > } > } > > +out: > + LOG_UNINDENT(display); > + > if (display->n_pipes && display->n_outputs) > igt_enable_connectors(drm_fd); > else > -- > 2.31.0 >