Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions drivers/gpu/drm/virtio/virtgpu_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ static void virtio_gpu_crtc_atomic_disable(struct drm_crtc *crtc,
struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(crtc);
const unsigned pipe = drm_crtc_index(crtc);

struct drm_pending_vblank_event *e = xchg(&vgdev->cache_event[pipe], NULL);
/* Send cached event even it's still premature. */
if (vgdev->cache_event[pipe]) {
if (e) {
spin_lock_irq(&dev->event_lock);
drm_crtc_send_vblank_event(crtc, vgdev->cache_event[pipe]);
vgdev->cache_event[pipe] = NULL;
drm_crtc_send_vblank_event(crtc, e);
spin_unlock_irq(&dev->event_lock);
drm_crtc_vblank_put(crtc);
}
Expand All @@ -142,7 +142,7 @@ static void virtio_gpu_crtc_atomic_begin(struct drm_crtc *crtc,
struct virtio_gpu_device *vgdev = crtc->dev->dev_private;
struct drm_device *drm = crtc->dev;
const unsigned pipe = drm_crtc_index(crtc);
struct drm_pending_vblank_event *e = crtc->state->event;
struct drm_pending_vblank_event *old_e, *e = crtc->state->event;

if (!vgdev->has_vblank || !crtc->state->event)
return;
Expand All @@ -165,13 +165,13 @@ static void virtio_gpu_crtc_atomic_begin(struct drm_crtc *crtc,
} else {
crtc->state->event->sequence =
atomic64_read(&vgdev->flip_sequence[pipe]) + 1;
if (vgdev->cache_event[pipe] != NULL) {
old_e = xchg(&vgdev->cache_event[pipe], crtc->state->event);
if (old_e) {
spin_lock_irq(&drm->event_lock);
drm_crtc_send_vblank_event(crtc, vgdev->cache_event[pipe]);
drm_crtc_send_vblank_event(crtc, old_e);
spin_unlock_irq(&drm->event_lock);
drm_crtc_vblank_put(crtc);
}
vgdev->cache_event[pipe] = crtc->state->event;
}
crtc->state->event = NULL;
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/virtio/virtgpu_vq.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,11 @@ void virtio_gpu_vblank_ack(struct virtqueue *vq)
if (!vgdev->has_flip_sequence)
return;

struct drm_pending_vblank_event *e = vgdev->cache_event[target];
struct drm_pending_vblank_event *e = xchg(&vgdev->cache_event[target], NULL);
if (e && drm_vblank_passed(atomic64_read(&vgdev->flip_sequence[target]),
e->sequence)) {
spin_lock_irqsave(&dev->event_lock, irqflags);
drm_crtc_send_vblank_event(&vgdev->outputs[target].crtc, e);
vgdev->cache_event[target] = NULL;
spin_unlock_irqrestore(&dev->event_lock, irqflags);
drm_crtc_vblank_put(&vgdev->outputs[target].crtc);
}
Expand Down
3 changes: 2 additions & 1 deletion sound/virtio/virtio_pcm_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ static int virtsnd_pcm_trigger(struct snd_pcm_substream *substream, int command)
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
queue = virtsnd_pcm_queue(vss);

printk("virtsnd_pcm_trigger, start \n");
spin_lock_irqsave(&queue->lock, flags);
spin_lock(&vss->lock);
if (vss->direction == SNDRV_PCM_STREAM_CAPTURE)
Expand All @@ -343,6 +343,7 @@ static int virtsnd_pcm_trigger(struct snd_pcm_substream *substream, int command)
vss->xfer_enabled = true;
spin_unlock(&vss->lock);
spin_unlock_irqrestore(&queue->lock, flags);
printk("virtsnd_pcm_trigger, finish \n");
if (rc)
return rc;

Expand Down