Displaying 20 results from an estimated 147 matches for "event_lock".
2020 Mar 18
4
[PATCH 1/9] drm/vblank: Add vblank works
...atic int vblank_work_thread(void *data)
> +{
> + struct drm_vblank_crtc *vblank = data;
> +
> + while (!kthread_should_stop()) {
> + struct drm_vblank_work *work, *next;
> + LIST_HEAD(list);
> + u64 count;
> + int ret;
> +
> + spin_lock_irq(&vblank->dev->event_lock);
> +
> + ret = wait_event_interruptible_lock_irq(vblank->queue,
> + kthread_should_stop() ||
> + !list_empty(&vblank->vblank_work.work_list),
> + vblank->dev->event_lock);
> +
> + WARN_ON(ret && !kthread_should_stop() &&
>...
2020 Mar 18
0
[PATCH 1/9] drm/vblank: Add vblank works
...drm_device *dev)
dev->num_crtcs = 0;
}
+static int vblank_work_thread(void *data)
+{
+ struct drm_vblank_crtc *vblank = data;
+
+ while (!kthread_should_stop()) {
+ struct drm_vblank_work *work, *next;
+ LIST_HEAD(list);
+ u64 count;
+ int ret;
+
+ spin_lock_irq(&vblank->dev->event_lock);
+
+ ret = wait_event_interruptible_lock_irq(vblank->queue,
+ kthread_should_stop() ||
+ !list_empty(&vblank->vblank_work.work_list),
+ vblank->dev->event_lock);
+
+ WARN_ON(ret && !kthread_should_stop() &&
+ list_empty(&vblank->vblank_w...
2020 Mar 27
2
[PATCH 1/9] drm/vblank: Add vblank works
...blank = data;
> > > +
> > > + while (!kthread_should_stop()) {
> > > + struct drm_vblank_work *work, *next;
> > > + LIST_HEAD(list);
> > > + u64 count;
> > > + int ret;
> > > +
> > > + spin_lock_irq(&vblank->dev->event_lock);
> > > +
> > > + ret = wait_event_interruptible_lock_irq(vblank->queue,
> > > + kthread_should_stop()
> > > + !list_empty(&vblank-
> > > > vblank_work.work_list),
> > > + vblank->dev-
> > > > event_lo...
2019 Jun 28
0
[PATCH v2 2/3] vsock/virtio: stop workers during the .remove()
...end_pkt_work;
spinlock_t send_pkt_list_lock;
@@ -53,6 +54,7 @@ struct virtio_vsock {
* must be accessed with rx_lock held.
*/
struct mutex rx_lock;
+ bool rx_run;
int rx_buf_nr;
int rx_buf_max_nr;
@@ -60,6 +62,7 @@ struct virtio_vsock {
* vqs[VSOCK_VQ_EVENT] must be accessed with event_lock held.
*/
struct mutex event_lock;
+ bool event_run;
struct virtio_vsock_event event_list[8];
u32 guest_cid;
@@ -94,6 +97,10 @@ static void virtio_transport_loopback_work(struct work_struct *work)
spin_unlock_bh(&vsock->loopback_list_lock);
mutex_lock(&vsock->rx_lock);...
2019 Jul 05
0
[PATCH v3 2/3] vsock/virtio: stop workers during the .remove()
...end_pkt_work;
spinlock_t send_pkt_list_lock;
@@ -53,6 +54,7 @@ struct virtio_vsock {
* must be accessed with rx_lock held.
*/
struct mutex rx_lock;
+ bool rx_run;
int rx_buf_nr;
int rx_buf_max_nr;
@@ -60,6 +62,7 @@ struct virtio_vsock {
* vqs[VSOCK_VQ_EVENT] must be accessed with event_lock held.
*/
struct mutex event_lock;
+ bool event_run;
struct virtio_vsock_event event_list[8];
u32 guest_cid;
@@ -94,6 +97,10 @@ static void virtio_transport_loopback_work(struct work_struct *work)
spin_unlock_bh(&vsock->loopback_list_lock);
mutex_lock(&vsock->rx_lock);...
2016 Mar 21
3
[PATCH 1/2] drm/virtio: use new drm_crtc_send_vblank_event()
...drivers/gpu/drm/virtio/virtgpu_display.c
index 429aa31..b70bb8b 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -163,7 +163,7 @@ static int virtio_gpu_page_flip(struct drm_crtc *crtc,
if (event) {
spin_lock_irqsave(&crtc->dev->event_lock, irqflags);
- drm_send_vblank_event(crtc->dev, -1, event);
+ drm_crtc_send_vblank_event(crtc, event);
spin_unlock_irqrestore(&crtc->dev->event_lock, irqflags);
}
--
2.5.0
2016 Mar 21
3
[PATCH 1/2] drm/virtio: use new drm_crtc_send_vblank_event()
...drivers/gpu/drm/virtio/virtgpu_display.c
index 429aa31..b70bb8b 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -163,7 +163,7 @@ static int virtio_gpu_page_flip(struct drm_crtc *crtc,
if (event) {
spin_lock_irqsave(&crtc->dev->event_lock, irqflags);
- drm_send_vblank_event(crtc->dev, -1, event);
+ drm_crtc_send_vblank_event(crtc, event);
spin_unlock_irqrestore(&crtc->dev->event_lock, irqflags);
}
--
2.5.0
2020 Mar 27
0
[PATCH 1/9] drm/vblank: Add vblank works
...+{
> > + struct drm_vblank_crtc *vblank = data;
> > +
> > + while (!kthread_should_stop()) {
> > + struct drm_vblank_work *work, *next;
> > + LIST_HEAD(list);
> > + u64 count;
> > + int ret;
> > +
> > + spin_lock_irq(&vblank->dev->event_lock);
> > +
> > + ret = wait_event_interruptible_lock_irq(vblank->queue,
> > + kthread_should_stop()
> > ||
> > + !list_empty(&vblank-
> > >vblank_work.work_list),
> > + vblank->dev-
> > >event_lock);
> > +
> &g...
2020 Apr 13
0
[PATCH 1/9] drm/vblank: Add vblank works
...> > > + while (!kthread_should_stop()) {
> > > > + struct drm_vblank_work *work, *next;
> > > > + LIST_HEAD(list);
> > > > + u64 count;
> > > > + int ret;
> > > > +
> > > > + spin_lock_irq(&vblank->dev->event_lock);
> > > > +
> > > > + ret = wait_event_interruptible_lock_irq(vblank->queue,
> > > > + kthread_should
> > > > _stop()
> > > > + !list_empty(&v
> > > > blank-
> > > > > vblank_work.work_list),...
2020 Jun 24
0
[RFC v7 03/11] drm/vblank: Add vblank works
...out period, sometimes during the
first few scanlines of the vblank). As such we use a high-priority
per-CRTC thread to accomplish this.
Changes since v6:
* Get rid of ->pending and seqcounts, and implement flushing through
simpler means - danvet
* Get rid of work_lock, just use drm_device->event_lock
* Move drm_vblank_work item cleanup into drm_crtc_vblank_off() so that
we ensure that all vblank work has finished before disabling vblanks
* Add checks into drm_crtc_vblank_reset() so we yell if it gets called
while there's vblank workers active
* Grab event_lock in both drm_crtc_vblank_on...
2019 Jun 28
11
[PATCH v2 0/3] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock
before registering the driver", Stefan pointed out some possible issues
in the .probe() and .remove() callbacks of the virtio-vsock driver.
This series tries to solve these issues:
- Patch 1 adds RCU critical sections to avoid use-after-free of
'the_virtio_vsock' pointer.
- Patch 2 stops workers before to
2019 Jun 28
11
[PATCH v2 0/3] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock
before registering the driver", Stefan pointed out some possible issues
in the .probe() and .remove() callbacks of the virtio-vsock driver.
This series tries to solve these issues:
- Patch 1 adds RCU critical sections to avoid use-after-free of
'the_virtio_vsock' pointer.
- Patch 2 stops workers before to
2019 Jul 05
4
[PATCH v3 0/3] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock
before registering the driver", Stefan pointed out some possible issues
in the .probe() and .remove() callbacks of the virtio-vsock driver.
This series tries to solve these issues:
- Patch 1 adds RCU critical sections to avoid use-after-free of
'the_virtio_vsock' pointer.
- Patch 2 stops workers before to
2019 May 28
8
[PATCH 0/4] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock
before registering the driver", Stefan pointed out some possible issues
in the .probe() and .remove() callbacks of the virtio-vsock driver.
This series tries to solve these issues:
- Patch 1 postpones the 'the_virtio_vsock' assignment at the end of the
.probe() to avoid that some sockets queue works when
2019 May 28
8
[PATCH 0/4] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock
before registering the driver", Stefan pointed out some possible issues
in the .probe() and .remove() callbacks of the virtio-vsock driver.
This series tries to solve these issues:
- Patch 1 postpones the 'the_virtio_vsock' assignment at the end of the
.probe() to avoid that some sockets queue works when
2020 Jun 24
0
[RFC v7 02/11] drm/vblank: Use spin_(un)lock_irq() in drm_crtc_vblank_off()
.../drivers/gpu/drm/drm_vblank.c
@@ -1283,13 +1283,12 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
struct drm_pending_vblank_event *e, *t;
ktime_t now;
- unsigned long irqflags;
u64 seq;
if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
return;
- spin_lock_irqsave(&dev->event_lock, irqflags);
+ spin_lock_irq(&dev->event_lock);
spin_lock(&dev->vbl_lock);
drm_dbg_vbl(dev, "crtc %d, vblank enabled %d, inmodeset %d\n",
@@ -1325,7 +1324,7 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
drm_vblank_put(dev, pipe);
send_vblank_event(dev, e, seq...
2016 Mar 22
1
[PATCH v2] drm/virtio: send vblank event after crtc updates
...tio/virtgpu_display.c
@@ -274,12 +274,24 @@ static int virtio_gpu_crtc_atomic_check(struct drm_crtc *crtc,
return 0;
}
+static void virtio_gpu_crtc_atomic_flush(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_state)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&crtc->dev->event_lock, flags);
+ if (crtc->state->event)
+ drm_crtc_send_vblank_event(crtc, crtc->state->event);
+ spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
+}
+
static const struct drm_crtc_helper_funcs virtio_gpu_crtc_helper_funcs = {
.enable = virtio_gpu_crtc_enable,
.d...
2016 Mar 22
1
[PATCH v2] drm/virtio: send vblank event after crtc updates
...tio/virtgpu_display.c
@@ -274,12 +274,24 @@ static int virtio_gpu_crtc_atomic_check(struct drm_crtc *crtc,
return 0;
}
+static void virtio_gpu_crtc_atomic_flush(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_state)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&crtc->dev->event_lock, flags);
+ if (crtc->state->event)
+ drm_crtc_send_vblank_event(crtc, crtc->state->event);
+ spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
+}
+
static const struct drm_crtc_helper_funcs virtio_gpu_crtc_helper_funcs = {
.enable = virtio_gpu_crtc_enable,
.d...
2019 Apr 03
2
[PATCH] drm/cirrus: rewrite and modernize driver.
...t; +
> > + if (drm_atomic_helper_damage_merged(old_state, state, &rect))
> > + cirrus_fb_blit_rect(pipe->plane.state->fb, &rect);
> > +
> > + if (crtc->state->event) {
> > + spin_lock_irq(&crtc->dev->event_lock);
> > + drm_crtc_send_vblank_event(crtc, crtc->state->event);
> > + spin_unlock_irq(&crtc->dev->event_lock);
> > + crtc->state->event = NULL;
> > + }
> > +}
> > +static int cirrus_fb_dirty(str...
2019 Apr 03
2
[PATCH] drm/cirrus: rewrite and modernize driver.
...t; +
> > + if (drm_atomic_helper_damage_merged(old_state, state, &rect))
> > + cirrus_fb_blit_rect(pipe->plane.state->fb, &rect);
> > +
> > + if (crtc->state->event) {
> > + spin_lock_irq(&crtc->dev->event_lock);
> > + drm_crtc_send_vblank_event(crtc, crtc->state->event);
> > + spin_unlock_irq(&crtc->dev->event_lock);
> > + crtc->state->event = NULL;
> > + }
> > +}
> > +static int cirrus_fb_dirty(str...