* Re: [PATCH] drm/loongson: Fix framebuffer selection in async cursor updates
2026-10-03 9:00 [PATCH] drm/loongson: Fix framebuffer selection in async cursor updates Evanshenf
@ 2026-10-09 8:33 ` Icenowy Zheng
2026-10-10 1:35 ` wuqianhai
2026-10-11 14:05 ` Huacai Chen
2026-10-31 4:26 ` Icenowy Zheng
2 siblings, 1 reply; 5+ messages in thread
From: Icenowy Zheng @ 2026-10-09 8:33 UTC (permalink / raw)
To: Evanshenf, dri-devel
Cc: Jianmin Lv, Qianhai Wu, Huacai Chen, Mingcong Bai, Xi Ruoyao,
Sui Jingfeng, kernel test robot, stable, linux-kernel,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann
(Cc'ing drm-misc maintainers)
在 2026-10-03六的 09:00 +0000,Evanshenf写道:
> An asynchronous cursor update swaps the new framebuffer into the live
> plane state. However, the driver reads both old_fb and new_fb from
> the
> live state before this swap. When an enabled cursor changes buffers,
> the
> address-update condition is therefore false and the hardware
> continues
> scanning the previous buffer.
>
> Read new_fb from the new plane state before swapping the framebuffer
> references. This updates the hardware address when the framebuffer
> changes while retaining the existing behavior for cursor movement.
>
> Verified on a Loongson 3A5000 with LS7A2000 using 32x32 and 64x64
> legacy
> cursor updates. Callback counters and read-only register observations
> confirmed the asynchronous path, the stale address before the change,
> and the new address afterward. Same-framebuffer movement and cursor
> disable/re-enable also passed, with the primary framebuffer and mode
> unchanged.
>
> AI assistance was used to investigate the existing report, prepare
> the
> fix and test tools, run the build and hardware comparison, and draft
> this message.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes:
> https://lore.kernel.org/r/202311152357.4KFS0M8f-lkp@intel.com/
> Fixes: f39db26c5428 ("drm: Add kms driver for loongson display
> controller")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Evanshenf <archwse@gmail.com>
> ---
> drivers/gpu/drm/loongson/lsdc_plane.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c
> b/drivers/gpu/drm/loongson/lsdc_plane.c
> index bcc0ffa..7b9c65c 100644
> --- a/drivers/gpu/drm/loongson/lsdc_plane.c
> +++ b/drivers/gpu/drm/loongson/lsdc_plane.c
> @@ -230,7 +230,7 @@ static void
> lsdc_cursor_plane_atomic_async_update(struct drm_plane *plane,
>
> new_state = drm_atomic_get_new_plane_state(state, plane);
>
> - new_fb = plane->state->fb;
> + new_fb = new_state->fb;
This change looks okay, although I don't know whether the
atomic_async_update() hook should be implemented at all now.
```
Reviewed-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
```
However, please wait for further clarification of the function itself
from drm-misc maintainers.
Thanks,
Icenowy
>
> plane->state->crtc_x = new_state->crtc_x;
> plane->state->crtc_y = new_state->crtc_y;
>
> base-commit: bca45af5998a05f34b13a2ef11e639bac9c62643
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drm/loongson: Fix framebuffer selection in async cursor updates
2026-10-09 8:33 ` Icenowy Zheng
@ 2026-10-10 1:35 ` wuqianhai
0 siblings, 0 replies; 5+ messages in thread
From: wuqianhai @ 2026-10-10 1:35 UTC (permalink / raw)
To: Icenowy Zheng, Evanshenf, dri-devel
Cc: Jianmin Lv, Huacai Chen, Mingcong Bai, Xi Ruoyao,
kernel test robot, stable, linux-kernel, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann
Reviewed-by: Qianhai Wu <wuqianhai@loongson.cn>
The fix is correct.
Thanks,
Qianhai Wu
在 2026/10/9 16:33, Icenowy Zheng 写道:
> (Cc'ing drm-misc maintainers)
>
> 在 2026-10-03六的 09:00 +0000,Evanshenf写道:
>> An asynchronous cursor update swaps the new framebuffer into the live
>> plane state. However, the driver reads both old_fb and new_fb from
>> the
>> live state before this swap. When an enabled cursor changes buffers,
>> the
>> address-update condition is therefore false and the hardware
>> continues
>> scanning the previous buffer.
>>
>> Read new_fb from the new plane state before swapping the framebuffer
>> references. This updates the hardware address when the framebuffer
>> changes while retaining the existing behavior for cursor movement.
>>
>> Verified on a Loongson 3A5000 with LS7A2000 using 32x32 and 64x64
>> legacy
>> cursor updates. Callback counters and read-only register observations
>> confirmed the asynchronous path, the stale address before the change,
>> and the new address afterward. Same-framebuffer movement and cursor
>> disable/re-enable also passed, with the primary framebuffer and mode
>> unchanged.
>>
>> AI assistance was used to investigate the existing report, prepare
>> the
>> fix and test tools, run the build and hardware comparison, and draft
>> this message.
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Closes:
>> https://lore.kernel.org/r/202311152357.4KFS0M8f-lkp@intel.com/
>> Fixes: f39db26c5428 ("drm: Add kms driver for loongson display
>> controller")
>> Cc: stable@vger.kernel.org
>> Assisted-by: LLM
>> Signed-off-by: Evanshenf <archwse@gmail.com>
>> ---
>> drivers/gpu/drm/loongson/lsdc_plane.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c
>> b/drivers/gpu/drm/loongson/lsdc_plane.c
>> index bcc0ffa..7b9c65c 100644
>> --- a/drivers/gpu/drm/loongson/lsdc_plane.c
>> +++ b/drivers/gpu/drm/loongson/lsdc_plane.c
>> @@ -230,7 +230,7 @@ static void
>> lsdc_cursor_plane_atomic_async_update(struct drm_plane *plane,
>>
>> new_state = drm_atomic_get_new_plane_state(state, plane);
>>
>> - new_fb = plane->state->fb;
>> + new_fb = new_state->fb;
>
> This change looks okay, although I don't know whether the
> atomic_async_update() hook should be implemented at all now.
>
> ```
> Reviewed-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> ```
>
> However, please wait for further clarification of the function itself
> from drm-misc maintainers.
>
> Thanks,
> Icenowy
>
>>
>> plane->state->crtc_x = new_state->crtc_x;
>> plane->state->crtc_y = new_state->crtc_y;
>>
>> base-commit: bca45af5998a05f34b13a2ef11e639bac9c62643
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/loongson: Fix framebuffer selection in async cursor updates
2026-10-03 9:00 [PATCH] drm/loongson: Fix framebuffer selection in async cursor updates Evanshenf
2026-10-09 8:33 ` Icenowy Zheng
@ 2026-10-11 14:05 ` Huacai Chen
2026-10-31 4:26 ` Icenowy Zheng
2 siblings, 0 replies; 5+ messages in thread
From: Huacai Chen @ 2026-10-11 14:05 UTC (permalink / raw)
To: Evanshenf
Cc: dri-devel, Jianmin Lv, Qianhai Wu, Mingcong Bai, Xi Ruoyao,
Icenowy Zheng, Sui Jingfeng, kernel test robot, stable,
linux-kernel
On Sat, Oct 3, 2026 at 5:00 PM Evanshenf <archwse@gmail.com> wrote:
>
> An asynchronous cursor update swaps the new framebuffer into the live
> plane state. However, the driver reads both old_fb and new_fb from the
> live state before this swap. When an enabled cursor changes buffers, the
> address-update condition is therefore false and the hardware continues
> scanning the previous buffer.
>
> Read new_fb from the new plane state before swapping the framebuffer
> references. This updates the hardware address when the framebuffer
> changes while retaining the existing behavior for cursor movement.
>
> Verified on a Loongson 3A5000 with LS7A2000 using 32x32 and 64x64 legacy
> cursor updates. Callback counters and read-only register observations
> confirmed the asynchronous path, the stale address before the change,
> and the new address afterward. Same-framebuffer movement and cursor
> disable/re-enable also passed, with the primary framebuffer and mode
> unchanged.
>
> AI assistance was used to investigate the existing report, prepare the
> fix and test tools, run the build and hardware comparison, and draft
> this message.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/r/202311152357.4KFS0M8f-lkp@intel.com/
> Fixes: f39db26c5428 ("drm: Add kms driver for loongson display controller")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
> Signed-off-by: Evanshenf <archwse@gmail.com>
> ---
> drivers/gpu/drm/loongson/lsdc_plane.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c b/drivers/gpu/drm/loongson/lsdc_plane.c
> index bcc0ffa..7b9c65c 100644
> --- a/drivers/gpu/drm/loongson/lsdc_plane.c
> +++ b/drivers/gpu/drm/loongson/lsdc_plane.c
> @@ -230,7 +230,7 @@ static void lsdc_cursor_plane_atomic_async_update(struct drm_plane *plane,
>
> new_state = drm_atomic_get_new_plane_state(state, plane);
>
> - new_fb = plane->state->fb;
> + new_fb = new_state->fb;
>
> plane->state->crtc_x = new_state->crtc_x;
> plane->state->crtc_y = new_state->crtc_y;
>
> base-commit: bca45af5998a05f34b13a2ef11e639bac9c62643
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drm/loongson: Fix framebuffer selection in async cursor updates
2026-10-03 9:00 [PATCH] drm/loongson: Fix framebuffer selection in async cursor updates Evanshenf
2026-10-09 8:33 ` Icenowy Zheng
2026-10-11 14:05 ` Huacai Chen
@ 2026-10-31 4:26 ` Icenowy Zheng
2 siblings, 0 replies; 5+ messages in thread
From: Icenowy Zheng @ 2026-10-31 4:26 UTC (permalink / raw)
To: Evanshenf, dri-devel
Cc: Jianmin Lv, Qianhai Wu, Huacai Chen, Mingcong Bai, Xi Ruoyao,
Sui Jingfeng, kernel test robot, stable, linux-kernel
在 2026-10-03六的 09:00 +0000,Evanshenf写道:
> An asynchronous cursor update swaps the new framebuffer into the live
> plane state. However, the driver reads both old_fb and new_fb from
> the
> live state before this swap. When an enabled cursor changes buffers,
> the
> address-update condition is therefore false and the hardware
> continues
> scanning the previous buffer.
>
> Read new_fb from the new plane state before swapping the framebuffer
> references. This updates the hardware address when the framebuffer
> changes while retaining the existing behavior for cursor movement.
>
> Verified on a Loongson 3A5000 with LS7A2000 using 32x32 and 64x64
> legacy
> cursor updates. Callback counters and read-only register observations
> confirmed the asynchronous path, the stale address before the change,
> and the new address afterward. Same-framebuffer movement and cursor
> disable/re-enable also passed, with the primary framebuffer and mode
> unchanged.
>
> AI assistance was used to investigate the existing report, prepare
> the
> fix and test tools, run the build and hardware comparison, and draft
> this message.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes:
> https://lore.kernel.org/r/202311152357.4KFS0M8f-lkp@intel.com/
> Fixes: f39db26c5428 ("drm: Add kms driver for loongson display
> controller")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Evanshenf <archwse@gmail.com>
>
Applied to drm-misc-fixes, Thanks for your contribution!
Icenowy
> ---
> drivers/gpu/drm/loongson/lsdc_plane.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c
> b/drivers/gpu/drm/loongson/lsdc_plane.c
> index bcc0ffa..7b9c65c 100644
> --- a/drivers/gpu/drm/loongson/lsdc_plane.c
> +++ b/drivers/gpu/drm/loongson/lsdc_plane.c
> @@ -230,7 +230,7 @@ static void
> lsdc_cursor_plane_atomic_async_update(struct drm_plane *plane,
>
> new_state = drm_atomic_get_new_plane_state(state, plane);
>
> - new_fb = plane->state->fb;
> + new_fb = new_state->fb;
>
> plane->state->crtc_x = new_state->crtc_x;
> plane->state->crtc_y = new_state->crtc_y;
>
> base-commit: bca45af5998a05f34b13a2ef11e639bac9c62643
^ permalink raw reply [flat|nested] 5+ messages in thread