Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1350501lql; Tue, 12 Mar 2024 14:39:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVWoka2jlDxt5zL9ntucYMTw48N06rEORxfQCiE1Ro32chjlT6IF4bZkQ8hl+3imXYQC7Ncrqzl/aJg0+8OwbYGMo3sUllRv6GLZIsrxg== X-Google-Smtp-Source: AGHT+IGo/2AaYwMEF6p+XVGq7ZHzIjKMFaY7+Mp1XZK8UcyCcNep8+EiCUa24dlpENLUTTWzcecs X-Received: by 2002:a05:6214:5097:b0:690:c64e:a221 with SMTP id kk23-20020a056214509700b00690c64ea221mr1147174qvb.31.1710279560578; Tue, 12 Mar 2024 14:39:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710279560; cv=pass; d=google.com; s=arc-20160816; b=r+La5xSv4nAywv+Tzi6j/THAqSKXBoSmlVxj2LQjxuIIzLJUZ8yWCO3lbuMTksfOLE WIkf7Wb5yKw9GvijIwv/jKf+E0B2TA6i9skLrJ1YxanictfQo12WuJ2rcxdYa1G1u5PN 4rMXV638E6tXhrxqoS9JvhwsO2mtPfnmHBP+PAoczETQs24ZePn8Eihdgf6Dh97qmSh9 UpqmznQJsZUcpQPxhD1kVM1WfVaf8yfqkGOAHO/mwFbw1XQUleOxcxoYffMaglAZ9Kdx rVXMPvzlHN98BcU8jSHHcVzgi4I40ZxehvnJOp5Pq2AYzFTtpEtFOZB2KdIG1ViYH7M3 id2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:mail-followup-to:message-id :subject:cc:to:from:date; bh=UYnmNDNhgWKQ0xVw0goBJemBBZ0JdKqT5KdNLilvFuU=; fh=tG0IWGBPXib09wHve5PcdUlFuZrvhniiTLeT+bZAq78=; b=Lr2jbCVrgLHxXr0riCsXdr8zTLxm21wqazggBOvidOZfHPHI6zQHZRQY8B4+B5fjhB KgKZ2jUITFzMwNONdyuXTKbXZT89hW6XTxb1QOMzwV8q11JYgCj6RBnflNjc+iRyJ6ND ytMeDyv0TbE9sviYOnrI3PWE7biiWPdAX3WTuns1htSkEnI4oYw96J1q0B6diN9n+5ky BwNJzncxKnDaWvOn6jB97XLbI6cbVtwgry5S8ccTkHZH9Zbb8hxjYnrn2r8MZZDX5byj z0vPODofn/L48lQWdVnyojtAo7OF2h/TBkPx+9A2oG7D4j3s4+bP6uNgY1YpUIaDEu9L P8OQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=bounce.ens-lyon.org); spf=pass (google.com: domain of linux-kernel+bounces-100813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100813-linux.lists.archive=gmail.com@vger.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 jl11-20020ad45e8b000000b00690b31bec86si8496780qvb.183.2024.03.12.14.39.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 14:39:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100813-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 spfdomain=bounce.ens-lyon.org); spf=pass (google.com: domain of linux-kernel+bounces-100813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100813-linux.lists.archive=gmail.com@vger.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 4DD5E1C215A0 for ; Tue, 12 Mar 2024 21:39:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E7A7143742; Tue, 12 Mar 2024 21:39:14 +0000 (UTC) Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) (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 B11D44CDE0; Tue, 12 Mar 2024 21:39:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.77.166.138 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710279554; cv=none; b=EXwOpLp4knaiArh4dBR7OBXF4to6y403m1kB20skn5o9aVnjuRInqV+BPNvKGEVdcXgXJ/ixRp9FbqC0cpRVOfxXXQIjlHYOvxDvsOro2lf1ciHqN0w/CDdU1l0c0QB7cVCKaozHbHcOPaau3aLShDR9tKMX5Cka9E78x1AVq4c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710279554; c=relaxed/simple; bh=jCOUl/hgH4m5xXQ4Gf/fSkRvMuN269rszqvSe0P/8zE=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=ql2uXgWMDao/ejTiFbI5Zx7CkoeXZvPKgj5C+FohHfxdwEJss6oM4+t1uM73KiB57DIXBsjCjAapLDYR6OILUHMP7GGmIMmsmt8qTe8KQ0jK0XS4xgB1KH6z50Q2LFfD+cfz7dISWO8wDo6rPgWkNAaf5Ygkq8ZeyschnKVfe7Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org; arc=none smtp.client-ip=140.77.166.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 70816A034B; Tue, 12 Mar 2024 22:39:03 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lKQgqEeYEGbq; Tue, 12 Mar 2024 22:39:03 +0100 (CET) Received: from begin.home (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr [83.192.234.57]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 1ECC4A02D1; Tue, 12 Mar 2024 22:39:03 +0100 (CET) Received: from samy by begin.home with local (Exim 4.97) (envelope-from ) id 1rk9pu-000000076so-2s5z; Tue, 12 Mar 2024 22:39:02 +0100 Date: Tue, 12 Mar 2024 22:39:02 +0100 From: Samuel Thibault To: Daniel Vetter , Helge Deller , Alexey Gladkov , Jiry Slaby Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] fbcon: Increase maximum font width x height to 64 x 64 Message-ID: <20240312213902.3zvqaghlopjusv6m@begin> Mail-Followup-To: Samuel Thibault , Daniel Vetter , Helge Deller , Alexey Gladkov , Jiry Slaby , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) This remains relatively simple by just enlarging integers. It wouldn't be that simple to get to the console's 64x128 maximum, as it would require 128b integers. Signed-off-by: Samuel Thibault Index: linux-6.4/drivers/video/fbdev/core/fbcon.c =================================================================== --- linux-6.4.orig/drivers/video/fbdev/core/fbcon.c +++ linux-6.4/drivers/video/fbdev/core/fbcon.c @@ -101,6 +101,9 @@ enum { FBCON_LOGO_DONTSHOW = -3 /* do not show the logo */ }; +#define FBCON_MAX_FONT_WIDTH (sizeof(((struct fb_pixmap *) 0)->blit_x) * 8) +#define FBCON_MAX_FONT_HEIGHT (sizeof(((struct fb_pixmap *) 0)->blit_y) * 8) + static struct fbcon_display fb_display[MAX_NR_CONSOLES]; struct fb_info *fbcon_registered_fb[FB_MAX]; @@ -2485,12 +2488,12 @@ static int fbcon_set_font(struct vc_data h > FBCON_SWAP(info->var.rotate, info->var.yres, info->var.xres)) return -EINVAL; - if (font->width > 32 || font->height > 32) + if (font->width > FBCON_MAX_FONT_WIDTH || font->height > FBCON_MAX_FONT_HEIGHT) return -EINVAL; /* Make sure drawing engine can handle the font */ - if (!(info->pixmap.blit_x & BIT(font->width - 1)) || - !(info->pixmap.blit_y & BIT(font->height - 1))) + if (!(info->pixmap.blit_x & BIT_ULL(font->width - 1)) || + !(info->pixmap.blit_y & BIT_ULL(font->height - 1))) return -EINVAL; /* Make sure driver can handle the font length */ @@ -3084,8 +3087,8 @@ void fbcon_get_requirement(struct fb_inf vc = vc_cons[i].d; if (vc && vc->vc_mode == KD_TEXT && info->node == con2fb_map[i]) { - caps->x |= 1 << (vc->vc_font.width - 1); - caps->y |= 1 << (vc->vc_font.height - 1); + caps->x |= 1ULL << (vc->vc_font.width - 1); + caps->y |= 1ULL << (vc->vc_font.height - 1); charcnt = vc->vc_font.charcount; if (caps->len < charcnt) caps->len = charcnt; @@ -3096,8 +3099,8 @@ void fbcon_get_requirement(struct fb_inf if (vc && vc->vc_mode == KD_TEXT && info->node == con2fb_map[fg_console]) { - caps->x = 1 << (vc->vc_font.width - 1); - caps->y = 1 << (vc->vc_font.height - 1); + caps->x = 1ULL << (vc->vc_font.width - 1); + caps->y = 1ULL << (vc->vc_font.height - 1); caps->len = vc->vc_font.charcount; } } Index: linux-6.4/include/linux/fb.h =================================================================== --- linux-6.4.orig/include/linux/fb.h +++ linux-6.4/include/linux/fb.h @@ -143,8 +143,8 @@ struct fb_event { }; struct fb_blit_caps { - u32 x; - u32 y; + u64 x; + u64 y; u32 len; u32 flags; }; @@ -191,10 +191,10 @@ struct fb_pixmap { u32 scan_align; /* alignment per scanline */ u32 access_align; /* alignment per read/write (bits) */ u32 flags; /* see FB_PIXMAP_* */ - u32 blit_x; /* supported bit block dimensions (1-32)*/ - u32 blit_y; /* Format: blit_x = 1 << (width - 1) */ + u64 blit_x; /* supported bit block dimensions (1-64)*/ + u64 blit_y; /* Format: blit_x = 1 << (width - 1) */ /* blit_y = 1 << (height - 1) */ - /* if 0, will be set to 0xffffffff (all)*/ + /* if 0, will be set to ~0ull (all) */ /* access methods */ void (*writeio)(struct fb_info *info, void __iomem *dst, void *src, unsigned int size); void (*readio) (struct fb_info *info, void *dst, void __iomem *src, unsigned int size);