search for: qxl_device_init

Displaying 20 results from an estimated 37 matches for "qxl_device_init".

2018 Jul 27
1
[PATCH] drm: qxl: Fix error handling at qxl_device_init
If qxl_device_init fails on creating resources and does not report it, then qxl module will catch null pointer exception on remove, or on probe's error path. The patch adds error path with resources release into qxl_device_init. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anto...
2020 Apr 15
2
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...turn -ENOMEM; + } ret = pci_enable_device(pdev); if (ret) - goto free_dev; + return ret; ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qxl"); if (ret) @@ -101,7 +104,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } } - ret = qxl_device_init(qdev, &qxl_driver, pdev); + ret = qxl_device_init(qdev, pdev); if (ret) goto put_vga; @@ -128,8 +131,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) vga_put(pdev, VGA_RSRC_LEGACY_IO); disable_pci: pci_disable_device(pdev); -free_dev: - kfree(qdev); + ret...
2020 Apr 15
2
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...turn -ENOMEM; + } ret = pci_enable_device(pdev); if (ret) - goto free_dev; + return ret; ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qxl"); if (ret) @@ -101,7 +104,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } } - ret = qxl_device_init(qdev, &qxl_driver, pdev); + ret = qxl_device_init(qdev, pdev); if (ret) goto put_vga; @@ -128,8 +131,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) vga_put(pdev, VGA_RSRC_LEGACY_IO); disable_pci: pci_disable_device(pdev); -free_dev: - kfree(qdev); + ret...
2020 Apr 03
3
[PATCH 30/44] drm/qxl: Use devm_drm_dev_alloc
...turn -ENOMEM; + } ret = pci_enable_device(pdev); if (ret) - goto free_dev; + return ret; ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qxl"); if (ret) @@ -101,7 +104,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } } - ret = qxl_device_init(qdev, &qxl_driver, pdev); + ret = qxl_device_init(qdev, pdev); if (ret) goto put_vga; @@ -128,8 +131,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) vga_put(pdev, VGA_RSRC_LEGACY_IO); disable_pci: pci_disable_device(pdev); -free_dev: - kfree(qdev); + ret...
2020 Apr 03
3
[PATCH 30/44] drm/qxl: Use devm_drm_dev_alloc
...turn -ENOMEM; + } ret = pci_enable_device(pdev); if (ret) - goto free_dev; + return ret; ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qxl"); if (ret) @@ -101,7 +104,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } } - ret = qxl_device_init(qdev, &qxl_driver, pdev); + ret = qxl_device_init(qdev, pdev); if (ret) goto put_vga; @@ -128,8 +131,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) vga_put(pdev, VGA_RSRC_LEGACY_IO); disable_pci: pci_disable_device(pdev); -free_dev: - kfree(qdev); + ret...
2020 Apr 28
2
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...ot;Unable to init drm dev"); > > return -ENOMEM; > > + } > > The other patches do not add any error message when devm_drm_dev_alloc() > fails and driver core will log that driver init failed. > > So the pr_err() above should be dropped. > I know it comes from qxl_device_init() but that does not make it a good > idea. Hm I know we're inconsistent here, but some drivers have error logging on all branches, some dont. I'm just trying to go with the prevailing style. > With this fixed: Insisting on this or ok as-is? -Daniel > Acked-by: Sam Ravnborg <...
2020 Apr 28
2
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...ot;Unable to init drm dev"); > > return -ENOMEM; > > + } > > The other patches do not add any error message when devm_drm_dev_alloc() > fails and driver core will log that driver init failed. > > So the pr_err() above should be dropped. > I know it comes from qxl_device_init() but that does not make it a good > idea. Hm I know we're inconsistent here, but some drivers have error logging on all branches, some dont. I'm just trying to go with the prevailing style. > With this fixed: Insisting on this or ok as-is? -Daniel > Acked-by: Sam Ravnborg <...
2020 Feb 14
0
[PATCH AUTOSEL 5.5 007/542] drm/qxl: Complete exception handling in qxl_device_init()
...specified in an if branch. The corresponding function call did not release the desired system resource then. Thus use the label ?rom_unmap? instead to fix the exception handling for this function implementation. Fixes: 5043348a4969ae1661c008efe929abd0d76e3792 ("drm: qxl: Fix error handling at qxl_device_init") Signed-off-by: Markus Elfring <elfring at users.sourceforge.net> Link: http://patchwork.freedesktop.org/patch/msgid/5e5ef9c4-4d85-3c93-cf28-42cfcb5b0649 at web.de Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> Signed-off-by: Sasha Levin <sashal at kernel.org> --- driv...
2020 Feb 14
0
[PATCH AUTOSEL 5.4 005/459] drm/qxl: Complete exception handling in qxl_device_init()
...specified in an if branch. The corresponding function call did not release the desired system resource then. Thus use the label ?rom_unmap? instead to fix the exception handling for this function implementation. Fixes: 5043348a4969ae1661c008efe929abd0d76e3792 ("drm: qxl: Fix error handling at qxl_device_init") Signed-off-by: Markus Elfring <elfring at users.sourceforge.net> Link: http://patchwork.freedesktop.org/patch/msgid/5e5ef9c4-4d85-3c93-cf28-42cfcb5b0649 at web.de Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> Signed-off-by: Sasha Levin <sashal at kernel.org> --- driv...
2020 Apr 24
0
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...+ if (IS_ERR(qdev)) { > + pr_err("Unable to init drm dev"); > return -ENOMEM; > + } The other patches do not add any error message when devm_drm_dev_alloc() fails and driver core will log that driver init failed. So the pr_err() above should be dropped. I know it comes from qxl_device_init() but that does not make it a good idea. With this fixed: Acked-by: Sam Ravnborg <sam at ravnborg.org> > > ret = pci_enable_device(pdev); > if (ret) > - goto free_dev; > + return ret; > > ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qx...
2020 Apr 06
0
[PATCH 30/44] drm/qxl: Use devm_drm_dev_alloc
...r, > + struct qxl_device, ddev); > + if (IS_ERR(qdev)) { > + pr_err("Unable to init drm dev"); > return -ENOMEM; > + } My feeling is that it is too early to allocate. Wouldn't it be better to first do the pdev and conflicting-fb stuff and allocate right before qxl_device_init() ? Best regards Thomas > > ret = pci_enable_device(pdev); > if (ret) > - goto free_dev; > + return ret; > > ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qxl"); > if (ret) > @@ -101,7 +104,7 @@ qxl_pci_probe(struct pci_dev *pdev...
2020 Apr 28
0
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...gt; > return -ENOMEM; > > > + } > > > > The other patches do not add any error message when devm_drm_dev_alloc() > > fails and driver core will log that driver init failed. > > > > So the pr_err() above should be dropped. > > I know it comes from qxl_device_init() but that does not make it a good > > idea. > > Hm I know we're inconsistent here, but some drivers have error logging on > all branches, some dont. I'm just trying to go with the prevailing style. > > > With this fixed: > > Insisting on this or ok as-is? O...
2019 Nov 29
0
[PATCH] drm/qxl: Complete exception handling in qxl_device_init()
.... The corresponding function > call did not release the desired system resource then. > Thus use the label ?rom_unmap? instead to fix the exception handling > for this function implementation. > > Fixes: 5043348a4969ae1661c008efe929abd0d76e3792 ("drm: qxl: Fix error handling at qxl_device_init") > Signed-off-by: Markus Elfring <elfring at users.sourceforge.net> Pushed to drm-misc-next. thanks, Gerd
2019 Feb 22
1
[PATCH v4 2/2] drm/qxl: remove conflicting framebuffers earlier
...drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -79,6 +79,10 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (ret) goto free_dev; + ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl"); + if (ret) + goto disable_pci; + ret = qxl_device_init(qdev, &qxl_driver, pdev); if (ret) goto disable_pci; @@ -94,7 +98,6 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (ret) goto modeset_cleanup; - drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl"); drm_fbdev_generic_setup(&qd...
2020 Apr 24
1
[PATCH Resend] drm/qxl: Use correct notify port address when creating cursor ring
...at 10:53 PM Gerd Hoffmann <kraxel at redhat.com> wrote: > > On Tue, Mar 31, 2020 at 02:18:08PM +0800, Huacai Chen wrote: > > The command ring and cursor ring use different notify port addresses > > definition: QXL_IO_NOTIFY_CMD and QXL_IO_NOTIFY_CURSOR. However, in > > qxl_device_init() we use QXL_IO_NOTIFY_CMD to create both command ring > > and cursor ring. This doesn't cause any problems now, because QEMU's > > behaviors on QXL_IO_NOTIFY_CMD and QXL_IO_NOTIFY_CURSOR are the same. > > However, QEMU's behavior may be change in future, so let's...
2020 Mar 02
1
[PATCH 07/51] drm/qxl: Use drmm_add_final_kfree
...172 100644 --- a/drivers/gpu/drm/qxl/qxl_kms.c +++ b/drivers/gpu/drm/qxl/qxl_kms.c @@ -27,6 +27,7 @@ #include <linux/pci.h> #include <drm/drm_drv.h> +#include <drm/drm_managed.h> #include <drm/drm_probe_helper.h> #include "qxl_drv.h" @@ -121,6 +122,7 @@ int qxl_device_init(struct qxl_device *qdev, qdev->ddev.pdev = pdev; pci_set_drvdata(pdev, &qdev->ddev); qdev->ddev.dev_private = qdev; + drmm_add_final_kfree(&qdev->ddev, qdev); mutex_init(&qdev->gem.mutex); mutex_init(&qdev->update_area_mutex); -- 2.24.1
2019 Aug 05
1
[PATCH v2] drm/qxl: get vga ioports
...xl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (ret) goto disable_pci; + if (is_vga(pdev)) { + ret = vga_get_interruptible(pdev, VGA_RSRC_LEGACY_IO); + if (ret) { + DRM_ERROR("can't get legacy vga ioports\n"); + goto disable_pci; + } + } + ret = qxl_device_init(qdev, &qxl_driver, pdev); if (ret) - goto disable_pci; + goto put_vga; ret = qxl_modeset_init(qdev); if (ret) @@ -109,6 +122,9 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) qxl_modeset_fini(qdev); unload: qxl_device_fini(qdev); +put_vga: + if (is_vga(pde...
2019 Aug 05
2
[PATCH] drm/qxl: get vga ioports
...rm/qxl/qxl_drv.c @@ -87,9 +87,15 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (ret) goto disable_pci; + ret = vga_get_interruptible(pdev, VGA_RSRC_LEGACY_IO); + if (ret) { + DRM_ERROR("can't get legacy vga ports\n"); + goto put_vga; + } + ret = qxl_device_init(qdev, &qxl_driver, pdev); if (ret) - goto disable_pci; + goto put_vga; ret = qxl_modeset_init(qdev); if (ret) @@ -109,6 +115,8 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) qxl_modeset_fini(qdev); unload: qxl_device_fini(qdev); +put_vga: + vga_put(pdev,...
2018 Dec 12
0
[PATCH v2 03/18] drm/qxl: simplify slot management
...n_mem_slot]); - setup_hw_slot(qdev, qdev->surfaces_mem_slot, &qdev->mem_slots[qdev->surfaces_mem_slot]); + setup_hw_slot(qdev, &qdev->main_slot); + setup_hw_slot(qdev, &qdev->surfaces_slot); } static void qxl_gc_work(struct work_struct *work) @@ -231,22 +237,11 @@ int qxl_device_init(struct qxl_device *qdev, } /* TODO - slot initialization should happen on reset. where is our * reset handler? */ - qdev->n_mem_slots = qdev->rom->slots_end; qdev->slot_gen_bits = qdev->rom->slot_gen_bits; qdev->slot_id_bits = qdev->rom->slot_id_bits; qdev-&g...
2018 Dec 12
0
[PATCH v2 05/18] drm/qxl: drop unused fields from struct qxl_device
...high_bits <<= (64 - (qdev->slot_gen_bits + qdev->slot_id_bits)); + high_bits <<= (64 - (qdev->rom->slot_gen_bits + qdev->rom->slot_id_bits)); slot->high_bits = high_bits; DRM_INFO("slot %d (%s): base 0x%08lx, size 0x%08lx\n", @@ -235,12 +235,6 @@ int qxl_device_init(struct qxl_device *qdev, r = -ENOMEM; goto cursor_ring_free; } - /* TODO - slot initialization should happen on reset. where is our - * reset handler? */ - qdev->slot_gen_bits = qdev->rom->slot_gen_bits; - qdev->slot_id_bits = qdev->rom->slot_id_bits; - qdev->va_slot_m...