summaryrefslogtreecommitdiffstats
path: root/drm-i915-Fixup-legacy-plane-crtc-link-for-initial-fb.patch
blob: afacbd1fc044b1f256684612360cf48a36b6e0d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed, 25 Mar 2015 18:30:38 +0100
Subject: [PATCH] drm/i915: Fixup legacy plane->crtc link for initial fb config

This is a very similar bug in the load detect code fixed in

commit 9128b040eb774e04bc23777b005ace2b66ab2a85
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue Mar 3 17:31:21 2015 +0100

    drm/i915: Fix modeset state confusion in the load detect code

But this time around it was the initial fb code that forgot to update
the plane->crtc pointer. Otherwise it's the exact same bug, with the
exact same restrains (any set_config call/ioctl that doesn't disable
the pipe papers over the bug for free, so fairly hard to hit in normal
testing). So if you want the full explanation just go read that one
over there - it's rather long ...

Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Josh Boyer <jwboyer@fedoraproject.org>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

(Backported to 4.0-rc5)
---
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 805b5e7b0058..778e7fa41c17 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2440,6 +2440,7 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc,
 
 	if (intel_alloc_plane_obj(intel_crtc, plane_config)) {
 		intel_crtc->base.primary->state->crtc = &intel_crtc->base;
+		intel_crtc->base.primary->crtc = &intel_crtc->base;
 		update_state_fb(intel_crtc->base.primary);
 		return;
 	}
@@ -2471,6 +2472,7 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc,
 			drm_framebuffer_reference(c->primary->fb);
 			intel_crtc->base.primary->fb = c->primary->fb;
 			intel_crtc->base.primary->state->crtc = &intel_crtc->base;
+			intel_crtc->base.primary->crtc = &intel_crtc->base;
 			obj->frontbuffer_bits |= INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 			break;
 		}
-- 
2.1.0