summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-07-04 10:52:36 -0700
committerChad Versace <[email protected]>2012-07-17 08:18:08 -0700
commitfadc9eaf97c0916d5680c1d3b47e80532ede22c1 (patch)
tree1b0951222f035aacb9c85d938e1b7db17ed8b0c1 /src/mesa/drivers
parent2b311fd8024ab20065568236bdc60b9f69706d4c (diff)
intel: Add a comment explaining why we early return on matching BO names.
Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 2494ac79457..378859c2a31 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -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)