diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c index 1b2c4d95a3..1570895294 100644 --- a/src/lib/ecore_drm2/ecore_drm2_fb.c +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c @@ -35,6 +35,7 @@ ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned fb->bpp = bpp; fb->depth = depth; fb->format = format; + fb->ref = 1; memset(&carg, 0, sizeof(drm_mode_create_dumb)); carg.bpp = bpp; @@ -113,6 +114,7 @@ ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsi fb->strides[0] = stride; fb->sizes[0] = fb->strides[0] * fb->h; fb->handles[0] = handle; + fb->ref = 1; if (!_fb2_create(fb)) { @@ -228,6 +230,7 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output) if (output->current.fb && (output->current.fb != output->pending.fb)) _release_buffer(output, &output->current); + output->current.fb = output->pending.fb; output->pending.fb = NULL; @@ -615,6 +618,8 @@ ecore_drm2_fb_dmabuf_import(int fd, int width, int height, int depth, int bpp, u fb->bpp = bpp; fb->depth = depth; fb->format = format; + fb->ref = 1; + memcpy(&fb->strides, strides, sizeof(fb->strides)); if (_fb2_create(fb)) return fb; diff --git a/src/lib/ecore_drm2/ecore_drm2_plane.c b/src/lib/ecore_drm2/ecore_drm2_plane.c index e90a740073..2bf1917545 100644 --- a/src/lib/ecore_drm2/ecore_drm2_plane.c +++ b/src/lib/ecore_drm2/ecore_drm2_plane.c @@ -119,6 +119,8 @@ out: return NULL; } + fb->ref++; + DBG("FB %d assigned to Plane %d", fb->id, pstate->obj_id); output->planes = eina_list_append(output->planes, plane); diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h index 1b82ad5d42..b73add3667 100644 --- a/src/lib/ecore_drm2/ecore_drm2_private.h +++ b/src/lib/ecore_drm2/ecore_drm2_private.h @@ -695,6 +695,7 @@ struct _Ecore_Drm2_Fb int fd; int w, h; int depth, bpp; + short ref; uint32_t id, handles[4]; uint32_t strides[4], sizes[4]; uint32_t format; @@ -795,7 +796,6 @@ struct _Ecore_Drm2_Output Eina_List *plane_states; Eina_List *planes; - Eina_Bool connected : 1; Eina_Bool primary : 1; Eina_Bool cloned : 1;