openwrt/staging/blogic.git
13 years agodrm/nouveau: fix suspend/resume on GPUs that don't have PM support
Ben Skeggs [Thu, 17 Feb 2011 01:11:28 +0000 (11:11 +1000)]
drm/nouveau: fix suspend/resume on GPUs that don't have PM support

This has been broken since 2.6.37, and fixes resume on a couple of fermi
boards I have access to.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: flips/flipd need to always set 'evict' for move_accel_cleanup()
Ben Skeggs [Mon, 14 Feb 2011 03:51:28 +0000 (13:51 +1000)]
drm/nouveau: flips/flipd need to always set 'evict' for move_accel_cleanup()

We free the temporary binding before leaving this function, so we also have
to wait for the move to actually complete.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv40: fix tiling-related setup for a number of chipsets
Ben Skeggs [Mon, 7 Feb 2011 00:49:39 +0000 (10:49 +1000)]
drm/nv40: fix tiling-related setup for a number of chipsets

Due to the default case handling the older chipsets, a bunch of the newer
ones ended up having the wrong tiling regs used.  This commit switches the
default case to handle the newest chipsets.

This also makes nv4e touch the "extra" tiling regs.  "nv" doesn't touch
them for C51 but traces of the NVIDIA binary driver show it being done
there.

I couldn't find NV41/NV45 traces to confirm the behaviour there, but an
educated guess was taken at each of them.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: fix non-EDIDful native mode selection
Ben Skeggs [Sun, 6 Feb 2011 22:41:18 +0000 (08:41 +1000)]
drm/nouveau: fix non-EDIDful native mode selection

The DRM core fills this value, but at too late a stage for this to work,
possibly resulting in an undesirable mode being selected.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Fix detection of DDC-based LVDS on DCB15 boards.
Francisco Jerez [Thu, 3 Feb 2011 00:56:32 +0000 (01:56 +0100)]
drm/nouveau: Fix detection of DDC-based LVDS on DCB15 boards.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv04-nv40: Fix NULL dereference when we fail to find an LVDS native mode.
Francisco Jerez [Thu, 3 Feb 2011 00:53:18 +0000 (01:53 +0100)]
drm/nv04-nv40: Fix NULL dereference when we fail to find an LVDS native mode.

Reported-by: Alex Buell <alex.buell@munted.org.uk>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv10: Fix crash when allocating a BO larger than half the available VRAM.
Francisco Jerez [Thu, 3 Feb 2011 00:49:33 +0000 (01:49 +0100)]
drm/nv10: Fix crash when allocating a BO larger than half the available VRAM.

Reported-by: Alex Buell <alex.buell@munted.org.uk>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: fix display on 0x50
Ben Skeggs [Mon, 31 Jan 2011 06:23:27 +0000 (16:23 +1000)]
drm/nv50: fix display on 0x50

Accidently busted a while back.  We'll be creating objects that aren't
necessary here, but, they're never used so no harm..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: correctly pair hwmon_init and hwmon_fini
Lucas Stach [Sun, 30 Jan 2011 09:54:11 +0000 (10:54 +0100)]
drm/nouveau: correctly pair hwmon_init and hwmon_fini

I broke this with my commit
07cfe0e7a820ecad078c04e9c2a102521709145d

This fixes fdo #33434

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: fix regression on IGPs
Ben Skeggs [Thu, 27 Jan 2011 00:42:50 +0000 (10:42 +1000)]
drm/nv50: fix regression on IGPs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/grctx: correct an off-by-one
Ben Skeggs [Fri, 21 Jan 2011 12:34:13 +0000 (22:34 +1000)]
drm/nvc0/grctx: correct an off-by-one

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: Fix race with PFIFO during PGRAPH context destruction.
Francisco Jerez [Mon, 24 Jan 2011 00:47:42 +0000 (01:47 +0100)]
drm/nv50: Fix race with PFIFO during PGRAPH context destruction.

Reported-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Workaround incorrect DCB entry on a GeForce3 Ti 200.
Francisco Jerez [Sat, 25 Dec 2010 14:43:30 +0000 (15:43 +0100)]
drm/nouveau: Workaround incorrect DCB entry on a GeForce3 Ti 200.

Fixes the DVI-D output on that board (fdo bug 32645).

Reported-by: Bryan Quigley <BryanQuigley@Ubuntu.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: implement irq handler for whatever's at 0x14xxxx
Ben Skeggs [Fri, 21 Jan 2011 03:53:21 +0000 (13:53 +1000)]
drm/nvc0: implement irq handler for whatever's at 0x14xxxx

This is just barely enough to stop a never-ending IRQ storm that can
be triggered by our 3D driver.  We have no idea what this engine is..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: fix incorrect TPC register setup
Ben Skeggs [Fri, 21 Jan 2011 01:15:16 +0000 (11:15 +1000)]
drm/nvc0: fix incorrect TPC register setup

Was hitting TPC+1's regs by accident, oops.

Reported-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: probe for adt7473 before f75375
Ben Skeggs [Wed, 19 Jan 2011 05:54:10 +0000 (15:54 +1000)]
drm/nouveau: probe for adt7473 before f75375

There's a reported case where probing for f75375 causes the system
to hang completely, in this case there's an adt7473 at the same
i2c address.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: remove dead function definition
Ben Skeggs [Tue, 18 Jan 2011 04:46:19 +0000 (14:46 +1000)]
drm/nouveau: remove dead function definition

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: fix gpu page faults triggered by plymouthd
Ben Skeggs [Mon, 17 Jan 2011 01:22:38 +0000 (11:22 +1000)]
drm/nouveau: fix gpu page faults triggered by plymouthd

The switch to separate BAR and channel address spaces made the fbcon memory
address calculation incorrect on NV50+ boards, this commit fixes that.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: greatly simplify mm, killing some bugs in the process
Ben Skeggs [Fri, 14 Jan 2011 05:46:30 +0000 (15:46 +1000)]
drm/nouveau: greatly simplify mm, killing some bugs in the process

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: enable protection of system-use-only structures in vm
Ben Skeggs [Fri, 14 Jan 2011 00:27:02 +0000 (10:27 +1000)]
drm/nvc0: enable protection of system-use-only structures in vm

Somehow missed this in the original merge of the nvc0 code.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv40: initialise 0x17xx on all chipsets that have it
Ben Skeggs [Tue, 11 Jan 2011 07:22:33 +0000 (17:22 +1000)]
drm/nv40: initialise 0x17xx on all chipsets that have it

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv40: make detection of 0x4097-ful chipsets available everywhere
Ben Skeggs [Tue, 11 Jan 2011 04:23:12 +0000 (14:23 +1000)]
drm/nv40: make detection of 0x4097-ful chipsets available everywhere

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: fix hwmon device binding
Lucas Stach [Thu, 6 Jan 2011 19:29:53 +0000 (20:29 +0100)]
drm/nouveau: fix hwmon device binding

Bind the hwmon structs to nouveau device kobj. This makes sure
the hwmon files are created in the device subdir in line with
all other hwmon drivers.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: create grctx on the fly on all chipsets
Ben Skeggs [Tue, 4 Jan 2011 02:41:37 +0000 (12:41 +1000)]
drm/nouveau: create grctx on the fly on all chipsets

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: fix init without firmware present
Ben Skeggs [Thu, 6 Jan 2011 12:10:15 +0000 (22:10 +1000)]
drm/nvc0: fix init without firmware present

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/pgraph: fix 0x406028/0x405870 init
Ben Skeggs [Sat, 1 Jan 2011 02:26:23 +0000 (12:26 +1000)]
drm/nvc0/pgraph: fix 0x406028/0x405870 init

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/pgraph: more unit names
Ben Skeggs [Fri, 31 Dec 2010 02:21:56 +0000 (12:21 +1000)]
drm/nvc0/pgraph: more unit names

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0/pfifo: support for chipsets with only one PSUBFIFO (0xc1)
Ben Skeggs [Fri, 31 Dec 2010 02:10:49 +0000 (12:10 +1000)]
drm/nvc0/pfifo: support for chipsets with only one PSUBFIFO (0xc1)

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: reserve only subc 0 for kernel use
Ben Skeggs [Thu, 30 Dec 2010 01:53:48 +0000 (11:53 +1000)]
drm/nvc0: reserve only subc 0 for kernel use

Current 3D driver expects this behaviour.  While this could be changed,
there's no compelling reason to reserve more than one subchannel for the
DRM.  If we ever need to use an object other then M2MF, we can just
re-bind subchannel 0 as required.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: sync up gr data error names with rnn, use for nvc0 also
Ben Skeggs [Thu, 30 Dec 2010 01:48:03 +0000 (11:48 +1000)]
drm/nv50: sync up gr data error names with rnn, use for nvc0 also

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: parse a couple more PGRAPH_INTR
Ben Skeggs [Thu, 30 Dec 2010 01:40:07 +0000 (11:40 +1000)]
drm/nvc0: parse a couple more PGRAPH_INTR

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: nuke left-over debug messages
Ben Skeggs [Wed, 29 Dec 2010 00:41:20 +0000 (10:41 +1000)]
drm/nvc0: nuke left-over debug messages

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: kill off a couple more magics
Ben Skeggs [Thu, 23 Dec 2010 23:33:33 +0000 (09:33 +1000)]
drm/nvc0: kill off a couple more magics

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Validate channel indices passed from userspace.
Michel Hermier [Sat, 25 Dec 2010 15:58:56 +0000 (16:58 +0100)]
drm/nouveau: Validate channel indices passed from userspace.

When hacking the libdrm for improvements, I triggered a kernel crash
related to the fact that the NOUVEAU_NOTIFIEROBJ_ALLOC ioctl calls
nouveau_channel_get with an unchecked channel index.
The patch ensures that the channel index is an unsigned and validates
its value in nouveau_channel_get.

Signed-off-by: Michel Hermier <hermier@frugalware.org>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Only select ACPI_VIDEO if its dependencies are met
Ben Hutchings [Sat, 25 Dec 2010 16:17:32 +0000 (16:17 +0000)]
drm/nouveau: Only select ACPI_VIDEO if its dependencies are met

CONFIG_ACPI_VIDEO depends on more than just CONFIG_ACPI, so add those
dependencies to the Kconfig select condition.  The case where some
dependencies fail to be satisfied should be handled correctly, because
in that case the ACPI_VIDEO symbols we use are converted into
static-inline stubs.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: accelerate ttm buffer moves
Ben Skeggs [Thu, 9 Dec 2010 05:17:10 +0000 (15:17 +1000)]
drm/nvc0: accelerate ttm buffer moves

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: initial support for tiled buffer objects
Ben Skeggs [Wed, 8 Dec 2010 01:19:30 +0000 (11:19 +1000)]
drm/nvc0: initial support for tiled buffer objects

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: implement fbcon acceleration
Ben Skeggs [Wed, 24 Nov 2010 00:52:43 +0000 (10:52 +1000)]
drm/nvc0: implement fbcon acceleration

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: implement pgraph engine hooks
Ben Skeggs [Wed, 24 Nov 2010 00:49:02 +0000 (10:49 +1000)]
drm/nvc0: implement pgraph engine hooks

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: implement pfifo engine hooks
Ben Skeggs [Wed, 24 Nov 2010 00:47:15 +0000 (10:47 +1000)]
drm/nvc0: implement pfifo engine hooks

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: implement fencing
Ben Skeggs [Wed, 24 Nov 2010 00:30:22 +0000 (10:30 +1000)]
drm/nvc0: implement fencing

Just simple REF_CNT fencing for the moment.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: fix channel dma init paths
Ben Skeggs [Wed, 24 Nov 2010 00:26:24 +0000 (10:26 +1000)]
drm/nvc0: fix channel dma init paths

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: skip dma object creation for drm channel
Ben Skeggs [Wed, 24 Nov 2010 00:18:28 +0000 (10:18 +1000)]
drm/nvc0: skip dma object creation for drm channel

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: implement channel structure initialisation
Ben Skeggs [Wed, 24 Nov 2010 00:15:05 +0000 (10:15 +1000)]
drm/nvc0: implement channel structure initialisation

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: gpuobj_new need only check validity and init the relevant engine
Ben Skeggs [Wed, 24 Nov 2010 00:10:23 +0000 (10:10 +1000)]
drm/nvc0: gpuobj_new need only check validity and init the relevant engine

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: reject the notifier_alloc ioctl
Ben Skeggs [Wed, 24 Nov 2010 00:07:21 +0000 (10:07 +1000)]
drm/nvc0: reject the notifier_alloc ioctl

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: create shared channel vm
Ben Skeggs [Tue, 16 Nov 2010 04:58:42 +0000 (14:58 +1000)]
drm/nvc0: create shared channel vm

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: initial vm implementation, use for bar1/bar3 management
Ben Skeggs [Mon, 15 Nov 2010 01:48:33 +0000 (11:48 +1000)]
drm/nvc0: initial vm implementation, use for bar1/bar3 management

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nvc0: import initial vm backend
Ben Skeggs [Wed, 10 Nov 2010 04:10:04 +0000 (14:10 +1000)]
drm/nvc0: import initial vm backend

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: modify vm to accomodate dual page tables for nvc0
Ben Skeggs [Wed, 15 Dec 2010 01:04:39 +0000 (11:04 +1000)]
drm/nouveau: modify vm to accomodate dual page tables for nvc0

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: add missing license header to nv50_fbcon.c
Ben Skeggs [Thu, 16 Dec 2010 03:32:36 +0000 (13:32 +1000)]
drm/nv50: add missing license header to nv50_fbcon.c

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: fix smatch warning in nv50_vram.c
Ben Skeggs [Tue, 21 Dec 2010 01:15:44 +0000 (11:15 +1000)]
drm/nv50: fix smatch warning in nv50_vram.c

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: sizeof() vs ARRAY_SIZE()
Dan Carpenter [Mon, 20 Dec 2010 09:26:26 +0000 (12:26 +0300)]
drm/nouveau: sizeof() vs ARRAY_SIZE()

ARRAY_SIZE() was intended here, sizeof() is too large.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/radeon/kms: properly print ontario chip id
Alex Deucher [Fri, 3 Dec 2010 20:34:16 +0000 (15:34 -0500)]
drm/radeon/kms: properly print ontario chip id

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: fix vram start calculation on ontario (v2)
Alex Deucher [Wed, 15 Dec 2010 16:04:10 +0000 (11:04 -0500)]
drm/radeon/kms: fix vram start calculation on ontario (v2)

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge remote branch 'nouveau/drm-nouveau-next' of ../drm-nouveau-next into drm-core...
Dave Airlie [Thu, 16 Dec 2010 04:49:02 +0000 (14:49 +1000)]
Merge remote branch 'nouveau/drm-nouveau-next' of ../drm-nouveau-next into drm-core-next

* 'nouveau/drm-nouveau-next' of ../drm-nouveau-next: (93 commits)
  drm/nv50: fix a couple of vm init issues
  drm/nv04-nv40: Fix up PCI(E) GART DMA object bus address calculation.
  drm/nouveau: kick vram functions out into an "engine"
  drm/nouveau: allow gpuobj vinst to be a virtual address when necessary
  drm/nv50: tidy up PCIEGART implementation
  drm/nv50: enable non-contig vram allocations where requested
  drm/nv50: enable 4KiB pages for small vram allocations
  drm/nv50: implement global channel address space on new VM code
  drm/nv50: implement BAR1/BAR3 management on top of new VM code
  drm/nv50: import new vm code
  drm/nv50: implement custom vram mm
  drm/nouveau: Avoid potential race between nouveau_fence_update() and context takedown.
  drm/nouveau: fix use of drm_mm_node in semaphore object
  drm/nouveau: wrap calls to ttm_bo_validate()
  drm/nouveau: no need to zero dma objects, we fill them completely anyway
  drm/nouveau: introduce a util function to wait on reg != val
  drm/nouveau: implicitly insert non-DMA objects into RAMHT
  drm/nouveau: make fifo.create_context() responsible for mapping control regs
  drm/nouveau: Spin for a bit in nouveau_fence_wait() before yielding the CPU.
  drm/nouveau: Use WC memory on the AGP GART.
  ...

13 years agodrm/ttm: delay freeing of old node during move_memcpy until after iounmap
Ben Skeggs [Thu, 16 Dec 2010 04:47:46 +0000 (14:47 +1000)]
drm/ttm: delay freeing of old node during move_memcpy until after iounmap

Drivers using their own implementation of io_mem_reserve/io_mem_free are
likely to store the tracking information for the map in mem.mm_node, so
it can't be freed while still mapped.

Signed-off-by: Ben Skeggs<bskeggs@redhat.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: add initial tracepoint support.
Dave Airlie [Tue, 23 Nov 2010 01:47:49 +0000 (11:47 +1000)]
drm/radeon: add initial tracepoint support.

this adds a bo create, and fence seq tracking tracepoints.

This is just an initial set to play around with, we should investigate
what others we need would be useful.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/nv50: fix a couple of vm init issues
Francisco Jerez [Thu, 16 Dec 2010 00:30:35 +0000 (10:30 +1000)]
drm/nv50: fix a couple of vm init issues

Fixes overwriting the first page table entry when testing that the PRAMIN
BAR can be correctly read/written, and adds an additional bar flush after
poking the BAR3 control regs.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv04-nv40: Fix up PCI(E) GART DMA object bus address calculation.
Francisco Jerez [Wed, 8 Dec 2010 01:37:12 +0000 (02:37 +0100)]
drm/nv04-nv40: Fix up PCI(E) GART DMA object bus address calculation.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: kick vram functions out into an "engine"
Ben Skeggs [Mon, 6 Dec 2010 05:28:54 +0000 (15:28 +1000)]
drm/nouveau: kick vram functions out into an "engine"

NVC0 will be able to share some of nv50's paths this way.  This also makes
it the card-specific vram code responsible for deciding if a given set
of tile_flags is valid, rather than duplicating the allowed types in
nv50_vram.c and nouveau_gem.c

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: allow gpuobj vinst to be a virtual address when necessary
Ben Skeggs [Mon, 22 Nov 2010 00:48:51 +0000 (10:48 +1000)]
drm/nouveau: allow gpuobj vinst to be a virtual address when necessary

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: tidy up PCIEGART implementation
Ben Skeggs [Tue, 16 Nov 2010 00:13:05 +0000 (10:13 +1000)]
drm/nv50: tidy up PCIEGART implementation

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: enable non-contig vram allocations where requested
Ben Skeggs [Fri, 12 Nov 2010 05:13:59 +0000 (15:13 +1000)]
drm/nv50: enable non-contig vram allocations where requested

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: enable 4KiB pages for small vram allocations
Ben Skeggs [Fri, 12 Nov 2010 05:12:51 +0000 (15:12 +1000)]
drm/nv50: enable 4KiB pages for small vram allocations

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: implement global channel address space on new VM code
Ben Skeggs [Mon, 15 Nov 2010 01:54:21 +0000 (11:54 +1000)]
drm/nv50: implement global channel address space on new VM code

As of this commit, it's guaranteed that if an object is in VRAM that its
GPU virtual address will be constant.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: implement BAR1/BAR3 management on top of new VM code
Ben Skeggs [Mon, 15 Nov 2010 01:53:16 +0000 (11:53 +1000)]
drm/nv50: implement BAR1/BAR3 management on top of new VM code

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: import new vm code
Ben Skeggs [Fri, 27 Aug 2010 00:00:25 +0000 (10:00 +1000)]
drm/nv50: import new vm code

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: implement custom vram mm
Ben Skeggs [Wed, 25 Aug 2010 05:26:04 +0000 (15:26 +1000)]
drm/nv50: implement custom vram mm

This is required on nv50 as we need to be able to have more precise control
over physical VRAM allocations to avoid buffer corruption when using
buffers of mixed memory types.

This removes some nasty overallocation/alignment that we were previously
using to "control" this problem.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Avoid potential race between nouveau_fence_update() and context takedown.
Francisco Jerez [Wed, 8 Dec 2010 01:35:45 +0000 (02:35 +0100)]
drm/nouveau: Avoid potential race between nouveau_fence_update() and context takedown.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: fix use of drm_mm_node in semaphore object
Ben Skeggs [Thu, 2 Dec 2010 23:05:20 +0000 (09:05 +1000)]
drm/nouveau: fix use of drm_mm_node in semaphore object

At some point in the future, this bo won't necessarily be backed by
a drm_mm_node, so use the start/size fields of the ttm_mem_reg instead.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: wrap calls to ttm_bo_validate()
Ben Skeggs [Sun, 21 Nov 2010 22:50:27 +0000 (08:50 +1000)]
drm/nouveau: wrap calls to ttm_bo_validate()

This will be used later to fixup bo.offset with a buffer's fixed GPU
virtual address.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: no need to zero dma objects, we fill them completely anyway
Ben Skeggs [Fri, 26 Nov 2010 00:32:22 +0000 (10:32 +1000)]
drm/nouveau: no need to zero dma objects, we fill them completely anyway

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: introduce a util function to wait on reg != val
Ben Skeggs [Fri, 19 Nov 2010 04:32:56 +0000 (14:32 +1000)]
drm/nouveau: introduce a util function to wait on reg != val

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: implicitly insert non-DMA objects into RAMHT
Ben Skeggs [Tue, 23 Nov 2010 00:10:24 +0000 (10:10 +1000)]
drm/nouveau: implicitly insert non-DMA objects into RAMHT

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: make fifo.create_context() responsible for mapping control regs
Ben Skeggs [Mon, 22 Nov 2010 06:05:54 +0000 (16:05 +1000)]
drm/nouveau: make fifo.create_context() responsible for mapping control regs

The regs belong to PFIFO, they're different for pretty much the same
generations we need different PFIFO control for, and NVC0 is going
to be even more different than the rest.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Spin for a bit in nouveau_fence_wait() before yielding the CPU.
Francisco Jerez [Thu, 25 Nov 2010 15:37:17 +0000 (16:37 +0100)]
drm/nouveau: Spin for a bit in nouveau_fence_wait() before yielding the CPU.

Sleeping doesn't pay off for very short delays in comparison with the
minimum granularity of schedule_timeout().

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Use WC memory on the AGP GART.
Francisco Jerez [Sat, 20 Nov 2010 21:11:22 +0000 (22:11 +0100)]
drm/nouveau: Use WC memory on the AGP GART.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: Synchronize with the user channel before GPU object destruction.
Francisco Jerez [Thu, 18 Nov 2010 22:57:46 +0000 (23:57 +0100)]
drm/nouveau: Synchronize with the user channel before GPU object destruction.

There have been reports of PFIFO cache errors during context take down
(fdo bug 31637). They are caused by some GPU objects being taken out
while the channel is still potentially processing commands. Make sure
that all the previous rendering has landed before releasing a GPU
object.

Reported-by: Grzesiek Sójka <pld@pfu.pl>
Reported-by: Patrice Mandin <patmandin@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv04-nv10: Don't re-enable FIFO access multiple times after IRQ dispatch.
Francisco Jerez [Sat, 20 Nov 2010 13:43:51 +0000 (14:43 +0100)]
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>
13 years agodrm/nv04-nv40: Give "gpuobj->cinst" the same meaning as on nv50.
Francisco Jerez [Sat, 20 Nov 2010 13:42:57 +0000 (14:42 +0100)]
drm/nv04-nv40: Give "gpuobj->cinst" the same meaning as on nv50.

No functional changes, just simplify some code paths a bit.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: fabricate DCB encoder table for iMac G4
Francisco Jerez [Fri, 19 Nov 2010 08:08:47 +0000 (18:08 +1000)]
drm/nouveau: fabricate DCB encoder table for iMac G4

In typical Apple fashion there's no standard information about what
encoders are present on this machine, this patch adds a quirk to
provide it.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: tidy up and extend dma object creation interfaces
Ben Skeggs [Tue, 16 Nov 2010 01:50:09 +0000 (11:50 +1000)]
drm/nouveau: tidy up and extend dma object creation interfaces

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: remove some useless GETPARAMs
Ben Skeggs [Tue, 16 Nov 2010 00:17:53 +0000 (10:17 +1000)]
drm/nouveau: remove some useless GETPARAMs

These have been unused since UMS support was ripped out, so lets remove
them completely.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv84: fix minor issues in PCRYPT implementation
Ben Skeggs [Mon, 15 Nov 2010 06:28:19 +0000 (16:28 +1000)]
drm/nv84: fix minor issues in PCRYPT implementation

Fix running of destroy_context() when create_context() has never been
called for the channel, and fill in engine's tlb_flush() function pointer.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: remove dummy page use from PCI(E)GART, use PTE present instead
Ben Skeggs [Mon, 15 Nov 2010 02:54:57 +0000 (12:54 +1000)]
drm/nouveau: remove dummy page use from PCI(E)GART, use PTE present instead

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: fix 0x100c90 init for NVAF
Ben Skeggs [Mon, 15 Nov 2010 02:52:23 +0000 (12:52 +1000)]
drm/nv50: fix 0x100c90 init for NVAF

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: allocate page for unknown PFB object in nv50_fb.c
Ben Skeggs [Mon, 15 Nov 2010 02:50:50 +0000 (12:50 +1000)]
drm/nv50: allocate page for unknown PFB object in nv50_fb.c

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: rework gpu-specific instmem interfaces
Ben Skeggs [Mon, 1 Nov 2010 01:45:02 +0000 (11:45 +1000)]
drm/nouveau: rework gpu-specific instmem interfaces

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: simplify gpuobj suspend/resume
Ben Skeggs [Mon, 25 Oct 2010 05:23:59 +0000 (15:23 +1000)]
drm/nouveau: simplify gpuobj suspend/resume

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: rework PGPIO IRQ handling and hotplug detection
Ben Skeggs [Thu, 11 Nov 2010 06:14:56 +0000 (16:14 +1000)]
drm/nv50: rework PGPIO IRQ handling and hotplug detection

Allows callers to install their own handlers for when a GPIO line
changes state (such as for hotplug detect).

This also fixes a bug where we weren't acknowledging the GPIO IRQ
until after the bottom half had run, causing a severe IRQ storm
in some cases.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv04-nv40: unregister irq handler on destroy
Ben Skeggs [Thu, 11 Nov 2010 03:59:05 +0000 (13:59 +1000)]
drm/nv04-nv40: unregister irq handler on destroy

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: tidy+move PGRAPH ISRs to their respective *_graph.c files
Ben Skeggs [Wed, 3 Nov 2010 03:16:18 +0000 (13:16 +1000)]
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>
13 years agodrm/nouveau: move PFIFO ISR into nv04_fifo.c
Ben Skeggs [Wed, 3 Nov 2010 00:56:05 +0000 (10:56 +1000)]
drm/nouveau: move PFIFO ISR into nv04_fifo.c

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv04-nv40: register vblank isr
Ben Skeggs [Wed, 3 Nov 2010 01:36:09 +0000 (11:36 +1000)]
drm/nv04-nv40: register vblank isr

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: move bitfield/enum helpers to nouveau_util.c
Ben Skeggs [Wed, 3 Nov 2010 00:45:48 +0000 (10:45 +1000)]
drm/nouveau: move bitfield/enum helpers to nouveau_util.c

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: use register/unregister functionality for PDISPLAY ISR
Ben Skeggs [Wed, 3 Nov 2010 00:27:27 +0000 (10:27 +1000)]
drm/nv50: use register/unregister functionality for PDISPLAY ISR

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv50: move GPIO ISR to nv50_gpio.c
Ben Skeggs [Wed, 3 Nov 2010 00:18:04 +0000 (10:18 +1000)]
drm/nv50: move GPIO ISR to nv50_gpio.c

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nv84: move PCRYPT ISR out of nouveau_irq.c
Ben Skeggs [Wed, 3 Nov 2010 00:06:43 +0000 (10:06 +1000)]
drm/nv84: move PCRYPT ISR out of nouveau_irq.c

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 years agodrm/nouveau: allow irq handlers to be installed by engine-specific code
Ben Skeggs [Tue, 2 Nov 2010 23:57:28 +0000 (09:57 +1000)]
drm/nouveau: allow irq handlers to be installed by engine-specific code

Lets start to clean up this mess!

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>