drm-next 62eb3e20f8f3ca9de4a17f87effe534d6a691176
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>
kms: take more care when pulling down accelerated fbcon

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
kms: restore acceleration before fb_set_suspend() resumes

This *should* be safe these days.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drm: pull in some missing bits from kernel tree

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drm: support for probing platform devices

Add a platform driver for Nouveau devices declared using the device tree
or platform data. This driver currently supports GK20A on Tegra
platforms and is only compiled for these platforms if Nouveau is
enabled.

Nouveau will probe the chip type itself using the BOOT0 register, so all
this driver really needs to do is to make sure the module is powered and
its clocks active before calling nouveau_drm_platform_probe().

Heavily based on work done by Thierry Reding.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
bar: add noncached ioremap property

Some BARs (like GK20A's) do not support being ioremapped write-combined.
Add a boolean property to the BAR structure and handle that case in the
Nouveau BO implementation.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
drm/gk20a: add BAR instance

GK20A's BAR is functionally identical to NVC0's, but do not support
being ioremapped write-combined. Create a BAR instance for GK20A that
reflect that state.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
graph/nve4: do not crash if no power device present

Detect and workaround the absence of a power device so chips that do not
feature one (e.g. GK20A) can still use this driver.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
pwr/macros: Stop playing Russian roulette on data memory

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>