diff --git a/dix/pixmap.c b/dix/pixmap.c index bc3d83831f..2b1f9e1864 100644 --- a/dix/pixmap.c +++ b/dix/pixmap.c @@ -87,6 +87,10 @@ PixmapScreenInit(ScreenPtr pScreen) pScreen->totalPixmapSize = BitmapBytePad(pixmap_size * 8); +#ifdef CONFIG_LEGACY_NVIDIA_PADDING + /* This field is used by the 470 and 390 proprietary nvidia DDX driver, and should always be NULL */ + pScreen->reserved_for_nvidia_470_and_390 = NULL; +#endif return TRUE; } diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index b26bdd7bbe..b790c31b9d 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -74,7 +74,14 @@ * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(1, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(28, 0) + +/* XXX This is a compile-time option that changes abi XXX */ +/* TODO: Remove this toggle in 26.0 */ +#ifdef CONFIG_LEGACY_NVIDIA_PADDING +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(28, 1) +#else +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(28, 0) +#endif #define ABI_XINPUT_VERSION SET_ABI_VERSION(26, 0) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(11, 0) diff --git a/include/meson.build b/include/meson.build index 6c14da6d77..2567caa62f 100644 --- a/include/meson.build +++ b/include/meson.build @@ -210,6 +210,9 @@ conf_data.set('MAXCLIENTS', 2048) # Must be a power of 2 and <= MAXCLIENTS */ conf_data.set('DIX_LIMITCLIENTS', 256) +# Legacy NVidia drivers (390, 470) use an older ABI and expect an additional field in ScreenRec */ +conf_data.set('CONFIG_LEGACY_NVIDIA_PADDING', legacy_nvidia_padding ? '1' : false) + # some drivers (eg. xf86-video-intel) still relying on this symbol being set conf_data.set('COMPOSITE', '1') diff --git a/include/scrnintstr.h b/include/scrnintstr.h index 71ef762ea0..216567d3d3 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -620,6 +620,11 @@ typedef struct _Screen { SetScreenPixmapProcPtr SetScreenPixmap; NameWindowPixmapProcPtr NameWindowPixmap; +#ifdef CONFIG_LEGACY_NVIDIA_PADDING + /* This field is used by the 470 and 390 proprietary nvidia DDX driver, and should always be NULL */ + void* reserved_for_nvidia_470_and_390; +#endif + unsigned int totalPixmapSize; MarkWindowProcPtr MarkWindow; diff --git a/meson.build b/meson.build index 3d2559ae3d..ec0b173488 100644 --- a/meson.build +++ b/meson.build @@ -553,6 +553,8 @@ elif get_option('mitshm') == 'true' build_mitshm = true endif +legacy_nvidia_padding = get_option('legacy_nvidia_padding') + m_dep = cc.find_library('m', required : false) dl_dep = cc.find_library('dl', required : false) diff --git a/meson_options.txt b/meson_options.txt index 6077dca96c..c66e73b695 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -145,3 +145,6 @@ option('devel-docs', type: 'combo', choices: ['true', 'false', 'auto'], value: ' description: 'Build development documentation') option('docs-pdf', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Whether to build PDF version of documentation. Setting is ignored if documentation is not built.') + +option('legacy_nvidia_padding', type: 'boolean', value: false, + description: 'EXPERT ONLY: Add a padding to ScreenRec to match an older ABI for legacy NVidia drivers')