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
Subject: Re: [Intel-xe] [PATCH 3/6] drm/xe/mocs: Drop xe_mocs_info_index
Date: Wed, 22 Feb 2023 15:38:42 -0800	[thread overview]
Message-ID: <20230222233842.z3kg2sw64ytj6rni@ldmartin-desk2.jf.intel.com> (raw)
In-Reply-To: <20230216231724.2246534-4-matthew.d.roper@intel.com>

On Thu, Feb 16, 2023 at 03:17:21PM -0800, Matt Roper wrote:
>The values in the xe_mocs_info_index enum only match old pre-gen12
>hardware not supported by the Xe driver.
>
>The only usage of this enum was to set a default value for
>info->unused_entries_index, but this is unnecessary since every platform
>in the subsequent switch statement sets a proper platform-specific value
>(and the XE_MOCS_PTE default doesn't even make sense since the hardware
>dropped the "use PAT settings" capability in gen12).
>
>Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
>---
> drivers/gpu/drm/xe/xe_mocs.c | 30 ++----------------------------
> 1 file changed, 2 insertions(+), 28 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_mocs.c b/drivers/gpu/drm/xe/xe_mocs.c
>index ec89ff3ac29b..583e198af88d 100644
>--- a/drivers/gpu/drm/xe/xe_mocs.c
>+++ b/drivers/gpu/drm/xe/xe_mocs.c
>@@ -23,30 +23,6 @@ static inline void mocs_dbg(const struct drm_device *dev,
> { /* noop */ }
> #endif
>
>-/*
>- * MOCS indexes used for GPU surfaces, defining the cacheability of the
>- * surface data and the coherency for this data wrt. CPU vs. GPU accesses.
>- */
>-enum xe_mocs_info_index {
>-	/*
>-	 * Not cached anywhere, coherency between CPU and GPU accesses is
>-	 * guaranteed.
>-	 */
>-	XE_MOCS_UNCACHED,
>-	/*
>-	 * Cacheability and coherency controlled by the kernel automatically
>-	 * based on the xxxx  IOCTL setting and the current
>-	 * usage of the surface (used for display scanout or not).
>-	 */
>-	XE_MOCS_PTE,
>-	/*
>-	 * Cached in all GPU caches available on the platform.
>-	 * Coherency between CPU and GPU accesses to the surface is not
>-	 * guaranteed without extra synchronization.
>-	 */
>-	XE_MOCS_CACHED,
>-};
>-
> enum {
> 	HAS_GLOBAL_MOCS = BIT(0),
> 	HAS_RENDER_L3CC = BIT(1),
>@@ -341,7 +317,6 @@ static unsigned int get_mocs_settings(struct xe_device *xe,
>
> 	memset(info, 0, sizeof(struct xe_mocs_info));
>
>-	info->unused_entries_index = XE_MOCS_PTE;

since leaving this as 0 should never be valid, maybe add a warning after
the switch for the cases someoneone forgot to set it appropriately?

with that,

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

thanks
Lucas De Marchi


> 	switch (xe->info.platform) {
> 	case XE_PVC:
> 		info->size = ARRAY_SIZE(pvc_mocs_desc);
>@@ -406,9 +381,8 @@ static unsigned int get_mocs_settings(struct xe_device *xe,
> }
>
> /*
>- * Get control_value from MOCS entry taking into account when it's not used
>- * then if unused_entries_index is non-zero then its value will be returned
>- * otherwise XE_MOCS_PTE's value is returned in this case.
>+ * Get control_value from MOCS entry.  If the table entry is not defined, the
>+ * settings from unused_entries_index will be returned.
>  */
> static u32 get_entry_control(const struct xe_mocs_info *info,
> 			     unsigned int index)
>-- 
>2.39.1
>

  reply	other threads:[~2023-02-22 23:38 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 [this message]
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
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=20230222233842.z3kg2sw64ytj6rni@ldmartin-desk2.jf.intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@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.