dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

21 Commits

Author SHA1 Message Date
Ben Skeggs a7dbf00433 drm/nouveau: allow creation of zero-sized mm
Useful for places where a given chipset may or may not have a given
resource, and we want to avoid having to spray checks for the mm's
existance around everywhere.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-31 11:22:51 +10:00
Marcin Slusarz d489738951 drm/nouveau: remove unused _nouveau_parent_ctor
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-09 13:50:33 +10:00
Ben Skeggs 7234d0230e drm/nouveau/devinit: fixup various issues with subdev ctor/init ordering
Details of the problem, and solution, are in comments in the commit
proper.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:17 +10:00
Martin Peres aa1b9b4836 drm/nouveau/therm: move thermal-related functions to the therm subdev
It looks scary because of the size, but I tried to keep the differences minimal.
Further patches will fix the actual "driver" code and add new features.

v2: change filenames, split to submodules

v3: add a missing include

v4: Ben Skeggs <bskeggs@redhat.com>
- fixed set_defaults() to allow min_duty < 30 (thermal table will
  override this if it's actually necessary)
- fixed set_defaults() to not provide pwm_freq so nv4x (which only has
  pwm_div) can actually work.  the boards using pwm_freq will have a
  thermal table entry to provide us the value.
- removed unused files

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:14 +10:00
Ben Skeggs fa6df8c163 drm/nouveau/core: have client-id be a string, rather than an integer
Can be somewhat more informative that way...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:10 +10:00
Ben Skeggs 2c1a425e7d drm/nve0/ibus: handle PIBUS interrupts to prevent storm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:07 +10:00
Marcin Slusarz e6626254f9 drm/nouveau: constify instances of nouveau_bitfield and nouveau_enum structs
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:06 +10:00
Ben Skeggs 9456f7d1be drm/nouveau: add defines for internal class names
Will probably flesh the documentation of the classes out a bit too at some
later point.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:05 +10:00
Ben Skeggs 368be5f1b8 drm/nv50/fifo: add support for dma channel class
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:05 +10:00
Ben Skeggs ab2858928b drm/nv84/fifo: add support for dma channel class
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:05 +10:00
Ben Skeggs a7c6e75eb2 drm/nouveau/fifo: version the dma channel class struct
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:04 +10:00
Ben Skeggs 503b0f1cd6 drm/nouveau/fifo: separate object classes for dma channels
Future code will use the object class rather than chipset checks in order to
identify available channel features.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:04 +10:00
Ben Skeggs 72a1482777 drm/nouveau: restore fifo chid information in engine error messages
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:03 +10:00
Ben Skeggs 4c2d42225b drm/nouveau/core: have fifo store a unique context identifier at attach time
This value will match something that's easily available from the engine IRQ
handlers, and used to lookup the relevant context.

Since the changes in how this is done on each generation match when the
major PFIFO changes happened, fifo is responsible for calculating the
correct value to avoid duplicating the same code among many engine modules.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:03 +10:00
Ben Skeggs 3acec63aee drm/nouveau/core: protect engine context list with hardirq-safe spinlock
IRQ handlers will need access to engine contexts.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:02 +10:00
Ben Skeggs dbff2dee9f drm/nve0/fifo: support engine selection when creating fifo channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:01 +10:00
Ben Skeggs c4837d2794 drm/nouveau/core: remove some left-over pieces from the porting process
Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:13:00 +10:00
Ben Skeggs ebb945a94b drm/nouveau: port all engines to new engine module format
This is a HUGE commit, but it's not nearly as bad as it looks - any problems
can be isolated to a particular chipset and engine combination.  It was
simply too difficult to port each one at a time, the compat layers are
*already* ridiculous.

Most of the changes here are simply to the glue, the process for each of the
engine modules was to start with a standard skeleton and copy+paste the old
code into the appropriate places, fixing up variable names etc as needed.

v2: Marcin Slusarz <marcin.slusarz@gmail.com>
- fix find/replace bug in license header

v3: Ben Skeggs <bskeggs@redhat.com>
- bump indirect pushbuf size to 8KiB, 4KiB barely enough for userspace and
  left no space for kernel's requirements during GEM pushbuf submission.
- fix duplicate assignments noticed by clang

v4: Marcin Slusarz <marcin.slusarz@gmail.com>
- add sparse annotations to nv04_fifo_pause/nv04_fifo_start
- use ioread32_native/iowrite32_native for fifo control registers

v5: Ben Skeggs <bskeggs@redhat.com>
- rebase on v3.6-rc4, modified to keep copy engine fix intact
- nv10/fence: unmap fence bo before destroying
- fixed fermi regression when using nvidia gr fuc
- fixed typo in supported dma_mask checking

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:12:56 +10:00
Ben Skeggs 496734bf03 drm/nouveau/core: add support for reverse mm allocations
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:12:48 +10:00
Ben Skeggs 9274f4a9ba drm/nouveau/core: pull in most of the new core infrastructure
This commit provides most of the infrastructure to support a major overhaul
of Nouveau's internals coming in the following commits.  This work aims to
take all the things we've learned over the last several years, and turn that
into a cleaner architecture that's more maintainable going forward.

RAMHT and MM bits of the new core have been left out for the moment, and
will be pulled in as I go through the process of porting the code to
become either subdev or engine modules.

There are several main goals I wanted to achieve through this work:

-- Reduce complexity

The goal here was to make each component of the driver as independent as
possible, which will ease maintainability and readability, and provide a
good base for resetting locked up GPU units in the future.

-- Better tracking of GPU units that are required at any given time

This is for future PM work, we'll be able to tell exactly what parts of the
GPU we need powered at any given point (etc).

-- Expose all available NVIDIA GPUs to the client

In order to support things such as multi-GPU channels, we want to be able
to expose all the NVIDIA GPUs to the client over a single file descriptor
so it can send a single push buffer to multiple GPUs.

-- Untangle the core hardware support code from the DRM implementation

This happened initially as an unexpected side-effect of developing the
initial core infrastructure in userspace, but it turned into a goal of
the whole project.  Initial benefits will be the availablility of a
number of userspace tools and tests using the same code as the driver
itself, but will also be important as I look into some virtualisation
ideas.

v2: Ben Skeggs <bskeggs@redhat.com>
- fix duplicate assignments noticed by clang
- implement some forgotten yelling in error path
- ensure 64-bit engine mask is used everywhere

v3: Marcin Slusarz <marcin.slusarz@gmail.com>
- sparse fixes
- inline nv_printk into nv_assert to prevent recursive inlining issues

v4: Ben Skeggs <bskeggs@redhat.com>
- fixed minor memory leak on gpuobj destruction

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:12:44 +10:00
Ben Skeggs 02a841d434 drm/nouveau: restructure source tree, split core from drm implementation
Future work will be headed in the way of separating the policy supplied by
the nouveau drm module from the mechanisms provided by the driver core.

There will be a couple of major classes (subdev, engine) of driver modules
that have clearly defined tasks, and the further directory structure change
is to reflect this.

No code changes here whatsoever, aside from fixing up a couple of include
file pathnames.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03 13:12:43 +10:00