Skip to content

Commit

Permalink
drm/nouveau/device: namespace + nvidia gpu names (no binary change)
Browse files Browse the repository at this point in the history
The namespace of NVKM is being changed to nvkm_ instead of nouveau_,
which will be used for the DRM part of the driver.  This is being
done in order to make it very clear as to what part of the driver a
given symbol belongs to, and as a minor step towards splitting the
DRM driver out to be able to stand on its own (for virt).

Because there's already a large amount of churn here anyway, this is
as good a time as any to also switch to NVIDIA's device and chipset
naming to ease collaboration with them.

A comparison of objdump disassemblies proves no code changes.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Jan 22, 2015
1 parent a56866a commit 9719047
Show file tree
Hide file tree
Showing 20 changed files with 280 additions and 268 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/include/nvif/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void nvif_device_ref(struct nvif_device *, struct nvif_device **);
#define nvxx_wait_cb(a,b,c) nv_wait_cb(nvxx_timer(a), (b), (c))
#define nvxx_therm(a) nouveau_therm(nvxx_device(a))

#include <engine/device.h>
#include <core/device.h>
#include <engine/fifo.h>
#include <engine/gr.h>
#include <engine/sw.h>
Expand Down
14 changes: 14 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvkm/core/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,18 @@ nv_device_resource_len(struct nvkm_device *device, unsigned int bar);

int
nv_device_get_irq(struct nvkm_device *device, bool stall);

struct platform_device;

enum nv_bus_type {
NVKM_BUS_PCI,
NVKM_BUS_PLATFORM,
};

#define nvkm_device_create(p,t,n,s,c,d,u) \
nvkm_device_create_((void *)(p), (t), (n), (s), (c), (d), \
sizeof(**u), (void **)u)
int nvkm_device_create_(void *, enum nv_bus_type type, u64 name,
const char *sname, const char *cfg, const char *dbg,
int, void **);
#endif
2 changes: 2 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvkm/core/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,5 +253,7 @@
#define nouveau_gr nvkm_gr
#define nouveau_sw nvkm_sw
#define nouveau_sw_chan nvkm_sw_chan
#define nouveau_device_create nvkm_device_create
#define nouveau_device_create_ nvkm_device_create_

#endif
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/nouveau_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
remove_conflicting_framebuffers(aper, "nouveaufb", boot);
kfree(aper);

ret = nouveau_device_create(pdev, NOUVEAU_BUS_PCI,
ret = nouveau_device_create(pdev, NVKM_BUS_PCI,
nouveau_pci_name(pdev), pci_name(pdev),
nouveau_config, nouveau_debug, &device);
if (ret)
Expand Down Expand Up @@ -1056,7 +1056,7 @@ nouveau_platform_device_create_(struct platform_device *pdev, int size,
struct drm_device *drm;
int err;

err = nouveau_device_create_(pdev, NOUVEAU_BUS_PLATFORM,
err = nouveau_device_create_(pdev, NVKM_BUS_PLATFORM,
nouveau_platform_name(pdev),
dev_name(&pdev->dev), nouveau_config,
nouveau_debug, size, pobject);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/nvkm/engine/device/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ nvkm-y += nvkm/engine/device/nv20.o
nvkm-y += nvkm/engine/device/nv30.o
nvkm-y += nvkm/engine/device/nv40.o
nvkm-y += nvkm/engine/device/nv50.o
nvkm-y += nvkm/engine/device/nvc0.o
nvkm-y += nvkm/engine/device/nve0.o
nvkm-y += nvkm/engine/device/gf100.o
nvkm-y += nvkm/engine/device/gk104.o
nvkm-y += nvkm/engine/device/gm100.o
9 changes: 5 additions & 4 deletions drivers/gpu/drm/nouveau/nvkm/engine/device/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
*
* Authors: Ben Skeggs
*/

#include "acpi.h"

#include <core/device.h>

#ifdef CONFIG_ACPI
static int
nvkm_acpi_ntfy(struct notifier_block *nb, unsigned long val, void *data)
{
struct nouveau_device *device =
struct nvkm_device *device =
container_of(nb, typeof(*device), acpi.nb);
struct acpi_bus_event *info = data;

Expand All @@ -40,7 +41,7 @@ nvkm_acpi_ntfy(struct notifier_block *nb, unsigned long val, void *data)
#endif

int
nvkm_acpi_fini(struct nouveau_device *device, bool suspend)
nvkm_acpi_fini(struct nvkm_device *device, bool suspend)
{
#ifdef CONFIG_ACPI
unregister_acpi_notifier(&device->acpi.nb);
Expand All @@ -49,7 +50,7 @@ nvkm_acpi_fini(struct nouveau_device *device, bool suspend)
}

int
nvkm_acpi_init(struct nouveau_device *device)
nvkm_acpi_init(struct nvkm_device *device)
{
#ifdef CONFIG_ACPI
device->acpi.nb.notifier_call = nvkm_acpi_ntfy;
Expand Down
9 changes: 4 additions & 5 deletions drivers/gpu/drm/nouveau/nvkm/engine/device/acpi.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#ifndef __NVKM_DEVICE_ACPI_H__
#define __NVKM_DEVICE_ACPI_H__
#include <core/os.h>
struct nvkm_device;

#include <engine/device.h>

int nvkm_acpi_init(struct nouveau_device *);
int nvkm_acpi_fini(struct nouveau_device *, bool);

int nvkm_acpi_init(struct nvkm_device *);
int nvkm_acpi_fini(struct nvkm_device *, bool);
#endif
Loading

0 comments on commit 9719047

Please sign in to comment.