From patchwork Mon Nov 16 12:50:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stone X-Patchwork-Id: 7624901 Return-Path: X-Original-To: patchwork-linux-rockchip@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 E64219F2E2 for ; Mon, 16 Nov 2015 12:51:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A9F32053F for ; Mon, 16 Nov 2015 12:51:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20506204FB for ; Mon, 16 Nov 2015 12:51:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyJFS-0004BT-MA; Mon, 16 Nov 2015 12:51:06 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyJFQ-00047j-O9 for linux-rockchip@lists.infradead.org; Mon, 16 Nov 2015 12:51:05 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: daniels) with ESMTPSA id 0CCB8609238 From: Daniel Stone To: mark.yao@rock-chips.com Subject: [PATCH 2/2] drm/rockchip: Send events for same-fb flips Date: Mon, 16 Nov 2015 12:50:22 +0000 Message-Id: <1447678222-6858-2-git-send-email-daniels@collabora.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1447678222-6858-1-git-send-email-daniels@collabora.com> References: <1447678222-6858-1-git-send-email-daniels@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151116_045104_961915_CBCB13AA X-CRM114-Status: GOOD ( 10.05 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, Sjoerd Simons , Heiko Stuebner , dri-devel@lists.freedesktop.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.0 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 Rockchip previously treated a pageflip to the same framebuffer as a no-op, discarding the event if one was requested. This breaks Weston, which, when idle, sends a no-op vblank event to discover vblank timings if the vblank query interface is not usable. Silently dropping events is also quite a hostile thing to do to userspace in general. Signed-off-by: Daniel Stone Cc: Sjoerd Simons Cc: Heiko Stuebner Tested-by: Sjoerd Simons Tested-by: Heiko Stuebner --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 30 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index ddf6dc2..dad607e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -916,25 +916,23 @@ static int vop_update_plane_event(struct drm_plane *plane, * unreference any previous framebuffers. */ mutex_lock(&vop->vsync_mutex); - if (fb != vop_win_last_pending_fb(vop_win)) { - ret = drm_vblank_get(plane->dev, vop->pipe); - if (ret) { - DRM_ERROR("failed to get vblank, %d\n", ret); - mutex_unlock(&vop->vsync_mutex); - return ret; - } + ret = drm_vblank_get(plane->dev, vop->pipe); + if (ret) { + DRM_ERROR("failed to get vblank, %d\n", ret); + mutex_unlock(&vop->vsync_mutex); + return ret; + } - drm_framebuffer_reference(fb); + drm_framebuffer_reference(fb); - ret = vop_win_queue_fb(vop_win, fb, yrgb_mst, event); - if (ret) { - drm_vblank_put(plane->dev, vop->pipe); - mutex_unlock(&vop->vsync_mutex); - return ret; - } - - vop->vsync_work_pending = true; + ret = vop_win_queue_fb(vop_win, fb, yrgb_mst, event); + if (ret) { + drm_vblank_put(plane->dev, vop->pipe); + mutex_unlock(&vop->vsync_mutex); + return ret; } + + vop->vsync_work_pending = true; mutex_unlock(&vop->vsync_mutex); spin_lock(&vop->reg_lock);