From patchwork Thu Jul 10 21:53:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 4528561 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 276D79F4BC for ; Thu, 10 Jul 2014 23:34:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 59B08201B4 for ; Thu, 10 Jul 2014 23:34:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 84BF0201DE for ; Thu, 10 Jul 2014 23:34:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 898086E7BF; Thu, 10 Jul 2014 16:33:24 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.180]) by gabe.freedesktop.org (Postfix) with ESMTP id 649EC6E163 for ; Thu, 10 Jul 2014 14:54:52 -0700 (PDT) Received: by mail-we0-f180.google.com with SMTP id x48so203754wes.25 for ; Thu, 10 Jul 2014 14:54:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qVqnrqzVHecEBfKqS4Vl3JY+MRvIgSpdD7elCJKTK/A=; b=IX8ZiJqKFGR9Um1ROAg5kAT1LS7SHrh8NMDSoNclPQbrZNxF/meu9dMfpGg4SPBrIg xXmvtngJMuJATXR76wuiZpaXEN4Rwqlno7ITh6qmAavn1kD+3USbrXjaPsfL3BzxGEbc 6RrqBBRi9yStzhD6KH9DnSBT00TGKGZ/h+HYE/DZ0uJ+vsfXSCPW6h53U7MSUuC9ulpC yOTBSc/Qj0LBDagpAx5zsyyvvEVuuvs+JG04ktzwrIq8NWmosYOmZd7bVJqcEpuZS5sW ZhU0i4CoY+9zvJ5MgGDsK2bSskVolxSswypefqDbh2ASSslm+TBYTpCIwwxMInVAhNaM DENw== X-Received: by 10.194.83.39 with SMTP id n7mr60429803wjy.58.1405029291626; Thu, 10 Jul 2014 14:54:51 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id pq9sm831097wjc.35.2014.07.10.14.54.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:54:51 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 31/83] drm/radeon: extending kfd-kgd interface Date: Fri, 11 Jul 2014 00:53:47 +0300 Message-Id: <1405029279-6894-3-git-send-email-oded.gabbay@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> References: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> X-Mailman-Approved-At: Thu, 10 Jul 2014 16:33:12 -0700 Cc: Andrew Lewycky , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Evgeny Pinchuk , =?UTF-8?q?Christian=20K=C3=B6nig?= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Evgeny Pinchuk Adding API for KFD to be able to query the GPU clock counter. Signed-off-by: Evgeny Pinchuk Signed-off-by: Oded Gabbay --- drivers/gpu/drm/radeon/radeon_kfd.c | 9 +++++++++ include/linux/radeon_kfd.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c index f4cc3c5..121e67b 100644 --- a/drivers/gpu/drm/radeon/radeon_kfd.c +++ b/drivers/gpu/drm/radeon/radeon_kfd.c @@ -42,6 +42,7 @@ static int kmap_mem(struct kgd_dev *kgd, struct kgd_mem *mem, void **ptr); static void unkmap_mem(struct kgd_dev *kgd, struct kgd_mem *mem); static uint64_t get_vmem_size(struct kgd_dev *kgd); +static uint64_t get_gpu_clock_counter(struct kgd_dev *kgd); static void lock_srbm_gfx_cntl(struct kgd_dev *kgd); static void unlock_srbm_gfx_cntl(struct kgd_dev *kgd); @@ -55,6 +56,7 @@ static const struct kfd2kgd_calls kfd2kgd = { .kmap_mem = kmap_mem, .unkmap_mem = unkmap_mem, .get_vmem_size = get_vmem_size, + .get_gpu_clock_counter = get_gpu_clock_counter, .lock_srbm_gfx_cntl = lock_srbm_gfx_cntl, .unlock_srbm_gfx_cntl = unlock_srbm_gfx_cntl, }; @@ -275,3 +277,10 @@ static void unlock_srbm_gfx_cntl(struct kgd_dev *kgd) mutex_unlock(&rdev->srbm_mutex); } + +static uint64_t get_gpu_clock_counter(struct kgd_dev *kgd) +{ + struct radeon_device *rdev = (struct radeon_device *)kgd; + + return rdev->asic->get_gpu_clock_counter(rdev); +} diff --git a/include/linux/radeon_kfd.h b/include/linux/radeon_kfd.h index 63b7bac..fcb6c7a 100644 --- a/include/linux/radeon_kfd.h +++ b/include/linux/radeon_kfd.h @@ -84,6 +84,7 @@ struct kfd2kgd_calls { void (*unkmap_mem)(struct kgd_dev *kgd, struct kgd_mem *mem); uint64_t (*get_vmem_size)(struct kgd_dev *kgd); + uint64_t (*get_gpu_clock_counter)(struct kgd_dev *kgd); /* SRBM_GFX_CNTL mutex */ void (*lock_srbm_gfx_cntl)(struct kgd_dev *kgd);