i915/gem_ctx_shared: handle mmap for discrete
A message that is not in the archive (sent off-list or not yet received): [email protected]
Matthew Auld
Reviewed-byQuoted 14 lines · Nirmoy Das
On discrete we can only do fixed mmap and also setting domain is not allowed.
Issue: https://gitlab.freedesktop.org/drm/intel/-/issues/5451
Signed-off-by Nirmoy Das <[email protected]>--- tests/i915/gem_ctx_shared.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)tests/i915/gem_ctx_shared.c +0
-0
tests/i915/gem_ctx_shared.c static void exec_shared_gtt(int i915, const intel_ctx_cfg_t *cfg, · line 298
Quoted 10 lines
tests/i915/gem_ctx_shared.c +6
-1@@ -290,9 +290,16 @@ static void exec_shared_gtt(int i915, const intel_ctx_cfg_t *cfg, execbuf.flags |=I915_EXEC_FENCE_IN ; scratch =gem_create (i915,4096 ); - s =gem_mmap__wc (i915, scratch,0 ,4096 ,PROT_WRITE ); +if (gem_has_lmem (i915)) + s =gem_mmap_offset__fixed (i915, scratch,0 ,4096 ,PROT_WRITE ); +else { + s =gem_mmap_offset__wc (i915, scratch,0 ,4096 ,PROT_WRITE ); +if (!s) + s =gem_mmap__wc (i915, scratch,0 ,4096 ,PROT_WRITE );
https://patchwork.freedesktop.org/series/100499/
gem_mmap__device_coherent() can be used here I think.
tests/i915/gem_ctx_shared.c static void exec_shared_gtt(int i915, const intel_ctx_cfg_t *cfg, · line 300
Quoted 2 lines
tests/i915/gem_ctx_shared.c +2
-0+ +gem_set_domain (i915, scratch,I915_GEM_DOMAIN_WC ,I915_GEM_DOMAIN_WC );
This does an object wait some on discrete IIRC. I didn't check if the test is relying on that or not though.
Otherwise,
Reviewed-by Matthew Auld <[email protected]>
Quoted 6 lines
tests/i915/gem_ctx_shared.c +1
-1+ } -gem_set_domain (i915, scratch,I915_GEM_DOMAIN_WC ,I915_GEM_DOMAIN_WC ); s[0 ] = bbe; s[64 ] = bbe;