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 2C6FFE77188 for ; Tue, 14 Jan 2025 16:36:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 76BF910E3ED; Tue, 14 Jan 2025 16:36:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.b="FRErAOO/"; dkim-atps=neutral Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D9B410E3DD for ; Tue, 14 Jan 2025 16:36:08 +0000 (UTC) Message-ID: <4d2bf1a9-37d8-4f9e-b855-b372179258f2@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736872566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WK/2Pg2t+qxTEB0vGf5T50Gledo/oPMXj73rdxBooow=; b=FRErAOO/f8CRafOfq+9JlUil0BEiGMlXrcS9X6h7mJlus+gaoAPm2PLxPs21IOHheKlZhk IQl9bUdZ5r/az+OqwscgFt12/sujxERh59LubUEmtQDU4OHoUGlAvsuLwiGP1aDD1NkINs vEAuYr8LSOzPOLZzuBS/ojSX2rSsKas= Date: Tue, 14 Jan 2025 22:05:56 +0530 MIME-Version: 1.0 Subject: Re: [PATCH v7 11/12] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable To: Tomi Valkeinen , Dmitry Baryshkov Cc: Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List References: <20250114055626.18816-1-aradhya.bhatia@linux.dev> <20250114055626.18816-12-aradhya.bhatia@linux.dev> <4518320e-4699-4026-adbe-b28514bde544@ideasonboard.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Aradhya Bhatia In-Reply-To: <4518320e-4699-4026-adbe-b28514bde544@ideasonboard.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 1/14/25 18:34, Tomi Valkeinen wrote: > Hi, >=20 > On 14/01/2025 13:24, Dmitry Baryshkov wrote: >> On Tue, Jan 14, 2025 at 11:26:25AM +0530, Aradhya Bhatia wrote: >>> Move the bridge pre_enable call before crtc enable, and the bridge >>> post_disable call after the crtc disable. >>> >>> The sequence of enable after this patch will look like: >>> >>> =C2=A0=C2=A0=C2=A0=C2=A0bridge[n]_pre_enable >>> =C2=A0=C2=A0=C2=A0=C2=A0... >>> =C2=A0=C2=A0=C2=A0=C2=A0bridge[1]_pre_enable >>> >>> =C2=A0=C2=A0=C2=A0=C2=A0crtc_enable >>> =C2=A0=C2=A0=C2=A0=C2=A0encoder_enable >>> >>> =C2=A0=C2=A0=C2=A0=C2=A0bridge[1]_enable >>> =C2=A0=C2=A0=C2=A0=C2=A0... >>> =C2=A0=C2=A0=C2=A0=C2=A0bridge[n]_enable >>> >>> And, the disable sequence for the display pipeline will look like: >>> >>> =C2=A0=C2=A0=C2=A0=C2=A0bridge[n]_disable >>> =C2=A0=C2=A0=C2=A0=C2=A0... >>> =C2=A0=C2=A0=C2=A0=C2=A0bridge[1]_disable >>> >>> =C2=A0=C2=A0=C2=A0=C2=A0encoder_disable >>> =C2=A0=C2=A0=C2=A0=C2=A0crtc_disable >>> >>> =C2=A0=C2=A0=C2=A0=C2=A0bridge[1]_post_disable >>> =C2=A0=C2=A0=C2=A0=C2=A0... >>> =C2=A0=C2=A0=C2=A0=C2=A0bridge[n]_post_disable >>> >>> The definition of bridge pre_enable hook says that, >>> "The display pipe (i.e. clocks and timing signals) feeding this bridg= e >>> will not yet be running when this callback is called". >>> >>> Since CRTC is also a source feeding the bridge, it should not be enab= led >>> before the bridges in the pipeline are pre_enabled. Fix that by >>> re-ordering the sequence of bridge pre_enable and bridge post_disable= =2E >> >> The patch contains both refactoring of the corresponding functions and= >> changing of the order. Please split it into two separate commits. >> >>> >>> Signed-off-by: Aradhya Bhatia >>> Signed-off-by: Aradhya Bhatia >>> --- >>> =C2=A0 drivers/gpu/drm/drm_atomic_helper.c | 300 +++++++++++++++++---= -------- >>> =C2=A0 1 file changed, 181 insertions(+), 119 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/drm_atomic_helper.c >>> b/drivers/gpu/drm/drm_atomic_helper.c >>> index 5186d2114a50..ad6290a4a528 100644 >>> --- a/drivers/gpu/drm/drm_atomic_helper.c >>> +++ b/drivers/gpu/drm/drm_atomic_helper.c >>> @@ -74,6 +74,12 @@ >>> =C2=A0=C2=A0 * also shares the &struct drm_plane_helper_funcs functio= n table >>> with the plane >>> =C2=A0=C2=A0 * helpers. >>> =C2=A0=C2=A0 */ >>> + >>> +enum bridge_chain_operation_type { >>> +=C2=A0=C2=A0=C2=A0 DRM_BRIDGE_PRE_ENABLE_OR_POST_DISABLE, >>> +=C2=A0=C2=A0=C2=A0 DRM_BRIDGE_ENABLE_OR_DISABLE, >>> +}; >>> + >> >> I have mixed feelings towards this approach. I doubt that it actually >> helps. Would you mind replacing it with just 'bool pre_enable' / 'bool= >> post_disable' arguments? >=20 > If my memory serves, I suggested the enum. I don't like it too much > either. But neither do I like the boolean that much, as this is not a > yes/no, on/off case... Then again, maybe boolean is fine here, as the > "off" case is the "normal/default" case so it's still ok-ish. >=20 > But this doesn't matter much, I think. It's internal, and can be > trivially adjusted later. >=20 Alright! I will drop the enum reference entirely, and just use the booleans. Regards Aradhya