From mboxrd@z Thu Jan 1 00:00:00 1970 From: alexdeucher@gmail.com Subject: [PATCH 091/165] drm/radeon/dpm: fixup dynamic state adjust for TN Date: Wed, 26 Jun 2013 09:22:51 -0400 Message-ID: <1372253045-17042-92-git-send-email-alexdeucher@gmail.com> References: <1372253045-17042-1-git-send-email-alexdeucher@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-qa0-f41.google.com (mail-qa0-f41.google.com [209.85.216.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 904FCE6339 for ; Wed, 26 Jun 2013 06:25:17 -0700 (PDT) Received: by mail-qa0-f41.google.com with SMTP id f14so1570493qak.0 for ; Wed, 26 Jun 2013 06:25:17 -0700 (PDT) In-Reply-To: <1372253045-17042-1-git-send-email-alexdeucher@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org Cc: Alex Deucher List-Id: dri-devel@lists.freedesktop.org From: Alex Deucher Use a dedicated copy of the current power state since we may have to adjust it on the fly. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/trinity_dpm.c | 5 +++++ drivers/gpu/drm/radeon/trinity_dpm.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c index 1b3822f..0c1b50a 100644 --- a/drivers/gpu/drm/radeon/trinity_dpm.c +++ b/drivers/gpu/drm/radeon/trinity_dpm.c @@ -1379,6 +1379,11 @@ static void trinity_apply_state_adjust_rules(struct radeon_device *rdev) bool force_high; u32 num_active_displays = rdev->pm.dpm.new_active_crtc_count; + /* point to the hw copy since this function will modify the ps */ + pi->hw_ps = *ps; + rdev->pm.dpm.hw_ps.ps_priv = &pi->hw_ps; + ps = &pi->hw_ps; + if (rps->class & ATOM_PPLIB_CLASSIFICATION_THERMAL) return trinity_patch_thermal_state(rdev, ps, current_ps); diff --git a/drivers/gpu/drm/radeon/trinity_dpm.h b/drivers/gpu/drm/radeon/trinity_dpm.h index 31100ac..c663aed 100644 --- a/drivers/gpu/drm/radeon/trinity_dpm.h +++ b/drivers/gpu/drm/radeon/trinity_dpm.h @@ -110,6 +110,7 @@ struct trinity_power_info { bool enable_dpm; bool enable_sclk_ds; bool uvd_dpm; + struct trinity_ps hw_ps; }; #define TRINITY_AT_DFLT 30 -- 1.7.7.5