From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A79B6C6FD18 for ; Wed, 19 Apr 2023 12:17:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6749710E96B; Wed, 19 Apr 2023 12:16:59 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8F1A10E199; Wed, 19 Apr 2023 12:16:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681906616; x=1713442616; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pl0Fj8njTvTodei45z7BipIYoSlOoHUirquGX/RaoQc=; b=B+xVfSX7nxQUe3Yuox5jqFMP1ic0oVtIHFs6KY4G7JerDKjG2HuxihOD J+wXnPaGSTwQy8NBWGyCob4PgbsOWpRBSJFSVradHTbiTfNcA6WkxsQQr se8B+VjIxK3TSSYgKYVrpxn74qkA2erNZ0CefyT3d0iendW/Eeq6BN+Ti txuDAOrGA7UddIzEJc7rFeXOM3ASbm4YFlTXLzTa10En5mRYTgVqISBez w3X07lqp5OBtYs8Ut048rf5xYx6ieqdrw2kfxrEVK/QsXZAkcaAO8kBVt AC5IriKXQvNN2A37uCV9Ji3v+y264QR2eceGDnchrFsXyOE/a5zKGRmyX Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="329607434" X-IronPort-AV: E=Sophos;i="5.99,208,1677571200"; d="scan'208";a="329607434" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2023 05:16:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="1021188995" X-IronPort-AV: E=Sophos;i="5.99,208,1677571200"; d="scan'208";a="1021188995" Received: from crijnder-mobl.ger.corp.intel.com (HELO intel.com) ([10.249.35.137]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2023 05:16:53 -0700 Date: Wed, 19 Apr 2023 14:16:49 +0200 From: Andi Shyti To: fei.yang@intel.com Message-ID: References: <20230417062503.1884465-1-fei.yang@intel.com> <20230417062503.1884465-8-fei.yang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230417062503.1884465-8-fei.yang@intel.com> Subject: Re: [Intel-gfx] [PATCH 7/8] drm/i915: use pat_index instead of cache_level X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Wilson , intel-gfx@lists.freedesktop.org, Matt Roper , dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Hi Fei, On Sun, Apr 16, 2023 at 11:25:02PM -0700, fei.yang@intel.com wrote: > From: Fei Yang > > Currently the KMD is using enum i915_cache_level to set caching policy for > buffer objects. This is flaky because the PAT index which really controls > the caching behavior in PTE has far more levels than what's defined in the > enum. In addition, the PAT index is platform dependent, having to translate > between i915_cache_level and PAT index is not reliable, and makes the code > more complicated. > > >From UMD's perspective there is also a necessity to set caching policy for you have an extra '>' here. > performance fine tuning. It's much easier for the UMD to directly use PAT > index because the behavior of each PAT index is clearly defined in Bspec. > Haivng the abstracted i915_cache_level sitting in between would only cause /Haivng/Having/ > more ambiguity. > > For these reasons this patch replaces i915_cache_level with PAT index. Also > note, the cache_level is not completely removed yet, because the KMD still > has the need of creating buffer objects with simple cache settings such as > cached, uncached, or writethrough. For these simple cases, using cache_level > would help simplify the code. > > Cc: Chris Wilson > Cc: Matt Roper > Signed-off-by: Fei Yang fiuuuuu... quite a run this patch! But I did review it once, anyway I checked it again, it looks all correct. Reviewed-by: Andi Shyti Andi