Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1374691rbb; Mon, 26 Feb 2024 07:24:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWYC6CuuIx8sNV/Pq8CjtdqE9lEftWjICxZS1SF6pjnPvAG+Io7rWkLqEHypH3MjktPgWHbnS8ljogVGTSvBrA2teqoaIDsfZMrN2CQqQ== X-Google-Smtp-Source: AGHT+IFxaT9HDY/gSB7eLyzsHxPd6E4FQ8GF3GB6s4PT1W8sllFjNq1PF6ORcdDS32rjKBfMbab3 X-Received: by 2002:a17:90a:6c61:b0:29a:7efc:471b with SMTP id x88-20020a17090a6c6100b0029a7efc471bmr4708497pjj.38.1708961047060; Mon, 26 Feb 2024 07:24:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708961047; cv=pass; d=google.com; s=arc-20160816; b=PnF5wdJ6GYZH9mGnIs2BznCS3w+mG7guZ8ayRnoiVhkW4vdnVwlD71KtPu/QZIwTx0 +IDfSKg+mIt+Htv/o3AphVqrq/n5MWUbudtMzcPLcEverYQ4+3XcRbwe8mW7qfS4TjGt 62xf8nUBSgTQcNwHy0nAcnBn5taH1pQvnOK8gMp4Q2XcieHPioSzyy9if0POHHXTZOC7 YwyrreOZeH62TqpXhcAsRzB33leygXh5Aze3WwWuOH3VR+9EAt7cGpbpUESXCf6rfO3b ZLFM0wp2l5yJenGWkwtLLOPuMwd73L1OuwHCjjL7yzvdv4YGf+CPOISOlV1dZWX6iHBj rXcA== 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:cc:to:from; bh=qkZimT8F9qMfcjAdDg/WxPmmgsjbAbsxf7mad7uYWxs=; fh=+sjJkTnuceKV/39ogbp2WrGgLtnGuaoEzUs1VQcMbqE=; b=zpxlzDeKLCGVqYpQFh6fDrXKYJdTFNPPwWbAolKfb54aKT81JxpbQQMEOp17qwCVcS v5L5kdGcWVWyZ2ew0msEG731X/ficwDUObVMaV78a07oQzCvWqhMEY9BS4vOM7Bajah9 ViMC2Mr0Frh3xTCUCkC96eHituUqadkW8sYBQpkOkDcysbtNeIO4Xy/92x2/l7UJzf7R /ve+f8JmhTwitgZ//DUAyCsBsTgouCbqcn54WfInXiVr6ADUdy4J9y1LRRi/dX0PAM7G RMeKvfyN+mwr6WQnCwdndoYfP6nsKgW+BJhPq2MePfaYS56GEB3WXFCZbq91rAYNewsl EpUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-81787-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81787-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id mi2-20020a17090b4b4200b0029ac57fe315si1737967pjb.90.2024.02.26.07.24.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 07:24:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81787-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-81787-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81787-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C225E2A3E09 for ; Mon, 26 Feb 2024 15:24:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3568605D5; Mon, 26 Feb 2024 15:22:36 +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 8A28012A176 for ; Mon, 26 Feb 2024 15:22:34 +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=1708960956; cv=none; b=rfLBBUaSHTXGMa0kKV/Gw7YAVmBDg/5ecNbyy3haXrfIkYeXTbw83qcELgjdskQuYefTMsp2vOstgXZ7lGtSMHCTdK5EjCJlo0iwEH426zrJiFJsHP0ovUB1K5AtXmbCG5RnISNf/0Xo/8b7rxl1Eq7nYWp0SFn+eHAUqr1m1C4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708960956; c=relaxed/simple; bh=yxolVSJbX/m3dNfKsgTDQ8S6trHvUXOwfNqXfcacNxk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DEczITiYzUGwFtrwZcK636NCHuYkbXR2FGimRrwF69bHAyy4q35Ned2O23CLSRXwlts2vTSjJXVV7u33zVhRwwMhTYFktIoIpoQoqk615narCQZQlLSkQsqPv9Yq01XnGGVW9bzVsgwVqtRjfR35OOu5WEkt49HG05uZ9YjdeFo= 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-21-0P7e64eiMSCuA8or5N7p9w-1; Mon, 26 Feb 2024 10:21:24 -0500 X-MC-Unique: 0P7e64eiMSCuA8or5N7p9w-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 C827C85A59A; Mon, 26 Feb 2024 15:21:23 +0000 (UTC) Received: from gentoo.redhat.com (unknown [10.45.224.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 170BE492BD7; Mon, 26 Feb 2024 15:21:22 +0000 (UTC) From: Alexey Gladkov To: LKML , Greg Kroah-Hartman , Jiri Slaby Cc: linux-api@vger.kernel.org Subject: [RFC PATCH v2 2/5] newport_con: Allow to get max font width and height Date: Mon, 26 Feb 2024 16:21:11 +0100 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.10 Signed-off-by: Alexey Gladkov --- drivers/video/console/newport_con.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c index e8e4f82cd4a1..87f174a95fa8 100644 --- a/drivers/video/console/newport_con.c +++ b/drivers/video/console/newport_con.c @@ -33,6 +33,9 @@ #define NEWPORT_LEN 0x10000 +#define NEWPORT_MAX_FONT_WIDTH 8 +#define NEWPORT_MAX_FONT_HEIGHT 16 + #define FONT_DATA ((unsigned char *)font_vga_8x16.data) static unsigned char *font_data[MAX_NR_CONSOLES]; @@ -328,8 +331,8 @@ static void newport_init(struct vc_data *vc, int init) { int cols, rows; - cols = newport_xsize / 8; - rows = newport_ysize / 16; + cols = newport_xsize / NEWPORT_MAX_FONT_WIDTH; + rows = newport_ysize / NEWPORT_MAX_FONT_HEIGHT; vc->vc_can_do_color = 1; if (init) { vc->vc_cols = cols; @@ -507,8 +510,8 @@ static int newport_set_font(int unit, struct console_font *op, unsigned int vpit /* ladis: when I grow up, there will be a day... and more sizes will * be supported ;-) */ - if ((w != 8) || (h != 16) || (vpitch != 32) - || (op->charcount != 256 && op->charcount != 512)) + if ((w != NEWPORT_MAX_FONT_WIDTH) || (h != NEWPORT_MAX_FONT_HEIGHT) || + (vpitch != 32) || (op->charcount != 256 && op->charcount != 512)) return -EINVAL; if (!(new_data = kmalloc(FONT_EXTRA_WORDS * sizeof(int) + size, @@ -569,6 +572,15 @@ static int newport_font_default(struct vc_data *vc, struct console_font *op, cha return newport_set_def_font(vc->vc_num, op); } +static int newport_font_info(struct vc_data *vc, struct console_font_info *info) +{ + info->min_width = info->max_width = NEWPORT_MAX_FONT_WIDTH; + info->min_height = info->max_height = NEWPORT_MAX_FONT_HEIGHT; + info->flags = KD_FONT_INFO_FLAG_LOW_SIZE | KD_FONT_INFO_FLAG_HIGH_SIZE; + + return 0; +} + static int newport_font_set(struct vc_data *vc, struct console_font *font, unsigned int vpitch, unsigned int flags) { @@ -688,6 +700,7 @@ const struct consw newport_con = { .con_scroll = newport_scroll, .con_switch = newport_switch, .con_blank = newport_blank, + .con_font_info = newport_font_info, .con_font_set = newport_font_set, .con_font_default = newport_font_default, .con_save_screen = newport_save_screen -- 2.44.0