From patchwork Thu Sep 21 17:29:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Zhi A" X-Patchwork-Id: 9964641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C95D2600C5 for ; Thu, 21 Sep 2017 17:30:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A479C29626 for ; Thu, 21 Sep 2017 17:30:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A322F29634; Thu, 21 Sep 2017 17:30:51 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7D4212962B for ; Thu, 21 Sep 2017 17:30:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A08406E8CA; Thu, 21 Sep 2017 17:30:06 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3951C6E8CA; Thu, 21 Sep 2017 17:30:05 +0000 (UTC) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2017 10:30:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,425,1500966000"; d="scan'208";a="151904103" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 21 Sep 2017 10:30:01 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 21 Sep 2017 10:30:01 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 21 Sep 2017 10:30:00 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Fri, 22 Sep 2017 01:29:58 +0800 From: "Wang, Zhi A" To: "intel-gfx@lists.freedesktop.org" , "intel-gvt-dev@lists.freedesktop.org" Thread-Topic: [PATCH] drm/i915: Return the correct score in i915_ppat_get() Thread-Index: AQHTMv7ot0PAP8FEb0+AK9EgaMojLKK/mHeA Date: Thu, 21 Sep 2017 17:29:58 +0000 Message-ID: References: <1506014831-1903-1-git-send-email-zhi.a.wang@intel.com> <1506014831-1903-3-git-send-email-zhi.a.wang@intel.com> In-Reply-To: <1506014831-1903-3-git-send-email-zhi.a.wang@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Cc: "Widawsky, Benjamin" , "Vivi, Rodrigo" Subject: Re: [Intel-gfx] [PATCH] drm/i915: Return the correct score in i915_ppat_get() 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Please drop this one. -----Original Message----- From: Wang, Zhi A Sent: Thursday, September 21, 2017 8:27 PM To: intel-gfx@lists.freedesktop.org; intel-gvt-dev@lists.freedesktop.org Cc: joonas.lahtinen@linux.intel.com; chris@chris-wilson.co.uk; zhenyuw@linux.intel.com; Wang, Zhi A ; Widawsky, Benjamin ; Vivi, Rodrigo Subject: [PATCH] drm/i915: Return the correct score in i915_ppat_get() The cache attribute of the required entry has to be the same with the existing value. After this requirement is met, the futher comparison should be performed. After this fix, the refined test case can pass. v2: - Refine the tittle and comments. (Rodrigo) Fixes: 4395890a4855 ("drm/i915: Introduce private PAT management") Cc: Chris Wilson Cc: Ben Widawsky Cc: Rodrigo Vivi Cc: Joonas Lahtinen Signed-off-by: Zhi Wang Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 5923b51..636ad7d 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -2965,7 +2965,7 @@ static unsigned int bdw_private_pat_match(u8 src, u8 dst) }; /* Cache attribute has to be matched. */ - if (GEN8_PPAT_GET_CA(src) == GEN8_PPAT_GET_CA(dst)) + if (GEN8_PPAT_GET_CA(src) != GEN8_PPAT_GET_CA(dst)) return 0; score |= CA_MATCH;