From bb7879d0315a147ffa82c6c7e862049dc0241fdb Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 21 Jul 2025 17:37:08 +0200 Subject: [PATCH] xfree86: drivers: chips: add the driver to the build Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/drivers/video/chips/man/chips.man | 16 +++---- hw/xfree86/drivers/video/chips/meson.build | 48 +++++++++++++++++++ .../drivers/video/chips/src/compat-api.h | 2 + hw/xfree86/drivers/video/chips/src/ct_accel.c | 5 +- hw/xfree86/drivers/video/chips/src/ct_bank.c | 5 +- .../drivers/video/chips/src/ct_cursor.c | 5 +- hw/xfree86/drivers/video/chips/src/ct_ddc.c | 5 +- hw/xfree86/drivers/video/chips/src/ct_dga.c | 5 +- .../drivers/video/chips/src/ct_driver.c | 5 +- .../drivers/video/chips/src/ct_driver.h | 1 - hw/xfree86/drivers/video/chips/src/ct_exa.c | 5 +- hw/xfree86/drivers/video/chips/src/ct_regs.c | 5 +- .../drivers/video/chips/src/ct_shadow.c | 5 +- hw/xfree86/drivers/video/chips/src/ct_video.c | 5 +- .../drivers/video/chips/util/meson.build | 23 +++++++++ hw/xfree86/drivers/video/meson.build | 4 ++ meson_options.txt | 2 + 17 files changed, 97 insertions(+), 49 deletions(-) create mode 100644 hw/xfree86/drivers/video/chips/meson.build create mode 100644 hw/xfree86/drivers/video/chips/util/meson.build diff --git a/hw/xfree86/drivers/video/chips/man/chips.man b/hw/xfree86/drivers/video/chips/man/chips.man index 9821bc9cc..cc0470b9f 100644 --- a/hw/xfree86/drivers/video/chips/man/chips.man +++ b/hw/xfree86/drivers/video/chips/man/chips.man @@ -1,8 +1,8 @@ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH CHIPS __drivermansuffix__ 2011-03-29 __vendorversion__ +.TH CHIPS @drivermansuffix@ 2011-03-29 @vendorversion@ .SH NAME -chips \- Chips and Technologies video driver for Xorg +chips \- Chips and Technologies video driver for Xlibre .SH SYNOPSIS .nf .B "Section \*qDevice\*q" @@ -13,7 +13,7 @@ chips \- Chips and Technologies video driver for Xorg .fi .SH DESCRIPTION .B chips -is an Xorg driver for Chips and Technologies video processors. +is an Xlibre driver for Chips and Technologies video processors. The majority of the Chips and Technologies chipsets are supported by this driver. In general the limitation on the capabilities of this driver are determined by the chipset on which it is run. @@ -78,7 +78,7 @@ overlay mode. Full acceleration is supplied for all chipsets. .SH CONFIGURATION DETAILS Please refer to -.BR xorg.conf (__filemansuffix__) +.BR xorg.conf (@filemansuffix@) for general configuration details. This section only covers configuration details specific to this driver. .PP @@ -236,10 +236,10 @@ of what the BIOS is saying set this option to off. Don't set it to off if a panel is connected. Default: value probed by BIOS. .SH "SEE ALSO" -.BR Xorg (__appmansuffix__), -.BR xorg.conf (__filemansuffix__), -.BR Xserver (__appmansuffix__), -.BR X (__miscmansuffix__) +.BR Xorg (@appmansuffix@), +.BR xorg.conf (@filemansuffix@), +.BR Xserver (@appmansuffix@), +.BR X (@miscmansuffix@) .PP You are also recommended to read the README file that comes with the driver source, which discusses the diff --git a/hw/xfree86/drivers/video/chips/meson.build b/hw/xfree86/drivers/video/chips/meson.build new file mode 100644 index 000000000..75d8f33f9 --- /dev/null +++ b/hw/xfree86/drivers/video/chips/meson.build @@ -0,0 +1,48 @@ +driver_video_chips_srcs = [ + 'src/ct_bank.c', + 'src/ct_cursor.c', + 'src/ct_dga.c', + 'src/ct_shadow.c', + 'src/ct_accel.c', + 'src/ct_ddc.c', + 'src/ct_driver.c', + 'src/ct_exa.c', + 'src/ct_regs.c', + 'src/ct_video.c' +] + +shared_module( + 'chips_drv', + driver_video_chips_srcs, + name_prefix: '', + + include_directories: [inc, xorg_inc], + c_args: xorg_c_args, + dependencies: [ + common_dep, + ], + + install: true, + install_dir: join_paths(module_abi_dir, 'drivers'), +) + +# Test that we don't have any unresolved symbols from our module to Xorg. +xorg_build_root = join_paths(meson.project_build_root(), 'hw', 'xfree86') +symbol_test_args = [] +symbol_test_args += join_paths(xorg_build_root, 'libxorgserver.so') +symbol_test_args += join_paths(xorg_build_root, 'dixmods', 'libshadow.so') +symbol_test_args += join_paths(xorg_build_root, 'dixmods', 'libglx.so') +symbol_test_args += join_paths(xorg_build_root, 'drivers', 'video-chips', 'chips_drv.so') + +test('video-chips symbol test', + xorg_symbol_test, + args: symbol_test_args, +) + +install_man(configure_file( + input: 'man/chips.man', + output: 'chips.4', + configuration: manpage_config, +)) + +subdir('util') diff --git a/hw/xfree86/drivers/video/chips/src/compat-api.h b/hw/xfree86/drivers/video/chips/src/compat-api.h index 89976e41c..8405f237e 100644 --- a/hw/xfree86/drivers/video/chips/src/compat-api.h +++ b/hw/xfree86/drivers/video/chips/src/compat-api.h @@ -28,6 +28,8 @@ #ifndef COMPAT_API_H #define COMPAT_API_H +typedef void *pointer; + #ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR #define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum] #define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p diff --git a/hw/xfree86/drivers/video/chips/src/ct_accel.c b/hw/xfree86/drivers/video/chips/src/ct_accel.c index 19eaa08f2..5590670f0 100644 --- a/hw/xfree86/drivers/video/chips/src/ct_accel.c +++ b/hw/xfree86/drivers/video/chips/src/ct_accel.c @@ -20,10 +20,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include /* * When monochrome tiles/stipples are cached on the HiQV chipsets the diff --git a/hw/xfree86/drivers/video/chips/src/ct_bank.c b/hw/xfree86/drivers/video/chips/src/ct_bank.c index 026461615..799db0ef5 100644 --- a/hw/xfree86/drivers/video/chips/src/ct_bank.c +++ b/hw/xfree86/drivers/video/chips/src/ct_bank.c @@ -27,10 +27,7 @@ * negligence, tort, under statute, in equity, at law or otherwise, even if * advised of the possibility of such damage. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #define PSZ 8 diff --git a/hw/xfree86/drivers/video/chips/src/ct_cursor.c b/hw/xfree86/drivers/video/chips/src/ct_cursor.c index 3598bd27c..e184bbc2f 100644 --- a/hw/xfree86/drivers/video/chips/src/ct_cursor.c +++ b/hw/xfree86/drivers/video/chips/src/ct_cursor.c @@ -24,10 +24,7 @@ * Written by Alan Hourihane * Modified for Chips and Technologies by David Bateman */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include /* All drivers should typically include these */ #include "xf86.h" diff --git a/hw/xfree86/drivers/video/chips/src/ct_ddc.c b/hw/xfree86/drivers/video/chips/src/ct_ddc.c index 677d84053..33addf896 100644 --- a/hw/xfree86/drivers/video/chips/src/ct_ddc.c +++ b/hw/xfree86/drivers/video/chips/src/ct_ddc.c @@ -1,7 +1,4 @@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include /* All drivers should typically include these */ #include "xf86.h" diff --git a/hw/xfree86/drivers/video/chips/src/ct_dga.c b/hw/xfree86/drivers/video/chips/src/ct_dga.c index af0c1c27f..b0b9936cc 100644 --- a/hw/xfree86/drivers/video/chips/src/ct_dga.c +++ b/hw/xfree86/drivers/video/chips/src/ct_dga.c @@ -1,7 +1,4 @@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include "xf86.h" #include "xf86_OSproc.h" diff --git a/hw/xfree86/drivers/video/chips/src/ct_driver.c b/hw/xfree86/drivers/video/chips/src/ct_driver.c index 48cfdbbbc..0752f6dc6 100644 --- a/hw/xfree86/drivers/video/chips/src/ct_driver.c +++ b/hw/xfree86/drivers/video/chips/src/ct_driver.c @@ -67,10 +67,7 @@ * negligence, tort, under statute, in equity, at law or otherwise, even if * advised of the possibility of such damage. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include /* All drivers should typically include these */ #include "xf86.h" diff --git a/hw/xfree86/drivers/video/chips/src/ct_driver.h b/hw/xfree86/drivers/video/chips/src/ct_driver.h index 980c6f749..75bca62ff 100644 --- a/hw/xfree86/drivers/video/chips/src/ct_driver.h +++ b/hw/xfree86/drivers/video/chips/src/ct_driver.h @@ -26,7 +26,6 @@ #ifndef _CT_DRIVER_H_ #define _CT_DRIVER_H_ -#include "config.h" #include "ct_pcirename.h" #include "exa.h" #include "vbe.h" diff --git a/hw/xfree86/drivers/video/chips/src/ct_exa.c b/hw/xfree86/drivers/video/chips/src/ct_exa.c index 8fe2cf692..064d9a91a 100644 --- a/hw/xfree86/drivers/video/chips/src/ct_exa.c +++ b/hw/xfree86/drivers/video/chips/src/ct_exa.c @@ -22,13 +22,10 @@ */ /* $NetBSD: ct_exa.c,v 1.3 2017/02/16 15:05:57 macallan Exp $ */ +#include #include -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - /* All drivers should typically include these */ #include "xf86.h" #include "xf86_OSproc.h" diff --git a/hw/xfree86/drivers/video/chips/src/ct_regs.c b/hw/xfree86/drivers/video/chips/src/ct_regs.c index 5ae521f8d..8aea7bb65 100644 --- a/hw/xfree86/drivers/video/chips/src/ct_regs.c +++ b/hw/xfree86/drivers/video/chips/src/ct_regs.c @@ -19,10 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include /* * The functions in this file are used to read/write the C&T extension register diff --git a/hw/xfree86/drivers/video/chips/src/ct_shadow.c b/hw/xfree86/drivers/video/chips/src/ct_shadow.c index 66b0ba7cc..06df250aa 100644 --- a/hw/xfree86/drivers/video/chips/src/ct_shadow.c +++ b/hw/xfree86/drivers/video/chips/src/ct_shadow.c @@ -1,7 +1,4 @@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include "xf86.h" #include "xf86_OSproc.h" diff --git a/hw/xfree86/drivers/video/chips/src/ct_video.c b/hw/xfree86/drivers/video/chips/src/ct_video.c index 22c20fb58..3de9a584c 100644 --- a/hw/xfree86/drivers/video/chips/src/ct_video.c +++ b/hw/xfree86/drivers/video/chips/src/ct_video.c @@ -1,7 +1,4 @@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include "xf86.h" #include "xf86_OSproc.h" diff --git a/hw/xfree86/drivers/video/chips/util/meson.build b/hw/xfree86/drivers/video/chips/util/meson.build new file mode 100644 index 000000000..9efdb1970 --- /dev/null +++ b/hw/xfree86/drivers/video/chips/util/meson.build @@ -0,0 +1,23 @@ +dRegs = executable( + 'dRegs', + [ 'dRegs.c' ], + install: true, +) + +mRegs = executable( + 'mRegs', + [ 'mRegs.c' ], + install: true, +) + +modClock = executable( + 'modClock', + [ 'modClock.c' ], + install: true, +) + +memClock = executable( + 'memClock', + [ 'modClock.c' ], + install: true, +) diff --git a/hw/xfree86/drivers/video/meson.build b/hw/xfree86/drivers/video/meson.build index 52801d88a..e98f71664 100644 --- a/hw/xfree86/drivers/video/meson.build +++ b/hw/xfree86/drivers/video/meson.build @@ -13,3 +13,7 @@ endif if get_option('xf86-video-ast') subdir('ast') endif + +if get_option('xf86-video-chips') + subdir('chips') +endif diff --git a/meson_options.txt b/meson_options.txt index fc0640a33..2c2558126 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -129,6 +129,8 @@ option('xf86-video-ark', type: 'boolean', value: true, description: 'xf86 video driver for ARK graphics chips') option('xf86-video-ast', type: 'boolean', value: true, description: 'xf86 video driver for AST graphics chips') +option('xf86-video-chips', type: 'boolean', value: true, + description: 'xf86 video driver for CHIPS graphics chips') option('tests', type: 'boolean', value: true, description: 'Build tests for the X server on platforms that support it')