From patchwork Sun Dec 14 14:55:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 5487671 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 A1A2BBEEA8 for ; Sun, 14 Dec 2014 14:55:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C58C020A0B for ; Sun, 14 Dec 2014 14:55:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6367A20A09 for ; Sun, 14 Dec 2014 14:55:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 115396E676; Sun, 14 Dec 2014 06:55:29 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bbn0101.outbound.protection.outlook.com [157.56.111.101]) by gabe.freedesktop.org (Postfix) with ESMTP id 78BC26E675 for ; Sun, 14 Dec 2014 06:55:27 -0800 (PST) Received: from BLUPR02CA034.namprd02.prod.outlook.com (25.160.23.152) by BN1PR02MB200.namprd02.prod.outlook.com (10.242.214.156) with Microsoft SMTP Server (TLS) id 15.1.31.17; Sun, 14 Dec 2014 14:55:26 +0000 Received: from BL2FFO11FD045.protection.gbl (2a01:111:f400:7c09::180) by BLUPR02CA034.outlook.office365.com (2a01:111:e400:8ad::24) with Microsoft SMTP Server (TLS) id 15.1.31.17 via Frontend Transport; Sun, 14 Dec 2014 14:55:26 +0000 Received: from atltwp02.amd.com (165.204.84.222) by BL2FFO11FD045.mail.protection.outlook.com (10.173.161.207) with Microsoft SMTP Server id 15.1.26.17 via Frontend Transport; Sun, 14 Dec 2014 14:55:25 +0000 X-WSS-ID: 0NGKUSB-08-SWY-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (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 288C0D1601E for ; Sun, 14 Dec 2014 08:55:23 -0600 (CST) Received: from SATLEXDAG02.amd.com (10.181.40.5) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 14 Dec 2014 08:55:31 -0600 Received: from STOREXDAG04.amd.com (10.1.13.13) by SATLEXDAG02.amd.com (10.181.40.5) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 14 Dec 2014 09:55:25 -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 09:55:23 -0500 From: Oded Gabbay To: Subject: [PATCH 1/6] drm/amd: Add SDMA functions to kfd-->kgd interface Date: Sun, 14 Dec 2014 16:55:07 +0200 Message-ID: <1418568912-25058-2-git-send-email-oded.gabbay@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418568912-25058-1-git-send-email-oded.gabbay@amd.com> References: <1418568912-25058-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)(189002)(199003)(19580405001)(105586002)(2351001)(229853001)(107046002)(97736003)(110136001)(76176999)(50986999)(19580395003)(77096005)(84676001)(36756003)(106466001)(120916001)(68736005)(21056001)(48376002)(50466002)(20776003)(77156002)(89996001)(101416001)(33646002)(50226001)(4396001)(47776003)(99396003)(31966008)(92566001)(450100001)(46102003)(64706001)(86362001)(62966003)(87936001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR02MB200; H:atltwp02.amd.com; FPR:; SPF:None; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN1PR02MB200; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601003); SRVR:BN1PR02MB200; X-Forefront-PRVS: 0425A67DEF X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BN1PR02MB200; 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: Ben Goz This patch adds four new functions to the kfd2kgd interface: 1. init_sdma_engines() - Initializes the SDMA engines through GPU registers. 2. hqd_sdma_load() - Loads SDMA mqd to a H/W SDMA hqd slot. Used only in no HWS mode. 3. hqd_sdma_is_occupied() - Checks if an SDMA hqd slot is occupied. Used only in no HWS mode. 4. hqd_sdma_destroy() - Destructs and preempts the SDMA queue assigned to that SDMA hqd slot. Used only in no HWS mode. These functions are needed to support SDMA queues scheduling. Signed-off-by: Ben Goz Reviewed-by: Oded Gabbay --- drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h index 47b5519..3da21e7 100644 --- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h +++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h @@ -141,13 +141,23 @@ struct kgd2kfd_calls { * * @init_pipeline: Initialized the compute pipelines. * + * @init_sdma_engines: Initialize the sdma engines. + * * @hqd_load: Loads the mqd structure to a H/W hqd slot. used only for no cp * sceduling mode. * + * @hqd_sdma_load: Loads the SDMA mqd structure to a H/W SDMA hqd slot. + * used only for no HWS mode. + * * @hqd_is_occupies: Checks if a hqd slot is occupied. * * @hqd_destroy: Destructs and preempts the queue assigned to that hqd slot. * + * @hqd_sdma_is_occupied: Checks if an SDMA hqd slot is occupied. + * + * @hqd_sdma_destroy: Destructs and preempts the SDMA queue assigned to that + * SDMA hqd slot. + * * @get_fw_version: Returns FW versions from the header * * This structure contains function pointers to services that the kgd driver @@ -179,16 +189,19 @@ struct kfd2kgd_calls { int (*init_memory)(struct kgd_dev *kgd); int (*init_pipeline)(struct kgd_dev *kgd, uint32_t pipe_id, uint32_t hpd_size, uint64_t hpd_gpu_addr); - + int (*init_sdma_engines)(struct kgd_dev *kgd); int (*hqd_load)(struct kgd_dev *kgd, void *mqd, uint32_t pipe_id, uint32_t queue_id, uint32_t __user *wptr); - + int (*hqd_sdma_load)(struct kgd_dev *kgd, void *mqd); bool (*hqd_is_occupies)(struct kgd_dev *kgd, uint64_t queue_address, uint32_t pipe_id, uint32_t queue_id); int (*hqd_destroy)(struct kgd_dev *kgd, uint32_t reset_type, unsigned int timeout, uint32_t pipe_id, uint32_t queue_id); + bool (*hqd_sdma_is_occupied)(struct kgd_dev *kgd, void *mqd); + int (*hqd_sdma_destroy)(struct kgd_dev *kgd, void *mqd, + unsigned int timeout); uint16_t (*get_fw_version)(struct kgd_dev *kgd, enum kgd_engine_type type); };