Author: dumbbell
Date: Sat Mar 12 11:57:32 2016
New Revision: 296721
URL: https://svnweb.freebsd.org/changeset/base/296721

Log:
  drm/i915: Call i915_gem_gtt_fini() when the device is detached
  
  This fixes several memory leaks. Apparently, this problem exists in
  Linux 3.8 but the code changed in Linux 3.9 so it may be fixed upstream
  already. Still, this is something we need to pay attention to.

Modified:
  head/sys/dev/drm2/i915/i915_dma.c

Modified: head/sys/dev/drm2/i915/i915_dma.c
==============================================================================
--- head/sys/dev/drm2/i915/i915_dma.c   Sat Mar 12 11:54:58 2016        
(r296720)
+++ head/sys/dev/drm2/i915/i915_dma.c   Sat Mar 12 11:57:32 2016        
(r296721)
@@ -1810,6 +1810,12 @@ int i915_driver_unload(struct drm_device
        if (dev_priv->mmio_map != NULL)
                drm_rmmap(dev, dev_priv->mmio_map);
 
+       /*
+        * NOTE Linux<->FreeBSD: Linux forgots to call
+        * i915_gem_gtt_fini(), causing memory leaks.
+        */
+       i915_gem_gtt_fini(dev);
+
        if (dev_priv->wq != NULL)
                taskqueue_free(dev_priv->wq);
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to