summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-07-12 13:01:49 -0700
committerEric Anholt <eric@anholt.net>2012-08-12 19:08:25 -0700
commit0e723b135bfd59868c92c3ae243f1adaedaec3a5 (patch)
treedbe45184b7579b7c618269481fdccda52fbc0a98 /src/mesa/drivers/dri
parent4cfb9e30000eea9cb1f316ace9347083b619cdb0 (diff)
intel: Add performance debug for some common GPU stalls.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/brw_queryobj.c6
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffer_objects.c8
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.c6
3 files changed, 19 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c
index b39f6441d1..3f9e065c70 100644
--- a/src/mesa/drivers/dri/i965/brw_queryobj.c
+++ b/src/mesa/drivers/dri/i965/brw_queryobj.c
@@ -139,6 +139,12 @@ brw_queryobj_get_results(struct gl_context *ctx,
if (query->bo == NULL)
return;
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
+ if (drm_intel_bo_busy(query->bo)) {
+ perf_debug("Stalling on the GPU waiting for a query object.\n");
+ }
+ }
+
drm_intel_bo_map(query->bo, false);
results = query->bo->virtual;
switch (query->Base.Target) {
diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
index 37dc75c506..df8ac7fb30 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
@@ -212,7 +212,8 @@ intel_bufferobj_subdata(struct gl_context * ctx,
intel_bufferobj_alloc_buffer(intel, intel_obj);
drm_intel_bo_subdata(intel_obj->buffer, 0, size, data);
} else {
- /* Use the blitter to upload the new data. */
+ perf_debug("Using a blit copy to avoid stalling on glBufferSubData() "
+ "to a busy buffer object.\n");
drm_intel_bo *temp_bo =
drm_intel_bo_alloc(intel->bufmgr, "subdata temp", size, 64);
@@ -226,6 +227,11 @@ intel_bufferobj_subdata(struct gl_context * ctx,
drm_intel_bo_unreference(temp_bo);
}
} else {
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
+ if (drm_intel_bo_busy(intel_obj->buffer)) {
+ perf_debug("Stalling on the GPU in glBufferSubData().\n");
+ }
+ }
drm_intel_bo_subdata(intel_obj->buffer, offset, size, data);
}
}
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index 1ef1ac663c..9bf9c668da 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -123,6 +123,12 @@ intel_region_map(struct intel_context *intel, struct intel_region *region,
* flush is only needed on first map of the buffer.
*/
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
+ if (drm_intel_bo_busy(region->bo)) {
+ perf_debug("Mapping a busy BO, causing a stall on the GPU.\n");
+ }
+ }
+
_DBG("%s %p\n", __FUNCTION__, region);
if (!region->map_refcount) {
intel_flush(&intel->ctx);