Commit Graph

483340 Commits

Author SHA1 Message Date
Ben Skeggs 6aac6ced4e drm/nouveau: fix pin refcnt leak in failure path
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:44:00 +10:00
Alexandre Courbot b22870ba6a drm/nouveau: synchronize BOs when required
On architectures for which access to GPU memory is non-coherent,
caches need to be flushed and invalidated explicitly when BO control
changes between CPU and GPU.

This patch adds buffer synchronization functions which invokes the
correct API (PCI or DMA) to ensure synchronization is effective.

Based on the TTM DMA cache helper patches by Lucas Stach.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:44:00 +10:00
Alexandre Courbot a81349a7b2 drm/nouveau: allocate GPFIFOs and fences coherently
Specify TTM_PL_FLAG_UNCACHED when allocating GPFIFOs and fences to
allow them to be safely accessed by the kernel without being synced
on non-coherent architectures.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:59 +10:00
Alexandre Courbot c3a0c771e5 drm/nouveau: implement explicitly coherent BOs
Allow nouveau_bo_new() to recognize the TTM_PL_FLAG_UNCACHED flag, which
means that we want the allocated BO to be perfectly coherent between the
CPU and GPU. This is useful on non-coherent architectures for which we
do not want to manually sync some rarely-accessed buffers: typically,
fences and pushbuffers.

A TTM BO allocated with the TTM_PL_FLAG_UNCACHED on a non-coherent
architecture will be populated using the DMA API, and accesses to it
performed using the coherent mapping performed by dma_alloc_coherent().

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:59 +10:00
Alexandre Courbot c5d7ddf70a drm/nouveau: introduce nv_device_is_cpu_coherent()
Add a function allowing us to know whether a device is CPU-coherent,
i.e. accesses performed by the CPU on GPU-mapped buffers will
be immediately visible on the GPU side and vice-versa.

For now, a device is considered to be coherent if it uses the PCI bus on
a non-ARM architecture.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:59 +10:00
Alexandre Courbot 5be5a15a43 drm/nouveau: warn when moving a pinned object
Pinned BOs are supposed to remain in their current location until
unpinned. Display a warning for the supposedly-erroneous case where we
are trying to move such objects.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:58 +10:00
Ben Skeggs f9895e6dbe drm/nouveau/disp: clear notify intr status when enabling, to prevent races
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:58 +10:00
Ben Skeggs 2832271d64 drm/nv50-/disp: rename class members to match nvidia channel names
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:57 +10:00
Ben Skeggs 868e34f784 drm/nouveau/core: remove some dead code that got forgotten
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:57 +10:00
Roy Spliet f67a8ff533 drm/nouveau/pwr/fuc: Fix thinko in nouveau_memx_wait()
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:56 +10:00
Roy Spliet f10e55c9fc drm/nva3/clock: Allow user reclocking
Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:56 +10:00
Roy Spliet 598a39e79a drm/nouveau/fb/ramnva3: Reclocking script for GDDR3
Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:55 +10:00
Roy Spliet b0c7336b1a drm/nouveau/fb/ramnva3: Reclocking script for DDR2
Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:55 +10:00
Roy Spliet b6a7907f6b drm/nouveau/fb/ramnva3: Reclocking script for DDR3
Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:54 +10:00
Roy Spliet bf504b3fbb drm/nouveau/fb/ramnva3: Ressurect timing calculation code
Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:54 +10:00
Roy Spliet 7f4b961618 drm/nouveau/fb/ramnva3: Link training for DDR3
V2: fix whitespace errors in memx.fuc

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:54 +10:00
Roy Spliet f648cab0ad drm/nouveau/fb/gddr3: Generate MR values
Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:53 +10:00
Roy Spliet 13a757dbc7 drm/nouveau/bios/ramcfg: 10_02_40 -> DLLoff
Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:53 +10:00
Ben Skeggs 7bb6d4428d drm/nouveau: move the (far too many...) different s/r paths to the same place
No code changes.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:52 +10:00
Ben Skeggs 70b2cc8e9a drm/gk104-/fifo: handle copy engine class errors
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:52 +10:00
Ben Skeggs 9b4de93bc9 drm/nouveau/bios: stop after NV+NPDS+ISBN image
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:51 +10:00
Ben Skeggs 798dda5528 drm/nouveau/bios: add some more signatures as seen on my gtx660
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:51 +10:00
Ben Skeggs dbbd6bcfd4 drm/nouveau: add support for gm204
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:50 +10:00
Ben Skeggs 083dba0294 drm/nouveau/device: recognise GM204
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:50 +10:00
Ben Skeggs c21e6b302a drm/gm204/disp: some magic that fixes bringup of uninitialised outputs
Probably missing something here, doesn't make a lot of sense to write
or+link data into a register whose offset is calculated by the same
or+link info..

This is the all I've witnessed the binary driver and vbios doing so
far, so it'll do.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:49 +10:00
Ben Skeggs 1f89b4756f drm/gm204/disp: initial support
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:49 +10:00
Ben Skeggs e16cc45c7d drm/gf110-/disp: magic that might help some tmds issues
The binary driver has been doing this since GF119, and we've somehow
gotten away with it.  But, TMDS that hasn't been initialised already
by the x86 vbios code is distorted without it on GM204.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:49 +10:00
Ben Skeggs c79965d8fa drm/nouveau/bios: support for opcodes 0x47/0x48
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:48 +10:00
Ben Skeggs 17187c81a6 drm/nouveau/bios: add support for udisp 2.2
Not entirely sure why this got bumped at all yet.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:48 +10:00
Ben Skeggs f467dc1839 drm/nouveau/bios: add support for dp 4.1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:47 +10:00
Ben Skeggs 5620c01dfc drm/nouveau/i2c: add support for DCB_I2C_PMGR port type
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:47 +10:00
Ben Skeggs c5a09c8116 drm/nouveau/bios: add support for ccb 4.1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:46 +10:00
Ben Skeggs dae2043976 drm/nouveau/bios: add support for dcb 4.1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:46 +10:00
Ben Skeggs c908357786 drm/gm204/i2c: add aux channel driver
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:45 +10:00
Ben Skeggs f105aa3715 drm/gm204/i2c: add pad driver
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:45 +10:00
Ben Skeggs 5b34cebe99 drm/nouveau/i2c: segregate aux channel adapter indices from bit-banged i2c
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:45 +10:00
Ben Skeggs 309a5702c2 drm/nouveau/bios: store aux addr independently of i2c
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:44 +10:00
Ben Skeggs a7468451e3 drm/nv50-/i2c: kill some unused struct members
Left-over from before a rework a while back.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:44 +10:00
Ben Skeggs 6ef4ead1b2 drm/nouveau/bios: log if auxch accesses fail, also return 0x00 from rd when it does
Logging at trace level, rather than as en error, as it seems conceivable
that failure could be normal under certain circumstances (new bios,
older sink that doesn't support a particular DPCD address)

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:43 +10:00
Ben Skeggs ba6e34e612 drm/gm204/devinit: initial implementation
Starting from GM204, certain registers are no longer accessible by the host
(or unsigned PMU firmware).

This commit implements devinit on PMU, using a signed microcode image, and
devinit data, from the VBIOS.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:43 +10:00
Ben Skeggs e21fd7c4d3 drm/nouveau/devinit: allow impl to select its own cold-boot method
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:42 +10:00
Ben Skeggs 50e216d6e7 drm/nouveau/bios: add parsing of pmu image tables
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:42 +10:00
Ben Skeggs a1a86aabd0 drm/nouveau/bios: recognise nv-specific rom/pcir signatures
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:41 +10:00
Ben Skeggs 7205875d09 drm/nouveau/bios: use NPDE to locate images beyond those defined by PCIR
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:41 +10:00
Ben Skeggs b71a1344ec drm/nouveau/bios: add NPDE parsing
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:40 +10:00
Ben Skeggs c2c2f6cb79 drm/nouveau/bios: fetch images beyond the first one in the rom
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:40 +10:00
Ben Skeggs 7af4dec166 drm/nouveau/bios: use size/type from pci data structure
The field at +0x2 is technically processor specific, though I don't know
that it's ever mattered in practice (yet).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:40 +10:00
Ben Skeggs 8d85e06b5e drm/nouveau/bios: add pci data structure parsing
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:39 +10:00
Ben Skeggs ad4a362635 drm/nouveau/bios: split out shadow methods
We're about to need to be able to fetch additional chunks of data beyond
the primary bios image, which makes fetching a lot more complicated.

This splits out the verious shadowing routines to be nothing more than
very dumb "fetch this much data from this offset" routines, and leaves
the logic of what and how much to fetch in common code.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:39 +10:00
Ben Skeggs e897242162 drm/nouveau/bios: fix thinko when parsing extdev table
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02 15:43:38 +10:00