From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0248DEB64D9 for ; Mon, 10 Jul 2023 08:07:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5894910E214; Mon, 10 Jul 2023 08:07:06 +0000 (UTC) Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by gabe.freedesktop.org (Postfix) with ESMTPS id 412BD10E217 for ; Mon, 10 Jul 2023 08:07:04 +0000 (UTC) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 0327A66057B8; Mon, 10 Jul 2023 09:07:00 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1688976421; bh=4MaltMVO+iQy6EpByYoeAcXeuF+ABj89+MZxBYJFHKg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=addcJBtOMke09j+T2MFJ5b5YVqiJA8dBuzMlpUWHxRWbF7exr5O9ywRw4xwFxyZdv 22k+KVecQZIG0Rmt9tBcCPHqUyxIZaPHySPgJC8fjqckey56wrJYQ+LIwBfFZWtwWI Q3Ek46u64q8lnquI2kj8o0u1gcCMo394umGWpHrYKt0OU2lAk3PN3H5EHx/dKqYLIg dH5Fu86DCBBs/qHx/iYA3x9Alj8/NubIPQPwBfaZcehKN/K95ffQwvEJWj9db7vD+W Hx9brc0DBNm+uZLfWFKBdlIWb37uqpSZKYr3jaSWRAffcj7LnqL8daiyvDGQQ81lhb M1txsLeyxlN1Q== Message-ID: <44a4270b-72d5-10ca-c706-c3a1fc7bd4dc@collabora.com> Date: Mon, 10 Jul 2023 10:06:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 1/2] drm/mediatek: Fix iommu fault by swapping FBs after updating plane state Content-Language: en-US To: "Jason-JH.Lin" , Chun-Kuang Hu , Alexandre Mergnat References: <20230709162641.6405-1-jason-jh.lin@mediatek.com> <20230709162641.6405-2-jason-jh.lin@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230709162641.6405-2-jason-jh.lin@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Singo Chang , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Project_Global_Chrome_Upstream_Group@mediatek.com, Jason-ch Chen , Nancy Lin , Johnson Wang , Shawn Sung , Matthias Brugger , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Il 09/07/23 18:26, Jason-JH.Lin ha scritto: > According to the comment in drm_atomic_helper_async_commit(), > we should make sure FBs have been swapped, so that cleanups in the > new_state performs a cleanup in the old FB. > > So we should move swapping FBs after calling mtk_plane_update_new_state(), > to avoid using the old FB which could be freed. > > Fixes: 1a64a7aff8da ("drm/mediatek: Fix cursor plane no update") > Signed-off-by: Jason-JH.Lin Reviewed-by: AngeloGioacchino Del Regno