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 796493 - kmssink: add support for GBM allocator
kmssink: add support for GBM allocator
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-06-04 14:49 UTC by Randy Li (ayaka)
Modified: 2018-11-03 14:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
allocator (22.22 KB, patch)
2018-06-04 14:49 UTC, Randy Li (ayaka)
none Details | Review
following the mesa not ARM Mali ddk (22.23 KB, patch)
2018-06-05 16:32 UTC, Randy Li (ayaka)
none Details | Review
Add import interface for wayland and EGL (26.63 KB, patch)
2018-06-11 18:51 UTC, Randy Li (ayaka)
none Details | Review
Add fallback method (26.86 KB, patch)
2018-06-12 17:39 UTC, Randy Li (ayaka)
none Details | Review
The correct fallback (27.18 KB, patch)
2018-06-13 02:56 UTC, Randy Li (ayaka)
none Details | Review
fix allocator problem (27.66 KB, patch)
2018-06-13 19:05 UTC, Randy Li (ayaka)
none Details | Review

Description Randy Li (ayaka) 2018-06-04 14:49:32 UTC
Created attachment 372542 [details] [review]
allocator

In the Android, there is a similiar usuage with GPU memory, it use galloc() to allocate and access a memory from GPU.
There is a GBM support in -base, it doesn't include any memory operation.

This patch is verified with ARM MALI GPU library.
Comment 1 Nicolas Dufresne (ndufresne) 2018-06-04 15:17:20 UTC
Review of attachment 372542 [details] [review]:

Shouldn't that go into libgstgl ? And then support can be added in kmssink ?

::: sys/kms/gstgbmallocator.c
@@ +1,2 @@
+/* GStreamer
+ *

Missing copyright ?

::: sys/kms/gstgbmallocator.h
@@ +5,3 @@
+ * Authors:
+ *  Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
+ *  Javier Martin <javiermartin@by.com.es>

Aren't you the author ?
Comment 2 Randy Li (ayaka) 2018-06-04 15:46:42 UTC
The GBM is not the GL/EGL texture, I think an additional upload path is still necessary. Another reason is that I am confused with the allocator in libgstgl.

I have not update the author information yet, you would found this allocator is just modified from kms allocator :P
Comment 3 Randy Li (ayaka) 2018-06-05 16:32:04 UTC
Created attachment 372557 [details] [review]
following the mesa not ARM Mali ddk

Both kms and wayland can use the gbm, I am planning to move the gbm allocator to a more common place.
But the first thing I should do is fixing the Mali library to make it work as much as mesa.
Comment 4 Randy Li (ayaka) 2018-06-11 18:51:09 UTC
Created attachment 372643 [details] [review]
Add import interface for wayland and EGL
Comment 5 Julien Isorce 2018-06-12 16:22:21 UTC
Review of attachment 372643 [details] [review]:

Thx for your contribution. I think this should go in the "existing" directory gst-plugins-base/tree/gst-libs/gst/gl/gbm
It already contains gbm bits and I am sure your patch have some duplications with this directory.
Please check and let us know if there is anything in your patch that is not in this directory above. Thx!

::: sys/kms/gstgbmallocator.c
@@ +268,3 @@
+  h = GST_VIDEO_INFO_HEIGHT (vinfo);
+
+  /* TODO: add C8 fackback allocation */

s/fackback/fallback/g

@@ +301,3 @@
+  mem = GST_MEMORY_CAST (gbmmem);
+
+  /* TODO: add C8 fackback allocation */

Same

@@ +406,3 @@
+  gobject_class->finalize = gst_gbm_allocator_finalize;
+
+  g_props[PROP_DRM_FD] = g_param_spec_int ("drm-fd", "DRM fd",

Make it more clear this is a fd for the drm 'device'. Ideally you also add a drm-device-path property.
Comment 6 Randy Li (ayaka) 2018-06-12 17:39:35 UTC
Created attachment 372662 [details] [review]
Add fallback method

Thank for you reviewing.
The main reason I don't move it to -base is that I am not familiar with EGL and confusing with the gl allocator.
Another is that I want to verify this modification as quickly as possible, the GPU work more slowly than kms. Also it should be fixed for waylandsink. Can you give me some guide on the libgstgl?

About this commit, it works well on the allocation and import part with those pixel format that gbm driver doesn't support. But I failed in export dmabuf part(with those pixel format is not supported) when I use the buffer in the other device beyond the GPU.
Comment 7 Randy Li (ayaka) 2018-06-13 02:56:50 UTC
Created attachment 372665 [details] [review]
The correct fallback

I uploaded a wrong version yesterday, but I found the DMAbuf won't work with those supported pixel format. And import (fd buffer) have some problem with when it use the fallback mode.
Comment 8 Randy Li (ayaka) 2018-06-13 19:05:14 UTC
Created attachment 372678 [details] [review]
fix allocator problem
Comment 9 GStreamer system administrator 2018-11-03 14:25:02 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/725.