Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp536215rdb; Thu, 15 Feb 2024 07:39:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV2eIieH9ofSpd1bkYn//xyv5H7HrR26InHOFoIwzxWuMi8Mo/Ry0rzwxpgITTm4WmxxsZ4Arct/LbsInCEIZ4wB8Kw72pQ0+AVlkAvWw== X-Google-Smtp-Source: AGHT+IHMcCN2cgKwoZNJlpO+2P4ALIjQNWMJDY3kvdmEANYHsZLzgm9pln4dKr/B6shavATNqnDh X-Received: by 2002:a05:6870:9722:b0:21e:4f99:d3c9 with SMTP id n34-20020a056870972200b0021e4f99d3c9mr850542oaq.50.1708011583848; Thu, 15 Feb 2024 07:39:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708011583; cv=pass; d=google.com; s=arc-20160816; b=csYn6wlFD6ClhoF96wUau7EQh4njX0+27EwywrM0NqvUupApAlDnmXsP5usOvQwdzJ TUAJn7kMqUdQPWcfhlKKCWkW7CudbUuH+tD/DO5Ji8Gma2ICyIaoe13veIqW/fbhfAZQ 5x2pPS/h4eyXysw/F8JhdndsBbkB8Gzbokqz2zEZN9IDWArb7o+f0Hw1ty59+4OYfWDi ED81KxgIi6vBpDfLAXs6dLaZfudUphABfxA02QRy6pdqeOACmkgEscGqS9aqoagW8evq nnvPC8VcQXhDCykjXoiLqpZ/RUpUzOVHg45uLBuEWglWqPMOmdJpnomz0noYQyY2rCtg TXVg== 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:references:in-reply-to:message-id :date:subject:to:from; bh=e1lUFoippBbtsRZQuH1HHjQrK33BQ7Ur+Ilp9M8UfcM=; fh=5lLQrGdKCUTEsMQkEJ//E4ZZVMrkT7zt/nAQQco0YdQ=; b=OQANfUTkIoDyShaVmFgLVxzAWoobcQnNFHxCMEzIXpz+uy7+upe6TtNUsVWQ/wowkt PTLiWrEPrfTjzNnYXPpke9lU25TSy45qWQm4qTlXYlbNKimjum747b7Li5vrAtFVcxm4 UfSAECAdJzjRgwFzh4avZAPujhx4P+RR3axbQTpGbZB52xc4VW1Uw6ptoeVifKmYoGDN 9QbSoQ+/TfDoHj8uui4aEEmx6eVZ8mFuIOr8SbUtrPN410QajFUxLO3PLmHNANc9VAzk ocM3+/HvJyojJz4IE8wwmqR6I80ijSeQDcKalk0liqy8r/Aop9HYylHxMd8sDLmXI+et rHYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-67213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67213-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x3-20020ab05ac3000000b007d6a3e43f58si264022uae.10.2024.02.15.07.39.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:39:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-67213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67213-linux.lists.archive=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 8A1931C2122A for ; Thu, 15 Feb 2024 15:39:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13328135408; Thu, 15 Feb 2024 15:37:56 +0000 (UTC) Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [207.211.30.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 18EDD133417 for ; Thu, 15 Feb 2024 15:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=207.211.30.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708011475; cv=none; b=QB238gR7XWcMp5Dh8gXGmMJI6pSLPs92jwz+vQd6LOHc+PL4fvcfEympTbR2jELujCgK1NNZJMEP1EO3Ck8LUf5Ybqdd/tTK1WiOYv2guW9QXKEr7vTh/SEvBHpFZ/uh25iHQPZGCfbqzoTwUZ4zGwZFNHInrxQOGAU1s3Ct5mA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708011475; c=relaxed/simple; bh=PzRCrAYZ3bmmaS2SVBTn1kR7ocsfUIv45eipG7Xx1Iw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MBCYIM1zJf395pYF5l0KAWs4RVi3N/+HmyUz9fHp6yZgRcm9bFK6LSXnlKzum5a2AfmQupTAlyGmxK7rI/TQQkRxgcYcQh/FK5yLVw4IXiHQFL3hYJDhlg5ya8hYOesgWRAYyjQGCzdQqXoiWX7VBrCqvPGV1oXaHTb/4XDDzxQ= 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=207.211.30.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-649-MvIx3WUINFKvlgf5QeaYgQ-1; Thu, 15 Feb 2024 10:37:45 -0500 X-MC-Unique: MvIx3WUINFKvlgf5QeaYgQ-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 A5320185A782; Thu, 15 Feb 2024 15:37:45 +0000 (UTC) Received: from gentoo.redhat.com (unknown [10.45.226.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0FDDC112132A; Thu, 15 Feb 2024 15:37:44 +0000 (UTC) From: Alexey Gladkov To: LKML , Greg Kroah-Hartman , Jiri Slaby Subject: [RFC PATCH v1 4/5] vgacon: Allow to get max font width and height Date: Thu, 15 Feb 2024 15:37:23 +0000 Message-ID: In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Signed-off-by: Alexey Gladkov --- drivers/video/console/vgacon.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 8ef1579fa57f..a499a469df4d 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -61,6 +61,10 @@ static struct vgastate vgastate; #define BLANK 0x0020 #define VGA_FONTWIDTH 8 /* VGA does not support fontwidths != 8 */ + +#define VGACON_MAX_FONT_WIDTH VGA_FONTWIDTH +#define VGACON_MAX_FONT_HEIGHT 32 + /* * Interface used by the world */ @@ -1013,6 +1017,15 @@ static int vgacon_adjust_height(struct vc_data *vc, unsigned fontheight) return 0; } +static int vgacon_font_info(struct vc_data *vc, struct console_font *font) +{ + font->width = VGACON_MAX_FONT_WIDTH; + font->height = VGACON_MAX_FONT_HEIGHT; + font->charcount = 512; + + return 0; +} + static int vgacon_font_set(struct vc_data *c, struct console_font *font, unsigned int vpitch, unsigned int flags) { @@ -1022,7 +1035,8 @@ static int vgacon_font_set(struct vc_data *c, struct console_font *font, if (vga_video_type < VIDEO_TYPE_EGAM) return -EINVAL; - if (font->width != VGA_FONTWIDTH || font->height > 32 || vpitch != 32 || + if (font->width != VGACON_MAX_FONT_WIDTH || + font->height > VGACON_MAX_FONT_HEIGHT || vpitch != 32 || (charcount != 256 && charcount != 512)) return -EINVAL; @@ -1177,6 +1191,7 @@ const struct consw vga_con = { .con_scroll = vgacon_scroll, .con_switch = vgacon_switch, .con_blank = vgacon_blank, + .con_font_info = vgacon_font_info, .con_font_set = vgacon_font_set, .con_font_get = vgacon_font_get, .con_resize = vgacon_resize, -- 2.43.0