<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body><div>On Fri, 2018-06-01 at 09:39 +0100, Brendan King wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
    <p>The IMG patch Eric was referring to was to dEQP. I submitted bug
      reports to Google and Khronos:</p>
    <p><span id="F1822.wrapper" class="fieldWidget stateRteFieldWidget
        roWidget"><span class="F1822 ControlStyle rofld" style="" id="F1822"><a href="https://issuetracker.google.com/issues/64059452" target="_blank">https://issuetracker.google.com/issues/64059452</a></span></span></p>
    <p><span id="F1822.wrapper" class="fieldWidget stateRteFieldWidget
        roWidget"><span class="F1822 ControlStyle rofld" style="" id="F1822"><a href="https://gitlab.khronos.org/Tracker/vk-gl-cts/issues/594" target="_blank">https://gitlab.khronos.org/Tracker/vk-gl-cts/issues/594</a></span></span></p>
    I've attached the patch to this email. The problem is that the dEQP
    <span id="F1822.wrapper" class="fieldWidget stateRteFieldWidget
      roWidget"><span class="F1822 ControlStyle rofld" style="" id="F1822">*resize.surface_size* tests check the native window
        dimensions after creating the window, without having called
        eglSwapBuffers, and hence get back a width and height of zero,
        resulting in the tests failing.<br></span></span></blockquote><div><br></div><div>Thanks for the reference.</div><div><br></div><div>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).</div><div><br></div><div><br></div><div>      J.A.</div><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><span id="F1822.wrapper" class="fieldWidget stateRteFieldWidget
      roWidget"><span class="F1822 ControlStyle rofld" style="" id="F1822">
        <br>
        Here is the patch description:<br>
      </span></span>
    <pre>The Wayland version of deqp-egl calls wl_egl_window_get_attached_size</pre><pre>to get window dimensions. On Mesa at least, this initially returns a</pre><pre>width and height of zero for a new window. The surface resize tests</pre><pre>check the initial surface size, and fail as a result.</pre><pre><br></pre><pre>Add a new native window capability, CAPABILITY_INITIAL_SURFACE_SIZE_QUERY,</pre><pre>which is only set if the initial window size can be queried after</pre><pre>creation. If native windows don't have the capability, return the</pre><pre>required size from getNativeSurfaceSize, rather than the size obtained</pre><pre>from the window system.</pre><pre><br></pre><pre>A parameter has been added to getNativeSurfaceSize, to indicate if</pre><pre>the initial size of a surface is being queried.</pre><pre><br></pre><pre>Brendan.</pre><pre><br></pre>
    <div class="moz-cite-prefix">On 01/06/18 09:12, Juan A. Suarez
      Romero wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:e7942a33db5df3918200f66f165028a274e0345b.camel@igalia.com" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
      <pre>On Thu, 2018-05-31 at 16:57 +0100, Daniel Stone wrote:</pre><pre><br></pre>
      <blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
        <pre>Hi Juan,</pre><pre>Thanks for picking this up!</pre><pre><br></pre><pre>On 31 May 2018 at 16:44, Juan A. Suarez Romero <a class="moz-txt-link-rfc2396E" href="mailto:jasuarez@igalia.com"><jasuarez@igalia.com></a> wrote:</pre><pre><br></pre>
        <blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
          <pre>@@ -255,6 +257,12 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,</pre><pre>       goto cleanup_surf;</pre><pre>    }</pre><pre><br></pre><pre>+   dri2_surf->base.Width = window->width;</pre><pre>+   dri2_surf->base.Height = window->height;</pre><pre>+</pre><pre>+   window->attached_width = dri2_surf->base.Width;</pre><pre>+   window->attached_height = dri2_surf->base.Height;</pre><pre><br></pre>
        </blockquote>
        <pre>We should definitely not initialise attached_{width,height} here,</pre><pre>because no buffer has ever been attached.</pre><pre><br></pre><pre><br></pre>
        <blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
          <pre>@@ -574,8 +582,8 @@ update_buffers(struct dri2_egl_surface *dri2_surf)</pre><pre>    struct dri2_egl_display *dri2_dpy =</pre><pre>       dri2_egl_display(dri2_surf->base.Resource.Display);</pre><pre><br></pre><pre>-   if (dri2_surf->base.Width != dri2_surf->wl_win->width ||</pre><pre>-       dri2_surf->base.Height != dri2_surf->wl_win->height) {</pre><pre>+   if (dri2_surf->wl_win->attached_width != dri2_surf->wl_win->width ||</pre><pre>+       dri2_surf->wl_win->attached_height != dri2_surf->wl_win->height) {</pre><pre><br></pre><pre>       dri2_wl_release_buffers(dri2_surf);</pre><pre><br></pre><pre>@@ -1629,8 +1637,8 @@ swrast_update_buffers(struct dri2_egl_surface *dri2_surf)</pre><pre>    if (dri2_surf->back)</pre><pre>       return 0;</pre><pre><br></pre><pre>-   if (dri2_surf->base.Width != dri2_surf->wl_win->width ||</pre><pre>-       dri2_surf->base.Height != dri2_surf->wl_win->height) {</pre><pre>+   if (dri2_surf->wl_win->attached_width != dri2_surf->wl_win->width ||</pre><pre>+       dri2_surf->wl_win->attached_height != dri2_surf->wl_win->height) {</pre><pre><br></pre>
        </blockquote>
        <pre>Not initialising attached_{width,height} should not cause any problems</pre><pre>with these checks. By definition there cannot have been any buffers</pre><pre>allocated or attached between creation and the first draw call, so</pre><pre>there are no old buffers to release.</pre><pre><br></pre>
      </blockquote>
      <pre>Eric explained pretty well the reason to touch attached_{width,height};</pre><pre>otherwise dEQP-EGL.functional.resize.surface_size.* tests continue to fail.</pre><pre><br></pre><pre><br></pre><pre>     J.A.</pre><pre><br></pre><pre><br></pre><pre><br></pre>
      <blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
        <pre>So with that initialisation removed, this is (assuming dEQP still passes):</pre><pre>Reviewed-by: Daniel Stone <a class="moz-txt-link-rfc2396E" href="mailto:daniels@collabora.com"><daniels@collabora.com></a></pre><pre><br></pre><pre>Cheers,</pre><pre>Daniel</pre><pre><br></pre><pre><br></pre>
      </blockquote>
      <pre>_______________________________________________</pre><pre>mesa-dev mailing list</pre><pre><a class="moz-txt-link-abbreviated" href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a></pre><pre><a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></pre><pre><br></pre>
    </blockquote>
    <br>
  

</blockquote></body></html>