Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp899877ybe; Fri, 13 Sep 2019 08:03:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3LsNdfbGP3vI7jRFGoKdgZ979aPRN3Y3loNnUSlVXgq6Ei3mpHaIvxK3UPNc6CDWyw97j X-Received: by 2002:aa7:ce81:: with SMTP id y1mr47566311edv.188.1568387007957; Fri, 13 Sep 2019 08:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568387007; cv=none; d=google.com; s=arc-20160816; b=HbKoZrDJYJo5bzsrS7R5qSqu/3Q+aLe3rqppp8JzR1VtgzoUrsXhLI/ADhf90/UmqG HiZCzAXxOeGL7q3Zad6ZwJotBYu/JpIqgURt6pgV3n32dHFiAIOFR2SIbvEt/H8lI12u fVGB9MKK50zWYvGBGhFV4gkNZiXJ2xegTDi2Ncy6iW9OM/iHuqBIVvyRTBTsZOV4tTMc qafTiRKJuy1ZMdCzPMYlzUUXEntFP0sk31YCLLH2hSV4Sym94CUK222mhxebQ9bZQD6D y/+Wmy1+ILBawmtJ/vZDgisHnGPXBu/fLLfnz9b5ZShT3bvY7g1NetFVEi77heoUuxWF CY3Q== 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=uzDcaExcMRL2YCYPh71BrFxQ4DRnwilYLif3y3F/7q8=; b=RLR1u48+NgIyloWEgs7y4rCgbdeicyDO8hawg25bBT4iGWZLrsEISNqMuAC/rLByxj mFmKQCMnI6lWinuLOHHfTt7RGNgtQfj6BKLss25H/sVS/5qO8YgIQNJfLbLlBxsN+YSi 0Kz8Vo8LB4rUTYlc4Ts76AwrWGNm8VNySBpoaKmyBd+p3wwX5FX98bX+80r3AJcHNZ7F Vq0R209gbme2o0+xJs4m/VcDEBf3P2ItgeIzTA6paTszV3tPygjjmGSxDhl6trh9YJD7 8wdkuZmX2D+DwVgGucMOrQhLGIbILe8cXOb5YqVqcJMdFk93fc2rd7Nss4TqmEmsx5RW AbDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ucafd9qy; 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 c6si16758698edc.291.2019.09.13.08.02.59; Fri, 13 Sep 2019 08:03:27 -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=ucafd9qy; 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 S2390996AbfIMNWR (ORCPT + 99 others); Fri, 13 Sep 2019 09:22:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:52504 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390984AbfIMNWO (ORCPT ); Fri, 13 Sep 2019 09:22:14 -0400 Received: from localhost (unknown [104.132.45.99]) (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 4FD3421A4C; Fri, 13 Sep 2019 13:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568380932; bh=Ai6FeToqozjczxaMMBFhZ4yPW7xruELrg27r+TvIafc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ucafd9qy4LvXtxbLSn3cs+u5+1KBsFDeYNrIlgOoPJUyop+odkALxKGYMFjMBOwuv 7CZmpBBS1x4qsrhVDjEa4IuaGIIaNdLHS6jkblFG+wOvDu/puKRg2mxiL92FLQPwwf j3JnSnaXgNXyDlZr5zZhMfoKlupK2DB6UCfweJkU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Harrison , "Robert M. Fosha" , Tvrtko Ursulin , Chris Wilson , Joonas Lahtinen , Sasha Levin Subject: [PATCH 5.2 30/37] drm/i915: Support flags in whitlist WAs Date: Fri, 13 Sep 2019 14:07:35 +0100 Message-Id: <20190913130521.388577782@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190913130510.727515099@linuxfoundation.org> References: <20190913130510.727515099@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 [ Upstream commit 6883eab274813d158bfcfb499aa225ece61c0f29 ] Newer hardware adds flags to the whitelist work-around register. These allow per access direction privileges and ranges. Signed-off-by: John Harrison Signed-off-by: Robert M. Fosha Cc: Tvrtko Ursulin Cc: Chris Wilson Reviewed-by: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20190618010108.27499-2-John.C.Harrison@Intel.com (cherry picked from commit 5380d0b781c491d94b4f4690ecf9762c1946c4ec) Signed-off-by: Joonas Lahtinen Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/i915_reg.h | 7 +++++++ drivers/gpu/drm/i915/intel_workarounds.c | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 13d6bd4e17b20..cf748b80e6401 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -2510,6 +2510,13 @@ enum i915_power_well_id { #define RING_WAIT_SEMAPHORE (1 << 10) /* gen6+ */ #define RING_FORCE_TO_NONPRIV(base, i) _MMIO(((base) + 0x4D0) + (i) * 4) +#define RING_FORCE_TO_NONPRIV_RW (0 << 28) /* CFL+ & Gen11+ */ +#define RING_FORCE_TO_NONPRIV_RD (1 << 28) +#define RING_FORCE_TO_NONPRIV_WR (2 << 28) +#define RING_FORCE_TO_NONPRIV_RANGE_1 (0 << 0) /* CFL+ & Gen11+ */ +#define RING_FORCE_TO_NONPRIV_RANGE_4 (1 << 0) +#define RING_FORCE_TO_NONPRIV_RANGE_16 (2 << 0) +#define RING_FORCE_TO_NONPRIV_RANGE_64 (3 << 0) #define RING_MAX_NONPRIV_SLOTS 12 #define GEN7_TLB_RD_ADDR _MMIO(0x4700) diff --git a/drivers/gpu/drm/i915/intel_workarounds.c b/drivers/gpu/drm/i915/intel_workarounds.c index 2fb70fab2d1c6..1db826b12774e 100644 --- a/drivers/gpu/drm/i915/intel_workarounds.c +++ b/drivers/gpu/drm/i915/intel_workarounds.c @@ -981,7 +981,7 @@ bool intel_gt_verify_workarounds(struct drm_i915_private *i915, } static void -whitelist_reg(struct i915_wa_list *wal, i915_reg_t reg) +whitelist_reg_ext(struct i915_wa_list *wal, i915_reg_t reg, u32 flags) { struct i915_wa wa = { .reg = reg @@ -990,9 +990,16 @@ whitelist_reg(struct i915_wa_list *wal, i915_reg_t reg) if (GEM_DEBUG_WARN_ON(wal->count >= RING_MAX_NONPRIV_SLOTS)) return; + wa.reg.reg |= flags; _wa_add(wal, &wa); } +static void +whitelist_reg(struct i915_wa_list *wal, i915_reg_t reg) +{ + whitelist_reg_ext(wal, reg, RING_FORCE_TO_NONPRIV_RW); +} + static void gen9_whitelist_build(struct i915_wa_list *w) { /* WaVFEStateAfterPipeControlwithMediaStateClear:skl,bxt,glk,cfl */ -- 2.20.1