Displaying 3 results from an estimated 3 matches for "nouveau_to_drm_dev".
2020 Nov 06
4
[PATCH 0/3] drm/nouveau: extend the lifetime of nouveau_drm
Hi folks,
Currently, when the device is removed (or the driver is unbound) the
nouveau_drm structure de-allocated. However, it's still accessible from
and used by some DRM layer callbacks. For example, file handles can be
closed after the device has been removed (physically or otherwise). This
series converts the Nouveau device structure to be allocated and
de-allocated with the
2020 Nov 06
2
[PATCH 2/3] drm/nouveau: manage nouveau_drm lifetime with devres
...- ret = PTR_ERR(drm_dev);
> + nv_dev = devm_drm_dev_alloc(&pdev->dev, &driver_stub, typeof(*nv_dev), drm_dev);
> + if (IS_ERR(nv_dev)) {
> + ret = PTR_ERR(nv_dev);
> goto fail_nvkm;
> }
> + drm_dev = nouveau_to_drm_dev(nv_dev);
>
> ret = pci_enable_device(pdev);
> if (ret)
> - goto fail_drm;
> + goto fail_nvkm;
>
> drm_dev->pdev = pdev;
> pci_set_drvdata(pdev, drm_dev);
> @@ -778,8 +775,6 @@ static int nouveau_drm_probe(stru...
2020 Nov 06
0
[PATCH 2/3] drm/nouveau: manage nouveau_drm lifetime with devres
...IC;
- drm_dev = drm_dev_alloc(&driver_pci, &pdev->dev);
- if (IS_ERR(drm_dev)) {
- ret = PTR_ERR(drm_dev);
+ nv_dev = devm_drm_dev_alloc(&pdev->dev, &driver_stub, typeof(*nv_dev), drm_dev);
+ if (IS_ERR(nv_dev)) {
+ ret = PTR_ERR(nv_dev);
goto fail_nvkm;
}
+ drm_dev = nouveau_to_drm_dev(nv_dev);
ret = pci_enable_device(pdev);
if (ret)
- goto fail_drm;
+ goto fail_nvkm;
drm_dev->pdev = pdev;
pci_set_drvdata(pdev, drm_dev);
@@ -778,8 +775,6 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
nouveau_drm_device_fini(drm_dev);
fail_pci:
pci_disable_device(pdev)...