drm/vc4: Free hang state before destroying BO cache.

The BO cache will complain if BOs are still allocated when we try to
destroy it (since freeing those BOs would try to hit the cache).  You
could hit this if you were to unload the module after a GPU hang.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: 214613656b ("drm/vc4: Add an interface for capturing the GPU state after a hang.")
(cherry picked from commit def9652770)
This commit is contained in:
Eric Anholt
2016-07-26 13:47:13 -07:00
parent 45d413b9f0
commit e86d4c29fc

View File

@@ -968,8 +968,8 @@ vc4_gem_destroy(struct drm_device *dev)
vc4->overflow_mem = NULL;
}
vc4_bo_cache_destroy(dev);
if (vc4->hang_state)
vc4_free_hang_state(dev, vc4->hang_state);
vc4_bo_cache_destroy(dev);
}