From 6efd01a304e323b57b57ea1a83f23bcb37de5acc Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sun, 29 May 2016 10:18:49 +0000 Subject: Import Mesa 11.2.2 --- lib/mesa/src/gallium/auxiliary/util/u_prim_restart.h | 9 ++++++--- lib/mesa/src/gallium/auxiliary/vl/vl_winsys_drm.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'lib/mesa') diff --git a/lib/mesa/src/gallium/auxiliary/util/u_prim_restart.h b/lib/mesa/src/gallium/auxiliary/util/u_prim_restart.h index 0e17ce5eb..1e98e0e1b 100644 --- a/lib/mesa/src/gallium/auxiliary/util/u_prim_restart.h +++ b/lib/mesa/src/gallium/auxiliary/util/u_prim_restart.h @@ -38,17 +38,20 @@ extern "C" { struct pipe_context; struct pipe_draw_info; -union pipe_index_binding; +struct pipe_index_buffer; struct pipe_resource; enum pipe_error util_translate_prim_restart_ib(struct pipe_context *context, - const struct pipe_draw_info *info, - struct pipe_resource **dst_buffer); + struct pipe_index_buffer *src_buffer, + struct pipe_resource **dst_buffer, + unsigned num_indexes, + unsigned restart_index); enum pipe_error util_draw_vbo_without_prim_restart(struct pipe_context *context, + const struct pipe_index_buffer *ib, const struct pipe_draw_info *info); diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_winsys_drm.c b/lib/mesa/src/gallium/auxiliary/vl/vl_winsys_drm.c index ebde5b8cb..6d9d94758 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_winsys_drm.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_winsys_drm.c @@ -26,7 +26,6 @@ **************************************************************************/ #include -#include #include "pipe/p_screen.h" #include "pipe-loader/pipe_loader.h" @@ -42,20 +41,20 @@ struct vl_screen * vl_drm_screen_create(int fd) { struct vl_screen *vscreen; - int new_fd; + int new_fd = -1; vscreen = CALLOC_STRUCT(vl_screen); if (!vscreen) return NULL; - if (fd < 0 || (new_fd = fcntl(fd, F_DUPFD_CLOEXEC, 3)) < 0) - goto free_screen; + if (fd < 0 || (new_fd = dup(fd)) < 0) + goto error; if (pipe_loader_drm_probe_fd(&vscreen->dev, new_fd)) - vscreen->pscreen = pipe_loader_create_screen(vscreen->dev, 0); + vscreen->pscreen = pipe_loader_create_screen(vscreen->dev); if (!vscreen->pscreen) - goto release_pipe; + goto error; vscreen->destroy = vl_drm_screen_destroy; vscreen->texture_from_drawable = NULL; @@ -65,13 +64,12 @@ vl_drm_screen_create(int fd) vscreen->get_private = NULL; return vscreen; -release_pipe: +error: if (vscreen->dev) pipe_loader_release(&vscreen->dev, 1); else close(new_fd); -free_screen: FREE(vscreen); return NULL; } -- cgit v1.2.3