Commit graph

222496 commits

Author SHA1 Message Date
Ben Skeggs
680a48720f drm/nvc0/pgraph: more unit names
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-31 12:21:56 +10:00
Ben Skeggs
ec9c0883ea drm/nvc0/pfifo: support for chipsets with only one PSUBFIFO (0xc1)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-31 12:11:50 +10:00
Ben Skeggs
2a55c9a7ff 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>
2010-12-30 11:55:07 +10:00
Ben Skeggs
6effe39364 drm/nv50: sync up gr data error names with rnn, use for nvc0 also
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-30 11:48:03 +10:00
Ben Skeggs
eae5e7f304 drm/nvc0: parse a couple more PGRAPH_INTR
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-30 11:40:07 +10:00
Ben Skeggs
93d0cd7b9e drm/nvc0: nuke left-over debug messages
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-29 10:51:34 +10:00
Ben Skeggs
b1cd916ab9 drm/nvc0: kill off a couple more magics
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-29 10:51:27 +10:00
Michel Hermier
8e91182bbd 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>
2010-12-27 10:41:01 +10:00
Ben Hutchings
c42988012a 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>
2010-12-27 10:40:47 +10:00
Ben Skeggs
183720b8af drm/nvc0: accelerate ttm buffer moves
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:18:44 +10:00
Ben Skeggs
6d86951a45 drm/nvc0: initial support for tiled buffer objects
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:18:42 +10:00
Ben Skeggs
ddbaf79a8b drm/nvc0: implement fbcon acceleration
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:18:39 +10:00
Ben Skeggs
966a5b7daa drm/nvc0: implement pgraph engine hooks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:18:32 +10:00
Ben Skeggs
b2b099388f drm/nvc0: implement pfifo engine hooks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:17:39 +10:00
Ben Skeggs
529c495912 drm/nvc0: implement fencing
Just simple REF_CNT fencing for the moment.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:17:36 +10:00
Ben Skeggs
96545299d7 drm/nvc0: fix channel dma init paths
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:17:34 +10:00
Ben Skeggs
5216782bf8 drm/nvc0: skip dma object creation for drm channel
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:17:31 +10:00
Ben Skeggs
effd6e066f drm/nvc0: implement channel structure initialisation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:17:28 +10:00
Ben Skeggs
7460d70355 drm/nvc0: gpuobj_new need only check validity and init the relevant engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:17:26 +10:00
Ben Skeggs
587107b690 drm/nvc0: reject the notifier_alloc ioctl
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:17:23 +10:00
Ben Skeggs
99805566d9 drm/nvc0: create shared channel vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:17:21 +10:00
Ben Skeggs
8984e04615 drm/nvc0: initial vm implementation, use for bar1/bar3 management
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:17:14 +10:00
Ben Skeggs
4c74eb7ff2 drm/nvc0: import initial vm backend
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:17:09 +10:00
Ben Skeggs
3ee0128140 drm/nouveau: modify vm to accomodate dual page tables for nvc0
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 17:17:01 +10:00
Ben Skeggs
147dc38e97 drm/nv50: add missing license header to nv50_fbcon.c
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 06:14:37 +10:00
Ben Skeggs
910d1b3a8c drm/nv50: fix smatch warning in nv50_vram.c
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 11:53:38 +10:00
Dan Carpenter
d095e23206 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>
2010-12-21 11:53:32 +10:00
Alex Deucher
b08ebe7e77 drm/radeon/kms: properly print ontario chip id
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-16 14:56:45 +10:00
Alex Deucher
b4183e301a 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>
2010-12-16 14:55:45 +10:00
Dave Airlie
ca9693a173 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.
  ...
2010-12-16 14:49:02 +10:00
Ben Skeggs
b921bae2ee 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>
2010-12-16 14:47:46 +10:00
Dave Airlie
99ee7fac18 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>
2010-12-16 14:37:47 +10:00
Francisco Jerez
c45aadabb9 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>
2010-12-16 10:34:43 +10:00
Francisco Jerez
fd70b6cd78 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>
2010-12-08 15:53:04 +10:00
Ben Skeggs
60d2a88ae8 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>
2010-12-08 13:48:20 +10:00
Ben Skeggs
34cf01bc4b drm/nouveau: allow gpuobj vinst to be a virtual address when necessary
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08 13:48:19 +10:00
Ben Skeggs
b571fe21f5 drm/nv50: tidy up PCIEGART implementation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08 13:48:17 +10:00
Ben Skeggs
5f6fdca570 drm/nv50: enable non-contig vram allocations where requested
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08 13:48:16 +10:00
Ben Skeggs
bfd83aca5a drm/nv50: enable 4KiB pages for small vram allocations
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08 13:48:15 +10:00
Ben Skeggs
4c13614298 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>
2010-12-08 13:48:13 +10:00
Ben Skeggs
f869ef8823 drm/nv50: implement BAR1/BAR3 management on top of new VM code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08 13:48:12 +10:00
Ben Skeggs
a11c3198c9 drm/nv50: import new vm code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08 13:48:10 +10:00
Ben Skeggs
573a2a37e8 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>
2010-12-08 13:48:07 +10:00
Francisco Jerez
937c3471cc 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>
2010-12-08 03:01:02 +01:00
Ben Skeggs
a8b214f007 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>
2010-12-08 03:00:38 +01:00
Ben Skeggs
7a45d764a8 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>
2010-12-08 03:00:37 +01:00
Ben Skeggs
a0fd9b9f68 drm/nouveau: no need to zero dma objects, we fill them completely anyway
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08 03:00:37 +01:00
Ben Skeggs
12fb952507 drm/nouveau: introduce a util function to wait on reg != val
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08 03:00:36 +01:00
Ben Skeggs
ceac30999d drm/nouveau: implicitly insert non-DMA objects into RAMHT
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08 03:00:35 +01:00
Ben Skeggs
d908175cca 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>
2010-12-08 03:00:34 +01:00