Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47b2505e authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/platform: remove subclassing of nvkm_device



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent f2c906fc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -144,6 +144,8 @@ struct nvkm_device {
	struct nvkm_sw *sw;
	struct nvkm_engine *vic;
	struct nvkm_engine *vp;

	struct nouveau_platform_gpu *gpu;
};

struct nvkm_device *nvkm_device_find(u64 name);
+7 −7
Original line number Diff line number Diff line
@@ -1056,16 +1056,16 @@ nouveau_drm_pci_driver = {
};

struct drm_device *
nouveau_platform_device_create_(struct platform_device *pdev, int size,
				void **pobject)
nouveau_platform_device_create(struct platform_device *pdev,
			       struct nvkm_device **pdevice)
{
	struct drm_device *drm;
	int err;

	err = nvkm_device_create_(pdev, NVKM_BUS_PLATFORM,
	err = nvkm_device_create(pdev, NVKM_BUS_PLATFORM,
				 nouveau_platform_name(pdev),
				 dev_name(&pdev->dev), nouveau_config,
				  nouveau_debug, size, pobject);
				 nouveau_debug, pdevice);
	if (err)
		return ERR_PTR(err);

@@ -1085,7 +1085,7 @@ nouveau_platform_device_create_(struct platform_device *pdev, int size,
	return drm;

err_free:
	nvkm_object_ref(NULL, (struct nvkm_object **)pobject);
	nvkm_object_ref(NULL, (struct nvkm_object **)pdevice);

	return ERR_PTR(err);
}
+1 −4
Original line number Diff line number Diff line
@@ -182,11 +182,8 @@ nouveau_drm(struct drm_device *dev)
int nouveau_pmops_suspend(struct device *);
int nouveau_pmops_resume(struct device *);

#define nouveau_platform_device_create(p, u)                                   \
	nouveau_platform_device_create_(p, sizeof(**u), (void **)u)
struct drm_device *
nouveau_platform_device_create_(struct platform_device *pdev,
				int size, void **pobject);
nouveau_platform_device_create(struct platform_device *, struct nvkm_device **);
void nouveau_drm_device_remove(struct drm_device *dev);

#define NV_PRINTK(l,c,f,a...) do {                                             \
+3 −3
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ static void nouveau_platform_remove_iommu(struct device *dev,
static int nouveau_platform_probe(struct platform_device *pdev)
{
	struct nouveau_platform_gpu *gpu;
	struct nouveau_platform_device *device;
	struct nvkm_device *device;
	struct drm_device *drm;
	int err;

@@ -214,7 +214,7 @@ static int nouveau_platform_probe(struct platform_device *pdev)
	}

	device->gpu = gpu;
	device->gpu_speedo = tegra_sku_info.gpu_speedo_value;
	gpu->gpu_speedo = tegra_sku_info.gpu_speedo_value;

	err = drm_dev_register(drm, 0);
	if (err < 0)
@@ -237,7 +237,7 @@ static int nouveau_platform_remove(struct platform_device *pdev)
	struct drm_device *drm_dev = platform_get_drvdata(pdev);
	struct nouveau_drm *drm = nouveau_drm(drm_dev);
	struct nvkm_device *device = nvxx_device(&drm->device);
	struct nouveau_platform_gpu *gpu = nv_device_to_platform(device)->gpu;
	struct nouveau_platform_gpu *gpu = device->gpu;
	int err;

	nouveau_drm_device_remove(drm_dev);
+0 −10
Original line number Diff line number Diff line
@@ -54,19 +54,9 @@ struct nouveau_platform_gpu {
		struct iommu_domain *domain;
		unsigned long pgshift;
	} iommu;
};

struct nouveau_platform_device {
	struct nvkm_device device;

	struct nouveau_platform_gpu *gpu;

	int gpu_speedo;
};

#define nv_device_to_platform(d)                                               \
	container_of(d, struct nouveau_platform_device, device)

extern struct platform_driver nouveau_platform_driver;

#endif
Loading