Commit Graph

347 Commits

Author SHA1 Message Date
Ben Skeggs
c4266a9c7b drm/nouveau/pci/nv46: attempt to fix msi, and re-enable by default
Was not able to obtain a trace of NVRM due to kernel version annoyances,
however, experimentally confirmed that the WAR we use on NV50/G8x boards
works here too.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-11-03 15:02:18 +10:00
Ben Skeggs
b31505c472 drm/nouveau/pci/g94: split implementation from nv40
An upcoming patch will implement functionality that we don't use on any
NV40 chipset.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-11-03 15:02:18 +10:00
Ben Skeggs
3e55b53bc7 drm/nouveau/pci/g84: split implementation from nv50
An upcoming patch will implement functionality that we don't use on the
original NV50.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-11-03 15:02:18 +10:00
Samuel Pitoiset
b6afa2650c drm/nouveau/ibus/gf100: increase wait timeout to avoid read faults
Increase clock timeout of some unknown engines in order to avoid failure
at high gpcclk rate.

This fixes IBUS read faults on my GF119 when reclocking is manually
enabled. Note that memory reclocking is completely broken and NvMemExec
has to be disabled to allow core clock reclocking only.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-11-03 15:02:18 +10:00
Martin Peres
1531dbbb56 drm/nouveau/volt/gk104: add support for pwm and gpio modes
Most Keplers actually use the GPIO-based voltage management instead of the new
PWM-based one. Use the GPIO mode as a fallback as it already gracefully handles
the case where no GPIOs exist.

All the Maxwells seem to use the PWM method though.

v2:
 - Do not forget to commit the PWM configuration change!

Signed-off-by: Martin Peres <martin.peres@free.fr>
2015-11-03 15:02:18 +10:00
Martin Peres
7bddeba966 drm/nouveau/bios/volt: add support for pwm-based volt management
Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-11-03 15:02:18 +10:00
Alexandre Courbot
e396ecd178 drm/nouveau/platform: allow to specify the IOMMU bit
Current Tegra code taking advantage of the IOMMU assumes a hardcoded
value for the IOMMU bit. Make it a platform property instead for
flexibility.

v2 (Ben Skeggs): remove nvkm dependence on drm structures

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-11-03 15:02:18 +10:00
Alexandre Courbot
a0a49bac2f drm/nouveau/ltc/gf100: add flush/invalidate functions
Allow clients to manually flush and invalidate L2. This will be useful
for Tegra systems for which we want to write instmem using the CPU.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-11-03 15:02:18 +10:00
Alexandre Courbot
38a8fc78d0 drm/nouveau/ltc: add hooks for invalidate and flush
These are useful for systems without a coherent CPU/GPU bus. For such
systems we may need to maintain the L2 ourselves.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-11-03 15:02:18 +10:00
Alexandre Courbot
542f60dc84 drm/nouveau/timer: re-introduce nvkm_wait_xsec macros
Reintroduce macros allowing us to test a register against a certain
mask, since this is the most common usage pattern for the more generic
nvkm_xsec macros and makes the code more concise and readable.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-11-03 15:02:18 +10:00
Ben Skeggs
43a70661ea drm/nouveau/tegra: merge platform setup from nouveau drm
The copyright header in nvkm/engine/device/platform.c has been replaced
with the NVIDIA one from drm/nouveau_platform.c, as most of the actual
code is now theirs.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:49 +10:00
Ben Skeggs
340b0e7c50 drm/nouveau/pci: merge agp handling from nouveau drm
This commit reinstates the pre-DEVINIT AGP fiddling that was broken in
an earlier commit.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:49 +10:00
Ben Skeggs
26c9e8effe drm/nouveau/device: remove pci/platform_device from common struct
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:49 +10:00
Ben Skeggs
c7af0ff0e8 drm/nouveau/device: import pciid list and integrate quirks with it
PCI IDs taken from the NVIDIA binary driver, with permission.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:48 +10:00
Ben Skeggs
7e8820fed7 drm/nouveau/device: cleaner abstraction for device resource functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:48 +10:00
Ben Skeggs
2b700825e7 drm/nouveau/mc: move device irq handling to platform-specific code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:48 +10:00
Ben Skeggs
d4c4cc8373 drm/nouveau/mc: abstract interface to master intr registers
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:48 +10:00
Ben Skeggs
0a34fb3149 drm/nouveau/pci: new subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:48 +10:00
Ben Skeggs
fbd58ebda9 drm/nouveau/object: merge with handle
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
68f3f702b6 drm/nouveau/core: remove the remainder of the previous style
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
7624fc011e drm/nouveau/mpeg: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
6f41c7c569 drm/nouveau/sw: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
97070f23c6 drm/nouveau/pm: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
c85ee6ca79 drm/nouveau/gr: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
13de7f4629 drm/nouveau/fifo: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:46 +10:00
Ben Skeggs
70aa8670e5 drm/nouveau/disp: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:46 +10:00
Ben Skeggs
bd70563f01 drm/nouveau/dma: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:46 +10:00
Ben Skeggs
14d74acafb drm/nouveau/cipher: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:46 +10:00
Ben Skeggs
e5b31ca632 drm/nouveau/ce: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:46 +10:00
Ben Skeggs
98b20c9ab8 drm/nouveau/xtensa: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
53e60da43a drm/nouveau/falcon: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
437b2296ce drm/nouveau/volt: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
31649ecf47 drm/nouveau/tmr: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
57113c0170 drm/nouveau/therm: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
e2ca4e7d6e drm/nouveau/pmu: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
a4f7bd3608 drm/nouveau/mxm: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
c9582455ab drm/nouveau/mmu: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
54dcadd5b6 drm/nouveau/mc: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
70bc7182cb drm/nouveau/ltc: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
b7a2bc1886 drm/nouveau/imem: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
8de65bd090 drm/nouveau/devinit: run devinit scripts right after preinit
This ensures we have a valid mask of disabled engines before we start
trying to execute fini()/init() on the subdevs, potentially touching
devices that don't exist.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
551d341755 drm/nouveau/ibus: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
49bd8da513 drm/nouveau/i2c: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:43 +10:00
Ben Skeggs
2ea7249fe2 drm/nouveau/gpio: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:43 +10:00
Ben Skeggs
c5fcafa528 drm/nouveau/fuse: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:43 +10:00
Ben Skeggs
03c8952fb3 drm/nouveau/fb: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:43 +10:00
Ben Skeggs
151abd44c2 drm/nouveau/devinit: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:43 +10:00
Ben Skeggs
6625f55c08 drm/nouveau/clk: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
bb23f9d791 drm/nouveau/bus: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
46484438ab drm/nouveau/bios: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
3293228174 drm/nouveau/bar: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
ef8bc5760b drm/nouveau/core: kill some (now) dead code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
07b9e6cc95 drm/nouveau/sw: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
5ffeb84b8e drm/nouveau/pm: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
218f978d43 drm/nouveau/mpeg: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
27f3d6cf80 drm/nouveau/gr: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
b3c9815047 drm/nouveau/cipher: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
e5ff112781 drm/nouveau/ce: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
c79a191b27 drm/nouveau/xtensa: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
9d498e0f7a drm/nouveau/falcon: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
8f0649b5c6 drm/nouveau/fifo: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
9a65a38c45 drm/nouveau/fifo: split user classes out from engine implementations
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
0ce41e3c66 drm/nouveau/disp: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
2a7909c0ad drm/nouveau/disp: split user classes out from engine implementations
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
0710cc3148 drm/nouveau/dma: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
19fef52d93 drm/nouveau/dma: split user classes out from engine implementations
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:39 +10:00
Ben Skeggs
0e29998a89 drm/nouveau/device: convert ctrl class to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:39 +10:00
Ben Skeggs
2a9f847f5d drm/nouveau/device: convert user class to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:39 +10:00
Ben Skeggs
24bd0930be drm/nouveau/client: convert to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:39 +10:00
Ben Skeggs
6157091177 drm/nouveau/sw: remove dependence on namedb/engctx lookup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:39 +10:00
Ben Skeggs
a83d8872fc drm/nouveau/falcon: remove dependence on namedb/engctx lookup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:38 +10:00
Ben Skeggs
344c2d429d drm/nouveau/fb: remove dependence on namedb/engctx lookup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:38 +10:00
Ben Skeggs
898a2b3213 drm/nouveau/sw: turn flip completion into an event
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:38 +10:00
Ben Skeggs
cd459e7776 drm/nouveau/sw/nv04: replace direct context access with GetRef method
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:37 +10:00
Ben Skeggs
1d2a1e5386 drm/nouveau/ramht: remove dependence on namedb
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:37 +10:00
Ben Skeggs
f027f49166 drm/nouveau/gpuobj: separate allocation from nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:37 +10:00
Ben Skeggs
358ce601ae drm/nouveau/fifo: directly use instmem for runlists and polling areas
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:37 +10:00
Ben Skeggs
faf468981e drm/nouveau/xtensa: directly use instmem for ucode image
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:37 +10:00
Ben Skeggs
406ca8c714 drm/nouveau/falcon: directly use instmem for ucode image
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:36 +10:00
Ben Skeggs
5b1ab0c2c7 drm/nouveau/imem/nv04-nv40: directly use instmem for vbios/ramfc/ramro
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:36 +10:00
Ben Skeggs
d0659d3277 drm/nouveau/mmu: directly use instmem for page tables
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:36 +10:00
Ben Skeggs
d8e83994aa drm/nouveau/imem: improve management of instance memory
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:36 +10:00
Ben Skeggs
1de68568d6 drm/nouveau/mmu: protect each vm with its own mutex
An upcoming commit requires being able to modify the PRAMIN BAR page
tables while already holding the MMU subdev mutex.

To solve this issue, each VM has been given its own mutex.  As a nice
side-effect, this also allows separate VMs to be updated concurrently.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:35 +10:00
Ben Skeggs
524bdbf202 drm/nouveau/core: prepare for new-style objects
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:35 +10:00
Ben Skeggs
6cf813fb26 drm/nouveau/device: prepare for new-style subdevs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:35 +10:00
Ben Skeggs
7974dd1bdb drm/nouveau/device: separate construction of pci/tegra devices
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:34 +10:00
Ben Skeggs
168c2e213d drm/nouveau/engine: implement support for new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:34 +10:00
Ben Skeggs
f0290215c4 drm/nouveau/subdev: implement support for new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:34 +10:00
Ben Skeggs
cbea21e2ab drm/nouveau/object: implement support for new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:34 +10:00
Ben Skeggs
89c651e221 drm/nouveau/engine: rename some functions to avoid upcoming conflicts
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:34 +10:00
Ben Skeggs
3a8c3400f3 drm/nouveau/subdev: rename some functions to avoid upcoming conflicts
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:33 +10:00
Ben Skeggs
aa35888ff0 drm/nouveau/object: rename some functions to avoid upcoming conflicts
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:33 +10:00
Ben Skeggs
d61f4c178c drm/nouveau/nvif: device time mthd
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:33 +10:00
Ben Skeggs
159045cdc4 drm/nouveau/nvif: replace pushbuf with vm in fermi/kepler gpfifo class args
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:33 +10:00
Ben Skeggs
22827fa42b drm/nouveau/nvif: return chipset/board names from device info method
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:33 +10:00
Ben Skeggs
41a634064d drm/nouveau/nvif: return min/max versions for supported object classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
f58ddf9581 drm/nouveau/nvif: assign internal class identifiers to sw classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
315a8b2edf drm/nouveau/nvif: use negative oclass identifier for internal classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
99d4d36ad6 drm/nouveau/nvif: extend nop ioctl to return nvif version identifier
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
bf81df9be2 drm/nouveau/nvif: replace path-based object identification
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
a01ca78c8f drm/nouveau/nvif: simplify and tidy library interfaces
A variety of tweaks to the NVIF library interfaces, mostly ripping out
things that turned out to be not so useful.

- Removed refcounting from nvif_object, callers are expected to not be
  stupid instead.
- nvif_client is directly reachable from anything derived from nvif_object,
  removing the need for heuristics to locate it
- _new() versions of interfaces, that allocate memory for the object
  they construct, have been removed.  The vast majority of callers used
  the embedded _init() interfaces.
- No longer storing constructor arguments (and the data returned from
  nvkm) inside nvif_object, it's more or less unused and just wastes
  memory.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
4e7e62d607 drm/nouveau/client: store default device by handle, not reference
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:31 +10:00
Ben Skeggs
102b49da15 drm/nouveau/parent: remove some (now) unnecessary special-case handling
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:31 +10:00
Ben Skeggs
493f189dc0 drm/nouveau/object: store object type data outside of handle
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:31 +10:00
Ben Skeggs
a1e8873622 drm/nouveau/device: decouple from engine machinery
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:31 +10:00
Ben Skeggs
0ac9d210a1 drm/nouveau/device: simplify subdev construction
Replaces the piece-by-piece (in response to NV_DEVICE ctor args) device
contruction with a once-off all-or-nothing approach, eliminating some
tricky refcounting issues.  The partial device init capability was only
required by some tools, and has been moved to probe time instead.

Temporarily removes a workaround for some boards where we need to fiddle
with AGP registers before executing the DEVINIT scripts.  A later commit
in this series reinstates it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:31 +10:00
Ben Skeggs
e781dc8f6c drm/nouveau/device: tidy ctor/dtor interfaces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:30 +10:00
Ben Skeggs
76ecea5b4b drm/nouveau/client: tidy ctor/dtor interfaces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:30 +10:00
Ben Skeggs
47b2505efb drm/nouveau/platform: remove subclassing of nvkm_device
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:30 +10:00
Ben Skeggs
f2c906fc0c drm/nouveau/disp: transition outp/conn away from being based on nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:30 +10:00
Ben Skeggs
2aa5eac516 drm/nouveau/i2c: transition pad/ports away from being based on nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:29 +10:00
Ben Skeggs
d36a99d2da drm/nouveau/fb: transition nvkm_ram away from being based on nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:29 +10:00
Ben Skeggs
a8dae9fe0e drm/nouveau/vga: require nvkm_device pointer in accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:29 +10:00
Ben Skeggs
95cf469cc3 drm/nouveau/imem: use object accessor function for suspend/resume
Very much not ideal, but this will be improved later.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:29 +10:00
Ben Skeggs
cfdc4c44b4 drm/nouveau/core: wrap direct use of object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:29 +10:00
Ben Skeggs
384af9acea drm/nouveau/gpuobj: type-safe accessor macros
These require an explicit struct nvkm_gpuobj pointer, unlike the previous
macros which take a void *, and work with any nvkm_object.

New semantics require acquiring/releasing a gpuobj before accessing them,
which will be made use of in later patches to greatly reduce the overhead
of accesses, particularly when a direct mmio mapping of the object is not
available (suspend/resume, out of ioremap() space, and on GK20A).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:27 +10:00
Ben Skeggs
9ccdc76006 drm/nouveau/xtensa: remove object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:27 +10:00
Ben Skeggs
63902181a7 drm/nouveau/falcon: remove object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:27 +10:00
Ben Skeggs
a47474261e drm/nouveau/imem: remove object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:26 +10:00
Ben Skeggs
7e24c1145a drm/nouveau/fuse: remove object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:26 +10:00
Ben Skeggs
7f5f518fd7 drm/nouveau/bios: remove object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:26 +10:00
Ben Skeggs
5300394106 drm/nouveau/core: remove last printks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:26 +10:00
Ben Skeggs
9e3911e5b2 drm/nouveau/sec: switch to subdev printk macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:26 +10:00
Ben Skeggs
109c2f2f1c drm/nouveau/gr: switch to subdev printk macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:25 +10:00
Ben Skeggs
6594363b9f drm/nouveau/core: type-safe printk macros
These require an explicit pointers to nvkm_object/nvkm_subdev/nvkm_device,
depending on which macros are used.  This is unlike the previous macros
which take a void *, and work for anything derived from nvkm_object (by
way of some awful heuristics).

The output will be a bit confused until everything has been transitioned,
as the logging format used is a more standard style that previously.

In addition, usage of pr_cont(), which doesn't work correctly with the
dev_*() printk functions (and was potentially racy to begin with), will
be replaced.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:21 +10:00
Ben Skeggs
5444204036 drm/nouveau: switch to new-style timer macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:21 +10:00
Ben Skeggs
56f67dc196 drm/nouveau/tmr: type-safe PTIMER-based delay/wait macros
These require an explicit struct nvkm_device pointer, unlike the previous
macros which take a void *, and work for (almost) anything derived from
nvkm_object by using some heuristics.

These macros are more general than the previous ones, and can be used to
handle PTIMER-based busy-waits (will be used in later devinit fixes) as
well as more complicated wait conditions.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:19 +10:00
Ben Skeggs
2ebfa1bc6f drm/nouveau/kms/nv04: fix incorrect use of register accessors
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:19 +10:00
Ben Skeggs
dd64694208 drm/nouveau/device: type-safe register accessor macros
These require an explit struct nvkm_device pointer, unlike the previous
macros which take a void *, and assume it's any old nvkm_subdev.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:13 +10:00
Ben Skeggs
226dcefe70 drm/nouveau/sw: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:13 +10:00
Ben Skeggs
8c1aeaa139 drm/nouveau/pm: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:12 +10:00
Ben Skeggs
11271f9f8f drm/nouveau/mspdec: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:12 +10:00
Ben Skeggs
b19de4f3d7 drm/nouveau/mpeg: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:12 +10:00
Ben Skeggs
bfee3f3d97 drm/nouveau/gr: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:11 +10:00
Ben Skeggs
6189f1b093 drm/nouveau/fifo: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:11 +10:00
Ben Skeggs
a317aa21be drm/nouveau/dma: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:11 +10:00
Ben Skeggs
fd166a1832 drm/nouveau/disp: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:11 +10:00
Ben Skeggs
d9261a6837 drm/nouveau/ce: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:11 +10:00
Ben Skeggs
f0961867b8 drm/nouveau/xtensa: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:10 +10:00
Ben Skeggs
b26ada6fed drm/nouveau/falcon: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:10 +10:00
Ben Skeggs
6052dc5775 drm/nouveau/volt: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:10 +10:00
Ben Skeggs
cb8bb9cedb drm/nouveau/tmr: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:09 +10:00
Ben Skeggs
da06b46b72 drm/nouveau/therm: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:09 +10:00
Ben Skeggs
5a7d1e22fe drm/nouveau/pmu: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:09 +10:00
Ben Skeggs
2d9d5889e8 drm/nouveau/mxm: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:09 +10:00
Ben Skeggs
1f5bffca22 drm/nouveau/mmu: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:09 +10:00
Ben Skeggs
2ca0ddbc03 drm/nouveau/mc: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:09 +10:00
Ben Skeggs
c7750cfbc1 drm/nouveau/ltc: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:09 +10:00
Ben Skeggs
c44c06aeeb drm/nouveau/imem: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:08 +10:00
Ben Skeggs
ac51596f27 drm/nouveau/ibus: cosmetic changes
This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:08 +10:00