static enum virgl_resource_fd_type vrend_pipe_resource_export_fd(UNUSED struct pipe_resource *pres,
                                                                 UNUSED int *fd,
                                                                 UNUSED void *data)
{
#ifdef ENABLE_MINIGBM_ALLOCATION
   struct vrend_resource *res = (struct vrend_resource *)pres;

   if (res->storage_bits & VREND_STORAGE_GBM_BUFFER) {
      int ret = virgl_gbm_export_fd(gbm->device,
                                    gbm_bo_get_handle(res->gbm_bo).u32, fd);
      if (!ret)
         return VIRGL_RESOURCE_FD_DMABUF;
   }
#endif

   return VIRGL_RESOURCE_FD_INVALID;
}
static enum virgl_resource_fd_type vrend_pipe_resource_export_fd(UNUSED struct pipe_resource *pres,
                                                                 UNUSED int *fd,
                                                                 UNUSED void *data)
{
#ifdef ENABLE_MINIGBM_ALLOCATION
   struct vrend_resource *res = (struct vrend_resource *)pres;

   if (res->storage_bits & VREND_STORAGE_GBM_BUFFER) {
      int ret = virgl_gbm_export_fd(gbm->device,
                                    gbm_bo_get_handle(res->gbm_bo).u32, fd);
      if (!ret)
         return VIRGL_RESOURCE_FD_DMABUF;
   }
#endif

   return VIRGL_RESOURCE_FD_INVALID;
}