From f25bf57cc275409f70a405b6e5258ff308e8c06f Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 2 Jun 2025 17:34:25 +0200 Subject: [PATCH] xfree86: compat: re-export MarkClientException() for horryibly maintained Nvidia NVidia yet again doing crazy shit in their proprietary drivers: This is an DIX-*internal* function for triggering client teardown when connection broke or somehow lack of resources to accept new connections. Video drivers have no business with that whatsoever - having them messing with client client connections is just insane. But still trying to be kind with Nvidia victims, thus adding a little wrapper function under the old name. It spills out a log warning calling users to file bug reports their driver vendor. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/compat/clientexception.c | 24 ++++++++++++++++++++++++ hw/xfree86/compat/meson.build | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 hw/xfree86/compat/clientexception.c diff --git a/hw/xfree86/compat/clientexception.c b/hw/xfree86/compat/clientexception.c new file mode 100644 index 000000000..6005f22c4 --- /dev/null +++ b/hw/xfree86/compat/clientexception.c @@ -0,0 +1,24 @@ +#include + +#include + +#include "dix/dix_priv.h" + +/* + * this is specifically for NVidia proprietary driver: they're again lagging + * behind a year, doing at least some minimal cleanup of their code base. + * All attempts to get in direct contact with them have failed. + */ +_X_EXPORT void MarkClientException(ClientPtr pClient); + +void MarkClientException(ClientPtr pClient) +{ + LogMessageVerb(X_WARNING, 0, "Bogus driver calling DIX-internal function MarkClientException() !\n"); + LogMessageVerb(X_WARNING, 0, "External drivers really should never ever call this function.\n"); + LogMessageVerb(X_WARNING, 0, "Nor should they ever DIX-internal fields like ClientRec->noClientException\n"); + LogMessageVerb(X_WARNING, 0, "File a bug report to driver vendor or use a FOSS driver.\n"); + LogMessageVerb(X_WARNING, 0, "Proprietary drivers are inherently unstable, they just can't be done right.\n"); + LogMessageVerb(X_WARNING, 0, "And just don't buy Nvidia hardware, ever.\n"); + + dixMarkClientException(pClient); +} diff --git a/hw/xfree86/compat/meson.build b/hw/xfree86/compat/meson.build index dcdbf1c21..fab631ca2 100644 --- a/hw/xfree86/compat/meson.build +++ b/hw/xfree86/compat/meson.build @@ -1,8 +1,10 @@ srcs_xorg_compat = [ + 'clientexception.c', 'log.c', ] xorg_compat = static_library('xorg_compat', srcs_xorg_compat, + dependencies: common_dep, include_directories: [inc, xorg_inc, top_dir_inc], )