drm/i915: Make i915_coherent_map_type GT-centric
Subsystems (3)
PATCH 1/2 drm/i915: Make i915_coherent_map_type GT-centric
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.
--- drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 3 ++- drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 ---- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 15 --------------- .../drm/i915/gem/selftests/i915_gem_migrate.c | 12 ++++++------ drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 +- drivers/gpu/drm/i915/gt/intel_gt.c | 17 ++++++++++++++++- drivers/gpu/drm/i915/gt/intel_gt.h | 3 +++ drivers/gpu/drm/i915/gt/intel_gtt.c | 4 ++-- drivers/gpu/drm/i915/gt/intel_lrc.c | 2 +- drivers/gpu/drm/i915/gt/intel_ring.c | 3 ++- drivers/gpu/drm/i915/gt/selftest_context.c | 2 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 4 ++-- drivers/gpu/drm/i915/gt/selftest_lrc.c | 2 +- drivers/gpu/drm/i915/gt/shmem_utils.c | 7 ++++--- drivers/gpu/drm/i915/gt/shmem_utils.h | 4 +++- drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c | 3 +-- drivers/gpu/drm/i915/gt/uc/intel_guc.c | 2 +- drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c | 3 +-- drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 3 ++- drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c | 2 +- drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 3 ++- drivers/gpu/drm/i915/selftests/igt_spinner.c | 2 +- 22 files changed, 53 insertions(+), 49 deletions(-)
drivers/gpu/drm/i915/display/intel_hdcp_gsc.c +2 -1
@@ -6,6 +6,7 @@#include <drm/i915_hdcp_interface.h> #include "gem/i915_gem_region.h" +#include "gt/intel_gt.h" #include "gt/uc/intel_gsc_uc_heci_cmd_submit.h" #include "i915_drv.h" #include "i915_utils.h"
@@ -632,7 +633,7 @@ static int intel_hdcp_gsc_initialize_message(struct drm_i915_private *i915,return PTR_ERR (obj); } - cmd_in =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + cmd_in =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (cmd_in)) {drm_err (&i915->drm,"Failed to map gsc message page!\n" ); err =PTR_ERR (cmd_in);
drivers/gpu/drm/i915/gem/i915_gem_object.h +0 -4
@@ -716,10 +716,6 @@ void *__must_check i915_gem_object_pin_map(struct drm_i915_gem_object *obj,void *__must_check i915_gem_object_pin_map_unlocked (struct drm_i915_gem_object *obj,enum i915_map_type type); -enum i915_map_type i915_coherent_map_type (struct drm_i915_private *i915, -struct drm_i915_gem_object *obj, -bool always_coherent); -void __i915_gem_object_flush_map (struct drm_i915_gem_object *obj,unsigned long offset,unsigned long size);
drivers/gpu/drm/i915/gem/i915_gem_pages.c +0 -15
@@ -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 ; -} -void __i915_gem_object_flush_map (struct drm_i915_gem_object *obj,unsigned long offset,unsigned long size)
drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c +6 -6
@@ -13,12 +13,12 @@#include "selftests/igt_spinner.h" static int igt_fill_check_buffer (struct drm_i915_gem_object *obj, +struct intel_gt *gt,bool fill) { -struct drm_i915_private *i915 =to_i915 (obj->base.dev);unsigned int i, count = obj->base.size /sizeof (u32);enum i915_map_type map_type = -i915_coherent_map_type (i915, obj, false); +intel_gt_coherent_map_type (gt, obj, false);u32 *cur;int err =0 ;
@@ -66,7 +66,7 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,if (err)continue ; - err =igt_fill_check_buffer (obj, true); + err =igt_fill_check_buffer (obj, gt, true);if (err)continue ;
@@ -86,7 +86,7 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,if (err)continue ; - err =igt_fill_check_buffer (obj, false); + err =igt_fill_check_buffer (obj, gt, false); }i915_gem_object_put (obj);
@@ -233,7 +233,7 @@ static int __igt_lmem_pages_migrate(struct intel_gt *gt,continue ;if (!vma) { - err =igt_fill_check_buffer (obj, true); + err =igt_fill_check_buffer (obj, gt, true);if (err)continue ; }
@@ -276,7 +276,7 @@ static int __igt_lmem_pages_migrate(struct intel_gt *gt,if (err) goto out_unlock; }else { - err =igt_fill_check_buffer (obj, false); + err =igt_fill_check_buffer (obj, gt, false); } out_unlock:
drivers/gpu/drm/i915/gt/intel_engine_pm.c +1 -1
@@ -39,7 +39,7 @@ static void dbg_poison_ce(struct intel_context *ce)if (ce->state) {struct drm_i915_gem_object *obj = ce->state->obj; -int type =i915_coherent_map_type (ce->engine->i915, obj, true); +int type =intel_gt_coherent_map_type (ce->engine->gt, obj, true);void *map;if (!i915_gem_object_trylock (obj,NULL ))
drivers/gpu/drm/i915/gt/intel_gt.c +16 -1
@@ -591,7 +591,7 @@ static int __engines_record_defaults(struct intel_gt *gt)continue ;/* Keep a copy of the state's backing pages; free the obj */ - state =shmem_create_from_object (rq->context->state->obj); + state =shmem_create_from_object (rq->context->state->obj, gt);if (IS_ERR (state)) { err =PTR_ERR (state); goto out;
@@ -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 ; +} +#if IS_ENABLED (CONFIG_DRM_I915_SELFTEST )#include "selftest_tlb.c" #endif
drivers/gpu/drm/i915/gt/intel_gt.h +3 -0
@@ -119,4 +119,7 @@ static inline u32 intel_gt_next_invalidate_tlb_full(const struct intel_gt *gt)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);#endif /* __INTEL_GT_H__ */
drivers/gpu/drm/i915/gt/intel_gtt.c +2 -2
@@ -89,7 +89,7 @@ int map_pt_dma(struct i915_address_space *vm, struct drm_i915_gem_object *obj)enum i915_map_type type;void *vaddr; - type =i915_coherent_map_type (vm->i915, obj, true); + type =intel_gt_coherent_map_type (vm->gt, obj, true); vaddr =i915_gem_object_pin_map_unlocked (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);
@@ -103,7 +103,7 @@ int map_pt_dma_locked(struct i915_address_space *vm, struct drm_i915_gem_objectenum i915_map_type type;void *vaddr; - type =i915_coherent_map_type (vm->i915, obj, true); + type =intel_gt_coherent_map_type (vm->gt, obj, true); vaddr =i915_gem_object_pin_map (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);
drivers/gpu/drm/i915/gt/intel_lrc.c +1 -1
@@ -1191,7 +1191,7 @@ lrc_pre_pin(struct intel_context *ce,GEM_BUG_ON (!i915_vma_is_pinned (ce->state)); *vaddr =i915_gem_object_pin_map (ce->state->obj, -i915_coherent_map_type (ce->engine->i915, +intel_gt_coherent_map_type (ce->engine->gt, ce->state->obj, false) |I915_MAP_OVERRIDE );
drivers/gpu/drm/i915/gt/intel_ring.c +2 -1
@@ -13,6 +13,7 @@#include "intel_engine_regs.h" #include "intel_gpu_commands.h" #include "intel_ring.h" +#include "intel_gt.h" #include "intel_timeline.h" unsigned int intel_ring_update_space (struct intel_ring *ring)
@@ -56,7 +57,7 @@ int intel_ring_pin(struct intel_ring *ring, struct i915_gem_ww_ctx *ww)if (i915_vma_is_map_and_fenceable (vma) && !HAS_LLC (vma->vm->i915)) { addr = (void __force *)i915_vma_pin_iomap (vma); }else { -int type =i915_coherent_map_type (vma->vm->i915, vma->obj, false); +int type =intel_gt_coherent_map_type (vma->vm->gt, vma->obj, false); addr =i915_gem_object_pin_map (vma->obj, type); }
drivers/gpu/drm/i915/gt/selftest_context.c +1 -1
@@ -88,7 +88,7 @@ static int __live_context_size(struct intel_engine_cs *engine) goto err; vaddr =i915_gem_object_pin_map_unlocked (ce->state->obj, -i915_coherent_map_type (engine->i915, +intel_gt_coherent_map_type (engine->gt, ce->state->obj, false));if (IS_ERR (vaddr)) { err =PTR_ERR (vaddr);
drivers/gpu/drm/i915/gt/selftest_hangcheck.c +2 -2
@@ -73,7 +73,7 @@ static int hang_init(struct hang *h, struct intel_gt *gt) h->seqno =memset (vaddr,0xff ,PAGE_SIZE ); vaddr =i915_gem_object_pin_map_unlocked (h->obj, -i915_coherent_map_type (gt->i915, h->obj, false)); +intel_gt_coherent_map_type (gt, h->obj, false));if (IS_ERR (vaddr)) { err =PTR_ERR (vaddr); goto err_unpin_hws;
@@ -119,7 +119,7 @@ hang_create_request(struct hang *h, struct intel_engine_cs *engine)return ERR_CAST (obj); } - vaddr =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (gt->i915, obj, false)); + vaddr =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, false));if (IS_ERR (vaddr)) {i915_gem_object_put (obj);i915_vm_put (vm);
drivers/gpu/drm/i915/gt/selftest_lrc.c +1 -1
@@ -1292,7 +1292,7 @@ static int compare_isolation(struct intel_engine_cs *engine, } lrc =i915_gem_object_pin_map_unlocked (ce->state->obj, -i915_coherent_map_type (engine->i915, +intel_gt_coherent_map_type (engine->gt, ce->state->obj, false));if (IS_ERR (lrc)) {
drivers/gpu/drm/i915/gt/shmem_utils.c +4 -3
@@ -11,6 +11,7 @@#include "i915_drv.h" #include "gem/i915_gem_object.h" #include "gem/i915_gem_lmem.h" +#include "gt/intel_gt.h" #include "shmem_utils.h" struct file *shmem_create_from_data (const char *name,void *data,size_t len)
@@ -31,9 +32,9 @@ struct file *shmem_create_from_data(const char *name, void *data, size_t len)return file; } -struct file *shmem_create_from_object (struct drm_i915_gem_object *obj) +struct file *shmem_create_from_object (struct drm_i915_gem_object *obj, +struct intel_gt *gt) { -struct drm_i915_private *i915 =to_i915 (obj->base.dev);enum i915_map_type map_type;struct file *file;void *ptr;
@@ -44,7 +45,7 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj)return file; } - map_type =i915_coherent_map_type (i915, obj, true); + map_type =intel_gt_coherent_map_type (gt, obj, true); ptr =i915_gem_object_pin_map_unlocked (obj, map_type);if (IS_ERR (ptr))return ERR_CAST (ptr);
drivers/gpu/drm/i915/gt/shmem_utils.h +3 -1
@@ -11,9 +11,11 @@struct iosys_map ;struct drm_i915_gem_object ;struct file ; +struct intel_gt ;struct file *shmem_create_from_data (const char *name,void *data,size_t len); -struct file *shmem_create_from_object (struct drm_i915_gem_object *obj); +struct file *shmem_create_from_object (struct drm_i915_gem_object *obj, +struct intel_gt *gt);void *shmem_pin_map (struct file *file);void shmem_unpin_map (struct file *file,void *ptr);
drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c +1 -2
@@ -268,7 +268,6 @@ static int gsc_fw_load(struct intel_gsc_uc *gsc)static int gsc_fw_load_prepare (struct intel_gsc_uc *gsc) {struct intel_gt *gt =gsc_uc_to_gt (gsc); -struct drm_i915_private *i915 = gt->i915;void *src;if (!gsc->local)
@@ -278,7 +277,7 @@ static int gsc_fw_load_prepare(struct intel_gsc_uc *gsc)return -ENOSPC ; src =i915_gem_object_pin_map_unlocked (gsc->fw.obj, -i915_coherent_map_type (i915, gsc->fw.obj, true)); +intel_gt_coherent_map_type (gt, gsc->fw.obj, true));if (IS_ERR (src))return PTR_ERR (src);
drivers/gpu/drm/i915/gt/uc/intel_guc.c +1 -1
@@ -792,7 +792,7 @@ int intel_guc_allocate_and_map_vma(struct intel_guc *guc, u32 size,return PTR_ERR (vma); vaddr =i915_gem_object_pin_map_unlocked (vma->obj, -i915_coherent_map_type (guc_to_gt (guc)->i915, +intel_gt_coherent_map_type (guc_to_gt (guc), vma->obj, true));if (IS_ERR (vaddr)) {i915_vma_unpin_and_release (&vma,0 );
drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +1 -2
@@ -27,7 +27,6 @@ struct mtl_huc_auth_msg_out {int intel_huc_fw_auth_via_gsccs (struct intel_huc *huc) {struct intel_gt *gt =huc_to_gt (huc); -struct drm_i915_private *i915 = gt->i915;struct drm_i915_gem_object *obj;struct mtl_huc_auth_msg_in *msg_in;struct mtl_huc_auth_msg_out *msg_out;
@@ -43,7 +42,7 @@ int intel_huc_fw_auth_via_gsccs(struct intel_huc *huc) pkt_offset =i915_ggtt_offset (huc->heci_pkt); pkt_vaddr =i915_gem_object_pin_map_unlocked (obj, -i915_coherent_map_type (i915, obj, true)); +intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (pkt_vaddr))return PTR_ERR (pkt_vaddr);
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +2 -1
@@ -11,6 +11,7 @@#include <drm/drm_print.h> #include "gem/i915_gem_lmem.h" +#include "gt/intel_gt.h" #include "gt/intel_gt_print.h" #include "intel_gsc_binary_headers.h" #include "intel_gsc_fw.h"
@@ -1213,7 +1214,7 @@ static int uc_fw_rsa_data_create(struct intel_uc_fw *uc_fw)return PTR_ERR (vma); vaddr =i915_gem_object_pin_map_unlocked (vma->obj, -i915_coherent_map_type (gt->i915, vma->obj, true)); +intel_gt_coherent_map_type (gt, vma->obj, true));if (IS_ERR (vaddr)) {i915_vma_unpin_and_release (&vma,0 ); err =PTR_ERR (vaddr);
drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c +1 -1
@@ -336,7 +336,7 @@ gsccs_create_buffer(struct intel_gt *gt, }/* return a virtual pointer */ - *map =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + *map =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (*map)) {drm_err (&i915->drm,"Failed to map gsccs backend %s.\n" , bufname); err =PTR_ERR (*map);
drivers/gpu/drm/i915/pxp/intel_pxp_tee.c +2 -1
@@ -11,6 +11,7 @@#include "gem/i915_gem_lmem.h" #include "i915_drv.h" +#include "gt/intel_gt.h" #include "intel_pxp.h" #include "intel_pxp_cmd_interface_42.h"
@@ -245,7 +246,7 @@ static int alloc_streaming_command(struct intel_pxp *pxp) }/* map the lmem into the virtual memory pointer */ - cmd =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + cmd =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (pxp->ctrl_gt, obj, true));if (IS_ERR (cmd)) {drm_err (&i915->drm,"Failed to map gsc message page!\n" ); err =PTR_ERR (cmd);
drivers/gpu/drm/i915/selftests/igt_spinner.c +1 -1
@@ -97,7 +97,7 @@ int igt_spinner_pin(struct igt_spinner *spin,if (!spin->batch) {unsigned int mode; - mode =i915_coherent_map_type (spin->gt->i915, spin->obj, false); + mode =intel_gt_coherent_map_type (spin->gt, spin->obj, false); vaddr =igt_spinner_pin_obj (ce, ww, spin->obj, mode, &spin->batch_vma);if (IS_ERR (vaddr))return PTR_ERR (vaddr);
Signature · 1 line
2.25.1
PATCH 2/2 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.
--- drivers/gpu/drm/i915/gt/intel_gt.c | 5 +++-- drivers/gpu/drm/i915/gt/intel_gt.h | 6 ++++++ drivers/gpu/drm/i915/gt/intel_lrc.c | 7 ++++--- drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c | 4 ---- drivers/gpu/drm/i915/gt/uc/intel_guc.c | 7 ++++--- drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 4 ---- 6 files changed, 17 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/gt/intel_gt.c +3 -2
@@ -1139,9 +1139,10 @@ enum i915_map_type intel_gt_coherent_map_type(struct intel_gt *gt, bool always_coherent) {/* -* Wa_22016122933: always return I915_MAP_WC for MTL +* Wa_22016122933: always return I915_MAP_WC for Media +* version 13.0 when the object is on the Media GT */ -if (i915_gem_object_is_lmem (obj) ||IS_METEORLAKE (gt->i915)) +if (i915_gem_object_is_lmem (obj) ||intel_gt_needs_wa_22016122933 (gt))return I915_MAP_WC ;if (HAS_LLC (gt->i915) || always_coherent)return I915_MAP_WB ;
drivers/gpu/drm/i915/gt/intel_gt.h +6 -0
@@ -6,6 +6,7 @@#ifndef __INTEL_GT__#define __INTEL_GT__ +#include "i915_drv.h" #include "intel_engine_types.h" #include "intel_gt_types.h" #include "intel_reset.h"
@@ -24,6 +25,11 @@ static inline bool gt_is_root(struct intel_gt *gt)return !gt->info.id; } +static inline bool intel_gt_needs_wa_22016122933 (struct intel_gt *gt) +{ +return MEDIA_VER_FULL (gt->i915) ==IP_VER (13 ,0 ) && gt->type ==GT_MEDIA ; +} +static inline struct intel_gt *uc_to_gt (struct intel_uc *uc) { return container_of(uc, struct intel_gt, uc);
drivers/gpu/drm/i915/gt/intel_lrc.c +4 -3
@@ -1095,10 +1095,11 @@ __lrc_alloc_state(struct intel_context *ce, struct intel_engine_cs *engine)if (IS_ERR (obj)) { obj =i915_gem_object_create_shmem (engine->i915, context_size);/* -* Wa_22016122933: For MTL the shared memory needs to be mapped -* as WC on CPU side and UC (PAT index 2) on GPU side +* Wa_22016122933: For Media version 13.0, all Media GT shared +* memory needs to be mapped as WC on CPU side and UC (PAT +* index 2) on GPU side. */ -if (IS_METEORLAKE (engine->i915)) +if (intel_gt_needs_wa_22016122933 (engine->gt))i915_gem_object_set_cache_coherency (obj,I915_CACHE_NONE ); }if (IS_ERR (obj))
drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c +0 -4
@@ -284,10 +284,6 @@ static int gsc_fw_load_prepare(struct intel_gsc_uc *gsc)memcpy_toio (gsc->local_vaddr, src, gsc->fw.size);memset_io (gsc->local_vaddr + gsc->fw.size,0 , gsc->local->size - gsc->fw.size); -/* -* Wa_22016122933: Making sure the data in dst is -* visible to GSC right away -*/ intel_guc_write_barrier (>->uc.guc);i915_gem_object_unpin_map (gsc->fw.obj);
drivers/gpu/drm/i915/gt/uc/intel_guc.c +4 -3
@@ -745,10 +745,11 @@ struct i915_vma *intel_guc_allocate_vma(struct intel_guc *guc, u32 size)return ERR_CAST (obj);/* -* Wa_22016122933: For MTL the shared memory needs to be mapped -* as WC on CPU side and UC (PAT index 2) on GPU side +* Wa_22016122933: For Media version 13.0, all Media GT shared +* memory needs to be mapped as WC on CPU side and UC (PAT +* index 2) on GPU side. */ -if (IS_METEORLAKE (gt->i915)) +if (intel_gt_needs_wa_22016122933 (gt))i915_gem_object_set_cache_coherency (obj,I915_CACHE_NONE ); vma =i915_vma_instance (obj, >->ggtt->vm,NULL );
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +0 -4
@@ -960,10 +960,6 @@ static int ct_read(struct intel_guc_ct *ct, struct ct_incoming_msg **msg)/* now update descriptor */ WRITE_ONCE (desc->head, head); -/* -* Wa_22016122933: Making sure the head update is -* visible to GuC right away -*/ intel_guc_write_barrier (ct_to_guc (ct));return available - len;
Signature · 1 line
2.25.1
Re: [Intel-gfx] [PATCH dii-client 2/2] drm/i915/gt: Apply workaround 22016122933 correctly
Quoted 1 line
Subject: [PATCH dii-client 2/2] drm/i915/gt: Apply workaround 22016122933 correctly
Remove dii-client from the subject.
Otherwise LGTM.
Quoted 128 lines
WA_22016122933was 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.
Signed-off-by Jonathan Cavitt <[email protected]>Suggested-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/gt/intel_gt.c | 5 +++-- drivers/gpu/drm/i915/gt/intel_gt.h | 6 ++++++ drivers/gpu/drm/i915/gt/intel_lrc.c | 7 ++++--- drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c | 4 ---- drivers/gpu/drm/i915/gt/uc/intel_guc.c | 7 ++++--- drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 4 ---- 6 files changed, 17 insertions(+), 16 deletions(-)drivers/gpu/drm/i915/gt/intel_gt.c +3
-2@@ -1139,9 +1139,10 @@ enum i915_map_type intel_gt_coherent_map_type(struct intel_gt *gt, bool always_coherent) {/* -* Wa_22016122933: always return I915_MAP_WC for MTL +* Wa_22016122933: always return I915_MAP_WC for Media +* version 13.0 when the object is on the Media GT */ -if (i915_gem_object_is_lmem (obj) ||IS_METEORLAKE (gt->i915)) +if (i915_gem_object_is_lmem (obj) ||intel_gt_needs_wa_22016122933 (gt))return I915_MAP_WC ;if (HAS_LLC (gt->i915) || always_coherent)return I915_MAP_WB ;drivers/gpu/drm/i915/gt/intel_gt.h +5
-0@@ -6,6 +6,7 @@#ifndef __INTEL_GT__#define __INTEL_GT__ +#include "i915_drv.h" #include "intel_engine_types.h" #include "intel_gt_types.h" #include "intel_reset.h" @@ -24,6 +25,11 @@ static inline bool gt_is_root(struct intel_gt *gt)return !gt->info.id; } +static inline bool intel_gt_needs_wa_22016122933 (struct intel_gt *gt) { +return MEDIA_VER_FULL (gt->i915) ==IP_VER (13 ,0 ) && gt->type == +GT_MEDIA ; } +static inline struct intel_gt *uc_to_gt (struct intel_uc *uc) { return container_of(uc, struct intel_gt, uc); diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.cindex
e5a83d4932c8..9f0a2d828a2a100644drivers/gpu/drm/i915/gt/intel_lrc.c +4
-3@@ -1095,10 +1095,11 @@ __lrc_alloc_state(struct intel_context *ce, struct intel_engine_cs *engine)if (IS_ERR (obj)) { obj =i915_gem_object_create_shmem (engine->i915, context_size);/* -* Wa_22016122933: For MTL the shared memory needs to be mapped -* as WC on CPU side and UC (PAT index 2) on GPU side +* Wa_22016122933: For Media version 13.0, all Media GT shared +* memory needs to be mapped as WC on CPU side and UC (PAT +* index 2) on GPU side. */ -if (IS_METEORLAKE (engine->i915)) +if (intel_gt_needs_wa_22016122933 (engine->gt))i915_gem_object_set_cache_coherency (obj,I915_CACHE_NONE ); }if (IS_ERR (obj))drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c +0
-4@@ -284,10 +284,6 @@ static int gsc_fw_load_prepare(struct intel_gsc_uc *gsc)memcpy_toio (gsc->local_vaddr, src, gsc->fw.size);memset_io (gsc->local_vaddr + gsc->fw.size,0 , gsc->local->size - gsc->fw.size); -/* -* Wa_22016122933: Making sure the data in dst is -* visible to GSC right away -*/ intel_guc_write_barrier (>->uc.guc);i915_gem_object_unpin_map (gsc->fw.obj);drivers/gpu/drm/i915/gt/uc/intel_guc.c +4
-3@@ -745,10 +745,11 @@ struct i915_vma *intel_guc_allocate_vma(struct intel_guc *guc, u32 size)return ERR_CAST (obj);/* -* Wa_22016122933: For MTL the shared memory needs to be mapped -* as WC on CPU side and UC (PAT index 2) on GPU side +* Wa_22016122933: For Media version 13.0, all Media GT shared +* memory needs to be mapped as WC on CPU side and UC (PAT +* index 2) on GPU side. */ -if (IS_METEORLAKE (gt->i915)) +if (intel_gt_needs_wa_22016122933 (gt))i915_gem_object_set_cache_coherency (obj,I915_CACHE_NONE ); vma = i915_vma_instance(obj, >->ggtt->vm, NULL); diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.cindex
f28a3a83742d..97eadd08181d100644drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +0
-5@@ -960,10 +960,6 @@ static int ct_read(struct intel_guc_ct *ct, struct ct_incoming_msg **msg)/* now update descriptor */ WRITE_ONCE (desc->head, head); -/* -* Wa_22016122933: Making sure the head update is -* visible to GuC right away -*/ intel_guc_write_barrier (ct_to_guc (ct));return available - len; --2.25.1
Quoted 6 lines · Jonathan Cavitt
Refactor
i915_coherent_map_typeto 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.
What about the issue of fake gt passed to shmem_create_from_object I raised?
Regards,
Tvrtko
P.S. See if you can drop the dii-client part from the subject line going forward.
Quoted 482 lines
Suggested-by Matt Roper <[email protected]>Signed-off-by Jonathan Cavitt <[email protected]>--- drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 3 ++- drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 ---- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 15 --------------- .../drm/i915/gem/selftests/i915_gem_migrate.c | 12 ++++++------ drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 +- drivers/gpu/drm/i915/gt/intel_gt.c | 17 ++++++++++++++++- drivers/gpu/drm/i915/gt/intel_gt.h | 3 +++ drivers/gpu/drm/i915/gt/intel_gtt.c | 4 ++-- drivers/gpu/drm/i915/gt/intel_lrc.c | 2 +- drivers/gpu/drm/i915/gt/intel_ring.c | 3 ++- drivers/gpu/drm/i915/gt/selftest_context.c | 2 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 4 ++-- drivers/gpu/drm/i915/gt/selftest_lrc.c | 2 +- drivers/gpu/drm/i915/gt/shmem_utils.c | 7 ++++--- drivers/gpu/drm/i915/gt/shmem_utils.h | 4 +++- drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c | 3 +-- drivers/gpu/drm/i915/gt/uc/intel_guc.c | 2 +- drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c | 3 +-- drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 3 ++- drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c | 2 +- drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 3 ++- drivers/gpu/drm/i915/selftests/igt_spinner.c | 2 +- 22 files changed, 53 insertions(+), 49 deletions(-)drivers/gpu/drm/i915/display/intel_hdcp_gsc.c +2
-1@@ -6,6 +6,7 @@#include <drm/i915_hdcp_interface.h> #include "gem/i915_gem_region.h" +#include "gt/intel_gt.h" #include "gt/uc/intel_gsc_uc_heci_cmd_submit.h" #include "i915_drv.h" #include "i915_utils.h" @@ -632,7 +633,7 @@ static int intel_hdcp_gsc_initialize_message(struct drm_i915_private *i915,return PTR_ERR (obj); } - cmd_in =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + cmd_in =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (cmd_in)) {drm_err (&i915->drm,"Failed to map gsc message page!\n" ); err =PTR_ERR (cmd_in);drivers/gpu/drm/i915/gem/i915_gem_object.h +0
-4@@ -716,10 +716,6 @@ void *__must_check i915_gem_object_pin_map(struct drm_i915_gem_object *obj,void *__must_check i915_gem_object_pin_map_unlocked (struct drm_i915_gem_object *obj,enum i915_map_type type); -enum i915_map_type i915_coherent_map_type (struct drm_i915_private *i915, -struct drm_i915_gem_object *obj, -bool always_coherent); -void __i915_gem_object_flush_map (struct drm_i915_gem_object *obj,unsigned long offset,unsigned long size);drivers/gpu/drm/i915/gem/i915_gem_pages.c +0
-15@@ -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 ; -} -void __i915_gem_object_flush_map (struct drm_i915_gem_object *obj,unsigned long offset,unsigned long size)drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c +6
-6@@ -13,12 +13,12 @@#include "selftests/igt_spinner.h" static int igt_fill_check_buffer (struct drm_i915_gem_object *obj, +struct intel_gt *gt,bool fill) { -struct drm_i915_private *i915 =to_i915 (obj->base.dev);unsigned int i, count = obj->base.size /sizeof (u32);enum i915_map_type map_type = -i915_coherent_map_type (i915, obj, false); +intel_gt_coherent_map_type (gt, obj, false);u32 *cur;int err =0 ;@@ -66,7 +66,7 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,if (err)continue ; - err =igt_fill_check_buffer (obj, true); + err =igt_fill_check_buffer (obj, gt, true);if (err)continue ;@@ -86,7 +86,7 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,if (err)continue ; - err =igt_fill_check_buffer (obj, false); + err =igt_fill_check_buffer (obj, gt, false); }i915_gem_object_put (obj);@@ -233,7 +233,7 @@ static int __igt_lmem_pages_migrate(struct intel_gt *gt,continue ;if (!vma) { - err =igt_fill_check_buffer (obj, true); + err =igt_fill_check_buffer (obj, gt, true);if (err)continue ; }@@ -276,7 +276,7 @@ static int __igt_lmem_pages_migrate(struct intel_gt *gt,if (err) goto out_unlock; }else { - err =igt_fill_check_buffer (obj, false); + err =igt_fill_check_buffer (obj, gt, false); } out_unlock:drivers/gpu/drm/i915/gt/intel_engine_pm.c +1
-1@@ -39,7 +39,7 @@ static void dbg_poison_ce(struct intel_context *ce)if (ce->state) {struct drm_i915_gem_object *obj = ce->state->obj; -int type =i915_coherent_map_type (ce->engine->i915, obj, true); +int type =intel_gt_coherent_map_type (ce->engine->gt, obj, true);void *map;if (!i915_gem_object_trylock (obj,NULL ))drivers/gpu/drm/i915/gt/intel_gt.c +16
-1@@ -591,7 +591,7 @@ static int __engines_record_defaults(struct intel_gt *gt)continue ;/* Keep a copy of the state's backing pages; free the obj */ - state =shmem_create_from_object (rq->context->state->obj); + state =shmem_create_from_object (rq->context->state->obj, gt);if (IS_ERR (state)) { err =PTR_ERR (state); goto out;@@ -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 ; +} +#if IS_ENABLED (CONFIG_DRM_I915_SELFTEST )#include "selftest_tlb.c" #endif drivers/gpu/drm/i915/gt/intel_gt.h +3
-0@@ -119,4 +119,7 @@ static inline u32 intel_gt_next_invalidate_tlb_full(const struct intel_gt *gt)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);#endif /* __INTEL_GT_H__ */ drivers/gpu/drm/i915/gt/intel_gtt.c +2
-2@@ -89,7 +89,7 @@ int map_pt_dma(struct i915_address_space *vm, struct drm_i915_gem_object *obj)enum i915_map_type type;void *vaddr; - type =i915_coherent_map_type (vm->i915, obj, true); + type =intel_gt_coherent_map_type (vm->gt, obj, true); vaddr =i915_gem_object_pin_map_unlocked (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);@@ -103,7 +103,7 @@ int map_pt_dma_locked(struct i915_address_space *vm, struct drm_i915_gem_objectenum i915_map_type type;void *vaddr; - type =i915_coherent_map_type (vm->i915, obj, true); + type =intel_gt_coherent_map_type (vm->gt, obj, true); vaddr =i915_gem_object_pin_map (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);drivers/gpu/drm/i915/gt/intel_lrc.c +1
-1@@ -1191,7 +1191,7 @@ lrc_pre_pin(struct intel_context *ce,GEM_BUG_ON (!i915_vma_is_pinned (ce->state)); *vaddr =i915_gem_object_pin_map (ce->state->obj, -i915_coherent_map_type (ce->engine->i915, +intel_gt_coherent_map_type (ce->engine->gt, ce->state->obj, false) |I915_MAP_OVERRIDE );drivers/gpu/drm/i915/gt/intel_ring.c +2
-1@@ -13,6 +13,7 @@#include "intel_engine_regs.h" #include "intel_gpu_commands.h" #include "intel_ring.h" +#include "intel_gt.h" #include "intel_timeline.h" unsigned int intel_ring_update_space (struct intel_ring *ring)@@ -56,7 +57,7 @@ int intel_ring_pin(struct intel_ring *ring, struct i915_gem_ww_ctx *ww)if (i915_vma_is_map_and_fenceable (vma) && !HAS_LLC (vma->vm->i915)) { addr = (void __force *)i915_vma_pin_iomap (vma); }else { -int type =i915_coherent_map_type (vma->vm->i915, vma->obj, false); +int type =intel_gt_coherent_map_type (vma->vm->gt, vma->obj, false); addr =i915_gem_object_pin_map (vma->obj, type); }drivers/gpu/drm/i915/gt/selftest_context.c +1
-1@@ -88,7 +88,7 @@ static int __live_context_size(struct intel_engine_cs *engine) goto err; vaddr =i915_gem_object_pin_map_unlocked (ce->state->obj, -i915_coherent_map_type (engine->i915, +intel_gt_coherent_map_type (engine->gt, ce->state->obj, false));if (IS_ERR (vaddr)) { err =PTR_ERR (vaddr);drivers/gpu/drm/i915/gt/selftest_hangcheck.c +2
-2@@ -73,7 +73,7 @@ static int hang_init(struct hang *h, struct intel_gt *gt) h->seqno =memset (vaddr,0xff ,PAGE_SIZE ); vaddr =i915_gem_object_pin_map_unlocked (h->obj, -i915_coherent_map_type (gt->i915, h->obj, false)); +intel_gt_coherent_map_type (gt, h->obj, false));if (IS_ERR (vaddr)) { err =PTR_ERR (vaddr); goto err_unpin_hws;@@ -119,7 +119,7 @@ hang_create_request(struct hang *h, struct intel_engine_cs *engine)return ERR_CAST (obj); } - vaddr =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (gt->i915, obj, false)); + vaddr =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, false));if (IS_ERR (vaddr)) {i915_gem_object_put (obj);i915_vm_put (vm);drivers/gpu/drm/i915/gt/selftest_lrc.c +1
-1@@ -1292,7 +1292,7 @@ static int compare_isolation(struct intel_engine_cs *engine, } lrc =i915_gem_object_pin_map_unlocked (ce->state->obj, -i915_coherent_map_type (engine->i915, +intel_gt_coherent_map_type (engine->gt, ce->state->obj, false));if (IS_ERR (lrc)) {drivers/gpu/drm/i915/gt/shmem_utils.c +4
-3@@ -11,6 +11,7 @@#include "i915_drv.h" #include "gem/i915_gem_object.h" #include "gem/i915_gem_lmem.h" +#include "gt/intel_gt.h" #include "shmem_utils.h" struct file *shmem_create_from_data (const char *name,void *data,size_t len)@@ -31,9 +32,9 @@ struct file *shmem_create_from_data(const char *name, void *data, size_t len)return file; } -struct file *shmem_create_from_object (struct drm_i915_gem_object *obj) +struct file *shmem_create_from_object (struct drm_i915_gem_object *obj, +struct intel_gt *gt) { -struct drm_i915_private *i915 =to_i915 (obj->base.dev);enum i915_map_type map_type;struct file *file;void *ptr;@@ -44,7 +45,7 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj)return file; } - map_type =i915_coherent_map_type (i915, obj, true); + map_type =intel_gt_coherent_map_type (gt, obj, true); ptr =i915_gem_object_pin_map_unlocked (obj, map_type);if (IS_ERR (ptr))return ERR_CAST (ptr);drivers/gpu/drm/i915/gt/shmem_utils.h +3
-1@@ -11,9 +11,11 @@struct iosys_map ;struct drm_i915_gem_object ;struct file ; +struct intel_gt ;struct file *shmem_create_from_data (const char *name,void *data,size_t len); -struct file *shmem_create_from_object (struct drm_i915_gem_object *obj); +struct file *shmem_create_from_object (struct drm_i915_gem_object *obj, +struct intel_gt *gt);void *shmem_pin_map (struct file *file);void shmem_unpin_map (struct file *file,void *ptr);drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c +1
-2@@ -268,7 +268,6 @@ static int gsc_fw_load(struct intel_gsc_uc *gsc)static int gsc_fw_load_prepare (struct intel_gsc_uc *gsc) {struct intel_gt *gt =gsc_uc_to_gt (gsc); -struct drm_i915_private *i915 = gt->i915;void *src;if (!gsc->local)@@ -278,7 +277,7 @@ static int gsc_fw_load_prepare(struct intel_gsc_uc *gsc)return -ENOSPC ; src =i915_gem_object_pin_map_unlocked (gsc->fw.obj, -i915_coherent_map_type (i915, gsc->fw.obj, true)); +intel_gt_coherent_map_type (gt, gsc->fw.obj, true));if (IS_ERR (src))return PTR_ERR (src);drivers/gpu/drm/i915/gt/uc/intel_guc.c +1
-1@@ -792,7 +792,7 @@ int intel_guc_allocate_and_map_vma(struct intel_guc *guc, u32 size,return PTR_ERR (vma); vaddr =i915_gem_object_pin_map_unlocked (vma->obj, -i915_coherent_map_type (guc_to_gt (guc)->i915, +intel_gt_coherent_map_type (guc_to_gt (guc), vma->obj, true));if (IS_ERR (vaddr)) {i915_vma_unpin_and_release (&vma,0 );drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +1
-2@@ -27,7 +27,6 @@ struct mtl_huc_auth_msg_out {int intel_huc_fw_auth_via_gsccs (struct intel_huc *huc) {struct intel_gt *gt =huc_to_gt (huc); -struct drm_i915_private *i915 = gt->i915;struct drm_i915_gem_object *obj;struct mtl_huc_auth_msg_in *msg_in;struct mtl_huc_auth_msg_out *msg_out;@@ -43,7 +42,7 @@ int intel_huc_fw_auth_via_gsccs(struct intel_huc *huc) pkt_offset =i915_ggtt_offset (huc->heci_pkt); pkt_vaddr =i915_gem_object_pin_map_unlocked (obj, -i915_coherent_map_type (i915, obj, true)); +intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (pkt_vaddr))return PTR_ERR (pkt_vaddr);drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +2
-1@@ -11,6 +11,7 @@#include <drm/drm_print.h> #include "gem/i915_gem_lmem.h" +#include "gt/intel_gt.h" #include "gt/intel_gt_print.h" #include "intel_gsc_binary_headers.h" #include "intel_gsc_fw.h" @@ -1213,7 +1214,7 @@ static int uc_fw_rsa_data_create(struct intel_uc_fw *uc_fw)return PTR_ERR (vma); vaddr =i915_gem_object_pin_map_unlocked (vma->obj, -i915_coherent_map_type (gt->i915, vma->obj, true)); +intel_gt_coherent_map_type (gt, vma->obj, true));if (IS_ERR (vaddr)) {i915_vma_unpin_and_release (&vma,0 ); err =PTR_ERR (vaddr);drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c +1
-1@@ -336,7 +336,7 @@ gsccs_create_buffer(struct intel_gt *gt, }/* return a virtual pointer */ - *map =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + *map =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (*map)) {drm_err (&i915->drm,"Failed to map gsccs backend %s.\n" , bufname); err =PTR_ERR (*map);drivers/gpu/drm/i915/pxp/intel_pxp_tee.c +2
-1@@ -11,6 +11,7 @@#include "gem/i915_gem_lmem.h" #include "i915_drv.h" +#include "gt/intel_gt.h" #include "intel_pxp.h" #include "intel_pxp_cmd_interface_42.h" @@ -245,7 +246,7 @@ static int alloc_streaming_command(struct intel_pxp *pxp) }/* map the lmem into the virtual memory pointer */ - cmd =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + cmd =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (pxp->ctrl_gt, obj, true));if (IS_ERR (cmd)) {drm_err (&i915->drm,"Failed to map gsc message page!\n" ); err =PTR_ERR (cmd);drivers/gpu/drm/i915/selftests/igt_spinner.c +1
-1@@ -97,7 +97,7 @@ int igt_spinner_pin(struct igt_spinner *spin,if (!spin->batch) {unsigned int mode; - mode =i915_coherent_map_type (spin->gt->i915, spin->obj, false); + mode =intel_gt_coherent_map_type (spin->gt, spin->obj, false); vaddr =igt_spinner_pin_obj (ce, ww, spin->obj, mode, &spin->batch_vma);if (IS_ERR (vaddr))return PTR_ERR (vaddr);
-----Original Message-----
From: Tvrtko Ursulin <[email protected]>
Sent: Tuesday, July 25, 2023 9:23 AM
To: Cavitt, Jonathan <[email protected]>; [email protected]
Cc: Shyti, Andi <[email protected]>; Roper, Matthew D <[email protected]>; [email protected]; Das, Nirmoy <[email protected]>
Subject: Re: [Intel-gfx] [PATCH dii-client 1/2] drm/i915: Make i915_coherent_map_type GT-centric
Quoted 11 lines · Jonathan Cavitt
Quoted 6 lines
Refactor
i915_coherent_map_typeto 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.
What about the issue of fake gt passed to
shmem_create_from_objectI raised?
The function is, presently, only called in __engines_record_defaults, as a part of intel_gt_init. shmem_create_from_object uses i915_coherent_map_type to determine the map_type to pass to i915_gem_object_pin_map_unlocked. This creates a pointer that we pass to shmem_create_from_data. Aside from an i915_gem_object_is_shmem check at the start, the function is otherwise just calling shmem_create_from_data... which, itself, is only called by shmem_create_from_object.
I'd argue that any additional changes to shmem_create_from_object are unnecessary as the function is only called from __engines_record_defaults. Additionally, the function is a part of the gt library (shmem_utils.h is in the gt folder), so taking a gt argument should be expected. However, if you still disagree, here's a few options for how we can rectify this issue:
Debatably, we could just delete shmem_create_from_object and use the full expansion in __engines_record_defaults. Though this may come with some additional complications, such as the lost helper function being desirable in the future and needing to expand the definition of shmem_create_from_data to include an object pinning requirement.
The second option is that we pass the map_type to the shmem_create_from_object function instead of the GT, bypassing the need for i915_coherent_map_type in the function by breaking it out as a part of __engines_record_defaults. I'll leave it to your judgement whether this would be more or less confusing than just passing the GT.
Thirdly, we could just hard-code a specific map_type to use, though that seems ill-advised.
The last option is to rename the function to something more representative. Here's a few ideas I can think of off the top of my head:
shmem_createshmem_create_on_gtshmem_create_from_gtshmem_create_from_object_on_gtintel_gt_create_shmem_from_object
If I had to recommend one approach over the rest, it would probably be the second option, followed by the fourth.
-Jonathan Cavitt
Quoted 491 lines
Regards,
Tvrtko
P.S. See if you can drop the dii-client part from the subject line going forward.Quoted 482 lines
Suggested-by Matt Roper <[email protected]>Signed-off-by Jonathan Cavitt <[email protected]>--- drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 3 ++- drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 ---- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 15 --------------- .../drm/i915/gem/selftests/i915_gem_migrate.c | 12 ++++++------ drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 +- drivers/gpu/drm/i915/gt/intel_gt.c | 17 ++++++++++++++++- drivers/gpu/drm/i915/gt/intel_gt.h | 3 +++ drivers/gpu/drm/i915/gt/intel_gtt.c | 4 ++-- drivers/gpu/drm/i915/gt/intel_lrc.c | 2 +- drivers/gpu/drm/i915/gt/intel_ring.c | 3 ++- drivers/gpu/drm/i915/gt/selftest_context.c | 2 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 4 ++-- drivers/gpu/drm/i915/gt/selftest_lrc.c | 2 +- drivers/gpu/drm/i915/gt/shmem_utils.c | 7 ++++--- drivers/gpu/drm/i915/gt/shmem_utils.h | 4 +++- drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c | 3 +-- drivers/gpu/drm/i915/gt/uc/intel_guc.c | 2 +- drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c | 3 +-- drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 3 ++- drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c | 2 +- drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 3 ++- drivers/gpu/drm/i915/selftests/igt_spinner.c | 2 +- 22 files changed, 53 insertions(+), 49 deletions(-)drivers/gpu/drm/i915/display/intel_hdcp_gsc.c +2
-1@@ -6,6 +6,7 @@#include <drm/i915_hdcp_interface.h> #include "gem/i915_gem_region.h" +#include "gt/intel_gt.h" #include "gt/uc/intel_gsc_uc_heci_cmd_submit.h" #include "i915_drv.h" #include "i915_utils.h" @@ -632,7 +633,7 @@ static int intel_hdcp_gsc_initialize_message(struct drm_i915_private *i915,return PTR_ERR (obj); } - cmd_in =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + cmd_in =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (cmd_in)) {drm_err (&i915->drm,"Failed to map gsc message page!\n" ); err =PTR_ERR (cmd_in);drivers/gpu/drm/i915/gem/i915_gem_object.h +0
-4@@ -716,10 +716,6 @@ void *__must_check i915_gem_object_pin_map(struct drm_i915_gem_object *obj,void *__must_check i915_gem_object_pin_map_unlocked (struct drm_i915_gem_object *obj,enum i915_map_type type); -enum i915_map_type i915_coherent_map_type (struct drm_i915_private *i915, -struct drm_i915_gem_object *obj, -bool always_coherent); -void __i915_gem_object_flush_map (struct drm_i915_gem_object *obj,unsigned long offset,unsigned long size);drivers/gpu/drm/i915/gem/i915_gem_pages.c +0
-15@@ -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 ; -} -void __i915_gem_object_flush_map (struct drm_i915_gem_object *obj,unsigned long offset,unsigned long size)drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c +6
-6@@ -13,12 +13,12 @@#include "selftests/igt_spinner.h" static int igt_fill_check_buffer (struct drm_i915_gem_object *obj, +struct intel_gt *gt,bool fill) { -struct drm_i915_private *i915 =to_i915 (obj->base.dev);unsigned int i, count = obj->base.size /sizeof (u32);enum i915_map_type map_type = -i915_coherent_map_type (i915, obj, false); +intel_gt_coherent_map_type (gt, obj, false);u32 *cur;int err =0 ;@@ -66,7 +66,7 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,if (err)continue ; - err =igt_fill_check_buffer (obj, true); + err =igt_fill_check_buffer (obj, gt, true);if (err)continue ;@@ -86,7 +86,7 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,if (err)continue ; - err =igt_fill_check_buffer (obj, false); + err =igt_fill_check_buffer (obj, gt, false); }i915_gem_object_put (obj);@@ -233,7 +233,7 @@ static int __igt_lmem_pages_migrate(struct intel_gt *gt,continue ;if (!vma) { - err =igt_fill_check_buffer (obj, true); + err =igt_fill_check_buffer (obj, gt, true);if (err)continue ; }@@ -276,7 +276,7 @@ static int __igt_lmem_pages_migrate(struct intel_gt *gt,if (err) goto out_unlock; }else { - err =igt_fill_check_buffer (obj, false); + err =igt_fill_check_buffer (obj, gt, false); } out_unlock:drivers/gpu/drm/i915/gt/intel_engine_pm.c +1
-1@@ -39,7 +39,7 @@ static void dbg_poison_ce(struct intel_context *ce)if (ce->state) {struct drm_i915_gem_object *obj = ce->state->obj; -int type =i915_coherent_map_type (ce->engine->i915, obj, true); +int type =intel_gt_coherent_map_type (ce->engine->gt, obj, true);void *map;if (!i915_gem_object_trylock (obj,NULL ))drivers/gpu/drm/i915/gt/intel_gt.c +16
-1@@ -591,7 +591,7 @@ static int __engines_record_defaults(struct intel_gt *gt)continue ;/* Keep a copy of the state's backing pages; free the obj */ - state =shmem_create_from_object (rq->context->state->obj); + state =shmem_create_from_object (rq->context->state->obj, gt);if (IS_ERR (state)) { err =PTR_ERR (state); goto out;@@ -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 ; +} +#if IS_ENABLED (CONFIG_DRM_I915_SELFTEST )#include "selftest_tlb.c" #endif drivers/gpu/drm/i915/gt/intel_gt.h +3
-0@@ -119,4 +119,7 @@ static inline u32 intel_gt_next_invalidate_tlb_full(const struct intel_gt *gt)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);#endif /* __INTEL_GT_H__ */ drivers/gpu/drm/i915/gt/intel_gtt.c +2
-2@@ -89,7 +89,7 @@ int map_pt_dma(struct i915_address_space *vm, struct drm_i915_gem_object *obj)enum i915_map_type type;void *vaddr; - type =i915_coherent_map_type (vm->i915, obj, true); + type =intel_gt_coherent_map_type (vm->gt, obj, true); vaddr =i915_gem_object_pin_map_unlocked (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);@@ -103,7 +103,7 @@ int map_pt_dma_locked(struct i915_address_space *vm, struct drm_i915_gem_objectenum i915_map_type type;void *vaddr; - type =i915_coherent_map_type (vm->i915, obj, true); + type =intel_gt_coherent_map_type (vm->gt, obj, true); vaddr =i915_gem_object_pin_map (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);drivers/gpu/drm/i915/gt/intel_lrc.c +1
-1@@ -1191,7 +1191,7 @@ lrc_pre_pin(struct intel_context *ce,GEM_BUG_ON (!i915_vma_is_pinned (ce->state)); *vaddr =i915_gem_object_pin_map (ce->state->obj, -i915_coherent_map_type (ce->engine->i915, +intel_gt_coherent_map_type (ce->engine->gt, ce->state->obj, false) |I915_MAP_OVERRIDE );drivers/gpu/drm/i915/gt/intel_ring.c +2
-1@@ -13,6 +13,7 @@#include "intel_engine_regs.h" #include "intel_gpu_commands.h" #include "intel_ring.h" +#include "intel_gt.h" #include "intel_timeline.h" unsigned int intel_ring_update_space (struct intel_ring *ring)@@ -56,7 +57,7 @@ int intel_ring_pin(struct intel_ring *ring, struct i915_gem_ww_ctx *ww)if (i915_vma_is_map_and_fenceable (vma) && !HAS_LLC (vma->vm->i915)) { addr = (void __force *)i915_vma_pin_iomap (vma); }else { -int type =i915_coherent_map_type (vma->vm->i915, vma->obj, false); +int type =intel_gt_coherent_map_type (vma->vm->gt, vma->obj, false); addr =i915_gem_object_pin_map (vma->obj, type); }drivers/gpu/drm/i915/gt/selftest_context.c +1
-1@@ -88,7 +88,7 @@ static int __live_context_size(struct intel_engine_cs *engine) goto err; vaddr =i915_gem_object_pin_map_unlocked (ce->state->obj, -i915_coherent_map_type (engine->i915, +intel_gt_coherent_map_type (engine->gt, ce->state->obj, false));if (IS_ERR (vaddr)) { err =PTR_ERR (vaddr);drivers/gpu/drm/i915/gt/selftest_hangcheck.c +2
-2@@ -73,7 +73,7 @@ static int hang_init(struct hang *h, struct intel_gt *gt) h->seqno =memset (vaddr,0xff ,PAGE_SIZE ); vaddr =i915_gem_object_pin_map_unlocked (h->obj, -i915_coherent_map_type (gt->i915, h->obj, false)); +intel_gt_coherent_map_type (gt, h->obj, false));if (IS_ERR (vaddr)) { err =PTR_ERR (vaddr); goto err_unpin_hws;@@ -119,7 +119,7 @@ hang_create_request(struct hang *h, struct intel_engine_cs *engine)return ERR_CAST (obj); } - vaddr =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (gt->i915, obj, false)); + vaddr =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, false));if (IS_ERR (vaddr)) {i915_gem_object_put (obj);i915_vm_put (vm);drivers/gpu/drm/i915/gt/selftest_lrc.c +1
-1@@ -1292,7 +1292,7 @@ static int compare_isolation(struct intel_engine_cs *engine, } lrc =i915_gem_object_pin_map_unlocked (ce->state->obj, -i915_coherent_map_type (engine->i915, +intel_gt_coherent_map_type (engine->gt, ce->state->obj, false));if (IS_ERR (lrc)) {drivers/gpu/drm/i915/gt/shmem_utils.c +4
-3@@ -11,6 +11,7 @@#include "i915_drv.h" #include "gem/i915_gem_object.h" #include "gem/i915_gem_lmem.h" +#include "gt/intel_gt.h" #include "shmem_utils.h" struct file *shmem_create_from_data (const char *name,void *data,size_t len)@@ -31,9 +32,9 @@ struct file *shmem_create_from_data(const char *name, void *data, size_t len)return file; } -struct file *shmem_create_from_object (struct drm_i915_gem_object *obj) +struct file *shmem_create_from_object (struct drm_i915_gem_object *obj, +struct intel_gt *gt) { -struct drm_i915_private *i915 =to_i915 (obj->base.dev);enum i915_map_type map_type;struct file *file;void *ptr;@@ -44,7 +45,7 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj)return file; } - map_type =i915_coherent_map_type (i915, obj, true); + map_type =intel_gt_coherent_map_type (gt, obj, true); ptr =i915_gem_object_pin_map_unlocked (obj, map_type);if (IS_ERR (ptr))return ERR_CAST (ptr);drivers/gpu/drm/i915/gt/shmem_utils.h +3
-1@@ -11,9 +11,11 @@struct iosys_map ;struct drm_i915_gem_object ;struct file ; +struct intel_gt ;struct file *shmem_create_from_data (const char *name,void *data,size_t len); -struct file *shmem_create_from_object (struct drm_i915_gem_object *obj); +struct file *shmem_create_from_object (struct drm_i915_gem_object *obj, +struct intel_gt *gt);void *shmem_pin_map (struct file *file);void shmem_unpin_map (struct file *file,void *ptr);drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c +1
-2@@ -268,7 +268,6 @@ static int gsc_fw_load(struct intel_gsc_uc *gsc)static int gsc_fw_load_prepare (struct intel_gsc_uc *gsc) {struct intel_gt *gt =gsc_uc_to_gt (gsc); -struct drm_i915_private *i915 = gt->i915;void *src;if (!gsc->local)@@ -278,7 +277,7 @@ static int gsc_fw_load_prepare(struct intel_gsc_uc *gsc)return -ENOSPC ; src =i915_gem_object_pin_map_unlocked (gsc->fw.obj, -i915_coherent_map_type (i915, gsc->fw.obj, true)); +intel_gt_coherent_map_type (gt, gsc->fw.obj, true));if (IS_ERR (src))return PTR_ERR (src);drivers/gpu/drm/i915/gt/uc/intel_guc.c +1
-1@@ -792,7 +792,7 @@ int intel_guc_allocate_and_map_vma(struct intel_guc *guc, u32 size,return PTR_ERR (vma); vaddr =i915_gem_object_pin_map_unlocked (vma->obj, -i915_coherent_map_type (guc_to_gt (guc)->i915, +intel_gt_coherent_map_type (guc_to_gt (guc), vma->obj, true));if (IS_ERR (vaddr)) {i915_vma_unpin_and_release (&vma,0 );drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +1
-2@@ -27,7 +27,6 @@ struct mtl_huc_auth_msg_out {int intel_huc_fw_auth_via_gsccs (struct intel_huc *huc) {struct intel_gt *gt =huc_to_gt (huc); -struct drm_i915_private *i915 = gt->i915;struct drm_i915_gem_object *obj;struct mtl_huc_auth_msg_in *msg_in;struct mtl_huc_auth_msg_out *msg_out;@@ -43,7 +42,7 @@ int intel_huc_fw_auth_via_gsccs(struct intel_huc *huc) pkt_offset =i915_ggtt_offset (huc->heci_pkt); pkt_vaddr =i915_gem_object_pin_map_unlocked (obj, -i915_coherent_map_type (i915, obj, true)); +intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (pkt_vaddr))return PTR_ERR (pkt_vaddr);drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +2
-1@@ -11,6 +11,7 @@#include <drm/drm_print.h> #include "gem/i915_gem_lmem.h" +#include "gt/intel_gt.h" #include "gt/intel_gt_print.h" #include "intel_gsc_binary_headers.h" #include "intel_gsc_fw.h" @@ -1213,7 +1214,7 @@ static int uc_fw_rsa_data_create(struct intel_uc_fw *uc_fw)return PTR_ERR (vma); vaddr =i915_gem_object_pin_map_unlocked (vma->obj, -i915_coherent_map_type (gt->i915, vma->obj, true)); +intel_gt_coherent_map_type (gt, vma->obj, true));if (IS_ERR (vaddr)) {i915_vma_unpin_and_release (&vma,0 ); err =PTR_ERR (vaddr);drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c +1
-1@@ -336,7 +336,7 @@ gsccs_create_buffer(struct intel_gt *gt, }/* return a virtual pointer */ - *map =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + *map =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (*map)) {drm_err (&i915->drm,"Failed to map gsccs backend %s.\n" , bufname); err =PTR_ERR (*map);drivers/gpu/drm/i915/pxp/intel_pxp_tee.c +2
-1@@ -11,6 +11,7 @@#include "gem/i915_gem_lmem.h" #include "i915_drv.h" +#include "gt/intel_gt.h" #include "intel_pxp.h" #include "intel_pxp_cmd_interface_42.h" @@ -245,7 +246,7 @@ static int alloc_streaming_command(struct intel_pxp *pxp) }/* map the lmem into the virtual memory pointer */ - cmd =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + cmd =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (pxp->ctrl_gt, obj, true));if (IS_ERR (cmd)) {drm_err (&i915->drm,"Failed to map gsc message page!\n" ); err =PTR_ERR (cmd);drivers/gpu/drm/i915/selftests/igt_spinner.c +1
-1@@ -97,7 +97,7 @@ int igt_spinner_pin(struct igt_spinner *spin,if (!spin->batch) {unsigned int mode; - mode =i915_coherent_map_type (spin->gt->i915, spin->obj, false); + mode =intel_gt_coherent_map_type (spin->gt, spin->obj, false); vaddr =igt_spinner_pin_obj (ce, ww, spin->obj, mode, &spin->batch_vma);if (IS_ERR (vaddr))return PTR_ERR (vaddr);
Quoted 26 lines · Jonathan
-----Original Message-----
From: Tvrtko Ursulin <[email protected]>
Sent: Tuesday, July 25, 2023 9:23 AM
To: Cavitt, Jonathan <[email protected]>; [email protected]
Cc: Shyti, Andi <[email protected]>; Roper, Matthew D <[email protected]>; [email protected]; Das, Nirmoy <[email protected]>
Subject: Re: [Intel-gfx] [PATCH dii-client 1/2] drm/i915: Makei915_coherent_map_typeGT-centricQuoted 11 lines · Jonathan Cavitt
Quoted 6 lines
Refactor
i915_coherent_map_typeto 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.
What about the issue of fake gt passed to
shmem_create_from_objectI raised?The function is, presently, only called in
__engines_record_defaults, as a part ofintel_gt_init.shmem_create_from_objectusesi915_coherent_map_typeto determine themap_typeto pass toi915_gem_object_pin_map_unlocked. This creates a pointer that we pass toshmem_create_from_data. Aside from ani915_gem_object_is_shmemcheck at the start, the function is otherwise just callingshmem_create_from_data... which, itself, is only called byshmem_create_from_object.
Quoted 5 lines
I'd argue that any additional changes to
shmem_create_from_objectare unnecessary as the function is only called from__engines_record_defaults. Additionally, the function is a part of the gt library (shmem_utils.his in the gt folder), so taking a gt argument should be expected. However, if you still disagree, here's a few options for how we can rectify this issue:
Looking at the content of shmem_utils.c it does seem wholly misplaced in gt/. I would say we could move it (and should really, just no need in scope of this series).
Quoted 11 lines
Debatably, we could just delete
shmem_create_from_objectand use the full expansion in__engines_record_defaults. Though this may come with some additional complications, such as the lost helper function being desirable in the future and needing to expand the definition ofshmem_create_from_datato include an object pinning requirement.The second option is that we pass the
map_typeto theshmem_create_from_objectfunction instead of the GT, bypassing the need fori915_coherent_map_typein the function by breaking it out as a part of__engines_record_defaults. I'll leave it to your judgement whether this would be more or less confusing than just passing the GT.Thirdly, we could just hard-code a specific
map_typeto use, though that seems ill-advised.
Does the helper even need the coherent mapping if it is not setting up shared access? AFAICS it is just a single use mapping with the sole purpose to read the content of the whole object in bulk. And the whole source object is also even a throw-away.
So in fact yes, why not just hardcode to something like:
type = i915_gem_object_is_lmem(obj) : I915_MMAP_WC : I915_MMAP_WB;
?
Regards,
Tvrtko
Quoted 507 lines
The last option is to rename the function to something more representative. Here's a few ideas I can think of off the top of my head:
shmem_createshmem_create_on_gtshmem_create_from_gtshmem_create_from_object_on_gtintel_gt_create_shmem_from_objectIf I had to recommend one approach over the rest, it would probably be the second option, followed by the fourth.
-Jonathan Cavitt
Quoted 491 lines
Regards,
Tvrtko
P.S. See if you can drop the dii-client part from the subject line going forward.Quoted 482 lines
Suggested-by Matt Roper <[email protected]>Signed-off-by Jonathan Cavitt <[email protected]>--- drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 3 ++- drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 ---- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 15 --------------- .../drm/i915/gem/selftests/i915_gem_migrate.c | 12 ++++++------ drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 +- drivers/gpu/drm/i915/gt/intel_gt.c | 17 ++++++++++++++++- drivers/gpu/drm/i915/gt/intel_gt.h | 3 +++ drivers/gpu/drm/i915/gt/intel_gtt.c | 4 ++-- drivers/gpu/drm/i915/gt/intel_lrc.c | 2 +- drivers/gpu/drm/i915/gt/intel_ring.c | 3 ++- drivers/gpu/drm/i915/gt/selftest_context.c | 2 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 4 ++-- drivers/gpu/drm/i915/gt/selftest_lrc.c | 2 +- drivers/gpu/drm/i915/gt/shmem_utils.c | 7 ++++--- drivers/gpu/drm/i915/gt/shmem_utils.h | 4 +++- drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c | 3 +-- drivers/gpu/drm/i915/gt/uc/intel_guc.c | 2 +- drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c | 3 +-- drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 3 ++- drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c | 2 +- drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 3 ++- drivers/gpu/drm/i915/selftests/igt_spinner.c | 2 +- 22 files changed, 53 insertions(+), 49 deletions(-)drivers/gpu/drm/i915/display/intel_hdcp_gsc.c +2
-1@@ -6,6 +6,7 @@#include <drm/i915_hdcp_interface.h> #include "gem/i915_gem_region.h" +#include "gt/intel_gt.h" #include "gt/uc/intel_gsc_uc_heci_cmd_submit.h" #include "i915_drv.h" #include "i915_utils.h" @@ -632,7 +633,7 @@ static int intel_hdcp_gsc_initialize_message(struct drm_i915_private *i915,return PTR_ERR (obj); } - cmd_in =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + cmd_in =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (cmd_in)) {drm_err (&i915->drm,"Failed to map gsc message page!\n" ); err =PTR_ERR (cmd_in);drivers/gpu/drm/i915/gem/i915_gem_object.h +0
-4@@ -716,10 +716,6 @@ void *__must_check i915_gem_object_pin_map(struct drm_i915_gem_object *obj,void *__must_check i915_gem_object_pin_map_unlocked (struct drm_i915_gem_object *obj,enum i915_map_type type); -enum i915_map_type i915_coherent_map_type (struct drm_i915_private *i915, -struct drm_i915_gem_object *obj, -bool always_coherent); -void __i915_gem_object_flush_map (struct drm_i915_gem_object *obj,unsigned long offset,unsigned long size);drivers/gpu/drm/i915/gem/i915_gem_pages.c +0
-15@@ -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 ; -} -void __i915_gem_object_flush_map (struct drm_i915_gem_object *obj,unsigned long offset,unsigned long size)drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c +6
-6@@ -13,12 +13,12 @@#include "selftests/igt_spinner.h" static int igt_fill_check_buffer (struct drm_i915_gem_object *obj, +struct intel_gt *gt,bool fill) { -struct drm_i915_private *i915 =to_i915 (obj->base.dev);unsigned int i, count = obj->base.size /sizeof (u32);enum i915_map_type map_type = -i915_coherent_map_type (i915, obj, false); +intel_gt_coherent_map_type (gt, obj, false);u32 *cur;int err =0 ;@@ -66,7 +66,7 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,if (err)continue ; - err =igt_fill_check_buffer (obj, true); + err =igt_fill_check_buffer (obj, gt, true);if (err)continue ;@@ -86,7 +86,7 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,if (err)continue ; - err =igt_fill_check_buffer (obj, false); + err =igt_fill_check_buffer (obj, gt, false); }i915_gem_object_put (obj);@@ -233,7 +233,7 @@ static int __igt_lmem_pages_migrate(struct intel_gt *gt,continue ;if (!vma) { - err =igt_fill_check_buffer (obj, true); + err =igt_fill_check_buffer (obj, gt, true);if (err)continue ; }@@ -276,7 +276,7 @@ static int __igt_lmem_pages_migrate(struct intel_gt *gt,if (err) goto out_unlock; }else { - err =igt_fill_check_buffer (obj, false); + err =igt_fill_check_buffer (obj, gt, false); } out_unlock:drivers/gpu/drm/i915/gt/intel_engine_pm.c +1
-1@@ -39,7 +39,7 @@ static void dbg_poison_ce(struct intel_context *ce)if (ce->state) {struct drm_i915_gem_object *obj = ce->state->obj; -int type =i915_coherent_map_type (ce->engine->i915, obj, true); +int type =intel_gt_coherent_map_type (ce->engine->gt, obj, true);void *map;if (!i915_gem_object_trylock (obj,NULL ))drivers/gpu/drm/i915/gt/intel_gt.c +16
-1@@ -591,7 +591,7 @@ static int __engines_record_defaults(struct intel_gt *gt)continue ;/* Keep a copy of the state's backing pages; free the obj */ - state =shmem_create_from_object (rq->context->state->obj); + state =shmem_create_from_object (rq->context->state->obj, gt);if (IS_ERR (state)) { err =PTR_ERR (state); goto out;@@ -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 ; +} +#if IS_ENABLED (CONFIG_DRM_I915_SELFTEST )#include "selftest_tlb.c" #endif drivers/gpu/drm/i915/gt/intel_gt.h +3
-0@@ -119,4 +119,7 @@ static inline u32 intel_gt_next_invalidate_tlb_full(const struct intel_gt *gt)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);#endif /* __INTEL_GT_H__ */ drivers/gpu/drm/i915/gt/intel_gtt.c +2
-2@@ -89,7 +89,7 @@ int map_pt_dma(struct i915_address_space *vm, struct drm_i915_gem_object *obj)enum i915_map_type type;void *vaddr; - type =i915_coherent_map_type (vm->i915, obj, true); + type =intel_gt_coherent_map_type (vm->gt, obj, true); vaddr =i915_gem_object_pin_map_unlocked (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);@@ -103,7 +103,7 @@ int map_pt_dma_locked(struct i915_address_space *vm, struct drm_i915_gem_objectenum i915_map_type type;void *vaddr; - type =i915_coherent_map_type (vm->i915, obj, true); + type =intel_gt_coherent_map_type (vm->gt, obj, true); vaddr =i915_gem_object_pin_map (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);drivers/gpu/drm/i915/gt/intel_lrc.c +1
-1@@ -1191,7 +1191,7 @@ lrc_pre_pin(struct intel_context *ce,GEM_BUG_ON (!i915_vma_is_pinned (ce->state)); *vaddr =i915_gem_object_pin_map (ce->state->obj, -i915_coherent_map_type (ce->engine->i915, +intel_gt_coherent_map_type (ce->engine->gt, ce->state->obj, false) |I915_MAP_OVERRIDE );drivers/gpu/drm/i915/gt/intel_ring.c +2
-1@@ -13,6 +13,7 @@#include "intel_engine_regs.h" #include "intel_gpu_commands.h" #include "intel_ring.h" +#include "intel_gt.h" #include "intel_timeline.h" unsigned int intel_ring_update_space (struct intel_ring *ring)@@ -56,7 +57,7 @@ int intel_ring_pin(struct intel_ring *ring, struct i915_gem_ww_ctx *ww)if (i915_vma_is_map_and_fenceable (vma) && !HAS_LLC (vma->vm->i915)) { addr = (void __force *)i915_vma_pin_iomap (vma); }else { -int type =i915_coherent_map_type (vma->vm->i915, vma->obj, false); +int type =intel_gt_coherent_map_type (vma->vm->gt, vma->obj, false); addr =i915_gem_object_pin_map (vma->obj, type); }drivers/gpu/drm/i915/gt/selftest_context.c +1
-1@@ -88,7 +88,7 @@ static int __live_context_size(struct intel_engine_cs *engine) goto err; vaddr =i915_gem_object_pin_map_unlocked (ce->state->obj, -i915_coherent_map_type (engine->i915, +intel_gt_coherent_map_type (engine->gt, ce->state->obj, false));if (IS_ERR (vaddr)) { err =PTR_ERR (vaddr);drivers/gpu/drm/i915/gt/selftest_hangcheck.c +2
-2@@ -73,7 +73,7 @@ static int hang_init(struct hang *h, struct intel_gt *gt) h->seqno =memset (vaddr,0xff ,PAGE_SIZE ); vaddr =i915_gem_object_pin_map_unlocked (h->obj, -i915_coherent_map_type (gt->i915, h->obj, false)); +intel_gt_coherent_map_type (gt, h->obj, false));if (IS_ERR (vaddr)) { err =PTR_ERR (vaddr); goto err_unpin_hws;@@ -119,7 +119,7 @@ hang_create_request(struct hang *h, struct intel_engine_cs *engine)return ERR_CAST (obj); } - vaddr =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (gt->i915, obj, false)); + vaddr =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, false));if (IS_ERR (vaddr)) {i915_gem_object_put (obj);i915_vm_put (vm);drivers/gpu/drm/i915/gt/selftest_lrc.c +1
-1@@ -1292,7 +1292,7 @@ static int compare_isolation(struct intel_engine_cs *engine, } lrc =i915_gem_object_pin_map_unlocked (ce->state->obj, -i915_coherent_map_type (engine->i915, +intel_gt_coherent_map_type (engine->gt, ce->state->obj, false));if (IS_ERR (lrc)) {drivers/gpu/drm/i915/gt/shmem_utils.c +4
-3@@ -11,6 +11,7 @@#include "i915_drv.h" #include "gem/i915_gem_object.h" #include "gem/i915_gem_lmem.h" +#include "gt/intel_gt.h" #include "shmem_utils.h" struct file *shmem_create_from_data (const char *name,void *data,size_t len)@@ -31,9 +32,9 @@ struct file *shmem_create_from_data(const char *name, void *data, size_t len)return file; } -struct file *shmem_create_from_object (struct drm_i915_gem_object *obj) +struct file *shmem_create_from_object (struct drm_i915_gem_object *obj, +struct intel_gt *gt) { -struct drm_i915_private *i915 =to_i915 (obj->base.dev);enum i915_map_type map_type;struct file *file;void *ptr;@@ -44,7 +45,7 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj)return file; } - map_type =i915_coherent_map_type (i915, obj, true); + map_type =intel_gt_coherent_map_type (gt, obj, true); ptr =i915_gem_object_pin_map_unlocked (obj, map_type);if (IS_ERR (ptr))return ERR_CAST (ptr);drivers/gpu/drm/i915/gt/shmem_utils.h +3
-1@@ -11,9 +11,11 @@struct iosys_map ;struct drm_i915_gem_object ;struct file ; +struct intel_gt ;struct file *shmem_create_from_data (const char *name,void *data,size_t len); -struct file *shmem_create_from_object (struct drm_i915_gem_object *obj); +struct file *shmem_create_from_object (struct drm_i915_gem_object *obj, +struct intel_gt *gt);void *shmem_pin_map (struct file *file);void shmem_unpin_map (struct file *file,void *ptr);drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c +1
-2@@ -268,7 +268,6 @@ static int gsc_fw_load(struct intel_gsc_uc *gsc)static int gsc_fw_load_prepare (struct intel_gsc_uc *gsc) {struct intel_gt *gt =gsc_uc_to_gt (gsc); -struct drm_i915_private *i915 = gt->i915;void *src;if (!gsc->local)@@ -278,7 +277,7 @@ static int gsc_fw_load_prepare(struct intel_gsc_uc *gsc)return -ENOSPC ; src =i915_gem_object_pin_map_unlocked (gsc->fw.obj, -i915_coherent_map_type (i915, gsc->fw.obj, true)); +intel_gt_coherent_map_type (gt, gsc->fw.obj, true));if (IS_ERR (src))return PTR_ERR (src);drivers/gpu/drm/i915/gt/uc/intel_guc.c +1
-1@@ -792,7 +792,7 @@ int intel_guc_allocate_and_map_vma(struct intel_guc *guc, u32 size,return PTR_ERR (vma); vaddr =i915_gem_object_pin_map_unlocked (vma->obj, -i915_coherent_map_type (guc_to_gt (guc)->i915, +intel_gt_coherent_map_type (guc_to_gt (guc), vma->obj, true));if (IS_ERR (vaddr)) {i915_vma_unpin_and_release (&vma,0 );drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +1
-2@@ -27,7 +27,6 @@ struct mtl_huc_auth_msg_out {int intel_huc_fw_auth_via_gsccs (struct intel_huc *huc) {struct intel_gt *gt =huc_to_gt (huc); -struct drm_i915_private *i915 = gt->i915;struct drm_i915_gem_object *obj;struct mtl_huc_auth_msg_in *msg_in;struct mtl_huc_auth_msg_out *msg_out;@@ -43,7 +42,7 @@ int intel_huc_fw_auth_via_gsccs(struct intel_huc *huc) pkt_offset =i915_ggtt_offset (huc->heci_pkt); pkt_vaddr =i915_gem_object_pin_map_unlocked (obj, -i915_coherent_map_type (i915, obj, true)); +intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (pkt_vaddr))return PTR_ERR (pkt_vaddr);drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +2
-1@@ -11,6 +11,7 @@#include <drm/drm_print.h> #include "gem/i915_gem_lmem.h" +#include "gt/intel_gt.h" #include "gt/intel_gt_print.h" #include "intel_gsc_binary_headers.h" #include "intel_gsc_fw.h" @@ -1213,7 +1214,7 @@ static int uc_fw_rsa_data_create(struct intel_uc_fw *uc_fw)return PTR_ERR (vma); vaddr =i915_gem_object_pin_map_unlocked (vma->obj, -i915_coherent_map_type (gt->i915, vma->obj, true)); +intel_gt_coherent_map_type (gt, vma->obj, true));if (IS_ERR (vaddr)) {i915_vma_unpin_and_release (&vma,0 ); err =PTR_ERR (vaddr);drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c +1
-1@@ -336,7 +336,7 @@ gsccs_create_buffer(struct intel_gt *gt, }/* return a virtual pointer */ - *map =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + *map =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (*map)) {drm_err (&i915->drm,"Failed to map gsccs backend %s.\n" , bufname); err =PTR_ERR (*map);drivers/gpu/drm/i915/pxp/intel_pxp_tee.c +2
-1@@ -11,6 +11,7 @@#include "gem/i915_gem_lmem.h" #include "i915_drv.h" +#include "gt/intel_gt.h" #include "intel_pxp.h" #include "intel_pxp_cmd_interface_42.h" @@ -245,7 +246,7 @@ static int alloc_streaming_command(struct intel_pxp *pxp) }/* map the lmem into the virtual memory pointer */ - cmd =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + cmd =i915_gem_object_pin_map_unlocked (obj,intel_gt_coherent_map_type (pxp->ctrl_gt, obj, true));if (IS_ERR (cmd)) {drm_err (&i915->drm,"Failed to map gsc message page!\n" ); err =PTR_ERR (cmd);drivers/gpu/drm/i915/selftests/igt_spinner.c +1
-1@@ -97,7 +97,7 @@ int igt_spinner_pin(struct igt_spinner *spin,if (!spin->batch) {unsigned int mode; - mode =i915_coherent_map_type (spin->gt->i915, spin->obj, false); + mode =intel_gt_coherent_map_type (spin->gt, spin->obj, false); vaddr =igt_spinner_pin_obj (ce, ww, spin->obj, mode, &spin->batch_vma);if (IS_ERR (vaddr))return PTR_ERR (vaddr);
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [dii-client,1/2] drm/i915: Make i915_coherent_map_type GT-centric
In reply to Jonathan Cavitt== Series Details ==
== Series Details ==
Series: series starting with [dii-client,1/2] drm/i915: Make i915_coherent_map_type GT-centric
URL : https://patchwork.freedesktop.org/series/121324/
State : warning
== Summary ==
Error: dim checkpatch failed04b9b8deb0b7 drm/i915: Make i915_coherent_map_type GT-centric -:225: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #225: FILE: drivers/gpu/drm/i915/gt/intel_lrc.c:1195:
+ intel_gt_coherent_map_type(ce->engine->gt,
ce->state->obj,
-:259: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #259: FILE: drivers/gpu/drm/i915/gt/selftest_context.c:92:
+ intel_gt_coherent_map_type(engine->gt,
ce->state->obj, false));
-:294: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #294: FILE: drivers/gpu/drm/i915/gt/selftest_lrc.c:1296:
+ intel_gt_coherent_map_type(engine->gt,
ce->state->obj,
-:378: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #378: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc.c:796:
+ intel_gt_coherent_map_type(guc_to_gt(guc),
vma->obj, true));
-:453: WARNING:LONG_LINE: line length of 105 exceeds 100 columns #453: FILE: drivers/gpu/drm/i915/pxp/intel_pxp_tee.c:249:
+ cmd = i915_gem_object_pin_map_unlocked(obj, intel_gt_coherent_map_type(pxp->ctrl_gt, obj, true));
total: 0 errors, 1 warnings, 4 checks, 329 lines checked 75d808bcaca2 drm/i915/gt: Apply workaround 22016122933 correctly
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [dii-client,1/2] drm/i915: Make i915_coherent_map_type GT-centric
In reply to Jonathan Cavitt== Series Details ==
== Series Details ==
Series: series starting with [dii-client,1/2] drm/i915: Make i915_coherent_map_type GT-centric
URL : https://patchwork.freedesktop.org/series/121324/
State : warning
== Summary ==
Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [dii-client,1/2] drm/i915: Make i915_coherent_map_type GT-centric
In reply to Jonathan Cavitt== Series Details ==
== Series Details ==
Series: series starting with [dii-client,1/2] drm/i915: Make i915_coherent_map_type GT-centric
URL : https://patchwork.freedesktop.org/series/121324/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_13421 -> Patchwork_121324v1
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_121324v1 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_121324v1, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/index.html
Participating hosts (43 -> 43)
------------------------------
Additional (1): fi-kbl-soraka
Missing (1): fi-snb-2520m
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_121324v1:
### IGT changes ###
#### Possible regressions ####
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-kbl-soraka: NOTRUN -> [INCOMPLETE][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/fi-kbl-soraka/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_121324v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_gttfill@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][2] ([fdo#109271]) +14 similar issues
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/fi-kbl-soraka/igt@[email protected]
* igt@gem_huc_copy@huc-copy:
- fi-kbl-soraka: NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#2190])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/fi-kbl-soraka/igt@[email protected]
* igt@gem_lmem_swapping@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#4613]) +3 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/fi-kbl-soraka/igt@[email protected]
* igt@i915_pm_rpm@basic-rte:
- fi-cfl-8109u: [PASS][5] -> [FAIL][6] ([i915#7940])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/fi-cfl-8109u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/fi-cfl-8109u/igt@[email protected]
- fi-kbl-7567u: [PASS][7] -> [FAIL][8] ([i915#7940])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/fi-kbl-7567u/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/fi-kbl-7567u/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-rkl-11600: [PASS][9] -> [FAIL][10] ([i915#7940])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/fi-rkl-11600/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/fi-rkl-11600/igt@[email protected]
* igt@i915_selftest@live@gt_mocs:
- bat-mtlp-6: [PASS][11] -> [DMESG-FAIL][12] ([i915#7059])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/bat-mtlp-6/igt@i915_selftest@live@gt_mocs.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-mtlp-6/igt@i915_selftest@live@gt_mocs.html
* igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][13] ([i915#1886] / [i915#7913])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html
* igt@i915_selftest@live@reset:
- bat-rpls-1: [PASS][14] -> [ABORT][15] ([i915#4983] / [i915#7461] / [i915#7981] / [i915#8347] / [i915#8384])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/bat-rpls-1/igt@i915_selftest@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-rpls-1/igt@i915_selftest@[email protected]
* igt@i915_suspend@basic-s3-without-i915:
- bat-mtlp-8: NOTRUN -> [SKIP][16] ([i915#6645])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-mtlp-8/igt@[email protected]
* igt@kms_chamelium_hpd@common-hpd-after-suspend:
- bat-rpls-2: NOTRUN -> [SKIP][17] ([i915#7828])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-rpls-2/igt@[email protected]
- bat-mtlp-8: NOTRUN -> [SKIP][18] ([i915#7828])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-mtlp-8/igt@[email protected]
* igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1:
- bat-rplp-1: [PASS][19] -> [ABORT][20] ([i915#8442] / [i915#8668])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/bat-rplp-1/igt@kms_pipe_crc_basic@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-rplp-1/igt@kms_pipe_crc_basic@[email protected]
* igt@kms_pipe_crc_basic@suspend-read-crc:
- bat-rpls-2: NOTRUN -> [SKIP][21] ([i915#1845])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-rpls-2/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s3@smem:
- bat-rpls-2: [ABORT][22] ([i915#6687] / [i915#7978] / [i915#8668]) -> [PASS][23]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/bat-rpls-2/igt@gem_exec_suspend@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-rpls-2/igt@gem_exec_suspend@[email protected]
* igt@i915_pm_rpm@basic-rte:
- fi-tgl-1115g4: [FAIL][24] ([i915#7940]) -> [PASS][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/fi-tgl-1115g4/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/fi-tgl-1115g4/igt@[email protected]
* igt@i915_selftest@live@gt_tlb:
- bat-mtlp-8: [ABORT][26] -> [PASS][27]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/bat-mtlp-8/igt@i915_selftest@live@gt_tlb.html
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-mtlp-8/igt@i915_selftest@live@gt_tlb.html
* igt@i915_selftest@live@slpc:
- bat-mtlp-6: [DMESG-WARN][28] ([i915#6367]) -> [PASS][29]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/bat-mtlp-6/igt@i915_selftest@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-mtlp-6/igt@i915_selftest@[email protected]
* igt@i915_selftest@live@workarounds:
- bat-mtlp-6: [DMESG-FAIL][30] ([i915#6763]) -> [PASS][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/bat-mtlp-6/igt@i915_selftest@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-mtlp-6/igt@i915_selftest@[email protected]
#### Warnings ####
* igt@core_auth@basic-auth:
- bat-adlp-11: [ABORT][32] ([i915#8011]) -> [ABORT][33] ([i915#4423] / [i915#8011])
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13421/bat-adlp-11/igt@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/bat-adlp-11/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#4423]: https://gitlab.freedesktop.org/drm/intel/issues/4423
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645
[i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
[i915#6763]: https://gitlab.freedesktop.org/drm/intel/issues/6763
[i915#7059]: https://gitlab.freedesktop.org/drm/intel/issues/7059
[i915#7461]: https://gitlab.freedesktop.org/drm/intel/issues/7461
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7940]: https://gitlab.freedesktop.org/drm/intel/issues/7940
[i915#7978]: https://gitlab.freedesktop.org/drm/intel/issues/7978
[i915#7981]: https://gitlab.freedesktop.org/drm/intel/issues/7981
[i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
[i915#8347]: https://gitlab.freedesktop.org/drm/intel/issues/8347
[i915#8384]: https://gitlab.freedesktop.org/drm/intel/issues/8384
[i915#8442]: https://gitlab.freedesktop.org/drm/intel/issues/8442
[i915#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
Build changes
-------------
* Linux: CI_DRM_13421 -> Patchwork_121324v1
CI-20190529: 20190529
CI_DRM_13421: 8f73cd99e697fc6e0064cfed23f3d90724478dbb @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7403: c93b4e6ff2f3cd1a41667e63c7414cc239d88240 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_121324v1: 8f73cd99e697fc6e0064cfed23f3d90724478dbb @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
ea287a2667ae drm/i915/gt: Apply workaround 22016122933 correctly f525a7e45d0d drm/i915: Make i915_coherent_map_type GT-centric
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_121324v1/index.html
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Jonathan,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-tip/drm-tip]
url: https://github.com/intel-lab-lkp/linux/commits/Jonathan-Cavitt/drm-i915-gt-Apply-workaround-22016122933-correctly/20230726-001113 base: git://anongit.freedesktop.org/drm/drm-tip drm-tip patch link: https://lore.kernel.org/r/20230725160145.1486613-1-jonathan.cavitt%40intel.com patch subject: [Intel-gfx] [PATCH dii-client 1/2] drm/i915: Make i915_coherent_map_type GT-centric config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230726/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce: (https://download.01.org/0day-ci/archive/20230726/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c: In function 'gsccs_create_buffer':
>> drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:339:54: error: implicit declaration of function 'intel_gt_coherent_map_type' [-Werror=implicit-function-declaration]
339 | *map = i915_gem_object_pin_map_unlocked(obj, intel_gt_coherent_map_type(gt, obj, true));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
vim +/intel_gt_coherent_map_type +339 drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c
314
315 static int
316 gsccs_create_buffer(struct intel_gt *gt,
317 const char *bufname, size_t size,
318 struct i915_vma **vma, void **map)
319 {
320 struct drm_i915_private *i915 = gt->i915;
321 struct drm_i915_gem_object *obj;
322 int err = 0;
323
324 obj = i915_gem_object_create_internal(i915, size);
325 if (IS_ERR(obj)) {
326 drm_err(&i915->drm, "Failed to allocate gsccs backend %s.\n", bufname);
327 err = PTR_ERR(obj);
328 goto out_none;
329 }
330
331 *vma = i915_vma_instance(obj, gt->vm, NULL);
332 if (IS_ERR(*vma)) {
333 drm_err(&i915->drm, "Failed to vma-instance gsccs backend %s.\n", bufname);
334 err = PTR_ERR(*vma);
335 goto out_put;
336 }
337
338 /* return a virtual pointer */
> 339 *map = i915_gem_object_pin_map_unlocked(obj, intel_gt_coherent_map_type(gt, obj, true));
340 if (IS_ERR(*map)) {
341 drm_err(&i915->drm, "Failed to map gsccs backend %s.\n", bufname);
342 err = PTR_ERR(*map);
343 goto out_put;
344 }
345
346 /* all PXP sessions commands are treated as non-privileged */
347 err = i915_vma_pin(*vma, 0, 0, PIN_USER);
348 if (err) {
349 drm_err(&i915->drm, "Failed to vma-pin gsccs backend %s.\n", bufname);
350 goto out_unmap;
351 }
352
353 return 0;
354
355 out_unmap:
356 i915_gem_object_unpin_map(obj);
357 out_put:
358 i915_gem_object_put(obj);
359 out_none:
360 *vma = NULL;
361 *map = NULL;
362
363 return err;
364 }
365
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Quoted 6 lines
Refactor
i915_coherent_map_typeto 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.
Remove dii-client in the title. Also need to fix the check-patch warnings. Otherwise the patch looks good to me.
assume you address the above issues,
Quoted 484 lines
Suggested-by Matt Roper <[email protected]>Signed-off-by Jonathan Cavitt <[email protected]>--- drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 3 ++- drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 ---- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 15 --------------- .../drm/i915/gem/selftests/i915_gem_migrate.c | 12 ++++++------ drivers/gpu/drm/i915/gt/intel_engine_pm.c | 2 +- drivers/gpu/drm/i915/gt/intel_gt.c | 17 ++++++++++++++++- drivers/gpu/drm/i915/gt/intel_gt.h | 3 +++ drivers/gpu/drm/i915/gt/intel_gtt.c | 4 ++-- drivers/gpu/drm/i915/gt/intel_lrc.c | 2 +- drivers/gpu/drm/i915/gt/intel_ring.c | 3 ++- drivers/gpu/drm/i915/gt/selftest_context.c | 2 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 4 ++-- drivers/gpu/drm/i915/gt/selftest_lrc.c | 2 +- drivers/gpu/drm/i915/gt/shmem_utils.c | 7 ++++--- drivers/gpu/drm/i915/gt/shmem_utils.h | 4 +++- drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c | 3 +-- drivers/gpu/drm/i915/gt/uc/intel_guc.c | 2 +- drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c | 3 +-- drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 3 ++- drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c | 2 +- drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 3 ++- drivers/gpu/drm/i915/selftests/igt_spinner.c | 2 +- 22 files changed, 53 insertions(+), 49 deletions(-)drivers/gpu/drm/i915/display/intel_hdcp_gsc.c +3
-1@@ -6,6 +6,7 @@#include <drm/i915_hdcp_interface.h> #include "gem/i915_gem_region.h" +#include "gt/intel_gt.h" #include "gt/uc/intel_gsc_uc_heci_cmd_submit.h" #include "i915_drv.h" #include "i915_utils.h" @@ -632,7 +633,7 @@ static int intel_hdcp_gsc_initialize_message(struct drm_i915_private *i915,return PTR_ERR (obj); } - cmd_in =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + cmd_in =i915_gem_object_pin_map_unlocked (obj, +intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (cmd_in)) {drm_err (&i915->drm,"Failed to map gsc message page!\n" ); err =PTR_ERR (cmd_in);drivers/gpu/drm/i915/gem/i915_gem_object.h +0
-4@@ -716,10 +716,6 @@ void *__must_check i915_gem_object_pin_map(struct drm_i915_gem_object *obj,void *__must_check i915_gem_object_pin_map_unlocked (struct drm_i915_gem_object *obj,enum i915_map_type type); -enum i915_map_type i915_coherent_map_type (struct drm_i915_private *i915, -struct drm_i915_gem_object *obj, -bool always_coherent); -void __i915_gem_object_flush_map (struct drm_i915_gem_object *obj,unsigned long offset,unsigned long size);drivers/gpu/drm/i915/gem/i915_gem_pages.c +0
-15@@ -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 ; -} -void __i915_gem_object_flush_map (struct drm_i915_gem_object *obj,unsigned long offset,unsigned long size)drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c +6
-6@@ -13,12 +13,12 @@#include "selftests/igt_spinner.h" static int igt_fill_check_buffer (struct drm_i915_gem_object *obj, +struct intel_gt *gt,bool fill) { -struct drm_i915_private *i915 =to_i915 (obj->base.dev);unsigned int i, count = obj->base.size /sizeof (u32);enum i915_map_type map_type = -i915_coherent_map_type (i915, obj, false); +intel_gt_coherent_map_type (gt, obj, false);u32 *cur;int err =0 ;@@ -66,7 +66,7 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,if (err)continue ; - err =igt_fill_check_buffer (obj, true); + err =igt_fill_check_buffer (obj, gt, true);if (err)continue ;@@ -86,7 +86,7 @@ static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,if (err)continue ; - err =igt_fill_check_buffer (obj, false); + err =igt_fill_check_buffer (obj, gt, false); }i915_gem_object_put (obj);@@ -233,7 +233,7 @@ static int __igt_lmem_pages_migrate(struct intel_gt *gt,continue ;if (!vma) { - err =igt_fill_check_buffer (obj, true); + err =igt_fill_check_buffer (obj, gt, true);if (err)continue ; }@@ -276,7 +276,7 @@ static int __igt_lmem_pages_migrate(struct intel_gt *gt,if (err) goto out_unlock; }else { - err =igt_fill_check_buffer (obj, false); + err =igt_fill_check_buffer (obj, gt, false); } out_unlock:drivers/gpu/drm/i915/gt/intel_engine_pm.c +1
-1@@ -39,7 +39,7 @@ static void dbg_poison_ce(struct intel_context *ce)if (ce->state) {struct drm_i915_gem_object *obj = ce->state->obj; -int type =i915_coherent_map_type (ce->engine->i915, obj, true); +int type =intel_gt_coherent_map_type (ce->engine->gt, obj, true);void *map; if (!i915_gem_object_trylock(obj, NULL)) diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.cindex
9f64d61dd5fc..6faf1dae965f100644drivers/gpu/drm/i915/gt/intel_gt.c +16
-1@@ -591,7 +591,7 @@ static int __engines_record_defaults(struct intel_gt *gt)continue ;/* Keep a copy of the state's backing pages; free the obj */ - state =shmem_create_from_object (rq->context->state->obj); + state =shmem_create_from_object (rq->context->state->obj, gt);if (IS_ERR (state)) { err =PTR_ERR (state); goto out;@@ -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 ; +} +#if IS_ENABLED (CONFIG_DRM_I915_SELFTEST )#include "selftest_tlb.c" #endif drivers/gpu/drm/i915/gt/intel_gt.h +3
-0@@ -119,4 +119,7 @@ static inline u32 intel_gt_next_invalidate_tlb_full(const struct intel_gt *gt)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);#endif /* __INTEL_GT_H__ */ drivers/gpu/drm/i915/gt/intel_gtt.c +2
-2@@ -89,7 +89,7 @@ int map_pt_dma(struct i915_address_space *vm, struct drm_i915_gem_object *obj)enum i915_map_type type;void *vaddr; - type =i915_coherent_map_type (vm->i915, obj, true); + type =intel_gt_coherent_map_type (vm->gt, obj, true); vaddr =i915_gem_object_pin_map_unlocked (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);@@ -103,7 +103,7 @@ int map_pt_dma_locked(struct i915_address_space *vm, struct drm_i915_gem_objectenum i915_map_type type;void *vaddr; - type =i915_coherent_map_type (vm->i915, obj, true); + type =intel_gt_coherent_map_type (vm->gt, obj, true); vaddr =i915_gem_object_pin_map (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);drivers/gpu/drm/i915/gt/intel_lrc.c +1
-1@@ -1191,7 +1191,7 @@ lrc_pre_pin(struct intel_context *ce,GEM_BUG_ON (!i915_vma_is_pinned (ce->state)); *vaddr =i915_gem_object_pin_map (ce->state->obj, -i915_coherent_map_type (ce->engine->i915, +intel_gt_coherent_map_type (ce->engine->gt, ce->state->obj, false) |I915_MAP_OVERRIDE );drivers/gpu/drm/i915/gt/intel_ring.c +2
-1@@ -13,6 +13,7 @@#include "intel_engine_regs.h" #include "intel_gpu_commands.h" #include "intel_ring.h" +#include "intel_gt.h" #include "intel_timeline.h" unsigned int intel_ring_update_space (struct intel_ring *ring)@@ -56,7 +57,7 @@ int intel_ring_pin(struct intel_ring *ring, struct i915_gem_ww_ctx *ww)if (i915_vma_is_map_and_fenceable (vma) && !HAS_LLC (vma->vm->i915)) { addr = (void __force *)i915_vma_pin_iomap (vma); }else { -int type =i915_coherent_map_type (vma->vm->i915, vma->obj, false); +int type =intel_gt_coherent_map_type (vma->vm->gt, vma->obj, false); addr =i915_gem_object_pin_map (vma->obj, type); }drivers/gpu/drm/i915/gt/selftest_context.c +1
-1@@ -88,7 +88,7 @@ static int __live_context_size(struct intel_engine_cs *engine) goto err; vaddr =i915_gem_object_pin_map_unlocked (ce->state->obj, -i915_coherent_map_type (engine->i915, +intel_gt_coherent_map_type (engine->gt, ce->state->obj, false));if (IS_ERR (vaddr)) { err =PTR_ERR (vaddr);drivers/gpu/drm/i915/gt/selftest_hangcheck.c +3
-2@@ -73,7 +73,7 @@ static int hang_init(struct hang *h, struct intel_gt *gt) h->seqno =memset (vaddr,0xff ,PAGE_SIZE ); vaddr =i915_gem_object_pin_map_unlocked (h->obj, -i915_coherent_map_type (gt->i915, h->obj, false)); +intel_gt_coherent_map_type (gt, h->obj, false));if (IS_ERR (vaddr)) { err =PTR_ERR (vaddr); goto err_unpin_hws;@@ -119,7 +119,7 @@ hang_create_request(struct hang *h, struct intel_engine_cs *engine)return ERR_CAST (obj); } - vaddr =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (gt->i915, obj, false)); + vaddr =i915_gem_object_pin_map_unlocked (obj, +intel_gt_coherent_map_type (gt, obj, false));if (IS_ERR (vaddr)) {i915_gem_object_put (obj);i915_vm_put (vm);drivers/gpu/drm/i915/gt/selftest_lrc.c +1
-1@@ -1292,7 +1292,7 @@ static int compare_isolation(struct intel_engine_cs *engine, } lrc =i915_gem_object_pin_map_unlocked (ce->state->obj, -i915_coherent_map_type (engine->i915, +intel_gt_coherent_map_type (engine->gt, ce->state->obj, false));if (IS_ERR (lrc)) {drivers/gpu/drm/i915/gt/shmem_utils.c +4
-3@@ -11,6 +11,7 @@#include "i915_drv.h" #include "gem/i915_gem_object.h" #include "gem/i915_gem_lmem.h" +#include "gt/intel_gt.h" #include "shmem_utils.h" struct file *shmem_create_from_data (const char *name,void *data,size_t len)@@ -31,9 +32,9 @@ struct file *shmem_create_from_data(const char *name, void *data, size_t len)return file; } -struct file *shmem_create_from_object (struct drm_i915_gem_object *obj) +struct file *shmem_create_from_object (struct drm_i915_gem_object *obj, +struct intel_gt *gt) { -struct drm_i915_private *i915 =to_i915 (obj->base.dev);enum i915_map_type map_type;struct file *file;void *ptr;@@ -44,7 +45,7 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj)return file; } - map_type =i915_coherent_map_type (i915, obj, true); + map_type =intel_gt_coherent_map_type (gt, obj, true); ptr =i915_gem_object_pin_map_unlocked (obj, map_type);if (IS_ERR (ptr))return ERR_CAST (ptr);drivers/gpu/drm/i915/gt/shmem_utils.h +3
-1@@ -11,9 +11,11 @@struct iosys_map ;struct drm_i915_gem_object ;struct file ; +struct intel_gt ;struct file *shmem_create_from_data (const char *name,void *data,size_t len); -struct file *shmem_create_from_object (struct drm_i915_gem_object *obj); +struct file *shmem_create_from_object (struct drm_i915_gem_object *obj, +struct intel_gt *gt);void *shmem_pin_map (struct file *file);void shmem_unpin_map (struct file *file,void *ptr);drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c +1
-2@@ -268,7 +268,6 @@ static int gsc_fw_load(struct intel_gsc_uc *gsc)static int gsc_fw_load_prepare (struct intel_gsc_uc *gsc) {struct intel_gt *gt =gsc_uc_to_gt (gsc); -struct drm_i915_private *i915 = gt->i915;void *src;if (!gsc->local)@@ -278,7 +277,7 @@ static int gsc_fw_load_prepare(struct intel_gsc_uc *gsc)return -ENOSPC ; src =i915_gem_object_pin_map_unlocked (gsc->fw.obj, -i915_coherent_map_type (i915, gsc->fw.obj, true)); +intel_gt_coherent_map_type (gt, gsc->fw.obj, true));if (IS_ERR (src))return PTR_ERR (src);drivers/gpu/drm/i915/gt/uc/intel_guc.c +1
-1@@ -792,7 +792,7 @@ int intel_guc_allocate_and_map_vma(struct intel_guc *guc, u32 size,return PTR_ERR (vma); vaddr =i915_gem_object_pin_map_unlocked (vma->obj, -i915_coherent_map_type (guc_to_gt (guc)->i915, +intel_gt_coherent_map_type (guc_to_gt (guc), vma->obj, true));if (IS_ERR (vaddr)) {i915_vma_unpin_and_release (&vma,0 );drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +1
-2@@ -27,7 +27,6 @@ struct mtl_huc_auth_msg_out { int intel_huc_fw_auth_via_gsccs(struct intel_huc *huc) {struct intel_gt *gt =huc_to_gt (huc); -struct drm_i915_private *i915 = gt->i915;struct drm_i915_gem_object *obj;struct mtl_huc_auth_msg_in *msg_in;struct mtl_huc_auth_msg_out *msg_out;@@ -43,7 +42,7 @@ int intel_huc_fw_auth_via_gsccs(struct intel_huc *huc) pkt_offset =i915_ggtt_offset (huc->heci_pkt); pkt_vaddr =i915_gem_object_pin_map_unlocked (obj, -i915_coherent_map_type (i915, obj, true)); +intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (pkt_vaddr))return PTR_ERR (pkt_vaddr);drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +2
-1@@ -11,6 +11,7 @@#include <drm/drm_print.h> #include "gem/i915_gem_lmem.h" +#include "gt/intel_gt.h" #include "gt/intel_gt_print.h" #include "intel_gsc_binary_headers.h" #include "intel_gsc_fw.h" @@ -1213,7 +1214,7 @@ static int uc_fw_rsa_data_create(struct intel_uc_fw *uc_fw)return PTR_ERR (vma); vaddr =i915_gem_object_pin_map_unlocked (vma->obj, -i915_coherent_map_type (gt->i915, vma->obj, true)); +intel_gt_coherent_map_type (gt, vma->obj, true));if (IS_ERR (vaddr)) {i915_vma_unpin_and_release (&vma,0 ); err =PTR_ERR (vaddr);drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c +2
-1@@ -336,7 +336,7 @@ gsccs_create_buffer(struct intel_gt *gt, }/* return a virtual pointer */ - *map =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + *map =i915_gem_object_pin_map_unlocked (obj, +intel_gt_coherent_map_type (gt, obj, true));if (IS_ERR (*map)) {drm_err (&i915->drm,"Failed to map gsccs backend %s.\n" , bufname); err =PTR_ERR (*map);drivers/gpu/drm/i915/pxp/intel_pxp_tee.c +3
-1@@ -11,6 +11,7 @@#include "gem/i915_gem_lmem.h" #include "i915_drv.h" +#include "gt/intel_gt.h" #include "intel_pxp.h" #include "intel_pxp_cmd_interface_42.h" @@ -245,7 +246,7 @@ static int alloc_streaming_command(struct intel_pxp *pxp) }/* map the lmem into the virtual memory pointer */ - cmd =i915_gem_object_pin_map_unlocked (obj,i915_coherent_map_type (i915, obj, true)); + cmd =i915_gem_object_pin_map_unlocked (obj, +intel_gt_coherent_map_type (pxp->ctrl_gt, obj, true));if (IS_ERR (cmd)) {drm_err (&i915->drm,"Failed to map gsc message page!\n" ); err =PTR_ERR (cmd);drivers/gpu/drm/i915/selftests/igt_spinner.c +1
-2@@ -97,7 +97,7 @@ int igt_spinner_pin(struct igt_spinner *spin,if (!spin->batch) {unsigned int mode; - mode =i915_coherent_map_type (spin->gt->i915, spin->obj, false); + mode =intel_gt_coherent_map_type (spin->gt, spin->obj, false); vaddr =igt_spinner_pin_obj (ce, ww, spin->obj, mode, &spin->batch_vma);if (IS_ERR (vaddr))return PTR_ERR (vaddr); --2.25.1