From patchwork Thu Mar 31 08:08:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8708161 Return-Path: X-Original-To: patchwork-linux-arm@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 2D21D9F39A for ; Thu, 31 Mar 2016 08:10:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D39F20259 for ; Thu, 31 Mar 2016 08:10:14 +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 3F6FF2017E for ; Thu, 31 Mar 2016 08:10:13 +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 1alXer-0002ul-3r; Thu, 31 Mar 2016 08:08:49 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1alXej-0002lE-KL; Thu, 31 Mar 2016 08:08:43 +0000 Received: by mail-wm0-x232.google.com with SMTP id p65so213690120wmp.1; Thu, 31 Mar 2016 01:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=cbqBNqxtoogn4AMGMUCf447m+qFxwcYjgrVlPXBTvC4=; b=NEEHL6wQ24Inw/IloIF/gY5WqXqs+QwG5la+bNoQksppysd75MaxUla9s9PJettk7+ p0H2ZdF5zA/S2YiagvjARd55f2F/c31zmduh61LBYkxSK8AyhTCQ2qZwMRJJkGkGKjqp O9IEssl9rlfByZxG1V1VUYL243eEh4LD94OKEgbeWuKg5tRAQWaVqnQW7v7eIghIg4dl 2J+7iPZvP+DAWkCOWCOkCg8sEG5ACMMF/WJowXL+Frza/w0SFQsaMmWBBae3HzjbkwXB bgMAdAxlXUkAmb5LbWdgOx6u8CweTsdBn9EJps8LunzH1sUIIGze/WRPFiI0RfVZ1DzH yOXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=cbqBNqxtoogn4AMGMUCf447m+qFxwcYjgrVlPXBTvC4=; b=Z4vrM6KiTQwHUqBVo2sQlGgrfV5avY153qzqkdDEltsTokFoQSkrbuEDxMW3ZYrkTk OHbp1XQ8c8D4i0mP0i8TorD41+1qRInEmTouQB3AX0WzKqKyfEtvgcs98Jve2WrATfyQ ueV9NNyu63+/w9i9F0B8Ca+6sloYXw9s2nayqwJ9iB4jdc+yhGlpDdWNycrY0kLx4ozJ 0Cl96AVtikLUEyhkb+FDkBGGupn+Y+xie49AWbbjSPDBouqLOJP8npC73QZOEqhTF9h9 tsr3/7BJJthEugqC6hKwRJtwlIh39ArTdr56/wWpiTYipmE/5Kvi1AuBdz4SNNgmPg4g L/qw== X-Gm-Message-State: AD7BkJJae3+lIlulEWBa1HMGzDfCemvdLdXUIzyLgCyLgDM01mUoCnUD3w9f0niVBltFjg== X-Received: by 10.194.21.197 with SMTP id x5mr1604011wje.90.1459411699990; Thu, 31 Mar 2016 01:08:19 -0700 (PDT) Received: from cizrna.lan ([109.72.12.79]) by smtp.gmail.com with ESMTPSA id j10sm7692705wjb.46.2016.03.31.01.08.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Mar 2016 01:08:18 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160331_010841_963578_5C5015FB X-CRM114-Status: UNSURE ( 9.03 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.4 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , Tomeu Vizoso , David Airlie , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Mark Yao MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 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;