From: Simon Glass <simon.glass@canonical.com> Add a new struct vidconsole_ctx to hold per-client state for video consoles. Add some driver-specific structs as well, so that each driver can build on the common context fields. This is preparation for supporting multiple clients with their own context. Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- drivers/video/console_normal.c | 9 +++++++++ drivers/video/console_truetype.c | 9 +++++++++ include/video_console.h | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c index 8f936191dd8..cfe6196fced 100644 --- a/drivers/video/console_normal.c +++ b/drivers/video/console_normal.c @@ -14,6 +14,15 @@ #include <video_font.h> /* Get font data, width and height */ #include "vidconsole_internal.h" +/** + * struct console_ctx - context for the normal console + * + * @com: Common fields from the vidconsole uclass + */ +struct console_ctx { + struct vidconsole_ctx com; +}; + struct console_store { int xpos_frac; int ypos; diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index cbc4473207c..c2d165a8b8e 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -203,6 +203,15 @@ struct console_tt_metrics { double scale; }; +/** + * struct console_tt_ctx - Per-client context for this driver + * + * @com: Common fields from the vidconsole uclass + */ +struct console_tt_ctx { + struct vidconsole_ctx com; +}; + /** * struct console_tt_priv - Private data for this driver * diff --git a/include/video_console.h b/include/video_console.h index ac04aeb3aef..0acc7ab2737 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -73,6 +73,15 @@ struct vidconsole_cursor { uint index; }; +/** + * struct vidconsole_ctx - per-client context for a video console + * + * This holds per-client state for video consoles. It can be used by clients + * to maintain separate contexts for different text-entry operations. + */ +struct vidconsole_ctx { +}; + /** * struct vidconsole_priv - uclass-private data about a console device * -- 2.43.0