From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-175.mta1.migadu.com (out-175.mta1.migadu.com [95.215.58.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 392261CEAC8 for ; Tue, 14 Jan 2025 16:36:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736872570; cv=none; b=ptRsW15KdxpSZvM+Iln8WK68YBMEgGcpMayPmRasB+0fI24P7+hoLM2hRS9b0SQhvsQ1P4qm7SJuNUP/dLV8hzX17KmlnpraQkJF+XJD3Ymohp8fcURJ2SjRoBbdvYQUjaLRrJGmW+Oy4MCTwFs5nRkpa96zxOC9DbHflJi/tIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736872570; c=relaxed/simple; bh=WK/2Pg2t+qxTEB0vGf5T50Gledo/oPMXj73rdxBooow=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Tv5WQWG/2JTlwjIcWb7bHuJt1eVkApFRXC3lrF1qRsGi7cdXdrEP3h9KX1oPwl2L0rP4HqIRWyGXS/Fi1AV4HXGeCWsfReOqzyclwriQfNpVyu9kH8imIvdjfKMl50zGsMRP515e2jU7yxBc98CvbNi1d5+Zki66CxPAGw647Hg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=FRErAOO/; arc=none smtp.client-ip=95.215.58.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="FRErAOO/" 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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