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: 153856 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2130221ljp; Fri, 14 Dec 2018 06:22:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/XtPzpetIa41dBBGPIMUY4SQ9Vpd/ScngNcrgOrzBZbmFFd+YGlVy5ZlC0gYDr7vhKSdjC1 X-Received: by 2002:a62:e044:: with SMTP id f65mr3007829pfh.208.1544797361858; Fri, 14 Dec 2018 06:22:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544797361; cv=none; d=google.com; s=arc-20160816; b=bGY5uLSE8JJrCQVe9xN8iTfF3/oZIah9AD3Mt6WtSTOAh9EQZ9p9NoTWJC+8yCDxnY VzoPKI6GZNqD8ibJEdDYefv5rJclzpy9jyUhYBCqoCuIQKm+5ZcxxNjCB4KXx0L1GK1Q DEiPbjzDvttBAasXl3DwuLnq7vlPRPdYBEuTNJyo+Sy5rKrSzlZzDoFiPSF7wrtUnhBY O9s9Pr267P5cykXpeEab8taDs7MMTfIlMEaqpU4hec1+zWAXZREVBYmOB5qMnCVYOuxk zNdNKNGPas366RBk639/j+MCfyPlDThE4R2cpfq+0BfH/vfu0QVIbnlXcjxjBvaHq2l/ Ip7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=B6KKzqZhmrvKOYN6ED9mcoMzLhzOfCHFL8+e2184smI=; b=TXUZUiKh3UYj2xdSVJ4neyUCcoxmoKuWeIvGKEDC8Q0lzUiX84LTgHVhvRp9aw5ZN5 sgr4vjn6dvU3S2mJXvv7EkhIjiGby3CKXCKpYQmZgW3U0OAllLrgzNOPKP635Vt31Q8S GGQeWpBMXp7Tc09n0f0Kv0DgrTWm/Y0MRLYy4zWvo5A3cg8EbHcmd0UrF+GIYibFxA7G +PpWMaFXnZraw5EluNriGCWvbu34neaMeRjPV2jmlC4ubvQSFCIdI1/L1I1chRZstiPH Qo5obZ8Wpikh0jgDZaExDYJq6N4eNwkrBDOwbVQ3fAIGD6qY1Q+e804wLQMf2kNOp5p+ fFDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QAn73MFm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3si1068314plr.178.2018.12.14.06.22.41; Fri, 14 Dec 2018 06:22:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QAn73MFm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730187AbeLNOWk (ORCPT + 31 others); Fri, 14 Dec 2018 09:22:40 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42403 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730106AbeLNOWh (ORCPT ); Fri, 14 Dec 2018 09:22:37 -0500 Received: by mail-wr1-f67.google.com with SMTP id q18so5603114wrx.9 for ; Fri, 14 Dec 2018 06:22:35 -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=Tr5jgheqapJHIvMlyrLOKzHslgdIYfbfgrA2XgJ3A970xVta38n9RztSrEba4aibIl SUh3hpe9vPkq7CItlesfVlmWdz13fQcasw6yYuTKiX6B8zzz4ddYu6Fs0k2Cz6LtctCO C/75kESLMuzVEvyeimoy4COoYn6EJw0qQ2ds3eGoFOvdpLMeOlYb9QYi1491Rw0ru2DW kBTuaranVGs3zI7gLKcDmDhJolTc+ZSaLufC6RRvk2VqcazNXPeyCr3k5a4KFyp7CFsZ rfIy4BYOXLPir8Rfkxz//aHyioG28ZOIldD7gnBN2GMPpJAybBK4waI/Me3XGj5GhjVX 3D1w== X-Gm-Message-State: AA+aEWb5TtHJpDUt1RqSZqsZTV4oaBgcZVSK53FgSava72NSke30jPON dIQ6BzEs6ybEvbwCEQ/hwOJ/mg== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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. */