From patchwork Sun Dec 14 13:35:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 5487571 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 007DBBEEA8 for ; Sun, 14 Dec 2014 13:35:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E84F020A0B for ; Sun, 14 Dec 2014 13:35:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1433520A09 for ; Sun, 14 Dec 2014 13:35:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C79C6E766; Sun, 14 Dec 2014 05:35:42 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0107.outbound.protection.outlook.com [65.55.169.107]) by gabe.freedesktop.org (Postfix) with ESMTP id B394D6E766 for ; Sun, 14 Dec 2014 05:35:40 -0800 (PST) Received: from CY1PR0201MB1001.namprd02.prod.outlook.com (25.161.211.143) by CY1PR0201MB0860.namprd02.prod.outlook.com (25.160.142.19) with Microsoft SMTP Server (TLS) id 15.1.31.17; Sun, 14 Dec 2014 13:35:38 +0000 Received: from BN1PR02CA0039.namprd02.prod.outlook.com (10.141.56.39) by CY1PR0201MB1001.namprd02.prod.outlook.com (25.161.211.143) with Microsoft SMTP Server (TLS) id 15.1.31.17; Sun, 14 Dec 2014 13:35:37 +0000 Received: from BL2FFO11FD011.protection.gbl (2a01:111:f400:7c09::180) by BN1PR02CA0039.outlook.office365.com (2a01:111:e400:2a::39) with Microsoft SMTP Server (TLS) id 15.1.31.17 via Frontend Transport; Sun, 14 Dec 2014 13:35:36 +0000 Received: from atltwp02.amd.com (165.204.84.222) by BL2FFO11FD011.mail.protection.outlook.com (10.173.161.17) with Microsoft SMTP Server id 15.1.26.17 via Frontend Transport; Sun, 14 Dec 2014 13:35:36 +0000 X-WSS-ID: 0NGKR3A-08-RLU-02 X-M-MSG: Received: from satlvexedge02.amd.com (satlvexedge02.amd.com [10.177.96.29]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2E725D1601E for ; Sun, 14 Dec 2014 07:35:34 -0600 (CST) Received: from SATLEXDAG03.amd.com (10.181.40.7) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 14 Dec 2014 07:35:47 -0600 Received: from STOREXDAG04.amd.com (10.1.13.13) by satlexdag03.amd.com (10.181.40.7) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 14 Dec 2014 08:35:36 -0500 Received: from AMD (10.20.0.84) by storexdag04.amd.com (10.1.13.13) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 14 Dec 2014 08:35:33 -0500 From: Oded Gabbay To: Subject: [PATCH 2/4] amdkfd: Add number of watch points to topology Date: Sun, 14 Dec 2014 15:35:18 +0200 Message-ID: <1418564120-19523-2-git-send-email-oded.gabbay@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418564120-19523-1-git-send-email-oded.gabbay@amd.com> References: <1418564120-19523-1-git-send-email-oded.gabbay@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.20.0.84] X-EOPAttributedMessage: 0 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=Oded.Gabbay@amd.com; X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(199003)(189002)(50986999)(99396003)(105586002)(107046002)(2351001)(229853001)(89996001)(33646002)(84676001)(36756003)(110136001)(19580405001)(101416001)(106466001)(46102003)(21056001)(92566001)(68736005)(47776003)(20776003)(4396001)(50226001)(77096005)(50466002)(120916001)(48376002)(76176999)(19580395003)(97736003)(31966008)(87936001)(450100001)(62966003)(86362001)(64706001)(77156002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0201MB1001; H:atltwp02.amd.com; FPR:; SPF:None; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1001; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601003); SRVR:CY1PR0201MB1001; X-Forefront-PRVS: 0425A67DEF X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB1001; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB0860; X-OriginatorOrg: amd4.onmicrosoft.com 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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: Alexey Skidanov This patch adds the number of watch points to the node capabilities in the topology module Reviewed-by: Oded Gabbay Signed-off-by: Alexey Skidanov --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 1 + drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 1 + drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 13 +++++++++++++ 3 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index 43884eb..436c31c 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c @@ -32,6 +32,7 @@ static const struct kfd_device_info kaveri_device_info = { .max_pasid_bits = 16, .ih_ring_entry_size = 4 * sizeof(uint32_t), + .num_of_watch_points = 4, .mqd_size_aligned = MQD_SIZE_ALIGNED }; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index f9fb81e..ba2bba8 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h @@ -107,6 +107,7 @@ enum cache_policy { struct kfd_device_info { unsigned int max_pasid_bits; size_t ih_ring_entry_size; + uint8_t num_of_watch_points; uint16_t mqd_size_aligned; }; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index b11792d..da34e1f 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "kfd_priv.h" #include "kfd_crat.h" @@ -634,6 +635,7 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr, struct kfd_topology_device *dev; char public_name[KFD_TOPOLOGY_PUBLIC_NAME_SIZE]; uint32_t i; + uint32_t log_max_watch_addr; /* Making sure that the buffer is an empty string */ buffer[0] = 0; @@ -708,6 +710,17 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr, dev->node_props.location_id); if (dev->gpu) { + log_max_watch_addr = + __ilog2_u32(dev->gpu->device_info->num_of_watch_points); + + if (log_max_watch_addr) { + dev->node_props.capability |= + HSA_CAP_WATCH_POINTS_SUPPORTED; + dev->node_props.capability |= + (log_max_watch_addr << HSA_CAP_WATCH_POINTS_TOTALBITS_SHIFT) & + HSA_CAP_WATCH_POINTS_TOTALBITS_MASK; + } + sysfs_show_32bit_prop(buffer, "max_engine_clk_fcompute", kfd2kgd->get_max_engine_clock_in_mhz( dev->gpu->kgd));