Mesa (master): intel: Add a comment explaining why we early return on matching BO names.
Chad Versace
chadversary at kemper.freedesktop.org
Tue Jul 17 15:19:48 UTC 2012
Module: Mesa
Branch: master
Commit: fadc9eaf97c0916d5680c1d3b47e80532ede22c1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fadc9eaf97c0916d5680c1d3b47e80532ede22c1
Author: Eric Anholt <eric at anholt.net>
Date: Wed Jul 4 10:52:36 2012 -0700
intel: Add a comment explaining why we early return on matching BO names.
Reviewed-by: Chad Versace <chad.versace at linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/intel/intel_context.c | 4 ++++
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 2494ac7..378859c 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)
More information about the mesa-commit
mailing list