drm/nouveau/device: remove pci/platform_device from common struct
authorBen Skeggs <bskeggs@redhat.com>
Thu, 20 Aug 2015 04:54:23 +0000 (14:54 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 28 Aug 2015 02:40:49 +0000 (12:40 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
27 files changed:
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
drivers/gpu/drm/nouveau/nouveau_abi16.c
drivers/gpu/drm/nouveau/nouveau_acpi.c
drivers/gpu/drm/nouveau/nouveau_acpi.h
drivers/gpu/drm/nouveau/nouveau_agp.c
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_sysfs.c
drivers/gpu/drm/nouveau/nouveau_ttm.c
drivers/gpu/drm/nouveau/nv50_display.c
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c
drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
drivers/gpu/drm/nouveau/nvkm/engine/falcon.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/xtensa.c
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv04.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv41.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c
drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c

index 5741bf2..773951b 100644 (file)
@@ -47,13 +47,21 @@ enum nvkm_devidx {
        NVKM_ENGINE_SEC,
        NVKM_ENGINE_MSPDEC,
 
-       NVKM_SUBDEV_NR,
+       NVKM_SUBDEV_NR
+};
+
+enum nvkm_device_type {
+       NVKM_DEVICE_PCI,
+       NVKM_DEVICE_AGP,
+       NVKM_DEVICE_PCIE,
+       NVKM_DEVICE_TEGRA,
 };
 
 struct nvkm_device {
        const struct nvkm_device_func *func;
        const struct nvkm_device_quirk *quirk;
        struct device *dev;
+       enum nvkm_device_type type;
        u64 handle;
        const char *name;
        const char *cfgopt;
@@ -63,9 +71,6 @@ struct nvkm_device {
        struct mutex mutex;
        int refcount;
 
-       struct pci_dev *pdev;
-       struct platform_device *platformdev;
-
        void __iomem *pri;
 
        struct nvkm_event event;
@@ -150,6 +155,7 @@ struct nvkm_device_func {
        void (*fini)(struct nvkm_device *, bool suspend);
        resource_size_t (*resource_addr)(struct nvkm_device *, unsigned bar);
        resource_size_t (*resource_size)(struct nvkm_device *, unsigned bar);
+       bool cpu_coherent;
 };
 
 struct nvkm_device_quirk {
@@ -220,32 +226,6 @@ int nvkm_device_list(u64 *name, int size);
        _temp;                                                                 \
 })
 
-static inline bool
-nv_device_is_pci(struct nvkm_device *device)
-{
-       return device->pdev != NULL;
-}
-
-static inline bool
-nv_device_is_cpu_coherent(struct nvkm_device *device)
-{
-       return (!IS_ENABLED(CONFIG_ARM) && nv_device_is_pci(device));
-}
-
-static inline struct device *
-nv_device_base(struct nvkm_device *device)
-{
-       return nv_device_is_pci(device) ? &device->pdev->dev :
-                                         &device->platformdev->dev;
-}
-
-struct platform_device;
-
-enum nv_bus_type {
-       NVKM_BUS_PCI,
-       NVKM_BUS_PLATFORM,
-};
-
 void nvkm_device_del(struct nvkm_device **);
 
 struct nvkm_device_oclass {
index 40a903b..4252e77 100644 (file)
@@ -174,19 +174,19 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
                getparam->value = device->info.chipset;
                break;
        case NOUVEAU_GETPARAM_PCI_VENDOR:
-               if (nv_device_is_pci(nvxx_device(device)))
+               if (nvxx_device(device)->func->pci)
                        getparam->value = dev->pdev->vendor;
                else
                        getparam->value = 0;
                break;
        case NOUVEAU_GETPARAM_PCI_DEVICE:
-               if (nv_device_is_pci(nvxx_device(device)))
+               if (nvxx_device(device)->func->pci)
                        getparam->value = dev->pdev->device;
                else
                        getparam->value = 0;
                break;
        case NOUVEAU_GETPARAM_BUS_TYPE:
-               if (!nv_device_is_pci(nvxx_device(device)))
+               if (!nvxx_device(device)->func->pci)
                        getparam->value = 3;
                else
                if (drm_pci_device_is_agp(dev))
Simple merge
Simple merge
Simple merge