-+ struct gbm_import_fd_data gbm_dmabuf = {
-+ .fd = dmabuf->attributes.fd[0],
-+ .width = dmabuf->attributes.width,
-+ .height = dmabuf->attributes.height,
-+ .stride = dmabuf->attributes.stride[0],
-+ .format = dmabuf->attributes.format
-+ };
-+
-+ bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_FD,
-+ &gbm_dmabuf, GBM_BO_USE_SCANOUT);
-+ if (!bo) {
-+ weston_log("failed to get gbm_bo\n");
-+ return -1;
-+ }
-+
-+ current = zalloc(sizeof *current);
-+ current->handle = gbm_bo_get_handle(bo).s32;
-+ if (!current->handle) {
-+ fprintf(stderr, "failed to get drm_handle\n");
++ current = drm_fb_get_from_dmabuf(dmabuf, b, is_opaque);
++ if (!current)
++ {
++ fprintf(stderr, "failed to get drm_fb from dmabuf\n");