Message ID | cover.1708011391.git.legion@kernel.org |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-67211-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp483803dyb; Thu, 15 Feb 2024 07:39:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUudEVis4TpNzu3vfN7nvNiAXzNj6n8oI/Me5liuHJ/3tN+klmyIK3csviJ6x46GJGUFjwAOiaCfjGayiTG4JmGXkGazg== X-Google-Smtp-Source: AGHT+IFXiHcO01wWJPFGNb5IXwd7MHrXAT6KHso9b+eZ6fSWTD3pd7mGozjiF6kMwH/WsNvmNiCo X-Received: by 2002:a05:622a:289:b0:42d:c742:3630 with SMTP id z9-20020a05622a028900b0042dc7423630mr2030539qtw.11.1708011578942; Thu, 15 Feb 2024 07:39:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708011578; cv=pass; d=google.com; s=arc-20160816; b=NQu3ZQ3KvysNcRoNwIIhYRbP0wvR0O4nU9dm0wIlnCUqkLeFww6KrjX/LI7xSuIt1V qnVWodPTzitGkKk8wSfb8O76/GnBx7D0YsaRJvzUbbekiBwXKZyHksoh0IjxOyydNw0t XHDMxw8oPKEiE14aoa4lux2UcSEVCOWB0VPVsOawa1wO+34uIFh0puJvrnRay8WV27+B /wPvKLt9OKxvHLJVXmLKZiVwDbov5ZLMiGJl7u4/owAv14RzuQXPb5YINTrAY4iJRKqi JQJbACMa3/SBNnpr4eNSmvftifUBQa79DyVk0+jGT8weGEq59nN7k3ImyW5B27ApcvTO /Zyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from; bh=3Nmi9Km9+zciNA4nmzDrQsaoFeO2ocqD38cGNsLsoe4=; fh=5lLQrGdKCUTEsMQkEJ//E4ZZVMrkT7zt/nAQQco0YdQ=; b=vZZH9t5K7FpUJxjLaXBy/SG/wEyZ1LlPh2CS7q556SaHe3D2PJJo/H7/gRDMtkzPhD jk6rULS5VVUiehSj0QMdWIB+UWpS3DTYFzyPuDp8JUUG4y1uEHsgieuBmDNZU5XBw1aQ msdTMsv3yHLZgyQ2UabPK0+C8BZsatHtChZbFkIyPc4dtfzbECPSTgjUYKcH2kbWS3Ie rOe/RIyMOvpakUufAac6a/9yN1K/HDix2Fa0kVUPRJVv9FfItnSog4lrYkvi04snVyFt rkISgtGHxZXwMwQTFGVqYgRz/Q5zu0B9r6/iV1JTjpDd1OJ4gysDN7H2m0ZD4HcBWmR+ 0RFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-67211-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67211-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t15-20020ac8588f000000b0042c7f5297fasi1718199qta.215.2024.02.15.07.39.38 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:39:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67211-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-67211-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67211-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B499D1C2155C for <ouuuleilei@gmail.com>; Thu, 15 Feb 2024 15:39:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2B68134CEA; Thu, 15 Feb 2024 15:37:55 +0000 (UTC) Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) (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 E345D1339B5 for <linux-kernel@vger.kernel.org>; Thu, 15 Feb 2024 15:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.139.111.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708011474; cv=none; b=YN97+rzzRtrlcaofmOvu6nQVyPpSyOnM8N9A6g93aBo9qmOo4kEIRQzVjCsbcx4a9NtzJOqoNULUUB3BtlG37SaDQry3BXozsGQeHY6mB/EWklckQ7qFv+zdzU8hbC8M9/s2quFD5gEmyzcxNRI+dNrN/qwqOUMQuguyzHARZa0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708011474; c=relaxed/simple; bh=O6k3+Kt9EY9aVhxjMtSqDSmcS8ddewY4b29TogNStAw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Vty7/+ib5PUw/cZpl+vNtgPIzcvrlTbgGKKQ/gzep6SHzDNDMFzCtIntunDbziRIK8JfXAxeWmOdUWe1IsjGkmxziK7fKhHgYzWmHfzBBjB8tSE4QDLsLsN9N5aVNg8pnh1nCZc2pSs7K+ndnYJ80bENfuLeojj7s7XGYXBGjqc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=fail smtp.mailfrom=kernel.org; arc=none smtp.client-ip=205.139.111.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-262-qSfwzd3LNeivXFSIUlv9Ag-1; Thu, 15 Feb 2024 10:37:42 -0500 X-MC-Unique: qSfwzd3LNeivXFSIUlv9Ag-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4E22983101A; Thu, 15 Feb 2024 15:37:42 +0000 (UTC) Received: from gentoo.redhat.com (unknown [10.45.226.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id A56AB112132A; Thu, 15 Feb 2024 15:37:41 +0000 (UTC) From: Alexey Gladkov <legion@kernel.org> To: LKML <linux-kernel@vger.kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org> Subject: [RFC PATCH v1 0/5] VT: Add ability to get font requirements Date: Thu, 15 Feb 2024 15:37:19 +0000 Message-ID: <cover.1708011391.git.legion@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790979949709621688 X-GMAIL-MSGID: 1790979949709621688 |
Series |
VT: Add ability to get font requirements
|
|
Message
Alexey Gladkov
Feb. 15, 2024, 3:37 p.m. UTC
We now have KD_FONT_OP_SET_TALL, but in fact such large fonts cannot be loaded. No console driver supports tall fonts. Unfortunately, userspace cannot distinguish the lack of support in the driver from errors in the font itself. In all cases, EINVAL will be returned. How about adding another operator to get the supported font size so that userspace can handle this situation correctly? I mean something like this proof-of-concept. --- Alexey Gladkov (5): VT: Add KD_FONT_OP_GET_INFO operation newport_con: Allow to get max font width and height sticon: Allow to get max font width and height vgacon: Allow to get max font width and height fbcon: Allow to get max font width and height drivers/tty/vt/vt.c | 27 +++++++++++++++++++++++++++ drivers/tty/vt/vt_ioctl.c | 2 +- drivers/video/console/newport_con.c | 21 +++++++++++++++++---- drivers/video/console/sticon.c | 21 +++++++++++++++++++-- drivers/video/console/vgacon.c | 17 ++++++++++++++++- drivers/video/fbdev/core/fbcon.c | 18 +++++++++++++++++- include/linux/console.h | 1 + include/uapi/linux/kd.h | 1 + 8 files changed, 99 insertions(+), 9 deletions(-)
Comments
On 15. 02. 24, 16:37, Alexey Gladkov wrote: > We now have KD_FONT_OP_SET_TALL, but in fact such large fonts cannot be > loaded. No console driver supports tall fonts. I thought fbcon can, no? If not, we should likely remove all the KD_FONT_OP_SET_TALL checks here and there. > Unfortunately, userspace > cannot distinguish the lack of support in the driver from errors in the > font itself. In all cases, EINVAL will be returned. Yeah, AFAIR userspace just tries many possibilities and sees what trial worked. > How about adding another operator to get the supported font size so that > userspace can handle this situation correctly? The whole font interface is horrid (and we got rid of v1 interface only recently). Like (ab)using height = vpitch in KD_FONT_OP_SET_TALL :(. So perhaps, as a band-aid, this might be fine (note you give no opportunity to find out supported vpitch for example). Eventually, we need to invent a v3 interface with some better font_op struct with reserved fields for future use and so on. > I mean something like this proof-of-concept. > > --- > > Alexey Gladkov (5): > VT: Add KD_FONT_OP_GET_INFO operation > newport_con: Allow to get max font width and height > sticon: Allow to get max font width and height > vgacon: Allow to get max font width and height > fbcon: Allow to get max font width and height > > drivers/tty/vt/vt.c | 27 +++++++++++++++++++++++++++ > drivers/tty/vt/vt_ioctl.c | 2 +- > drivers/video/console/newport_con.c | 21 +++++++++++++++++---- > drivers/video/console/sticon.c | 21 +++++++++++++++++++-- > drivers/video/console/vgacon.c | 17 ++++++++++++++++- > drivers/video/fbdev/core/fbcon.c | 18 +++++++++++++++++- > include/linux/console.h | 1 + > include/uapi/linux/kd.h | 1 + > 8 files changed, 99 insertions(+), 9 deletions(-) >
On Fri, Feb 16, 2024 at 08:21:38AM +0100, Jiri Slaby wrote: > On 15. 02. 24, 16:37, Alexey Gladkov wrote: > > We now have KD_FONT_OP_SET_TALL, but in fact such large fonts cannot be > > loaded. No console driver supports tall fonts. > > I thought fbcon can, no? If not, we should likely remove all the > KD_FONT_OP_SET_TALL checks here and there. I thought so too until kbd users started trying to use such fonts. A month after adding KD_FONT_OP_SET_TALL, support for large fonts was turned off in fbcon: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=2b09d5d364986f724f17001ccfe4126b9b43a0be But I don't think we need to remove KD_FONT_OP_SET_TALL completely. Maybe support for large fonts can be fixed. I suggested GET_INFO to solve the problem in general. Even if there is no SET_TALL, the problem still remains. For example newport only supports 8x16 fonts. > > Unfortunately, userspace > > cannot distinguish the lack of support in the driver from errors in the > > font itself. In all cases, EINVAL will be returned. > > Yeah, AFAIR userspace just tries many possibilities and sees what trial > worked. Yep. In case of big font, I don’t know how to improve the error message in setfont. The EINVAL is very confusing for users. > > How about adding another operator to get the supported font size so that > > userspace can handle this situation correctly? > > The whole font interface is horrid (and we got rid of v1 interface only > recently). Like (ab)using height = vpitch in KD_FONT_OP_SET_TALL :(. Yep. > So perhaps, as a band-aid, this might be fine (note you give no > opportunity to find out supported vpitch for example). The vpitch can be 32 or if the height is greater, then vpitch = fnt_height > Eventually, we need to invent a v3 interface with some better font_op > struct with reserved fields for future use and so on. Yes, yes, yes! Can we discuss this, pleeeeese? :) > > > I mean something like this proof-of-concept. > > > > --- > > > > Alexey Gladkov (5): > > VT: Add KD_FONT_OP_GET_INFO operation > > newport_con: Allow to get max font width and height > > sticon: Allow to get max font width and height > > vgacon: Allow to get max font width and height > > fbcon: Allow to get max font width and height > > > > drivers/tty/vt/vt.c | 27 +++++++++++++++++++++++++++ > > drivers/tty/vt/vt_ioctl.c | 2 +- > > drivers/video/console/newport_con.c | 21 +++++++++++++++++---- > > drivers/video/console/sticon.c | 21 +++++++++++++++++++-- > > drivers/video/console/vgacon.c | 17 ++++++++++++++++- > > drivers/video/fbdev/core/fbcon.c | 18 +++++++++++++++++- > > include/linux/console.h | 1 + > > include/uapi/linux/kd.h | 1 + > > 8 files changed, 99 insertions(+), 9 deletions(-) > > > > -- > js > suse labs >
Alexey Gladkov, le ven. 16 févr. 2024 14:26:38 +0100, a ecrit: > On Fri, Feb 16, 2024 at 08:21:38AM +0100, Jiri Slaby wrote: > > On 15. 02. 24, 16:37, Alexey Gladkov wrote: > > > We now have KD_FONT_OP_SET_TALL, but in fact such large fonts cannot be > > > loaded. No console driver supports tall fonts. > > > > I thought fbcon can, no? If not, we should likely remove all the > > KD_FONT_OP_SET_TALL checks here and there. > > I thought so too until kbd users started trying to use such fonts. A month > after adding KD_FONT_OP_SET_TALL, support for large fonts was turned off > in fbcon: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=2b09d5d364986f724f17001ccfe4126b9b43a0be > > But I don't think we need to remove KD_FONT_OP_SET_TALL completely. Maybe > support for large fonts can be fixed. Some users *need* it to be fixed, because they need large fonts to be able to read their screen. Samuel
On Fri, Feb 16, 2024 at 02:45:22PM +0100, Samuel Thibault wrote: > Alexey Gladkov, le ven. 16 févr. 2024 14:26:38 +0100, a ecrit: > > On Fri, Feb 16, 2024 at 08:21:38AM +0100, Jiri Slaby wrote: > > > On 15. 02. 24, 16:37, Alexey Gladkov wrote: > > > > We now have KD_FONT_OP_SET_TALL, but in fact such large fonts cannot be > > > > loaded. No console driver supports tall fonts. > > > > > > I thought fbcon can, no? If not, we should likely remove all the > > > KD_FONT_OP_SET_TALL checks here and there. > > > > I thought so too until kbd users started trying to use such fonts. A month > > after adding KD_FONT_OP_SET_TALL, support for large fonts was turned off > > in fbcon: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=2b09d5d364986f724f17001ccfe4126b9b43a0be > > > > But I don't think we need to remove KD_FONT_OP_SET_TALL completely. Maybe > > support for large fonts can be fixed. > > Some users *need* it to be fixed, because they need large fonts to be > able to read their screen. I totally understand that. That's why I don't think it's necessary to remove or block SET_TALL. And that's also why I added you to the thread.
Cc Thomas (fbdev/fbcon fadeaway -- search SUSE below) On 16. 02. 24, 14:26, Alexey Gladkov wrote: > On Fri, Feb 16, 2024 at 08:21:38AM +0100, Jiri Slaby wrote: >> On 15. 02. 24, 16:37, Alexey Gladkov wrote: >>> We now have KD_FONT_OP_SET_TALL, but in fact such large fonts cannot be >>> loaded. No console driver supports tall fonts. >> >> I thought fbcon can, no? If not, we should likely remove all the >> KD_FONT_OP_SET_TALL checks here and there. > > I thought so too until kbd users started trying to use such fonts. A month > after adding KD_FONT_OP_SET_TALL, support for large fonts was turned off > in fbcon: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=2b09d5d364986f724f17001ccfe4126b9b43a0be Hmmm -- it has been a year! > But I don't think we need to remove KD_FONT_OP_SET_TALL completely. Maybe > support for large fonts can be fixed. Either someone needs it so (not necessarily the same) someone fixes it, or we remove it. Note that this whole fbdev is deprecated in favor of (simple)drm. I wonder if we want to invest any time to fix this mess at all? Or we simply drop the defunct parts now. I believe SUSE and Fedora (and others very likely too) are currently in the process of moving away from fbdev completely at last. I don't know the current state, though. Thomas? >> Eventually, we need to invent a v3 interface with some better font_op >> struct with reserved fields for future use and so on. > > Yes, yes, yes! Can we discuss this, pleeeeese? :) You need not discuss at first, propose something ;). thanks,