intel: Add a comment explaining why we early return on matching BO names.
authorEric Anholt <eric@anholt.net>
Wed, 4 Jul 2012 17:52:36 +0000 (10:52 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Tue, 17 Jul 2012 15:18:08 +0000 (08:18 -0700)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_context.c

index 2494ac7..378859c 100644 (file)
@@ -893,6 +893,10 @@ intel_process_dri2_buffer(struct intel_context *intel,
    if (!rb)
       return;
 
+   /* We try to avoid closing and reopening the same BO name, because the first
+    * use of a mapping of the buffer involves a bunch of page faulting which is
+    * moderately expensive.
+    */
    if (rb->mt &&
        rb->mt->region &&
        rb->mt->region->name == buffer->name)