Commit Graph

22 Commits (3a2fd4a14112452eb5c1a079ac8b3f4842762afe)

Author SHA1 Message Date
Ben Skeggs 9962cc6eba drm/nouveau/gr: disable fifo access and idle before suspend ctx unload
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-07-25 09:43:38 +10:00
Ben Skeggs 6c320fef58 drm/nouveau: pass flag to engine fini() method on suspend
It may not be necessary to fail in certain cases (such as failing to idle)
on module unload, whereas on suspend it's important to ensure a consistent
state can be restored on resume.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-07-25 09:43:22 +10:00
Ben Skeggs 70ad25ab73 drm/nouveau: replace nv04_graph_fifo_access() use with direct reg bashing
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-07-25 09:42:27 +10:00
Ben Skeggs 4976986bd4 drm/nv04/gr: move to exec engine interfaces
Like nv10-nv50, needs cleanup.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-05-16 10:48:27 +10:00
Ben Skeggs 4ea52f8974 drm/nouveau: move engine object creation into per-engine hooks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-05-16 10:47:52 +10:00
Emil Velikov f9ec8f6c8d drm/nouveau: Fix brace placement checkpatch.pl errors.
Fix 'ERROR: that open brace { should be on the previous line'
Fix 'ERROR: else should follow close brace }'

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2011-05-16 10:47:19 +10:00
Emil Velikov f212949ced drm/nouveau: Clean up trailing whitespace and C99-style comments.
Fix 'ERROR: trailing whitespace',
Fix 'ERROR: do not use C99 // comments'

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2011-05-16 10:47:17 +10:00
Francisco Jerez 38cf189fa1 drm/nv04-nv10: Don't re-enable FIFO access multiple times after IRQ dispatch.
nvxx_graph_isr is already taking care of it. In some cases this
could've made you miss PGRAPH interrupts (e.g. when you were supposed
to get several IRQs of the same kind in a row).

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08 03:00:20 +01:00
Ben Skeggs 274fec93cd drm/nouveau: tidy+move PGRAPH ISRs to their respective *_graph.c files
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-03 15:11:41 +10:00
Francisco Jerez 332b242f47 drm/nouveau: Implement the pageflip ioctl.
nv0x-nv4x should be mostly fine, nv50 doesn't work yet.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-03 15:11:12 +10:00
Ben Skeggs b8c157d3a9 drm/nouveau: only expose the object classes that are supported by the chipset
We previously added all the available classes for the entire generation,
even though the objects wouldn't work on the hardware.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-03 15:06:56 +10:00
Ben Skeggs 50536946fa drm/nouveau: store engine type in gpuobj class structs
We will eventually want to address hw engines other than PGRAPH.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-03 15:06:52 +10:00
Francisco Jerez 3945e47543 drm/nouveau: Refactor context destruction to avoid a lock ordering issue.
The destroy_context() engine hooks call gpuobj management functions to
release the channel resources, these functions use HARDIRQ-unsafe locks
whereas destroy_context() is called with the HARDIRQ-safe
context_switch_lock held, that's a lock ordering violation.

Push the engine-specific channel destruction logic into destroy_context()
and let the hardware-specific code lock and unlock when it's actually
needed. Change the engine destruction order to avoid a race in the small
gap between pgraph and pfifo context uninitialization.

Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-03 15:06:35 +10:00
Ben Skeggs cff5c13324 drm/nouveau: add more fine-grained locking to channel list + structures
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-03 15:05:18 +10:00
Ben Skeggs 047d1d3cae drm/nouveau: reduce usage of fence spinlock to when absolutely necessary
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-13 10:14:04 +10:00
Francisco Jerez 6e86e04194 drm/nouveau: Fix a couple of sparse warnings.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-13 10:13:23 +10:00
Marcin Kościelnicki f23d4cf4bd drm/nv04: Implement missing nv04 PGRAPH methods in software.
Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 13:15:14 +10:00
Marcin Kościelnicki 40c2298bdc drm/nv04: Fix set_operation software method.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 14:41:19 +10:00
Francisco Jerez ea911a1cf4 drm/nv04: Context switching fixes.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 14:41:12 +10:00
Francisco Jerez a5027ccd3c drm/nouveau: Use the software object for fencing.
This should avoid a race condition on nv0x, if we're doing it with
actual PGRAPH objects and a there's a fence within the FIFO DMA fetch
area when a context switch kicks in.

In that case we get an ILLEGAL_MTHD interrupt as expected, but the
values in PGRAPH_TRAPPED_ADDR aren't calculated correctly and they're
almost useless (e.g. you can see ILLEGAL_MTHDs for the now inactive
channel, with a wrong offset/data pair).

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 14:41:12 +10:00
Marcin Kościelnicki 13c5443b51 drm/nv04: Fix NV04 set_operation software method.
Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-16 17:05:13 +10:00
Ben Skeggs 6ee738610f drm/nouveau: Add DRM driver for NVIDIA GPUs
This adds a drm/kms staging non-API stable driver for GPUs from NVIDIA.

This driver is a KMS-based driver and requires a compatible nouveau
userspace libdrm and nouveau X.org driver.

This driver requires firmware files not available in this kernel tree,
interested parties can find them via the nouveau project git archive.

This driver is reverse engineered, and is in no way supported by nVidia.

Support for nearly the complete range of nvidia hw from nv04->g80 (nv50)
is available, and the kms driver should support driving nearly all
output types (displayport is under development still) along with supporting
suspend/resume.

This work is all from the upstream nouveau project found at
nouveau.freedesktop.org.

The original authors list from nouveau git tree is:
Anssi Hannula <anssi.hannula@iki.fi>
Ben Skeggs <bskeggs@redhat.com>
Francisco Jerez <currojerez@riseup.net>
Maarten Maathuis <madman2003@gmail.com>
Marcin Kościelnicki <koriakin@0x04.net>
Matthew Garrett <mjg@redhat.com>
Matt Parnell <mparnell@gmail.com>
Patrice Mandin <patmandin@gmail.com>
Pekka Paalanen <pq@iki.fi>
Xavier Chantry <shiningxc@gmail.com>
along with project founder Stephane Marchesin <marchesin@icps.u-strasbg.fr>

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-11 21:29:34 +10:00