From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [PATCH hwc v1] [RFC] drm_hwcomposer: Flatten composition using writeback connector Date: Wed, 21 Mar 2018 08:48:47 -0700 Message-ID: <87woy577kw.fsf@anholt.net> References: <1520958080-9280-1-git-send-email-alexandru-cosmin.gheorghe@arm.com> <20180320140017.GO223881@art_vandelay> <20180320151608.GA22267@e114479-lin.cambridge.arm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1039570834==" Return-path: Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id B64FC6E3E8 for ; Wed, 21 Mar 2018 15:48:50 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Rob Clark , Alexandru-Cosmin Gheorghe Cc: nd@arm.com, Liviu Dudau , dri-devel List-Id: dri-devel@lists.freedesktop.org --===============1039570834== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Rob Clark writes: > On Tue, Mar 20, 2018 at 11:16 AM, Alexandru-Cosmin Gheorghe > wrote: >> On Tue, Mar 20, 2018 at 10:00:17AM -0400, Sean Paul wrote: >>> On Tue, Mar 13, 2018 at 04:21:20PM +0000, Alexandru Gheorghe wrote: >>> > This patchset tries to add support for using writeback connector to >>> > flatten a scene when it doesn't change for a while. This idea had >>> > been floated around on IRC here [1] and here [2]. >>> > >>> > Developed on top of the latest writeback series, sent by Liviu here >>> > [3]. >>> > >>> > Probably the patch should/could be broken in more patches, but since I >>> > want to put this out there to get feedback, I kept them as a single >>> > patch for now. >>> > >>> > This change could be summarize as follow: >>> > - Attach a writeback connector to the CRTC that's controlling a >>> > display. >>> > - Detect the scene did not change for a while(60 vblanks). >>> > - Re-commit scene and get the composited scene through the writeback >>> > connector. >>> > - Commit the whole scene as a single plane. >>> > >>> > Some areas that I consider important and I could use some >>> > feedback/ideas: >>> > >>> > 1. Building the pipeline. >>> > Currently, drm_hwcomposer allows to connect just a single connector >>> > to a crtc. For now, I decided to treat the writeback connector as a >>> > separate field inside DrmCrtc. I'm not sure if it's a good idea to try >>> > to handle this in a unified way, since the writeback connector is such >>> > a special connector. Regarding the allocation of writeback connectors, >>> > my idea was to allocate writeback connector to the primary display >>> > first and then continue allocating while respecting the display number. 0 >>> > gets a writeback before 1 and so on. >>> > >>> > 2. Heuristic for triggering the flattening. >>> > I just created a VSyncWorker which will trigger the flattening of the >>> > scene if it doesn't change for 60 consecutive vsyncs. The countdown >>> > gets reset every time ValidateDisplay is called. This is a relatively >>> > basic heuristic, so I'm open to suggestions. >>> > >>> > 3. Locking scheme corner cases. >>> > The Vsynworker is a separate thread which will contend with >>> > SurfaceFlinger for showing things on the screen. I tried to limit the >>> > race window by resetting the countdown on ValidateDisplay and >>> > explicitely checking that we still need to use the flatten scene before >>> > commiting to get the writeback result or before applying the flattened >>> > scene. >>> >>> What are the consequences of the race? It seems like it might be possible that >>> stale content will be shown over fresh? >>> I think it'd be fine to serialize >>> vsyncworker and "normal" commits such that the race window is closed instead of >>> reduced. I think you could do the writeback operation asynchronously and then >>> commit the result once it's ready, that shouldn't block things up too much. >>> >> >> Just, to make sure we are on the same page, for Mali DP650 the pipeline >> looks like this, I didn't see how it looks for the other hardware. >> >> CRTC ---- encoder ------------ display connector >> |------- writeback enc ------ writeback connector. >> >> There is no asynchronously writeback operation, the scene that you >> do writeback for will be shown on the display as well. >> > > fwiw, the msm/mdp5 writeback support I implemented was using a > different CRTC (ie. output going either to display or to wb).. (which > unfortunately implies using different planes).. not sure how much this > case is worth supporting in drm-hwc. This is also how VC4's writeback would work. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlqyfuAACgkQtdYpNtH8 nuiJLA/+JrDpDoUWFs0M7jZPfUyVcGPscIl/A59cgRyK1KPXXPD9n/QLOexQBp6P r4AIRICpYGrtYme1edbxzzUrkzAfNHIjmwMoriE06YDfq0fRT0E1mDK21uSicIBA Ch1wHKOuoke4VAP+C2lbrzpA86ciFNvYA98oYOzbL2dgWl5ID4zNqIofNl5Ds2v+ PJFt+inGE4pho6JVPuLgVJJY4mwzkZPvtLkVR571GkbubJ9kVb2It8w+XdrULiF7 33eWuwvHpAUzwXLjSzPye2qsP3mFKeTk1cPkyK0yzPRdEiCKlS9oL41MvHSePkcw z30eP0/v1/BBr9jkw2FQdqHulyxKHjY1bhV7qbzbGY/FeQiH+L0W1H9l9VsA5hed tBMS7b8yTo46U4sSL2H8YjE2Hy7ZFUcK7k9f2RaSyXDkE/uoLxOai2NLsAXVoG4a qM7r1SSV53zk5JHHxWCdXxYplaM4Qng7ExsLm8apJO7sBWNTOdYZvOflIQkycvqd 2amPLMDBNwsHHBQIZUO65g4tY3QfW5rB4uExN/zIFuQKtU+JDQ8PKOju+iP8PE54 6BTWZjXuPhQjooVxkwUo8tKw7oyijNY+9eYu8i5eKi+AP9+6lDBVXj6A3sdEXqgI uUTBY64OlaF9MKF2jdfu1Kli9prbcmDINb9xeaP1FsUduJu+VOo= =2MfU -----END PGP SIGNATURE----- --=-=-=-- --===============1039570834== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1039570834==--