From patchwork Fri Dec 14 14:22:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 10731249 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 18E4913AD for ; Fri, 14 Dec 2018 14:22:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0A082D535 for ; Fri, 14 Dec 2018 14:22:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 950082D534; Fri, 14 Dec 2018 14:22:43 +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 350312D535 for ; Fri, 14 Dec 2018 14:22:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EAAD6F525; Fri, 14 Dec 2018 14:22:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 862EF6F523 for ; Fri, 14 Dec 2018 14:22:36 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id 96so5616430wrb.2 for ; Fri, 14 Dec 2018 06:22:36 -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; bh=B6KKzqZhmrvKOYN6ED9mcoMzLhzOfCHFL8+e2184smI=; b=b+CSp+Ob3JoTQc1LNk1lGn2rA4oQciG1SgQDN73XZqVowaj273l8M6EFLg+4Y70hdr 58qm/DR/WsfcviaOADGVc7d39UyGc1O61OjVP4Jq9ZFL5O05yeCDSG2wye0hqwADnNuA m8nsAkQe06o236jW2R5aBC+BwQWc6pnIiimDV2SXz87f6mZvV8rDq4R1gYDf678HBXfd 0vHEGpBJtRb0wRWoVOkI/gSgkx/vUV+5thYd12FKTW7344FhxYvHKGMYkls4usV8vIA+ ocULojzX1mzJII4qlQsB+HY10ix4Mr4aOrbU2FuByTpIOAkdzD0O/X91jsT+PSu2LwOw foRA== X-Gm-Message-State: AA+aEWZWW9p08WM8LkHs2yrqV6cx5DpehEHVd7pMn9TTXrSHXMT7MsZG sAW0RP8w9RYtm9N1lG5H03GK1g== X-Google-Smtp-Source: AFSGD/UqxrZoOHYqy0eFlkd+RGzUaYthK6wcqifIVgODMwqns32SoTW73Iv4mc8UNO8gSdQ9dPJ+eA== X-Received: by 2002:adf:f785:: with SMTP id q5mr2982881wrp.9.1544797354960; Fri, 14 Dec 2018 06:22:34 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:f:6020:ed2e:a6ad:f6ef:ff8e]) by smtp.gmail.com with ESMTPSA id m4sm25793829wmi.3.2018.12.14.06.22.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Dec 2018 06:22:34 -0800 (PST) From: Vincent Guittot To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, rjw@rjwysocki.net, thara.gopinath@linaro.org, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, airlied@linux.ie, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 3/3] drm/i915: Move to new PM core fields Date: Fri, 14 Dec 2018 15:22:27 +0100 Message-Id: <1544797347-20601-4-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544797347-20601-1-git-send-email-vincent.guittot@linaro.org> References: <1544797347-20601-1-git-send-email-vincent.guittot@linaro.org> 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: ulf.hansson@linaro.org, Vincent Guittot MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP With jiffies been replaced by raw ns in PM core accounting, 915 driver is updated to use this new time infrastructure. Signed-off-by: Vincent Guittot --- drivers/gpu/drm/i915/i915_pmu.c | 12 ++++++------ drivers/gpu/drm/i915/i915_pmu.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index d6c8f8f..cf6437d 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -493,14 +493,14 @@ static u64 get_rc6(struct drm_i915_private *i915) */ if (kdev->power.runtime_status == RPM_SUSPENDED) { if (!i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur) - i915->pmu.suspended_jiffies_last = - kdev->power.suspended_jiffies; + i915->pmu.suspended_time_last = + kdev->power.suspended_time; - val = kdev->power.suspended_jiffies - - i915->pmu.suspended_jiffies_last; - val += jiffies - kdev->power.accounting_timestamp; + val = kdev->power.suspended_time - + i915->pmu.suspended_time_last; + val += ktime_to_ns(ktime_get()) - + kdev->power.accounting_timestamp; - val = jiffies_to_nsecs(val); val += i915->pmu.sample[__I915_SAMPLE_RC6].cur; i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur = val; diff --git a/drivers/gpu/drm/i915/i915_pmu.h b/drivers/gpu/drm/i915/i915_pmu.h index 7f164ca..3dc2a30 100644 --- a/drivers/gpu/drm/i915/i915_pmu.h +++ b/drivers/gpu/drm/i915/i915_pmu.h @@ -95,9 +95,9 @@ struct i915_pmu { */ struct i915_pmu_sample sample[__I915_NUM_PMU_SAMPLERS]; /** - * @suspended_jiffies_last: Cached suspend time from PM core. + * @suspended_time_last: Cached suspend time from PM core. */ - unsigned long suspended_jiffies_last; + u64 suspended_time_last; /** * @i915_attr: Memory block holding device attributes. */