From patchwork Mon Aug 12 16:43:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 2843179 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 7F7B19F271 for ; Mon, 12 Aug 2013 17:50:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B500204F0 for ; Mon, 12 Aug 2013 17:50:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AF59320340 for ; Mon, 12 Aug 2013 17:50:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A1334E76B5 for ; Mon, 12 Aug 2013 10:50:41 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qe0-f44.google.com (mail-qe0-f44.google.com [209.85.128.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 29ED0E639F for ; Mon, 12 Aug 2013 09:44:58 -0700 (PDT) Received: by mail-qe0-f44.google.com with SMTP id 6so3762632qeb.3 for ; Mon, 12 Aug 2013 09:44:57 -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=kx3g1A9X9AgP4uREwYpapb8WjRT/GAt5Nv1sY4ybopQ=; b=cXcTCm7UZ+Ke9/bEBl0F0FZju7z57W2TLorq2szOwicVx132fJA/ja0qwa0mLmvZ1z 7Cy/9+P5FfHD5H3P7/Km6IpOY+n+CBaAPqLAvcwuNgdLpFRKk/lptZPOcElZaYXeOGCp NYqeVcJrmxZJ4li5v2l2slBxRviYKpXgXSkQppmuOWaUT18CS3xYIWWjI93/hbJLIDog 74ZF6Zr+e2NkL5FWWJwzYFUX+J3CILq4hf6ZVWuzOttsE7SES9y1hS+skf1La4QyaApb egTYFZvLsQMjUhnwQO3kzVIUexKGasGn+tq/EaXlZepRKiUBk5UpjIW3tBEZ1IIZjW3y mu+w== X-Received: by 10.229.32.9 with SMTP id a9mr6087061qcd.74.1376325897771; Mon, 12 Aug 2013 09:44:57 -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 i4sm2016268qev.8.2013.08.12.09.44.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 09:44:57 -0700 (PDT) From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 51/53] drm/radeon/dpm: implement UVD powergating for CI Date: Mon, 12 Aug 2013 12:43:43 -0400 Message-Id: <1376325825-1993-52-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1376325825-1993-1-git-send-email-alexander.deucher@amd.com> References: <1376325825-1993-1-git-send-email-alexander.deucher@amd.com> 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.9 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 Disable the UVD block when not in use to save power. The block is not actually powergated on CI, but we switch between UVD DPM (where the uvd clocks are adjusted on demand) and clocks off. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/ci_dpm.c | 7 +------ drivers/gpu/drm/radeon/radeon_asic.c | 1 + drivers/gpu/drm/radeon/radeon_asic.h | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index 6e3d387..e4d9d50 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c @@ -677,7 +677,7 @@ static int ci_power_control_set_level(struct radeon_device *rdev) return ret; } -static void ci_dpm_powergate_uvd(struct radeon_device *rdev, bool gate) +void ci_dpm_powergate_uvd(struct radeon_device *rdev, bool gate) { ci_update_uvd_dpm(rdev, gate); } @@ -4674,11 +4674,6 @@ int ci_dpm_set_power_state(struct radeon_device *rdev) return ret; } #endif - ret = ci_update_uvd_dpm(rdev, false); - if (ret) { - DRM_ERROR("ci_update_uvd_dpm failed\n"); - return ret; - } ret = ci_update_sclk_t(rdev); if (ret) { DRM_ERROR("ci_update_sclk_t failed\n"); diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index 63b6aae..61c0644 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c @@ -2470,6 +2470,7 @@ static struct radeon_asic ci_asic = { .debugfs_print_current_performance_level = &ci_dpm_debugfs_print_current_performance_level, .force_performance_level = &ci_dpm_force_performance_level, .vblank_too_short = &ci_dpm_vblank_too_short, + .powergate_uvd = &ci_dpm_powergate_uvd, }, .pflip = { .pre_page_flip = &evergreen_pre_page_flip, diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h index 9060757..5630291 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h @@ -766,6 +766,7 @@ void ci_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, int ci_dpm_force_performance_level(struct radeon_device *rdev, enum radeon_dpm_forced_level level); bool ci_dpm_vblank_too_short(struct radeon_device *rdev); +void ci_dpm_powergate_uvd(struct radeon_device *rdev, bool gate); int kv_dpm_init(struct radeon_device *rdev); int kv_dpm_enable(struct radeon_device *rdev);