Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915: Shadow default engine context image in the context

To enable adding override of the default engine context image let us start
shadowing the per engine state in the context.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Carlos Santa <carlos.santa@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Tvrtko Ursulin <tursulin@igalia.com>
Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20240514145939.87427-1-tursulin@igalia.com

authored by

Tvrtko Ursulin and committed by
Tvrtko Ursulin
e1eb97c2 60a2f25d

+10 -6
+2
drivers/gpu/drm/i915/gt/intel_context_types.h
··· 99 99 struct i915_address_space *vm; 100 100 struct i915_gem_context __rcu *gem_context; 101 101 102 + struct file *default_state; 103 + 102 104 /* 103 105 * @signal_lock protects the list of requests that need signaling, 104 106 * @signals. While there are any requests that need signaling,
+4 -3
drivers/gpu/drm/i915/gt/intel_lrc.c
··· 1017 1017 1018 1018 set_redzone(state, engine); 1019 1019 1020 - if (engine->default_state) { 1021 - shmem_read(engine->default_state, 0, 1022 - state, engine->context_size); 1020 + if (ce->default_state) { 1021 + shmem_read(ce->default_state, 0, state, engine->context_size); 1023 1022 __set_bit(CONTEXT_VALID_BIT, &ce->flags); 1024 1023 inhibit = false; 1025 1024 } ··· 1129 1130 int err; 1130 1131 1131 1132 GEM_BUG_ON(ce->state); 1133 + 1134 + ce->default_state = engine->default_state; 1132 1135 1133 1136 vma = __lrc_alloc_state(ce, engine); 1134 1137 if (IS_ERR(vma))
+4 -3
drivers/gpu/drm/i915/gt/intel_ring_submission.c
··· 474 474 if (IS_ERR(vaddr)) 475 475 return PTR_ERR(vaddr); 476 476 477 - shmem_read(ce->engine->default_state, 0, 478 - vaddr, ce->engine->context_size); 477 + shmem_read(ce->default_state, 0, vaddr, ce->engine->context_size); 479 478 480 479 i915_gem_object_flush_map(obj); 481 480 __i915_gem_object_release_map(obj); ··· 490 491 struct i915_address_space *vm; 491 492 int err = 0; 492 493 493 - if (ce->engine->default_state && 494 + if (ce->default_state && 494 495 !test_bit(CONTEXT_VALID_BIT, &ce->flags)) { 495 496 err = ring_context_init_default_state(ce, ww); 496 497 if (err) ··· 568 569 static int ring_context_alloc(struct intel_context *ce) 569 570 { 570 571 struct intel_engine_cs *engine = ce->engine; 572 + 573 + ce->default_state = engine->default_state; 571 574 572 575 /* One ringbuffer to rule them all */ 573 576 GEM_BUG_ON(!engine->legacy.ring);