[Mesa-dev] [PATCH v2] intel/ppgtt: memory address alignment

Sergii Romantsov sergii.romantsov at globallogic.com
Wed Jul 25 09:37:29 UTC 2018


Hello, Chris.
Your variant also works.
But i wonder about comment:
   /* If we don't have caching at this size, don't actually round the
    * allocation up.
    */
   if (bucket == NULL) {

Has it any sense now? If 'no' - will delete it in next patch update.

Was trying to get commit where and why it was added and it brings me to:
commit 514db96c117adc84940bb08ebd0e8f84879bd4ad
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Mar 20 16:40:01 2017 -0700

    i965: Import libdrm_intel.

    This imports commit 19c4cfc54918d361f2535aec16650e9f0be667cd of
    libdrm/intel/*.[ch], minus a few files that we're never going to use
    (and would immediately delete), plus a few necessary dependencies.

    We rename intel_bufmgr.h to brw_bufmgr.h to avoid #include conflicts.
    We also fix UTF-8 symbol problems in intel_bufmgr_gem.c comments
    because vim keeps trying to fix that every time I edit the file,
    and we may as well fix it right away.


Repository of 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 (
https://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg5146035.html)

On Wed, Jul 25, 2018 at 10:48 AM, Chris Wilson <chris at chris-wilson.co.uk>
wrote:

> Quoting Sergii Romantsov (2018-07-25 08:42:55)
> > Hello,
> > here is a backtrace:
> ...
>
> Please try:
> diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c
> b/src/mesa/drivers/dri/i965/brw_bufmgr.c
> index 09d45e30ecc..8274c2e0b2f 100644
> --- a/src/mesa/drivers/dri/i965/brw_bufmgr.c
> +++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c
> @@ -496,7 +496,6 @@ bo_alloc_internal(struct brw_bufmgr *bufmgr,
>                    uint32_t stride)
>  {
>     struct brw_bo *bo;
> -   unsigned int page_size = getpagesize();
>     int ret;
>     struct bo_cache_bucket *bucket;
>     bool alloc_from_cache;
> @@ -522,12 +521,12 @@ bo_alloc_internal(struct brw_bufmgr *bufmgr,
>      * allocation up.
>      */
>     if (bucket == NULL) {
> -      bo_size = size;
> -      if (bo_size < page_size)
> -         bo_size = page_size;
> +      unsigned int page_size = getpagesize();
> +      bo_size = ALIGN(size, page_size);
>     } else {
>        bo_size = bucket->size;
>     }
> +   assert(bo_size);
>
>     mtx_lock(&bufmgr->lock);
>     /* Get a buffer out of the cache if available */
>



-- 
Sergii Romantsov
GlobalLogic Inc.
www.globallogic.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180725/8a9e1e2a/attachment-0001.html>


More information about the mesa-dev mailing list