From: Kenneth Graunke Date: Fri, 1 Sep 2017 06:54:20 +0000 (-0700) Subject: i965: Fix crash in fallback GTT mapping. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=52b65dfda84e4d433a332dd84596eef054eb5cbb;p=mesa.git i965: Fix crash in fallback GTT mapping. We can't perf_debug without a context. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Anuj Phogat --- diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c b/src/mesa/drivers/dri/i965/brw_bufmgr.c index 6a7422fff92..801721991f4 100644 --- a/src/mesa/drivers/dri/i965/brw_bufmgr.c +++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c @@ -944,8 +944,10 @@ brw_bo_map(struct brw_context *brw, struct brw_bo *bo, unsigned flags) * We skip MAP_RAW because we want to avoid map_gtt's fence detiling. */ if (!map && !(flags & MAP_RAW)) { - perf_debug("Fallback GTT mapping for %s with access flags %x\n", - bo->name, flags); + if (brw) { + perf_debug("Fallback GTT mapping for %s with access flags %x\n", + bo->name, flags); + } map = brw_bo_map_gtt(brw, bo, flags); }