I first posted this message to the etnaviv list today, and I hope it's OK to
cross-post here. I don't intend to spam, I'm just not 100% sure if the problem
is in Xwayland, glamor or in etnaviv. Any input is appreciated.
My system is a i.MX6QP board (with 1.2GHz, but identical problem with another
1.0GHz chip), Vivante GC3000.
Problem: When using Xwayland -retro, a black window appears instead of the
classic X stipple pattern, and X applications are generally invisible, except
when using the software rendering path instead of glamor+GLES2.
- Launch weston (i.e. weston --tty 7)
- From weston-terminal, launch Xwayland -retro
- Xwayland launches with glamor+GLES2, because I disabled the "desktop opengl"
init in Xwayland which cannot run due to missing extensions. Glamor+GLES2
initializes without errors and renders, though fails to present the output.
- Subsequently launched X apps are invisible.
When starting X apps, for example xeyes, Xwayland correctly posts damage to the
compositor, but the glamor texture/buffer object is always empty (filled with
zeroes) or cannot be sampled, resulting in completely black textures.
- with fan debugging enabled in weston, I can see the outlines of the xeyes'
eyes and the pupils' outlines are following the mouse cursor.
- I can map and dump the gbm_bo that xwayland/glamor renders into, in
xwl_window_post_damage. X applications are rendered correctly into this buffer
(I dumped a screenshot of xclock and Chromium), so glamor/gles2 mostly works on
etnaviv, it's just a presentation problem.
- Xwayland/glamor registers its gbm buffer with wl_drm_create_prime_buffer
(passing a fd) which ends up in drm_create_prime_buffer on the server side. I
might have made mistakes, but when mapping the gbm_bo on that side (using
gbm_bo_import and then gbm_map_bo), it appears that the buffer is empty (maybe
it cannot be transferred correctly?).
- Wayland native GLES2 and OpenGL apps work fine on weston, for example
glmark2-wayland or glmark2-es2-wayland, or ioquake3.
- The mouse cursor (big X) is set correctly in xwayland
Versions (all are recent master commits from git):
- xserver bebcc8477c8070ade9dd4be7299c718baeab3d7a
- weston e8ff7df863a10eb4be5273017fb544b5f823fc6a
- mesa 12a2350e6d3b974dec74280543cf5cac22720358
- linux 4.15.0-12117-ga0f79386a49-dirty
I've spent 3-4 days trying to debug this but I don't have enough
egl/dri/etnaviv knowledge to figure out what exactly causes the problem. If you
have any suggestions of how to approach fixing this, I'd be very thankful.
Lukas F. Hartmann (mntmn)
firstname.lastname@example.org: X.Org development