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: 10731259 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 B800A746 for ; Fri, 14 Dec 2018 14:22:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B0812D532 for ; Fri, 14 Dec 2018 14:22:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F78C2D543; Fri, 14 Dec 2018 14:22:53 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0E8A2D532 for ; Fri, 14 Dec 2018 14:22:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729793AbeLNOWw (ORCPT ); Fri, 14 Dec 2018 09:22:52 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43128 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730132AbeLNOWh (ORCPT ); Fri, 14 Dec 2018 09:22:37 -0500 Received: by mail-wr1-f67.google.com with SMTP id r10so5594291wrs.10 for ; Fri, 14 Dec 2018 06:22:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=B6KKzqZhmrvKOYN6ED9mcoMzLhzOfCHFL8+e2184smI=; b=QAn73MFmuHG4n98+SxXjRKozG3XQEUTCGn4Gx1561auPX0rE8IJuZY6oS91pvwm7ty s61NzVuF/ZDdW5aIwoWpD5Xcqkb7OYmo9j8YkoG8D9ffz9bH+u2QkoLHvkXwPxfthg5b QmSx5GDwPYHtOIjIWOuPA6WA0BHjScKkuY8OM= 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=rRGY1qtGhxQcCo5hX0VDpG3PLRngwjzS07IoQDGbToD6KPsRa4bLlYP6oC7ONnS7lk Ijk+PxYmQhw4MbV/VsuSUjfm1Z0Gmh0OCwjwmMeJncDNqId6O7aiVMz+SrMkdAPtKLoV Si4wzcBcXvJi6pNHex48vmMqaEVL41fIIvsBpSCTkjO1hjMW7jrq7nK15OQhm2y8aVL7 FZJ3ZiV0MMUnQRVmcbkfHCPWV2ws8SvOO/+aCN11f4NnBkBVrZomd6zk0sR00MLeo9Cw YcpNuLxnzSl7O3dS4L6Yg1ueeapN4Yvo4piXpX0sY0Qb5lY9jXic3k/MagpgP3v3CgNs Uqtg== X-Gm-Message-State: AA+aEWY5cHQHIDD6bOi0POuZfdV7OTYKrqMxlSLR1yLH+Tydimn3KAM4 SV7EM7fxRLVs9aUXuf6GgFRywjK9uqz6Cw== 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 Cc: ulf.hansson@linaro.org, Vincent Guittot 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> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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. */