From patchwork Tue Mar 22 20:17:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 8644891 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 509549F6E1 for ; Tue, 22 Mar 2016 20:18:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7EE9620398 for ; Tue, 22 Mar 2016 20:18:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9EB962038F for ; Tue, 22 Mar 2016 20:18:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D272B6E361; Tue, 22 Mar 2016 20:18:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-f193.google.com (mail-yw0-f193.google.com [209.85.161.193]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4B77C6E361 for ; Tue, 22 Mar 2016 20:18:02 +0000 (UTC) Received: by mail-yw0-f193.google.com with SMTP id f6so22926518ywa.1 for ; Tue, 22 Mar 2016 13:18:02 -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:in-reply-to :references; bh=K6RN0NMgo+CqN1FWqjehrqgTAAp/24kihap5V8DNaTc=; b=S+vjI2XyGXhjEutS14kUrvYlVBBI4gz83X7ybWi3GlmcCN9eoXrW+/4/gwh/KOoP8K bs9GqSfFBPb1DVbP+HucX17Q4aBEe30x7KOodAm2mwa2+8s9TItlnNyjEvAYk7g17LrZ SLZWkZpNURbuaD8cAWhWvGTaKk4+1ISZcucJj8JjsoFixRK4sakSuvvPP0vSFI0/vLHE TXTnBjnbCFg+mQsmUxryhQr86VsLv9/O1GYzgJDR2rot8xrZ0A/0gnvJ7Y39vLlpHDVF yJQW1MONgdCYq3gq20Jt/lrkUIPVqA5xmQxxm0CTlJubbnst2wHNSmO+HVTjOIfVRhnv QZ8A== X-Gm-Message-State: AD7BkJK45lhlOiTmA5i6mLb+bmbX+yLZS16XUIkA89OjI/04xG370eAPyu7v73sAUtnJmA== X-Received: by 10.13.254.67 with SMTP id o64mr17429068ywf.77.1458677880643; Tue, 22 Mar 2016 13:18:00 -0700 (PDT) Received: from jade.localdomain ([177.194.47.65]) by smtp.gmail.com with ESMTPSA id x7sm21604515ywf.35.2016.03.22.13.17.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2016 13:17:59 -0700 (PDT) From: Gustavo Padovan To: Gerd Hoffmann Subject: [PATCH v2] drm/virtio: send vblank event after crtc updates Date: Tue, 22 Mar 2016 17:17:52 -0300 Message-Id: <1458677872-6024-1-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458588187-26002-2-git-send-email-gustavo@padovan.org> References: <1458588187-26002-2-git-send-email-gustavo@padovan.org> Cc: Gustavo Padovan , open list , "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=-2.9 required=5.0 tests=BAYES_00, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED, T_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 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,