<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 28, 2017 at 9:25 AM, Chris Wilson <span dir="ltr"><<a href="mailto:chris@chris-wilson.co.uk" target="_blank">chris@chris-wilson.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Feb 28, 2017 at 08:56:47AM -0800, Jason Ekstrand wrote:<br>
> ---<br>
> src/intel/vulkan/anv_batch_<wbr>chain.c | 91 ++++++++++++++++++++++++++++++<wbr>++++++--<br>
> src/intel/vulkan/anv_device.c | 26 +++++++++++<br>
> src/intel/vulkan/anv_gem.c | 36 +++++++++++++++<br>
> src/intel/vulkan/anv_private.h | 9 +++-<br>
> src/intel/vulkan/anv_queue.c | 68 +++++++++++++++++++++++++---<br>
> 5 files changed, 220 insertions(+), 10 deletions(-)<br>
><br>
> diff --git a/src/intel/vulkan/anv_batch_<wbr>chain.c b/src/intel/vulkan/anv_batch_<wbr>chain.c<br>
> index 3640588..004594a 100644<br>
> --- a/src/intel/vulkan/anv_batch_<wbr>chain.c<br>
> +++ b/src/intel/vulkan/anv_batch_<wbr>chain.c<br>
> @@ -1352,6 +1352,28 @@ setup_execbuf_for_cmd_buffer(<wbr>struct anv_execbuf *execbuf,<br>
> }<br>
> }<br>
><br>
> +static void<br>
> +setup_empty_execbuf(struct anv_execbuf *execbuf, struct anv_device *device)<br>
> +{<br>
> + anv_execbuf_add_bo(execbuf, &device->trivial_batch_bo, NULL, 0,<br>
> + &device->alloc);<br>
> +<br>
> + execbuf->execbuf = (struct drm_i915_gem_execbuffer2) {<br>
<br>
</span>Does mesa check for gcc > 4.4?<br></blockquote><div><br></div><div>We use designated initializers all over the place. This won't be the first thing to not compile on old gcc.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> + .buffers_ptr = (uintptr_t) execbuf->objects,<br>
> + .buffer_count = execbuf->bo_count,<br>
> + .batch_start_offset = 0,<br>
> + .batch_len = 8, /* GEN8_MI_BATCH_BUFFER_END and NOOP */<br>
<br>
> + .cliprects_ptr = 0,<br>
> + .num_cliprects = 0,<br>
> + .DR1 = 0,<br>
> + .DR4 = 0,<br>
<br>
</span>Best left to the compiler to clear, and don't mention DRI1 leftovers.<span class=""><br></span></blockquote><div><br></div><div>Fair enough. I can do a pre-patch or a follow-on to get rid of those.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> + .flags = I915_EXEC_HANDLE_LUT | I915_EXEC_RENDER |<br>
> + I915_EXEC_CONSTANTS_REL_<wbr>GENERAL,<br>
<br>
</span>Just drop EXEC_CONSTANTS; it is entirely dead and best forgotten.<span class=""><br></span></blockquote><div><br></div><div>Yeah...<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> + .rsvd1 = device->context_id,<br>
> + .rsvd2 = 0,<br>
> + };<br>
> +}<br>
<br>
<br>
</span><span class="">> VkResult<br>
> anv_cmd_buffer_execbuf(struct anv_device *device,<br>
> struct anv_cmd_buffer *cmd_buffer,<br>
<br>
</span><span class="">> + if (need_out_fence)<br>
> + execbuf.execbuf.flags |= I915_EXEC_FENCE_OUT;<br>
><br>
> VkResult result = anv_device_execbuf(device, &execbuf.execbuf, execbuf.bos);<br>
><br>
> + if (need_out_fence) {<br>
> + int out_fence = execbuf.execbuf.rsvd2 >> 32;<br>
> + for (uint32_t i = 0; i < num_out_semaphores; i++) {<br>
> + ANV_FROM_HANDLE(anv_semaphore, semaphore, out_semaphores[i]);<br>
> + /* Out fences can't have temporary state because that would imply<br>
> + * that we imported a sync file and are trying to signal it.<br>
> + */<br>
> + assert(semaphore->temporary.<wbr>type == ANV_SEMAPHORE_TYPE_NONE);<br>
> + struct anv_semaphore_impl *impl = &semaphore->permanent;<br>
> +<br>
> + if (impl->type == ANV_SEMAPHORE_TYPE_SYNC_FILE) {<br>
> + assert(impl->fd == -1);<br>
> + impl->fd = dup(out_fence);<br>
<br>
</span>out_fence will still be zero/stdin if anv_device_execbuf() failed.<br></blockquote><div><br></div><div> Good catch! Best not to close stdin.<br></div></div><br></div></div>