[Mesa-dev] [PATCH 6/6] intel: Add a comment explaining why we early return on matching BO names.
Eric Anholt
eric at anholt.net
Wed Jul 4 10:52:36 PDT 2012
---
src/mesa/drivers/dri/intel/intel_context.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 9d8ac9c..e5168ec 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -894,6 +894,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)
--
1.7.10
More information about the mesa-dev
mailing list