From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (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 0C68A1DE2C4 for ; Sun, 9 Feb 2025 12:16:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739103408; cv=none; b=M734Wxh3YsDtGkUyBhzO2fUotzTztVCiPexPhfP802FlZ44suUqkBGd32TbzMhLvWyc/sknoFv8qyjUlgkmPnRZd8VsPiAhtdJ+LxjVMwz2ivfX+kHp9uAwHXyQxBac1xlOwQD6Ix4L5nIHtfDAQ+dZGjo1LD1f+5RJAQ8jUPG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739103408; c=relaxed/simple; bh=EcS4T/ykvPlEPd6lmt0LZjRl0Yhxtzt3eXwuLDRgqmg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dMaa5n171tt6mgOBupbz6DJ+l2E26pORgmnJiomWDfyuG+kaUV45hdBcUHpgmo4Q7QyusHbfd8Y3zAw9I1+/d7aYIg1VoIeKaJJPSrdollgj4ZUQuSXSy8eFCrqGOT9qieNwY6+q8U0MewEIuBo/Nt7zs0VvviJ08Wk+ZKYkRJk= 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=Uxp1I5eE; arc=none smtp.client-ip=95.215.58.180 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="Uxp1I5eE" 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=1739103405; 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=wDd9H+cpVECWFj/tV+zCYRPGelCzXuXhyaQoRRLjdZM=; b=Uxp1I5eEWVeCardaIf4k2BdQX+mZrkZe+w6AlWtbehK+ZaowWz1GbzDkLPitYdUPeg+SJ5 dzCGgOuIuIjD2Lh8t6EVp1qfnK1SBr7WY6ndXBoGez2UiipzGk7jtQqPSGJzO84Rc5gg+W PhIr2bA17nMHPABzKNYw3rjKdjwW8/8= 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 v9 12/13] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable Date: Sun, 9 Feb 2025 17:46:20 +0530 Message-Id: <20250209121621.34677-5-aradhya.bhatia@linux.dev> In-Reply-To: <20250209121621.34677-1-aradhya.bhatia@linux.dev> References: <20250209121032.32655-1-aradhya.bhatia@linux.dev> <20250209121621.34677-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 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 c9ffca796f32..348ef0c12949 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1298,9 +1298,9 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) { encoder_bridge_disable(dev, old_state); - encoder_bridge_post_disable(dev, old_state); - crtc_disable(dev, old_state); + + encoder_bridge_post_disable(dev, old_state); } /** @@ -1636,10 +1636,10 @@ encoder_bridge_enable(struct drm_device *dev, struct drm_atomic_state *old_state void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, struct drm_atomic_state *old_state) { - crtc_enable(dev, old_state); - encoder_bridge_pre_enable(dev, old_state); + crtc_enable(dev, old_state); + encoder_bridge_enable(dev, old_state); drm_atomic_helper_commit_writebacks(dev, old_state); -- 2.34.1