From patchwork Thu Apr 23 21:28:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 6265441 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2C1DA9F54F for ; Thu, 23 Apr 2015 21:37:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 358E3203A9 for ; Thu, 23 Apr 2015 21:37:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2BCEF2037C for ; Thu, 23 Apr 2015 21:37:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 054E66E81C; Thu, 23 Apr 2015 14:37:12 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lynxeye.de (ns.lynxeye.de [87.118.118.114]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E3686E819 for ; Thu, 23 Apr 2015 14:37:10 -0700 (PDT) Received: by lynxeye.de (Postfix, from userid 501) id 82F6F26C2003; Thu, 23 Apr 2015 23:28:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from antimon.Speedport_W_504V_Typ_A (p4FD7DE34.dip0.t-ipconnect.de [79.215.222.52]) by lynxeye.de (Postfix) with ESMTPA id 8E60F26C2002; Thu, 23 Apr 2015 23:28:25 +0200 (CEST) From: Lucas Stach To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie Subject: [PATCH 2/2] drm/radeon: remove bapm callbacks Date: Thu, 23 Apr 2015 23:28:13 +0200 Message-Id: <1429824493-3162-2-git-send-email-dev@lynxeye.de> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1429824493-3162-1-git-send-email-dev@lynxeye.de> References: <1429824493-3162-1-git-send-email-dev@lynxeye.de> Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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-Virus-Scanned: ClamAV using ClamSMTP Trying to disable BAPM on battery power does not fix the problematic Trinity mobile parts. Fixing those probably need a more complex solution, like doing a complete reinit of the DPM state. This will take more work and most likely it will not be possible to map this to a single callback. Even worse trying to change the BAPM state mid flight is breaking BAPM on Richland mobile parts that are otherwise completely stable with BAPM enabled. As there are no users of this hook anymore we can just remove the calling infrastructure. Signed-off-by: Lucas Stach --- I've did some pretty extensive tests with one of the problematic Trinity mobile parts. I was able to figure out a stable config with BAPM enabled for this, but unfortunately the power consumption rose quite a bit. So on Trinity one has to disable BAPM while on battery power. I found a sequence to enable/disable BAPM mid flight without hanging the GPU, but the SMC seemed to be stuck after that, as no DPM power level changes were happening anymore. --- drivers/gpu/drm/radeon/radeon.h | 2 -- drivers/gpu/drm/radeon/radeon_asic.c | 1 - drivers/gpu/drm/radeon/radeon_asic.h | 1 - drivers/gpu/drm/radeon/radeon_pm.c | 4 ---- drivers/gpu/drm/radeon/trinity_dpm.c | 11 ----------- 5 files changed, 19 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 33d5a4f..93659d2 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -1980,7 +1980,6 @@ struct radeon_asic { int (*force_performance_level)(struct radeon_device *rdev, enum radeon_dpm_forced_level level); bool (*vblank_too_short)(struct radeon_device *rdev); void (*powergate_uvd)(struct radeon_device *rdev, bool gate); - void (*enable_bapm)(struct radeon_device *rdev, bool enable); void (*fan_ctrl_set_mode)(struct radeon_device *rdev, u32 mode); u32 (*fan_ctrl_get_mode)(struct radeon_device *rdev); int (*set_fan_speed_percent)(struct radeon_device *rdev, u32 speed); @@ -2949,7 +2948,6 @@ static inline void radeon_ring_write(struct radeon_ring *ring, uint32_t v) #define radeon_dpm_force_performance_level(rdev, l) rdev->asic->dpm.force_performance_level((rdev), (l)) #define radeon_dpm_vblank_too_short(rdev) rdev->asic->dpm.vblank_too_short((rdev)) #define radeon_dpm_powergate_uvd(rdev, g) rdev->asic->dpm.powergate_uvd((rdev), (g)) -#define radeon_dpm_enable_bapm(rdev, e) rdev->asic->dpm.enable_bapm((rdev), (e)) /* Common functions */ /* AGP */ diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index 2a33e38..fa11abc 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c @@ -1818,7 +1818,6 @@ static struct radeon_asic trinity_asic = { .print_power_state = &trinity_dpm_print_power_state, .debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level, .force_performance_level = &trinity_dpm_force_performance_level, - .enable_bapm = &trinity_dpm_enable_bapm, }, .pflip = { .page_flip = &evergreen_page_flip, diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h index 85d76da..605be51 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h @@ -673,7 +673,6 @@ void trinity_dpm_debugfs_print_current_performance_level(struct radeon_device *r struct seq_file *m); int trinity_dpm_force_performance_level(struct radeon_device *rdev, enum radeon_dpm_forced_level level); -void trinity_dpm_enable_bapm(struct radeon_device *rdev, bool enable); /* DCE6 - SI */ void dce6_bandwidth_update(struct radeon_device *rdev); diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index c1ba83a..a78d146 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -74,10 +74,6 @@ void radeon_pm_acpi_event_handler(struct radeon_device *rdev) rdev->pm.dpm.ac_power = true; else rdev->pm.dpm.ac_power = false; - if (rdev->family == CHIP_ARUBA) { - if (rdev->asic->dpm.enable_bapm) - radeon_dpm_enable_bapm(rdev, rdev->pm.dpm.ac_power); - } mutex_unlock(&rdev->pm.mutex); } else if (rdev->pm.pm_method == PM_METHOD_PROFILE) { if (rdev->pm.profile == PM_PROFILE_AUTO) { diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c index 38dacb7..e473455 100644 --- a/drivers/gpu/drm/radeon/trinity_dpm.c +++ b/drivers/gpu/drm/radeon/trinity_dpm.c @@ -1069,17 +1069,6 @@ static void trinity_update_requested_ps(struct radeon_device *rdev, pi->requested_rps.ps_priv = &pi->requested_ps; } -void trinity_dpm_enable_bapm(struct radeon_device *rdev, bool enable) -{ - struct trinity_power_info *pi = trinity_get_pi(rdev); - - if (pi->enable_bapm) { - trinity_acquire_mutex(rdev); - trinity_dpm_bapm_enable(rdev, enable); - trinity_release_mutex(rdev); - } -} - int trinity_dpm_enable(struct radeon_device *rdev) { struct trinity_power_info *pi = trinity_get_pi(rdev);