drm/i915: rip out the pipe A quirk for i855gm
Subsystems (3)
PATCH 1/3 drm/i915: rip out the pipe A quirk for i855gm
This seems to be the root-cause that breaks resume on my i855gm when I apply the "drm/i915: fixup the plane->pipe fixup code" patch. And that code doesn't even run on my machine, so it's pure timing changes causing the regression.
Furthermore resume has been constantly switching between working and broken on this machine ever since kms support has been merged, seemingly with no related change as a root cause. And always with the same symptoms of the backlight lighting up, but the lvds panel only displaying black.
Also, of both i855gm variants only one is in the table. And in the past we've only ever removed entries from this quirk table because it breaks things.
So let's just remove it - in case there's indeed a bios out there relying on a running pipe A, we can add back in a more precise quirk entry, like all the others (save for i830/i845).
--- drivers/gpu/drm/i915/intel_display.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -2
@@ -7790,8 +7790,7 @@ static struct intel_quirk intel_quirks[] = {/* ThinkPad T60 needs pipe A force quirk (bug #16494) */ { 0x2782, 0x17aa, 0x201a, quirk_pipea_force }, -/* 855 & before need to leave pipe A & dpll A up */ - { 0x3582, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, +/* 830/845 need to leave pipe A & dpll A up */ { 0x2562, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, { 0x3577, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },
Signature · 1 line
1.7.11.2
PATCH 2/3 drm/i915: fixup the plane->pipe fixup code
We need to check whether the _other plane is on our pipe, not whether our plane is on the other pipe. Otherwise if not both pipes/planes are active, we won't properly clean up the mess and set up our desired plane->pipe mapping.
v2: Fixup the logic, I've totally fumbled it. Noticed by Chris Wilson.
v3: I've checked Bspec, and the flexible plane->pipe mapping is a gen2/3 feature, so test for that instead of PCH_SPLIT
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51265
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49838
--- drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_display.c +18 -10
@@ -7946,11 +7946,27 @@ static void intel_enable_pipe_a(struct drm_device *dev) } +static bool +intel_check_plane_mapping (struct intel_crtc *crtc) +{ +struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; +u32 reg, val; + + reg =DSPCNTR (!crtc->plane); + val =I915_READ (reg); + +if ((val &DISPLAY_PLANE_ENABLE ) && + (!!(val &DISPPLANE_SEL_PIPE_MASK ) == crtc->pipe)) +return false; + +return true; +} +static void intel_sanitize_crtc (struct intel_crtc *crtc) {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -u32 reg, val; +u32 reg;/* Clear any frame start delays used for debugging left by the BIOS */ reg =PIPECONF (crtc->pipe);
@@ -7958,17 +7974,10 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)/* We need to sanitize the plane -> pipe mapping first because this will * disable the crtc (and hence change the state) if it is wrong. */ -if (!HAS_PCH_SPLIT (dev)) { +if (INTEL_INFO (dev)->gen <4 && !intel_check_plane_mapping (crtc)) {struct intel_connector *connector;bool plane; - reg =DSPCNTR (crtc->plane); - val =I915_READ (reg); - -if ((val &DISPLAY_PLANE_ENABLE ) ==0 && - (!!(val &DISPPLANE_SEL_PIPE_MASK ) == crtc->pipe)) - goto ok; -DRM_DEBUG_KMS ("[CRTC:%d] wrong plane connection detected!\n" , crtc->base.base.id);
@@ -7992,7 +8001,6 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)WARN_ON (crtc->active); crtc->base.enabled = false; } -ok:if (dev_priv->quirks &QUIRK_PIPEA_FORCE && crtc->pipe ==PIPE_A && !crtc->active) {
Signature · 1 line
1.7.11.2
Re: [PATCH 2/3] drm/i915: fixup the plane->pipe fixup code
Quoted 7 lines · Daniel Vetter
We need to check whether the
_otherplane is on our pipe, not whether our plane is on the other pipe. Otherwise if not both pipes/planes are active, we won't properly clean up the mess and set up our desiredplane->pipemapping.v2: Fixup the logic, I've totally fumbled it. Noticed by Chris Wilson.
Quoted 7 lines
v3: I've checked Bspec, and the flexible
plane->pipemapping is a gen2/3 feature, so test for that instead ofPCH_SPLITBugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51265
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49838Tested-by Dave Airlie <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
With these patches applied my 855gm is still in good working order (the best it has been). Though I'm still spammed by modeset_check failing in every possible way!
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
PATCH 3/3 drm/i915: disable wc gtt pte mappings on gen2
In reply to Daniel VetterIt doesn't work since the gtt pte range sits in the middle of the mmio bar. We didn't notice that since both my and Chris' gen2 machines don't support PAT and hence all wc io mapping request will automatically be demoted to uc.
This regression has been introduce in
commit edef7e685da05c13cce50c0126189c80fe2c8f71
Author: Chris Wilson <[email protected]> Date: Fri Sep 14 11:57:47 2012 +0100
agp/intel: Use a write-combining map for updating PTEs
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55834
--- drivers/char/agp/intel-gtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/agp/intel-gtt.c +1 -1
@@ -667,7 +667,7 @@ static int intel_gtt_init(void) gtt_map_size = intel_private.base.gtt_total_entries *4 ; intel_private.gtt =NULL ; -if (INTEL_GTT_GEN <6 ) +if (INTEL_GTT_GEN <6 &&INTEL_GTT_GEN >2 ) intel_private.gtt =ioremap_wc (intel_private.gtt_bus_addr, gtt_map_size);if (intel_private.gtt ==NULL )
Signature · 1 line
1.7.11.2
Re: [PATCH 3/3] drm/i915: disable wc gtt pte mappings on gen2
Quoted 8 lines · Daniel Vetter
It doesn't work since the gtt pte range sits in the middle of the mmio bar. We didn't notice that since both my and Chris' gen2 machines don't support PAT and hence all wc io mapping request will automatically be demoted to uc.
This regression has been introduce in
commit
edef7e685da05c13cce50c0126189c80fe2c8f71
Quoted 8 lines
Author: Chris Wilson <[email protected]> Date: Fri Sep 14 11:57:47 2012 +0100agp/intel: Use a write-combining map for updating PTEs
Reported-by Egbert Eich <[email protected]>Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55834
Signed-off-by Daniel Vetter <[email protected]>
Thanks for the explanation,
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Re: [PATCH 3/3] drm/i915: disable wc gtt pte mappings on gen2
Quoted 12 lines · Chris Wilson
Quoted 11 lines · Daniel Vetter
It doesn't work since the gtt pte range sits in the middle of the mmio bar. We didn't notice that since both my and Chris' gen2 machines don't support PAT and hence all wc io mapping request will automatically be demoted to uc.
This regression has been introduce in
commit
edef7e685da05c13cce50c0126189c80fe2c8f71Author: Chris Wilson <[email protected]> Date: Fri Sep 14 11:57:47 2012 +0100
Quoted 8 lines
Quoted 5 lines
agp/intel: Use a write-combining map for updating PTEs
Reported-by Egbert Eich <[email protected]>Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55834
Signed-off-by Daniel Vetter <[email protected]>Thanks for the explanation,
Acked-by Chris Wilson <[email protected]>
Patch merged to -fixes.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Chris Wilson
Reviewed-byRe: [PATCH 3/3] drm/i915: disable wc gtt pte mappings on gen2
Quoted 15 lines · Daniel Vetter
Quoted 14 lines · Chris Wilson
Quoted 13 lines · Daniel Vetter
It doesn't work since the gtt pte range sits in the middle of the mmio bar. We didn't notice that since both my and Chris' gen2 machines don't support PAT and hence all wc io mapping request will automatically be demoted to uc.
This regression has been introduce in
commit
edef7e685da05c13cce50c0126189c80fe2c8f71Author: Chris Wilson <[email protected]> Date: Fri Sep 14 11:57:47 2012 +0100agp/intel: Use a write-combining map for updating PTEs
Quoted 12 lines
Quoted 6 lines
Quoted 3 lines
Reported-by Egbert Eich <[email protected]>Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55834
Signed-off-by Daniel Vetter <[email protected]>Thanks for the explanation,
Acked-by Chris Wilson <[email protected]>Patch merged to -fixes.
-DanielSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
From: Chris Wilson <[email protected]>
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: fixup the plane->pipe fixup code
To: Daniel Vetter <[email protected]>, Intel Graphics Development <[email protected]>
Cc: Daniel Vetter <[email protected]>
In-Reply-To: <[email protected]>
References: <[email protected]> <[email protected]>
Quoted 7 lines · Daniel Vetter
We need to check whether the
_otherplane is on our pipe, not whether our plane is on the other pipe. Otherwise if not both pipes/planes are active, we won't properly clean up the mess and set up our desiredplane->pipemapping.v2: Fixup the logic, I've totally fumbled it. Noticed by Chris Wilson.
Quoted 7 lines
v3: I've checked Bspec, and the flexible
plane->pipemapping is a gen2/3 feature, so test for that instead ofPCH_SPLITBugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51265
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49838Tested-by Dave Airlie <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
Ok, looks good. I would move the gen check into intel_check_plane_mapping() itself with a short note that gen4+ has a fixed mapping.
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Re: [PATCH 3/3] drm/i915: disable wc gtt pte mappings on gen2
Quoted 51 lines · Chris Wilson
Quoted 15 lines · Daniel Vetter
Quoted 14 lines · Chris Wilson
Quoted 13 lines · Daniel Vetter
It doesn't work since the gtt pte range sits in the middle of the mmio bar. We didn't notice that since both my and Chris' gen2 machines don't support PAT and hence all wc io mapping request will automatically be demoted to uc.
This regression has been introduce in
commit
edef7e685da05c13cce50c0126189c80fe2c8f71Author: Chris Wilson <[email protected]> Date: Fri Sep 14 11:57:47 2012 +0100agp/intel: Use a write-combining map for updating PTEs
Quoted 12 lines
Quoted 6 lines
Quoted 3 lines
Reported-by Egbert Eich <[email protected]>Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55834
Signed-off-by Daniel Vetter <[email protected]>Thanks for the explanation,
Acked-by Chris Wilson <[email protected]>Patch merged to -fixes.
-DanielSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.chFrom: Chris Wilson <[email protected]>
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: fixup theplane->pipefixup code
To: Daniel Vetter <[email protected]>, Intel Graphics Development <[email protected]>
Cc: Daniel Vetter <[email protected]>
In-Reply-To: <[email protected]>
References: <[email protected]> <[email protected]>Quoted 7 lines · Daniel Vetter
We need to check whether the
_otherplane is on our pipe, not whether our plane is on the other pipe. Otherwise if not both pipes/planes are active, we won't properly clean up the mess and set up our desiredplane->pipemapping.v2: Fixup the logic, I've totally fumbled it. Noticed by Chris Wilson.
Quoted 7 lines
v3: I've checked Bspec, and the flexible
plane->pipemapping is a gen2/3 feature, so test for that instead ofPCH_SPLITBugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51265
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49838Tested-by Dave Airlie <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
Quoted 5 lines
Ok, looks good. I would move the gen check into
intel_check_plane_mapping()itself with a short note that gen4+ has a fixed mapping.Reviewed-by Chris Wilson <[email protected]>
Applied them both, although I did not move the gen < 4 check, only added a comment - that way it's clear that the fixup code only ever runs on hw with at most 2 pipes. And all the !plane tricks it does depend upon that. -Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch