Merge branch 'X11Libre:master' into master
This commit is contained in:
commit
30a51f4e81
|
@ -1280,7 +1280,7 @@ ProcVidModeGetMonitor(ClientPtr client)
|
||||||
+ nHsync + nVrefresh + nVendorItems + nModelItems
|
+ nHsync + nVrefresh + nVendorItems + nModelItems
|
||||||
};
|
};
|
||||||
|
|
||||||
const int buflen = nHsync * nVrefresh + nVendorItems + nModelItems;
|
const int buflen = nHsync + nVrefresh + nVendorItems + nModelItems;
|
||||||
|
|
||||||
CARD32 *sendbuf = calloc(buflen, sizeof(CARD32));
|
CARD32 *sendbuf = calloc(buflen, sizeof(CARD32));
|
||||||
if (!sendbuf)
|
if (!sendbuf)
|
||||||
|
@ -1302,22 +1302,22 @@ ProcVidModeGetMonitor(ClientPtr client)
|
||||||
bufwalk++;
|
bufwalk++;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(sendbuf,
|
memcpy(bufwalk,
|
||||||
pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0).ptr,
|
pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0).ptr,
|
||||||
vendorLength);
|
vendorLength);
|
||||||
sendbuf += nVendorItems;
|
bufwalk += nVendorItems;
|
||||||
|
|
||||||
memcpy(sendbuf,
|
memcpy(bufwalk,
|
||||||
pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0).ptr,
|
pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0).ptr,
|
||||||
modelLength);
|
modelLength);
|
||||||
sendbuf += nModelItems;
|
bufwalk += nModelItems;
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), &rep);
|
WriteToClient(client, sizeof(xXF86VidModeGetMonitorReply), &rep);
|
||||||
WriteToClient(client, buflen * sizeof(CARD32), sendbuf);
|
WriteToClient(client, buflen * sizeof(CARD32), sendbuf);
|
||||||
|
|
||||||
free(sendbuf);
|
free(sendbuf);
|
||||||
|
|
|
@ -647,7 +647,6 @@ ProcXF86BigfontDispatch(ClientPtr client)
|
||||||
static int _X_COLD
|
static int _X_COLD
|
||||||
SProcXF86BigfontQueryVersion(ClientPtr client)
|
SProcXF86BigfontQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86BigfontQueryVersionReq);
|
|
||||||
return ProcXF86BigfontQueryVersion(client);
|
return ProcXF86BigfontQueryVersion(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1435,12 +1435,11 @@ MouseFini(KdPointerInfo * pi)
|
||||||
}
|
}
|
||||||
|
|
||||||
KdPointerDriver EphyrMouseDriver = {
|
KdPointerDriver EphyrMouseDriver = {
|
||||||
"ephyr",
|
.name = "ephyr",
|
||||||
MouseInit,
|
.Init = MouseInit,
|
||||||
MouseEnable,
|
.Enable = MouseEnable,
|
||||||
MouseDisable,
|
.Disable = MouseDisable,
|
||||||
MouseFini,
|
.Fini = MouseFini,
|
||||||
NULL,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Keyboard */
|
/* Keyboard */
|
||||||
|
@ -1509,12 +1508,11 @@ EphyrKeyboardBell(KdKeyboardInfo * ki, int volume, int frequency, int duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
KdKeyboardDriver EphyrKeyboardDriver = {
|
KdKeyboardDriver EphyrKeyboardDriver = {
|
||||||
"ephyr",
|
.name = "ephyr",
|
||||||
EphyrKeyboardInit,
|
.Init = EphyrKeyboardInit,
|
||||||
EphyrKeyboardEnable,
|
.Enable = EphyrKeyboardEnable,
|
||||||
EphyrKeyboardLeds,
|
.Leds = EphyrKeyboardLeds,
|
||||||
EphyrKeyboardBell,
|
.Bell = EphyrKeyboardBell,
|
||||||
EphyrKeyboardDisable,
|
.Disable = EphyrKeyboardDisable,
|
||||||
EphyrKeyboardFini,
|
.Fini = EphyrKeyboardFini,
|
||||||
NULL,
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -370,6 +370,23 @@ ddxProcessArgument(int argc, char **argv, int i)
|
||||||
return KdProcessArgument(argc, argv, i);
|
return KdProcessArgument(argc, argv, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
EphyrInit(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* make sure at least one screen
|
||||||
|
* has been added to the system.
|
||||||
|
*/
|
||||||
|
if (!KdCardInfoLast()) {
|
||||||
|
processScreenArg("640x480", NULL);
|
||||||
|
}
|
||||||
|
return hostx_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
KdOsFuncs EphyrOsFuncs = {
|
||||||
|
.Init = EphyrInit,
|
||||||
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
OsVendorInit(void)
|
OsVendorInit(void)
|
||||||
{
|
{
|
||||||
|
@ -381,32 +398,23 @@ OsVendorInit(void)
|
||||||
if (hostx_want_host_cursor())
|
if (hostx_want_host_cursor())
|
||||||
ephyrFuncs.initCursor = &ephyrCursorInit;
|
ephyrFuncs.initCursor = &ephyrCursorInit;
|
||||||
|
|
||||||
if (serverGeneration == 1) {
|
KdOsInit(&EphyrOsFuncs);
|
||||||
if (!KdCardInfoLast()) {
|
|
||||||
processScreenArg("640x480", NULL);
|
|
||||||
}
|
|
||||||
hostx_init();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
KdCardFuncs ephyrFuncs = {
|
KdCardFuncs ephyrFuncs = {
|
||||||
ephyrCardInit, /* cardinit */
|
.cardinit = ephyrCardInit,
|
||||||
ephyrScreenInitialize, /* scrinit */
|
.scrinit = ephyrScreenInitialize,
|
||||||
ephyrInitScreen, /* initScreen */
|
.initScreen = ephyrInitScreen,
|
||||||
ephyrFinishInitScreen, /* finishInitScreen */
|
.finishInitScreen = ephyrFinishInitScreen,
|
||||||
ephyrCreateResources, /* createRes */
|
.createRes = ephyrCreateResources,
|
||||||
ephyrScreenFini, /* scrfini */
|
|
||||||
ephyrCardFini, /* cardfini */
|
|
||||||
|
|
||||||
0, /* initCursor */
|
.scrfini = ephyrScreenFini,
|
||||||
|
.cardfini = ephyrCardFini,
|
||||||
|
|
||||||
0, /* initAccel */
|
/* no cursor or accel funcs here */
|
||||||
0, /* enableAccel */
|
|
||||||
0, /* disableAccel */
|
|
||||||
0, /* finiAccel */
|
|
||||||
|
|
||||||
ephyrGetColors, /* getColors */
|
.getColors = ephyrGetColors,
|
||||||
ephyrPutColors, /* putColors */
|
.putColors = ephyrPutColors,
|
||||||
|
|
||||||
ephyrCloseScreen, /* closeScreen */
|
.closeScreen = ephyrCloseScreen,
|
||||||
};
|
};
|
||||||
|
|
|
@ -91,6 +91,14 @@ const char *kdGlobalXkbLayout = NULL;
|
||||||
const char *kdGlobalXkbVariant = NULL;
|
const char *kdGlobalXkbVariant = NULL;
|
||||||
const char *kdGlobalXkbOptions = NULL;
|
const char *kdGlobalXkbOptions = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Carry arguments from InitOutput through driver initialization
|
||||||
|
* to KdScreenInit
|
||||||
|
*/
|
||||||
|
|
||||||
|
KdOsFuncs *kdOsFuncs = NULL;
|
||||||
|
|
||||||
void
|
void
|
||||||
KdDisableScreen(ScreenPtr pScreen)
|
KdDisableScreen(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
|
@ -517,6 +525,19 @@ KdProcessArgument(int argc, char **argv, int i)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
KdOsInit(KdOsFuncs * pOsFuncs)
|
||||||
|
{
|
||||||
|
kdOsFuncs = pOsFuncs;
|
||||||
|
if (pOsFuncs) {
|
||||||
|
if (serverGeneration == 1) {
|
||||||
|
KdDoSwitchCmd("start");
|
||||||
|
if (pOsFuncs->Init)
|
||||||
|
(*pOsFuncs->Init) ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
KdAllocatePrivates(ScreenPtr pScreen)
|
KdAllocatePrivates(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
|
|
|
@ -278,6 +278,16 @@ int KdAddConfigKeyboard(char *pointer);
|
||||||
int KdAddKeyboard(KdKeyboardInfo * ki);
|
int KdAddKeyboard(KdKeyboardInfo * ki);
|
||||||
void KdRemoveKeyboard(KdKeyboardInfo * ki);
|
void KdRemoveKeyboard(KdKeyboardInfo * ki);
|
||||||
|
|
||||||
|
typedef struct _KdOsFuncs {
|
||||||
|
int (*Init) (void); /* Only called when the X server is started, when serverGeneration == 1 */
|
||||||
|
void (*Enable) (void);
|
||||||
|
Bool (*SpecialKey) (KeySym);
|
||||||
|
void (*Disable) (void);
|
||||||
|
void (*Fini) (void);
|
||||||
|
void (*pollEvents) (void);
|
||||||
|
void (*Bell) (int, int, int);
|
||||||
|
} KdOsFuncs;
|
||||||
|
|
||||||
typedef struct _KdPointerMatrix {
|
typedef struct _KdPointerMatrix {
|
||||||
int matrix[2][3];
|
int matrix[2][3];
|
||||||
} KdPointerMatrix;
|
} KdPointerMatrix;
|
||||||
|
@ -289,6 +299,8 @@ extern DevPrivateKeyRec kdScreenPrivateKeyRec;
|
||||||
extern Bool kdEmulateMiddleButton;
|
extern Bool kdEmulateMiddleButton;
|
||||||
extern Bool kdDisableZaphod;
|
extern Bool kdDisableZaphod;
|
||||||
|
|
||||||
|
extern KdOsFuncs *kdOsFuncs;
|
||||||
|
|
||||||
#define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \
|
#define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \
|
||||||
dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey))
|
dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey))
|
||||||
#define KdSetScreenPriv(pScreen,v) \
|
#define KdSetScreenPriv(pScreen,v) \
|
||||||
|
@ -345,6 +357,9 @@ void
|
||||||
int
|
int
|
||||||
KdProcessArgument(int argc, char **argv, int i);
|
KdProcessArgument(int argc, char **argv, int i);
|
||||||
|
|
||||||
|
void
|
||||||
|
KdOsInit(KdOsFuncs * pOsFuncs);
|
||||||
|
|
||||||
void
|
void
|
||||||
KdOsAddInputDrivers(void);
|
KdOsAddInputDrivers(void);
|
||||||
|
|
||||||
|
|
|
@ -1 +1,5 @@
|
||||||
special compat code for legacy drivers, namely Nvidia proprietary
|
special compat code for legacy drivers, namely Nvidia proprietary
|
||||||
|
|
||||||
|
NVidia is lacking behind for at least a year and don't actually clean up
|
||||||
|
their spaghetti code. That's why we need to keep several special compat
|
||||||
|
functions to emulate prehistoric behaviour.
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
|
||||||
|
#include "xf86_compat.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* this is specifically for NVidia proprietary driver: they're again lagging
|
* this is specifically for NVidia proprietary driver: they're again lagging
|
||||||
* behind a year, doing at least some minimal cleanup of their code base.
|
* behind a year, doing at least some minimal cleanup of their code base.
|
||||||
|
@ -13,12 +15,7 @@ _X_EXPORT void MarkClientException(ClientPtr pClient);
|
||||||
|
|
||||||
void MarkClientException(ClientPtr pClient)
|
void MarkClientException(ClientPtr pClient)
|
||||||
{
|
{
|
||||||
LogMessageVerb(X_WARNING, 0, "Bogus driver calling DIX-internal function MarkClientException() !\n");
|
xf86NVidiaBugInternalFunc("MarkClientException()");
|
||||||
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);
|
dixMarkClientException(pClient);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include "include/os.h"
|
#include "include/os.h"
|
||||||
|
|
||||||
|
#include "xf86_compat.h"
|
||||||
|
|
||||||
#undef xf86Msg
|
#undef xf86Msg
|
||||||
#undef xf86MsgVerb
|
#undef xf86MsgVerb
|
||||||
|
|
||||||
|
@ -17,9 +19,7 @@ _X_EXPORT void xf86Msg(MessageType type, const char *format, ...)
|
||||||
|
|
||||||
void xf86Msg(MessageType type, const char *format, ...)
|
void xf86Msg(MessageType type, const char *format, ...)
|
||||||
{
|
{
|
||||||
LogMessageVerb(X_WARNING, 0, "Outdated driver still using xf86Msg() !\n");
|
xf86NVidiaBugInternalFunc("xf86Msg()");
|
||||||
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");
|
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
@ -39,9 +39,7 @@ _X_EXPORT void xf86MsgVerb(MessageType type, int verb, const char *format, ...)
|
||||||
void
|
void
|
||||||
xf86MsgVerb(MessageType type, int verb, const char *format, ...)
|
xf86MsgVerb(MessageType type, int verb, const char *format, ...)
|
||||||
{
|
{
|
||||||
LogMessageVerb(X_WARNING, 0, "Outdated driver still using xf86MsgVerb() !\n");
|
xf86NVidiaBugInternalFunc("xf86MsgVerb()");
|
||||||
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");
|
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
srcs_xorg_compat = [
|
srcs_xorg_compat = [
|
||||||
'clientexception.c',
|
'clientexception.c',
|
||||||
'log.c',
|
'log.c',
|
||||||
|
'nvidiabug.c',
|
||||||
'ones.c',
|
'ones.c',
|
||||||
'xf86Helper.c',
|
'xf86Helper.c',
|
||||||
]
|
]
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
/* SPDX-License-Identifier: MIT OR X11
|
||||||
|
*
|
||||||
|
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
|
||||||
|
*/
|
||||||
|
#include <dix-config.h>
|
||||||
|
|
||||||
|
#include "include/os.h"
|
||||||
|
|
||||||
|
#include "xf86_compat.h"
|
||||||
|
|
||||||
|
void xf86NVidiaBug(void)
|
||||||
|
{
|
||||||
|
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] file a bug report to driver vendor or use a free Xlibre driver.\n");
|
||||||
|
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] Proprietary drivers are inherently unstable, they just can't be done right.\n");
|
||||||
|
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] For NVidia report here: https://forums.developer.nvidia.com/c/gpu-graphics/linux/148\n");
|
||||||
|
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] And better don't buy NVidia HW until they've fixed their mess.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void xf86NVidiaBugInternalFunc(const char* name)
|
||||||
|
{
|
||||||
|
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] calling internal function: %s\n", name);
|
||||||
|
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] this function is not supposed to be by drivers ever\n");
|
||||||
|
xf86NVidiaBug();
|
||||||
|
}
|
||||||
|
|
||||||
|
void xf86NVidiaBugObsoleteFunc(const char* name)
|
||||||
|
{
|
||||||
|
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] calling obsolete function: %s\n", name);
|
||||||
|
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] this function is not supposed to be by drivers ever\n");
|
||||||
|
xf86NVidiaBug();
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
/* SPDX-License-Identifier: MIT OR X11
|
||||||
|
*
|
||||||
|
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
|
||||||
|
*/
|
||||||
|
#ifndef __XFREE86_COMPAT_XF86_COMPAT_H
|
||||||
|
#define __XFREE86_COMPAT_XF86_COMPAT_H
|
||||||
|
|
||||||
|
void xf86NVidiaBug(void);
|
||||||
|
void xf86NVidiaBugInternalFunc(const char* name);
|
||||||
|
void xf86NVidiaBugObsoleteFunc(const char* name);
|
||||||
|
|
||||||
|
#endif /* __XFREE86_COMPAT_XF86_COMPAT_H */
|
|
@ -417,7 +417,6 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
|
||||||
{
|
{
|
||||||
int vercode[4];
|
int vercode[4];
|
||||||
long ver = data->xf86version;
|
long ver = data->xf86version;
|
||||||
MessageType errtype;
|
|
||||||
|
|
||||||
LogMessage(X_INFO, "Module %s: vendor=\"%s\"\n",
|
LogMessage(X_INFO, "Module %s: vendor=\"%s\"\n",
|
||||||
data->modname ? data->modname : "UNKNOWN!",
|
data->modname ? data->modname : "UNKNOWN!",
|
||||||
|
@ -458,6 +457,7 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
|
||||||
vermaj = GET_ABI_MAJOR(ver);
|
vermaj = GET_ABI_MAJOR(ver);
|
||||||
vermin = GET_ABI_MINOR(ver);
|
vermin = GET_ABI_MINOR(ver);
|
||||||
if (abimaj != vermaj) {
|
if (abimaj != vermaj) {
|
||||||
|
MessageType errtype;
|
||||||
if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
|
if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
|
||||||
errtype = X_WARNING;
|
errtype = X_WARNING;
|
||||||
else
|
else
|
||||||
|
@ -469,6 +469,7 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else if (abimin > vermin) {
|
else if (abimin > vermin) {
|
||||||
|
MessageType errtype;
|
||||||
if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
|
if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
|
||||||
errtype = X_WARNING;
|
errtype = X_WARNING;
|
||||||
else
|
else
|
||||||
|
|
4
os/log.c
4
os/log.c
|
@ -410,6 +410,10 @@ vpnprintf(char *string, int size_in, const char *f, va_list args)
|
||||||
|
|
||||||
f_idx++;
|
f_idx++;
|
||||||
|
|
||||||
|
/* silently ignore reverse justification */
|
||||||
|
if (f[f_idx] == '-')
|
||||||
|
f_idx++;
|
||||||
|
|
||||||
/* silently swallow minimum field width */
|
/* silently swallow minimum field width */
|
||||||
if (f[f_idx] == '*') {
|
if (f[f_idx] == '*') {
|
||||||
f_idx++;
|
f_idx++;
|
||||||
|
|
Loading…
Reference in New Issue