From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 945ECC5DF66 for ; Mon, 17 Aug 2026 15:11:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4906C10E838; Mon, 17 Aug 2026 15:11:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="a34GwEdE"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4CFFB10E836 for ; Mon, 17 Aug 2026 15:08:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:From:Reply-To; bh=dxg3CLOUyqvyjnE8yPmCr8ofpSZVQRhQMMc1c/lV9XE=; b= a34GwEdE4mc+2WIBakraszYSEJ88/ZhxxC4r5xxv/3sPq7QsWyzlm50mGX4rYw72YJbLZ6k7mjxu0 ki93MTwxDHKazUrjRN4L7DT5rZ/y2btXmcaS/Y1/LxwUsK1hNP5bCOK85K1c9XKYZiCS8+XAhFW7O tZUMAzckvc62lhVaMYDkQsxfVCZNeyH4HEd+SXXETNQX6/AJWcIaMyQwgv6eRjSAsidp3mqvlFWVY Umc0qo4bg4M2T+8auQKCZPmblJFppdSWAToxPrJWSVYmvRXladRGKXydbl19lRnorkRRyzwJ2Vkan 8F5lNkIZD7f51jPqhvZseloGg9ciOoQgAg==; Received: from 154.red-79-147-121.dynamicip.rima-tde.net ([79.147.121.154] helo=killbill) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1wvywp-004dea-1j; Mon, 17 Aug 2026 17:08:23 +0200 From: Melissa Wen To: Petri Latvala , Arkadiusz Hiler , Kamil Konieczny , Juha-Pekka Heikkila , Bhanuprakash Modem , Ashutosh Dixit , Karthik B S Cc: Chaitanya Kumar Borah , Alex Hung , Swati Sharma , John Harrison , Rodrigo Siqueira , Simon Ser , Xaver Hugl , Harry Wentland , Uma Shankar , Jani Nikula , igt-dev@lists.freedesktop.org, kernel-dev@igalia.com Subject: [PATCH i-g-t v4 4/8] tests/kms_properties: give non-primary planes their own fb Date: Mon, 17 Aug 2026 17:07:45 +0200 Message-ID: <20260817150749.66509-5-mwen@igalia.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260817150749.66509-1-mwen@igalia.com> References: <20260817150749.66509-1-mwen@igalia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" Testing colorop properties requires the color pipeline to be active, which in turn requires the plane that owns it to be active. On AMD, a CRTC only stays active while its primary plane is enabled, so handing the primary's fb over to a non-primary plane would take the CRTC down with it. Create a dedicated fb for each non-primary plane before testing its colorops and drop it again afterwards, leaving the primary plane and its fb from prepare_crtc() untouched. This is groundwork for the next commit, which checks colorop properties on an active color pipeline. Signed-off-by: Melissa Wen --- v2: - detach different changes from a single commit (Chaitanya) v3: - move hunk from next patch to fix mem leak (Alex H/Chaitanya) --- tests/kms_properties.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/kms_properties.c b/tests/kms_properties.c index 2b4cb152b..c55a271da 100644 --- a/tests/kms_properties.c +++ b/tests/kms_properties.c @@ -237,7 +237,7 @@ static void run_colorop_property_tests(igt_display_t *display, igt_crtc_t *crtc, igt_output_t *output, bool atomic) { - struct igt_fb fb; + struct igt_fb fb, afb; igt_plane_t *plane; igt_colorop_t *colorop; int i; @@ -255,6 +255,18 @@ static void run_colorop_property_tests(igt_display_t *display, igt_crtc_name(crtc), plane->index, kmstest_plane_type_name(plane->type), output->name); + /* A non-primary plane needs an fb of its own: AMD keeps the + * CRTC active only while the primary plane is enabled. + */ + if (plane->type != DRM_PLANE_TYPE_PRIMARY) { + drmModeModeInfo *mode = igt_output_get_mode(output); + + igt_create_pattern_fb(display->drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR, &afb); + + igt_plane_set_fb(plane, &afb); + } + /* iterate over all color pipelines on plane */ for (i = 0; i < plane->num_color_pipelines; ++i) { /* iterate over all colorops in pipeline*/ @@ -272,6 +284,12 @@ static void run_colorop_property_tests(igt_display_t *display, colorop = igt_find_colorop(display, colorop_id); } } + + /* only the fb created above needs to go away here */ + if (plane->type != DRM_PLANE_TYPE_PRIMARY) { + igt_plane_set_fb(plane, NULL); + igt_remove_fb(display->drm_fd, &afb); + } } cleanup_crtc(display, crtc, output, -- 2.53.0