From patchwork Mon Jun 10 21:44:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 10985529 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 8DB451850 for ; Mon, 10 Jun 2019 21:45:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D45626E73 for ; Mon, 10 Jun 2019 21:45:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FB532848B; Mon, 10 Jun 2019 21:45:28 +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 2DAAB26E73 for ; Mon, 10 Jun 2019 21:45:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BCA5E8914F; Mon, 10 Jun 2019 21:45:26 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5950E8914F for ; Mon, 10 Jun 2019 21:45:25 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2019 14:45:24 -0700 X-ExtLoop1: 1 Received: from ldmartin-desk.jf.intel.com ([10.24.10.152]) by orsmga005.jf.intel.com with ESMTP; 10 Jun 2019 14:45:24 -0700 From: Lucas De Marchi To: intel-gfx@lists.freedesktop.org Date: Mon, 10 Jun 2019 14:44:49 -0700 Message-Id: <20190610214449.9447-1-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 0/3] Use ranges for voltage level lookup X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lucas De Marchi Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Version 2 of https://patchwork.freedesktop.org/series/61742/, this time applied to all possible platforms, not only Ice Lake. I also changed the if else chain to use big to small frequency values according to the suggestion from Ville. $ git grep -e "static.*_calc_voltage_level" -- drivers/gpu/drm/i915 drivers/gpu/drm/i915/intel_cdclk.c:static u8 vlv_calc_voltage_level(struct drm_i915_private *dev_priv, int cdclk) drivers/gpu/drm/i915/intel_cdclk.c:static u8 bdw_calc_voltage_level(int cdclk) drivers/gpu/drm/i915/intel_cdclk.c:static u8 skl_calc_voltage_level(int cdclk) drivers/gpu/drm/i915/intel_cdclk.c:static u8 bxt_calc_voltage_level(int cdclk) drivers/gpu/drm/i915/intel_cdclk.c:static u8 cnl_calc_voltage_level(int cdclk) drivers/gpu/drm/i915/intel_cdclk.c:static u8 icl_calc_voltage_level(int cdclk) vlv: already using ranges (and not applicable for chv) bdw: not applicable as levels don't respect the ranges (confirmed in spec, too) bxt: not applicable as it just divides the cdclk The rest is in this series. Lucas De Marchi (3): drm/i915/icl: use ranges for voltage level lookup drm/i915/cnl: use ranges for voltage level lookup drm/i915/skl: use ranges for voltage level lookup drivers/gpu/drm/i915/intel_cdclk.c | 52 ++++++++++-------------------- 1 file changed, 17 insertions(+), 35 deletions(-)