Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe: Simplify selecting caching mode
Date: Mon, 8 Jul 2024 17:33:05 +0000	[thread overview]
Message-ID: <Zowi0V1icginCJVX@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240708120550.131683-1-maarten.lankhorst@linux.intel.com>

On Mon, Jul 08, 2024 at 02:05:50PM +0200, Maarten Lankhorst wrote:
> The switch is slightly overkill, with the default already set to cached
> since previous commit.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Good cleanup.

Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_bo.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index 31192d983d9e..d3511dd4a488 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -364,15 +364,6 @@ static struct ttm_tt *xe_ttm_tt_create(struct ttm_buffer_object *ttm_bo,
>  	 * CPU.
>  	 */
>  	if (!IS_DGFX(xe)) {
> -		switch (bo->cpu_caching) {
> -		case DRM_XE_GEM_CPU_CACHING_WC:
> -			caching = ttm_write_combined;
> -			break;
> -		default:
> -			caching = ttm_cached;
> -			break;
> -		}
> -
>  		WARN_ON((bo->flags & XE_BO_FLAG_USER) && !bo->cpu_caching);
>  
>  		/*
> @@ -381,7 +372,8 @@ static struct ttm_tt *xe_ttm_tt_create(struct ttm_buffer_object *ttm_bo,
>  		 * For Xe_LPG and beyond, PPGTT PTE lookups are also
>  		 * non-coherent and require a CPU:WC mapping.
>  		 */
> -		if ((!bo->cpu_caching && bo->flags & XE_BO_FLAG_SCANOUT) ||
> +		if (bo->cpu_caching == DRM_XE_GEM_CPU_CACHING_WC ||
> +		    (!bo->cpu_caching && bo->flags & XE_BO_FLAG_SCANOUT) ||
>  		    (xe->info.graphics_verx100 >= 1270 &&
>  		     bo->flags & XE_BO_FLAG_PAGETABLE))
>  			caching = ttm_write_combined;
> -- 
> 2.45.2
> 

      parent reply	other threads:[~2024-07-08 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08 12:05 [PATCH] drm/xe: Simplify selecting caching mode Maarten Lankhorst
2024-07-08 12:11 ` ✓ CI.Patch_applied: success for " Patchwork
2024-07-08 12:11 ` ✓ CI.checkpatch: " Patchwork
2024-07-08 12:12 ` ✓ CI.KUnit: " Patchwork
2024-07-08 12:24 ` ✓ CI.Build: " Patchwork
2024-07-08 12:26 ` ✓ CI.Hooks: " Patchwork
2024-07-08 12:28 ` ✓ CI.checksparse: " Patchwork
2024-07-08 12:48 ` ✓ CI.BAT: " Patchwork
2024-07-08 15:35 ` ✓ CI.FULL: " Patchwork
2024-07-08 17:33 ` Matthew Brost [this message]

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=Zowi0V1icginCJVX@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox