All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-xe@lists.freedesktop.org,
	Philippe Lecluse <philippe.lecluse@intel.com>
Subject: Re: [Intel-xe] [PATCH 5/6] drm/xe/mocs: add MTL mocs
Date: Wed, 22 Feb 2023 15:46:27 -0800	[thread overview]
Message-ID: <20230222234627.kgzticaf67wfjaks@ldmartin-desk2.jf.intel.com> (raw)
In-Reply-To: <20230216231724.2246534-6-matthew.d.roper@intel.com>

On Thu, Feb 16, 2023 at 03:17:23PM -0800, Matt Roper wrote:
>From: Philippe Lecluse <philippe.lecluse@intel.com>
>
>It was incorrectly using dg2_mocs for now.
>
>v2 (MattR):
> - Use REG_GENMASK/REG_FIELD_PREP for bitfields
> - Add bspec references
>
>Bspec: 45101, 45410, 63882
>Signed-off-by: Philippe Lecluse <philippe.lecluse@intel.com>
>Signed-off-by: Matt Roper <matthew.d.roper@intel.com>


Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>


Lucas De Marchi

>---
> drivers/gpu/drm/xe/xe_mocs.c | 69 +++++++++++++++++++++++++++++++++---
> 1 file changed, 65 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_mocs.c b/drivers/gpu/drm/xe/xe_mocs.c
>index 696001f60259..3b48934d99d4 100644
>--- a/drivers/gpu/drm/xe/xe_mocs.c
>+++ b/drivers/gpu/drm/xe/xe_mocs.c
>@@ -62,6 +62,10 @@ struct xe_mocs_info {
> #define L3_GLBGO(value)		((value) << 6)
> #define L3_LKUP(value)		((value) << 7)
>
>+/* Defines for the tables (GLOB_MOCS_0 - GLOB_MOCS_16) */
>+#define _L4_CACHEABILITY	REG_GENMASK(3, 2)
>+#define IG_PAT			REG_BIT(8)
>+
> /* Helper defines */
> #define GEN9_NUM_MOCS_ENTRIES	64  /* 63-64 are reserved, but configured. */
> #define PVC_NUM_MOCS_ENTRIES	3
>@@ -89,6 +93,12 @@ struct xe_mocs_info {
> #define L3_2_RESERVED		_L3_CACHEABILITY(2)
> #define L3_3_WB			_L3_CACHEABILITY(3)
>
>+/* L4 caching options */
>+#define L4_0_WB                 REG_FIELD_PREP(_L4_CACHEABILITY, 0)
>+#define L4_1_WT                 REG_FIELD_PREP(_L4_CACHEABILITY, 1)
>+#define L4_2_RESERVED           REG_FIELD_PREP(_L4_CACHEABILITY, 2)
>+#define L4_3_UC                 REG_FIELD_PREP(_L4_CACHEABILITY, 3)
>+
> #define MOCS_ENTRY(__idx, __control_value, __l3cc_value) \
> 	[__idx] = { \
> 		.control_value = __control_value, \
>@@ -310,6 +320,57 @@ static const struct xe_mocs_entry pvc_mocs_desc[] = {
> 	MOCS_ENTRY(2, 0, L3_3_WB),
> };
>
>+static const struct xe_mocs_entry mtl_mocs_desc[] = {
>+	/* Error - Reserved for Non-Use */
>+	MOCS_ENTRY(0,
>+		   0,
>+		   L3_LKUP(1) | L3_3_WB),
>+	/* Cached - L3 + L4 */
>+	MOCS_ENTRY(1,
>+		   IG_PAT,
>+		   L3_LKUP(1) | L3_3_WB),
>+	/* L4 - GO:L3 */
>+	MOCS_ENTRY(2,
>+		   IG_PAT,
>+		   L3_LKUP(1) | L3_1_UC),
>+	/* Uncached - GO:L3 */
>+	MOCS_ENTRY(3,
>+		   IG_PAT | L4_3_UC,
>+		   L3_LKUP(1) | L3_1_UC),
>+	/* L4 - GO:Mem */
>+	MOCS_ENTRY(4,
>+		   IG_PAT,
>+		   L3_LKUP(1) | L3_GLBGO(1) | L3_1_UC),
>+	/* Uncached - GO:Mem */
>+	MOCS_ENTRY(5,
>+		   IG_PAT | L4_3_UC,
>+		   L3_LKUP(1) | L3_GLBGO(1) | L3_1_UC),
>+	/* L4 - L3:NoLKUP; GO:L3 */
>+	MOCS_ENTRY(6,
>+		   IG_PAT,
>+		   L3_1_UC),
>+	/* Uncached - L3:NoLKUP; GO:L3 */
>+	MOCS_ENTRY(7,
>+		   IG_PAT | L4_3_UC,
>+		   L3_1_UC),
>+	/* L4 - L3:NoLKUP; GO:Mem */
>+	MOCS_ENTRY(8,
>+		   IG_PAT,
>+		   L3_GLBGO(1) | L3_1_UC),
>+	/* Uncached - L3:NoLKUP; GO:Mem */
>+	MOCS_ENTRY(9,
>+		   IG_PAT | L4_3_UC,
>+		   L3_GLBGO(1) | L3_1_UC),
>+	/* Display - L3; L4:WT */
>+	MOCS_ENTRY(14,
>+		   IG_PAT | L4_1_WT,
>+		   L3_LKUP(1) | L3_3_WB),
>+	/* CCS - Non-Displayable */
>+	MOCS_ENTRY(15,
>+		   IG_PAT,
>+		   L3_GLBGO(1) | L3_1_UC),
>+};
>+
> static unsigned int get_mocs_settings(struct xe_device *xe,
> 				      struct xe_mocs_info *info)
> {
>@@ -327,11 +388,11 @@ static unsigned int get_mocs_settings(struct xe_device *xe,
> 		info->unused_entries_index = 2;
> 		break;
> 	case XE_METEORLAKE:
>-		info->size = ARRAY_SIZE(dg2_mocs_desc);
>-		info->table = dg2_mocs_desc;
>+		info->size = ARRAY_SIZE(mtl_mocs_desc);
>+		info->table = mtl_mocs_desc;
> 		info->n_entries = MTL_NUM_MOCS_ENTRIES;
>-		info->uc_index = 1;
>-		info->unused_entries_index = 3;
>+		info->uc_index = 9;
>+		info->unused_entries_index = 1;
> 		break;
> 	case XE_DG2:
> 		if (xe->info.subplatform == XE_SUBPLATFORM_DG2_G10 &&
>-- 
>2.39.1
>

  reply	other threads:[~2023-02-22 23:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-16 23:17 [Intel-xe] [PATCH 0/6] Assorted MOCS updates Matt Roper
2023-02-16 23:17 ` [Intel-xe] [PATCH 1/6] drm/xe/mocs: Drop unwanted TGL table Matt Roper
2023-02-22 23:33   ` Lucas De Marchi
2023-02-27 14:32   ` Balasubramani Vivekanandan
2023-02-16 23:17 ` [Intel-xe] [PATCH 2/6] drm/xe/mocs: Add missing RKL handling Matt Roper
2023-02-22 23:35   ` Lucas De Marchi
2023-02-16 23:17 ` [Intel-xe] [PATCH 3/6] drm/xe/mocs: Drop xe_mocs_info_index Matt Roper
2023-02-22 23:38   ` Lucas De Marchi
2023-02-27 14:34   ` Balasubramani Vivekanandan
2023-02-16 23:17 ` [Intel-xe] [PATCH 4/6] drm/xe/mocs: Drop duplicate assignment of uc_index Matt Roper
2023-02-22 23:39   ` Lucas De Marchi
2023-02-16 23:17 ` [Intel-xe] [PATCH 5/6] drm/xe/mocs: add MTL mocs Matt Roper
2023-02-22 23:46   ` Lucas De Marchi [this message]
2023-02-16 23:17 ` [Intel-xe] [PATCH 6/6] drm/xe/mocs: LNCF MOCS settings only need to be restored on pre-Xe_HP Matt Roper
2023-02-23  0:11   ` Lucas De Marchi
2023-02-23 17:37     ` Matt Roper
2023-02-24 16:24       ` Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230222234627.kgzticaf67wfjaks@ldmartin-desk2.jf.intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=philippe.lecluse@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.