renderer: consolidate on errno return values

macos/master
Dave Airlie 10 years ago
parent 14b6e99bb1
commit d30144b6aa
  1. 11
      src/virgl_egl_context.c
  2. 4
      src/vrend_renderer.c

@ -33,6 +33,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <stdbool.h>
#include <epoxy/egl.h>
#include <gbm.h>
@ -266,7 +267,7 @@ int virgl_egl_get_fd_for_texture(struct virgl_egl *ve, uint32_t tex_id, int *fd)
image = eglCreateImageKHR(ve->egl_display, eglGetCurrentContext(), EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer)(unsigned long)tex_id, NULL);
if (!image)
return -1;
return EINVAL;
if (ve->have_mesa_dma_buf_img_export) {
#ifdef EGL_MESA_image_dma_buf_export
@ -275,7 +276,7 @@ int virgl_egl_get_fd_for_texture(struct virgl_egl *ve, uint32_t tex_id, int *fd)
fd,
&stride);
#else
return -1;
return EINVAL;
#endif
} else {
#ifdef EGL_MESA_drm_image
@ -287,15 +288,15 @@ int virgl_egl_get_fd_for_texture(struct virgl_egl *ve, uint32_t tex_id, int *fd)
&stride);
if (!b)
return -1;
return EINVAL;
fprintf(stderr,"image exported %d %d\n", handle, stride);
r = drmPrimeHandleToFD(ve->fd, handle, DRM_CLOEXEC, fd);
if (r < 0)
return -1;
return EINVAL;
#else
return -1;
return EINVAL;
#endif
}
return 0;

@ -3290,7 +3290,7 @@ int vrend_renderer_resource_attach_iov(int res_handle, struct iovec *iov,
res = vrend_resource_lookup(res_handle, 0);
if (!res)
return -1;
return EINVAL;
/* work out size and max resource size */
res->iov = iov;
@ -4656,7 +4656,7 @@ int vrend_renderer_create_fence(int client_fence_id, uint32_t ctx_id)
fence = malloc(sizeof(struct vrend_fence));
if (!fence)
return -1;
return ENOMEM;
fence->ctx_id = ctx_id;
fence->fence_id = client_fence_id;

Loading…
Cancel
Save