From: Gustavo Padovan <gustavo@padovan.org>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>,
David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org (open list:VIRTIO GPU DRIVER),
virtualization@lists.linux-foundation.org (open list:VIRTIO GPU
DRIVER), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 2/2] drm/virtio: send vblank event on plane atomic update
Date: Mon, 21 Mar 2016 16:23:07 -0300 [thread overview]
Message-ID: <1458588187-26002-2-git-send-email-gustavo@padovan.org> (raw)
In-Reply-To: <1458588187-26002-1-git-send-email-gustavo@padovan.org>
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
virtio_gpu was failing to send vblank events when using the atomic IOCTL
with the DRM_MODE_PAGE_FLIP_EVENT flag set. This patch fixes each and
enables atomic pageflips updates.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
drivers/gpu/drm/virtio/virtgpu_plane.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index 70b44a2..20260ad 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -63,9 +63,11 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane,
{
struct drm_device *dev = plane->dev;
struct virtio_gpu_device *vgdev = dev->dev_private;
- struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(plane->crtc);
+ struct drm_crtc *crtc = plane->crtc;
+ struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(crtc);
struct virtio_gpu_framebuffer *vgfb;
struct virtio_gpu_object *bo;
+ unsigned long flags;
uint32_t handle;
if (plane->state->fb) {
@@ -96,6 +98,11 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane,
plane->state->crtc_y,
plane->state->crtc_w,
plane->state->crtc_h);
+
+ 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);
}
--
2.5.0
next prev parent reply other threads:[~2016-03-21 19:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-21 19:23 [PATCH 1/2] drm/virtio: use new drm_crtc_send_vblank_event() Gustavo Padovan
2016-03-21 19:23 ` Gustavo Padovan [this message]
2016-03-22 13:17 ` [PATCH 2/2] drm/virtio: send vblank event on plane atomic update Daniel Stone
2016-03-22 20:17 ` [PATCH v2] drm/virtio: send vblank event after crtc updates Gustavo Padovan
2016-04-05 18:21 ` Gustavo Padovan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1458588187-26002-2-git-send-email-gustavo@padovan.org \
--to=gustavo@padovan.org \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo.padovan@collabora.co.uk \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®