Skip to content

Commit 9822393

Browse files
committed
Merge tag 'drm-intel-fixes-2015-03-26' of git://anongit.freedesktop.org/drm-intel into drm-fixes
This should cover the final warnings in -rc5 with two more backports from our development branch (drm-intel-next-queued). They're the ones from Daniel and Damien, with references to the reports. This is on top of drm-fixes because of the dependency on the two earlier fixes not yet in Linus' tree. There's an additional regression fix from Chris. * tag 'drm-intel-fixes-2015-03-26' of git://anongit.freedesktop.org/drm-intel: drm/i915: Fixup legacy plane->crtc link for initial fb config drm/i915: Fix atomic state when reusing the firmware fb drm/i915: Keep ring->active_list and ring->requests_list consistent
2 parents 59a58cb + 5f40775 commit 9822393

File tree

2 files changed

+32
-19
lines changed

2 files changed

+32
-19
lines changed

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2737,24 +2737,11 @@ i915_gem_retire_requests_ring(struct intel_engine_cs *ring)
27372737

27382738
WARN_ON(i915_verify_lists(ring->dev));
27392739

2740-
/* Move any buffers on the active list that are no longer referenced
2741-
* by the ringbuffer to the flushing/inactive lists as appropriate,
2742-
* before we free the context associated with the requests.
2740+
/* Retire requests first as we use it above for the early return.
2741+
* If we retire requests last, we may use a later seqno and so clear
2742+
* the requests lists without clearing the active list, leading to
2743+
* confusion.
27432744
*/
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-
27582745
while (!list_empty(&ring->request_list)) {
27592746
struct drm_i915_gem_request *request;
27602747
struct intel_ringbuffer *ringbuf;
@@ -2789,6 +2776,23 @@ i915_gem_retire_requests_ring(struct intel_engine_cs *ring)
27892776
i915_gem_free_request(request);
27902777
}
27912778

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+
27922796
if (unlikely(ring->trace_irq_req &&
27932797
i915_gem_request_completed(ring->trace_irq_req, true))) {
27942798
ring->irq_put(ring);

drivers/gpu/drm/i915/intel_display.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,7 +2439,12 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc,
24392439
return;
24402440

24412441
if (intel_alloc_plane_obj(intel_crtc, plane_config)) {
2442-
update_state_fb(intel_crtc->base.primary);
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+
24432448
return;
24442449
}
24452450

@@ -2464,11 +2469,15 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc,
24642469
continue;
24652470

24662471
if (i915_gem_obj_ggtt_offset(obj) == plane_config->base) {
2472+
struct drm_plane *primary = intel_crtc->base.primary;
2473+
24672474
if (obj->tiling_mode != I915_TILING_NONE)
24682475
dev_priv->preserve_bios_swizzle = true;
24692476

24702477
drm_framebuffer_reference(c->primary->fb);
2471-
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;
24722481
obj->frontbuffer_bits |= INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
24732482
break;
24742483
}

0 commit comments

Comments
 (0)