From bc10b612b998acbf26d3c74760dd0ca2a10cbc05 Mon Sep 17 00:00:00 2001 From: Adam Greloch Date: Wed, 2 Oct 2024 13:17:24 +0200 Subject: [PATCH] tinyx: disable fbcon while server is running Use the TTYSETMODE ioctl to stop the fbcon from drawing to the same framebuffer xserver is using JIRA: RTOS-906, RTOS-925 --- .../tinyx/eed490/15-set-tty-mode.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tinyx/patches/tinyx/eed490/15-set-tty-mode.patch diff --git a/tinyx/patches/tinyx/eed490/15-set-tty-mode.patch b/tinyx/patches/tinyx/eed490/15-set-tty-mode.patch new file mode 100644 index 0000000..cb896bb --- /dev/null +++ b/tinyx/patches/tinyx/eed490/15-set-tty-mode.patch @@ -0,0 +1,39 @@ +diff -ruN a/kdrive/phoenix/phoenix.c b/kdrive/phoenix/phoenix.c +--- a/kdrive/phoenix/phoenix.c 2024-10-01 15:21:58.698012684 +0200 ++++ b/kdrive/phoenix/phoenix.c 2024-10-02 13:10:42.440162376 +0200 +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -24,6 +25,10 @@ + if (ioctl(fd, TIOCNOTTY, NULL) < 0) { + FatalError("PhoenixInit: TIOCNOTTY failed\n"); + } ++ ++ if (ioctl(fd, FBCONSETMODE, FBCON_DISABLED) < 0) { ++ FatalError("PhoenixInit: FBCONSETMODE failed\n"); ++ } + close(fd); + + return 1; +@@ -47,6 +52,16 @@ + + static void PhoenixFini(void) + { ++ int fd; ++ if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) { ++ FatalError("PhoenixInit: Cannot open /dev/tty0 (%s)\n", ++ strerror(errno)); ++ } ++ ++ if (ioctl(fd, FBCONSETMODE, FBCON_ENABLED) < 0) { ++ FatalError("PhoenixInit: FBCONSETMODE failed\n"); ++ } ++ close(fd); + } + + static const KdOsFuncs PhoenixFuncs = {