After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 784494 - glupload: Put directviv upload high priority than dma upload
glupload: Put directviv upload high priority than dma upload
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-04 03:07 UTC by Haihua Hu
Modified: 2018-05-06 12:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glupload: Put directviv upload high priority than dma upload (906 bytes, patch)
2017-07-04 03:07 UTC, Haihua Hu
none Details | Review

Description Haihua Hu 2017-07-04 03:07:11 UTC
On i.Mx8 platform, need check directviv upload first and then dma. Meanwhile this will have no impact on other platforms.
Comment 1 Haihua Hu 2017-07-04 03:07:57 UTC
Created attachment 354862 [details] [review]
glupload: Put directviv upload high priority than dma upload
Comment 2 Sebastian Dröge (slomo) 2017-07-04 05:43:20 UTC
Why? If both are available and can be used, it shouldn't really make a difference?
Comment 3 Haihua Hu 2017-07-04 05:50:37 UTC
(In reply to Sebastian Dröge (slomo) from comment #2)
> Why? If both are available and can be used, it shouldn't really make a
> difference?

Yes, both are supported on i.MX8 platform. We add memory copy in dma upload to support none dma case on other platform. The new vpu on imx8 only can output physical memory buffer, then it will go through the dma memory copy and performance is bad. Actually, it can go through directviv with zero-copy.
Comment 4 Sebastian Dröge (slomo) 2017-07-04 05:58:22 UTC
That dmabuf is implemented less efficient than directviv sounds weird. Can't both go through exactly the same code paths internally, and basically have the dmabuf carry the same information as the physical memory buffers?
Comment 5 Haihua Hu 2017-07-04 06:14:02 UTC
(In reply to Sebastian Dröge (slomo) from comment #4)
> That dmabuf is implemented less efficient than directviv sounds weird. Can't
> both go through exactly the same code paths internally, and basically have
> the dmabuf carry the same information as the physical memory buffers?

On early imx8DV platform, there is no VPU(video process unit)and software decode can only output system memory buffer. But it realy has an dmabuf allocator called ion. To avoid glupload go through raw data upload, we did a memory copy in dmabuf upload and copy system memory to a new allocator dmabuf then pass it to GPU. 

It also works on imx6 because imx6 has no ion and will fail at allocator dmabuf. Then it will fallback to directviv.

All imx platform share the same code and the recent imx8 platform has implement VPU to do video decode and support physical memory buffer but it also has ion dmabuf allocator. Then it will go through dmabuf upload. This is not right. Actually we need check if the buffer is physical memory buffer first and then dmabuf.
Comment 6 Nicolas Dufresne (ndufresne) 2017-07-04 13:34:48 UTC
(In reply to Haihua Hu from comment #5)
> All imx platform share the same code and the recent imx8 platform has
> implement VPU to do video decode and support physical memory buffer but it
> also has ion dmabuf allocator. Then it will go through dmabuf upload. This
> is not right. Actually we need check if the buffer is physical memory buffer
> first and then dmabuf.

This of course is not normally something userspace shall be aware of, this is special hack form Freescale/NXP/Qualcomm (not sure which name you use now ;-P).

Though, if your decoder produces DMABuf allocated using the CMA, you should not need your "physical memory" hack anymore. The reason the current uploader is slower is most likely because it's doing the color conversion on the GPU (R8 + RG88 + shaders), which I believe is still pretty slow even on newer IMX.

For Etnaviv, which does not implement your "physical memory" hack, they started adding a direct upload to glupload. In Etnaviv, the VPU is used instead for conversion. The result has been reported has good as the other method, with the benifit it's standard and can be used on other boards. Patches are over there:

  https://bugzilla.gnome.org/show_bug.cgi?id=783521

Meanwhile, I'm just encouraging you to move forward something slightly more standard, I don't see any problem of moving this uploader higher in the stack, after all this is only used on your platform, actually it's only used with your SW stack.
Comment 7 Matthew Waters (ystreet00) 2018-05-06 12:53:12 UTC
This is probably not something we're going to do.  Working with the direct dma-buf uploader is the best way forward for this.