OSDN Git Service

i965: Create drm_intel_bo_map wrappers with performance warnings.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 29 Jan 2014 17:09:18 +0000 (09:09 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 4 Feb 2014 00:16:26 +0000 (16:16 -0800)
commitd613bafe9111a577bed6bb89ef559df40712674c
treebc44ea510c0413ea5a7177fa0021e85b55178748
parent1b886078dbff593ceb23b05b3ce78a3bb3cbcb94
i965: Create drm_intel_bo_map wrappers with performance warnings.

Mapping a buffer is a common place where we could stall the CPU.

In a few places, we've added special code to check whether a buffer is
busy and log the stall as a performance warning.  Most of these give no
indication of the severity of the stall, though, since measuring the
time is a small hassle.

This patch introduces a new brw_bo_map() function which wraps
drm_intel_bo_map, but additionally measures the time stalled and reports
a performance warning.  If performance debugging is not enabled, it
simply maps the buffer with negligable overhead.

We also add a similar wrapper for drm_intel_gem_bo_map_gtt().

This should make it easy to add performance warnings in lots of places.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/intel_buffer_objects.c