Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2762912ybh; Mon, 5 Aug 2019 06:28:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaFpOK34xUP95e9WtxEa99IOUUj5blkUjIQ6bkR4ZSSE0luA8oqcsXJUFkV/YO/4mviP4N X-Received: by 2002:a17:902:c509:: with SMTP id o9mr146576424plx.222.1565011681348; Mon, 05 Aug 2019 06:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565011681; cv=none; d=google.com; s=arc-20160816; b=sWGe5cjlsdnkRR/U+l6bsKT48lyP3p4IiDpPF+AxNLQ7/LPddikixBF6hpl7IXOrLN H0RVLtFK065bxUglteFM5/2NslAyaSqObjf102st43LlpZ0KplN3220/IzPGPOWHx6ai Y9IfWO+F0STzToY31wagJNyhvPSb+N3IDRwSsLJrF/3nzLq/XOXP1Sovfg/NTMS/7yZz 1xxGn17P2roYnA+Jq4A+RFVv2QcxG4oloq37TS14KCP2ojJYwpfxhAjhCwGci1zXgzWG pQrzGEbHlZaFgIVtfllpMfBtY9rPJEJW5T7f3Wk9iYvTqGnH6mqKHBHP4gLqm3uhQNKY 0/xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=85aq5U7rQUDhe2y7zsNGTR5UDOuMNGyaBxkY5bnM5rE=; b=C2Mx414tRZv09y3iPt9wi36yOMDg3Le5QIJROkJoAPZo1qh6WtJiyfHSvvu0eKgSyy g7JkIe1BtjlehrXEHI4Nm3AG++BBMndpaVV6eJGQE+oE0FwfhoGgSD1X0dgBkPXFCZ9G DfdLaAMGuTJrWKCMFI1apgU/FZ90vM9bpSNFXdRooIGAMNcjwItH+BGzy2pmP+MLR84P isSl4X7s9a8ONN3IDXe98scdnaDCTnJ/P5QANs5G5wum4z+OSThby1s9jWb3o3Kty5XT aGTpkb8SCOTgI6+wn1m3cOu1fBNH2+XP+Td8gXG1PW5C1nS7LB0dL3EbfD9jdQmxlQPC Bi1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fvae2LmQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si6147367pgn.123.2019.08.05.06.27.46; Mon, 05 Aug 2019 06:28:01 -0700 (PDT) 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=@kernel.org header.s=default header.b=fvae2LmQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731327AbfHENZw (ORCPT + 99 others); Mon, 5 Aug 2019 09:25:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:34398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730916AbfHENZu (ORCPT ); Mon, 5 Aug 2019 09:25:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9DD6A20644; Mon, 5 Aug 2019 13:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565011549; bh=O81cY2+UO09peQGoXM9mbiGl/Zz6yhVdTmLOCrqsWy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fvae2LmQHCdKoqDEewTy59ddlu9mEgPkwaNIgRvG9OUvtD7739cV5Hhbx+0wa6FS7 1F3lcmJ3iFAsb05L7nigE5YRiqtqLh722hzn4AIgU+vYmiqY4Lfmper1J498ESiaRT XlN5dWfXgK+r/ywWOP3F4vuJKH2AM5X6DFjpUAJ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lionel Landwerlin , Kenneth Graunke , Jani Nikula Subject: [PATCH 5.2 130/131] drm/i915/perf: fix ICL perf register offsets Date: Mon, 5 Aug 2019 15:03:37 +0200 Message-Id: <20190805125000.682940232@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124951.453337465@linuxfoundation.org> References: <20190805124951.453337465@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lionel Landwerlin commit 95eef14cdad150fed43147bcd4f29eea3d0a3f03 upstream. We got the wrong offsets (could they have changed?). New values were computed off an error state by looking up the register offset in the context image as written by the HW. Signed-off-by: Lionel Landwerlin Fixes: 1de401c08fa805 ("drm/i915/perf: enable perf support on ICL") Cc: # v4.18+ Acked-by: Kenneth Graunke Link: https://patchwork.freedesktop.org/patch/msgid/20190610081914.25428-1-lionel.g.landwerlin@intel.com (cherry picked from commit 8dcfdfb4501012a8d36d2157dc73925715f2befb) Signed-off-by: Jani Nikula Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/i915_perf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -3457,9 +3457,13 @@ void i915_perf_init(struct drm_i915_priv dev_priv->perf.oa.ops.enable_metric_set = gen8_enable_metric_set; dev_priv->perf.oa.ops.disable_metric_set = gen10_disable_metric_set; - dev_priv->perf.oa.ctx_oactxctrl_offset = 0x128; - dev_priv->perf.oa.ctx_flexeu0_offset = 0x3de; - + if (IS_GEN(dev_priv, 10)) { + dev_priv->perf.oa.ctx_oactxctrl_offset = 0x128; + dev_priv->perf.oa.ctx_flexeu0_offset = 0x3de; + } else { + dev_priv->perf.oa.ctx_oactxctrl_offset = 0x124; + dev_priv->perf.oa.ctx_flexeu0_offset = 0x78e; + } dev_priv->perf.oa.gen8_valid_ctx_bit = (1<<16); } }