Commit graph

4693 commits

Author SHA1 Message Date
Ben Skeggs
24f246ac10 drm/nouveau: rework vram init/fini ordering a little
Commit "drm/nouveau: add some debug output if nouveau_mm busy at destroy time"
revealed an issue where vram mm takedown would actually fail due to there
still being nodes present, causing nouveau to leak a small amount of memory
on module unload.

This splits TTM/nouveau_mm a bit more cleanly and ensures nouveau_mm fini
isn't done until all gpuobjs are also destroyed.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:03:46 +10:00
Ben Skeggs
15ba79ad44 drm/nouveau: shut lockdep up if last vm ref needs to destroy pgd
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:01:52 +10:00
Ben Skeggs
06b75e3552 drm/nouveau: fix display takedown order to match reverse init order
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:01:47 +10:00
Ben Skeggs
5de8037ab4 drm/nvc0: enable per-client address spaces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:01:41 +10:00
Ben Skeggs
ad9ac437a5 drm/nouveau: add some debug output if nouveau_mm busy at destroy time
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:00:55 +10:00
Ben Skeggs
e41f26e7d1 drm/nv50: enable use of per-client gpu address space
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:00:47 +10:00
Ben Skeggs
2fd3db6f14 drm/nouveau: remove implicit mapping of every bo into chan_vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:00:42 +10:00
Ben Skeggs
7375c95b34 drm/nouveau: remove 'chan' argument from nouveau_bo_new
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:00:37 +10:00
Ben Skeggs
e758a31119 drm/nouveau: fixup gem_info ioctl to return client-specific bo virtual
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:00:32 +10:00
Ben Skeggs
3d483d575b drm/nvc0: explicitly map PDISP semaphore buffer into each channel's vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:00:27 +10:00
Ben Skeggs
9f9f51fcb9 drm/nv50-nvc0: lookup pushbuf virtual address on dma_push
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:00:22 +10:00
Ben Skeggs
d02836b4f5 drm/nv84-nvc0: explicitly map semaphore buffer into channel vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:00:17 +10:00
Ben Skeggs
ce163f6967 drm/nv50-nvc0: explicitly map pushbuf bo into channel vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:00:09 +10:00
Ben Skeggs
0b7187335f drm/nv50-nvc0: explicitly map notifier bo into channel vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 16:00:04 +10:00
Ben Skeggs
45143cb53c drm/nv50-nvc0: explicitly map fbcon fb into channel vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:59 +10:00
Ben Skeggs
fd2871af3d drm/nouveau: initial changes to support multiple VMAs per buffer object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:53 +10:00
Ben Skeggs
a3fcd0a975 drm/nv50-nvc0: completely disable relocs
GPU virtual addresses are constant now so this should never be getting hit
anyway and userspace shouldn't break from them being ignored.

This is being done in preference to teaching the code how to deal with BOs
that exist at different virtual addresses within separate VMs.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:49 +10:00
Ben Skeggs
180cc30637 drm/nouveau: convert bo.mem.start usage to bo.offset
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:44 +10:00
Ben Skeggs
07533ea549 drm/nouveau: convert some bo.offset use to vma.offset
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:39 +10:00
Ben Skeggs
d2f96666c5 drm/nouveau: create temp vmas for both src and dst of bo moves
Greatly simplifies a number of things, particularly once per-client GPU
address spaces are involved.

May add this back later once I know what things'll look like.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:34 +10:00
Ben Skeggs
f91bac5bf6 drm/nouveau: store bo's page size in nouveau_bo
Was previously assuming a page size of 4KiB unless a VMA was present to
override it.  Eventually, a buffer won't necessarily have a VMA at all at
some stages of its life, so we need to store this info elsewhere.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:27 +10:00
Ben Skeggs
111af5c100 drm/nouveau: skip move_notify() if bo does not have a vma attached
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:22 +10:00
Ben Skeggs
6e32fedc8b drm/nouveau: will need to specify channel for vm-ful gpuobj allocations
Abuses existing gpuobj_new() chan argument for this, which in turn forces
all NVOBJ_FLAG_VM allocations to be done from the global heap, not
suballocated from the channel's private heap.  Not a problem though in
practise.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:18 +10:00
Ben Skeggs
dd6a46cc92 drm/nouveau: initialise any vm for a channel before pushbuf/ntfy
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:12 +10:00
Ben Skeggs
b7cb6c01ee drm/nouveau: modify gpuobj/ntfy takedown ordering
gpuobj really needs splitting into channel/gpuobj code instead...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:07 +10:00
Ben Skeggs
639212d011 drm/nouveau/gem: implement stub hooks for GEM object open/close
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:59:02 +10:00
Ben Skeggs
f6d4e62145 drm/nouveau: remove 'chan' argument from nouveau_gem_new
Userspace hasn't passed us a channel_hint for a long long time now, and
there isn't actually a need to do so anymore anyway.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:58:56 +10:00
Ben Skeggs
0320d7910b drm/nv50-nvc0/chan: inherit vm from fpriv, rather than chan_vm directly
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:58:52 +10:00
Ben Skeggs
fe32b16e79 drm/nv50-nvc0/vm: take client reference on shared channel vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:58:46 +10:00
Ben Skeggs
b79181cbad drm/nv50-nvc0/vm: don't touch chan_vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:58:40 +10:00
Ben Skeggs
d359d51cba drm/nouveau: no need to update bo.offset from vma after validate
On chipsets using nouveau_vm, the virtual address stays constant, so
the value set at bo creation time is fine.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:58:32 +10:00
Ben Skeggs
e8a863c10f drm/nouveau: store a per-client channel list
Removes the need to disable IRQs to lookup channel struct on every pushbuf
ioctl, among others.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:58:25 +10:00
Ben Skeggs
f8656f0baa drm/nouveau: use NULL file_priv for DRM-created channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:58:20 +10:00
Ben Skeggs
3f0a68d8f8 drm/nouveau: allocate structure to store per-client data
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:58:15 +10:00
Ben Skeggs
1562ffde94 drm/nouveau: silence error for missing dac loadval table
There's lots of boards (all recent ones) that don't have this anymore, so
punt the message to debug loglevel.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:58:10 +10:00
Ben Skeggs
e540afc325 drm/nv50: DCB table quirks for another busted XFX board
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:58:04 +10:00
Ben Skeggs
ad830d23d3 drm/nouveau: log if accel is disabled by default on a chipset
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:58:00 +10:00
Ben Skeggs
752ab0a092 drm/nvc0/gr: fill in some more data for 0xc1/0xc8/0xce
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:56 +10:00
Ben Skeggs
2b6f1c5f17 drm/nvc0/gr: fix typo in class9197 init
Reported-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:51 +10:00
Ben Skeggs
066d65db11 drm/nvc0/gr: calculate magicgpc918 ourselves
Not a clue what it is yet, but we get the same numbers as NVIDIA now.

My 465 didn't seem to care to greatly *what* I bashed into these registers..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:48 +10:00
Ben Skeggs
a219997a3b drm/nvc0/gr: add some missing magics for 0xc1/0xc8/0xce
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:43 +10:00
Ben Skeggs
0411de8548 drm/nvc0/gr: import and use our own fuc by default
The ability to use NVIDIA's fuc has been retained *temporarily* in order
to better debug any issues that may be lingering in our initial attempt
at writing this ucode.  Once I'm fairly confident we're okay, it'll be
removed.

There's a number of things not implemented by this fuc currently, but
most of it is sets of state that our context setup would not have used
anyway.  No doubt we'll find out what they're for at some point, and
implement it if required.

This has been tested on 0xc0/0xc4 thus far, and from what I could tell
it worked as well as NVIDIA's.  It's also been tested on 0xc1, but even
with NVIDIA's fuc that chipset doesn't work correctly with nouveau yet.

0xc3/0xc8/0xce should in theory be supported too, but I don't have the
hardware to check that.

There's no doubt numerous bugs to squash yet, please report any!

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:38 +10:00
Ben Skeggs
f8522fc80f drm/nvc0: fix suspend/resume of PGRAPH/PCOPYn
We need the physical VRAM address in vinst, even for objects mapped into
a vm, as the gpuobj suspend/resume code uses PMEM to access the object.

Previously, vinst was overloaded to mean "VRAM address" for !VM objects,
and "VM address" for VM objects, causing the wrong data to be accessed
during suspend/resume.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:33 +10:00
Ben Skeggs
aba99a8400 drm/nouveau: default to noaccel on 0xc1/0xc8/0xce for now
Until we know these should work properly, would much rather default to
noaccel than risk giving people corruption/hangs out of the box..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:28 +10:00
Ben Skeggs
d4409cc7e2 drm/nvc1/gr: switch on acceleration support
There's issues with certain 3D apps still, unknown whether this is a kernel
issue or not.. It does appear that it may be in the 3D driver however.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:25 +10:00
Ben Skeggs
b53a2d0649 drm/nvc0/gr: enable 0xc8/0xce support, no idea if it works or not..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:20 +10:00
Ben Skeggs
e1b89b1ca5 drm/nvc0/gr: some initial state modifications
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:16 +10:00
Ben Skeggs
6f376460e4 drm/nvc0/gr: 0x9197/0x9297 state init
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:11 +10:00
Ben Skeggs
847adea2c7 drm/nvc0/gr: macro to determine fermi class, will use it in a few places
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:07 +10:00
Ben Skeggs
068da16198 drm/nvc0/fifo: fix typos in unload_context
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-23 15:57:03 +10:00