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: 7624871 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 CFED89F2E2 for ; Mon, 16 Nov 2015 12:50:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 05584204EB for ; Mon, 16 Nov 2015 12:50:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 95379205B5 for ; Mon, 16 Nov 2015 12:50:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E1816E10B; Mon, 16 Nov 2015 04:50:39 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id D5BE56E10A for ; Mon, 16 Nov 2015 04:50:37 -0800 (PST) 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> Cc: linux-rockchip@lists.infradead.org, Sjoerd Simons , dri-devel@lists.freedesktop.org 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.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);