From: Alan Mackenzie <acm@muc.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
Simona Vetter <simona@ffwll.ch>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Helge Deller <deller@gmx.de>,
Thomas Zimmermann <tzimmermann@suse.de>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: acm@muc.de
Subject: [Patch 9/9]: vt: Misc changes, e.g. to #include directives
Date: Thu, 27 Aug 2026 18:58:48 +0000 [thread overview]
Message-ID: <apCI6JhoH5D7ss34@MAC.fritz.box> (raw)
In-Reply-To: <apCEDM2sWv_M354-@MAC.fritz.box>
vt: 32b glyph: 9. Misc changes, e.g. to #include directives
Rearrange some #include directives, add some clarifying
comments, and some code changes which didn't fit elsewhere.
Signed-off-by: Alan Mackenzie <acm@muc.de>
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index dfdea0842149..35da5e127a49 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -25,7 +25,6 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <linux/consolemap.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/jiffies.h>
@@ -46,6 +45,7 @@
#include <linux/tty.h>
#include <linux/uaccess.h>
#include <linux/vt_kern.h>
+#include <linux/consolemap.h>
#include <asm/irq_regs.h>
diff --git a/drivers/tty/vt/selection.c b/drivers/tty/vt/selection.c
index 13f4e48b4142..18affdb3c7c5 100644
--- a/drivers/tty/vt/selection.c
+++ b/drivers/tty/vt/selection.c
@@ -48,6 +48,8 @@ static struct vc_selection {
.start = -1,
};
+static unsigned int size_row;
+
/* clear_selection, highlight and highlight_pointer can be called
from interrupt (via scrollback/front) */
@@ -340,6 +342,7 @@ static int vc_selection(struct vc_data *vc, struct tiocl_selection *v,
{
int ps, pe;
+ size_row = vc->vc_size_row;
poke_blanked_console();
if (v->sel_mode == TIOCL_SELCLEAR) {
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index 7d40eacc21b3..f23d61fe10c1 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -201,6 +201,8 @@ static struct vc_data *vcs_vc(struct inode *inode, bool *viewed)
/**
* vcs_size - return size for a VC in @vc
+ * The size is the number of bytes required by a buffer reading to/writing from
+ * the entire device.
* @vc: which VC
* @attr: does it use attributes?
* @unicode: is it unicode?
@@ -307,7 +314,9 @@ static unsigned int vcs_read_buf(const struct vc_data *vc, char *con_buf,
getconsxy(vc, con_buf + 2);
*skip += pos;
- count += pos;
+ count += pos; /* COUNT is now the byte offset of the end
+ * position from the start of the header.
+ */
if (count > CON_BUF_SIZE) {
count = CON_BUF_SIZE;
filled = count - pos;
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 8f467b22b799..0c389a564357 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -89,6 +89,7 @@
#include <linux/init.h>
#include <linux/mutex.h>
#include <linux/vt_kern.h>
+#include <linux/vt_buffer.h>
#include <linux/selection.h>
#include <linux/tiocl.h>
#include <linux/kbd_kern.h>
@@ -4910,15 +4967,17 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op)
static int con_font_get(struct vc_data *vc, struct console_font_op *op)
{
struct console_font font;
int c;
- unsigned int vpitch = op->op == KD_FONT_OP_GET_TALL ? op->height : 32;
+ unsigned int vpitch =
+ op->op == KD_FONT_OP_GET_TALL ? vc->vc_font.height : 32;
if (vpitch > max_font_height)
return -EINVAL;
void *font_data __free(kvfree) = NULL;
+ c = DIV_ROUND_UP(vc->vc_font.width, 8) * vpitch * vc->vc_font.charcount;
if (op->data) {
- font.data = font_data = kvzalloc(max_font_size, GFP_KERNEL);
+ font.data = font_data = kvzalloc(c, GFP_KERNEL);
if (!font.data)
return -ENOMEM;
} else
@@ -4935,8 +4994,6 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op)
return ret;
}
- c = DIV_ROUND_UP(font.width, 8) * vpitch * font.charcount;
-
if (op->data && font.charcount > op->charcount)
return -ENOSPC;
if (font.width > op->width || font.height > op->height)
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index fe915afdece5..5afce52057ca 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -13,6 +13,7 @@
#ifndef _LINUX_CONSOLE_STRUCT_H
#define _LINUX_CONSOLE_STRUCT_H
+#include <linux/consolemap.h>
#include <linux/vt.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2026-08-27 18:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 18:38 vt: Enlarge the framebuffer glyph size from 16 to 32 bits Alan Mackenzie
2026-08-27 18:42 ` [Patch 1/9]: Make consolemap.c handle Unicode planes outside BMP Alan Mackenzie
2026-08-28 4:57 ` Jiri Slaby
2026-08-27 18:45 ` [Patch 2/9]: Glyph size: Use GLYPH_SZ/HW rather than hardcoded 2, 1 Alan Mackenzie
2026-08-27 18:47 ` [Patch 3/9]: Replace scr_readw/writew by scr_readg/writeg, etc Alan Mackenzie
2026-08-27 18:48 ` [Patch 4/9]: Amend internal manipulation of glyph structure Alan Mackenzie
2026-08-27 18:50 ` [Patch 5/9]: vt: Amend three Kconfig files Alan Mackenzie
2026-08-27 18:52 ` [Patch 6/9]: vt: Use u32 and typedef u1632 to handle whole glyphs Alan Mackenzie
2026-08-27 18:54 ` [Patch 7/9]: vt: Handle up to 2^21 glyphs, rather than 256/512 Alan Mackenzie
2026-08-27 18:56 ` [Patch 8/9]: vt: Enhancements to the VT ioctl interface Alan Mackenzie
2026-08-27 18:58 ` Alan Mackenzie [this message]
2026-08-28 6:12 ` vt: Enlarge the framebuffer glyph size from 16 to 32 bits Thomas Zimmermann
2026-08-28 14:36 ` Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=apCI6JhoH5D7ss34@MAC.fritz.box \
--to=acm@muc.de \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®