From patchwork Sun Oct 20 18:31:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Demers X-Patchwork-Id: 3073661 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 85BDE9F372 for ; Sun, 20 Oct 2013 18:31:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC8A3202E5 for ; Sun, 20 Oct 2013 18:31:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C2F67202D1 for ; Sun, 20 Oct 2013 18:31:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B044FE6213 for ; Sun, 20 Oct 2013 11:31:18 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ie0-f178.google.com (mail-ie0-f178.google.com [209.85.223.178]) by gabe.freedesktop.org (Postfix) with ESMTP id B8F14E5C21 for ; Sun, 20 Oct 2013 11:31:06 -0700 (PDT) Received: by mail-ie0-f178.google.com with SMTP id to1so12977933ieb.23 for ; Sun, 20 Oct 2013 11:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=IweI4iFuB9aAj6z9oxFHxXmZK4RYEfwgcnu6w8AGB44=; b=qvDiwrvp5X2J2aO+YhbwqDrLNDNSRdtbdquG7UqsMznh05yvK4D6p54azQeeAZsZOE dOhSfNenM4egI90ChCrTDNXlk4BSrKOoUl9O4Tcmv49Kq+HSy/Xsh+7YsKPmCP1eIYmu nYsCh6DqwYZdkuSq5x/trRrRcE41YmLdW1lcgRBELCaVzbdjvgqLs+7oX3j9wzdxuUcQ /ab76wSQ6+yRFLseS/ikgrZC9MydGdm9M0uXBqsX1K6rbhi8WVl7lOL8xaWPVD3q6aUZ zCBtl9z/ZkMcM3adXHKdBqf1GGpsxr2E2is4SzdSATcsN2We5uCK91l5LcjyiNgB7+OM CncA== X-Received: by 10.43.98.202 with SMTP id cp10mr8059766icc.28.1382293865913; Sun, 20 Oct 2013 11:31:05 -0700 (PDT) Received: from localhost.localdomain (209-197-165-170.cpe.distributel.net. [209.197.165.170]) by mx.google.com with ESMTPSA id ka5sm25796030igb.2.2013.10.20.11.31.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Oct 2013 11:31:05 -0700 (PDT) From: Alexandre Demers To: dri-devel@lists.freedesktop.org Subject: [PATCH] simplifying low state adjustment's logic Date: Sun, 20 Oct 2013 14:31:04 -0400 Message-Id: <1382293864-19856-1-git-send-email-alexandre.f.demers@gmail.com> X-Mailer: git-send-email 1.8.4.1 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=-4.5 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 While working on a dpm bug (https://bugs.freedesktop.org/show_bug.cgi?id=69723), I stumbled on a couple of lines where we were reading and setting back the same values for no obvious reason. --- drivers/gpu/drm/radeon/ni_dpm.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c index f263390..2a10bbe 100644 --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c @@ -841,21 +841,12 @@ static void ni_apply_state_adjust_rules(struct radeon_device *rdev, if (disable_mclk_switching) { mclk = ps->performance_levels[ps->performance_level_count - 1].mclk; - sclk = ps->performance_levels[0].sclk; - vddc = ps->performance_levels[0].vddc; vddci = ps->performance_levels[ps->performance_level_count - 1].vddci; - } else { - sclk = ps->performance_levels[0].sclk; - mclk = ps->performance_levels[0].mclk; - vddc = ps->performance_levels[0].vddc; - vddci = ps->performance_levels[0].vddci; - } - /* adjusted low state */ - ps->performance_levels[0].sclk = sclk; - ps->performance_levels[0].mclk = mclk; - ps->performance_levels[0].vddc = vddc; - ps->performance_levels[0].vddci = vddci; + /* adjusted low state */ + ps->performance_levels[0].mclk = mclk; + ps->performance_levels[0].vddci = vddci; + } btc_skip_blacklist_clocks(rdev, max_limits->sclk, max_limits->mclk, &ps->performance_levels[0].sclk,