[wpe-webkit] WPE WebKit on libhybris drivers

Alfred Neumayer dev.beidl at gmail.com
Fri Apr 26 23:42:58 PDT 2024


Hello again.

I narrowed down the problem and it has to do with the frame
compleition handler getting called at a 30Hz refresh rate rather than
60fps.
Something is delaying the presentation of the client's new frame by a
whole frame.

No idea why but I circumvented lags by letting the WebProcess and the
host spin independently from each other, plus disabled a codepath
that SIGABRTed when that happens. History shows this might not be
something you are willing to take as is or only in a configurable way,
but it allows for 60fps WebGL contents to stay smooth without much of
an issue, and even without any custom copy of wayland-android.xml.

Here are the two commits in my own forks that enable this:

https://github.com/fredldotme/WebKit/commit/83bf9df4908f68f11ab33bf95c8f36d866459242
https://github.com/fredldotme/WPEBackend-fdo/commit/fcad89823888f91eb701341d9b489506b58c83ce

It doesn't change the API but merely the behavior in a slight way. The
way it is handled now doesn't follow what Wayland allows for,
ie clients spinning independently and causing frame completion to be
signalled with eglSwapBuffers but with a signalling concept around it
instead.

Any idea on how to get this upstreamed so that patches can be reduced
would be appreciated.

Am Do., 25. Apr. 2024 um 11:46 Uhr schrieb Alfred Neumayer
<dev.beidl at gmail.com>:
>
> I have proceeded to implement hybris buffer support into
> WPEBackend-fdo itself, ensuring that buffers are passed using the
> optimal way of operation using existing exportable-fdo-egl interfaces:
>
> https://github.com/fredldotme/WPEBackend-fdo/tree/hybris
>
> I plan to upstream this after verifying functionality and cleanup, as
> long as I don't get immediate refusal (if you dislike anything
> strongly about this branch, please let me know ASAP).
>
> I have been able to verify using WAYLAND_DEBUG=1 and some tracing
> output that initial EGLImage creation is happening, but after the
> first 4 buffers or so passed no further use of my newly implemented
> interfaces is getting used in tandem with WPEWebKit.
>
> Attached a short gist of the Wayland debug output for completeness.
>
> Am Di., 23. Apr. 2024 um 09:25 Uhr schrieb Alfred Neumayer
> <dev.beidl at gmail.com>:
> >
> > Hello,
> >
> > I am working on integrating WPE WebKit as a new browser for Ubuntu
> > Touch, the smart phone OS (which isn't dead but maintained by
> > community members) using libhybris drivers.
> >
> > In a nutshell libhybris wraps GLESv2 and EGL for Android into glibc
> > libraries + some Wayland listeners for passing those buffers between a
> > client and a server. Right now this allows for working WPE WebKit with
> > the WPEQtView (since UT uses QML for UI mostly) but at the cost of
> > performance.
> >
> > Something causes the frame completion handler in the WPEQtViewBackend
> > to get called at roughly 30fps, which isn't ideal and I have ruled
> > out:
> >
> > - OpenGL ES not getting used
> > - Buffer passing between the UIProcess and the WebProcess not working
> > - DisplayVBlank timer stalling redraws
> >
> > to be the causes, so I am wondering how to approach the debugging of
> > this issue further.
> >
> > What I have noticed is that opening webkit://gpu allows smooth
> > scrolling until the first few frames have finished drawing, so roughly
> > the first half of a second is considerably fluid.
> >
> > I really would like to reach the fluidity of recent WebKitGTK. :)
> >
> > Thank you.


More information about the webkit-wpe mailing list