From patchwork Thu Apr 14 17:58:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 8840671 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 306B69F36E for ; Thu, 14 Apr 2016 17:59:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 61E962035D for ; Thu, 14 Apr 2016 17:59:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EB0862034C for ; Thu, 14 Apr 2016 17:58:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7FBC66EAC9; Thu, 14 Apr 2016 17:58:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180]) by gabe.freedesktop.org (Postfix) with ESMTPS id 14FF76EAC9 for ; Thu, 14 Apr 2016 17:58:56 +0000 (UTC) Received: by mail-pf0-f180.google.com with SMTP id e128so48054871pfe.3 for ; Thu, 14 Apr 2016 10:58:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=69cw+Zz9JgFP3wXizV7vpGP/mm98JXkjDBJI6tbL1B4=; b=AaILI4ABl5AbTNAVHg0+W1fCn9yCJOAG3Oz74j3q5W5K2LifsT8M+cI5UO7t6J+Up4 5XOb9zBAhaAP0GKlVpnKM1qnJAC5C8QnYF/Z2jq04O76AzdcDMRYOnQJ9XGyDl6z4K0E NJCJNxLefG5SHL9KmP6jH2WGWqak7I4AAPaRTQSVY6lK158g4N/BDmt6MSw4AmVNXi+F TLtd1CoiPxaLENYHfzszkYI/bN09CYLDY8fxthc9tNPSA59rjEShNZ3B4xrJQP65JnwG /C5uj+LsE4AMNo/y/hVRAg8L+ZjnfdwIG7QHsgfOdaJUXD8hOS1j7kmTe4m/0hFs0AKO hLKA== X-Gm-Message-State: AOPr4FWttygD+mee85Mqx04pl03CI8MDDBEueKVOPcgMjKUU3rLqECIVvfOcDlz4oxw8gQ== X-Received: by 10.98.64.132 with SMTP id f4mr23432388pfd.146.1460656735674; Thu, 14 Apr 2016 10:58:55 -0700 (PDT) Received: from jade.localdomain (c-73-241-147-137.hsd1.ca.comcast.net. [73.241.147.137]) by smtp.gmail.com with ESMTPSA id i7sm15250100pfc.47.2016.04.14.10.58.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Apr 2016 10:58:55 -0700 (PDT) From: Gustavo Padovan To: David Airlie Subject: [PATCH RESEND] drm/virtio: send vblank event after crtc updates Date: Thu, 14 Apr 2016 10:58:54 -0700 Message-Id: <1460656734-17216-1-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 Cc: open list , Gustavo Padovan , "open list:VIRTIO GPU DRIVER" , "open list:VIRTIO GPU DRIVER" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 4854dac..5fd1fd0 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -267,11 +267,23 @@ 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_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,