};
static void
-_allocation_complete(Dmabuf_Buffer *b)
+_fallback(Dmabuf_Surface *s, int w, int h)
{
- Surface *s;
- int w, h, num_buf;
Eina_Bool recovered;
- b->pending = EINA_FALSE;
- if (!dmabuf_totally_hosed) return;
-
- if (!b->surface) return;
-
- /* Something went wrong, better try to fall back to a different
- * buffer type...
- */
- s = b->surface->surface;
- w = b->w;
- h = b->h;
- num_buf = b->surface->nbuf;
+ dmabuf_totally_hosed = EINA_TRUE;
/* Depending when things broke we may need this commit to get
* the frame callback to fire and keep the animator running
*/
- wl_surface_commit(b->surface->wl_surface);
- _evas_dmabuf_surface_destroy(b->surface->surface);
- recovered = _evas_surface_init(s, w, h, num_buf);
+ wl_surface_commit(s->wl_surface);
+
+ _evas_dmabuf_surface_destroy(s->surface);
+ recovered = _evas_surface_init(s->surface, w, h, s->nbuf);
if (recovered) return;
ERR("Fallback from dmabuf to shm attempted and failed.");
}
static void
+_allocation_complete(Dmabuf_Buffer *b)
+{
+ b->pending = EINA_FALSE;
+ if (!dmabuf_totally_hosed) return;
+
+ if (!b->surface) return;
+
+ /* Something went wrong, better try to fall back to a different
+ * buffer type...
+ */
+ _fallback(b->surface, b->w, b->h);
+}
+
+static void
_create_succeeded(void *data,
struct zwp_linux_buffer_params_v1 *params,
struct wl_buffer *new_buffer)
static void
_evas_dmabuf_buffer_destroy(Dmabuf_Buffer *b)
{
+ if (!b) return;
+
if (b->locked || b->busy || b->pending)
{
b->orphaned = EINA_TRUE;
static void
_evas_dmabuf_surface_reconfigure(Surface *s, int w, int h, uint32_t flags EINA_UNUSED)
{
+ Dmabuf_Buffer *buf;
Dmabuf_Surface *surface;
int i;
}
_evas_dmabuf_buffer_destroy(b);
- surface->buffer[i] = _evas_dmabuf_buffer_init(surface, w, h);
+ buf = _evas_dmabuf_buffer_init(surface, w, h);
+ surface->buffer[i] = buf;
+ if (!buf)
+ {
+ _fallback(surface, w, h);
+ return;
+ }
}
}
if (!out->bh)
{
free(out);
+ _fallback(s, w, h);
return NULL;
}
out->w = w;
return EINA_TRUE;
err:
- _evas_dmabuf_surface_destroy(s);
+ _fallback(surf, w, h);
return EINA_FALSE;
}