fb/ram/gk104: bash mpll bit 31 on

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
fb: Prevent inlining of ramfuc_reg

When gcc 4.8 inlines this function, it eats up 16 bytes on the stack
every time. Eventually we hit warnings because our stack grew too
much:

ramnve0.c:1383:1: error: the frame size of 1496 bytes is larger than
1024 bytes

We fix this by preventing inlining for this function.

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
kms/nv50-: pass a non-zero value for head to sor dpms methods

There's Apple machines out there which (probably completely arbitrarily)
restrict each output path to a particular head.  This causes us to not
be able to locate the output data needed to power on/off the DP output
correctly.

We fix this by passing in a head index we know is valid (as opposed to
"head 0").

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
kms: restore fbcon after display has been resumed

Under some complicated circumstances (boot, suspend, resume, attach
second display, suspend, resume, suspend, detach second display,
resume, suspend, attach second display, resume), the fb_set_suspend()
call can somehow result in a modeset being attempted before we're
ready for it and things blow up in fun ways.

Running display init first fixes the issue.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
disp/dp: fix required link bandwidth calculations

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
disp/dp: workaround broken display

The display in fdo#76483 pulses the hotplug line for link retraining
after we cut power to the main link on the source, even while it's
in D3.

fdo#76483

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
fb/ram/fuc: fix test for gpio presence

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drm-next 62eb3e20f8f3ca9de4a17f87effe534d6a691176
therm: fix a potential deadlock in the therm monitoring code

Signed-off-by: Martin Peres <martin.peres@free.fr>
Tested-by: Stefan Ringel <mail@stefanringel.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Merge branch 'linux-3.16' into linux-3.17
drm-next 43e09b3beb37d69f2c1cb3c88bff9eedd306d7aa
pwr: tidy

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
pwr/gk104: implement PGOB disable method

As documented at:

ftp://download.nvidia.com/open-gpu-doc/gk104-disable-graphics-power-gating/1/gk104-disable-graphics-power-gating.txt

NVIDIA were not able document the steps necessary to detect whether this
is required or not at this time.  However, they did confirm that this
procedure is safe to perform unconditionally on GK104/6.  GK107 does not
have the power gating feature, and it was recommended that we do not
perform these steps there as the effects were not verified.

The disable path is from observing the binary driver, and not
documented in the link above.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
gr/gk104: disable PGOB at init time

This removes the previous hack that worked on some boards.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
gr/gk110b: initvals differ from gk110

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
gr/gk208-: stop touching 0x260 inappropriately

As a side note.. It's a bit hard to figure out how to name this commit..
GK20A is NVEA, which is before NV108 (GK208).. Confusing.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
device: register for acpi events

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
clk: schedule pstate changes through a workqueue

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
clk: allow selection of different power state for ac vs battery

v2:
- s/init/fini/ typo, reported by Alex

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drm: expose pstate selection per-power source in sysfs

echo ac:id >> pstate # select mode when on mains power
echo dc:id >> pstate # select mode when on battery
echo id >> pstate # select mode for both

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>