From patchwork Sun Feb 14 19:41:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12087421 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A35F4C433DB for ; Sun, 14 Feb 2021 19:43:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 567F764DE0 for ; Sun, 14 Feb 2021 19:43:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 567F764DE0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=58Hq56qexNRd9k/Zs0Fgy2z+dwhmOXm+FQD1pH4tD5w=; b=QJ3b4/E9Yq77JT5j/Ml1nYkdy ZDNJGxYVvAsFtSENKqUJTqwdfBcm+Wtpl6+jUcaqM1AKpI8c1Lkl9vX4yEiv6j+OxvQVleFsrQfh3 wC0HtMFji9fQ4W8Vc2KcDgatVzemAFk7FTVFg+Ai8SdIzeyg355sbONB6K1jZglv5oi2Qa5T4ZZuT MUj1LazlSvdYTyVz7gDRHCuNS6JK3oM4XaGWrC2iidmPBgP93TeSu7jn7ycTiSjj5YNmg6RQDmGQx OVO1IBaKf9u9XWHgQS9AyL8ob8U9hccsjBhgkZXjR+y4bIV9wtVFTo8UCegyGR+1jYojpuWUI3LOJ nIPq1wnjw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBNHK-00041h-EJ; Sun, 14 Feb 2021 19:41:58 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBNH3-0003vl-LV for linux-arm-kernel@lists.infradead.org; Sun, 14 Feb 2021 19:41:42 +0000 Received: by mail-pj1-x1034.google.com with SMTP id cv23so2477394pjb.5 for ; Sun, 14 Feb 2021 11:41:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uYz3kOtrZ6Hf5DjXT1UkBRogQ4J1lPOvWIWH1kd6QXA=; b=aO2QjQGa2mG9vCy1BwYu3zPMtnftm5Mg2AM9uV8EZImKreIS9VatNBo8bb0qRtNplE 3OBD8aDO1PGAaH8XGG16wdFBOCLqqTx5nMR5pn1I8GBZO4l4CssVedKyRpXL6TVYrtw6 TcovWJ3IIlzD1+m8i7Q6j4uqUZI5AThOLWvR4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uYz3kOtrZ6Hf5DjXT1UkBRogQ4J1lPOvWIWH1kd6QXA=; b=WxVkRL68fgYe9FAHac6+Sjy0vKtyB+aoenfvjUJ5ssZyUL2InlHzhaIrF+ln+n/E+b xwIfm1VMLe+UT14w9Ha4aJ0M724H1yK5VP3Uu4hDzmmLMST6HMQ4fNVN8ifh9irTwgVB PyX/O0+vqSpyio92WRd9u/8gmAYgzjh3I3Gee81yftZxn7EA/9IJJucA1GJBexsS8oM2 /yB8baToY2QO5nu/DEhcNbvrhPtOvhfsiNfg+/t5oyv8O9g1hRZWecKrJga5Zo2gT8B/ rl6rq9Kudf7ES/zyDc/ZsBMDpGuVW0ocAl6gvkD4eSORVBNawMgwIowEehuFgUBJTRtL P9Eg== X-Gm-Message-State: AOAM532a2Oeg1iCXyk4/Q4W+zacyiUonJKHttBikGrIm2b21qZvfdV6H m4/y4gh9tGmlhP9vYVIfDAxgwg== X-Google-Smtp-Source: ABdhPJzLLpSe6h6YLhCLR1f9osYYHY7qcokxZFU5wgjVcteYh/v71KLAWqCEIpbS89QnvAza0juNXg== X-Received: by 2002:a17:90b:4d06:: with SMTP id mw6mr12223997pjb.24.1613331699994; Sun, 14 Feb 2021 11:41:39 -0800 (PST) Received: from ub-XPS-13-9350.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id 125sm15129247pfu.7.2021.02.14.11.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 11:41:39 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart Subject: [PATCH v3 5/7] drm: bridge: Queue the bridge chain instead of stacking Date: Mon, 15 Feb 2021 01:11:00 +0530 Message-Id: <20210214194102.126146-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210214194102.126146-1-jagan@amarulasolutions.com> References: <20210214194102.126146-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210214_144141_826977_C6B87E3F X-CRM114-Status: GOOD ( 14.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maarten Lankhorst , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Jagan Teki , Thomas Zimmermann , linux-amarula@amarulasolutions.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org drm_bridge_attach has stacked the bridge chain, so the bridge that gets pushed last can trigger its bridge function pre_enable first from drm_atomic_bridge_chain_pre_enable. This indeed gives a chance to trigger slave bridge pre_enable first without triggering its host bridge pre_enable for the usual host to slave device model like DSI host with panel slave. For fully enabled bridge drivers, host bridge pre_enable has all host related clock, reset, PHY configuration code that needs to initialized before sending commands or configuration from a slave to communicate its host. Queue the bridge chain instead of stacking it so-that the bridges that got enqueued first can have a chance to trigger first. Cc: Maarten Lankhorst Cc: Thomas Zimmermann Signed-off-by: Jagan Teki --- Changes for v3: - new patch drivers/gpu/drm/drm_bridge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 64f0effb52ac..e75d1a080c55 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -191,9 +191,9 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, bridge->encoder = encoder; if (previous) - list_add(&bridge->chain_node, &previous->chain_node); + list_add_tail(&bridge->chain_node, &previous->chain_node); else - list_add(&bridge->chain_node, &encoder->bridge_chain); + list_add_tail(&bridge->chain_node, &encoder->bridge_chain); if (bridge->funcs->attach) { ret = bridge->funcs->attach(bridge, flags);