i965: Issue performance warnings when copying the program cache BO.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Aug 2014 17:50:31 +0000 (10:50 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 13 Oct 2014 13:53:54 +0000 (06:53 -0700)
We don't really want unnecessary buffer copying, so it'd be nice to know
when it's happening.

v2: Drop stall warnings when doing a read-only CPU mapping of the cache
    BO.  The GPU also uses it in a read-only fashion, so there won't be
    any stalls, even though the buffer is busy.  (Thanks to Chris Wilson
    for catching this mistake.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> [v1]
src/mesa/drivers/dri/i965/brw_state_cache.c

index 62e03b129849b9e134a00de9c7568260d4028139..f4cae8f560b2b40752fb8380e72edf58a6493efe 100644 (file)
@@ -241,6 +241,8 @@ brw_upload_item_data(struct brw_cache *cache,
                     struct brw_cache_item *item,
                     const void *data)
 {
+   struct brw_context *brw = cache->brw;
+
    /* Allocate space in the cache BO for our new program. */
    if (cache->next_offset + item->size > cache->bo->size) {
       uint32_t new_size = cache->bo->size * 2;
@@ -255,6 +257,7 @@ brw_upload_item_data(struct brw_cache *cache,
     * recreate it.
     */
    if (cache->bo_used_by_gpu) {
+      perf_debug("Copying busy program cache buffer.\n");
       brw_cache_new_bo(cache, cache->bo->size);
    }