drm/ttm: add number of bytes moved to the operation context
authorChristian König <christian.koenig@amd.com>
Thu, 27 Apr 2017 16:19:46 +0000 (18:19 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Dec 2017 17:48:03 +0000 (12:48 -0500)
Add some statistics how many bytes we have moved.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/ttm/ttm_bo.c
include/drm/ttm/ttm_bo_api.h

index d3448c3..97c3da6 100644 (file)
@@ -361,6 +361,7 @@ moved:
        else
                bo->offset = 0;
 
+       ctx->bytes_moved += bo->num_pages << PAGE_SHIFT;
        return 0;
 
 out_err:
index d0164d1..368eb02 100644 (file)
@@ -270,6 +270,7 @@ struct ttm_bo_kmap_obj {
 struct ttm_operation_ctx {
        bool interruptible;
        bool no_wait_gpu;
+       uint64_t bytes_moved;
 };
 
 /**