From patchwork Thu Jul 10 21:50:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 4528521 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 D5B1ABEEAA for ; Thu, 10 Jul 2014 23:34:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10ADD201D5 for ; Thu, 10 Jul 2014 23:34:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 50E04201B4 for ; Thu, 10 Jul 2014 23:34:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F22B6E7AA; 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-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by gabe.freedesktop.org (Postfix) with ESMTP id 803D96E163 for ; Thu, 10 Jul 2014 14:52:15 -0700 (PDT) Received: by mail-wi0-f181.google.com with SMTP id bs8so397767wib.14 for ; Thu, 10 Jul 2014 14:52:13 -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=h9JMvpAxFy0UJfSwpgzbHUOWRLY36QHPhPyKkWmW7K4=; b=k59DWUtGxfw+4FCQZkDOy93Pdhu5+DYHroGRR+QmmuHO8nrHQxi2GMCsJUwp7S7ROz fM3FHTlcBfVdrkBliGjByUzav1GgKFEzGQ4wuILp6MKnetCBo+ceGAn7PITnINLjsFL7 I2iiOb2k6xJYv52qDJV3aVTBPXpsznkjRRl0bMEQdjv6DNnwdAb5l5J1jfw+eHpKJQ5p JKOSkKqClc39GJVe5RwivXrzb7d4I4LcSgT9ZzKWiPN/6C4OO2iNFiH+lYUkV+4chlty kmAno7CbCxnr1h+P3WHPf6cmHB9I24eyxpnhbqJjGiF3fthg4T92sfoj0Zeow1UoavCA sjPw== X-Received: by 10.180.83.105 with SMTP id p9mr22338180wiy.8.1405029133746; Thu, 10 Jul 2014 14:52:13 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id n2sm805353wjf.40.2014.07.10.14.52.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:52:13 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 22/83] drm/radeon: Add calls to suspend and resume of kfd driver Date: Fri, 11 Jul 2014 00:50:22 +0300 Message-Id: <1405029027-6085-21-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, =?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 The radeon driver can suspend and resume its device. For each device it suspends/resumes, it should inform the kfd about it, so the kfd could perform relevant actions per that device. This patch adds the calls to kfd's suspend and resume functions. The device is passed as an argument. Signed-off-by: Oded Gabbay --- drivers/gpu/drm/radeon/cik.c | 7 +++++++ drivers/gpu/drm/radeon/radeon_kfd.c | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index e0c8052..b1c50f4 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c @@ -138,6 +138,8 @@ static void cik_fini_pg(struct radeon_device *rdev); static void cik_fini_cg(struct radeon_device *rdev); static void cik_enable_gui_idle_interrupt(struct radeon_device *rdev, bool enable); +extern void radeon_kfd_suspend(struct radeon_device *rdev); +extern int radeon_kfd_resume(struct radeon_device *rdev); /* get temperature in millidegrees */ int ci_get_temp(struct radeon_device *rdev) @@ -8429,6 +8431,10 @@ static int cik_startup(struct radeon_device *rdev) if (r) return r; + r = radeon_kfd_resume(rdev); + if (r) + return r; + return 0; } @@ -8477,6 +8483,7 @@ int cik_resume(struct radeon_device *rdev) */ int cik_suspend(struct radeon_device *rdev) { + radeon_kfd_suspend(rdev); radeon_pm_suspend(rdev); dce6_audio_fini(rdev); radeon_vm_manager_fini(rdev); diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c index 594020e..e3af85b 100644 --- a/drivers/gpu/drm/radeon/radeon_kfd.c +++ b/drivers/gpu/drm/radeon/radeon_kfd.c @@ -124,6 +124,22 @@ void radeon_kfd_device_fini(struct radeon_device *rdev) } } +void radeon_kfd_suspend(struct radeon_device *rdev) +{ + if (rdev->kfd) + kgd2kfd->suspend(rdev->kfd); +} + +int radeon_kfd_resume(struct radeon_device *rdev) +{ + int r = 0; + + if (rdev->kfd) + r = kgd2kfd->resume(rdev->kfd); + + return r; +} + static u32 pool_to_domain(enum kgd_memory_pool p) { switch (p) {