Re: Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-04-09 Thread Daniel Vetter
On Tue, Apr 09, 2013 at 03:21:35PM +0200, Richard Cochran wrote:
> On Tue, Apr 09, 2013 at 02:50:03PM +0200, Daniel Vetter wrote:
> > 
> > This should be fixed with the above mentioned patch. The issue is that the
> > bios fumbles around with the output configuration behind our backs, so the
> > new paranoid modeset code in 3.7+ freaks out about the state mismatch
> > between sw and hw.
> > 
> > The patch above should detect this situation and undo any bios-induced
> > damage.
> 
> Even with the patch, I still am seeing the issue (in 3.8).

Indeed, there's still a bug there with the state checking. Can you please
test the below patch?

Thanks, Daniel

commit d206df2685801a832a728c7dca13428a6f5bf3ef
Author: Daniel Vetter 
Date:   Tue Apr 9 19:25:12 2013 +0200

drm/i915: don't check inconstent modeset state when force-restoring

It will be only consistent once we've restored all the crtcs. Since a
bunch of other callers also want to just restore a single crtc, add a
boolean to disable checking only where it doesn't make sense.

Note that intel_modeset_setup_hw_state already has a call to
intel_modeset_check_state at the end, so we don't reduce the amount of
checking.

References: https://lkml.org/lkml/2013/3/16/60
Cc: Tomas Melin 
Cc: Richard Cochran 
Cc: sta...@vger.kernel.org
Signed-off-by: Daniel Vetter 

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 8809813..1e29201 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7916,9 +7916,9 @@ intel_modeset_check_state(struct drm_device *dev)
}
 }
 
-int intel_set_mode(struct drm_crtc *crtc,
-  struct drm_display_mode *mode,
-  int x, int y, struct drm_framebuffer *fb)
+static int __intel_set_mode(struct drm_crtc *crtc,
+   struct drm_display_mode *mode,
+   int x, int y, struct drm_framebuffer *fb)
 {
struct drm_device *dev = crtc->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -8012,8 +8012,6 @@ done:
if (ret && crtc->enabled) {
crtc->hwmode = *saved_hwmode;
crtc->mode = *saved_mode;
-   } else {
-   intel_modeset_check_state(dev);
}
 
 out:
@@ -8022,9 +8020,27 @@ out:
return ret;
 }
 
-void intel_crtc_restore_mode(struct drm_crtc *crtc)
+int intel_set_mode(struct drm_crtc *crtc,
+struct drm_display_mode *mode,
+int x, int y, struct drm_framebuffer *fb)
+{
+   int ret;
+
+   ret = __intel_set_mode(crtc, mode, x, y, fb);
+
+   if (ret == 0)
+   intel_modeset_check_state(crtc->dev);
+
+   return ret;
+}
+
+void intel_crtc_restore_mode(struct drm_crtc *crtc,
+bool check)
 {
-   intel_set_mode(crtc, >mode, crtc->x, crtc->y, crtc->fb);
+   __intel_set_mode(crtc, >mode, crtc->x, crtc->y, crtc->fb);
+
+   if (check)
+   intel_modeset_check_state(crtc->dev);
 }
 
 #undef for_each_intel_crtc_masked
@@ -9336,7 +9352,7 @@ setup_pipes:
for_each_pipe(pipe) {
struct drm_crtc *crtc =
dev_priv->pipe_to_crtc_mapping[pipe];
-   intel_crtc_restore_mode(crtc);
+   intel_crtc_restore_mode(crtc, false);
}
list_for_each_entry(plane, >mode_config.plane_list, head)
intel_plane_restore(plane);
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 173add1..99b9f09 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2466,7 +2466,7 @@ intel_dp_set_property(struct drm_connector *connector,
 
 done:
if (intel_encoder->base.crtc)
-   intel_crtc_restore_mode(intel_encoder->base.crtc);
+   intel_crtc_restore_mode(intel_encoder->base.crtc, true);
 
return 0;
 }
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index d7bd031..d7b1094 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -540,7 +540,7 @@ struct intel_set_config {
 extern int intel_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode,
  int x, int y, struct drm_framebuffer *old_fb);
 extern void intel_modeset_disable(struct drm_device *dev);
-extern void intel_crtc_restore_mode(struct drm_crtc *crtc);
+extern void intel_crtc_restore_mode(struct drm_crtc *crtc, bool check);
 extern void intel_crtc_load_lut(struct drm_crtc *crtc);
 extern void intel_crtc_update_dpms(struct drm_crtc *crtc);
 extern void intel_encoder_destroy(struct drm_encoder *encoder);
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c 
b/drivers/gpu/drm/i915/intel_hdmi.c
index ee4a8da..de07bd4 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ 

Re: Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-04-09 Thread Richard Cochran
On Tue, Apr 09, 2013 at 02:50:03PM +0200, Daniel Vetter wrote:
> 
> This should be fixed with the above mentioned patch. The issue is that the
> bios fumbles around with the output configuration behind our backs, so the
> new paranoid modeset code in 3.7+ freaks out about the state mismatch
> between sw and hw.
> 
> The patch above should detect this situation and undo any bios-induced
> damage.

Even with the patch, I still am seeing the issue (in 3.8).

Thanks,
Richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-04-09 Thread Daniel Vetter
On Tue, Apr 09, 2013 at 02:54:34PM +0300, Tomas Melin wrote:
> On Mon, 18 Mar 2013 09:32:51 +0100, Daniel Vetter wrote:
> >
> > On Sat, Mar 16, 2013 at 01:28:50PM +0100, Richard Cochran wrote:
> >>
> >> I have an Acer Aspire One netbook, and on it I get the following
> >> warning when closing and opening the lid. I think this warning first
> >> appeared in 3.7.
> >>
> >> Does this need fixing? If so, who can do it?
> >
> > Another pesky BIOS which changes the display state behind our back on lid
> > closing! Should be duct-tapped over with
> >
> > commit 45e2b5f640b3766da3eda48f6c35f088155c06f3
> > Author: Daniel Vetter 
> > Date:   Fri Nov 23 18:16:34 2012 +0100
> >
> > drm/i915: force restore on lid open
> >
> > which is in 3.8.
> 
> I'm seeing the same problems on my eeepc using 3.8. Happens (most) of
> the time when opening and closing the lid. Any ideas on how to fix
> this?

This should be fixed with the above mentioned patch. The issue is that the
bios fumbles around with the output configuration behind our backs, so the
new paranoid modeset code in 3.7+ freaks out about the state mismatch
between sw and hw.

The patch above should detect this situation and undo any bios-induced
damage.
-Daniel

> 
> -Tomas
> 
> [20314.679749] [drm:i9xx_crtc_mode_set] *ERROR* Couldn't find PLL
> settings for mode!
> 
> [20314.679787] [ cut here ]
> [20314.679819] WARNING: at drivers/gpu/drm/i915/intel_display.c:7864
> intel_modeset_check_state+0x4ad/0x620()
> [20314.679831] Hardware name: 901
> [20314.679843] encoder's hw state doesn't match sw tracking (expected
> 1, found 0)
> [20314.679853] Modules linked in: bridge ipv6 rfcomm fuse btusb
> rt2800pci rt2800lib rt2x00pci rt2x00lib atl1e
> [20314.679917] Pid: 10069, comm: kworker/0:0 Tainted: GW3.8.0 #8
> [20314.679930] Call Trace:
> [20314.679958]  [] warn_slowpath_common+0x6d/0xa0
> [20314.679983]  [] ? intel_modeset_check_state+0x4ad/0x620
> [20314.680006]  [] ? intel_modeset_check_state+0x4ad/0x620
> [20314.680017]  [] warn_slowpath_fmt+0x2e/0x30
> [20314.680017]  [] intel_modeset_check_state+0x4ad/0x620
> [20314.680103]  [] intel_set_mode+0x701/0x990
> [20314.680170]  [] intel_modeset_setup_hw_state+0x5d5/0x8e0
> [20314.680215]  [] ? acpi_lid_open+0x28/0x40
> [20314.680236]  [] intel_lid_notify+0x9b/0xc0
> [20314.680258]  [] notifier_call_chain+0x45/0x60
> [20314.680283]  [] __blocking_notifier_call_chain+0x3e/0x60
> [20314.680306]  [] blocking_notifier_call_chain+0x1a/0x20
> [20314.680329]  [] acpi_lid_send_state+0x78/0x9d
> [20314.680351]  [] acpi_button_notify+0x30/0xa4
> [20314.680376]  [] acpi_device_notify+0x12/0x15
> [20314.680402]  [] acpi_ev_notify_dispatch+0x2e/0x45
> [20314.680424]  [] acpi_os_execute_deferred+0x1b/0x26
> [20314.680449]  [] process_one_work+0x110/0x380
> [20314.680475]  [] ? apic_timer_interrupt+0x2d/0x34
> [20314.680498]  [] ? acpi_os_wait_events_complete+0x19/0x19
> [20314.680522]  [] worker_thread+0x119/0x340
> [20314.680545]  [] ? manage_workers+0x260/0x260
> [20314.680572]  [] kthread+0x8f/0xa0
> [20314.680598]  [] ret_from_kernel_thread+0x1b/0x28
> [20314.680622]  [] ? flush_kthread_work+0xc0/0xc0
> [20314.680640] ---[ end trace 037b36714b28cbdf ]---
> [20314.680661] [ cut here ]
> [20314.680684] WARNING: at drivers/gpu/drm/i915/intel_display.c:7898
> intel_modeset_check_state+0x47b/0x620()
> [20314.680697] Hardware name: 901
> [20314.680709] crtc's computed active state doesn't match tracked
> active state (expected 1, found 0)
> [20314.680719] Modules linked in: bridge ipv6 rfcomm fuse btusb
> rt2800pci rt2800lib rt2x00pci rt2x00lib atl1e
> [20314.680898] Pid: 10069, comm: kworker/0:0 Tainted: GW3.8.0 #8
> [20314.680910] Call Trace:
> [20314.680934]  [] warn_slowpath_common+0x6d/0xa0
> [20314.680960]  [] ? intel_modeset_check_state+0x47b/0x620
> [20314.680983]  [] ? intel_modeset_check_state+0x47b/0x620
> [20314.681006]  [] warn_slowpath_fmt+0x2e/0x30
> [20314.681041]  [] intel_modeset_check_state+0x47b/0x620
> [20314.681052]  [] intel_set_mode+0x701/0x990
> [20314.681095]  [] intel_modeset_setup_hw_state+0x5d5/0x8e0
> [20314.681122]  [] ? acpi_lid_open+0x28/0x40
> [20314.681147]  [] intel_lid_notify+0x9b/0xc0
> [20314.681170]  [] notifier_call_chain+0x45/0x60
> [20314.681196]  [] __blocking_notifier_call_chain+0x3e/0x60
> [20314.681221]  [] blocking_notifier_call_chain+0x1a/0x20
> [20314.681246]  [] acpi_lid_send_state+0x78/0x9d
> [20314.681270]  [] acpi_button_notify+0x30/0xa4
> [20314.681295]  [] acpi_device_notify+0x12/0x15
> [20314.681320]  [] acpi_ev_notify_dispatch+0x2e/0x45
> [20314.681344]  [] acpi_os_execute_deferred+0x1b/0x26
> [20314.681366]  [] process_one_work+0x110/0x380
> [20314.681392]  [] ? apic_timer_interrupt+0x2d/0x34
> [20314.681416]  [] ? acpi_os_wait_events_complete+0x19/0x19
> [20314.681465]  [] worker_thread+0x119/0x340
> [20314.681516]  [] ? manage_workers+0x260/0x260
> [20314.681568]  [] kthread+0x8f/0xa0
> [20314.681614] 

Re: Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-04-09 Thread Tomas Melin
On Mon, 18 Mar 2013 09:32:51 +0100, Daniel Vetter wrote:
>
> On Sat, Mar 16, 2013 at 01:28:50PM +0100, Richard Cochran wrote:
>>
>> I have an Acer Aspire One netbook, and on it I get the following
>> warning when closing and opening the lid. I think this warning first
>> appeared in 3.7.
>>
>> Does this need fixing? If so, who can do it?
>
> Another pesky BIOS which changes the display state behind our back on lid
> closing! Should be duct-tapped over with
>
> commit 45e2b5f640b3766da3eda48f6c35f088155c06f3
> Author: Daniel Vetter 
> Date:   Fri Nov 23 18:16:34 2012 +0100
>
> drm/i915: force restore on lid open
>
> which is in 3.8.

I'm seeing the same problems on my eeepc using 3.8. Happens (most) of
the time when opening and closing the lid. Any ideas on how to fix
this?

-Tomas

[20314.679749] [drm:i9xx_crtc_mode_set] *ERROR* Couldn't find PLL
settings for mode!

[20314.679787] [ cut here ]
[20314.679819] WARNING: at drivers/gpu/drm/i915/intel_display.c:7864
intel_modeset_check_state+0x4ad/0x620()
[20314.679831] Hardware name: 901
[20314.679843] encoder's hw state doesn't match sw tracking (expected
1, found 0)
[20314.679853] Modules linked in: bridge ipv6 rfcomm fuse btusb
rt2800pci rt2800lib rt2x00pci rt2x00lib atl1e
[20314.679917] Pid: 10069, comm: kworker/0:0 Tainted: GW3.8.0 #8
[20314.679930] Call Trace:
[20314.679958]  [] warn_slowpath_common+0x6d/0xa0
[20314.679983]  [] ? intel_modeset_check_state+0x4ad/0x620
[20314.680006]  [] ? intel_modeset_check_state+0x4ad/0x620
[20314.680017]  [] warn_slowpath_fmt+0x2e/0x30
[20314.680017]  [] intel_modeset_check_state+0x4ad/0x620
[20314.680103]  [] intel_set_mode+0x701/0x990
[20314.680170]  [] intel_modeset_setup_hw_state+0x5d5/0x8e0
[20314.680215]  [] ? acpi_lid_open+0x28/0x40
[20314.680236]  [] intel_lid_notify+0x9b/0xc0
[20314.680258]  [] notifier_call_chain+0x45/0x60
[20314.680283]  [] __blocking_notifier_call_chain+0x3e/0x60
[20314.680306]  [] blocking_notifier_call_chain+0x1a/0x20
[20314.680329]  [] acpi_lid_send_state+0x78/0x9d
[20314.680351]  [] acpi_button_notify+0x30/0xa4
[20314.680376]  [] acpi_device_notify+0x12/0x15
[20314.680402]  [] acpi_ev_notify_dispatch+0x2e/0x45
[20314.680424]  [] acpi_os_execute_deferred+0x1b/0x26
[20314.680449]  [] process_one_work+0x110/0x380
[20314.680475]  [] ? apic_timer_interrupt+0x2d/0x34
[20314.680498]  [] ? acpi_os_wait_events_complete+0x19/0x19
[20314.680522]  [] worker_thread+0x119/0x340
[20314.680545]  [] ? manage_workers+0x260/0x260
[20314.680572]  [] kthread+0x8f/0xa0
[20314.680598]  [] ret_from_kernel_thread+0x1b/0x28
[20314.680622]  [] ? flush_kthread_work+0xc0/0xc0
[20314.680640] ---[ end trace 037b36714b28cbdf ]---
[20314.680661] [ cut here ]
[20314.680684] WARNING: at drivers/gpu/drm/i915/intel_display.c:7898
intel_modeset_check_state+0x47b/0x620()
[20314.680697] Hardware name: 901
[20314.680709] crtc's computed active state doesn't match tracked
active state (expected 1, found 0)
[20314.680719] Modules linked in: bridge ipv6 rfcomm fuse btusb
rt2800pci rt2800lib rt2x00pci rt2x00lib atl1e
[20314.680898] Pid: 10069, comm: kworker/0:0 Tainted: GW3.8.0 #8
[20314.680910] Call Trace:
[20314.680934]  [] warn_slowpath_common+0x6d/0xa0
[20314.680960]  [] ? intel_modeset_check_state+0x47b/0x620
[20314.680983]  [] ? intel_modeset_check_state+0x47b/0x620
[20314.681006]  [] warn_slowpath_fmt+0x2e/0x30
[20314.681041]  [] intel_modeset_check_state+0x47b/0x620
[20314.681052]  [] intel_set_mode+0x701/0x990
[20314.681095]  [] intel_modeset_setup_hw_state+0x5d5/0x8e0
[20314.681122]  [] ? acpi_lid_open+0x28/0x40
[20314.681147]  [] intel_lid_notify+0x9b/0xc0
[20314.681170]  [] notifier_call_chain+0x45/0x60
[20314.681196]  [] __blocking_notifier_call_chain+0x3e/0x60
[20314.681221]  [] blocking_notifier_call_chain+0x1a/0x20
[20314.681246]  [] acpi_lid_send_state+0x78/0x9d
[20314.681270]  [] acpi_button_notify+0x30/0xa4
[20314.681295]  [] acpi_device_notify+0x12/0x15
[20314.681320]  [] acpi_ev_notify_dispatch+0x2e/0x45
[20314.681344]  [] acpi_os_execute_deferred+0x1b/0x26
[20314.681366]  [] process_one_work+0x110/0x380
[20314.681392]  [] ? apic_timer_interrupt+0x2d/0x34
[20314.681416]  [] ? acpi_os_wait_events_complete+0x19/0x19
[20314.681465]  [] worker_thread+0x119/0x340
[20314.681516]  [] ? manage_workers+0x260/0x260
[20314.681568]  [] kthread+0x8f/0xa0
[20314.681614]  [] ret_from_kernel_thread+0x1b/0x28
[20314.681660]  [] ? flush_kthread_work+0xc0/0xc0
[20314.681681] ---[ end trace 037b36714b28cbe0 ]---
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-04-09 Thread Tomas Melin
On Mon, 18 Mar 2013 09:32:51 +0100, Daniel Vetter wrote:

 On Sat, Mar 16, 2013 at 01:28:50PM +0100, Richard Cochran wrote:

 I have an Acer Aspire One netbook, and on it I get the following
 warning when closing and opening the lid. I think this warning first
 appeared in 3.7.

 Does this need fixing? If so, who can do it?

 Another pesky BIOS which changes the display state behind our back on lid
 closing! Should be duct-tapped over with

 commit 45e2b5f640b3766da3eda48f6c35f088155c06f3
 Author: Daniel Vetter daniel.vet...@ffwll.ch
 Date:   Fri Nov 23 18:16:34 2012 +0100

 drm/i915: force restore on lid open

 which is in 3.8.

I'm seeing the same problems on my eeepc using 3.8. Happens (most) of
the time when opening and closing the lid. Any ideas on how to fix
this?

-Tomas

[20314.679749] [drm:i9xx_crtc_mode_set] *ERROR* Couldn't find PLL
settings for mode!

[20314.679787] [ cut here ]
[20314.679819] WARNING: at drivers/gpu/drm/i915/intel_display.c:7864
intel_modeset_check_state+0x4ad/0x620()
[20314.679831] Hardware name: 901
[20314.679843] encoder's hw state doesn't match sw tracking (expected
1, found 0)
[20314.679853] Modules linked in: bridge ipv6 rfcomm fuse btusb
rt2800pci rt2800lib rt2x00pci rt2x00lib atl1e
[20314.679917] Pid: 10069, comm: kworker/0:0 Tainted: GW3.8.0 #8
[20314.679930] Call Trace:
[20314.679958]  [c1033d6d] warn_slowpath_common+0x6d/0xa0
[20314.679983]  [c136645d] ? intel_modeset_check_state+0x4ad/0x620
[20314.680006]  [c136645d] ? intel_modeset_check_state+0x4ad/0x620
[20314.680017]  [c1033e1e] warn_slowpath_fmt+0x2e/0x30
[20314.680017]  [c136645d] intel_modeset_check_state+0x4ad/0x620
[20314.680103]  [c1366d31] intel_set_mode+0x701/0x990
[20314.680170]  [c13695c5] intel_modeset_setup_hw_state+0x5d5/0x8e0
[20314.680215]  [c12e3798] ? acpi_lid_open+0x28/0x40
[20314.680236]  [c136b6db] intel_lid_notify+0x9b/0xc0
[20314.680258]  [c1731ad5] notifier_call_chain+0x45/0x60
[20314.680283]  [c1057f4e] __blocking_notifier_call_chain+0x3e/0x60
[20314.680306]  [c1057f8a] blocking_notifier_call_chain+0x1a/0x20
[20314.680329]  [c12e3839] acpi_lid_send_state+0x78/0x9d
[20314.680351]  [c12e38aa] acpi_button_notify+0x30/0xa4
[20314.680376]  [c12c435e] acpi_device_notify+0x12/0x15
[20314.680402]  [c12cf786] acpi_ev_notify_dispatch+0x2e/0x45
[20314.680424]  [c12c14cb] acpi_os_execute_deferred+0x1b/0x26
[20314.680449]  [c104c800] process_one_work+0x110/0x380
[20314.680475]  [c172ede9] ? apic_timer_interrupt+0x2d/0x34
[20314.680498]  [c12c14b0] ? acpi_os_wait_events_complete+0x19/0x19
[20314.680522]  [c104df89] worker_thread+0x119/0x340
[20314.680545]  [c104de70] ? manage_workers+0x260/0x260
[20314.680572]  [c10522af] kthread+0x8f/0xa0
[20314.680598]  [c1734fb7] ret_from_kernel_thread+0x1b/0x28
[20314.680622]  [c1052220] ? flush_kthread_work+0xc0/0xc0
[20314.680640] ---[ end trace 037b36714b28cbdf ]---
[20314.680661] [ cut here ]
[20314.680684] WARNING: at drivers/gpu/drm/i915/intel_display.c:7898
intel_modeset_check_state+0x47b/0x620()
[20314.680697] Hardware name: 901
[20314.680709] crtc's computed active state doesn't match tracked
active state (expected 1, found 0)
[20314.680719] Modules linked in: bridge ipv6 rfcomm fuse btusb
rt2800pci rt2800lib rt2x00pci rt2x00lib atl1e
[20314.680898] Pid: 10069, comm: kworker/0:0 Tainted: GW3.8.0 #8
[20314.680910] Call Trace:
[20314.680934]  [c1033d6d] warn_slowpath_common+0x6d/0xa0
[20314.680960]  [c136642b] ? intel_modeset_check_state+0x47b/0x620
[20314.680983]  [c136642b] ? intel_modeset_check_state+0x47b/0x620
[20314.681006]  [c1033e1e] warn_slowpath_fmt+0x2e/0x30
[20314.681041]  [c136642b] intel_modeset_check_state+0x47b/0x620
[20314.681052]  [c1366d31] intel_set_mode+0x701/0x990
[20314.681095]  [c13695c5] intel_modeset_setup_hw_state+0x5d5/0x8e0
[20314.681122]  [c12e3798] ? acpi_lid_open+0x28/0x40
[20314.681147]  [c136b6db] intel_lid_notify+0x9b/0xc0
[20314.681170]  [c1731ad5] notifier_call_chain+0x45/0x60
[20314.681196]  [c1057f4e] __blocking_notifier_call_chain+0x3e/0x60
[20314.681221]  [c1057f8a] blocking_notifier_call_chain+0x1a/0x20
[20314.681246]  [c12e3839] acpi_lid_send_state+0x78/0x9d
[20314.681270]  [c12e38aa] acpi_button_notify+0x30/0xa4
[20314.681295]  [c12c435e] acpi_device_notify+0x12/0x15
[20314.681320]  [c12cf786] acpi_ev_notify_dispatch+0x2e/0x45
[20314.681344]  [c12c14cb] acpi_os_execute_deferred+0x1b/0x26
[20314.681366]  [c104c800] process_one_work+0x110/0x380
[20314.681392]  [c172ede9] ? apic_timer_interrupt+0x2d/0x34
[20314.681416]  [c12c14b0] ? acpi_os_wait_events_complete+0x19/0x19
[20314.681465]  [c104df89] worker_thread+0x119/0x340
[20314.681516]  [c104de70] ? manage_workers+0x260/0x260
[20314.681568]  [c10522af] kthread+0x8f/0xa0
[20314.681614]  [c1734fb7] ret_from_kernel_thread+0x1b/0x28
[20314.681660]  [c1052220] ? flush_kthread_work+0xc0/0xc0
[20314.681681] ---[ end trace 037b36714b28cbe0 ]---
--
To unsubscribe from this list: send the line 

Re: Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-04-09 Thread Daniel Vetter
On Tue, Apr 09, 2013 at 02:54:34PM +0300, Tomas Melin wrote:
 On Mon, 18 Mar 2013 09:32:51 +0100, Daniel Vetter wrote:
 
  On Sat, Mar 16, 2013 at 01:28:50PM +0100, Richard Cochran wrote:
 
  I have an Acer Aspire One netbook, and on it I get the following
  warning when closing and opening the lid. I think this warning first
  appeared in 3.7.
 
  Does this need fixing? If so, who can do it?
 
  Another pesky BIOS which changes the display state behind our back on lid
  closing! Should be duct-tapped over with
 
  commit 45e2b5f640b3766da3eda48f6c35f088155c06f3
  Author: Daniel Vetter daniel.vet...@ffwll.ch
  Date:   Fri Nov 23 18:16:34 2012 +0100
 
  drm/i915: force restore on lid open
 
  which is in 3.8.
 
 I'm seeing the same problems on my eeepc using 3.8. Happens (most) of
 the time when opening and closing the lid. Any ideas on how to fix
 this?

This should be fixed with the above mentioned patch. The issue is that the
bios fumbles around with the output configuration behind our backs, so the
new paranoid modeset code in 3.7+ freaks out about the state mismatch
between sw and hw.

The patch above should detect this situation and undo any bios-induced
damage.
-Daniel

 
 -Tomas
 
 [20314.679749] [drm:i9xx_crtc_mode_set] *ERROR* Couldn't find PLL
 settings for mode!
 
 [20314.679787] [ cut here ]
 [20314.679819] WARNING: at drivers/gpu/drm/i915/intel_display.c:7864
 intel_modeset_check_state+0x4ad/0x620()
 [20314.679831] Hardware name: 901
 [20314.679843] encoder's hw state doesn't match sw tracking (expected
 1, found 0)
 [20314.679853] Modules linked in: bridge ipv6 rfcomm fuse btusb
 rt2800pci rt2800lib rt2x00pci rt2x00lib atl1e
 [20314.679917] Pid: 10069, comm: kworker/0:0 Tainted: GW3.8.0 #8
 [20314.679930] Call Trace:
 [20314.679958]  [c1033d6d] warn_slowpath_common+0x6d/0xa0
 [20314.679983]  [c136645d] ? intel_modeset_check_state+0x4ad/0x620
 [20314.680006]  [c136645d] ? intel_modeset_check_state+0x4ad/0x620
 [20314.680017]  [c1033e1e] warn_slowpath_fmt+0x2e/0x30
 [20314.680017]  [c136645d] intel_modeset_check_state+0x4ad/0x620
 [20314.680103]  [c1366d31] intel_set_mode+0x701/0x990
 [20314.680170]  [c13695c5] intel_modeset_setup_hw_state+0x5d5/0x8e0
 [20314.680215]  [c12e3798] ? acpi_lid_open+0x28/0x40
 [20314.680236]  [c136b6db] intel_lid_notify+0x9b/0xc0
 [20314.680258]  [c1731ad5] notifier_call_chain+0x45/0x60
 [20314.680283]  [c1057f4e] __blocking_notifier_call_chain+0x3e/0x60
 [20314.680306]  [c1057f8a] blocking_notifier_call_chain+0x1a/0x20
 [20314.680329]  [c12e3839] acpi_lid_send_state+0x78/0x9d
 [20314.680351]  [c12e38aa] acpi_button_notify+0x30/0xa4
 [20314.680376]  [c12c435e] acpi_device_notify+0x12/0x15
 [20314.680402]  [c12cf786] acpi_ev_notify_dispatch+0x2e/0x45
 [20314.680424]  [c12c14cb] acpi_os_execute_deferred+0x1b/0x26
 [20314.680449]  [c104c800] process_one_work+0x110/0x380
 [20314.680475]  [c172ede9] ? apic_timer_interrupt+0x2d/0x34
 [20314.680498]  [c12c14b0] ? acpi_os_wait_events_complete+0x19/0x19
 [20314.680522]  [c104df89] worker_thread+0x119/0x340
 [20314.680545]  [c104de70] ? manage_workers+0x260/0x260
 [20314.680572]  [c10522af] kthread+0x8f/0xa0
 [20314.680598]  [c1734fb7] ret_from_kernel_thread+0x1b/0x28
 [20314.680622]  [c1052220] ? flush_kthread_work+0xc0/0xc0
 [20314.680640] ---[ end trace 037b36714b28cbdf ]---
 [20314.680661] [ cut here ]
 [20314.680684] WARNING: at drivers/gpu/drm/i915/intel_display.c:7898
 intel_modeset_check_state+0x47b/0x620()
 [20314.680697] Hardware name: 901
 [20314.680709] crtc's computed active state doesn't match tracked
 active state (expected 1, found 0)
 [20314.680719] Modules linked in: bridge ipv6 rfcomm fuse btusb
 rt2800pci rt2800lib rt2x00pci rt2x00lib atl1e
 [20314.680898] Pid: 10069, comm: kworker/0:0 Tainted: GW3.8.0 #8
 [20314.680910] Call Trace:
 [20314.680934]  [c1033d6d] warn_slowpath_common+0x6d/0xa0
 [20314.680960]  [c136642b] ? intel_modeset_check_state+0x47b/0x620
 [20314.680983]  [c136642b] ? intel_modeset_check_state+0x47b/0x620
 [20314.681006]  [c1033e1e] warn_slowpath_fmt+0x2e/0x30
 [20314.681041]  [c136642b] intel_modeset_check_state+0x47b/0x620
 [20314.681052]  [c1366d31] intel_set_mode+0x701/0x990
 [20314.681095]  [c13695c5] intel_modeset_setup_hw_state+0x5d5/0x8e0
 [20314.681122]  [c12e3798] ? acpi_lid_open+0x28/0x40
 [20314.681147]  [c136b6db] intel_lid_notify+0x9b/0xc0
 [20314.681170]  [c1731ad5] notifier_call_chain+0x45/0x60
 [20314.681196]  [c1057f4e] __blocking_notifier_call_chain+0x3e/0x60
 [20314.681221]  [c1057f8a] blocking_notifier_call_chain+0x1a/0x20
 [20314.681246]  [c12e3839] acpi_lid_send_state+0x78/0x9d
 [20314.681270]  [c12e38aa] acpi_button_notify+0x30/0xa4
 [20314.681295]  [c12c435e] acpi_device_notify+0x12/0x15
 [20314.681320]  [c12cf786] acpi_ev_notify_dispatch+0x2e/0x45
 [20314.681344]  [c12c14cb] acpi_os_execute_deferred+0x1b/0x26
 [20314.681366]  [c104c800] process_one_work+0x110/0x380
 [20314.681392]  

Re: Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-04-09 Thread Richard Cochran
On Tue, Apr 09, 2013 at 02:50:03PM +0200, Daniel Vetter wrote:
 
 This should be fixed with the above mentioned patch. The issue is that the
 bios fumbles around with the output configuration behind our backs, so the
 new paranoid modeset code in 3.7+ freaks out about the state mismatch
 between sw and hw.
 
 The patch above should detect this situation and undo any bios-induced
 damage.

Even with the patch, I still am seeing the issue (in 3.8).

Thanks,
Richard
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-04-09 Thread Daniel Vetter
On Tue, Apr 09, 2013 at 03:21:35PM +0200, Richard Cochran wrote:
 On Tue, Apr 09, 2013 at 02:50:03PM +0200, Daniel Vetter wrote:
  
  This should be fixed with the above mentioned patch. The issue is that the
  bios fumbles around with the output configuration behind our backs, so the
  new paranoid modeset code in 3.7+ freaks out about the state mismatch
  between sw and hw.
  
  The patch above should detect this situation and undo any bios-induced
  damage.
 
 Even with the patch, I still am seeing the issue (in 3.8).

Indeed, there's still a bug there with the state checking. Can you please
test the below patch?

Thanks, Daniel

commit d206df2685801a832a728c7dca13428a6f5bf3ef
Author: Daniel Vetter daniel.vet...@ffwll.ch
Date:   Tue Apr 9 19:25:12 2013 +0200

drm/i915: don't check inconstent modeset state when force-restoring

It will be only consistent once we've restored all the crtcs. Since a
bunch of other callers also want to just restore a single crtc, add a
boolean to disable checking only where it doesn't make sense.

Note that intel_modeset_setup_hw_state already has a call to
intel_modeset_check_state at the end, so we don't reduce the amount of
checking.

References: https://lkml.org/lkml/2013/3/16/60
Cc: Tomas Melin tomas.me...@iki.fi
Cc: Richard Cochran richardcoch...@gmail.com
Cc: sta...@vger.kernel.org
Signed-off-by: Daniel Vetter daniel.vet...@ffwll.ch

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 8809813..1e29201 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7916,9 +7916,9 @@ intel_modeset_check_state(struct drm_device *dev)
}
 }
 
-int intel_set_mode(struct drm_crtc *crtc,
-  struct drm_display_mode *mode,
-  int x, int y, struct drm_framebuffer *fb)
+static int __intel_set_mode(struct drm_crtc *crtc,
+   struct drm_display_mode *mode,
+   int x, int y, struct drm_framebuffer *fb)
 {
struct drm_device *dev = crtc-dev;
drm_i915_private_t *dev_priv = dev-dev_private;
@@ -8012,8 +8012,6 @@ done:
if (ret  crtc-enabled) {
crtc-hwmode = *saved_hwmode;
crtc-mode = *saved_mode;
-   } else {
-   intel_modeset_check_state(dev);
}
 
 out:
@@ -8022,9 +8020,27 @@ out:
return ret;
 }
 
-void intel_crtc_restore_mode(struct drm_crtc *crtc)
+int intel_set_mode(struct drm_crtc *crtc,
+struct drm_display_mode *mode,
+int x, int y, struct drm_framebuffer *fb)
+{
+   int ret;
+
+   ret = __intel_set_mode(crtc, mode, x, y, fb);
+
+   if (ret == 0)
+   intel_modeset_check_state(crtc-dev);
+
+   return ret;
+}
+
+void intel_crtc_restore_mode(struct drm_crtc *crtc,
+bool check)
 {
-   intel_set_mode(crtc, crtc-mode, crtc-x, crtc-y, crtc-fb);
+   __intel_set_mode(crtc, crtc-mode, crtc-x, crtc-y, crtc-fb);
+
+   if (check)
+   intel_modeset_check_state(crtc-dev);
 }
 
 #undef for_each_intel_crtc_masked
@@ -9336,7 +9352,7 @@ setup_pipes:
for_each_pipe(pipe) {
struct drm_crtc *crtc =
dev_priv-pipe_to_crtc_mapping[pipe];
-   intel_crtc_restore_mode(crtc);
+   intel_crtc_restore_mode(crtc, false);
}
list_for_each_entry(plane, dev-mode_config.plane_list, head)
intel_plane_restore(plane);
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 173add1..99b9f09 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2466,7 +2466,7 @@ intel_dp_set_property(struct drm_connector *connector,
 
 done:
if (intel_encoder-base.crtc)
-   intel_crtc_restore_mode(intel_encoder-base.crtc);
+   intel_crtc_restore_mode(intel_encoder-base.crtc, true);
 
return 0;
 }
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index d7bd031..d7b1094 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -540,7 +540,7 @@ struct intel_set_config {
 extern int intel_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode,
  int x, int y, struct drm_framebuffer *old_fb);
 extern void intel_modeset_disable(struct drm_device *dev);
-extern void intel_crtc_restore_mode(struct drm_crtc *crtc);
+extern void intel_crtc_restore_mode(struct drm_crtc *crtc, bool check);
 extern void intel_crtc_load_lut(struct drm_crtc *crtc);
 extern void intel_crtc_update_dpms(struct drm_crtc *crtc);
 extern void intel_encoder_destroy(struct drm_encoder *encoder);
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c 
b/drivers/gpu/drm/i915/intel_hdmi.c
index ee4a8da..de07bd4 

Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-03-19 Thread Richard Cochran
On Mon, Mar 18, 2013 at 09:32:51AM +0100, Daniel Vetter wrote:
> 
> Another pesky BIOS which changes the display state behind our back on lid
> closing! Should be duct-tapped over with
> 
> commit 45e2b5f640b3766da3eda48f6c35f088155c06f3
> Author: Daniel Vetter 
> Date:   Fri Nov 23 18:16:34 2012 +0100
> 
> drm/i915: force restore on lid open
> 
> which is in 3.8.

But that warning was from a 3.8.3 kernel. Any other ideas?

Thanks,
Richard

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-03-19 Thread Richard Cochran
On Mon, Mar 18, 2013 at 09:32:51AM +0100, Daniel Vetter wrote:
 
 Another pesky BIOS which changes the display state behind our back on lid
 closing! Should be duct-tapped over with
 
 commit 45e2b5f640b3766da3eda48f6c35f088155c06f3
 Author: Daniel Vetter daniel.vet...@ffwll.ch
 Date:   Fri Nov 23 18:16:34 2012 +0100
 
 drm/i915: force restore on lid open
 
 which is in 3.8.

But that warning was from a 3.8.3 kernel. Any other ideas?

Thanks,
Richard

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-03-18 Thread Daniel Vetter
On Sat, Mar 16, 2013 at 01:28:50PM +0100, Richard Cochran wrote:
> 
> I have an Acer Aspire One netbook, and on it I get the following
> warning when closing and opening the lid. I think this warning first
> appeared in 3.7.
> 
> Does this need fixing? If so, who can do it?

Another pesky BIOS which changes the display state behind our back on lid
closing! Should be duct-tapped over with

commit 45e2b5f640b3766da3eda48f6c35f088155c06f3
Author: Daniel Vetter 
Date:   Fri Nov 23 18:16:34 2012 +0100

drm/i915: force restore on lid open

which is in 3.8.

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: drm/i915: new warning (regression) in 3.7.10 and 3.8.3

2013-03-18 Thread Daniel Vetter
On Sat, Mar 16, 2013 at 01:28:50PM +0100, Richard Cochran wrote:
 
 I have an Acer Aspire One netbook, and on it I get the following
 warning when closing and opening the lid. I think this warning first
 appeared in 3.7.
 
 Does this need fixing? If so, who can do it?

Another pesky BIOS which changes the display state behind our back on lid
closing! Should be duct-tapped over with

commit 45e2b5f640b3766da3eda48f6c35f088155c06f3
Author: Daniel Vetter daniel.vet...@ffwll.ch
Date:   Fri Nov 23 18:16:34 2012 +0100

drm/i915: force restore on lid open

which is in 3.8.

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/