From patchwork Wed Jan 16 18:46:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10766809 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C2F61580 for ; Wed, 16 Jan 2019 18:46:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F13CA2EBBA for ; Wed, 16 Jan 2019 18:46:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4CFE2EBDC; Wed, 16 Jan 2019 18:46:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 94B6D2EBBA for ; Wed, 16 Jan 2019 18:46:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B51DF6F1CC; Wed, 16 Jan 2019 18:46:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 070066F1CC for ; Wed, 16 Jan 2019 18:46:35 +0000 (UTC) Received: by mail-pf1-x444.google.com with SMTP id g62so3465122pfd.12 for ; Wed, 16 Jan 2019 10:46:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FU7vnujm7PFqQbun8zmDwXg0wlx5eTmKlDoI+BggiOU=; b=dWZz+E+nJJVgBO6c4F+3EvaO62ZTAanPIW2fkcCKFS1LAuet0F+t84m3wvR8O3b3My q74RGxy0dgi6zPZABc7z2RFQd4qhS6Qylq6uoLr/nPUjYhqguzXDlHbLDVPquqrg5Gz+ wm19UZwhBdGX6ZSonRc0RZBj65RVQShCNs9b9OhAcSNZ7OaUvQNoG6r1GE7vUxZ3XzkD mQfK6vbQD54jda0aMaMTnPBT0dwdKN2nyxclNS6g8jWHdwcX1125Xzw5m24roB8Qps3E 5noO6zJacz3C3Rq3c8v7ow/OuJMl46LVxavlIQO1v5U7/9Xp9AMUQBmXtC/ADorqKxMg RINQ== X-Gm-Message-State: AJcUukezqfI9iP/P4adzzcEnti4/vDkN4R6VjIVsE7wvYEDmYrJP716L d0fPR+pbUfR1x4k3SqyZipkbyw== X-Google-Smtp-Source: ALg8bN415uNxmPPZwJn8lkLzuqEUKrI/rXNceInBgwImlGAIb5dSZBe4/+wy2j3BE49nDqGts9qTLw== X-Received: by 2002:a62:6ec8:: with SMTP id j191mr11252708pfc.198.1547664394565; Wed, 16 Jan 2019 10:46:34 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:c8e0:70d7:4be7:a36]) by smtp.gmail.com with ESMTPSA id k186sm8138902pge.13.2019.01.16.10.46.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 10:46:33 -0800 (PST) From: Douglas Anderson To: Rob Clark , Jordan Crouse Subject: [PATCH v2 2/2] drm/msm: Cleanup A6XX opp-level reading Date: Wed, 16 Jan 2019 10:46:22 -0800 Message-Id: <20190116184623.77136-2-dianders@chromium.org> X-Mailer: git-send-email 2.20.1.97.g81188d93c3-goog In-Reply-To: <20190116184623.77136-1-dianders@chromium.org> References: <20190116184623.77136-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rajendra Nayak , David Airlie , linux-arm-msm@vger.kernel.org, Sharat Masetty , Douglas Anderson , dri-devel@lists.freedesktop.org, Stephen Boyd , Mamta Shukla , Viresh Kumar , Andy Gross , Colin Ian King , "Kristian H . Kristensen" , Bjorn Andersson , freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The patch ("OPP: Add support for parsing the 'opp-level' property") adds an API enabling a cleaner way to read the opp-level. Let's use the new API. Signed-off-by: Douglas Anderson Reviewed-by: Jordan Crouse --- Obviously this can't land until we have a tree that contains the patch adding the API. I believe that means we'll want to target this patch for 5.2. Luckily it's fine to wait since this patch has no functional changes--it's all cleanup. Changes in v2: - Split into two patches to facilitate landing. drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index ce1b3cc4bf6d..900f18dc1577 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -928,25 +928,20 @@ static int a6xx_gmu_memory_probe(struct a6xx_gmu *gmu) } /* Return the 'arc-level' for the given frequency */ -static u32 a6xx_gmu_get_arc_level(struct device *dev, unsigned long freq) +static unsigned int a6xx_gmu_get_arc_level(struct device *dev, + unsigned long freq) { struct dev_pm_opp *opp; - struct device_node *np; - u32 val = 0; + unsigned int val; if (!freq) return 0; - opp = dev_pm_opp_find_freq_exact(dev, freq, true); + opp = dev_pm_opp_find_freq_exact(dev, freq, true); if (IS_ERR(opp)) return 0; - np = dev_pm_opp_get_of_node(opp); - - if (np) { - of_property_read_u32(np, "opp-level", &val); - of_node_put(np); - } + val = dev_pm_opp_get_level(opp); dev_pm_opp_put(opp); @@ -982,7 +977,7 @@ static int a6xx_gmu_rpmh_arc_votes_init(struct device *dev, u32 *votes, /* Construct a vote for each frequency */ for (i = 0; i < freqs_count; i++) { u8 pindex = 0, sindex = 0; - u32 level = a6xx_gmu_get_arc_level(dev, freqs[i]); + unsigned int level = a6xx_gmu_get_arc_level(dev, freqs[i]); /* Get the primary index that matches the arc level */ for (j = 0; j < pri_count; j++) {