[PATCH 09/11] drm/ttm: add number of bytes moved to the operation context

Christian König deathsimple at vodafone.de
Thu Apr 27 16:24:02 UTC 2017


From: Christian König <christian.koenig at amd.com>

Add some statistics how many bytes we have moved.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 1 +
 include/drm/ttm/ttm_bo_api.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 0c3c06a..0c5bc9e 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -378,6 +378,7 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
 	else
 		bo->offset = 0;
 
+	ctx->bytes_moved += bo->num_pages << PAGE_SHIFT;
 	return 0;
 
 out_err:
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 4b4e9e0..91b4afb 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -270,6 +270,7 @@ struct ttm_bo_kmap_obj {
 struct ttm_operation_ctx {
 	bool interruptible;
 	bool no_wait_gpu;
+	uint64_t bytes_moved;
 };
 
 /**
-- 
2.5.0



More information about the amd-gfx mailing list