[Mesa-dev] [PATCH 3/3] egl/wayland: unify dri2_wl_create_surface implementations

Emil Velikov emil.l.velikov at gmail.com
Fri Nov 11 18:04:32 UTC 2016


On 11 November 2016 at 17:19, Daniel Stone <daniel at fooishbar.org> wrote:
> Hi,
>
> On 11 November 2016 at 16:45, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> @@ -174,14 +172,24 @@ dri2_wl_create_surface(_EGLDriver *drv, _EGLDisplay *disp,
>>     config = dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT,
>>                                  dri2_surf->base.GLColorspace);
>>
>> -   dri2_surf->dri_drawable =
>> -      (*dri2_dpy->dri2->createNewDrawable)(dri2_dpy->dri_screen, config,
>> -                                           dri2_surf);
>> +   if (dri2_dpy->dri2) {
>> +      dri2_surf->wl_win->resize_callback = resize_callback;
>> +
>> +      createNewDrawable = dri2_dpy->dri2->createNewDrawable;
>> +   } else {
>> +      createNewDrawable = dri2_dpy->swrast->createNewDrawable;
>> +   }
>
> Hm, we've just lost the place we set resize_callback for swrast now.
> :\ This should be called for both paths, no?
> And presumably also only
> set after calling createNewDrawable, so we the following doesn't
> explode:
>     win = wl_egl_window_create(...);
>     surf = eglCreateSurface(..., win); /* fails */
>     wl_egl_window_resize(win, ...); /* unexpectedly calls into
> resize_callback */
>
> No wait, after reading that, resize_callback is essentially a no-op:
> the flush extension doesn't exist for swrast, so resize_callback will
> explode if ever called on swrast. Does this mean that 1/3 is generally
> wrong, and needs to set destroy_window_callback rather than
> resize_callback instead?
>
Yes that's correct - copy/pasta mistake in 1/3. Moving setting
resize_callback after the createNewDrawable sounds like a good thing-
I'll flesh it out.

Thanks
Emil


More information about the mesa-dev mailing list