[Mesa-dev] [PATCH v2 1/4] softpipe: Add assert verifying successful pipe_transfer_map

Brian Paul brianp at vmware.com
Tue Jul 17 14:18:38 UTC 2018


On 07/17/2018 04:32 AM, Robert Foss wrote:
> This failure mode is a bit tricky to debug and manifests itself
> later as a null pointer dereference, for which finding the origin
> is needlessly tricky.
> 
> Signed-off-by: Robert Foss <robert.foss at collabora.com>
> ---
> 
> Changes since v1:
>    - Patch added
> 
>   src/gallium/drivers/softpipe/sp_tile_cache.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
> index 351736ee421..211cc5ef4b0 100644
> --- a/src/gallium/drivers/softpipe/sp_tile_cache.c
> +++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
> @@ -209,6 +209,7 @@ sp_tile_cache_set_surface(struct softpipe_tile_cache *tc,
>                                                       PIPE_TRANSFER_UNSYNCHRONIZED,
>                                                       0, 0, ps->width, ps->height,
>                                                       &tc->transfer[i]);
> +            assert(tc->transfer_map[i]);
>            }
>         }
>         else {
> 

Looks OK to me.

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list