<div dir="ltr"><div>Pushed, thanks!</div><div><br></div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2019 at 7:33 AM Guido Günther <<a href="mailto:agx@sigxcpu.org">agx@sigxcpu.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
On Fri, Mar 29, 2019 at 05:48:31PM +0100, Guido Günther wrote:<br>
> Without that kmscube with GALLIUM_TRACE would segfault like:<br>
> <br>
> #0 0x0000000000000000 in ()<br>
> #1 0x0000ffff8f311760 in dri2_create_fence_fd (_ctx=0xaaaae266b8b0, fd=10) at ../src/gallium/state_trackers/dri/dri_helpers.c:122<br>
> #2 0x0000ffff90788670 in dri2_create_sync (drv=0xaaaae2667910, disp=0xaaaae26691f0, type=12612, attrib_list=0xaaaae26b9290) at ../src/egl/drivers/dri2/egl_dri2.c:2993<br>
> #3 0x0000ffff90776a9c in _eglCreateSync (disp=0xaaaae26691f0, type=12612, attrib_list=0xaaaae26b9290, orig_is_EGLAttrib=0, invalid_type_error=12292) at ../src/egl/main/eglapi.c:1823<br>
> #4 0x0000ffff90776be4 in eglCreateSyncKHR (dpy=0xaaaae26691f0, type=12612, int_list=0xfffff662e828) at ../src/egl/main/eglapi.c:1848<br>
> <br>
> Signed-off-by: Guido Günther <<a href="mailto:agx@sigxcpu.org" target="_blank">agx@sigxcpu.org</a>><br>
<br>
These are similar to the already applied (thanks Lucas!) GALLIUM_DDEBUG<br>
fixes:<br>
<br>
<a href="https://lists.freedesktop.org/archives/mesa-dev/2019-April/217422.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/archives/mesa-dev/2019-April/217422.html</a><br>
<br>
but for GALLIUM_TRACE - just in case they looked to similar when flying<br>
by.<br>
Cheers,<br>
-- Guido<br>
<br>
> ---<br>
> .../auxiliary/driver_trace/tr_context.c | 44 +++++++++++++++++++<br>
> .../auxiliary/driver_trace/tr_screen.c | 24 ++++++++++<br>
> 2 files changed, 68 insertions(+)<br>
> <br>
> diff --git a/src/gallium/auxiliary/driver_trace/tr_context.c b/src/gallium/auxiliary/driver_trace/tr_context.c<br>
> index 7859a3395ca..9f3926a32a4 100644<br>
> --- a/src/gallium/auxiliary/driver_trace/tr_context.c<br>
> +++ b/src/gallium/auxiliary/driver_trace/tr_context.c<br>
> @@ -1314,6 +1314,48 @@ trace_context_flush(struct pipe_context *_pipe,<br>
> }<br>
> <br>
> <br>
> +static void<br>
> +trace_context_create_fence_fd(struct pipe_context *_pipe,<br>
> + struct pipe_fence_handle **fence,<br>
> + int fd,<br>
> + enum pipe_fd_type type)<br>
> +{<br>
> + struct trace_context *tr_ctx = trace_context(_pipe);<br>
> + struct pipe_context *pipe = tr_ctx->pipe;<br>
> +<br>
> + trace_dump_call_begin("pipe_context", "create_fence_fd");<br>
> +<br>
> + trace_dump_arg(ptr, pipe);<br>
> + trace_dump_arg(int, fd);<br>
> + trace_dump_arg(uint, type);<br>
> +<br>
> + pipe->create_fence_fd(pipe, fence, fd, type);<br>
> +<br>
> + if (fence)<br>
> + trace_dump_ret(ptr, *fence);<br>
> +<br>
> + trace_dump_call_end();<br>
> +}<br>
> +<br>
> +<br>
> +static void<br>
> +trace_context_fence_server_sync(struct pipe_context *_pipe,<br>
> + struct pipe_fence_handle *fence)<br>
> +{<br>
> + struct trace_context *tr_ctx = trace_context(_pipe);<br>
> + struct pipe_context *pipe = tr_ctx->pipe;<br>
> +<br>
> + trace_dump_call_begin("pipe_context", "fence_server_sync");<br>
> +<br>
> + trace_dump_arg(ptr, pipe);<br>
> + trace_dump_arg(ptr, fence);<br>
> +<br>
> + pipe->fence_server_sync(pipe, fence);<br>
> +<br>
> + trace_dump_call_end();<br>
> +}<br>
> +<br>
> +<br>
> static inline boolean<br>
> trace_context_generate_mipmap(struct pipe_context *_pipe,<br>
> struct pipe_resource *res,<br>
> @@ -1946,6 +1988,8 @@ trace_context_create(struct trace_screen *tr_scr,<br>
> TR_CTX_INIT(clear_depth_stencil);<br>
> TR_CTX_INIT(clear_texture);<br>
> TR_CTX_INIT(flush);<br>
> + TR_CTX_INIT(create_fence_fd);<br>
> + TR_CTX_INIT(fence_server_sync);<br>
> TR_CTX_INIT(generate_mipmap);<br>
> TR_CTX_INIT(texture_barrier);<br>
> TR_CTX_INIT(memory_barrier);<br>
> diff --git a/src/gallium/auxiliary/driver_trace/tr_screen.c b/src/gallium/auxiliary/driver_trace/tr_screen.c<br>
> index b5bd3e11c46..e42aef63552 100644<br>
> --- a/src/gallium/auxiliary/driver_trace/tr_screen.c<br>
> +++ b/src/gallium/auxiliary/driver_trace/tr_screen.c<br>
> @@ -495,6 +495,29 @@ trace_screen_fence_reference(struct pipe_screen *_screen,<br>
> }<br>
> <br>
> <br>
> +static int<br>
> +trace_screen_fence_get_fd(struct pipe_screen *_screen,<br>
> + struct pipe_fence_handle *fence)<br>
> +{<br>
> + struct trace_screen *tr_scr = trace_screen(_screen);<br>
> + struct pipe_screen *screen = tr_scr->screen;<br>
> + int result;<br>
> +<br>
> + trace_dump_call_begin("pipe_screen", "fence_get_fd");<br>
> +<br>
> + trace_dump_arg(ptr, screen);<br>
> + trace_dump_arg(ptr, fence);<br>
> +<br>
> + result = screen->fence_get_fd(screen, fence);<br>
> +<br>
> + trace_dump_ret(int, result);<br>
> +<br>
> + trace_dump_call_end();<br>
> +<br>
> + return result;<br>
> +}<br>
> +<br>
> +<br>
> static boolean<br>
> trace_screen_fence_finish(struct pipe_screen *_screen,<br>
> struct pipe_context *_ctx,<br>
> @@ -654,6 +677,7 @@ trace_screen_create(struct pipe_screen *screen)<br>
> SCR_INIT(resource_changed);<br>
> tr_scr->base.resource_destroy = trace_screen_resource_destroy;<br>
> tr_scr->base.fence_reference = trace_screen_fence_reference;<br>
> + SCR_INIT(fence_get_fd);<br>
> tr_scr->base.fence_finish = trace_screen_fence_finish;<br>
> SCR_INIT(memobj_create_from_handle);<br>
> SCR_INIT(memobj_destroy);<br>
> -- <br>
> 2.20.1<br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div>