From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) (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 7C558223710 for ; Wed, 26 Feb 2025 15:58:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740585494; cv=none; b=uUEWdpEz4QQvMHSrESOtjQC+Eq7bMz0OYhT08lzcO3lh5F4OItJRXgl24o7Xbmbi2DG4VEW4+uwWfkpxpdzVlbDmTf5DavM/OlJVCEPG23fo9wS4gWsoBS8S59gRpSyptFFkEUfn7uOVu5oFLhCxdk2GeKojRGiFsPcgHtBhtbE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740585494; c=relaxed/simple; bh=VhD4M4jeBNeuYnpDlCsAordD3XjsnTG9dSGIhW4jQzs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AJn0zBybVhtD5Er+skRf/VVkqlUcs9w5WX883GMbruKDLSQrQpEBbLaEW2RQAapyW5MdJt+7eHLxarHUZwb7FPq/lBRzW6Xk5CciE6ZvKFKRP94YEqRp3Qwz8p4pKLvpebGWQkBiqgWo0Gxlx4WWtkNeqAPNRTSpmx0BnAf4hTk= 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=xsDgrm02; arc=none smtp.client-ip=95.215.58.172 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="xsDgrm02" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1740585490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/Lr0Isna30T6Alj+UYYql2xnpgx6olSyJYL64RBOfiQ=; b=xsDgrm02OnhYwVGGHbx4H3nJbx4JvoUZUGYXMv0TBTtleDlWSEEvCL1VanuHqpA5JJvQGI GvEkbyjjn1H3oZKPjQDHz7C6s+l4fWoVS0WmIRjsT5CYwPGIhelut7dcnJGYghmdbkBUqW gKCBMixQ6io9EsP4sGx/o3uzzHp2MOg= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v10 12/13] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable Date: Wed, 26 Feb 2025 21:27:36 +0530 Message-Id: <20250226155737.565931-5-aradhya.bhatia@linux.dev> In-Reply-To: <20250226155737.565931-1-aradhya.bhatia@linux.dev> References: <20250226155228.564289-1-aradhya.bhatia@linux.dev> <20250226155737.565931-1-aradhya.bhatia@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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: bridge[n]_pre_enable ... bridge[1]_pre_enable crtc_enable encoder_enable bridge[1]_enable ... bridge[n]_enable And, the disable sequence for the display pipeline will look like: bridge[n]_disable ... bridge[1]_disable encoder_disable crtc_disable bridge[1]_post_disable ... bridge[n]_post_disable The definition of bridge pre_enable hook says that, "The display pipe (i.e. clocks and timing signals) feeding this bridge will not yet be running when this callback is called". Since CRTC is also a source feeding the bridge, it should not be enabled before the bridges in the pipeline are pre_enabled. Fix that by re-ordering the sequence of bridge pre_enable and bridge post_disable. Acked-by: Dmitry Baryshkov Reviewed-by: Tomi Valkeinen Tested-by: Tomi Valkeinen Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/drm_atomic_helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index d6a14e0c3e93..431a84a007aa 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1336,9 +1336,9 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *state) { encoder_bridge_disable(dev, state); - encoder_bridge_post_disable(dev, state); - crtc_disable(dev, state); + + encoder_bridge_post_disable(dev, state); } /** @@ -1674,10 +1674,10 @@ encoder_bridge_enable(struct drm_device *dev, struct drm_atomic_state *state) void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, struct drm_atomic_state *state) { - crtc_enable(dev, state); - encoder_bridge_pre_enable(dev, state); + crtc_enable(dev, state); + encoder_bridge_enable(dev, state); drm_atomic_helper_commit_writebacks(dev, state); -- 2.34.1