All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Pierre Moreau <pierre.morrow@free.fr>
Cc: nouveau@lists.freedesktop.org, bskeggs@redhat.com,
	dri-devel@lists.freedesktop.org
Subject: Re: [Nouveau] [PATCH v2 8/9] acpi: Add support for Apple Gmux _DMS
Date: Sat, 30 May 2015 20:23:46 +0200	[thread overview]
Message-ID: <20150530182346.GA3625@wunner.de> (raw)
In-Reply-To: <1121819706.18409644.1432803176893.JavaMail.root@spooler8-g27.priv.proxad.net>

Hi Pierre,

On Thu, May 28, 2015 at 10:52:56AM +0200, Pierre Moreau wrote:
> How is it supposed to work, by simply echo'ing ON or OFF to
> vga_switcheroo/switch? Then I probably forgot some stuff as
> it doesn't want to work on my laptop.

What exactly doesn't work and which version of the MacBook Pro did
you try this on? The expected behaviour when switching GPUs on the
MBP is that the GPU that was inactive on bootup will only show a
black screen because it was unable to read the EDID (and DPCD on
retina MBPs) on bootup. In other words, it's broken.

There have been attempts to solve this by multiple folks, the last
one was submitted to dri-devel in April by yours truly:
http://lists.freedesktop.org/archives/dri-devel/2015-April/081515.html

That initial version of my patch set turned out to only work on
pre-retina MBPs, and only if the active GPU on bootup is the
discrete one. I'm currently working on a v2 to solve all that.

We need to get switching working before we can enable runtime PM on
MBPs, otherwise the user will be greeted by a black screen when the
Nvidia GPU goes to sleep and hands over to the integrated GPU.
So your patch is a bit premature I'm afraid. :-(


As to the patch itself, you're checking for existence of the gmux
but we can't make use of it unless its driver is loaded. Hence it
may be easier to simply query for the existence of the driver,
using something along the lines of find_module("apple-gmux").
I imagine this is much less code than checking for the DMI IDs.

Also, Dave Airlie and Matthew Garrett already wrote a patch set to
enable runtime PM for nouveau on MBPs which is more generic: It works
with any vga_switcheroo handler, not just gmux:

http://lists.freedesktop.org/archives/dri-devel/2014-June/060927.html
http://lists.freedesktop.org/archives/dri-devel/2014-June/060928.html
http://lists.freedesktop.org/archives/dri-devel/2014-June/060942.html
http://www.codon.org.uk/~mjg59/tmp/retina_patches/0027-nouveau-enable-runtime-pm-on-apple-gmux-machines.patch
http://www.codon.org.uk/~mjg59/tmp/retina_patches/0028-nouveau-Enable-switcheroo-dynamic-PM-at-switcheroo-e.patch

The fourth one in that list is by Dave Airlie and all the others are
by Matthew Garrett. But, as I said, we can't apply these either until
switching works. I'm working on it. ;-)


As to your questions:

> How is it supposed to work, by simply echo'ing ON or OFF to
> vga_switcheroo/switch?

Echoing ON/OFF to the "switch" file will power the inactive device
up or down. If the currently active gpu is the discrete one (which
is the default when booting a MacBook Pro), this will power up/down
the integrated gpu. You can use the tool "gpu-switch" to force the
MBP to the integrated GPU on next bootup, then you can echo ON/OFF
to change the power state of the Nvidia GPU:
https://github.com/0xbb/gpu-switch

> If I understand it correctly, if the laptop is an Optimus one or
> has a mux, we are not "allowed" to opt-out of DynPwr/DynOff by
> powering down the card?

If we power the GPU down manually by echoing OFF to the "switch"
file, the runtime PM code would probably get confused, I imagine
that's the reason why ON/OFF is ignored if client->driver_power_control
is set to true.

Speaking of which, the external ports of the MBP are soldered to
the discrete GPU and can't be switched. Only the panel can be
switched. So if there are DP or HDMI connectors with status
connected, we can't suspend. That's one of the MBP's numerous
peculiarities that I haven't verified yet they're handled properly
by the code.

Best regards,

Lukas
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-05-30 18:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28  6:40 [PATCH v2 1/9] acpi: Rename v1 DSM to mux to avoid ambiguity Pierre Moreau
     [not found] ` <1432795249-4458-1-git-send-email-pierre.morrow-GANU6spQydw@public.gmane.org>
2015-05-28  6:40   ` [PATCH v2 2/9] acpi: Add evaluate to name of functions evaluating _DSM Pierre Moreau
2015-05-28  6:40   ` [PATCH 3/9] acpi: Define static variables for revision ids Pierre Moreau
2015-05-28  6:40   ` [PATCH v2 4/9] acpi: Allow evaluate_optimus_dsm to take NULL results Pierre Moreau
2015-05-28  6:40   ` [PATCH NEW 5/9] acpi: Use a single type of errors in evaluate functions Pierre Moreau
2015-05-28  6:42     ` [Nouveau] " Pierre Moreau
2015-05-28  6:40   ` [PATCH v2 6/9] acpi: Check returned object type by Optimus _DSM locally Pierre Moreau
     [not found]     ` <1432795249-4458-6-git-send-email-pierre.morrow-GANU6spQydw@public.gmane.org>
2015-05-29  1:17       ` Dave Airlie
2015-05-28  6:40   ` [PATCH 7/9] acpi: Improve some messages level and content Pierre Moreau
2015-05-28  6:40   ` [PATCH v2 8/9] acpi: Add support for Apple Gmux _DMS Pierre Moreau
     [not found]     ` <1432795249-4458-8-git-send-email-pierre.morrow-GANU6spQydw@public.gmane.org>
2015-05-28  8:52       ` Pierre Moreau
     [not found]         ` <1121819706.18409644.1432803176893.JavaMail.root-x5ewXQG5twBsFmKuirFwRhh1pbbyJDp15NbjCUgZEJk@public.gmane.org>
2015-05-29  1:20           ` Dave Airlie
2015-05-30 18:23         ` Lukas Wunner [this message]
2015-05-30 21:21           ` [Nouveau] " Pierre Moreau
2015-05-29  1:22     ` Ben Skeggs
2015-05-28  6:40   ` [PATCH v2 9/9] acpi: Move detecting available _DSM outside of while loops Pierre Moreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150530182346.GA3625@wunner.de \
    --to=lukas@wunner.de \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=pierre.morrow@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.