From: Nicolas Dufresne <nicolas@ndufresne.ca>
To: Daniel Vetter <daniel@ffwll.ch>,
Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: linux-kernel@vger.kernel.org,
Alexandre Courbot <acourbot@chromium.org>,
Tomasz Figa <tfiga@chromium.org>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Eric Anholt <eric@anholt.net>, Rob Clark <robdclark@gmail.com>,
Dave Airlie <airlied@redhat.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Subject: Re: Support for 2D engines/blitters in V4L2 and DRM
Date: Thu, 18 Apr 2019 20:30:41 -0400 [thread overview]
Message-ID: <8265f098722d0cd5aae606d7ee6d955f168ac8f3.camel@ndufresne.ca> (raw)
In-Reply-To: <20190418081816.GO13337@phenom.ffwll.local>
Le jeudi 18 avril 2019 à 10:18 +0200, Daniel Vetter a écrit :
> > It would be cool if both could be used concurrently and not just return
> > -EBUSY when the device is used with the other subsystem.
>
> We live in this world already :-) I think there's even patches (or merged
> already) to add fences to v4l, for Android.
This work is currently suspended. It will require some feature on DRM
display to really make this useful, but there is also a lot of
challanges in V4L2. In GFX space, most of the use case are about
rendering as soon as possible. Though, in multimedia we have two
problems, we need to synchronize the frame rendering with the audio,
and output buffers may comes out of order due to how video CODECs are
made.
In the first, we'd need a mechanism where we can schedule a render at a
specific time or vblank. We can of course already implement this in
software, but with fences, the scheduling would need to be done in the
driver. Then if the fence is signalled earlier, the driver should hold
on until the delay is met. If the fence got signalled late, we also
need to think of a workflow. As we can't schedule more then one render
in DRM at one time, I don't really see yet how to make that work.
For the second, it's complicated on V4L2 side. Currently we signal
buffers when they are ready in the display order. With fences, we
receive early pairs buffer and fence (in decoding order). There exist
cases where reordering is done by the driver (stateful CODEC). We
cannot schedule these immediately we would need a new mechanism to know
which one come next. If we just reuse current mechnism, it would void
the fence usage since the fence will always be signalled by the time it
reaches DRM or other v4l2 component.
There also other issues, for video capture pipeline, if you are not
rendering ASAP, you need the HW timestamp in order to schedule. Again,
we'd get the fence early, but the actual timestamp will be signalled at
the very last minutes, so we also risk of turning the fence into pure
overhead. Note that as we speak, I have colleagues who are
experimenting with frame timestamp prediction that slaves to the
effective timestamp (catching up over time). But we still have issues
when the capture driver skipped a frame (missed a capture window).
I hope this is useful reflection data,
Nicolas
next prev parent reply other threads:[~2019-04-19 0:30 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-17 18:10 Paul Kocialkowski
2019-04-18 8:18 ` Daniel Vetter
2019-04-18 8:54 ` Paul Kocialkowski
2019-04-18 9:09 ` Tomasz Figa
2019-04-18 9:13 ` Paul Kocialkowski
2019-04-18 9:21 ` Tomasz Figa
2019-04-19 0:30 ` Nicolas Dufresne [this message]
2019-04-19 4:27 ` Tomasz Figa
2019-04-19 15:31 ` Nicolas Dufresne
2019-04-22 4:02 ` Tomasz Figa
2019-04-19 8:38 ` Paul Kocialkowski
2019-04-24 8:31 ` Michel Dänzer
2019-04-24 12:01 ` Nicolas Dufresne
2019-04-24 14:39 ` Michel Dänzer
2019-04-24 14:41 ` Paul Kocialkowski
2019-04-24 15:06 ` Daniel Vetter
2019-04-24 15:44 ` Nicolas Dufresne
2019-04-24 16:54 ` Michel Dänzer
2019-04-24 17:43 ` Nicolas Dufresne
2019-04-25 15:17 ` Michel Dänzer
2019-04-24 12:19 ` Paul Kocialkowski
2019-04-24 17:10 ` Michel Dänzer
2019-05-06 8:28 ` Pekka Paalanen
2019-05-09 8:32 ` Paul Kocialkowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8265f098722d0cd5aae606d7ee6d955f168ac8f3.camel@ndufresne.ca \
--to=nicolas@ndufresne.ca \
--cc=acourbot@chromium.org \
--cc=airlied@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric@anholt.net \
--cc=hverkuil@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=maxime.ripard@bootlin.com \
--cc=mchehab@kernel.org \
--cc=paul.kocialkowski@bootlin.com \
--cc=robdclark@gmail.com \
--cc=tfiga@chromium.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®