diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 38 |
3 files changed, 24 insertions, 35 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 37c2c5009d9a..c5db23511184 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -1960,11 +1960,8 @@ static int i915_context_status(struct seq_file *m, void *unused) | |||
1960 | 1960 | ||
1961 | seq_puts(m, "HW context "); | 1961 | seq_puts(m, "HW context "); |
1962 | describe_ctx(m, ctx); | 1962 | describe_ctx(m, ctx); |
1963 | for_each_ring(ring, dev_priv, i) { | 1963 | if (ctx == dev_priv->kernel_context) |
1964 | if (dev_priv->kernel_context == ctx) | 1964 | seq_printf(m, "(kernel context) "); |
1965 | seq_printf(m, "(default context %s) ", | ||
1966 | ring->name); | ||
1967 | } | ||
1968 | 1965 | ||
1969 | if (i915.enable_execlists) { | 1966 | if (i915.enable_execlists) { |
1970 | seq_putc(m, '\n'); | 1967 | seq_putc(m, '\n'); |
@@ -2056,12 +2053,10 @@ static int i915_dump_lrc(struct seq_file *m, void *unused) | |||
2056 | if (ret) | 2053 | if (ret) |
2057 | return ret; | 2054 | return ret; |
2058 | 2055 | ||
2059 | list_for_each_entry(ctx, &dev_priv->context_list, link) { | 2056 | list_for_each_entry(ctx, &dev_priv->context_list, link) |
2060 | for_each_ring(ring, dev_priv, i) { | 2057 | if (ctx != dev_priv->kernel_context) |
2061 | if (dev_priv->kernel_context != ctx) | 2058 | for_each_ring(ring, dev_priv, i) |
2062 | i915_dump_lrc_obj(m, ctx, ring); | 2059 | i915_dump_lrc_obj(m, ctx, ring); |
2063 | } | ||
2064 | } | ||
2065 | 2060 | ||
2066 | mutex_unlock(&dev->struct_mutex); | 2061 | mutex_unlock(&dev->struct_mutex); |
2067 | 2062 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 06abe1bf5afc..6a3e4ee7f7e2 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2679,10 +2679,8 @@ void i915_gem_request_free(struct kref *req_ref) | |||
2679 | i915_gem_request_remove_from_client(req); | 2679 | i915_gem_request_remove_from_client(req); |
2680 | 2680 | ||
2681 | if (ctx) { | 2681 | if (ctx) { |
2682 | if (i915.enable_execlists) { | 2682 | if (i915.enable_execlists && ctx != req->i915->kernel_context) |
2683 | if (ctx != req->i915->kernel_context) | 2683 | intel_lr_context_unpin(req); |
2684 | intel_lr_context_unpin(req); | ||
2685 | } | ||
2686 | 2684 | ||
2687 | i915_gem_context_unreference(ctx); | 2685 | i915_gem_context_unreference(ctx); |
2688 | } | 2686 | } |
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 2c6da4013b1a..134379dc4dd9 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c | |||
@@ -686,16 +686,10 @@ static int execlists_move_to_gpu(struct drm_i915_gem_request *req, | |||
686 | 686 | ||
687 | int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request) | 687 | int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request) |
688 | { | 688 | { |
689 | int ret; | 689 | int ret = 0; |
690 | 690 | ||
691 | request->ringbuf = request->ctx->engine[request->ring->id].ringbuf; | 691 | request->ringbuf = request->ctx->engine[request->ring->id].ringbuf; |
692 | 692 | ||
693 | if (request->ctx != request->i915->kernel_context) { | ||
694 | ret = intel_lr_context_pin(request); | ||
695 | if (ret) | ||
696 | return ret; | ||
697 | } | ||
698 | |||
699 | if (i915.enable_guc_submission) { | 693 | if (i915.enable_guc_submission) { |
700 | /* | 694 | /* |
701 | * Check that the GuC has space for the request before | 695 | * Check that the GuC has space for the request before |
@@ -709,7 +703,10 @@ int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request | |||
709 | return ret; | 703 | return ret; |
710 | } | 704 | } |
711 | 705 | ||
712 | return 0; | 706 | if (request->ctx != request->i915->kernel_context) |
707 | ret = intel_lr_context_pin(request); | ||
708 | |||
709 | return ret; | ||
713 | } | 710 | } |
714 | 711 | ||
715 | static int logical_ring_wait_for_space(struct drm_i915_gem_request *req, | 712 | static int logical_ring_wait_for_space(struct drm_i915_gem_request *req, |
@@ -2391,22 +2388,21 @@ void intel_lr_context_free(struct intel_context *ctx) | |||
2391 | { | 2388 | { |
2392 | int i; | 2389 | int i; |
2393 | 2390 | ||
2394 | for (i = 0; i < I915_NUM_RINGS; i++) { | 2391 | for (i = I915_NUM_RINGS; --i >= 0; ) { |
2392 | struct intel_ringbuffer *ringbuf = ctx->engine[i].ringbuf; | ||
2395 | struct drm_i915_gem_object *ctx_obj = ctx->engine[i].state; | 2393 | struct drm_i915_gem_object *ctx_obj = ctx->engine[i].state; |
2396 | 2394 | ||
2397 | if (ctx_obj) { | 2395 | if (!ctx_obj) |
2398 | struct intel_ringbuffer *ringbuf = | 2396 | continue; |
2399 | ctx->engine[i].ringbuf; | ||
2400 | struct intel_engine_cs *ring = ringbuf->ring; | ||
2401 | 2397 | ||
2402 | if (ctx == ctx->i915->kernel_context) { | 2398 | if (ctx == ctx->i915->kernel_context) { |
2403 | intel_unpin_ringbuffer_obj(ringbuf); | 2399 | intel_unpin_ringbuffer_obj(ringbuf); |
2404 | i915_gem_object_ggtt_unpin(ctx_obj); | 2400 | i915_gem_object_ggtt_unpin(ctx_obj); |
2405 | } | ||
2406 | WARN_ON(ctx->engine[ring->id].pin_count); | ||
2407 | intel_ringbuffer_free(ringbuf); | ||
2408 | drm_gem_object_unreference(&ctx_obj->base); | ||
2409 | } | 2401 | } |
2402 | |||
2403 | WARN_ON(ctx->engine[i].pin_count); | ||
2404 | intel_ringbuffer_free(ringbuf); | ||
2405 | drm_gem_object_unreference(&ctx_obj->base); | ||
2410 | } | 2406 | } |
2411 | } | 2407 | } |
2412 | 2408 | ||
@@ -2481,7 +2477,7 @@ static void lrc_setup_hardware_status_page(struct intel_engine_cs *ring, | |||
2481 | */ | 2477 | */ |
2482 | 2478 | ||
2483 | int intel_lr_context_deferred_alloc(struct intel_context *ctx, | 2479 | int intel_lr_context_deferred_alloc(struct intel_context *ctx, |
2484 | struct intel_engine_cs *ring) | 2480 | struct intel_engine_cs *ring) |
2485 | { | 2481 | { |
2486 | struct drm_device *dev = ring->dev; | 2482 | struct drm_device *dev = ring->dev; |
2487 | struct drm_i915_gem_object *ctx_obj; | 2483 | struct drm_i915_gem_object *ctx_obj; |