public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver
@ 2025-10-24 20:27 Ariel D'Alessandro
  2025-10-27  9:51 ` Daniel Stone
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Ariel D'Alessandro @ 2025-10-24 20:27 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, simona, matthias.bgg,
	angelogioacchino.delregno, greenjustin, sjoerd
  Cc: dri-devel, linux-mediatek, linux-kernel, linux-arm-kernel, kernel,
	Ariel D'Alessandro

Commit c410fa9b07c32 ("drm/mediatek: Add AFBC support to Mediatek DRM
driver") added AFBC support to Mediatek DRM and enabled the
32x8/split/sparse modifier.

However, this is currently broken on Mediatek MT8188 (Genio 700 EVK
platform); tested using upstream Kernel and Mesa (v25.2.1), AFBC is used by
default since Mesa v25.0.

Kernel trace reports vblank timeouts constantly, and the render is garbled:

```
[CRTC:62:crtc-0] vblank wait timed out
WARNING: CPU: 7 PID: 70 at drivers/gpu/drm/drm_atomic_helper.c:1835 drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
[...]
Hardware name: MediaTek Genio-700 EVK (DT)
Workqueue: events_unbound commit_work
pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
lr : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
sp : ffff80008337bca0
x29: ffff80008337bcd0 x28: 0000000000000061 x27: 0000000000000000
x26: 0000000000000001 x25: 0000000000000000 x24: ffff0000c9dcc000
x23: 0000000000000001 x22: 0000000000000000 x21: ffff0000c66f2f80
x20: ffff0000c0d7d880 x19: 0000000000000000 x18: 000000000000000a
x17: 000000040044ffff x16: 005000f2b5503510 x15: 0000000000000000
x14: 0000000000000000 x13: 74756f2064656d69 x12: 742074696177206b
x11: 0000000000000058 x10: 0000000000000018 x9 : ffff800082396a70
x8 : 0000000000057fa8 x7 : 0000000000000cce x6 : ffff8000823eea70
x5 : ffff0001fef5f408 x4 : ffff80017ccee000 x3 : ffff0000c12cb480
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000c12cb480
Call trace:
 drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c (P)
 drm_atomic_helper_commit_tail_rpm+0x64/0x80
 commit_tail+0xa4/0x1a4
 commit_work+0x14/0x20
 process_one_work+0x150/0x290
 worker_thread+0x2d0/0x3ec
 kthread+0x12c/0x210
 ret_from_fork+0x10/0x20
---[ end trace 0000000000000000 ]---
```

Until this gets fixed upstream, disable AFBC support on this platform, as
it's currently broken with upstream Mesa.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
 drivers/gpu/drm/mediatek/mtk_plane.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_plane.c b/drivers/gpu/drm/mediatek/mtk_plane.c
index 02349bd440017..788b52c1d10c5 100644
--- a/drivers/gpu/drm/mediatek/mtk_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_plane.c
@@ -21,9 +21,6 @@
 
 static const u64 modifiers[] = {
 	DRM_FORMAT_MOD_LINEAR,
-	DRM_FORMAT_MOD_ARM_AFBC(AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 |
-				AFBC_FORMAT_MOD_SPLIT |
-				AFBC_FORMAT_MOD_SPARSE),
 	DRM_FORMAT_MOD_INVALID,
 };
 
@@ -71,26 +68,7 @@ static bool mtk_plane_format_mod_supported(struct drm_plane *plane,
 					   uint32_t format,
 					   uint64_t modifier)
 {
-	if (modifier == DRM_FORMAT_MOD_LINEAR)
-		return true;
-
-	if (modifier != DRM_FORMAT_MOD_ARM_AFBC(
-				AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 |
-				AFBC_FORMAT_MOD_SPLIT |
-				AFBC_FORMAT_MOD_SPARSE))
-		return false;
-
-	if (format != DRM_FORMAT_XRGB8888 &&
-	    format != DRM_FORMAT_ARGB8888 &&
-	    format != DRM_FORMAT_BGRX8888 &&
-	    format != DRM_FORMAT_BGRA8888 &&
-	    format != DRM_FORMAT_ABGR8888 &&
-	    format != DRM_FORMAT_XBGR8888 &&
-	    format != DRM_FORMAT_RGB888 &&
-	    format != DRM_FORMAT_BGR888)
-		return false;
-
-	return true;
+	return modifier == DRM_FORMAT_MOD_LINEAR;
 }
 
 static void mtk_plane_destroy_state(struct drm_plane *plane,


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver
  2025-10-24 20:27 [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver Ariel D'Alessandro
@ 2025-10-27  9:51 ` Daniel Stone
  2025-10-28  5:43 ` CK Hu (胡俊光)
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Daniel Stone @ 2025-10-27  9:51 UTC (permalink / raw)
  To: Ariel D'Alessandro
  Cc: chunkuang.hu, p.zabel, airlied, simona, matthias.bgg,
	angelogioacchino.delregno, greenjustin, sjoerd, dri-devel,
	linux-mediatek, linux-kernel, linux-arm-kernel, kernel

On Fri, 24 Oct 2025 at 21:28, Ariel D'Alessandro
<ariel.dalessandro@collabora.com> wrote:
> Commit c410fa9b07c32 ("drm/mediatek: Add AFBC support to Mediatek DRM
> driver") added AFBC support to Mediatek DRM and enabled the
> 32x8/split/sparse modifier.
>
> However, this is currently broken on Mediatek MT8188 (Genio 700 EVK
> platform); tested using upstream Kernel and Mesa (v25.2.1), AFBC is used by
> default since Mesa v25.0.
>
> Kernel trace reports vblank timeouts constantly, and the render is garbled:

Reviewed-by: Daniel Stone <daniels@collabora.com>

This is definitely the right thing to do until we can figure out why
the DRM driver doesn't like the GPU's images, and how we can get it
fixed in either DRM or Mesa.

Cheers,
Daniel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver
  2025-10-24 20:27 [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver Ariel D'Alessandro
  2025-10-27  9:51 ` Daniel Stone
@ 2025-10-28  5:43 ` CK Hu (胡俊光)
  2025-10-28 10:48 ` Macpaul Lin (林智斌)
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: CK Hu (胡俊光) @ 2025-10-28  5:43 UTC (permalink / raw)
  To: Ariel D'Alessandro, Sjoerd Simons, chunkuang.hu@kernel.org,
	simona@ffwll.ch, AngeloGioacchino Del Regno, airlied@gmail.com,
	greenjustin@chromium.org, p.zabel@pengutronix.de,
	matthias.bgg@gmail.com
  Cc: dri-devel@lists.freedesktop.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel@collabora.com

On Fri, 2025-10-24 at 17:27 -0300, Ariel D'Alessandro wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
> 
> 
> Commit c410fa9b07c32 ("drm/mediatek: Add AFBC support to Mediatek DRM
> driver") added AFBC support to Mediatek DRM and enabled the
> 32x8/split/sparse modifier.
> 
> However, this is currently broken on Mediatek MT8188 (Genio 700 EVK
> platform); tested using upstream Kernel and Mesa (v25.2.1), AFBC is used by
> default since Mesa v25.0.
> 
> Kernel trace reports vblank timeouts constantly, and the render is garbled:
> 
> ```
> [CRTC:62:crtc-0] vblank wait timed out
> WARNING: CPU: 7 PID: 70 at drivers/gpu/drm/drm_atomic_helper.c:1835 drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> [...]
> Hardware name: MediaTek Genio-700 EVK (DT)
> Workqueue: events_unbound commit_work
> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> lr : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> sp : ffff80008337bca0
> x29: ffff80008337bcd0 x28: 0000000000000061 x27: 0000000000000000
> x26: 0000000000000001 x25: 0000000000000000 x24: ffff0000c9dcc000
> x23: 0000000000000001 x22: 0000000000000000 x21: ffff0000c66f2f80
> x20: ffff0000c0d7d880 x19: 0000000000000000 x18: 000000000000000a
> x17: 000000040044ffff x16: 005000f2b5503510 x15: 0000000000000000
> x14: 0000000000000000 x13: 74756f2064656d69 x12: 742074696177206b
> x11: 0000000000000058 x10: 0000000000000018 x9 : ffff800082396a70
> x8 : 0000000000057fa8 x7 : 0000000000000cce x6 : ffff8000823eea70
> x5 : ffff0001fef5f408 x4 : ffff80017ccee000 x3 : ffff0000c12cb480
> x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000c12cb480
> Call trace:
>  drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c (P)
>  drm_atomic_helper_commit_tail_rpm+0x64/0x80
>  commit_tail+0xa4/0x1a4
>  commit_work+0x14/0x20
>  process_one_work+0x150/0x290
>  worker_thread+0x2d0/0x3ec
>  kthread+0x12c/0x210
>  ret_from_fork+0x10/0x20
> ---[ end trace 0000000000000000 ]---
> ```
> 
> Until this gets fixed upstream, disable AFBC support on this platform, as
> it's currently broken with upstream Mesa.

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

> 
> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_plane.c | 24 +-----------------------
>  1 file changed, 1 insertion(+), 23 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_plane.c b/drivers/gpu/drm/mediatek/mtk_plane.c
> index 02349bd440017..788b52c1d10c5 100644
> --- a/drivers/gpu/drm/mediatek/mtk_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_plane.c
> @@ -21,9 +21,6 @@
> 
>  static const u64 modifiers[] = {
>         DRM_FORMAT_MOD_LINEAR,
> -       DRM_FORMAT_MOD_ARM_AFBC(AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 |
> -                               AFBC_FORMAT_MOD_SPLIT |
> -                               AFBC_FORMAT_MOD_SPARSE),
>         DRM_FORMAT_MOD_INVALID,
>  };
> 
> @@ -71,26 +68,7 @@ static bool mtk_plane_format_mod_supported(struct drm_plane *plane,
>                                            uint32_t format,
>                                            uint64_t modifier)
>  {
> -       if (modifier == DRM_FORMAT_MOD_LINEAR)
> -               return true;
> -
> -       if (modifier != DRM_FORMAT_MOD_ARM_AFBC(
> -                               AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 |
> -                               AFBC_FORMAT_MOD_SPLIT |
> -                               AFBC_FORMAT_MOD_SPARSE))
> -               return false;
> -
> -       if (format != DRM_FORMAT_XRGB8888 &&
> -           format != DRM_FORMAT_ARGB8888 &&
> -           format != DRM_FORMAT_BGRX8888 &&
> -           format != DRM_FORMAT_BGRA8888 &&
> -           format != DRM_FORMAT_ABGR8888 &&
> -           format != DRM_FORMAT_XBGR8888 &&
> -           format != DRM_FORMAT_RGB888 &&
> -           format != DRM_FORMAT_BGR888)
> -               return false;
> -
> -       return true;
> +       return modifier == DRM_FORMAT_MOD_LINEAR;
>  }
> 
>  static void mtk_plane_destroy_state(struct drm_plane *plane,


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver
  2025-10-24 20:27 [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver Ariel D'Alessandro
  2025-10-27  9:51 ` Daniel Stone
  2025-10-28  5:43 ` CK Hu (胡俊光)
@ 2025-10-28 10:48 ` Macpaul Lin (林智斌)
  2025-10-29  2:53   ` CK Hu (胡俊光)
  2025-11-01 14:27 ` Chun-Kuang Hu
  2026-02-10  5:06 ` Chen-Yu Tsai
  4 siblings, 1 reply; 7+ messages in thread
From: Macpaul Lin (林智斌) @ 2025-10-28 10:48 UTC (permalink / raw)
  To: Ariel D'Alessandro, Sjoerd Simons, chunkuang.hu@kernel.org,
	simona@ffwll.ch, AngeloGioacchino Del Regno, airlied@gmail.com,
	greenjustin@chromium.org, p.zabel@pengutronix.de,
	matthias.bgg@gmail.com
  Cc: Bear Wang (萩原惟德), Tzu-Hsien Kao,
	TommyYL Chen (陳彥良),
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Pablo Sun (孫毓翔),
	linux-arm-kernel@lists.infradead.org, Jian Hui Lee,
	linux-mediatek@lists.infradead.org, kernel@collabora.com,
	stable@vger.kernel.org

On Fri, 2025-10-24 at 17:27 -0300, Ariel D'Alessandro wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> Commit c410fa9b07c32 ("drm/mediatek: Add AFBC support to Mediatek DRM
> driver") added AFBC support to Mediatek DRM and enabled the
> 32x8/split/sparse modifier.
> 
> However, this is currently broken on Mediatek MT8188 (Genio 700 EVK
> platform); tested using upstream Kernel and Mesa (v25.2.1), AFBC is
> used by
> default since Mesa v25.0.
> 
> Kernel trace reports vblank timeouts constantly, and the render is
> garbled:
> 
> ```
> [CRTC:62:crtc-0] vblank wait timed out
> WARNING: CPU: 7 PID: 70 at drivers/gpu/drm/drm_atomic_helper.c:1835
> drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> [...]
> Hardware name: MediaTek Genio-700 EVK (DT)
> Workqueue: events_unbound commit_work
> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> lr : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> sp : ffff80008337bca0
> x29: ffff80008337bcd0 x28: 0000000000000061 x27: 0000000000000000
> x26: 0000000000000001 x25: 0000000000000000 x24: ffff0000c9dcc000
> x23: 0000000000000001 x22: 0000000000000000 x21: ffff0000c66f2f80
> x20: ffff0000c0d7d880 x19: 0000000000000000 x18: 000000000000000a
> x17: 000000040044ffff x16: 005000f2b5503510 x15: 0000000000000000
> x14: 0000000000000000 x13: 74756f2064656d69 x12: 742074696177206b
> x11: 0000000000000058 x10: 0000000000000018 x9 : ffff800082396a70
> x8 : 0000000000057fa8 x7 : 0000000000000cce x6 : ffff8000823eea70
> x5 : ffff0001fef5f408 x4 : ffff80017ccee000 x3 : ffff0000c12cb480
> x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000c12cb480
> Call trace:
>  drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c (P)
>  drm_atomic_helper_commit_tail_rpm+0x64/0x80
>  commit_tail+0xa4/0x1a4
>  commit_work+0x14/0x20
>  process_one_work+0x150/0x290
>  worker_thread+0x2d0/0x3ec
>  kthread+0x12c/0x210
>  ret_from_fork+0x10/0x20
> ---[ end trace 0000000000000000 ]---
> ```
> 
> Until this gets fixed upstream, disable AFBC support on this
> platform, as
> it's currently broken with upstream Mesa.
> 
> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_plane.c | 24 +-----------------------
>  1 file changed, 1 insertion(+), 23 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_plane.c
> b/drivers/gpu/drm/mediatek/mtk_plane.c
> index 02349bd440017..788b52c1d10c5 100644
> --- a/drivers/gpu/drm/mediatek/mtk_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_plane.c
> @@ -21,9 +21,6 @@
> 
>  static const u64 modifiers[] = {
>         DRM_FORMAT_MOD_LINEAR,
> -       DRM_FORMAT_MOD_ARM_AFBC(AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 |
> -                               AFBC_FORMAT_MOD_SPLIT |
> -                               AFBC_FORMAT_MOD_SPARSE),
>         DRM_FORMAT_MOD_INVALID,
>  };
> 
> @@ -71,26 +68,7 @@ static bool mtk_plane_format_mod_supported(struct
> drm_plane *plane,
>                                            uint32_t format,
>                                            uint64_t modifier)
>  {
> -       if (modifier == DRM_FORMAT_MOD_LINEAR)
> -               return true;
> -
> -       if (modifier != DRM_FORMAT_MOD_ARM_AFBC(
> -                               AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 |
> -                               AFBC_FORMAT_MOD_SPLIT |
> -                               AFBC_FORMAT_MOD_SPARSE))
> -               return false;
> -
> -       if (format != DRM_FORMAT_XRGB8888 &&
> -           format != DRM_FORMAT_ARGB8888 &&
> -           format != DRM_FORMAT_BGRX8888 &&
> -           format != DRM_FORMAT_BGRA8888 &&
> -           format != DRM_FORMAT_ABGR8888 &&
> -           format != DRM_FORMAT_XBGR8888 &&
> -           format != DRM_FORMAT_RGB888 &&
> -           format != DRM_FORMAT_BGR888)
> -               return false;
> -
> -       return true;
> +       return modifier == DRM_FORMAT_MOD_LINEAR;
>  }
> 
>  static void mtk_plane_destroy_state(struct drm_plane *plane,
> 

Great! Thanks for this patch.
I've tested this patch against k6.17.5 on mt8395-genio-1200-evk board,
and it is working.
I've also tested this patch with 'modetest -M mediatek -s
34@59:1200x1290' is working as well.

I'm not sure if it is possible to add a "Fixes:" tag to this patch?
Maybe add this patch with 'Cc: stable@vger.kernel.org #6.17' at least?
Some Linux distros are currently using 6.17 for testing.

Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>

Regards,
Macpaul Lin


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver
  2025-10-28 10:48 ` Macpaul Lin (林智斌)
@ 2025-10-29  2:53   ` CK Hu (胡俊光)
  0 siblings, 0 replies; 7+ messages in thread
From: CK Hu (胡俊光) @ 2025-10-29  2:53 UTC (permalink / raw)
  To: Ariel D'Alessandro, Sjoerd Simons, chunkuang.hu@kernel.org,
	simona@ffwll.ch, AngeloGioacchino Del Regno,
	Macpaul Lin (林智斌), airlied@gmail.com,
	greenjustin@chromium.org, p.zabel@pengutronix.de,
	matthias.bgg@gmail.com
  Cc: Bear Wang (萩原惟德), Tzu-Hsien Kao,
	TommyYL Chen (陳彥良),
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Pablo Sun (孫毓翔),
	linux-arm-kernel@lists.infradead.org, Jian Hui Lee,
	linux-mediatek@lists.infradead.org, kernel@collabora.com,
	stable@vger.kernel.org

Hi, Justin:

AFBC just improve DRAM bandwidth performance, so I decide to backport this disable patch.
Once fixup patch exist, then backport fixup patch.

Regards,
CK

On Tue, 2025-10-28 at 10:48 +0000, Macpaul Lin (林智斌) wrote:
> 
> On Fri, 2025-10-24 at 17:27 -0300, Ariel D'Alessandro wrote:
> > 
> > External email : Please do not click links or open attachments until
> > you have verified the sender or the content.
> > 
> > 
> > Commit c410fa9b07c32 ("drm/mediatek: Add AFBC support to Mediatek DRM
> > driver") added AFBC support to Mediatek DRM and enabled the
> > 32x8/split/sparse modifier.
> > 
> > However, this is currently broken on Mediatek MT8188 (Genio 700 EVK
> > platform); tested using upstream Kernel and Mesa (v25.2.1), AFBC is
> > used by
> > default since Mesa v25.0.
> > 
> > Kernel trace reports vblank timeouts constantly, and the render is
> > garbled:
> > 
> > ```
> > [CRTC:62:crtc-0] vblank wait timed out
> > WARNING: CPU: 7 PID: 70 at drivers/gpu/drm/drm_atomic_helper.c:1835
> > drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> > [...]
> > Hardware name: MediaTek Genio-700 EVK (DT)
> > Workqueue: events_unbound commit_work
> > pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> > pc : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> > lr : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> > sp : ffff80008337bca0
> > x29: ffff80008337bcd0 x28: 0000000000000061 x27: 0000000000000000
> > x26: 0000000000000001 x25: 0000000000000000 x24: ffff0000c9dcc000
> > x23: 0000000000000001 x22: 0000000000000000 x21: ffff0000c66f2f80
> > x20: ffff0000c0d7d880 x19: 0000000000000000 x18: 000000000000000a
> > x17: 000000040044ffff x16: 005000f2b5503510 x15: 0000000000000000
> > x14: 0000000000000000 x13: 74756f2064656d69 x12: 742074696177206b
> > x11: 0000000000000058 x10: 0000000000000018 x9 : ffff800082396a70
> > x8 : 0000000000057fa8 x7 : 0000000000000cce x6 : ffff8000823eea70
> > x5 : ffff0001fef5f408 x4 : ffff80017ccee000 x3 : ffff0000c12cb480
> > x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000c12cb480
> > Call trace:
> >  drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c (P)
> >  drm_atomic_helper_commit_tail_rpm+0x64/0x80
> >  commit_tail+0xa4/0x1a4
> >  commit_work+0x14/0x20
> >  process_one_work+0x150/0x290
> >  worker_thread+0x2d0/0x3ec
> >  kthread+0x12c/0x210
> >  ret_from_fork+0x10/0x20
> > ---[ end trace 0000000000000000 ]---
> > ```
> > 
> > Until this gets fixed upstream, disable AFBC support on this
> > platform, as
> > it's currently broken with upstream Mesa.
> > 
> > Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
> > ---
> >  drivers/gpu/drm/mediatek/mtk_plane.c | 24 +-----------------------
> >  1 file changed, 1 insertion(+), 23 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/mediatek/mtk_plane.c
> > b/drivers/gpu/drm/mediatek/mtk_plane.c
> > index 02349bd440017..788b52c1d10c5 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_plane.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_plane.c
> > @@ -21,9 +21,6 @@
> > 
> >  static const u64 modifiers[] = {
> >         DRM_FORMAT_MOD_LINEAR,
> > -       DRM_FORMAT_MOD_ARM_AFBC(AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 |
> > -                               AFBC_FORMAT_MOD_SPLIT |
> > -                               AFBC_FORMAT_MOD_SPARSE),
> >         DRM_FORMAT_MOD_INVALID,
> >  };
> > 
> > @@ -71,26 +68,7 @@ static bool mtk_plane_format_mod_supported(struct
> > drm_plane *plane,
> >                                            uint32_t format,
> >                                            uint64_t modifier)
> >  {
> > -       if (modifier == DRM_FORMAT_MOD_LINEAR)
> > -               return true;
> > -
> > -       if (modifier != DRM_FORMAT_MOD_ARM_AFBC(
> > -                               AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 |
> > -                               AFBC_FORMAT_MOD_SPLIT |
> > -                               AFBC_FORMAT_MOD_SPARSE))
> > -               return false;
> > -
> > -       if (format != DRM_FORMAT_XRGB8888 &&
> > -           format != DRM_FORMAT_ARGB8888 &&
> > -           format != DRM_FORMAT_BGRX8888 &&
> > -           format != DRM_FORMAT_BGRA8888 &&
> > -           format != DRM_FORMAT_ABGR8888 &&
> > -           format != DRM_FORMAT_XBGR8888 &&
> > -           format != DRM_FORMAT_RGB888 &&
> > -           format != DRM_FORMAT_BGR888)
> > -               return false;
> > -
> > -       return true;
> > +       return modifier == DRM_FORMAT_MOD_LINEAR;
> >  }
> > 
> >  static void mtk_plane_destroy_state(struct drm_plane *plane,
> > 
> 
> Great! Thanks for this patch.
> I've tested this patch against k6.17.5 on mt8395-genio-1200-evk board,
> and it is working.
> I've also tested this patch with 'modetest -M mediatek -s
> 34@59:1200x1290' is working as well.
> 
> I'm not sure if it is possible to add a "Fixes:" tag to this patch?
> Maybe add this patch with 'Cc: stable@vger.kernel.org #6.17' at least?
> Some Linux distros are currently using 6.17 for testing.
> 
> Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>
> 
> Regards,
> Macpaul Lin
> 
> 
> ************* MEDIATEK Confidentiality Notice
>  ********************
> The information contained in this e-mail message (including any 
> attachments) may be confidential, proprietary, privileged, or otherwise
> exempt from disclosure under applicable laws. It is intended to be 
> conveyed only to the designated recipient(s). Any use, dissemination, 
> distribution, printing, retaining or copying of this e-mail (including its 
> attachments) by unintended recipient(s) is strictly prohibited and may 
> be unlawful. If you are not an intended recipient of this e-mail, or believe
>  
> that you have received this e-mail in error, please notify the sender 
> immediately (by replying to this e-mail), delete any and all copies of 
> this e-mail (including any attachments) from your system, and do not
> disclose the content of this e-mail to any other person. Thank you!


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver
  2025-10-24 20:27 [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver Ariel D'Alessandro
                   ` (2 preceding siblings ...)
  2025-10-28 10:48 ` Macpaul Lin (林智斌)
@ 2025-11-01 14:27 ` Chun-Kuang Hu
  2026-02-10  5:06 ` Chen-Yu Tsai
  4 siblings, 0 replies; 7+ messages in thread
From: Chun-Kuang Hu @ 2025-11-01 14:27 UTC (permalink / raw)
  To: Ariel D'Alessandro
  Cc: chunkuang.hu, p.zabel, airlied, simona, matthias.bgg,
	angelogioacchino.delregno, greenjustin, sjoerd, dri-devel,
	linux-mediatek, linux-kernel, linux-arm-kernel, kernel

Ariel D'Alessandro <ariel.dalessandro@collabora.com> 於 2025年10月24日 週五 下午8:28寫道:
>
> Commit c410fa9b07c32 ("drm/mediatek: Add AFBC support to Mediatek DRM
> driver") added AFBC support to Mediatek DRM and enabled the
> 32x8/split/sparse modifier.
>
> However, this is currently broken on Mediatek MT8188 (Genio 700 EVK
> platform); tested using upstream Kernel and Mesa (v25.2.1), AFBC is used by
> default since Mesa v25.0.
>
> Kernel trace reports vblank timeouts constantly, and the render is garbled:
>
> ```
> [CRTC:62:crtc-0] vblank wait timed out
> WARNING: CPU: 7 PID: 70 at drivers/gpu/drm/drm_atomic_helper.c:1835 drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> [...]
> Hardware name: MediaTek Genio-700 EVK (DT)
> Workqueue: events_unbound commit_work
> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> lr : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> sp : ffff80008337bca0
> x29: ffff80008337bcd0 x28: 0000000000000061 x27: 0000000000000000
> x26: 0000000000000001 x25: 0000000000000000 x24: ffff0000c9dcc000
> x23: 0000000000000001 x22: 0000000000000000 x21: ffff0000c66f2f80
> x20: ffff0000c0d7d880 x19: 0000000000000000 x18: 000000000000000a
> x17: 000000040044ffff x16: 005000f2b5503510 x15: 0000000000000000
> x14: 0000000000000000 x13: 74756f2064656d69 x12: 742074696177206b
> x11: 0000000000000058 x10: 0000000000000018 x9 : ffff800082396a70
> x8 : 0000000000057fa8 x7 : 0000000000000cce x6 : ffff8000823eea70
> x5 : ffff0001fef5f408 x4 : ffff80017ccee000 x3 : ffff0000c12cb480
> x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000c12cb480
> Call trace:
>  drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c (P)
>  drm_atomic_helper_commit_tail_rpm+0x64/0x80
>  commit_tail+0xa4/0x1a4
>  commit_work+0x14/0x20
>  process_one_work+0x150/0x290
>  worker_thread+0x2d0/0x3ec
>  kthread+0x12c/0x210
>  ret_from_fork+0x10/0x20
> ---[ end trace 0000000000000000 ]---
> ```
>
> Until this gets fixed upstream, disable AFBC support on this platform, as
> it's currently broken with upstream Mesa.

Applied to mediatek-drm-fixes [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-fixes

Regards,
Chun-Kuang.

>
> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
> ---


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver
  2025-10-24 20:27 [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver Ariel D'Alessandro
                   ` (3 preceding siblings ...)
  2025-11-01 14:27 ` Chun-Kuang Hu
@ 2026-02-10  5:06 ` Chen-Yu Tsai
  4 siblings, 0 replies; 7+ messages in thread
From: Chen-Yu Tsai @ 2026-02-10  5:06 UTC (permalink / raw)
  To: Ariel D'Alessandro
  Cc: chunkuang.hu, p.zabel, airlied, simona, matthias.bgg,
	angelogioacchino.delregno, greenjustin, sjoerd, dri-devel,
	linux-mediatek, linux-kernel, linux-arm-kernel, kernel,
	Macpaul Lin (林智斌), Daniel Stone

Sorry for revisiting this old thread.

On Fri, Oct 24, 2025 at 05:27:56PM -0300, Ariel D'Alessandro wrote:
> Commit c410fa9b07c32 ("drm/mediatek: Add AFBC support to Mediatek DRM
> driver") added AFBC support to Mediatek DRM and enabled the
> 32x8/split/sparse modifier.
> 
> However, this is currently broken on Mediatek MT8188 (Genio 700 EVK
> platform); tested using upstream Kernel and Mesa (v25.2.1), AFBC is used by
> default since Mesa v25.0.
> 
> Kernel trace reports vblank timeouts constantly, and the render is garbled:
> 
> ```
> [CRTC:62:crtc-0] vblank wait timed out
> WARNING: CPU: 7 PID: 70 at drivers/gpu/drm/drm_atomic_helper.c:1835 drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> [...]
> Hardware name: MediaTek Genio-700 EVK (DT)
> Workqueue: events_unbound commit_work
> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> lr : drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c
> sp : ffff80008337bca0
> x29: ffff80008337bcd0 x28: 0000000000000061 x27: 0000000000000000
> x26: 0000000000000001 x25: 0000000000000000 x24: ffff0000c9dcc000
> x23: 0000000000000001 x22: 0000000000000000 x21: ffff0000c66f2f80
> x20: ffff0000c0d7d880 x19: 0000000000000000 x18: 000000000000000a
> x17: 000000040044ffff x16: 005000f2b5503510 x15: 0000000000000000
> x14: 0000000000000000 x13: 74756f2064656d69 x12: 742074696177206b
> x11: 0000000000000058 x10: 0000000000000018 x9 : ffff800082396a70
> x8 : 0000000000057fa8 x7 : 0000000000000cce x6 : ffff8000823eea70
> x5 : ffff0001fef5f408 x4 : ffff80017ccee000 x3 : ffff0000c12cb480
> x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000c12cb480
> Call trace:
>  drm_atomic_helper_wait_for_vblanks.part.0+0x24c/0x27c (P)
>  drm_atomic_helper_commit_tail_rpm+0x64/0x80
>  commit_tail+0xa4/0x1a4
>  commit_work+0x14/0x20
>  process_one_work+0x150/0x290
>  worker_thread+0x2d0/0x3ec
>  kthread+0x12c/0x210
>  ret_from_fork+0x10/0x20
> ---[ end trace 0000000000000000 ]---
> ```
> 
> Until this gets fixed upstream, disable AFBC support on this platform, as
> it's currently broken with upstream Mesa.

Do you remember the circumstances you had an issue with?

Looking at our notes, it seems that for MT8188 only vdosys0 supports
AFBC. And on MT8195 it has issues with color correction on the second
pipeline. The driver as currently seen in next-20260209 only signals
AFBC support for the first pipeline on these two platforms. So I don't
see any issues there.

The commit you mentioned that introduces AFBC support failed to take
into account this flag when exposing AFBC support to userspace. But
this was subsequently fixed by:

    8d121a82fa56 drm/mediatek: only announce AFBC if really supported

On my MT8188 based Chromebook, only the planes for the internal display,
i.e. the first or vdosys0 pipeline, show AFBC support.

AFAICT the Genio 700 EVK only has one external HDMI connector, and that
is tied to the second pipeline, which should not have AFBC support
announced. I'm not sure why mesa would still be using AFBC then.


Thanks
ChenYu


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-02-10  5:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24 20:27 [PATCH] drm/mediatek: Disable AFBC support on Mediatek DRM driver Ariel D'Alessandro
2025-10-27  9:51 ` Daniel Stone
2025-10-28  5:43 ` CK Hu (胡俊光)
2025-10-28 10:48 ` Macpaul Lin (林智斌)
2025-10-29  2:53   ` CK Hu (胡俊光)
2025-11-01 14:27 ` Chun-Kuang Hu
2026-02-10  5:06 ` Chen-Yu Tsai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox