ltc/gf100-: fix cbc issues on certain boards

A mismatch between FB and LTC's idea of how big a large page is causes
issues such as black "holes" in rendering to occur on some boards
(those where LTC is configured for 64KiB large pages) when compression
is used.

Confirmed to fix at least the GK107 MBP.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
v3.17-rc7
disp/nv50: fix dpms regression on certain boards

Reported in fdo#82527 comment #2.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drm: fix regression on original nv50 board

Xorg (and any non-DRM client really) doesn't have permission to directly
touch VRAM on nv50 and up, which the fence code prior to g84 depends on.

It's less invasive to temporarily grant it premission to do so, as it
previously did, than it is to rework fencenv50 to use the VM.  That
will come later on.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drm: punt fbcon resume out to a workqueue

Preparation for some runtime pm fixes.  Currently we skip over fbcon
suspend/resume in the runtime path, which causes issues on resume if
fbcon tries to write to the framebuffer before the BAR subdev has
been resumed to restore the BAR1 VM setup.

As we might be woken up via a sysfs connector, we are unable to call
fb_set_suspend() in the resume path as it could make its way down to
a modeset and cause all sorts of locking hilarity.

To solve this, we'll just delay the fbcon resume to a workqueue.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drm: make sure display hardware is reinitialised on runtime resume

Linus commit 05c63c2ff23a80b654d6c088ac3ba21628db0173 modified the
runtime suspend/resume paths to skip over display-related tasks to
avoid locking issues on resume.

Unfortunately, this resulted in the display hardware being left in
a partially initialised state, preventing subsequent modesets from
completing.

This commit unifies the (many) suspend/resume paths, bringing back
display (and fbcon) handling in the runtime paths.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drm-next 98faa78ce7f1f986e11e7805d31b409782a6d2d4

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
bar: ioremap only the areas that we're actually using

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core: pass related object into notify constructor

The event source types/index might need to be derived from it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
disp/nv50-: add support for completion events

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ltc: drop workaround for an interrupt storm that no longer happens

This is really the wrong thing to do, but at the time it was our only
option to prevent worse issues.

We no longer cause quite so much anger from LTC, so it's not needed.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ltc/gf100: translate interrupt status into more meaningful names

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core/mm: make it clearer what (type == 0) means

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core/mm: modify test for if building a mm with holes in it

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core/mm: dump mm when trying to tear one down that still has allocations

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core/mm: fill in holes with "allocated" nodes

The allocation algorithm doesn't expect there to be holes in the mm, which
causes its alignment/cutoff calculations to choke (and go negative) when
encountering the last chunk of a block before a hole.

The least expensive solution is to simply fill in any holes with nodes
that are pre-marked as being allocated.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core/mm: allow allocation to be confined to a specific slice of heap

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ltc: allocate tagram from memory that spans all partitions

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
bios/fan: add support for maxwell's fan management table v2

Re-use the therm-exported fan structure with only two minor modifications:
- pwm_freq: u16 -> u32;
- add fan_type (toggle or PWM)

v2:
- Do not memset the table to 0 as it erases the pre-set default values

Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
therm/fan: do not use the pwm mode when the vbios tells us to use toggle

Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>