drm/ttm: add number of bytes moved to the operation context
authorChristian König <[email protected]>
Thu, 27 Apr 2017 16:19:46 +0000 (18:19 +0200)
committerAlex Deucher <[email protected]>
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 <[email protected]>
Reviewed-by: Michel Dänzer <[email protected]>
Reviewed-by: Chunming Zhou <[email protected]>
Tested-by: Dieter Nützel <[email protected]>
Tested-by: Michel Dänzer <[email protected]>
Acked-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/ttm/ttm_bo.c
include/drm/ttm/ttm_bo_api.h

index d3448c38f00df602c0bb06a65ea529bbb5eb226b..97c3da6d5f17b75530ccae023abf357122101210 100644 (file)
@@ -361,6 +361,7 @@ moved:
        else
                bo->offset = 0;
 
+       ctx->bytes_moved += bo->num_pages << PAGE_SHIFT;
        return 0;
 
 out_err:
index d0164d1319826560339a8c8629e66f053f2e22f9..368eb02b54a9ee1526270da28ae30d4c9607d884 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;
 };
 
 /**