Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp523938imm; Wed, 6 Jun 2018 01:28:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKkShw7/6qJifgtWcrcIM7gvc6p7VYonpO+c6EMihYGK3BQQPoMiVGjSc7yHLwBIUqdQfUM X-Received: by 2002:a63:a05d:: with SMTP id u29-v6mr1814195pgn.80.1528273737956; Wed, 06 Jun 2018 01:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528273737; cv=none; d=google.com; s=arc-20160816; b=f8jHpr5HQcihM1vh6kD5lELAgn6f9iygTEx0gURYMPwJXsZjr+STelUxGWnAtuXch3 psDwGECOnJmfH+rAUABMAQTs/Mx2LEMLNKRIlFugeerlQoODDPaXZl2yB19CQQy2o37k P8BGkl3dJJOhJ0p/XDLTyqby6hY01H0zLnE2uoPBikquR2EaOW7bdaBxWLjUakP5wpVU N/V3pvYILUMr6izQqciPBtLrPi2YEWEaIui8JnacZ0HmG5rA1eGpET8SZBluxYm97Q+a 9lxAncH43EDOi+vRTd1U6fMfuvrBn8RBeuSr79avFOU/pLVJu2SN5+ZgWN0eyD/C7EUB cnTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id :content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:from:cc:to:subject:dkim-signature:dkim-filter :arc-authentication-results; bh=46y6hvy1JDnE+LwiYNPx61gSf1ym8ltj3rMwwU5w7+k=; b=wAQ0bcpVQzeMqhDRykd3Fq4DjZpa4cnD5DjAQVs0HpfzGCdSII7YB+RrkgOk0cV1kM q16sHOEH2aONv4+e7gRnVNpx4JZq5sw3aTyi6NqB7LnSzOFovidhQOCPNSBtCj8/JX8m JUrgvHgISZraUgUKbY9OsPdPVYFyfdBCsNXWEQA7DBOlmqBMWfIDl62UJxjKcILoojA5 IVV+/rg9GxwP5jb+MvVgMme0QiNlz4QI1Mjqa2nNXevnEJYaxEMjj5HKBy8j2JUM51at mOVAlzm3EJ3x78ZLfbEEuk+ZMrSeBRJp9PVE+8giH2FljauSNx9OWKCY99Ny5bdLU8K1 k1oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=dio5ZWdX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3-v6si14223438pgp.496.2018.06.06.01.28.43; Wed, 06 Jun 2018 01:28:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=dio5ZWdX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932529AbeFFI2K (ORCPT + 99 others); Wed, 6 Jun 2018 04:28:10 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55104 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932444AbeFFI2J (ORCPT ); Wed, 6 Jun 2018 04:28:09 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180606082806euoutp01fb078d39482ac59c69f3b84cc211e0b5~1hNIrJRCW0593805938euoutp01S for ; Wed, 6 Jun 2018 08:28:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180606082806euoutp01fb078d39482ac59c69f3b84cc211e0b5~1hNIrJRCW0593805938euoutp01S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528273686; bh=46y6hvy1JDnE+LwiYNPx61gSf1ym8ltj3rMwwU5w7+k=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=dio5ZWdX7FoqzjchD4HA/+58mZy0IHLF01+QaXUuhhm4U+S+17OGkCrnh16oTUCFX rAxcw5UKuxkj6OGp9Rmjrhfamg99R52ZmVy2FtoSqz1zNFSHOuaOcnsFqLLA7Sz15Y lqvYwgrbhTZ0GWszI6P6WEb12qWgg4MxPrBLnH/E= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180606082806eucas1p17a6ecaf741810a55fe1a1597a71a89c4~1hNIGWpGa2616526165eucas1p1A; Wed, 6 Jun 2018 08:28:06 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 58.7F.05700.51B971B5; Wed, 6 Jun 2018 09:28:05 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20180606082805eucas1p29c806a82abbd8bdb9879c83211976fb9~1hNHMfcIE0348503485eucas1p2R; Wed, 6 Jun 2018 08:28:05 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180606082804eusmtrp10ca8adfa1ee82fa85adfe6f85e207529~1hNG6l4042531225312eusmtrp1S; Wed, 6 Jun 2018 08:28:04 +0000 (GMT) X-AuditID: cbfec7f2-1dbff70000011644-06-5b179b15781d Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 82.48.04183.41B971B5; Wed, 6 Jun 2018 09:28:04 +0100 (BST) Received: from [106.120.43.17] (unknown [106.120.43.17]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20180606082804eusmtip2c3f75dace131a928df5a738817ce1502~1hNGb3FmD3048730487eusmtip2T; Wed, 6 Jun 2018 08:28:04 +0000 (GMT) Subject: Re: [PATCH] drm/vc4: Enable the DSI module and link before other enables. To: Eric Anholt , dri-devel@lists.freedesktop.org Cc: Kevin Quigley , Boris Brezillon , linux-kernel@vger.kernel.org, James Hughes , Archit Taneja From: Andrzej Hajda Date: Wed, 6 Jun 2018 10:28:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <87lgbtt6em.fsf@anholt.net> Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKKsWRmVeSWpSXmKPExsWy7djP87qis8WjDf49NrJo6njLarHvVD+L xZWv79ksDjReZrTY/P0Bq8XNd0/YLC7vmsPmwO7R9P4Ym8e8NdUel/t6mTzW9K5j87jffZzJ 4+DJbkaPz5vkAtijuGxSUnMyy1KL9O0SuDJuL/nCXLBFvmL7or2sDYxXJbsYOTkkBEwkPjXc Ye1i5OIQEljBKDFzVycjhPOFUeL8p242COczo8TSc51MMC2Tjv2DqlrOKHFr/z0mCOcto8SS jc/BqoQFQiSm3N7FAmKLCDhJfNywD6yIWeAco0TTgu9sIAk2AU2Jv5tvgtksAioSSye9ZgWx RQUiJDZO+MQMYvMKCEqcnPkEbBCngIZE/9oLYPXMAvISzVtnM0PY4hK3nswHWyAhsI9d4uui u+wQzWUSr3fOYYe420XiwJpljBC2sMSr41ug4jISpyf3sEDY9RJNM68wQwzqYJQ4sXg5G0TC WuLw8YtA13EAbdOUWL9LHyLsKHHsSj87SFhCgE/ixltBiHv4JCZtm84MEeaV6GgTgqhWlLh/ diszhC0usfTCV7YJjEqzkHw5C8lns5B8Ngth7wJGllWM4qmlxbnpqcWGeanlesWJucWle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braLnqJ7hNvg5g1P4UP/5qr+vON7XerKtH3PeLany25fFOD0TF+HZW1B29xYuUC2 yxvcGjxO59yaOV9Iua5ZWMDs7JabBW/Yow70ra3b5ew1U2yG1RRRuSOLXR40dcWvmsyaXeu6 qE7j/l2r90osxRmJhlrMRcWJAJx0uuraAgAA Message-Id: <20180606082805eucas1p29c806a82abbd8bdb9879c83211976fb9~1hNHMfcIE0348503485eucas1p2R@eucas1p2.samsung.com> X-CMS-MailID: 20180606082805eucas1p29c806a82abbd8bdb9879c83211976fb9 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20180604194448epcas1p29627759e2d8c0b1388c6700a7da77a45 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180604194448epcas1p29627759e2d8c0b1388c6700a7da77a45 References: <20180604194437.13790-1-eric@anholt.net> <20180605082532eucas1p21328ec5bea7d588c81480829f862bdfd~1NhnMydDJ0562405624eucas1p2l@eucas1p2.samsung.com> <87lgbtt6em.fsf@anholt.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05.06.2018 20:49, Eric Anholt wrote: > Andrzej Hajda writes: > >> On 04.06.2018 21:44, Eric Anholt wrote: >>> We want the DSI PHY to be enabled and the DSI module clocked before a >>> panel or bridge's prepare() function, since most DSI panel drivers >>> with a prepare() hook are doing DCS transactions inside of them. >>> >>> Signed-off-by: Eric Anholt >>> Cc: Kevin Quigley >>> Cc: James Hughes >>> Cc: Boris Brezillon >>> --- >>> >>> I'm not sure it makes sense to enable CRTCs before encoders on vc4 at >>> all. Why start scanning pixels before the encoder is ready to hear >>> about VSTART? However, this patch will hopefully unblock people >>> trying to attach other panels to rpi >> But this patch is about enabling encoder before panel/bridge prepare. Or >> am I missing something. >> Anyway I would be more precise here, MIPI-DSI bus is used for two things: >> - control bus - accessing DSI device (configuration/detection,...), >> - video data bus - sending video stream. >> >> I suspect in prepare/pre_enable phase of DSI panel/bridge only control >> bus should be functional, video stream transfer does not make sense. >> So the best solution (I guess) would be to split DSI-encoder enable >> sequence into control bus enable and video transfer enable parts and >> call the former before 1st transfer request from device and the latter >> in encoder enable callback. Of course there will be a problem then with >> disabling sequence, ie stopping video stream should be performed in >> encoder's disable, but when we should disable control bus? If we do it >> in encoder's disable callback we could not perform transfers in >> post_disable cb of the bridge - in most cases (maybe all currently >> present in kernel) it will work, but it does not look ideal. >> All this recalls me discussion that hardwiring bridge callbacks into drm >> core is problematic and maybe it would be better to call downstream >> callbacks explicitly from upstream element - the callback order should >> depend on the local bus protocol, and should not be fixed in drm core. > It does seem like for DSI encoders they generally would need to be able > to control when the call down to the bridge happens. However, from my > experience with panels, drivers are bad about calling both prepare and > enable, if their particular panel only cares about one of them. So, how > about: > > - encoders can call drm_bridge_disable_midlayer_calls() (any naming > suggestions?) to flag this bridge as not wanting the calls from the > atomic helpers. > > - atomic helpers WARN if bridge midlayer_calls flag was set and > drm_bridge_pre_enable/enable/disable/post_disable failed to be called > by the encoder > > - drm_bridge_detach() clears disable_midlayer_calls flag for the next > encoder I like the idea, I guess the flag should be placed in "struct drm_bridge". Since I plan to propose flag to avoid device links in panels/bridges maybe it would be good to set flags directly, or by helper similar to irq_set_status_flags, instead of creating separate helper for each flag. I am not sure about warns from atomic helpers, maybe it would be enough to track and verify state transitions of bridges similarly to the ones proposed (and abandoned?) by Sean [1]. And little off-topic: all these duplication of ideas/code/functionalities added to/from panels from/to bridges and this crazy code:     sink = drm_of_find_panel_or_bridge...     if (sink is panel)         do_something     else if (sink is bridge)         do_something_similar_but_with_different_functions laying in multiple encoders/bridges, provokes me to raise again a question, wouldn't be better to merge drm_bridge and drm_panel into one drm_sink object. [1]: https://marc.info/?l=dri-devel&m=150827480716580 Regards Andrzej