aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau
AgeCommit message (Collapse)Author
2010-01-11drm/nv04: Fix set_operation software method.Marcin Kościelnicki
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nouveau: initialise DMA tracking parameters earlierBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nouveau: use dma.max rather than pushbuf size for checking GET validityBen Skeggs
Some upcoming G80 DMA changes will depend on this, but it's split out for bisectibility just in case it causes some unexpected issues. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nv04: differentiate between nv04/nv05Ben Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nouveau: Fix null deref in nouveau_fence_emit due to deleted fenceLuca Barbieri
Currently Nouveau will unvalidate all buffers if it is forced to wait on one, and then start revalidating from the beginning. While doing so, it destroys the operation fence, causing nouveau_fence_emit to crash. This patch fixes this bug by taking the fence object out of validate_op and creating it just before emit. The fence pointer is initialized to 0 and unref'ed unconditionally. In addition to fixing the bug, this prevents its reintroduction and simplifies the code. Signed-off-by: Luca Barbieri <luca@luca-barbieri.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nv50: prevent a possible ctxprog hangBen Skeggs
The below is mainly an educated guess at what's going on, docs would sure be handy... NVIDIA? :P It appears it's possible for a ctxprog to run even while a GPU exception is pending. The GF8 and up ctxprogs appear to have a small snippet of code which detects this, and stalls the ctxprog until it's been handled, which essentially looks like: if (r2 & 0x00008000) { r0 |= 0x80000000; while (r0 & 0x80000000) {} } I don't know of any way that flag would get cleared unless the driver intervenes (and indeed, in the cases I've seen the hang, nothing steps in to automagically clear it for us). This patch causes the driver to clear the flag during the PGRAPH IRQ handler. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nouveau: have ttm's fault handler called directlyBen Skeggs
There's no good reason for us to have our own anymore, this is left over from an early port to these TTM interfaces. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nv50: restore correct cache1 get/put address on fifoctx loadBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nouveau: create function for "dealing" with gpu lockupMarcin Slusarz
It's mostly a cleanup, but in nv50_fbcon_accel_init gpu lockup message was printed, but HWACCEL_DISBALED flag was not set. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nouveau: remove unused nouveau_channel_idle() functionBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nouveau: fix handling of fbcon colours in 8bppBen Skeggs
Depending on the visual, the colours handed to us in fillrect() can either be an actual colour, or an index into the pseudo-palette. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nv04: Context switching fixes.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11drm/nouveau: Use the software object for fencing.Francisco Jerez
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-11drm/nouveau: Allocate a per-channel instance of NV_SW.Francisco Jerez
It will be useful for various synchronization purposes, mostly stolen from "[PATCH] drm/nv50: synchronize user channel after buffer object move on kernel channel" by Maarten Maathuis. Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11drm/nv50: make the blocksize depend on vram sizeMaarten Maathuis
- This should be better than what we have now. - I'm less sure about the non power of two path. Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
2010-01-11drm/nouveau: better alignment of bo sizes and use roundup instead of ALIGNMaarten Maathuis
- Aligning to block size should ensure that the extra size is enough. - Using roundup, because not all sizes are powers of two. Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
2010-01-11drm/nouveau: Don't skip card take down on nv0x.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11drm/nouveau: Implement nv42-nv43 TV load detection.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11drm/nouveau: Clean up the nv17-nv4x load detection code a bit.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11drm/nv50: fix fillrect colorMarcin Slusarz
struct fb_fillrect->color is not a color, but index into pseudo_palette array Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nv50: ignore vbios table's claim to the contrary if EDID says >8bpcBen Skeggs
Should fix dim panel issues reported on Dell M6400/M6500. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11drm/nouveau: Drop redundant placement initialization.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11drm/nouveau: No need to force evict=true when swapping evicted BOs back in.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11drm/nouveau: Fix "general protection fault" in the flipd/flips eviction path.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11drm/i2c/ch7006: Drop build time dependency to nouveau.Francisco Jerez
This partially reverts e4b41066, as this driver is intended to be useful with any KMS driver for suitable hardware. The missing build dependency that commit workarounded was DRM_KMS_HELPER. Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11drm/nouveau: Make the MM aware of pre-G80 tiling.Francisco Jerez
This commit has also the following 3 bugfix commits squashed into it from the nouveau git tree: drm/nouveau: Fix up the tiling alignment restrictions for nv1x. drm/nouveau: Fix up the nv2x tiling alignment restrictions. drm/nv50: fix align typo for g9x Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11drm/nouveau: Pre-G80 tiling support.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11drm/nouveau: Add cache_flush/pull fifo engine functions.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2009-12-23Merge remote branch 'nouveau/for-airlied' into drm-linusDave Airlie
* nouveau/for-airlied: drm/nouveau: fix bug causing pinned buffers to lose their NO_EVICT flag drm/nv50: fix suspend/resume delays without firmware present drm/nouveau: prevent all channel creation if accel not available drm/nv50: fix two potential suspend/resume oopses drm/nv40: implement ctxprog/state generation drm/nv10: Add the initial graph context and soft methods needed for LMA. drm/nouveau: Fix up buffer eviction, and evict them to GART, if possible. drm/nouveau: Add proper error handling to nouveau_card_init drm/nv04: Fix NV04 set_operation software method. drm/nouveau: Kill global state in BIOS script interpreter drm/nouveau: Kill global state in NvShadowBIOS drm/nouveau: use drm debug levels drm/i2c/ch7006: Fix load detection false positives right after system init. drm/nv04-nv40: Fix "conflicting memory types" when saving/restoring VGA fonts.
2009-12-18drm: convert drm_ioctl to unlocked_ioctlArnd Bergmann
drm_ioctl is called with the Big Kernel Lock held, which shows up very high in statistics on vfs_ioctl. Moving the lock into the drm_ioctl function itself makes sure we blame the right subsystem and it gets us one step closer to eliminating the locked version of fops->ioctl. Since drm_ioctl does not require the lock itself, we only need to hold it while calling the specific handler. The 32 bit conversion handlers do not interact with any other code, so they don't need the BKL here either and can just call drm_ioctl. As a bonus, this cleans up all the other users of drm_ioctl which now no longer have to find the inode or call lock_kernel. [airlied: squashed the non-driver bits of the second patch in here, this provides the flag for drivers to use to select unlocked ioctls - but doesn't modify any drivers]. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: David Airlie <airlied@linux.ie> Cc: dri-devel@lists.sourceforge.net Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/nouveau: fix bug causing pinned buffers to lose their NO_EVICT flagBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-16drm/nv50: fix suspend/resume delays without firmware presentBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-16drm/nouveau: prevent all channel creation if accel not availableBen Skeggs
Previously, if there was no firmware available, the DRM would just disable channel creation from userspace, but still use a single channel for its own purposes. With a bit of care it should actually be possible to do this, due to the DRM's very limited use of the engine. It currently doesn't work correctly however, resulting in corrupted fbcon and hangs on a number of cards. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-16drm/nv50: fix two potential suspend/resume oopsesBen Skeggs
This avoids touching the dummy channel 0/127 we have on nv50. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-16drm/nv40: implement ctxprog/state generationBen Skeggs
The context programs are *very* simple compared to the ones used by the binary driver. There's notes in nv40_grctx.c explaining most of the things we don't implement. If we discover if/why any of it is required further down the track, we'll handle it then. The PGRAPH state generated for each chipset should match what NVIDIA do almost exactly (there's a couple of exceptions). If someone has a lot of time on their hands, they could figure out the mapping of object/method to PGRAPH register and demagic the initial state a little, it's not terribly important however. At time of commit, confirmed to be working at least well enough for accelerated X (and where tested, for 3D apps) on NV40, NV43, NV44, NV46, NV49, NV4A, NV4B and NV4E. A module option has been added to force the use of external firmware blobs if it becomes required. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-16drm/nv10: Add the initial graph context and soft methods needed for LMA.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-16drm/nouveau: Fix up buffer eviction, and evict them to GART, if possible.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-16drm/nouveau: Add proper error handling to nouveau_card_initMarcin Kościelnicki
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-16drm/nv04: Fix NV04 set_operation software method.Marcin Kościelnicki
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-16drm/nouveau: Kill global state in BIOS script interpreterMarcin Kościelnicki
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-16drm/nouveau: Kill global state in NvShadowBIOSMarcin Kościelnicki
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-16drm/nouveau: use drm debug levelsMaarten Maathuis
- Use driver level (0x2) for NV_DEBUG instead of all levels - Create a NV_DEBUG_KMS for KMS level (0x4) and use them in modesetting code - Remove a few odd NV_TRACE calls and replace some of them with NV_DEBUG_KMS or NV_INFO Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-16drm/nv04-nv40: Fix "conflicting memory types" when saving/restoring VGA fonts.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-15drm/nouveau: remove use of -ERESTARTBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-15nouveau: Fix endianness with new context program loaderBenjamin Herrenschmidt
When switching to request_firmware() to load the context programs, some endian fixes need to be applied. This makes it work again on my quad g5 nvidia 6600. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-15drm/nouveau: fix build with CONFIG_AGP=nBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-15drm/nouveau: fix ch7006 buildRandy Dunlap
The ch7006 driver could be built even when nouveau was not enabled, but the build fails in that case, so make it depend on DRM_NOUVEUA. Also make the I2c encoder/helper chips menu depend on I2C (no build error, just visual inspection). ERROR: "drm_helper_probe_single_connector_modes" [drivers/gpu/drm/i2c/ch7006.ko] undefined! Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-11drm/nouveau: Add DRM driver for NVIDIA GPUsBen Skeggs
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>