From patchwork Thu Jul 10 21:50: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: 4528361 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 03D399F37C for ; Thu, 10 Jul 2014 23:33:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F714201DE for ; Thu, 10 Jul 2014 23:33:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6DD2F201B4 for ; Thu, 10 Jul 2014 23:33:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 85AE26E783; Thu, 10 Jul 2014 16:33:22 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) by gabe.freedesktop.org (Postfix) with ESMTP id BE2776E01B for ; Thu, 10 Jul 2014 14:52:02 -0700 (PDT) Received: by mail-we0-f175.google.com with SMTP id k48so190895wev.6 for ; Thu, 10 Jul 2014 14:52:01 -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=vIgnq1SmnFPoF+lpMasNpav+17eFeIn7k9aFXwAa6IQ=; b=Eoj5zTPRx7nhWphZzV3eGMURQ47iH3E9ojIzdRfELv7587kfnm4tR3jfDpA/pc8KKP 2iroFvvqAq66gKYQsw0JfoR00NiI8B2kuqC3/bjzMQ5GXwTKNBHIArnoOyZNt1mwA9fB nwnZptiYgzY7EE4HdGsOW8B427El48EkrGQPuPbccINipOp3aV+DJrlJFeM/dTw+B/wy pvARo/MylcU9adgU6kBlesUq2/PP4N9CYv8UjZPNnOkg0Ts02UpooN0ABYJ8GpIxly9D uYGbcdeKlwfjQ42DkYGDRMlQlaOJvPG+4DwTHUk9vl5YrRj94ZBWqyOVCMCnduSby2LP 634Q== X-Received: by 10.194.133.42 with SMTP id oz10mr52139228wjb.40.1405029121584; Thu, 10 Jul 2014 14:52:01 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id n2sm805353wjf.40.2014.07.10.14.51.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:52:00 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 18/83] hsa/radeon: Enable interrupts in KFD scheduler Date: Fri, 11 Jul 2014 00:50:18 +0300 Message-Id: <1405029027-6085-17-git-send-email-oded.gabbay@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405029027-6085-1-git-send-email-oded.gabbay@amd.com> References: <1405029027-6085-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 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 This patch enables the use of interrupts in the KFD scheduler when the scheduler performs its initialization. It also disables the interrupts when the scheduler stops its work. Signed-off-by: Oded Gabbay --- drivers/gpu/hsa/radeon/kfd_sched_cik_static.c | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c b/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c index 5d42e88..9add5e5 100644 --- a/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c +++ b/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c @@ -486,6 +486,32 @@ static void cik_static_destroy(struct kfd_scheduler *scheduler) kfree(priv); } +static void +enable_interrupts(struct cik_static_private *priv) +{ + unsigned int i; + + lock_srbm_index(priv); + for (i = 0; i < priv->num_pipes; i++) { + pipe_select(priv, i); + WRITE_REG(priv->dev, CPC_INT_CNTL, DEQUEUE_REQUEST_INT_ENABLE); + } + unlock_srbm_index(priv); +} + +static void +disable_interrupts(struct cik_static_private *priv) +{ + unsigned int i; + + lock_srbm_index(priv); + for (i = 0; i < priv->num_pipes; i++) { + pipe_select(priv, i); + WRITE_REG(priv->dev, CPC_INT_CNTL, 0); + } + unlock_srbm_index(priv); +} + static void cik_static_start(struct kfd_scheduler *scheduler) { struct cik_static_private *priv = kfd_scheduler_to_private(scheduler); @@ -495,6 +521,7 @@ static void cik_static_start(struct kfd_scheduler *scheduler) init_pipes(priv); init_ats(priv); + enable_interrupts(priv); } static void cik_static_stop(struct kfd_scheduler *scheduler) @@ -502,6 +529,7 @@ static void cik_static_stop(struct kfd_scheduler *scheduler) struct cik_static_private *priv = kfd_scheduler_to_private(scheduler); exit_ats(priv); + disable_interrupts(priv); radeon_kfd_vidmem_ungpumap(priv->dev, priv->hpd_mem); radeon_kfd_vidmem_ungpumap(priv->dev, priv->mqd_mem);