0542-drm-vc4-Free-hang-state-before-destroying-BO-cache.patch 1023 B

1234567891011121314151617181920212223242526272829
  1. From 12588d06f8dca8bfdffae3d7e9c181160c2fbf6e Mon Sep 17 00:00:00 2001
  2. From: Eric Anholt <eric@anholt.net>
  3. Date: Tue, 26 Jul 2016 13:47:13 -0700
  4. Subject: [PATCH] drm/vc4: Free hang state before destroying BO cache.
  5. The BO cache will complain if BOs are still allocated when we try to
  6. destroy it (since freeing those BOs would try to hit the cache). You
  7. could hit this if you were to unload the module after a GPU hang.
  8. Signed-off-by: Eric Anholt <eric@anholt.net>
  9. Fixes: 214613656b51 ("drm/vc4: Add an interface for capturing the GPU state after a hang.")
  10. (cherry picked from commit def96527707e1978a0c88e75d13b082f51460d5c)
  11. ---
  12. drivers/gpu/drm/vc4/vc4_gem.c | 4 ++--
  13. 1 file changed, 2 insertions(+), 2 deletions(-)
  14. --- a/drivers/gpu/drm/vc4/vc4_gem.c
  15. +++ b/drivers/gpu/drm/vc4/vc4_gem.c
  16. @@ -968,8 +968,8 @@ vc4_gem_destroy(struct drm_device *dev)
  17. vc4->overflow_mem = NULL;
  18. }
  19. - vc4_bo_cache_destroy(dev);
  20. -
  21. if (vc4->hang_state)
  22. vc4_free_hang_state(dev, vc4->hang_state);
  23. +
  24. + vc4_bo_cache_destroy(dev);
  25. }