Module Name:    src
Committed By:   riastradh
Date:           Wed Jul 16 21:48:53 UTC 2014

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/i915: i915_gem.c

Log Message:
Explain why i915_gem_release_mmap is broken.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.13 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.14
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.13	Wed Jul 16 20:56:24 2014
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c	Wed Jul 16 21:48:53 2014
@@ -2140,6 +2140,24 @@ i915_gem_release_mmap(struct drm_i915_ge
 		mutex_enter(obj->base.gemo_shm_uao->vmobjlock);
 		KASSERT(obj->pages != NULL);
 		/* Force a fresh fault for each page.  */
+		/*
+		 * XXX OOPS!  This doesn't actually do what we want.
+		 * This causes a fresh fault for access to the backing
+		 * pages -- but nothing accesses the backing pages
+		 * directly!  What is actually entered into CPU page
+		 * table entries is aperture addresses which have been
+		 * programmed by the GTT to refer to those backing
+		 * pages.
+		 *
+		 * We need to clear those page table entries, but
+		 * there's no good way to do that at the moment: nobody
+		 * records for us a map from either uvm objects or
+		 * physical device addresses to a list of all virtual
+		 * pages where they have been mapped.  pmap(9) records
+		 * a map only from physical RAM addresses to virtual
+		 * pages; it does nothing for physical device
+		 * addresses.
+		 */
 		TAILQ_FOREACH(page, &obj->igo_pageq, pageq.queue)
 			pmap_page_protect(page, VM_PROT_NONE);
 		mutex_exit(obj->base.gemo_shm_uao->vmobjlock);

Reply via email to