From patchwork Wed Nov 18 12:36:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Vlad X-Patchwork-Id: 7648421 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2E5E99F392 for ; Wed, 18 Nov 2015 12:36:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B54E2062A for ; Wed, 18 Nov 2015 12:36:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9529A20620 for ; Wed, 18 Nov 2015 12:36:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 711046E6DC; Wed, 18 Nov 2015 04:36:17 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C6096E6D4 for ; Wed, 18 Nov 2015 04:36:15 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 18 Nov 2015 04:36:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,313,1444719600"; d="scan'208";a="853613730" Received: from mcvlad-wk.rb.intel.com (HELO mcvlad-wk) ([10.237.105.57]) by orsmga002.jf.intel.com with ESMTP; 18 Nov 2015 04:36:14 -0800 Received: by mcvlad-wk (Postfix, from userid 1000) id 49C7AC0067; Wed, 18 Nov 2015 14:36:24 +0200 (EET) From: Marius Vlad To: marius.vlad0@gmail.com, intel-gfx@lists.freedesktop.org Date: Wed, 18 Nov 2015 14:36:22 +0200 Message-Id: <1447850182-6978-1-git-send-email-marius.c.vlad@intel.com> X-Mailer: git-send-email 2.6.2 Subject: [Intel-gfx] [PATCH i-g-t] overlay/intel-gpu-overlay Fix power consumption not being displayed X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The power metter was not showing up due to a check over I915_PERF_ENERGY. ENOENT is returned when I915_PERF_ENERGY is not available, and we use that for relaying on debugfs i915_energy_uJ. Signed-off-by: Marius Vlad --- overlay/power.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overlay/power.c b/overlay/power.c index 6c5c374..6873e7f 100644 --- a/overlay/power.c +++ b/overlay/power.c @@ -60,7 +60,7 @@ int power_init(struct power *power) memset(power, 0, sizeof(*power)); power->fd = perf_open(); - if (power->fd != -1) + if (power->fd != -ENOENT) return 0; sprintf(buf, "%s/i915_energy_uJ", debugfs_dri_path); @@ -121,7 +121,7 @@ int power_update(struct power *power) if (power->error) return power->error; - if (power->fd != -1) { + if (power->fd != -ENOENT) { uint64_t data[2]; int len;