intel: Add a comment explaining why we early return on matching BO names.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Eric Anholt 2012-07-04 10:52:36 -07:00 committed by Chad Versace
parent 2b311fd802
commit fadc9eaf97

View 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)