Skip to content

Commit f1530f9

Browse files
Jonathan-CavittAndi Shyti
authored andcommitted
drm/i915/gt: Apply workaround 22016122933 correctly
WA_22016122933 was recently applied to all MeteorLake engines, which is simultaneously too broad (should only apply to Media engines) and too specific (should apply to all platforms that use the same media engine as MeteorLake). Correct this in cases where coherency settings are modified. There were also two additional places where the workaround was applied unconditionally. The change was confirmed as necessary for all platforms, so the workaround label was removed. Suggested-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Acked-by: Fei Yang <fei.yang@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230801153242.2445478-4-jonathan.cavitt@intel.com Link: https://patchwork.freedesktop.org/patch/msgid/20230807121957.598420-4-andi.shyti@linux.intel.com
1 parent 115cdcc commit f1530f9

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

drivers/gpu/drm/i915/gt/intel_gt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,9 +1009,10 @@ enum i915_map_type intel_gt_coherent_map_type(struct intel_gt *gt,
10091009
bool always_coherent)
10101010
{
10111011
/*
1012-
* Wa_22016122933: always return I915_MAP_WC for MTL
1012+
* Wa_22016122933: always return I915_MAP_WC for Media
1013+
* version 13.0 when the object is on the Media GT
10131014
*/
1014-
if (i915_gem_object_is_lmem(obj) || IS_METEORLAKE(gt->i915))
1015+
if (i915_gem_object_is_lmem(obj) || intel_gt_needs_wa_22016122933(gt))
10151016
return I915_MAP_WC;
10161017
if (HAS_LLC(gt->i915) || always_coherent)
10171018
return I915_MAP_WB;

drivers/gpu/drm/i915/gt/intel_gt.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#ifndef __INTEL_GT__
77
#define __INTEL_GT__
88

9+
#include "i915_drv.h"
910
#include "intel_engine_types.h"
1011
#include "intel_gt_types.h"
1112
#include "intel_reset.h"
@@ -24,6 +25,11 @@ static inline bool gt_is_root(struct intel_gt *gt)
2425
return !gt->info.id;
2526
}
2627

28+
static inline bool intel_gt_needs_wa_22016122933(struct intel_gt *gt)
29+
{
30+
return MEDIA_VER_FULL(gt->i915) == IP_VER(13, 0) && gt->type == GT_MEDIA;
31+
}
32+
2733
static inline struct intel_gt *uc_to_gt(struct intel_uc *uc)
2834
{
2935
return container_of(uc, struct intel_gt, uc);

drivers/gpu/drm/i915/gt/intel_lrc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,10 +1095,11 @@ __lrc_alloc_state(struct intel_context *ce, struct intel_engine_cs *engine)
10951095
if (IS_ERR(obj)) {
10961096
obj = i915_gem_object_create_shmem(engine->i915, context_size);
10971097
/*
1098-
* Wa_22016122933: For MTL the shared memory needs to be mapped
1099-
* as WC on CPU side and UC (PAT index 2) on GPU side
1098+
* Wa_22016122933: For Media version 13.0, all Media GT shared
1099+
* memory needs to be mapped as WC on CPU side and UC (PAT
1100+
* index 2) on GPU side.
11001101
*/
1101-
if (IS_METEORLAKE(engine->i915))
1102+
if (intel_gt_needs_wa_22016122933(engine->gt))
11021103
i915_gem_object_set_cache_coherency(obj, I915_CACHE_NONE);
11031104
}
11041105
if (IS_ERR(obj))

drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,6 @@ static int gsc_fw_load_prepare(struct intel_gsc_uc *gsc)
298298
memcpy_toio(gsc->local_vaddr, src, gsc->fw.size);
299299
memset_io(gsc->local_vaddr + gsc->fw.size, 0, gsc->local->size - gsc->fw.size);
300300

301-
/*
302-
* Wa_22016122933: Making sure the data in dst is
303-
* visible to GSC right away
304-
*/
305301
intel_guc_write_barrier(&gt->uc.guc);
306302

307303
i915_gem_object_unpin_map(gsc->fw.obj);

drivers/gpu/drm/i915/gt/uc/intel_guc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -745,10 +745,11 @@ struct i915_vma *intel_guc_allocate_vma(struct intel_guc *guc, u32 size)
745745
return ERR_CAST(obj);
746746

747747
/*
748-
* Wa_22016122933: For MTL the shared memory needs to be mapped
749-
* as WC on CPU side and UC (PAT index 2) on GPU side
748+
* Wa_22016122933: For Media version 13.0, all Media GT shared
749+
* memory needs to be mapped as WC on CPU side and UC (PAT
750+
* index 2) on GPU side.
750751
*/
751-
if (IS_METEORLAKE(gt->i915))
752+
if (intel_gt_needs_wa_22016122933(gt))
752753
i915_gem_object_set_cache_coherency(obj, I915_CACHE_NONE);
753754

754755
vma = i915_vma_instance(obj, &gt->ggtt->vm, NULL);

drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -960,10 +960,6 @@ static int ct_read(struct intel_guc_ct *ct, struct ct_incoming_msg **msg)
960960
/* now update descriptor */
961961
WRITE_ONCE(desc->head, head);
962962

963-
/*
964-
* Wa_22016122933: Making sure the head update is
965-
* visible to GuC right away
966-
*/
967963
intel_guc_write_barrier(ct_to_guc(ct));
968964

969965
return available - len;

0 commit comments

Comments
 (0)