[Bug 779146] dmabuf: be able to negotiate tiled surfaces
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Fri Feb 24 01:24:39 UTC 2017
https://bugzilla.gnome.org/show_bug.cgi?id=779146
--- Comment #5 from Nicolas Dufresne (stormer) <nicolas at ndufresne.ca> ---
OK, so you basically want to negotiate a second format, which is the hardware
format. I suppose this format can be described as a DRM 64bit format (with
modifiers). If you want to use the allocation query, you'll probably need to
set the supported backend formats, when known (linear is assumed if unknown).
This way, the information can be read by exporters downstream. Then downstream
will intersect with it's on set of backend formats (this will mostly be 1
format), and return back the information.
This way, regardless who's the exporter, both side can make the right decision.
This is all doable with allocation_meta(). Which is just a GType + a structure.
We could stage this work in plugin-bad allocator library to start with, and
when happy, we could eventually move that to the -base allocator library. What
we need there is to register the GType and add documentation about the
GstStructure layout. Ideally, the formats, which will by definition not be
GstVideoFormat, shall have a unique definition. To recap, let's run through two
use cases:
v4l2src ! vaapienc
v4l2src will run an allocation query, the GsDmabufBackedFormatMeta will be
missing, because V4L2 does not expose this information. VAAPI will receive the
empty allocation query in propose_allocation(), and decide to go linear.
icamerasrc ! vaapienc
icamerasrc will set GsDmabufBackedFormatMeta,foramt=INTEL_Y_TILED,LIENEAR.
VAAPI will read find this meta, as it supports this tiling, it will leave the
meta as-is, and return the filled allocation query. At this point, both
elements knows they can operate with tiles.
randomcamsrc ! vaapienc
randomcamsrc will set GsDmabufBackedFormatMeta,foramt=REANDOM_FORMAT,LINEAR.
VAAPI will read the meta, and fine that the intersection is LINEAR. VAAPI will
update the allocation query, and return.
randomcamsrc2 ! vaapienc
randomcamsrc2 will set GsDmabufBackedFormatMeta,RANDOM_FORMAT,RANDOM_FORMAT_2.
VAAPI won't recognize any format, and will remove all of them. Both side will
know that it's not worth bothering doing DMABuf.
This might be over-simplistic, and extremely Intel specific, but could serve as
a base. It could also be GstDmabufConstraintMeta. And formats could just be one
of the parameter (e.g. allocation type like CMA, SG/page-aligned, vmalloc,
memory alignement, etc). We are a bit ahead of what the kernel currently expose
to usespace though.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list