mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "amergnat@baylibre.com" <amergnat@baylibre.com>,
	"Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
	"angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
	"Johnson Wang (王聖鑫)" <Johnson.Wang@mediatek.com>,
	"Jason-ch Chen (陳建豪)" <Jason-ch.Chen@mediatek.com>,
	"Shawn Sung (宋孝謙)" <Shawn.Sung@mediatek.com>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>
Subject: Re: [PATCH v3 1/2] drm/mediatek: Fix iommu fault by swapping FBs after updating plane state
Date: Fri, 14 Jul 2023 06:38:38 +0000	[thread overview]
Message-ID: <e546b039ea36bd66b327f6597daf9340419a3306.camel@mediatek.com> (raw)
In-Reply-To: <20230710093253.32224-2-jason-jh.lin@mediatek.com>

Hi, Jason:

On Mon, 2023-07-10 at 17:32 +0800, Jason-JH.Lin wrote:
> 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.

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> 
> Fixes: 1a64a7aff8da ("drm/mediatek: Fix cursor plane no update")
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> Reviewed-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> index 31f9420aff6f..b1a918ffe457 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> @@ -210,9 +210,9 @@ static void mtk_plane_atomic_async_update(struct
> drm_plane *plane,
>  	plane->state->src_y = new_state->src_y;
>  	plane->state->src_h = new_state->src_h;
>  	plane->state->src_w = new_state->src_w;
> -	swap(plane->state->fb, new_state->fb);
>  
>  	mtk_plane_update_new_state(new_state, new_plane_state);
> +	swap(plane->state->fb, new_state->fb);
>  	wmb(); /* Make sure the above parameters are set before update
> */
>  	new_plane_state->pending.async_dirty = true;
>  	mtk_drm_crtc_async_update(new_state->crtc, plane, state);

      parent reply	other threads:[~2023-07-14  6:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230710093253.32224-1-jason-jh.lin@mediatek.com>
     [not found] ` <20230710093253.32224-3-jason-jh.lin@mediatek.com>
2023-07-10  9:34   ` [PATCH v3 2/2] drm/mediatek: Fix iommu fault during crtc enabling AngeloGioacchino Del Regno
2023-07-12 13:03   ` Alexandre Mergnat
2023-07-14  6:57   ` CK Hu (胡俊光)
2023-07-18 15:48     ` Jason-JH Lin (林睿祥)
2023-07-26  6:56       ` CK Hu (胡俊光)
2023-08-05  8:10         ` Jason-JH Lin (林睿祥)
     [not found] ` <20230710093253.32224-2-jason-jh.lin@mediatek.com>
2023-07-12 13:03   ` [PATCH v3 1/2] drm/mediatek: Fix iommu fault by swapping FBs after updating plane state Alexandre Mergnat
2023-07-14  6:38   ` CK Hu (胡俊光) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e546b039ea36bd66b327f6597daf9340419a3306.camel@mediatek.com \
    --to=ck.hu@mediatek.com \
    --cc=Jason-JH.Lin@mediatek.com \
    --cc=Jason-ch.Chen@mediatek.com \
    --cc=Johnson.Wang@mediatek.com \
    --cc=Nancy.Lin@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Shawn.Sung@mediatek.com \
    --cc=Singo.Chang@mediatek.com \
    --cc=amergnat@baylibre.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®