From patchwork Fri Nov 17 10:49:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 10062649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 23FA36023A for ; Fri, 17 Nov 2017 10:50:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CA372A9F7 for ; Fri, 17 Nov 2017 10:50:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11BC52AA01; Fri, 17 Nov 2017 10:50:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A9A752A9FC for ; Fri, 17 Nov 2017 10:50:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA3256EA13; Fri, 17 Nov 2017 10:49:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8FBC96E9FF; Fri, 17 Nov 2017 10:49:47 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id y42so1742236wrd.3; Fri, 17 Nov 2017 02:49:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=U0O2jJ7Tqpn91dExAtZ1SGui1gPGemUrxQ5yKi4vQj0=; b=JCgT98yQPypJkQk+aFDrGTtILVKgr6vvQpJsHP8hg0C4fKQgr7b/EfcVi72qHUx8/P hrTwX96CiopHfMYSETonpOxpdhwix2epmYDhrEXZGSVhtThAuXVSiNt9EIwLgTVMVJWH Lj+0ZSdf1DNIGhwcu5Ko3mmXwAVpfmMz0bZxC+WbdlQP9cpPr4aU6bdajnvLYeoo/Edz lvLXAGcSC4izJK1PuR2lAmhUyLkO+DGCW9CRdqnNOHJ5nJp+uv+DKPy0gQTFzYu4My2C 0wbqIquSoDRjGHlGuH6dYMPe9Qr4dSdW+l7DDifwliPsZEtuuRqas+PMiKO+WvqytWtl eLSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U0O2jJ7Tqpn91dExAtZ1SGui1gPGemUrxQ5yKi4vQj0=; b=ZHN9J0NNa7U9L4NuRzSQEbbVXk5JOi4UqFRp3rVJvDHC8Sw2B6uZpH1G6gqJNTGpyt yZYCqnIrD095gypEOd6u8AvhCe5+1Pz4CjLqJ/wxC3N3fioT/DLwTJB8HHGy2Perk/77 WJkr9VfcRNcUtG6gHL3SI+6IXrY92itswIIzshuixEpLKyZe35UbMt36DqSJBV3KQces SA8zjzGQpgpNskkX8l6Mi+na9SgO6ZthDQr3lmHMwVXaF1gQKM1OqogfFwoMS2Xc95mr r77MYXO7JXCjtOBFMw6m3AQswgyCPuPWoZ/KFFLUfvRRFK+fBxZfljG21AhbDS8B7wdJ z0qg== X-Gm-Message-State: AJaThX6gkcP+NGtDgYsoWbuQ9hy41QSOjgZHZx3FxYF54WxUb5CHxFMi L/FsuCH+jENSL+djyKjYZVO/7g== X-Google-Smtp-Source: AGs4zMY+/idW6a3+BxHD4P9+zIozxnGAMzVD3FFzkh51Uv/NN1BmJOMPLNGbuMx9So10GL8fjR496Q== X-Received: by 10.223.161.158 with SMTP id u30mr3868471wru.199.1510915785974; Fri, 17 Nov 2017 02:49:45 -0800 (PST) Received: from localhost.localdomain ([2a02:908:1251:7981:4ce1:a38d:11ca:a5]) by smtp.gmail.com with ESMTPSA id 186sm2884009wmm.47.2017.11.17.02.49.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 02:49:45 -0800 (PST) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 6/8] drm/ttm: add number of bytes moved to the operation context Date: Fri, 17 Nov 2017 11:49:33 +0100 Message-Id: <20171117104935.4150-7-christian.koenig@amd.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117104935.4150-1-christian.koenig@amd.com> References: <20171117104935.4150-1-christian.koenig@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add some statistics how many bytes we have moved. Signed-off-by: Christian König Reviewed-by: Michel Dänzer --- 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 d3448c38f00d..97c3da6d5f17 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -361,6 +361,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 d0164d131982..368eb02b54a9 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; }; /**