<div dir="ltr">Hello, Chris.<div>Your variant also works.</div><div>But i wonder about comment:</div><div><div>   /* If we don't have caching at this size, don't actually round the</div><div>    * allocation up.</div><div>    */</div><div>   if (bucket == NULL) {</div></div><div><br></div><div>Has it any sense now? If 'no' - will delete it in next patch update.</div><div><br></div><div>Was trying to get commit where and why it was added and it brings me to:</div><div><div>commit 514db96c117adc84940bb08ebd0e8f84879bd4ad</div><div>Author: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>></div><div>Date:   Mon Mar 20 16:40:01 2017 -0700</div><div><br></div><div>    i965: Import libdrm_intel.</div><div>    </div><div>    This imports commit 19c4cfc54918d361f2535aec16650e9f0be667cd of</div><div>    libdrm/intel/*.[ch], minus a few files that we're never going to use</div><div>    (and would immediately delete), plus a few necessary dependencies.</div><div>    </div><div>    We rename intel_bufmgr.h to brw_bufmgr.h to avoid #include conflicts.</div><div>    We also fix UTF-8 symbol problems in intel_bufmgr_gem.c comments</div><div>    because vim keeps trying to fix that every time I edit the file,</div><div>    and we may as well fix it right away.</div></div><div><br></div><div><br></div><div>Repository of <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">libdrm (master and tags about 2.4.7 and 2.4.8) doesn't contain such commit. Observed only that it fixes some crash of VB (<a href="https://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg5146035.html">https://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg5146035.html</a>)</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 25, 2018 at 10:48 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">Quoting Sergii Romantsov (2018-07-25 08:42:55)<br>
<span class="">> Hello,<br>
> here is a backtrace:<br>
</span>...<br>
<br>
Please try:<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_bufmgr.c b/src/mesa/drivers/dri/i965/<wbr>brw_bufmgr.c<br>
index 09d45e30ecc..8274c2e0b2f 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_bufmgr.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_bufmgr.c<br>
@@ -496,7 +496,6 @@ bo_alloc_internal(struct brw_bufmgr *bufmgr,<br>
                   uint32_t stride)<br>
 {<br>
    struct brw_bo *bo;<br>
-   unsigned int page_size = getpagesize();<br>
    int ret;<br>
    struct bo_cache_bucket *bucket;<br>
    bool alloc_from_cache;<br>
@@ -522,12 +521,12 @@ bo_alloc_internal(struct brw_bufmgr *bufmgr,<br>
     * allocation up.<br>
     */<br>
    if (bucket == NULL) {<br>
-      bo_size = size;<br>
-      if (bo_size < page_size)<br>
-         bo_size = page_size;<br>
+      unsigned int page_size = getpagesize();<br>
+      bo_size = ALIGN(size, page_size);<br>
    } else {<br>
       bo_size = bucket->size;<br>
    }<br>
+   assert(bo_size);<br>
<br>
    mtx_lock(&bufmgr->lock);<br>
    /* Get a buffer out of the cache if available */<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Sergii Romantsov<br></div><div dir="ltr"><div style="margin:0px;padding:0px;color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;font-size:14px">GlobalLogic Inc.<br><a href="http://www.globallogic.com/" rel="nofollow" style="color:rgb(0,82,204)" target="_blank">www.globallogic.com</a><br></div></div></div></div></div></div>
</div>