From patchwork Thu Aug 29 21:24:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 2851622 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 1C8039F2F4 for ; Thu, 29 Aug 2013 21:25:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3A6DB20182 for ; Thu, 29 Aug 2013 21:25:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0298920181 for ; Thu, 29 Aug 2013 21:25:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 05BC2E7A95 for ; Thu, 29 Aug 2013 14:25:28 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by gabe.freedesktop.org (Postfix) with ESMTP id 122D7E5CF9 for ; Thu, 29 Aug 2013 14:24:59 -0700 (PDT) Received: by mail-vb0-f46.google.com with SMTP id p13so728103vbe.19 for ; Thu, 29 Aug 2013 14:24:59 -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; bh=But6ylCad1d3f+V1MQVSAobRKxUtZDRra1UeXXamRLg=; b=tLTh7WmvhU4qfZFE5aPRp3OtR+K12oPwm4ssv/oK9SOMONpKr3ZYM5PHLCeBzgFDGI 6GHg+CklsrxVsgsFD0uuf5zinZ5kAZ6Xm3NBmwtLTB/Pjp55kMN85y66brsIRut4q+Dk DIMsnJ/9g++CDRTrdfzfNL/ZwFWU1Cx0F8f8aswSLT4bR1JEpDXA1jYNn6fX5Ddu9TX7 f/jhBPuUDTV70mVDfzu+pEigzNmmBBjWezDz/rgGDwsgr/yZrRbYYwhib+bYMQZ1nBkU 52TOcZgsmwVmQgvE6TVH2G8v4n6S3egAeXsQ6fXtnwcrI+m+QFEVcRNM0Sw1V1g2ilKo X/1w== X-Received: by 10.58.97.238 with SMTP id ed14mr53246veb.34.1377811499319; Thu, 29 Aug 2013 14:24:59 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by mx.google.com with ESMTPSA id ee5sm7699210vdb.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 29 Aug 2013 14:24:58 -0700 (PDT) From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume Date: Thu, 29 Aug 2013 17:24:48 -0400 Message-Id: <1377811490-4649-1-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 1.8.3.1 Cc: Alex Deucher X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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 For powergating, we just need to re-init the registers, there is no need to resture the uvd BOs. This just adds needless work when powergating uvd for playback while the system is on. We only need to restore the uvd BOs on an actual resume from suspend or when the driver loads. Signed-off-by: Alex Deucher Reviewed-by: Christian König --- drivers/gpu/drm/radeon/cik.c | 13 ++++++++----- drivers/gpu/drm/radeon/uvd_v4_2.c | 5 ----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index e336a31..79124f8 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c @@ -7051,12 +7051,15 @@ static int cik_startup(struct radeon_device *rdev) return r; } - r = uvd_v4_2_resume(rdev); + r = radeon_uvd_resume(rdev); if (!r) { - r = radeon_fence_driver_start_ring(rdev, - R600_RING_TYPE_UVD_INDEX); - if (r) - dev_err(rdev->dev, "UVD fences init error (%d).\n", r); + r = uvd_v4_2_resume(rdev); + if (!r) { + r = radeon_fence_driver_start_ring(rdev, + R600_RING_TYPE_UVD_INDEX); + if (r) + dev_err(rdev->dev, "UVD fences init error (%d).\n", r); + } } if (r) rdev->ring[R600_RING_TYPE_UVD_INDEX].ring_size = 0; diff --git a/drivers/gpu/drm/radeon/uvd_v4_2.c b/drivers/gpu/drm/radeon/uvd_v4_2.c index d7e4807..d04d507 100644 --- a/drivers/gpu/drm/radeon/uvd_v4_2.c +++ b/drivers/gpu/drm/radeon/uvd_v4_2.c @@ -39,11 +39,6 @@ int uvd_v4_2_resume(struct radeon_device *rdev) { uint64_t addr; uint32_t size; - int r; - - r = radeon_uvd_resume(rdev); - if (r) - return r; /* programm the VCPU memory controller bits 0-27 */ addr = rdev->uvd.gpu_addr >> 3;