summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_fb.c')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 090c998d45..be75760765 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -522,3 +522,29 @@ ecore_drm2_fb_bo_get(Ecore_Drm2_Fb *fb)
522 EINA_SAFETY_ON_NULL_RETURN_VAL(fb, NULL); 522 EINA_SAFETY_ON_NULL_RETURN_VAL(fb, NULL);
523 return fb->gbm_bo; 523 return fb->gbm_bo;
524} 524}
525
526EAPI Ecore_Drm2_Fb *
527ecore_drm2_fb_dmabuf_import(int fd, int width, int height, int depth, int bpp, unsigned int format, unsigned int strides[4], int dmabuf_fd[4], int dmabuf_fd_count)
528{
529 int i;
530 Ecore_Drm2_Fb *fb;
531
532 fb = calloc(1, sizeof(Ecore_Drm2_Fb));
533 if (!fb) return NULL;
534
535 for (i = 0; i < dmabuf_fd_count; i++)
536 if (sym_drmPrimeFDToHandle(fd, dmabuf_fd[i], &fb->handles[i])) goto fail;
537
538 fb->fd = fd;
539 fb->w = width;
540 fb->h = height;
541 fb->bpp = bpp;
542 fb->depth = depth;
543 fb->format = format;
544 memcpy(&fb->strides, strides, sizeof(fb->strides));
545 if (_fb2_create(fb)) return fb;
546
547fail:
548 free(fb);
549 return NULL;
550}