summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_fb.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-05-09 11:29:35 -0400
committerChris Michael <cp.michael@samsung.com>2017-05-09 11:47:04 -0400
commitaf587c01cb75e10f766316c66a02c8d258259a94 (patch)
treeedc6de759e5817bf54cca3c37fb94274a8d34747 /src/lib/ecore_drm2/ecore_drm2_fb.c
parent544cffaa19fca975970e773b209c40c40d1208d6 (diff)
ecore-drm2: Add start of refcounting for FB objects
Small patch which starts to implement refcounting on framebuffer objects. This will be needed so that we do not free FB objects while they are on the screen. Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c5
1 files changed, 5 insertions, 0 deletions
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
35 fb->bpp = bpp; 35 fb->bpp = bpp;
36 fb->depth = depth; 36 fb->depth = depth;
37 fb->format = format; 37 fb->format = format;
38 fb->ref = 1;
38 39
39 memset(&carg, 0, sizeof(drm_mode_create_dumb)); 40 memset(&carg, 0, sizeof(drm_mode_create_dumb));
40 carg.bpp = bpp; 41 carg.bpp = bpp;
@@ -113,6 +114,7 @@ ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsi
113 fb->strides[0] = stride; 114 fb->strides[0] = stride;
114 fb->sizes[0] = fb->strides[0] * fb->h; 115 fb->sizes[0] = fb->strides[0] * fb->h;
115 fb->handles[0] = handle; 116 fb->handles[0] = handle;
117 fb->ref = 1;
116 118
117 if (!_fb2_create(fb)) 119 if (!_fb2_create(fb))
118 { 120 {
@@ -228,6 +230,7 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
228 230
229 if (output->current.fb && (output->current.fb != output->pending.fb)) 231 if (output->current.fb && (output->current.fb != output->pending.fb))
230 _release_buffer(output, &output->current); 232 _release_buffer(output, &output->current);
233
231 output->current.fb = output->pending.fb; 234 output->current.fb = output->pending.fb;
232 output->pending.fb = NULL; 235 output->pending.fb = NULL;
233 236
@@ -615,6 +618,8 @@ ecore_drm2_fb_dmabuf_import(int fd, int width, int height, int depth, int bpp, u
615 fb->bpp = bpp; 618 fb->bpp = bpp;
616 fb->depth = depth; 619 fb->depth = depth;
617 fb->format = format; 620 fb->format = format;
621 fb->ref = 1;
622
618 memcpy(&fb->strides, strides, sizeof(fb->strides)); 623 memcpy(&fb->strides, strides, sizeof(fb->strides));
619 if (_fb2_create(fb)) return fb; 624 if (_fb2_create(fb)) return fb;
620 625