diff options
Diffstat (limited to 'drivers/gpu/drm/i915')
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 38 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 18 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_sprite.c | 4 |
4 files changed, 37 insertions, 25 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 5b205863b659..27ea6bdebce7 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -2737,24 +2737,11 @@ i915_gem_retire_requests_ring(struct intel_engine_cs *ring) | |||
| 2737 | 2737 | ||
| 2738 | WARN_ON(i915_verify_lists(ring->dev)); | 2738 | WARN_ON(i915_verify_lists(ring->dev)); |
| 2739 | 2739 | ||
| 2740 | /* Move any buffers on the active list that are no longer referenced | 2740 | /* Retire requests first as we use it above for the early return. |
| 2741 | * by the ringbuffer to the flushing/inactive lists as appropriate, | 2741 | * If we retire requests last, we may use a later seqno and so clear |
| 2742 | * before we free the context associated with the requests. | 2742 | * the requests lists without clearing the active list, leading to |
| 2743 | * confusion. | ||
| 2743 | */ | 2744 | */ |
| 2744 | while (!list_empty(&ring->active_list)) { | ||
| 2745 | struct drm_i915_gem_object *obj; | ||
| 2746 | |||
| 2747 | obj = list_first_entry(&ring->active_list, | ||
| 2748 | struct drm_i915_gem_object, | ||
| 2749 | ring_list); | ||
| 2750 | |||
| 2751 | if (!i915_gem_request_completed(obj->last_read_req, true)) | ||
| 2752 | break; | ||
| 2753 | |||
| 2754 | i915_gem_object_move_to_inactive(obj); | ||
| 2755 | } | ||
| 2756 | |||
| 2757 | |||
| 2758 | while (!list_empty(&ring->request_list)) { | 2745 | while (!list_empty(&ring->request_list)) { |
| 2759 | struct drm_i915_gem_request *request; | 2746 | struct drm_i915_gem_request *request; |
| 2760 | struct intel_ringbuffer *ringbuf; | 2747 | struct intel_ringbuffer *ringbuf; |
| @@ -2789,6 +2776,23 @@ i915_gem_retire_requests_ring(struct intel_engine_cs *ring) | |||
| 2789 | i915_gem_free_request(request); | 2776 | i915_gem_free_request(request); |
| 2790 | } | 2777 | } |
| 2791 | 2778 | ||
| 2779 | /* Move any buffers on the active list that are no longer referenced | ||
| 2780 | * by the ringbuffer to the flushing/inactive lists as appropriate, | ||
| 2781 | * before we free the context associated with the requests. | ||
| 2782 | */ | ||
| 2783 | while (!list_empty(&ring->active_list)) { | ||
| 2784 | struct drm_i915_gem_object *obj; | ||
| 2785 | |||
| 2786 | obj = list_first_entry(&ring->active_list, | ||
| 2787 | struct drm_i915_gem_object, | ||
| 2788 | ring_list); | ||
| 2789 | |||
| 2790 | if (!i915_gem_request_completed(obj->last_read_req, true)) | ||
| 2791 | break; | ||
| 2792 | |||
| 2793 | i915_gem_object_move_to_inactive(obj); | ||
| 2794 | } | ||
| 2795 | |||
| 2792 | if (unlikely(ring->trace_irq_req && | 2796 | if (unlikely(ring->trace_irq_req && |
| 2793 | i915_gem_request_completed(ring->trace_irq_req, true))) { | 2797 | i915_gem_request_completed(ring->trace_irq_req, true))) { |
| 2794 | ring->irq_put(ring); | 2798 | ring->irq_put(ring); |
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index b773368fc62c..38a742532c4f 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
| @@ -1487,7 +1487,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
| 1487 | goto err; | 1487 | goto err; |
| 1488 | } | 1488 | } |
| 1489 | 1489 | ||
| 1490 | if (i915_needs_cmd_parser(ring)) { | 1490 | if (i915_needs_cmd_parser(ring) && args->batch_len) { |
| 1491 | batch_obj = i915_gem_execbuffer_parse(ring, | 1491 | batch_obj = i915_gem_execbuffer_parse(ring, |
| 1492 | &shadow_exec_entry, | 1492 | &shadow_exec_entry, |
| 1493 | eb, | 1493 | eb, |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 6d22128d97b1..f75173c20f47 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -2438,8 +2438,15 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc, | |||
| 2438 | if (!intel_crtc->base.primary->fb) | 2438 | if (!intel_crtc->base.primary->fb) |
| 2439 | return; | 2439 | return; |
| 2440 | 2440 | ||
| 2441 | if (intel_alloc_plane_obj(intel_crtc, plane_config)) | 2441 | if (intel_alloc_plane_obj(intel_crtc, plane_config)) { |
| 2442 | struct drm_plane *primary = intel_crtc->base.primary; | ||
| 2443 | |||
| 2444 | primary->state->crtc = &intel_crtc->base; | ||
| 2445 | primary->crtc = &intel_crtc->base; | ||
| 2446 | update_state_fb(primary); | ||
| 2447 | |||
| 2442 | return; | 2448 | return; |
| 2449 | } | ||
| 2443 | 2450 | ||
| 2444 | kfree(intel_crtc->base.primary->fb); | 2451 | kfree(intel_crtc->base.primary->fb); |
| 2445 | intel_crtc->base.primary->fb = NULL; | 2452 | intel_crtc->base.primary->fb = NULL; |
| @@ -2462,11 +2469,15 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc, | |||
| 2462 | continue; | 2469 | continue; |
| 2463 | 2470 | ||
| 2464 | if (i915_gem_obj_ggtt_offset(obj) == plane_config->base) { | 2471 | if (i915_gem_obj_ggtt_offset(obj) == plane_config->base) { |
| 2472 | struct drm_plane *primary = intel_crtc->base.primary; | ||
| 2473 | |||
| 2465 | if (obj->tiling_mode != I915_TILING_NONE) | 2474 | if (obj->tiling_mode != I915_TILING_NONE) |
| 2466 | dev_priv->preserve_bios_swizzle = true; | 2475 | dev_priv->preserve_bios_swizzle = true; |
| 2467 | 2476 | ||
| 2468 | drm_framebuffer_reference(c->primary->fb); | 2477 | drm_framebuffer_reference(c->primary->fb); |
| 2469 | intel_crtc->base.primary->fb = c->primary->fb; | 2478 | primary->fb = c->primary->fb; |
| 2479 | primary->state->crtc = &intel_crtc->base; | ||
| 2480 | primary->crtc = &intel_crtc->base; | ||
| 2470 | obj->frontbuffer_bits |= INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe); | 2481 | obj->frontbuffer_bits |= INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe); |
| 2471 | break; | 2482 | break; |
| 2472 | } | 2483 | } |
| @@ -6663,7 +6674,6 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc, | |||
| 6663 | plane_config->size); | 6674 | plane_config->size); |
| 6664 | 6675 | ||
| 6665 | crtc->base.primary->fb = fb; | 6676 | crtc->base.primary->fb = fb; |
| 6666 | update_state_fb(crtc->base.primary); | ||
| 6667 | } | 6677 | } |
| 6668 | 6678 | ||
| 6669 | static void chv_crtc_clock_get(struct intel_crtc *crtc, | 6679 | static void chv_crtc_clock_get(struct intel_crtc *crtc, |
| @@ -7704,7 +7714,6 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc, | |||
| 7704 | plane_config->size); | 7714 | plane_config->size); |
| 7705 | 7715 | ||
| 7706 | crtc->base.primary->fb = fb; | 7716 | crtc->base.primary->fb = fb; |
| 7707 | update_state_fb(crtc->base.primary); | ||
| 7708 | return; | 7717 | return; |
| 7709 | 7718 | ||
| 7710 | error: | 7719 | error: |
| @@ -7798,7 +7807,6 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc, | |||
| 7798 | plane_config->size); | 7807 | plane_config->size); |
| 7799 | 7808 | ||
| 7800 | crtc->base.primary->fb = fb; | 7809 | crtc->base.primary->fb = fb; |
| 7801 | update_state_fb(crtc->base.primary); | ||
| 7802 | } | 7810 | } |
| 7803 | 7811 | ||
| 7804 | static bool ironlake_get_pipe_config(struct intel_crtc *crtc, | 7812 | static bool ironlake_get_pipe_config(struct intel_crtc *crtc, |
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index 0a52c44ad03d..9c5451c97942 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c | |||
| @@ -1322,7 +1322,7 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data, | |||
| 1322 | drm_modeset_lock_all(dev); | 1322 | drm_modeset_lock_all(dev); |
| 1323 | 1323 | ||
| 1324 | plane = drm_plane_find(dev, set->plane_id); | 1324 | plane = drm_plane_find(dev, set->plane_id); |
| 1325 | if (!plane) { | 1325 | if (!plane || plane->type != DRM_PLANE_TYPE_OVERLAY) { |
| 1326 | ret = -ENOENT; | 1326 | ret = -ENOENT; |
| 1327 | goto out_unlock; | 1327 | goto out_unlock; |
| 1328 | } | 1328 | } |
| @@ -1349,7 +1349,7 @@ int intel_sprite_get_colorkey(struct drm_device *dev, void *data, | |||
| 1349 | drm_modeset_lock_all(dev); | 1349 | drm_modeset_lock_all(dev); |
| 1350 | 1350 | ||
| 1351 | plane = drm_plane_find(dev, get->plane_id); | 1351 | plane = drm_plane_find(dev, get->plane_id); |
| 1352 | if (!plane) { | 1352 | if (!plane || plane->type != DRM_PLANE_TYPE_OVERLAY) { |
| 1353 | ret = -ENOENT; | 1353 | ret = -ENOENT; |
| 1354 | goto out_unlock; | 1354 | goto out_unlock; |
| 1355 | } | 1355 | } |
