From nobody Mon Jun 8 07:26:16 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE63E38837C; Mon, 1 Jun 2026 07:54:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780300478; cv=none; b=M6q4DIsIkon6GFq8G3Q8rzq7j89a4YDciALpB3mFgJvyeRen22eX5iE7692JMS81BR5x0v/FM8COfjHm8EjqDDHs+Ao8sYffvngUMfoWQgRMGUF2xrGHv5CwAvH7lXGevAsdgE7fjhHaS5AHmbCyj1oqeVUGFN2mkQmxhstKU0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780300478; c=relaxed/simple; bh=UA6lVnaUVFnSloqLbYBnYV5Y1adVW3NBuBmUfd7DNq8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QG3Rh6w2MeM6GkGiTPAIWTVnUIUQ8pD1GWkeW9uL6NqrujeVDERMo3xj+PCuqTGt3wTzPaawAfsb5e/VYru/VuvwFMzgDOpqhGwZPIeOOCyBgQMQU2sdY669pkt2gWkb0A/mpAIZPzq8hQt4cWHYWQhxZa3IPNYNfP2cJiT8kJc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 1d3be2805d8f11f1aa26b74ffac11d73-20260601 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:fedfcc34-84aa-469c-a9e9-4b4170d56118,IP:0,U RL:0,TC:0,Content:0,EDM:25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:25 X-CID-META: VersionHash:e7bac3a,CLOUDID:c9f868013bde326e382fa55a7c858271,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|123|850|865|898,TC:nil,Content :0|15|50,EDM:5,IP:nil,URL:99|1,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL :0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULS X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 1d3be2805d8f11f1aa26b74ffac11d73-20260601 X-User: yaolu@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1752011668; Mon, 01 Jun 2026 15:54:27 +0800 From: yaolu@kylinos.cn To: deller@gmx.de Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, simona@ffwll.ch, tzimmermann@suse.de, yaolu@kylinos.cn Subject: [PATCH v2] fbcon: do suspend/resume only when vc is text mode and visible Date: Mon, 1 Jun 2026 15:54:23 +0800 Message-Id: <20260601075423.543611-1-yaolu@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <67a1f756-996c-404b-8eff-f705ff151ed3@gmx.de> References: <67a1f756-996c-404b-8eff-f705ff151ed3@gmx.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lu Yao Don't need to do suspend/resume for fbcon in graphic mode. Doing this may cause error, eg: At the beginning, starting the Xorg with single screen and then an external screen was plugged in. After logging out in Xorg, fbdev info may using screen which is connected later on for info always using first connected connector in list in func 'drm_setup_crtcs_fb'. Then, S3 executed, fbcon found that the information did not match and do atomic to switch fb. However, Xorg will not re-bind the crtc fb but continues doing ioctl. At this time, the fb is incorrect. Signed-off-by: Lu Yao --- v1->v2: change to '=3D=3DKD_TEXT' rather than '!=3DKD_GRAPHICS' and add visible judgement suggested by Helge. Link: https://lore.kernel.org/all/67a1f756-996c-404b-8eff-f705ff151ed3@gm= x.de drivers/video/fbdev/core/fbcon.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fb= con.c index b0e3e765360d..ab460ba9264c 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2602,8 +2602,9 @@ void fbcon_suspended(struct fb_info *info) return; vc =3D vc_cons[par->currcon].d; =20 - /* Clear cursor, restore saved data */ - fbcon_cursor(vc, false); + /* Only in TEXT mode and visible, need to clear cursor, restore saved dat= a */ + if ((vc->vc_mode =3D=3D KD_TEXT) && con_is_visible(vc)) + fbcon_cursor(vc, false); } =20 void fbcon_resumed(struct fb_info *info) @@ -2615,7 +2616,9 @@ void fbcon_resumed(struct fb_info *info) return; vc =3D vc_cons[par->currcon].d; =20 - update_screen(vc); + /* Graphics mode is managed by userspace */ + if ((vc->vc_mode =3D=3D KD_TEXT) && con_is_visible(vc)) + update_screen(vc); } =20 static void fbcon_modechanged(struct fb_info *info) --=20 2.25.1