]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: fix OOPS in lid_notify
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 17 Sep 2012 20:27:21 +0000 (22:27 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 17 Sep 2012 22:59:37 +0000 (00:59 +0200)
commit5f6a9c700a5a0b0c0f72ff55721ab6bde7feb3a3
treee78b09a61a7cf3c578df601f68f61ebd74dae76c
parent3ee15b20093eb3ce6a1f5f2f944c74033982d943
drm/i915: fix OOPS in lid_notify

This goes back to

commit b67e986c0dc3f4e812ad1b326be338aa25ac2119
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Thu Sep 10 15:28:03 2009 -0700

    drm/i915: force mode set at lid open time

It was used to fix an issue on a i915GM based Thinkpad X41, which
somehow clobbered the modeset state at lid close time. Since then
massive amounts of things changed: Tons of fixes to the modeset
sequence, OpRegion support, better integration with the acpi code.
Especially OpRegion /should/ allow us to control the display hw
cooperatively with the firmware, without the firmware clobbering the
hw state behind our backs.

So it's dubious whether we still need this.

The second issue is that it's unclear who's responsibility it actually
is to restore the mode - Chris Wilson suggests to just emit a hotplug
event and let userspace figure things out.

The real reason I've stumbled over this is that the new modeset code
breaks drm_helper_resume_force_mode - it OOPSes derefing a NULL vfunc
pointer. The reason this wasn't caught in testing earlier is that in

commit 0b8c4478828c4e364db97a22c2cdc702f5fcb85f
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Mon Nov 2 09:29:55 2009 -0800

    i915: fix intel graphics suspend breakage due to resume/lid event
    confusion

logic was added to _not_ restore the modeset state after a resume. And
since most machines are configured to auto-suspend on lid-close, this
neatly papered over the issue.

Summarizing, this shouldn't be required on any platform supporting
OpRegion. And none of the really old machines I have here seem to
require it either. Hence I'm inclined to just rip it out.

But in case that there are really firmwares out there that clobber the
hw state, replace it with a call to intel_modset_check_state. This
will ensure that we catch any issues as soon as they happen.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_lvds.c