[Mesa-dev] [PATCH] wayland/egl: initialize window surface size to window size

Brendan King brendan.king at imgtec.com
Fri Jun 1 14:35:29 UTC 2018

On 01/06/18 12:09, Juan A. Suarez Romero wrote:
> On Fri, 2018-06-01 at 11:23 +0100, Daniel Stone wrote:
>> Hi,
>> On 1 June 2018 at 09:47, Juan A. Suarez Romero <jasuarez at igalia.com> wrote:
>>> My question then: is mandatory to call eglSwapBuffers() to ensure
>>> wl_egl_window_get_attached_size() returns the right window size? Because I
>>> found nothing related about this. If it is mandatory, then calling
>>> eglSwapBuffers() in the test should fix the problem (including the patch
>>> I've summited with Daniel's changes).
>> In Wayland, surfaces do _not_ have a native size, unlike say GBM
>> surfaces or X11 surfaces. Buffers obviously have a size, and buffers
>> are 'attached' to a surface inside eglSwapBuffers by calling
>> wl_surface_attach(). wl_egl_window_get_attached_size() returns the
>> size of the last buffer which was actually attached, which is required
>> for things like correct input handling when resizing.
> I see. So initialy the wayland window does not have a buffer attached, and hence
> why calling wl_egl_window_get_attached_size() returns an invalid value.
> Only when wl_surface_attach() is called (that happens when invoking
> eglSwapBuffers()) wl_egl_window_get_attached_size() returns the proper value.
> In this case, I agree the error is in the dEQP test.
> I'm going to get rid of attached_{width,height} in the original patch and push
> it. And send a patch to CTS to fix the dEQP test.
> Thanks!
> 	J.A.

IMG has a similar patch to the one you describe, but without the changes 
to the resize_callback, so just this bit:

@@ -255,6 +257,12 @@ dri2_wl_create_window_surface(_EGLDriver *drv, 
_EGLDisplay *disp,
        goto cleanup_surf;

+   dri2_surf->base.Width = window->width;
+   dri2_surf->base.Height = window->height;

I don't think the resize_callback changes are necessary.


More information about the mesa-dev mailing list