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 <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <stdbool.h> #include <stdbool.h>
#include <epoxy/egl.h> #include <epoxy/egl.h>
#include <gbm.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); image = eglCreateImageKHR(ve->egl_display, eglGetCurrentContext(), EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer)(unsigned long)tex_id, NULL);
if (!image) if (!image)
return -1; return EINVAL;
if (ve->have_mesa_dma_buf_img_export) { if (ve->have_mesa_dma_buf_img_export) {
#ifdef EGL_MESA_image_dma_buf_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, fd,
&stride); &stride);
#else #else
return -1; return EINVAL;
#endif #endif
} else { } else {
#ifdef EGL_MESA_drm_image #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); &stride);
if (!b) if (!b)
return -1; return EINVAL;
fprintf(stderr,"image exported %d %d\n", handle, stride); fprintf(stderr,"image exported %d %d\n", handle, stride);
r = drmPrimeHandleToFD(ve->fd, handle, DRM_CLOEXEC, fd); r = drmPrimeHandleToFD(ve->fd, handle, DRM_CLOEXEC, fd);
if (r < 0) if (r < 0)
return -1; return EINVAL;
#else #else
return -1; return EINVAL;
#endif #endif
} }
return 0; 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); res = vrend_resource_lookup(res_handle, 0);
if (!res) if (!res)
return -1; return EINVAL;
/* work out size and max resource size */ /* work out size and max resource size */
res->iov = iov; 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)); fence = malloc(sizeof(struct vrend_fence));
if (!fence) if (!fence)
return -1; return ENOMEM;
fence->ctx_id = ctx_id; fence->ctx_id = ctx_id;
fence->fence_id = client_fence_id; fence->fence_id = client_fence_id;

Loading…
Cancel
Save