[Mesa-dev] [PATCH 3/7] i965/bufmgr: Allocate BO pages outside of the kernel's locking.

Kenneth Graunke kenneth at whitecape.org
Sat Jul 22 20:18:25 UTC 2017


On Saturday, July 22, 2017 2:09:43 AM PDT Chris Wilson wrote:
> Quoting Kenneth Graunke (2017-07-22 00:17:43)
> > Suggested by Chris Wilson.
> > ---
> >  src/mesa/drivers/dri/i965/brw_bufmgr.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c b/src/mesa/drivers/dri/i965/brw_bufmgr.c
> > index 1669d26e990..78a4626d430 100644
> > --- a/src/mesa/drivers/dri/i965/brw_bufmgr.c
> > +++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c
> > @@ -382,6 +382,19 @@ retry:
> >  
> >        if (bo_set_tiling_internal(bo, tiling_mode, stride))
> >           goto err_free;
> > +
> > +      /* Calling set_domain() will allocate pages for the BO outside of the
> > +       * struct mutex lock in the kernel, which is more efficient than waiting
> > +       * to create them during the first execbuf that uses the BO.
> > +       */
> > +      struct drm_i915_gem_set_domain sd = {
> > +         .handle = bo->gem_handle,
> > +         .read_domains = I915_GEM_DOMAIN_CPU,
> > +         .write_domain = I915_GEM_DOMAIN_CPU,
> 
> We can pass .write_domain = 0 here. Should be no different as the bo is
> created in the CPU write domain and already marked as dirty. I think it
> is a better reflection of intent that we are just pulling in the pages.
> -Chris

Fixed this locally, thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170722/fb804e6d/attachment.sig>


More information about the mesa-dev mailing list