[Mesa-dev] [PATCH 07/12] r600g: don't call buffer_wait in buffer_mmap_sync_with_rings
Marek Olšák
maraeo at gmail.com
Fri Jul 12 17:40:14 PDT 2013
This should fix it:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=06b38dbab287026625de302e80e9806db206c43e
Marek
On Thu, Jul 11, 2013 at 10:15 PM, Vadim Girlin <vadimgirlin at gmail.com> wrote:
> On 07/01/2013 05:53 AM, Marek Olšák wrote:
>>
>> The winsys should do this, because it measures how much time we spend
>> in buffer_map doing synchronization, which can be viewed with the gallium
>> HUD.
>> ---
>> src/gallium/drivers/r600/r600_pipe.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/drivers/r600/r600_pipe.c
>> b/src/gallium/drivers/r600/r600_pipe.c
>> index c9f4607..8b67e85 100644
>> --- a/src/gallium/drivers/r600/r600_pipe.c
>> +++ b/src/gallium/drivers/r600/r600_pipe.c
>> @@ -292,10 +292,9 @@ void *r600_buffer_mmap_sync_with_rings(struct
>> r600_context *ctx,
>> ctx->ws->cs_sync_flush(ctx->rings.dma.cs);
>> }
>> }
>> - ctx->ws->buffer_wait(resource->buf, rusage);
>>
>> /* at this point everything is synchronized */
>> - return ctx->ws->buffer_map(resource->cs_buf, NULL, usage |
>> PIPE_TRANSFER_UNSYNCHRONIZED);
>> + return ctx->ws->buffer_map(resource->cs_buf, NULL, usage);
>> }
>>
>> static void r600_flush_from_winsys(void *ctx, unsigned flags)
>>
>
> This patch (commit 862f69fbe1e54e0e9a3c439450a14f0319648b60) causes segfault
> with CoreBreach on startup:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007fffed96d13e in radeon_bo_is_referenced_by_cs_for_write (cs=0x0,
> bo=0x21a7cf0) at radeon_drm_cs.h:110
> 110 index = radeon_get_reloc(cs->csc, bo);
>
> #0 0x00007fffed96d13e in radeon_bo_is_referenced_by_cs_for_write (cs=0x0,
> bo=0x21a7cf0) at radeon_drm_cs.h:110
> index = 0
> #1 0x00007fffed96e05a in radeon_bo_map (buf=0x21a7cf0, rcs=0x0,
> usage=PIPE_TRANSFER_READ) at radeon_drm_bo.c:492
> time = 14332823331767
> bo = 0x21a7cf0
> cs = 0x0
> #2 0x00007fffed8c8aed in r600_buffer_mmap_sync_with_rings (ctx=0x129cf30,
> resource=0x21a65c0, usage=1) at r600_pipe.c:303
> rusage = RADEON_USAGE_WRITE
> flags = 0
> sync_flush = true
> #3 0x00007fffed8c4919 in r600_buffer_transfer_map (ctx=0x129cf30,
> resource=0x21a65c0, level=0, usage=1, box=0x7fffffffce10,
> ptransfer=0x7fffffffce78) at r600_buffer.c:179
> rctx = 0x129cf30
> rbuffer = 0x21a65c0
> data = 0x300001000 <Address 0x300001000 out of bounds>
> __func__ = "r600_buffer_transfer_map"
> #4 0x00007fffed8006a8 in u_transfer_map_vtbl (context=0x129cf30,
> resource=0x21a65c0, level=0, usage=1, box=0x7fffffffce10,
> transfer=0x7fffffffce78) at util/u_transfer.c:122
> ur = 0x21a65c0
> #5 0x00007fffed801a3d in pipe_buffer_map_range (pipe=0x129cf30,
> buffer=0x21a65c0, offset=24, length=12, usage=1, transfer=0x7fffffffce78) at
> ./util/u_inlines.h:267
> box = {x = 24, y = 0, z = 0, width = 12, height = 1, depth = 1}
> map = 0x7fffed8f79fd <r600_bind_ps_sampler_states+53>
> __func__ = "pipe_buffer_map_range"
> #6 0x00007fffed80425b in u_vbuf_get_minmax_index (pipe=0x129cf30,
> ib=0x17e0c60, info=0x7fffffffcfd0, out_min_index=0x7fffffffcf3c,
> out_max_index=0x7fffffffcf38) at util/u_vbuf.c:1029
> transfer = 0x0
> indices = 0x17e0610
> i = 0
> restart_index = 0
> __func__ = "u_vbuf_get_minmax_index"
> #7 0x00007fffed80484b in u_vbuf_draw_vbo (mgr=0x17e0610,
> info=0x7fffffffcfd0) at util/u_vbuf.c:1159
> max_index = 25376656
> pipe = 0x129cf30
> start_vertex = 4
> min_index = 0
> num_vertices = 3982917512
> unroll_indices = 0 '\000'
> used_vb_mask = 3
> user_vb_mask = 0
> incompatible_vb_mask = 1
> __func__ = "u_vbuf_draw_vbo"
> #8 0x00007fffed753359 in cso_draw_vbo (cso=0x1833790, info=0x7fffffffcfd0)
> at cso_cache/cso_context.c:1410
> vbuf = 0x17e0610
> #9 0x00007fffed6684e5 in st_draw_vbo (ctx=0x1a1d800, prims=0x7fffffffd100,
> nr_prims=1, ib=0x7fffffffd120, index_bounds_valid=0 '\000',
> min_index=4294967295, max_index=4294967295, tfb_vertcount=0x0)
> at ../../src/mesa/state_tracker/st_draw.c:286
> st = 0x17be390
> ibuffer = {index_size = 2, offset = 24, buffer = 0x21a65c0,
> user_buffer = 0x0}
> info = {indexed = 1 '\001', mode = 4, start = 0, count = 6,
> start_instance = 0, instance_count = 1, index_bias = 0, min_index = 0,
> max_index = 4294967295, primitive_restart = 0 '\000', restart_index = 0,
> count_from_stream_output = 0x0}
> arrays = 0x1af5df8
> i = 0
> __func__ = "st_draw_vbo"
> #10 0x00007fffed62595f in vbo_handle_primitive_restart (ctx=0x1a1d800,
> prim=0x7fffffffd100, nr_prims=1, ib=0x7fffffffd120, index_bounds_valid=0
> '\000', min_index=4294967295, max_index=4294967295) at
> ../../src/mesa/vbo/vbo_exec_array.c:549
> vbo = 0x1af2900
> #11 0x00007fffed626894 in vbo_validated_drawrangeelements (ctx=0x1a1d800,
> mode=4, index_bounds_valid=0 '\000', start=4294967295, end=4294967295,
> count=6, type=5123, indices=0x18, basevertex=0, numInstances=1,
> baseInstance=0)
> at ../../src/mesa/vbo/vbo_exec_array.c:968
> vbo = 0x1af2900
> exec = 0x1af3548
> ib = {count = 6, type = 5123, obj = 0x2201450, ptr = 0x18}
> prim = {{mode = 4, indexed = 1, begin = 1, end = 1, weak = 0,
> no_current_update = 1, pad = 0, start = 0, count = 6, basevertex = 0,
> num_instances = 1, base_instance = 0}}
> #12 0x00007fffed626ce4 in vbo_exec_DrawElements (mode=4, count=6, type=5123,
> indices=0x18) at ../../src/mesa/vbo/vbo_exec_array.c:1118
> ctx = 0x1a1d800
> #13 0x00007ffff6a6c336 in glDrawElements (mode=4, count=6, type=5123,
> indices=0x18) at ../../../src/mapi/glapi/glapi_mapi_tmp.h:3600
> _tbl = 0x1a33ec0
> _func = 0x7fffed626bdc <vbo_exec_DrawElements>
> #14 0x0000000000498b67 in -[Skybox renderNode] ()
> No symbol table info available.
> #15 0x000000000047f565 in -[SceneNode render] ()
> No symbol table info available.
>
More information about the mesa-dev
mailing list