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

Eric Anholt eric at anholt.net
Thu Oct 6 22:55:49 CEST 2011


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.

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


More information about the Intel-gfx mailing list