From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759630AbcDESV0 (ORCPT ); Tue, 5 Apr 2016 14:21:26 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:33009 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754068AbcDESVZ (ORCPT ); Tue, 5 Apr 2016 14:21:25 -0400 Date: Tue, 5 Apr 2016 11:21:15 -0700 From: Gustavo Padovan To: Gerd Hoffmann Cc: Gustavo Padovan , David Airlie , "open list:VIRTIO GPU DRIVER" , "open list:VIRTIO GPU DRIVER" , open list Subject: Re: [PATCH v2] drm/virtio: send vblank event after crtc updates Message-ID: <20160405182115.GB24204@joana> Mail-Followup-To: Gustavo Padovan , Gerd Hoffmann , Gustavo Padovan , David Airlie , "open list:VIRTIO GPU DRIVER" , "open list:VIRTIO GPU DRIVER" , open list References: <1458588187-26002-2-git-send-email-gustavo@padovan.org> <1458677872-6024-1-git-send-email-gustavo@padovan.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458677872-6024-1-git-send-email-gustavo@padovan.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Any comment on this? Gustavo 2016-03-22 Gustavo Padovan : > From: Gustavo Padovan > > 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 > --- > drivers/gpu/drm/virtio/virtgpu_display.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c > index b70bb8b..4f372e0 100644 > --- a/drivers/gpu/drm/virtio/virtgpu_display.c > +++ b/drivers/gpu/drm/virtio/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, > .disable = virtio_gpu_crtc_disable, > .mode_fixup = virtio_gpu_crtc_mode_fixup, > .mode_set_nofb = virtio_gpu_crtc_mode_set_nofb, > .atomic_check = virtio_gpu_crtc_atomic_check, > + .atomic_flush = virtio_gpu_crtc_atomic_flush, > }; > > static void virtio_gpu_enc_mode_set(struct drm_encoder *encoder, > -- > 2.5.0 > Gustavo