Compare commits

...

14 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 293a2c1edc xfree86: move private definitions out of dri.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:31 +01:00
Enrico Weigelt, metux IT consult 0f30927e7b xfree86: move private definitions out of dri2.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:31 +01:00
Enrico Weigelt, metux IT consult 517285c45c xfree86: ddc: move private definitions from xf86DDC.h to xf86DDC_priv.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:31 +01:00
Enrico Weigelt, metux IT consult 234172809d xfree86: common: dont install xf86MatchDrivers.h
xf86MatchDrivers.h doesn't export any symbols, thus doesn't need to
be installed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:31 +01:00
Enrico Weigelt, metux IT consult 24c4eba91c xfree86: parser: move private defs from xf86Parser.h to xf86Parser_priv.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:31 +01:00
Enrico Weigelt, metux IT consult b197333e98 xfree86: modes: move private definitions out of from xf86RandR12.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:31 +01:00
Enrico Weigelt, metux IT consult 0737a4e637 xfree86: common: move private defs out of xf86VGAarbiter.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:31 +01:00
Enrico Weigelt, metux IT consult 7a4dbf52b2 xfree86: common: move private defs from xf86Xinput.h to xf86Xinput_priv.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:31 +01:00
Enrico Weigelt, metux IT consult 27233c3fa1 xfree86: common: move private defs from xf86_OSproc.h to xf86OSpriv.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:31 +01:00
Enrico Weigelt, metux IT consult 76d31d6bfc xfree86: int10: move private defs out of xf86int10.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:31 +01:00
Enrico Weigelt, metux IT consult c2d1ff1c8b xfree86: common: move non-public defs out of xf86platformBus.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:31 +01:00
Enrico Weigelt, metux IT consult 96d01009a2 xfree86: common: move private defs out of xf86sbusBus.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 16:20:29 +01:00
Enrico Weigelt, metux IT consult ac7b49b45c xfree86: common: unexport dgaproc.h
dgaproc.h doesn't contain any exported (module API) functions, and the structs
defined here also aren't used by anything public. Thus this file doesn't need
to be installed into SDK anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 15:34:17 +01:00
Enrico Weigelt, metux IT consult 0a9be2584a xfree86: parser: drop HAS_NO_UIDS
It's only locally defined when WIN32 is defined, so we can use this directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-29 15:34:17 +01:00
61 changed files with 474 additions and 340 deletions

View File

@ -42,7 +42,6 @@ xorg_sdk_headers = [
'xf86VGAarbiter.h', 'xf86VGAarbiter.h',
'xf86Optionstr.h', 'xf86Optionstr.h',
'xf86platformBus.h', 'xf86platformBus.h',
'xf86MatchDrivers.h',
'xaarop.h', 'xaarop.h',
] ]
@ -57,7 +56,6 @@ endif
if build_dga if build_dga
srcs_xorg_common += 'xf86DGA.c' srcs_xorg_common += 'xf86DGA.c'
xorg_sdk_headers += 'dgaproc.h'
endif endif
if build_xv if build_xv

View File

@ -126,13 +126,7 @@ extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn,
EntityProc leave, EntityProc leave,
void *private); void *private);
#else #else
#define xf86VGAarbiterInit() do {} while (0)
#define xf86VGAarbiterFini() do {} while (0)
#define xf86VGAarbiterLock(x) do {} while (0)
#define xf86VGAarbiterUnlock(x) do {} while (0)
#define xf86VGAarbiterScrnInit(x) do {} while (0)
#define xf86VGAarbiterDeviceDecodes() do {} while (0) #define xf86VGAarbiterDeviceDecodes() do {} while (0)
#define xf86VGAarbiterWrapFunctions() do {} while (0)
#endif #endif
/* xf86Bus.c */ /* xf86Bus.c */

View File

@ -34,7 +34,7 @@
#endif #endif
#include "xf86.h" #include "xf86.h"
#include "xf86Parser.h" #include "xf86Parser_priv.h"
#include "xf86tokens.h" #include "xf86tokens.h"
#include "xf86Config.h" #include "xf86Config.h"
#include "xf86MatchDrivers.h" #include "xf86MatchDrivers.h"

View File

@ -48,7 +48,7 @@
#define XF86_OS_PRIVS #define XF86_OS_PRIVS
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
#ifdef XSERVER_LIBPCIACCESS #ifdef XSERVER_LIBPCIACCESS
#include "xf86VGAarbiter.h" #include "xf86VGAarbiter_priv.h"
#endif #endif
/* Entity data */ /* Entity data */
EntityPtr *xf86Entities = NULL; /* Bus slots claimed by drivers */ EntityPtr *xf86Entities = NULL; /* Bus slots claimed by drivers */

View File

@ -51,7 +51,7 @@
#include "xf86.h" #include "xf86.h"
#include "xf86Modes.h" #include "xf86Modes.h"
#include "xf86Parser.h" #include "xf86Parser_priv.h"
#include "xf86tokens.h" #include "xf86tokens.h"
#include "xf86Config.h" #include "xf86Config.h"
#include "xf86Priv.h" #include "xf86Priv.h"
@ -62,6 +62,7 @@
#include "xf86pciBus.h" #include "xf86pciBus.h"
#include "xf86Xinput.h" #include "xf86Xinput.h"
#include "loaderProcs.h" #include "loaderProcs.h"
#include "xf86Xinput_priv.h"
#include "xkbsrv.h" #include "xkbsrv.h"
#include "picture.h" #include "picture.h"

View File

@ -33,7 +33,7 @@
#include "xf86Priv.h" #include "xf86Priv.h"
#define IN_XSERVER #define IN_XSERVER
#include "Configint.h" #include "Configint.h"
#include "xf86DDC.h" #include "xf86DDC_priv.h"
#include "xf86pciBus.h" #include "xf86pciBus.h"
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
#include "xf86Bus.h" #include "xf86Bus.h"
@ -41,6 +41,7 @@
#endif #endif
#include "misc.h" #include "misc.h"
#include "loaderProcs.h" #include "loaderProcs.h"
#include "xf86Parser_priv.h"
typedef struct _DevToConfig { typedef struct _DevToConfig {
GDevRec GDev; GDevRec GDev;

View File

@ -44,7 +44,7 @@
#include "dpmsproc.h" #include "dpmsproc.h"
#endif #endif
#ifdef XSERVER_LIBPCIACCESS #ifdef XSERVER_LIBPCIACCESS
#include "xf86VGAarbiter.h" #include "xf86VGAarbiter_priv.h"
#endif #endif
#ifdef DPMSExtension #ifdef DPMSExtension

View File

@ -71,7 +71,7 @@
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
#include "inputstr.h" #include "inputstr.h"
#include "xf86Xinput.h" #include "xf86Xinput_priv.h"
#include "mi.h" #include "mi.h"
#include "mipointer.h" #include "mipointer.h"
@ -84,7 +84,7 @@
#include "dpmsproc.h" #include "dpmsproc.h"
#endif #endif
#include "xf86platformBus.h" #include "xf86platformBus_priv.h"
#include "systemd-logind.h" #include "systemd-logind.h"
extern void (*xf86OSPMClose) (void); extern void (*xf86OSPMClose) (void);

View File

@ -52,7 +52,7 @@
#include "xf86_OSlib.h" #include "xf86_OSlib.h"
#include "micmap.h" #include "micmap.h"
#include "xf86DDC.h" #include "xf86DDC.h"
#include "xf86Xinput.h" #include "xf86Xinput_priv.h"
#include "xf86InPriv.h" #include "xf86InPriv.h"
#include "mivalidate.h" #include "mivalidate.h"

View File

@ -54,7 +54,7 @@
#include "mi.h" #include "mi.h"
#include "dbus-core.h" #include "dbus-core.h"
#include "systemd-logind.h" #include "systemd-logind.h"
#include "xf86VGAarbiter_priv.h"
#include "loaderProcs.h" #include "loaderProcs.h"
#define XF86_OS_PRIVS #define XF86_OS_PRIVS

View File

@ -44,7 +44,7 @@
#include "xf86Xinput.h" #include "xf86Xinput.h"
#include "xf86Optrec.h" #include "xf86Optrec.h"
#include "xf86Parser.h" #include "xf86Parser.h"
#include "xf86platformBus.h" /* For OutputClass functions */ #include "xf86platformBus_priv.h"
#include "optionstr.h" #include "optionstr.h"
static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options, static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options,

View File

@ -32,7 +32,7 @@
#include <X11/X.h> #include <X11/X.h>
#include "xf86.h" #include "xf86.h"
#include "xf86Priv.h" #include "xf86Priv.h"
#include "xf86Xinput.h" #include "xf86Xinput_priv.h"
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
int (*xf86PMGetEventFromOs) (int fd, pmEvent * events, int num) = NULL; int (*xf86PMGetEventFromOs) (int fd, pmEvent * events, int num) = NULL;

View File

@ -30,7 +30,7 @@
#include "xorg-config.h" #include "xorg-config.h"
#include "xf86VGAarbiter.h" #include "xf86VGAarbiter_priv.h"
#include "xf86VGAarbiterPriv.h" #include "xf86VGAarbiterPriv.h"
#include "xf86Bus.h" #include "xf86Bus.h"
#include "xf86Priv.h" #include "xf86Priv.h"

View File

@ -30,14 +30,6 @@
#include "misc.h" #include "misc.h"
#include "xf86.h" #include "xf86.h"
/* Functions */
extern void xf86VGAarbiterInit(void);
extern void xf86VGAarbiterFini(void);
void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn);
extern Bool xf86VGAarbiterWrapFunctions(void);
extern void xf86VGAarbiterLock(ScrnInfoPtr pScrn);
extern void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn);
/* allow a driver to remove itself from arbiter - really should be /* allow a driver to remove itself from arbiter - really should be
* done in the kernel though */ * done in the kernel though */
extern _X_EXPORT void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn, int rsrc); extern _X_EXPORT void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn, int rsrc);

View File

@ -0,0 +1,32 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER_XF86VGAARBITERPRIV_H
#define _XSERVER_XF86VGAARBITERPRIV_H
#include <X11/Xdefs.h>
#include "xf86VGAarbiter.h"
#ifdef XSERVER_LIBPCIACCESS
void xf86VGAarbiterInit(void);
void xf86VGAarbiterFini(void);
void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn);
Bool xf86VGAarbiterWrapFunctions(void);
void xf86VGAarbiterLock(ScrnInfoPtr pScrn);
void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn);
#else /* XSERVER_LIBPCIACCESS */
static inline void xf86VGAarbiterInit() {}
static inline void xf86VGAarbiterFini() {}
static inline void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn) {}
static inline void xf86VGAarbiterWrapFunctions(void) { return FALSE; }
static inline void xf86VGAarbiterLock(ScrnInfoPtr pScrn) {}
static inline void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn) {}
#endif /* XSERVER_LIBPCIACCESS */
#endif /* _XSERVER_XF86VGAARBITERPRIV_H */

View File

@ -58,7 +58,7 @@
#include "xf86.h" #include "xf86.h"
#include "xf86Priv.h" #include "xf86Priv.h"
#include "xf86Config.h" #include "xf86Config.h"
#include "xf86Xinput.h" #include "xf86Xinput_priv.h"
#include "xf86Optrec.h" #include "xf86Optrec.h"
#include "mipointer.h" #include "mipointer.h"
#include "extinit.h" #include "extinit.h"

View File

@ -113,9 +113,6 @@ struct _InputInfoRec {
InputAttributes *attrs; InputAttributes *attrs;
}; };
/* xf86Globals.c */
extern InputInfoPtr xf86InputDevs;
/* xf86Xinput.c */ /* xf86Xinput.c */
extern _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute, extern _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
int first_valuator, int num_valuators, int first_valuator, int num_valuators,
@ -189,10 +186,6 @@ extern _X_EXPORT void xf86DisableDevice(DeviceIntPtr dev, Bool panic);
extern _X_EXPORT void xf86EnableDevice(DeviceIntPtr dev); extern _X_EXPORT void xf86EnableDevice(DeviceIntPtr dev);
extern _X_EXPORT void xf86InputEnableVTProbe(void); extern _X_EXPORT void xf86InputEnableVTProbe(void);
/* not exported */
int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL is_auto);
InputInfoPtr xf86AllocateInput(void);
/* xf86Helper.c */ /* xf86Helper.c */
extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, void *module, extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, void *module,
int flags); int flags);

View File

@ -0,0 +1,15 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER__XF86XINPUT_H
#define _XSERVER__XF86XINPUT_H
#include "xf86Xinput.h"
extern InputInfoPtr xf86InputDevs;
int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL is_auto);
InputInfoPtr xf86AllocateInput(void);
#endif /* _XSERVER__XF86XINPUT_H */

View File

@ -49,7 +49,7 @@
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
#include "xf86str.h" #include "xf86str.h"
#include "micmap.h" #include "micmap.h"
#include "xf86RandR12.h" #include "xf86RandR12_priv.h"
#include "xf86Crtc.h" #include "xf86Crtc.h"
#ifdef XFreeXDGA #ifdef XFreeXDGA

View File

@ -45,6 +45,7 @@
/* Bus-specific headers */ /* Bus-specific headers */
#include "xf86Bus.h" #include "xf86Bus.h"
#include "xf86sbusBus_priv.h"
#define XF86_OS_PRIVS #define XF86_OS_PRIVS
#include "xf86_OSproc.h" #include "xf86_OSproc.h"

View File

@ -34,6 +34,7 @@
#define _XF86_PCI_BUS_H #define _XF86_PCI_BUS_H
#include "xf86MatchDrivers.h" #include "xf86MatchDrivers.h"
#include "xf86platformBus_priv.h"
void xf86PciProbe(void); void xf86PciProbe(void);
Bool xf86PciAddMatchingDev(DriverPtr drvp); Bool xf86PciAddMatchingDev(DriverPtr drvp);

View File

@ -47,9 +47,10 @@
#include "xf86str.h" #include "xf86str.h"
#include "xf86Bus.h" #include "xf86Bus.h"
#include "Pci.h" #include "Pci.h"
#include "xf86platformBus.h" #include "xf86platformBus_priv.h"
#include "xf86Config.h" #include "xf86Config.h"
#include "xf86Crtc.h" #include "xf86Crtc.h"
#include "xf86OSpriv.h"
#include "randrstr.h" #include "randrstr.h"
int platformSlotClaimed; int platformSlotClaimed;

View File

@ -34,139 +34,10 @@ struct xf86_platform_device {
int flags; int flags;
}; };
/* xf86_platform_device flags */
#define XF86_PDEV_UNOWNED 0x01
#define XF86_PDEV_SERVER_FD 0x02
#define XF86_PDEV_PAUSED 0x04
#ifdef XSERVER_PLATFORM_BUS
int xf86platformProbe(void);
int xf86platformProbeDev(DriverPtr drvp);
int xf86platformAddGPUDevices(DriverPtr drvp);
void xf86MergeOutputClassOptions(int entityIndex, void **options);
void xf86PlatformScanPciDev(void);
const char *xf86PlatformFindHotplugDriver(int dev_index);
extern int xf86_num_platform_devices;
extern struct xf86_platform_device *xf86_platform_devices;
extern int
xf86_add_platform_device(struct OdevAttributes *attribs, Bool unowned);
extern int
xf86_remove_platform_device(int dev_index);
extern Bool
xf86_get_platform_device_unowned(int index);
extern int
xf86platformAddDevice(const char *driver_name, int index);
extern void
xf86platformRemoveDevice(int index);
static inline struct OdevAttributes *
xf86_platform_device_odev_attributes(struct xf86_platform_device *device)
{
return device->attribs;
}
static inline struct OdevAttributes *
xf86_platform_odev_attributes(int index)
{
struct xf86_platform_device *device = &xf86_platform_devices[index];
return device->attribs;
}
#ifndef _XORG_CONFIG_H_
/*
* Define the legacy API only for external builds
*/
/* path to kernel device node - Linux e.g. /dev/dri/card0 */
#define ODEV_ATTRIB_PATH 1
/* system device path - Linux e.g. /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1 */
#define ODEV_ATTRIB_SYSPATH 2
/* DRI-style bus id */
#define ODEV_ATTRIB_BUSID 3
/* Server managed FD */
#define ODEV_ATTRIB_FD 4
/* Major number of the device node pointed to by ODEV_ATTRIB_PATH */
#define ODEV_ATTRIB_MAJOR 5
/* Minor number of the device node pointed to by ODEV_ATTRIB_PATH */
#define ODEV_ATTRIB_MINOR 6
/* kernel driver name */
#define ODEV_ATTRIB_DRIVER 7
/* Protect against a mismatch attribute type by generating a compiler
* error using a negative array size when an incorrect attribute is
* passed
*/
#define _ODEV_ATTRIB_IS_STRING(x) ((x) == ODEV_ATTRIB_PATH || \
(x) == ODEV_ATTRIB_SYSPATH || \
(x) == ODEV_ATTRIB_BUSID || \
(x) == ODEV_ATTRIB_DRIVER)
#define _ODEV_ATTRIB_STRING_CHECK(x) ((int (*)[_ODEV_ATTRIB_IS_STRING(x)-1]) 0)
static inline char *
_xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib, int (*fake)[0])
{
switch (attrib) {
case ODEV_ATTRIB_PATH:
return xf86_platform_device_odev_attributes(device)->path;
case ODEV_ATTRIB_SYSPATH:
return xf86_platform_device_odev_attributes(device)->syspath;
case ODEV_ATTRIB_BUSID:
return xf86_platform_device_odev_attributes(device)->busid;
case ODEV_ATTRIB_DRIVER:
return xf86_platform_device_odev_attributes(device)->driver;
default:
assert(FALSE);
return NULL;
}
}
#define xf86_get_platform_device_attrib(device, attrib) _xf86_get_platform_device_attrib(device,attrib,_ODEV_ATTRIB_STRING_CHECK(attrib))
#define _ODEV_ATTRIB_IS_INT(x) ((x) == ODEV_ATTRIB_FD || (x) == ODEV_ATTRIB_MAJOR || (x) == ODEV_ATTRIB_MINOR)
#define _ODEV_ATTRIB_INT_DEFAULT(x) ((x) == ODEV_ATTRIB_FD ? -1 : 0)
#define _ODEV_ATTRIB_DEFAULT_CHECK(x,def) (_ODEV_ATTRIB_INT_DEFAULT(x) == (def))
#define _ODEV_ATTRIB_INT_CHECK(x,def) ((int (*)[_ODEV_ATTRIB_IS_INT(x)*_ODEV_ATTRIB_DEFAULT_CHECK(x,def)-1]) 0)
static inline int
_xf86_get_platform_device_int_attrib(struct xf86_platform_device *device, int attrib, int (*fake)[0])
{
switch (attrib) {
case ODEV_ATTRIB_FD:
return xf86_platform_device_odev_attributes(device)->fd;
case ODEV_ATTRIB_MAJOR:
return xf86_platform_device_odev_attributes(device)->major;
case ODEV_ATTRIB_MINOR:
return xf86_platform_device_odev_attributes(device)->minor;
default:
assert(FALSE);
return 0;
}
}
#define xf86_get_platform_device_int_attrib(device, attrib, def) _xf86_get_platform_device_int_attrib(device,attrib,_ODEV_ATTRIB_INT_CHECK(attrib,def))
#endif
extern _X_EXPORT Bool extern _X_EXPORT Bool
xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid); xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid);
extern _X_EXPORT void extern _X_EXPORT void
xf86PlatformMatchDriver(XF86MatchedDrivers *); xf86PlatformMatchDriver(XF86MatchedDrivers *);
extern void xf86platformVTProbe(void);
extern void xf86platformPrimary(void);
#else
static inline int xf86platformAddGPUDevices(DriverPtr drvp) { return FALSE; }
static inline void xf86MergeOutputClassOptions(int index, void **options) {}
#endif
#endif #endif

View File

@ -0,0 +1,137 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
* Copyright © 2012 Red Hat.
*/
#ifndef _XSERVER_XF86_PLATFORM_BUS_PRIV_H_
#define _XSERVER_XF86_PLATFORM_BUS_PRIV_H_
#include <X11/Xdefs.h>
#include "xf86platformBus.h"
/* xf86_platform_device flags */
#define XF86_PDEV_UNOWNED 0x01
#define XF86_PDEV_SERVER_FD 0x02
#define XF86_PDEV_PAUSED 0x04
#ifdef XSERVER_PLATFORM_BUS
int xf86platformProbe(void);
int xf86platformProbeDev(DriverPtr drvp);
int xf86platformAddGPUDevices(DriverPtr drvp);
void xf86MergeOutputClassOptions(int entityIndex, void **options);
void xf86PlatformScanPciDev(void);
const char *xf86PlatformFindHotplugDriver(int dev_index);
extern int xf86_num_platform_devices;
extern struct xf86_platform_device *xf86_platform_devices;
int xf86_add_platform_device(struct OdevAttributes *attribs, Bool unowned);
int xf86_remove_platform_device(int dev_index);
Bool xf86_get_platform_device_unowned(int index);
int xf86platformAddDevice(const char *driver_name, int index);
void xf86platformRemoveDevice(int index);
static inline struct OdevAttributes *
xf86_platform_device_odev_attributes(struct xf86_platform_device *device)
{
return device->attribs;
}
static inline struct OdevAttributes *
xf86_platform_odev_attributes(int index)
{
struct xf86_platform_device *device = &xf86_platform_devices[index];
return device->attribs;
}
#ifndef _XORG_CONFIG_H_
/*
* Define the legacy API only for external builds
*/
/* path to kernel device node - Linux e.g. /dev/dri/card0 */
#define ODEV_ATTRIB_PATH 1
/* system device path - Linux e.g. /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1 */
#define ODEV_ATTRIB_SYSPATH 2
/* DRI-style bus id */
#define ODEV_ATTRIB_BUSID 3
/* Server managed FD */
#define ODEV_ATTRIB_FD 4
/* Major number of the device node pointed to by ODEV_ATTRIB_PATH */
#define ODEV_ATTRIB_MAJOR 5
/* Minor number of the device node pointed to by ODEV_ATTRIB_PATH */
#define ODEV_ATTRIB_MINOR 6
/* kernel driver name */
#define ODEV_ATTRIB_DRIVER 7
/* Protect against a mismatch attribute type by generating a compiler
* error using a negative array size when an incorrect attribute is
* passed
*/
#define _ODEV_ATTRIB_IS_STRING(x) ((x) == ODEV_ATTRIB_PATH || \
(x) == ODEV_ATTRIB_SYSPATH || \
(x) == ODEV_ATTRIB_BUSID || \
(x) == ODEV_ATTRIB_DRIVER)
#define _ODEV_ATTRIB_STRING_CHECK(x) ((int (*)[_ODEV_ATTRIB_IS_STRING(x)-1]) 0)
static inline char *
_xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib, int (*fake)[0])
{
switch (attrib) {
case ODEV_ATTRIB_PATH:
return xf86_platform_device_odev_attributes(device)->path;
case ODEV_ATTRIB_SYSPATH:
return xf86_platform_device_odev_attributes(device)->syspath;
case ODEV_ATTRIB_BUSID:
return xf86_platform_device_odev_attributes(device)->busid;
case ODEV_ATTRIB_DRIVER:
return xf86_platform_device_odev_attributes(device)->driver;
default:
assert(FALSE);
return NULL;
}
}
#define xf86_get_platform_device_attrib(device, attrib) _xf86_get_platform_device_attrib(device,attrib,_ODEV_ATTRIB_STRING_CHECK(attrib))
#define _ODEV_ATTRIB_IS_INT(x) ((x) == ODEV_ATTRIB_FD || (x) == ODEV_ATTRIB_MAJOR || (x) == ODEV_ATTRIB_MINOR)
#define _ODEV_ATTRIB_INT_DEFAULT(x) ((x) == ODEV_ATTRIB_FD ? -1 : 0)
#define _ODEV_ATTRIB_DEFAULT_CHECK(x,def) (_ODEV_ATTRIB_INT_DEFAULT(x) == (def))
#define _ODEV_ATTRIB_INT_CHECK(x,def) ((int (*)[_ODEV_ATTRIB_IS_INT(x)*_ODEV_ATTRIB_DEFAULT_CHECK(x,def)-1]) 0)
static inline int
_xf86_get_platform_device_int_attrib(struct xf86_platform_device *device, int attrib, int (*fake)[0])
{
switch (attrib) {
case ODEV_ATTRIB_FD:
return xf86_platform_device_odev_attributes(device)->fd;
case ODEV_ATTRIB_MAJOR:
return xf86_platform_device_odev_attributes(device)->major;
case ODEV_ATTRIB_MINOR:
return xf86_platform_device_odev_attributes(device)->minor;
default:
assert(FALSE);
return 0;
}
}
#define xf86_get_platform_device_int_attrib(device, attrib, def) _xf86_get_platform_device_int_attrib(device,attrib,_ODEV_ATTRIB_INT_CHECK(attrib,def))
#endif /* _XORG_CONFIG_H_ */
extern void xf86platformVTProbe(void);
extern void xf86platformPrimary(void);
#else /* XSERVER_PLATFORM_BUS */
static inline int xf86platformAddGPUDevices(DriverPtr drvp) { return FALSE; }
static inline void xf86MergeOutputClassOptions(int index, void **options) {}
#endif /* XSERVER_PLATFORM_BUS */
#endif /* _XSERVER_XF86_PLATFORM_BUS_PRIV_H_ */

View File

@ -40,21 +40,8 @@
#define SBUS_DEVICE_GT 0x000c #define SBUS_DEVICE_GT 0x000c
#define SBUS_DEVICE_MGX 0x000d #define SBUS_DEVICE_MGX 0x000d
typedef struct sbus_prom_node { typedef struct sbus_prom_node *sbusPromNodePtr;
int node; typedef struct sbus_device *sbusDevicePtr;
/* Because of misdesigned openpromio */
int cookie[2];
} sbusPromNode, *sbusPromNodePtr;
typedef struct sbus_device {
int devId;
int fbNum;
int fd;
int width, height;
sbusPromNode node;
const char *descr;
const char *device;
} sbusDevice, *sbusDevicePtr;
struct sbus_devtable { struct sbus_devtable {
int devId; int devId;
@ -104,8 +91,4 @@ extern _X_EXPORT char *sparcPromNode2Pathname(sbusPromNodePtr pnode);
extern _X_EXPORT int sparcPromPathname2Node(const char *pathName); extern _X_EXPORT int sparcPromPathname2Node(const char *pathName);
extern _X_EXPORT char *sparcDriverName(void); extern _X_EXPORT char *sparcDriverName(void);
extern Bool xf86SbusConfigure(void *busData, sbusDevicePtr sBus);
extern void xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus,
GDevRec * GDev);
#endif /* _XF86_SBUSBUS_H */ #endif /* _XF86_SBUSBUS_H */

View File

@ -0,0 +1,32 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
* Copyright © 2000 Jakub Jelinek (jakub@redhat.com)
*/
#ifndef _XSERVER_XF86_SBUSBUS_H
#define _XSERVER_XF86_SBUSBUS_H
#include <X11/Xdefs.h>
#include "xf86sbusBus.h"
typedef struct sbus_prom_node {
int node;
/* Because of misdesigned openpromio */
int cookie[2];
} sbusPromNode, *sbusPromNodePtr;
typedef struct sbus_device {
int devId;
int fbNum;
int fd;
int width, height;
sbusPromNode node;
const char *descr;
const char *device;
} sbusDevice, *sbusDevicePtr;
Bool xf86SbusConfigure(void *busData, sbusDevicePtr sBus);
void xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec* GDev);
#endif /* _XSERVER_XF86_SBUSBUS_H */

View File

@ -32,7 +32,7 @@
#include "xf86.h" #include "xf86.h"
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
#define _PARSE_EDID_ #define _PARSE_EDID_
#include "xf86DDC.h" #include "xf86DDC_priv.h"
#include <string.h> #include <string.h>
static void get_vendor_section(Uchar *, struct vendor *); static void get_vendor_section(Uchar *, struct vendor *);

View File

@ -34,7 +34,7 @@
#include "misc.h" #include "misc.h"
#include "xf86.h" #include "xf86.h"
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
#include "xf86DDC.h" #include "xf86DDC_priv.h"
#include "edid.h" #include "edid.h"
#define EDID_WIDTH 16 #define EDID_WIDTH 16

View File

@ -56,46 +56,4 @@ FindDMTMode(int hsize, int vsize, int refresh, Bool rb);
extern _X_EXPORT const DisplayModeRec DMTModes[]; extern _X_EXPORT const DisplayModeRec DMTModes[];
/*
* Quirks to work around broken EDID data from various monitors.
*/
typedef enum {
DDC_QUIRK_NONE = 0,
/* First detailed mode is bogus, prefer largest mode at 60hz */
DDC_QUIRK_PREFER_LARGE_60 = 1 << 0,
/* 135MHz clock is too high, drop a bit */
DDC_QUIRK_135_CLOCK_TOO_HIGH = 1 << 1,
/* Prefer the largest mode at 75 Hz */
DDC_QUIRK_PREFER_LARGE_75 = 1 << 2,
/* Convert detailed timing's horizontal from units of cm to mm */
DDC_QUIRK_DETAILED_H_IN_CM = 1 << 3,
/* Convert detailed timing's vertical from units of cm to mm */
DDC_QUIRK_DETAILED_V_IN_CM = 1 << 4,
/* Detailed timing descriptors have bogus size values, so just take the
* maximum size and use that.
*/
DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1 << 5,
/* Monitor forgot to set the first detailed is preferred bit. */
DDC_QUIRK_FIRST_DETAILED_PREFERRED = 1 << 6,
/* use +hsync +vsync for detailed mode */
DDC_QUIRK_DETAILED_SYNC_PP = 1 << 7,
/* Force single-link DVI bandwidth limit */
DDC_QUIRK_DVI_SINGLE_LINK = 1 << 8,
} ddc_quirk_t;
typedef void (*handle_detailed_fn) (struct detailed_monitor_section *, void *);
void xf86ForEachDetailedBlock(xf86MonPtr mon, handle_detailed_fn, void *data);
ddc_quirk_t xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose);
void xf86DetTimingApplyQuirks(struct detailed_monitor_section *det_mon,
ddc_quirk_t quirks, int hsize, int vsize);
typedef void (*handle_video_fn) (struct cea_video_block *, void *);
void xf86ForEachVideoBlock(xf86MonPtr, handle_video_fn, void *);
struct cea_data_block *xf86MonitorFindHDMIBlock(xf86MonPtr mon);
#endif #endif

View File

@ -0,0 +1,53 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
* Copyright © 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
*/
#ifndef _XSERVER_XF86_DDC_PRIV_H
#define _XSERVER_XF86_DDC_PRIV_H
#include "xf86DDC.h"
/*
* Quirks to work around broken EDID data from various monitors.
*/
typedef enum {
DDC_QUIRK_NONE = 0,
/* First detailed mode is bogus, prefer largest mode at 60hz */
DDC_QUIRK_PREFER_LARGE_60 = 1 << 0,
/* 135MHz clock is too high, drop a bit */
DDC_QUIRK_135_CLOCK_TOO_HIGH = 1 << 1,
/* Prefer the largest mode at 75 Hz */
DDC_QUIRK_PREFER_LARGE_75 = 1 << 2,
/* Convert detailed timing's horizontal from units of cm to mm */
DDC_QUIRK_DETAILED_H_IN_CM = 1 << 3,
/* Convert detailed timing's vertical from units of cm to mm */
DDC_QUIRK_DETAILED_V_IN_CM = 1 << 4,
/* Detailed timing descriptors have bogus size values, so just take the
* maximum size and use that.
*/
DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1 << 5,
/* Monitor forgot to set the first detailed is preferred bit. */
DDC_QUIRK_FIRST_DETAILED_PREFERRED = 1 << 6,
/* use +hsync +vsync for detailed mode */
DDC_QUIRK_DETAILED_SYNC_PP = 1 << 7,
/* Force single-link DVI bandwidth limit */
DDC_QUIRK_DVI_SINGLE_LINK = 1 << 8,
} ddc_quirk_t;
typedef void (*handle_detailed_fn) (struct detailed_monitor_section *, void *);
void xf86ForEachDetailedBlock(xf86MonPtr mon, handle_detailed_fn, void *data);
ddc_quirk_t xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose);
void xf86DetTimingApplyQuirks(struct detailed_monitor_section *det_mon,
ddc_quirk_t quirks, int hsize, int vsize);
typedef void (*handle_video_fn) (struct cea_video_block *, void *);
void xf86ForEachVideoBlock(xf86MonPtr, handle_video_fn, void *);
struct cea_data_block *xf86MonitorFindHDMIBlock(xf86MonPtr mon);
#endif /* _XSERVER_XF86_DDC_PRIV_H */

View File

@ -61,7 +61,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/dri/xf86driproto.h> #include <X11/dri/xf86driproto.h>
#include "swaprep.h" #include "swaprep.h"
#include "xf86str.h" #include "xf86str.h"
#include "dri.h" #include "dri_priv.h"
#include "sarea.h" #include "sarea.h"
#include "dristruct.h" #include "dristruct.h"
#include "mi.h" #include "mi.h"

View File

@ -195,8 +195,6 @@ extern _X_EXPORT Bool DRIScreenInit(ScreenPtr pScreen,
extern _X_EXPORT void DRICloseScreen(ScreenPtr pScreen); extern _X_EXPORT void DRICloseScreen(ScreenPtr pScreen);
extern Bool DRIExtensionInit(void);
extern _X_EXPORT void DRIReset(void); extern _X_EXPORT void DRIReset(void);
extern _X_EXPORT Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen, extern _X_EXPORT Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,

12
hw/xfree86/dri/dri_priv.h Normal file
View File

@ -0,0 +1,12 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER_DRI_PRIV_H
#define _XSERVER_DRI_PRIV_H
#include "dri.h"
extern Bool DRIExtensionInit(void);
#endif /* _XSERVER_DRI_PRIV_H */

View File

@ -56,7 +56,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/dri/xf86driproto.h> #include <X11/dri/xf86driproto.h>
#include "swaprep.h" #include "swaprep.h"
#include "xf86str.h" #include "xf86str.h"
#include "dri.h" #include "dri_priv.h"
#include "sarea.h" #include "sarea.h"
#include "dristruct.h" #include "dristruct.h"
#include "xf86drm.h" #include "xf86drm.h"

View File

@ -42,7 +42,7 @@
#include "scrnintstr.h" #include "scrnintstr.h"
#include "windowstr.h" #include "windowstr.h"
#include "dixstruct.h" #include "dixstruct.h"
#include "dri2.h" #include "dri2_priv.h"
#include "dri2int.h" #include "dri2int.h"
#include "damage.h" #include "damage.h"
#include "xf86.h" #include "xf86.h"

View File

@ -46,9 +46,6 @@ typedef struct {
void *driverPrivate; void *driverPrivate;
} DRI2BufferRec, *DRI2BufferPtr; } DRI2BufferRec, *DRI2BufferPtr;
extern CARD8 dri2_major; /* version of DRI2 supported by DDX */
extern CARD8 dri2_minor;
typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr; typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr;
typedef void (*DRI2SwapEventPtr) (ClientPtr client, void *data, int type, typedef void (*DRI2SwapEventPtr) (ClientPtr client, void *data, int type,
CARD64 ust, CARD64 msc, CARD32 sbc); CARD64 ust, CARD64 msc, CARD32 sbc);

View File

@ -0,0 +1,13 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER_DRI2_PRIV_H_
#define _XSERVER_DRI2_PRIV_H_
#include "dri2.h"
extern CARD8 dri2_major; /* version of DRI2 supported by DDX */
extern CARD8 dri2_minor;
#endif /* _XSERVER_DRI2_PRIV_H_ */

View File

@ -43,7 +43,7 @@
#include "pixmapstr.h" #include "pixmapstr.h"
#include "extnsionst.h" #include "extnsionst.h"
#include "xfixes.h" #include "xfixes.h"
#include "dri2.h" #include "dri2_priv.h"
#include "dri2int.h" #include "dri2int.h"
#include "protocol-versions.h" #include "protocol-versions.h"

View File

@ -63,6 +63,7 @@
#include <pciaccess.h> #include <pciaccess.h>
#endif #endif
#include "driver.h" #include "driver.h"
#include "xf86platformBus_priv.h"
static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y); static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y);
static Bool CloseScreen(ScreenPtr pScreen); static Bool CloseScreen(ScreenPtr pScreen);

View File

@ -14,7 +14,7 @@
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
#include "compiler.h" #include "compiler.h"
#define _INT10_PRIVATE #define _INT10_PRIVATE
#include "xf86int10.h" #include "xf86int10_priv.h"
#include "int10Defines.h" #include "int10Defines.h"
#include "Pci.h" #include "Pci.h"

View File

@ -28,7 +28,7 @@
#include "compiler.h" #include "compiler.h"
#define _INT10_PRIVATE #define _INT10_PRIVATE
#include "int10Defines.h" #include "int10Defines.h"
#include "xf86int10.h" #include "xf86int10_priv.h"
#include "Pci.h" #include "Pci.h"
#ifdef _X86EMU #ifdef _X86EMU
#include "x86emu/x86emui.h" #include "x86emu/x86emui.h"

View File

@ -18,7 +18,7 @@
#if 0 #if 0
#include "int10Defines.h" #include "int10Defines.h"
#endif #endif
#include "xf86int10.h" #include "xf86int10_priv.h"
#define REG pInt #define REG pInt

View File

@ -11,7 +11,7 @@
#include "xf86.h" #include "xf86.h"
#include "compiler.h" #include "compiler.h"
#define _INT10_PRIVATE #define _INT10_PRIVATE
#include "xf86int10.h" #include "xf86int10_priv.h"
#include "int10Defines.h" #include "int10Defines.h"
#include "Pci.h" #include "Pci.h"

View File

@ -122,70 +122,18 @@ extern _X_EXPORT Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
/* int.c */ /* int.c */
extern _X_EXPORT xf86Int10InfoPtr Int10Current; extern _X_EXPORT xf86Int10InfoPtr Int10Current;
int int_handler(xf86Int10InfoPtr pInt);
/* helper_exec.c */
int setup_int(xf86Int10InfoPtr pInt);
void finish_int(xf86Int10InfoPtr, int sig);
uint32_t getIntVect(xf86Int10InfoPtr pInt, int num);
void pushw(xf86Int10InfoPtr pInt, uint16_t val);
int run_bios_int(int num, xf86Int10InfoPtr pInt);
void dump_code(xf86Int10InfoPtr pInt);
void dump_registers(xf86Int10InfoPtr pInt);
void stack_trace(xf86Int10InfoPtr pInt);
uint8_t bios_checksum(const uint8_t *start, int size);
void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
#if defined (_PC) #if defined (_PC)
extern _X_EXPORT void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, extern _X_EXPORT void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt,
Bool save); Bool save);
#endif #endif
int port_rep_inb(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
int port_rep_inw(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
int port_rep_inl(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
int port_rep_outb(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
int port_rep_outw(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
int port_rep_outl(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
uint8_t x_inb(uint16_t port);
uint16_t x_inw(uint16_t port);
void x_outb(uint16_t port, uint8_t val);
void x_outw(uint16_t port, uint16_t val);
uint32_t x_inl(uint16_t port);
void x_outl(uint16_t port, uint32_t val);
uint8_t Mem_rb(uint32_t addr);
uint16_t Mem_rw(uint32_t addr);
uint32_t Mem_rl(uint32_t addr);
void Mem_wb(uint32_t addr, uint8_t val);
void Mem_ww(uint32_t addr, uint16_t val);
void Mem_wl(uint32_t addr, uint32_t val);
/* helper_mem.c */
void setup_int_vect(xf86Int10InfoPtr pInt);
int setup_system_bios(void *base_addr);
void reset_int_vect(xf86Int10InfoPtr pInt);
void set_return_trap(xf86Int10InfoPtr pInt);
extern _X_EXPORT void *xf86HandleInt10Options(ScrnInfoPtr pScrn, extern _X_EXPORT void *xf86HandleInt10Options(ScrnInfoPtr pScrn,
int entityIndex); int entityIndex);
Bool int10skip(const void *options);
Bool int10_check_bios(int scrnIndex, int codeSeg,
const unsigned char *vbiosMem);
Bool initPrimary(const void *options);
extern _X_EXPORT BusType xf86int10GetBiosLocationType(const xf86Int10InfoPtr extern _X_EXPORT BusType xf86int10GetBiosLocationType(const xf86Int10InfoPtr
pInt); pInt);
extern _X_EXPORT Bool xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, extern _X_EXPORT Bool xf86int10GetBiosSegment(xf86Int10InfoPtr pInt,
void *base); void *base);
#ifdef DEBUG
void dprint(unsigned long start, unsigned long size);
#endif
#endif /* _INT10_PRIVATE */ #endif /* _INT10_PRIVATE */
#endif /* _XF86INT10_H */ #endif /* _XF86INT10_H */

View File

@ -0,0 +1,77 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
* Copyright © 1999 Egbert Eich
*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
*/
#ifndef _XSERVER_XF86INT10_H
#define _XSERVER_XF86INT10_H
#include <X11/Xmd.h>
#include <X11/Xdefs.h>
#include "xf86Pci.h"
#include "xf86int10.h"
#ifdef _INT10_PRIVATE
/* int.c */
int int_handler(xf86Int10InfoPtr pInt);
/* helper_exec.c */
int setup_int(xf86Int10InfoPtr pInt);
void finish_int(xf86Int10InfoPtr, int sig);
uint32_t getIntVect(xf86Int10InfoPtr pInt, int num);
void pushw(xf86Int10InfoPtr pInt, uint16_t val);
int run_bios_int(int num, xf86Int10InfoPtr pInt);
void dump_code(xf86Int10InfoPtr pInt);
void dump_registers(xf86Int10InfoPtr pInt);
void stack_trace(xf86Int10InfoPtr pInt);
uint8_t bios_checksum(const uint8_t *start, int size);
void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
int port_rep_inb(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
int port_rep_inw(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
int port_rep_inl(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
int port_rep_outb(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
int port_rep_outw(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
int port_rep_outl(xf86Int10InfoPtr pInt,
uint16_t port, uint32_t base, int d_f, uint32_t count);
uint8_t x_inb(uint16_t port);
uint16_t x_inw(uint16_t port);
void x_outb(uint16_t port, uint8_t val);
void x_outw(uint16_t port, uint16_t val);
uint32_t x_inl(uint16_t port);
void x_outl(uint16_t port, uint32_t val);
uint8_t Mem_rb(uint32_t addr);
uint16_t Mem_rw(uint32_t addr);
uint32_t Mem_rl(uint32_t addr);
void Mem_wb(uint32_t addr, uint8_t val);
void Mem_ww(uint32_t addr, uint16_t val);
void Mem_wl(uint32_t addr, uint32_t val);
/* helper_mem.c */
void setup_int_vect(xf86Int10InfoPtr pInt);
int setup_system_bios(void *base_addr);
void reset_int_vect(xf86Int10InfoPtr pInt);
void set_return_trap(xf86Int10InfoPtr pInt);
Bool int10skip(const void *options);
Bool int10_check_bios(int scrnIndex, int codeSeg,
const unsigned char *vbiosMem);
Bool initPrimary(const void *options);
#ifdef DEBUG
void dprint(unsigned long start, unsigned long size);
#endif
#endif /* _INT10_PRIVATE */
#endif /* _XSERVER_XF86INT10_H */

View File

@ -11,7 +11,7 @@
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
#include "xf86Pci.h" #include "xf86Pci.h"
#define _INT10_PRIVATE #define _INT10_PRIVATE
#include "xf86int10.h" #include "xf86int10_priv.h"
#include "int10Defines.h" #include "int10Defines.h"
#include <x86emu.h> #include <x86emu.h>

View File

@ -30,7 +30,7 @@
#include <stdio.h> #include <stdio.h>
#include "xf86.h" #include "xf86.h"
#include "xf86DDC.h" #include "xf86DDC_priv.h"
#include "xf86Crtc.h" #include "xf86Crtc.h"
#include "xf86Modes.h" #include "xf86Modes.h"
#include "xf86Priv.h" #include "xf86Priv.h"

View File

@ -33,7 +33,7 @@
#define _PARSE_EDID_ #define _PARSE_EDID_
#include "xf86.h" #include "xf86.h"
#include "xf86DDC.h" #include "xf86DDC_priv.h"
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include "property.h" #include "property.h"
#include "propertyst.h" #include "propertyst.h"

View File

@ -38,7 +38,7 @@
#include "xf86cmap.h" #include "xf86cmap.h"
#include "xf86Crtc.h" #include "xf86Crtc.h"
#include "xf86RandR12.h" #include "xf86RandR12_priv.h"
typedef struct _xf86RandR12Info { typedef struct _xf86RandR12Info {
int virtualX; int virtualX;

View File

@ -40,9 +40,4 @@ extern _X_EXPORT void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn,
extern _X_EXPORT Bool xf86RandR12PreInit(ScrnInfoPtr pScrn); extern _X_EXPORT Bool xf86RandR12PreInit(ScrnInfoPtr pScrn);
extern _X_EXPORT void xf86RandR12TellChanged(ScreenPtr pScreen); extern _X_EXPORT void xf86RandR12TellChanged(ScreenPtr pScreen);
extern void xf86RandR12LoadPalette(ScrnInfoPtr pScrn, int numColors,
int *indices, LOCO *colors,
VisualPtr pVisual);
extern Bool xf86RandR12InitGamma(ScrnInfoPtr pScrn, unsigned gammaSize);
#endif /* _XF86_RANDR_H_ */ #endif /* _XF86_RANDR_H_ */

View File

@ -0,0 +1,18 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER_XF86RANDR12_PRIV_H_
#define _XSERVER_XF86RANDR12_PRIV_H_
#include <X11/extensions/render.h>
#include "randrstr.h"
#include "xf86RandR12.h"
void xf86RandR12LoadPalette(ScrnInfoPtr pScrn, int numColors,
int *indices, LOCO *colors,
VisualPtr pVisual);
Bool xf86RandR12InitGamma(ScrnInfoPtr pScrn, unsigned gammaSize);
#endif /* _XSERVER_XF86RANDR12_PRIV_H_ */

View File

@ -36,8 +36,8 @@
#include "dbus-core.h" #include "dbus-core.h"
#include "linux.h" #include "linux.h"
#include "xf86.h" #include "xf86.h"
#include "xf86platformBus.h" #include "xf86platformBus_priv.h"
#include "xf86Xinput.h" #include "xf86Xinput_priv.h"
#include "xf86Priv.h" #include "xf86Priv.h"
#include "globals.h" #include "globals.h"

View File

@ -14,10 +14,11 @@
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
#include "xf86.h" #include "xf86.h"
#include "xf86platformBus.h" #include "xf86platformBus_priv.h"
#include "xf86Bus.h" #include "xf86Bus.h"
#include "hotplug.h" #include "hotplug.h"
#include "xf86OSpriv.h"
#include "systemd-logind.h" #include "systemd-logind.h"
static Bool static Bool

View File

@ -38,4 +38,16 @@ typedef struct {
void xf86OSInitVidMem(VidMemInfoPtr); void xf86OSInitVidMem(VidMemInfoPtr);
#ifdef XSERVER_PLATFORM_BUS
struct OdevAttributes;
#include "hotplug.h"
void
xf86PlatformDeviceProbe(struct OdevAttributes *attribs);
void
xf86PlatformReprobeDevice(int index, struct OdevAttributes *attribs);
#endif
#endif /* _XF86OSPRIV_H */ #endif /* _XF86OSPRIV_H */

View File

@ -188,15 +188,6 @@ extern _X_EXPORT void xf86InitVidMem(void);
#endif /* XF86_OS_PRIVS */ #endif /* XF86_OS_PRIVS */
#ifdef XSERVER_PLATFORM_BUS
#include "hotplug.h"
void
xf86PlatformDeviceProbe(struct OdevAttributes *attribs);
void
xf86PlatformReprobeDevice(int index, struct OdevAttributes *attribs);
#endif
_XFUNCPROTOEND _XFUNCPROTOEND
#endif /* NO_OSLIB_PROTOTYPES */ #endif /* NO_OSLIB_PROTOTYPES */
#endif /* _XF86_OSPROC_H */ #endif /* _XF86_OSPROC_H */

View File

@ -56,7 +56,7 @@
#include <xorg-config.h> #include <xorg-config.h>
#endif #endif
#include "xf86Parser.h" #include "xf86Parser_priv.h"
#include "xf86tokens.h" #include "xf86tokens.h"
#include "Configint.h" #include "Configint.h"
#include <string.h> #include <string.h>

View File

@ -57,7 +57,7 @@
#endif #endif
#include "xf86Config.h" #include "xf86Config.h"
#include "xf86Parser.h" #include "xf86Parser_priv.h"
#include "xf86tokens.h" #include "xf86tokens.h"
#include "Configint.h" #include "Configint.h"

View File

@ -66,6 +66,7 @@
#include <X11/Xdefs.h> #include <X11/Xdefs.h>
#include <X11/Xfuncproto.h> #include <X11/Xfuncproto.h>
#include <limits.h> #include <limits.h>
#include "xf86Parser_priv.h"
#if !defined(MAXHOSTNAMELEN) #if !defined(MAXHOSTNAMELEN)
#define MAXHOSTNAMELEN 32 #define MAXHOSTNAMELEN 32

View File

@ -56,7 +56,7 @@
#endif #endif
#include "os.h" #include "os.h"
#include "xf86Parser.h" #include "xf86Parser_priv.h"
#include "xf86tokens.h" #include "xf86tokens.h"
#include "Configint.h" #include "Configint.h"
@ -65,10 +65,6 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <errno.h> #include <errno.h>
#if defined(WIN32)
#define HAS_NO_UIDS
#endif
static int static int
doWriteConfigFile(const char *filename, XF86ConfigPtr cptr) doWriteConfigFile(const char *filename, XF86ConfigPtr cptr)
{ {
@ -126,7 +122,7 @@ doWriteConfigFile(const char *filename, XF86ConfigPtr cptr)
int int
xf86writeConfigFile(const char *filename, XF86ConfigPtr cptr) xf86writeConfigFile(const char *filename, XF86ConfigPtr cptr)
{ {
#ifndef HAS_NO_UIDS #ifndef WIN32
int ret; int ret;
if (getuid() != geteuid()) { if (getuid() != geteuid()) {
@ -149,6 +145,6 @@ xf86writeConfigFile(const char *filename, XF86ConfigPtr cptr)
return ret; return ret;
} }
else else
#endif /* !HAS_NO_UIDS */ #endif /* WIN32 */
return doWriteConfigFile(filename, cptr); return doWriteConfigFile(filename, cptr);
} }

View File

@ -442,17 +442,6 @@ typedef struct {
/* /*
* prototypes for public functions * prototypes for public functions
*/ */
extern void xf86initConfigFiles(void);
extern char *xf86openConfigFile(const char *path, const char *cmdline,
const char *projroot);
extern char *xf86openConfigDirFiles(const char *path, const char *cmdline,
const char *projroot);
extern void xf86setBuiltinConfig(const char *config[]);
extern XF86ConfigPtr xf86readConfigFile(void);
extern void xf86closeConfigFile(void);
extern XF86ConfigPtr xf86allocateConfig(void);
extern void xf86freeConfig(XF86ConfigPtr p);
extern int xf86writeConfigFile(const char *, XF86ConfigPtr);
extern _X_EXPORT XF86ConfDevicePtr xf86findDevice(const char *ident, extern _X_EXPORT XF86ConfDevicePtr xf86findDevice(const char *ident,
XF86ConfDevicePtr p); XF86ConfDevicePtr p);
extern _X_EXPORT XF86ConfLayoutPtr xf86findLayout(const char *name, extern _X_EXPORT XF86ConfLayoutPtr xf86findLayout(const char *name,
@ -472,14 +461,10 @@ extern _X_EXPORT XF86ConfInputPtr xf86findInputByDriver(const char *driver,
extern _X_EXPORT XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident, extern _X_EXPORT XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident,
XF86ConfVideoAdaptorPtr XF86ConfVideoAdaptorPtr
p); p);
extern int xf86layoutAddInputDevices(XF86ConfigPtr config,
XF86ConfLayoutPtr layout);
extern _X_EXPORT GenericListPtr xf86addListItem(GenericListPtr head, extern _X_EXPORT GenericListPtr xf86addListItem(GenericListPtr head,
GenericListPtr c_new); GenericListPtr c_new);
extern _X_EXPORT int xf86itemNotSublist(GenericListPtr list_1, extern _X_EXPORT int xf86itemNotSublist(GenericListPtr list_1,
GenericListPtr list_2); GenericListPtr list_2);
extern _X_EXPORT int xf86pathIsAbsolute(const char *path); extern _X_EXPORT int xf86pathIsAbsolute(const char *path);
extern _X_EXPORT int xf86pathIsSafe(const char *path); extern _X_EXPORT int xf86pathIsSafe(const char *path);
extern _X_EXPORT char *xf86addComment(char *cur, const char *add); extern _X_EXPORT char *xf86addComment(char *cur, const char *add);

View File

@ -0,0 +1,26 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
* Copyright © 1997 Metro Link Incorporated
*/
#ifndef _XSERVER_XF86_PARSER_PRIV
#define _XSERVER_XF86_PARSER_PRIV
#include "xf86Parser.h"
void xf86initConfigFiles(void);
char *xf86openConfigFile(const char *path,
const char *cmdline,
const char *projroot);
char *xf86openConfigDirFiles(const char *path,
const char *cmdline,
const char *projroot);
void xf86setBuiltinConfig(const char *config[]);
XF86ConfigPtr xf86readConfigFile(void);
void xf86closeConfigFile(void);
XF86ConfigPtr xf86allocateConfig(void);
void xf86freeConfig(XF86ConfigPtr p);
int xf86writeConfigFile(const char *filename, XF86ConfigPtr cptr);
int xf86layoutAddInputDevices(XF86ConfigPtr config, XF86ConfLayoutPtr layout);
#endif /* _XSERVER_XF86_PARSER_PRIV */