drm/nouveau/core: pull in most of the new core infrastructure
authorBen Skeggs <bskeggs@redhat.com>
Thu, 5 Jul 2012 21:36:43 +0000 (07:36 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 3 Oct 2012 03:12:44 +0000 (13:12 +1000)
commit9274f4a9ba7e70d1770e237fca16d52f27f0c728
tree21f87161e32f176acc1233af18642576c0987a5a
parentaa4cc5d274c09909fe32861825c2377d0ccb3bfd
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>
42 files changed:
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/core/core/client.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/core/engctx.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/core/engine.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/core/enum.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/core/gpuobj.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/core/handle.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/core/mm.c
drivers/gpu/drm/nouveau/core/core/namedb.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/core/object.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/core/option.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/core/parent.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/core/printk.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/core/subdev.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/class.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/client.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/debug.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/device.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/engctx.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/engine.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/enum.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/gpuobj.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/handle.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/math.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/mm.h
drivers/gpu/drm/nouveau/core/include/core/namedb.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/object.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/option.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/parent.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/printk.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/core/subdev.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/include/subdev/device.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/os.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/subdev/device/base.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/subdev/device/nv04.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/subdev/device/nv10.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/subdev/device/nv20.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/subdev/device/nv30.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/subdev/device/nv40.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/subdev/device/nv50.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/subdev/device/nvc0.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/subdev/device/nve0.c [new file with mode: 0644]