[igt-dev] [PATCH i-g-t v1] lib/igt_kms: Call get_assigned_primary only if display is initialized

Jessica Zhang quic_jesszhan at quicinc.com
Fri Jun 3 18:32:57 UTC 2022


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.

Signed-off-by: Jessica Zhang <quic_jesszhan at quicinc.com>
---
 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



More information about the igt-dev mailing list