[Intel-gfx] [PATCH] intel: non-blocking mmaps on the cheap

Ben Widawsky ben at bwidawsk.net
Fri Oct 7 00:56:14 CEST 2011


On Thu, Oct 06, 2011 at 01:55:49PM -0700, Eric Anholt wrote:
> On Thu, 22 Sep 2011 16:27:11 -0700, Ben Widawsky <ben at bwidawsk.net> wrote:
> > +/**
> > + * unmap an object in the non-blocking mode
> > + */
> > +int drm_intel_gem_bo_unmap_nonblocking(drm_intel_bo *bo)
> > +{
> > +	drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
> > +	int ret = 0;
> > +
> > +	if (bo == NULL)
> > +		return 0;
> > +
> > +	pthread_mutex_lock(&bufmgr_gem->lock);
> > +	bo->virtual = NULL;
> > +	pthread_mutex_unlock(&bufmgr_gem->lock);
> > +
> > +	return ret;
> 
> You dereffed bo before checking for NULL, so the compiler will just drop
> that NULL check.  I realize this is copy'n'paste from bo_unmap_gtt, but
> I don't see why this new copy of bo_unmap_gtt exists anyway.
> 

My original patch did not have the extra unmap, but since we had an unmap for
gtt and non-gtt case, Danvet complains that it wasn't symmetric.

I honestly care so little about what we decide for this, I'd like you two to
fight it out.

Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20111006/cb778ce7/attachment.sig>


More information about the Intel-gfx mailing list