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=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 A8AA0C2D0D1 for ; Mon, 6 Jan 2020 10:29:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1581120731 for ; Mon, 6 Jan 2020 10:29:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="aigvBjAQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1581120731 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 046A46E23D; Mon, 6 Jan 2020 10:29:25 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C67C6E23B for ; Mon, 6 Jan 2020 10:29:23 +0000 (UTC) Received: from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7A86B52F; Mon, 6 Jan 2020 11:29:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1578306561; bh=Epnma+hHn8oqzO71KUPxhhXyABGgluqWJ8aDYarTFCQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aigvBjAQvWmc8LAwYvHzTLXXO7BKX/wgcBPDtmHopU4+uCbi+NHq55BGMe5XUPPRf BUspD4IC/XxUK6FmRRc7RIuiwPlv12unT/wTF6Dd7qhwcS5iBzuLqciOBRHiRGoboX 6Mv08y27tCV2rZFbNsIlaPgqRzeSIqZrS7gKK2SE= Date: Mon, 6 Jan 2020 12:29:11 +0200 From: Laurent Pinchart To: Boris Brezillon Subject: Re: [PATCH 1/3] drm/bridge: Fix drm_bridge_chain_pre_enable() Message-ID: <20200106102911.GA4853@pendragon.ideasonboard.com> References: <20191227144124.210294-1-boris.brezillon@collabora.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191227144124.210294-1-boris.brezillon@collabora.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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: , Cc: Jernej Skrabec , Jonas Karlman , Neil Armstrong , Seung-Woo Kim , dri-devel@lists.freedesktop.org, Kyungmin Park , Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Boris, Thank you for the patch. On Fri, Dec 27, 2019 at 03:41:22PM +0100, Boris Brezillon wrote: > Stop iterating on the bridge chain when we reach the bridge element. > That's what other helpers do and should allow bridge implementations > to execute a pre_enable operation on a sub-chain. The code looks fine to me, but I think you should update the documentation to explain this. It currently states: * Calls &drm_bridge_funcs.pre_enable op for all the bridges in the encoder * chain, starting from the last bridge to the first. These are called * before calling the encoder's commit op. * * Note: the bridge passed should be the one closest to the encoder I suggest stating instead that the operation is called from the last bridge to the bridge passed as the argument. The note should then either be removed, or updated to state that bridge is usually the bridge closest to the encoder, but can be any other bridge if the caller only wants to execute the operation on a subset of the chain. It's also probably worth it updating the other functions accordingly. > Fixes: 05193dc38197 ("drm/bridge: Make the bridge chain a double-linked list") > Signed-off-by: Boris Brezillon > --- > drivers/gpu/drm/drm_bridge.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c > index c2cf0c90fa26..b3b269ec6a39 100644 > --- a/drivers/gpu/drm/drm_bridge.c > +++ b/drivers/gpu/drm/drm_bridge.c > @@ -357,6 +357,9 @@ void drm_bridge_chain_pre_enable(struct drm_bridge *bridge) > list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) { > if (iter->funcs->pre_enable) > iter->funcs->pre_enable(iter); > + > + if (iter == bridge) > + break; > } > } > EXPORT_SYMBOL(drm_bridge_chain_pre_enable); -- Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel