From patchwork Tue Nov 26 06:13:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Demers X-Patchwork-Id: 3236711 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 18A25C045B for ; Tue, 26 Nov 2013 06:13:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FA752035C for ; Tue, 26 Nov 2013 06:13:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1200D2034F for ; Tue, 26 Nov 2013 06:13:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 92DD4FB3C7; Mon, 25 Nov 2013 22:13:53 -0800 (PST) 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 B5DA7FB3C7 for ; Mon, 25 Nov 2013 22:13:51 -0800 (PST) Received: by mail-ie0-f178.google.com with SMTP id lx4so8452283iec.37 for ; Mon, 25 Nov 2013 22:13:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=dBoHMD7LgYK9FTm2ofenXT894kaSrjoxRDSkiGd+Qq0=; b=tTE5/a7+BiEQOvzcZ2m3XNfejNz6RgzlKNy3wcpAcJiM2uCkATzP/cgRKGriYmYQmy Ng1lQ6ttVIcbjrYmXZkqzvP+HStomdX0F0k7gQO5DAUpoxxCoCcu3Wi9RxGpviUJFFTO Sr3ILAKqRbfoeI8vNpM3jwm0HmYaTuSaC5WlLKkg2YXJK/TDf+D/m/wjPJWxsVvf+WaC MWKmwVK8KzLy8H2ykVJyqmtgt2LJlEwD2GDXq3GSMpI7suxEVXEE9i1E4H8FXWgEFGYo UVPEm8rruL6S7xbOw7ZsFlNabfUamoDIqgH11D8sHxnI/fpcL49ZNoFxilgA6MThrR5u HaIg== X-Received: by 10.50.117.3 with SMTP id ka3mr15723893igb.15.1385446431052; Mon, 25 Nov 2013 22:13:51 -0800 (PST) Received: from localhost.localdomain (198-91-137-67.cpe.distributel.net. [198.91.137.67]) by mx.google.com with ESMTPSA id a17sm30113749ign.2.2013.11.25.22.13.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Nov 2013 22:13:50 -0800 (PST) From: Alexandre Demers To: dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/radeon/dpm: simplifying low state adjustment's logic for NI Date: Tue, 26 Nov 2013 01:13:48 -0500 Message-Id: <1385446428-6922-1-git-send-email-alexandre.f.demers@gmail.com> X-Mailer: git-send-email 1.8.4.2 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@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 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 upon a couple of lines in NI dpm where we were reading and setting back the same values for no obvious reason. Simplified the logic. Signed-off-by: Alexandre Demers --- 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,