[Pm-utils] [PATCH 1/1] Handle kernel modesetting correctly.
Victor Lowther
victor.lowther at gmail.com
Thu Apr 2 19:50:59 PDT 2009
On Tue, 2009-03-24 at 09:23 -0700, Dan Nicholson wrote:
> On Mon, Mar 23, 2009 at 7:42 PM, Victor Lowther
> <victor.lowther at gmail.com> wrote:
> > Now that KMS is finally going to be included in mainstream, we need to handle
> > it. This patch does so by folding 90chvt into 99video, checking to see if we
> > are using a KMS capable framebuffer, and if so removing all HAL-passed video
> > quirks and adding a quirk that allows 99video to skip changing to vt63.
> >
> > My testing with the nvidia driver indicates that it does something vaguely
> > approximating the Right Thing with vt handling, so it gets to ignore
> > chvt handling in 99video too.
> >
> > Comments?
>
> Seems pretty good. I cc'd Kristian since I know he has an intel kms
> setup and can maybe see if this does the right thing.
Any luck with the testing?
> Couple comments below.
>
> > diff --git a/pm/sleep.d/98smart-kernel-video b/pm/sleep.d/98smart-kernel-video
> > index 1043e94..997dc3e 100755
> > --- a/pm/sleep.d/98smart-kernel-video
> > +++ b/pm/sleep.d/98smart-kernel-video
> > @@ -31,6 +31,7 @@ smart_kernel_nvidia()
> > --quirk-radeon-off \
> > --quirk-no-fb \
> > --quirk-pci-save
> > + add_parameters --quirk-no-chvt
> > }
>
> Nitpick, but I'd like this to be in a separate commit since it deals
> with nvidia rather than kms. Or maybe smart_kernel_modesetting could
> be a separate commit from the chvt stuff.
>
> > +smart_kernel_modesetting() {
> > + [ -d /sys/class/drm/card0/device/graphics/fb0 ] || return 1
>
> At some point we'll probably have to think about dealing with systems
> that have multiple cards and/or different drivers with/without kms.
> But that can be punted on for now.
And it will be -- we don't handle dual video cards right now anyways. :)
> > + remove_parameters --quirk-dpms-on \
> > + --quirk-dpms-suspend \
> > + --quirk-s3-mode \
> > + --quirk-s3-bios \
> > + --quirk-vbe-post \
> > + --quirk-vbe-post \
> > + --quirk-vga-mode3 \
> > + --quirk-vbemode-restore \
> > + --quirk-vbestate-restore \
> > + --quirk-reset-brightness \
> > + --quirk-radeon-off \
> > + --quirk-no-fb \
> > + --quirk-pci-save
> > + add_parameters --quirk-no-chvt
> > +}
> > +
> > smart_kernel_video()
> > {
> > - smart_kernel_nvidia || smart_kernel_fglrx || smart_kernel_intel || \
> > - return $NA
> > + smart_kernel_modesetting || smart_kernel_nvidia || \
> > + smart_kernel_fglrx || smart_kernel_intel || return $NA
> > }
> >
> > case $1 in
> > diff --git a/pm/sleep.d/99video b/pm/sleep.d/99video
> > index 1fe54c2..01da7c7 100755
> > --- a/pm/sleep.d/99video
> > +++ b/pm/sleep.d/99video
> > @@ -28,6 +28,7 @@ for opt in $PM_CMDLINE; do
> > vga-mode3) QUIRK_VGA_MODE_3="true" ;;
> > no-fb) QUIRK_NOFB="true" ;;
> > pci-save) QUIRK_PCI_SAVE="true" ;;
> > + no-chvt) QUIRK_NO_CHVT="true" ;;
> > none) QUIRK_NONE="true" ;;
> > *) continue ;;
> > esac
> > @@ -63,6 +64,17 @@ die_if_framebuffer()
> > exit 1
> > }
> >
> > +maybe_to_vt63() {
> > + [ "$QUIRK_NO_CHVT" = "true" ] && return
> > + fgconsole |savestate console
> > + chvt 63
> > +}
> > +
> > +maybe_from_vt63() {
> > + state_exists console || return
> > + chvt $(restorestate console)
> > + deallocvt 63
> > +}
>
> Maybe these should be maybe_chvt/maybe_deallocvt? to/from_vt63 doesn't
> jump out to me as to what's going on. Not a big deal, though.
>
> Rest looks good. Thanks, Victor.
>
> --
> Dan
--
Victor Lowther
RHCE# 805008539634727
LPIC-2# LPI000140019
More information about the Pm-utils
mailing list