search for: drm_dev_enter

Displaying 20 results from an estimated 40 matches for "drm_dev_enter".

2020 Feb 11
2
[PATCH v4] drm/bochs: add drm_driver.release callback.
.../* TODO: shot down existing vram mappings */ + if (bochs->mmio) iounmap(bochs->mmio); if (bochs->ioports) @@ -207,6 +210,11 @@ void bochs_hw_fini(struct drm_device *dev) void bochs_hw_setmode(struct bochs_device *bochs, struct drm_display_mode *mode) { + int idx; + + if (!drm_dev_enter(bochs->dev, &idx)) + return; + bochs->xres = mode->hdisplay; bochs->yres = mode->vdisplay; bochs->bpp = 32; @@ -232,11 +240,18 @@ void bochs_hw_setmode(struct bochs_device *bochs, bochs_dispi_write(bochs, VBE_DISPI_INDEX_ENABLE, VBE_DISPI_ENABLED | VBE_DISPI_L...
2020 Feb 11
2
[PATCH v4] drm/bochs: add drm_driver.release callback.
.../* TODO: shot down existing vram mappings */ + if (bochs->mmio) iounmap(bochs->mmio); if (bochs->ioports) @@ -207,6 +210,11 @@ void bochs_hw_fini(struct drm_device *dev) void bochs_hw_setmode(struct bochs_device *bochs, struct drm_display_mode *mode) { + int idx; + + if (!drm_dev_enter(bochs->dev, &idx)) + return; + bochs->xres = mode->hdisplay; bochs->yres = mode->vdisplay; bochs->bpp = 32; @@ -232,11 +240,18 @@ void bochs_hw_setmode(struct bochs_device *bochs, bochs_dispi_write(bochs, VBE_DISPI_INDEX_ENABLE, VBE_DISPI_ENABLED | VBE_DISPI_L...
2020 Feb 11
1
[PATCH v4] drm/cirrus: add drm_driver.release callback.
...2c..d2ff63ce8eaf 100644 --- a/drivers/gpu/drm/cirrus/cirrus.c +++ b/drivers/gpu/drm/cirrus/cirrus.c @@ -151,9 +151,13 @@ static int cirrus_pitch(struct drm_framebuffer *fb) static void cirrus_set_start_address(struct cirrus_device *cirrus, u32 offset) { + int idx; u32 addr; u8 tmp; + if (!drm_dev_enter(&cirrus->dev, &idx)) + return; + addr = offset >> 2; wreg_crt(cirrus, 0x0c, (u8)((addr >> 8) & 0xff)); wreg_crt(cirrus, 0x0d, (u8)(addr & 0xff)); @@ -168,6 +172,8 @@ static void cirrus_set_start_address(struct cirrus_device *cirrus, u32 offset) tmp &= 0x7...
2020 Feb 11
1
[PATCH v3] drm/bochs: add drm_driver.release callback.
.../* TODO: shot down existing vram mappings */ + if (bochs->mmio) iounmap(bochs->mmio); if (bochs->ioports) @@ -207,6 +210,11 @@ void bochs_hw_fini(struct drm_device *dev) void bochs_hw_setmode(struct bochs_device *bochs, struct drm_display_mode *mode) { + int idx; + + if (!drm_dev_enter(bochs->dev, &idx)) + return; + bochs->xres = mode->hdisplay; bochs->yres = mode->vdisplay; bochs->bpp = 32; @@ -232,11 +240,18 @@ void bochs_hw_setmode(struct bochs_device *bochs, bochs_dispi_write(bochs, VBE_DISPI_INDEX_ENABLE, VBE_DISPI_ENABLED | VBE_DISPI_L...
2020 Feb 11
0
[PATCH v4] drm/bochs: add drm_driver.release callback.
...: add changelog. > v3: use drm_dev_*(). > v2: move hardware deinit to pci_remove(). > > Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch> Btw I checked around whether there's anything else that obviously needs a drm_dev_enter/exit, and I spotted the !bochs->mmio check in bochs_hw_load_edid. That one looks like cargo-cult, there's a single caller in the init path, so either mmio works at that point or this is dead code ... slightly confusing. -Daniel > --- > drivers/gpu/drm/bochs/bochs_drv.c | 6 +++--- &g...
2020 Feb 11
2
[PATCH v4] drm/virtio: add drm_driver.release callback.
...9c54f87a3 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -330,7 +330,14 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev, { struct virtqueue *vq = vgdev->ctrlq.vq; bool notify = false; - int ret; + int ret, idx; + + if (!drm_dev_enter(vgdev->ddev, &idx)) { + if (fence && vbuf->objs) + virtio_gpu_array_unlock_resv(vbuf->objs); + free_vbuf(vgdev, vbuf); + return; + } if (vgdev->has_indirect) elemcnt = 1; @@ -338,14 +345,6 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,...
2020 Feb 11
2
[PATCH v4] drm/virtio: add drm_driver.release callback.
...9c54f87a3 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -330,7 +330,14 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev, { struct virtqueue *vq = vgdev->ctrlq.vq; bool notify = false; - int ret; + int ret, idx; + + if (!drm_dev_enter(vgdev->ddev, &idx)) { + if (fence && vbuf->objs) + virtio_gpu_array_unlock_resv(vbuf->objs); + free_vbuf(vgdev, vbuf); + return; + } if (vgdev->has_indirect) elemcnt = 1; @@ -338,14 +345,6 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,...
2020 Feb 11
0
[PATCH v3] drm/cirrus: add drm_driver.release callback.
...2c..d2ff63ce8eaf 100644 --- a/drivers/gpu/drm/cirrus/cirrus.c +++ b/drivers/gpu/drm/cirrus/cirrus.c @@ -151,9 +151,13 @@ static int cirrus_pitch(struct drm_framebuffer *fb) static void cirrus_set_start_address(struct cirrus_device *cirrus, u32 offset) { + int idx; u32 addr; u8 tmp; + if (!drm_dev_enter(&cirrus->dev, &idx)) + return; + addr = offset >> 2; wreg_crt(cirrus, 0x0c, (u8)((addr >> 8) & 0xff)); wreg_crt(cirrus, 0x0d, (u8)(addr & 0xff)); @@ -168,6 +172,8 @@ static void cirrus_set_start_address(struct cirrus_device *cirrus, u32 offset) tmp &= 0x7...
2020 Feb 11
0
[PATCH v4] drm/virtio: add drm_driver.release callback.
...; device removal. Tidy up here and there. > > v4: add changelog. > v3: use drm_dev_*(). > > Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> Looks reasonable I think. Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch> I didn't review whether you need more drm_dev_enter/exit pairs, virtio is a bit more complex for that and I have no idea how exactly it works. Maybe for these more complex drivers we need a drm_dev_assert_entered() or so that uses the right srcu lockdep annotations to make sure we do this right. Sprinkling that check into a few low-level hw function...
2023 Feb 15
17
[PATCH 00/17] cirrus: Modernize the cirrus driver
Update the cirrus driver to follow current best practices. While the driver's hardware is obsolete, the cirrus driver is still one of the go-to modules to learn about writing a DRM driver. So keep it in good shape. Patches 1 to 3 simplify blitting and convert it to the DRM's current helpers. Patches 4 to 8 replace simple-KMS helpers with DRM's regular atomic helpers. The former are
2020 Feb 11
0
[PATCH v3] drm/virtio: add drm_driver.release callback.
...9c54f87a3 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -330,7 +330,14 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev, { struct virtqueue *vq = vgdev->ctrlq.vq; bool notify = false; - int ret; + int ret, idx; + + if (!drm_dev_enter(vgdev->ddev, &idx)) { + if (fence && vbuf->objs) + virtio_gpu_array_unlock_resv(vbuf->objs); + free_vbuf(vgdev, vbuf); + return; + } if (vgdev->has_indirect) elemcnt = 1; @@ -338,14 +345,6 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,...
2020 Feb 10
1
[PATCH v2 2/2] drm/qxl: add drm_driver.release callback.
...>> + * non-trivial though. >> + */ >> + qxl_modeset_fini(qdev); > > So the drm_mode_config_cleanup call in here belongs in ->release, but the > qxl_destroy_monitors_object feels like should be perfectly fine in the > remove hook. You might need to sprinkle a few drm_dev_enter/exit around to > protect code paths thought. > > Aside from this lgtm, for the series > > Acked-by: Daniel Vetter <daniel.vetter at ffwll.ch> > > And up to you whether you want to fix this or not really. > > Btw for testing all these patches that add a ->rele...
2020 Feb 10
2
[PATCH v2 2/2] drm/qxl: add drm_driver.release callback.
Move final cleanups to qxl_drm_release() callback. Add drm_atomic_helper_shutdown() call to qxl_pci_remove(). Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> --- drivers/gpu/drm/qxl/qxl_drv.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index 1d601f57a6ba..4fda3f9b29f4
2020 Feb 10
2
[PATCH v2 2/2] drm/qxl: add drm_driver.release callback.
Move final cleanups to qxl_drm_release() callback. Add drm_atomic_helper_shutdown() call to qxl_pci_remove(). Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> --- drivers/gpu/drm/qxl/qxl_drv.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index 1d601f57a6ba..4fda3f9b29f4
2020 Feb 10
1
[PATCH v2] drm/bochs: add drm_driver.release callback.
Call drm_dev_unregister() first in bochs_pci_remove(). Hook bochs_unload() into the new .release callback, to make sure cleanup is done when all users are gone. Add ready bool to state struct and move bochs_hw_fini() call from bochs_unload() to bochs_pci_remove() to make sure hardware is not touched after bochs_pci_remove returns. Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> ---
2020 Nov 03
4
[PATCH 0/3] drm/nouveau: fix a use-after-free in postclose()
This series fixes a number of use-after-frees in nouveau's postclose() handler. It was discovered by pointing IGT's core_hotunplug tests at a nouveau device, but the steps to reproduce it are simple: 1. Open the device file 2. Unbind the driver or remove the device 3. Close the file opened in step 1. During the device removal, the nouveau_drm structure is de-allocated, but is
2020 Feb 10
0
[PATCH v2 2/2] drm/qxl: add drm_driver.release callback.
...i() + qxl_device_fini() calls is > + * non-trivial though. > + */ > + qxl_modeset_fini(qdev); So the drm_mode_config_cleanup call in here belongs in ->release, but the qxl_destroy_monitors_object feels like should be perfectly fine in the remove hook. You might need to sprinkle a few drm_dev_enter/exit around to protect code paths thought. Aside from this lgtm, for the series Acked-by: Daniel Vetter <daniel.vetter at ffwll.ch> And up to you whether you want to fix this or not really. Btw for testing all these patches that add a ->release hook I think it'd be good if the drm...
2020 Feb 12
1
[PATCH v2] drm/virtio: rework batching
...100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -329,7 +329,6 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev, int incnt) { struct virtqueue *vq = vgdev->ctrlq.vq; - bool notify = false; int ret, idx; if (!drm_dev_enter(vgdev->ddev, &idx)) { @@ -368,16 +367,10 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev, trace_virtio_gpu_cmd_queue(vq, virtio_gpu_vbuf_ctrl_hdr(vbuf)); - notify = virtqueue_kick_prepare(vq); + atomic_inc(&vgdev->pending_commands); spin_unlock(&...
2020 Feb 10
1
[PATCH v2] drm/cirrus: add drm_driver.release callback.
Move final cleanups from cirrus_pci_remove() to the new callback. Add drm_atomic_helper_shutdown() call to cirrus_pci_remove(). Set pointers to NULL after iounmap() and check them before using them to make sure we don't touch released hardware. Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> --- drivers/gpu/drm/cirrus/cirrus.c | 23 +++++++++++++++++++++-- 1 file changed, 21
2020 Feb 10
1
[PATCH v2] drm/virtio: add drm_driver.release callback.
Split virtio_gpu_deinit(), move the drm shutdown and release to virtio_gpu_release(). Also free vbufs in case we can't queue them. Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_display.c | 1 - drivers/gpu/drm/virtio/virtgpu_drv.c | 4 ++++ drivers/gpu/drm/virtio/virtgpu_kms.c | 5 +++++