From ba7d036718e63071a8272efc63e53a99c771acfb Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 22 Feb 2024 17:32:26 +0100 Subject: [PATCH] (submit/unexport-ddx-callbacks) os: unexport ddx callbacks The DDX callbacks (where core/DIX calls into DDX) aren't supposed to be called by drivers directly, so unexport them. Signed-off-by: Enrico Weigelt, metux IT consult --- dix/dispatch.c | 1 + dix/main.c | 1 + hw/kdrive/ephyr/ephyrinit.c | 1 + hw/vfb/InitOutput.c | 1 + hw/xfree86/common/xf86Configure.c | 1 + hw/xnest/Args.c | 1 + hw/xnest/Init.c | 1 + hw/xquartz/darwin.c | 1 + hw/xwayland/xwayland.c | 1 + hw/xwin/winprocarg.c | 1 + meson.build | 1 + os/ddx.h | 27 +++++++++++++++++++++++++++ os/log.c | 1 + os/utils.c | 1 + 14 files changed, 40 insertions(+) create mode 100644 os/ddx.h diff --git a/dix/dispatch.c b/dix/dispatch.c index 6d0bc6c6f..0a6168f6c 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -120,6 +120,7 @@ Equipment Corporation. #include "os/screensaver.h" #include "windowstr.h" +#include "ddx.h" #include "dixfontstr.h" #include "gcstruct.h" #include "colormapst.h" diff --git a/dix/main.c b/dix/main.c index 0fb762071..2d6735add 100644 --- a/dix/main.c +++ b/dix/main.c @@ -112,6 +112,7 @@ Equipment Corporation. #include "colormapst.h" #include "cursorstr.h" #include "servermd.h" +#include "ddx.h" #include "dixfont.h" #include "extnsionst.h" #include "privates.h" diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 9306f3367..742f98ac1 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -30,6 +30,7 @@ #include "os/ddx_priv.h" #include "os/osdep.h" +#include "ddx.h" #include "ephyr.h" #include "ephyrlog.h" #include "glx_extinit.h" diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 4a448a5ae..d5ef77e18 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -69,6 +69,7 @@ from The Open Group. #include #include #endif /* MITSHM */ +#include "ddx.h" #include "dix.h" #include "miline.h" #include "glx_extinit.h" diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index 923b73516..75032b642 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -32,6 +32,7 @@ #include "os/ddx_priv.h" #include "os/osdep.h" +#include "ddx.h" #include "xf86.h" #include "xf86Config.h" #include "xf86_OSlib.h" diff --git a/hw/xnest/Args.c b/hw/xnest/Args.c index 8f448babb..c83666c4e 100644 --- a/hw/xnest/Args.c +++ b/hw/xnest/Args.c @@ -25,6 +25,7 @@ is" without express or implied warranty. #include "misc.h" #include "scrnintstr.h" #include "servermd.h" +#include "ddx.h" #include "xnest-xcb.h" diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c index ccd663903..f5f9dd886 100644 --- a/hw/xnest/Init.c +++ b/hw/xnest/Init.c @@ -25,6 +25,7 @@ is" without express or implied warranty. #include "os/ddx_priv.h" #include "os/osdep.h" +#include "ddx.h" #include "screenint.h" #include "input.h" #include "misc.h" diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index caadd8944..f2f30d2d0 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -46,6 +46,7 @@ #include "micmap.h" // mi colormap code #include "fb.h" // fb framebuffer code #include "globals.h" +#include "ddx.h" #include "dix.h" #include "xkbsrv.h" diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 427ccf3f1..889452c22 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -51,6 +51,7 @@ #include #include #include +#include "ddx.h" #include #include diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index 4f753982f..d32c705cf 100644 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -47,6 +47,7 @@ from The Open Group. #include "winprefs.h" #include "winclipboard/winclipboard.h" +#include "ddx.h" /* * Function prototypes diff --git a/meson.build b/meson.build index 77b2f64b4..50dd72c91 100644 --- a/meson.build +++ b/meson.build @@ -654,6 +654,7 @@ inc = include_directories( 'dix', 'dri3', 'include', + 'os', 'present', 'randr', 'render', diff --git a/os/ddx.h b/os/ddx.h new file mode 100644 index 000000000..1f90e099d --- /dev/null +++ b/os/ddx.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: MIT OR X11 + * + * Copyright © 2024 Enrico Weigelt, metux IT consult + */ +#ifndef _XSERVER_OS_DDX_H +#define _XSERVER_OS_DDX_H + +#include "os.h" + +/* callbacks of the DDX, which are called by DIX or OS layer. + DDX's need to implement these in order to handle DDX specific things. +*/ + +/* called before server reset */ +void ddxBeforeReset(void); + +/* called by ProcessCommandLine, so DDX can catch cmdline args */ +int ddxProcessArgument(int argc, char *argv[], int i); + +/* print DDX specific usage message */ +void ddxUseMsg(void); + +void ddxGiveUp(enum ExitCode error); + +void ddxInputThreadInit(void); + +#endif /* _XSERVER_OS_DDX_H */ diff --git a/os/log.c b/os/log.c index 281e3a384..28833d642 100644 --- a/os/log.c +++ b/os/log.c @@ -96,6 +96,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #include "os/osdep.h" #include "opaque.h" +#include "ddx.h" #ifdef XF86BIGFONT #include "xf86bigfontsrv.h" diff --git a/os/utils.c b/os/utils.c index de49e2b35..e945560b0 100644 --- a/os/utils.c +++ b/os/utils.c @@ -116,6 +116,7 @@ __stdcall unsigned long GetTickCount(void); #include "xkbsrv.h" #include "picture.h" #include "miinitext.h" +#include "ddx.h" #include "present.h" #include "dixstruct_priv.h" #include "dpmsproc.h"