NEW 272958
[WPE] Qt View is tied to fdo backend
https://bugs.webkit.org/show_bug.cgi?id=272958
Summary [WPE] Qt View is tied to fdo backend
Alfred E. Neumayer
Reported 2024-04-19 00:24:55 PDT
I've recently started to take on getting WebKit to work on Ubuntu Touch with libhybris drivers (basically GNU/Linux with Android GL/EGL). Since it mainly uses Qt with QML for UI applications the existing WPEQtView was a good start, but it turns out that buffer passing to the host app is tied to the fdo backend (linking against it for wpe_fdo_initialize_for_egl_display and wpe_fdo_egl_exported_image, etc), resulting in imperfect performance. Since the adaptation to run on libhybris comes with its own WPEBackend it would be beneficial to be able to load it instead of having -fdo trump everytime. To make the Qt/QML view behave the most performant on any backend changes are needed, like getting EGLImages from multiple backends in the view backend code, or ensure an abstraction in libwpe itself. I'd argue the former is quicker to implement and could be transferred over to libwpe if appropriate. Input welcome.
Attachments
Adrian Perez
Comment 1 2024-05-17 06:37:13 PDT
We are currently working on bringing in support for Qt6 *without* needing to use wpebackend-fdo -- this would be bug #270161 There is already a PR for review which uses the new WPE platform API, which results in using DMA-BUF, maybe you would like to take a look: https://github.com/WebKit/WebKit/pull/25197 Now, question: which kind of buffers do you use for brokering pixel data through libhybris? If the answer is something DMA-BUF based, I think most of the needed code would already be inside WebKit. Note that new “platform” implementations (the somewhat substitute of WPE backends) can be added, so if we need something different to cover libhybris we could specialize the Qt platform implementation, either guarding the needed extra code (if any) with preprocessor guards or trying to detect at runtime what needs to be used. Sorry I am not able to provide more detailed advice, I don't have experience with libhybris O:-)
Alfred E. Neumayer
Comment 2 2024-05-17 07:11:04 PDT
Thanks for the link, I will take a look in a short moment. To answer your question: libhybris is doing the low-level Android way of passing buffer references around, using more than one fd and some ints, ie buffers that have been allocated by Android's gralloc. That means that DMA-Buf behavior cannot be mimicked easily as that one only needs one fd and done. For example, for Wayland compositors and clients to work together they follow this additional protocol: https://github.com/libhybris/libhybris/blob/9dea23ce225eb03e2c2f9091ea1cde0b33c6098c/hybris/platforms/common/wayland-android.xml A libhybris meta-EGL library wraps the Android libEGL and stuffs its own Wayland listener in between, so that Android buffers are passed without requiring apps to be modified. After all in the end hybris EGL extensions can turn those into EGLImages for use on the client-side as already done in the QML Item in question. I was also wondering about performance issues with WPEWebKit at the moment, but have not received an answer on that topic in the mailing list from April 2024. Should I open another bug report or should we discuss there still?
Note You need to log in before you can comment on or make changes to this bug.