<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On 26 Jul. 2017 17:25, "Bas Nieuwenhuizen" <<a href="mailto:bas@basnieuwenhuizen.nl">bas@basnieuwenhuizen.nl</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">On Wed, Jul 26, 2017 at 4:29 AM, Dave Airlie <<a href="mailto:airlied@gmail.com">airlied@gmail.com</a>> wrote:<br>
> From: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>><br>
><br>
> We were adding pad to size after creating the object, so we could<br>
> submit a CS bigger than the bo created for it.<br>
<br>
</div>So while this is indeed pedantically more correct, I wonder what would<br>
trigger it, since bo size is always a 4096 multiple, and the padding<br>
shouldn't cross between 32 byte blocks.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">It at least broke intercept :-) which was what motivated me to fix it.</div><div dir="auto"><br></div><div dir="auto">Dave.</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="elided-text"><br>
><br>
> Signed-off-by: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>><br>
> ---<br>
>  src/amd/vulkan/winsys/amdgpu/<wbr>radv_amdgpu_cs.c | 10 ++++++----<br>
>  1 file changed, 6 insertions(+), 4 deletions(-)<br>
><br>
> diff --git a/src/amd/vulkan/winsys/<wbr>amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/<wbr>amdgpu/radv_amdgpu_cs.c<br>
> index 0d89b95..ad4b0b3 100644<br>
> --- a/src/amd/vulkan/winsys/<wbr>amdgpu/radv_amdgpu_cs.c<br>
> +++ b/src/amd/vulkan/winsys/<wbr>amdgpu/radv_amdgpu_cs.c<br>
> @@ -841,7 +841,7 @@ static int radv_amdgpu_winsys_cs_submit_<wbr>sysmem(struct radeon_winsys_ctx *_ctx,<br>
>                 uint32_t *ptr;<br>
>                 unsigned cnt = 0;<br>
>                 unsigned size = 0;<br>
> -<br>
> +               unsigned pad_words = 0;<br>
>                 if (preamble_cs)<br>
>                         size += preamble_cs->cdw;<br>
><br>
> @@ -850,6 +850,10 @@ static int radv_amdgpu_winsys_cs_submit_<wbr>sysmem(struct radeon_winsys_ctx *_ctx,<br>
>                         ++cnt;<br>
>                 }<br>
><br>
> +               while(!size || (size & 7)) {<br>
> +                       size++;<br>
> +                       pad_words++;<br>
> +               }<br>
>                 assert(cnt);<br>
><br>
>                 bo = ws->buffer_create(ws, 4 * size, 4096, RADEON_DOMAIN_GTT, RADEON_FLAG_CPU_ACCESS);<br>
> @@ -867,10 +871,8 @@ static int radv_amdgpu_winsys_cs_submit_<wbr>sysmem(struct radeon_winsys_ctx *_ctx,<br>
><br>
>                 }<br>
><br>
> -               while(!size || (size & 7)) {<br>
> +               for (unsigned j = 0; j < pad_words; ++j)<br>
>                         *ptr++ = pad_word;<br>
> -                       ++size;<br>
> -               }<br>
><br>
>                 memset(&request, 0, sizeof(request));<br>
><br>
> --<br>
> 2.9.4<br>
><br>
> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">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/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></blockquote></div><br></div></div></div>