[Mesa-dev] [PATCH] egl: Fix for not setting EGL_BAD_ALLOC on try to create multiple window surfaces on single window v2.

Daniel Stone daniel at fooishbar.org
Wed Mar 22 18:27:45 UTC 2017


Hi Adrian,
Thanks for the patch! Some comments inline.

On 22 March 2017 at 13:40, Adrian Pielech <adrian.pielech at intel.com> wrote:
> +struct list_head window_list = {NULL, NULL};
> +
> +/* Checks if a EGLWindow already have a created surface */
> +static inline bool
> +is_window_associated_with_surface(EGLNativeWindowType window)
> +{
> +   list_for_each_entry(struct window_list_item, item, &window_list, link) {
> +      if (item->native_window = window) {

This must be changed to == rather than =. Right now it will always
return a false positive.

> +         return true;
> +      }
> +   }
> +
> +   return false;
> +}

I also can't see any locking associated with these (mutex/spinlock),
so this would in fact fail when multiple threads are
creating/destroying surfaces/displays simultaneously. Can you please
add some locking so that concurrent access succeeds?

Cheers,
Daniel


More information about the mesa-dev mailing list