[Mesa-dev] [PATCH] i965: Remove clearing of bo->map_gtt after failure

Kenneth Graunke kenneth at whitecape.org
Sat Jul 1 18:47:38 UTC 2017


On Saturday, July 1, 2017 3:14:00 AM PDT Chris Wilson wrote:
> With the conversion to storing the result of drm_mmap to a local and not
> directly to bo->map_gtt itself, we no longer should clear bo->map_gtt.
> In the best the operation is redundant as we know bo->map_gtt to already
> be NULL, but in the worst case we overwrite a concurrent thread that
> successfully mmaped the GTT.
> 
> Fixes: 314647c4c206 ("i965: Drop global bufmgr lock from brw_bo_map_* functions.")
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> Cc: Matt Turner <mattst88 at gmail.com>
> ---
>  src/mesa/drivers/dri/i965/brw_bufmgr.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c b/src/mesa/drivers/dri/i965/brw_bufmgr.c
> index 8ed6ba5f41..d05885cfaf 100644
> --- a/src/mesa/drivers/dri/i965/brw_bufmgr.c
> +++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c
> @@ -747,7 +747,6 @@ brw_bo_map_gtt(struct brw_context *brw, struct brw_bo *bo, unsigned flags)
>        map = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE,
>                       MAP_SHARED, bufmgr->fd, mmap_arg.offset);
>        if (map == MAP_FAILED) {
> -         bo->map_gtt = NULL;
>           DBG("%s:%d: Error mapping buffer %d (%s): %s .\n",
>               __FILE__, __LINE__, bo->gem_handle, bo->name, strerror(errno));
>           return NULL;
> 

Thanks, sorry for botching this.  I tested this and pushed the patch.

--Ken
-------------- 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/20170701/d4fac75a/attachment.sig>


More information about the mesa-dev mailing list