[Mesa-dev] [PATCH 06/10] i965: Add virtual memory allocator infrastructure to brw_bufmgr.

Chris Wilson chris at chris-wilson.co.uk
Sat May 5 07:49:18 UTC 2018


Quoting Chris Wilson (2018-05-04 22:27:27)
> Quoting Kenneth Graunke (2018-05-04 02:12:36)
> > +   if (brw_using_softpin(bufmgr) && bo->gtt_offset == 0ull) {
> > +      bo->gtt_offset = vma_alloc(bufmgr, memzone, bo->size, 1);
> > +
> > +      if (bo->gtt_offset == 0ull)
> > +         goto err_free;
> > +   }
> > +
> >     bo->name = name;
> >     p_atomic_set(&bo->refcount, 1);
> >     bo->reusable = true;
> > @@ -545,6 +792,9 @@ brw_bo_gem_create_from_name(struct brw_bufmgr *bufmgr,
> >     bo->external = true;
> >     bo->kflags = bufmgr->initial_kflags;
> >  
> > +   if (brw_using_softpin(bufmgr))
> > +      bo->gtt_offset = vma_alloc(bufmgr, BRW_MEMZONE_OTHER, bo->size, 1);
> 
> At this point, I think you want bo_using_softpoin() and pull it from the
> kflags. Not any different today, but I think more defensive, especially
> on the free paths.

In particular, err_free: is suspect in that it may try to free an
unassigned address. (Fortunately, it should be non-existent, but it
should throw a few errors!)
-Chris


More information about the mesa-dev mailing list