i965: Fix crash in fallback GTT mapping.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 1 Sep 2017 06:54:20 +0000 (23:54 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 2 Sep 2017 19:56:18 +0000 (12:56 -0700)
We can't perf_debug without a context.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/brw_bufmgr.c

index 6a7422fff92ac629c5b826311374e01ed7b1fa35..801721991f44867d4b735e601eff6754807942a1 100644 (file)
@@ -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);
    }