The execlist_lock is now completely subsumed by the engine->timeline->lock, and so we can remove the redundant layer of locking.
Unified · Split
| @@ -3256,11 +3256,11 @@ static int i915_engine_info(struct seq_file *m, void *unused) · 3255 unmodified lines | |||
| 3256 | seq_printf(m, "\t\tELSP[1] idle\n"); | 3256 | seq_printf(m, "\t\tELSP[1] idle\n"); |
| 3257 | rcu_read_unlock(); | 3257 | rcu_read_unlock(); |
| 3258 | 3258 | ||
| 3259 | spin_lock_irq(&engine->execlist_lock); | 3259 | spin_lock_irq(&engine->timeline->lock); |
| 3260 | list_for_each_entry(rq, &engine->execlist_queue, execlist_link) { | 3260 | list_for_each_entry(rq, &engine->execlist_queue, execlist_link) { |
| 3261 | print_request(m, rq, "\t\tQ "); | 3261 | print_request(m, rq, "\t\tQ "); |
| 3262 | } | 3262 | } |
| 3263 | spin_unlock_irq(&engine->execlist_lock); | 3263 | spin_unlock_irq(&engine->timeline->lock); |
| 3264 | } else if (INTEL_GEN(dev_priv) > 6) { | 3264 | } else if (INTEL_GEN(dev_priv) > 6) { |
| 3265 | seq_printf(m, "\tPP_DIR_BASE: 0x%08x\n", | 3265 | seq_printf(m, "\tPP_DIR_BASE: 0x%08x\n", |
| 3266 | I915_READ(RING_PP_DIR_BASE(engine))); | 3266 | I915_READ(RING_PP_DIR_BASE(engine))); |
| @@ -2717,12 +2717,16 @@ static void i915_gem_cleanup_engine(struct intel_engine_cs *engine) · 2716 unmodified lines | |||
| 2717 | */ | 2717 | */ |
| 2718 | 2718 | ||
| 2719 | if (i915.enable_execlists) { | 2719 | if (i915.enable_execlists) { |
| 2720 | spin_lock(&engine->execlist_lock); | 2720 | unsigned long flags; |
| 2721 | |||
| 2722 | spin_lock_irqsave(&engine->timeline->lock, flags); | ||
| 2723 | |||
| 2721 | INIT_LIST_HEAD(&engine->execlist_queue); | 2724 | INIT_LIST_HEAD(&engine->execlist_queue); |
| 2722 | i915_gem_request_put(engine->execlist_port[0].request); | 2725 | i915_gem_request_put(engine->execlist_port[0].request); |
| 2723 | i915_gem_request_put(engine->execlist_port[1].request); | 2726 | i915_gem_request_put(engine->execlist_port[1].request); |
| 2724 | memset(engine->execlist_port, 0, sizeof(engine->execlist_port)); | 2727 | memset(engine->execlist_port, 0, sizeof(engine->execlist_port)); |
| 2725 | spin_unlock(&engine->execlist_lock); | 2728 | |
| 2729 | spin_unlock_irqrestore(&engine->timeline->lock, flags); | ||
| 2726 | } | 2730 | } |
| 2727 | } | 2731 | } |
| 2728 | 2732 | ||
| @@ -237,7 +237,6 @@ static void intel_engine_init_timeline(struct intel_engine_cs *engine) · 236 unmodified lines | |||
| 237 | void intel_engine_setup_common(struct intel_engine_cs *engine) | 237 | void intel_engine_setup_common(struct intel_engine_cs *engine) |
| 238 | { | 238 | { |
| 239 | INIT_LIST_HEAD(&engine->execlist_queue); | 239 | INIT_LIST_HEAD(&engine->execlist_queue); |
| 240 | spin_lock_init(&engine->execlist_lock); | ||
| 241 | 240 | ||
| 242 | intel_engine_init_timeline(engine); | 241 | intel_engine_init_timeline(engine); |
| 243 | intel_engine_init_hangcheck(engine); | 242 | intel_engine_init_hangcheck(engine); |
| @@ -471,7 +471,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 470 unmodified lines | |||
| 471 | */ | 471 | */ |
| 472 | 472 | ||
| 473 | spin_lock_irqsave(&engine->timeline->lock, flags); | 473 | spin_lock_irqsave(&engine->timeline->lock, flags); |
| 474 | spin_lock(&engine->execlist_lock); | ||
| 475 | list_for_each_entry(cursor, &engine->execlist_queue, execlist_link) { | 474 | list_for_each_entry(cursor, &engine->execlist_queue, execlist_link) { |
| 476 | /* Can we combine this request with the current port? It has to | 475 | /* Can we combine this request with the current port? It has to |
| 477 | * be the same context/ringbuffer and not have any exceptions | 476 | * be the same context/ringbuffer and not have any exceptions |
| @@ -524,7 +523,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 46 unmodified lines | |||
| 524 | 523 | ||
| 525 | i915_gem_request_assign(&port->request, last); | 524 | i915_gem_request_assign(&port->request, last); |
| 526 | } | 525 | } |
| 527 | spin_unlock(&engine->execlist_lock); | ||
| 528 | spin_unlock_irqrestore(&engine->timeline->lock, flags); | 526 | spin_unlock_irqrestore(&engine->timeline->lock, flags); |
| 529 | 527 | ||
| 530 | if (submit) | 528 | if (submit) |
| @@ -633,13 +631,14 @@ static void execlists_submit_request(struct drm_i915_gem_request *request) · 102 unmodified lines | |||
| 633 | struct intel_engine_cs *engine = request->engine; | 631 | struct intel_engine_cs *engine = request->engine; |
| 634 | unsigned long flags; | 632 | unsigned long flags; |
| 635 | 633 | ||
| 636 | spin_lock_irqsave(&engine->execlist_lock, flags); | 634 | /* Will be called from irq-context when using foreign fences. */ |
| 635 | spin_lock_irqsave(&engine->timeline->lock, flags); | ||
| 637 | 636 | ||
| 638 | list_add_tail(&request->execlist_link, &engine->execlist_queue); | 637 | list_add_tail(&request->execlist_link, &engine->execlist_queue); |
| 639 | if (execlists_elsp_idle(engine)) | 638 | if (execlists_elsp_idle(engine)) |
| 640 | tasklet_hi_schedule(&engine->irq_tasklet); | 639 | tasklet_hi_schedule(&engine->irq_tasklet); |
| 641 | 640 | ||
| 642 | spin_unlock_irqrestore(&engine->execlist_lock, flags); | 641 | spin_unlock_irqrestore(&engine->timeline->lock, flags); |
| 643 | } | 642 | } |
| 644 | 643 | ||
| 645 | int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request) | 644 | int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request) |
| @@ -335,7 +335,6 @@ struct intel_engine_cs { · 334 unmodified lines | |||
| 335 | 335 | ||
| 336 | /* Execlists */ | 336 | /* Execlists */ |
| 337 | struct tasklet_struct irq_tasklet; | 337 | struct tasklet_struct irq_tasklet; |
| 338 | spinlock_t execlist_lock; /* used inside tasklet, use spin_lock_bh */ | ||
| 339 | struct execlist_port { | 338 | struct execlist_port { |
| 340 | struct drm_i915_gem_request *request; | 339 | struct drm_i915_gem_request *request; |
| 341 | unsigned int count; | 340 | unsigned int count; |