diff options
Diffstat (limited to 'src/gallium')
22 files changed, 59 insertions, 59 deletions
diff --git a/src/gallium/auxiliary/util/u_index_modify.c b/src/gallium/auxiliary/util/u_index_modify.c index 65b079ed53..3822f60e71 100644 --- a/src/gallium/auxiliary/util/u_index_modify.c +++ b/src/gallium/auxiliary/util/u_index_modify.c @@ -52,8 +52,8 @@ void util_shorten_ubyte_elts(struct pipe_context *context, out_map++; } - pipe_buffer_unmap(context, *elts, src_transfer); - pipe_buffer_unmap(context, new_elts, dst_transfer); + pipe_buffer_unmap(context, src_transfer); + pipe_buffer_unmap(context, dst_transfer); *elts = new_elts; } @@ -86,8 +86,8 @@ void util_rebuild_ushort_elts(struct pipe_context *context, out_map++; } - pipe_buffer_unmap(context, *elts, in_transfer); - pipe_buffer_unmap(context, new_elts, out_transfer); + pipe_buffer_unmap(context, in_transfer); + pipe_buffer_unmap(context, out_transfer); *elts = new_elts; } @@ -120,8 +120,8 @@ void util_rebuild_uint_elts(struct pipe_context *context, out_map++; } - pipe_buffer_unmap(context, *elts, in_transfer); - pipe_buffer_unmap(context, new_elts, out_transfer); + pipe_buffer_unmap(context, in_transfer); + pipe_buffer_unmap(context, out_transfer); *elts = new_elts; } diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index e55aafe90f..9184b6aa4d 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -242,7 +242,6 @@ pipe_buffer_map(struct pipe_context *pipe, static INLINE void pipe_buffer_unmap(struct pipe_context *pipe, - struct pipe_resource *buf, struct pipe_transfer *transfer) { if (transfer) { @@ -341,7 +340,7 @@ pipe_buffer_read(struct pipe_context *pipe, if (map) memcpy(data, map + offset, size); - pipe_buffer_unmap(pipe, buf, src_transfer); + pipe_buffer_unmap(pipe, src_transfer); } static INLINE struct pipe_transfer * diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c index af229e61a0..4daa55d663 100644 --- a/src/gallium/auxiliary/util/u_upload_mgr.c +++ b/src/gallium/auxiliary/util/u_upload_mgr.c @@ -108,7 +108,7 @@ my_buffer_write(struct pipe_context *pipe, memcpy(map + offset, data, size); pipe_buffer_flush_mapped_range(pipe, transfer, offset, dirty_size); - pipe_buffer_unmap(pipe, buf, transfer); + pipe_buffer_unmap(pipe, transfer); return PIPE_OK; } @@ -243,7 +243,7 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload, done: if (map) - pipe_buffer_unmap( upload->pipe, inbuf, transfer ); + pipe_buffer_unmap( upload->pipe, transfer ); return ret; } diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h index e7acbe6c3d..8dfb84a596 100644 --- a/src/gallium/drivers/nouveau/nouveau_winsys.h +++ b/src/gallium/drivers/nouveau/nouveau_winsys.h @@ -11,7 +11,7 @@ #include "nouveau/nouveau_notifier.h" #include "nouveau/nouveau_resource.h" #ifndef NOUVEAU_NVC0 -#include "nouveau/nouveau_pushbuf.h" +#include "nouveau/nv04_pushbuf.h" #endif #ifndef NV04_PFIFO_MAX_PACKET_LEN diff --git a/src/gallium/drivers/nv50/nv50_shader_state.c b/src/gallium/drivers/nv50/nv50_shader_state.c index 306aa81d98..1c1b66deb3 100644 --- a/src/gallium/drivers/nv50/nv50_shader_state.c +++ b/src/gallium/drivers/nv50/nv50_shader_state.c @@ -71,7 +71,7 @@ nv50_transfer_constbuf(struct nv50_context *nv50, map += nr; } - pipe_buffer_unmap(pipe, buf, transfer); + pipe_buffer_unmap(pipe, transfer); } static void diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index ce48022db4..a99df76cee 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -22,7 +22,7 @@ #define __NOUVEAU_PUSH_H__ #include <stdint.h> -#include "nouveau/nouveau_pushbuf.h" +#include "nouveau/nv04_pushbuf.h" #include "nv50_context.h" #include "nv50_resource.h" #include "pipe/p_defines.h" diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index d41a59d05d..53f319acf4 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -284,7 +284,7 @@ nv50_draw_elements_inline(struct pipe_context *pipe, nzi = TRUE; } - pipe_buffer_unmap(pipe, indexBuffer, transfer); + pipe_buffer_unmap(pipe, transfer); } static void diff --git a/src/gallium/drivers/nvfx/nv04_2d.c b/src/gallium/drivers/nvfx/nv04_2d.c index e0e65e7a87..e2fadd33e1 100644 --- a/src/gallium/drivers/nvfx/nv04_2d.c +++ b/src/gallium/drivers/nvfx/nv04_2d.c @@ -34,11 +34,11 @@ #include <stdio.h> #include <stdint.h> #include <nouveau/nouveau_device.h> -#include <nouveau/nouveau_pushbuf.h> #include <nouveau/nouveau_channel.h> #include <nouveau/nouveau_bo.h> #include <nouveau/nouveau_notifier.h> #include <nouveau/nouveau_grobj.h> +#include <nouveau/nv04_pushbuf.h> #include "nv04_2d.h" #include "nouveau/nv_object.xml.h" diff --git a/src/gallium/drivers/nvfx/nvfx_vbo.c b/src/gallium/drivers/nvfx/nvfx_vbo.c index 597664e771..339b31786d 100644 --- a/src/gallium/drivers/nvfx/nvfx_vbo.c +++ b/src/gallium/drivers/nvfx/nvfx_vbo.c @@ -9,8 +9,7 @@ #include "nvfx_resource.h" #include "nouveau/nouveau_channel.h" - -#include "nouveau/nouveau_pushbuf.h" +#include "nouveau/nv04_pushbuf.h" static inline unsigned util_guess_unique_indices_count(unsigned mode, unsigned indices) diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 1d26eb9f91..f58d511e11 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -425,7 +425,7 @@ static void r300_emit_draw_arrays_immediate(struct r300_context *r300, if (transfer[vbi]) { vbuf = &r300->vertex_buffer[vbi]; - pipe_buffer_unmap(&r300->context, vbuf->buffer, transfer[vbi]); + pipe_buffer_unmap(&r300->context, transfer[vbi]); transfer[vbi] = NULL; } } @@ -568,7 +568,7 @@ static void r300_draw_range_elements(struct pipe_context* pipe, indexBuffer = userbuf; r300_upload_index_buffer(r300, &indexBuffer, indexSize, 0, count, &new_offset); pipe_resource_reference(&userbuf, NULL); - pipe_buffer_unmap(pipe, indexBuffer, transfer); + pipe_buffer_unmap(pipe, transfer); } else { r300_upload_index_buffer(r300, &indexBuffer, indexSize, start, count, &new_offset); } @@ -770,14 +770,13 @@ static void r300_swtcl_draw_vbo(struct pipe_context* pipe, for (i = 0; i < r300->vertex_buffer_count; i++) { if (r300->vertex_buffer[i].buffer) { - pipe_buffer_unmap(pipe, r300->vertex_buffer[i].buffer, - vb_transfer[i]); + pipe_buffer_unmap(pipe, vb_transfer[i]); draw_set_mapped_vertex_buffer(r300->draw, i, NULL); } } if (indexed) { - pipe_buffer_unmap(pipe, r300->index_buffer.buffer, ib_transfer); + pipe_buffer_unmap(pipe, ib_transfer); draw_set_mapped_index_buffer(r300->draw, NULL); } } @@ -877,7 +876,7 @@ static void r300_render_unmap_vertices(struct vbuf_render* render, r300render->vbo_max_used = MAX2(r300render->vbo_max_used, r300render->vertex_size * (max + 1)); - pipe_buffer_unmap(context, r300->vbo, r300render->vbo_transfer); + pipe_buffer_unmap(context, r300render->vbo_transfer); r300render->vbo_transfer = NULL; } diff --git a/src/gallium/drivers/r300/r300_render_translate.c b/src/gallium/drivers/r300/r300_render_translate.c index 90b2f40be5..26e00a2cad 100644 --- a/src/gallium/drivers/r300/r300_render_translate.c +++ b/src/gallium/drivers/r300/r300_render_translate.c @@ -128,12 +128,11 @@ void r300_begin_vertex_translate(struct r300_context *r300) /* Unmap all buffers. */ for (i = 0; i < r300->vertex_buffer_count; i++) { if (vb_translated[i]) { - pipe_buffer_unmap(pipe, r300->vertex_buffer[i].buffer, - vb_transfer[i]); + pipe_buffer_unmap(pipe, vb_transfer[i]); } } - pipe_buffer_unmap(pipe, out_buffer, out_transfer); + pipe_buffer_unmap(pipe, out_transfer); /* Setup the new vertex buffer in the first free slot. */ for (i = 0; i < PIPE_MAX_ATTRIBS; i++) { diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 07496ebf51..af19beb6f3 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1327,16 +1327,16 @@ void evergreen_vertex_buffer_update(struct r600_pipe_context *rctx) vbuffer_index = rctx->vertex_elements->elements[i].vertex_buffer_index; vertex_buffer = &rctx->vertex_buffer[vbuffer_index]; rbuffer = (struct r600_resource*)vertex_buffer->buffer; - offset = rctx->vertex_elements->vbuffer_offset[i] + - vertex_buffer->buffer_offset + - r600_bo_offset(rbuffer->bo); + offset = rctx->vertex_elements->vbuffer_offset[i]; } else { /* bind vertex buffer once */ vertex_buffer = &rctx->vertex_buffer[i]; rbuffer = (struct r600_resource*)vertex_buffer->buffer; - offset = vertex_buffer->buffer_offset + - r600_bo_offset(rbuffer->bo); + offset = 0; } + if (vertex_buffer == NULL) + continue; + offset += vertex_buffer->buffer_offset + r600_bo_offset(rbuffer->bo); r600_pipe_state_add_reg(rstate, R_030000_RESOURCE0_WORD0, offset, 0xFFFFFFFF, rbuffer->bo); diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index cd5f0792d5..0d76afd6cd 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -167,16 +167,16 @@ void r600_vertex_buffer_update(struct r600_pipe_context *rctx) vbuffer_index = rctx->vertex_elements->elements[i].vertex_buffer_index; vertex_buffer = &rctx->vertex_buffer[vbuffer_index]; rbuffer = (struct r600_resource*)vertex_buffer->buffer; - offset = rctx->vertex_elements->vbuffer_offset[i] + - vertex_buffer->buffer_offset + - r600_bo_offset(rbuffer->bo); + offset = rctx->vertex_elements->vbuffer_offset[i]; } else { /* bind vertex buffer once */ vertex_buffer = &rctx->vertex_buffer[i]; rbuffer = (struct r600_resource*)vertex_buffer->buffer; - offset = vertex_buffer->buffer_offset + - r600_bo_offset(rbuffer->bo); + offset = 0; } + if (vertex_buffer == NULL) + continue; + offset += vertex_buffer->buffer_offset + r600_bo_offset(rbuffer->bo); r600_pipe_state_add_reg(rstate, R_038000_RESOURCE0_WORD0, offset, 0xFFFFFFFF, rbuffer->bo); diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 99b372caac..f488cf74ff 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -179,8 +179,16 @@ void r600_set_vertex_buffers(struct pipe_context *ctx, unsigned count, struct pipe_vertex_buffer *vbo; unsigned max_index = (unsigned)-1; - for (int i = 0; i < rctx->nvertex_buffer; i++) { - pipe_resource_reference(&rctx->vertex_buffer[i].buffer, NULL); + if (rctx->family >= CHIP_CEDAR) { + for (int i = 0; i < rctx->nvertex_buffer; i++) { + pipe_resource_reference(&rctx->vertex_buffer[i].buffer, NULL); + evergreen_fs_resource_set(&rctx->ctx, NULL, i); + } + } else { + for (int i = 0; i < rctx->nvertex_buffer; i++) { + pipe_resource_reference(&rctx->vertex_buffer[i].buffer, NULL); + r600_context_pipe_state_set_fs_resource(&rctx->ctx, NULL, i); + } } memcpy(rctx->vertex_buffer, buffers, sizeof(struct pipe_vertex_buffer) * count); @@ -188,6 +196,8 @@ void r600_set_vertex_buffers(struct pipe_context *ctx, unsigned count, vbo = (struct pipe_vertex_buffer*)&buffers[i]; rctx->vertex_buffer[i].buffer = NULL; + if (buffers[i].buffer == NULL) + continue; if (r600_buffer_is_user_buffer(buffers[i].buffer)) rctx->any_user_vbs = TRUE; pipe_resource_reference(&rctx->vertex_buffer[i].buffer, buffers[i].buffer); diff --git a/src/gallium/drivers/r600/r600_translate.c b/src/gallium/drivers/r600/r600_translate.c index ba12eee2b5..f80fa7af94 100644 --- a/src/gallium/drivers/r600/r600_translate.c +++ b/src/gallium/drivers/r600/r600_translate.c @@ -125,12 +125,11 @@ void r600_begin_vertex_translate(struct r600_pipe_context *rctx) /* Unmap all buffers. */ for (i = 0; i < rctx->nvertex_buffer; i++) { if (vb_translated[i]) { - pipe_buffer_unmap(pipe, rctx->vertex_buffer[i].buffer, - vb_transfer[i]); + pipe_buffer_unmap(pipe, vb_transfer[i]); } } - pipe_buffer_unmap(pipe, out_buffer, out_transfer); + pipe_buffer_unmap(pipe, out_transfer); /* Setup the new vertex buffer in the first free slot. */ for (i = 0; i < PIPE_MAX_ATTRIBS; i++) { diff --git a/src/gallium/drivers/svga/svga_draw_arrays.c b/src/gallium/drivers/svga/svga_draw_arrays.c index da33fae62f..be0e7abe21 100644 --- a/src/gallium/drivers/svga/svga_draw_arrays.c +++ b/src/gallium/drivers/svga/svga_draw_arrays.c @@ -65,14 +65,14 @@ static enum pipe_error generate_indices( struct svga_hwtnl *hwtnl, generate( nr, dst_map ); - pipe_buffer_unmap( pipe, dst, transfer ); + pipe_buffer_unmap( pipe, transfer ); *out_buf = dst; return PIPE_OK; fail: if (dst_map) - pipe_buffer_unmap( pipe, dst, transfer ); + pipe_buffer_unmap( pipe, transfer ); if (dst) pipe->screen->resource_destroy( pipe->screen, dst ); diff --git a/src/gallium/drivers/svga/svga_draw_elements.c b/src/gallium/drivers/svga/svga_draw_elements.c index c4579177b7..c7ea014bba 100644 --- a/src/gallium/drivers/svga/svga_draw_elements.c +++ b/src/gallium/drivers/svga/svga_draw_elements.c @@ -72,18 +72,18 @@ translate_indices( struct svga_hwtnl *hwtnl, nr, dst_map ); - pipe_buffer_unmap( pipe, src, src_transfer ); - pipe_buffer_unmap( pipe, dst, dst_transfer ); + pipe_buffer_unmap( pipe, src_transfer ); + pipe_buffer_unmap( pipe, dst_transfer ); *out_buf = dst; return PIPE_OK; fail: if (src_map) - pipe_buffer_unmap( pipe, src, src_transfer ); + pipe_buffer_unmap( pipe, src_transfer ); if (dst_map) - pipe_buffer_unmap( pipe, dst, dst_transfer ); + pipe_buffer_unmap( pipe, dst_transfer ); if (dst) pipe->screen->resource_destroy( pipe->screen, dst ); diff --git a/src/gallium/drivers/svga/svga_state_constants.c b/src/gallium/drivers/svga/svga_state_constants.c index 97c818cd37..daf1024fd0 100644 --- a/src/gallium/drivers/svga/svga_state_constants.c +++ b/src/gallium/drivers/svga/svga_state_constants.c @@ -110,7 +110,7 @@ static int emit_consts( struct svga_context *svga, done: if (data) - pipe_buffer_unmap(&svga->pipe, svga->curr.cb[unit], transfer); + pipe_buffer_unmap(&svga->pipe, transfer); return ret; } diff --git a/src/gallium/drivers/svga/svga_state_vs.c b/src/gallium/drivers/svga/svga_state_vs.c index 5133c70593..6682a1efe6 100644 --- a/src/gallium/drivers/svga/svga_state_vs.c +++ b/src/gallium/drivers/svga/svga_state_vs.c @@ -233,9 +233,7 @@ static int update_zero_stride( struct svga_context *svga, translate->run(translate, 0, 1, 0, svga->curr.zero_stride_constants); - pipe_buffer_unmap(&svga->pipe, - vbuffer->buffer, - transfer); + pipe_buffer_unmap(&svga->pipe, transfer); translate->release(translate); } diff --git a/src/gallium/drivers/svga/svga_swtnl_backend.c b/src/gallium/drivers/svga/svga_swtnl_backend.c index ff3da84272..24646b48f6 100644 --- a/src/gallium/drivers/svga/svga_swtnl_backend.c +++ b/src/gallium/drivers/svga/svga_swtnl_backend.c @@ -141,7 +141,7 @@ svga_vbuf_render_unmap_vertices( struct vbuf_render *render, pipe_buffer_flush_mapped_range(&svga->pipe, svga_render->vbuf_transfer, offset, length); - pipe_buffer_unmap(&svga->pipe, svga_render->vbuf, svga_render->vbuf_transfer); + pipe_buffer_unmap(&svga->pipe, svga_render->vbuf_transfer); svga_render->min_index = min_index; svga_render->max_index = max_index; svga_render->vbuf_used = MAX2(svga_render->vbuf_used, used); diff --git a/src/gallium/drivers/svga/svga_swtnl_draw.c b/src/gallium/drivers/svga/svga_swtnl_draw.c index 814e8edd70..d903984581 100644 --- a/src/gallium/drivers/svga/svga_swtnl_draw.c +++ b/src/gallium/drivers/svga/svga_swtnl_draw.c @@ -106,20 +106,17 @@ svga_swtnl_draw_vbo(struct svga_context *svga, * unmap vertex/index buffers */ for (i = 0; i < svga->curr.num_vertex_buffers; i++) { - pipe_buffer_unmap(&svga->pipe, svga->curr.vb[i].buffer, - vb_transfer[i]); + pipe_buffer_unmap(&svga->pipe, vb_transfer[i]); draw_set_mapped_vertex_buffer(draw, i, NULL); } if (ib_transfer) { - pipe_buffer_unmap(&svga->pipe, svga->curr.ib.buffer, ib_transfer); + pipe_buffer_unmap(&svga->pipe, ib_transfer); draw_set_mapped_index_buffer(draw, NULL); } if (svga->curr.cb[PIPE_SHADER_VERTEX]) { - pipe_buffer_unmap(&svga->pipe, - svga->curr.cb[PIPE_SHADER_VERTEX], - cb_transfer); + pipe_buffer_unmap(&svga->pipe, cb_transfer); } return ret; diff --git a/src/gallium/state_trackers/python/p_context.i b/src/gallium/state_trackers/python/p_context.i index 5bdeaa8e4e..d694651eef 100644 --- a/src/gallium/state_trackers/python/p_context.i +++ b/src/gallium/state_trackers/python/p_context.i @@ -360,7 +360,7 @@ struct st_context { if (!map) goto error2; memcpy(map, vertices, size); - pipe_buffer_unmap(pipe, vbuf, transfer); + pipe_buffer_unmap(pipe, transfer); cso_save_vertex_elements($self->cso); |