Commit Graph

277000 Commits

Author SHA1 Message Date
Ben Skeggs f553b79c03 drm/nouveau/i2c: handle bit-banging ourselves
i2c-algo-bit doesn't actually work very well on one card I have access to
(NVS 300), random single-bit errors occur most of the time - what we're
doing now is closer to what xf86i2c.c does.

The original plan was to figure out why i2c-algo-bit fails on the NVS 300,
and fix it.  However, while investigating I discovered i2c-algo-bit calls
cond_resched(), which makes it a bad idea for us to be using as we execute
VBIOS scripts from a tasklet, and there may very well be i2c transfers as
a result.

So, since I already wrote this code in userspace to track down the NVS 300
bug, and it's not really much code - lets use it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:41 +10:00
Ben Skeggs 9e3b6b9907 drm/nouveau/i2c: fix debug message
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:40 +10:00
Ben Skeggs 2bdb06e3cf drm/nouveau/i2c: tidy up bit-bang helpers, also fixing nv50 setsda bug
Was using nv_mask, which is bad.  Reading the reg senses the current line
states, which aren't necessarily the states we're trying to drive the
lines to.

Fixed to store SCL driver state just as we already do for SDA.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:40 +10:00
Ben Skeggs 486a45c2a6 drm/nouveau/i2c: do parsing of i2c-related vbios info in nouveau_i2c.c
Not much point parsing the vbios data into a struct which is only used once
to parse the data into another struct, go directly from vbios to
nouveau_i2c_chan.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:40 +10:00
Ben Skeggs 6b5a81a2e7 drm/nouveau/bios: start refactoring dcb routines
This primary reason for this was mostly to avoid duplication of some of
this stuff by the MXM-SIS parser.  However, some other cleanups will also
follow this as a result.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:39 +10:00
Ben Skeggs 0f8067c705 drm/nouveau/bios: fold fixup_legacy_i2c
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:39 +10:00
Ben Skeggs f9f9f53631 drm/nouveau/bios: pass drm_device to ROMPTR, rather than nvbios
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:39 +10:00
Ben Skeggs 816af2f2d6 drm/nvd0/disp: use single, shared, sync bo for all evo channels
This simplifies some things, and hopefully won't come back to bite me.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:38 +10:00
Ben Skeggs a63a97eb66 drm/nvd0/disp: rename sync channel to flip channel
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:38 +10:00
Ben Skeggs 84e052e626 drm/nvd0/disp: handle yet another interrupt
Spotted while messing with overlay channels (probably as a result of
sending a similar "disable" sequence as we do for the flip channels).

The value in 0x61008c was 0x20, which one would reasonably guess is
"bit 5 == something to report about evo channel 5" - but who knows.

Spotted the binary driver getting this too, and it appears to not do
anything exciting as a result.  So, handle it the same way and avoid
an IRQ storm.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:37 +10:00
Ben Skeggs 8a46438a6a drm/nvd0/disp: initialise overlay channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:37 +10:00
Ben Skeggs 3376ee374d drm/nvd0/disp: add support for page flipping
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:37 +10:00
Ben Skeggs 4acd429398 drm/nvd0/disp: make it clearer that the cursor regs are pio evo channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:36 +10:00
Ben Skeggs 2eac77b793 drm/nvd0/disp: have evo names now, use them
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:36 +10:00
Ben Skeggs bdb8c212be drm/nvd0/disp: init display sync channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:36 +10:00
Ben Skeggs 9285462273 drm/nvd0/disp: scaler updates, overscan compensation etc
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:35 +10:00
Ben Skeggs 2d1d898b46 drm/nvd0/disp: update crtc timing calculations for interlace/doublescan
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:35 +10:00
Ben Skeggs f62b27db6b drm/nouveau: shutdown display on suspend/hibernate
Known to fix some serious issues with hibernate on a couple of systems.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:35 +10:00
Ben Skeggs 1772fcc6f8 drm/nv50/disp: fix evo for create/init + destroy/fini split
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:34 +10:00
Ben Skeggs cf41d53bf5 drm/nouveau: re-jig fbcon suspend/resume process a little
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:34 +10:00
Ben Skeggs 2a44e4997c drm/nouveau/disp: introduce proper init/fini, separate from create/destroy
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:33 +10:00
Ben Skeggs d2edab4acf drm/nouveau/pm: fix missing volt changes when boot voltage is undefined
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:33 +10:00
Martin Peres d4676461a7 drm/nv50/pm: fix a typo in clock calculation
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:33 +10:00
Ben Skeggs 091e40cd95 drm/nvd0/disp: enable hdmi audio
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:32 +10:00
Ben Skeggs 27517ddbdc drm/nvd0/disp: hook evo up to debugging
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:32 +10:00
Ben Skeggs 64d9cc04ec drm/nvd0/disp: enable hdmi on sor if hdmi monitor present
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:32 +10:00
Ben Skeggs 78951d2226 drm/nvd0/disp: send eld to the audio codec
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:31 +10:00
Ben Skeggs 50a01fe06e drm/nouveau/hdmi: enable audio for nva3:nvd0 chipsets
Pre-nva3 will likely require far more extensive setup, and nvd9 needs to
be checked to find its SOR_HDMI/SOR_AUDIO blocks.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:31 +10:00
Marcin Slusarz 9e7f96aa3a drm/nv50: fix page faulting for 128MB page table sizes
This seems to be a typo...

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:31 +10:00
Marcin Slusarz 13f90122e8 drm/nouveau: print correct engine number which failed to unload/idle
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:30 +10:00
Ben Skeggs 0f0f7be8bd drm/nva3/copy: fix typo in fuc which caused host to not recieve exceptions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:30 +10:00
Ben Skeggs 971fa6b46d drm/nva3/copy: update fuc source for latest envytools
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:30 +10:00
Ben Skeggs d2491567cd drm/nv50/pm: only touch 0x611200 on nv92-
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:29 +10:00
Ben Skeggs 8b5f4d0def drm/nv50/pm: stabilise transition to 100MHz mclk a bit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:29 +10:00
Ben Skeggs 973e861657 drm/nv50/pm: avoid touching dom6/vdec clocks if perflvl doesn't define it
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:28 +10:00
Ben Skeggs 463464eb9b drm/nv50/pm: fix thinko which lead to clocks being slightly off sometimes
read_pll_ref() needs to take into account the refclk src bits in 0xc040 on
some chipsets, it wasn't doing this.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:27 +10:00
Ben Skeggs 6805979fa9 drm/nv50/pm: 0x84/0x86 can't use "1" for nvclk src, need 0x50 method
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:27 +10:00
Ben Skeggs 06784090ec drm/nvc0/gr: add initial support for nvd9, not quite there yet..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:27 +10:00
Ben Skeggs be7f2615d7 drm/nvc0/gr: update fuc source to assemble with latest envyas
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:26 +10:00
Ben Skeggs 020c6bf394 drm/nv50/disp: stricter check for evo being active on init
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Tested-by: Martin Peres <martin.peres@labri.fr>
2011-12-21 19:01:26 +10:00
Ben Skeggs 19fa224f8a drm/nv50/pm: free state struct after setting clocks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:26 +10:00
Ben Skeggs 0b627a0b23 drm/nouveau/pm: change volt/fan before upclock, but after downclock
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:25 +10:00
Ben Skeggs ff2b6c6e58 drm/nouveau/pm: remove the older interfaces completely
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:25 +10:00
Ben Skeggs 36f1317ed0 drm/nv04-nv30/pm: port to newer interfaces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:24 +10:00
Ben Skeggs f3fbaf34e2 drm/nv50/pm: rewrite clock management, and switch to the new pm hooks
This area is horrifically complicated on these chipsets, and it's likely we
will need at least a few more tweaks yet.

Oh yes, and it's completely disabled on IGPs for the moment.  From traces,
things look potentially different there yet again.  Sigh...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:24 +10:00
Martin Peres d4cca9e1fc drm/nv50/pm: s/PLL_UNK05/PLL_VDEC/
Following to "drm/nv50/pm: s/unk05/vdec/", let's rename the PLL to PLL_VDEC

PLL names are purely indicative and are based on the most important engine
it clocks.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:24 +10:00
Martin Peres dd1da8de17 drm/nouveau/pm: make clocks_set return an error code clocks_set can fail.
Reporting an error is better than silently refusing to reclock.

V2: Use the same logic on nv40

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:23 +10:00
Martin Peres 6109183794 drm/nvd0: read temperature as we did on nv84+ boards
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:23 +10:00
Ben Skeggs 1cb9469ee7 drm/nv50/disp: fix scaling of doublescan modes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:23 +10:00
Ben Skeggs 616a5f57b6 drm/nv50/disp: rewrite crtc timing calculation, with proper names and fixes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:22 +10:00