From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=159.226.251.81 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793420801; b=INbYL0RC+EAWE6ojMuZunEX5V4Yl1k6iNTpzKcWwngUl1D9iemrOZ8GcEH38AFCaDVRU FuZbSyjoHy2kb97DxPDabKg1JEB58LvoqVxWA3J5G+kEmMWsDpOBWT5H2NdXtikiRaMOP IIACzENmMd9gNGj8IV8kwTB8DnUS50oeAj9DnPEoe/oo/Vukt+zqZRJuWvO5tu4eP/LTk vbn7T3UZbaFr5qOO0Vjkq6a67Cli+FUMG6mRBzPM1VFLXZgzT5iVZ5MjcLguCRe43m24h UTrqBZFVi0H/9tq4oxBBqjbVt2bPyiGLhn73hL/CUXQq8jPMba4nZ6TPR6SE3t8Z5nA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793420801; h=DMARC-Filter:Received:Message-ID:Subject:From:To:Cc:Date:In-Reply-To: References:Content-Type:Content-Transfer-Encoding:User-Agent: MIME-Version:X-CM-TRANSID:X-Coremail-Antispam:X-Originating-IP: X-CM-SenderInfo; bh=V21TV/zhZYZBx4vw4bMRfE5IzXMZMg0TRnefxN4ViKk=; b=bU3RUFeIg23/mmKCHjXS3zKRMOnv52UoLVfio43YUaeOf4CbNt2O0nAs9FH8rRnEn0oG ebtO0UV73qWluLtLYO2ACbgHshXoIyYjEDFmDfjXxyIew2w0xZ6Lg1WgXg0v4D8Sf/Vry TesJWV4f6AKNH7j0Os24tmg4O5Etj6ahg+jP1qoDpG2wr8NrmWmVZFUSmS5WgxRk5/7t8 ypuKstfzeNB8kVpi9NrbqVs3NrqbsUVRD3w6TfpMPBgh9qapfBSSLJa4q+MuyhbD1LUDU m2XhR1WXCfEdRZVgKZAyPJ3imeQhHEgBltoY6SJnRnLanAdhpVEylOpmCeJR1NYa/IA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=iscas.ac.cn; spf=pass smtp.mailfrom=iscas.ac.cn; arc=none smtp.remote-ip=159.226.251.81 Received: from cstnet.cn (smtp81.cstnet.cn [159.226.251.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B68F606A31C; Sat, 31 Oct 2026 04:26:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7B68F606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from edelgard.fodlan.icenowy.me (unknown [112.94.102.150]) by APP-03 (Coremail) with SMTP id rQCowABHGpvybeVqSLsJAA--.7893S2; Sat, 31 Oct 2026 12:26:27 +0800 (CST) Message-ID: <20933d0650fcead77cb14dc1d07e0b05f0ce2448.camel@iscas.ac.cn> Subject: Re: [PATCH] drm/loongson: Fix framebuffer selection in async cursor updates From: Icenowy Zheng To: Evanshenf , dri-devel@lists.freedesktop.org Cc: Jianmin Lv , Qianhai Wu , Huacai Chen , Mingcong Bai , Xi Ruoyao , Sui Jingfeng , kernel test robot , stable@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 31 Oct 2026 12:26:25 +0800 In-Reply-To: <20261003090006.4e29fdce9913-1-archwse@gmail.com> References: <20261003090006.4e29fdce9913-1-archwse@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-CM-TRANSID:rQCowABHGpvybeVqSLsJAA--.7893S2 X-Coremail-Antispam: 1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v3d6l2u1dvotugofq/ =E5=9C=A8 2026-10-03=E5=85=AD=E7=9A=84 09:00 +0000=EF=BC=8CEvanshenf=E5=86= =99=E9=81=93=EF=BC=9A > 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. >=20 > 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. >=20 > 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. >=20 > 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. >=20 > Reported-by: kernel test robot > 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 >=20 Applied to drm-misc-fixes, Thanks for your contribution! Icenowy > --- > =C2=A0drivers/gpu/drm/loongson/lsdc_plane.c | 2 +- > =C2=A01 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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, > =C2=A0 > =C2=A0 new_state =3D drm_atomic_get_new_plane_state(state, plane); > =C2=A0 > - new_fb =3D plane->state->fb; > + new_fb =3D new_state->fb; > =C2=A0 > =C2=A0 plane->state->crtc_x =3D new_state->crtc_x; > =C2=A0 plane->state->crtc_y =3D new_state->crtc_y; >=20 > base-commit: bca45af5998a05f34b13a2ef11e639bac9c62643