From: Eric Anholt Date: Wed, 4 Jul 2012 17:52:36 +0000 (-0700) Subject: intel: Add a comment explaining why we early return on matching BO names. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fadc9eaf97c0916d5680c1d3b47e80532ede22c1;p=mesa.git intel: Add a comment explaining why we early return on matching BO names. Reviewed-by: Chad Versace Reviewed-by: Kenneth Graunke --- 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)