Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755534AbcCaIIm (ORCPT ); Thu, 31 Mar 2016 04:08:42 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:35414 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755113AbcCaIIV (ORCPT ); Thu, 31 Mar 2016 04:08:21 -0400 From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Cc: Tomeu Vizoso , Mark Yao , David Airlie , Heiko Stuebner , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH] drm/rockchip: Return -EBUSY if there's already a pending flip event v2 Date: Thu, 31 Mar 2016 10:08:00 +0200 Message-Id: <1459411680-6176-1-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 932 Lines: 27 As per the docs, atomic_commit should return -EBUSY "if an asycnhronous updated is requested and there is an earlier updated pending". v2: Use the status of the workqueue instead of vop->event, and don't add a superfluous wait on the workqueue. Signed-off-by: Tomeu Vizoso --- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c index 3b8f652698f8..285f8cd5afe1 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c @@ -282,6 +282,9 @@ int rockchip_drm_atomic_commit(struct drm_device *dev, struct rockchip_atomic_commit *commit = &private->commit; int ret; + if (async && work_busy(&commit->work)) + return -EBUSY; + ret = drm_atomic_helper_prepare_planes(dev, state); if (ret) return ret; -- 2.5.5