Skip to content
Commits on Source (5)
  • Jan Beich's avatar
    os: unbreak xsha1 on FreeBSD · f2cf236d
    Jan Beich authored
    ../os/xsha1.c:36:10: fatal error: 'sha1.h' file not found
     #include <sha1.h>
              ^~~~~~~~
    ../os/xsha1.c:45:5: error: implicit declaration of function 'SHA1Init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        SHA1Init(ctx);
        ^
    ../os/xsha1.c:54:5: error: implicit declaration of function 'SHA1Update' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        SHA1Update(sha1_ctx, data, size);
        ^
    ../os/xsha1.c:63:5: error: implicit declaration of function 'SHA1Final' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        SHA1Final(result, sha1_ctx);
        ^
    f2cf236d
  • Jan Beich's avatar
    glx: unbreak on Unix without /usr/include/drm · be731e0b
    Jan Beich authored
    In file included from ../glx/glxdri2.c:35:
    /usr/local/include/GL/internal/dri_interface.h:43:10: fatal error: 'drm.h' file not found
     #include <drm.h>
              ^~~~~~~
    In file included from ../glx/glxdriswrast.c:39:
    /usr/local/include/GL/internal/dri_interface.h:43:10: fatal error: 'drm.h' file not found
     #include <drm.h>
              ^~~~~~~
    be731e0b
  • Jan Beich's avatar
    meson: split udev from udev_kms which requires systemd · b5b52979
    Jan Beich authored
    DragonFly and FreeBSD can use xf86-input-libinput with config/udev.
    
    ld: error: undefined symbol: xf86PlatformDeviceProbe
    >>> referenced by xf86platformBus.c
    >>>               xf86platformBus.c.o:(xf86platformProbe) in archive hw/xfree86/common/libxorg_common.a
    
    ld: error: undefined symbol: xf86PlatformDeviceCheckBusID
    >>> referenced by xf86platformBus.c
    >>>               xf86platformBus.c.o:(xf86platformProbeDev) in archive hw/xfree86/common/libxorg_common.a
    
    ld: error: undefined symbol: xf86PlatformReprobeDevice
    >>> referenced by xf86platformBus.c
    >>>               xf86platformBus.c.o:(xf86platformVTProbe) in archive hw/xfree86/common/libxorg_common.a
    
    ld: error: undefined symbol: NewGPUDeviceRequest
    >>> referenced by udev.c
    >>>               udev.c.o:(device_added) in archive config/liblibxserver_config.a
    
    ld: error: undefined symbol: DeleteGPUDeviceRequest
    >>> referenced by udev.c
    >>>               udev.c.o:(device_removed) in archive config/liblibxserver_config.a
    b5b52979
  • Matthieu Herrb's avatar
    Remove BSD APM support. · 5dc16f6f
    Matthieu Herrb authored
    
    
    None of the current BSD is actually using this code.
    (checked DragonFly 5.8.1, FreeBSD 11.2, NetBSD 9.0 and OpenBSD 6.7)
    
    Signed-off-by: default avatarMatthieu Herrb <matthieu@herrb.eu>
    5dc16f6f
  • Adam Jackson's avatar
    xwayland: Set the vendor name for GLX_EXT_libglvnd · fc4f2485
    Adam Jackson authored
    Without this the client library will flail around looking for a default
    provider, probably one named "indirect", and that defeats the point of
    having the EGL provider for direct context support in the first place.
    
    This assumes that "mesa" will work, of course, and in general it should.
    Mesa drivers will DTRT through the DRI3 setup path, and if our glamor is
    atop something non-Mesa then you should fall back to llvmpipe like 1.20.
    In the future it might be useful to differentiate the vendor here based
    on whether glamor is using gbm or streams.
    
    Fixes: xorg/xserver#1032
    fc4f2485
......@@ -237,15 +237,6 @@ dnl OpenBSD /dev/xf86 aperture driver
if test -c /dev/xf86 ; then
AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver])
fi
dnl BSD APM support
AC_CHECK_HEADER([machine/apmvar.h],[
AC_CHECK_HEADER([sys/event.h],
ac_cv_BSD_KQUEUE_APM=yes,
ac_cv_BSD_APM=yes)])
AM_CONDITIONAL(BSD_APM, [test "x$ac_cv_BSD_APM" = xyes])
AM_CONDITIONAL(BSD_KQUEUE_APM, [test "x$ac_cv_BSD_KQUEUE_APM" = xyes])
dnl glibc backtrace support check
AC_CHECK_HEADER([execinfo.h],[
......
......@@ -38,6 +38,7 @@ if build_glx
dependencies: [
common_dep,
dl_dep,
dri_dep,
dependency('glproto', version: '>= 1.4.17'),
dependency('gl', version: '>= 1.2'),
],
......
......@@ -33,7 +33,7 @@ if build_glx
include_directories: [ inc, xorg_inc, glx_inc ],
c_args: [ xorg_c_args, glx_align64 ],
dependencies: [ common_dep, dl_dep ],
dependencies: [ common_dep, dl_dep, dri_dep ],
link_whole: libxserver_glx,
link_with: e,
......
noinst_LTLIBRARIES = libbsd.la
# APM support.
if BSD_KQUEUE_APM
APM_SOURCES = $(srcdir)/bsd_kqueue_apm.c
else
if BSD_APM
APM_SOURCES = $(srcdir)/bsd_apm.c
else
# No APM support.
APM_SOURCES = $(srcdir)/../shared/pm_noop.c
endif
endif
if FREEBSD_KLDLOAD
KMOD_SOURCES = bsd_kmod.c
......
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include <X11/X.h>
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
#define XF86_OS_PRIVS
#include "xf86_OSproc.h"
#include "xf86_OSlib.h"
#include <machine/apmvar.h>
#define APM_DEVICE "/dev/apm"
static void *APMihPtr = NULL;
static void bsdCloseAPM(void);
static struct {
u_int apmBsd;
pmEvent xf86;
} bsdToXF86Array[] = {
{APM_STANDBY_REQ, XF86_APM_SYS_STANDBY},
{APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND},
{APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME},
{APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME},
{APM_BATTERY_LOW, XF86_APM_LOW_BATTERY},
{APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE},
{APM_UPDATE_TIME, XF86_APM_UPDATE_TIME},
{APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND},
{APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY},
{APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND},
{APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME},
#ifdef APM_CAPABILITY_CHANGE
{APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED},
#endif
};
static pmEvent
bsdToXF86(int type)
{
int i;
for (i = 0; i < ARRAY_SIZE(bsdToXF86Array); i++) {
if (type == bsdToXF86Array[i].apmBsd) {
return bsdToXF86Array[i].xf86;
}
}
return XF86_APM_UNKNOWN;
}
/*
* APM events can be requested direclty from /dev/apm
*/
static int
bsdPMGetEventFromOS(int fd, pmEvent * events, int num)
{
struct apm_event_info bsdEvent;
int i;
for (i = 0; i < num; i++) {
if (ioctl(fd, APM_IOC_NEXTEVENT, &bsdEvent) < 0) {
if (errno != EAGAIN) {
xf86Msg(X_WARNING, "bsdPMGetEventFromOS: APM_IOC_NEXTEVENT"
" %s\n", strerror(errno));
}
break;
}
events[i] = bsdToXF86(bsdEvent.type);
}
return i;
}
/*
* XXX This won't work on /dev/apm !
* We should either use /dev/apm_ctl (and kill apmd(8))
* or talk to apmd (but its protocol is not publically available)...
*/
static pmWait
bsdPMConfirmEventToOs(int fd, pmEvent event)
{
switch (event) {
case XF86_APM_SYS_STANDBY:
case XF86_APM_USER_STANDBY:
if (ioctl(fd, APM_IOC_STANDBY, NULL) == 0)
return PM_WAIT; /* should we stop the Xserver in standby, too? */
else
return PM_NONE;
case XF86_APM_SYS_SUSPEND:
case XF86_APM_CRITICAL_SUSPEND:
case XF86_APM_USER_SUSPEND:
if (ioctl(fd, APM_IOC_SUSPEND, NULL) == 0)
return PM_WAIT;
else
return PM_NONE;
case XF86_APM_STANDBY_RESUME:
case XF86_APM_NORMAL_RESUME:
case XF86_APM_CRITICAL_RESUME:
case XF86_APM_STANDBY_FAILED:
case XF86_APM_SUSPEND_FAILED:
return PM_CONTINUE;
default:
return PM_NONE;
}
}
PMClose
xf86OSPMOpen(void)
{
int fd;
if (APMihPtr || !xf86Info.pmFlag) {
return NULL;
}
if ((fd = open(APM_DEVICE, O_RDWR)) == -1) {
return NULL;
}
xf86PMGetEventFromOs = bsdPMGetEventFromOS;
xf86PMConfirmEventToOs = bsdPMConfirmEventToOs;
APMihPtr = xf86AddGeneralHandler(fd, xf86HandlePMEvents, NULL);
return bsdCloseAPM;
}
static void
bsdCloseAPM(void)
{
int fd;
if (APMihPtr) {
fd = xf86RemoveGeneralHandler(APMihPtr);
close(fd);
APMihPtr = NULL;
}
}
/*
* Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the XFree86 Project
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* from the XFree86 Project.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include <X11/X.h>
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
#define XF86_OS_PRIVS
#include "xf86_OSproc.h"
#include "xf86_OSlib.h"
#include <sys/event.h>
#include <machine/apmvar.h>
#define _PATH_APM_SOCKET "/var/run/apmdev"
#define _PATH_APM_DEV "/dev/apm"
#define _PATH_APM_CTLDEV "/dev/apmctl"
static void *APMihPtr = NULL;
static int devFd = -1;
static int ctlFd = -1;
static void bsdCloseAPM(void);
static struct {
u_int apmBsd;
pmEvent xf86;
} bsdToXF86Array[] = {
{APM_STANDBY_REQ, XF86_APM_SYS_STANDBY},
{APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND},
{APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME},
{APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME},
{APM_BATTERY_LOW, XF86_APM_LOW_BATTERY},
{APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE},
{APM_UPDATE_TIME, XF86_APM_UPDATE_TIME},
{APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND},
{APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY},
{APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND},
{APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME},
#ifdef APM_CAPABILITY_CHANGE
{APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED},
#endif
};
static pmEvent
bsdToXF86(int type)
{
int i;
for (i = 0; i < ARRAY_SIZE(bsdToXF86Array); i++) {
if (type == bsdToXF86Array[i].apmBsd) {
return bsdToXF86Array[i].xf86;
}
}
return XF86_APM_UNKNOWN;
}
/*
* APM events can be requested direclty from /dev/apm
*/
static int
bsdPMGetEventFromOS(int kq, pmEvent * events, int num)
{
struct kevent ev;
int i, result;
struct timespec ts = { 0, 0 };
for (i = 0; i < num; i++) {
result = kevent(kq, NULL, 0, &ev, 1, &ts);
if (result == 0 || APM_EVENT_TYPE(ev.data) == APM_NOEVENT) {
/* no event */
break;
}
else if (result < 0) {
xf86Msg(X_WARNING, "bsdPMGetEventFromOS: kevent returns"
" %s\n", strerror(errno));
break;
}
events[i] = bsdToXF86(APM_EVENT_TYPE(ev.data));
}
return i;
}
/*
* If apmd(8) is running, he will get the events and handle them,
* so, we've nothing to do here.
* Otherwise, opening /dev/apmctl will succeed and we have to send the
* confirmations to /dev/apmctl.
*/
static pmWait
bsdPMConfirmEventToOs(int dummyfd, pmEvent event)
{
if (ctlFd < 0) {
if ((ctlFd = open(_PATH_APM_CTLDEV, O_RDWR)) < 0) {
return PM_NONE;
}
}
/* apmctl open succeedeed */
switch (event) {
case XF86_APM_SYS_STANDBY:
case XF86_APM_USER_STANDBY:
if (ioctl(ctlFd, APM_IOC_STANDBY, NULL) == 0)
return PM_WAIT; /* should we stop the Xserver in standby, too? */
else
return PM_NONE;
case XF86_APM_SYS_SUSPEND:
case XF86_APM_CRITICAL_SUSPEND:
case XF86_APM_USER_SUSPEND:
if (ioctl(ctlFd, APM_IOC_SUSPEND, NULL) == 0)
return PM_WAIT;
else
return PM_NONE;
break;
case XF86_APM_STANDBY_RESUME:
case XF86_APM_NORMAL_RESUME:
case XF86_APM_CRITICAL_RESUME:
case XF86_APM_STANDBY_FAILED:
case XF86_APM_SUSPEND_FAILED:
return PM_CONTINUE;
break;
default:
return PM_NONE;
}
}
PMClose
xf86OSPMOpen(void)
{
int kq;
struct kevent ev;
if (APMihPtr || !xf86Info.pmFlag) {
return NULL;
}
if ((devFd = open(_PATH_APM_DEV, O_RDONLY)) == -1) {
return NULL;
}
if ((kq = kqueue()) <= 0) {
close(devFd);
return NULL;
}
EV_SET(&ev, devFd, EVFILT_READ, EV_ADD | EV_ENABLE | EV_CLEAR, 0, 0, NULL);
if (kevent(kq, &ev, 1, NULL, 0, NULL) < 0) {
close(devFd);
return NULL;
}
xf86PMGetEventFromOs = bsdPMGetEventFromOS;
xf86PMConfirmEventToOs = bsdPMConfirmEventToOs;
APMihPtr = xf86AddGeneralHandler(kq, xf86HandlePMEvents, NULL);
return bsdCloseAPM;
}
static void
bsdCloseAPM(void)
{
int kq;
if (APMihPtr) {
kq = xf86RemoveGeneralHandler(APMihPtr);
close(devFd);
devFd = -1;
close(kq);
if (ctlFd >= 0) {
close(ctlFd);
ctlFd = -1;
}
APMihPtr = NULL;
}
}
......@@ -96,18 +96,9 @@ elif host_machine.system().endswith('bsd')
'bsd/bsd_VTsw.c',
'bsd/bsd_bell.c',
'bsd/bsd_init.c',
'shared/pm_noop.c'
]
if cc.has_header('machine/apmvar.h')
if cc.has_header('sys/event.h')
srcs_xorg_os_support += 'bsd/bsd_kqueue_apm.c'
else
srcs_xorg_os_support += 'bsd/bsd_apm.c'
endif
else
srcs_xorg_os_support += 'shared/pm_noop.c'
endif
if host_machine.cpu_family() == 'x86_64'
srcs_xorg_os_support += 'bsd/i386_video.c'
if host_machine.system() == 'netbsd'
......
......@@ -378,6 +378,9 @@ egl_screen_probe(ScreenPtr pScreen)
return NULL;
}
if (!screen->base.glvnd)
screen->base.glvnd = strdup("mesa");
__glXScreenInit(base, pScreen);
__glXsetGetProcAddress(eglGetProcAddress);
......
......@@ -86,7 +86,7 @@ conf_data.set('HAVE_LIBBSD', libbsd_dep.found())
# Note: this symbol is used by libXtrans.
conf_data.set('HAVE_SYSTEMD_DAEMON', libsystemd_daemon_dep.found())
conf_data.set('CONFIG_UDEV', build_udev)
conf_data.set('CONFIG_UDEV_KMS', build_udev)
conf_data.set('CONFIG_UDEV_KMS', build_udev_kms)
conf_data.set('HAVE_DBUS', build_dbus)
conf_data.set('CONFIG_HAL', build_hal)
conf_data.set('SYSTEMD_LOGIND', build_systemd_logind)
......@@ -310,7 +310,7 @@ conf_data.set('PCVT_SUPPORT', supports_pcvt)
conf_data.set('SYSCONS_SUPPORT', supports_syscons)
conf_data.set('WSCONS_SUPPORT', supports_wscons)
conf_data.set('XSERVER_LIBPCIACCESS', get_option('pciaccess'))
conf_data.set('XSERVER_PLATFORM_BUS', build_udev)
conf_data.set('XSERVER_PLATFORM_BUS', build_udev_kms)
configure_file(output : 'dix-config.h',
configuration : conf_data)
......@@ -359,7 +359,7 @@ xorg_data.set_quoted('DEFAULT_LIBRARY_PATH', join_paths(get_option('prefix'), ge
xorg_data.set_quoted('__XSERVERNAME__', 'Xorg')
xorg_data.set('XSERVER_LIBPCIACCESS', get_option('pciaccess'))
xorg_data.set_quoted('PCI_TXT_IDS_PATH', '')
xorg_data.set('XSERVER_PLATFORM_BUS', build_udev)
xorg_data.set('XSERVER_PLATFORM_BUS', build_udev_kms)
xorg_data.set('WSCONS_SUPPORT', host_machine.system() == 'netbsd' or host_machine.system() == 'openbsd')
xorg_data.set('HAVE_STROPTS_H', cc.has_header('stropts.h'))
xorg_data.set('HAVE_SYS_KD_H', cc.has_header('sys/kd.h'))
......
......@@ -163,13 +163,15 @@ hal_option = get_option('hal')
glamor_option = get_option('glamor')
build_udev = get_option('udev')
build_udev_kms = get_option('udev_kms')
if host_machine.system() == 'windows' or host_machine.system() == 'darwin'
build_udev = false
build_udev_kms = false
hal_option = 'false'
endif
if get_option('systemd_logind') == 'auto'
build_systemd_logind = build_udev and dbus_dep.found()
build_systemd_logind = build_udev_kms and dbus_dep.found()
else
build_systemd_logind = get_option('systemd_logind') == 'true'
endif
......@@ -303,7 +305,7 @@ endif
build_dbus = build_hal or build_systemd_logind
udev_dep = dependency('', required:false)
if build_udev
if build_udev or build_udev_kms
udev_dep = dependency('libudev', version: '>= 143')
endif
......
......@@ -68,6 +68,7 @@ option('suid_wrapper', type: 'boolean', value: 'false',
option('pciaccess', type: 'boolean', value: 'true',
description: 'Xorg pciaccess support')
option('udev', type: 'boolean', value: 'true')
option('udev_kms', type: 'boolean', value: 'true')
option('hal', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Enable HAL integration')
option('systemd_logind', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
......
......@@ -33,7 +33,16 @@
#if defined(HAVE_SHA1_IN_LIBMD) /* Use libmd for SHA1 */ \
|| defined(HAVE_SHA1_IN_LIBC) /* Use libc for SHA1 */
#if defined(__DragonFly__) || defined(__FreeBSD__)
#include <sha.h>
#define SHA1End SHA1_End
#define SHA1File SHA1_File
#define SHA1Final SHA1_Final
#define SHA1Init SHA1_Init
#define SHA1Update SHA1_Update
#else
#include <sha1.h>
#endif
void *
x_sha1_init(void)
......