From patchwork Wed Jul 19 07:40:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 9850649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5BF6860392 for ; Wed, 19 Jul 2017 07:41:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A409285FD for ; Wed, 19 Jul 2017 07:41:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EF6028600; Wed, 19 Jul 2017 07:41:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EC49E285FD for ; Wed, 19 Jul 2017 07:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=WfkTjhUhAik9lNXs/rey6H7Iic3pWhQuq87g+vQJXXQ=; b=JXdIiuE/cgrNM8eE4HfnzlE64I BgvDJb2hdU5LFtGyHdCExYBLQNkG8O5+S1mYJMMyN4ZGB6qkw81xHAzx+MVjRRnM3McuDGkzjZWdN JhpdI3PpC8OvL6XFLhKmsTAYiyvFYYd/uLf21pcP1V8RFxzBNLTSs0I22mrEA2Kv/CQGJCs5Z+Iws fmJ172P+mcWCiGtVDjbvFHCNv1+1x8iZUaiyKCCcR4Qg8uynko6gk1A47ksmk4MYlFsEn75wn0vPa t7Y71Ib9iHIbgc9StKHxkJuXnjgeKTHFYelNCtaGujXAk6HrtRjm+GDksqOQT99cXQTsue6WeB2O1 2sXYpyDg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dXjc7-0000Vc-N1; Wed, 19 Jul 2017 07:41:43 +0000 Received: from mblankhorst.nl ([141.105.120.124]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dXjbq-0000FF-0S; Wed, 19 Jul 2017 07:41:28 +0000 From: Maarten Lankhorst To: intel-gfx-trybot@lists.freedesktop.org Subject: [PATCH 06/12] drm/mediatek: Handle drm_atomic_helper_swap_state failure Date: Wed, 19 Jul 2017 09:40:46 +0200 Message-Id: <20170719074052.2993-6-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170719074052.2993-1-maarten.lankhorst@linux.intel.com> References: <20170719074052.2993-1-maarten.lankhorst@linux.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170719_004126_252360_D506038C X-CRM114-Status: UNSURE ( 7.28 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CK Hu , linux-mediatek@lists.infradead.org, Maarten Lankhorst , linux-arm-kernel@lists.infradead.org, Philipp Zabel MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP drm_atomic_helper_swap_state() will be changed to interruptible waiting in the next few commits, so all drivers have to be changed to handling failure. Signed-off-by: Maarten Lankhorst Cc: CK Hu Cc: Philipp Zabel Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Link: http://patchwork.freedesktop.org/patch/msgid/20170711143314.2148-7-maarten.lankhorst@linux.intel.com Reviewed-by: Philipp Zabel Reviewed-by: Sean Paul --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index be0741638f94..b2596f35104b 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -109,7 +109,12 @@ static int mtk_atomic_commit(struct drm_device *drm, mutex_lock(&private->commit.lock); flush_work(&private->commit.work); - drm_atomic_helper_swap_state(state, true); + ret = drm_atomic_helper_swap_state(state, true); + if (ret) { + mutex_unlock(&private->commit.lock); + drm_atomic_helper_cleanup_planes(drm, state); + return ret; + } drm_atomic_state_get(state); if (async)