From patchwork Thu Aug 29 21:24:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 2851624 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 98EBA9F2F4 for ; Thu, 29 Aug 2013 21:27:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3BCF20559 for ; Thu, 29 Aug 2013 21:27:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0516020556 for ; Thu, 29 Aug 2013 21:27:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFDEBE7A9E for ; Thu, 29 Aug 2013 14:27:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B5EBE5CF9 for ; Thu, 29 Aug 2013 14:25:01 -0700 (PDT) Received: by mail-ve0-f173.google.com with SMTP id cy12so763331veb.4 for ; Thu, 29 Aug 2013 14:25:00 -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=l2iaAmDDrg6scqhcbl2O1PIOscl7Yl5dCaFiY8rF2Pk=; b=LI7dcFBQ70uIhKFg8jI0zatYIrwaxXSqhygk/43abTnpEIjaIgqpTsBJCL1kYInWL1 mst2+ijHBiwSfwgZtVx4tMXTcYeWPkAu9KtYyZe8pBaRzC9IvswL8X75h8C9XhkTw5cw HPYWhGY1IxAgsGtI9KevfuuieBLIvrWFUGp6aoO/fJ4iyQkqwCOZ2GGcTi3+P/2Kqm7m pPXrpglvk3/xelFoc6QlQ7dquSgfxUKMj35G9NmMM6fSLz0dTNL7fn8u6ZOZwG4JE0qt VCdrTdat0143tiR401YTQ5ikawwh5l4XdFNp14M4S+PEa0eSYwwmmE36mWFTUZa1Nyd0 khAw== X-Received: by 10.58.201.69 with SMTP id jy5mr2503041vec.29.1377811500614; Thu, 29 Aug 2013 14:25:00 -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:25:00 -0700 (PDT) From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm/radeon/dpm: only need to reprogram uvd if uvd pg is enabled Date: Thu, 29 Aug 2013 17:24:50 -0400 Message-Id: <1377811490-4649-3-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1377811490-4649-1-git-send-email-alexander.deucher@amd.com> References: <1377811490-4649-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.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 Avoid needless uvd reprogramming if uvd powergating is disabled. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/kv_dpm.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c index a102077..15a6f67 100644 --- a/drivers/gpu/drm/radeon/kv_dpm.c +++ b/drivers/gpu/drm/radeon/kv_dpm.c @@ -1491,17 +1491,20 @@ void kv_dpm_powergate_uvd(struct radeon_device *rdev, bool gate) pi->uvd_power_gated = gate; if (gate) { - uvd_v1_0_stop(rdev); - cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, false); + if (pi->caps_uvd_pg) { + uvd_v1_0_stop(rdev); + cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, false); + } kv_update_uvd_dpm(rdev, gate); if (pi->caps_uvd_pg) kv_notify_message_to_smu(rdev, PPSMC_MSG_UVDPowerOFF); } else { - if (pi->caps_uvd_pg) + if (pi->caps_uvd_pg) { kv_notify_message_to_smu(rdev, PPSMC_MSG_UVDPowerON); - uvd_v4_2_resume(rdev); - uvd_v1_0_start(rdev); - cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, true); + uvd_v4_2_resume(rdev); + uvd_v1_0_start(rdev); + cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, true); + } kv_update_uvd_dpm(rdev, gate); } }