From: Andi Shyti <andi.shyti@linux.intel.com>
To: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: chris.p.wilson@linux.intel.com, intel-gfx@lists.freedesktop.org,
matthew.d.roper@intel.com, nirmoy.das@intel.com
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: Make i915_coherent_map_type GT-centric
Date: Thu, 27 Jul 2023 14:16:40 +0200 [thread overview]
Message-ID: <ZMJgKO9DbXg4cob4@ashyti-mobl2.lan> (raw)
In-Reply-To: <20230726155356.1652979-2-jonathan.cavitt@intel.com>
Hi Jonathan,
On Wed, Jul 26, 2023 at 08:53:55AM -0700, Jonathan Cavitt wrote:
> Refactor i915_coherent_map_type to be GT-centric rather than
> device-centric. Each GT may require different coherency
> handling due to hardware workarounds.
>
> Since the function now takes a GT instead of the i915, the function is
> renamed and moved to the gt folder.
[...]
> --- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
> @@ -465,21 +465,6 @@ void *i915_gem_object_pin_map_unlocked(struct drm_i915_gem_object *obj,
> return ret;
> }
>
> -enum i915_map_type i915_coherent_map_type(struct drm_i915_private *i915,
> - struct drm_i915_gem_object *obj,
> - bool always_coherent)
> -{
> - /*
> - * Wa_22016122933: always return I915_MAP_WC for MTL
> - */
> - if (i915_gem_object_is_lmem(obj) || IS_METEORLAKE(i915))
> - return I915_MAP_WC;
> - if (HAS_LLC(i915) || always_coherent)
> - return I915_MAP_WB;
> - else
> - return I915_MAP_WC;
> -}
> -
[...]
> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> @@ -1134,6 +1134,21 @@ void intel_gt_invalidate_tlb(struct intel_gt *gt, u32 seqno)
> }
> }
>
> +enum i915_map_type intel_gt_coherent_map_type(struct intel_gt *gt,
> + struct drm_i915_gem_object *obj,
> + bool always_coherent)
> +{
> + /*
> + * Wa_22016122933: always return I915_MAP_WC for MTL
> + */
> + if (i915_gem_object_is_lmem(obj) || IS_METEORLAKE(gt->i915))
> + return I915_MAP_WC;
> + if (HAS_LLC(gt->i915) || always_coherent)
> + return I915_MAP_WB;
> + else
> + return I915_MAP_WC;
> +}
> +
yep! That's how it should be! Thanks for moving it.
I'm just thinking whether intel_gt.c is the right place to put
it... I'm anyway OK with it.
> --- a/drivers/gpu/drm/i915/gt/intel_ring.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ring.c
> @@ -13,6 +13,7 @@
> #include "intel_engine_regs.h"
> #include "intel_gpu_commands.h"
> #include "intel_ring.h"
> +#include "intel_gt.h"
mmhhh... pity... this required this extra include because it
needs the prototype of intel_gt_coherent_map_type();
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Andi
next prev parent reply other threads:[~2023-07-27 12:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-26 15:53 [Intel-gfx] [PATCH 1/3] drm/i915/gt: Simplify shmem_create_from_object map_type selection Jonathan Cavitt
2023-07-26 15:53 ` [Intel-gfx] [PATCH 2/3] drm/i915: Make i915_coherent_map_type GT-centric Jonathan Cavitt
2023-07-27 11:35 ` Tvrtko Ursulin
2023-07-28 1:34 ` Andi Shyti
2023-07-28 8:07 ` Tvrtko Ursulin
2023-07-28 8:18 ` Andi Shyti
2023-07-27 12:16 ` Andi Shyti [this message]
2023-08-01 14:32 ` Andi Shyti
2023-07-26 15:53 ` [Intel-gfx] [PATCH 3/3] drm/i915/gt: Apply workaround 22016122933 correctly Jonathan Cavitt
2023-07-27 12:20 ` Andi Shyti
2023-07-26 16:37 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915/gt: Simplify shmem_create_from_object map_type selection Patchwork
2023-07-26 16:37 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-07-26 16:51 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-07-26 20:30 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-07-27 11:27 ` [Intel-gfx] [PATCH 1/3] " Tvrtko Ursulin
2023-07-27 12:23 ` Andi Shyti
2023-08-01 12:17 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915/gt: Simplify shmem_create_from_object map_type selection (rev2) Patchwork
2023-08-01 12:17 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-08-01 12:31 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-08-01 15:38 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2023-08-01 15:32 [Intel-gfx] [PATCH 0/3] drm/i915: Fix Wa_22016122933 implementation Jonathan Cavitt
2023-08-01 15:32 ` [Intel-gfx] [PATCH 2/3] drm/i915: Make i915_coherent_map_type GT-centric Jonathan Cavitt
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=ZMJgKO9DbXg4cob4@ashyti-mobl2.lan \
--to=andi.shyti@linux.intel.com \
--cc=chris.p.wilson@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jonathan.cavitt@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=nirmoy.das@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