From 1a66cad3fbfa7e12c36075abf25018a42a22e83e Mon Sep 17 00:00:00 2001 From: matthieu Date: Fri, 8 Dec 2017 15:01:59 +0000 Subject: [PATCH] Update to xserver 1.19.5. Tested by bru@, jsg@ and others --- xserver/.dir-locals.el | 1 + xserver/ChangeLog | 14699 +++++++++++++--- xserver/Makefile.in | 18 +- xserver/TODO | 92 - xserver/Xext/Makefile.in | 14 +- xserver/Xext/geext.c | 22 - xserver/Xext/panoramiXprocs.c | 70 +- xserver/Xext/security.c | 2 +- xserver/Xext/shape.c | 1 + xserver/Xext/shm.c | 12 +- xserver/Xext/sleepuntil.c | 17 +- xserver/Xext/sync.c | 45 +- xserver/Xext/vidmode.c | 2 +- xserver/Xext/xace.c | 45 +- xserver/Xext/xace.h | 12 +- xserver/Xext/xf86bigfont.c | 10 +- xserver/Xext/xres.c | 96 +- xserver/Xext/xselinux_hooks.c | 18 +- xserver/Xext/xvdisp.c | 3 - xserver/Xi/Makefile.in | 14 +- xserver/Xi/exevents.c | 30 +- xserver/Xi/extinit.c | 17 +- xserver/Xi/stubs.c | 14 + xserver/Xi/xichangehierarchy.c | 6 +- xserver/Xi/xiproperty.c | 8 +- xserver/Xi/xiquerypointer.c | 4 +- xserver/Xi/xiwarppointer.c | 4 + xserver/aclocal.m4 | 1 + xserver/composite/Makefile.in | 14 +- xserver/composite/compalloc.c | 10 +- xserver/composite/compext.c | 29 +- xserver/composite/compint.h | 2 +- xserver/composite/compwindow.c | 9 +- xserver/config/Makefile.in | 14 +- xserver/config/config.c | 6 +- xserver/config/dbus-api | 40 + xserver/config/dbus-core.c | 18 +- xserver/config/hal.c | 4 +- xserver/config/udev.c | 57 +- xserver/config/wscons.c | 2 +- xserver/configure | 940 +- xserver/configure.ac | 183 +- xserver/damageext/Makefile.in | 14 +- xserver/damageext/damageext.c | 23 +- .../ephyrglxext.h => damageext/damageext.h} | 31 +- xserver/dbe/Makefile.in | 14 +- xserver/dix/Makefile.am | 4 +- xserver/dix/Makefile.in | 18 +- xserver/dix/devices.c | 81 +- xserver/dix/dispatch.c | 237 +- xserver/dix/dixfonts.c | 326 +- xserver/dix/dixutils.c | 45 +- xserver/dix/events.c | 17 +- xserver/dix/getevents.c | 32 +- xserver/dix/inpututils.c | 17 +- xserver/dix/main.c | 36 +- xserver/dix/pixmap.c | 22 +- xserver/dix/privates.c | 9 + xserver/dix/property.c | 14 +- xserver/dix/ptrveloc.c | 42 +- xserver/dix/resource.c | 41 +- xserver/dix/selection.c | 3 + xserver/dix/touch.c | 92 +- xserver/doc/Makefile.in | 14 +- xserver/doc/Xinput.xml | 8 +- xserver/doc/Xserver-spec.xml | 59 +- xserver/doc/c-extensions | 68 + xserver/doc/dtrace/Makefile.in | 14 +- xserver/dri3/Makefile.in | 14 +- xserver/dri3/dri3_request.c | 8 +- xserver/exa/Makefile.in | 14 +- xserver/exa/exa.c | 10 +- xserver/fb/Makefile.in | 14 +- xserver/fb/fbimage.c | 2 +- xserver/fix-miregion | 29 + xserver/fix-miregion-private | 14 + xserver/fix-patch-whitespace | 4 + xserver/fix-region | 38 + xserver/glamor/Makefile.am | 4 +- xserver/glamor/Makefile.in | 19 +- xserver/glamor/glamor.c | 103 +- xserver/glamor/glamor.h | 40 +- xserver/glamor/glamor_composite_glyphs.c | 3 +- xserver/glamor/glamor_copy.c | 62 +- xserver/glamor/glamor_core.c | 168 - xserver/glamor/glamor_dash.c | 3 +- xserver/glamor/glamor_egl.c | 133 +- xserver/glamor/glamor_egl.h | 75 + xserver/glamor/glamor_egl_stubs.c | 5 - xserver/glamor/glamor_fbo.c | 236 +- xserver/glamor/glamor_font.c | 6 +- xserver/glamor/glamor_glyphblt.c | 26 +- xserver/glamor/glamor_gradient.c | 8 +- xserver/glamor/glamor_largepixmap.c | 13 +- xserver/glamor/glamor_lines.c | 13 +- xserver/glamor/glamor_picture.c | 1017 +- xserver/glamor/glamor_points.c | 14 +- xserver/glamor/glamor_priv.h | 55 +- xserver/glamor/glamor_program.c | 3 +- xserver/glamor/glamor_rects.c | 13 +- xserver/glamor/glamor_render.c | 95 +- xserver/glamor/glamor_segs.c | 14 +- xserver/glamor/glamor_spans.c | 15 +- xserver/glamor/glamor_transform.c | 11 +- xserver/glamor/glamor_transform.h | 2 +- xserver/glamor/glamor_utils.h | 563 +- xserver/glamor/glamor_xv.c | 9 +- xserver/glx/Makefile.am | 10 +- xserver/glx/Makefile.in | 35 +- xserver/glx/createcontext.c | 8 - xserver/glx/extension_string.c | 5 +- xserver/glx/extension_string.h | 1 + xserver/glx/glxcmds.c | 45 +- xserver/glx/glxcontext.h | 5 - xserver/glx/glxdrawable.h | 3 + xserver/glx/glxdri2.c | 184 +- xserver/glx/glxdricommon.c | 62 +- xserver/glx/glxdricommon.h | 3 +- xserver/glx/glxdriswrast.c | 98 +- xserver/glx/glxext.c | 22 +- xserver/glx/glxscreens.c | 44 +- xserver/glx/glxscreens.h | 17 +- xserver/glx/single2.c | 4 - xserver/glx/single2swap.c | 4 - xserver/glx/singlepix.c | 1 - xserver/glx/singlepixswap.c | 1 - xserver/hw/Makefile.in | 14 +- xserver/hw/dmx/Makefile.in | 14 +- xserver/hw/dmx/config/Makefile.in | 14 +- xserver/hw/dmx/config/man/Makefile.in | 14 +- xserver/hw/dmx/dmxfont.c | 9 +- xserver/hw/dmx/dmxinit.c | 63 - xserver/hw/dmx/dmxinput.c | 5 + xserver/hw/dmx/dmxinput.h | 18 - xserver/hw/dmx/dmxscrinit.c | 4 +- xserver/hw/dmx/dmxsync.c | 6 +- xserver/hw/dmx/doc/DMXSpec-v1.txt | 2 +- xserver/hw/dmx/doc/DMXSpec.txt | 2 +- xserver/hw/dmx/doc/Makefile.in | 14 +- xserver/hw/dmx/doc/dmx.xml | 11 +- xserver/hw/dmx/doxygen/Makefile.in | 14 +- xserver/hw/dmx/examples/Makefile.in | 14 +- xserver/hw/dmx/glxProxy/Makefile.in | 14 +- xserver/hw/dmx/input/Makefile.am | 2 - xserver/hw/dmx/input/Makefile.in | 27 +- xserver/hw/dmx/input/dmxcommon.c | 17 +- xserver/hw/dmx/input/dmxevents.c | 29 +- xserver/hw/dmx/input/dmxinputinit.c | 13 +- xserver/hw/dmx/input/dmxsigio.c | 234 - xserver/hw/dmx/input/dmxsigio.h | 43 - xserver/hw/dmx/input/lnx-keyboard.c | 7 +- xserver/hw/dmx/input/lnx-ms.c | 21 +- xserver/hw/dmx/input/lnx-ps2.c | 14 +- xserver/hw/dmx/input/usb-common.c | 2 +- xserver/hw/dmx/input/usb-keyboard.c | 5 +- xserver/hw/dmx/man/Makefile.in | 14 +- xserver/hw/kdrive/Makefile.in | 14 +- xserver/hw/kdrive/Xkdrive.man | 7 - xserver/hw/kdrive/ephyr/Makefile.am | 14 - xserver/hw/kdrive/ephyr/Makefile.in | 42 +- xserver/hw/kdrive/ephyr/ephyr.c | 222 +- xserver/hw/kdrive/ephyr/ephyr.h | 6 +- xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c | 8 + xserver/hw/kdrive/ephyr/ephyrdri.c | 356 - xserver/hw/kdrive/ephyr/ephyrdri.h | 70 - xserver/hw/kdrive/ephyr/ephyrdriext.c | 1376 -- xserver/hw/kdrive/ephyr/ephyrdriext.h | 40 - xserver/hw/kdrive/ephyr/ephyrglxext.c | 854 - xserver/hw/kdrive/ephyr/ephyrhostglx.c | 490 - xserver/hw/kdrive/ephyr/ephyrhostglx.h | 75 - xserver/hw/kdrive/ephyr/ephyrinit.c | 65 +- xserver/hw/kdrive/ephyr/ephyrvideo.c | 7 +- xserver/hw/kdrive/ephyr/hostx.c | 279 +- xserver/hw/kdrive/ephyr/hostx.h | 30 +- xserver/hw/kdrive/ephyr/man/Makefile.in | 14 +- xserver/hw/kdrive/ephyr/os.c | 1 - xserver/hw/kdrive/fake/Makefile.in | 14 +- xserver/hw/kdrive/fake/mouse.c | 1 - xserver/hw/kdrive/fbdev/Makefile.in | 14 +- xserver/hw/kdrive/linux/Makefile.in | 14 +- xserver/hw/kdrive/linux/evdev.c | 20 +- xserver/hw/kdrive/linux/linux.c | 78 +- xserver/hw/kdrive/linux/mouse.c | 34 +- xserver/hw/kdrive/linux/ms.c | 13 +- xserver/hw/kdrive/linux/ps2.c | 13 +- xserver/hw/kdrive/linux/tslib.c | 1 - xserver/hw/kdrive/src/Makefile.am | 8 + xserver/hw/kdrive/src/Makefile.in | 20 +- xserver/hw/kdrive/src/kdrive.c | 96 +- xserver/hw/kdrive/src/kdrive.h | 6 +- xserver/hw/kdrive/src/kinfo.c | 4 + xserver/hw/kdrive/src/kinput.c | 402 +- xserver/hw/vfb/InitOutput.c | 4 +- xserver/hw/vfb/Makefile.in | 14 +- xserver/hw/vfb/man/Makefile.in | 14 +- xserver/hw/xfree86/Makefile.am | 10 +- xserver/hw/xfree86/Makefile.in | 28 +- xserver/hw/xfree86/common/Makefile.in | 14 +- xserver/hw/xfree86/common/xf86.h | 13 +- xserver/hw/xfree86/common/xf86AutoConfig.c | 17 +- xserver/hw/xfree86/common/xf86Bus.c | 3 +- xserver/hw/xfree86/common/xf86Config.c | 35 - xserver/hw/xfree86/common/xf86Cursor.c | 8 +- xserver/hw/xfree86/common/xf86Events.c | 114 +- xserver/hw/xfree86/common/xf86Globals.c | 3 +- xserver/hw/xfree86/common/xf86Helper.c | 94 +- xserver/hw/xfree86/common/xf86Init.c | 267 +- xserver/hw/xfree86/common/xf86Module.h | 9 +- xserver/hw/xfree86/common/xf86Option.c | 2 +- xserver/hw/xfree86/common/xf86PM.c | 8 +- xserver/hw/xfree86/common/xf86Priv.h | 6 +- xserver/hw/xfree86/common/xf86Privstr.h | 17 +- xserver/hw/xfree86/common/xf86VGAarbiter.c | 12 +- .../hw/xfree86/common/xf86VGAarbiterPriv.h | 6 +- xserver/hw/xfree86/common/xf86Xinput.c | 160 +- xserver/hw/xfree86/common/xf86cmap.c | 62 +- xserver/hw/xfree86/common/xf86pciBus.c | 2 +- xserver/hw/xfree86/common/xf86platformBus.c | 28 +- xserver/hw/xfree86/common/xf86str.h | 2 +- xserver/hw/xfree86/ddc/Makefile.in | 14 +- xserver/hw/xfree86/ddc/ddc.c | 2 +- xserver/hw/xfree86/ddc/ddcProperty.c | 55 +- xserver/hw/xfree86/ddc/edid.h | 1 - xserver/hw/xfree86/dixmods/Makefile.am | 6 +- xserver/hw/xfree86/dixmods/Makefile.in | 38 +- xserver/hw/xfree86/dixmods/glxmodule.c | 10 +- xserver/hw/xfree86/doc/Makefile.am | 1 - xserver/hw/xfree86/doc/Makefile.in | 15 +- xserver/hw/xfree86/doc/README.DRIcomp | 551 - xserver/hw/xfree86/doc/ddxDesign.xml | 18 - xserver/hw/xfree86/dri/Makefile.in | 14 +- xserver/hw/xfree86/dri/dri.c | 100 +- xserver/hw/xfree86/dri/dri.h | 18 +- xserver/hw/xfree86/dri2/Makefile.in | 14 +- xserver/hw/xfree86/dri2/dri2.c | 8 +- xserver/hw/xfree86/dri2/pci_ids/Makefile.in | 14 +- .../hw/xfree86/dri2/pci_ids/i965_pci_ids.h | 85 +- .../xfree86/dri2/pci_ids/radeonsi_pci_ids.h | 12 + xserver/hw/xfree86/drivers/Makefile.in | 14 +- .../xfree86/drivers/modesetting/Makefile.am | 1 + .../xfree86/drivers/modesetting/Makefile.in | 18 +- xserver/hw/xfree86/drivers/modesetting/dri2.c | 323 +- .../hw/xfree86/drivers/modesetting/driver.c | 552 +- .../hw/xfree86/drivers/modesetting/driver.h | 26 +- .../drivers/modesetting/drmmode_display.c | 644 +- .../drivers/modesetting/drmmode_display.h | 55 +- .../hw/xfree86/drivers/modesetting/pageflip.c | 344 + .../hw/xfree86/drivers/modesetting/present.c | 335 +- .../hw/xfree86/drivers/modesetting/vblank.c | 76 +- xserver/hw/xfree86/exa/Makefile.in | 14 +- xserver/hw/xfree86/exa/man/Makefile.in | 14 +- xserver/hw/xfree86/fbdevhw/Makefile.in | 14 +- xserver/hw/xfree86/fbdevhw/man/Makefile.in | 14 +- xserver/hw/xfree86/glamor_egl/Makefile.in | 14 +- xserver/hw/xfree86/i2c/Makefile.in | 14 +- xserver/hw/xfree86/i2c/xf86i2c.c | 8 +- xserver/hw/xfree86/int10/Makefile.in | 14 +- xserver/hw/xfree86/loader/Makefile.in | 14 +- xserver/hw/xfree86/loader/loader.c | 1 - xserver/hw/xfree86/loader/loadmod.c | 38 +- xserver/hw/xfree86/loader/os.c | 2 +- xserver/hw/xfree86/man/Makefile.in | 14 +- xserver/hw/xfree86/man/xorg.conf.man | 35 +- xserver/hw/xfree86/modes/Makefile.in | 14 +- xserver/hw/xfree86/modes/xf86Crtc.c | 113 - xserver/hw/xfree86/modes/xf86Crtc.h | 53 +- xserver/hw/xfree86/modes/xf86Cursors.c | 163 +- xserver/hw/xfree86/modes/xf86EdidModes.c | 5 + xserver/hw/xfree86/modes/xf86RandR12.c | 395 +- xserver/hw/xfree86/modes/xf86RandR12.h | 5 + xserver/hw/xfree86/modes/xf86Rotate.c | 9 +- xserver/hw/xfree86/os-support/Makefile.in | 14 +- xserver/hw/xfree86/os-support/bsd/Makefile.in | 14 +- xserver/hw/xfree86/os-support/bsd/bsd_init.c | 2 +- xserver/hw/xfree86/os-support/bsd/ppc_video.c | 4 +- .../hw/xfree86/os-support/bsd/sparc64_video.c | 3 - xserver/hw/xfree86/os-support/bus/Makefile.in | 14 +- xserver/hw/xfree86/os-support/bus/Sbus.c | 4 +- .../hw/xfree86/os-support/hurd/Makefile.in | 14 +- .../hw/xfree86/os-support/linux/Makefile.in | 14 +- .../hw/xfree86/os-support/linux/lnx_init.c | 5 +- .../hw/xfree86/os-support/misc/Makefile.in | 14 +- .../hw/xfree86/os-support/shared/VTsw_usl.c | 2 +- .../hw/xfree86/os-support/shared/posix_tty.c | 36 +- xserver/hw/xfree86/os-support/shared/sigio.c | 121 +- .../hw/xfree86/os-support/shared/sigiostubs.c | 23 - .../hw/xfree86/os-support/solaris/Makefile.in | 14 +- .../hw/xfree86/os-support/solaris/sun_bell.c | 4 +- .../hw/xfree86/os-support/stub/Makefile.in | 14 +- xserver/hw/xfree86/os-support/xf86_OSlib.h | 22 +- xserver/hw/xfree86/os-support/xf86_OSproc.h | 4 - xserver/hw/xfree86/parser/DRI.c | 2 +- xserver/hw/xfree86/parser/Device.c | 3 +- xserver/hw/xfree86/parser/Extensions.c | 2 +- xserver/hw/xfree86/parser/Files.c | 2 +- xserver/hw/xfree86/parser/Flags.c | 2 +- xserver/hw/xfree86/parser/Input.c | 3 +- xserver/hw/xfree86/parser/InputClass.c | 95 +- xserver/hw/xfree86/parser/Layout.c | 4 +- xserver/hw/xfree86/parser/Makefile.in | 14 +- xserver/hw/xfree86/parser/Module.c | 4 +- xserver/hw/xfree86/parser/Monitor.c | 8 +- xserver/hw/xfree86/parser/OutputClass.c | 3 +- xserver/hw/xfree86/parser/Pointer.c | 4 +- xserver/hw/xfree86/parser/Screen.c | 4 +- xserver/hw/xfree86/parser/Vendor.c | 4 +- xserver/hw/xfree86/parser/Video.c | 4 +- xserver/hw/xfree86/parser/configProcs.h | 6 +- xserver/hw/xfree86/parser/read.c | 18 +- xserver/hw/xfree86/parser/scan.c | 44 +- xserver/hw/xfree86/parser/write.c | 38 +- xserver/hw/xfree86/parser/xf86Parser.h | 3 + xserver/hw/xfree86/parser/xf86tokens.h | 13 +- xserver/hw/xfree86/ramdac/Makefile.in | 14 +- xserver/hw/xfree86/ramdac/xf86Cursor.c | 23 +- xserver/hw/xfree86/ramdac/xf86Cursor.h | 1 + xserver/hw/xfree86/ramdac/xf86CursorPriv.h | 1 + xserver/hw/xfree86/ramdac/xf86HWCurs.c | 166 +- xserver/hw/xfree86/sdksyms.sh | 1 - xserver/hw/xfree86/shadowfb/Makefile.in | 14 +- xserver/hw/xfree86/utils/Makefile.in | 14 +- xserver/hw/xfree86/utils/cvt/Makefile.in | 14 +- xserver/hw/xfree86/utils/gtf/Makefile.in | 14 +- xserver/hw/xfree86/utils/gtf/gtf.c | 2 + xserver/hw/xfree86/utils/man/Makefile.in | 14 +- xserver/hw/xfree86/vbe/Makefile.in | 14 +- xserver/hw/xfree86/vbe/vbe.c | 2 +- xserver/hw/xfree86/vgahw/Makefile.in | 14 +- xserver/hw/xfree86/x86emu/Makefile.in | 14 +- xserver/hw/xfree86/xkb/Makefile.am | 6 + xserver/hw/xfree86/xkb/Makefile.in | 790 + xserver/hw/xfree86/xkb/meson.build | 12 + .../hw/xfree86/{dixmods => xkb}/xkbKillSrv.c | 0 .../hw/xfree86/{dixmods => xkb}/xkbPrivate.c | 0 xserver/hw/xfree86/{dixmods => xkb}/xkbVT.c | 0 xserver/hw/xfree86/xorg-wrapper.c | 5 +- xserver/hw/xnest/Font.c | 7 +- xserver/hw/xnest/Handlers.c | 4 +- xserver/hw/xnest/Handlers.h | 5 +- xserver/hw/xnest/Init.c | 12 +- xserver/hw/xnest/Makefile.in | 14 +- xserver/hw/xnest/man/Makefile.in | 14 +- xserver/hw/xquartz/GL/Makefile.in | 14 +- xserver/hw/xquartz/GL/glcontextmodes.c | 585 + xserver/hw/xquartz/GL/glcontextmodes.h | 60 + xserver/hw/xquartz/GL/indirect.c | 40 +- xserver/hw/xquartz/GL/visualConfigs.c | 1 - xserver/hw/xquartz/Makefile.in | 14 +- xserver/hw/xquartz/X11Application.h | 3 - xserver/hw/xquartz/X11Application.m | 64 +- xserver/hw/xquartz/bundle/Makefile.in | 14 +- xserver/hw/xquartz/darwin.c | 18 +- xserver/hw/xquartz/darwinEvents.c | 125 +- xserver/hw/xquartz/darwinXinput.c | 15 + xserver/hw/xquartz/mach-startup/Makefile.in | 14 +- xserver/hw/xquartz/man/Makefile.in | 14 +- xserver/hw/xquartz/pbproxy/Makefile.am | 5 +- xserver/hw/xquartz/pbproxy/Makefile.in | 20 +- xserver/hw/xquartz/pbproxy/app-main.m | 3 - xserver/hw/xquartz/pbproxy/main.m | 18 - xserver/hw/xquartz/quartz.c | 1 + xserver/hw/xquartz/quartzCocoa.m | 8 +- xserver/hw/xquartz/quartzCommon.h | 5 +- xserver/hw/xquartz/quartzStartup.c | 9 + xserver/hw/xquartz/xpr/Makefile.in | 14 +- xserver/hw/xwayland/Makefile.am | 30 +- xserver/hw/xwayland/Makefile.in | 81 +- xserver/hw/xwayland/drm.xml | 35 +- xserver/hw/xwayland/xwayland-cursor.c | 28 +- xserver/hw/xwayland/xwayland-cvt.c | 7 + xserver/hw/xwayland/xwayland-glamor.c | 73 +- xserver/hw/xwayland/xwayland-input.c | 961 +- xserver/hw/xwayland/xwayland-output.c | 54 +- xserver/hw/xwayland/xwayland-shm.c | 56 +- xserver/hw/xwayland/xwayland.c | 216 +- xserver/hw/xwayland/xwayland.h | 53 +- xserver/hw/xwin/InitInput.c | 14 +- xserver/hw/xwin/InitOutput.c | 112 +- xserver/hw/xwin/Makefile.am | 16 +- xserver/hw/xwin/Makefile.in | 27 +- xserver/hw/xwin/dri/Makefile.am | 9 + xserver/hw/xwin/dri/Makefile.in | 793 + xserver/hw/xwin/dri/windowsdri.c | 274 + xserver/hw/xwin/dri/windowsdri.h | 30 + xserver/hw/xwin/glx/Makefile.am | 7 + xserver/hw/xwin/glx/Makefile.in | 40 +- xserver/hw/xwin/glx/dri_helpers.c | 120 + xserver/hw/xwin/glx/dri_helpers.h | 38 + xserver/hw/xwin/glx/indirect.c | 494 +- xserver/hw/xwin/glx/indirect.h | 95 + xserver/hw/xwin/glx/winpriv.c | 7 + xserver/hw/xwin/glx/winpriv.h | 1 + xserver/hw/xwin/man/Makefile.in | 14 +- xserver/hw/xwin/man/XWin.man | 10 +- xserver/hw/xwin/win.h | 39 +- xserver/hw/xwin/winallpriv.c | 7 - xserver/hw/xwin/winauth.c | 25 + xserver/hw/xwin/winblock.c | 5 +- xserver/hw/xwin/winclipboard/Makefile.in | 14 +- xserver/hw/xwin/winclipboard/internal.h | 125 + xserver/hw/xwin/winconfig.c | 5 +- xserver/hw/xwin/wincreatewnd.c | 6 +- xserver/hw/xwin/winengine.c | 2 +- xserver/hw/xwin/winerror.c | 2 +- xserver/hw/xwin/winglobals.c | 1 - xserver/hw/xwin/winglobals.h | 1 - xserver/hw/xwin/winkeybd.c | 2 +- xserver/hw/xwin/winmsg.c | 33 +- xserver/hw/xwin/winmsg.h | 17 +- xserver/hw/xwin/winmultiwindowicons.c | 141 +- xserver/hw/xwin/winmultiwindowicons.h | 4 +- xserver/hw/xwin/winmultiwindowwindow.c | 56 +- xserver/hw/xwin/winmultiwindowwm.c | 1434 +- xserver/hw/xwin/winmultiwindowwndproc.c | 2 +- xserver/hw/xwin/winprefs.c | 30 +- xserver/hw/xwin/winprefs.h | 9 +- xserver/hw/xwin/winprocarg.c | 21 +- xserver/hw/xwin/winscrinit.c | 10 +- xserver/hw/xwin/winshadddnl.c | 6 - xserver/hw/xwin/winshadgdi.c | 12 +- xserver/hw/xwin/wintaskbar.c | 2 +- xserver/hw/xwin/winvalargs.c | 19 +- xserver/hw/xwin/winwakeup.c | 3 +- xserver/hw/xwin/winwin32rootless.c | 68 +- xserver/hw/xwin/winwin32rootlesswindow.c | 15 +- xserver/hw/xwin/winwin32rootlesswndproc.c | 239 +- xserver/hw/xwin/winwindow.h | 26 +- xserver/hw/xwin/winwindowswm.c | 2 +- xserver/hw/xwin/winwndproc.c | 52 +- xserver/include/Makefile.am | 3 +- xserver/include/Makefile.in | 19 +- xserver/include/dix-config.h.in | 27 +- xserver/include/dix.h | 34 +- xserver/include/dixfont.h | 18 +- xserver/include/dixfontstr.h | 1 + xserver/include/dixfontstubs.h | 43 - xserver/include/dixstruct.h | 47 +- xserver/include/do-not-use-config.h.in | 43 +- xserver/include/eventstr.h | 10 + xserver/include/globals.h | 2 - xserver/include/input.h | 26 +- xserver/include/inpututils.h | 4 +- xserver/include/misc.h | 3 +- xserver/include/os.h | 43 +- xserver/include/pixmap.h | 3 + xserver/include/privates.h | 3 + xserver/include/property.h | 9 - xserver/include/protocol-versions.h | 5 + xserver/include/scrnintstr.h | 73 +- xserver/include/xkbsrv.h | 6 + xserver/include/xorg-config.h.in | 9 +- xserver/include/xserver_poll.h | 55 + xserver/m4/ax_pthread.m4 | 337 + xserver/man/Makefile.in | 14 +- xserver/man/Xserver.man | 2 +- xserver/mi/Makefile.in | 14 +- xserver/mi/mieq.c | 163 +- xserver/mi/miglblt.c | 6 +- xserver/mi/mipointer.c | 48 +- xserver/mi/mipointer.h | 6 + xserver/mi/mipointrst.h | 14 +- xserver/mi/misprite.c | 8 +- xserver/miext/Makefile.in | 14 +- xserver/miext/damage/Makefile.in | 14 +- xserver/miext/damage/damage.c | 14 +- xserver/miext/rootless/Makefile.in | 14 +- xserver/miext/rootless/rootlessScreen.c | 4 +- xserver/miext/shadow/Makefile.in | 14 +- xserver/miext/shadow/shadow.c | 20 +- xserver/miext/shadow/shadow.h | 1 + xserver/miext/sync/Makefile.in | 14 +- xserver/os/Makefile.am | 14 +- xserver/os/Makefile.in | 75 +- xserver/os/WaitFor.c | 432 +- xserver/os/access.c | 25 +- xserver/os/auth.c | 6 +- xserver/os/backtrace.c | 2 +- xserver/os/busfault.c | 13 +- xserver/os/connection.c | 554 +- xserver/os/inputthread.c | 559 + xserver/os/io.c | 184 +- xserver/os/osdep.h | 75 +- xserver/os/osinit.c | 27 +- xserver/os/ospoll.c | 477 + xserver/os/ospoll.h | 142 + xserver/os/reallocarray.c | 2 +- xserver/os/rpcauth.c | 2 +- xserver/os/timingsafe_memcmp.c | 3 + xserver/os/utils.c | 169 +- xserver/os/xdmauth.c | 2 +- xserver/os/xdmcp.c | 159 +- xserver/os/xserver_poll.c | 277 + xserver/present/Makefile.in | 14 +- xserver/present/present.c | 39 +- xserver/present/present_event.c | 29 +- xserver/present/present_fake.c | 3 +- xserver/present/present_priv.h | 6 + xserver/present/present_request.c | 2 - xserver/present/present_screen.c | 6 +- xserver/pseudoramiX/Makefile.in | 14 +- xserver/randr/Makefile.in | 14 +- xserver/randr/randr.c | 56 +- xserver/randr/randrstr.h | 25 + xserver/randr/rrcrtc.c | 294 +- xserver/randr/rrmonitor.c | 17 +- xserver/randr/rroutput.c | 10 +- xserver/randr/rrprovider.c | 110 +- xserver/randr/rrscreen.c | 15 +- xserver/randr/rrxinerama.c | 7 + xserver/record/Makefile.in | 14 +- xserver/record/record.c | 3 +- xserver/render/Makefile.in | 14 +- xserver/render/animcur.c | 57 +- xserver/render/render.c | 17 +- xserver/test-driver | 148 - xserver/test/Makefile.am | 48 +- xserver/test/Makefile.in | 81 +- xserver/test/ddxstubs.c | 16 - xserver/test/os.c | 166 - xserver/test/scripts/run-piglit.sh | 80 + xserver/test/scripts/xephyr-glamor-piglit.sh | 16 + xserver/test/scripts/xinit-piglit-session.sh | 44 + xserver/test/scripts/xvfb-piglit.sh | 7 + xserver/test/signal-logging.c | 2 +- xserver/test/simple-xinit.c | 229 + xserver/test/touch.c | 31 +- xserver/test/xi1/Makefile.in | 14 +- xserver/test/xi2/Makefile.in | 14 +- xserver/test/xi2/protocol-xiquerypointer.c | 1 + xserver/xfixes/Makefile.in | 14 +- xserver/xfixes/cursor.c | 1 + xserver/xfixes/select.c | 1 + xserver/xfixes/xfixes.c | 21 +- xserver/xkb/Makefile.in | 14 +- xserver/xkb/XKM_file_format.txt | 684 + xserver/xkb/maprules.c | 2 +- xserver/xkb/xkbAccessX.c | 11 +- xserver/xkb/xkbActions.c | 176 +- xserver/xkb/xkbInit.c | 2 +- 539 files changed, 30742 insertions(+), 17224 deletions(-) create mode 100644 xserver/.dir-locals.el delete mode 100644 xserver/TODO create mode 100644 xserver/config/dbus-api rename xserver/{hw/kdrive/ephyr/ephyrglxext.h => damageext/damageext.h} (57%) create mode 100644 xserver/doc/c-extensions create mode 100644 xserver/fix-miregion create mode 100644 xserver/fix-miregion-private create mode 100644 xserver/fix-patch-whitespace create mode 100644 xserver/fix-region create mode 100644 xserver/glamor/glamor_egl.h delete mode 100644 xserver/hw/dmx/input/dmxsigio.c delete mode 100644 xserver/hw/dmx/input/dmxsigio.h delete mode 100644 xserver/hw/kdrive/ephyr/ephyrdri.c delete mode 100644 xserver/hw/kdrive/ephyr/ephyrdri.h delete mode 100644 xserver/hw/kdrive/ephyr/ephyrdriext.c delete mode 100644 xserver/hw/kdrive/ephyr/ephyrdriext.h delete mode 100644 xserver/hw/kdrive/ephyr/ephyrglxext.c delete mode 100644 xserver/hw/kdrive/ephyr/ephyrhostglx.c delete mode 100644 xserver/hw/kdrive/ephyr/ephyrhostglx.h delete mode 100644 xserver/hw/xfree86/doc/README.DRIcomp create mode 100644 xserver/hw/xfree86/drivers/modesetting/pageflip.c create mode 100644 xserver/hw/xfree86/xkb/Makefile.am create mode 100644 xserver/hw/xfree86/xkb/Makefile.in create mode 100644 xserver/hw/xfree86/xkb/meson.build rename xserver/hw/xfree86/{dixmods => xkb}/xkbKillSrv.c (100%) rename xserver/hw/xfree86/{dixmods => xkb}/xkbPrivate.c (100%) rename xserver/hw/xfree86/{dixmods => xkb}/xkbVT.c (100%) create mode 100644 xserver/hw/xquartz/GL/glcontextmodes.c create mode 100644 xserver/hw/xquartz/GL/glcontextmodes.h create mode 100644 xserver/hw/xwin/dri/Makefile.am create mode 100644 xserver/hw/xwin/dri/Makefile.in create mode 100644 xserver/hw/xwin/dri/windowsdri.c create mode 100644 xserver/hw/xwin/dri/windowsdri.h create mode 100644 xserver/hw/xwin/glx/dri_helpers.c create mode 100644 xserver/hw/xwin/glx/dri_helpers.h create mode 100644 xserver/hw/xwin/glx/indirect.h create mode 100644 xserver/hw/xwin/winclipboard/internal.h delete mode 100644 xserver/include/dixfontstubs.h create mode 100644 xserver/include/xserver_poll.h create mode 100644 xserver/m4/ax_pthread.m4 create mode 100644 xserver/os/inputthread.c create mode 100644 xserver/os/ospoll.c create mode 100644 xserver/os/ospoll.h create mode 100644 xserver/os/xserver_poll.c delete mode 100644 xserver/test-driver delete mode 100644 xserver/test/os.c create mode 100644 xserver/test/scripts/run-piglit.sh create mode 100644 xserver/test/scripts/xephyr-glamor-piglit.sh create mode 100644 xserver/test/scripts/xinit-piglit-session.sh create mode 100644 xserver/test/scripts/xvfb-piglit.sh create mode 100644 xserver/test/simple-xinit.c create mode 100644 xserver/xkb/XKM_file_format.txt diff --git a/xserver/.dir-locals.el b/xserver/.dir-locals.el new file mode 100644 index 000000000..6aceae3a6 --- /dev/null +++ b/xserver/.dir-locals.el @@ -0,0 +1 @@ +((c-mode . ((c-basic-offset . 4) (indent-tabs-mode . nil)))) \ No newline at end of file diff --git a/xserver/ChangeLog b/xserver/ChangeLog index 5cc1db39f..4dcd10d1e 100644 --- a/xserver/ChangeLog +++ b/xserver/ChangeLog @@ -1,54 +1,6335 @@ -commit 8b312db7d1d98be67f0283d982428545cf948a66 +commit b96e982e3a43513549636850186ff80a82190f64 Author: Adam Jackson -Date: Tue Jul 19 13:27:08 2016 -0400 +Date: Thu Oct 12 12:32:31 2017 -0400 - xserver 1.18.4 + xserver 1.19.5 Signed-off-by: Adam Jackson -commit 42a74080ffe93502904ede7555652f01ab11d12d -Author: Michel Dänzer -Date: Wed Mar 30 18:23:04 2016 +0900 +commit 95f605b42d8bbb6bea2834a1abfc205981c5b803 +Author: Nathan Kidd +Date: Fri Jan 9 10:15:46 2015 -0500 - os: Use strtok instead of xstrtokenize in ComputeLocalClient + Unvalidated extra length in ProcEstablishConnection (CVE-2017-12176) - Fixes leaking the memory pointed to by the members of the array returned - by xstrtokenize. + Reviewed-by: Julien Cristau + Signed-off-by: Nathan Kidd + Signed-off-by: Julien Cristau + (cherry picked from commit b747da5e25be944337a9cd1415506fc06b70aa81) + +commit cc41e5b581d287c56f8d7113a97a4882dcfdd696 +Author: Nathan Kidd +Date: Fri Jan 9 10:09:14 2015 -0500 + + dbe: Unvalidated variable-length request in ProcDbeGetVisualInfo (CVE-2017-12177) + + v2: Protect against integer overflow (Alan Coopersmith) + + Reviewed-by: Alan Coopersmith + Reviewed-by: Jeremy Huddleston Sequoia + Reviewed-by: Julien Cristau + Signed-off-by: Nathan Kidd + Signed-off-by: Julien Cristau + (cherry picked from commit 4ca68b878e851e2136c234f40a25008297d8d831) + +commit 6c15122163a2d2615db7e998e8d436815a08dec6 +Author: Nathan Kidd +Date: Wed Dec 24 16:22:18 2014 -0500 + + Xi: fix wrong extra length check in ProcXIChangeHierarchy (CVE-2017-12178) + + Reviewed-by: Alan Coopersmith + Reviewed-by: Jeremy Huddleston Sequoia + Reviewed-by: Julien Cristau + Signed-off-by: Nathan Kidd + Signed-off-by: Julien Cristau + (cherry picked from commit 859b08d523307eebde7724fd1a0789c44813e821) + +commit c77cd08efcf386bcc5d8dfbd0427134b2b2d0888 +Author: Nathan Kidd +Date: Fri Jan 9 10:04:41 2015 -0500 + + Xi: integer overflow and unvalidated length in (S)ProcXIBarrierReleasePointer + + [jcristau: originally this patch fixed the same issue as commit + 211e05ac85 "Xi: Test exact size of XIBarrierReleasePointer", with the + addition of these checks] + + This addresses CVE-2017-12179 + + Reviewed-by: Alan Coopersmith + Reviewed-by: Jeremy Huddleston Sequoia + Reviewed-by: Julien Cristau + Signed-off-by: Jeremy Huddleston Sequoia + Signed-off-by: Nathan Kidd + Signed-off-by: Julien Cristau + (cherry picked from commit d088e3c1286b548a58e62afdc70bb40981cdb9e8) + +commit d264da92f7f8129b8aad4f0114a6467fc38fc896 +Author: Nathan Kidd +Date: Sun Dec 21 01:10:03 2014 -0500 + + hw/xfree86: unvalidated lengths + + This addresses: + CVE-2017-12180 in XFree86-VidModeExtension + CVE-2017-12181 in XFree86-DGA + CVE-2017-12182 in XFree86-DRI + + Reviewed-by: Jeremy Huddleston Sequoia + Reviewed-by: Julien Cristau + Signed-off-by: Nathan Kidd + Signed-off-by: Julien Cristau + (cherry picked from commit 1b1d4c04695dced2463404174b50b3581dbd857b) + +commit 61502107a30d64f991784648c3228ebc6694a032 +Author: Nathan Kidd +Date: Fri Jan 9 11:43:05 2015 -0500 + + xfixes: unvalidated lengths (CVE-2017-12183) + + v2: Use before swap (Jeremy Huddleston Sequoia) + + v3: Fix wrong XFixesCopyRegion checks (Alan Coopersmith) + + Reviewed-by: Alan Coopersmith + Reviewed-by: Jeremy Huddleston Sequoia + Reviewed-by: Julien Cristau + Signed-off-by: Jeremy Huddleston Sequoia + Signed-off-by: Nathan Kidd + Signed-off-by: Julien Cristau + (cherry picked from commit 55caa8b08c84af2b50fbc936cf334a5a93dd7db5) + +commit c206f36a4b6ecf2555ab2291c349ab7d7d0b02f5 +Author: Nathan Kidd +Date: Fri Jan 9 09:57:23 2015 -0500 + + Unvalidated lengths + + v2: Add overflow check and remove unnecessary check (Julien Cristau) + + This addresses: + CVE-2017-12184 in XINERAMA + CVE-2017-12185 in MIT-SCREEN-SAVER + CVE-2017-12186 in X-Resource + CVE-2017-12187 in RENDER + + Reviewed-by: Jeremy Huddleston Sequoia + Reviewed-by: Julien Cristau + Signed-off-by: Nathan Kidd + Signed-off-by: Julien Cristau + (cherry picked from commit cad5a1050b7184d828aef9c1dd151c3ab649d37e) + +commit e751722a7b0c5b595794e60b054ade0b3f6cdb4d +Author: Michal Srb +Date: Fri Jul 7 17:04:03 2017 +0200 + + os: Make sure big requests have sufficient length. + + A client can send a big request where the 32B "length" field has value + 0. When the big request header is removed and the length corrected, + the value will underflow to 0xFFFFFFFF. Functions processing the + request later will think that the client sent much more data and may + touch memory beyond the receive buffer. + + Signed-off-by: Eric Anholt + Reviewed-by: Peter Hutterer + (cherry picked from commit 9c23685009aa96f4b861dcc5d2e01dbee00c4dd9) + +commit 784d205ff6527c761ffbb1c43c9ad3669dd8d26e +Author: Adam Jackson +Date: Thu Oct 12 12:17:53 2017 -0400 + + Revert "xf86-video-modesetting: Add ms_queue_vblank helper [v3]" + + Apparently introduces a regression: + + https://bugs.freedesktop.org/103243 + + This reverts commit 388dc1aeac9acf2d51ad5103570beffd81d78b96. + +commit ec37e559614cf4eaba67d3ca0693f09fd95a5d57 +Author: Adam Jackson +Date: Wed Oct 4 15:29:18 2017 -0400 + + xserver 1.19.4 + + Signed-off-by: Adam Jackson + +commit 12fe3d3e9f494ef84832efe94ba00db92be499b1 +Author: Louis-Francis Ratté-Boulianne +Date: Wed Sep 27 01:19:58 2017 -0400 + + present: Check the whole exec queue on event + + Later events are sometimes added in front of the queue (e.g. + if page flipping fails) so we need to check the whole queue + on event. + + Signed-off-by: Louis-Francis Ratté-Boulianne + Reviewed-by: Michel Dänzer + (cherry picked from commit c2f2b25ab55c67f9f3ad07c02fa746eae7c61196) + +commit 388dc1aeac9acf2d51ad5103570beffd81d78b96 +Author: Keith Packard +Date: Fri Sep 29 08:48:33 2017 -0700 + + xf86-video-modesetting: Add ms_queue_vblank helper [v3] + + This provides an API wrapper around the kernel interface for queueing + a vblank event, simplifying all of the callers. + + v2: Fix missing '|' in computing vbl.request.type + + v3: Remove spurious bit of next patch (thanks, Michel Dänzer) + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + (cherry picked from commit 677c32bcda98a96585bb1f66b57e0755a157b772) + +commit 8bd33a2db7337b2801fc630a57e36b6aeea219d9 +Author: Keith Packard +Date: Thu Jul 27 10:08:32 2017 -0700 + + xkb: Handle xkb formated string output safely (CVE-2017-13723) + + Generating strings for XKB data used a single shared static buffer, + which offered several opportunities for errors. Use a ring of + resizable buffers instead, to avoid problems when strings end up + longer than anticipated. + + Reviewed-by: Michal Srb + Signed-off-by: Keith Packard + Signed-off-by: Julien Cristau + (cherry picked from commit 94f11ca5cf011ef123bd222cabeaef6f424d76ac) + +commit 3094c4c6d879215923f2183ecd048b4f5429b182 +Author: Michal Srb +Date: Thu Jul 27 11:54:26 2017 +0200 + + xkb: Escape non-printable characters correctly. + + XkbStringText escapes non-printable characters using octal numbers. Such escape + sequence would be at most 5 characters long ("\0123"), so it reserves 5 bytes + in the buffer. Due to char->unsigned int conversion, it would print much longer + string for negative numbers. + + Reviewed-by: Keith Packard + Signed-off-by: Julien Cristau + (cherry picked from commit eaf1f72ed8994b708d94ec2de7b1a99f5c4a39b8) + +commit a510fb811100bc27f0bfafe5d073998551161819 +Author: Michal Srb +Date: Fri Jul 28 16:27:10 2017 +0200 + + Xext/shm: Validate shmseg resource id (CVE-2017-13721) + + Otherwise it can belong to a non-existing client and abort X server with + FatalError "client not in use", or overwrite existing segment of another + existing client. + + Signed-off-by: Julien Cristau + (cherry picked from commit b95f25af141d33a65f6f821ea9c003f66a01e1f1) + +commit 3cea13cc40e2421ebefcf2ee0eb949a7bc4e63fd +Author: Adam Jackson +Date: Fri Jun 16 15:44:47 2017 -0400 + + dmx: Remove some not-very-interesting debug prints + + gcc/glibc think the snprintf in dmxExecOS() might truncate. Yes, it + might, and we also don't care. Just delete all this. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + (cherry picked from commit d6db66811643d3762716f6b144a7358572216a4f) + +commit 320e48c9217a8bdcd07dc8ce4aebec043e4afa3c +Author: Adam Jackson +Date: Fri Jun 16 15:44:46 2017 -0400 + + dmx: Silence an unused-result warning + + Modern glibc is very insistent that you care about whether write() + succeeds: + + ../hw/dmx/input/usb-keyboard.c: In function ‘kbdUSBCtrl’: + ../hw/dmx/input/usb-keyboard.c:292:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] + write(priv->fd, &event, sizeof(event)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + (cherry picked from commit 17ad6e5d5616039021455bc821d6ee2497f7ebde) + +commit c5d409a292008c4219c77a1bdb7621eb0ac42991 +Author: Jon TURNEY +Date: Mon Jun 26 14:54:04 2017 +0100 + + Move statically linked xorgxkb files from dixmods to a separate directory + + [ajax: Fixed test/Makefile.am as well] Reviewed-by: Adam Jackson - (cherry picked from commit e156c0ccb530897d3a428255bd5585f7ea7b9b41) + (cherry picked from commit fbdd73fac68383c93f6f5c6a7615860503039999) -commit 3c4cead499f10dabac20ab87728746ec41dae799 +commit 359186b13bc6ea6d8c3340c392c0aba5b9376a5d +Author: Dawid Kurek +Date: Thu Jul 6 14:51:11 2017 +0200 + + modesetting: Blacklist EVDI devices from PRIME sync + + UDL (usb) devices are blacklisted because of they weird behaviour when + it comes to vblank events. As EVDI uses very similar model of handling + vblanks it should be treated similarly. + + When doing a page flip, EVDI does not wait for real vblank, but + simulates it by adding constant delay. It also does not support + DRM_IOCTL_WAIT_VBLANK. + + In contrast to UDL, EVDI uses platform devices, thus instead of 'usb' in + path they all have 'platform'. + + It is possible to blacklist by 'platform', so without explicitly saying + 'evdi', but it might be misleading when it comes to real reason for it. + + Signed-off-by: Dawid Kurek + (cherry picked from commit fbd80b2c8ebe9fd41229dc5438524d107c071ff1) + +commit 5571318f22f17883e26977a4c72e1e46d17bdf5d +Author: Keith Packard +Date: Mon Sep 25 16:18:22 2017 -0700 + + modesetting: Skip no-longer-present connectors when resetting BAD links + + Outputs may have NULL mode_output (connector) pointers if the + connector disappears while the server is running. Skip these when + resetting outputs with BAD link status. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + (cherry picked from commit 37f4e7651a2fd51efa613a08a1e705553be33e76) + +commit 787655d5df0c8c43e5e424af3e6e35b8daf54a7d +Author: Martin Peres +Date: Mon Apr 10 16:48:21 2017 +0300 + + modesetting: re-set the crtc's mode when link-status goes BAD + + Despite all the careful planning of the kernel, a link may become + insufficient to handle the currently-set mode. At this point, the + kernel should mark this particular configuration as being broken + and potentially prune the mode before setting the offending connector's + link-status to BAD and send the userspace a hotplug event. This may + happen right after a modeset or later on. + + Upon receiving a hot-plug event, we iterate through the connectors to + re-apply the currently-set mode on all the connectors that have a + link-status property set to BAD. The kernel may be able to get the + link to work by dropping to using a lower link bpp (with the same + display bpp). However, the modeset may fail if the kernel has pruned + the mode, so to make users aware of this problem a warning is outputed + in the logs to warn about having a potentially-black display. + + This patch does not modify the current behaviour of always propagating + the events to the randr clients. This allows desktop environments to + re-probe the connectors and select a new resolution based on the new + (currated) mode list if a mode disapeared. This behaviour is expected in + order to pass the Display Port compliance tests. + + Signed-off-by: Martin Peres + Reviewed-by: Eric Anholt + (cherry picked from commit bcee1b76aa0db8525b491485e90b8740763d7de6) + +commit 126144c2355ce5a3a350f15ef97389c7f34bb6fb +Author: Peter Hutterer +Date: Fri May 5 09:04:35 2017 +1000 + + xfree86: up the path name size to 512 in xf86MatchDriverFromFiles + + ./hw/xfree86/common/xf86pciBus.c: In function ‘xf86MatchDriverFromFiles’: + ../hw/xfree86/common/xf86pciBus.c:1330:52: warning: ‘snprintf’ output may be + truncated before the last format character [-Wformat-truncation=] + snprintf(path_name, sizeof(path_name), "%s/%s", ^~~~~~~ + ../hw/xfree86/common/xf86pciBus.c:1330:13: note: ‘snprintf’ output between 2 + + dirent->d_name is 256, so sprintf("%s/%s") into a 256 buffer gives us: + + and 257 bytes into a destination of size 256 + + Signed-off-by: Peter Hutterer + (cherry picked from commit 96af794dc648eadcd596893412d7530e92cb5421) + +commit a114286c079c42067b001ac330501496e2e297a1 +Author: Peter Hutterer +Date: Wed Sep 6 11:53:02 2017 +1000 + + test: fix compiler warning + + signal-logging.c:182:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] + + Signed-off-by: Peter Hutterer + (cherry picked from commit ea82ececbf85a7ac3d0931687f44c57534fde17c) + +commit d230e12d7dac4461626d0c6edfd692571592a280 +Author: Nick Sarnie +Date: Sat Sep 23 17:35:48 2017 -0400 + + suid: Include sysmacros.h to fix build after glibc-2.25 + + [Added HAVE_SYS_SYSMACROS_H guard - ajax] + + Signed-off-by: Nick Sarnie + Reviewed-by: Adam Jackson + (cherry picked from commit 84e3b96b531363e47f6789aacfcae4aa60135e2e) + +commit c5320244a3501aaf9558715e9097a2a625cb768b Author: Adam Jackson -Date: Mon Mar 28 18:11:09 2016 +0900 +Date: Thu Apr 27 14:45:25 2017 -0400 - os: Treat ssh as a non-local client (v4) + xfree86: Silence a new glibc warning - By the time we get to ComputeLocalClient, we've already done - NextAvailableClient → ReserveClientIds → DetermineClientCmd (assuming - we're built with #define CLIENTIDS), so we can look up the name of the - client process and refuse to treat ssh's X forwarding as if it were - local. - - v2: (Michel Dänzer) - * Only match "ssh" itself, not other executable names starting with - that prefix. - * Ignore executable path for the match. - v3: (Michel Dänzer) - * Use GetClientCmdName (Mark Kettenis) - * Perform check on Windows as well, but only ignore path on Cygwin - (Martin Peres, Emil Velikov, Jon Turney) - v4: (Michel Dänzer) - * Cut of any colon and whatever comes after it. (Adam Jackson) - * Add bugzilla reference. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261 + glibc would like to stop declaring major()/minor() macros in + because that header gets included absolutely everywhere + and unix device major/minor is perhaps usually not what's expected. Fair + enough. If one includes as well then glibc knows we + meant it and doesn't warn, so do that if it exists. Signed-off-by: Adam Jackson - Signed-off-by: Michel Dänzer - (cherry picked from commit adefbaee499b9679c6cac21f52ec6545af2b36b5) + (cherry picked from commit d732c36597fab2e9bc4f2aa72cf1110997697557) -commit aebfc6ad9be5bd33b7e0a813d424c81d6214ab07 +commit 0e79797e3cb3f8fafe271f4f233a8a8fd25f2001 +Author: Adam Jackson +Date: Wed Aug 30 15:11:45 2017 -0400 + + os: Fix warning in LockServer + + The meson build gives me: + + ../os/utils.c: In function ‘LockServer’: + ../os/utils.c:310:40: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] + snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid()); + ^~~~~~~~~ + ../os/utils.c:310:5: note: ‘snprintf’ output between 12 and 13 bytes into a destination of size 12 + snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid()); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Which seems to be due to the %d part meaning that a negative number's - + sign would be one wider than we're expecting. Fine, just coerce it to + unsigned. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + (cherry picked from commit aabf65d2a0206bd1a9c6e9a9f3153ded873dfd43) + +commit 69ab094a08513849bb68cd2750840e88db6e5933 +Author: Olivier Fourdan +Date: Wed Jul 26 16:00:38 2017 +0200 + + glamor: Avoid overflow between box32 and box16 box + + glamor_compute_transform_clipped_regions() uses a temporary box32 + internally which is copied back to a box16 to init the regions16, + thus causing a potential overflow. + + If an overflow occurs, the given region is invalid and the pixmap + init region will fail. + + Simply check that the coordinates won't overflow when copying back to + the box16, avoiding a crash later down the line in glamor. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101894 + Signed-off-by: Olivier Fourdan + Tested-by: Fabrice Bellet + Reviewed-by: Adam Jackson + (cherry picked from commit 9869dcb349b49f6d4cc2fab5d927cd8b1d1f463c) + +commit 421814bc81ba8dfaa9be59b8b35b3a9114dbcb8b +Author: Olivier Fourdan +Date: Wed Jul 26 16:00:37 2017 +0200 + + glamor: handle NULL source picture + + COMPOSITE_REGION() can pass NULL as a source picture, make sure we + handle that nicely in both glamor_composite_clipped_region() and + glamor_composite_choose_shader(). + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101894 + Signed-off-by: Olivier Fourdan + Reviewed-by: Adam Jackson + (cherry picked from commit bd353e9b84e013fc34ed730319d5b63d20977903) + +commit baa25315014af350c9c04c2c83beeee36aead042 +Author: Olivier Fourdan +Date: Thu Aug 31 10:23:00 2017 +0200 + + xwayland: Fix a segfault with pointer locking + + Xwayland would crash in some circumstances while trying to issue a + pointer locking when the cursor is hidden when there is no seat focus + window set. + + The crash signature looks like: + + #0 zwp_pointer_constraints_v1_lock_pointer () + #1 xwl_pointer_warp_emulator_lock () at xwayland-input.c:2584 + #2 xwl_seat_maybe_lock_on_hidden_cursor () at xwayland-input.c:2756 + #3 xwl_seat_maybe_lock_on_hidden_cursor () at xwayland-input.c:2765 + #4 xwl_seat_cursor_visibility_changed () at xwayland-input.c:2768 + #5 xwl_set_cursor () at xwayland-cursor.c:245 + #6 miPointerUpdateSprite () at mipointer.c:468 + #7 miPointerDisplayCursor () at mipointer.c:206 + #8 CursorDisplayCursor () at cursor.c:150 + #9 AnimCurDisplayCursor () at animcur.c:220 + #10 ChangeToCursor () at events.c:936 + #11 ActivatePointerGrab () at events.c:1542 + #12 GrabDevice () at events.c:5120 + #13 ProcGrabPointer () at events.c:4908 + #14 Dispatch () at dispatch.c:478 + #15 dix_main () at main.c:276 + + xwl_pointer_warp_emulator_lock() tries to use the surface from the + xwl_seat->focus_window leading to a NULL pointer dereference when that + value is NULL. + + Check that xwl_seat->focus_window is not NULL earlier in the stack in + xwl_seat_maybe_lock_on_hidden_cursor() and return early if not the case + to avoid the crash. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=102474 + Signed-off-by: Olivier Fourdan + Acked-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit cdd0352ba05d4d8482aaca41797e05d40e58da36) + +commit 6f29c8375281c0337ab94f7919a70c20149b0fc6 +Author: Michal Srb +Date: Fri Jul 7 17:21:46 2017 +0200 + + Xi: Test exact size of XIBarrierReleasePointer + + Otherwise a client can send any value of num_barriers and cause reading or swapping of values on heap behind the receive buffer. + + Signed-off-by: Peter Hutterer + (cherry picked from commit 211e05ac85a294ef361b9f80d689047fa52b9076) + +commit c8eb79c1834cef5657e227844111052e0dd78661 +Author: Rodrigo Vivi +Date: Thu Jun 29 13:29:58 2017 -0700 + + dri2: Sync i965_pci_ids.h from Mesa. + + Copied from Mesa with no modifications. + + Gives us Coffee Lake and Cannon Lake PCI IDs. + + Signed-off-by: Rodrigo Vivi + Acked-by: Kenneth Graunke + (cherry picked from commit abb031e731f5c159add1b3351de9c4bb121bf00a) + +commit 37815323721790c4311faff9743f4d2f902b5506 +Author: Adam Jackson +Date: Thu Jun 29 10:32:00 2017 -0400 + + wayland: Sync drm.xml with Mesa + + ... where it is named src/egl/wayland/wayland-drm/wayland-drm.xml and + has its requests sorted by protocol version number, avoiding a warning + from wayland-scanner. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + (cherry picked from commit 04511a0476b5c860e7d157b01080dff94d935f74) + +commit 0934d56dc804780f3e83ae0153c797d392e6faba +Author: Michel Dänzer +Date: Fri Jun 16 11:30:03 2017 +0900 + + xfree86/modes: Use RRTransformEqual in xf86RandR12CrtcSet + + The memcmp didn't catch when e.g. only the filter changed. Tested by + alternately running + + xrandr --output DVI-I-0 --scale-from 3840x2160 --filter bilinear + xrandr --output DVI-I-0 --scale-from 3840x2160 --filter nearest + + Reviewed-by: Aaron Plattner + (cherry picked from commit 4212c884c423e5ce2cd3b4d67c0d656475fddc79) + +commit 358f0bcd4f6703302b8895e42e20d1cbdfff102e +Author: Aaron Plattner +Date: Thu Jun 15 14:28:27 2017 -0700 + + randr: Use RRTransformEqual in RRCrtcPendingTransform + + Currently, RRCrtcPendingTransform returns false unless the + transformation matrix itself is changing. This makes RRCrtcSet skip + doing anything if the only thing that is changing is the transform + filter. + + There's already a function for comparing RRTransformPtrs, so use that + instead. + + Tested by running + + xrandr --output DP-1 --mode 1920x1080 --rate 144 --scale 0.5x0.5 --filter nearest + + follwed by + + xrandr --output DP-1 --mode 1920x1080 --rate 144 --scale 0.5x0.5 --filter bilinear + + Signed-off-by: Aaron Plattner + Reviewed-and-Tested-by: Michel Dänzer + (cherry picked from commit 091af80be48c37f16c679d35fc12ad33e6b0cd74) + +commit ed8fbabacac3cd4c7798bd36713894a2068cee13 +Author: Michal Srb +Date: Wed May 24 15:54:42 2017 +0300 + + Xi: Do not try to swap GenericEvent. + + The SProcXSendExtensionEvent must not attempt to swap GenericEvent because + it is assuming that the event has fixed size and gives the swapping function + xEvent-sized buffer. + + A GenericEvent would be later rejected by ProcXSendExtensionEvent anyway. + + Signed-off-by: Michal Srb + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit ba336b24052122b136486961c82deac76bbde455) + +commit e8f6a1bb77cbd1bb30d8dc956c5fdc98e25a22aa +Author: Michal Srb +Date: Wed May 24 15:54:41 2017 +0300 + + Xi: Verify all events in ProcXSendExtensionEvent. + + The requirement is that events have type in range + EXTENSION_EVENT_BASE..lastEvent, but it was tested + only for first event of all. + + Signed-off-by: Michal Srb + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 8caed4df36b1f802b4992edcfd282cbeeec35d9d) + +commit 21f559038c8776acc6439faadbdcab7df4300c66 +Author: Michal Srb +Date: Wed May 24 15:54:40 2017 +0300 + + dix: Disallow GenericEvent in SendEvent request. + + The SendEvent request holds xEvent which is exactly 32 bytes long, no more, + no less. Both ProcSendEvent and SProcSendEvent verify that the received data + exactly match the request size. However nothing stops the client from passing + in event with xEvent::type = GenericEvent and any value of + xGenericEvent::length. + + In the case of ProcSendEvent, the event will be eventually passed to + WriteEventsToClient which will see that it is Generic event and copy the + arbitrary length from the receive buffer (and possibly past it) and send it to + the other client. This allows clients to copy unitialized heap memory out of X + server or to crash it. + + In case of SProcSendEvent, it will attempt to swap the incoming event by + calling a swapping function from the EventSwapVector array. The swapped event + is written to target buffer, which in this case is local xEvent variable. The + xEvent variable is 32 bytes long, but the swapping functions for GenericEvents + expect that the target buffer has size matching the size of the source + GenericEvent. This allows clients to cause stack buffer overflows. + + Signed-off-by: Michal Srb + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 215f894965df5fb0bb45b107d84524e700d2073c) + +commit cdf15ab8f94d54bce72f37653fc46daf482b1671 +Author: Michal Srb +Date: Wed May 24 15:54:39 2017 +0300 + + Xi: Zero target buffer in SProcXSendExtensionEvent. + + Make sure that the xEvent eventT is initialized with zeros, the same way as + in SProcSendEvent. + + Some event swapping functions do not overwrite all 32 bytes of xEvent + structure, for example XSecurityAuthorizationRevoked. Two cooperating + clients, one swapped and the other not, can send + XSecurityAuthorizationRevoked event to each other to retrieve old stack data + from X server. This can be potentialy misused to go around ASLR or + stack-protector. + + Signed-off-by: Michal Srb + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 05442de962d3dc624f79fc1a00eca3ffc5489ced) + +commit 3a53e4407fb9e0c0e0dbf8d147b67f6e36aea5ae +Author: Michel Dänzer +Date: Tue Jun 6 18:42:06 2017 +0900 + + glamor: Fix temporary pixmap coordinate offsets + + The previous values happened to work in basic cases, but not in general + if the destination is a subwindow or has a border. + + Fixes crash with xli, which moves a large subwindow inside a smaller + parent window for scrolling. + + No regressions with xterm, x11perf -copyplane or the xscreensaver + phosphor hack. + + Bug: https://bugs.debian.org/857983 + Reviewed-by: Keith Packard + (cherry picked from commit ffda82ed04d28feae2e001dbd0c32d6c795d90b1) + +commit 87a7393799ab5d1ea4a19ae7687cd50ac0dceeb4 +Author: Adam Jackson +Date: Mon Jun 12 14:43:23 2017 -0400 + + modesetting: Validate the atom for enum properties + + The client could have said anything here, and if what they said doesn't + actually name an atom NameForAtom() will return NULL, and strcmp() will + be unhappy about that. + + Signed-off-by: Adam Jackson + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit d4995a3936ae283b9080fdaa0905daa669ebacfc) + +commit faeee7646695261e60ea03d934a0c496a429f31b +Author: Carlos Garnacho +Date: Sun May 28 15:56:21 2017 +0200 + + Xi: Use WarpPointerProc hook on XI pointer warping implementation + + Just like we do with XWarpPointer's. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 95febc42cadf392a888104ad6d5cf4f34fdde7d5) + +commit c6df0d03de22b57d5faa77b19ac1ec0311f4f3a5 +Author: Carlos Garnacho +Date: Sun May 28 15:56:20 2017 +0200 + + xwayland: Lock the pointer if it is confined and has no cursor + + In the typical pattern in games of "hide cursor, grab with a confineTo, + warp constantly the pointer to the middle of the window" the last warping + step is actually rather optional. Some games may choose to just set up a + grab with confineTo argument, and trust that they'll get correct relative + X/Y axis values despite the hidden cursor hitting the confinement window + edge. + + To cater for these cases, lock the pointer whenever there is a pointer + confinement and the cursor is hidden. This ensures the pointer position + is in sync with the compositor's when it's next shown again, and more + importantly resorts to the relative pointer for event delivery. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit ca17f3e9fd3b59fdc5ffd0e5d78e4db6ddc87aa1) + +commit 2ccea152c091e25474a83588e18475567471e7c8 +Author: Carlos Garnacho +Date: Sun May 28 15:56:19 2017 +0200 + + xwayland: Update root window size when desktop size changes + + This fixes grabs on InputOnly windows whose parent is the root window + failing with GrabNotViewable. This is due to window->borderSize/windowSize + being computed as clipped by its parent, resulting in a null region. + + Setting up the right size on the root window makes the InputOnly size + correct too, so the GrabNotViewable paths aren't hit anymore. + + Signed-off-by: Carlos Garnacho + Acked-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 513e3bd3870fdb8a8e0e2e52c0fa93872300bc8b) + +commit 0e5b08f2eef946e9d9d071f0a79ead379419d8a7 +Author: Carlos Garnacho +Date: Sun May 28 15:56:18 2017 +0200 + + xwayland: "Accept" confineTo on InputOnly windows + + Of sorts, actually make it confine to the pointer focus, as the + InputOnly window is entirely invisible to xwayland accounting, + we don't have a xwl_window for it. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit fafdb0cc9697eb53635ed1e78bec1d4cd87ab3a2) + +commit 420f77a1ba8bfbbf8c06f6dd57e9ee36124b7360 +Author: Carlos Garnacho +Date: Sun May 28 15:56:17 2017 +0200 + + xwayland: Allow pointer warp on root/None window + + Of sorts, as we can't honor pointer warping across the whole root window + coordinates, peek the pointer focus in these cases. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit c217fcb4c4640ffd2fefee63c6fcd7ea5e64b942) + +commit 40edd409bfc527223dfae89c7f84fea0721dec49 +Author: Michel Dänzer +Date: Fri May 26 12:30:13 2017 +0900 + + glamor: Store the actual EGL/GLX context pointer in lastGLContext + + Fixes subtle breakage which could sometimes trigger after a server reset + with multiple screens using glamor: + + Screen A enters glamor_close_screen last and calls various cleanup + functions, which at some point call glamor_make_current to make sure + screen A's GL context is current. This sets lastGLContext to screen A's + &glamor_priv->ctx. Finally, glamor_close_screen calls + glamor_release_screen_priv, which calls free(glamor_priv). + + Later, screen B enters glamor_init, which allocates a new glamor_priv. + With bad luck, this can return the same pointer which was previously + used for screen A's glamor_priv. So when screen B's glamor_init calls + glamor_make_current, lastGLContext == &glamor_priv->ctx, so MakeCurrent + isn't called for screen B's GL context, and the following OpenGL API + calls triggered by glamor_init mess up screen A's GL context. + + The observed end result of this was a crash in glamor_get_vbo_space + because glamor_priv->vbo didn't match the GL context, though there might + be other possible outcomes. + + Assigning the actual GL context pointer to lastGLContext prevents this + by preventing the false negative test in glamor_make_current. + + Reviewed-by: Keith Packard + Reviewed-by: Eric Anholt + (cherry picked from commit 7c88977d338a01aca866e52c9e736f8857fb9ae4) + +commit 7c4f7b3a49a43984ab90788b85b35078feadf42a +Author: Lyude +Date: Tue May 30 16:39:49 2017 -0400 + + xwayland: Don't load extension list more than once + + When running an Xwayland server from the command line, we end up + resetting the server every time all of the clients connected to the + server leave. This would be fine, except that xwayland makes the mistake + of unconditionally calling LoadExtensionList(). This causes us to setup + the glxExtension twice in a row which means that when we lose our last + client on the second server generation, we end up trying to call the glx + destructors twice in a row resulting in a segfault: + + (EE) + (EE) Backtrace: + (EE) 0: Xwayland (OsSigHandler+0x3b) [0x4982f9] + (EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x70845bf] + (EE) 2: /usr/lib64/dri/swrast_dri.so (__driDriverGetExtensions_virtio_gpu+0x32897d) [0x1196e5bd] + (EE) 3: /usr/lib64/dri/swrast_dri.so (__driDriverGetExtensions_virtio_gpu+0x328a45) [0x1196e745] + (EE) 4: /usr/lib64/dri/swrast_dri.so (__driDriverGetExtensions_virtio_gpu+0x32665f) [0x11969f7f] + (EE) 5: Xwayland (__glXDRIscreenDestroy+0x30) [0x54686e] + (EE) 6: Xwayland (glxCloseScreen+0x3f) [0x5473db] + (EE) 7: Xwayland (glxCloseScreen+0x53) [0x5473ef] + (EE) 8: Xwayland (dix_main+0x7b6) [0x44c8c9] + (EE) 9: Xwayland (main+0x28) [0x61c503] + (EE) 10: /lib64/libc.so.6 (__libc_start_main+0xf1) [0x72b1401] + (EE) 11: Xwayland (_start+0x2a) [0x4208fa] + (EE) 12: ? (?+0x2a) [0x2a] + (EE) + (EE) Segmentation fault at address 0x18 + (EE) + Fatal server error: + (EE) Caught signal 11 (Segmentation fault). Server aborting + (EE) + + Easy reproduction recipe: + - Start an Xwayland session with the default settings + - Open a window + - Close that window + - Open another window + - Close that window + - Total annihilation occurs + + Signed-off-by: Lyude + Reviewed-by: Michel Dänzer + Signed-off-by: Peter Hutterer + (cherry picked from commit 4f29366f1e5678505fb882143c9b4a892d5b8273) + +commit d8f63717e05ae8d820ceae74216916ebd180441d +Author: Jason Gerecke +Date: Fri May 26 14:27:19 2017 -0700 + + xfree86: Fix interpretation of xf86WaitForInput timeout + + Commit aa6717ce2 switched xf86WaitForInput from using select(2) to using + poll(2). Before this change, the timeout was interpreted as being in + microseconds; afterwards it is fed directly to xorg_poll which interprets + it as being in milliseconds. This results in the function potentially + blocking 1000x longer than intended. This commit scales down the timeout + argument before passing it to xorg_poll, being careful to ensure the result + is not rounded down due to integer division. + + Signed-off-by: Jason Gerecke + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 2fbf62b2fb3dcb29551251d09aa695715bb754f4) + +commit 444929b446a0ef5873d6346c3f3091adb8fbe6bb +Author: Keith Packard +Date: Wed May 10 21:50:45 2017 -0700 + + dix: Remove clients from input and output ready queues after closing + + Delay removing the client from these two queues until all potential + I/O has completed in case we mark the client as ready for reading or + with pending output during the close operation. + + Bugzilla: https://bugs.freedesktop.org/100957 + Signed-off-by: Keith Packard + Tested-by: Nick Sarnie + Reviewed-by: Michel Dänzer + (cherry picked from commit d9e23ea4228575344e3b4c0443cecc5eb75356e4) + +commit d808b573992ae1fc7706d8897a92783b847040e3 +Author: Keith Packard +Date: Sat Apr 29 00:26:10 2017 -0700 + + os: Mark client as ready to read when closing due to write failure [100863] + + This makes sure the server will go look at the client again, notice + that the FD is no longer valid and close the client down. + + Bugzilla: https://bugs.freedesktop.org/100863 + Signed-off-by: Keith Packard + Reviewed-and-Tested-by: Michel Dänzer + (cherry picked from commit e2f68296ffb8e40035c0ebd949b67d1e2e424e11) + +commit 7a2525fba60a04a95a4a8b26c2b628dc8fdfdeff +Author: Keith Packard +Date: Sat Apr 29 00:21:47 2017 -0700 + + os: un-duplicate code to close client on write failure + + There are three copies of the same short sequence of operations to + close down a client when a write error occurs. Create a new function, + AbortClient, which performs these operations and then call it from the + three places. + + Signed-off-by: Keith Packard + Reviewed-and-Tested-by: Michel Dänzer + (cherry picked from commit a82971b07035ee9a4e3ed01326e7c1eab34b5a19) + +commit b3de3ebcf450fd4ab1543dd2f133e45e9c0b9e7e +Author: Michel Dänzer +Date: Wed Apr 26 18:31:08 2017 +0900 + + os: Handle SIGABRT + + Without this, assertion failures can make life hard for users and those + trying to help them. + + v2: + * Change commit log wording slightly to "can make life hard", since + apparently e.g. logind can alleviate that somewhat. + * Set default handler for SIGABRT in + hw/xfree86/common/xf86Init.c:InstallSignalHandlers() and + hw/xquartz/quartz.c:QuartzInitOutput() (Eric Anholt) + + Reviewed-by: Eric Anholt + Signed-off-by: Michel Dänzer + (cherry picked from commit 27a6b9f7c84c914d0f5909ec1069d72f5035bc04) + +commit e59a32c897c9f093f54ce4b695e9aff1ba20bda2 +Author: Olivier Fourdan +Date: Fri Apr 21 09:05:51 2017 +0200 + + glamor: an FBO is not needed for Xv pixmaps + + It appears that on some hardware/diver combo such as nv30/nouveau, using + GL_ALPHA as format for 8-bit depth will cause an incomplete attachment + error (GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT) when trying to bind the + texture. + + As a result, the FBO is NULL and glamor segfaults when trying to access + the FBO width/height in pixmap_priv_get_scale() in glamor_xv_render(). + + This happens with glamor-xv which uses 8-bit pixmaps, meaning that on + such hardware/driver, trying to play a video using Xv will lead to a + crash of the Xserver. This affects Xwayland, Xephyr, modesetting driver + with glamor accel. + + But the use of an FBO is not actually needed for glamox-xv, so by + disabling FBO at pixmap creation, we can avoid the issue entirely. + + Fix suggested by Eric Anholt + + Signed-off-by: Olivier Fourdan + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100710 + Fixes: https://bugzilla.redhat.com/1412814 + Reviewed-by: Eric Anholt + (cherry picked from commit 7bfb87a2137853295ecc9e544a15626cfd773a02) + +commit 6a6bf1ae046124a9d8a6f3f53f02707951c85c43 +Author: Michel Dänzer +Date: Wed Apr 12 17:58:05 2017 +0900 + + xfree86/modes: Make colormap/gamma glue code work with RandR disabled + + E.g. because Xinerama is enabled. + + Fixes crash on startup and wrong colours in that case. + + Bugzilla: https://bugs.freedesktop.org/100293 + Bugzilla: https://bugs.freedesktop.org/100294 + Fixes: 62f44052573b ("xfree86/modes: Move gamma initialization to + xf86RandR12Init12 v2") + Tested-by: Mariusz Bialonczyk + Reviewed-by: Alex Deucher + (cherry picked from commit 41dafcc2a2942fc4c94ce3cbafc4a1b413c460c3) + +commit 74126530c0c22cf3e5f8bd2dd2740fded2df098f +Author: Adam Jackson +Date: Fri Apr 7 10:24:54 2017 -0400 + + xephyr: Check for host XVideo support before trying to use it + + Otherwise xcb will treat our attempt to send xv requests as a connection + error (quite reasonably: we're asking it to emit a request for which + there is no defined major opcode), and we'll die quietly the first time + we hit KdBlockhandler. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + (cherry picked from commit 14d2fe74f4e51c5b37eab4b7475c804a0340b530) + +commit 60ae865a703cb2c51c0b00cd768a46a20d79f0f1 +Author: Daniel Stone +Date: Fri Apr 7 14:27:58 2017 +0100 + + modesetting: Set correct DRM event context version + + DRM_EVENT_CONTEXT_VERSION is the latest context version supported by + whatever version of libdrm is present. modesetting was blindly asserting + it supported whatever version that may be, even if it actually didn't. + + With libdrm 2.4.78, setting a higher context version than 2 will attempt + to call the page_flip_handler2 vfunc if it was non-NULL, which being a + random chunk of stack memory, it might well have been. + + Set the version as 2, which should be bumped only with the appropriate + version checks. + + Reviewed-by: Adam Jackson + Signed-off-by: Daniel Stone + (cherry picked from commit 0c8e6ed85810e96d84173a52d628863802a78d82) + +commit df4d01e6aa957ec8eb2814832de2f78ca42ee238 +Author: Tobias Stoeckmann +Date: Sun Mar 12 14:21:38 2017 +0100 + + dmx: Fix null pointer dereference + + A null pointer dereference can occur in dmxSync, because TimerForce + does not handle a null pointer. + + dmxSyncTimer is set to NULL a few lines above on a certain condition, + which happened on my machine. The explicit NULL check allowed me to + start Xdmx again without a segmentation fault. + + Reviewed-by: Adam Jackson + (cherry picked from commit 21eda7464d0e13ac6558edaf6531c3d3251e05df) + +commit e23000d83f8dbab4effd9f344f3d776634a1d56e +Author: Tobias Stoeckmann +Date: Sun Mar 19 17:55:07 2017 +0100 + + record: Fix OOB access in ProcRecordUnregisterClients + + If a client sends a RecordUnregisterClients request with an nClients + field larger than INT_MAX / 4, an integer overflow leads to an + out of boundary access in RecordSanityCheckClientSpecifiers. + + An example line with libXtst would be: + XRecordUnregisterClients(dpy, rc, clients, 0x40000001); + + Reviewed-by: Adam Jackson + (cherry picked from commit 40c12a76c2ae57adefd3b1d412387ebbfe2fb784) + +commit 3166138ea681537dbe164e2888ccb96bb022220b +Author: Kenneth Graunke +Date: Fri Mar 17 13:45:04 2017 -0700 + + dri2: Sync i965_pci_ids.h from Mesa. + + Copied from Mesa with no modifications. Gives us Geminilake PCI IDs. + + Signed-off-by: Kenneth Graunke + Acked-by: Eric Anholt + (cherry picked from commit 368f60d461421fe5e2bbd90652d6ac858dbff8fe) + +commit 2191f9b49e5e542e39f451d1819de00043a90e8f +Author: Olivier Fourdan +Date: Fri Mar 17 15:58:26 2017 +0100 + + glamor: avoid a crash if texture allocation failed + + Texture creation in _glamor_create_tex() can fail if a GL_OUT_OF_MEMORY + is raised, in which case the texture returned is zero. + + But the texture value is not checked in glamor_create_fbo() and glamor + will abort in glamor_pixmap_ensure_fb() because the fbo->tex is 0: + + Truncated backtrace: + Thread no. 1 (10 frames) + #4 glamor_pixmap_ensure_fb at glamor_fbo.c:57 + #5 glamor_create_fbo_from_tex at glamor_fbo.c:112 + #6 glamor_create_fbo at glamor_fbo.c:159 + #7 glamor_create_fbo_array at glamor_fbo.c:210 + #8 glamor_create_pixmap at glamor.c:226 + #9 compNewPixmap at compalloc.c:536 + #10 compAllocPixmap at compalloc.c:605 + #11 compCheckRedirect at compwindow.c:167 + #12 compRealizeWindow at compwindow.c:267 + #13 RealizeTree at window.c:2617 + + Check the value returned by _glamor_create_tex() in glamor_create_fbo() + and return NULL in the texture is zero. + + All callers of glamor_create_fbo() actually check the returned value and + will use a fallback code path if it's NULL. + + Please cherry-pick this to active stable branches. + + Bugzilla: https://bugzilla.redhat.com/1433305 + Signed-off-by: Olivier Fourdan + Reviewed-by: Eric Anholt + (cherry picked from commit 8805a48ed35afb2ca66315656c1575ae5a01c639) + +commit 0f3196bf805b1d36b786852096dd86be290a2c9d +Author: Adam Jackson +Date: Fri Mar 17 12:40:03 2017 -0400 + + ephyr: Don't clobber bitsPerPixel when using glamor + + This ends up passing 0 as the bpp argument to fb screen setup, which is + not really the best plan. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + (cherry picked from commit 83c4297d2c4fd501a9d36bc0cb7d357a8d22394c) + +commit c58bff7e9601b3eeb0be95c0a60c6588d051e923 +Author: Eric Anholt +Date: Wed Mar 15 17:51:46 2017 -0700 + + glamor: Fix dashed line rendering. + + We were binding the screen pixmap as the dash and sampling its alpha, + which is usually just 1.0 (no dashing at all). + + Please cherry-pick this to active stable branches. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + Reviewed-by: Michel Dänzer + (cherry picked from commit fe0b297420fc1de8a7fab28457d0864b3182e967) + +commit 2f36c6faa0dac168cee6049d7dfac59a5e32edcd +Author: Adam Jackson +Date: Wed Nov 2 12:49:25 2016 -0400 + + xinerama: Implement graphics exposures for window->pixmap copies (v4) + + This code is using GetImage to accumulate a logical view of the window + image (since the windows will be clipped to their containing screen), + and then PutImage to load that back into the pixmap. What it wasn't + doing was constructing a region for the obscured areas of the window and + emitting graphics exposures for same. + + v2: Fix coordinate translation when the source is the root window + v3: Create sourceBox with the right coordinates initially instead of + translating (Keith Packard) + v4: Clamp the region to 15 bits to avoid overflow (Keith Packard) + + Signed-off-by: Adam Jackson + (cherry picked from commit e337de2d488a124e5fee0fdcb882567b68f1767d) + +commit 8c609764004560081bad23ac14e7d3975e83ce6b +Author: Adam Jackson +Date: Mon Jan 23 11:31:36 2017 -0500 + + parser: Fix crash when xf86nameCompare(s1 = x, s2 = NULL) + + Signed-off-by: Adam Jackson + (cherry picked from commit f1f865e909090406841a9b9416ea6259a75c2086) + +commit 9db3361b29396684122b3db056368e927e8de6d6 +Author: Olivier Fourdan +Date: Tue Mar 14 15:06:34 2017 +0100 + + glamor: Check glamor_set_destination_drawable() return value + + Check the value returned by glamor_set_destination_drawable() and use + the fallback code path where possible. + + Bugzilla: https://bugzilla.redhat.com/1417575 + Signed-off-by: Olivier Fourdan + (cherry picked from commit 455051a0f1d2bc84f605c325f647bd64d414c47d) + +commit 703ba42ce658faadb3d8ad32ea03fa9c9f0c91b1 +Author: Olivier Fourdan +Date: Tue Mar 14 14:58:26 2017 +0100 + + glamor: glamor_set_destination_drawable() can fail + + The fbo_array of a given glamor pixmap can be NULL in some cases, as + glamor_create_fbo_array() can fail to allocate the FBO array. + + If this is the case, glamor_pixmap_fbo_at() will return NULL even though + the box index is valid, and glamor_set_destination_drawable() simply + assumes glamor_pixmap_fbo_at() will return an FBO prior to pass the + value to glamor_set_destination_pixmap_fbo(), which will segfault. + + We need a way for glamor_set_destination_drawable() to fail safely and + let the caller know about the failure. + + Add a boolean return value to glamor_set_destination_drawable() for that + purpose. + + Bugzilla: https://bugzilla.redhat.com/1417575 + Signed-off-by: Olivier Fourdan + (cherry picked from commit 04b4bad7c048fd077fe839f10634c99ef1e488af) + +commit 52ab10aa9a98076227e7db40fcd4b19b55a66861 +Author: Olivier Fourdan +Date: Tue Mar 14 15:22:32 2017 +0100 + + Xephyr: Check screen resources creation success + + If the screen pixmap or the corresponding texture creation with glamor + fails, exit cleanly with an error message instead of segfaulting. + + Fixes: https://bugzilla.redhat.com/1431633 + Reviewed-by: Michel Dänzer + Signed-off-by: Olivier Fourdan + (cherry picked from commit b0ce1d088a863492f5de11e4dbde10af4261d892) + +commit 2a47e328641c061d73b3fc4602343500d18500c1 +Author: Olivier Fourdan +Date: Tue Mar 14 15:22:31 2017 +0100 + + glamor: Check for NULL pixmap in glamor_get_pixmap_texture() + + glamor_create_pixmap() would return a NullPixmap if the given size is + larger than the maximum size of a pixmap. + + But glamor_get_pixmap_texture() won't check if the given pixmap is + non-null, leading to a segfault if glamor_create_pixmap() failed. + + This can be reproduced by passing Xephyr a very large screen width, + e.g.: + + $ Xephyr -glamor -screen 32768x1024 :10 + + (EE) + (EE) Backtrace: + (EE) 0: Xephyr (OsSigHandler+0x29) + (EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) + (EE) 2: Xephyr (glamor_get_pixmap_texture+0x30) + (EE) 3: Xephyr (ephyr_glamor_create_screen_resources+0xc6) + (EE) 4: Xephyr (ephyrCreateResources+0x98) + (EE) 5: Xephyr (dix_main+0x275) + (EE) 6: /lib64/libc.so.6 (__libc_start_main+0xf1) + (EE) 7: Xephyr (_start+0x2a) + (EE) 8: ? (?+0x2a) [0x2a] + (EE) + (EE) Segmentation fault at address 0x0 + (EE) + Fatal server error: + (EE) Caught signal 11 (Segmentation fault). Server aborting + (EE) + Aborted (core dumped) + + Bugzilla: https://bugzilla.redhat.com/1431633 + Reviewed-by: Michel Dänzer + Signed-off-by: Olivier Fourdan + (cherry picked from commit f40ff18c96e02ff18a367bf53feeb4bd8ee952a0) + +commit d88937ba8354d6a4e0be2a398037443146701ddc +Author: Adam Jackson +Date: Wed Mar 15 13:44:05 2017 -0400 + + xserver 1.19.3 + + Signed-off-by: Adam Jackson + +commit b258ed457d8f22cfba8a45b35a9be9b53fd37e1e +Author: Chris Wilson +Date: Fri Feb 17 08:18:52 2017 +0000 + + os: Fix iteration over busfaults + + Fixes a regression from + + commit 41da295eb50fa08eaacd0ecde99f43a716fcb41a + Author: Keith Packard + Date: Sun Nov 3 13:12:40 2013 -0800 + + Trap SIGBUS to handle truncated shared memory segments + + that causes the SIGBUS handler to fail to chain up correctly and + corrupts nearby memory instead. + + Signed-off-by: Chris Wilson + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit acdb5bf2de57c0080d2a6e730c788a0a428e13dc) + +commit 7c4fab2f1f411b6f7d7adc76271fca7c29365ac4 +Author: Tobias Stoeckmann +Date: Mon Mar 13 19:13:14 2017 +0100 + + render: Fix out of boundary heap access + + ProcRenderCreateRadialGradient and ProcRenderCreateConicalGradient must + be protected against an integer overflow during length check. This is + already included in ProcRenderCreateLinearGradient since the fix for + CVE-2008-2362. + + This can only be successfully exploited on a 32 bit system for an + out of boundary read later on. Validated by using ASAN. + + Reviewed-by: Adam Jackson + (cherry picked from commit ac15d4cecca377c5c31ab852c39bbd554ca48fe2) + +commit fbb46e0be897ffe78b731a2456673b4cbb73b2be +Author: Dr.-Ing. Dieter Jurzitza +Date: Thu Feb 23 12:57:26 2017 -0500 + + glamor: Fix missing declaration in dash vertex shader + + Fixes a GLSL compilation error: + + Failed to compile VS: 0:13(43): error: `pos' undeclared + 0:13(14): error: operands to arithmetic operators must be numeric + 0:13(13): error: operands to arithmetic operators must be numeric + + [1.19: Squash in Michel's typo fix from 0c1574d9] + + Tested-by: Stefan Dirsch + Reviewed-by: Adam Jackson + (cherry picked from commit d8161aeb50891ae10c5656487ce8f982deed5f9f) + (cherry picked from commit 0c1574d9882a91b2c1a046bf4ac5a9b138a37965) + +commit 18fcb66688057f5676952e2535d4bb9942371199 +Author: Olivier Fourdan +Date: Thu Mar 2 10:19:26 2017 +0100 + + xwayland: Monitor client states to destroy callbacks + + In XWayland, dri3_send_open_reply() is called from a sync callback, so + there is a possibility that the client might be gone when we get to the + callback eventually, which leads to a crash in _XSERVTransSendFd() from + WriteFdToClient() . + + Client resources can survive the client itself, in which case we + may end up in our sync callback trying to access client's data after + it's been freed/reclaimed. + + Add a ClientStateCallback handler to monitor the client state changes + and clear the sync callback set up by the glamor drm code if any. + + Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1416553 + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100040 + Tested-by: Mark B + Signed-off-by: Olivier Fourdan + Reviewed-by: Michel Dänzer + (cherry picked from commit 937527f9798d573ec82c2c508821899c229c018f) + +commit d402b86b4561eb2580421de91d977a35abe88190 +Author: Olivier Fourdan +Date: Tue Mar 7 10:28:35 2017 +0100 + + xwayland: clear cursor frame callback + + After an X cursor is unrealized, the seat's corresponding x_cursor is + cleared, but if a frame callback was pending at the time, it will + remain and thus prevent any further cursor update, leaving the window + with no cursor. + + Make sure to destroy the frame callback, if any, when that occurs, so + that next time a cursor needs to be set, it won't be ignored for a frame + callback that will never be triggered. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1389327 + Signed-off-by: Olivier Fourdan + Reviewed-by: Pekka Paalanen + Reviewed-by: Rui Matos + (cherry picked from commit d4b7e0eaa4b2e97ce1dec653a2ae7d9621fe1431) + +commit db1326cd6625747e4036e6cdc75bc7a0e1b0426b +Author: Qiang Yu +Date: Thu Jan 26 18:13:53 2017 +0800 + + present: disable page flip only when a slave crtc is active + + This prevents the tearing of moving window in a composite WM + desktop when output slave is attached but none of its crtc is + really active. + + [1.19: Also fix DMX_LIBS= in configure.ac so it still links - ajax] + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + (cherry picked from commit bb9128fdc86decd6f6e3b0e145011a8c08b1d2b5) + +commit 1097bc9c184db4c722d5a8d2c5a4c0da9cdc70f5 +Author: Chris Wilson +Date: Thu Mar 9 11:25:34 2017 +0000 + + Revert "prime: Sync shared pixmap from root window instead of screen pixmap" + + This reverts commit b5b292896f647c85f03f53b20b2f03c0e94de428. + + This breaks the concept of the screen->pixmap_dirty_list as it no longer + tracks the relationship between the PixmapDirtyUpdate src and slave_dst, + for the supposed convenience of not tracking present flips. + + Bugzilla: https://bugs.freedesktop.org/100086 + Reviewed-by: Adam Jackson + +commit 0ec92f06d4b3bad2e62da24ee7fb64fc88a75820 +Author: Adam Jackson +Date: Fri Mar 10 10:54:17 2017 -0500 + + Revert "present: Allow flipping with PRIME slave outputs" + + This reverts commit 5c1dd4eba833ecf4ea789c8319b4e25ea1e1fab9. + + Bugzilla: https://bugs.freedesktop.org/100086 + Reviewed-by: Adam Jackson + +commit f23e65f96365706c69fa781b2c6cbf3203619c9f +Author: Adam Jackson +Date: Thu Mar 2 17:53:04 2017 -0500 + + xserver 1.19.2, no, really + + Signed-off-by: Adam Jackson + +commit 96d4df934bb4397a251d7d1f2dc0e1296c2e9bb3 +Author: Adam Jackson +Date: Thu Mar 2 15:07:00 2017 -0500 + + xserver 1.19.2 + + Signed-off-by: Adam Jackson + +commit f4ff7b6b559c3ebf7ec1156d170b3daa0618eec2 +Author: Adam Jackson +Date: Thu Mar 2 17:20:30 2017 -0500 + + os: Squash missing declaration warning for timingsafe_memcmp + + timingsafe_memcmp.c:21:1: warning: no previous prototype for ‘timingsafe_memcmp’ [-Wmissing-prototypes] + timingsafe_memcmp(const void *b1, const void *b2, size_t len) + + Signed-off-by: Adam Jackson + (cherry picked from commit 5c44169caed811e59a65ba346de1cadb46d266ec) + +commit 1aa40b96e2f099eabfeef66e77fff36dbd377aa0 +Author: Adam Jackson +Date: Thu Mar 2 15:43:15 2017 -0500 + + Revert "xserver 1.19.2" + + Apparently I need to fight make distcheck some more, so let's not + pretend this is released yet. + + This reverts commit 0b4112bc753a5bd5306f0c67e13e26e3f1c72211. + +commit 0b4112bc753a5bd5306f0c67e13e26e3f1c72211 +Author: Adam Jackson +Date: Thu Mar 2 15:07:00 2017 -0500 + + xserver 1.19.2 + + Signed-off-by: Adam Jackson + +commit e4dd73b242522942d9a5f1c9cada92321710a682 +Author: Olivier Fourdan +Date: Wed Mar 1 08:51:31 2017 +0100 + + xwayland: do not set checkRepeat on master kbd + + keyboard_check_repeat() fetches the XWayland seat from the + dev->public.devicePrivate do do its thing. + + If a key event is sent programmatically through Xtest, our device is the + virtual core keyboard and that has a dev->public.devicePrivate of NULL, + leading to a segfault in keyboard_check_repeat(). + + This is the case with "antimicro" which sends key events based on the + joystick buttons. + + Don't set the checkRepeat handler on the VCK since it cannot possibly work + anyway and it has no effect on the actual checkRepeat intended functionality. + + Bugzilla: https://bugzilla.redhat.com/1416244 + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit fe5c340046c8cf755b92763a49b2dc475e856a76) + +commit c84f5c3dd19ae114da4eb3441b3e4e3a29f195df +Author: Olivier Fourdan +Date: Tue Feb 28 14:27:52 2017 +0100 + + xwayland: Make sure we have a focus window + + During the InitInput() phase, the wayland events get dequeued so we + can possibly end up calling dispatch_pointer_motion_event(). + + If this occurs before xwl_seat->focus_window is set, it leads to a NULL + pointer derefence and a segfault. + + Check for xwl_seat->focus_window in both pointer_handle_frame() and + relative_pointer_handle_relative_motion() prior to calling + dispatch_pointer_motion_event() like it's done in + pointer_handle_motion(). + + Bugzilla: https://bugzilla.redhat.com/1410804 + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 8c9909a99292b2fb4a86de694bb0029f61e35662) + +commit 94c3454d9fdbcefb01042c5c9d88468d86dd4725 +Author: Matthieu Herrb +Date: Wed Mar 1 20:28:34 2017 +0100 + + Brown bag commit to fix 957e8d (arc4random_buf() support) + + - typo in #ifdef check + - also need to add AC_CHECK_FUNCS([arc4random_buf]) + + Reported-by Eric Engestrom. Thanks + + Reviewed-by: Adam Jackson + Signed-off-by: Matthieu Herrb + (cherry picked from commit 386fbbe410a1168b724136e54cf3bd37fb64ad4e) + +commit b0298c02f0383760be899448fa666d0ea56f5d79 +Author: Matthieu Herrb +Date: Tue Feb 28 19:18:56 2017 +0100 + + auth: remove AuthToIDFunc and associated functions. Not used anymore. + + And the current code for MitToId has a use-after-free() issue. + + [Also remove the actual implementations - ajax] + + Signed-off-by: Matthieu Herrb + Reviewed-by: Alan Coopersmith + (cherry picked from commit 2855f759b1e7bf7f5e57cac36c1f0d0e5ac1a683) + +commit ab15f65fe5d6d50e705c1064a6a5c1a0c2a8e045 +Author: Matthieu Herrb +Date: Tue Feb 28 19:18:43 2017 +0100 + + Use arc4random_buf(3) if available to generate cookies. + + Reviewed-by: Adam Jackson + Signed-off-by: Matthieu Herrb + (cherry picked from commit 957e8db38f27932d353e86e9aa69cf16778b18f1) + +commit 3f61c7a09b220805ee6778f4bf2f429e3df8e37a +Author: Matthieu Herrb +Date: Tue Feb 28 19:18:25 2017 +0100 + + Use timingsafe_memcmp() to compare MIT-MAGIC-COOKIES CVE-2017-2624 + + Provide the function definition for systems that don't have it. + + Signed-off-by: Matthieu Herrb + Reviewed-by: Alan Coopersmith + (cherry picked from commit d7ac755f0b618eb1259d93c8a16ec6e39a18627c) + +commit b5c98aa6779b97882246b03c5dea646bd1355991 +Author: Peter Hutterer +Date: Thu Feb 23 10:21:49 2017 +1000 + + os: log a bug whenever WriteToClient is called from the input thread + + The input thread should generate events, not send them. Make it easier to + find the instances where it's doing so. + + Signed-off-by: Peter Hutterer + Tested-by: Olivier Fourdan + Reviewed-by: Olivier Fourdan + (cherry picked from commit 1b12249fd6d4d3b566043d556503f3f625b9b4ba) + +commit 04c72d3c30623e360fd0bd37ed559915b93467f4 +Author: Michel Dänzer +Date: Tue Feb 7 17:38:23 2017 +0900 + + damage: Validate source pictures bound to windows before unwrapping + + The lower layers also do this, but no damage may be reported there, + since we unwrap before calling down. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99220 + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + (cherry picked from commit 38696ea56854e055c31bd2730adfc7c39aa115b0) + +commit 5c1dd4eba833ecf4ea789c8319b4e25ea1e1fab9 +Author: Michel Dänzer +Date: Wed Feb 1 18:35:57 2017 +0900 + + present: Allow flipping with PRIME slave outputs + + Works fine now. + + Reviewed-by: Alex Deucher + Signed-off-by: Michel Dänzer + (cherry picked from commit 542d9f6807ac06b70f564ccab10af69fa21a1221) + +commit 10f8cf3572297764c6b50ac1f01b3ee195b1a453 +Author: Michel Dänzer +Date: Wed Feb 1 18:35:56 2017 +0900 + + prime: Sync shared pixmap from root window instead of screen pixmap + + The screen pixmap doesn't receive updates while there's a Present flip + window. + + [1.19: Squashed in a6566f9e to avoid intermediate regression - ajax] + + Reviewed-by: Alex Deucher + Reviewed-by: Adam Jackson + Signed-off-by: Michel Dänzer + (cherry picked from commit b5b292896f647c85f03f53b20b2f03c0e94de428) + (cherry picked from commit a6566f9e4dbf9ea9568a14e22cb5d004e10dbd4d) + +commit e2243e5b805df387cb3881b2298bffaac4f02942 +Author: Olivier Fourdan +Date: Tue Jan 24 18:08:30 2017 +0100 + + glamor: Two pass won't work on memory pixmaps + + When selecting "CA_TWO_PASS" in glamor_composite_clipped_region() when + the hardware does not support "GL_ARB_blend_func_extended", we call + glamor_composite_choose_shader() twice in a row, which in turn calls + glamor_pixmap_ensure_fbo(). + + On memory pixmaps, the first call will set the FBO and the second one + will fail an assertion in glamor_upload_picture_to_texture() because + the FBO is already set. + + Bail out earlier when the mask pixmap is in memory and the hardware + capabilities would require to use two pass, so that the assertion is not + failed and the rendering is correct. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99346 + Signed-off-by: Olivier Fourdan + Reviewed-by: Eric Anholt + (cherry picked from commit 86463981361064dd0352ec215abf1696ce7fc5ea) + +commit ada5328290f444e3fc0e6a05557d5963dec626e5 +Author: Svitozar Cherepii +Date: Fri Feb 3 01:49:04 2017 +0200 + + xwayland: Add hack for FWXGA resolution #99574 + + For some applications (like fullscreen games) it matters for XRandr + resolution to be correctly set and equal to root window resolution. + + In XServer there is already hack for this, adapted it for XWayland. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99574 + + Signed-off-by: Svitozar Cherepii + Tested-by: Svitozar Cherepii + Acked-by: Olivier Fourdan + (cherry picked from commit 1c78bec9ca3cd1975a38bf5ebdba7dea65b309ab) + +commit abf3bc68db579eb524c2eb5786daa5a00957a2f8 +Author: Olivier Fourdan +Date: Tue Feb 7 15:31:22 2017 +0100 + + xwayland: CRTC should support all rotations + + If the Wayland compositor sets a rotation on the output, Xwayland + translates the transformation as an xrandr rotation for the given + output. + + However, if the rotation is not supported by the CRTC, this is not + a valid setup and xrandr queries will fail. + + Pretend we support all rotations and reflections so that the + configuration remains a valid xrandr setup. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663 + Signed-off-by: Olivier Fourdan + Reviewed-by: Adam Jackson + (cherry picked from commit afeace27d3818274b75d59375771dc964d2f56bb) + +commit fd74867b8b4a4d5da80d2ff9c3eb4ae5c36df4df +Author: Olivier Fourdan +Date: Wed Feb 8 09:23:20 2017 +0100 + + xwayland: Apply output rotation for screen size + + Previously, we would swap the width/height of the Xwayland output based + on the output rotation, so that the overall screen size would match the + actual rotation of each output. + + Problem is the RandR's ConstrainCursorHarder() handler will also apply + the output rotation, meaning that when the output is rotated, the + pointer will be constrained within the wrong dimension. + + Moreover, XRandR assumes the original output width/height are unchanged + when the output is rotated, so by changing the Xwayland output width and + height based on rotation, Xwayland causes XRandr to report the wrong + output sizes (an output of size 1024x768 rotated left or right should + remain 1024x768, not 768x1024). + + So to avoid this issue and keep things consistent between Wayland and + Xwayland outputs, leave the actual width/height unchanged but apply the + rotation when computing the screen size. This fixes both the output size + being wrong in "xrandr -q" and the pointer being constrained in the + wrong dimension with rotated with weston. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663 + Signed-off-by: Olivier Fourdan + Reviewed-by: Adam Jackson + (cherry picked from commit 058809c43ec578a407cf40d4c3e54a42503e3562) + +commit 9a9c6af22e0f0136b11d7c19ce06c48e720a9ca4 +Author: Chris Wilson +Date: Fri Jan 20 09:49:19 2017 +0000 + + xfree86: Take input_lock() for xf86ScreenCheckHWCursor + + (cherry picked from commit 3eb964e25243056dd998f52d3b00171b71c89189) + +commit 2a6904306f9cebc30aa472956a3417ff02221d00 +Author: Chris Wilson +Date: Mon Jan 16 22:36:34 2017 +0000 + + xfree86: Take input lock for xf86TransparentCursor + + (cherry picked from commit cfddd919cce4178baba07959e5e862d02e166522) + +commit da85ab9dd87e3646be8bc617bfd4c8a86ec0b662 +Author: Chris Wilson +Date: Mon Jan 16 22:17:36 2017 +0000 + + xfree86: Take the input lock for xf86RecolorCursor + + xf86RecolorCursor() may be called directly from XRecolorCursor as well + as from xf86ScreenSetCursor(). In the latter case, the input lock is + already held, but not for the former and so we need to add a wrapper + function that acquires the input lock before performing + xf86RecolorCursor() + + References: https://bugs.freedesktop.org/show_bug.cgi?id=99358 + (cherry picked from commit 7198a6d4e74f684cb383b3e0f70dd2bae405e6e7) + +commit ad2facda30f453d749492c51d29f2626aee6326a +Author: Adam Jackson +Date: Wed Jan 11 16:15:57 2017 -0500 + + xserver 1.19.1 + + Signed-off-by: Adam Jackson + +commit 82dcb68a8782d0cce6e6ce1a375cda05c91fe8c3 +Author: Keith Packard +Date: Mon Jan 9 18:10:21 2017 -0800 + + AttendClient of grab-pervious client must queue to saved_ready_clients [v2] + + A client which is attended while a grab is blocking execution of its + requests needs to be placed in the saved_ready_clients list so that it + will get scheduled once the grab terminates. Otherwise, if the client + never sends another request, there is no way for it to be placed in + the ready_clients list. + + v2: Wrap comment above mark_client_saved_ready. + Remove test for OS_COMM_IGNORED which will always be true. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99333 + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + (cherry picked from commit 785053d033e73d2deb0ded4b97eabfd881991978) + +commit 14516988e095ed748e738c14a87c3656006846f7 +Author: Qiang Yu +Date: Tue Jan 10 18:51:55 2017 +0800 + + randr: fix xserver crash when xrandr setprovideroutputsource + + xrandr --setprovideroutputsource + Xorg: ../../../xserver/dix/dispatch.c:4018: AttachOutputGPU: + Assertion `new->isGPU' failed. + + GPUScreen is not allowed to be sink output. + + Signed-off-by: Qiang Yu + Reviewed-by: Hans de Goede + Signed-off-by: Peter Hutterer + (cherry picked from commit 555e0a42d138ac8d83af62638752a1bebad602d6) + +commit 3381e2c26b2ac40b1dd909439bf72559b80d0d86 +Author: Qiang Yu +Date: Tue Jan 10 18:51:54 2017 +0800 + + xfree86: fix wrong usage of xf86optionListMerge + + Signed-off-by: Qiang Yu + Reviewed-by: Hans de Goede + Signed-off-by: Peter Hutterer + (cherry picked from commit 1012510620de7dadd0ab18b19a8e11facd884601) + +commit 27a2772cf3a1bcd656efdf653a7504597911dbc4 +Author: Michel Dänzer +Date: Fri Nov 25 17:34:05 2016 +0900 + + present: Only call present_flip_notify if vblank->queued == FALSE + + We are no longer using the present_flip_queue list only for presents + which have already been submitted to the driver for page flipping, but + also for those which we are queueing up to be flipped later, marked + with vblank->queued == TRUE. We were incorrectly calling + present_flip_notify for such entries, failing the assertion in + present_flip_notify (or presumably resulting in other undesirable + behaviour with assertions disabled). + + Reproduction recipe: Run the JavaFX test case referenced by + https://bugs.freedesktop.org/show_bug.cgi?id=98831#c6 and alt-tab out + of it while it's fullscreen. May take a few attempts to hit the + assertion failure. + + Fixes: bab0f450a719 ("present: Fix presentation of flips out of order") + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98854 + Reviewed-by: Alex Deucher + (cherry picked from commit e473b2bc016adacfe3fa47fdf6a8ce9f8cddff62) + +commit 943e3cbeb0139d719589fc07c4f471195e4efe0a +Author: Kai-Heng Feng +Date: Thu Dec 15 13:56:38 2016 +0800 + + edid: Add quirk for ADA 1024x600 7" display. + + Detailed mode reports 108 mm x 68 mm which is for smaller display. + Maximum image size reports 15 cm x 10 cm which aligns with its physical + size, use this size instead. + + Signed-off-by: Kai-Heng Feng + Acked-by: Alex Deucher + (cherry picked from commit 9874f73e88678c9eacbcba05e52336fc63a32712) + +commit cb3057da2254f9b6434a9c40486c72865cd1ab5e +Author: Peter Hutterer +Date: Thu Dec 8 14:32:06 2016 +1000 + + os: return 0 from check_timers if we touched any of them + + Fixes a regression introduced in 0b2f30834b1a9f. If a driver posts input + events during a timer function (wacom and synaptics do this during tap + timeouts), ProcessInputEvents() is not called for these events. There are no + new events on any fds, so the events just sit in the queue waiting for + something else to happen. + + Fix this by simply returning 0 from check_timers if we ran at least one of + them or reset them all. This way the callers ospoll_wait will exit and + continue with normal processing. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit db03742cd33d6d54834bb138886a4f84bc452a85 +Author: Michal Srb +Date: Mon Dec 12 17:45:22 2016 +0200 + + xinerama: Swap the response in RRXineramaWriteMonitor + + Reviewed-by: Adam Jackson + +commit 862c1c43c10eda955db1440cc72ff0387e24a35f +Author: Hans De Goede +Date: Tue Dec 20 13:00:43 2016 +0100 + + glamor: Trust eglGetPlatformDisplayEXT if it exists + + If the libEGL we are using has eglGetPlatformDisplayEXT, yet it still + returns NULL, then this very likely means that it does not support the + type (e.g. EGL_PLATFORM_GBM_MESA) passed in, and then returning NULL is + the right thing to do. + + This avoids falling back to an eglGetDisplay() implementation which does + not understands the passed in gbm handle, treats it as a pointer to + something else completely, followed by a crash sooner or later. + + Specifically this fixes using the nvidia binary driver, with nvidia's + libEGL + the modesetting driver on a secondary GPU crashing inside + glamor_egl_init() sometimes. + + [1.19: squash in typo fix from 29a4f3db - ajax] + + Cc: Eric Anholt + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + (cherry picked from commit 05e19644250698aa126a60bc671e85425df784d1) + +commit 8790bd993ac2f8f8dd54a1946312e6b6dc929e00 +Author: Mihail Konev +Date: Thu Dec 29 12:37:18 2016 +0500 + + os,dix: Depend custom libs on libs, not objects + + The custom os/os.O library reuses *.o files of os/libos.la. + + The current rule assumes automake puts all the objects into per-target + am__*_la_OBJECTS variable. At least with AC_REPLACE_FUNCS, this no + longer holds (as wanted objects are put into LTLIBOBJS instead). + + Depend on automake's result, the *.la library instead, to express demand + of any its dependencies being built. + + Should be fixing randomly occuring "undefined reference to `strlcpy'" + errors when linking Xvfb and other DDX-es that could use os.O. + + Reviewed-by: Adam Jackson + Signed-off-by: Mihail Konev + (cherry picked from commit 5b74e260e009d8bdf26433724495802b85cce7c3) + +commit 8cf47472bff1d5ca3de6ff83a80f0d2820c3fb93 +Author: Ben Crocker +Date: Tue Nov 15 16:34:38 2016 -0500 + + Fix a segfault that occurs if xorg.conf.d is absent: + + In InitOutput, if xf86HandleConfigFile returns CONFIG_NOFILE + (which it does if no config file or directory is present), the + autoconfig flag is set, causing xf86AutoConfig to be called + later on. + + xf86AutoConfig calls xf86OutputClassDriverList via the + call tree: + + xf86AutoConfig => + listPossibleVideoDrivers => + xf86PlatformMatchDriver => + xf86OutputClassDriverList + + and xf86OutputClassDriverList attempts to traverse a linked list + that is a member of the XF86ConfigRec struct pointed to by the + global xf86configptr, which is NULL at this point because the + XF86ConfigRec struct is only allocated (by xf86readConfigFile) + AFTER the config file and directory have been successfully + opened; the CONFIG_NOFILE return from xf86HandleConfigFile + occurs BEFORE the call to xf86readConfigFile which allocates + the XF86ConfigRec struct. + + Rx: In read.c (for symmetry with xf86freeConfig, which already + appears in this file), add a new function xf86allocateConfig + which tests the value of xf86configptr and, if it's NULL, + allocates the XF86ConfigRec struct and deposits the pointer + in xf86configptr. In xf86Parser.h, add a prototype for the + new xf86allocateConfig function. + + Back in read.c, #include "xf86Config.h". In xf86readConfigFile, + change the open-code call to calloc to a call to the new + xf86allocateConfig function. + + In xf86AutoConfig.c, add a call to the new xf86allocateConfig function + to the beginning of xf86AutoConfig to make sure the XF86ConfigRec struct + is allocated. + + Reviewed-by: Adam Jackson + Signed-off-by: Ben Crocker + (cherry picked from commit 8b335d9068fe4e1f1423a4d86c22b69ffcb819a5) + +commit 06a3e7ef3bf9a907f1fba84a3601870a5697f657 +Author: Pekka Paalanen +Date: Wed Dec 7 15:43:06 2016 +0200 + + test: fix distributing scripts + + Fix the following error on 'make distcheck': + + make[6]: *** No rule to make target 'scripts/xvfb-piglit.sh', needed by 'scripts/xvfb-piglit.sh.log'. Stop. + make[6]: Leaving directory '/home/pq/git/xserver/xorg-server-1.19.99.1/_build/sub/test' + Makefile:1367: recipe for target 'check-TESTS' failed + + The setup to trigger this is: + $ ./configure --prefix=/home/pq/local --disable-docs + --disable-devel-docs --enable-xwayland --disable-xorg --disable-xvfb + --disable-xnest --disable-xquartz --disable-xwin --enable-debug + + SCRIPT_TESTS is populated conditionally, but we should distribute the + scripts in any case. + + Reviewed-by: Adam Jackson + Signed-off-by: Pekka Paalanen + (cherry picked from commit b365c5d16894a259dbf29db4ca2640d8ed768063) + +commit 543287e60af5e9d91b5fc7e4a42e51eafa63db21 +Author: Adam Jackson +Date: Tue Dec 6 14:11:11 2016 -0500 + + composite: Fix repaint of borders (v2) + + When going from border width zero to a non-zero border width, the + Composite extension is informed via the ConfigNotify callback. The + call-chain looks like this: compConfigNotify -> compReallocPixmap -> + compSetPixmap -> TraverseTree -> compSetPixmapVisitWindow. However, at + this time, pWindow->borderWidth was not yet updated. Thus, HasBorder() + is false and the window border will not be repainted. + + To fix this, thread the new bw through to the window visitor, and + inspect that rather than HasBorder(). For the other callers of + compSetPixmap the border does not change size, so we can pass + pWin->borderWidth instead. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98499 + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + (cherry picked from commit f31875510d818ba517f082e124adb294db906e51) + +commit c24c9cc956038a61922f8b11ee68b8b0fc6b9f83 +Author: Hans de Goede +Date: Tue Nov 22 14:53:20 2016 +0100 + + randr: rrCheckPixmapBounding: do not shrink the screen_pixmap + + The purpose of rrCheckPixmapBounding is to make sure that the + screen_pixmap is *large* enough for the slave-output which crtc is + being configured. + + However until now rrCheckPixmapBounding would also shrink the + screen_pixmap in certain scenarios leading to various problems. + + For example: Take a laptop with its internalscreen on a slave-output and + currently disabled and an external monitor at 1920x1080+0+0. + Now lets say that we want to drive the external monitor at its native + resolution of 2560x1440 and have the internal screen mirror the top left + part of the external monitor, so we run: + + $ xrandr --output eDP --mode 1920x1080 --pos 0x0 --output HDMI \ + --mode 2560x1440 --pos 0x0 + + Here xrandr utility first calls RRSetScreenSize to 2560x1440, then it + calls RRSetCrtc 1920x1080+0+0 on the eDP, since this is a slave output, + rrCheckPixmapBounding gets called and resizes the screen_pixmap to + 1920x1080, undoing the RRSetScreenSize. Then RRSetCrtc 2560x1440+0+0 + gets called on the HDMI, depending on crtc->transforms this will + either result in a BadValue error from ProcRRSetCrtcConfig; or + it will succeed, but the monitor ends up running at 2560x1440 + while showing a 1920x1080 screen_pixmap + black borders on the right + and bottom. Neither of which is what we want. + + This commit removes the troublesome shrinking behavior, fixing this. + + Note: + + 1) One could argue that this will leave us with a too large screen_pixmap + in some cases, but rrCheckPixmapBounding only gets called for slave + outputs, so xrandr clients already must manually shrink the screen_pixmap + after disabling crtcs in normal setups. + + 2) An alternative approach would be to also call rrCheckPixmapBounding + on RRSetCrtc on normal (non-slave) outputs, but that would result in + 2 unnecessary resizes of the screen_pixmap in the above example, which + seems undesirable. + + Cc: Nikhil Mahale + Cc: Dave Airlie + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + (cherry picked from commit a46afee84d45fbff4e4dad9376afc95bbcc31d7c) + +commit 26132f57ee6fae9376955e7990ac2fbad5b49fac +Author: Hans de Goede +Date: Tue Nov 22 14:48:14 2016 +0100 + + randr: rrCheckPixmapBounding: Do not substract crtc non 0 x,y from screen size + + The purpose of rrCheckPixmapBounding is to make sure that the + screen_pixmap is large enough for the slave-output which crtc is + being configured. + + This should include crtc->x and crtc->y, otherwise the crtc might + still end up scanning out an area outside of the screen-pixmap. + + For example: Take a laptop with an external monitor on a slave-output at + 1920x1080+0+0 and its internal-screen at 3840x2160+1920+0 and in + gnome-settings-daemon move the external monitor to be on the ri ght of + the internal screen rather then on the left. First g-s-d will do a + RRSetScreenSize to 5760*2160 (which is a nop), then it calls RRSetCrtc + to move the slave output to 1920x1080+3840+0, since this is a slave + output, rrCheckPixmapBounding gets called, since the 2 crtcs now overlap + the code before this commit would shrinks the screen_pixmap to 3180*2160. + Then g-s-d calls RRSetCrtc to move the internal screen to 3180*2160+0+0. + + And we end up with the slave-output configured to scan-out an area + which completely falls outside of the screen-pixmap (and end up with + a black display on the external monitor). + + This commit fixes this by not substracting the x1 and y1 coordinates + of the union-ed region when determining the new screen_pixmap size. + + Cc: Nikhil Mahale + Cc: Dave Airlie + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + (cherry picked from commit 3b624aa9a9df86dc7d48149e0f18ca223b4355f1) + +commit 6c51845e6b0f313a90e4375f2821f1da9cc53014 +Author: Olivier Fourdan +Date: Wed Nov 30 09:42:43 2016 +0100 + + xwayland: Fix use after free of cursors + + Sometimes, Xwayland will try to use a cursor that has just been freed, + leading to a crash when trying to access that cursor data either in + miPointerUpdateSprite() or AnimCurTimerNotify(). + + CheckMotion() updates the pointer's cursor based on which xwindow + XYToWindow() returns, and Xwayland implements its own xwl_xy_to_window() + to fake a crossing to the root window when the pointer has left the + Wayland surface but is still within the xwindow. + + But after an xwindow is unrealized, the last xwindow used to match the + xwindows is cleared so two consecutive calls to xwl_xy_to_window() may + not return the same xwindow. + + To avoid this issue, update the last_xwindow based on enter and leave + notifications instead of xwl_xy_to_window(), and check if the xwindow + found by the regular miXYToWindow() is a child of the known last + xwindow, so that multiple consecutive calls to xwl_xy_to_window() + return the same xwindow, being either the one found by miXYToWindow() + or the root window. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1385258 + Signed-off-by: Olivier Fourdan + Tested-by: Vít Ondruch + Tested-by: Satish Balay + Reviewed-by: Jonas Ådahl + (cherry picked from commit 59ad0e6a416d8e23f9d962af67a16ee28ec7867b) + +commit b711efb05714bf3d0a102c717a05cde4fefdae3f +Author: Olivier Fourdan +Date: Thu Nov 3 09:59:30 2016 +0100 + + glamor: restore vfunc handlers on init failure + + In glamor_init(), if the minimum requirements are not met, glamor may + fail after setting up its own CloseScreen() and DestroyPixmap() + routines, leading to a crash when either of the two routines is called + if glamor failed to complete its initialization, e.g: + + (EE) Backtrace: + (EE) 0: Xwayland (OsSigHandler+0x29) + (EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) + (EE) 2: Xwayland (glamor_sync_close+0x2a) + (EE) 3: Xwayland (glamor_close_screen+0x52) + (EE) 4: Xwayland (CursorCloseScreen+0x88) + (EE) 5: Xwayland (AnimCurCloseScreen+0xa4) + (EE) 6: Xwayland (present_close_screen+0x42) + (EE) 7: Xwayland (dix_main+0x4f9) + (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf1) + (EE) 9: Xwayland (_start+0x2a) + + Restore the previous CloseScreen() and DestroyPixmap() vfunc handlers in + case of failure when checking for the minimum requirements, so that if + any of the requirement is not met we don't leave the CloseScreen() and + DestroyPixmap() from glamor handlers in place. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1390018 + + Signed-off-by: Olivier Fourdan + Reviewed-by: Hans de Goede + Reviewed-by: Eric Anholt + (cherry picked from commit f43207c1c4a8487600cf3ea116c10437417c861b) + +commit 201ff45c2d7e6c7d73fd29d28871bb8b944074be +Author: Peter Hutterer +Date: Fri Nov 11 15:28:50 2016 +1000 + + Xi: when creating a new master device, update barries for all clients + + The previous code only worked when the barrier was created by the same client + as the one calling XIChangeDeviceHierarchy. + + http://bugzilla.redhat.com/show_bug.cgi?id=1384432 + + Signed-off-by: Peter Hutterer + Reviewed-by: Daniel Stone + (cherry picked from commit d6a6e1d6abb110ff00ad31b94cd29d92ca7c71a5) + +commit 738c17b7ef4c70ad00c7bc01cf64edb770dda840 +Author: Rui Matos +Date: Thu Nov 24 19:56:18 2016 +0100 + + xwayland: Don't send KeyRelease events on wl_keyboard::leave + + Commits 816015648ffe660ddaa0f7d4d192e555b723c372 and + fee0827a9a695600765f3d04376fc9babe497401 made it so that + wl_keyboard::enter doesn't result in X clients getting KeyPress events + while still updating our internal xkb state to be in sync with the + host compositor. + + wl_keyboard::leave needs to be handled in the same way as its + semantics from an X client POV should be the same as an X grab getting + triggered, i.e. X clients shouldn't get KeyRelease events for keys + that are still down at that point. + + This patch uses LeaveNotify for these events on wl_keyboard::leave and + changes the current use of KeymapNotify to EnterNotify instead just to + keep some symmetry between both cases. + + On ProcessDeviceEvent() we still need to deactivate X grabs if needed + for KeyReleases. + + Signed-off-by: Rui Matos + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 5611585b87ce48428a66f98ece319a083f55d205) + +commit cd8f43e1b06aee8500548a94e3743cf153591683 +Author: Rhys Kidd +Date: Fri Oct 28 22:44:30 2016 -0400 + + test: Fix stray Makefile reference to removed os test + + Fixes the following warning: + + test/Makefile.am:69: warning: variable 'os_LDADD' is defined but no program or + test/Makefile.am:69: library has 'os' as canonical name (possible typo) + + Introduced upon the removal of test/os in: + + commit 6a5a4e60373c1386b311b2a8bb666c32d68a9d99 + Author: Keith Packard + Date: Tue Dec 8 14:39:46 2015 -0800 + + Remove SIGIO support for input [v5] + + This removes all of the SIGIO handling support used for input + throughout the X server, preparing the way for using threads for input + handling instead. + + Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls + to stub functions input_lock/input_unlock so that we don't lose this + information. + + xfree86 SIGIO support is reworked to use internal versions of + OsBlockSIGIO and OsReleaseSIGIO. + + v2: Don't change locking order (Peter Hutterer) + v3: Comment weird && FALSE in xf86Helper.c + Leave errno save/restore in xf86ReadInput + Squash with stub adding patch (Peter Hutterer) + v4: Leave UseSIGIO config parameter so that + existing config files don't break (Peter Hutterer) + v5: Split a couple of independent patch bits out + of kinput.c (Peter Hutterer) + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + + Signed-off-by: Rhys Kidd + Reviewed-by: Keith Packard + Signed-off-by: Peter Hutterer + (cherry picked from commit cf8860786c3e301486cd2853bc82977ba75e6b17) + +commit d6da2086951693e047fdd22b0d21c539ea1bb1e1 +Author: Adam Jackson +Date: Mon Dec 12 13:08:17 2016 -0500 + + Revert "damage: Make damageRegionProcessPending take a damage not a drawable" + + The commit message makes the assertion that the code below damage is not + allowed to change whether there's a damage monitor for the drawable. + That turns out not to be the case! exa's mixed code, at least, will + create and destroy a damage in PrepareAccess. The destroy path can then + be catastrophic, as damageRegionProcessPending will attempt to + RegionEmpty memory from the middle of a freed block. + + I'd wanted that invariant for performance, but faster isn't worth + broken, so revert it. I think what exa's doing is reasonable, so the + better way to improve performance for the unmonitored case is to either + revisit dynamically wrapping into the GC, or inline damage into dix. + + This reverts commit 4e124203f2260daaf54155f4a05fe469733e0b97. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1389886 + Signed-off-by: Adam Jackson + (cherry picked from commit 32e632e85894eddc3ace83f16f1e973b1be478fe) + +commit 7e5c9bdf73e4185ac4cf7f044da0793a5cc3e62c +Author: Keith Packard +Date: Tue Nov 15 08:12:05 2016 -0800 + + Bump version to 1.19.0 + + Signed-off-by: Keith Packard + +commit ea8efb3a997e15d27d362762e6c85d59487f9864 +Author: Keith Packard +Date: Wed Nov 2 13:25:33 2016 -0700 + + dix: Make sure client is not in output_pending chain after closed (RH 1382444) + + I think it is possible that output could get queued to a client during + CloseDownClient. After it is removed from the pending queue, active + grabs are released, the client is awoken if sleeping and any work + queue entries related to the client are processed. + + To fix this, move the call removing it from the output_pending chain + until after clientGone has been set and then check clientGone in + output_pending_mark. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1382444 + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + +commit 7513da40a656317ad3aa101651d29373de99c798 +Author: Timo Aaltonen +Date: Wed Nov 2 17:18:11 2016 +0200 + + dri2: Sync i965_pci_ids.h from mesa + + Import changes from these mesa commits: + 85ea8deb26da420 i965: Removing PCI IDs that are no longer listed as Kabylake. + bdff2e554735ed9 i956: Add more Kabylake PCI IDs. + f1fa8b4a1ca73fa i965/bxt: Add 2x6 variant + d1ab544bb883d04 i965/chv: Display proper branding + 20e8ee36627f874 i965/skl: Update Skylake renderer strings + 644c8a515192d28 i965/skl: Add two missing device IDs + + Reviewed-by: Adam Jackson + Signed-off-by: Timo Aaltonen + +commit 4cfee398726adf89db4b632ade7d6cab8b78282e +Author: Ian Ray +Date: Wed May 25 10:41:53 2016 +0300 + + xwayland-shm: block signals during fallocate + + posix_fallocate() does an explicit rollback if it gets EINTR, and + this is a problem on slow systems because when the allocation size + is sufficiently large posix_fallocate() will always be interrupted + by the smart scheduler's SIGALRM. + + Changes since v1 - big comment in the code to explain what is going on + + Reviewed-by: Adam Jackson + Signed-off-by: Ian Ray + Acked-by: Pekka Paalanen + Acked-by: Daniel Stone + +commit 512e75a23b7f6339593c3ae6942f0c420a975fd3 +Author: Keith Packard +Date: Fri Oct 28 09:32:42 2016 -0700 + + Bump to 1.18.99.902 (1.19 RC2) + + Signed-off-by: Keith Packard + +commit c85f81825e196e96337347e0ce3a538fb2e38f16 +Author: Keith Packard +Date: Fri Oct 28 09:28:32 2016 -0700 + + dix: Bump MAXHASHSIZE for the resource db [v2] + + [This was originally a workaround for a client-side resource leak: + + http://lists.freedesktop.org/archives/xorg-devel/2012-November/034555.html + + Obviously that's a broken app, but the performance problem it + illustrates - that walking the linked list ends up burning all your CPU + time - is real enough. - ajax] + + v2: Replace with a shorter code sequence which computes the same + results for all but numBits == 7 + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 356db2340f5b473a7191c7969586ca5b0396c48f +Merge: 9ed5b26354 03d99ef729 +Author: Keith Packard +Date: Fri Oct 28 09:05:54 2016 -0700 + + Merge remote-tracking branch 'jturney/master' + +commit 9ed5b263542e5245317927828f0515db6c0a54c8 +Author: Keith Packard +Date: Fri Oct 28 08:04:43 2016 -0700 + + os: Recompute whether any clients are ready after ProcessWorkQueue() (bug 98030) + + If a work proc wakes up a sleeping client and it is ready to execute, + we need to re-compute the local 'are_ready' value before deciding + what timeout value to use in WaitForSomething. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98030 + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + +commit 2c91f3235a4e1655e18cb014922529161051ffbb +Author: Keith Packard +Date: Wed Oct 5 09:41:44 2016 -0700 + + ephyr: Leave window unmapped for -glamor-skip-present [v2] + + If we're never painting anything in the window, we probably don't need + to map it. + + v2: Drop ephyr_glamor_gles2 from hostx.c + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit cba5a10fd93310702cad9dbe1e6d48da99f5552f +Author: Alex Goins +Date: Wed Oct 26 11:03:49 2016 -0700 + + ramdac: Check sPriv != NULL in xf86CheckHWCursor() + + xf86CheckHWCursor() would dereference sPriv without NULL checking it. If Option + "SWCursor" is specified, sPriv == NULL. In this case we should assume that HW + cursors are not supported. + + Signed-off-by: Alex Goins + Reviewed-by: Andy Ritger + Signed-off-by: Keith Packard + +commit 03d99ef729178dd99268f185fb45320a29382091 +Author: Jon Turney +Date: Thu Oct 6 22:13:07 2016 +0100 + + glx/dri2: Don't build DRI loader if DRI2 isn't enabled + + This partially reverts 501d8e2b. + + Signed-off-by: Jon Turney + Reviewed-by: Emil Velikov + +commit 5cb328338684d8e5b03913c47475bfcd7acffec4 +Author: Peter Hutterer +Date: Wed Oct 26 12:21:16 2016 +0200 + + inputthread: On Linux leave the main thread's name as-is + + On Linux, setting the main thread's name changes the program name + (/proc/self/comm). Setting it to MainThread breaks scripts that rely on + the command name, e.g. ps -C Xorg. + + Signed-off-by: Peter Hutterer + Signed-off-by: Hans de Goede + +commit 007f8ee61a35ceda36b43e772a9a1074b8e27a06 +Author: Olivier Fourdan +Date: Fri Oct 21 10:11:45 2016 +0200 + + xwayland: Activate and enable touch devices + + On some random condition, a touch event may trigger a crash in Xwayland + in GetTouchEvents(). + + The (simplified) backtrace goes as follow: + + (gdb) bt + #0 GetTouchEvents() at getevents.c:1892 + #1 QueueTouchEvents() at getevents.c:1866 + #2 xwl_touch_send_event() at xwayland-input.c:652 + #5 wl_closure_invoke() from libwayland-client.so.0 + #6 dispatch_event() from libwayland-client.so.0 + #7 wl_display_dispatch_queue_pending() from libwayland-client.so.0 + #8 xwl_read_events() at xwayland.c:483 + #9 ospoll_wait() at ospoll.c:412 + #10 WaitForSomething() at WaitFor.c:222 + #11 Dispatch() at dispatch.c:412 + #12 dix_main() at main.c:287 + #13 __libc_start_main() at libc-start.c:289 + #14 _start () + + The crash occurs when trying to access the sprite associated with the + touch device, which appears to be NULL. Reason being the device itself + is more a keyboard device than a touch device. + + Moreover, it appears the device is neither enabled nor activated + (inited=0, enabled=0) which doesn't seem right, but matches the code in + init_touch() from xwayland-input.c which would enable the device if it + was previously existing and otherwise would create the device but not + activate it. + + Make sure we do activate and enable touch devices just like we do for + other input devices such as keyboard and pointer. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Hans de Goede + +commit f68ba7b81ffe765380664fccc92f3e689c6c48c2 +Author: Rui Matos +Date: Tue Oct 25 19:24:49 2016 +0200 + + xwayland: Transform pointer enter event coordinates + + Pointer enter event coordinates are surface relative and we need them to + be screen relative for pScreen->SetCursorPosition(). + + https://bugzilla.gnome.org/show_bug.cgi?id=758283 + + Signed-off-by: Rui Matos + Reviewed-by: Eric Engestrom + Reviewed-by: Jonas Ådahl + Signed-off-by: Hans de Goede + +commit f5c6d751d08c6de77c2ca49ba2a48f8023758cef +Author: Nikhil Mahale +Date: Sat Oct 22 17:40:51 2016 +0530 + + modesetting: unifdef MODESETTING_OUTPUT_SLAVE_SUPPORT + + Commit c7e8d4a6ee9542f56cd241cf7a960fb8223a6b22 had already unifdef + MODESETTING_OUTPUT_SLAVE_SUPPORT but commit + 9257b1252da9092ddc676fec9aabe2b33dfad272 didn't notice that. + + Signed-off-by: Nikhil Mahale + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 4aaeeda4774397dd6d80aa240ca623ae795ec5dc +Author: Hans de Goede +Date: Tue Oct 18 16:10:19 2016 +0200 + + xfree86: Xorg.wrap: Do not require root rights for cards with 0 outputs + + Prior to this commit the Xorg.wrap code to detect if root rights are + necessary checked for DRM_IOCTL_MODE_GETRESOURCES succeeding *and* + reporting more then 0 output connectors. + + DRM_IOCTL_MODE_GETRESOURCES succeeding alone is enough to differentiate + between old drm only cards (which need ums and thus root) and kms capable + cards. + + Some hybrid gfx laptops have 0 output connectors on one of their 2 GPUs, + resulting in Xorg needlessly running as root. This commits removes the + res.count_connectors > 0 check, fixing this. + + Signed-off-by: Hans de Goede + Reviewed-by: Eric Engestrom + +commit 7d91063aca4e4d326c294e246bc2dc36cb05318e +Author: Michel Dänzer +Date: Mon Oct 17 18:48:44 2016 +0900 + + DRI2: Sync radeonsi_pci_ids.h from Mesa + + Fixes DRI2 client driver name mapping for newer AMD GPUs with the + modesetting driver, allowing the DRI2 extension to initialize. + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Hans de Goede + +commit f6ff2e974c5de3071c899eba828789f1d4d8645a +Author: Mihail Konev +Date: Sat Oct 15 04:13:43 2016 +0000 + + modesetting: fix glamor ifdef + + Add a missing ifdef needed for --disable-glamor. + + Signed-off-by: Mihail Konev + Reviewed-by: Jon Turney + Signed-off-by: Hans de Goede + +commit 8fee6a917b6468e1b116d922f86484498874fb5c +Author: Mihail Konev +Date: Fri Oct 14 02:40:59 2016 +0000 + + xwin: make glx optional again + + Commit 501d8e2b removed --enable-aiglx, but made xwin always be + --enable-glx. + + Signed-off-by: Mihail Konev + Reviewed-by: Emil Velikov + Reviewed-by: Jon Turney + Signed-off-by: Hans de Goede + +commit d13cb974426f7f1110b0bdb08c4ebb46ff8975f7 +Author: Peter Hutterer +Date: Fri Oct 21 06:27:57 2016 +1000 + + ddx: add new call to purge input devices that weren't added + + Special case for the systemd-logind case in xfree86: when we're vt-switched + away and a device is plugged in, we get a paused fd from logind. Since we + can't probe the device or do anything with it, we store that device in the + xfree86 and handle it later when we vt-switch back. The device is not added to + inputInfo.devices until that time. + + When the device is removed while still vt-switched away, the the config system + never notifies the DDX. It only runs through inputInfo.devices and our device + was never added to that. + + When a device is plugged in, removed, and plugged in again while vt-switched + away, we have two entries in the xfree86-specific list that refer to the same + device node, both pending for addition later. On VT switch back, the first one + (the already removed one) will be added successfully, the second one (the + still plugged-in one) fails. Since the fd is correct, the device works until + it is removed again. The removed devices' config_info (i.e. the syspath) + doesn't match the actual device we addded tough (the input number increases + with each plug), it doesn't get removed, the fd remains open and we lose track + of the fd count. Plugging the device in again leads to a dead device. + + Fix this by adding a call to notify the DDX to purge any remainders of devices + with the given config_info, that's the only identifiable bit we have at this + point. + + https://bugs.freedesktop.org/show_bug.cgi?id=97928 + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit 8fcf2fa78f09257933b17e7dc9a03a2034e3076f +Author: Peter Hutterer +Date: Thu Oct 20 15:45:46 2016 +1000 + + xfree86: swap the list of paused devices to an xorg_list + + No functional changes but it makes it easier to remove elements from the + middle of the list (future patch). + + We don't have an init call into this file, so the list is manually + initialized. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit 28d8855cd4e3be8831fb1c17bf1d205bd8465d1e +Author: Peter Hutterer +Date: Thu Oct 20 15:25:51 2016 +1000 + + xfree86: use the right option traversal list to search for an option + + They're identically laid-out structs but let's use the right type to search + for our desired value. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit 7fc96fb02dade4a86f2fc038f3cf5f2d9c0cda00 +Author: Emil Velikov +Date: Fri Oct 21 19:06:00 2016 +0100 + + glamor: don't look for non-existing EGL_KHR_platform_base + + The extension does not exist in the registry, thus needs to know they're + using EGL 1.5 in order to determine the eglGetPlatformDisplay function + pointer is valid. + + Thus brings us into some lovely circular dependency. + + Since mesa won't be able (in the foreseeable future) to export the KHR + flavour of extension (another way one could assume that EGL 1.5 is + available) just drop all the heuristics and use the + EGL_EXT_platform_base extension. + + In practise (checked with the Mali driver) any EGL 1.5 driver will + advertise support for EGL_EXT_platform_base. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 5dcb0666b82f5ab00f3d22e86f05ac14b0d5341e +Author: Mihail Konev +Date: Sat Oct 15 17:59:05 2016 +0000 + + os/inputthread: Ensure pollfd refreshing + + When putting a device node into a poll-request list, do not overwrite a + "please-remove" element with the same fd, so that a closed device file + is ospoll_remove'd prior to being ospoll_add'ed. + + Before, the opposite order was possible, resulting in ospoll_add + considering the newly opened file being already polled, should it have a + fd for which the "please-remove" has not been procesed yet. In this + case, no further events would be seen from the device. + + Signed-off-by: Mihail Konev + Regressed-in: 52d6a1e832a5e62289dd4f32824ae16a78dfd7e8 + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97880 + Patchwork: https://patchwork.freedesktop.org/patch/113763/ + Hit-and-Reduced-by: Hans de Goede + Reviewed-and-Reduced-by: Peter Hutterer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 9cf0bd4d4507dca6234024605b14724713f2109e +Author: Michel Dänzer +Date: Wed Oct 5 18:28:45 2016 +0900 + + xf86Cursor: Take the input lock in xf86Set/MoveCursor + + Prevents the HW cursor from intermittently jumping around when the + cursor image is changed while the cursor is being moved. This is hardly + noticeable in normal operation but can be quite confusing when stepping + through these codepaths in a debugger. + + Reviewed-by: Hans de Goede + +commit 011ce3297d924e78ef0254b0451561946bd8be8d +Author: Michel Dänzer +Date: Wed Oct 5 18:01:29 2016 +0900 + + xf86Cursor: Use PRIME master xf86CursorScreenRec::HotX/Y for slaves + + xf86CursorScreenRec::HotX/Y contain 0 for PRIME slave screens. + + Fixes incorrect HW cursor position on PRIME slave screens. + + Also hoist the hotspot translation out from xf86ScreenSet/MoveCursor to + xf86Set/MoveCursor, since the hotspot position is a property of the + cursor, not the screen. + + v2: + * Squash patches 1 & 2 of the v1 series, since it's basically the same + problem + * Use the master screen's xf86CursorScreenRec::HotX/Y instead of + CursorRec::bits->x/yhot, since CursorRec::bits can be NULL (Hans de + Goede) + + Reviewed-by: Hans de Goede + +commit e3f53aa3a8dfc323c75837cd41e35b8e895d547e +Author: Adam Jackson +Date: Thu Oct 6 14:42:34 2016 -0400 + + glx/dri2: Don't include drm headers + + They're not needed, and they won't be present on win32. + + Signed-off-by: Adam Jackson + Reviewed-by: Emil Velikov + +commit 97a8353ec1192d8d3bd2ebb99e5687cb91427e09 +Author: Peter Harris +Date: Thu Sep 29 11:17:48 2016 -0400 + + Fix id in error when resource does not exist + + Always set client->errorValue before returning an error. + + Test program: + + int main(int argc, char *argv[]) { + int screen = 0; + xcb_connection_t *c = xcb_connect(NULL, &screen); + if (!c) { + printf("Cannot connect\n"); + return 1; + } + + xcb_void_cookie_t tok = xcb_free_gc_checked(c, BAD_VALUE); + xcb_g_context_error_t *err = (xcb_g_context_error_t *)xcb_request_check(c, tok); + if (!err) { + printf("Unexpected request success\n"); + return 1; + } + if (err->bad_value != BAD_VALUE) { + printf("Error: Got 0x%X, expected 0x%X\n", err->bad_value, BAD_VALUE); + return 1; + } + printf("Success! Got expected bad value of 0x%X\n", BAD_VALUE); + return 0; + } + + Reviewed-by: Adam Jackson + Signed-off-by: Peter Harris + +commit f4a41155479e68bf55740c1dfffafc78e4c02087 +Author: Adam Jackson +Date: Wed Oct 5 12:34:34 2016 -0400 + + glamor: Use eglGetPlatformDisplay{,EXT} if we can + + eglGetDisplay forces the implementation to guess which kind of display + it's been handed. glvnd does something different from Mesa, and in + general it's impossible for the library to get this right. Add a new + inline that gets the logic right, and works around a quirk in epoxy. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 95d3980c7c991b2cc8dcadac173635641ae15865 +Author: Michel Dänzer +Date: Wed Oct 5 17:29:36 2016 +0900 + + test: Use $XSERVER_BUILDDIR for Xvfb executable path + + Fixes make check with out-of-tree builds. + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Reviewed-by: Eric Anholt + +commit cc69d4f110bd8a87b9e6c238ebebf8d85cbd93ec +Author: Emil Velikov +Date: Thu Sep 29 18:35:04 2016 +0100 + + xfree86/dri: remove libdrm runtime checks + + As of last commit all the places in our configure.ac require version + 2.3.1 (released back in 2007) or later. With the latter introducing the + 1.3.0 version, as returned by drmGetLibVersion. + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 962962e978e5cededc20e577a36f77eb24d14bda +Author: Emil Velikov +Date: Thu Sep 29 18:35:03 2016 +0100 + + configure.ac: bump the required libdrm version to 2.3.1 + + It fixes a bug where the version reported by drmGetLibVersion() was + 'wrong'. See libdrm commit 79038751ffe("libdrm: add support for server + side functionality in libdrm") for details. + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 74a8b320fa5068cd86d8b8b8e73fa92caae9a8a6 +Author: Emil Velikov +Date: Thu Sep 29 18:35:02 2016 +0100 + + configure.ac: use $LIBDRM over libdrm when using pkg-config + + The former contains the minimum required version which is required. + Strictly speaking Xephyr/Xwayland may require version greater than the + current 2.3.0, although I've personally haven't checked the specifics. + + Signed-off-by: Emil Velikov + Reviewed-by: Adam Jackson + +commit 45e1220486139c483a69366323f8f590beffa19d +Author: Emil Velikov +Date: Thu Sep 29 18:35:01 2016 +0100 + + configure.ac: default to DRI=yes on solaris platforms + + Afaict there's little-to-no reason/way one would want xserver without + DRI support on Solaris platforms. + + This will allow us to simplify/fix all the libdrm detection in the next + commit. + + Cc: Alan Coopersmith + Signed-off-by: Emil Velikov + Reviewed-by: Alan Coopersmith + Reviewed-by: Adam Jackson + +commit 501d8e2beb337e072c93c9310fcd927a099b9c3b +Author: Emil Velikov +Date: Thu Sep 29 18:41:19 2016 +0100 + + configure.ac: remove --enable-aiglx option + + Presently the option guards both direct and accelerated indirect GLX. As + such when one toggles it off they end up without any acceleration. + + Remove the option all together until we have the time to split/rework + things. + + Cc: Jon Turney + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 7ec350ddd42479595f0ea88f86085af941913617 +Author: Emil Velikov +Date: Thu Sep 29 18:41:18 2016 +0100 + + xfree86: remove aiglx cmd/xorg.conf option + + The option is misleading and using it leads to disabling both direct and + accelerated indirect GLX. In such cases the xserver GLX attempts to + match DRISW (IGLX) configs with the DRI2/3 ones (direct GLX) leading to + all sorts of fun experience. + + Remove the option until we get a clear split and control over direct vs + indirect GLX. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 04ef8558a731bf070abf1b40c7e6b54aad8f5f31 +Author: Emil Velikov +Date: Thu Sep 29 18:41:17 2016 +0100 + + glx: drisw is not accelerated IGLX, reflect that in log messages + + The messages from glxdricommon.c (used by drisw) still have the A, but + at least we're don't have it locally. + + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov + +commit 1c2fcb95484777ca9aa80b3f814ad64e81f825f1 +Author: Olivier Fourdan +Date: Wed Oct 5 08:36:21 2016 +0200 + + glamor: Fix pixmap offset for bitplane in glamor_copy_fbo_cpu + + Commit cba28d5 - "glamor: Handle bitplane in glamor_copy_fbo_cpu" + introduced a regression as the computed pixmap offset would not match + the actual coordinates and write data elsewhere in memory causing a + segfault in fbBltOne(). + + Translate the pixmap coordinates so that the data is read and written at + the correct location. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97974 + Signed-off-by: Olivier Fourdan + Reviewed-and-Tested-by: Michel Dänzer + +commit a6e85e6330adcdcbcd939c0963daaecc96d41a2a +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:08 2016 +0800 + + xwayland: Add pointer warp emulator + + Emulate pointer warps by locking the pointer and sending relative + motion events instead of absolute. X will keep track of the "fake" + pointer cursor position given the relative motion events, and the + client warping the cursor will warp the faked cursor position. + + Various requirements need to be met for the pointer warp emulator to + enable: + + The cursor must be invisible: since it would not be acceptable that a + fake cursor position would be different from the visual representation + of the cursor, emulation can only be done when there is no visual + representation done by the Wayland compositor. Thus, for the emulator + to enable, the cursor must be hidden, and would the cursor be displayed + while the emulator is active, the emulator would be destroyed. + + The window that is warped within must be likely to have pointer focus. + For example, warping outside of the window region will be ignored. + + The pointer warp emulator will disable itself once the fake cursor + position leaves the window region, or the cursor is made visible. + + This makes various games depending on pointer warping (such as 3D + first-person shooters and stategy games using click-to-drag-map like + things) work. + + Signed-off-by: Jonas Ådahl + +commit 467ab142fff926e1475440dd5f649a49f45808fa +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:07 2016 +0800 + + xwayland: Translate a pointer grab with confineTo to pointer confinement + + Translate grabbing a pointer device with confineTo set to a window into + confining the Wayland pointer using the pointer constraints protocol. + This makes clients that depend on the pointer not going outside of the + window region, such as certain games and virtual machines viewers, to + function more properly. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit ca7b593fbe54bc9a0b44037e62e4b4401cbd375e +Author: Jonas Ådahl +Date: Thu Sep 29 10:42:13 2016 +0800 + + xwayland: Bind pointer constraints global + + Will be used by the pointer warp emulator. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit c14a8c6cc0fcd56c380d1220c2a8f04b74edee93 +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:05 2016 +0800 + + xwayland: Put getting a xwl_window from a Window in a helper + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit b4644ce8d3420447a8e5a2339238968da0a59de7 +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:04 2016 +0800 + + xwayland: Set unaccelerated pointer motion delta if available + + If there was an relative pointer motion within the same frame as an + absolute pointer motion, provide both the absolute coordinate and the + unaccelerated delta when setting the valuator mask. + + If a frame contained only a relative motion, queue an absolute motion + with an unchanged position, but still pass the unaccelerated motion + event. + + If the wl_seat advertised by the compositor is not new enough, assume + each relative and absolute pointer motion arrives within their own + separate frames. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit aa9634d03bc2434dfd25476529eccb14e46fcfdc +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:03 2016 +0800 + + xwayland: Dispatch pointer motion events on wl_pointer.frame if possible + + Wait until wl_pointer.frame with dispatching the pointer motion event, + if wl_pointer.frame is supported by the compositor. This will later be + used to combine unaccelerated motion deltas with the absolute motion + delta. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit 42e8902395cb27af5c28306abd577a92c467a62d +Author: Krzysztof Sobiecki +Date: Tue Sep 13 22:23:49 2016 +0800 + + xwayland: Add a new input device used for pointer warping/locking + + Generating relative and absolute movement events from the same input + device is problematic, because an absolute pointer device doesn't + expect to see any relative motion events. To be able to generate + relative pointer motion events including unaccelerated deltas, create a + secondary pointer device 'xwayland-relative-pointer', and use that for + emitting relative motion events. + + Signed-off-by: Krzysztof Sobiecki + Signed-off-by: Jonas Ådahl + +commit 011ada724afdba8955f1d4844b306e61390eead8 +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:01 2016 +0800 + + xwayland: Move pointer button initialization into helper + + We'll later use this for initializing buttons for the relative pointer + since they need to be the same. + + Signed-off-by: Jonas Ådahl + +commit a77d0715c6272cc1778a54dccd8cb68dc28cd761 +Author: Jonas Ådahl +Date: Tue Sep 13 15:17:00 2016 +0800 + + xwayland: Split up device class init/release into functions + + Put device class initialization in init_[device_class](xwl_seat) and + releasing in release_[device class](xwl_seat). The purpose is to make + it easier to add more type of initialization here later, without making + the function too large. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit 9037ba736a0424feee2fb6ac20cf7687613dc452 +Author: Jonas Ådahl +Date: Thu Sep 29 10:40:01 2016 +0800 + + xwayland: Bind the relative pointer manager + + Will be used for getting unaccelerated motion events and later for + relative motions used by a pointer warp emulator. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit 0fae3be0686cae746e03d6e4592f97278cc2275d +Author: Jonas Ådahl +Date: Tue Sep 13 15:16:57 2016 +0800 + + dix: Add valuator_mask_set_absolute_unaccelerated + + Add a valuator mask setter for setting absolute coordinate combined + with unaccelerated motion deltas. This will later be used by Xwayland + to combine a wl_pointer.motion() event with the unaccelerated delta of + a wp_relative_pointer.relative_motion() event. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + +commit bbd4854f81ebba1119202c5f6ff4679c62afec1f +Author: Carlos Garnacho +Date: Tue Sep 27 19:03:26 2016 +0200 + + xwayland: Apply touch abs axes transformation before posting events + + The way we map the touch absolute device to screen coordinates can't + work across wl_output mode and geometry events. Instead, set up + a fixed coordinate space, and transform touch events according to + the screen coordinate space as they happen. + + Reviewed-by: Adam Jackson + Signed-off-by: Carlos Garnacho + +commit ee526285882995289846648f3122c4295e3e8284 +Author: Carlos Garnacho +Date: Wed Sep 28 12:35:36 2016 +0200 + + xwayland: Apply "last pointer window" check only to the pointer device + + The checks in xwayland's XYToWindow handler pretty much assumes that the + sprite is managed by the wl_pointer, which is not entirely right, given + 1) The Virtual Core Pointer may be controlled from other interfaces, and + 2) there may be other SpriteRecs than the VCP's. + + This makes XYToWindow calls return a sprite trace with just the root + window if any of those two assumptions are broken, eg. on touch events. + + So turn the check upside down, first assume that the default XYToWindow + proc behavior is right, and later cut down the spriteTrace if the + current device happens to be the pointer and is out of focus. We work + our way to the device's lastSlave here so as not to break assumption #1 + above. + + Reviewed-by: Adam Jackson + Signed-off-by: Carlos Garnacho + Acked-by: Olivier Fourdan + +commit 2b6a068d21997ca812e665ed058e72eb4626c129 +Author: Keith Packard +Date: Mon Oct 3 15:37:03 2016 -0700 + + fb: XYPixmap format PutImage includes all planes in depth + + Unlike GetImage, for which the provided planemask restricts the data + delivered, for PutImage in XYPixmap format, all of the planes in the + drawable depth are sent and those outside the plane mask are simply + ignored. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit c9b8ce73927a43ed82b267d1c1985445f24827cc +Author: Mark Yao +Date: Fri Sep 30 16:42:35 2016 +0800 + + glamor: spans: fixup wrong count on glDrawArrays + + In commit 9e9fcf5 (glamor: Add a helper function for the common + GL_QUADS fallback pattern.), the glDrawArrays count change was + accidentally changed to nbox. + + Fixes xlogo with MESA_GL_VERSION_OVERRIDE=2.1 and + MESA_GLSL_VERSION_OVERRIDE=120 + + Signed-off-by: Mark Yao + Reviewed-by: Eric Anholt + +commit 2aca2dadda4cc9c378049457885d33a4eede9768 +Author: Eric Anholt +Date: Sat Sep 24 14:42:28 2016 -0700 + + glamor: Fix link failure on GLES2. + + Current Mesa requires that the precision qualifier on uniforms matches + between stages, even if (as in this case) the uniform isn't used in + one of the stages. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 20fcdfcf39497fe44d2a3200338523effb8e2bc6 +Author: Eric Anholt +Date: Sat Sep 24 14:30:27 2016 -0700 + + glamor: Remove #if 0-ed picture dumping code. + + I don't think anybody has run this code since it was pulled into the + server. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 4b5326aeba539249fcded91bf7806a708eeca651 +Author: Eric Anholt +Date: Sat Sep 24 14:04:14 2016 -0700 + + glamor: Remove many unused glamor util functions. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 117d614d1ba324bdb02c50a430c2e0d22a384f03 +Author: Eric Anholt +Date: Sat Sep 24 22:26:17 2016 +0300 + + glamor: Require GL_OES_texture_border_clamp for GLES2. + + The extension came out in 2000, and all Mesa-supported hardware that + can do glamor supports it. We were already relying on the ARB version + being present on desktop. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 7a5ddf8da5ed817aa2dd6f7af1b9197a5ceec60b +Author: Adam Jackson +Date: Wed Sep 28 15:27:20 2016 -0400 + + test: Re-enable a couple of GetImage tests + + Fixed in 6c6f09aac. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit c7a9161da5eb80ef0444601621b52314255b0ce5 +Author: Francois Tigeot +Date: Fri Sep 23 11:36:49 2016 +0200 + + Enable XTRANS_SEND_FDS on FreeBSD, DragonFly and OpenBSD + + This code is based on local patches which had been sitting in + FreeBSD and OpenBSD ports. + + Reviewed-by: Matthieu Herrb + Signed-off-by: François Tigeot + +commit 6c6f09aac7f1d1367a042087b7681c7fdf1d1e0f +Author: Keith Packard +Date: Sun Sep 25 14:19:08 2016 +0300 + + xace: Don't censor window borders + + GetImage is allowed to return window border contents, so don't remove + that from the returned image. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 380c2ca25ec4dd330f938e382ff4af60bc253785 +Author: Hans de Goede +Date: Fri Sep 23 14:11:52 2016 +0300 + + XF86VidMode: Fix free() on walked pointer + + Based on: https://patchwork.freedesktop.org/patch/85636/ + + Rewritten to just not walk the pointer. + + Signed-off-by: Hans de Goede + Reviewed-by: Emi Velikov + +commit 220d327ee00ec1278d50d4ba8cd20612e8b77c8f +Author: Hans de Goede +Date: Fri Sep 23 14:06:52 2016 +0300 + + Xext: Fix a memory leak + + Based on: https://patchwork.freedesktop.org/patch/85636/ + + Rewritten to also free the resources allocated by + panoramix_setup_ids(). + + Signed-off-by: Hans de Goede + Reviewed-by: Emi Velikov + +commit 3abf791ab82cb3dc7eacd0317fe0262a71340753 +Author: Michael Thayer +Date: Fri Sep 16 17:51:25 2016 +0200 + + modesetting: only fall back to drmModeSetCursor() on -EINVAL + + This change effectively reverts commit 074cf58. We were falling back from + drmModeSetCursor2() to drmModeSetCursor() whenever the first failed. This + fall-back only makes sense on pre-mid-2013 kernels which implemented the + cursor_set hook but not cursor_set2, and in this case the call to + drmModeSetCursor2() will always return -EINVAL. Specifically, a return + value of -ENXIO usually means that neither are supported. + + Signed-off-by: Michael Thayer + [hdegoede@redhat.com: initialize ret to -EINVAL] + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 363f4273dd4aec3e26cc57ecb6c20f27e6c813d8 +Author: Daniel Martin +Date: Fri Dec 11 12:05:22 2015 +0100 + + modesetting: Consume all available udev events at once + + We get multiple udev events for actions like docking a laptop into its + station or plugging a monitor to the station. By consuming as much + events as we can, we reduce the number of output re-evalutions. + + I.e. having a Lenovo X250 in a ThinkPad Ultra Dock and plugging a + monitor to the station generates 5 udev events. Or having 2 monitors + attached to the station and docking the laptop generates 7 events. + + It depends on the timing how many events can consumed at once. + + Signed-off-by: Daniel Martin + [hdegoede@redhat.com: Keep goto out so that we always call RRGetInfo()] + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit ea91db4b83312e791dcae935b8720f49a3861d72 +Author: Qiang Yu +Date: Thu Sep 8 21:24:58 2016 +0800 + + config: fix GPUDevice fail when AutoAddGPU off + BusID + + This fix is for the following xorg.conf can work: + + Section "ServerFlags" + Option "AutoAddGPU" "off" + EndSection + + Section "Device" + Identifier "Amd" + Driver "ati" + BusID "PCI:1:0:0" + EndSection + + Section "Device" + Identifier "Intel" + Driver "modesetting" + BusID "pci:0:2:0" + EndSection + + Section "Screen" + Identifier "Screen0" + Device "Intel" + GPUDevice "Amd" + EndSection + + Without AutoAddGPU off, modesetting DDX will also be loaded + for GPUDevice. + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + Signed-off-by: Hans de Goede + +commit ca8d88e50310a0d440a127c22a0a383cc149f408 +Author: Laszlo Ersek +Date: Wed Sep 7 15:08:06 2016 +0200 + + xfree86: recognize primary BUS_PCI device in xf86IsPrimaryPlatform() + + The new platform bus code and the old PCI bus code overlap. Platform bus + can handle any type of device, including PCI devices, whereas the PCI code + can only handle PCI devices. Some drivers only support the old style + PCI-probe methods, but the primary device detection code is server based, + not driver based; so we might end up with a primary device which only has + a PCI bus-capable driver, but was detected as primary by the platform + code, or the other way around. + + (The above paragraph was shamelessly stolen from Hans de Goede, and + customized.) + + The latter case applies to QEMU's virtio-gpu-pci device: it is detected as + a BUS_PCI primary device, but we actually probe it first (with the + modesetting driver) through xf86platformProbeDev(). The + xf86IsPrimaryPlatform() function doesn't recognize the device as primary + (it bails out as soon as it sees BUS_PCI); instead, we add the device as a + secondary graphics card under "autoAddGPU". In turn, the success of this + automatic probing-as-GPU prevents xf86CallDriverProbe() from proceeding to + the PCI probing. + + The result is that the server exits with no primary devices detected. + + Commit cf66471353ac ("xfree86: use udev to provide device enumeration for + kms devices (v10)") added "cross-bus" matching to xf86IsPrimaryPci(). Port + that now to xf86IsPrimaryPlatform(), so that we can probe virtio-gpu-pci + as a primary card in platform bus code. + + Cc: Adam Jackson + Cc: Dave Airlie + Cc: Hans de Goede + Cc: Keith Packard + Cc: Marcin Juszkiewicz + Signed-off-by: Laszlo Ersek + Tested-By: Marcin Juszkiewicz + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 44968da376c880e096225f149f78673aa4c6e5e0 +Author: Kyle Guinn +Date: Fri Sep 23 15:03:34 2016 +0300 + + xfree86: Fix null pointer dereference + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93675 + Signed-off-by: Kyle Guinn + [hdegoede@redhat.com: Simplify by adding 2 if conds together with &&] + Signed-off-by: Hans de Goede + +commit 127e0569ca8dbf774df8f83d4c59bbbbf2e25a20 +Author: David CARLIER +Date: Fri Sep 23 14:17:12 2016 +0300 + + xfree86: small memory leaks fixes + + A couple of memory leaks fixes and avoiding bit shifting on an + unitialized value. + + [hdegoede@redhat.com: Split out some non free fixes in separate patches] + [hdegoede@redhat.com: Don't touch ancient (and weird) os/rpcauth.c code] + Signed-off-by: Hans de Goede + +commit d51cce7992508f366758fa13dd93be24df0947ed +Author: Adam Jackson +Date: Tue Jul 5 13:07:09 2016 -0400 + + xephyr: Don't crash if the server advertises zero xv adaptors + + Useless as an XVideo implementation with zero adaptors might be, it's + apparently a thing in the wild. Catch this case and bail out of xv init + if it happens. + + Signed-off-by: Adam Jackson + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 445271ec00f25405fa5ed0e149dd4a9d9f6098d4 +Author: Hans de Goede +Date: Fri Jul 1 17:36:02 2016 +0200 + + glx: Always enable EXT_texture_from_pixmap for DRI swrast glx + + Prior to commit f95645c6f700 ("glx: Don't enable EXT_texture_from_pixmap + unconditionally") DRI glx would always advertise EXT_texture_from_pixmap. + + That commit moved the setting of the extension in the extension bits from + __glXInitExtensionEnableBits to its callers so that + __glXInitExtensionEnableBits can be used more generally, but at the same + time made the setting of EXT_texture_from_pixmap conditionally on + __DRI_TEX_BUFFER being present. + + This has result in an unintended behavior change which breaks e.g. + compositors running on llvmpipe. This commit makes the DRI swrast glx code + advertise EXT_texture_from_pixmap unconditionally again fixing this. + + Fixes: f95645c6f700 ("glx: Don't enable EXT_texture_from_pixmap unconditionally") + Signed-off-by: Hans de Goede + --- + Changes in v2: + -Only add unconditional advertising of GLX_EXT_texture_from_pixmap + to glxdriswrast.c, do not also add it to glxdri2.c + +commit 02ff0a5d7e32ce8460d6d0669f532d65ad212fcd +Author: Hans de Goede +Date: Sat Sep 17 11:33:13 2016 +0200 + + xf86RandR12: Fix XF86VidModeSetGamma triggering a BadImplementation error + + Commit b4e46c0444bb ("xfree86: Hook up colormaps and RandR 1.2 gamma code") + dropped the providing of a pScrn->ChangeGamma callback from the xf86RandR12 + code. Leaving pScrn->ChangeGamma NULL in most cases. + + This triggers the BadImplementation error in xf86ChangeGamma() : + + if (pScrn->ChangeGamma) + return (*pScrn->ChangeGamma) (pScrn, gamma); + + return BadImplementation; + + Which causes X-apps using XF86VidModeSetGamma to crash with a + X protocol error. + + This commit fixes this by re-introducing the xf86RandR12ChangeGamma + helper removed by the commit and adjusting it to work with the new + combined palette / gamma code. + + Fixes: b4e46c0444bb ("xfree86: Hook up colormaps and RandR 1.2 gamma code") + Signed-off-by: Hans de Goede + Reviewed-by: Alex Deucher + +commit a58dd678bf952560e5422845e186d80a189953fe +Author: Hans de Goede +Date: Sat Sep 17 11:42:09 2016 +0200 + + xf86RandR12: Move calculating of shift inside init_one_component + + This is a preparation patch to allow easier usage of init_one_component + outside of xf86RandR12CrtcInitGamma. + + Signed-off-by: Hans de Goede + Reviewed-by: Alex Deucher + +commit 299cbb92670fdb83c24c3ef6327eb9d66b8be92a +Author: Hans de Goede +Date: Thu Sep 15 14:35:52 2016 +0200 + + modesetting: Fix reverse prime update lagging on secondary GPU outputs + + When using secondary GPU outputs the primary GPU's blockhandler + will copy changes from its framebuffer to a pixmap shared with the + secondary GPU. + + In reverse prime setups the secondary GPU's blockhandler will do another + copy from the shared pixmap to its own framebuffer. + + Before this commit, if the primary GPU's blockhandler would run after + the secondary GPU's blockhandler and no events were pending, then the + secondary GPU's blockhandler would not run until some events came in + (WaitForSomething() would block in the poll call), resulting in the + secondary GPU output sometimes showing stale contents (e.g. a just closed + window) for easily up to 10 seconds. + + This commit fixes this by setting the timeout passed into the + blockhandler to 0 if any shared pixmaps were updated by the primary GPU, + forcing an immediate re-run of all blockhandlers. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit e8695100b17b758359fc4897dbe995231ed224fc +Author: Hans de Goede +Date: Thu Sep 15 14:28:35 2016 +0200 + + modesetting: Fix reverse prime partial update issues on secondary GPU outputs + + When using reverse prime we do 2 copies, 1 from the primary GPU's + framebuffer to a shared pixmap and 1 from the shared pixmap to the + secondary GPU's framebuffer. + + This means that on the primary GPU side the copy MUST be finished, + before we start the second copy (before the secondary GPU's driver + starts processing the damage on the shared pixmap). + + This fixes secondary outputs sometimes showning (some) old fb contents, + because of the 2 copies racing with each other, for an example of + what this looks like see: + + https://fedorapeople.org/~jwrdegoede/IMG_20160915_130555.jpg + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + Reviewed-by: Eric Anholt + +commit 862a3dab287b5186a958d0131d70779468348e3e +Author: Olivier Fourdan +Date: Thu Sep 22 09:38:50 2016 +0200 + + xwayland: Clear up x_cursor on UnrealizeCursor() + + In Xwayland's xwl_unrealize_cursor(), the x_cursor is cleared up only + when a device value is provided to the UnrealizeCursor() routine, but + if the device is NULL as called from FreeCursor(), the corresponding + x_cursor for the xwl_seat is left untouched. + + This might cause a segfault when trying to access the unrealized + cursor's devPrivates in xwl_seat_set_cursor(). + + A possible occurrence of this is the client changing the cursor, the + Xserver calling FreeCursor() which does UnrealizeCursor() and then + the Wayland server sending a pointer enter event, which invokes + xwl_seat_set_cursor() while the seat's x_cursor has just been + unrealized. + + To avoid this, walk through all the xwl_seats and clear up all x_cursor + matching the cursor being unrealized. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Jonas Ådahl + Reviewed-by: Hans de Goede + +commit b79eaf1184f6514ede9dcd9baaa24a40ef724a15 +Author: Olivier Fourdan +Date: Thu Sep 15 15:59:07 2016 +0200 + + xwayland: handle EAGAIN on Wayland fd + + wl_display_flush() can fail with EAGAIN and Xwayland would make this a + fatal error. + + When this happens, it means that Xwayland has flooded the Wayland file + descriptor, either because the Wayland compositor cannot cope or more + likely because of a deadlock situation where the Wayland compositor is + blocking, waiting for an X reply while Xwayland tries to write data to + the Wayland file descriptor. + + The general consensus to avoid the deadlock is for the Wayland + compositor to never issue blocking X11 roundtrips, but in practice + blocking rountrips can occur in various places, including Xlib calls + themselves so this is not always achievable without major surgery in the + Wayland compositor/Window manager. + + What this patch does is to avoid dispatching to the Wayland file + descriptor until it becomes available for writing again, while at the + same time continue processing X11 requests to release the deadlock. + + This is not perfect, as there is still the possibility of another X + client hammering the connection and we'll still fail writing to the + Wayland connection eventually, but this improves things enough to avoid + a 100% repeatable crash with vlc and gtkperf. + + Also, it is worth considering that window managers and Wayland + compositors such as mutter already have a higher priority than other + regular X clients thanks to XSyncSetPriority(), mitigating the risk. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1278159 + Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=763400 + Signed-off-by: Olivier Fourdan + Reviewed-by: Daniel Stone + +commit 36e1a058c5826398ceea9dba6c166ae40c75646e +Author: Rui Matos +Date: Fri Feb 5 14:44:29 2016 +0100 + + xwayland: Close the shm fd as early as possible + + Keeping the shm fd open beyond pixmap creation means we can easily + reach the open file descriptor limit if an X client asks us to create + that many pixmaps. Instead, let's get the wl_buffer immediatly so that + we can destroy the shm pool and close the fd before being asked to + create more. + Tested-by: Olivier Fourdan + Reviewed-by: Olivier Fourdan + +commit fd4a6dc06fcf8671d616af52025e19200c79e404 +Author: Adam Jackson +Date: Tue Sep 27 17:15:12 2016 -0400 + + glamor: Fall back to software for CopyPlane if we need to + + glUniform4ui is available starting in GL{,ES} 3.0. Technically it's + also in EXT_gpu_shader4, but that's not worth supporting. There was also + a MESA_shading_language_130 spec proposed at one point; if that ever + gets finished, we can update epoxy to know about it and fix up the + feature check. + + Signed-off-by: Adam Jackson + Reviewed-by: Michel Dänzer + +commit c49e820f796c27cbd2907709576a3fb672acd453 +Author: Eric Anholt +Date: Sun Sep 25 13:30:22 2016 -0700 + + test: Run xts against Xephyr -glamor when present + + v2: Drop x8r8g8b8 skip, now that it's fixed. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 5392ea5525082ceeb3aad50d9168baee2abc860e +Author: Eric Anholt +Date: Sun Sep 25 13:30:21 2016 -0700 + + test: Switch our testing X server to being spawned with simple-xinit + + Once I introduced a second X server being tested, I found that startx + hit races in choosing a display. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 283840c295c69aa3729f3f0aa2bf3ef83b1c220f +Author: Eric Anholt +Date: Sun Sep 25 13:30:20 2016 -0700 + + test: Update piglit HTML even when tests all pass + + I was confused by the behavior I'd written before. keithp and + mattst88 responded with shock that I would have made it so surprising, + as well. + + v2: Point to index.html instead of problems.html, which won't exist if + we had no problems. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 022fea767cd29d256fb99159df89cc25d339e787 +Author: Eric Anholt +Date: Sun Sep 25 13:30:19 2016 -0700 + + test: Fix parsing of piglit results + + The "dmesg-fail" line was matching our "fail" regex, so if you didn't + have those we would ignore fails. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 7fe5b9c02cf90b81532cb6dee3ec75c90c72c27c +Author: Eric Anholt +Date: Sun Sep 25 13:30:18 2016 -0700 + + test: Make the piglit-running script callable with an arbitrary server + + v2: Check that SERVER_COMMAND is set. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 7ac130a0664b43b6ba5324548c8f7ab8230f7199 +Author: Eric Anholt +Date: Sun Sep 25 13:30:17 2016 -0700 + + test: Add a little xinit-like program for starting servers for testing + + The normal xinit is racy because it doesn't use -displayfd. This + implements the bare minimum for testing purposes, using -displayfd to + sequence starting the client, and avoids adding yet another dependency + to the server. + + v2: Fix asprintf error checks. + v3: Add error checking for fork(), clarify calloc() arg. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 8d5e0c07b965d545c925c34be95d41c29135a63a +Author: Eric Anholt +Date: Sun Sep 25 13:30:16 2016 -0700 + + test: Handle srcdir != builddir in Xvfb testing + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit add49792608171feef8090f7520cfa02d2daae9c +Author: Eric Anholt +Date: Sun Sep 25 13:30:15 2016 -0700 + + ephyr: Add a mode for skipping redisplay in glamor + + This speeds up headless testing of Xephyr -glamor with softpipe from + "a test per minute or so" to "a test every few seconds". + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 453f813bb4afd39eb5b6b3c4a822894e04b6b11b +Author: Eric Anholt +Date: Sat Sep 24 14:37:28 2016 +0300 + + glamor: Properly handle mask formats without alpha. + + Even if the pixmap's storage has alpha, it may have been uploaded with + garbage in the alpha channel, so we need to force the shader to set + alpha to 1. This was broken way back in + 355334fcd99e4dce62e2be1e27290c9a74ea944f. + + Fixes rendercheck -t composite -f x8r8g8b8. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 905c877f094eb6cfe905d64e34fdd01a72dd8103 +Author: Eric Anholt +Date: Tue Sep 20 12:24:38 2016 +0100 + + glamor: Require that pixmap depths match for Render copies. + + The copy optimization in d37329cba42fa8e72fe4be8a7be18e512268b5bd + replicated a bug from last time we did a copy optimization: CopyArea + is only defined for matching depths. This is only a problem at 15 vs + 16 depth right now (24 vs 32 would also have matching Render formats, + but they should work) but be strict in case we store other depths + differently in the future. + + Fixes rendercheck -t blend -o src -f x4r4g4b4,x3r4g4b4 + + v2: Drop excessive src->depth == dst->depth check that snuck in. + v3: Switch back to src->depth == dst->depth + v4: Touch up commit message (s/bpp/depth). + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit b87a07567421af05622197eec91a71e4fca4f79e +Author: Eric Anholt +Date: Tue Sep 20 12:14:36 2016 +0100 + + glamor: Fix some awful formatting of some fallback debug code. + + This was clearly x-indent.sh damage. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit ba199cb90157cefab01183f2e2c909895df73321 +Author: Mark Kettenis +Date: Tue Nov 17 22:31:21 2015 +0100 + + glamor: Make glamor_sync_init work with --disable-xshmfence + + Signed-off-by: Mark Kettenis + Signed-off-by: Eric Anholt + Reviewed-by: Hans de Goede + +commit 8bb4b11298c285d2cd1eb28e65729933ec386829 +Author: Matthieu Herrb +Date: Fri Sep 23 16:56:06 2016 +0300 + + glamor: Make glamor_name_from_pixmap work without DRI3 + + This function is used by the modesetting driver to implement DRI2 and + shouldn't fail on systems that don't support DRI3. + + v2: Drop stale commit message wording, fix compiler warning (by anholt) + + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + +commit 128d40b2dd0a26a075a67854455d4208afaa01ca +Author: Eric Engestrom +Date: Sat Apr 2 19:53:18 2016 +0100 + + glamor: fix spelling mistakes + + v2: Fix "orignal" too (review feedback by ajax, change by anholt)_ + + Signed-off-by: Eric Engestrom + Reviewed-by: Eric Anholt + +commit ade315386cee9a65a3885c65e96256880ac6f00a +Author: Keith Packard +Date: Fri Sep 23 09:52:21 2016 +0300 + + Require xproto 7.0.31 + + xproto 7.0.30 had a typo which caused compiles to fail on anything + other than clang + + Signed-off-by: Keith Packard + +commit f72ff1f7ac784f3911fe2f8d746f62f7709f0edc +Author: Jeremy Huddleston Sequoia +Date: Mon Sep 19 09:34:50 2016 -0700 + + XQuartz: Silence an expected TSan warning + + This code is safe. If the data race fails, the result is that we take the + lock and recheck. + + ================== + WARNING: ThreadSanitizer: data race (pid=31401) + Read of size 1 at 0x00010f5d2500 by thread T11: + #0 wait_for_mieq_init darwinEvents.c:102 (X11.bin+0x00010003155a) + #1 -[X11Application(Private) sendX11NSEvent:] X11Application.m:1330 (X11.bin+0x00010001d652) + #2 __28-[X11Application sendEvent:]_block_invoke X11Application.m:476 (X11.bin+0x00010001887f) + #3 __tsan::invoke_and_release_block(void*) :144 (libclang_rt.tsan_osx_dynamic.dylib+0x00000005d97b) + #4 _dispatch_client_callout :33 (libdispatch.dylib+0x0000000020ef) + + Previous write of size 1 at 0x00010f5d2500 by thread T8: + [failed to restore the stack] + + Location is global 'mieqInitialized' at 0x00010f5d2500 (X11.bin+0x000100599500) + + Thread T11 (tid=4367138, running) created by thread T-1 + [failed to restore the stack] + + Thread T8 (tid=4367130, running) created by main thread at: + #0 pthread_create :144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) + #1 create_thread quartzStartup.c:78 (X11.bin+0x000100039d2d) + #2 QuartzInitServer quartzStartup.c:95 (X11.bin+0x000100039b96) + #3 X11ApplicationMain X11Application.m:1238 (X11.bin+0x00010001cd54) + #4 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a5b2) + #5 server_main quartzStartup.c:136 (X11.bin+0x000100039fbb) + #6 do_start_x11_server bundle-main.c:436 (X11.bin+0x000100002e25) + #7 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x000100004e09) + #8 mach_startup_server mach_startupServer.c:399 (X11.bin+0x0001000056a4) + #9 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #10 start :29 (libdyld.dylib+0x000000005254) + + SUMMARY: ThreadSanitizer: data race darwinEvents.c:102 in wait_for_mieq_init + ================== + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 7d6ebf3f4e4d517bb846d15a5deb131da19a267c +Author: Jeremy Huddleston Sequoia +Date: Mon Sep 19 00:21:44 2016 -0700 + + XQuartz: Adopt input_lock() and input_unlock() + + This allows us to remove darwinEvents_lock() and darwinEvents_unlock() + and remove the serverRunning hack from dix + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 8bc4727f475321a8adcbbd859f3f8dd9eeb64aa4 +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 18 23:17:19 2016 -0700 + + XQuartz: pbproxy shouldn't need to wait for server initialization. + + Just block on the socket like every other client does. + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 81493d30981d7deb38f57bca2a35487add5ea509 +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 18 23:13:20 2016 -0700 + + XQuartz: Remove X11ApplicationFatalError + + AppKit handles crashes on app launch with their own dialog now, so we shouldn't need to do this ourselves. + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 9153ec8464336c280f2a6e79ffa443104bbeb98c +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 18 22:45:16 2016 -0700 + + XQuartz: Don't respond to SIGALRM on the AppKit thread + + ================== + WARNING: ThreadSanitizer: data race (pid=69627) + Write of size 8 at 0x00010dae73f8 by main thread (mutexes: write M262): + #0 SmartScheduleTimer utils.c:1245 (X11.bin+0x0001004b21f9) + #1 __tsan::CallUserSignalHandler(__tsan::ThreadState*, bool, bool, bool, int, my_siginfo_t*, void*) :144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000279f6) + #2 __CFRunLoopRun :77 (CoreFoundation+0x000000087e17) + #3 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) + #4 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) + #5 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) + #6 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) + #7 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) + #8 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #9 start :29 (libdyld.dylib+0x000000005254) + + Previous read of size 8 at 0x00010dae73f8 by thread T7: + [failed to restore the stack] + + Location is global 'SmartScheduleTime' at 0x00010dae73f8 (X11.bin+0x0001005b03f8) + + Mutex M262 (0x7d300000bd10) created at: + #0 pthread_mutex_init :144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000253c3) + #1 __CFRunLoopCreate :77 (CoreFoundation+0x000000054e63) + #2 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) + #3 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) + #4 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) + #5 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) + #6 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) + #7 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #8 start :29 (libdyld.dylib+0x000000005254) + + Thread T7 (tid=4051693, running) created by main thread at: + #0 pthread_create :144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) + #1 create_thread quartzStartup.c:78 (X11.bin+0x0001000398dd) + #2 QuartzInitServer quartzStartup.c:95 (X11.bin+0x000100039813) + #3 X11ApplicationMain X11Application.m:1286 (X11.bin+0x00010001c804) + #4 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) + #5 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) + #6 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) + #7 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) + #8 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) + #9 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #10 start :29 (libdyld.dylib+0x000000005254) + + SUMMARY: ThreadSanitizer: data race utils.c:1245 in SmartScheduleTimer + ================== + ================== + WARNING: ThreadSanitizer: signal handler spoils errno (pid=69627) + #0 SmartScheduleTimer utils.c:1244 (X11.bin+0x0001004b21a0) + #1 __CFRunLoopRun :77 (CoreFoundation+0x000000087e17) + #2 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a062) + #3 server_main quartzStartup.c:127 (X11.bin+0x000100039b6b) + #4 do_start_x11_server bundle-main.c:436 (X11.bin+0x0001000022c5) + #5 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x0001000042a9) + #6 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100004b44) + #7 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #8 start :29 (libdyld.dylib+0x000000005254) + + SUMMARY: ThreadSanitizer: signal handler spoils errno utils.c:1244 in SmartScheduleTimer + ================== + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 2740dc1937e8ab32b4930f4086c302e6602a7bad +Author: Jeremy Huddleston Sequoia +Date: Mon Sep 19 01:25:13 2016 -0700 + + dix: Silence TSan warnings when checking for pending input + + V2: Moves InputCheckPending() into dix.h + + Bumps required version of xproto to 7.0.30 + + ================== + WARNING: ThreadSanitizer: data race (pid=4943) + Read of size 4 at 0x00010c4e3854 by thread T8: + #0 WaitForSomething WaitFor.c:237 (X11.bin+0x00010049216c) + #1 Dispatch dispatch.c:413 (X11.bin+0x000100352ed9) + #2 dix_main main.c:287 (X11.bin+0x00010036e894) + #3 server_thread quartzStartup.c:66 (X11.bin+0x000100039e63) + + Previous write of size 4 at 0x00010c4e3854 by thread T12 (mutexes: write M856, write M1976): + #0 mieqEnqueue mieq.c:263 (X11.bin+0x000100448d14) + #1 DarwinSendDDXEvent darwinEvents.c:641 (X11.bin+0x000100033613) + #2 DarwinProcessFDAdditionQueue_thread darwinEvents.c:338 (X11.bin+0x000100032039) + + Location is global 'miEventQueue' at 0x00010c4e3850 (X11.bin+0x0001005ab854) + + Mutex M856 (0x00010c4c8c80) created at: + #0 pthread_mutex_lock :144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000321fe) + #1 DarwinListenOnOpenFD darwinEvents.c:300 (X11.bin+0x000100031607) + #2 socket_handoff bundle-main.c:288 (X11.bin+0x000100002b40) + #3 __do_request_fd_handoff_socket_block_invoke bundle-main.c:379 (X11.bin+0x0001000029ba) + #4 __tsan::invoke_and_release_block(void*) :144 (libclang_rt.tsan_osx_dynamic.dylib+0x00000005d97b) + #5 _dispatch_client_callout :33 (libdispatch.dylib+0x0000000020ef) + + Mutex M1976 (0x00010c4e3d68) created at: + #0 pthread_mutex_init :144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000253c3) + #1 input_lock inputthread.c:103 (X11.bin+0x00010049fd10) + #2 TimerSet WaitFor.c:343 (X11.bin+0x0001004926c2) + #3 RootlessQueueRedisplay rootlessScreen.c:594 (X11.bin+0x000100065d7f) + #4 RootlessInstallColormap rootlessScreen.c:514 (X11.bin+0x000100069f1a) + #5 miSpriteInstallColormap misprite.c:562 (X11.bin+0x000100467095) + #6 miCreateDefColormap micmap.c:270 (X11.bin+0x000100440399) + #7 DarwinScreenInit darwin.c:285 (X11.bin+0x0001000303bb) + #8 AddScreen dispatch.c:3908 (X11.bin+0x00010036c417) + #9 InitOutput darwin.c:671 (X11.bin+0x00010002fdeb) + #10 dix_main main.c:197 (X11.bin+0x00010036e228) + #11 server_thread quartzStartup.c:66 (X11.bin+0x000100039e63) + + Thread T8 (tid=4198779, running) created by main thread at: + #0 pthread_create :144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) + #1 create_thread quartzStartup.c:78 (X11.bin+0x000100039dad) + #2 QuartzInitServer quartzStartup.c:95 (X11.bin+0x000100039c16) + #3 X11ApplicationMain X11Application.m:1238 (X11.bin+0x00010001cde4) + #4 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a642) + #5 server_main quartzStartup.c:136 (X11.bin+0x00010003a03b) + #6 do_start_x11_server bundle-main.c:436 (X11.bin+0x000100002eb5) + #7 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x000100004e99) + #8 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000100005734) + #9 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #10 start :29 (libdyld.dylib+0x000000005254) + + Thread T12 (tid=4198797, running) created by thread T8 at: + #0 pthread_create :144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) + #1 create_thread darwinEvents.c:121 (X11.bin+0x000100031ecf) + #2 DarwinEQInit darwinEvents.c:365 (X11.bin+0x000100031860) + #3 InitInput darwin.c:571 (X11.bin+0x00010002ea09) + #4 dix_main main.c:261 (X11.bin+0x00010036e7ce) + #5 server_thread quartzStartup.c:66 (X11.bin+0x000100039e63) + + SUMMARY: ThreadSanitizer: data race WaitFor.c:237 in WaitForSomething + ================== + ================== + WARNING: ThreadSanitizer: data race (pid=22841) + Write of size 4 at 0x000105bbd864 by main thread (mutexes: write M1945): + #0 mieqEnqueue mieq.c:263 (X11.bin+0x000100448cf4) + #1 DarwinSendDDXEvent darwinEvents.c:642 (X11.bin+0x000100033693) + #2 -[X11Controller set_window_menu:] X11Controller.m:275 (X11.bin+0x0001000222fd) + #3 -[X11Application set_window_menu:] X11Application.m:486 (X11.bin+0x000100018b44) + #4 -[X11Application handleMachMessage:] X11Application.m:177 (X11.bin+0x000100016678) + #5 __NSFireMachPort :69 (Foundation+0x00000009b62b) + #6 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a5f2) + #7 server_main quartzStartup.c:136 (X11.bin+0x000100039ffb) + #8 do_start_x11_server bundle-main.c:436 (X11.bin+0x000100002e65) + #9 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x000100004e49) + #10 mach_startup_server mach_startupServer.c:399 (X11.bin+0x0001000056e4) + #11 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #12 start :29 (libdyld.dylib+0x000000005254) + + Previous read of size 4 at 0x000105bbd864 by thread T7: + #0 Dispatch dispatch.c:434 (X11.bin+0x000100352fc8) + #1 dix_main main.c:287 (X11.bin+0x00010036e874) + #2 server_thread quartzStartup.c:66 (X11.bin+0x000100039e23) + + Location is global 'miEventQueue' at 0x000105bbd860 (X11.bin+0x0001005ab864) + + Mutex M1945 (0x000105bbdd78) created at: + #0 pthread_mutex_init :144 (libclang_rt.tsan_osx_dynamic.dylib+0x0000000253c3) + #1 input_lock inputthread.c:103 (X11.bin+0x00010049fd10) + #2 TimerSet WaitFor.c:348 (X11.bin+0x0001004926c2) + #3 RootlessQueueRedisplay rootlessScreen.c:594 (X11.bin+0x000100065d3f) + #4 RootlessInstallColormap rootlessScreen.c:514 (X11.bin+0x000100069eda) + #5 miSpriteInstallColormap misprite.c:562 (X11.bin+0x000100467075) + #6 miCreateDefColormap micmap.c:270 (X11.bin+0x000100440379) + #7 DarwinScreenInit darwin.c:285 (X11.bin+0x00010003036b) + #8 AddScreen dispatch.c:3914 (X11.bin+0x00010036c3f7) + #9 InitOutput darwin.c:671 (X11.bin+0x00010002fd9b) + #10 dix_main main.c:197 (X11.bin+0x00010036e208) + #11 server_thread quartzStartup.c:66 (X11.bin+0x000100039e23) + + Thread T7 (tid=4257217, running) created by main thread at: + #0 pthread_create :144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) + #1 create_thread quartzStartup.c:78 (X11.bin+0x000100039d6d) + #2 QuartzInitServer quartzStartup.c:95 (X11.bin+0x000100039bd6) + #3 X11ApplicationMain X11Application.m:1238 (X11.bin+0x00010001cd94) + #4 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a5f2) + #5 server_main quartzStartup.c:136 (X11.bin+0x000100039ffb) + #6 do_start_x11_server bundle-main.c:436 (X11.bin+0x000100002e65) + #7 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x000100004e49) + #8 mach_startup_server mach_startupServer.c:399 (X11.bin+0x0001000056e4) + #9 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) + #10 start :29 (libdyld.dylib+0x000000005254) + + SUMMARY: ThreadSanitizer: data race mieq.c:263 in mieqEnqueue + ================== + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Keith Packard + +commit 7ff8a74945c0cb525a2d197e28426fd098a407cf +Author: Keith Packard +Date: Thu Sep 22 02:53:46 2016 +0300 + + os: Clear saved poll events in listen so that edge triggering works + + When a client is marked as write blocked, clear any old 'write ready' + bit in the osfds structure so that a new indication of write ready + (which is marked as edge trigggered) will trigger the callback. + + Signed-off-by: Keith Packard + Reviewed-by: Jeremy Huddleston Sequoia + Tested-by: Jeremy Huddleston Sequoia + Tested-by: Matthieu Herrb + +commit 1d365f1ffe0362732b64e565db6ae8af718758f2 +Author: Keith Packard +Date: Thu Sep 22 02:53:45 2016 +0300 + + os: Ready clients with pending output aren't flushed, so set NewOutputPending + + When a client with pending output is ready (has request data pending), + FlushAllOutput will skip it to get all of the requests processed + before sending any queued output. That means FlushAllOutput is going + to return with some output pending to a client which isn't known to be + write blocked. And that means NewOutputPending needs to be set so that + FlushAllOutput will get called again to actually go flush this client. + + It might be interesting to try just flushing the client to send any + queued data along the way. This patch just restores the server + behavior to what it was before the ospoll changes. + + Signed-off-by: Keith Packard + Reviewed-by: Jeremy Huddleston Sequoia + Tested-by: Jeremy Huddleston Sequoia + Tested-by: Matthieu Herrb + +commit d0c5d205a919fc1d2eb599356090b58b1bf0176d +Author: Jeremy Huddleston Sequoia +Date: Mon Sep 19 01:13:02 2016 -0700 + + dix: Make InitCoreDevices() failures more verbose. + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 5794bdd52821463acf691c4230741f6b4289669b +Author: Mihail Konev +Date: Wed Sep 14 11:47:15 2016 +0100 + + xkb: fix turbo-repeat of RedirectKey-ed keysyms + + RedirectKey() action had been broken by commit 2e6190. + A dropped check caused over-intense autorepeat of keysyms enriched + with the action. + + Previous to this commit, the check wrapped the entire switch() block, + which was dropped with the move to a separate function. + + Restore the checking. + + Signed-off-by: Mihail Konev + Reviewed-by: Daniel Stone + Signed-off-by: Peter Hutterer + +commit fc1c358b955258ce675e49490de7c3b8ddee2b76 +Author: Keith Packard +Date: Mon Sep 19 09:02:57 2016 -0700 + + Bump to 1.18.99.901 (1.19 RC1) + + Signed-off-by: Keith Packard + +commit 5998da7855750dd947288349a0b14e65db1e3c8c +Author: Jonas Ådahl +Date: Tue Sep 13 15:16:56 2016 +0800 + + dix: Incroduce CursorConfinedTo vfunc in Screen + + This function will be called when a pointer is grabbed non-root window + set as the 'confineTo'. This will enable the ddx to handle the + confinement their own way. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit daf48a3aba7d5c42d7156f0d0e2b1d8aae423303 +Author: Jonas Ådahl +Date: Tue Sep 13 15:16:55 2016 +0800 + + dix: Introduce CursorWarpedTo vfunc in Screen + + This new vfunc will be called, if set, after a client has issued a + WarpPointer request. This is necessary for implementing pointer warp + emulation in Xwayland. + + Signed-off-by: Jonas Ådahl + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 3ef51c5c74297937002668b0c507fa88550db67e +Author: Keith Packard +Date: Fri Sep 16 10:03:49 2016 -0700 + + Bump version to 1.18.99.2 + + Prepare for 1.19 RC1 + + Signed-off-by: Keith Packard + +commit 86038dfd42d6f6da9646ef2f87b2ab8ccba98e02 +Author: Keith Packard +Date: Fri Sep 16 10:56:15 2016 -0700 + + os: Add 'ospoll.h' to Makefile.am + + Distribute this source file. + + Signed-off-by: Keith Packard + +commit 56972d007dcde93693cb9e39931978b744942e5b +Author: Keith Packard +Date: Fri Sep 16 10:55:27 2016 -0700 + + include: Add 'xserver_poll.h' to Makefile.am + + Make sure this file is included in the tarball. + + Signed-off-by: Keith Packard + +commit 61b159f5a79130a9661064d3f0143e5d6107985a +Author: Keith Packard +Date: Fri Sep 16 10:54:37 2016 -0700 + + hw/xwin: Add 'dri' to DIST_SUBDIRS + + This creates the needed Makefile.in files during 'make dist' or 'make + distcheck' + + Signed-off-by: Keith Packard + +commit 93f474e49b24abc673cb9cf5ea16fac296dce312 +Author: Keith Packard +Date: Fri Sep 16 10:43:09 2016 -0700 + + Remove 'dixfontstubs.h' from include EXTRA_DIST + + This file was removed when moving to the new libXfont API, but + accidentally left in EXTRA_DIST. + + Signed-off-by: Keith Packard + +commit 5b9f3ea2501a886fb74e5248e82a95e76443f1e8 +Author: Michel Dänzer +Date: Thu Jan 14 18:09:44 2016 +0900 + + xfree86/modes: Set RandR primary output from CreateScreenResources + + Fixes XRRGetOutputPrimary and xrandr not reporting a primary output after + startup. This was especially confusing when an output was explicitly + marked as primary using Option "Primary" in Section "Monitor". + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit bd8ecd9be1568b59258b6d2f78530ede345b7c7a +Author: Michel Dänzer +Date: Fri Sep 16 09:51:31 2016 -0700 + + Add SyncSharedPixmap ScreenRec hook + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit 7f6fa4e449f5a7215bbf60ce8c874e163a7453a9 +Author: Qiang Yu +Date: Mon Sep 5 18:05:42 2016 +0800 + + modesetting: fix compile error when --disable-glamor + + Move ms_flush_drm_events out of GLAMOR ifdef. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97586 + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + Signed-off-by: Keith Packard + +commit d81f9ce12aa4ac54b9c2b8c74c2f827c1f3e739a +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 11 03:07:44 2016 -0700 + + dix/dispatch: Fix SmartScheduleClient interval adjustment to use best rather than pClient + + pClient does not contain a live value after the transition to lists + + https://bugs.freedesktop.org/show_bug.cgi?id=97765 + + Application Specific Information: + X.Org X Server 1.18.99.1 Build Date: 20160910 + ================================================================= + ==16921==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000108ce3834 at pc 0x000108880766 bp 0x7000045f76c0 sp 0x7000045f76b8 + READ of size 4 at 0x000108ce3834 thread T6 + #0 0x108880765 in SmartScheduleClient dispatch.c:365 + #1 0x10887ecc5 in Dispatch dispatch.c:422 + #2 0x1088c05f1 in dix_main main.c:301 + #3 0x1082aabba in server_thread quartzStartup.c:66 + #4 0x7fffc5f16aaa in _pthread_body (libsystem_pthread.dylib+0x3aaa) + #5 0x7fffc5f169f6 in _pthread_start (libsystem_pthread.dylib+0x39f6) + #6 0x7fffc5f161fc in thread_start (libsystem_pthread.dylib+0x31fc) + + Regressed-in: 8f1edf4bd3a1f050ce9eeb5eac45dd1a8f7a6d5e + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 265c4e66533243b60d92cffc7769ecadb0292c8d +Merge: 3caf671ed2 f5f4d32ac7 +Author: Keith Packard +Date: Thu Sep 15 21:32:46 2016 -0700 + + Merge remote-tracking branch 'jturney/master' + +commit 3caf671ed2a8a79856409a109355fc0f393d7aed +Author: Keith Packard +Date: Wed Sep 14 22:40:32 2016 -0700 + + config/dbus: Initialize dbus fd to -1 so teardown doesn't use fd 0 + + The dbus teardown code is called when the server fatal errors even if + that is before dbus has ever been initialized. By statically + initializing the value of bus_info.fd, we avoid calling RemoveNotifyFd + on stdin. + + Signed-off-by: Keith Packard + Reviewed-by: Julien Cristau + Reviewed-by: Peter Hutterer + +commit f5f4d32ac7c250cfbfb94883ce7d7e46151e89f0 +Author: Jon Turney +Date: Thu Jul 24 12:29:41 2014 +0100 + + Add Windows-DRI extension + + If windowsdriproto headers are available, build a Windows-DRI extension, + which supports requests to enable local clients to directly render GL to a + Windows drawable: + + - a query to check if WGL is being used on a screen + - a query to map a fbconfigID to a native pixelformatindex + - a query to map a drawable to a native handle + + Windows-DRI can only be useful if we are using WGL, so make an note if WGL + is active on a screen. + + Make validGlxDrawable() public + + Adjust glxWinSetPixelFormat() so it doesn't require a context, just a + screen and config. + + That enables factoring out the deferred drawable creation code as + glxWinDeferredCreateDrawable() + + Enhance glxWinDeferredCreateDrawable(), so that pixmaps are placed into a + file mapping, so they exist in memory which can be shared with the direct + rendering process. + + Currently, this file mapping is accessed by a name generated from the XID. + This will not be unique across multiple server instances. It would perhaps + be better, although more complicated, to use an anonymous file mapping, and + then duplicate the handle for the direct rendering process. + + Use glxWinDeferredCreateDrawable() to ensure the native handle exists for + the Windows-DRI query to map a drawable to native handle. + + v2: + Various printf format warning fixes + + v3: + Fix format warnings on x86 + Move some uninteresting windows-dri output to debug log level + + v4: + check for windowsdriproto when --enable-windowsdri + use windowsdriproto_CFLAGS + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 52d6a1e832a5e62289dd4f32824ae16a78dfd7e8 +Author: Keith Packard +Date: Thu Sep 8 11:02:30 2016 -0600 + + Hold input lock for deviceProc + + This ensures that the deviceProc is never called while the input + thread is processing data from the device. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit dfc91f0f630f9e0500fc28b18e3f2851024d719f +Author: Keith Packard +Date: Thu Sep 8 11:02:31 2016 -0600 + + Hold input lock while calling input device SetProperty callback + + This keeps the input driver SetProperty function from being called + while input events are being processed. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit c4799f186b31e579721f5874c897f3f46db6ad0a +Author: Alan Coopersmith +Date: Sat Sep 10 21:14:19 2016 -0700 + + os: Use pthread_setname_np to set thread names if available + + Autoconf logic borrowed from glib + + Signed-off-by: Alan Coopersmith + Reviewed-by: Jeremy Huddleston Sequoia + Tested-by: Jeremy Huddleston Sequoia + +commit 75c1d04650f63464263c159d2e95364482be724f +Author: Alan Coopersmith +Date: Sat Sep 10 21:08:01 2016 -0700 + + os: OsSigHandler should not show rtld errors for unrelated signals + + If RTLD_DI_SETSIGNAL is set to let us turn runtime linker/loader errors + into catchable signals, then we should only show the errors when catching + that signal, instead of tossing out red herrings to distract people with + unrelated crashes long after their last failed symbol lookup (especially + when using drivers built to support multiple API's by checking which + symbols are available before calling them). + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Reviewed-by: Aaron Plattner + +commit 065eb6612492bacf4d7caaad90e35dafc2cbf7ea +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 11 19:56:52 2016 -0700 + + os/inputthread: Fix setting of cloexec on file descriptors + + O_CLOEXEC is not a file bit. It is not setable with F_SETFL. One must + use it when calling open(2). To set it cloexec on an existing fd, + F_SETFD and FD_CLOEXEC must be used. + + This also fixes a build failure regression on configurations that don't + have O_CLOEXEC defined. + + cf: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html + Regressed-in: 30ac7567980a1eb79d084a63e0e74e1d9a3af673 + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Julien Cristau + +commit a5769de0f5399053e9864b753fa9755220d65ae0 +Author: Jeremy Huddleston Sequoia +Date: Sun Sep 11 19:47:47 2016 -0700 + + Xext/shm: Fix usage of F_GETFD to match standard + + flags = fcntl(fd, F_GETFD) is compliant. + + fcntl(fd, F_GETFD, &flags) is non-compliant (Linux extension?) + + cf: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Julien Cristau + +commit 7def2fea30060d47780dc1eedc91fada5ae1934f +Author: Jeremy Huddleston Sequoia +Date: Sat Sep 10 23:37:46 2016 -0700 + + Xquartz: Update for removal of AddEnabledDevice and RemoveEnabledDevice + + Regressed-in: be5a513fee6cbf29ef7570e57eb0436d70fbd88c + Signed-off-by: Jeremy Huddleston Sequoia + +commit 4f4ecd0f41cf1c710d3ef1626b747847e6184f4c +Author: Jeremy Huddleston Sequoia +Date: Sat Sep 10 22:16:11 2016 -0700 + + XQuartz: Cleanup CPPFLAGS that are no longer necessary on darwin + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 33d595255d4206df0d136014de33100817cbe344 +Author: Jeremy Huddleston Sequoia +Date: Sun May 29 14:01:38 2016 -0700 + + XQuartz: Fix the issue where the h key could be come "stuck" after hiding XQuartz with cmd-h + + The issue was that we set a flag to ignore the k key's up event when sent + the cmd-h down event, but because the cmd-h keycode hides XQuartz, we + became !_x_active by the time the event is delivered which caused us to + go down a differnet codepath rather than getting a chance to ignore it. + We then incorrectly ignored the next h up key. + + https://bugs.freedesktop.org/show_bug.cgi?id=92648 + + Signed-off-by: Jeremy Huddleston Sequoia + +commit d8e05c04758cbcd7b5c11362cb28ce017d50098b +Author: Hans de Goede +Date: Wed Aug 24 15:00:13 2016 +0200 + + modesetting: Fall back to primary crtc for vblank for drawables on slave outputs + + This fixes glxgears running at 1 fps when fully covering a slave-output + and the modesetting driver is used for the master gpu. + + Reported-by: Peter Wu + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 7ade8ba10e1e767bb510343c86573bc5d4804b92 +Author: Hans de Goede +Date: Wed Aug 24 14:55:27 2016 +0200 + + modesetting: ms_covering_crtc: Allow calling on non modesetting Screens + + 99% of the code in ms_covering_crtc is video-driver agnostic. Add a + screen_is_ms parameter when when FALSE skips the one ms specific check, + this will allow calling ms_covering_crtc on slave GPUs. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 238248d67e6a422f31e8864c0b15d693a658cdac +Author: Hans de Goede +Date: Mon Aug 15 12:02:54 2016 +0200 + + modesetting: Implement DRI2InfoRec version 9 callbacks + + Implement the CreateBuffer2 / DestroyBuffer2 / CopyRegion2 DRI2InfoRec + version 9 callbacks, this is necessary for being an offload source + provider with DRI2. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 03a7c50202f61030830ff639fccf52091e02156c +Author: Hans de Goede +Date: Mon Aug 15 10:44:57 2016 +0200 + + modesetting: ms_dri2_create_buffer: check screen of existing front buffers + + If a frontbuffer drawable already has a pixmap, make sure it was created + on the right screen. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 35c4e96ed1d372dd161480be8cddcd2d4549e449 +Author: Hans de Goede +Date: Mon Sep 12 12:47:59 2016 +0200 + + randr: Fix crtc_bounds when using rotation combined with reflection + + Before this commit crtc_bounds() did not take reflection into account, + when using reflection with 0 / 180 degree rotation this was not an + issue because of the default in the switch-case doing the right thing. + + But when using 90 / 270 degree rotation we would also end up in the + default which is wrong in this case. This would lead to the cursor + being constrained to a height x height area of the monitor. + + This commit masks out the reflection bits for the switch-case, + making crtc_bounds return the correct bounds and fixing the + problematic cursor constraining. + + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + +commit 7b634067c13045671685a9f00bfbac626ed68f94 +Author: Dave Airlie +Date: Wed Jul 15 10:15:51 2015 +1000 + + xf86Cursor: Add hw cursor support for prime + + Currently with PRIME if we detect a secondary GPU, + we switch to using SW cursors, this isn't optimal, + esp for the intel/nvidia combinations, we have + no choice for the USB offload devices. + + This patch checks on each slave screen if hw + cursors are enabled, and also calls set cursor + and move cursor on all screens. + + Cc: Aaron Plattner + Signed-off-by: Dave Airlie + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + Reviewed-by: Keith Packard + +commit df88008f92f85ef96d9fe48ac509d027570424eb +Author: Hans de Goede +Date: Tue Sep 6 11:48:31 2016 +0200 + + xf86Cursor: Deal with rotation on GPU screens using a hw-cursor + + When a slave-output is rotated the transformation is done on the blit + from master to slave GPU, so crtc->transform_in_use is not set, but we + still need to adjust the mouse position for things to work. + + This commit modifies xf86_crtc_transform_cursor_position to not rely + on crtc->f_framebuffer_to_crtc, so that it can be used with GPU screens + too and always calls it for crtcs with any form of rotation. + + Note not using crtc->f_framebuffer_to_crtc means that crtc->transform + will not be taken into account, that is ok, because when we've a transform + active hw-cursors are not used and xf86_crtc_transform_cursor_position + will never get called. + + Signed-off-by: Hans de Goede + Reviewed-and-Tested-by: Michel Dänzer + +commit f82fd47016628e8bcdcba3aab506a919fe8c49d8 +Author: Hans de Goede +Date: Tue Sep 6 11:50:50 2016 +0200 + + xf86Cursor: Fix xf86_crtc_rotate_coord using width/height wrongly + + xf86_crtc_rotate_coord should be the exact inverse operation of + xf86_crtc_rotate_coord_back, but when calculating x / y for 90 / 270 + degrees rotation it was using height to calculate x / width to calculate y, + instead of the otherway around. + + This was likely not noticed before since xf86_crtc_rotate_coord + until now was only used with cursor_info->MaxWidth and + cursor_info->MaxHeight, which are usally the same. + + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + +commit b0b04cb266a62675dd7cde97111ebe7c1552db9a +Author: Hans de Goede +Date: Tue Sep 6 13:14:35 2016 +0200 + + xf86Cursor: Fix xf86CurrentCursor to work on slave GPU Screens + + The CurrentCursor is always attached to the master GPU. + + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + +commit 71fecc84e9ceb11ff61c912bdaa3fc959ec36bef +Author: Dave Airlie +Date: Tue Sep 6 13:02:32 2016 +0200 + + xf86Cursor: Add xf86CheckHWCursor() helper function + + This is a preparation patch for adding prime hw-cursor support. + + Signed-off-by: Dave Airlie + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + +commit 2eefb53f58854ef9d34859583207ec37d3c3047a +Author: Hans de Goede +Date: Tue Sep 6 13:15:36 2016 +0200 + + randr: Add RRHasScanoutPixmap helper function + + This is a preparation patch for adding prime hw-cursor support. + + Signed-off-by: Hans de Goede + Reviewed-by: Michel Dänzer + +commit a52530a655438f03919d47f6edd11287efff47bb +Author: Dave Airlie +Date: Tue Sep 6 12:50:14 2016 +0200 + + dix: Add dixPrivatesCreated helper function + + This is a preparation patch for adding prime hw-cursor support. + + Signed-off-by: Dave Airlie + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + Reviewed-by: Michel Dänzer + +commit 3fe4107643ba029dd48e3d12ec9bc97d07112300 +Author: Hans de Goede +Date: Thu Sep 8 09:30:31 2016 +0200 + + glamor: Fix crash when master gpu is using glamor and another gpu is hotplugged + + When a GPU gets hotplugged while X is already running, glamor_egl_init() + gets called and changes the current egl context, without updating + lastGLContext, potentially causing the next glamor call on another GPU to + run in the wrong context. + + This causes glamor to e.g. crash in the next glamor_create_pixmap() call + (called through the master's screen->CreatePixmap), note this is not the + only troublesome entry point I've seen other backtraces when using a + compositing window manager. + + Set lastGLContext to NULL to force the next glamor_make_current() call + to set the right context. + + Note that we cannot use glamor_make_current() here to replace the + eglMakeCurrent() call and update lastGLContext for us because + glamor_make_current takes a glamor_priv struct as argument and that + has not been created yet when glamor_egl_init() gets called. + + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + +commit 1075af8a6c26009c04db30a6d6d1f10070568ab1 +Author: Hans de Goede +Date: Mon Aug 15 11:10:15 2016 +0200 + + modesetting: Remove some dead code + + The "if (pixmap) ..." block this commit removes is inside an + "if (pixmap == NULL) ..." block, so it will never execute. + + Signed-off-by: Hans de Goede + Reviewed-by: Aaron Plattner + +commit dfa295b29c20b174f80ab823eef41e5211a6a921 +Author: Hans de Goede +Date: Wed Aug 24 14:13:19 2016 +0200 + + modesetting: ms_covering_crtc: Remove unused arguments, make static + + Remove unused arguments from ms_covering_crtc, make it static as it is + only used in vblank.c. + + While at it also change its first argument from a ScrnInfoPtr to a + ScreenPtr, this makes the next patch in this patch-set cleaner. + + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + +commit cb7b145a25452de8b549e8c8e9ec3bcc752e55dc +Author: Hans de Goede +Date: Wed Aug 17 12:03:41 2016 +0200 + + modesetting: Fix msSharePixmapBacking returning a non-linear bo + + glamor_fd_from_pixmap() may return a tiled bo, which is not suitable + for sharing with another GPU as tiling usually is GPU specific. + + Switch to glamor_shareable_fd_from_pixmap(), which always returns a + linear bo. This fixes mis-rendering when running the mode setting + driver on the master gpu in a dual-gpu setup and running an opengl + app with DRI_PRIME=1. + + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + +commit a74d553cb97d545148bd2f81b7bd021cca94e076 +Author: Hans de Goede +Date: Tue Aug 23 12:18:56 2016 +0200 + + glamor: Add glamor_shareable_fd_from_pixmap() + + Add glamor_shareable_fd_from_pixmap function to get dma-buf fds suitable + for sharing across GPUs (not using GPU specific tiling). + + This is necessary for the modesetting driver to correctly implement + the DRI2 SharePixmapBacking callback. + + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + +commit 527c6baa294d17c5eca1d87ac941844872e90dac +Author: Ran Benita +Date: Wed Aug 29 12:33:34 2012 +0300 + + xkb: fix check for appending '|' character when applying rules + + There are two ways to separate multiple files in XKB include statements: + '+' will cause the later file to override the first in case of conflict, + while '|' will cause it augment it (this is done by xkbcomp). '!' is + unrelated here. + Currently, if someone tries to use '|' in a rule instead of '+', it + won't have any effect. Since '|' is practically never used, this wasn't + noticed. + + Signed-off-by: Ran Benita + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 392da389d7b0e9dd970741dcd5321a4e0fd3aef5 +Author: Adam Jackson +Date: Wed Mar 30 14:04:04 2016 -0400 + + glx: Fix computation of GLX_X_RENDERABLE fbconfig attribute + + >From the GLX spec: + + "GLX_X_RENDERABLE is a boolean indicating whether X can be used to + render into a drawable created with the GLXFBConfig. This attribute + is True if the GLXFBConfig supports GLX windows and/or pixmaps." + + Every backend was setting this to true unconditionally, and then the + core ignored that value and sent true unconditionally on its own. This + is broken for ARB_fbconfig_float and EXT_fbconfig_packed_float, which + only apply to pbuffers, which are not renderable from non-GLX APIs. + + Instead compute GLX_X_RENDERABLE from the supported drawable types. The + dri backends were getting _that_ wrong too, so fix that as well. + + This is not a functional change, as there are no mesa drivers that claim + to support __DRI_ATTRIB_{UNSIGNED_,}FLOAT_BIT yet. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 589f42e9830e66a7e26475fc9a8b91034b5aad86 +Author: Rui Matos +Date: Sun Jun 26 19:48:23 2016 +0200 + + xwayland: Process queued events before making wayland mods effective + + Since xwayland's initial commit we have had a check to not process + wayland modifier events while one of our surfaces has keyboard focus + since the normal xkb event processing keeps our internal modifier + state up to date and if we use the modifiers we get from the + compositor we mess up that state. + + This was slightly changed in commit + 10e9116b3f709bec6d6a50446c1341441a0564e4 to allow the xkb group to be + set from the wayland event while we have focus in case the compositor + triggers a group switch. + + There's a better solution to the original problem though. Processing + queued events before overriding the xkb state with the compositor's + allows those events to be sent properly modified to X clients while + any further events will be modified with the wayland modifiers as + intended. + + This allows us to fully take in the wayland modifiers, including + depressed ones, which fixes an issue where we wouldn't be aware of + already pressed modifiers on enter. + + Signed-off-by: Rui Matos + Tested-by: Olivier Fourdan + Reviewed-by: Daniel Stone + Signed-off-by: Peter Hutterer + +commit deae9c7e846e244e5d62b2dcfb6663fde0e12cbb +Author: Eric Anholt +Date: Wed Aug 31 17:00:00 2016 -0700 + + test: Run some XTS5 integration tests against Xvfb if possible. + + By default the tests will be skipped. However, if you set XTEST_DIR + to the repo of a built X Test Suite and PIGLIT_DIR to a piglit repo + (no build necessary), make check will run piglit's xts-render tests + against Xvfb. + + We could run more of XTS5, but I haven't spent the time identifying + what additional subset would be worth running, since much of it is + only really testing the client libraries. We want to make sure that + we keep the runtime down, and this subset of the test suite took 92 + seconds according to piglit. + + Reviewed-by: Adam Jackson + +commit f06aef31c0b2ab62d915a469a399d82a1a73ac28 +Author: Qiang Yu +Date: Mon Aug 22 18:14:18 2016 +0800 + + modesetting: add DRI2 page flip support + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + +commit 4a839da6274b76424ee7cbc2deba2693e97e8186 +Author: Qiang Yu +Date: Mon Aug 22 18:14:17 2016 +0800 + + modesetting: move common page flip handle to pageflip.c + + The common page flip handle framework can be shared with DRI2 + page flip. + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + +commit 4f1eb7864b61d0c992c5eff3339085e887792048 +Author: Qiang Yu +Date: Mon Aug 22 18:14:16 2016 +0800 + + modesetting: move ms_do_pageflip to pageflip.c + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + +commit a586bf9ccf60b2cc66953555e82eeb6a8e0b4ca9 +Author: Qiang Yu +Date: Mon Aug 22 18:14:15 2016 +0800 + + modesetting: make ms_do_pageflip generic for share with DRI2 + + Signed-off-by: Qiang Yu + Reviewed-by: Michel Dänzer + +commit 7d33ab0f8c7958b205076f71e4b47c24aace77fd +Author: Adam Jackson +Date: Tue Jun 28 15:54:44 2016 -0400 + + dri2: Don't make reference to noClientException + + noClientException is now never filled in with a meaningful value, it's + always -1. The sole caller of this function disregards the error value + in any case. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit dff435568b40286df2bf7a66e870f9ae5f4eb9bd +Author: Adam Jackson +Date: Tue Jun 28 15:54:43 2016 -0400 + + dri3: Don't do return client->noClientException + + Hasn't been necessary since: + + commit 92ed75ac59e2d3af149cddb962efd05fc8487750 + Author: Jamey Sharp + Date: Mon May 10 20:22:05 2010 -0700 + + Eliminate boilerplate around client->noClientException. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 65493c0b73f6ee65b2a8fcaa4a15b0c453ff72b1 +Author: Adam Jackson +Date: Tue Jun 28 15:54:42 2016 -0400 + + sync: Don't do return client->noClientException + + Hasn't been necessary since: + + commit 92ed75ac59e2d3af149cddb962efd05fc8487750 + Author: Jamey Sharp + Date: Mon May 10 20:22:05 2010 -0700 + + Eliminate boilerplate around client->noClientException. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit bc3eed379ee5b4176db848708799fb2d5db16531 +Author: Hans De Goede +Date: Wed Aug 31 15:37:20 2016 +0200 + + modesetting: Hide cursor when initializing crtc + + When Xorg gets started directly from a wayland-gdm the crtc still has the + wayland hw cursor set. Combine this with Xorg immediately falling back to + a sw cursor because a slave-output has a monitor attached at startup; and + we end up with the wayland hardware cursor overlay fixed in its last + position + the Xorg sw cursor resulting in 2 cursors. + + This commit fixes this by hiding any left-over cursors when initializing + the crtc. + + Signed-off-by: Hans de Goede + Reviewed-by: Eric Engestrom + +commit 6c984ac9a737304ab5e26de90c76a79d970b6e33 +Author: Hans De Goede +Date: Wed Aug 31 16:11:11 2016 +0200 + + modesetting: Do not use function local static variables + + The modesetting driver may be driving 2 screens (slave and master + gpu), which may have different behavior wrt hardware cursor support. + + So stop using static variables and instead store the hw-cursor support + related data in a per screen struct. While at it actually make it per + crtc data as in theory different crtc's could have different hw-cursor + support. + + Signed-off-by: Hans de Goede + Reviewed-by: Keith Packard + +commit d8c288ec371a853bcd023217f34893a0efae65ea +Author: Michael Thayer +Date: Wed Aug 24 08:48:13 2016 +1000 + + xi2: fix FocusIn grabs + + Fix a couple of copy-and-paste errors preventing FocusIn grabs from working. + Perhaps the extension version should be bumped though to distinguish between + working and non-working extension versions. + + Signed-off-by: Michael Thayer + Reviewed-by: Peter Hutterer + +commit 25e4f9ee68b99c2810efdb6cd8c56affa45e1fea +Author: Peter Hutterer +Date: Tue Aug 23 13:43:42 2016 +1000 + + xfree86: print the module name together with the load failure message + + We're happily printing the error to stdout but not which module caused it... + That's in the Xorg.log but that's at least one click away. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit be334f42a198a25e817e6dab43dd0e30aa1cd4f8 +Author: Michel Dänzer +Date: Thu Aug 18 09:40:34 2016 +0900 + + glamor: Declare "pos" in the composite glyph GLSL 1.20 vertex shader + + Fixes shader compile failure: + + Failed to compile VS: 0:13(43): error: `pos' undeclared + 0:13(14): error: operands to arithmetic operators must be numeric + 0:13(13): error: operands to arithmetic operators must be numeric + + Program source: + #define ATLAS_DIM_INV 0.000976562500000000 + attribute vec2 primitive; + attribute vec2 source; + varying vec2 glyph_pos; + uniform vec2 fill_offset; + uniform vec2 fill_size_inv; + varying vec2 fill_pos; + uniform vec4 v_matrix; + void main() { + gl_Position.xy = primitive.xy * v_matrix.xz + v_matrix.yw; + gl_Position.zw = vec2(0.0,1.0); + glyph_pos = source.xy * ATLAS_DIM_INV; + fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv; + } + (EE) Fatal server error: + (EE) GLSL compile failure + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97300 + Reviewed-by: Keith Packard + +commit cba28d572ac799391beacd89d57e69d0d7ed70e7 +Author: Michel Dänzer +Date: Tue Jul 12 12:25:13 2016 +0900 + + glamor: Handle bitplane in glamor_copy_fbo_cpu + + This can significantly speed up at least some CopyPlane cases, e.g. + indirectly for stippled fills. + + v2: + * Make temporary pixmap the same size as the destination pixmap + (instead of the destination drawable size), and fix coordinate + parameters passed to fbCopyXtoX and glamor_upload_boxes. Fixes + incorrect rendering with x11perf -copyplane* and crashes with the + xscreensaver phosphor hack. + v3: + * Make the change a bit more compact and hopefully more readable by + re-using the existing src_* locals in the bitplane case as well. + + Reported-by: Keith Raghubar + Reviewed-by: Alex Deucher + Acked-by: Eric Anholt + +commit 6e5bec261c3f7af069b57618d6c82b070dc4579d +Author: Olivier Fourdan +Date: Thu Jun 23 15:31:30 2016 +0200 + + wayland: Emulate crossing for native window + + Emitting a LeaveNotify event every time the pointer leaves an X11 window + may confuse focus follow mouse mode in window managers such as + mutter/gnome-shell. + + Keep the previously found X window and compare against the new one, and + if they match then it means the pointer has left an Xwayland window for + a native Wayland surface, only in this case fake the crossing to the + root window. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 48c5c23a1b250c7f9d7a1747c76e4669ebf752cf +Author: Hans De Goede +Date: Mon Aug 8 14:53:59 2016 +0200 + + Fix Xorg -configure not working anymore + + Xorg -configure relies on the bus implementation, e.g. + xf86pciBus.c to call xf86AddBusDeviceToConfigure(). The new + xf86platformBus code does not have support for this. + + Almost all drivers support both the xf86platformBus and xf86pciBus + nowadays, and the generic xf86Bus xf86CallDriverProbe() function + prefers the new xf86platformBus probe method when available. + + Since the platformBus paths do not call xf86AddBusDeviceToConfigure() + this results in Xorg -configure failing with the following error: + "No devices to configure. Configuration failed.". + + Adding support for the xf86Configure code to xf86platformBus.c + is non trivial and since we advise users to normally run without + any Xorg.conf at all not worth the trouble. + + However some users still want to use Xorg -configure to generate a + template config file, this commit implements a minimal fix to make + things work again for PCI devices by skipping the platform + probe method when xf86DoConfigure is set. + + This has been tested on a system with integrated intel graphics, + with both the intel and modesetting drivers and restores Xorg -configure + functionality on both cases. + + Reviewed-by: Adam Jackson + Signed-off-by: Hans de Goede + +commit 6acd0d098add5a14f23d326ac6ee8cebab14b86a +Author: Adam Jackson +Date: Wed Aug 17 10:32:28 2016 -0400 + + test: Remember to swap the window argument to XIQueryPointer + + Before 5c69cb60 this wouldn't matter, because ProcXIQueryPointer + manually emitted its own error before (bogusly) returning Success to the + main loop. Since these tests only look at the return value of the + dispatch function we'd think things succeeded even when we'd generated + an error. + + With that fixed, the test code's failure to swap the window id would + make dixLookupWindow (rightly) throw BadWindow. + + Reviewed-and-Tested-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 5c69cb604a144bdced7d066eaca574aa44e8cb36 +Author: Adam Jackson +Date: Mon Jun 20 12:57:12 2016 -0400 + + xinput: Let top-level dispatch generate the error + + ... instead of calling SendErrorToClient ourselves. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + +commit 2f981c06a5b9b9eab5e8a9b1d0a18281c0d1033f +Author: Adam Jackson +Date: Mon Jun 20 12:57:11 2016 -0400 + + xv: Remove some dumb calls SendErrorToClient + + We already generate errors from the top level when non-Success is + returned from a dispatch function, so really we were emitting errors + twice. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + +commit 0bfa6bf9def43fd14bc79a302b912454e82999b1 +Author: Adam Jackson +Date: Mon Jun 20 12:57:10 2016 -0400 + + xwayland: Fix relinking when dix changes + + Without this a change in eg Xext/ wouldn't relink Xwayland, making you + wonder why your changes didn't have any effect. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + +commit bf2ca502b9cd07044cba56499d5c092deb9d73f5 +Author: Keith Packard +Date: Mon Aug 15 22:25:56 2016 -0700 + + config: Hold input lock across udev socket handling + + This avoids having the server running inside libudev from two threads + at once, which it appears to not like. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit de5291c04b05772e6da599a475baa1b19dcae07a +Author: Olivier Fourdan +Date: Mon Aug 8 17:25:35 2016 +0200 + + present: Free the fake_present OsTimerPtr + + Plug a leak in present_fake_queue_vblank() where the OsTimer would not + be freed. + + 492,608 (482,816 direct, 9,792 indirect) bytes in 15,088 blocks + are definitely lost in loss record 3,954 of 3,954 + at 0x4C2ABDE: malloc (in vgpreload_memcheck-amd64-linux.so) + by 0x586B19: TimerSet (WaitFor.c:433) + by 0x4F1AA9: present_fake_queue_vblank (present_fake.c:108) + by 0x4F15E0: present_pixmap (present.c:954) + by 0x4F23B4: proc_present_pixmap (present_request.c:138) + by 0x552BCE: Dispatch (dispatch.c:430) + by 0x556C22: dix_main (main.c:300) + by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so) + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97065 + Signed-off-by: Olivier Fourdan + Reviewed-by: Michel Dänzer + +commit d21b53673b9de052004e761fd1299d2e788b44b8 +Author: Michel Dänzer +Date: Wed Aug 3 10:19:20 2016 +0900 + + present: Call set_abort_flip / restore_screen_pixmap in clear_window_flip + + We were asserting that these were called before from other places, but + that isn't always the case, e.g. during server shutdown. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96951 + Reported-and-Tested-by: Tod Jackson + Reviewed-by: Hans de Goede + Signed-off-by: Michel Dänzer + +commit 9f04fa3babaaabe0ed5bf4aa2563755bc6c45723 +Author: Michel Dänzer +Date: Wed Aug 3 10:19:19 2016 +0900 + + present: Make present_restore_screen_pixmap handle screen->root == NULL + + Easier than dealing with it in all paths that can end up here during + server shutdown. + + Signed-off-by: Michel Dänzer + Reviewed-by: Hans de Goede + +commit 4cbf1fb1f978ecd975770cebbb330dc10f712b77 +Author: Olivier Fourdan +Date: Mon Aug 8 17:57:57 2016 +0200 + + xwayland: Avoid double free of RRCrtc and RROutput + + At shutdown, the Xserver will free all its resources which includes the + RRCrtc and RROutput created. + + Xwayland would do the same in its xwl_output_destroy() called from + xwl_close_screen(), leading to a double free of existing RRCrtc + RROutput: + + Invalid read of size 4 + at 0x4CDA10: RRCrtcDestroy (rrcrtc.c:689) + by 0x426E75: xwl_output_destroy (xwayland-output.c:301) + by 0x424144: xwl_close_screen (xwayland.c:117) + by 0x460E17: CursorCloseScreen (cursor.c:187) + by 0x4EB5A3: AnimCurCloseScreen (animcur.c:106) + by 0x4EF431: present_close_screen (present_screen.c:64) + by 0x556D40: dix_main (main.c:354) + by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so) + Address 0xbb1fc30 is 0 bytes inside a block of size 728 free'd + at 0x4C2BDB0: free (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + by 0x4CCE5F: RRCrtcDestroyResource (rrcrtc.c:719) + by 0x577541: doFreeResource (resource.c:895) + by 0x5787B5: FreeClientResources (resource.c:1161) + by 0x578862: FreeAllResources (resource.c:1176) + by 0x556C54: dix_main (main.c:323) + by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so) + Block was alloc'd at + at 0x4C2CA6A: calloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + by 0x4CC6DB: RRCrtcCreate (rrcrtc.c:76) + by 0x426D1C: xwl_output_create (xwayland-output.c:264) + by 0x4232EC: registry_global (xwayland.c:431) + by 0x76CB1C7: ffi_call_unix64 (in /usr/lib/libffi.so.6.0.4) + by 0x76CAC29: ffi_call (in /usr/lib/libffi.so.6.0.4) + by 0x556CEFD: wl_closure_invoke (connection.c:935) + by 0x5569CBF: dispatch_event.isra.4 (wayland-client.c:1310) + by 0x556AF13: dispatch_queue (wayland-client.c:1456) + by 0x556AF13: wl_display_dispatch_queue_pending + (wayland-client.c:1698) + by 0x556B33A: wl_display_roundtrip_queue (wayland-client.c:1121) + by 0x42371C: xwl_screen_init (xwayland.c:631) + by 0x552F60: AddScreen (dispatch.c:3864) + + And: + + Invalid read of size 4 + at 0x522890: RROutputDestroy (rroutput.c:348) + by 0x42684E: xwl_output_destroy (xwayland-output.c:302) + by 0x423CF4: xwl_close_screen (xwayland.c:118) + by 0x4B6377: CursorCloseScreen (cursor.c:187) + by 0x539503: AnimCurCloseScreen (animcur.c:106) + by 0x53D081: present_close_screen (present_screen.c:64) + by 0x43DBF0: dix_main (main.c:354) + by 0x7068730: (below main) (libc-start.c:289) + Address 0xc403190 is 0 bytes inside a block of size 154 free'd + at 0x4C2CD5A: free (vg_replace_malloc.c:530) + by 0x521DF3: RROutputDestroyResource (rroutput.c:389) + by 0x45DA61: doFreeResource (resource.c:895) + by 0x45ECFD: FreeClientResources (resource.c:1161) + by 0x45EDC2: FreeAllResources (resource.c:1176) + by 0x43DB04: dix_main (main.c:323) + by 0x7068730: (below main) (libc-start.c:289) + Block was alloc'd at + at 0x4C2BBAD: malloc (vg_replace_malloc.c:299) + by 0x52206B: RROutputCreate (rroutput.c:84) + by 0x426763: xwl_output_create (xwayland-output.c:270) + by 0x422EDC: registry_global (xwayland.c:432) + by 0x740FC57: ffi_call_unix64 (unix64.S:76) + by 0x740F6B9: ffi_call (ffi64.c:525) + by 0x5495A9D: wl_closure_invoke (connection.c:949) + by 0x549283F: dispatch_event.isra.4 (wayland-client.c:1274) + by 0x5493A13: dispatch_queue (wayland-client.c:1420) + by 0x5493A13: wl_display_dispatch_queue_pending + (wayland-client.c:1662) + by 0x5493D2E: wl_display_roundtrip_queue (wayland-client.c:1085) + by 0x4232EC: xwl_screen_init (xwayland.c:632) + by 0x439F50: AddScreen (dispatch.c:3864) + + Split xwl_output_destroy() into xwl_output_destroy() which frees the + wl_output and the xwl_output structure, and xwl_output_remove() which + does the RRCrtcDestroy() and RROutputDestroy() and call the latter only + when an output is effectively removed. + + An additional benefit, on top of avoiding a double free, is to avoid + updating the screen size at shutdown. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Hans de Goede + +commit b380f3ac51f40ffefcde7d3db5c4c149f274246d +Author: Michel Dänzer +Date: Tue Aug 2 17:53:01 2016 +0900 + + dix: Pass ClientPtr to FlushCallback + + This change has two effects: + + 1. Only calls FlushCallbacks when we're actually flushing data to a + client. The unnecessary FlushCallback calls could cause significant + performance degradation with compositing, which is significantly + reduced even without any driver changes. + + 2. By passing the ClientPtr to FlushCallbacks, drivers can completely + eliminate unnecessary flushing of GPU commands by keeping track of + whether we're flushing any XDamageNotify events to the client for + which the corresponding rendering commands haven't been flushed to + the GPU yet. + + Reviewed-by: Adam Jackson + Signed-off-by: Michel Dänzer + +commit 92b3cd32066aa5befa67a408cc079cd2ce4c077e +Author: Aaron Plattner +Date: Tue Aug 2 10:34:07 2016 -0700 + + xace: Fix XaceCensorImage to actually censor the right part of the image + + The caller passes arguments into XaceCensorImage that are in + window-relative coordinates. However, the pBuf that it uses to construct + a temporary pixmap has its origin at (x, y) relative to the window in + question. The code to convert the censor region into boxes adjusts for + the Y coordinate, but leaves the X coordinate alone. The result is that + if x is not zero, it censors the wrong part of the image. + + Fix this by just translating censorRegion into pixmap-relative + coordinates and using the resulting boxes as-is. + + Reported-by: Fabien Lelaquais + Link: https://lists.x.org/archives/xorg/2016-August/058165.html + Reviewed-by: Adam Jackson + Signed-off-by: Aaron Plattner + +commit 4d586118c113f3c0a6e95ed2d3fc7f9d03a4e362 +Author: Olivier Fourdan +Date: Tue Aug 2 11:24:41 2016 +0200 + + xwayland: Plug memleak in frame callbacks + + The frame callback set up via wl_surface_frame() needs to be freed with + wl_callback_destroy() or we'll leak memory. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97065 + Signed-off-by: Olivier Fourdan + Reviewed-by: Daniel Stone + +commit 611b3b1d40f58035582480a3d7cfa77cb288cbc6 +Author: Matthieu Herrb +Date: Sun Jul 31 12:13:03 2016 +0200 + + Autoconfig: Fix the loop adding dectected drivers to the list of screens + + This loop was written in a buggy style, causing a NULL driver ptr to be + passed to copyScreen(). copyScreen() only uses that to generate an + identifier string, so this is mostly harmless on systems that accept + NULL for asprintf() "%s" format. (the generated identifiers are off + by one wrt the driver names and the last one contains NULL. + + For systems that don't accept NULL for '%s' this would cause a + segmentation fault when this code is used (no xorg.conf, but partial + config in xorg.conf.d for instance). + + Signed-off-by: Matthieu Herrb + Reviewed-by: Keith Packard + +commit 88820f1c7b66cbc98d3f19efca24c9f52410d9f9 +Author: Emily Deng +Date: Mon Jul 25 16:12:53 2016 +0800 + + xfree86: vgaarb: Initialize local variable rsrc_decodes + + In function xf86VGAarbiterScrnInit when the "pEnt->bus.type" is + BUS_PLATFORM, the "pScrn->vgaDev" won't be set, so the "pScrn->vgaDev" is + equal to zero. + + The variable "rsrc_decodes" in function "xf86VGAarbiterAllowDRI" is not + initialized. So it will occur error when "pScrn->vgaDev == 0", and + "vga_count > 1". For this case, as "pScrn->vgaDev == 0", the function + "pci_device_vgaarb_get_info" will only set the value of "vga_count", + but won't set the value of "rsrc_decodes", so it will has two different + return values for function "xf86VGAarbiterAllowDRI" in different + platforms. One platform will return TRUE, as the "rsrc_decodes" 's + default value is 0, but another platform will return FALSE, as the + "rsrc_decodes" 's default value is "32767", this will cause disable + direct rendering. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96937 + + Signed-off-by: Emily Deng + Reviewed-by: Michel Dänzer + +commit fa2bc06407665ee074f5914d0f83d4114b20fc8e +Author: Keith Packard +Date: Fri Aug 12 17:40:55 2016 -0700 + + dix: Avoid writing uninitialized bytes in deliverPropertyNotifyEvent + + Make sure the whole event is initialized, instead of leaving the pad + bytes unset. + + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + +commit 67fc5d68f967d19236221b2c0c2e0fe45acf560f +Author: Keith Packard +Date: Sat Aug 13 09:02:15 2016 -0700 + + os: Abandon loop after poll call when array of fds has changed + + If a file descriptor is added or removed from an ospoll callback, then + the arrays containing file descriptor information will have all of + their indices changed, so the loop state is no longer consistent. Just + bail out and let the caller come back around to try again. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 7d6fffb6013cfc718d884cc549d7a8fef37240cf +Author: Keith Packard +Date: Fri Aug 12 15:23:55 2016 -0700 + + os: Delay freeing of epoll_wait return pointers until epoll is idle. + + Instead of freeing the struct ospollfd elements when the fd is + removed by the user, delay that until epoll is idle so that we are + sure no epoll_event structures could contain the stale pointer. This + handles cases where an fd is removed from the ospoll callback + interface, and also in case the OS keeps stale pointers around after + the call to epoll_ctl with EPOLL_CTL_DEL. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 69b782aa75bc06f11b8f9b532d5213f252c4c6c4 +Author: Keith Packard +Date: Fri Jul 29 17:45:45 2016 -0700 + + xfree86: Set pScrn->pScreen before driver ScreenInit is called + + Any code called from the driver ScreenInit may want to refer to + pScrn->pScreen. As the function passed to AddScreen is the first place + the DDX sees a new screen, the generic code needs to make sure that + value is set before passing control to the video driver's + initialization code. + + This was found by running a driver which didn't bother to set this + value when the initial colormap was installed; xf86RandR12LoadPalette + tried to use pScrn->pScreen and crashed. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97124 + Signed-off-by: Keith Packard + Reviewed-and-Tested-by: Michel Dänzer + +commit 387d6b5df3e11de5cb88db8a559128fcb62e4e5a +Merge: d2558f063a 8bb9d460fb +Author: Keith Packard +Date: Sat Aug 13 09:12:19 2016 -0700 + + Merge remote-tracking branch 'daenzer/for-master' + +commit d2558f063a034a827247b66b4c5adbffe79dc0e7 +Author: Keith Packard +Date: Thu Aug 11 17:28:38 2016 -0700 + + Build glamor when Xorg or Xephyr are built. + + Requires gbm when building Xorg so that xf86-video-modesetting will + work. + + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + Reviewed-by: Eric Anholt + +commit 2b9f8ae98602d2abda7c363900f39a5bd3768a4c +Author: Keith Packard +Date: Thu Aug 11 21:32:59 2016 -0700 + + mi: Remove spurious call to OsReleaseSignals from mieqGrowQueue + + This call wasn't converted to 'input_unlock()' when the SIGIO code was + removed from the server, and so when the queue growing was reworked to + be done from the input thread, it got left sitting here. As the caller + now manages the lock, we don't need to switch this to input_unlock at + this point. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit f399919e13c994452f7219163b2a4b1fa015242e +Author: Peter Hutterer +Date: Fri Aug 12 13:59:56 2016 +1000 + + xfree86: lock input during PreInit + + This is a problem for the libinput driver that uses the same context across + multiple devices. The driver may be halfway through setting up an input device + (and the only way to do so is to add it to libinput) when the input thread + comes in an reads events. This then causes mayhem when data is dereferenced + that hasn't been set up yet. + + In my case the cause was the call to libinput_path_remove_device() inside + preinit racing with evdev_dispatch_device() handling of ENODEV. The sequence + was: + - thread 2 gets an event and calls evdev_dispatch_device() + - thread 1 calls libinput_path_remove_device() which sets the device->source + to NULL + - thread 2 reads from the fd, gets ENODEV and now removes the device->source, + dereferencing the null-pointer + + This is the one I could reproduce the most, but there are other potential + pitfalls that affect any driver that uses the same fd for multiple devices. + Avoid all this and wrap PreInit into the lock. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit dd4e21cb3a6e692e834ec34bec42944202b3e085 +Author: Peter Hutterer +Date: Fri Aug 12 12:06:18 2016 +1000 + + xfree86: fix unbalanced input_lock/unlock in xf86NewInputDevice() + + If a device couldn't be enabled we left the lock hanging. + + This patch also removes the leftover OsReleaseSignals() call, now unnecessary. + Note that input_unlock() is later than previously OsReleaseSignals(). + RemoveDevice() manipulates the input device and its file descriptors, it's + safer to put the input_unlock() call after RemoveDevice() to avoid events + coming in while the device is being removed. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit bf31d6f43e5ce04891a96b226a975379e2e2ba71 +Author: Keith Packard +Date: Thu Aug 11 12:34:54 2016 -0700 + + os: Allow re-registering fd with InputThreadRegisterDev + + Calling InputThreadRegisterDev twice with the same fd should replace + the existing function and args instead of creating a new entry with + the same fd. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 2df2815d6ae0c2ffb9e0a084d61ee3585f5116df +Author: Peter Hutterer +Date: Tue Aug 9 17:35:58 2016 +1000 + + os: append, rather than prepend, any new input thread fds + + xf86AddEnabledDevice() prepends the new fd to the list, + xf86RemoveEnabledDevice() then searches for a matching fd and removes that + entry. If this is done for the same fd (and since we lose all information but + the actual fd) we usually unregister virtual devices in reverse order, causing + a dereference of already released memory. + + Case in point: + - the wacom driver calls xf86AddEnabledDevice() once for the physical device, + then multiple times for the virtual subdevices + - when the physical device is unplugged, the driver calls + xf86RemoveEnabledDevice() for the physical device + - all we have is the fd, so we end up removing the last virtual device from + the fd set + - xf86DeleteInput() frees the physical device's pInfo + - the fd goes crazy with ENODEV, but a read_input() now passes the already + freed pInfo for the physical device + - boom + + Fix this by appending to the fd list to provide bug-for-bug compatibility with + the old SIGIO code. This needs to be fixed in the driver, but meanwhile not + crashing the server provides for better user experience. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit a446ff84de2dd29439521f6e87d75bde3bbf002c +Author: Michel Dänzer +Date: Fri Jul 29 17:38:21 2016 +0900 + + xfree86/modes: Handle no palette case better in xf86RandR12CrtcSetGamma + + Just use the RandR gamma ramp directly. + + Fixes random on-monitor colours with drivers which don't call + xf86HandleColormaps, e.g. modesetting. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97154 + + Reviewed-by: Alex Deucher + +commit d3d4ff0ed4d4679b7983b1a3ea267ff945f7643c +Author: Kenneth Graunke +Date: Thu Jul 28 07:28:51 2016 -0700 + + modesetting: Delete dead drmmode_bo_for_pixmap function. + + Embarassingly, it looks like I introduced this dead function in + commit 13c7d53df8dac45ea2a685826cd45a39bcb51657 a year ago. + Nothing ever used it, not even then. + + Signed-off-by: Kenneth Graunke + Reviewed-by: Eric Anholt + +commit 8bb9d460fbc82ee5d6f87e1d11cfa52f4f3072ee +Author: Michel Dänzer +Date: Fri Jul 29 17:38:21 2016 +0900 + + xfree86/modes: Handle no palette case better in xf86RandR12CrtcSetGamma + + Just use the RandR gamma ramp directly. + + Fixes random on-monitor colours with drivers which don't call + xf86HandleColormaps, e.g. modesetting. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97154 + + Reviewed-by: Alex Deucher + +commit c833c0866f2f8f829185667efe3d6dfa5979a9e8 +Author: Michel Dänzer +Date: Fri Jul 29 18:41:06 2016 +0900 + + present: Handle event mask updates as specified v2 + + From the Present extension specification: + + An event context is associated with a specific window; using + an existing event context with a different window generates + a Match error. + + If eventContext specifies an existing event context, then if + eventMask is empty, PresentSelectInput deletes the specified + context, otherwise the specified event context is changed to + select a different set of events. + + If eventContext is an unused XID, then if eventMask is empty + no operation is performed. Otherwise, a new event context is + created selecting the specified events. + + Without this change, there's no way for a client to explicitly change + or destroy an existing event mask entry. Trying to do so as specified + above would just result in a protocol error. + + v2: (Keith Packard) + * Use dixLookupResourceByType instead of walking window_priv->events + * Return BadMatch if the existing event context is associated with a + different window or client + * Call LEGAL_NEW_RESOURCE again when creating a new event context + * Drop invalid "leak fix" + + Signed-off-by: Michel Dänzer + Signed-off-by: Keith Packard + Reviewed-by: Keith Packard + Reviewed-by: Kenneth Graunke + +commit 0924ac014d7caadab0b15ba69cd0a09cfe8a01da +Author: Michel Dänzer +Date: Tue Jul 26 17:28:33 2016 +0900 + + present: Only call restore_screen_pixmap once from set_abort_flip + + present_restore_screen_pixmap's work doesn't need to be done several + times for the same pending flip. + + Fixes a crash if the X server quits while a flip is pending, in which + case present_set_abort_flip may be called several times, including when + screen->root is already cleared to NULL. + + Reviewed-by: Hans de Goede + +commit b4e46c0444bb09f4af59d9d13acc939a0fbbc6d6 +Author: Michel Dänzer +Date: Sat Nov 28 16:50:47 2015 +0900 + + xfree86: Hook up colormaps and RandR 1.2 gamma code v6 + + Instead of breaking the former when the driver supports the latter, + hook them up so that the hardware LUTs reflect the combination of the + current colourmap and gamma states. I.e. combine the colourmap, the + global gamma value/ramp and the RandR 1.2 per-CRTC gamma ramps into one + combined LUT per CRTC. + + Fixes e.g. gamma sliders not working in games. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27222 + + v2: + * Initialize palette_size and palette struct members, fixes crash on + server startup. + v3: + * Free randrp->palette in xf86RandR12CloseScreen, fixes memory leak. + v4: + * Call CMapUnwrapScreen if xf86RandR12InitGamma fails (Emil Velikov). + * Still allow xf86HandleColormaps to be called with a NULL loadPalette + parameter in the xf86_crtc_supports_gamma case. + v5: + * Clean up inner loops in xf86RandR12CrtcComputeGamma (Keith Packard) + * Move palette update out of per-CRTC loop in xf86RandR12LoadPalette + (Keith Packard) + v6: + * Handle reallocarray failure in xf86RandR12LoadPalette (Keith Packard) + + Reviewed-by: Keith Packard + +commit 17213b74fd7fc4c4e2fe7a3781e7422dd482a0ab +Author: Michel Dänzer +Date: Tue Jun 21 16:44:20 2016 +0900 + + xfree86/modes: Remove xf86RandR12CrtcGetGamma + + This would normally return the same values the core RandR code passed to + xf86RandR12CrtcSetGamma before, which is rather pointless. The only + possible exception would be if a driver tried initializing + crtc->gamma_red/green/blue to reflect the hardware LUT state on startup, + but that can't work correctly if whatever set the LUT before the server + started was running at a different depth. + + Even the pointless round-trip case will no longer work with the + following change. + + Reviewed-by: Keith Packard + +commit 62f44052573b475a7b4c24f8e2da9bd6a8f1bd70 +Author: Michel Dänzer +Date: Tue Jun 21 15:41:45 2016 +0900 + + xfree86/modes: Move gamma initialization to xf86RandR12Init12 v2 + + RRCrtcGammaSetSize cannot be used yet in xf86InitialConfiguration, + because randr_crtc isn't allocated yet at that point, but a following + change will require RRCrtcGammaSetSize to be called from + xf86RandR12CrtcInitGamma. + + v2: + * Bail from xf86RandR12CrtcInitGamma if !crtc->funcs->gamma_set (Keith + Packard) + + Reviewed-by: Keith Packard + +commit 0b2f30834b1a9f4a03542e25c5f54ae800df57e2 +Author: Keith Packard +Date: Sun May 29 17:47:29 2016 -0700 + + os: Clean up WaitFor.c + + Do all timer stuff before blocking, avoiding a bunch of duplicate code + and merge common code in WaitForSomething. + + The WaitForSomething changes need a bit of explanation to show that + the new code is effectively equivalent to the old. Eliding error + checking and trivial bits we've got: + + Before: + + if (ready clients) + timeout = 0 + else + compute timeout + i = poll + if (i <= 0) { + if (ready clients) + return TRUE; + if (input) + return FALSE; + if (any ready timers) { + run timers + return FALSE; + } + } else { + if (input) + return FALSE; + if (any ready timers) { + run timers + return FALSE; + } + if (ready clients) + return TRUE; + } + + After: + + if (ready clients) + timeout = 0; + else + compute timeout + run_timers + poll + + if (input) + return FALSE; + + if (ready clients) + return TRUE; + + The old code would return TRUE if there were ready clients and input + pending. Dispatch would then schedule that ready client, but before + processing any requests, it would notice that there was input pending + and go process it. The new code just checks for input first, which is + effectively the same. + + If the poll timed out and there weren't clients ready, then timers + would get run. + + If the poll didn't time out, then timers would get run, even if there + were clients now ready. Now, if the timeout interval was zero, that + means that the timers must have been ready *before* poll was + invoked. In this case, we should simply run the timers before calling + poll -- no sense calling poll just to discard any data that it + generates. + + If the timeout interval was non-zero, and poll didn't timeout, then + either there aren't any timers to run, or we got a surprise and hit a + timer exactly as a client became ready to run. This is the one case + where the new code is different from the old; the new code delays the + timer call until the next time WaitForSomething is called. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 2ab8b1dcd37900e5e2f11007d7c0cd0545209482 +Author: Keith Packard +Date: Sun May 29 19:48:25 2016 -0700 + + os: Use xorg_list for struct _OsTimerRec + + No sense having an open-coded linked list here, plus the doubly linked + list is more efficient + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 50779c494d4682103b96db440021e56e44311b6b +Author: Keith Packard +Date: Sun May 29 12:45:53 2016 -0700 + + os: Remove CheckConnections + + poll provides per-fd notification of failure, so we don't need + CheckConnections anymore. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit f0275b1e5a4787da1f4d5507165315a000c22b33 +Author: Keith Packard +Date: Thu May 26 00:19:55 2016 -0700 + + os: Leave stdin and stdout open + + There's no reason to close these now that we don't care what file + descriptors we use. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 8217c29d2d8b29bd66bc54fee3fe5cb3385a05c7 +Author: Keith Packard +Date: Wed May 25 23:43:49 2016 -0700 + + Allow 1024 and 2048 for LimitClients + + There's no reason not to offer ridiculous numbers of clients; only a + few static data structures are arrays of this length. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit e0edb963fe09582f23a4b55da4f8840173e7a1ee +Author: Keith Packard +Date: Tue May 24 21:04:14 2016 -0700 + + os: eliminate fd value limits for clients + + With no code depending on the range of file descriptors, checking + for that can be eliminated. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 30bc0732f959bbc63f318c06d48de080d495da32 +Author: Keith Packard +Date: Tue May 24 21:12:33 2016 -0700 + + os: Use ospoll for input thread [v2] + + Replace use of select(2) to avoid fd limits. Note that + InputThreadFillPipe used select as well, but none of the files passed + were non-blocking, so there was no need for that code at all. + + v2: Keep ospoll API usage single threaded to avoid re-entrancy issues + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit f993091e7db81b0420e23c485378cba112278839 +Author: Keith Packard +Date: Thu May 26 10:40:44 2016 -0700 + + os: Switch server to poll(2) [v3] + + Eliminates all of the fd_set mangling in the server main thread + + v2: Listen for POLLOUT while writes are blocked. + + v3: Only mark client not ready on EAGAIN return from read + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 8f1edf4bd3a1f050ce9eeb5eac45dd1a8f7a6d5e +Author: Keith Packard +Date: Thu May 19 13:59:54 2016 -0700 + + dix: Use list for ready clients + + This converts the dispatch loop into using a list of ready clients + instead of an array. This changes the WaitForSomething API so that it + notifies DIX when a client becomes ready to read, instead of returning + the set of ready clients. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit d6eff3c31e8289881a3aa9b858e5710d0f741db0 +Author: Keith Packard +Date: Thu May 26 10:20:45 2016 -0700 + + os: Add ospoll interface [v2] + + This provides a wrapper around poll or epoll providing a + callback-based interface for monitoring activity on a large set of + file descriptors. + + v2: use xserver_poll API instead of poll. Don't use WSAPoll as + that is broken. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit d403aca70a07e1401cb93738f1af5961582a2e47 +Author: Keith Packard +Date: Mon Jul 18 15:58:42 2016 -0700 + + Switch poll() users to xserver_poll() + + This uses the wrapper in case we need to emulate poll with select + as we do on Windows. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 711c36558f50943c8342f25ad210281134887a3d +Author: Brian M. Clapper +Date: Mon Jul 11 18:30:05 2016 -0400 + + os: Add poll emulation for mingw [v2] + + v2: rename as 'xserver_poll' to avoid potential library name + collisions. Provide 'xserver_poll.h' which uses the system + poll where available and falls back to this emulation otherwise. + Autodetects when this is required, building the emulation only + then + + Source: https://github.com/bmc/poll + Signed-off-by: Adam Jackson + +commit 2a79be9e4dd1b6ba00b69ff40bc5257ec84d34da +Author: Jon Turney +Date: Tue Jul 19 13:35:37 2016 +0100 + + hw/xwin: Update BlockHandler function signature + + Update for removal of fdset from Block/Wakeup handler API in 9d15912a + + Signed-off-by: Jon Turney + Reviewed-by: Keith Packard + +commit 60a91031d13e4d29c383087120e318f6b528b6e5 +Author: Jon Turney +Date: Tue Jul 19 13:35:36 2016 +0100 + + hw/xwin: Update for removal of AddEnabledDevice + + Update for removal of AddEnabledDevice in be5a513f. Use SetNotifyFd instead. + + Signed-off-by: Jon Turney + Reviewed-by: Keith Packard + +commit 7f2d690725292e7b5a44c813c9456da426256873 +Author: Peter Hutterer +Date: Mon Jun 27 10:17:14 2016 +1000 + + xfree86: if ATTR_KEYBOARD is set, match for keyboards + + ATTR_KEY maps to ID_INPUT_KEY which is set for any device with keys. + ID_INPUT_KEYBOARD and thus ATTR_KEYBOARD is set for devices that are actual + keyboards (and have a set of expected keys). + + Hand-written match rules may only apply ID_INPUT_KEYBOARD, so make sure we + match on that too. + + Arguably we should've been matching on ATTR_KEYBOARD only all along but + changing that likely introduces regressions. + + Reported-by: Marty Plummer + Reviewed-by: Adam Jackson + Signed-off-by: Peter Hutterer + +commit 4b311d23e84356bd0e9e736aeed7448dd6382118 +Author: Adam Jackson +Date: Mon Jul 18 12:46:51 2016 -0400 + + modesetting: resubmit dirty rects on EINVAL (v2) + + This error code can mean we're submitting more rects at once than the + driver can handle. If that happens, resubmit one at a time. + + v2: Make the rect submit loop more error-proof (Walter Harms) + + Signed-off-by: Adam Jackson + Reviewed-by: Michael Thayer + +commit 8d3a368d8980e37e7e8c57065dc901ce809887c6 +Author: Keith Packard +Date: Wed Jun 1 22:47:29 2016 -0700 + + os: InputThreadFillPipe doesn't need select or poll + + The file descriptors passed to InputThreadFillPipe are always + blocking, so there's no need to use Select (or poll). + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit ef7ddbe242ed4c461f816663fb88646e41f1c21b +Author: Keith Packard +Date: Wed Jun 1 22:35:09 2016 -0700 + + os: Move ETEST macro from io.c to osdep.h + + This lets other code share this functionality + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 0d294462a5af08ada654c588fad921ed7a22749b +Author: Keith Packard +Date: Sun May 29 15:06:36 2016 -0700 + + os: Add X_NOTIFY_ERROR value + + This provides a way to report errors on file descriptors that is + better defined than "any bits which are not READ or WRITE". + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit e6636b438322a9a2f2270ad9d60bf3dfc72be0b3 +Author: Keith Packard +Date: Thu May 26 10:30:56 2016 -0700 + + os: Compute timeout in milliseconds instead of struct timeval + + The timeout resolution offered in the AdjustWaitForDelay call is + only milliseconds, so passing around the timeout as a pointer to a + struct timeval is not helpful. Doing everything in milliseconds up to + the point of the select call simplifies the code without affecting + functionality at all. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit a414db021575accff64abad6f1047245e81c7476 +Author: Keith Packard +Date: Thu May 19 15:08:05 2016 -0700 + + dix: Intermediate GrabServer state 'GrabKickout' not needed + + The intermediate grabState, "GrabKickout", was used to trigger + dispatch into going back to WaitForSomething after doing a GrabServer + so that the set of ready clients would be recomputed to match what the + server should be processing. As we only process one client per + WaitForSomething call, we will always hit WaitForSomething after + finishing the current client, and so don't need any special case here. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 7762a602c1dfdd8cfcf2b8c2281cf4d683d05216 +Author: Keith Packard +Date: Thu May 19 15:05:55 2016 -0700 + + dix/os: Merge priority computation into SmartScheduleClient + + Instead of having scheduling done in two places (one in + WaitForSomething, and the other in SmartScheduleClient), just stick + all of the scheduling in SmartScheduleClient. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 4af00242ef1e39499b932d12423fdf449296090a +Author: Keith Packard +Date: Mon May 30 01:49:46 2016 -0700 + + Bump ABI versions to reflect block/wakeup handler API changes + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit be5a513fee6cbf29ef7570e57eb0436d70fbd88c +Author: Keith Packard +Date: Mon Dec 7 15:12:14 2015 -0800 + + Remove AddEnabledDevice and AddGeneralSocket APIs + + All uses of these interfaces should instead be using the NotifyFd API + instead. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 9d15912aa475b733bbb20efc367a67dacad63bf1 +Author: Keith Packard +Date: Tue Sep 1 18:51:14 2015 -0700 + + Remove fd_set from Block/Wakeup handler API + + This removes the last uses of fd_set from the server interfaces + outside of the OS layer itself. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit fb0802113b4c57819cba15d64baf79bf4148607e +Author: Keith Packard +Date: Tue Sep 1 11:20:04 2015 -0700 + + Remove readmask from screen block/wakeup handler + + With no users of the interface needing the readmask anymore, we can + remove it from the argument passed to these functions. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 410bc047480a9f98df678dc850bc6b99c3cfb5bf +Author: Keith Packard +Date: Mon Dec 7 15:03:10 2015 -0800 + + dmx: Eliminate use of AddEnabledDevice [v2] + + Use SetNotifyFd instead, with the hope that someday someone will come + fix this to be more efficient -- right now, the wakeup handler is + doing the event reading, instead of the notify callback. + + v2: no need to patch dmxsigio.c as it has been removed. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 6299ef3d749d6f978d3d38d42f711ac56bf382eb +Author: Keith Packard +Date: Thu Aug 27 11:49:35 2015 -0700 + + modesetting: Use passed-in fd for drm event monitoring NotifyFd callback + + This is a cleanup, proposed by Adam Jackson, but wasn't merged with + the original NotifyFD changes. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 6bf7b49f6711c7ed1837283dc04f93f4c1b77ecc +Author: Keith Packard +Date: Thu Aug 27 11:47:26 2015 -0700 + + hw/kdrive: Use passed-in fd for kdrive/linux APM monitoring [v2] + + This is a cleanup, proposed by Adam Jackson, but wasn't merged with + the original NotifyFD changes. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 55c2e1a3aa587c58a74066724e11e30b3df267b8 +Author: Keith Packard +Date: Mon Dec 7 15:11:33 2015 -0800 + + xnest: Use SetNotifyFd to receive events + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 24e65bf0db57bf4ac70386c0a0e8275b73edd2fb +Author: Keith Packard +Date: Thu Dec 3 01:02:02 2015 -0600 + + hw/xfree86: Use NotifyFd for other input fd wakeups + + Remove code in xf86Wakeup for dealing with other input and switch to + using the new NotifyFd interface. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit c3fea428aed919826130ef8ebdb2cceb445a845b +Author: Keith Packard +Date: Tue May 24 20:51:31 2016 -0700 + + os: Use NotifyFd for ErrorConnMax + + Instead of open-coding a single FD wait, use NotifyFd to wait for the + FD to become readable before returning the error message. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 559aac2d71250e3137aaa582e2a59a918ddf21b7 +Author: Keith Packard +Date: Tue May 24 21:59:38 2016 -0700 + + dmx: Switch from select(2) to poll(2) for input + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit aa6717ce213e79735c72afc5ec9cc1f9c0297e09 +Author: Keith Packard +Date: Tue May 24 21:36:18 2016 -0700 + + xfree86: Switch from select(2) to poll(2) + + xf86WaitForInput and the xf86 SIGIO handling code. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 81135991a583b3b30a90e82ddc1d5c86d57bf00b +Author: Keith Packard +Date: Tue May 24 21:19:13 2016 -0700 + + kdrive: switch from select(2) to poll(2) + + This avoids fd limits + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 05a793f5b3c40747d5a92a076def7f4fb673c7e7 +Author: Keith Packard +Date: Tue Sep 1 18:50:55 2015 -0700 + + dix: Switch to the libXfont2 API (v2) + + This new libXfont API eliminates exposing internal X server symbols to + the font library, replacing those with a struct full of the entire API + needed to use that library. + + v2: Use libXfont2 instead of libXfont_2 + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 950ffb8d6fd1480f305e38c571bda44f247f1de2 +Author: Eric Anholt +Date: Fri Nov 6 12:27:42 2015 -0800 + + glamor: Remove the FBO cache. + + It is a modest performance improvement (2.7% on Intel), with the + significant downside that it keeps extra pixmap contents laying around + for 1000 BlockHandlers without the ability for the system to purge + them when under memory pressure, and tiled renderers don't know that + we could avoid reading their current contents when beginning to render + again. We could use the FB invalidate functions, but they aren't + always available, aren't hooked up well in Mesa, and would eat into + the performance gains of having the cache. + + [ajax: rebased to master] + + Reviewed-by: Adam Jackson + +commit e8e36755abb17872d669b88d33ca9adc511029a0 Author: Michel Dänzer Date: Fri Jul 1 12:34:20 2016 +0900 @@ -60,9 +6341,8 @@ Date: Fri Jul 1 12:34:20 2016 +0900 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96742 Signed-off-by: Michel Dänzer Reviewed-by: Adam Jackson - (cherry picked from commit e8e36755abb17872d669b88d33ca9adc511029a0) -commit 7a08d8d82007367a90197f9e9d549dbf0bc9ca2e +commit 32a9504c69183485b0b796fa3966cd1e39992365 Author: Adam Jackson Date: Tue Jul 12 10:04:18 2016 -0400 @@ -82,9 +6362,8 @@ Date: Tue Jul 12 10:04:18 2016 -0400 Reviewed-by: Keith Packard Signed-off-by: Adam Jackson - (cherry picked from commit 32a9504c69183485b0b796fa3966cd1e39992365) -commit 8ff830d1ea4c3572b8fb770009c73c40007e132a +commit 4926845a57fa8b53e18ea7d3434bf5539e9b7782 Author: Andrew Eikum Date: Wed Jul 6 14:13:09 2016 -0500 @@ -96,9 +6375,30 @@ Date: Wed Jul 6 14:13:09 2016 -0500 Reviewed-by: Adam Jackson Signed-off-by: Andrew Eikum - (cherry picked from commit 4926845a57fa8b53e18ea7d3434bf5539e9b7782) -commit d4cbb1155a79a3dc1dc74cc155dbcfc303273856 +commit 9fcb554e9bfdf3eed2c2250d89150e3e7b907f01 +Author: Adam Jackson +Date: Fri Jul 8 15:17:05 2016 -0400 + + xwayland: Only force monotonic clock once + + Otherwise on regeneration we get: + + (EE) BUG: triggered 'if (clockid)' + (EE) BUG: utils.c:440 in ForceClockId() + (EE) + (EE) Backtrace: + (EE) 0: ./hw/xwayland/Xwayland (ForceClockId+0x5c) [0x47713c] + (EE) 1: ./hw/xwayland/Xwayland (OsInit+0x25) [0x4763d5] + (EE) 2: ./hw/xwayland/Xwayland (dix_main+0x11c) [0x43e60c] + (EE) 3: /lib64/libc.so.6 (__libc_start_main+0xf1) [0x7f627b2f9731] + (EE) 4: ./hw/xwayland/Xwayland (_start+0x29) [0x4238e9] + (EE) 5: ? (?+0x29) [0x29] + + Signed-off-by: Adam Jackson + Reviewed-by: Jonas Ådahl + +commit cf6730c503f8090a5d1b80918fe253fc2c5bc090 Author: Rui Matos Date: Wed Jul 13 19:19:09 2016 +0200 @@ -111,9 +6411,8 @@ Date: Wed Jul 13 19:19:09 2016 +0200 Reviewed-by: Jonas Ådahl Signed-off-by: Rui Matos - (cherry picked from commit cf6730c503f8090a5d1b80918fe253fc2c5bc090) -commit 65c5eab6000f108762b7ef6b63869525222ff99d +commit 401a8d6e1379133863e3271374dc21850d0d3cab Author: Michel Dänzer Date: Tue Jun 28 17:22:47 2016 +0900 @@ -132,9 +6431,8 @@ Date: Tue Jun 28 17:22:47 2016 +0900 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92309 Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher - (cherry picked from commit 401a8d6e1379133863e3271374dc21850d0d3cab) -commit c0b02ce45f48450d2896a424dc1eb9a2827ed4c5 +commit 033888e7766d226a179357d970223428c19c4b53 Author: Hans De Goede Date: Thu Jul 7 10:55:04 2016 +0200 @@ -152,24 +6450,156 @@ Date: Thu Jul 7 10:55:04 2016 +0200 Signed-off-by: Hans de Goede Reviewed-by: Julien Cristau Reviewed-by: Chad Versace - (cherry picked from commit 033888e7766d226a179357d970223428c19c4b53) -commit b377a806693ec86df1743d7ddd5a931c88050ebb +commit ce24f3aa5815e03c2d501d1504f6c0162b219801 +Author: Alex Goins +Date: Thu Jul 7 14:50:03 2016 -0700 + + modesetting: NULL assignment for drmmode_set_target_scanout_target_cpu + + Commit 80e64dae: "modesetting: Implement PRIME syncing as a sink" originally was + supposed to have this line, but it was dropped as part of the merge process. + + Foregoing the NULL assignment causes a ton of problems with dereferencing + uninitialized memory. + + Signed-off-by: Alex Goins + Reviewed-by: Dave Airlie + +commit df8e86931eb19c196ed2afc85d89525ef8cb711b +Author: agoins +Date: Thu Jun 16 20:06:48 2016 -0700 + + randr: Add ability to turn PRIME sync off + + Adds an output parameter to disable PRIME synchronization. + + Output parameter is created when the user calls 'xrandr + --setprovideroutputsource ' to prevent polluting output + parameters of non-PRIME configurations. + + Defaults to on, so if the user wants PRIME synchronization they don't need + to do anything. + + If the user wishes to disable PRIME synchronization when they first set up + PRIME, they can run 'xrandr --output --set "PRIME Synchronization" + 0' after running 'xrandr --setprovideroutputsource ', but + before 'xrandr --auto'. + + If the user wishes to enable or disable PRIME synchronization after PRIME has + already been set up, they can run 'xrandr --output --set "PRIME + Synchronization" <0 or 1>' at any time, xrandr will trigger a modeset, which + will tear down and setup PRIME in the configuration they requested on CRTCs + associated with that output. + + randrstr.h: + Add central definition of the output property name. + + rrcrtc.c: + Add function rrGetPixmapSharingSyncProp() to query the status of the + output property. + + Add function rrSetPixmapSharingSyncProp() to set the output property. + + Add 'sync' parameter to rrSetupPixmapSharing(), which when false will + use single buffering even if the required ABI functions are supported. + Changes rrSetupPixmapSharing() to only report an error if falling back + to single buffering when the user requested synchronization. + + Change RRCrtcSet() to use rrPixmapSharingSyncProp() to query the status + of the output property and feed it into rrSetupPixmapSharing() using + the 'sync' parameter. + + rrprovider.c: + Add RR(Init/Fini)PrimeSyncProps(), functions to create and destroy the + PRIME synchronization output property. + + Add a call to RRInitPrimeSyncProps() in + ProcRRSetProviderOutputSource(), such that the output property is + created when the user requests PRIME. + + Add a call to RRFiniPrimeSyncProps() in RRProviderDestroy(). + + v1: Initial commit + v2: Unchanged + v3: Add /* TODO */ for handling different sources with different outputs + Make rrSetupPixmapSharing() set the output property to 0 if it has to fall + back, to avoid user confusion. + Make rr(Get)PixmapSharingSyncProp() check the current value if there isn't a + pending value + v4: Unchanged + v5: Unchanged + v6: Rebase onto ToT + v7: Unchanged + + Signed-off-by: Alex Goins + +commit 60ad701a6a8cb9f1eacb72acfe2cb8d3b7a865dc +Author: Hans de Goede +Date: Tue Jun 14 11:58:01 2016 +0200 + + modesetting: Load on GPU-s with 0 outputs + + In newer laptops with switchable graphics, the GPU may have 0 outputs, + in this case the modesetting driver should still load if the GPU is + SourceOffload capable, so that it can be used as an offload source provider. + + Signed-off-by: Hans de Goede + Reviewed-by: Eric Engestrom + +commit 94a1c77259ce39ba59ad87615df39b570ffab435 +Author: Hans de Goede +Date: Thu Jun 16 15:21:03 2016 +0200 + + modesetting: Fix swapping of provider sink / source capabilities + + When a card has import capability it can be an offload _sink_, not + a source and vice versa for export capability. + + This commit fixes the modesetting driver to properly set these + capabilities, this went unnoticed sofar because most gpus have both + import and export capability. + + Signed-off-by: Hans de Goede + Reviewed-by: Eric Engestrom + +commit fcbafdfd79fd03205bc324e23b6d4e4d4f7180e1 Author: Adam Jackson -Date: Mon Jul 18 12:46:51 2016 -0400 +Date: Wed Jul 22 12:14:08 2015 -0400 - modesetting: resubmit dirty rects on EINVAL (v2) + modesetting: Implement a double-buffered shadow mode - This error code can mean we're submitting more rects at once than the - driver can handle. If that happens, resubmit one at a time. + Server GPUs often have a VNC feature attached to allow remote console. + The controller implementing this feature is usually not very powerful, + and we can easily swamp it with work. This is made somewhat worse by + damage over-reporting the size of the dirty region, and a whole lot + worse by applications (or shells) that update the screen with identical + pixel content as was already there. - v2: Make the rect submit loop more error-proof (Walter Harms) + Fix this by double-buffering the shadow fb, using memcmp to identify + dirty tiles on each update pass. Since both shadows are in host memory + the memcmp is cheap, and worth it given the win in network bandwidth. + The tile size is somewhat arbitrarily chosen to be one cacheline wide at + 32bpp on Intel Core. + + By default we enable this behaviour for (a subset of) known server GPUs; + the heuristic could use work. Signed-off-by: Adam Jackson - Reviewed-by: Michael Thayer - (cherry picked from commit 4b311d23e84356bd0e9e736aeed7448dd6382118) + Reviewed-by: Alex Deucher + Signed-off-by: Hans de Goede -commit f091528457cc62fa9bd6cd24aeebacffb7296419 +commit 75e660e379d921a53eb7c3bc9c2e412fa58aec02 +Author: Adam Jackson +Date: Wed Jul 22 12:14:07 2015 -0400 + + modesetting: Drop some non-functional triple-buffering variables + + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + Signed-off-by: Hans de Goede + +commit 21217d02168d1883b2d1f64399aec494f96a8b9d Author: Dave Airlie Date: Wed Jul 22 12:14:06 2015 -0400 @@ -189,31 +6619,8 @@ Date: Wed Jul 22 12:14:06 2015 -0400 Reviewed-by: Alex Deucher [hdegoede@redhat.com: rebase, also use kbpp for rotate shadow fb] Signed-off-by: Hans de Goede - - (cherry picked from commit 21217d02168d1883b2d1f64399aec494f96a8b9d) -commit d8eccab378dd8fe5a36dd31ff91561da47ec9ecf -Author: Hans de Goede -Date: Wed Jun 1 15:14:32 2016 +0200 - - modesetting: Only add main fb if necessary - - If we're doing reverse-prime; or doing rotation the main fb is not used, - and there is no reason to add it in this case. - - Signed-off-by: Hans de Goede - Reviewed-by: Dave Airlie - (cherry picked from commit 4313122dea0df9affc280ee698e929489061ccc6) - -commit 23a7010f3438e053f66c9fb0c4a13456fe33bf72 -Author: Adam Jackson -Date: Tue Jul 19 13:08:31 2016 -0400 - - Revert "modesetting: Load on GPU-s with 0 outputs" - - This reverts commit 713a21cc702561931ed5e84c3a5c3d7e7c580725. - -commit effd785aa8a97c9a044d86bde7ad63645cbca176 +commit af916477c65a083ec496ac3f088d766b410e8b6e Author: Takashi Iwai Date: Mon Feb 16 17:00:55 2015 +0100 @@ -251,9 +6658,8 @@ Date: Mon Feb 16 17:00:55 2015 +0100 Signed-off-by: Takashi Iwai Reviewed-by: Adam Jackson Signed-off-by: Hans de Goede - (cherry picked from commit af916477c65a083ec496ac3f088d766b410e8b6e) -commit 61094504a774ac763cb457d1f4bf2a1476e03f56 +commit 14c21ea1c9496638b1feb8e6145c440fb4f1d14b Author: Takashi Iwai Date: Mon Feb 16 17:00:54 2015 +0100 @@ -272,10 +6678,8 @@ Date: Mon Feb 16 17:00:54 2015 +0100 Reviewed-by: Kenneth Graunke [hdegoede@redhat.com: Add extra comment suggested by Kenneth] Signed-off-by: Hans de Goede - - (cherry picked from commit 14c21ea1c9496638b1feb8e6145c440fb4f1d14b) -commit 15f8aaa786ac89509843f22dcb5f446effba1024 +commit 074cf58769b38550a3f35d5ecb73333330cb2aed Author: Takashi Iwai Date: Mon Feb 16 17:00:53 2015 +0100 @@ -290,9 +6694,39 @@ Date: Mon Feb 16 17:00:53 2015 +0100 Reviewed-by: Michel Dänzer Reviewed-by: Kenneth Graunke Signed-off-by: Hans de Goede - (cherry picked from commit 074cf58769b38550a3f35d5ecb73333330cb2aed) -commit ee0fd6b2c68d88ef3511fe1796dd50601785ead0 +commit 3762edded8e6e973f71419937e16bea262a266b8 +Author: Adam Jackson +Date: Wed Jun 29 14:07:32 2016 -0400 + + configure: Tell AC_REPLACE_FUNCS where to find replacements + + Fixes weird link errors of the form: + + CCLD Xvfb + ../../Xext/.libs/libXext.a(xvmc.o): In function `xf86XvMCRegisterDRInfo': + /home/ajax/git/xserver/Xext/xvmc.c:828: undefined reference to `strlcpy' + /home/ajax/git/xserver/Xext/xvmc.c:829: undefined reference to `strlcpy' + ../../os/os.O: In function `siHostnameAddrMatch': + /home/ajax/git/xserver/os/access.c:1821: undefined reference to `strlcpy' + ../../os/os.O: In function `AuthAudit': + /home/ajax/git/xserver/os/connection.c:555: undefined reference to `strlcpy' + /home/ajax/git/xserver/os/connection.c:574: undefined reference to `strlcpy' + ../../os/os.O:/home/ajax/git/xserver/os/log.c:972: more undefined references to `strlcpy' follow + collect2: error: ld returned 1 exit status + Makefile:688: recipe for target 'Xvfb' failed + make[3]: *** [Xvfb] Error 1 + Makefile:749: recipe for target 'all-recursive' failed + make[2]: *** [all-recursive] Error 1 + Makefile:608: recipe for target 'all-recursive' failed + make[1]: *** [all-recursive] Error 1 + Makefile:776: recipe for target 'all-recursive' failed + make: *** [all-recursive] Error 1 + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit d135100d6b17e54262a12aeaebe0fe2fe48da3bb Author: Peter Hutterer Date: Tue Jun 28 11:42:41 2016 +1000 @@ -310,9 +6744,934 @@ Date: Tue Jun 28 11:42:41 2016 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau Reviewed-by: Daniel Stone - (cherry picked from commit d135100d6b17e54262a12aeaebe0fe2fe48da3bb) -commit 54ba95861e5ae54051d3963e5e7ced7d69a6de7b +commit b83dede9cb930cf55249ad8e935f3c4d4328e2d9 +Author: Alex Goins +Date: Thu Jun 16 20:06:56 2016 -0700 + + modesetting: Implement PRIME syncing as a source + + Implements (Start/Stop)FlippingPixmapTracking, PresentSharedPixmap, and + RequestSharedPixmapNotifyDamage, the source functions for PRIME + synchronization and double buffering. Allows modesetting driver to be used + as a source with PRIME synchronization. + + v1: N/A + v2: N/A + v3: N/A + v4: Initial commit + v5: Move disabling of reverse PRIME on sink to sink commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit 44cb9578c0e5e10568826bc3ecbed97d358bba3c +Author: Alex Goins +Date: Thu Jun 16 20:06:55 2016 -0700 + + modesetting: Disable Reverse PRIME for i915 + + Reverse PRIME seems to be designed with discrete graphics as a sink in + mind, designed to do an extra copy from sysmem to vidmem to prevent a + discrete chip from needing to scan out from sysmem. + + The criteria it used to detect this case is if we are a GPU screen and + Glamor accelerated. It's possible for i915 to fulfill these conditions, + despite the fact that the additional copy doesn't make sense for i915. + + Normally, you could just set AccelMethod = none as an option for the device + and call it a day. However, when running with modesetting as both the sink + and the source, Glamor must be enabled. + + Ideally, you would be able to set AccelMethod individually for devices + using the same driver, but there seems to be a bug in X option parsing that + makes all devices on a driver inherit the options from the first detected + device. Thus, glamor needs to be enabled for all or for none until that bug + (if it's even a bug) is fixed. + + Nonetheless, it probably doesn't make sense to do the extra copy on i915 + even if Glamor is enabled for the device, so this is more user friendly by + not requiring users to disable acceleration for i915. + + v1: N/A + v2: N/A + v3: N/A + v4: Initial commit + v5: Unchanged + v6: Rebase onto ToT + v7: NULL check and free drmVersionPtr + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit f6fef2a171366156c4c6807de7fe086f04f41b7b +Author: Alex Goins +Date: Thu Jun 16 20:06:54 2016 -0700 + + modesetting: Blacklist USB transport devices from PRIME sync + + UDL (USB 2.0 DisplayLink DRM driver) and other drivers for USB transport devices + have strange semantics when it comes to vblank events, due to their inability to + get the actual vblank info. + + When doing a page flip, UDL instantly raises a vblank event without waiting for + vblank. It also has no support for DRM_IOCTL_WAIT_VBLANK, and has some strange + behavior with how it handles damage when page flipping. + + It's possible to get something semi-working by hacking around these issues, + but even then there isn't much value-add vs single buffered PRIME, and it + reduces maintainability and adds additional risks to the modesetting driver + when running with more well-behaved DRM drivers. + + Work needs to be done on UDL in order to properly support synchronized + PRIME. For now, just blacklist it, causing RandR to fall back to + unsynchronized PRIME. + + This patch originally blacklisted UDL by name, but it was pointed out that there + are other USB transport device drivers with similar limitations, so it was + expanded to blacklist all USB transport devices. + + v1: N/A + v2: N/A + v3: Initial commit + v4: Move check to driver.c for consistency/visibility + v5: Refactor to accomodate earlier changes + v6: Rebase onto ToT + v7: Expand to blacklist all USB transport devices, not just UDL + + Signed-off-by: Alex Goins + Reviewed-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit 500853086dd5fbfe6d2b3e30923fdc4d8c262cf0 +Author: Alex Goins +Date: Thu Jun 16 20:06:53 2016 -0700 + + modesetting: Suspend and resume flipping with DPMS + + DPMS would prevent page flip / vblank events from being raised, freezing + the screen until PRIME flipping was reinitialized. To handle DPMS cleanly, + suspend PRIME page flipping when DPMS mode is not on, and resume it when + DPMS mode is on. + + v1: Initial commit + v2: Moved flipping_active check from previous commit to here + v3: Unchanged + v4: Unchanged + v5: Move flipping_active check to sink support commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit 80e64dae8af1eb3bb225b00fd800c6924883cf46 +Author: Alex Goins +Date: Thu Jun 16 20:06:52 2016 -0700 + + modesetting: Implement PRIME syncing as a sink + + Implements (Enable/Disable)SharedPixmapFlipping and + SharedPixmapNotifyDamage, the sink functions for PRIME synchronization and + double buffering. Allows modesetting driver to be used as a sink with PRIME + synchronization. + + Changes dispatch_slave_dirty to flush damage from both scanout pixmaps. + + Changes drmmode_set_scanout_pixmap*() functions to + drmmode_set_target_scanout_pixmap*() that take an additional parameter + PixmapPtr *target. Then, treat *target as it did prime_pixmap. This allows + me to use it to explicitly set both prime_pixmap and prime_pixmap_back + individually. drmmode_set_scanout_pixmap() without the extra parameter + remains to cover the single-buffered case, but only works if we aren't + already double buffered. + + driver.c: + Add plumbing for rr(Enable/Disable)SharedPixmapFlipping and + SharedPixmapNotifyDamage. + + Change dispatch_dirty_crtc to dispatch_dirty_pixmap, which functions the + same but flushes damage associated with a ppriv instead of the crtc, and + chanage dispatch_slave_dirty to use it on both scanout pixmaps if + applicable. + + drmmode_display.h: + Add flip_seq field to msPixmapPrivRec to keep track of the event handler + associated with a given pixmap, if any. + + Add wait_for_damage field to msPixmapPrivRec to keep track if we have + requested a damage notification from the source. + + Add enable_flipping field to drmmode_crtc_private_rec to keep track if + flipping is enabled or disabled. + + Add prime_pixmap_back to drmmode_crtc_private_rec to keep track of back + buffer internally. + + Add declarations for drmmode_SetupPageFlipFence(), + drmmode_EnableSharedPixmapFlipping(), + drmmode_DisableSharedPixmapFlipping, drmmode_SharedPixmapFlip(), and + drmmode_SharedPixmapPresentOnVBlank(). + + Move slave damage from crtc to ppriv. + + drmmode_display.c: + Change drmmode_set_scanout_pixmap*() functions to + drmmode_set_target_scanout_pixmap*() that take an additional parameter + PixmapPtr *target for explicitly setting different scanout pixmaps. + + Add definitions for functions drmmode_SharedPixmapFlip(), + drmmode_SharedPixmapPresentOnVBlank(), + drmmode_SharedPixmapPresent(), + drmmode_SharedPixmapVBlankEventHandler(), + drmmode_SharedPixmapVBlankEventAbort(), + drmmode_EnableSharedPixmapFlipping(), and + drmmode_DisableSharedPixmapFlipping, + drmmode_InitSharedPixmapFlipping(), and + drmmode_FiniSharedPixmapFlipping, along with struct + vblank_event_args. + + The control flow is as follows: + pScrPriv->rrEnableSharedPixmapFlipping() makes its way to + drmmode_EnableSharedPixmapFlipping(), which sets enable_flipping to + TRUE and sets both scanout pixmaps prime_pixmap and + prime_pixmap_back. + + When setting a mode, if prime_pixmap is defined, modesetting + driver will call drmmode_InitSharedPixmapFlipping(), which if + flipping is enabled will call drmmode_SharedPixmapPresent() on + scanout_pixmap_back. + + drmmode_SharedPixmapPresent() requests that for the source to + present on the given buffer using master->PresentSharedPixmap(). If + it succeeds, it will then attempt to flip to that buffer using + drmmode_SharedPixmapFlip(). Flipping shouldn't fail, but if it + does, it will raise a warning and try drmmode_SharedPixmapPresent() + again on the next vblank using + drmmode_SharedPixmapPresentOnVBlank(). + + master->PresentSharedPixmap() could fail, in most cases because + there is no outstanding damage on the mscreenpix tracked by the + shared pixmap. In this case, drmmode_SharedPixmapPresent() will + attempt to use master->RequestSharedPixmapNotifyDamage() to request + for the source driver to call slave->SharedPixmapNotifyDamage() in + response to damage on mscreenpix. This will ultimately call + into drmmode_SharedPixmapPresentOnVBlank() to retry + drmmode_SharedPixmapPresent() on the next vblank after + accumulating damage. + + drmmode_SharedPixmapFlip() sets up page flip event handler by + packing struct vblank_event_args with the necessary parameters, and + registering drmmode_SharedPixmapVBlankEventHandler() and + drmmode_SharedPixmapVBlankEventAbort() with the modesetting DRM + event handler queue. Then, it uses the drmModePageFlip() to flip on + the next vblank and raise an event. + + drmmode_SharedPixmapPresentOnVBlank() operates similarly to + drmmode_SharedPixmapFlip(), but uses drmWaitVBlank() instead of + drmModePageFlip() to raise the event without flipping. + + On the next vblank, DRM will raise an event that will ultimately be + handled by drmmode_SharedPixmapVBlankEventHandler(). If we flipped, + it will update prime_pixmap and prime_pixmap_back to reflect that + frontTarget is now being displayed, and use + drmmode_SharedPixmapPresent(backTarget) to start the process again + on the now-hidden shared pixmap. If we didn't flip, it will just + use drmmode_SharedPixmapPresent(frontTarget) to start the process + again on the still-hidden shared pixmap. + + Note that presentation generally happens asynchronously, so with + these changes alone tearing is reduced, but we can't always + guarantee that the present will finish before the flip. These + changes are meant to be paired with changes to the sink DRM driver + that makes flips wait on fences attached to dmabuf backed buffers. + The source driver is responsible for attaching the fences and + signaling them when presentation is finished. + + Note that because presentation is requested in response to a + vblank, PRIME sources will now conform to the sink's refresh rate. + + At teardown, pScrPriv->rrDisableSharedPixmapFlipping() will be + called, making its way to drmmode_FiniSharedPixmapFlipping(). + There, the event handlers for prime_pixmap and prime_pixmap_back + are aborted, freeing the left over parameter structure. Then, + prime_pixmap and prime_pixmap back are unset as scanout pixmaps. + + Register and tear down slave damage per-scanout pixmap instead of + per-crtc. + + v1: Initial commit + v2: Renamed PresentTrackedFlippingPixmap to PresentSharedPixmap + Renamed flipSeq to flip_seq + Warn if flip failed + Use SharedPixmapNotifyDamage to retry on next vblank after damage + v3: Refactor to accomodate moving (rr)StartFlippingPixmapTracking and + (rr)(Enable/Disable)SharedPixmapFlipping to rrScrPrivRec from ScreenRec + Do damage tracking on both scanout pixmaps + v4: Tweaks to commit message + v5: Revise for internal storage of prime pixmap ptrs + Move disabling for reverse PRIME from source commit to here + Use drmmode_set_target_scanout_pixmap*() to set scanout pixmaps + internally to EnableSharedPixmapFlipping(). + Don't support flipping if ms->drmmode.pageflip == FALSE. + Move flipping_active check to this commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit 378c85a8848679eaa3c2881f3ba8b686e59df25e +Author: Alex Goins +Date: Thu Jun 16 20:06:51 2016 -0700 + + modesetting: Always load ms->drmmode.pageflip + + ms->drmmode.pageflip was only loaded from options if ms->drmmode.glamor was + defined, otherwise it would always assume FALSE. + + PRIME Synchronization requires ms->drmmode.pageflip even if we aren't using + glamor, so load it unconditionally. + + v1: N/A + v2: N/A + v3: N/A + v4: N/A + v5: Initial commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit b773a9c8126222e5fed2904d012fbf917a9f22fd +Author: Alex Goins +Date: Thu Jun 16 20:06:50 2016 -0700 + + modesetting: Always tear down scanout pixmap + + drmmode_set_scanout_pixmap_(cpu/gpu) would only do teardown if ppix == + NULL. This meant that if there were consecutive calls to + SetScanoutPixmap(ppix != NULL) without calls to SetScanoutPixmap(ppix == + NULL) in between, earlier calls would be leaked. RRReplaceScanoutPixmap() + does this today. + + Instead, when setting a scanout pixmap, always do teardown of the existing + scanout pixmap before setting up the new one. Then, if there is no new one + to set up, stop there. + + This maintains the previous behavior in all cases except those with + multiple consecutive calls to SetScanoutPixmap(ppix != NULL). + + v1: N/A + v2: N/A + v3: N/A + v4: N/A + v5: Initial commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit f4c37eeee7953df1fe0e3196eda452acf0078e61 +Author: Alex Goins +Date: Thu Jun 16 20:06:49 2016 -0700 + + modesetting: Internal storage of scanout pixmaps + + modesetting relied on randr_crtc->scanout_pixmap being consistent with + calls to SetScanoutPixmap, which is very fragile and makes a lot of + assumptions about the caller's behavior. + + For example, RRReplaceScanoutPixmap(), when dropping off with !size_fits, + will set randr_crtc->scanout_pixmap = NULL and then call SetScanoutPixmap. + Without this patch, drmmode_set_scanout_pixmap_(cpu/gpu) will think that + there is no scanout pixmap to tear down, because it's already been set to + NULL. + + By keeping track of the scanout pixmap in its internal state, modesetting + can avoid these types of bugs and reduce constraints on calling + conventions. + + v1: N/A + v2: N/A + v3: N/A + v4: N/A + v5: Initial commit + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit 1bdbc7e764ed7bf7c1ae46287dec368aa7c7e80d +Author: Alex Goins +Date: Thu Jun 16 20:06:47 2016 -0700 + + randr/xf86: Add PRIME Synchronization / Double Buffer + + Changes PRIME to use double buffering and synchronization if all required + driver functions are available. + + rrcrtc.c: + Changes rrSetupPixmapSharing() to use double buffering and + synchronization in the case that all required driver functions are + available. Otherwise, falls back to unsynchronized single buffer. + + Changes RRCrtcDetachScanoutPixmap() to properly clean up in the case of + double buffering. + + Moves StopPixmapTracking() from rrDestroySharedPixmap() to + RRCrtcDetachScanoutPixmap(). + + Changes RRReplaceScanoutPixmap() to fail if we are using double buffering, + as it would need a second ppix parameter to function with double buffering, + and AFAICT no driver I've implemented double buffered source support in uses + RRReplaceScanoutPixmap(). + + randrstr.h: + Adds scanout_pixmap_back to struct _rrCrtc to facilitate PRIME + double buffering. + + xf86Crtc.h: + Adds current_scanout_back to _xf86Crtc to facilitate detection + of changes to it in xf86RandR12CrtcSet(). + + xf86RandR12.c: + Changes xf86RandR12CrtcSet() to detect changes in + scanout_pixmap_back. + + Adds scanout_pixmap_back to struct _rrCrtc to facilitate PRIME double + buffering. + + v1: Initial commit + v2: Rename PresentTrackedFlippingPixmap to PresentSharedPixmap + v3: Refactor to accomodate moving (rr)StartFlippingPixmapTracking and + (rr)(Enable/Disable)SharedPixmapFlipping to rrScrPrivRec from ScreenRec + Add fallback if flipping funcs fail + v4: Detach scanout pixmap when destroying scanout_pixmap_back, to avoid + dangling pointers in some drivers + v5: Disable RRReplaceScanoutPixmap for double-buffered PRIME, it would need an + ABI change with support for 2 pixmaps if it were to be supported, but AFAICT + no driver that actually supports double-buffered PRIME uses it. + Refactor to use rrEnableSharedPixmapFlipping() as a substitute for + rrCrtcSetScanoutPixmap() in the flipping case. + Remove extraneous pSlaveScrPriv from DetachScanoutPixmap() + Remove extraneous protopix and pScrPriv from rrSetupPixmapSharing() + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit b601f96a5915a2c486b389483b291797e6fdf617 +Author: Alex Goins +Date: Thu Jun 16 20:06:46 2016 -0700 + + xf86: Add PRIME flipping functions to Screen + + Adds typedefs for (*RRStartFlippingPixmapTrackingProcPtr), + (*RREnableSharedPixmapFlippingProcPtr), + and (*RRDisableSharedPixmapFlippingProcPtr) in randrstr.h. + + Adds typedefs for (*PresentSharedPixmapProcPtr), + (*SharedPixmapNotifyDamageProcPtr), + (*RequestSharedPixmapNotifyDamageProcPtr), and + (*StopFlippingPixmapTrackingProcPtr) in scrnintstr.h. + + Adds RR(Enable/Disable)SharedPixmapFlipping, and + RRStartFlippingPixmapTracking to rrScrnPrivRec. + + Adds StopFlippingPixmapTracking, PresentSharedPixmap, + SharedPixmapNotifyDamage, and RequestSharedPixmapNotifyDamage to ScreenRec. + + rrScrnPrivRec used for functions that use RandR-private data types, and + ScreenRec used for the rest. + + RREnableSharedPixmapFlipping will allow the sink driver to setup for + flipping between two shared pixmaps. + + RRDisableSharedPixmapFlipping will allow the sink driver to do teardown + associated with flipping between two shared pixmaps. + + (RRStart/Stop)FlippingPixmapTracking are merely the double-buffered + equivalents of (Start/Stop)PixmapTracking, allowing the source driver to do + whatever setup and teardown necessary for presenting on the two shared + pixmaps. + + PresentSharedPixmap is a function exposed by the source driver for the X + server or sink driver to call to request a present on a given shared + pixmap. This way, presents can be driven by the sink's vblank instead of a + timer or similar mechanism. + + SharedPixmapNotifyDamage and RequestSharedPixmapNotifyDamage are OPTIONAL + (even for double-buffered PRIME) functions exposed by the sink driver and + the source driver, respectively. By calling + master->RequestSharedPixmapNotifyDamage(ppix), the sink driver can request + for the source driver to call slave->SharedPixmapNotifyDamage(ppix) in + response to damage on the master screen pixmap tracked by ppix. + + v1: Initial commit + v2: Rename PresentTrackedFlippingPixmap to PresentSharedPixmap + Add SharedPixmapNotifyDamage / RequestSharedPixmapNotifyDamage + v3: Add RRCrtcPtr as a parameter to StartFlippingPixmapTracking + Move functions that use RandR-private data types to rrScrnPrivRec. + v4: Unchanged + v5: Add front and back parameters to RREnableSharedPixmapFlippingProcPtr + v6: Rebase onto ToT + v7: Unchanged + + Reviewed-by: Dave Airlie + Signed-off-by: Alex Goins + +commit ef1578e736887aadf209172f48daa9eaec25b3db +Author: Jon Turney +Date: Sun Feb 28 00:53:24 2016 +0000 + + hw/xwin: Fix a typo in "Remove Shadow DirectDraw engine" + + Commit 7a22912e "Remove Shadow DirectDraw engine" contained a typo, changing + the fullscreen && DirectDraw check in WM_DISPLAYCHANGE to fullscreen || + DirectDraw + + This causes disruptive depth changes to be improperly handled + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 0a0c1bd93259c208184d6ad974ba55658191af0c +Author: Jon Turney +Date: Fri Feb 26 18:03:04 2016 +0000 + + hw/xwin: Fix a crash trying to reload window icons when not in multiwindow mode + + ReloadEnumWindowsProc() accesses window privates, which are only valid in + multiwindow mode, but is called in all modes. + + Fix this potential crash by not doing this unless in multiwindow mode. + + Reproduction steps: + 1/ XWin -mwextwm + 2/ Run a client which creates an X window e.g. xterm + 3/ Right click on notification area icon, and choose 'Reload .XWinrc' from the menu + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 91ae2571458c50d9f782190d9f80815b770aefac +Author: Colin Harrison +Date: Fri Feb 26 16:46:15 2016 +0000 + + hw/xwin: Fix a crash which occurs if focus returns to XWin after xkbcomp has failed + + If WM_FOCUS is received while the "core devices failed" fatal error (due to + xkbcomp failing) is displayed, winRestoreModeKeyState() attempts to + dereference a NULL InputInfo.keyboard->key pointer. + + Signed-off-by: Colin Harrison + Reviewed-by: Jon Turney + +commit 4b123e0f61eb55e59d30bf442499cf3b3f621c3b +Author: Jon Turney +Date: Tue Aug 4 16:05:05 2015 +0100 + + hw/xwin: Make window maximizable if a maximium size larger than virtual desktop size is specified + + Firefox 38 has a WM_NORMAL_HINTS with a maximum size of 32767x32767. + + Don't remove the maximize control from the window frame if the maximum size + is bigger than the virtual desktop size, as maximizing the window will not + exceed the maximium size. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 504bf495f9b3adea1ba650469223511f81709714 +Author: Jon Turney +Date: Wed Jul 8 19:12:22 2015 +0100 + + hw/xwin: Detect invalid options in combination with -nodecoration + + Detect invalid options in combination with -nodecoration + + These are particularly problematic as -nodecoration implies a default of + -nomultimonitors, for some reason, which will gives rendering issues with + -multiwindow. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit e1b983b55e4cefcf976c8f92d608af8216a56927 +Author: Jon Turney +Date: Tue Nov 11 11:46:25 2014 +0000 + + hw/xwin: Default to -noresize when -fullscreen is used + + Currently, just using -fullscreen fails in winValidateArgs(), as the default + -resize=randr is incompatible with -fullscreen. + + Set the default resize mode to -noresize if -fullscreen is used. + + Also, rename enum value notAllowed -> resizeNotAllowed for clarity. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 42f7cd5d92f2046e1b5c264b3d76c3afda624a55 +Author: Jon Turney +Date: Sat Oct 11 14:49:16 2014 +0100 + + hw/xwin: Tell LogInit() to backup previous logfile as .old + + Future work: Do we really need to call LogInit() in so many different + places? + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 197419838273eddbd0bd34890771799f4bebbc07 +Author: Jon Turney +Date: Fri Sep 26 13:18:33 2014 +0100 + + hw/xwin: Downgrade some uninformative, always-emitted log output to debug + + Downgrade from error to debug some uninformative, always-emitted log output + about thread synchronization during initialization + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 17c8bf348eea4f12ce7cb4ca7db0d0576e28c982 +Author: Jon Turney +Date: Tue Apr 28 16:04:40 2015 +0100 + + hw/xwin: Check for just the hostname in window title + + When -hostintitle is enabled, only use the hostname, not a FQDN from + WM_CLIENT_MACHINE, when checking if the window title already contains it + + Also restructure GetWindowName() to fix a potential memory leak. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit c05c4360eea245b3ef5f3a355b95dcd63244ef70 +Author: Jon Turney +Date: Mon Sep 22 14:40:41 2014 +0100 + + hw/xwin: Use _NET_WM_NAME for window titles in multiwindow mode + + Use _NET_WM_NAME in preference to WM_NAME for window title + + Update window title when _NET_WM_NAME property changes + + We should always have been doing this, but some qt5 examples only set + _NET_WM_NAME, so now it's become more important... + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 866d8299abc4315d4836292aeac4abe0b686fc10 +Author: Jon Turney +Date: Thu Mar 13 17:53:44 2014 +0000 + + hw/xwin: Remove decorations from _NET_WM_WINDOW_TYPE_SPLASH type windows + + In multiwindow mode, remove decorations from _NET_WM_WINDOW_TYPE_SPLASH type + windows. + + Some programs use _NET_WM_WINDOW_TYPE_SPLASH_SCREEN in error, so also accept + that as equivalent. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 356b9129067dd0e1dc62e893d47a1e9b033885bd +Author: Jon Turney +Date: Thu Apr 7 17:40:56 2016 +0100 + + hw/xwin: Use Bool type in winShowWindowOnTaskbar() prototype + + Use the Bool type from X11/Xdefs.h for winShowWindowOnTaskbar(). + + This is the boolean type we should be using inside the X server, rather than + BOOL, which evaluates to either the Win32 API type, or the Xlib API type, + depending on the context... + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 7397a2191f333a8632109873cc60d13ca4d550b0 +Author: Olivier Fourdan +Date: Tue Jun 21 13:54:35 2016 +0200 + + xwayland-input: Fake crossing to rootwin + + This partially reverts commit c1565f3. + + When the pointer moves from an X11 window to a Wayland native window, + no LeaveNotify event is emitted which can lead to various unexpected + behaviors like tooltips remaining visible after the pointer has left the + window. + + Yet the pointer_handle_leave() is called and so is the DIX CheckMotion() + but since the pointer enters a Wayland native window with no other + Xwayland window matching, DoEnterLeaveEvents() does not get invoked and + therefore no LeaveNotify event is sent to the X11 client at the time the + pointer leaves the window for a Wayland native surface. + + Restore the XYToWindow() handler in xwayland-input that was previously + removed with commit c1565f3 and use that handler to pretend that the + pointer entered the root window in this case so that the LeaveNotify + event is emitted. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96437 + + Signed-off-by: Olivier Fourdan + Acked-by: Daniel Stone + Acked-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 111a045dcf0912dc5b178c18acda479b3972876b +Author: Adam Jackson +Date: Tue Jun 21 11:45:17 2016 -0400 + + Revert "XDMCP: For IPv6 add link local addresses to the end of the list" + + This reverts commit fdd448cd39b4ca84a28d73fc628911070437b703. + +commit fdd448cd39b4ca84a28d73fc628911070437b703 +Author: Reinhard Max +Date: Thu Apr 28 15:21:15 2016 +0200 + + XDMCP: For IPv6 add link local addresses to the end of the list + + For link local addresses the XDMCP server would need to either know the + interface thru a scope identifier or try all available interfaces. If + they don't this address will fail in which case the XDMCP server could + still try the other addresses passed - however some only try the first + address and then give up. + + Even if this seems to be the wrong place to fix this it seems to be + easier than fixing all display servers. + + [ajax: Cleaned up commit message] + + Reviewed-by: Adam Jackson + +commit ce82ae1964b2115a780786676c614546297a79c9 +Author: Adam Jackson +Date: Tue Feb 2 14:10:49 2016 -0500 + + res: Account for GLXPixmap references too + + GLX_EXT_tetxure_from_pixmap operates on a GLXPixmap, which takes a + reference on the backing pixmap; that GLXPixmap might be long-lived, so + we should account for it in ResQueryClientPixmapBytes. + + Acked-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 5d6ad0d3a7611c4dff2d79b6af9eb5c0885656ef +Author: Adam Jackson +Date: Tue Feb 2 13:49:37 2016 -0500 + + res: Fix accounting of redirected window pixmaps for Composite + + The previous change removed the special case that matched resources of + CompositeClientWindowType and walked back from that to the window + pixmap. That was intentional, since that logic was broken anyway. CCWTs + don't map 1:1 to references on the backing pixmap; a window redirected + by multiple clients (say, by the server since it's on the synthetic + visual, and then manually by a compositor) would have a window pixmap + refcount of 1, but would have those bytes accounted twice. + + The right thing is to have Composite wrap window accounting, and add the + pixmap bytes once and only once for the redirection reference. + + Note that the view from the client can still be non-intuitive in the + face of Composite. xcompmgr, for example, holds _two_ references to + each window pixmap (one each from CompositeNameWindowPixmap and + RenderCreatePicture), so a synthetic-visual window will have its bytes + split 2/3 to xcompmgr and 1/3 to the server-client. Nothing to be done + about that, and at least this way we're not over-accounting. + + Acked-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 4f8a72034c4a2654bfc16d929e09a69d1cc138ef +Author: Adam Jackson +Date: Tue Feb 2 13:46:42 2016 -0500 + + res: Simplify QueryClientPixmapBytes + + I suspect this code predates the common resource hooks for computing + sizes. It's ugly in any case since the Resource extension shouldn't + need to know which extensions can take a reference on pixmaps. Instead, + let's just walk every resource for the client and sum up all the pixmap + bytes that way. + + This might be slightly slower since we're calling the size func once for + every resource. On the other hand, it might be slightly faster since we + only walk the resource table once instead of 3-5 times. Probably a + wash, and not really a performance path in any case. + + Acked-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 263c5333a54107efac702a54d7e6329ae25ff4e0 +Author: Michel Dänzer +Date: Fri Dec 25 18:32:46 2015 +0900 + + xfree86/modes: Simplify in_range logic in xf86_crtc_set_cursor_position + + Consolidate to a single if/else statement and eliminate the redundant + local variable in_range and assignments to x/y. + + Reviewed-by: Adam Jackson + +commit a991b1ec30344c16d318d2c0640f9e5d380193e0 +Author: Michel Dänzer +Date: Mon Feb 1 16:07:22 2016 +0900 + + xfree86/modes: Disambiguate driverIsPerformingTransform + + The driver can now specify exactly which aspects of the transform it + wants to handle via XF86DriverTransform* flags. + + Since the driver can now choose whether it wants to receive transformed + or untransformed cursor coordinates, xf86CrtcTransformCursorPos no + longer needs to be available to drivers, so make it static. + + Reviewed-by: Adam Jackson + +commit aad96f85005f8eab27df62049d619092865a9b16 +Author: Michel Dänzer +Date: Fri Dec 25 18:28:47 2015 +0900 + + xfree86/modes: Fix HW cursor clipping for driverIsPerformingTransform (v2) + + Even if the driver is handling the transform, we still need to transform + the cursor position for clipping, otherwise we may hide the HW cursor + when the cursor is actually inside the area covered by the CRTC. + + v2: Use crtc_x/y local variables for clarity + + Reviewed-by: Adam Jackson + +commit 828887b6f4a997b6468da565a88b6fe9afcda191 +Author: Keith Packard +Date: Tue Jun 14 13:45:27 2016 -0700 + + ephyr: Process only the last expose or configure available from the server + + Delay expose or configure processing until the event queue is empty so + that we don't end up processing a long series of events one at a + time. Expose events already have a check waiting for the last in a + series, this further improves that by discarding multiple + series of events. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit c17a41794507d6d04c850e9e1bc04fc60c31de18 +Author: Keith Packard +Date: Sat Jun 4 19:55:07 2016 -0700 + + ephyr: Process queued X events before blocking [v2] + + If we end up reading all pending X events in the course of other server + execution, then our notify FD callback won't get invoked and we won't + process them. Fix this by noting that there are queued events in the + block handler, setting the poll timeout to zero and queuing a work + proc to clear the event queue. + + v2: use a work proc to clear the event queue rather than doing it in + the block handler directly. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit f3248eba6e2d0c099025f8e9a4874b431246eac7 +Author: Keith Packard +Date: Tue Jun 14 13:19:49 2016 -0700 + + ephyr: Handle window resize when using glamor + + Under glamor, we need to re-create the screen pixmap at the new size + so that we can ask glamor for the associated texture. Fortunately, we + can simply use ephyr_glamor_create_screen_resources to create the new + pixmap. + + Because this is being done after the server has started, we need to + walk the window heirarchy and reset any windows pointing at the old + pixmap. I could easily be convinced that this TraverseTree should be + moved to miSetScreenPixmap. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 235d21670dcff224807ff719c7fa86212058ec46 +Author: Keith Packard +Date: Tue Jun 14 13:16:03 2016 -0700 + + ephyr: Don't configure window while responding to configure events + + This leads to and endless sequence of window resizes. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit fb1edccf3c90c626f120b3c399657f24d3f7901e +Author: Keith Packard +Date: Thu May 26 12:11:46 2016 -0700 + + dix: Call screen block/wakeup handlers closest to blocking [v3] + + The screen block and wakeup handlers are the only ones which provide a + well known ordering between the wrapping layers; placing these as + close as possible to the server blocking provides a way for the driver + to control the flow of execution correctly. + + Switch the shadow code to run in the screen block handler so that it + now occurrs just before the server goes to sleep. + + Switch glamor to call down to the driver after it has executed its own + block handler piece, in case the driver needs to perform additional + flushing work after glamor has called glFlush. + + These changes ensure that the following modules update the screen in + the correct order: + + animated cursors (uses RegisterBlockAndWakeupHandlers dynamically) + composite (dynamic wrapping) + misprite (dynamic wrapping) + shadow (static wrapping) + glamor (static wrapping) + driver (static wrapping) + + It looks like there's still a bit of confusion between composite and + misprite; if composite updates after misprite, then it's possible + you'd exit the block handler chain with the cursor left hidden. To fix + that, misprite should be wrapping during ScreenInit time and not + unwrapping. And composite might as well join in that fun, just to make + things consistent. + + [v2] Unwrap BlockHandler in shadowCloseScreen (ajax) + [v3] ephyr: Use screen block handler for flushing changes + + ephyr needs to make sure it calls glXSwapBuffers after glamor finishes + its rendering. As the screen block handler is now called last, we have + to use that instead of a registered block/wakeup handler to make sure + the GL rendering is done before we copy it to the front buffer. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit a134d1e7eada0ac90fb622f45833c87b72c9aa06 Author: Guilherme Quentel Melo Date: Tue May 10 00:29:58 2016 +0000 @@ -335,9 +7694,254 @@ Date: Tue May 10 00:29:58 2016 +0000 Reviewed-by: Adam Jackson Signed-off-by: Guilherme Quentel Melo - (cherry picked from commit a134d1e7eada0ac90fb622f45833c87b72c9aa06) -commit be8eb5c4a1dda472d54f96bd54ee3e9421daf2e7 +commit 266cf39a8f108e2f365a9772f4ee4d9fca88eb36 +Merge: fa7b70a9b8 848089e0dd +Author: Adam Jackson +Date: Mon Jun 20 11:21:40 2016 -0400 + + Merge remote-tracking branch 'hans/for-master' + +commit fa7b70a9b895789ec57562bbba0bc052fc91d134 +Author: Keith Packard +Date: Tue Jun 14 17:36:16 2016 -0700 + + kdrive: Only enable threaded input if we have input devices + + When there aren't any devices, the input thread is going to be pretty + lonely, so don't bother to even start it. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 6f2a5b8cdf7b1e913a1e0581e65195dd10f04ca3 +Author: Jason Gerecke +Date: Fri Jun 17 08:44:41 2016 -0700 + + xwayland: Expose all NBUTTONS buttons on the pointer + + The call to 'InitButtonClassDeviceStruct' which initializes the pointer + buttons only results in the first three buttons being created due to a + hardcoded '3'. In order to expose all the buttons defined in the + btn_labels array, we subtitute 'NBUTTONS' in its place. + + Signed-off-by: Jason Gerecke + Reviewed-by: Olivier Fourdan + Signed-off-by: Peter Hutterer + +commit 72df6e2a3a5020696902b70fe940934ef0a681c4 +Author: Jason Gerecke +Date: Fri Jun 17 08:44:40 2016 -0700 + + xwayland: Use correct labels when initializing pointer valuators + + Signed-off-by: Jason Gerecke + Reviewed-by: Olivier Fourdan + Signed-off-by: Peter Hutterer + +commit dab5b3922c50f73712a8ea0cb9742c4bc7d7ab1d +Author: Jason Gerecke +Date: Fri Jun 17 08:44:39 2016 -0700 + + xwayland: Fix whitespace errors + + Substitute a few errant tab characters with eight spaces to conform to the + prevailing style. + + Signed-off-by: Jason Gerecke + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 848089e0dde38f043c85332785520946103e77c1 +Author: Lyude Paul +Date: Mon Jun 13 15:31:02 2016 -0400 + + modesetting: Clear drmmode->fb_id before unflipping + + [fix copied from 40191d82370e in xf86-video-ati] + + Without this, we end up setting rotated CRTCs back to their previous + framebuffer right after we perform a rotation. Reproducer: + + - Have two monitors connected at the same resolution + - Rotate one monitor from normal straight to inverted + - Watch as the monitor you didn't rotate either freezes or shows intense + flickering + + Signed-off-by: Lyude + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 4313122dea0df9affc280ee698e929489061ccc6 +Author: Hans de Goede +Date: Wed Jun 1 15:14:32 2016 +0200 + + modesetting: Only add main fb if necessary + + If we're doing reverse-prime; or doing rotation the main fb is not used, + and there is no reason to add it in this case. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit 877453212166fdc912e0d687cdecee11aba563b5 +Author: Hans de Goede +Date: Wed Jun 1 15:11:05 2016 +0200 + + modesetting: Remove unnecessary fb addition from drmmode_xf86crtc_resize + + drmmode_set_mode_major() is the only user of drmmode->fb_id and will + create it if necessary. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit 210d83ad492f0e91889472eaae549106d9b4ebf5 +Author: Hans de Goede +Date: Wed Jun 1 15:07:22 2016 +0200 + + modesetting: Set ppix->fb_id to 0 after removing the fb + + This ensures the fb gets re-added when a shared pixmap is re-used for + a second drmmode_set_scanout_pixmap_cpu call. + + Note currently the xserver never re-uses a shared pixmap in this way, + so this is mostly a sanity fix. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit b8ef71fb07a8ba9587aeaca942b4de20b59266ca +Author: Hans de Goede +Date: Wed Jun 1 14:59:38 2016 +0200 + + modesetting: Properly cleanup fb for reverse-prime-offload + + drmmode_set_scanout_pixmap_gpu(pix) adds drmmod->fb_id through a call + to drmmode_xf86crtc_resize(), but on a subsequent + drmmode_set_scanout_pixmap_gpu(NULL) it would not remove the fb. + + This keeps the crtc marked as busy, which causes the dgpu to not + being able to runtime suspend, after an output attached to the dgpu + has been used once. Which causes burning through an additional 10W + of power and the laptop to run quite hot. + + This commit adds the missing remove fb call, allowing the dgpu to runtime + suspend after an external monitor has been plugged into the laptop. + + Note this also makes drmmode_set_scanout_pixmap_gpu(NULL) match the + behavior of drmmode_set_scanout_pixmap_cpu(NULL) which was already + removing the fb. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit 15595d29c2c3992f260a3314f26fa691f1e5cec8 +Author: Nikhil Mahale +Date: Thu May 26 21:50:16 2016 +0530 + + randr: Adjust master's last set time with slaves + + In prime configurations master's last set time may not be latest + and greatest, adjust it with slaves last set time, pick up greatest + one. Otherwise xserver may end with events which has + lastSetTime < lastConfigTime even if that's not + the case and confuse xrandr client. + + [hdegoede: rebase on "xrandrprovider: Do not use separate lists for unbound / + source / offload slaves"] + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 5c7af02b103790ac1fb6a71822788892c70290b6 +Author: Hans de Goede +Date: Fri May 13 15:58:10 2016 +0200 + + xrandrprovider: Do not use separate lists for unbound / source / offload slaves + + A single provider can be both a offload and source slave at the same time, + the use of seperate lists breaks in this case e.g. : + + xrandr --listproviders + Providers: number : 2 + Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting + Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting + + xrandr --setprovideroutputsource 1 0x7b + xrandr --listproviders + Providers: number : 2 + Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting + Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting + + xrandr --setprovideroffloadsink 1 0x7b + xrandr --listproviders + Providers: number : 3 + Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting + Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting + Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting + + Not good. The problem is that the provider with id 0x46 now is on both + the output_slave_list and the offload_slave_list of the master screen. + + This commit fixes this by unifying all 3 lists into a single slaves list. + + Note that this does change the struct _Screen definition, so this is an ABI + break. I do not expect any of the drivers to actually use the removed / changed + fields so a recompile should suffice. + + Signed-off-by: Hans de Goede + Reviewed-by: Dave Airlie + +commit bab0f450a719a11799491043b82c2f293fed27fe +Author: Chris Wilson +Date: Sat Feb 14 09:58:44 2015 +0000 + + present: Fix presentation of flips out of order + + The flip queue currently only holds events submitted to the driver for + flipping, awaiting the completion notifier. It is short. We therefore + can speed up interrupt processing by keeping the small number of events + ready to be flipped on the end of the flip queue. By appending the + events to the flip_queue in the order that they become ready, we also + resolve one issue causing Present to display frames out of order. + + Signed-off-by: Chris Wilson + Reviewed-and-tested-by: Mario Kleiner + Signed-off-by: Hans de Goede + +commit fbe660b7652b945bdd8e3eb0780179d83cc7de96 +Author: Chris Wilson +Date: Sat Feb 14 09:58:43 2015 +0000 + + present: Improve scaling of vblank handler + + With large numbers of queued vblank, the list iteration on every + interupt dominates processing time. If we reorder the list to be in + ascending event order, then not only is also likely to be in order for + notification queries (i.e. the notification will be near the start of + the list), we can also stop iterating when past the target event_id. + + Signed-off-by: Chris Wilson + Reviewed-and-tested-by: Mario Kleiner + Signed-off-by: Hans de Goede + +commit c6511d0142040654140bdedd6f03d43af0abba21 +Author: Maarten Lankhorst +Date: Wed Oct 2 15:47:54 2013 +0200 + + exa: only draw valid trapezoids + + Fixes freedesktop.org bug https://bugs.freedesktop.org/show_bug.cgi?id=67484 + + If t->bottom is close to MIN_INT, removing top can wraparound, so do the check properly. + A similar fix should also be applied to pixman. + + Signed-off-by: Maarten Lankhorst + Reviewed-by: Hans de Goede + Signed-off-by: Hans de Goede + +commit 2d6230e77348e550c90e00c007b113ce38c81d12 Author: Keith Packard Date: Tue Jun 14 17:09:07 2016 -0700 @@ -350,9 +7954,8 @@ Date: Tue Jun 14 17:09:07 2016 -0700 Signed-off-by: Keith Packard Reviewed-by: Michel Dänzer - (cherry picked from commit 2d6230e77348e550c90e00c007b113ce38c81d12) -commit 5c549168a2947c56727a7546baee21d04c46d563 +commit edd24aa50b17849b904a3ac5429e333bac9bac9c Author: Olivier Fourdan Date: Mon Jun 6 09:22:28 2016 +0200 @@ -365,9 +7968,205 @@ Date: Mon Jun 6 09:22:28 2016 +0200 Signed-off-by: Olivier Fourdan Reviewed-by: Adam Jackson Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96246 - (cherry picked from commit edd24aa50b17849b904a3ac5429e333bac9bac9c) -commit f05a5859102409fe203bcffa96c0231c8b406659 +commit 941aeb3b92e644923bd112eef8023f033a140ee6 +Author: Olivier Fourdan +Date: Fri May 13 08:58:58 2016 +0200 + + randr: Do not update ConnectionInfo if NULL + + RRScreenSizeNotify() will update the connection information block, but + if this occurs during initialization before ConnectionInfo is even + initialized, this will lead to a crash. + + Simply check for ConnectionInfo prior to update it to avoid the crash. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337 + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit 6a6bbc3b756706bdade01434f1ee8d8cbe7dd854 +Author: Olivier Fourdan +Date: Thu May 12 14:51:51 2016 +0200 + + xwayland: Restore wl_display_roundtrip() in InitInput + + This partially revert commit 984be78 + + The rountrip in Xwayland's InitInput() is unlikely the culprit for the + crash reported in bug 95337, even though it's triggered from + InitInput(). + + Startup goes like this: + + xwl_screen_init() + xwl_output_create() + wl_display_roundtrip() + InitInput() + wl_display_roundtrip() + ConnectionInfo initialized + + What happens in bug 95337 is that some output data is already available + when we reach InitInput()'s wl_display_roundtrip() and therefore we end + up trying to update the ConnectionInfo's data from RR routines before + ConnectionInfo is actually initialized. + + Removing the wl_display_roundtrip() from InitInput() will not fix the + issue (although it would make it less lileky to happen), because + xwl_screen_init() also does a wl_display_roundtrip() after creating the + output, so the race that led to bug 95337 remains. + + However, re-setting the xwl_screen->expecting_event to 0 again in + InitInput() still doesn't seem right. so this part is not restored + (thus a partial revert). + + Signed-off-by: Olivier Fourdan + Reviewed-by: Adam Jackson + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337 + +commit 6cb34816afa95d9214199c363f9b4bb5ecbae77b +Author: Adam Jackson +Date: Fri Apr 29 14:22:52 2016 -0400 + + xace: Remove the audit hooks and tune dispatch + + There are no in-tree consumers of the audit hooks, and they are in any + case redundant with the dtrace dispatch hooks. Neither is there any + in-tree user of the core request dispatch hook. The extension hook is + only used for non-default security cases, but in the absence of LTO we + always have to take the function call into XaceHookDispatch to find out + that there's no callback registered. + + Cc: Eamon Walsh + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit da9fec4eddd554b4b709ba58b4436aef5a76cd51 +Author: Eric Biggers +Date: Thu Jun 9 19:45:15 2016 -0500 + + Allow ConstantDeceleration < 1.0 + + As documented in xorg.conf(5), a value of ConstantDeceleration between 0 + and 1 will speed up the pointer. However, values less than 1 actually + had no effect. Fix this. + + Note that this bug only affected "ConstantDeceleration" as configured + through xorg.conf, not "Device Accel Constant Deceleration" as configured + through xinput. The property handler AccelSetDecelProperty() also did + not need to be changed, as it did not limit the values of the property. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92766 + + Signed-off-by: Eric Biggers + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 7cf80b9714864c3c4eb9898ff1b7d657ecd16df7 +Author: Adam Jackson +Date: Wed Jun 1 14:27:23 2016 -0400 + + xfree86: Don't swallow ±iglx command line flag + + We want to notice that it's set, but still pass it through to dix. + Return 0 to indicate this. + + Signed-off-by: Adam Jackson + Reviewed-by: Peter Hutterer + +commit 4653793de3860f2d83a39919af348527bc719794 +Author: Olivier Fourdan +Date: Wed Jun 8 17:10:11 2016 +0200 + + wayland: Remove unused field in xwl_screen + + Can't find any reference of pointer_limbo_window in the code, let's + remove it. + + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit c69bd15e00aea2610834d05f63777f9bf20eca34 +Author: Peter Hutterer +Date: Wed Jun 1 14:38:54 2016 +1000 + + Allow compile-time selection of a fallback input driver + + A new --with-fallback-input-driver=foo option allows selecting a + fallback driver for the server if the driver configured for the device + is not found. Note that this only applies when the device has a driver + assigned and that module fails to load, devices without a driver are + ignored as usual. + + This avoids the situation where a configuration assigns e.g. the + synaptics driver but that driver is not available on the system, + resulting in a dead device. A fallback driver can at least provides some + functionality. + + This becomes more important as we move towards making other driver true + leaf nodes that can be installed/uninstalled as requested. Specifically, + wacom and synaptics, a config that assigns either driver should be + viable even when the driver itself is not (yet) installed on the system. + + It is up to the distributions to make sure that the fallback driver is + always installed. The fallback driver can be disabled with + --without-fallback-input-driver and is disabled by default on non-Linux + systems because we don't have generic drivers on those platforms. + Default driver on Linux is libinput, evdev is the only other serious + candidate here. + + Sample log output: + [ 3274.421] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event4) + [ 3274.421] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad weird driver" + [ 3274.421] (II) LoadModule: "banana" + [ 3274.422] (WW) Warning, couldn't open module banana + [ 3274.422] (II) UnloadModule: "banana" + [ 3274.422] (II) Unloading banana + [ 3274.422] (EE) Failed to load module "banana" (module does not exist, 0) + [ 3274.422] (EE) No input driver matching `banana' + [ 3274.422] (II) Falling back to input driver `libinput' + .. server proceeds to assign libinput, init the device, world peace and rainbows + everywhere, truly what a sight. Shame about the banana though. + + Reviewed-by: Adam Jackson + Signed-off-by: Peter Hutterer + +commit a6b6e8ba026acedef6336b17adf06aebddd5f22f +Author: Dave Airlie +Date: Fri May 6 10:46:14 2016 +1000 + + prime: clean up slave bo properly. (v3) + + This is an ABI break, in that we now pass NULL to a function that hasn't + accepted it before. + + Alex Goins had a different patch for this but it wasn't symmetrical, it + freed something in a very different place than it allocated it, this + attempts to retain symmetry in the releasing of the backing bo. + + v2: use a new toplevel API, though it still passes NULL to something + that wasn't expecting it. + v3: pass -1 instead of 0. + + Signed-off-by: Dave Airlie + Tested-by: Hans de Goede + Reviewed-by: Hans de Goede + Reviewed-by: Alex Goins + +commit aa5390aa83be55f887e3b4f78681b4f3d3386eb5 +Author: Adam Jackson +Date: Mon May 9 14:18:32 2016 -0400 + + xfree86: Remove redundant parse of AIGLX server flag + + Not visible in the patch, but the same stanza is repeated below inside + the #ifdef GLXEXT. There's no reason to bother with checking it if we + built without GLXEXT so remove the unconditional one. + + Reviewed-by: Alan Coopersmith + Signed-off-by: Adam Jackson + +commit 166d4c817897f5aa197f639bf06b5b3e04994496 Author: Michel Dänzer Date: Fri Jun 3 10:25:20 2016 +0900 @@ -379,9 +8178,8 @@ Date: Fri Jun 3 10:25:20 2016 +0900 Signed-off-by: Michel Dänzer Reviewed-by: Pekka Paalanen - (cherry picked from commit 166d4c817897f5aa197f639bf06b5b3e04994496) -commit e4bf0e5ad5503c9a1d08080bca0b826ac64bd389 +commit d798b8318adf298bc23166e74f31e49805f0d881 Author: Michel Dänzer Date: Fri Jun 3 10:25:19 2016 +0900 @@ -394,9 +8192,285 @@ Date: Fri Jun 3 10:25:19 2016 +0900 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96344 Reviewed-by: Adam Jackson Signed-off-by: Michel Dänzer - (cherry picked from commit d798b8318adf298bc23166e74f31e49805f0d881) -commit e02d2174570e42800c21a2205f83dd286881469f +commit 5bcdd1cc753d8e60c249eeacba695653af1a39d8 +Author: Adam Jackson +Date: Tue Jun 7 15:52:15 2016 -0400 + + dix: Update some comments to reflect the new non-SIGIO input model + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 48a9b29b0a09b865492d60e8a7cd2a94864fbb3f +Author: Adam Jackson +Date: Tue Jun 7 15:52:14 2016 -0400 + + xfree86: Undocument UseSIGIO in xorg.conf + + The doc text is wrong at this point, input processing isn't going to + vary based on this, so we shouldn't say it does. The only thing this + _does_ get used for is DRI1 SwapBuffers (on everything but savage), and + if you disable it you're not going to get DRI1 at all, so we really + shouldn't even mention it. + + Still, leave the option wired up to the parser so we don't break any + DRI1-driver-using setup relying on it being disabled, and so we don't + complain about unused options elsewhere. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 2725dd024de33e96555cbf6ff28184a64d515c3c +Author: Adam Jackson +Date: Tue Jun 7 15:52:13 2016 -0400 + + dri1: Hide the SIGIO details from drivers + + Not being used, and not likely to be useful. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 95ce2bccdcdc88355262674a636c342c946914da +Author: Adam Jackson +Date: Tue Jun 7 15:52:12 2016 -0400 + + dmx: Remove SIGIO input support here too + + This code was broken anyway. Note that DEVICE_OFF would make dmx think + _no_ devices were using SIGIO anymore, which means 'xinput disable' on + your mouse would probably do weird things to your keyboard too. Rather + than try to repair that and keep SIGIO working on this one niche DDX, + just rip it out and use the thread model like everyone else. + + Signed-off-by: Adam Jackson + Acked-by: Keith Packard + +commit 6178b1c91cfc9e860914acc6f0be2f2d2e07a124 +Author: Adam Jackson +Date: Tue Jun 7 15:52:11 2016 -0400 + + dix: Use OsSignal() not signal() + + As the man page for the latter states: + + The effects of signal() in a multithreaded process are unspecified. + + We already have an interface to call sigaction() instead, use it. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 8174daa6bd3f0c792425a5ebef63a6a9ce7d00a4 +Author: Keith Packard +Date: Sun Jun 5 12:32:19 2016 -0700 + + os: Do timers under input lock, not blocked signals + + Timer processing can happen on either the main thread or the input + thread. As a result, it must be done under the input lock. + + Signals are unrelated to timers now that SIGIO isn't used for input + processing, so stop blocking signals while processing timers. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 88e981e7088198fabea6c322c58f371d91578b6a +Author: Olivier Fourdan +Date: Wed Mar 9 10:33:50 2016 +0100 + + xwayland: sync event queue to check compositor reply + + Read and dispatch pending Wayland events to make sure we do not miss a + possible reply from the compositor prior to discard a key repeat. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + +commit 26ad25a0ed1d99f3cacb711793c830cb5249580e +Author: Olivier Fourdan +Date: Wed Mar 9 11:17:27 2016 +0100 + + xwayland: refactor Wayland event handling + + To be able to reuse some code. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + +commit 239705a6feefaddf90be9541a054ebd8c8c10d81 +Author: Olivier Fourdan +Date: Wed Mar 9 10:31:58 2016 +0100 + + xwayland: add a server sync before repeating keys + + Key repeat is handled by the X server, but input events need to be + processed and forwarded by the Wayland compositor first. + + Make sure the Wayland compositor is actually processing events, to + avoid repeating keys in Xwayland while the Wayland compositor cannot + deal with input events for whatever reason, thus not dispatching key + release events, leading to repeated keys while the user has already + released the key. + + Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=762618 + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + +commit fda5675f9d257d583ea0683adf863c5e1e51e30c +Author: Olivier Fourdan +Date: Wed Mar 9 10:31:13 2016 +0100 + + xkb: add hook to allow/deny AccessX key repeat + + The xserver generates the key repeat by itself. + + But when used with another server processing inputs first (e.g. a + Wayland compositor), the other server may be busy dealing with some + other things and not queue up key release events in time. + + Add a vfunc in XkbSrvInfo to possibly add a check before re-emitting a + keypress event in the AccessX timer handler, so that the key repeat has + a chance to be denied if the server processing the input is not ready. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + +commit 3735ab965a4642273d070840bda4e827991e5219 +Merge: 7c77c42fe8 43dbc556f3 +Author: Keith Packard +Date: Thu Jun 2 07:47:16 2016 -0700 + + Merge remote-tracking branch 'daenzer/for-master' + +commit 7c77c42fe87316e5c68611f03b0bda96656c4a4c +Author: Keith Packard +Date: Fri May 27 17:36:57 2016 -0700 + + dix: Don't update current time in the middle of input event processing + + In patch 137ac094e7ab8c871f3b36e40ad826ac797f0e26, Adam moved an + expensive call to UpdateCurrentTime out of the main dispatch + loop. That's a good change as the original fix from Chase was a bit + expensive. However, it breaks grab processing and so a couple of the + calls to UpdateCurrenTime need to be removed. + + Input event processing can generate a stream of events; a button press + that activates a grab will send a press followed by a sequence of + enter/leave events. All of these should have the same time stamp on + the wire as they occur at the 'same' time. + + More importantly, the grab time recorded in the device is pulled from + currentTime after all of the events are delivered, so if currentTime + doesn't match the time in the device event, then future grab + modifications will fail as the time marked in the device will be + 'later' than the grab time known to the client (which is defined as + the timestamp from the activating input event). + + A bit of history here -- it used to be that currentTime was driven + *entirely* by input events; those timestamps didn't even have to be + related to the system time in any way. Then we started doing ICCCM + stuff and people got confused when PropertyNotify events would have + the same timestamp even when delivered minutes apart because no input + events were delivered. + + We added code in the server to go update the time, but only if no + input events were pending (so that the clock "wouldn't" go + backwards). The only places where this is necessary is in request + processing which may generate an event with a timestamp, and there + only at the very top of the request processing code so that the whole + request would be processed at the 'same time', just like events. + + cc: Chase Douglas + cc: Peter Hutterer + cc: Adam Jackson + Signed-off-by: Keith Packard + Tested-by: Michel Dänzer + Acked-by: Peter Hutterer + +commit ce6546337487c052b5dd3c04d3d8d4b09d691c3d +Author: Keith Packard +Date: Tue May 31 09:38:17 2016 -0700 + + os: Initialize NotifyFds earlier in startup + + If the server calls AbortServer during the first-time initialization + (which can happen if you start the server on an already using + DISPLAY), then the dbus code will shut down and call the notify fd + interface. If the notify fd list hasn't been initialized, the server + will crash. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit f0756793e4c30278164d7a5cc483ce6a311c58dc +Author: Keith Packard +Date: Tue May 31 09:14:17 2016 -0700 + + os: Lock input while messing with input device list + + The list of input devices may be changed by hotplugging while the + server is active, and those changes may come from either the main + thread or the input thread. That means the list of input devices needs + to be protected by a mutex. + + This prevents input drivers from receiving I/O ready callbacks after + removing a device. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit a779fda224bee0c4d27636503367e55ae93b33c2 +Author: Jonas Ådahl +Date: Tue May 24 18:46:42 2016 +0800 + + xwayland: Use the CLOCK_MONOTONIC clock + + By default the X server will try CLOCK_MONOTONIC_COARSE before + CLOCK_MONOTONIC, while A Wayland compositor may only support getting + their timestamps from the CLOCK_MONOTONIC clock. This causes various + issues since it may happen that a timestamp from CLOCK_MONOTONIC + retrieved before a sending an X request will still be "later" than the + timestamp the X server than gets after receiving the request, due to the + fact that CLOCK_MONOTONIC_COARSE has a lower resolution. + + To avoid these issues, make Xwayland always use CLOCK_MONOTONIC, so + that it becomes possible for Wayland compositor only supporting + CLOCK_MONOTONIC and X server to use the same clock. + + Signed-off-by: Jonas Ådahl + Acked-by: Daniel Stone + Tested-by: Olivier Fourdan + Signed-off-by: Peter Hutterer + +commit 43dbc556f3a4d743b9121d6cfc21961be4a9da56 +Author: Michel Dänzer +Date: Thu Dec 24 16:43:44 2015 +0900 + + xfree86/modes: Remove xf86_reload_cursors v2 + + No longer needed now that xf86CursorResetCursor is getting called for + each CRTC configuration change. + + v2: Keep xf86_reload_cursors as a deprecated empty inline function + until all drivers stop calling it. (Adam Jackson) + + Reviewed-by: Adam Jackson + +commit e156c0ccb530897d3a428255bd5585f7ea7b9b41 +Author: Michel Dänzer +Date: Wed Mar 30 18:23:04 2016 +0900 + + os: Use strtok instead of xstrtokenize in ComputeLocalClient + + Fixes leaking the memory pointed to by the members of the array returned + by xstrtokenize. + + Reviewed-by: Adam Jackson + +commit 5ff75da317539e87cca429185d710d0eeb9d9222 Author: Michel Dänzer Date: Thu May 26 19:01:59 2016 +0900 @@ -410,9 +8484,138 @@ Date: Thu May 26 19:01:59 2016 +0900 This fixes rendercheck regressions from the commit above. Reviewed-by: Keith Packard - (cherry picked from commit 5ff75da317539e87cca429185d710d0eeb9d9222) -commit f5b224a0e20f1d44d4ab1aeeddbb4e2d40dec998 +commit 84e0d5d63c393fc36e91433cd7897e776e82528c +Author: Michel Dänzer +Date: Fri May 27 16:58:19 2016 +0900 + + xfree86/modes: Assign xf86_config->cursor in xf86_load_cursor_image v2 + + Fixes a crash on startup in the radeon driver's drmmode_show_cursor() + due to xf86_config->cursor == NULL, because no CRTC was enabled yet, so + xf86_crtc_load_cursor_image was never called. + + (Also use scrn->pScreen instead of xf86ScrnToScreen(scrn)) + + v2: Set xf86_config->cursor at the beginning of xf86_load_cursor_image + instead of at the end. + + Reviewed-by: Keith Packard + +commit 28b2c880a9dbfd91e82397a0f22482d258a8b670 +Author: Keith Packard +Date: Sun May 29 19:11:50 2016 -0700 + + xfree86: Provide xf86BlockSIGIO and xf86ReleaseSIGIO as wrappers for input mutex + + Threaded input doesn't use SIGIO anymore, but existing drivers using + xf86BlockSIGIO and xf86ReleaseSIGIO probably want to lock the input + mutex during those operations. Provide inline functions to do this + which are marked as 'deprecated' so that drivers will get warnings + until they are changed. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 2bed654be7001407ae65f7128440340fd3c1f083 +Author: Keith Packard +Date: Sun May 29 19:05:13 2016 -0700 + + dix: Remove bogus input_mutex and input_mutex_count definitions from globals.c + + These are local to inputthread.c; the ones in globals.c aren't + declared in any header file. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 06bdc3bc1aeca2635d0f711ac7eef34796e28339 +Author: Keith Packard +Date: Sun May 29 01:14:59 2016 -0700 + + os: fix input_mutex_count off-by-one in input_force_unlock + + input_force_unlock was mis-using input_mutex_lock and leaving it set + to -1. As this is executed from OsInit at each server generation, on + the second time through, the mutex would be left locked (!) due to the + trylock call. This caused input to fail after the first server reset. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit de3620065945f199a203afb831cac99bb8bff75b +Author: Keith Packard +Date: Fri May 27 17:51:01 2016 -0700 + + xfree86: Remove event reading code from xf86Wakeup + + Oops. This didn't get removed when xfree86 was converted over to use + the input thread. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit c9703007ea77a8aa5aba4e7bc7367814526056fe +Author: Keith Packard +Date: Sat May 28 10:34:07 2016 -0700 + + Add ax_pthread.m4 to m4/ + + Threaded input requires AX_PTHREAD, which is provided by this file. + + Signed-off-by: Keith Packard + Acked-by: Peter Hutterer + +commit c07b796b47ae7f5a616d5e8e02ab0f84dc438a93 +Author: Keith Packard +Date: Sun May 29 18:38:18 2016 -0700 + + xfree86: Bump ABI versions + + threaded input can affect drivers that use OsBlockSIGIO when dealing + with cursors. + + Signed-off-by: Keith Packard + Requested-by: Peter Hutterer + +commit 24e4c6db25aef7a057f3f384f1e2ce67e66fa40e +Author: Keith Packard +Date: Sun May 29 18:43:00 2016 -0700 + + test: Actually verify that two equivalent touch points are the same + + I typo'd when fixing this at Peter's request and left off the '2' from + the second variable name. + + Signed-off-by: Keith Packard + +commit 1338bfa81c6eddc66f07c15225c3feff062182ce +Author: Keith Packard +Date: Fri May 27 01:56:39 2016 -0700 + + test: Make touch test reflect new ability to realloc touch array [v2] + + Threaded input allows the input code to call malloc while processing + events. In this case, that's in the middle of processing touch events + and needing to resize the touch buffer. + + This test was expecting the old behaviour where touch points would get + dropped if the buffer was full. The fix is to check for the new + behaviour instead. + + [v2] + + * make sure two finding two equivalent touches return the same touch + object + + * check to make sure the queue resizes by the expected amount + + Changes provided by Peter Hutterer + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 8b9b4387e8473810f6174519ee76818fcaae725d Author: Keith Packard Date: Fri May 27 10:55:02 2016 -0700 @@ -428,9 +8631,222 @@ Date: Fri May 27 10:55:02 2016 -0700 Signed-off-by: Keith Packard Reviewed-by: Alex Deucher - (cherry picked from commit 8b9b4387e8473810f6174519ee76818fcaae725d) -commit fad7cab684199b7a0e721e59bb25b1eb6f1a9aa8 +commit 0d16a0c3b95d4ac446a07d8b95e634de5cb8055f +Author: Keith Packard +Date: Thu May 26 10:22:17 2016 -0700 + + os: Increase default client buffer to 16kB + + This matches a change made in xcb and improves performance for a small + increase in memory usage. + + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + +commit 714736124f2bfba9ede076eff3bf017f986ce6c4 +Author: Keith Packard +Date: Fri May 27 02:02:48 2016 -0700 + + modesetting: Use new xf86CurrentCursor API + + Use this instead of the (now deprecated) cursor pointer in the + xf86CrtcConfigRec. + + Signed-off-by: Keith Packard + Reviewed-by: Michel Dänzer + +commit e69061e605c66084056cf2064dcc5d4c6c8aa0cf +Author: Keith Packard +Date: Tue Dec 8 14:26:50 2015 -0800 + + kdrive: Use threaded input + + Signed-off-by: Keith Packard + Acked-by: Peter Hutterer + +commit a977c9c4d07a04c0c7b3713a21eefb92a8d3005b +Author: Keith Packard +Date: Tue Dec 8 14:53:08 2015 -0800 + + xfree86: Use threaded input mechanism [v2] + + Switch the XFree86 DDX over to threaded input + + v2: Rewrite comment in xf86Helper about silken mouse + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit f84703b50cc908a127f4ad923ebbf56f8f244c0d +Author: Keith Packard +Date: Tue Dec 8 14:20:21 2015 -0800 + + dix: Reallocate touchpoint buffer at input event time [v2] + + Now that input is threaded, malloc can be used at event time to resize + the touchpoint buffer as needed.x + + v2: Remove "Need to grow the queue means dropping events." + from comment as it no longer applies. (Peter Hutterer) + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit e2df803fcabd7c2d2fc7991c794856378dcb5489 +Author: Keith Packard +Date: Tue Dec 8 19:53:36 2015 -0800 + + mi: Grow event queue while reading events + + Now that events are read at normal process time, we can use malloc to + grow the event queue instead of discarding events. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 30ac7567980a1eb79d084a63e0e74e1d9a3af673 +Author: Keith Packard +Date: Tue Dec 8 11:37:51 2015 -0800 + + Create a threaded mechanism for input [v7] + + The current SIGIO signal handler method, used at generation of input events, + has a bunch of oddities. This patch introduces an alternative way using a + thread, which is used to select() all input device file descriptors. + + A mutex was used to control the access to input structures by the main and input + threads. Two pipes to emit alert events (such hotplug ones) and guarantee the + proper communication between them was also used. + + Co-authored-by: Fernando Carrijo + Signed-off-by: Tiago Vignatti + + v2: Fix non-Xorg link. Enable where supported by default. + + This also splits out the actual enabling of input threads to + DDX-specific patches which follow + + v3: Make the input lock recursive + + v4: Use regular RECURSIVE_MUTEXes instead of rolling our own + Respect the --disable-input-thread configuration option by + providing stubs that expose the same API/ABI. + + Respond to style comments from Peter Hutterer. + + v5: use __func__ in inputthread debug and error mesages. + + Respond to style comments from Peter Hutterer. + + v6: use AX_PTHREAD instead of inlining pthread tests. + + Suggested by Emil Velikov + + v7: Use pthread_sigmask instead of sigprocmask when using threads + + Suggested by Adam Jackson + + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 728c9570a05f03bd90343ff6f5b1a8fd3988864c +Author: Keith Packard +Date: Wed Dec 9 14:27:05 2015 -0800 + + xkb: Hold input lock across injected key event processing + + This makes the code more consistent with other versions of + out-of-queue event processing + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 05d549d60440126105d5a70272e72ea2319724bd +Author: Keith Packard +Date: Thu Dec 17 22:21:46 2015 -0800 + + xfree86: Remove unnecessary errno save/restore in xf86ReadInput + + When this code was called from SIGIO, saving and restoring errno could + possibly have made sense in some strange environment. Now that this + will not be called from a signal handler, there is no reason to do that. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 0bbb5aabf794720fa99ae5ea3f55138ded159705 +Author: Keith Packard +Date: Mon May 16 21:33:41 2016 -0500 + + kdrive: Don't lock input across read in KdNotifyFd + + We won't need these locks with the new threaded input code as it holds + the input lock across all of the input device I/O operations. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 6a5a4e60373c1386b311b2a8bb666c32d68a9d99 +Author: Keith Packard +Date: Tue Dec 8 14:39:46 2015 -0800 + + Remove SIGIO support for input [v5] + + This removes all of the SIGIO handling support used for input + throughout the X server, preparing the way for using threads for input + handling instead. + + Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls + to stub functions input_lock/input_unlock so that we don't lose this + information. + + xfree86 SIGIO support is reworked to use internal versions of + OsBlockSIGIO and OsReleaseSIGIO. + + v2: Don't change locking order (Peter Hutterer) + v3: Comment weird && FALSE in xf86Helper.c + Leave errno save/restore in xf86ReadInput + Squash with stub adding patch (Peter Hutterer) + v4: Leave UseSIGIO config parameter so that + existing config files don't break (Peter Hutterer) + v5: Split a couple of independent patch bits out + of kinput.c (Peter Hutterer) + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 8cf832c288dec13cbf3c25478a8ccef52d61f3db +Author: Keith Packard +Date: Mon May 16 21:28:48 2016 -0500 + + kdrive: Remove unneeded AddEnabledDevice/RemoveEnabledDevice calls + + kdrive uses the NotifyFd interface, which handles all of the necessary + fd configuration in the OS layer. Having it also use the old + EnableDevice interfaces is incorrect. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 4fca18dc03669bada75175df289fbee41275208e +Author: Adam Jackson +Date: Mon May 9 13:28:08 2016 -0400 + + xfree86: Add IndirectGLX server flag (v2) + + Not all display managers make it easy (or possible) to modify the + command line flags passed to the server, so add a way to get to it from + xorg.conf. + + v2: Fix the FlagOptions list to not have IGLX after the terminator (Alan + Coopersmith) + + Reviewed-by: Alan Coopersmith + Signed-off-by: Adam Jackson + +commit 181a4bd0cc436f89582408196038ff37032f9bac Author: Keith Packard Date: Fri May 13 16:19:38 2016 -0700 @@ -455,11 +8871,11 @@ Date: Fri May 13 16:19:38 2016 -0700 This fixes incorrect rendering in firefox for this page: - https://gfycat.com/HoarseCheapAmericankestrel + https://gfycat.com/HoarseCheapAmericankestrel while not breaking rendering for this page: - https://feedly.com + https://feedly.com v2: Add change accidentally left in patch for missing glDisable(GL_COLOR_LOGIC_OP). @@ -468,9 +8884,8 @@ Date: Fri May 13 16:19:38 2016 -0700 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63397 Signed-off-by: Keith Packard Tested-by: Michel Dänzer - (cherry picked from commit 181a4bd0cc436f89582408196038ff37032f9bac) -commit 0c9a6d4093d6cdfadecb9a703cfb090e43ccf6aa +commit b07bc700b3cf2f5c8912fc5b9e0dad2baf395525 Author: Keith Packard Date: Sat May 14 08:22:17 2016 -0700 @@ -480,9 +8895,8 @@ Date: Sat May 14 08:22:17 2016 -0700 Signed-off-by: Keith Packard Reviewed-by: Michel Dänzer - (cherry picked from commit b07bc700b3cf2f5c8912fc5b9e0dad2baf395525) -commit e63e9b8f197889b6c162ba36988d6e5656cb0c10 +commit 743b6f231e999d8b2909228412266dc13cc433c5 Author: Keith Packard Date: Fri May 13 04:25:43 2016 -0700 @@ -502,9 +8916,33 @@ Date: Fri May 13 04:25:43 2016 -0700 Signed-off-by: Keith Packard Reviewed-by: Michel Dänzer - (cherry picked from commit 743b6f231e999d8b2909228412266dc13cc433c5) -commit d37329cba42fa8e72fe4be8a7be18e512268b5bd +commit f5670b4a7eb3b43fa20017f89192394930eae6f4 +Author: Keith Packard +Date: Wed Mar 9 11:13:14 2016 -0800 + + xfree86: Set xf86CrtcConfigRec cursor pointer to NULL in HideCursor + + This makes the cursor pointer held by xf86Cursors.c get reset to NULL + whenever the cursor isn't displayed, and means that the reference + count held in xf86Cursor.c is sufficient to cover the reference in + xf86Cursors.c. + + As HideCursor may be called in the cursor loading path after + UseHWCursor or UseHWCursorARGB when HARDWARE_CURSOR_UPDATE_UNHIDDEN + isn't set in the Flags field, the setting of the cursor pointer had to + be moved to the LoadCursor paths. + + LoadCursorARGBCheck gets the cursor pointer, but LoadCursorImageCheck + does not. For LoadCursorImageCheck, I added a new function, + xf86CurrentCursor, which returns the current cursor. With this new + function, we can eliminate the cursor pointer from the + xf86CrtcConfigRec, once drivers are converted over to use it. + + Signed-off-by: Keith Packard + Acked-by: Peter Hutterer + +commit b64108fa305e956e4edaae9d53071ff0abee268e Author: Michel Dänzer Date: Wed May 25 19:09:23 2016 +0900 @@ -517,9 +8955,8 @@ Date: Wed May 25 19:09:23 2016 +0900 Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher - (cherry picked from commit b64108fa305e956e4edaae9d53071ff0abee268e) -commit 009304ef129f21b286086f3c841b60c5f865241a +commit 4711ebc174206b5a50e6ae8a7f974cd835e4ebd3 Author: Michel Dänzer Date: Tue May 24 18:12:42 2016 +0900 @@ -538,9 +8975,67 @@ Date: Tue May 24 18:12:42 2016 +0900 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94514 Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher - (cherry picked from commit 4711ebc174206b5a50e6ae8a7f974cd835e4ebd3) -commit 888e5f636a32945b0a1f59d6db6e143d094cc2a0 +commit 4d649d51770cace4d7c1e51d9a199ac7a056c30a +Author: Keith Packard +Date: Wed May 18 16:03:48 2016 -0500 + + mi: Remove miPointerRec from API + + This moves the definition of miPointerRec from mipointrst.h to + mipointer.c so that it is no longer visible in the API, allowing it to + be changed while the API/ABI is frozen. + + Reviewed-by: Pekka Paalanen + Signed-off-by: Keith Packard + +commit 3f9015b6dc9e7e9c97f8717dea6af9f4d8523f2e +Author: Keith Packard +Date: Wed May 18 16:03:47 2016 -0500 + + xwayland: Move sprite invalidation logic into mipointer + + This creates a function that invalidates the current sprite and forces + a sprite image reload the next time the sprite is checked, moving that + logic out of the xwayland sources and allowing the miPointerRec + structure to be removed from the server API. + + Signed-off-by: Keith Packard + Reviewed-by: Pekka Paalanen + +commit 4e124203f2260daaf54155f4a05fe469733e0b97 +Author: Adam Jackson +Date: Tue May 3 11:24:58 2016 -0400 + + damage: Make damageRegionProcessPending take a damage not a drawable + + In the case where there's no damage monitor on the drawable, we look + that fact up twice: once before rendering to decide whether to compute + damage, and again after to decide whether to append it. This is wasted + effort, as the layer below us is effectively not allowed to change + whether there's a damage monitor for the drawable, but there's no way + the compiler can know that. + + Instead, look it up once up front, and change the check macros and + damageRegionProcessPending to take a damage not a drawable. + + v2: Explicitly pass pDamage to the macros as well (Michel Dänzer) + + Signed-off-by: Adam Jackson + Reviewed-by: Michel Dänzer + +commit 1bb932bf1417ff319a594d7e40f6813a26936784 +Author: Jeremy Huddleston Sequoia +Date: Sat May 7 00:43:33 2016 -0700 + + XQuartz: Fix default CFBundleVersion + + m4/shell variable name collision broke the case when the configure + option was not used + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 2fbf5c2f91d33efbda573c4be036248b1d8ed7f1 Author: Andrew Comminos Date: Tue Dec 29 23:41:27 2015 -0800 @@ -555,9 +9050,86 @@ Date: Tue Dec 29 23:41:27 2015 -0800 Signed-off-by: Andrew Comminos Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 2fbf5c2f91d33efbda573c4be036248b1d8ed7f1) -commit 81bd4fc18c407ebe8e535ffbe83b7578261e1643 +commit 984be789d5935bc7f695dc61234ef0251ed33679 +Author: Olivier Fourdan +Date: Wed May 11 09:15:19 2016 +0200 + + xwayland: don't check events as early as InitInput + + If data is received during XWayland startup, it will be read early in + InitInput() before the connection data is initialized, causing a crash. + + Remove the wayland rountrips from InitInput() as this is done again in + xwl_screen_init() where it seems more appropriate. + + Signed-off-by: Olivier Fourdan + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337 + Reviewed-by: Adam Jackson + +commit 3f569435e10df515c6f86289dc986bfc59c6bc18 +Author: Adam Jackson +Date: Thu Mar 31 16:56:44 2016 -0400 + + glx: Stop tracking hasUnflushedCommands + + This is only meaningful for indirect contexts, and all it does is + (maybe) prevent a flush when switching away from an indirect context. + Indirect contexts aren't worth optimizing for, and Mesa tracks whether + a flush is needed anyway. + + Careful readers will note that ReadPixels would reset the flag even + though it doesn't imply a flush! + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 0ebb58f6b6f66afbc3a48bd10693fe190aed8694 +Author: Adam Jackson +Date: Thu Mar 31 16:20:40 2016 -0400 + + glx: Remove some redundant zero-init of GLX context state + + The context is already calloc'd. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit d5ba09598210063926aeff55ac58d2b7020d9a03 +Author: Adam Jackson +Date: Thu Mar 31 15:51:39 2016 -0400 + + glx/dri2: Implement dri2FlushFrontBuffer explicitly + + No functional change. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 0ba4e251a1012bd5a2eab83e2c51006ec3805394 +Author: Adam Jackson +Date: Thu Mar 31 15:50:34 2016 -0400 + + glx: Code motion + + No functional change, just rearranging some code to make later commits + more obvious. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit f523ebb5492a2e12b76a8b5b7f1b0e5efd4a8040 +Author: Adam Jackson +Date: Mon Apr 18 12:56:17 2016 -0400 + + dix: Remove pointless client-state callbacks + + Private storage is pre-zeroed by the private system itself. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 140c2f1a54dbc2503311e9a011e841aa1f277cbd Author: Michel Dänzer Date: Fri Apr 1 18:24:00 2016 +0900 @@ -568,180 +9140,62 @@ Date: Fri Apr 1 18:24:00 2016 +0900 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94775 Signed-off-by: Michel Dänzer Reviewed-by: Uli Schlachter - (cherry picked from commit 140c2f1a54dbc2503311e9a011e841aa1f277cbd) -commit e849aecb65aabe2fc6abeab6e0ab0a721710c25c -Author: Andreas Schwab -Date: Thu Apr 28 14:47:33 2016 +0200 - - x86emu: Change include order to avoid conflict with system header - - R_SP is also defined in on m68k. Also remove duplicate - definitions. - - Reviewed-by: Adam Jackson - Signed-off-by: Andreas Schwab - (cherry picked from commit 23dfa017298ceceac818f83779858e490c7757b6) - -commit 0f947779c7afcdaf246849b627c13a11987a4bbf +commit 7f0494671f95cfa33f6f2c7c74b20a21f239f8c5 Author: Dave Airlie -Date: Fri Mar 11 09:22:00 2016 +1000 +Date: Fri May 6 05:41:58 2016 +1000 - glamor: add glamor_finish API + modesetting: fix build with glamor disabled. - Some drivers are calling glFinish, they really should be doing this. + Fix build without --enable-glamor. - This also is needed for some reverse prime scenarios. + Caught by the arm tinderbox. Signed-off-by: Dave Airlie - Reviewed-by: Michel Dänzer - Reviewed-by: Eric Anholt - (cherry picked from commit aa4e757130010dd3202f10ec6cb0c306c1dbcfbc) - -commit d25bb3ae9de1661ed0988a44119abeb52d52d4b7 -Author: Marek Chalupa -Date: Mon Apr 25 11:33:00 2016 +0200 - - xwayland-shm: fortify fallocate against EINTR - - If posix_fallocate or ftruncate is interrupted by signal while working, - we return -1 as fd and the allocation process returns BadAlloc error. - That causes xwayland clients to abort with 'BadAlloc (insufficient - resources for operation)' even when there's a lot of resources - available. - - Fix it by trying again when we get EINTR. - - Signed-off-by: Marek Chalupa - Reviewed-by: Pekka Paalanen - (cherry picked from commit f48b0534f110397246809d279225afedb28aa233) - -commit acbfff1d3b27bb71faf2fe95061de8414b536004 -Author: Alexandre Courbot -Date: Wed Mar 23 13:47:37 2016 +0900 - - configure.ac: Keep environment CFLAGS when testing - - DRI2 detection could fail if configure is invoked with a sysroot passed - as CFLAGS. Ideally configure should invoke gcc with the sysroot argument - passed to the configure script, but for some reason this is not done by - AC_COMPILE_IFELSE. - - Fix this by ensuring CFLAGS are preserved when checking for stuff. - - Signed-off-by: Alexandre Courbot - Reviewed-by: Emil Velikov - (cherry picked from commit 4cc32880737c2d3e568fdb4867b2dba10fb3998a) - -commit 1c811298eb953bb56e2ca05b1a881f88c0703df3 -Author: Simon Thum -Date: Tue Apr 5 14:29:47 2016 +0200 - - dix/ptraccel: Fix memory leak in InitPredictableAccelerationScheme - - This was quite unlikely except in situations where a proper startup - would have been impossible anyway, but since automated checks don't - grade likelyhood just fix it. - - Detected by Jeremy Huddleston's clang checks. - - Signed-off-by: Simon Thum - Reviewed-by: Peter Hutterer + Reviewed-by: Mark Kettenis + Tested-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit c8e5fc30575a309c25970fc68b9184c07bb74df4) -commit 51441379a35077e868dae86e6b24cfa31d6dd1f8 -Author: Olivier Fourdan -Date: Thu Mar 17 09:53:58 2016 +0100 +commit 66fdeb880aac0966be9aa41219047ade0148c35f +Author: Emil Velikov +Date: Mon May 2 23:47:22 2016 +0100 - glamor: fix wrong offset on composite rectangles + xfree86: drop unneeded strdup for modulepath/logfile - When using PictOpSrc, the destination is wrongly shifted back to (0, 0). + The destination variable is never freed, thus we even plug some memory + leaks. + + v2: Rebase against updated xf86CheckPrivs() helper. - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94568 Reviewed-by: Adam Jackson - Signed-off-by: Olivier Fourdan - (cherry picked from commit 8437955515ad59b0bfcd6598248e7f0ffc706370) + Signed-off-by: Emil Velikov -commit 713a21cc702561931ed5e84c3a5c3d7e7c580725 -Author: Hans de Goede -Date: Tue Jun 14 11:58:01 2016 +0200 +commit 032b1d79b7d04d47814a5b3a9fdd162249fea74c +Author: Emil Velikov +Date: Mon May 2 23:47:21 2016 +0100 - modesetting: Load on GPU-s with 0 outputs + xfree86: use the xf86CheckPrivs() helper for modulepath/logfile - In newer laptops with switchable graphics, the GPU may have 0 outputs, - in this case the modesetting driver should still load if the GPU is - SourceOffload capable, so that it can be used as an offload source provider. + v2: Rebase against updated xf86CheckPrivs() helper. - Signed-off-by: Hans de Goede - Reviewed-by: Eric Engestrom - (cherry picked from commit 60ad701a6a8cb9f1eacb72acfe2cb8d3b7a865dc) + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov -commit a9f970fe28d76bd2c57b44aa02ac38eb8aab8acf -Author: Hans de Goede -Date: Thu Jun 16 15:21:03 2016 +0200 +commit 0fdd47560468e7b6147c666cc6b9eebcecb68572 +Author: Emil Velikov +Date: Mon May 2 23:47:20 2016 +0100 - modesetting: Fix swapping of provider sink / source capabilities + xfree86: factor out the check priviliges and print a big warning - When a card has import capability it can be an offload _sink_, not - a source and vice versa for export capability. + Current message was quite off "file specified must be a relative path" + and alike. Just factor it out and use "path/file" as needed. - This commit fixes the modesetting driver to properly set these - capabilities, this went unnoticed sofar because most gpus have both - import and export capability. + v2: Rework error message, drop "Using default", print actual arg value. - Signed-off-by: Hans de Goede - Reviewed-by: Eric Engestrom - (cherry picked from commit 94a1c77259ce39ba59ad87615df39b570ffab435) + Reviewed-by: Adam Jackson + Signed-off-by: Emil Velikov -commit 0dc1a58b9379c79ede8c40b2e6f008dc0868a40e -Author: Lyude Paul -Date: Mon Jun 13 15:31:02 2016 -0400 - - modesetting: Clear drmmode->fb_id before unflipping - - [fix copied from 40191d82370e in xf86-video-ati] - - Without this, we end up setting rotated CRTCs back to their previous - framebuffer right after we perform a rotation. Reproducer: - - - Have two monitors connected at the same resolution - - Rotate one monitor from normal straight to inverted - - Watch as the monitor you didn't rotate either freezes or shows intense - flickering - - Signed-off-by: Lyude - Reviewed-by: Hans de Goede - Signed-off-by: Hans de Goede - (cherry picked from commit 848089e0dde38f043c85332785520946103e77c1) - -commit 619730cac614ff8306e17edd07ae860051c700b7 -Author: Hans de Goede -Date: Wed Jun 1 14:59:38 2016 +0200 - - modesetting: Properly cleanup fb for reverse-prime-offload - - drmmode_set_scanout_pixmap_gpu(pix) adds drmmod->fb_id through a call - to drmmode_xf86crtc_resize(), but on a subsequent - drmmode_set_scanout_pixmap_gpu(NULL) it would not remove the fb. - - This keeps the crtc marked as busy, which causes the dgpu to not - being able to runtime suspend, after an output attached to the dgpu - has been used once. Which causes burning through an additional 10W - of power and the laptop to run quite hot. - - This commit adds the missing remove fb call, allowing the dgpu to runtime - suspend after an external monitor has been plugged into the laptop. - - Note this also makes drmmode_set_scanout_pixmap_gpu(NULL) match the - behavior of drmmode_set_scanout_pixmap_cpu(NULL) which was already - removing the fb. - - Signed-off-by: Hans de Goede - Reviewed-by: Dave Airlie - (cherry picked from commit b8ef71fb07a8ba9587aeaca942b4de20b59266ca) - -commit 768e40e6c41dba3c7039db437d7b5be36f1477f5 +commit 2378adde6770385c06f7efcd32f270d00d49ce3f Author: Dave Airlie Date: Fri Apr 29 14:01:33 2016 +1000 @@ -753,9 +9207,8 @@ Date: Fri Apr 29 14:01:33 2016 +1000 Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie - (cherry picked from commit 2378adde6770385c06f7efcd32f270d00d49ce3f) -commit 69f9319568609f23cf313995cd65400180de9345 +commit 258588224d6b35de12f97d9092efa5cb3e426550 Author: Dave Airlie Date: Fri Apr 29 14:01:32 2016 +1000 @@ -767,9 +9220,8 @@ Date: Fri Apr 29 14:01:32 2016 +1000 Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie - (cherry picked from commit 258588224d6b35de12f97d9092efa5cb3e426550) -commit 5b4ced6d3a4c309e1792ac49017fb961a7262e7f +commit a41a171bcbae9aeafac2865faa904f15d9b59925 Author: Dave Airlie Date: Fri Apr 29 14:01:31 2016 +1000 @@ -779,9 +9231,8 @@ Date: Fri Apr 29 14:01:31 2016 +1000 Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie - (cherry picked from commit a41a171bcbae9aeafac2865faa904f15d9b59925) -commit cbbf4b0da098636e3d23407d62c3f41402c3f401 +commit fc1f61b75c9712e24ff665f95d62771f39eba1c7 Author: Dave Airlie Date: Fri Apr 29 14:01:30 2016 +1000 @@ -791,9 +9242,54 @@ Date: Fri Apr 29 14:01:30 2016 +1000 Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie - (cherry picked from commit fc1f61b75c9712e24ff665f95d62771f39eba1c7) -commit cc7c0b0e3c7f7af624c3b1bc360f7c6ff99ea3be +commit 2d0f151c6195ba94d0320b55227a108e6301a74c +Author: Alex Goins +Date: Fri Apr 29 14:01:29 2016 +1000 + + modesetting: Consistent whitespace in driver.c + + For some reason a couple of the dirty functions in driver.c used 8 + spaces per tab instead of 4 like the rest of the file. Fix this to make + it more consistent and give me more room to work in ms_dirty_update in + subsequent commits. + + v1: N/A + v2: N/A + v3: N/A + v4: Initial commit + + Signed-off-by: Alex Goins + Reviewed-by: Dave Airlie + Reviewed-by: Alex Deucher + +commit 137ac094e7ab8c871f3b36e40ad826ac797f0e26 +Author: Adam Jackson +Date: Fri Apr 1 22:44:26 2016 -0400 + + dix: Push UpdateCurrentTimeIf down out of the main loop + + This was added in: + + commit 312910b4e34215aaa50fc0c6092684d5878dc32f + Author: Chase Douglas + Date: Wed Apr 18 11:15:40 2012 -0700 + + Update currentTime in dispatch loop + + Unfortunately this is equivalent to calling GetTimeInMillis() once per + request. In the absolute best case (as on Linux) you're only hitting the + vDSO; on other platforms that's a syscall. Either way it puts a pretty + hard ceiling on request throughput. + + Instead, push the call down to the requests that need it; basically, + grab processing and event generation. + + Cc: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Adam Jackson + +commit ac164e58870d70640381e68b776eb95578c7fbd3 Author: Peter Hutterer Date: Wed May 4 20:36:18 2016 +1000 @@ -827,9 +9323,222 @@ Date: Wed May 4 20:36:18 2016 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone - (cherry picked from commit ac164e58870d70640381e68b776eb95578c7fbd3) -commit bcb633cae6c976b3416c736acab71c065adf5ee7 +commit 059d5ef30490233f410ca87084c7697b87e5b05e +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:43:06 2016 -0700 + + XQuartz: Update copyright years + + Signed-off-by: Jeremy Huddleston Sequoia + +commit d6ba4f2c52da150a9a92bdb00efe7902d17033bd +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:42:34 2016 -0700 + + XQuartz: Add --with-bundle-version and --with-bundle-version-string configure options + + Signed-off-by: Jeremy Huddleston Sequoia + +commit c1614928c10a8f8400f99acfd1b7f96d503af7ec +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:21:38 2016 -0700 + + XQuartz: Add --with-sparkle-feed-url configure option + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 299b01eabf827a7435b5d6004d50637ac710bbc7 +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:14:24 2016 -0700 + + XQuartz: Update release feed URL to use new https URL + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 16d6733c63727d910eb516d7f6950f4675281f2d +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:24:44 2016 -0700 + + XQuartz: Fix the help text for --with-bundle-id-prefix + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 214a66b661dcb56ebb9776e34049753f65c7510a +Author: Jeremy Huddleston Sequoia +Date: Tue May 3 23:16:46 2016 -0700 + + XQuartz: Remove --with-launchd-id-prefix + + It's been deprecated for years. + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 2285fe78c04714561a0d1a164a41a38c48263f89 +Author: Peter Hutterer +Date: Fri Apr 22 15:04:37 2016 +1000 + + xfree86: add support for MatchIsTabletPad + + The tablet pads have been separate kernel devices for a while now and + libwacom has labelled them with the udev ID_INPUT_TABLET_PAD for over a year + now. Add a new MatchIsTabletPad directive to apply configuration options + specifically to the Pad part of a tablet. + + Signed-off-by: Peter Hutterer + Reviewed-by: Adam Jackson + +commit fa02b05645080c285da5972262a8d37403e39d7e +Author: Dave Airlie +Date: Tue May 3 06:54:57 2016 +1000 + + modesetting: port clean start code from amdgpu. (v2) + + Both radeon and amdgpu don't set the mode until the first blockhandler, + this means everything should be rendered on the screen correctly by + then. + + This ports this code, it also removes the tail call of EnterVT from + ScreenInit, it really isn't necessary and causes us to set a dirty mode + with -modesetting always anyways. + + v2: reorder set desired modes vs block handler as done for amdgpu. + + Reviewed-by: Eric Anholt + Signed-off-by: Dave Airlie + Reviewed-by: Alex Deucher + +commit caabc4e85540dcd4225f2780b5616f7d870fbb06 +Author: Dave Airlie +Date: Tue May 3 06:54:56 2016 +1000 + + modesetting: add support for background none. + + This adds support using glamor for background None. + + loosely based off the amdgpu code. relies on the glamor_finish code. + + Acked-by: Eric Anholt + Reviewed-by: Alex Deucher + Signed-off-by: Dave Airlie + +commit c33250945b45adc447154239f0cf48fb9b2d7335 +Author: Adam Jackson +Date: Fri Apr 8 11:26:36 2016 -0400 + + kdrive: Nuke a bunch of dead code + + gcc6 says: + + keyboard.c:46:21: warning: ‘linux_to_x’ defined but not used + + Only referenced by a bunch of long if-0'd code, so chuck it all out. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit a5dd7b890f4f3a5245639591c73303c5a087b38a +Author: Adam Jackson +Date: Fri Apr 8 11:24:50 2016 -0400 + + dix: Squash some new gcc6 warnings + + -Wlogical-op now tells us: + + devices.c:1685:23: warning: logical ‘and’ of equal expressions + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 23dfa017298ceceac818f83779858e490c7757b6 +Author: Andreas Schwab +Date: Thu Apr 28 14:47:33 2016 +0200 + + x86emu: Change include order to avoid conflict with system header + + R_SP is also defined in on m68k. Also remove duplicate + definitions. + + Reviewed-by: Adam Jackson + Signed-off-by: Andreas Schwab + +commit aa4e757130010dd3202f10ec6cb0c306c1dbcfbc +Author: Dave Airlie +Date: Fri Mar 11 09:22:00 2016 +1000 + + glamor: add glamor_finish API + + Some drivers are calling glFinish, they really should be doing this. + + This also is needed for some reverse prime scenarios. + + Signed-off-by: Dave Airlie + Reviewed-by: Michel Dänzer + Reviewed-by: Eric Anholt + +commit f48b0534f110397246809d279225afedb28aa233 +Author: Marek Chalupa +Date: Mon Apr 25 11:33:00 2016 +0200 + + xwayland-shm: fortify fallocate against EINTR + + If posix_fallocate or ftruncate is interrupted by signal while working, + we return -1 as fd and the allocation process returns BadAlloc error. + That causes xwayland clients to abort with 'BadAlloc (insufficient + resources for operation)' even when there's a lot of resources + available. + + Fix it by trying again when we get EINTR. + + Signed-off-by: Marek Chalupa + Reviewed-by: Pekka Paalanen + +commit 4cc32880737c2d3e568fdb4867b2dba10fb3998a +Author: Alexandre Courbot +Date: Wed Mar 23 13:47:37 2016 +0900 + + configure.ac: Keep environment CFLAGS when testing + + DRI2 detection could fail if configure is invoked with a sysroot passed + as CFLAGS. Ideally configure should invoke gcc with the sysroot argument + passed to the configure script, but for some reason this is not done by + AC_COMPILE_IFELSE. + + Fix this by ensuring CFLAGS are preserved when checking for stuff. + + Signed-off-by: Alexandre Courbot + Reviewed-by: Emil Velikov + +commit 16e4bce9e5257c50c80c66efee0d07c2483619e1 +Author: Simon Thum +Date: Fri Apr 8 13:24:39 2016 +0200 + + dix/ptraccel: Remove float literals + + This was fine back when valuators were integer. Device + properties are float (not double), so some instances remain. + + Signed-off-by: Simon Thum + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit c8e5fc30575a309c25970fc68b9184c07bb74df4 +Author: Simon Thum +Date: Tue Apr 5 14:29:47 2016 +0200 + + dix/ptraccel: Fix memory leak in InitPredictableAccelerationScheme + + This was quite unlikely except in situations where a proper startup + would have been impossible anyway, but since automated checks don't + grade likelyhood just fix it. + + Detected by Jeremy Huddleston's clang checks. + + Signed-off-by: Simon Thum + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit f641ae412287ecb7a3437987e2ba1646a8443aa4 Author: Peter Hutterer Date: Wed Mar 9 10:45:48 2016 +1000 @@ -842,90 +9551,183 @@ Date: Wed Mar 9 10:45:48 2016 +1000 https://bugzilla.redhat.com/show_bug.cgi?id=1282252 Signed-off-by: Peter Hutterer - (cherry picked from commit f641ae412287ecb7a3437987e2ba1646a8443aa4) -commit da4c6e1aaae6f564cbde7981898582018108622e -Author: Chris Wilson -Date: Sat Feb 14 09:58:44 2015 +0000 +commit 577bebe2067293bb154068e99a2ef085b066cb67 +Author: Emil Velikov +Date: Sun Apr 17 20:30:46 2016 +0100 - present: Fix presentation of flips out of order + xfree86/parser: simplify #ifdef ladder - The flip queue currently only holds events submitted to the driver for - flipping, awaiting the completion notifier. It is short. We therefore - can speed up interrupt processing by keeping the small number of events - ready to be flipped on the end of the flip queue. By appending the - events to the flip_queue in the order that they become ready, we also - resolve one issue causing Present to display frames out of order. + Rather than 'hacking' around symbol names and providing macros such as + 'Local' just fold things and make the code more readable. - Signed-off-by: Chris Wilson - Reviewed-and-tested-by: Mario Kleiner - Signed-off-by: Hans de Goede - (cherry picked from commit bab0f450a719a11799491043b82c2f293fed27fe) + Signed-off-by: Emil Velikov + Reviewed-by: Alex Deucher -commit 1a3577259f7d3d4c91f8a6eff1a5d466dabb45ee -Author: Chris Wilson -Date: Sat Feb 14 09:58:43 2015 +0000 +commit 537276a5b86b7341169ea4eb36d479a503ba5d84 +Author: Emil Velikov +Date: Sun Apr 17 20:30:45 2016 +0100 - present: Improve scaling of vblank handler + xfree86/parser: reuse StringToToken() in xf86getToken() - With large numbers of queued vblank, the list iteration on every - interupt dominates processing time. If we reorder the list to be in - ascending event order, then not only is also likely to be in order for - notification queries (i.e. the notification will be near the start of - the list), we can also stop iterating when past the target event_id. - - Signed-off-by: Chris Wilson - Reviewed-and-tested-by: Mario Kleiner - Signed-off-by: Hans de Goede - (cherry picked from commit fbe660b7652b945bdd8e3eb0780179d83cc7de96) + Reviewed-by: Alex Deucher + Signed-off-by: Emil Velikov -commit db258a27f021c80281ed4f89df897dfda0ffce9f -Author: Maarten Lankhorst -Date: Wed Oct 2 15:47:54 2013 +0200 +commit 944ea03d5be2ffe22a3f1c4c287760261c31235f +Author: Emil Velikov +Date: Sun Apr 17 20:30:44 2016 +0100 - exa: only draw valid trapezoids + xfree86/parser: move StringToToken() definition further up - Fixes freedesktop.org bug https://bugs.freedesktop.org/show_bug.cgi?id=67484 + ... so that we can use it without the forward declaration. Plus we're + doing to reuse it in the next commit ;-) - If t->bottom is close to MIN_INT, removing top can wraparound, so do the check properly. - A similar fix should also be applied to pixman. - - Signed-off-by: Maarten Lankhorst - Reviewed-by: Hans de Goede - Signed-off-by: Hans de Goede - (cherry picked from commit c6511d0142040654140bdedd6f03d43af0abba21) + Reviewed-by: Alex Deucher + Signed-off-by: Emil Velikov -commit 62bf33d0d105beb257619ef6b77919d01b04d401 +commit b93be14b7d339e4e46d941729dad853452fae8c0 +Author: Emil Velikov +Date: Sun Apr 17 20:30:43 2016 +0100 + + xfree86/parser: annotate xf86ConfigSymTabRec as constant data + + Add the const notation to all the static storage as well as the + functions that use it - xf86getToken(), xf86getSubTokenWithTab(), + StringToToken() and xf86getStringToken(). + + Reviewed-by: Alex Deucher + Signed-off-by: Emil Velikov + +commit 3981dcdd489b60fbf356534a509ca93dcbedf769 +Author: Emil Velikov +Date: Sun Apr 17 20:34:43 2016 +0100 + + dri3: remove unused file dri3int.h + + Copied during the prototyping stage and never used. + + Cc: Keith Packard + Signed-off-by: Emil Velikov + Reviewed-by: Alex Deucher + +commit a1b13cda6169a98d694451fec75e63352e9d90bd Author: Adam Jackson -Date: Wed Jun 1 14:27:23 2016 -0400 +Date: Wed Jan 6 09:09:21 2016 -0500 - xfree86: Don't swallow ±iglx command line flag + xfree86: Remove xf86RegisterRootWindowProperty - We want to notice that it's set, but still pass it through to dix. - Return 0 to indicate this. + All consumers have been ported to the root window callback, so this can + all be nuked. + Reviewed-by: Michel Dänzer Signed-off-by: Adam Jackson - Reviewed-by: Peter Hutterer - (cherry picked from commit 7cf80b9714864c3c4eb9898ff1b7d657ecd16df7) -commit d7ae950c1d08724144514151afe47a3fd8e84f3c +commit e89c7f1c2a0ea3480b21446e413073c1427285ae Author: Adam Jackson -Date: Mon May 9 13:28:08 2016 -0400 +Date: Wed Jan 6 09:04:15 2016 -0500 - xfree86: Add IndirectGLX server flag (v2) + xfree86: Create EDID atom from the root window callback (v2) - Not all display managers make it easy (or possible) to modify the - command line flags passed to the server, so add a way to get to it from - xorg.conf. + v2: Fix swapped callback args - v2: Fix the FlagOptions list to not have IGLX after the terminator (Alan - Coopersmith) - - Reviewed-by: Alan Coopersmith + Reviewed-by: Michel Dänzer Signed-off-by: Adam Jackson - (cherry picked from commit 4fca18dc03669bada75175df289fbee41275208e) -commit 02f9b3c18f6561d47b518bdcd6043a0ec8995c32 +commit 8e3010d7d8e8c49c8859b576de1808ae7b2859be +Author: Adam Jackson +Date: Wed Jan 6 08:54:47 2016 -0500 + + xfree86: Remove a never-hit diagnostic message + + Practically speaking, the EDID major version is never not 1. + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 7961377567f15dfad9d96c5c0a0992b38013d973 +Author: Adam Jackson +Date: Wed Jan 6 08:47:37 2016 -0500 + + xfree86: Make xf86SetDDCproperties work more than once (v2) + + We can call this more than once via xf86OutputSetEDID since hotplug is + actually a thing in RANDR 1.2, but xf86RegisterRootWindowProperty merely + adds the data to a list to be applied to the root at CreateWindow time, + so calls past the first (for a given screen) would have no effect until + server regen. + + Once we've initialised pScrn->pScreen is filled in, so we can just set + the property directly. + + v2: Removed pointless version check, deobfuscate math (Walter Harms) + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 8be83fff04a009109a956837ca983a96fd279711 +Author: Adam Jackson +Date: Wed Jan 6 08:35:43 2016 -0500 + + xfree86: Remove some leftovers from DisplayID support + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 0cd2a24b61ef1583fc6b3fec7d01c7481cc97d52 +Author: Adam Jackson +Date: Wed Jan 6 08:30:07 2016 -0500 + + xfree86: Unexport xf86Initialising, remove xf86ServerIsInitialising + + Neither of these are used from outside the server. + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit e70ee11a39b957141fbc565d79d128a46fac5f34 +Author: Adam Jackson +Date: Tue Jan 5 16:27:41 2016 -0500 + + xfree86: Create VT atoms from the root window callback (v2) + + v2: Fix swapped callback args + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit da9ee1eddd65d00788cef8a3becfad948c0a2168 +Author: Adam Jackson +Date: Tue Jan 5 16:11:42 2016 -0500 + + xfree86: Create seat atom from the root window callback (v2) + + v2: Fix swapped callback args + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 2c3a3afb5104714b637c1c4aea195df73e0fa918 +Author: Adam Jackson +Date: Tue Jan 5 15:56:42 2016 -0500 + + dix: Add RootWindowFinalizeCallback + + Reviewed-by: Michel Dänzer + Signed-off-by: Adam Jackson + +commit 8437955515ad59b0bfcd6598248e7f0ffc706370 +Author: Olivier Fourdan +Date: Thu Mar 17 09:53:58 2016 +0100 + + glamor: fix wrong offset on composite rectangles + + When using PictOpSrc, the destination is wrongly shifted back to (0, 0). + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94568 + Reviewed-by: Adam Jackson + Signed-off-by: Olivier Fourdan + +commit e8e5d839968e22cf42a6e1982a07b02c6f4a4562 Author: Olivier Fourdan Date: Fri Apr 1 13:38:11 2016 +0200 @@ -945,115 +9747,276 @@ Date: Fri Apr 1 13:38:11 2016 +0200 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit e8e5d839968e22cf42a6e1982a07b02c6f4a4562) -commit a482b0b6c7d4e66276190acab25c945d74da1178 +commit f9b5bbaa3a7fce1a4efb2084b8d9d82b98d4ee83 +Author: Peter Hutterer +Date: Tue Mar 8 15:42:42 2016 +1000 + + xkb: fix SlowKeys release/reject beeps + + Wrong use of the mask here caused a beep whenever a key was rejected but + also when it was released after being accepted. Fix the mask to check + for the correct enabled controls. + + Signed-off-by: Peter Hutterer + Reviewed-by: Daniel Stone + +commit a6288f0954cf97499e78849a87847062ee962c17 +Author: Jon Turney +Date: Tue Nov 3 19:07:43 2015 +0000 + + hw/xwin: xcbify internal window manager + + Convert the code for the multiwindow mode internal window manager to xcb + + xcb conversion avoids xlib/xserver namespace collision and _XSERVER64 type + sizing issues + + v2: Various fixes + v3: Don't include X11/extensions/windowswmstr.h, which uses the Display type + and thus depends on Xlib.h, just for _WINDOWSWM_NATIVE_HWND + v4: Fix indentation, add some error handling. + Fix a bug with ConfigureNotify handling + v5: Fix a bug which prevented WM_NORMAL_HINTS from being checked + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 8114b8127f01fc81390fc13e3d09bcc50e41a66f +Author: Jon Turney +Date: Wed Jul 1 16:30:36 2015 +0100 + + hw/xwin: In multiwindow mode, do window minimization entirely in the WM + + Remove winMinimizeWindow(), implement as UpdateState() in the WM instead, + which uses getHwnd() to map a Window XID to a HWND (like everything else in + the WM), rather than peering into the servers internal data structures. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 6a64b9d7af70dc7ff2cac8b35a1f7b0797823733 +Author: Jon Turney +Date: Mon Nov 2 17:55:19 2015 +0000 + + hw/xwin: xcbify code for converting X11 icon to Win32 icon + + Convert the code for converting an X11 icon to Win32 icon from Xlib to xcb. + + v2: some warning fixes in winXIconToHICON() + v3: declaration-after-statement warning fixes + v4: printf format fixes + v5: convert in place rather than in a library + + This also avoids the xlib/xserver namespace collision issues, so + winmultiwindowicons.h can be included everywhere it should be, which fixes + compilation with -Werror=implicit-function-declaration + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 0a69c1e2fa0ea63b02fff98e68d9f56a369e882b +Author: Jon Turney +Date: Wed Mar 30 18:31:38 2016 +0100 + + xwin/glx: Build fix for warnings about missing WGL extensioons + + Reviewed-by: Adam Jackson + Signed-off-by: Jon Turney + +commit b08526eecf1e165ed9ec2e6b571a5a616a9b696e Author: Adam Jackson -Date: Fri Apr 8 11:26:36 2016 -0400 +Date: Wed Mar 16 11:38:13 2016 -0400 - kdrive: Nuke a bunch of dead code + glx: Implement GLX_EXT_libglvnd (v2) - gcc6 says: + For the dri2 backend, we depend on xfree86 already, so we can walk the + options for the screen looking for a vendor string from xorg.conf. For + the swrast backend we don't have that luxury, so just say mesa. This + extension isn't really meaningful on Windows or OSX yet (since libglvnd + isn't really functional there yet), so on those platforms we don't say + anything and return BadValue for the token from QueryServerString. - keyboard.c:46:21: warning: ‘linux_to_x’ defined but not used - - Only referenced by a bunch of long if-0'd code, so chuck it all out. - - Reviewed-by: Julien Cristau - Signed-off-by: Adam Jackson - (cherry picked from commit c33250945b45adc447154239f0cf48fb9b2d7335) - -commit 0dfa816af2a383449804b891f4a9f8c431e00528 -Author: Adam Jackson -Date: Fri Apr 8 11:24:50 2016 -0400 - - dix: Squash some new gcc6 warnings - - -Wlogical-op now tells us: - - devices.c:1685:23: warning: logical ‘and’ of equal expressions - - Reviewed-by: Julien Cristau - Signed-off-by: Adam Jackson - (cherry picked from commit a5dd7b890f4f3a5245639591c73303c5a087b38a) - -commit 98499770640c747128f212b1ebb6bd42775f3b72 -Author: Jeremy Huddleston Sequoia -Date: Sat May 7 00:43:33 2016 -0700 - - XQuartz: Fix default CFBundleVersion - - m4/shell variable name collision broke the case when the configure - option was not used - - Signed-off-by: Jeremy Huddleston Sequoia - (cherry picked from commit 1bb932bf1417ff319a594d7e40f6813a26936784) - -commit 1a81f2a51955e5c8a9d1d80cc008e2927ddd0123 -Author: Jeremy Huddleston Sequoia -Date: Tue May 3 23:43:06 2016 -0700 - - XQuartz: Update copyright years - - Signed-off-by: Jeremy Huddleston Sequoia - (cherry picked from commit 059d5ef30490233f410ca87084c7697b87e5b05e) - -commit 73987379d73cd6ef2701dad7e3027f9363cb81b4 -Author: Jeremy Huddleston Sequoia -Date: Tue May 3 23:42:34 2016 -0700 - - XQuartz: Add --with-bundle-version and --with-bundle-version-string configure options - - Signed-off-by: Jeremy Huddleston Sequoia - (cherry picked from commit d6ba4f2c52da150a9a92bdb00efe7902d17033bd) - -commit bab72d3905bdafe4815ab1dc5509988c8e467769 -Author: Jeremy Huddleston Sequoia -Date: Tue May 3 23:21:38 2016 -0700 - - XQuartz: Add --with-sparkle-feed-url configure option - - Signed-off-by: Jeremy Huddleston Sequoia - (cherry picked from commit c1614928c10a8f8400f99acfd1b7f96d503af7ec) - -commit a1915ad14d89bdcd0f2a6607d6d1cb8f90201158 -Author: Jeremy Huddleston Sequoia -Date: Tue May 3 23:14:24 2016 -0700 - - XQuartz: Update release feed URL to use new https URL - - Signed-off-by: Jeremy Huddleston Sequoia - (cherry picked from commit 299b01eabf827a7435b5d6004d50637ac710bbc7) - -commit ab5f69e5419b34f21cfd30d38374d14103a88f40 -Author: Jeremy Huddleston Sequoia -Date: Tue May 3 23:24:44 2016 -0700 - - XQuartz: Fix the help text for --with-bundle-id-prefix - - Signed-off-by: Jeremy Huddleston Sequoia - (cherry picked from commit 16d6733c63727d910eb516d7f6950f4675281f2d) - -commit 3600f8600f1a876409c3a7f2b29f036156b2c7c6 -Author: Jeremy Huddleston Sequoia -Date: Tue May 3 23:16:46 2016 -0700 - - XQuartz: Remove --with-launchd-id-prefix - - It's been deprecated for years. - - Signed-off-by: Jeremy Huddleston Sequoia - (cherry picked from commit 214a66b661dcb56ebb9776e34049753f65c7510a) - -commit 9454cd51da9b38b974cff7c8b7125901f6403848 -Author: Adam Jackson -Date: Mon Apr 4 14:39:36 2016 -0400 - - xserver 1.18.3 + v2: Use xnf* allocators when parsing options (Eric and Emil) + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov Signed-off-by: Adam Jackson -commit 082d5ea9a8f882c5ab7c30c481e2d9a5c5f11376 +commit 2e8781ead3067b195baec2e76a28091575679383 +Author: Adam Jackson +Date: Wed Mar 23 15:41:24 2016 -0400 + + glx: Compute the GLX extension string from __glXScreenInit + + Now that the enable bits are in the screen base class we can compute + this in one place, rather than making every backend do it. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit e21de4bf3c5ff8cbb9c5ea023d04162e5e56b3df +Author: Adam Jackson +Date: Wed Mar 23 15:36:52 2016 -0400 + + glx: Move glx_enable_bits up to the GLX screen base class + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 23cce73221c0b96e7778da34616f8c3f4d6aa819 +Author: Adam Jackson +Date: Wed Mar 23 15:13:51 2016 -0400 + + xquartz/glx: Remove unused fields from the glx screen subclass + + dmt:~/git/xserver% git grep -E '\<(index|num_vis)\>' hw/xquartz/GL + hw/xquartz/GL/indirect.c: int index; + hw/xquartz/GL/indirect.c: int num_vis; + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 36bcbf76dcc7e88cac093f8fb656c525bfeaf65d +Author: Adam Jackson +Date: Wed Mar 23 15:26:23 2016 -0400 + + glx: Enable GLX 1.4 unconditionally + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 2a72789ee8e88f612dff48ebe2ebe9fecda7a95d +Author: Adam Jackson +Date: Wed Mar 16 16:28:13 2016 -0400 + + xwin/glx: Drop GLWIN_NO_WGL_EXTENSIONS hack + + This doesn't seem very useful, and we're about to implement 1.4 across + the board, so some WGL extensions will become required. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 77bdaa1313aa55191b49ec73c1e377928ca294fe +Author: Adam Jackson +Date: Tue Mar 22 14:40:37 2016 -0400 + + glx: Use __glXInitExtensionEnableBits in all backends (v2) + + On xquartz this enables SGI_make_current_read, which is a mostly + harmless lie as CGL doesn't implement it, as well as SGIX_pbuffer, which + is fine because no pbuffer-enabled configs are created. + + On xwin this enables SGIX_pbuffer and ARB_multisample in all cases. + Again this is harmless if the backend doesn't support the features, + since no fbconfigs will be created to expose them. + + It also adds SGIX_visual_select_group to both xquartz and xwin. + Amusingly, both were filling in the appropriate field in the fbconfig + already. + + v2: Warn about missing WGL extensions (Emil) + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 15af78fc56569dc3b6a7f2c5a6a49edb602111b7 +Author: Adam Jackson +Date: Wed Mar 23 15:19:15 2016 -0400 + + glx: Enable GLX_SGI_make_current_read in the core + + GLX 1.3 implies equivalent functionality, so this is safe to enable + unconditionally, and bindContext always takes both drawable and readable + arguments in any case. Mesa stopped exporting the __DRI_READ_DRAWABLE + extension in 8.0 (when the DRI1 drivers were removed) so this will + restore the extension string. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 9b2fc6d98691966f1c9186edad956f78c31f3698 +Author: Adam Jackson +Date: Wed Mar 23 14:57:25 2016 -0400 + + xwin/glx: Enable GLX_SGI_make_current_read unconditionally (v2) + + This seems to be fairly universal these days, and if it doesn't exist + the only thing you break is separate drawable and readable, which is a + rare feature to use. So pretend it's always there and just throw an + error on MakeCurrent if it isn't, and don't consider it when computing + the GLX version number. + + v2: Fix type-o for glxWinScreen (Jon Turney) + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit b2ef7df476af619903ef7f6b6962b371ae14306c +Author: Adam Jackson +Date: Sat Mar 19 13:44:10 2016 -0400 + + xquartz/glx: Error out for MakeContextCurrent(draw != read) + + CGL doesn't have a way to express this directly, unlike EGL WGL and GLX. + It might be implementable, but it's never actually worked, and it's a + fairly niche feature so we're better off throwing an error if someone + attempts it. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Reviewed-by: Jeremy Huddleston Sequoia + Signed-off-by: Adam Jackson + +commit f95645c6f70019316f8ad77b7beb84530fc0505f +Author: Adam Jackson +Date: Tue Mar 22 14:37:19 2016 -0400 + + glx: Don't enable EXT_texture_from_pixmap unconditionally + + Not all backend servers implement this. Those that don't happen to not + use __glXInitExtensionEnableBits, but we'd like that to change, so fix + it up before we switch them over. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 410aec82556def5395f51299bcefbeb7d0bda604 +Author: Adam Jackson +Date: Tue Mar 22 14:29:06 2016 -0400 + + glx: Remove server-side mention of GLX_MESA_swap_control + + This extension is direct-only and has no GLX protocol. We don't even + track an enable bit for it, trying to turn it on is pointless. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 3a21da59e59cf11a9113d71e3431c4bd394ff1e8 +Author: Adam Jackson +Date: Wed Mar 16 19:05:17 2016 -0400 + + glx: Remove default server glx extension string + + This existed only to be strdup'd and then immediately freed. + + Reviewed-by: Eric Anholt + Reviewed-by: Emil Velikov + Signed-off-by: Adam Jackson + +commit 44e1c97ca6fe992bbb6ef9ecb0b82a113adfa57e Author: Olivier Fourdan Date: Mon Mar 21 09:53:17 2016 +0100 @@ -1066,9 +10029,8 @@ Date: Mon Mar 21 09:53:17 2016 +0100 Signed-off-by: Olivier Fourdan Reviewed-by: Hans de Goede - (cherry picked from commit 44e1c97ca6fe992bbb6ef9ecb0b82a113adfa57e) -commit fcb89adb4a6cde585923e63d3c34df465aa78d1b +commit 6e3a6e30a6ac66942a0756a5d079993181f02e34 Author: Olivier Fourdan Date: Thu Mar 17 14:39:45 2016 +0100 @@ -1085,9 +10047,8 @@ Date: Thu Mar 17 14:39:45 2016 +0100 Signed-off-by: Olivier Fourdan Reviewed-by: Daniel Stone - (cherry picked from commit 6e3a6e30a6ac66942a0756a5d079993181f02e34) -commit b8f9fd83189bd5593793c1cfcbfedb5150d7c5a5 +commit 418fe365b45a143680d3b4143dc60f7cdc5a3507 Author: Michel Dänzer Date: Thu Mar 24 17:34:23 2016 +0900 @@ -1105,9 +10066,37 @@ Date: Thu Mar 24 17:34:23 2016 +0900 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94560 Reviewed-by: Adam Jackson Signed-off-by: Michel Dänzer - (cherry picked from commit 418fe365b45a143680d3b4143dc60f7cdc5a3507) -commit 1211d483d4581ee5ccbd50c654d30cf3318fe7c6 +commit adefbaee499b9679c6cac21f52ec6545af2b36b5 +Author: Adam Jackson +Date: Mon Mar 28 18:11:09 2016 +0900 + + os: Treat ssh as a non-local client (v4) + + By the time we get to ComputeLocalClient, we've already done + NextAvailableClient → ReserveClientIds → DetermineClientCmd (assuming + we're built with #define CLIENTIDS), so we can look up the name of the + client process and refuse to treat ssh's X forwarding as if it were + local. + + v2: (Michel Dänzer) + * Only match "ssh" itself, not other executable names starting with + that prefix. + * Ignore executable path for the match. + v3: (Michel Dänzer) + * Use GetClientCmdName (Mark Kettenis) + * Perform check on Windows as well, but only ignore path on Cygwin + (Martin Peres, Emil Velikov, Jon Turney) + v4: (Michel Dänzer) + * Cut of any colon and whatever comes after it. (Adam Jackson) + * Add bugzilla reference. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261 + + Signed-off-by: Adam Jackson + Signed-off-by: Michel Dänzer + +commit 1c90797565385426ad63bd2108085c8466695c0b Author: Sonny Jiang Date: Mon Mar 28 16:36:50 2016 +0900 @@ -1121,9 +10110,8 @@ Date: Mon Mar 28 16:36:50 2016 +0900 Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher - (cherry picked from commit 1c90797565385426ad63bd2108085c8466695c0b) -commit 07ad2fde78f07e98caaf3e9b6b67af15359fefe4 +commit 3b385105b2d19a1c55e9779ae88d775185eea231 Author: Michel Dänzer Date: Thu Mar 24 17:42:47 2016 +0900 @@ -1144,9 +10132,8 @@ Date: Thu Mar 24 17:42:47 2016 +0900 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94596 Signed-off-by: Michel Dänzer Reviewed-by: Keith Packard - (cherry picked from commit 3b385105b2d19a1c55e9779ae88d775185eea231) -commit e8f785f82ec8d3a76ae377c7430b1945180cba00 +commit 8ac0e05cc6c6e87b223ba7cb31d8856771c5d41a Author: Adam Jackson Date: Wed Mar 23 14:42:08 2016 -0400 @@ -1156,9 +10143,8 @@ Date: Wed Mar 23 14:42:08 2016 -0400 Reviewed-by: Yaakov Selkowitz Signed-off-by: Adam Jackson - (cherry picked from commit 8ac0e05cc6c6e87b223ba7cb31d8856771c5d41a) -commit fb8ddcf1cb0f47257370c3d6a895a5a41bea8dc0 +commit a288cf58a0dc0f965a6f964c76bb86bb1989d797 Author: Dave Airlie Date: Wed Mar 16 10:45:54 2016 +1000 @@ -1172,9 +10158,63 @@ Date: Wed Mar 16 10:45:54 2016 +1000 Reviewed-by: Adam Jackson Signed-off-by: Dave Airlie Tested-by: Timo Aaltonen - (cherry picked from commit a288cf58a0dc0f965a6f964c76bb86bb1989d797) -commit 1bffe77769a9dce623e4a587ed3895ba003c257b +commit 4583fa9a6cd3095d7497c075d68e7430ea3c5cb0 +Author: Ángel González +Date: Mon Oct 15 22:04:22 2012 +0200 + + security: Fix reversed comment + + Commit 6045506be0cebca4ebbe943ae77f020aafa703d4 changed back + the behavior to only allow the trusted extensions to the untrusted clients, + but left the 8b5d21cc1d1f4e9d20e5d5eca44cb1e60a419763 + comment intended for Security*Un*trustedExtensions saying that + "untrusted clients shouldn't have access to these". + + Reviewed-by: Adam Jackson + Signed-off-by: Ángel González + +commit b78897d0a04a833720698901fbac9535570875e4 +Author: Evgeny M. Zubok +Date: Thu Apr 8 03:58:21 2010 -0700 + + xfree86: Change VBE version early-out to 1.2. (#22672) + + Reporter has an S3 Trio with DDC and VESA 1.2. + + Signed-off-by: Corbin Simpson + Reviewed-by: Matt Turner + +commit 184fbf7541012090b8716c7eaf00895efd16d0ac +Author: Adam Jackson +Date: Mon Mar 14 11:37:32 2016 -0400 + + xfree86: Finish removing font modules + + Signed-off-by: Adam Jackson + +commit 69d1528bc35073331e281448dfb04eb4240ff472 +Author: Adam Jackson +Date: Thu Apr 26 16:42:20 2012 -0400 + + xfree86: Font modules aren't a real thing + + There are no longer any loadable font modules (not that they ever did + much in the first place), so stop pretending they're a defined ABI + surface. + + Signed-off-by: Adam Jackson + Reviewed-by: Julien Cristau + +commit 4f8151c7a4bcf2d55848e70c83b2f9ce458cf316 +Author: Adam Jackson +Date: Mon Mar 14 11:20:39 2016 -0400 + + Fix the typo from the previous patch, d'oh + + Signed-off-by: Adam Jackson + +commit 75eecf28ae3709181a51571132b0accd9cae316e Author: Chris Wilson Date: Sun Mar 13 13:54:01 2016 +0000 @@ -1196,17 +10236,8 @@ Date: Sun Mar 13 13:54:01 2016 +0000 References: https://bugs.freedesktop.org/show_bug.cgi?id=94515 Signed-off-by: Chris Wilson Cc: Olivier Fourdan - (cherry picked from commit 75eecf28ae3709181a51571132b0accd9cae316e) -commit 93d4224ccf3dee5a51815a66f76c905450419b50 -Author: Adam Jackson -Date: Fri Mar 11 16:38:52 2016 -0500 - - xserver 1.18.2 - - Signed-off-by: Adam Jackson - -commit d88f8ffeb7ec0304d793388be5b65a293505bc3b +commit 744c292ae49dd1f9d33b860d2b4f0ae27023809b Author: Adam Jackson Date: Fri Mar 11 13:50:32 2016 -0500 @@ -1223,9 +10254,8 @@ Date: Fri Mar 11 13:50:32 2016 -0500 but not removed from the Makefile, which broke 'make dist'. Signed-off-by: Adam Jackson - (cherry picked from commit 744c292ae49dd1f9d33b860d2b4f0ae27023809b) -commit 643359fb03c51244c9ed5f5efab4c84594259e8c +commit 47bc7fcaa567b0d9e2627b4a21b112e96f81725b Author: Dave Airlie Date: Tue Feb 9 16:54:22 2016 +1000 @@ -1245,9 +10275,26 @@ Date: Tue Feb 9 16:54:22 2016 +1000 Signed-off-by: Dave Airlie Reviewed-by: Keith Packard - (cherry picked from commit 47bc7fcaa567b0d9e2627b4a21b112e96f81725b) -commit 3e480c6f5168e7da1521bdcc15ed8b5b8762612d +commit 316948734c2bba72d42c4cf4530932b5862c109f +Author: Michel Dänzer +Date: Fri Mar 11 12:21:06 2016 +0900 + + glamor: Make context current in glamor_pixmap_fbo_cache_put + + Without this, we may be manipulating the context of another screen. + + In a system with two GPUs using glamor, this fixes lots of + + (EE) glamor256: GL error: GL_INVALID_OPERATION in glBindTexture(non-gen name) + + spew since 0b4c0c75 ('glamor: Replace "finish access" shader with texture + swizzling'). + + Signed-off-by: Michel Dänzer + Reviewed-by: Dave Airlie + +commit ef3005da3d5dc92b3ee5a0ee78164e739a3216dc Author: Adam Jackson Date: Thu Jan 21 12:47:57 2016 -0500 @@ -1259,9 +10306,8 @@ Date: Thu Jan 21 12:47:57 2016 -0500 Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson - (cherry picked from commit ef3005da3d5dc92b3ee5a0ee78164e739a3216dc) -commit b9f7edda0634955711870bb1389095525d4496e3 +commit d15cb654b6ba365dac9a62064e277adebde2fdab Author: Adam Jackson Date: Mon May 18 13:00:02 2015 -0400 @@ -1275,9 +10321,8 @@ Date: Mon May 18 13:00:02 2015 -0400 Reviewed-by: James Jones Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson - (cherry picked from commit d15cb654b6ba365dac9a62064e277adebde2fdab) -commit 2b3363418a425bf432b55927d8f8dd93c004c791 +commit a18238877bbf9aab95843d849a6f434275e9cd6c Author: Adam Jackson Date: Thu Mar 3 16:50:02 2016 -0500 @@ -1290,9 +10335,8 @@ Date: Thu Mar 3 16:50:02 2016 -0500 Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson - (cherry picked from commit a18238877bbf9aab95843d849a6f434275e9cd6c) -commit 2541d765fdd1006d649063882e3a667438f1d30e +commit 47c1d6b7abcfb1c6b478367bbc2e869c91485bc0 Author: Adam Jackson Date: Thu Mar 10 12:29:34 2016 -0500 @@ -1303,9 +10347,8 @@ Date: Thu Mar 10 12:29:34 2016 -0500 Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson - (cherry picked from commit 47c1d6b7abcfb1c6b478367bbc2e869c91485bc0) -commit 2a7b6ea1a54a4c8174669c1ca38c4665505c4637 +commit c01094c5312fbd84146dd83122e5256a8e57d092 Author: Eric Anholt Date: Mon Feb 1 13:58:15 2016 -0800 @@ -1315,9 +10358,153 @@ Date: Mon Feb 1 13:58:15 2016 -0800 Reviewed-by: Adam Jackson Signed-off-by: Eric Anholt - (cherry picked from commit c01094c5312fbd84146dd83122e5256a8e57d092) -commit 5af20f15636aa2ede3dac1af9e9afa063564130c +commit 0b4c0c75d06f3dbe92be1a26a637e9f05529cb3d +Author: Eric Anholt +Date: Mon Feb 1 13:58:14 2016 -0800 + + glamor: Replace "finish access" shader with texture swizzling. + + For pictures without alpha, and for most other formats for GLES2, we + would make a temporary FBO, make another temporary texture, upload our + GLAMOR_MEMORY pixmap to the texture, then run the "finish access" shader + across it to swizzle its values around into the temporary FBO (which we + would use for a single Render operation and then throw away). + + We can simplify everything by using GL_ARB_texture_swizzle (or its + GLES3 counterpart). It's just not worth the complexity to try to + improve the performance of this already low-performance path (SHM + pixmaps + Render) on GLES2. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit b0cc04992ced5d96bb5c52fc1e5c868797cc0a17 +Author: Eric Anholt +Date: Mon Feb 1 13:58:13 2016 -0800 + + glamor: Drop dead large-pixmap handling code in temp picture uploads. + + The glamor_pixmap_ensure_fbo() in glamor_pixmap_upload_prepare() will + always fail on a large pixmap, so we can just be explicit about + bailing out here and then dump the rest of this garbage. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 094b1bea8bd08eec029e4d61ba40d81441c37905 +Author: Eric Anholt +Date: Mon Feb 1 13:58:12 2016 -0800 + + glamor: Drop unused PBO code in temporary picture uploading. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 6112fecc3a4fd7dfb0ef77a98cfd1f7c91ccea0c +Author: Eric Anholt +Date: Mon Feb 1 13:58:11 2016 -0800 + + glamor: Generalize the a1-to-a8 conversion path. + + Pixman is quite qualified to allocate our temporary memory, and all we + need to do is decide what formats to convert from and to. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 8f1411c3847a742f84ff07c4a0bb610801f5bfee +Author: Eric Anholt +Date: Mon Feb 1 13:58:10 2016 -0800 + + glamor: Drop the REVERT_UPLOADING_1_5_5_5 path. + + There was only a pretty special case that could have even worked -- + you've got a GLES2 renderer, you've got a SHM pixmap, it's 1555 (not + the usual 565 for 16-bit), and you're little endian (BE was broken, + since GL's 5_5_5_1 picks the 1 bit from the lowest bit of the short, + and on BE we weren't doing the conversion path that swaps around the + channels). This is just not worth the complexity. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 2cc7a0815e5e2c2b1b1267cae9c348a8e95b1082 +Author: Eric Anholt +Date: Mon Feb 1 13:58:09 2016 -0800 + + glamor: Drop the GLES2 REVERT_UPLOADING_2_10_10_10 paths. + + These just smash your 2_10_10_10 data into 8888, despite what the + comments said. That's not valid rendering, so just ditch this path + and fall back to software. One might also note in the code being + removed here that the REVERT_UPLOADING_10_10_10_2 path wasn't even + connected. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit f667d5177024d3fdfb1b51694bdaeba6cee67962 +Author: Eric Anholt +Date: Mon Feb 1 13:58:08 2016 -0800 + + glamor: Merge the two GL-type-from-pictformat paths. + + It clarifies what the difference is between the two paths, and would + potentially encourage us to handle GLES extensions that expose + additional types. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit c7574c63c618d3a017105c380542eb04341b04a2 +Author: Eric Anholt +Date: Mon Feb 1 13:58:07 2016 -0800 + + glamor: Propagate that is_upload is always true. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 1bed5ef2b80c77c1bb9b62971367bea864fd8f66 +Author: Eric Anholt +Date: Mon Feb 1 13:58:06 2016 -0800 + + glamor: Drop dead fbo handling from GLAMOR_MEMORY pict uploads. + + The previous commit asserts that we don't have one. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit ee7ca670b1695d64bc12cb37302913acc066a569 +Author: Eric Anholt +Date: Mon Feb 1 13:58:05 2016 -0800 + + glamor: Make sure that GLAMOR_MEMORY pixmaps don't retain an FBO. + + glamor_composite_choose_shader() may upload our scratch pixmaps to get + a Render operation completed. We don't want to hang onto GL memory + for our scratch pixmaps, since we'll just have to reallocate them at a + new w/h next time around, and the contents will be updated as well. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit a96c6d4658e3f386002f96eede660af3b01e5209 +Author: Eric Anholt +Date: Mon Feb 1 13:58:04 2016 -0800 + + glamor: Simplify temporary picture uploading call stack. + + glamor_upload_sub_pixmap_to_texture() only had the one caller, so we + can merge it in, fix its silly return value, and propagate a bunch of + constants. + + Reviewed-by: Adam Jackson + Signed-off-by: Eric Anholt + +commit 25ce263fd88684be9370025f93ba3a2bfc72ff1a Author: Olivier Fourdan Date: Wed Mar 9 16:45:18 2016 +0100 @@ -1325,9 +10512,8 @@ Date: Wed Mar 9 16:45:18 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit 25ce263fd88684be9370025f93ba3a2bfc72ff1a) -commit 9fc05b85e544638ccc4b811c19e64312b387c799 +commit da7724d3d277c6c8a814881785b716896802629a Author: Olivier Fourdan Date: Wed Mar 9 16:21:18 2016 +0100 @@ -1337,9 +10523,157 @@ Date: Wed Mar 9 16:21:18 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit da7724d3d277c6c8a814881785b716896802629a) -commit 1aa9a2be313c51a78af9bceea865dcf069e9cebe +commit d11fdff50c91575e977a63617806a61bca98cd35 +Author: Jon Turney +Date: Fri Jan 3 13:21:40 2014 +0000 + + hw/xwin: Tidy-up of winmsg.h + + - winVMsg() has no uses, so remove + - winMsgVerb() has only one use, with default verbosity, so remove + - winMsg() is identical to LogMessage() + - Put winDrvMsg() and winDrvMsgVerb() under XWIN_XF86CONFIG + - Include what you use Xfuncproto.h for _X_ATTRIBUTE_PRINTF + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 519b98765f0c7d083a744ae7beb641753e4eb751 +Author: Jon Turney +Date: Thu Mar 3 22:32:28 2016 +0000 + + hw/xwin: Remove GC privates, unused since native GDI engine removal + + Unused since native GDI engine removal in commit 8465ee78 + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 9d28ff2a9be86662f56463aa1fd46d12988e30fa +Author: Jon Turney +Date: Fri Jul 31 20:23:59 2015 +0100 + + hw/xwin: Use NULL rather than NoopDDA for unimplemented engine functions + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit a309085a56de4d30dfbc44d9ff5302c7d9fdbf73 +Author: Jon Turney +Date: Fri Jul 31 20:20:00 2015 +0100 + + hw/xwin: Remove unused FinishCreateWindowsWindow engine function + + This only ever had an (unused) implementation in the DDNL engine, which was + removed in commit 57bbf6e2. + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit fa6f9d06a3d1a90134d9349f5ce4ec5b4eeff5e3 +Author: Jon Turney +Date: Fri Jul 31 20:12:37 2015 +0100 + + hw/xwin: Remove unused HotKeyAltTab engine function + + This was only ever used by the primaryfb engine, removed in commit c79f824b + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 7bd25aa8437ec410e7a7de1b0636ba33298fc8d6 +Author: Jon Turney +Date: Fri Jul 31 19:44:34 2015 +0100 + + hw/xwin: Return FALSE to indicate failure in winSetEngine() + + Return FALSE to indicate failure in winSetEngine(), if it couldn't find a + drawing engine to use + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 52e05b9282f0f220d7c762793ce0b8f606a45deb +Author: Jon Turney +Date: Tue Feb 23 23:09:43 2016 +0000 + + hw/xwin: Remove WM_WM_MAP message, which is now unused + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit c42217aa3d372acaa5ca7c64895edbfbd20c8475 +Author: Jon Turney +Date: Mon Nov 2 20:24:33 2015 +0000 + + hw/xwin: Remove WM_(UN|)MANAGE messages, which are now never sent + + Remove fAnotherWMRunning which tracks this message (although since it was + never initialized, I doubt this worked reliably), and the only use of that, + which was to prevent winMWExtWMRestackWindows() from being used when the + internalwm is running + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit b6bdf368420355332e41c604c523584bd39933f9 +Author: Jon Turney +Date: Mon Nov 2 20:51:51 2015 +0000 + + hw/xwin: Remove allowOtherWM, which is now always FALSE + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 8407d3096287868b5c5e50ca5a98d470918c85a9 +Author: Jon Turney +Date: Mon Nov 2 20:34:09 2015 +0000 + + hw/xwin: Remove winIsInternalWMRunning(), which now always returns FALSE + + Also remove then unused variables and IsRaiseonClick() + + v2: + Also remove unused pScreenInfo variable in winMWEXtWMRestackFrame() + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 2779a28a86a13831b334e8678cd4e838b3b38472 +Author: Jon Turney +Date: Mon Nov 2 20:07:04 2015 +0000 + + hw/xwin: Remove fInternalWM flag + + Remove the fInternalWM flag as it is now always FALSE after removing the + -internalwm option + + v2: + Also remove then unused pRLWinPriv local from pRLWinPriv() + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 98238ece5756801a8a67b9235e42cb9ab2318633 +Author: Jon Turney +Date: Mon Nov 2 19:37:40 2015 +0000 + + hw/xwin: Ignore the obsolete, undocumented -internalwm option + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit cdeaebad9889d81d2698b8a10fec5e55d8dec7a1 +Author: Jon Turney +Date: Tue Mar 1 21:37:05 2016 +0000 + + hw/xwin: Remove the long-broken -silent-dup-error option + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 24042b4e367803dd64f3fcdc1bef7b2bf36c4145 Author: Michel Dänzer Date: Mon Dec 21 17:54:08 2015 +0900 @@ -1352,9 +10686,8 @@ Date: Mon Dec 21 17:54:08 2015 +0900 allow them to properly take effect. Reviewed-by: Keith Packard - (cherry picked from commit 24042b4e367803dd64f3fcdc1bef7b2bf36c4145) -commit aa8770bf546a58e534ad2d0e0180f7e1013e24e9 +commit b04767c84deafc44993723add4b1c5163fc11711 Author: Michel Dänzer Date: Wed Oct 21 18:33:46 2015 +0900 @@ -1370,9 +10703,8 @@ Date: Wed Oct 21 18:33:46 2015 +0900 cursor again once none of those conditions are true anymore. Reviewed-by: Keith Packard - (cherry picked from commit b04767c84deafc44993723add4b1c5163fc11711) -commit 870d4e2e6b40f911049a5286d605814d2401741d +commit a4ffa8721debb34bd36fd4624890d9c26886c618 Author: Michel Dänzer Date: Thu Dec 24 12:56:03 2015 +0900 @@ -1386,9 +10718,8 @@ Date: Thu Dec 24 12:56:03 2015 +0900 latter is TRUE for rotation as well, which we handle correctly. Reviewed-by: Keith Packard - (cherry picked from commit a4ffa8721debb34bd36fd4624890d9c26886c618) -commit af87ab62878334ee9d4e75c472fc80178329b4dd +commit c3e4e9fc5d84bfc17b3ed63f67488ea25ba150ce Author: Michel Dänzer Date: Thu Dec 24 16:20:49 2015 +0900 @@ -1399,9 +10730,8 @@ Date: Thu Dec 24 16:20:49 2015 +0900 v2: No functional change this time. Reviewed-by: Keith Packard - (cherry picked from commit c3e4e9fc5d84bfc17b3ed63f67488ea25ba150ce) -commit 87c23dc47160d7524b82b60abbc70d285708f7cb +commit a3e681eafa5355b8bb3b099d47983f14f0d5e197 Author: Michel Dänzer Date: Tue Feb 23 17:19:03 2016 +0900 @@ -1415,9 +10745,8 @@ Date: Tue Feb 23 17:19:03 2016 +0900 Reviewed-by: Adam Jackson Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94246 Signed-off-by: Michel Dänzer - (cherry picked from commit a3e681eafa5355b8bb3b099d47983f14f0d5e197) -commit 0220275531552a5400c22b56105257586f390260 +commit b05ae79ee3bebef9790c97eedc033d1ffb3ec39a Author: Michel Dänzer Date: Tue Feb 23 17:19:02 2016 +0900 @@ -1428,9 +10757,8 @@ Date: Tue Feb 23 17:19:02 2016 +0900 Reviewed-by: Adam Jackson Signed-off-by: Michel Dänzer - (cherry picked from commit b05ae79ee3bebef9790c97eedc033d1ffb3ec39a) -commit 79985270f1d63a8b186640b81d0eb142ac532e6e +commit 947e94a341fa153258e9e86060b83af95934672b Author: Hans de Goede Date: Wed Feb 10 16:40:43 2016 +0100 @@ -1442,9 +10770,8 @@ Date: Wed Feb 10 16:40:43 2016 +0100 Adjust src_y accordingly when rendering. Signed-off-by: Hans de Goede - (cherry picked from commit 947e94a341fa153258e9e86060b83af95934672b) -commit ddca8e1647d3b79f803f4080be648e5475055fe8 +commit 40a164b8f4e720b0d6ebf228ee175eb397ffeec2 Author: Rui Matos Date: Fri Mar 4 16:24:48 2016 +0100 @@ -1457,9 +10784,8 @@ Date: Fri Mar 4 16:24:48 2016 +0100 Signed-off-by: Rui Matos Reviewed-by: Emil Velikov - (cherry picked from commit 40a164b8f4e720b0d6ebf228ee175eb397ffeec2) -commit 7680f558e1584a191554658ff7b3b75c75d35e06 +commit 2be527b1d4ce2b0412c4484539a8c9607645ec6d Author: Julien Cristau Date: Mon Mar 7 23:20:34 2016 +0100 @@ -1470,9 +10796,8 @@ Date: Mon Mar 7 23:20:34 2016 +0100 Reviewed-by: Rémi Cardona Signed-off-by: Julien Cristau - (cherry picked from commit 2be527b1d4ce2b0412c4484539a8c9607645ec6d) -commit b7e1f25005f7b552870fe782fc927c9dc97f5ed0 +commit 4217db89ecd480fda2ee74fecba06c6713c2a0f0 Author: Julien Cristau Date: Mon Mar 7 23:20:33 2016 +0100 @@ -1482,9 +10807,8 @@ Date: Mon Mar 7 23:20:33 2016 +0100 Reviewed-by: Rémi Cardona Signed-off-by: Julien Cristau - (cherry picked from commit 4217db89ecd480fda2ee74fecba06c6713c2a0f0) -commit 518a0c179f99e9ea33e9cd56ce215661d27cabb6 +commit 054f80717812d4781741cd05393623fe6f6c627f Author: Julien Cristau Date: Mon Mar 7 23:20:32 2016 +0100 @@ -1492,9 +10816,8 @@ Date: Mon Mar 7 23:20:32 2016 +0100 Reviewed-by: Rémi Cardona Signed-off-by: Julien Cristau - (cherry picked from commit 054f80717812d4781741cd05393623fe6f6c627f) -commit dae9c195a9db4d210855a16efce2037f3af454e1 +commit d0c1a5bc61a3d151f2234aa3820862f16c0f00c7 Author: Julien Cristau Date: Mon Mar 7 23:20:31 2016 +0100 @@ -1504,9 +10827,8 @@ Date: Mon Mar 7 23:20:31 2016 +0100 Reviewed-by: Rémi Cardona Signed-off-by: Julien Cristau - (cherry picked from commit d0c1a5bc61a3d151f2234aa3820862f16c0f00c7) -commit 4bbaffc8134a72d4e2dd21d4def1afc9ad29e815 +commit acf263df81ad6813e0233033610fb44521cab1b4 Author: Julien Cristau Date: Mon Mar 7 23:20:30 2016 +0100 @@ -1517,9 +10839,8 @@ Date: Mon Mar 7 23:20:30 2016 +0100 Reviewed-by: Rémi Cardona Signed-off-by: Julien Cristau - (cherry picked from commit acf263df81ad6813e0233033610fb44521cab1b4) -commit 8616bd95de43aa63c959b0c978f1001ac38c0222 +commit 164753f158e78f615f903467bfd234d7c58244ef Author: Julien Cristau Date: Mon Mar 7 23:20:29 2016 +0100 @@ -1527,9 +10848,8 @@ Date: Mon Mar 7 23:20:29 2016 +0100 Reviewed-by: Rémi Cardona Signed-off-by: Julien Cristau - (cherry picked from commit 164753f158e78f615f903467bfd234d7c58244ef) -commit dcbf88aea74a00a8e09ffdc4de2b555911eb90fb +commit 59b9c3d5e4bf05aeaaac2ee4ea12c301a67aae2c Author: Julien Cristau Date: Mon Mar 7 23:20:28 2016 +0100 @@ -1540,9 +10860,17 @@ Date: Mon Mar 7 23:20:28 2016 +0100 Reviewed-by: Rémi Cardona Signed-off-by: Julien Cristau - (cherry picked from commit 59b9c3d5e4bf05aeaaac2ee4ea12c301a67aae2c) -commit ab197ee9478a0e4e7a276c03645657b4f22ae9c0 +commit ac97fb2b804809c39b12fe0032d96fb076657258 +Author: Julien Cristau +Date: Mon Mar 7 23:20:27 2016 +0100 + + dri3: return an error if AddResource fails + + Reviewed-by: Rémi Cardona + Signed-off-by: Julien Cristau + +commit 119d5c0e2f800737c949ef760c5fe25d963200bf Author: Julien Cristau Date: Mon Mar 7 23:20:26 2016 +0100 @@ -1550,9 +10878,8 @@ Date: Mon Mar 7 23:20:26 2016 +0100 Reviewed-by: Rémi Cardona Signed-off-by: Julien Cristau - (cherry picked from commit 119d5c0e2f800737c949ef760c5fe25d963200bf) -commit bd022f03143723ac326b39d6e67853650aa1bf1d +commit a2c3c34b44b866440a152511e682c98879ee13b7 Author: Jonas Ådahl Date: Tue Mar 8 20:05:33 2016 +0800 @@ -1564,9 +10891,8 @@ Date: Tue Mar 8 20:05:33 2016 +0800 Signed-off-by: Jonas Ådahl Reviewed-by: Julien Cristau - (cherry picked from commit a2c3c34b44b866440a152511e682c98879ee13b7) -commit 23d9b2a566cdaeff71deae9c3a221ebf0cb5f550 +commit 939ce0bae68b682b57675f65c901653c1a094ebb Author: Julien Cristau Date: Tue Mar 1 21:39:01 2016 +0100 @@ -1578,9 +10904,8 @@ Date: Tue Mar 1 21:39:01 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Julien Cristau - (cherry picked from commit 939ce0bae68b682b57675f65c901653c1a094ebb) -commit 90b854b2acc58a9936e9810f58b0bd1973697210 +commit 05e1bcf56e1c511a1ef539acfe11e37727e1179e Author: Adam Jackson Date: Tue Mar 1 14:09:30 2016 -0500 @@ -1588,9 +10913,8 @@ Date: Tue Mar 1 14:09:30 2016 -0500 Signed-off-by: Adam Jackson Reviewed-by: Julien Cristau - (cherry picked from commit 05e1bcf56e1c511a1ef539acfe11e37727e1179e) -commit 0e3cc3d042a2da1ed781f6691dd7aca72d87046b +commit 093f9505c12565cc19bdf6e33b263f31d104c3ef Author: Adam Jackson Date: Tue Mar 1 14:09:29 2016 -0500 @@ -1598,9 +10922,8 @@ Date: Tue Mar 1 14:09:29 2016 -0500 Reviewed-by: Julien Cristau Signed-off-by: Adam Jackson - (cherry picked from commit 093f9505c12565cc19bdf6e33b263f31d104c3ef) -commit 3d7bfe02cc3ad0f16403a073f1182d7019c98be3 +commit ac4d8c7cee13947b688ebb26035f06f7744db201 Author: Olivier Fourdan Date: Tue Mar 1 17:03:44 2016 +0100 @@ -1618,9 +10941,104 @@ Date: Tue Mar 1 17:03:44 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit ac4d8c7cee13947b688ebb26035f06f7744db201) -commit a49e7b9c2ebeb2e2ccb922265798234a8ce9d242 +commit 9c88cb9b059111e0531852f3fa8fa571c0306f57 +Author: Laércio de Sousa +Date: Thu Feb 25 16:37:57 2016 -0300 + + kdrive/ephyr: map host X server's keymap into Xephyr, if supported + + Currently Xephyr doesn't inherit host X server's keymap, which + may lead to keymap mismatches when using a non-US keyboard in a + window inside Xephyr. This patch makes Xephyr change its keymap + to match host X server's one (unless XKB support is disabled), + using xcb-xkb to retrieve the needed XKB controls. + This implementation is analogous to Xnest one at commit 83fef4235. + + Supersedes: https://patchwork.freedesktop.org/patch/67504 + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit daa6d2d58f65b9301b1b1f3c6df07719ecb5c03d +Author: Laércio de Sousa +Date: Fri Feb 12 14:18:02 2016 -0200 + + config/udev: distinguish between real keyboards and other key devices + + This patch introduces a new flag ATTR_KEY for hotplugged input devices, + so we can better distinguish between real keyboards (i.e. devices with + udev property ID_INPUT_KEYBOARD="1") and other key input devices like + lid switches, power buttons, etc. + + All supported hotplug backends (udev, hal, and wscons) will set both + flags ATTR_KEY and ATTR_KEYBOARD for real keyboards, but udev backend + will set ATTR_KEY, but not ATTR_KEYBOARD, for non-keyboard key input + devices (hal and wscons will set both flags in any case). With this + distinction, kdrive input hotplugging mechanism will be allowed to only + grab real keyboards, as other key input devices are currently not + supported. + + In order to don't break current behaviour, this patch will replace all + ATTR_KEYBOARD occurrences with ATTR_KEY in hw/xfree86/common/xf86Xinput.c. + + [ajax: Just add ATTR_KEY, don't re-number the other attributes] + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 851ff9ec04b73412c7dbad7b4911a1feac21f354 +Author: Laércio de Sousa +Date: Fri Feb 12 14:18:01 2016 -0200 + + ephyr: enable option -sw-cursor by default in multi-seat mode + + Option -seat passed to Xephyr requires -sw-cursor to be passed as well, + otherwise the mouse cursor will remain invisible for the given seat. + This patch takes care of enabling -sw-cursor if -seat is passed. + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 40e32e9fc9f3a1bd8287ee03dd399d8161cb98dd +Author: Laércio de Sousa +Date: Fri Feb 12 14:18:00 2016 -0200 + + kdrive: add options to set default XKB properties + + This patch introduces convenient command-line options -xkb-rules, + -xkb-model, -xkb-layout, -xkb-variant, and -xkb-options, to set default + values for these properties. + + These options can be handful for cases in which compile-time default + values don't match user locale, since kdrive doesn't support InputClass + matching rules yet and not all Linux distros provide default rules to + store these values in udev properties (which by the way is a discouraged + practice). + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 0cf3d72be6bd99cd2c66b7885339322c7e5bf73d +Author: Laércio de Sousa +Date: Fri Feb 12 14:17:59 2016 -0200 + + kdrive: introduce input hot-plugging support for udev and hal backends (#33140) + + This patch introduces input hot-plugging support for kdrive-based + applications in multi-seat context. This feature is enabled by passing + -seat option with desired seat name. All keyboard/mouse devices assigned + to that seat will be automatically grabbed by kdrive. + + It supports udev and hal backends for input hot-plugging support. + Another patches may be required for wscons backend. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=33140 + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 2116f03be04240e961649ca750a7aa5438b8446c Author: Olivier Fourdan Date: Mon Feb 8 17:48:26 2016 +0100 @@ -1648,9 +11066,8 @@ Date: Mon Feb 8 17:48:26 2016 +0100 Signed-off-by: Olivier Fourdan Reviewed-by: Daniel Stone - (cherry picked from commit 2116f03be04240e961649ca750a7aa5438b8446c) -commit c7735f102aa9daa604f304f2e8a2131fcdd652e8 +commit 1bee4e254ca0305cb23e574b4c8b250d276ee998 Author: Michel Dänzer Date: Thu Feb 18 17:33:19 2016 +0900 @@ -1669,9 +11086,8 @@ Date: Thu Feb 18 17:33:19 2016 +0900 Reviewed-by: Keith Packard Reviewed-by: Chris Wilson - (cherry picked from commit 1bee4e254ca0305cb23e574b4c8b250d276ee998) -commit 05d9de4e9ac515176f41f9fd649935ae990d8fb3 +commit 4611e902c291b8a789f374cff3300f74645bc2b2 Author: Michel Dänzer Date: Thu Feb 18 17:20:45 2016 +0900 @@ -1689,9 +11105,8 @@ Date: Thu Feb 18 17:20:45 2016 +0900 Reviewed-by: Chris Wilson (v1) Reviewed-by: Keith Packard - (cherry picked from commit 4611e902c291b8a789f374cff3300f74645bc2b2) -commit 49b2a0fb0e6ae0793171b5dbfe517fe06647c06d +commit 72328e5eb98a3f27e1f0a0e17beae6db447bd87c Author: Michel Dänzer Date: Thu Feb 18 18:23:47 2016 +0900 @@ -1718,9 +11133,8 @@ Date: Thu Feb 18 18:23:47 2016 +0900 Reviewed-by: Keith Packard Reviewed-by: Chris Wilson - (cherry picked from commit 72328e5eb98a3f27e1f0a0e17beae6db447bd87c) -commit d5b8bc69e2652d8b9b13065b6528d2e8b8188b57 +commit 43eb5b6047c9b35c337e553ec054f08bdc835abb Author: Michel Dänzer Date: Tue Dec 8 12:52:17 2015 +0900 @@ -1734,9 +11148,8 @@ Date: Tue Dec 8 12:52:17 2015 +0900 v2: Return BadMatch instead of BadRequest (Keith Packard) Reviewed-by: Keith Packard - (cherry picked from commit 43eb5b6047c9b35c337e553ec054f08bdc835abb) -commit 15454c5d26b00931b2099ccc6da356a1e5b6f88c +commit 6070a749d953951bacbfb149c5c36451293aad35 Author: Olivier Fourdan Date: Wed Feb 10 09:35:39 2016 +0100 @@ -1752,9 +11165,8 @@ Date: Wed Feb 10 09:35:39 2016 +0100 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit 6070a749d953951bacbfb149c5c36451293aad35) -commit f2b346f9ba86ba304baac5ed29f8caf3fefbdba0 +commit b430f53bb753f9b064ab62d014820c1c3c76a841 Author: Olivier Fourdan Date: Fri Feb 5 09:48:25 2016 +0100 @@ -1768,9 +11180,8 @@ Date: Fri Feb 5 09:48:25 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit b430f53bb753f9b064ab62d014820c1c3c76a841) -commit d381d59e44f675d01ca9ecab5a58c4864ae56c29 +commit 48fccde2bfb60efdbf45a96fa53bcd9a6570bf89 Author: Olivier Fourdan Date: Fri Feb 5 09:48:24 2016 +0100 @@ -1783,9 +11194,8 @@ Date: Fri Feb 5 09:48:24 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit 48fccde2bfb60efdbf45a96fa53bcd9a6570bf89) -commit 349b71a37e4a87e3650b5c0df9651b2ce967293e +commit f175cf45aebcdda53f3ae49c0eaf27da1f194e92 Author: Olivier Fourdan Date: Wed Feb 10 09:34:34 2016 +0100 @@ -1802,9 +11212,8 @@ Date: Wed Feb 10 09:34:34 2016 +0100 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit f175cf45aebcdda53f3ae49c0eaf27da1f194e92) -commit 860669b1867178fe46df9da98591ea5a47f427f1 +commit 17097e083b2392c8989474f6e0da8cc234329e9c Author: Olivier Fourdan Date: Fri Feb 5 09:48:22 2016 +0100 @@ -1814,9 +11223,8 @@ Date: Fri Feb 5 09:48:22 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit 17097e083b2392c8989474f6e0da8cc234329e9c) -commit 64053645cfd950bb0b6c3fda8deb60e1e540ce69 +commit ddfb8c009ac651209eb0087aaf86b54e1446e8b2 Author: Olivier Fourdan Date: Fri Feb 5 09:48:21 2016 +0100 @@ -1827,9 +11235,8 @@ Date: Fri Feb 5 09:48:21 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit ddfb8c009ac651209eb0087aaf86b54e1446e8b2) -commit 227b533bf414e03e9a73d0d9e47a761fc597c360 +commit e29a64de662112b8ebcd3f20c89df0e8c51890ef Author: Olivier Fourdan Date: Fri Feb 5 09:48:20 2016 +0100 @@ -1845,9 +11252,8 @@ Date: Fri Feb 5 09:48:20 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit e29a64de662112b8ebcd3f20c89df0e8c51890ef) -commit 9824faaa58efe55a372d7dd0f6c5cbf84e77af61 +commit b7962ade5265a21ac7c60da6cc07ece15ef7e648 Author: Olivier Fourdan Date: Fri Feb 5 09:48:19 2016 +0100 @@ -1861,9 +11267,8 @@ Date: Fri Feb 5 09:48:19 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit b7962ade5265a21ac7c60da6cc07ece15ef7e648) -commit 3b52aee6dddc2cd2780f729e9389a1515c544c61 +commit 12f714fd95dc9d912c0bf2524005a73ec6e8ee4f Author: Olivier Fourdan Date: Fri Feb 5 09:48:18 2016 +0100 @@ -1878,9 +11283,8 @@ Date: Fri Feb 5 09:48:18 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit 12f714fd95dc9d912c0bf2524005a73ec6e8ee4f) -commit b241fd6413775f76a5faaea0f685a8294322e2fc +commit f6f7e21133c13c34f306a191137d566e83b40929 Author: Olivier Fourdan Date: Fri Feb 5 09:48:17 2016 +0100 @@ -1892,9 +11296,8 @@ Date: Fri Feb 5 09:48:17 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit f6f7e21133c13c34f306a191137d566e83b40929) -commit 2028b9066ddbbeaf585e154d19c2672cccdda9bb +commit 6e898ef080df93e885ead9d6fee8854b34e0216f Author: Olivier Fourdan Date: Fri Feb 5 09:48:16 2016 +0100 @@ -1906,9 +11309,8 @@ Date: Fri Feb 5 09:48:16 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit 6e898ef080df93e885ead9d6fee8854b34e0216f) -commit cb3a8768db1b7b2f98f62e3075aa0dd2a46edd9d +commit 341f3bccafde71754a9ed2303df9908e509c6d31 Author: Olivier Fourdan Date: Fri Feb 5 09:48:15 2016 +0100 @@ -1922,9 +11324,8 @@ Date: Fri Feb 5 09:48:15 2016 +0100 Reviewed-by: Adam Jackson Signed-off-by: Olivier Fourdan - (cherry picked from commit 341f3bccafde71754a9ed2303df9908e509c6d31) -commit 45d17e6bb0ee35662913cd6ce378460aa7e461cc +commit d8882954570aba656d5a7be7d357feaba21cb099 Author: Chris Wilson Date: Fri Feb 12 11:59:53 2016 +0000 @@ -1941,9 +11342,8 @@ Date: Fri Feb 12 11:59:53 2016 +0000 Reviewed-by: Adam Jackson Signed-off-by: Chris Wilson - (cherry picked from commit d8882954570aba656d5a7be7d357feaba21cb099) -commit 204e85786f24c1ab734ab9ee015efbb790dee130 +commit bc3634010c096dffd1935c0c6cf8ba37534ae3d8 Author: Chris Wilson Date: Fri Feb 12 11:59:52 2016 +0000 @@ -1954,9 +11354,17 @@ Date: Fri Feb 12 11:59:52 2016 +0000 Reviewed-by: Adam Jackson Signed-off-by: Chris Wilson - (cherry picked from commit bc3634010c096dffd1935c0c6cf8ba37534ae3d8) -commit c06a4b4a2422e937eda36a4ec10bdafc71001be7 +commit 9fecc4cd571641f8920f25473ce5abb3fdca8b40 +Author: Jon Turney +Date: Tue Jan 12 16:18:35 2016 +0000 + + xwin: Remove unhelpful debug about WM message queue size + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit f7d1e5acdf5ed4ab4ed5c18727aa6f3d379ef560 Author: Jon Turney Date: Tue Aug 11 15:45:57 2015 +0100 @@ -1964,9 +11372,8 @@ Date: Tue Aug 11 15:45:57 2015 +0100 Signed-off-by: Jon Turney Reviewed-by: Colin Harrison - (cherry picked from commit f7d1e5acdf5ed4ab4ed5c18727aa6f3d379ef560) -commit 6f099c7bd59039834c7b45289310b003b81cb3e3 +commit e7f87f8f76e5ac9479a71e3daf2cfdefd4b5f684 Author: Jon Turney Date: Thu Jul 2 19:21:11 2015 +0100 @@ -1978,9 +11385,24 @@ Date: Thu Jul 2 19:21:11 2015 +0100 Signed-off-by: Jon Turney Reviewed-by: Colin Harrison - (cherry picked from commit e7f87f8f76e5ac9479a71e3daf2cfdefd4b5f684) -commit 41cbb7da4e9337d4136d378f5fa45365f41f02e4 +commit 856a28f63739bffe32f5a8156fd2680e5c5259a1 +Author: Jon Turney +Date: Thu Jul 2 13:32:40 2015 +0100 + + xwin: Factor out MessageName() debug helper + + Factor out the MessageName() debug helper for message id -> text, and + use it on message queue and dequeue. + + Reorder in numerical order to match winwindow.h + + Add missing WM_WM_ICON_EVENT + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit 8c2006ddc5abbd4ac374dabf1cfdd3df8fc88779 Author: Jon Turney Date: Mon Feb 22 17:41:14 2016 +0000 @@ -1998,9 +11420,8 @@ Date: Mon Feb 22 17:41:14 2016 +0000 Signed-off-by: Jon Turney Reviewed-by: Colin Harrison - (cherry picked from commit 8c2006ddc5abbd4ac374dabf1cfdd3df8fc88779) -commit da7745065ee27d62cc2eba4e860118459917dad9 +commit 8c97a0078e7fe22e6159fa53490dfca2f4d267a9 Author: Colin Harrison Date: Wed Nov 19 22:33:39 2014 +0000 @@ -2008,9 +11429,8 @@ Date: Wed Nov 19 22:33:39 2014 +0000 Signed-off-by: Colin Harrison Reviewed-by: Jon Turney - (cherry picked from commit 8c97a0078e7fe22e6159fa53490dfca2f4d267a9) -commit c1eb12f89c2391cd99a834da6b342f104da1eb5c +commit a4d8a64c4ba467964476c4a1486da698bd6aed9e Author: Jon Turney Date: Tue Feb 10 14:36:37 2015 +0000 @@ -2047,9 +11467,8 @@ Date: Tue Feb 10 14:36:37 2015 +0000 Signed-off-by: Jon Turney Reviewed-by: Colin Harrison - (cherry picked from commit a4d8a64c4ba467964476c4a1486da698bd6aed9e) -commit 771a668188793e7261ae2cbf7d7289b8a133316a +commit 008efebda801b9b80e2ab3f2c95aeef8c82102ee Author: Jon Turney Date: Sat Oct 18 17:31:57 2014 +0100 @@ -2061,9 +11480,8 @@ Date: Sat Oct 18 17:31:57 2014 +0100 Signed-off-by: Jon Turney Reviewed-by: Colin Harrison - (cherry picked from commit 008efebda801b9b80e2ab3f2c95aeef8c82102ee) -commit 00199e8c822fcf6a933637410e44e08ac659f682 +commit de7f1fd6f8f10f07b366ae5428a8c65a224bda98 Author: Jon Turney Date: Wed Jul 9 14:26:54 2014 +0100 @@ -2074,9 +11492,8 @@ Date: Wed Jul 9 14:26:54 2014 +0100 Signed-off-by: Jon Turney Reviewed-by: Colin Harrison - (cherry picked from commit de7f1fd6f8f10f07b366ae5428a8c65a224bda98) -commit 0fb47bd27919a7f1e47db3bd3f97fd9a07ccc517 +commit a9e73131b6453e0fa2da5360e84af7a2eae3b205 Author: Jon Turney Date: Thu May 8 11:40:39 2014 +0100 @@ -2084,9 +11501,8 @@ Date: Thu May 8 11:40:39 2014 +0100 Signed-off-by: Jon Turney Reviewed-by: Colin Harrison - (cherry picked from commit a9e73131b6453e0fa2da5360e84af7a2eae3b205) -commit 1e143cff16835dd69559ca5646f313dad3db75ab +commit d7cef6fbe23381b31c163468f349feee2f1b1eba Author: Jon Turney Date: Thu Mar 13 18:04:17 2014 +0000 @@ -2101,9 +11517,8 @@ Date: Thu Mar 13 18:04:17 2014 +0000 Signed-off-by: Jon Turney Reviewed-by: Colin Harrison - (cherry picked from commit d7cef6fbe23381b31c163468f349feee2f1b1eba) -commit f0c2a3527797cf2bfbfa4697c294ae087c1e4423 +commit f75404be3ad94c8da493688397712c65ea66cb90 Author: Jon Turney Date: Fri Mar 28 16:57:48 2014 +0000 @@ -2114,9 +11529,20 @@ Date: Fri Mar 28 16:57:48 2014 +0000 Signed-off-by: Jon Turney Reviewed-by: Colin Harrison - (cherry picked from commit f75404be3ad94c8da493688397712c65ea66cb90) -commit e457e93e5d33cbec387e40051fbabf6cf76d6af3 +commit 9dc32746f2cd161b512cce8f39c95287bdf1a3a3 +Author: Jon Turney +Date: Tue Nov 10 10:27:07 2015 +0000 + + xwin: Fix format warnings when ./configured --enable-debug --enable-windowswm + + Fix format warnings (mainly pointer format fixes) which show up when + ./configured --enable-debug --enable-windowswm + + Signed-off-by: Jon Turney + Reviewed-by: Colin Harrison + +commit b4ac7b142fa3c536e9b283cfd34b94d82c03aac6 Author: Michel Dänzer Date: Wed Feb 24 16:52:59 2016 +0900 @@ -2134,9 +11560,8 @@ Date: Wed Feb 24 16:52:59 2016 +0900 Reviewed-by: Chris Wilson Signed-off-by: Michel Dänzer - (cherry picked from commit b4ac7b142fa3c536e9b283cfd34b94d82c03aac6) -commit eb5108b87017128f394ae31b5b7cd85dd8819bca +commit e7a35b9e16aa12970908f5d55371bb1b862f8f24 Author: Michel Dänzer Date: Wed Feb 24 16:52:58 2016 +0900 @@ -2152,9 +11577,8 @@ Date: Wed Feb 24 16:52:58 2016 +0900 Reviewed-by: Chris Wilson Signed-off-by: Michel Dänzer - (cherry picked from commit e7a35b9e16aa12970908f5d55371bb1b862f8f24) -commit cf30b7cfd6d91da16c762332617fc165d82f17d2 +commit 1a9f8c4623c4e6b6955cb6d5f44d29c244dfd32a Author: Michel Dänzer Date: Wed Feb 24 16:52:57 2016 +0900 @@ -2165,9 +11589,8 @@ Date: Wed Feb 24 16:52:57 2016 +0900 Reviewed-by: Chris Wilson Signed-off-by: Michel Dänzer - (cherry picked from commit 1a9f8c4623c4e6b6955cb6d5f44d29c244dfd32a) -commit 8869f45a965a7b12bb7fe03ba226167e1f821c1e +commit 0461bca0cb2f7918c77ed45d2cbc756cf65021be Author: Laércio de Sousa Date: Mon Feb 22 16:04:12 2016 -0300 @@ -2182,9 +11605,8 @@ Date: Mon Feb 22 16:04:12 2016 -0300 Reviewed-by: Adam Jackson Signed-off-by: Laércio de Sousa - (cherry picked from commit 0461bca0cb2f7918c77ed45d2cbc756cf65021be) -commit 05f3cf659be44caf00e801a5bcd9362a1a87aa46 +commit 30b7d7995ef70b7473e0fb170eb8ae23b8d1f4a7 Author: Jon TURNEY Date: Mon Feb 22 16:20:00 2016 +0000 @@ -2213,9 +11635,8 @@ Date: Mon Feb 22 16:20:00 2016 +0000 Reviewed-by: Adam Jackson Signed-off-by: Jon Turney - (cherry picked from commit 30b7d7995ef70b7473e0fb170eb8ae23b8d1f4a7) -commit 10e46504711427ed5280fdeb974a08b888f47034 +commit 544b4149268561d3d794aa540172831fa7550a20 Author: Jonas Ådahl Date: Fri Feb 19 15:08:12 2016 +0800 @@ -2228,9 +11649,8 @@ Date: Fri Feb 19 15:08:12 2016 +0800 Reviewed-by: Adam Jackson Signed-off-by: Jonas Ådahl - (cherry picked from commit 544b4149268561d3d794aa540172831fa7550a20) -commit de7f91c079d7168c107bb8b8dbe651eebd8e9a12 +commit 5627708e5f447d0e360bbc9eb8d1c4e58c5046d0 Author: Marc-Andre Lureau Date: Fri Feb 12 22:52:07 2016 +0100 @@ -2241,9 +11661,8 @@ Date: Fri Feb 12 22:52:07 2016 +0100 Signed-off-by: Marc-André Lureau Reviewed-by: Dave Airlie - (cherry picked from commit 5627708e5f447d0e360bbc9eb8d1c4e58c5046d0) -commit 16573a4c35cb71f204b37ad1c3b3d115e84b2cd8 +commit e957a2e5dd288f515f3e93724823542c20333f6a Author: Daniel Stone Date: Fri Feb 12 16:36:59 2016 +0000 @@ -2271,9 +11690,8 @@ Date: Fri Feb 12 16:36:59 2016 +0000 Signed-off-by: Daniel Stone Tested-by: Olivier Fourdan Reviewed-by: Adam Jackson - (cherry picked from commit e957a2e5dd288f515f3e93724823542c20333f6a) -commit 29d1c5a8e4127d5fd1a0d41f8e1474e9dfdb9638 +commit dbe8d03c42f01332b3dc41fe9290aed142f1436f Author: Keith Packard Date: Tue Feb 16 20:03:57 2016 -0800 @@ -2284,9 +11702,8 @@ Date: Tue Feb 16 20:03:57 2016 -0800 Signed-off-by: Keith Packard Reviewed-by: Dave Airlie - (cherry picked from commit dbe8d03c42f01332b3dc41fe9290aed142f1436f) -commit fc3eef6024355206ea429eb5e2d36001fa47a884 +commit eddf848c44349c7ebc7da9957bffb3630f3faaa9 Author: Adam Jackson Date: Wed Feb 10 11:13:04 2016 -0500 @@ -2309,9 +11726,20 @@ Date: Wed Feb 10 11:13:04 2016 -0500 Tested-by: Chris Wilson Reviewed-by: Chris Wilson Signed-off-by: Adam Jackson - (cherry picked from commit eddf848c44349c7ebc7da9957bffb3630f3faaa9) -commit 9db37e05a96d1488b7cb30b7e1ccd4c73b38d915 +commit b3e9c534e2b0dc2c9acd2fe9b942e1fc5227339b +Author: Adam Jackson +Date: Mon Feb 8 17:36:03 2016 -0500 + + os: unifdef STREAMSCONN + + Removed from xtrans in 2012, and never wired up in the modular build + anyway. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + +commit e43abdce964f5ed9689cf908af8c305b39a5dd36 Author: Chris Wilson Date: Wed Feb 3 09:54:46 2016 +0000 @@ -2328,9 +11756,8 @@ Date: Wed Feb 3 09:54:46 2016 +0000 Signed-off-by: Chris Wilson Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä - (cherry picked from commit e43abdce964f5ed9689cf908af8c305b39a5dd36) -commit 7be0e08cd91ed4be18eefb04018be36dcf0f427e +commit a722d617a092f08f69086630f5cfb598d4a21cc7 Author: Adam Jackson Date: Wed Dec 9 09:10:13 2015 -0500 @@ -2343,9 +11770,8 @@ Date: Wed Dec 9 09:10:13 2015 -0500 Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson - (cherry picked from commit a722d617a092f08f69086630f5cfb598d4a21cc7) -commit c388b2d52177eb7f66a63a8454cee1990b4813d9 +commit 7bb64d8c1de9659f11da7917772919b071e9db82 Author: Jan Burgmeier Date: Thu Feb 4 14:06:43 2016 +0100 @@ -2358,9 +11784,8 @@ Date: Thu Feb 4 14:06:43 2016 +0100 Bugzilla: https://bugs.freedesktop.org/92313 Reviewed-by: Dave Airlie - (cherry picked from commit 7bb64d8c1de9659f11da7917772919b071e9db82) -commit 18155405875608f3a46db465aa9753d66b099f8e +commit 87d5534f701242d7c23aa20545a6292a0779c89c Author: Rui Matos Date: Wed Feb 3 16:14:09 2016 +0100 @@ -2376,9 +11801,8 @@ Date: Wed Feb 3 16:14:09 2016 +0100 Acked-by: Pekka Paalanen Reviewed-by: Daniel Stone Reviewed-by: Jonas Ådahl - (cherry picked from commit 87d5534f701242d7c23aa20545a6292a0779c89c) -commit eac170e469cb66a7e5a47d00c56ddc53c63cca85 +commit b7d392931a309d0fe754869efb456ccd0385f3aa Author: Chris Wilson Date: Wed Feb 3 09:54:43 2016 +0000 @@ -2393,9 +11817,77 @@ Date: Wed Feb 3 09:54:43 2016 +0000 Signed-off-by: Chris Wilson Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä - (cherry picked from commit b7d392931a309d0fe754869efb456ccd0385f3aa) -commit 2fc1752ac39a9325dbc5f8e700fc566ea6f8240f +commit da69f2f15a9917c3ed04e305061683c41338126e +Author: Laércio de Sousa +Date: Fri Dec 11 11:43:14 2015 -0200 + + ephyr: don't load ephyr input driver if -seat option is passed + + When used for single-GPU multi-seat purposes, there's no need to enable + ephyr virtual input devices, since Xephyr is supposed to handle its own + hardware devices. + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 7213e99cbc38a60f0076bc2115b144798ea4c3ba +Author: Laércio de Sousa +Date: Fri Dec 11 11:43:13 2015 -0200 + + ephyr: ignore Xorg multiseat command line options + + Multi-seat-capable display managers commonly pass command-line options + like "-novtswitch", "-sharevts", or "-layout seatXXXX" to Xorg server, + but Xephyr currently refuses to start if these options are passed to it, + which may break Xephyr-based single-GPU multiseat setups. + + [ajax: shortened summary] + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit edd443f69ea385a957b8eae0b066ad8e77fb947b +Author: Laércio de Sousa +Date: Fri Dec 11 11:43:11 2015 -0200 + + kdrive: don't let evdev driver overwrite existing device names + + KDrive evdev driver deliberately name grabbed devices as "Evdev mouse" + or "Evdev keyboard". This patch will make it skip this step if grabbed + devices are already named (i.e. from udev). + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 0b80da0d18713df4712c05973388b6226bb0227f +Author: Laércio de Sousa +Date: Fri Dec 11 11:43:07 2015 -0200 + + kdrive: set "evdev" driver for input devices automatically, if available. + + If kdrive input driver "evdev" is available, no other driver was + explicitly set for a given input device, and its kernel device node is + /dev/input/event*, this patch will make kdrive set "evdev" driver + automatically for such device. + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 6d6fd688ecf95f2e84f2af276d681ff42f9d5610 +Author: Laércio de Sousa +Date: Fri Dec 11 11:43:06 2015 -0200 + + kdrive: fix up NewInputDeviceRequest() implementation + + This patch simplifies NewInputDeviceRequest() implementation in + kinput.c, making use of improved KdParseKbdOptions() / + KdParsePointerOptions() and merging several "if (ki)"/"if (pi)" clauses. + + Reviewed-by: Adam Jackson + Signed-off-by: Laércio de Sousa + +commit 2c3e8768443caa66d78775ea79bb16a5faae3a3c Author: Eric Anholt Date: Wed Jan 27 11:26:16 2016 -0800 @@ -2404,9 +11896,8 @@ Date: Wed Jan 27 11:26:16 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 2c3e8768443caa66d78775ea79bb16a5faae3a3c) -commit 4acebf257e37e075a14b3acecce27d050b18bba8 +commit e82c8c81df80de487aa795d69e874a0811c537ea Author: Eric Anholt Date: Wed Jan 27 11:21:05 2016 -0800 @@ -2424,9 +11915,8 @@ Date: Wed Jan 27 11:21:05 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit e82c8c81df80de487aa795d69e874a0811c537ea) -commit d1c0873228a115ee0ebf46afaf335b8b97a5bbdc +commit 2c3273861cdf874b165ce5a1953102187f71b48e Author: Eric Anholt Date: Wed Jan 27 11:15:27 2016 -0800 @@ -2435,9 +11925,8 @@ Date: Wed Jan 27 11:15:27 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 2c3273861cdf874b165ce5a1953102187f71b48e) -commit b0b160aafc151b1fdf1840134bc344e3ce2f3e85 +commit 990a8ee01324332ee9b4a4bb124ce8f73be24349 Author: Eric Anholt Date: Wed Jan 27 11:10:14 2016 -0800 @@ -2449,9 +11938,8 @@ Date: Wed Jan 27 11:10:14 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 990a8ee01324332ee9b4a4bb124ce8f73be24349) -commit 12e4e3ac31b05b501df74c4fa37274830e30662a +commit 20cb5b2d65ce63ea7934b77f1520387550c778a8 Author: Eric Anholt Date: Wed Jan 27 10:24:17 2016 -0800 @@ -2463,9 +11951,8 @@ Date: Wed Jan 27 10:24:17 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 20cb5b2d65ce63ea7934b77f1520387550c778a8) -commit d5c9c541c5d325453ddb9ebcdcf36bc6ef0af4aa +commit 07f0d90e4a8b05ef968b1ef47acda7c9f4580340 Author: Eric Anholt Date: Tue Jan 26 17:29:48 2016 -0800 @@ -2478,9 +11965,8 @@ Date: Tue Jan 26 17:29:48 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 07f0d90e4a8b05ef968b1ef47acda7c9f4580340) -commit 68bd172432de069aa242d21b3af505867417ae45 +commit 0dbce65b08f4812dcaa4b77cd37aebac334c47a2 Author: Eric Anholt Date: Tue Jan 26 15:56:27 2016 -0800 @@ -2491,9 +11977,8 @@ Date: Tue Jan 26 15:56:27 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 0dbce65b08f4812dcaa4b77cd37aebac334c47a2) -commit 6a71251b3985d6dd7c1ab1fa6e13f1edaa33a5c5 +commit 9b676786de32f06aedf9d4c9535c10fda247335a Author: Eric Anholt Date: Tue Jan 26 15:47:01 2016 -0800 @@ -2505,9 +11990,8 @@ Date: Tue Jan 26 15:47:01 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 9b676786de32f06aedf9d4c9535c10fda247335a) -commit 2db5bf7a1297a84e516ce87b24dd3982e7674bb2 +commit 03f34f85563c81e1655626e10f75fd7e21393c92 Author: Eric Anholt Date: Tue Jan 26 15:19:50 2016 -0800 @@ -2521,9 +12005,8 @@ Date: Tue Jan 26 15:19:50 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 03f34f85563c81e1655626e10f75fd7e21393c92) -commit 9be8478467fc4827ca8edc035f0a6d1cca78fbe0 +commit f368a0ba3aa58e5260d839d11d2f3aef75feaeaf Author: Eric Anholt Date: Tue Jan 26 14:52:08 2016 -0800 @@ -2538,9 +12021,8 @@ Date: Tue Jan 26 14:52:08 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit f368a0ba3aa58e5260d839d11d2f3aef75feaeaf) -commit d23fe3229c17cb0dfb4210041efbdc36fc365dad +commit 294e45b60d99cf7d11c657288bbe2670b56775f3 Author: Eric Anholt Date: Tue Jan 26 14:18:48 2016 -0800 @@ -2551,9 +12033,8 @@ Date: Tue Jan 26 14:18:48 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 294e45b60d99cf7d11c657288bbe2670b56775f3) -commit ef993dbbed24f1fe68fd4c66f0035e6c74cde10d +commit 5d7bef2eedfd965359dd4eebb6ab806cdad5b83f Author: Eric Anholt Date: Tue Jan 26 13:39:18 2016 -0800 @@ -2565,9 +12046,8 @@ Date: Tue Jan 26 13:39:18 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 5d7bef2eedfd965359dd4eebb6ab806cdad5b83f) -commit f031c5edbf36a029800d0f8574aea226a4b5b82f +commit 4494a450405cf539743cbcfe6907bf5bdd2d80cb Author: Eric Anholt Date: Tue Jan 26 15:08:17 2016 -0800 @@ -2578,9 +12058,8 @@ Date: Tue Jan 26 15:08:17 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 4494a450405cf539743cbcfe6907bf5bdd2d80cb) -commit f1a03379c44c467b92753748165380e33e2e28c8 +commit f7c24e6ac345aab91df5fc959f239a33f37113b1 Author: Eric Anholt Date: Tue Jan 26 13:34:00 2016 -0800 @@ -2589,9 +12068,8 @@ Date: Tue Jan 26 13:34:00 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit f7c24e6ac345aab91df5fc959f239a33f37113b1) -commit 83395e6a99c0665490948c92da9bd768954f8c9e +commit 1fcb6f4cbf3d6514716435a0e79c0e6d53c31a3a Author: Eric Anholt Date: Tue Jan 26 13:31:59 2016 -0800 @@ -2603,9 +12081,8 @@ Date: Tue Jan 26 13:31:59 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 1fcb6f4cbf3d6514716435a0e79c0e6d53c31a3a) -commit 558ea399664b767c3f9c1acc18f4b2d341d6929c +commit 9ef11f13af7f552dadb4a90c248e525a257e0a2c Author: Eric Anholt Date: Thu Jan 21 16:01:14 2016 -0800 @@ -2614,9 +12091,8 @@ Date: Thu Jan 21 16:01:14 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 9ef11f13af7f552dadb4a90c248e525a257e0a2c) -commit 7c63e80e3f9de3d1b8132a40be6f932e772e0d69 +commit b8229cc5f5298a37a4735dd002b0e0ebfc8bc75a Author: Eric Anholt Date: Wed Jan 27 11:35:03 2016 -0800 @@ -2628,9 +12104,8 @@ Date: Wed Jan 27 11:35:03 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit b8229cc5f5298a37a4735dd002b0e0ebfc8bc75a) -commit 14e2b6f9d87921b39c0874e1a74dff2f9e396f78 +commit 68f236ebd4b268a9e525d623986999d230feb453 Author: Eric Anholt Date: Wed Jan 27 16:11:17 2016 -0800 @@ -2641,9 +12116,20 @@ Date: Wed Jan 27 16:11:17 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie Reviewed-by: Kenneth Graunke - (cherry picked from commit 68f236ebd4b268a9e525d623986999d230feb453) -commit cd9ae6d1a259f3229df4c110903658d1bede8554 +commit 623ff251dd025929f5bb6174ca86580c5e707261 +Author: Adam Jackson +Date: Tue Dec 8 17:41:38 2015 -0500 + + xephyr: Remove DRI1 + + This only worked if the backend server supported DRI1, which is + stunningly unlikely these days. + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + +commit 953b71270cf12c59c8a836c9be403d07fb01fa22 Author: Adam Jackson Date: Tue Dec 8 17:41:37 2015 -0500 @@ -2655,9 +12141,17 @@ Date: Tue Dec 8 17:41:37 2015 -0500 Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson - (cherry picked from commit 953b71270cf12c59c8a836c9be403d07fb01fa22) -commit 3da08902dd5961ea6f70431fce813f294d0f8547 +commit 1a48a5863e4bceee6b99c1feda1b2c584ff3657c +Author: Adam Jackson +Date: Tue Dec 8 17:41:36 2015 -0500 + + xfree86: Remove ancient DRI build instructions + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit d8ecbe563991cc689e95a8cb9d510e920eaceea0 Author: Dave Airlie Date: Wed Jan 27 16:46:06 2016 -0800 @@ -2667,9 +12161,31 @@ Date: Wed Jan 27 16:46:06 2016 -0800 Signed-off-by: Dave Airlie Reviewed-by: Dave Airlie - (cherry picked from commit d8ecbe563991cc689e95a8cb9d510e920eaceea0) -commit 4c6ca0aae5a301140eadc97313be954bd6a5fe18 +commit 50ca286d79f6304b972ea74487308e7794a170fb +Author: Timo Aaltonen +Date: Wed Jan 27 14:18:50 2016 +0200 + + dri2: Sync i915_pci_ids.h and i965_pci_ids.h from mesa + + Adds Skylake, Kabylake and Broxton allowing them to use + modesetting + glamor with dri2. + + Signed-off-by: Timo Aaltonen + Reviewed-by: Andreas Boll + +commit bf23db42a4e5943129501223a47b48884cdeb62f +Author: Adam Jackson +Date: Wed Jan 27 11:50:13 2016 -0500 + + modesetting: Require sufficiently new libdrm + + Bugzilla: https://bugs.freedesktop.org/93883 + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + Reviewed-by: Julien Cristau + +commit 6978c8ee666a9224213173e7680e2d71b1094bab Author: Dave Airlie Date: Tue Jan 19 08:06:25 2016 +1000 @@ -2683,9 +12199,8 @@ Date: Tue Jan 19 08:06:25 2016 +1000 Signed-off-by: Dave Airlie Reviewed-by: Eric Anholt - (cherry picked from commit 6978c8ee666a9224213173e7680e2d71b1094bab) -commit b0fa782081f933e84f068228ca35fa5c25c9a4b3 +commit 79c3925532bc0d098c9a4da6d5117bdada56e0af Author: Dave Airlie Date: Tue Jan 19 07:59:59 2016 +1000 @@ -2696,9 +12211,8 @@ Date: Tue Jan 19 07:59:59 2016 +1000 Signed-off-by: Dave Airlie Reviewed-by: Eric Anholt - (cherry picked from commit 79c3925532bc0d098c9a4da6d5117bdada56e0af) -commit 181ea41e71934a0c575322a8be9234f2e64ef8db +commit 98c3504dcfcec227b9c7798a0bd287941cec0691 Author: Keith Packard Date: Wed Sep 10 19:05:08 2014 -0700 @@ -2714,9 +12228,8 @@ Date: Wed Sep 10 19:05:08 2014 -0700 Signed-off-by: Keith Packard Signed-off-by: Dave Airlie Reviewed-by: Eric Anholt - (cherry picked from commit 98c3504dcfcec227b9c7798a0bd287941cec0691) -commit d7f03d57454de989025de2a2ef644d43eead9ddf +commit 564d9f0f8c17bb3c13aa3ca36da7825454dc5de3 Author: Dave Airlie Date: Mon Jan 11 14:00:35 2016 +1000 @@ -2733,9 +12246,8 @@ Date: Mon Jan 11 14:00:35 2016 +1000 Signed-off-by: Dave Airlie Reviewed-by: Eric Anholt - (cherry picked from commit 564d9f0f8c17bb3c13aa3ca36da7825454dc5de3) -commit 0cd5b9525a8f661c6b2545c21ce1ba21577c009e +commit e6754dcb59ee21abb42421a28f4e467295584f67 Author: Keith Packard Date: Wed Sep 10 19:02:55 2014 -0700 @@ -2754,49 +12266,8 @@ Date: Wed Sep 10 19:02:55 2014 -0700 Signed-off-by: Keith Packard Signed-off-by: Dave Airlie Reviewed-by: Eric Anholt - (cherry picked from commit e6754dcb59ee21abb42421a28f4e467295584f67) -commit 7bd0f79c38cac71d433b1ec7e56a6ff7c2550bcc -Author: Eric Anholt -Date: Thu Jun 18 11:14:41 2015 -0700 - - glamor: Delay making pixmaps shareable until we need to. - - If a pixmap isn't getting exported as a dmabuf, then we don't need to - make an EGLImage/GBM bo for it. This should reduce normal pixmap - allocation overhead, and also lets the driver choose non-scanout - formats which may be much higher performance. - - On Raspberry Pi, where scanout isn't usable as a texture source, this - improves x11perf -copypixwin100 from about 4300/sec to 5780/sec under - xcompmgr -a, because we no longer need to upload our x11perf window to - a tiled temporary in order to render it to the screen. - - v2: Just use pixmap->usage_hint instead of a new field. Drop the - changes that started storing gbm_bos in the pixmap priv due to - lifetime issues. - v3: Fix a missing gbm_bo_destroy() on the pixmap-from-fd success path. - - [ajax: Restore glamor_egl_create_argb8888_based_texture for ABI reasons. - I'm not aware of any driver using it directly, but.] - - Signed-off-by: Eric Anholt - Reviewed-by: Michel Dänzer - (cherry picked from commit 51984dddfcc7133ed3c1f20d03514aa98c9a7831) - -commit ec9b79c8d497522f87697e434f55086f185e65e7 -Author: Eric Anholt -Date: Thu Jun 18 11:26:46 2015 -0700 - - glamor: Simplify DRI3 pixmap-from-fd, using GBM. - - This GBM import path was introduced in 10.2, which we already require. - - Signed-off-by: Eric Anholt - Reviewed-by: Michel Dänzer - (cherry picked from commit 6be33fd044949330e0b2b4185882c9664d2f90b4) - -commit fba0d8a3c9deff557f8a9735fc907556e4e861aa +commit 5042b0652b9fe5fed57a233880c3429ba390d86d Author: Eric Anholt Date: Wed Jan 20 12:33:25 2016 -0800 @@ -2807,9 +12278,21 @@ Date: Wed Jan 20 12:33:25 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie - (cherry picked from commit 5042b0652b9fe5fed57a233880c3429ba390d86d) -commit 389761e592184d78969469914d1aba5d281824fd +commit 1fd82c764d5b24107e60f2173e30e5d24a2f2667 +Author: Dave Airlie +Date: Tue Jan 19 02:01:09 2016 +0000 + + glamor: don't do copy if we have 0 boxes to copy. + + This happens if you run twm + mplayer + xclock and drag + the clock over the mplayer. If we don't catch it, we cause + an illegal draw elements command to be passed to GL. + + Signed-off-by: Dave Airlie + Reviewed-by: Eric Anholt + +commit e7308b6c77561df44c04f81509f8ada678705d94 Author: Dave Airlie Date: Tue Jan 12 18:13:46 2016 +1000 @@ -2830,9 +12313,8 @@ Date: Tue Jan 12 18:13:46 2016 +1000 Signed-off-by: Dave Airlie Signed-off-by: Eric Anholt - (cherry picked from commit e7308b6c77561df44c04f81509f8ada678705d94) -commit 2e79da2dce15b25534ea83eb453cb9b762a2e29f +commit cab14a9a08ff06bc4cbef79c7be8f1d07c07ebf9 Author: Eric Anholt Date: Thu Jan 21 12:01:02 2016 -0800 @@ -2845,101 +12327,8 @@ Date: Thu Jan 21 12:01:02 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie - (cherry picked from commit cab14a9a08ff06bc4cbef79c7be8f1d07c07ebf9) -commit aad8e4714a2bdeada5c7ae42d2047cf6a4720d19 -Author: Keith Packard -Date: Wed Sep 10 16:17:52 2014 -0700 - - glamor: Use vertex array objects - - Core contexts require the use of vertex array objects, so switch both glamor - and ephyr/glamor over. - - Signed-off-by: Keith Packard - Reviewed-by: Eric Anholt - Signed-off-by: Dave Airlie - (cherry picked from commit 49aa5e3ea4eecea0562c05a4e52962985a56e510) - -commit 6691f523332a5993d3e90e16d8edff7f3b85c4ae -Author: Dave Airlie -Date: Tue Jan 19 10:34:14 2016 +1000 - - glamor/xv: add vbo support (v2.1) - - This converts the Xv code to using VBOs instead of - client ptrs. This is necessary to move towards using - the core profile later. - - v2: put all boxes into single vbo, use draw arrays - to offset things. (Eric) - v2.1: brown paper bag with releasing vbo. - - Reviewed-by: Eric Anholt - Signed-off-by: Dave Airlie - (cherry picked from commit d99204fb5e09ce7be36485d4226f7ad6d6eb24cc) - -commit eabe0e0b3685b5ab38c3597f238e92a3e4598441 -Author: Dave Airlie -Date: Mon Jan 11 14:00:04 2016 +1000 - - glamor: use vbos in gradient/picture code. - - This converts two client arrays users to using vbos, - this is necessary to move to using core profile later. - - Reviewed-by: Eric Anholt - Signed-off-by: Dave Airlie - (cherry picked from commit 5582ad1b9b29934498cf3fef305d3a988130cd52) - -commit 23e60f917a5af652cd83b8a3a9951c79838721b3 -Author: Adam Jackson -Date: Mon Feb 8 18:32:57 2016 -0500 - - xserver 1.18.1 - - Signed-off-by: Adam Jackson - -commit a0d49b1c660f2453d07ce23bf86b0ef717f3d2c8 -Author: Timo Aaltonen -Date: Wed Jan 27 14:18:50 2016 +0200 - - dri2: Sync i915_pci_ids.h and i965_pci_ids.h from mesa - - Adds Skylake, Kabylake and Broxton allowing them to use - modesetting + glamor with dri2. - - Signed-off-by: Timo Aaltonen - Reviewed-by: Andreas Boll - (cherry picked from commit 50ca286d79f6304b972ea74487308e7794a170fb) - -commit bc4b234d6f4b7b211f7a9750a97524e9652d0e6e -Author: Adam Jackson -Date: Wed Jan 27 11:50:13 2016 -0500 - - modesetting: Require sufficiently new libdrm - - Bugzilla: https://bugs.freedesktop.org/93883 - Signed-off-by: Adam Jackson - Reviewed-by: Alex Deucher - Reviewed-by: Julien Cristau - (cherry picked from commit bf23db42a4e5943129501223a47b48884cdeb62f) - -commit 0b95625cecc7dc2cb6aff61edbc8366e8ffd516f -Author: Dave Airlie -Date: Tue Jan 19 02:01:09 2016 +0000 - - glamor: don't do copy if we have 0 boxes to copy. - - This happens if you run twm + mplayer + xclock and drag - the clock over the mplayer. If we don't catch it, we cause - an illegal draw elements command to be passed to GL. - - Signed-off-by: Dave Airlie - Reviewed-by: Eric Anholt - (cherry picked from commit 1fd82c764d5b24107e60f2173e30e5d24a2f2667) - -commit 71be56c426bd9b66cbc5ab23923f4564e066cd75 +commit 510c8605641803f1f5b5d2de6d3bb422b148e0e7 Author: Eric Anholt Date: Thu Jan 21 11:30:15 2016 -0800 @@ -2955,9 +12344,8 @@ Date: Thu Jan 21 11:30:15 2016 -0800 Signed-off-by: Eric Anholt Reviewed-by: Dave Airlie - (cherry picked from commit 510c8605641803f1f5b5d2de6d3bb422b148e0e7) -commit 6a4f771c5da99d5f723d61e1a780390a5e6b161b +commit bc415fb1e0031ad23bda6e9c3f4664532876a0e5 Author: Adam Jackson Date: Wed Jan 20 15:43:10 2016 -0500 @@ -2977,9 +12365,50 @@ Date: Wed Jan 20 15:43:10 2016 -0500 Reviewed-by: Ilia Mirkin Signed-off-by: Adam Jackson - (cherry picked from commit bc415fb1e0031ad23bda6e9c3f4664532876a0e5) -commit ff562c9f98bbce91b61b06dfc51aa30c14180cdd +commit 49aa5e3ea4eecea0562c05a4e52962985a56e510 +Author: Keith Packard +Date: Wed Sep 10 16:17:52 2014 -0700 + + glamor: Use vertex array objects + + Core contexts require the use of vertex array objects, so switch both glamor + and ephyr/glamor over. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + Signed-off-by: Dave Airlie + +commit d99204fb5e09ce7be36485d4226f7ad6d6eb24cc +Author: Dave Airlie +Date: Tue Jan 19 10:34:14 2016 +1000 + + glamor/xv: add vbo support (v2.1) + + This converts the Xv code to using VBOs instead of + client ptrs. This is necessary to move towards using + the core profile later. + + v2: put all boxes into single vbo, use draw arrays + to offset things. (Eric) + v2.1: brown paper bag with releasing vbo. + + Reviewed-by: Eric Anholt + Signed-off-by: Dave Airlie + +commit 5582ad1b9b29934498cf3fef305d3a988130cd52 +Author: Dave Airlie +Date: Mon Jan 11 14:00:04 2016 +1000 + + glamor: use vbos in gradient/picture code. + + This converts two client arrays users to using vbos, + this is necessary to move to using core profile later. + + Reviewed-by: Eric Anholt + Signed-off-by: Dave Airlie + +commit 25eca80265654cfbf8768024e027426fedeb0918 Author: Michel Dänzer Date: Fri Jan 15 18:22:21 2016 +0900 @@ -3008,9 +12437,8 @@ Date: Fri Jan 15 18:22:21 2016 +0900 Reviewed-by: Keith Packard Reviewed-by: Martin Peres Signed-off-by: Keith Packard - (cherry picked from commit 25eca80265654cfbf8768024e027426fedeb0918) -commit 9505783c2270b6da13cc5691b94f48ff72d7b625 +commit 1db6de7b6a6ee240eb50a13fe1fa1e135d7cb93b Author: Michel Dänzer Date: Tue Jan 12 15:42:47 2016 +0900 @@ -3027,9 +12455,8 @@ Date: Tue Jan 12 15:42:47 2016 +0900 Reviewed-by: Emil Velikov Signed-off-by: Michel Dänzer Reviewed-by: Eric Anholt - (cherry picked from commit 1db6de7b6a6ee240eb50a13fe1fa1e135d7cb93b) -commit 9e45b28e998a4e0aacd1224b5d4f479ee453fdb9 +commit 8116fd8a760b5935645def1b2c3b155c05927850 Author: Dave Airlie Date: Tue Jan 12 14:19:24 2016 +1000 @@ -3048,9 +12475,8 @@ Date: Tue Jan 12 14:19:24 2016 +1000 Reviewed-by: Keith Packard Signed-off-by: Dave Airlie - (cherry picked from commit 8116fd8a760b5935645def1b2c3b155c05927850) -commit f673c6cffb033286bf4f31fbb64f0863dfbe77f6 +commit 64081d0eacf3e53a029b8e8b63096cc153e98549 Author: Dave Airlie Date: Mon Jan 11 17:02:57 2016 +1000 @@ -3064,9 +12490,8 @@ Date: Mon Jan 11 17:02:57 2016 +1000 Reviewed-by: Keith Packard Signed-off-by: Dave Airlie - (cherry picked from commit 64081d0eacf3e53a029b8e8b63096cc153e98549) -commit f7da9e4cd8237795cea4c0cf82148bdd18ec0f92 +commit 6dcb73375e0ce389315d55587623eb84e9d13543 Author: Adam Jackson Date: Wed Jan 6 10:03:23 2016 -0500 @@ -3074,9 +12499,8 @@ Date: Wed Jan 6 10:03:23 2016 -0500 Signed-off-by: Adam Jackson Reviewed-by: Alan Coopersmith - (cherry picked from commit 6dcb73375e0ce389315d55587623eb84e9d13543) -commit 4dfb05aaae9dc7a45294f60ebd3ad454a4707966 +commit 862cbf4c870c9ed913206c6ef4988bdb470e1c39 Author: Thomas Klausner Date: Wed Nov 11 13:32:05 2015 +0100 @@ -3084,9 +12508,8 @@ Date: Wed Nov 11 13:32:05 2015 +0100 Reviewed-by: Adam Jackson Signed-off-by: Thomas Klausner - (cherry picked from commit 862cbf4c870c9ed913206c6ef4988bdb470e1c39) -commit 88f2aa2940b6fb9deea0a1b53d05df02912dc17c +commit 63f83d1b7f496d05b409352749cdb6674d71cf80 Author: Thomas Klausner Date: Tue Jan 5 12:51:41 2016 -0500 @@ -3099,9 +12522,26 @@ Date: Tue Jan 5 12:51:41 2016 -0500 Signed-off-by: Thomas Klausner Acked-by: Michel Dänzer - (cherry picked from commit 63f83d1b7f496d05b409352749cdb6674d71cf80) -commit 320b169c225fa05d83928bad438c4b15481cea1f +commit ba71b69f94f00a6f6910597185610668e79c10be +Author: Alan Coopersmith +Date: Fri Jan 1 17:34:41 2016 -0800 + + Avoid segfault in CloseWellKnownConnections when using -displayfd + + When -displayfd is looping through the possible display ids to use, + if it can't open all the listening sockets for one (say when :0 is + already in use), it calls CloseWellKnownConnections to close all + the ListenTransConns entries before the point that ListenTransFds + was allocated & initialized, so CloseWellKnownConnections would + segfault trying to read entries from a NULL ListenTransFds pointer. + + Introduced by commit 7b02f0b8 + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + +commit edcb6426f20c3be5dd5f50b76a686754aef2f64e Author: Alan Coopersmith Date: Fri Jan 1 18:11:14 2016 -0800 @@ -3116,9 +12556,8 @@ Date: Fri Jan 1 18:11:14 2016 -0800 Reviewed-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit edcb6426f20c3be5dd5f50b76a686754aef2f64e) -commit a32b85bf192bd15e9585e4c13a24407634478b05 +commit fe8562f5316d8c74ca074ad145295c65ddff5fc2 Author: Alan Coopersmith Date: Fri Jan 1 18:10:08 2016 -0800 @@ -3140,9 +12579,90 @@ Date: Fri Jan 1 18:10:08 2016 -0800 Reviewed-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit fe8562f5316d8c74ca074ad145295c65ddff5fc2) -commit 4457fd45efef85b567d4a0ac085d252ffe49020d +commit 792176417f7e62a99c4f07801f74f804d6080de2 +Author: Adam Jackson +Date: Tue Jan 5 12:03:54 2016 -0500 + + Revert "Fix uninitialized variable warnings reported by clang" + + Crashes at startup: + + dmt:~/git/xserver% ./hw/kdrive/ephyr/Xephyr :1 + (EE) Backtrace: + (EE) 0: ./hw/kdrive/ephyr/Xephyr (OsSigHandler+0x29) [0x47c8f9] + (EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7f38d4de6b1f] + (EE) 2: ./hw/kdrive/ephyr/Xephyr (InitNotifyFds+0x17) [0x478697] + (EE) 3: ./hw/kdrive/ephyr/Xephyr (OsInit+0x1e) [0x47c99e] + (EE) 4: ./hw/kdrive/ephyr/Xephyr (dix_main+0x11c) [0x446efc] + (EE) 5: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f38d4dd2580] + (EE) 6: ./hw/kdrive/ephyr/Xephyr (_start+0x29) [0x427099] + (EE) 7: ? (?+0x29) [0x29] + (EE) + (EE) Segmentation fault at address 0x0 + + This reverts commit a221d4737c167589da44595c795d54f2c36b439a. + +commit a221d4737c167589da44595c795d54f2c36b439a +Author: Thomas Klausner +Date: Wed Dec 16 08:36:24 2015 +0100 + + Fix uninitialized variable warnings reported by clang + + Signed-off-by: Thomas Klausner + Acked-by: Michel Dänzer + +commit f3593918a0507cc080875788b2776ebe4f57c694 +Author: Peter Hutterer +Date: Wed Dec 16 09:21:39 2015 +1000 + + xfree86: move check for driver->PreInit up + + No real change, but if the driver is broken and doesn't provide a PreInit + function, then we don't need to worry about logind. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit fc4fbe8224fdc8d7774120b6e978c652a70a50ee +Author: Peter Hutterer +Date: Fri Dec 11 09:31:30 2015 +1000 + + xfree86: add NoMatchFoo directives for InputClass sections + + InputClass sections use various MatchFoo directives to decide which device to + apply to. This usually works fine for specific snippets but has drawbacks for + snippets that apply more generally to a multitude of devices. + + This patch adds a NoMatchFoo directive to negate a match, thus allowing + snippets that only apply if a given condition is not set. Specifically, this + allows for more flexible fallback driver matching, it is now possible to use a + snippet that says "assign driver foo, but only if driver bar wasn't already + assigned to it". For example: + + Section "InputClass" + Identifier "libinput for tablets" + MatchIsTablet "true" + NoMatchDriver "wacom" + Driver "libinput" + EndSection + + The above only assigns libinput to tablet devices if wacom isn't already + assigned to this device, making it possible to select a specific driver by + installing/uninstalling it. + + Signed-off-by: Peter Hutterer + Reviewed-by: Benjamin Tissoires + +commit eb671b804e902011ba901d0833a215799177bad0 +Author: Peter Hutterer +Date: Fri Dec 11 07:26:02 2015 +1000 + + xfree86: whitespace fix + + Signed-off-by: Peter Hutterer + +commit 3d68d1f26709ecb5ce22a9baa0d3d8162574ed6a Author: Siim Põder Date: Mon Jun 8 22:14:12 2015 +0000 @@ -3161,9 +12681,30 @@ Date: Mon Jun 8 22:14:12 2015 +0000 Signed-off-by: Mike Frysinger Signed-off-by: Michal Srb Signed-off-by: Siim Põder - (cherry picked from commit 3d68d1f26709ecb5ce22a9baa0d3d8162574ed6a) -commit 5a89a6336d6b70781101e6395c276649956b9d80 +commit e98b36bc69d805ab52aba95b070a614427d46e05 +Author: Adam Jackson +Date: Tue Dec 8 16:22:16 2015 -0500 + + randr: Silence unused variable warning + + Signed-off-by: Adam Jackson + Reviewed-by: Michel Dänzer + +commit 8c49c883dc196ea57e3f64425c2a5b0a8ce3ba75 +Author: Adam Jackson +Date: Tue Dec 8 15:08:34 2015 -0500 + + sync: Don't allow creating a system counter before sync is initialized + + It probably doesn't work very well since there's other extension setup + we're not doing on this path, and in any event it's not a thing that + happens currently. + + Reviewed-by: Peter Hutterer + Signed-off-by: Adam Jackson + +commit b5f04a79df8b5aab8b558461261d14721f0b3e41 Author: Adam Jackson Date: Tue Dec 8 15:56:17 2015 -0500 @@ -3171,9 +12712,8 @@ Date: Tue Dec 8 15:56:17 2015 -0500 Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson - (cherry picked from commit b5f04a79df8b5aab8b558461261d14721f0b3e41) -commit c10def69e1d92741ab79eee0b26ae80d143c93fb +commit 18729a211a5fdd4f733e44eded754a0e6210b687 Author: Adam Jackson Date: Tue Dec 8 15:53:35 2015 -0500 @@ -3181,9 +12721,8 @@ Date: Tue Dec 8 15:53:35 2015 -0500 Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson - (cherry picked from commit 18729a211a5fdd4f733e44eded754a0e6210b687) -commit e36834cee865152dee5fbe1e8d480b7010466f75 +commit bc996fa4e3c06f65eafe0a88ef491dbf01f31422 Author: Adam Jackson Date: Tue Dec 8 16:04:44 2015 -0500 @@ -3194,9 +12733,8 @@ Date: Tue Dec 8 16:04:44 2015 -0500 Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson - (cherry picked from commit bc996fa4e3c06f65eafe0a88ef491dbf01f31422) -commit bb9bdb213250dbd28a61f91dba2145d20ef5f569 +commit a55e0bc56fd8f9da8f066dc344af19535dd092ca Author: Adam Jackson Date: Tue Dec 8 16:00:19 2015 -0500 @@ -3204,9 +12742,8 @@ Date: Tue Dec 8 16:00:19 2015 -0500 Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson - (cherry picked from commit a55e0bc56fd8f9da8f066dc344af19535dd092ca) -commit 1f5afbba4513c0e0d2d8827f3bbbbc383fd918f0 +commit 2730ccb803c55af74dbdd1bfd982fc23e643554d Author: Adam Jackson Date: Tue Dec 8 15:37:12 2015 -0500 @@ -3214,9 +12751,8 @@ Date: Tue Dec 8 15:37:12 2015 -0500 Reviewed-by: Peter Hutterer Signed-off-by: Adam Jackson - (cherry picked from commit 2730ccb803c55af74dbdd1bfd982fc23e643554d) -commit b63a8cc4f24012267b0cb88bc358e68ab3ceb427 +commit 718223d27452862eedcf1bee6278eae6040d45ea Author: Laércio de Sousa Date: Thu Dec 3 08:05:59 2015 -0200 @@ -3227,9 +12763,8 @@ Date: Thu Dec 3 08:05:59 2015 -0200 Signed-off-by: Laércio de Sousa Reviewed-by: Hans de Goede - (cherry picked from commit 718223d27452862eedcf1bee6278eae6040d45ea) -commit a8b746948db1871c0b28663b99fa839582693087 +commit 7c0ba32ddd5f1d5c65279365fa307dec3433caf3 Author: Bob Ham Date: Fri Dec 4 12:30:47 2015 +0000 @@ -3257,9 +12792,8 @@ Date: Fri Dec 4 12:30:47 2015 +0000 Reviewed-by: Adam Jackson Signed-off-by: Bob Ham - (cherry picked from commit 7c0ba32ddd5f1d5c65279365fa307dec3433caf3) -commit b564cc9121bade2fee22eb14edd360036b7ba0b9 +commit 530d3e5ca0a02039b04ec6a677bbb4e05b78e5f4 Author: Michel Dänzer Date: Thu Dec 3 17:04:09 2015 +0900 @@ -3270,9 +12804,8 @@ Date: Thu Dec 3 17:04:09 2015 +0900 Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher - (cherry picked from commit 530d3e5ca0a02039b04ec6a677bbb4e05b78e5f4) -commit 00f65597c80d01e1c0759527ed1c72bc5af46c29 +commit 2a52c06e235bd79f91851121f53f7c1808fde321 Author: Adam Jackson Date: Mon Dec 7 17:03:02 2015 -0500 @@ -3282,9 +12815,8 @@ Date: Mon Dec 7 17:03:02 2015 -0500 patch. Signed-off-by: Adam Jackson - (cherry picked from commit 2a52c06e235bd79f91851121f53f7c1808fde321) -commit 4415b0cd6f1ddd75f2dc8b2096a89716baa38405 +commit 59b618227ebd024e57720aaaea17596953f5b80e Author: Julian Pidancet Date: Sun Jul 1 18:49:25 2012 +0100 @@ -3327,9 +12859,8 @@ Date: Sun Jul 1 18:49:25 2012 +0100 Reviewed-by: Adam Jackson Signed-off-by: Julian Pidancet - (cherry picked from commit 59b618227ebd024e57720aaaea17596953f5b80e) -commit cc0cefed4f098ce6e933f2142a4fee93df5f652d +commit 72f0724cdc65dc9abbbf70b9feb6cce7c2b9f8a0 Author: Chris Wilson Date: Sun Feb 8 09:47:42 2015 +0000 @@ -3347,9 +12878,8 @@ Date: Sun Feb 8 09:47:42 2015 +0000 Signed-off-by: Chris Wilson Reviewed-by: Michel Dänzer - (cherry picked from commit 72f0724cdc65dc9abbbf70b9feb6cce7c2b9f8a0) -commit cfeea6382b5aaac0dcf59d88f7735b0703c9929f +commit 180b09912c0d2c4a43b5a08678bcad4b818924c7 Author: Chris Wilson Date: Sun Feb 8 09:47:41 2015 +0000 @@ -3363,9 +12893,8 @@ Date: Sun Feb 8 09:47:41 2015 +0000 Signed-off-by: Chris Wilson Reviewed-by: Michel Dänzer - (cherry picked from commit 180b09912c0d2c4a43b5a08678bcad4b818924c7) -commit 4d48ceb8a15fcf521e8be3dba2756b69e54f20cc +commit b2d55338f6b8f43ebcb49994abad123a797248cf Author: Chris Wilson Date: Sun Feb 8 09:47:40 2015 +0000 @@ -3377,9 +12906,8 @@ Date: Sun Feb 8 09:47:40 2015 +0000 Signed-off-by: Chris Wilson Reviewed-by: Michel Dänzer - (cherry picked from commit b2d55338f6b8f43ebcb49994abad123a797248cf) -commit 54c74aa952ac7eecaeeb3f3cba6d2fe8a98cf450 +commit 548a3d5fd69bb059bbaf26ededdc94c212712cd7 Author: Dave Airlie Date: Mon Nov 16 09:05:27 2015 +1000 @@ -3395,9 +12923,8 @@ Date: Mon Nov 16 09:05:27 2015 +1000 Reported-by: Mark Kettenis Reviewed-by: Mark Kettenis Signed-off-by: Dave Airlie - (cherry picked from commit 548a3d5fd69bb059bbaf26ededdc94c212712cd7) -commit d94118fa1b75ea773857b7bbeda96ac181feb994 +commit 771016f0705909c908917b4ccaeafc950ba93c05 Author: Dave Airlie Date: Mon Nov 16 09:05:26 2015 +1000 @@ -3407,9 +12934,8 @@ Date: Mon Nov 16 09:05:26 2015 +1000 Reviewed-by: Mark Kettenis Signed-off-by: Dave Airlie - (cherry picked from commit 771016f0705909c908917b4ccaeafc950ba93c05) -commit 067c4dd5ce06c2f17d54c3b89e23efbc0822a194 +commit 19b0249a5e07b9fc008e5d8709d7e489874415de Author: Arkadiusz Miśkiewicz Date: Mon Nov 16 11:06:57 2015 +0100 @@ -3423,9 +12949,310 @@ Date: Mon Nov 16 11:06:57 2015 +0100 Signed-off-by: Arkadiusz Miśkiewicz Reviewed-by: Michel Dänzer Signed-off-by: Hans de Goede - (cherry picked from commit 19b0249a5e07b9fc008e5d8709d7e489874415de) -commit 8f41c32bb5f3b962d4db105f96d47d8b74f5af79 +commit 5bccde749db93296b7784e4cdc5e54c4443656c1 +Author: Michel Dänzer +Date: Wed Dec 2 18:21:12 2015 +0900 + + randr: Stop dirty tracking for shared pixmap being destroyed + + Otherwise, we leave a dangling reference to the destroyed pixmap in the + master screen's pixmap_dirty_list. + + Fixes regression from commit cf5d6414 ("randr: Factor out shared pixmap + destruction"). + + Reviewed-by: Adam Jackson + Signed-off-by: Michel Dänzer + +commit 2e3d9623ae3f562f81e513cb183ca1b1b68f279c +Author: Adam Jackson +Date: Wed Dec 2 10:42:36 2015 -0500 + + Revert "hw/xfree86: Use NotifyFd for device and other input fd wakeups" + + Reported to break libinput: + + http://lists.freedesktop.org/archives/xorg-devel/2015-December/048091.html + + This reverts commit 1df07dc36ca145c59f51176d9ab2651112506d75. + +commit 7b02f0b87ec2fa0cc5a65307a1fd55c671cec884 +Author: Keith Packard +Date: Wed Nov 11 22:02:17 2015 -0800 + + os: Use NotifyFd interface for listen descriptors + + Replace the custom path for dealing with new incoming connections with + the general-purpose NotifyFd API. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 1df07dc36ca145c59f51176d9ab2651112506d75 +Author: Keith Packard +Date: Wed Nov 11 22:02:16 2015 -0800 + + hw/xfree86: Use NotifyFd for device and other input fd wakeups + + Remove code in xf86Wakeup for dealing with device and other input and + switch to using the new NotifyFd interface. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit e51ea53b26bd9ec05b9209825960af28d0b6bbe1 +Author: Keith Packard +Date: Wed Nov 11 22:02:15 2015 -0800 + + render: Use OsTimer for animated cursor timing + + This replaces the block/wakeup handlers with an OsTimer. This also + avoids problems with performing rendering during the wakeup handler. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 49c0f2413d32fdfe36e45861fcb32aaeab633094 +Author: Keith Packard +Date: Wed Nov 11 22:02:14 2015 -0800 + + os/xdmcp: Replace xdmcp block/wakeup handlers with timer and NotifyFd + + This removes the block and wakeup handlers and replaces them with a + combination of a NotifyFd callback and timers. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 6a121f55381ecbb9cdaaef36ba6135890f3e006f +Author: Keith Packard +Date: Wed Nov 11 22:02:13 2015 -0800 + + Xext/xselinux: Use NotifyFd interface + + Replace block/wakeup handlers with SetNotifyFd. Much nicer now. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit f933a1b38ed1c65cc39fce1ee37aa18e3022c3f0 +Author: Keith Packard +Date: Mon Nov 23 17:36:53 2015 -0800 + + hw/xwayland: Use NotifyFd handler to monitor wayland socket + + Replace the block/wakeup handler with a NotifyFd callback instead. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 8543d4d8bc0526d1c910913b76259e5dee108e74 +Author: Keith Packard +Date: Wed Nov 11 22:02:11 2015 -0800 + + modesetting: Use NotifyFd for drm event monitoring + + Replace the block/wakeup handlers with a NotifyFd callback. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 58354fcf472cefc35b9c19cf84bf079cadfa2e1d +Author: Keith Packard +Date: Wed Nov 11 22:02:10 2015 -0800 + + kdrive/ephyr: Use NotifyFd for XCB connection input [v2] + + Eliminates polling every 20ms for device input. + + v2: rename ephyrPoll to ephyrXcbNotify and fix the API so it can be + used directly for SetNotifyFd. Thanks to Daniel Martin + + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + Cc: Daniel Martin + +commit 483c2a1adf044ba1da844687b908c1c802060d2d +Author: Keith Packard +Date: Wed Nov 11 22:02:09 2015 -0800 + + hw/kdrive: Use NotifyFd for kdrive input devices + + This switches the kdrive code to use FD notification for input + devices, rather than the block and wakeup handlers. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 21c1680e83865a52d88cf8c80fb236d212931e5c +Author: Keith Packard +Date: Wed Nov 11 22:02:08 2015 -0800 + + hw/kdrive: Use NotifyFd interface for kdrive/linux APM monitoring + + Replace the block/wakeup handlers with a NotifyFd callback + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 8c8f3567fe4b4e372e22420810443c43e008da2c +Author: Keith Packard +Date: Wed Nov 11 22:02:07 2015 -0800 + + config: Use NotifyFd interface for udev + + This uses the NotifyFd interface to monitor the udev file descriptor + rather than adding another block/wakeup handler + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit bf920b2390dc27947f87dd0b228518290a5ed85d +Author: Keith Packard +Date: Wed Nov 11 22:02:06 2015 -0800 + + config: Use NotifyFd for dbus interface + + This uses the NotifyFd interface to monitor the dbus socket rather + than a block/wakeup handler. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 91ea0965dd4dfeba0a914c47ad4a64768e983b1b +Author: Keith Packard +Date: Wed Nov 11 22:02:04 2015 -0800 + + dix: Move InitFonts up above screen initialization + + Font initialization was split into two stages, the first was to set up + font privates with a call to ResetFontPrivateIndex, then much later + the call to InitFonts to set up all of the FPEs. Doing the full font + initialization before initializing the video drivers means that we can + move the call to ResetFontPrivateIndex inside InitFonts. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 4020aacd1fc5b9c63369f011aeb9120af9c55218 +Author: Keith Packard +Date: Wed Nov 11 22:02:03 2015 -0800 + + os: Implement support for NotifyFd X_NOTIFY_WRITE + + This adds the ability to be notified when a file descriptor is + available for writing. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 0c41b7af4ab0c8d22b88f201293f59524d1e7317 +Author: Keith Packard +Date: Wed Nov 11 22:02:02 2015 -0800 + + os: Add NotifyFd interfaces + + This provides a callback-based interface to monitor file + descriptors beyond the usual client and device interfaces. + + Modules within the server using file descriptors for reading and/or + writing can call + + Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data); + + mask can be any combination of X_NOTIFY_READ and X_NOTIFY_WRITE. + + When 'fd' becomes readable or writable, the notify_fd function will be + called with the 'fd', the ready conditions and 'data' values as arguments, + + When the module no longer needs to monitor the fd, it will call + + void RemoveNotifyFd(int fd); + + RemoveNotifyFd may be called from the notify function. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit e10ba9e4b52269b2ac75c4802dce4ca47d169657 +Author: Keith Packard +Date: Wed Nov 11 22:02:01 2015 -0800 + + Remove non-smart scheduler. Don't require setitimer. + + This allows the server to call GetTimeInMillis() after each request is + processed to avoid needing setitimer. -dumbSched now turns off the + setitimer. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit c7f4aef8f45e500c900d59f68c653477148907ea +Author: agoins +Date: Wed Nov 25 18:39:31 2015 -0800 + + randr: Cleanup rrSetupPixmapSharing() + + protopix is completely redundant with mscreenpix. Get rid of it. + + We don't need rrScrPriv, so remove it. + + [ajax: also squash an unused variable in RRCrtcDetachScanoutPixmap, + though it'll come back when the rest of this series lands] + + Reviewed-by: Adam Jackson + Signed-off-by: Alex Goins + +commit 8d3f0e964e399dcfa8eb5e85d405217fdc5dbcd4 +Author: agoins +Date: Wed Nov 25 18:39:27 2015 -0800 + + xf86: Bump ABI version to 21 + + Reviewed-by: Adam Jackson + Signed-off-by: Alex Goins + +commit 7006b4e7ff759c899d5391b7d12db889cbc0b535 +Author: agoins +Date: Wed Nov 25 18:39:26 2015 -0800 + + randr: Factor out shared pixmap creation + + The old version of rrCreateSharedPixmap(), in addition to actually creating + a shared pixmap with scanout, also set up pixmap tracking on the source + driver. + + I will be needing to create multiple shared pixmaps for PRIME double + buffering, so factor the part that does shared pixmap creation into its own + function, the new rrCreateSharedPixmap(). Rename the old + rrCreateSharedPixmap() to rrSetupPixmapSharing(), a function that + replicates the old functionality of rrCreateSharedPixmap() using the new + rrCreateSharedPixmap(). + + Reviewed-by: Adam Jackson + Signed-off-by: Alex Goins + +commit cf5d6414e0c21140f763d618bde1e91ad2b1cb49 +Author: agoins +Date: Wed Nov 25 18:39:25 2015 -0800 + + randr: Factor out shared pixmap destruction + + Shared pixmap destruction is done by unrefing the master pixmap twice: once + for the original reference, and once for the reference implicitly added by + PixmapShareToSlave. Then, unrefing the slave pixmap once. + + When I add PRIME double buffering and synchronization, I will need to do + this in multiple places. To avoid duplication of code and comments + explaining it everywhere, factor it out into its own function and use that + in place of where it was before. + + Reviewed-by: Adam Jackson + Signed-off-by: Alex Goins + +commit ab9837cc6a11f46b9df780f131b69de3822c3dd9 Author: Olivier Fourdan Date: Tue Dec 1 17:16:03 2015 +0100 @@ -3441,9 +13268,8 @@ Date: Tue Dec 1 17:16:03 2015 +0100 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92914 Signed-off-by: Olivier Fourdan Reviewed-by: Marek Chalupa - (cherry picked from commit ab9837cc6a11f46b9df780f131b69de3822c3dd9) -commit 2b356cb50139601dcd5393646aad30552fa778a1 +commit 07941a50a547f2ca094e242588298695f48903ed Author: Jonas Ådahl Date: Wed Oct 7 12:01:53 2015 +0800 @@ -3470,9 +13296,8 @@ Date: Wed Oct 7 12:01:53 2015 +0800 Reviewed-by: Adam Jackson Signed-off-by: Jonas Ådahl - (cherry picked from commit 07941a50a547f2ca094e242588298695f48903ed) -commit 74354c4b0086ea1a952b5591846803719e3e3e91 +commit 51a4399b94f9adfac5f7718d4cbf73f793dcca56 Author: Olivier Fourdan Date: Mon Nov 23 08:51:48 2015 +0100 @@ -3488,9 +13313,8 @@ Date: Mon Nov 23 08:51:48 2015 +0100 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93045 Signed-off-by: Olivier Fourdan Tested-by: Marek Chalupa - (cherry picked from commit 51a4399b94f9adfac5f7718d4cbf73f793dcca56) -commit 0a500c3cc74e39a01be24053e152dd52469dd908 +commit 5b2ca3413203210d112a08a4e20d14382abae437 Author: Marek Chalupa Date: Fri Nov 27 14:27:46 2015 +0100 @@ -3502,9 +13326,8 @@ Date: Fri Nov 27 14:27:46 2015 +0100 Signed-off-by: Marek Chalupa Reviewed-by: Olivier Fourdan - (cherry picked from commit 5b2ca3413203210d112a08a4e20d14382abae437) -commit c2e6eddb1bfc5106596729bc3f0a6a381f5be9f4 +commit 646ebea456b4c5251ae997eab8d9b971f97de836 Author: Marek Chalupa Date: Fri Nov 27 14:59:27 2015 +0100 @@ -3517,9 +13340,20 @@ Date: Fri Nov 27 14:59:27 2015 +0100 Signed-off-by: Marek Chalupa Reviewed-by: Olivier Fourdan - (cherry picked from commit 646ebea456b4c5251ae997eab8d9b971f97de836) -commit 68168c764662c0ce4ac8193d293b8befd934f666 +commit e6b106715f24112d1dc7a84c6e37df4b5debb2d0 +Author: Richard PALO +Date: Tue Nov 17 07:02:07 2015 +0100 + + Replace 'sun' with '__sun' + + Globally replace #ifdef and #if defined usage of 'sun' with '__sun' + such that strict ISO compiler modes such as -ansi or -std=c99 can be used. + + Signed-off-by: Richard PALO + Reviewed-by: Alan Coopersmith + +commit 44d0fd435a4eaf45e252b4f00409152a6d599dfc Author: Egbert Eich Date: Tue Nov 24 17:37:36 2015 +0100 @@ -3540,9 +13374,19 @@ Date: Tue Nov 24 17:37:36 2015 +0100 Signed-off-by: Egbert Eich Reviewed-by: Peter Hutterer - (cherry picked from commit 44d0fd435a4eaf45e252b4f00409152a6d599dfc) -commit 84fbfa8a7d40553c5129a667b532ea3a8b63bfb3 +commit eb36924ead40564325aa56d54a973dc8fb4eae83 +Author: Adam Jackson +Date: Tue Nov 24 08:31:21 2015 -0500 + + dix: Remove redundant ChangeWindowProperty + + Use dixChangeWindowProperty(serverClient, ...) instead. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 4affa75a90d2455c81087b930126ad7adfd019f0 Author: Adam Jackson Date: Thu Nov 19 12:21:08 2015 -0500 @@ -3564,9 +13408,70 @@ Date: Thu Nov 19 12:21:08 2015 -0500 Signed-off-by: Adam Jackson Reviewed-by: Olivier Fourdan - (cherry picked from commit 4affa75a90d2455c81087b930126ad7adfd019f0) -commit 115913d9ec8f7961e9a5789972aeb33da9cfd1e4 +commit fee0827a9a695600765f3d04376fc9babe497401 +Author: Daniel Stone +Date: Fri Nov 20 15:37:31 2015 +0000 + + XWayland: Use FocusIn events for keyboard enter + + wl_keyboard::enter is the equivalent of FocusIn + KeymapNotify: it + notifies us that the surface/window has now received the focus, and + provides us a set of keys which are currently down. + + We should use these keys to update the current state, but not to send + any events to clients. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 816015648ffe660ddaa0f7d4d192e555b723c372 +Author: Daniel Stone +Date: Fri Nov 20 15:37:30 2015 +0000 + + Input: Add focus-in event source + + Add a new event source type for keypress events synthesised from focus + notifications (e.g. KeymapNotify from the parent server, when running + nested). This is used to keep the keys-down array in sync with the host + server's, without sending actual keypress events to clients. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit c3788394e9190130a8eed44c5c93eeb93c2a9893 +Author: Daniel Stone +Date: Fri Nov 20 15:37:29 2015 +0000 + + Input: Add DeviceEventSource enum + + Add a flag to DeviceEvents, giving the source of the event. Currently + this only supports a 'normal' flag, but will be used later to add a + 'focus-in' flag, noting events synthesised from key/button arrays on + focus-in notifications. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 2e61901e46d28ce2f436219ad1a495aa0dcd0fba +Author: Daniel Stone +Date: Fri Nov 20 15:37:28 2015 +0000 + + XKB: Split filter execution into a separate function + + Move the giant state machine which maps from a key action to actually + running the filters into a separate function, to be used when adding + KeyFocusIn. + + Signed-off-by: Daniel Stone + Tested-by: Giulio Camuffo + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 71ba82690158f46d50a455e69a83ee0d685bb274 Author: Peter Hutterer Date: Mon Nov 23 07:59:24 2015 +1000 @@ -3576,9 +13481,129 @@ Date: Mon Nov 23 07:59:24 2015 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede - (cherry picked from commit 71ba82690158f46d50a455e69a83ee0d685bb274) -commit c9bd60790c6636a7911ca479e0f9439bc118d74c +commit 51984dddfcc7133ed3c1f20d03514aa98c9a7831 +Author: Eric Anholt +Date: Thu Jun 18 11:14:41 2015 -0700 + + glamor: Delay making pixmaps shareable until we need to. + + If a pixmap isn't getting exported as a dmabuf, then we don't need to + make an EGLImage/GBM bo for it. This should reduce normal pixmap + allocation overhead, and also lets the driver choose non-scanout + formats which may be much higher performance. + + On Raspberry Pi, where scanout isn't usable as a texture source, this + improves x11perf -copypixwin100 from about 4300/sec to 5780/sec under + xcompmgr -a, because we no longer need to upload our x11perf window to + a tiled temporary in order to render it to the screen. + + v2: Just use pixmap->usage_hint instead of a new field. Drop the + changes that started storing gbm_bos in the pixmap priv due to + lifetime issues. + v3: Fix a missing gbm_bo_destroy() on the pixmap-from-fd success path. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 7cd495a88807698b4ebaf9c1fb3db6edf31dd7e6 +Author: Eric Anholt +Date: Thu Oct 15 13:25:12 2015 -0700 + + glamor: Make glamor_get_name_from_bo static. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 6be33fd044949330e0b2b4185882c9664d2f90b4 +Author: Eric Anholt +Date: Thu Jun 18 11:26:46 2015 -0700 + + glamor: Simplify DRI3 pixmap-from-fd, using GBM. + + This GBM import path was introduced in 10.2, which we already require. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 1b8f16d8e659fb483453e1123a9fa876adb758ff +Author: Eric Anholt +Date: Thu Jun 18 11:21:10 2015 -0700 + + glamor: Use real types for glamor_egl's public gbm functions. + + I think void * was just used to avoid needing to #include gbm.h, but + we can just forward-declare the structs and be fine. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit f80758f32a7b922baf8fbf3ac6d8c9aae5fea1c4 +Author: Eric Anholt +Date: Thu Jun 18 11:15:40 2015 -0700 + + glamor: Use the GBM function for getting an FD from a GBM BO. + + We were rolling ioctl calls ourselves, when there's a nice interface + for it. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit ff2850424c99652506d0d6bc43506b4c16bf2ad5 +Author: Eric Anholt +Date: Sun Oct 18 19:26:14 2015 -0700 + + glamor: Hook up EGL DestroyPixmap through the normal wrap chain. + + One less layering violation (EGL should call glamor, if anything, not + the other way around). + + v2: Move glamor.c's DestroyPixmap wrapping up above the + glamor_egl_screen_init() call, since glamor.c's DestroyPixmap + needs to be the bottom of the stack (it calls fb directly and + doesn't wrap). Caught by Michel. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit e91fd30049ba9ebfb6ee8aded74eebe006af3f57 +Author: Eric Anholt +Date: Sun Oct 18 21:34:45 2015 -0700 + + glamor: Unexport glamor_destroy_textured_pixmap(). + + This is just a bit of the DestroyPixmap chain. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 3dd202933fd94615aeeaec7e4cfd05a68954a3f3 +Author: Eric Anholt +Date: Sun Oct 18 21:28:19 2015 -0700 + + glamor: Remove glamor_egl_destroy_textured_pixmap(). + + The DestroyPixmap chain and CloseScreen chain all do pixmap teardown + already, and calling it manually would be redundant. + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 9d2b76652f0bca5680b9e3ae2aacd508d5525684 +Author: Eric Anholt +Date: Fri Jun 19 15:56:13 2015 -0700 + + modesetting: No need to free the EGLImage just before freeing the pixmap. + + DestroyPixmap handles that just fine. This also lets us drop our use + of the manual image destruction function (Note that the radeon driver + still uses it in a similar fashion, though). + + Signed-off-by: Eric Anholt + Reviewed-by: Michel Dänzer + +commit 98a1993536add730b7ec29a9e37f62b1cd70ad31 Author: Eric Anholt Date: Sun Oct 18 19:16:20 2015 -0700 @@ -3592,9 +13617,8 @@ Date: Sun Oct 18 19:16:20 2015 -0700 Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer - (cherry picked from commit 98a1993536add730b7ec29a9e37f62b1cd70ad31) -commit 9379c6a3f6109fe2cca3bf2dc45dc92fcf1e302f +commit 9a5972801f7789833062e5711e77483b643eef92 Author: Eric Anholt Date: Thu Nov 5 16:35:56 2015 -0800 @@ -3617,9 +13641,8 @@ Date: Thu Nov 5 16:35:56 2015 -0800 Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer - (cherry picked from commit 9a5972801f7789833062e5711e77483b643eef92) -commit 6bb58ea2a9c1931f4e04075f19ed22bb50b1d709 +commit e7aa4d3c7420d45cca2b7e1e69e22cebc64d5b74 Author: Eric Anholt Date: Thu Nov 5 16:03:14 2015 -0800 @@ -3630,9 +13653,8 @@ Date: Thu Nov 5 16:03:14 2015 -0800 Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer - (cherry picked from commit e7aa4d3c7420d45cca2b7e1e69e22cebc64d5b74) -commit ade2ed4f8bb66127ad46df22b12d201dad318c3d +commit ff8ef975df9cd99ec6f0b8b8047445091bf35ef0 Author: Eric Anholt Date: Thu Nov 5 15:13:55 2015 -0800 @@ -3640,9 +13662,8 @@ Date: Thu Nov 5 15:13:55 2015 -0800 Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer - (cherry picked from commit ff8ef975df9cd99ec6f0b8b8047445091bf35ef0) -commit 90fe7266ab67aa3e45a0a68c71987c70c0496504 +commit a6b05d10da2fe476f46e6dc4ad8a603964735905 Author: Eric Anholt Date: Thu Nov 5 15:05:11 2015 -0800 @@ -3653,9 +13674,8 @@ Date: Thu Nov 5 15:05:11 2015 -0800 Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer - (cherry picked from commit a6b05d10da2fe476f46e6dc4ad8a603964735905) -commit 701b4347aca1a9b81492b05cf3ae35fe0499325c +commit de959ec939b262cb1cb4c0b6146826e3092843f9 Author: Eric Anholt Date: Thu Nov 5 14:47:42 2015 -0800 @@ -3668,9 +13688,8 @@ Date: Thu Nov 5 14:47:42 2015 -0800 Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer - (cherry picked from commit de959ec939b262cb1cb4c0b6146826e3092843f9) -commit 73799de77f551c22308af1e7ef0b2f83ae49b0e0 +commit 74be466d40080545117628c376cb59b696db33bc Author: Eric Anholt Date: Mon Nov 9 15:47:05 2015 -0800 @@ -3682,9 +13701,8 @@ Date: Mon Nov 9 15:47:05 2015 -0800 Signed-off-by: Eric Anholt Reviewed-by: Rob Clark - (cherry picked from commit 74be466d40080545117628c376cb59b696db33bc) -commit 7727e433459675f80cb38857a6c82ebb29393072 +commit a6cddb8c04ddc3c48aae3f3611ad9f336fecb09d Author: Michael Stapelberg Date: Tue Nov 3 03:51:48 2015 -0800 @@ -3693,7 +13711,14 @@ Date: Tue Nov 3 03:51:48 2015 -0800 Signed-off-by: Michael Stapelberg Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit a6cddb8c04ddc3c48aae3f3611ad9f336fecb09d) + +commit f2ceb683c2da1ec08c8e07d7ec146f14864f2386 +Author: Adam Jackson +Date: Mon Nov 9 16:22:12 2015 -0500 + + Post-release version bump for 1.19 + + Signed-off-by: Adam Jackson commit 43fb888bd01cf9d3d277e77a52a3d0c93ccff8bd Author: Adam Jackson @@ -4079,7 +14104,7 @@ Date: Mon Sep 21 07:16:12 2015 +0100 Reviewed-by: Adam Jackson commit 5b582a4a0350c253d729efb31b710851ae9a958e -Merge: 1d4aa67 27ad212 +Merge: 1d4aa67242 27ad21254f Author: Adam Jackson Date: Mon Oct 19 12:23:22 2015 -0400 @@ -4690,7 +14715,7 @@ Date: Fri Sep 25 14:04:34 2015 +0100 Reviewed-by: Michel Dänzer commit dca5770af9e20bb1148374ebfd60931a81b148a2 -Merge: a31bbc4 21f384b +Merge: a31bbc450a 21f384b7b8 Author: Adam Jackson Date: Fri Sep 25 10:23:28 2015 -0400 @@ -5324,7 +15349,7 @@ Date: Mon Sep 21 15:23:23 2015 -0400 Signed-off-by: Adam Jackson commit b25f7d0c165c4d32c73fbdf9080012503d319ba1 -Merge: db1089e 1ba4fde +Merge: db1089eafc 1ba4fde101 Author: Adam Jackson Date: Mon Sep 21 17:34:48 2015 -0400 @@ -5947,7 +15972,7 @@ Date: Tue Jul 7 18:19:50 2015 +0200 Signed-off-by: Keith Packard commit 7ecdfbf0af3547295b245efa754123db65cabb43 -Merge: bca4f4b a0b4f30 +Merge: bca4f4b56c a0b4f30b1f Author: Keith Packard Date: Mon Aug 17 18:53:25 2015 -0700 @@ -6194,7 +16219,7 @@ Date: Thu Jul 16 15:12:52 2015 -0700 Signed-off-by: Eric Anholt commit 2fcfa532532fbe4a7f668556808e6245ff4e36bc -Merge: cb695b0 7b0f940 +Merge: cb695b0f3b 7b0f940625 Author: Eric Anholt Date: Fri Jul 17 10:15:01 2015 -0700 @@ -6801,7 +16826,7 @@ Date: Tue Jun 30 14:54:42 2015 +1000 Signed-off-by: Keith Packard commit 991712f1e8deeb6289ee0abd9910e279d6396246 -Merge: 0cd2280 3c85911 +Merge: 0cd228073a 3c859112d3 Author: Keith Packard Date: Wed Jul 8 10:43:31 2015 -0700 @@ -7353,28 +17378,28 @@ Date: Tue May 12 14:19:15 2015 -0400 Signed-off-by: Keith Packard commit 8a8d51358cea782147bb9b5b2e0902b1e47fcf4a -Merge: b22534d 13c7d53 +Merge: b22534d8e6 13c7d53df8 Author: Keith Packard Date: Mon Jun 29 21:04:53 2015 -0700 Merge remote-tracking branch 'airlied/for-keithp' commit b22534d8e653575196180970292eaade33c090a8 -Merge: 0a625ad 780a69a +Merge: 0a625adeec 780a69aff0 Author: Keith Packard Date: Mon Jun 29 21:04:11 2015 -0700 Merge remote-tracking branch 'jwrdecoede/for-keith' commit 0a625adeec465d6c7dcdb8622c53157b4e932bb0 -Merge: 84128c1 790311c +Merge: 84128c10bb 790311cec3 Author: Keith Packard Date: Mon Jun 29 21:01:34 2015 -0700 Merge remote-tracking branch 'anholt/glamor-next' commit 84128c10bb6d34f78f7a4148b3c640748efe58e1 -Merge: 9003a3e 8c86dd5 +Merge: 9003a3e5c5 8c86dd5160 Author: Keith Packard Date: Mon Jun 29 20:59:31 2015 -0700 @@ -8011,13 +18036,13 @@ Date: Mon Jan 12 17:10:02 2015 +0000 backtrace.c: In function 'xorg_backtrace': backtrace.c:90:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] - if (dladdr((void *)(pip.start_ip + off), &dlinfo) && + if (dladdr((void *)(pip.start_ip + off), &dlinfo) && dlinfo.dli_fname && - ^ + ^ backtrace.c:98:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] - (void *)(pip.start_ip + off)); - ^ + (void *)(pip.start_ip + off)); + ^ cc1: some warnings being treated as errors make[2]: *** [backtrace.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... @@ -8398,14 +18423,14 @@ Date: Tue Mar 17 10:21:12 2015 +0900 Signed-off-by: Keith Packard commit 0409b6e6d63e9cfb5dc71bb27de4b1ed0152dd9b -Merge: c39c3a9 23702dd +Merge: c39c3a9750 23702dd268 Author: Keith Packard Date: Mon May 11 16:50:43 2015 -0700 Merge remote-tracking branch 'evelikov/master' commit c39c3a97508dc384c0757a0990c07b5d7b2fe97a -Merge: 6b65e96 7470578 +Merge: 6b65e96189 7470578520 Author: Keith Packard Date: Mon May 11 16:34:48 2015 -0700 @@ -8424,7 +18449,7 @@ Date: Wed May 6 15:07:21 2015 +1200 Signed-off-by: Keith Packard commit d7091a21d90cf463ae39ec5e8741123218ec5686 -Merge: c3ce9d8 8fb8bbb +Merge: c3ce9d8fd4 8fb8bbb306 Author: Keith Packard Date: Mon May 11 15:49:34 2015 -0700 @@ -8492,7 +18517,7 @@ Date: Sat Apr 25 21:19:25 2015 +0200 Signed-off-by: Keith Packard commit 26e50e8b2cbd01d050b5ecc02d47488b53ecc08b -Merge: 28ff661 c7b49bd +Merge: 28ff661e73 c7b49bdbb9 Author: Keith Packard Date: Mon May 11 15:36:53 2015 -0700 @@ -9156,7 +19181,7 @@ Date: Tue Dec 30 09:13:15 2014 -0800 Acked-by: Alex Deucher commit e608f3521eaaab972a3eea62aa04a65958351c1c -Merge: d3b9c47 5de1383 +Merge: d3b9c47c84 5de1383070 Author: Keith Packard Date: Tue Mar 31 09:06:08 2015 -0700 @@ -9228,7 +19253,7 @@ Date: Tue Mar 31 11:18:44 2015 +1000 Signed-off-by: Dave Airlie commit 7088816fee0ca7d609c7bca41ef8c3fc938556f5 -Merge: 95e83ff e977b40 +Merge: 95e83ff87a e977b404d7 Author: Keith Packard Date: Fri Mar 27 06:45:56 2015 -0700 @@ -10717,7 +20742,7 @@ Date: Thu Jan 15 22:03:18 2015 +0100 Signed-off-by: Keith Packard commit 5f2e8ac51ccbf7c02f25c8cb7617df0238418cd1 -Merge: 4e12d7b 4301479 +Merge: 4e12d7b6f4 4301479508 Author: Keith Packard Date: Sat Jan 10 14:51:57 2015 +1300 @@ -10801,7 +20826,7 @@ Date: Sun Jan 4 19:13:35 2015 -0800 Reviewed-by: Peter Hutterer commit 1c01633877caa4239f901f02fbe113926318d030 -Merge: 3573855 e774663 +Merge: 3573855514 e774663fa5 Author: Keith Packard Date: Sun Jan 4 17:02:25 2015 -0800 @@ -10917,9 +20942,9 @@ Date: Thu Dec 11 19:09:48 2014 -0800 attributions in place before copying that. To get this list of names I went through: - git log -- os/xsha1.c + git log -- os/xsha1.c and: - git log -- render/glyph.c + git log -- render/glyph.c Signed-off-by: Keith Packard @@ -11544,7 +21569,7 @@ Date: Mon Dec 1 16:06:17 2014 -0500 Signed-off-by: Keith Packard commit 6704bb0ed7a10dabe8ef3bb3adf8b8a7f29a78f0 -Merge: 8aa23f2 1559a94 +Merge: 8aa23f27c7 1559a94395 Author: Keith Packard Date: Tue Dec 9 11:47:11 2014 -0800 @@ -12142,14 +22167,14 @@ Date: Fri Jan 17 18:54:03 2014 -0800 Reviewed-by: Peter Hutterer commit 3e7218a6c23354d66f508b18164cac98a346b3ee -Merge: 6f4c398 bc71081 +Merge: 6f4c398a0e bc71081f0e Author: Keith Packard Date: Mon Dec 8 18:07:55 2014 -0800 Merge remote-tracking branch 'jturney/indirect-glx-fixes' commit 6f4c398a0e632b0c92e3cb8ee03ca7f5b5cc018e -Merge: aae6460 5920433 +Merge: aae6460694 5920433c3a Author: Keith Packard Date: Mon Dec 8 18:04:08 2014 -0800 @@ -12467,7 +22492,7 @@ Date: Tue Nov 11 12:30:07 2014 -0500 Signed-off-by: Keith Packard commit ec0ac8970b508adcbc3d104b14a127118e4979d0 -Merge: 65cc098 0f88d4e +Merge: 65cc0982af 0f88d4e793 Author: Keith Packard Date: Mon Nov 24 15:39:51 2014 -0800 @@ -12824,11 +22849,11 @@ Date: Wed Oct 29 16:59:27 2014 +0100 include/gcstruct.h header which wasn't included by the source file, only gc.h was. That caused the following build failure: - CC xvmain.lo - Xext/xvmain.c: In function 'XvFillColorKey': - Xext/xvmain.c:1114:13: error: dereferencing pointer to incomplete type - (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); - ^ + CC xvmain.lo + Xext/xvmain.c: In function 'XvFillColorKey': + Xext/xvmain.c:1114:13: error: dereferencing pointer to incomplete type + (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); + ^ Fix this by including the correct header file. @@ -13013,14 +23038,14 @@ Date: Tue Oct 21 15:03:55 2014 +0100 Signed-off-by: Keith Packard commit 3a123fbdda56b24dc01a2308137144dc960e0d61 -Merge: 9b29fa9 7ea4a21 +Merge: 9b29fa957a 7ea4a21fee Author: Keith Packard Date: Mon Oct 27 15:39:26 2014 -0700 Merge remote-tracking branch 'jturney/master' Conflicts: - hw/xwin/winpixmap.c + hw/xwin/winpixmap.c Adam removed a pile of windows code, including this file. @@ -13056,7 +23081,7 @@ Date: Mon Oct 27 15:28:14 2014 -0700 Signed-off-by: Keith Packard commit 59b12c454d9c4b5a26c6ad87c53abc671b15ce37 -Merge: 5574a0a cac4b06 +Merge: 5574a0a07e cac4b064f9 Author: Keith Packard Date: Mon Oct 27 14:48:55 2014 -0700 @@ -13534,7 +23559,7 @@ Date: Thu Oct 9 09:58:06 2014 +0200 Signed-off-by: Keith Packard commit de55aafa8f6a9e0dec364bec920d6f91ef2b39f0 -Merge: 462bf87 c79f824 +Merge: 462bf87c4d c79f824bf6 Author: Keith Packard Date: Thu Oct 23 17:28:24 2014 -0700 @@ -13773,21 +23798,21 @@ Date: Thu Oct 9 15:17:17 2014 +0200 Signed-off-by: Keith Packard commit d634ecdf82f244ff8ce75d351fc175792d254e5c -Merge: 6622f0c 7ebf480 +Merge: 6622f0cb17 7ebf480f5e Author: Keith Packard Date: Thu Oct 9 15:08:31 2014 +0200 Merge remote-tracking branch 'ajax/dead-code' commit 6622f0cb1761501f3287ffa8d3cbca3fd30f9f0c -Merge: f12e7f4 5ecd786 +Merge: f12e7f4980 5ecd7866f7 Author: Keith Packard Date: Thu Oct 9 15:05:26 2014 +0200 Merge remote-tracking branch 'ajax/mi-cleanup' commit f12e7f4980416b74988052a04d0f2487b2c4a7e9 -Merge: da88772 aaf5e2d +Merge: da887726ee aaf5e2d643 Author: Keith Packard Date: Thu Oct 9 14:21:19 2014 +0200 @@ -14165,7 +24190,7 @@ Date: Thu Oct 2 10:26:53 2014 -0700 Signed-off-by: Keith Packard commit e9651e3dbc32650fcaf90888b4cbef81da77cfcd -Merge: 9bc01df 4433bc6 +Merge: 9bc01dfc70 4433bc6d53 Author: Keith Packard Date: Thu Oct 2 10:24:33 2014 -0700 @@ -14237,7 +24262,7 @@ Date: Thu Sep 25 15:27:22 2014 +0900 Signed-off-by: Keith Packard commit 78c27d12e1f4857bfcfc92afbb69d5dd989232b9 -Merge: 6e50bfa 1d6334d +Merge: 6e50bfa706 1d6334dd0c Author: Keith Packard Date: Mon Sep 29 13:04:49 2014 -0700 @@ -14471,12 +24496,12 @@ Date: Wed Aug 6 12:58:38 2014 -0700 I can't find any performance benefit to using the GL path and the code renders this trapezoid incorrectly: - top: FIXED 29.50 - bottom: FIXED 30.00 - left top: POINT 0.00, 29.50 - left bottom: POINT 0.00, 30.50 - right top: POINT -127.50, 29.50 - right bottom: POINT 52.50, 30.00 + top: FIXED 29.50 + bottom: FIXED 30.00 + left top: POINT 0.00, 29.50 + left bottom: POINT 0.00, 30.50 + right top: POINT -127.50, 29.50 + right bottom: POINT 52.50, 30.00 This should render a solid line from 0,30 to 52,30 but draws nothing. @@ -14694,7 +24719,7 @@ Date: Wed Sep 17 07:41:27 2014 +0200 Signed-off-by: Keith Packard commit eaee6572beefca240c42791f9a3a6e547bedd410 -Merge: e3aa13b b84d25f +Merge: e3aa13b8d6 b84d25fd53 Author: Keith Packard Date: Wed Sep 17 15:49:24 2014 -0700 @@ -15381,7 +25406,7 @@ Date: Wed Sep 10 16:20:45 2014 +0900 Signed-off-by: Keith Packard commit 54a1d4db825be90fb7be138e3267a15922d62f03 -Merge: 8f8dcfe f92df22 +Merge: 8f8dcfee20 f92df22a03 Author: Keith Packard Date: Thu Sep 11 18:27:41 2014 -0700 @@ -15680,7 +25705,7 @@ Date: Fri Jun 13 16:16:51 2014 +0100 Reviewed-by: Colin Harrison commit 35dc7c75150733dbcef8a18b6796f49a7c48ebee -Merge: 3a51418 5f3485b +Merge: 3a51418b2d 5f3485b06e Author: Eric Anholt Date: Mon Aug 25 15:52:58 2014 -0700 @@ -15891,7 +25916,7 @@ Date: Mon Aug 11 15:23:02 2014 -0700 Signed-off-by: Keith Packard commit d09c9ddb866dea31e2adf82be329d5d3489718f5 -Merge: 606b701 ab32ee3 +Merge: 606b701c56 ab32ee3589 Author: Keith Packard Date: Tue Aug 12 16:34:24 2014 -0700 @@ -16898,7 +26923,7 @@ Date: Tue Jul 22 17:55:25 2014 +0200 Signed-off-by: Keith Packard commit 556cdf8fe870bc23e0393c0eed15c86f49a0b9f8 -Merge: 83701c4 1faa766 +Merge: 83701c4ee8 1faa766705 Author: Keith Packard Date: Thu Jul 24 16:51:00 2014 -0700 @@ -17129,14 +27154,14 @@ Date: Fri Jul 18 09:13:54 2014 -0400 Signed-off-by: Keith Packard commit 5c2e9fa3d6c4bdf626fededce866056ba8eca502 -Merge: e678b49 6d49548 +Merge: e678b4971b 6d49548849 Author: Keith Packard Date: Thu Jul 17 20:06:21 2014 -0700 Merge remote-tracking branch 'anholt/glamor-next' commit 6d4954884908ea9894fcfe9836db1ba7bb45be61 -Merge: 9ddcb20 55f5bfb +Merge: 9ddcb20f47 55f5bfb578 Author: Eric Anholt Date: Thu Jul 17 18:00:44 2014 -0700 @@ -17326,11 +27351,11 @@ Date: Wed Jul 16 16:03:23 2014 -0700 drawable as x_dest, y_dest. The protocol coordinates now exist solely to 'pin' the three objects together. - extents->x1,y1 Screen origin of clipped operation + extents->x1,y1 Screen origin of clipped operation width,height Extents of the clipped operation - x_dest,y_dest Unclipped destination-relative operation coordinate - x_source,y_source Unclipped source-relative operation coordinate - x_mask,y_mask Unclipped mask-relative operation coordinate + x_dest,y_dest Unclipped destination-relative operation coordinate + x_source,y_source Unclipped source-relative operation coordinate + x_mask,y_mask Unclipped mask-relative operation coordinate One thing we want to know is what the offset is from the original operation origin to the clipped origin @@ -17668,7 +27693,7 @@ Date: Mon Jul 7 08:27:44 2014 +1000 Signed-off-by: Peter Hutterer commit 9de3cc8daa4c6e877d30a0e8ccfe0cc159f1dbe3 -Merge: 9308eaf a549987 +Merge: 9308eafb7d a5499870e2 Author: Keith Packard Date: Mon Jul 7 16:53:07 2014 -0700 @@ -17726,11 +27751,11 @@ Date: Thu Feb 13 13:42:05 2014 +0100 to load for non-PCI output devices. DDX modules can ship an xorg.conf.d snippet (e.g. in /usr/share/X11/xorg.conf.d) that looks like this: - Section "OutputClass" - Identifer "NVIDIA Tegra open-source driver" - MatchDriver "tegra" - Driver "opentegra" - EndSection + Section "OutputClass" + Identifer "NVIDIA Tegra open-source driver" + MatchDriver "tegra" + Driver "opentegra" + EndSection This will cause any device that's driven by the kernel driver named "tegra" to use the "opentegra" DDX module. @@ -17919,7 +27944,7 @@ Date: Mon Jun 16 08:06:53 2014 +0100 Signed-off-by: Keith Packard commit 736bed2aaf4bb672b6c7b33146fe84700baf22bd -Merge: ce581ac d90b5f8 +Merge: ce581ac3fa d90b5f8301 Author: Keith Packard Date: Mon Jun 23 14:18:03 2014 -0700 @@ -17958,7 +27983,7 @@ Date: Mon Feb 24 11:36:54 2014 +0100 Signed-off-by: Keith Packard commit ea47341792cf06eda5bbdf0aca48aacc024a5be0 -Merge: 334faab a11bbd8 +Merge: 334faabe68 a11bbd875f Author: Keith Packard Date: Mon Jun 23 13:50:54 2014 -0700 @@ -18689,7 +28714,7 @@ Date: Wed May 28 08:13:59 2014 +0100 Signed-off-by: Keith Packard commit b5526141f78df15bc5df2497bc4b4a17f1a6368d -Merge: dc8d068 a205ec3 +Merge: dc8d068847 a205ec3ab7 Author: Keith Packard Date: Mon Jun 2 13:08:23 2014 -0700 @@ -18706,7 +28731,7 @@ Date: Mon Jun 2 01:17:31 2014 +0400 Signed-off-by: Keith Packard commit a6ffdc69c4ac45bc39924159c7fab5f02f720f1f -Merge: 63c48de 1c10b37 +Merge: 63c48de63b 1c10b37380 Author: Keith Packard Date: Mon Jun 2 11:30:24 2014 -0700 @@ -18731,7 +28756,7 @@ Date: Fri May 30 16:50:35 2014 -0400 Signed-off-by: Keith Packard commit ab47ec9636b21a7f542d2e8612834915e7c8cc64 -Merge: 0df871c cfaf2ab +Merge: 0df871cf34 cfaf2abbac Author: Keith Packard Date: Mon Jun 2 11:22:48 2014 -0700 @@ -19111,7 +29136,7 @@ Date: Wed Apr 30 10:55:26 2014 +1000 Reviewed-by: Keith Packard commit d60724b752613ce2ad11c6ae102bf4513f9768ff -Merge: a5b9757 15460ea +Merge: a5b9757142 15460eaed2 Author: Keith Packard Date: Thu May 8 12:58:41 2014 -0700 @@ -19323,7 +29348,7 @@ Date: Thu Apr 24 13:38:28 2014 -0400 Signed-off-by: Keith Packard commit 6bd7ad914470322ddd02b50078e159234ebec643 -Merge: b92a928 e06fbe4 +Merge: b92a9289fe e06fbe4dc8 Author: Keith Packard Date: Tue Apr 29 09:37:37 2014 -0700 @@ -19974,17 +29999,17 @@ Date: Fri Apr 11 17:44:59 2014 -0400 int screen; xcb_connection_t *c = xcb_connect(NULL, &screen); if (!c || xcb_connection_has_error(c)) { - fprintf(stderr, "Cannot open default display \"%s\"\n", getenv("DISPLAY")); - return EXIT_FAILURE; + fprintf(stderr, "Cannot open default display \"%s\"\n", getenv("DISPLAY")); + return EXIT_FAILURE; } // Find root window and depth const xcb_setup_t *setup = xcb_get_setup(c); if (screen >= setup->roots_len) - screen = 0; + screen = 0; xcb_screen_iterator_t si = xcb_setup_roots_iterator(setup); for (int i=0; i < screen; i++) - xcb_screen_next(&si); + xcb_screen_next(&si); xcb_window_t root = si.data->root; uint8_t depth = si.data->root_depth; xcb_visualid_t visual = si.data->root_visual; @@ -19993,8 +30018,8 @@ Date: Fri Apr 11 17:44:59 2014 -0400 xcb_render_query_pict_formats_reply_t *qpf; qpf = xcb_render_query_pict_formats_reply(c, xcb_render_query_pict_formats(c), NULL); if (!qpf) { - fprintf(stderr, "Cannot query RENDER picture formats\n"); - return EXIT_FAILURE; + fprintf(stderr, "Cannot query RENDER picture formats\n"); + return EXIT_FAILURE; } xcb_render_pictformat_t fmt_a8 = 0; xcb_render_pictforminfo_iterator_t pfi = @@ -20010,8 +30035,8 @@ Date: Fri Apr 11 17:44:59 2014 -0400 xcb_render_pictforminfo_next(&pfi); } if (!fmt_a8) { - fprintf(stderr, "Cannot find a8 RENDER picture format\n"); - return EXIT_FAILURE; + fprintf(stderr, "Cannot find a8 RENDER picture format\n"); + return EXIT_FAILURE; } xcb_render_pictformat_t fmt_visual = 0; @@ -20036,8 +30061,8 @@ Date: Fri Apr 11 17:44:59 2014 -0400 } found_visual: if (!fmt_visual) { - fprintf(stderr, "Cannot find visual RENDER picture format\n"); - return EXIT_FAILURE; + fprintf(stderr, "Cannot find visual RENDER picture format\n"); + return EXIT_FAILURE; } xcb_render_glyphset_t glyphset = xcb_generate_id(c); @@ -20050,8 +30075,8 @@ Date: Fri Apr 11 17:44:59 2014 -0400 xcb_window_t window = xcb_generate_id(c); uint32_t list[] = { si.data->black_pixel, XCB_EVENT_MASK_EXPOSURE }; xcb_create_window(c, XCB_COPY_FROM_PARENT, window, root, 0, 0, WIN_SIZE, WIN_SIZE, - 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, - XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, list); + 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, + XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, list); xcb_map_window(c, window); xcb_render_picture_t winpic = xcb_generate_id(c); xcb_render_create_picture(c, winpic, window, fmt_visual, 0, NULL); @@ -20066,9 +30091,9 @@ Date: Fri Apr 11 17:44:59 2014 -0400 xcb_flush(c); for (xcb_generic_event_t *ev = xcb_wait_for_event(c); ev; ev = xcb_wait_for_event(c)) { - int type = ev->response_type; - free(ev); - if (type == XCB_EXPOSE) { + int type = ev->response_type; + free(ev); + if (type == XCB_EXPOSE) { xcb_clear_area(c, 0, window, 0, 0, 0, 0); xcb_render_composite_glyphs_8(c, XCB_RENDER_PICT_OP_SRC, pixpic, winpic, fmt_a8, glyphset, 0, 0, sizeof(elt), (uint8_t *)&elt); @@ -20106,7 +30131,7 @@ Date: Mon Apr 21 16:30:49 2014 -0400 Signed-off-by: Keith Packard commit ba5c2b6c876a15fe18bc1ff1ab4e773c46bc9009 -Merge: 9c86d5f 66b6024 +Merge: 9c86d5f4f6 66b6024740 Author: Keith Packard Date: Mon Apr 21 14:59:51 2014 -0700 @@ -20526,7 +30551,7 @@ Date: Tue Apr 8 01:01:28 2014 -0700 Reviewed-by: Eric Anholt commit 3028ae6c9aa37168e249e0d847b29f8e3efb05b2 -Merge: bd3de10 ec6007e +Merge: bd3de10f86 ec6007e6f7 Author: Keith Packard Date: Wed Apr 9 21:59:17 2014 -0700 @@ -20620,7 +30645,7 @@ Date: Thu Apr 3 18:22:50 2014 +0100 Signed-off-by: Keith Packard commit b4d0bec22c15930abf13a7fb9d684208ccd56b1d -Merge: 3c34dd3 6e539d8 +Merge: 3c34dd3603 6e539d8817 Author: Keith Packard Date: Thu Apr 3 15:35:01 2014 -0700 @@ -20889,7 +30914,7 @@ Date: Fri Mar 21 13:13:27 2014 -0700 Reviewed-by: Julien Cristau commit 84f977467b514af88019ab2791bf7a74530b54df -Merge: 9d20d18 9892471 +Merge: 9d20d18fb9 98924719d5 Author: Keith Packard Date: Thu Apr 3 10:44:28 2014 -0700 @@ -21050,7 +31075,7 @@ Date: Wed Mar 26 12:24:49 2014 +0100 Signed-off-by: Peter Hutterer commit 9d20d18fb9dcc74bfa5392a2da40fd41b3e640d3 -Merge: 8468e24 bc348bd +Merge: 8468e24430 bc348bd2c4 Author: Keith Packard Date: Mon Mar 31 23:24:56 2014 -0700 @@ -21573,7 +31598,7 @@ Date: Tue Mar 25 13:48:52 2014 -0400 Reviewed-by: Peter Hutterer commit bda6fdc71c25b0c3f3747f445103a1995a5713f4 -Merge: e46820f 78167a9 +Merge: e46820fb89 78167a98a8 Author: Keith Packard Date: Tue Mar 25 16:06:03 2014 -0700 @@ -21692,7 +31717,7 @@ Date: Sat Mar 22 14:30:04 2014 -0700 Signed-off-by: Keith Packard commit d9fdae5f4a648a10653e18dbc602646f3e22e522 -Merge: 99bee6c 0e5d299 +Merge: 99bee6c054 0e5d2996ac Author: Keith Packard Date: Sat Mar 22 14:09:00 2014 -0700 @@ -21726,7 +31751,7 @@ Date: Fri Jan 17 09:54:01 2014 -0500 Signed-off-by: Keith Packard commit 1782316744866a181ed92486bb4dca6ac46d40bd -Merge: 4fb31e4 2b77b20 +Merge: 4fb31e4824 2b77b208da Author: Keith Packard Date: Sat Mar 22 13:46:15 2014 -0700 @@ -21960,7 +31985,7 @@ Date: Wed Mar 19 10:27:39 2014 -0700 Signed-off-by: Peter Hutterer commit 4fb31e4824d46edc80bb49b4065152899faa5ac6 -Merge: d18d3f6 0e531fb +Merge: d18d3f6d18 0e531fbb97 Author: Keith Packard Date: Wed Mar 19 06:43:14 2014 -0700 @@ -21976,7 +32001,7 @@ Date: Wed Mar 12 16:31:25 2014 +1000 Reviewed-by: Kristian Høgsberg commit d18d3f6d18aa7827748f7ba14efd405b525883d0 -Merge: 81a4952 6649d00 +Merge: 81a4952d3d 6649d0059e Author: Keith Packard Date: Mon Mar 17 17:29:56 2014 -0700 @@ -22635,7 +32660,7 @@ Date: Fri Mar 7 14:32:28 2014 -0800 Signed-off-by: Peter Hutterer commit 81a4952d3dcab9ca3a1ee399c773f5ac352036c4 -Merge: 96a28e9 7950664 +Merge: 96a28e9c91 795066477e Author: Keith Packard Date: Tue Mar 11 22:04:36 2014 -0700 @@ -22995,7 +33020,7 @@ Date: Mon Mar 10 08:58:37 2014 +1000 Signed-off-by: Keith Packard commit 1c61d38528a573caadee2468ee59ea558c822e09 -Merge: 5350ae1 bf35437 +Merge: 5350ae1d38 bf3543739d Author: Keith Packard Date: Fri Mar 7 22:07:19 2014 -0800 @@ -23534,7 +33559,7 @@ Date: Sun Feb 9 11:20:59 2014 +0100 Signed-off-by: Keith Packard commit 1940508a4af33d44a7a8ef24bbdcd1e31e228dab -Merge: c85ea92 ddeca92 +Merge: c85ea92af1 ddeca92749 Author: Keith Packard Date: Mon Feb 24 16:27:52 2014 -0800 @@ -23549,7 +33574,7 @@ Date: Mon Feb 24 09:51:39 2014 -0800 Signed-off-by: Keith Packard commit 0840a303c47b9b10ba8e24e62956da0f1675e963 -Merge: 0f10cfd 3d71df4 +Merge: 0f10cfd4b9 3d71df48e7 Author: Keith Packard Date: Mon Feb 24 09:40:23 2014 -0800 @@ -23597,7 +33622,7 @@ Date: Wed Feb 19 13:48:06 2014 -0500 LDADD is for libraries and not for source code. - Introduced in commit: ccb3e78124fb05defd0c9b438746b79d84dfc3ae + Introduced in commit: ccb3e78124fb05defd0c9b438746b79d84dfc3ae Signed-off-by: Gaetan Nadon Signed-off-by: Peter Hutterer @@ -23613,8 +33638,8 @@ Date: Wed Feb 19 17:16:48 2014 +0100 the field (rather than the field's address). The correct way to do it would have been (note the &'s): - assert(((void *) &v->axisVal - (void *) v) % sizeof(double) == 0); - assert(((void *) &v->axes - (void *) v) % sizeof(double) == 0); + assert(((void *) &v->axisVal - (void *) v) % sizeof(double) == 0); + assert(((void *) &v->axes - (void *) v) % sizeof(double) == 0); That's essentially what the offsetof() macro does. Using offsetof() has the added benefit of not using void pointer arithmetic and therefore @@ -23915,7 +33940,7 @@ Date: Sun Feb 9 16:56:40 2014 -0800 Signed-off-by: Keith Packard commit 5300212ce8e9364ba26497605f3edc089af20130 -Merge: ae796d4 0b193b3 +Merge: ae796d43c9 0b193b3ac9 Author: Keith Packard Date: Sun Feb 9 16:05:42 2014 -0800 @@ -23999,9 +34024,9 @@ Date: Mon Feb 3 17:38:24 2014 -0800 Fixes Solaris Studio compiler warning & error: "glxext.c", line 557: warning: assignment type mismatch: - pointer to void "=" pointer to function(void) returning void + pointer to void "=" pointer to function(void) returning void "glxext.c", line 559: error: operands have incompatible types: - pointer to void ":" pointer to function(void) returning void + pointer to void ":" pointer to function(void) returning void Signed-off-by: Alan Coopersmith Signed-off-by: Keith Packard @@ -24478,21 +34503,21 @@ Date: Tue Jan 28 20:27:49 2014 -0800 Signed-off-by: Keith Packard commit da1660deeb9032ecca61f4bcdc9fc2eec2ada445 -Merge: 0fbb3d7 9fc1916 +Merge: 0fbb3d711e 9fc19168e7 Author: Keith Packard Date: Mon Jan 27 19:02:15 2014 -0800 Merge remote-tracking branch 'whot/for-keith' commit 0fbb3d711efec5222a57b45a70d28fc98380f3a1 -Merge: 7ddef4f b98e493 +Merge: 7ddef4f703 b98e49379c Author: Keith Packard Date: Mon Jan 27 14:11:09 2014 -0800 Merge remote-tracking branch 'anholt/glamor-reformat' Conflicts: - Makefile.am + Makefile.am Conflict caused by adding PSEUDORAMIX and GLAMOR directory defines in separate branches @@ -24973,14 +34998,14 @@ Date: Wed Dec 11 11:55:37 2013 -0800 Reviewed-by: Eric Anholt commit 25ebb9dbc9df659dec2bf6c27654a5bad2d11f94 -Merge: 409e8e2 71baa46 +Merge: 409e8e29fb 71baa466b1 Author: Keith Packard Date: Wed Jan 22 11:33:53 2014 -0800 Merge remote-tracking branch 'whot/for-keith' commit 409e8e29fbe16122ba5a4249256fc56e2e68ea93 -Merge: 457bc83 d6c8d75 +Merge: 457bc83549 d6c8d75097 Author: Keith Packard Date: Wed Jan 22 11:32:35 2014 -0800 @@ -25008,21 +35033,21 @@ Date: Sat Jan 4 00:09:45 2014 -0800 Signed-off-by: Keith Packard commit 044a6ef2ff5f2c83a80b11e747f62f48830b526b -Merge: 0b932cf 77df653 +Merge: 0b932cf47a 77df653ae3 Author: Keith Packard Date: Wed Jan 22 11:28:54 2014 -0800 Merge remote-tracking branch 'jeremyhu/master' commit 0b932cf47a4df8ea0f7488e285d218fe7c10dd77 -Merge: 1d76b02 295d41f +Merge: 1d76b02fac 295d41fa2a Author: Keith Packard Date: Wed Jan 22 11:27:36 2014 -0800 Merge remote-tracking branch 'anholt/xserver-unifdef' commit 1d76b02fac79c0360ae201e4d1a8ba0e9a00e810 -Merge: 771f390 4dd62d7 +Merge: 771f390efd 4dd62d7807 Author: Keith Packard Date: Wed Jan 22 11:22:35 2014 -0800 @@ -25957,7 +35982,7 @@ Date: Thu Dec 19 14:31:07 2013 -0800 Signed-off-by: Keith Packard commit 4b1ead9d3400acc3402c2480d7cc0527750c32f0 -Merge: 4d62646 929795d +Merge: 4d62646142 929795d50d Author: Keith Packard Date: Thu Dec 19 14:14:59 2013 -0800 @@ -27886,9 +37911,9 @@ Date: Fri Apr 6 17:01:57 2012 +0800 are not frequenly used in real application. We simply fallback them currently. - PictOpAtop: s*mask*dst.a + (1 - s.a*mask)*dst - PictOpAtopReverse: s*mask*(1 - dst.a) + dst *s.a*mask - PictOpXor: s*mask*(1 - dst.a) + dst * (1 - s.a*mask) + PictOpAtop: s*mask*dst.a + (1 - s.a*mask)*dst + PictOpAtopReverse: s*mask*(1 - dst.a) + dst *s.a*mask + PictOpXor: s*mask*(1 - dst.a) + dst * (1 - s.a*mask) The two oprands in the above three ops are all reated to dst and the blend factors are not constant (0 or 1), it's hardly to @@ -29232,7 +39257,7 @@ Date: Wed Nov 2 13:44:50 2011 +0800 Signed-off-by: Zhigang Gong commit 2dbbe2565052cc024ce0e98918ed34c1239b780a -Merge: 4d62646 7982eca +Merge: 4d62646142 7982eca622 Author: Eric Anholt Date: Wed Dec 18 11:21:07 2013 -0800 @@ -29250,7 +39275,7 @@ Date: Wed Dec 18 11:16:15 2013 -0800 support code outside of glamor for now. commit 4d62646142718024b0981eb4f1fd0131e829161f -Merge: f4bfb14 81ba89d +Merge: f4bfb14f53 81ba89d670 Author: Keith Packard Date: Mon Dec 16 09:27:57 2013 -0800 @@ -29873,14 +39898,14 @@ Date: Fri Nov 29 12:26:43 2013 +0000 > --- a/configure.ac > +++ b/configure.ac > @@ -1822,6 +1822,9 @@ if test "x$XORG" = xyes; then - > if test "x$CONFIG_UDEV_KMS" = xyes; then - > AC_MSG_ERROR([Platform device enumeration requires libpciaccess]) - > fi - > + if test "x$INT10" != xstub; then - > + AC_MSG_ERROR([Cannot build int10 without libpciaccess]) - > + fi - > fi - > AC_MSG_RESULT([$PCI]) + > if test "x$CONFIG_UDEV_KMS" = xyes; then + > AC_MSG_ERROR([Platform device enumeration requires libpciaccess]) + > fi + > + if test "x$INT10" != xstub; then + > + AC_MSG_ERROR([Cannot build int10 without libpciaccess]) + > + fi + > fi + > AC_MSG_RESULT([$PCI]) > This causes my build to fail where --disable-int10-module --disable-pciaccess @@ -30248,11 +40273,11 @@ Date: Sat Nov 9 12:36:47 2013 -0800 Change check to vblank->window == NULL in: - present_flip_notify + present_flip_notify Add check for vblank->window == NULL in: - present_vblank_notify - present_execute + present_vblank_notify + present_execute present_flip_notify was also using vblank->window->drawable.pScreen, so stop doing that and use vblank->screen instead. @@ -30317,7 +40342,7 @@ Date: Fri Nov 15 13:26:36 2013 +0900 Signed-off-by: Keith Packard commit 29240e5cbf6e7f875b128fc7bfc4d56b2350835a -Merge: 0492deb 8ff7e32 +Merge: 0492deb8f8 8ff7e32c3e Author: Keith Packard Date: Thu Nov 14 17:02:04 2013 +0900 @@ -30581,7 +40606,7 @@ Date: Thu Nov 7 15:18:28 2013 -0800 Signed-off-by: Keith Packard commit a239e6faf3fce848ac0d10c48f8e817db68a493c -Merge: 43e5a43 f70a8bf +Merge: 43e5a43fa8 f70a8bf371 Author: Keith Packard Date: Mon Nov 11 15:26:12 2013 -0800 @@ -30644,8 +40669,8 @@ Date: Sun Nov 3 13:12:40 2013 -0800 v3: Also catch errors in ShmCreateSegment Conflicts: - include/dix-config.h.in - include/xorg-config.h.in + include/dix-config.h.in + include/xorg-config.h.in commit 719e880d7698d92f9b854b217ef9680aaa446f2e Author: Keith Packard @@ -30818,7 +40843,7 @@ Date: Fri Nov 1 01:43:59 2013 -0700 Signed-off-by: Keith Packard commit 977e2644b1d9e13b44debcb9a372bbc832ee32a3 -Merge: 66c5ee0 f36f5a6 +Merge: 66c5ee0ff4 f36f5a65f6 Author: Keith Packard Date: Fri Nov 1 00:34:18 2013 -0700 @@ -31017,7 +41042,7 @@ Date: Tue Oct 8 17:45:40 2013 -0400 Reviewed-by: Adam Jackson commit 95bf478b78e466002c382bcde7d4d62591e9215d -Merge: abf5d5a bb745f2 +Merge: abf5d5ac12 bb745f2b45 Author: Keith Packard Date: Thu Oct 31 18:18:19 2013 -0700 @@ -31039,7 +41064,7 @@ Date: Thu Oct 31 08:57:56 2013 -0700 Signed-off-by: Keith Packard commit e4636072949a76477fe7c9d54662a0b3536b1372 -Merge: 17ed7ac 5c5c1b7 +Merge: 17ed7ac1fe 5c5c1b7798 Author: Keith Packard Date: Thu Oct 31 17:05:48 2013 -0700 @@ -31112,17 +41137,17 @@ Date: Thu Jan 17 13:43:02 2013 -0800 void SetReqFds(ClientPtr client, int req_fds) - Marks the number of file descriptors expected for this - request. Call this before any request processing so that - any un-retrieved file descriptors will be closed - automatically. + Marks the number of file descriptors expected for this + request. Call this before any request processing so that + any un-retrieved file descriptors will be closed + automatically. int ReadFdFromClient(ClientPtr client) - Reads the next queued file descriptor from the connection. If - this request is not expecting any more file descriptors, or - if there are no more file descriptors available from the - connection, then this will return -1. + Reads the next queued file descriptor from the connection. If + this request is not expecting any more file descriptors, or + if there are no more file descriptors available from the + connection, then this will return -1. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson @@ -31303,7 +41328,7 @@ Date: Wed Oct 30 13:33:49 2013 +0200 Signed-off-by: Keith Packard commit 1470c0a132806fb2ce817515ad4ddfe66eb7c98f -Merge: 04ab07c 9f4afe7 +Merge: 04ab07ca19 9f4afe7e83 Author: Keith Packard Date: Tue Oct 29 21:00:13 2013 -0700 @@ -31351,7 +41376,7 @@ Date: Thu Oct 17 18:26:28 2013 -0700 Signed-off-by: Keith Packard commit b32a4c91ccd479638c2bd2c0143b6ea170c717d1 -Merge: be66809 c671e93 +Merge: be6680967a c671e935e7 Author: Keith Packard Date: Tue Oct 29 09:37:30 2013 -0700 @@ -31455,7 +41480,7 @@ Date: Sat Aug 3 09:47:55 2013 -0400 Author: Adam Jackson Date: Mon Mar 21 11:59:29 2011 -0400 - glx: Reimplement context tags + glx: Reimplement context tags In that, I changed the glx client state to not explicitly track the list of current contexts for the client (since that was what we were deriving @@ -31625,7 +41650,7 @@ Date: Fri Oct 18 17:31:01 2013 -0700 Signed-off-by: Keith Packard commit e3220d7bae4548bf64e5879c981ad070ac1f78f7 -Merge: 73b2660 2523a44 +Merge: 73b2660d72 2523a445a0 Author: Keith Packard Date: Fri Oct 18 17:22:52 2013 -0700 @@ -31635,7 +41660,7 @@ Date: Fri Oct 18 17:22:52 2013 -0700 also merging in the spurious merge at the top of that branch. commit f8662a133690773692dfa392ecfa3b8b56af8fa9 -Merge: 7cf1b59 2523a44 +Merge: 7cf1b595c8 2523a445a0 Author: Peter Hutterer Date: Fri Oct 18 16:50:12 2013 +1000 @@ -32018,7 +42043,7 @@ Date: Sun Oct 6 16:45:52 2013 +0100 Reviewed-by: Adam Jackson commit 6a9bd103cb993e873cb82664b677ceed73c0bd85 -Merge: ea3b7db 8aae28e +Merge: ea3b7db4b7 8aae28e3cb Author: Keith Packard Date: Mon Oct 7 17:29:38 2013 -0700 @@ -32207,7 +42232,7 @@ Date: Sat Sep 28 15:26:33 2013 -0400 Signed-off-by: Keith Packard commit f3b529bf25db2700addbafc7aa4fc5b126ba9929 -Merge: 4399bd3 abc2bfc +Merge: 4399bd3832 abc2bfca16 Author: Keith Packard Date: Fri Oct 4 14:04:48 2013 -0700 @@ -32224,14 +42249,14 @@ Date: Mon Sep 30 13:30:46 2013 -0400 Signed-off-by: Keith Packard commit 9ccb4a63982942fdce19609d2cadbd8e51708462 -Merge: 5d2ec69 da5e201 +Merge: 5d2ec6933f da5e20127a Author: Keith Packard Date: Fri Oct 4 13:54:55 2013 -0700 Merge remote-tracking branch 'whot/for-keith' commit 5d2ec6933f6bb5116666ca1bfb07f0f20bf2a0b5 -Merge: 7d3d4ae 6ee4d9f +Merge: 7d3d4ae55d 6ee4d9f94a Author: Keith Packard Date: Fri Oct 4 13:50:04 2013 -0700 @@ -32889,7 +42914,7 @@ Date: Wed Aug 21 14:12:52 2013 -0400 Signed-off-by: Adam Jackson commit 47ff382d1fce25a8b097d45b79489e891f1f1228 -Merge: 6f89ae3 3752a81 +Merge: 6f89ae3e64 3752a81580 Author: Keith Packard Date: Mon Sep 9 15:13:42 2013 -0700 @@ -33820,7 +43845,7 @@ Date: Sat Aug 17 12:17:36 2013 +0200 Signed-off-by: Keith Packard commit f67d022523c59a27f3bf8791aa9ca6624318b1fd -Merge: 5a36cdd 9680f6a +Merge: 5a36cdd915 9680f6a12d Author: Keith Packard Date: Tue Aug 6 07:12:12 2013 +0200 @@ -33945,7 +43970,7 @@ Date: Wed Jul 31 11:24:48 2013 +1000 Signed-off-by: Dave Airlie commit ff38bbe81ace85bf675bbaa0a9ca5f3b32ede449 -Merge: bdd1e22 4360514 +Merge: bdd1e22cbd 4360514d1c Author: Keith Packard Date: Thu Jul 25 22:50:27 2013 -0700 @@ -34248,7 +44273,7 @@ Date: Mon Sep 3 15:19:43 2012 +0100 Reviewed-by: Colin Harrison commit d5ebe20f9ba9569351c4a41449866679fd60ba45 -Merge: 21ea7eb 33f7e60 +Merge: 21ea7ebb6a 33f7e60785 Author: Keith Packard Date: Mon Jul 22 20:34:41 2013 -0700 @@ -34597,7 +44622,7 @@ Date: Mon Jun 17 15:51:19 2013 -0700 Signed-off-by: Keith Packard commit 227015d6544115258b74c31b700f9bd163540e24 -Merge: d9005d5 80054fc +Merge: d9005d58c0 80054fcafb Author: Keith Packard Date: Tue Jun 18 10:53:08 2013 -0700 @@ -34772,21 +44797,21 @@ Date: Mon May 27 13:46:49 2013 +1000 Signed-off-by: Keith Packard commit cb3018d8a15add48efb3335e1f79b66378166008 -Merge: c76a1b3 6589f3b +Merge: c76a1b343d 6589f3b55e Author: Keith Packard Date: Thu May 23 19:58:46 2013 -0600 Merge remote-tracking branch 'whot/unreviewed' commit c76a1b343d6a56aa9529e87f0eda8d61355d562b -Merge: 891123c 9a5ad65 +Merge: 891123ce9d 9a5ad65330 Author: Keith Packard Date: Thu May 23 19:58:36 2013 -0600 Merge remote-tracking branch 'whot/touch-grab-race-condition-56578-v3' commit 891123ce9dac5e52685b9a921b33d8279ba52956 -Merge: 7e97166 49521ed +Merge: 7e97166c4f 49521edaf8 Author: Keith Packard Date: Thu May 23 10:30:15 2013 -0600 @@ -35559,14 +45584,14 @@ Date: Fri Feb 15 11:19:10 2013 +1000 Reviewed-by: Keith Packard commit 2746c681639f9512e6e45fb8d0151b996b6aff7f -Merge: 1e6cf8e 9878e09 +Merge: 1e6cf8ec20 9878e097a7 Author: Keith Packard Date: Mon May 6 10:52:40 2013 -0700 Merge remote-tracking branch 'alanc/master' commit 1e6cf8ec20d07b73a11116564aba71b4e4291dcd -Merge: dbfeaf7 5860408a +Merge: dbfeaf7062 5860408a19 Author: Keith Packard Date: Mon May 6 10:20:21 2013 -0700 @@ -35933,21 +45958,21 @@ Date: Sun Feb 10 10:24:59 2013 -0800 Reviewed-by: Ian Romanick commit 7ab98bafc9a3426fd40f8ae693430491333ba4fc -Merge: 53da26a 5ab2603 +Merge: 53da26afb7 5ab260317a Author: Keith Packard Date: Wed Apr 24 14:14:45 2013 -0700 Merge remote-tracking branch 'geertu/master' commit 53da26afb76bcce70b91c5df23d25e7e85c010cf -Merge: 5ece86e d8d3c78 +Merge: 5ece86e921 d8d3c78b6e Author: Keith Packard Date: Wed Apr 24 10:27:19 2013 -0700 Merge remote-tracking branch 'whot/for-keith' commit 5ece86e921a1df457a9baab6a2357ccda4ad6957 -Merge: ef0a726 22cab8a +Merge: ef0a726bc8 22cab8a28a Author: Keith Packard Date: Wed Apr 24 10:23:51 2013 -0700 @@ -36667,7 +46692,7 @@ Date: Sat Feb 23 13:14:45 2013 +0100 Signed-off-by: Keith Packard commit c2ede8f92f0d6f15b1b2a04889cb54cd1728780b -Merge: 190b032 7050aae +Merge: 190b032151 7050aae69c Author: Keith Packard Date: Mon Mar 18 11:26:24 2013 -0700 @@ -36691,7 +46716,7 @@ Date: Thu Feb 14 15:06:57 2013 -0800 Signed-off-by: Keith Packard commit 116f020102fd6c2a603069a639b113dfa31b48b7 -Merge: cf89aa5 0f537da +Merge: cf89aa5374 0f537da72d Author: Keith Packard Date: Mon Mar 18 11:18:58 2013 -0700 @@ -36960,7 +46985,7 @@ Date: Tue Mar 5 10:14:29 2013 +1000 Signed-off-by: Keith Packard commit 604169af8b67afc74a292cdb9070a3a1f2d7c536 -Merge: 8f4640b 6ea59dc +Merge: 8f4640bdb9 6ea59dc2d8 Author: Keith Packard Date: Mon Mar 4 21:09:59 2013 -0800 @@ -37159,7 +47184,7 @@ Date: Mon Feb 27 16:43:10 2012 +1000 Reviewed-by: Chase Douglas commit 88517ced1fa2e621be2d05a319b522b3111da516 -Merge: 82425c6 73974dd +Merge: 82425c66e7 73974dd7ea Author: Peter Hutterer Date: Fri Feb 15 11:58:52 2013 +1000 @@ -37282,7 +47307,7 @@ Date: Thu Feb 14 10:02:02 2013 +1000 Reviewed-by: Mark Kettenis commit 90642948cc78834d95f7a3bddaac7ff77b68ed7e -Merge: 9a35d42 eda7dbf +Merge: 9a35d4240e eda7dbff5a Author: Keith Packard Date: Thu Feb 14 11:05:48 2013 -0800 @@ -37518,7 +47543,7 @@ Date: Fri Jan 25 11:47:32 2013 +1000 Reviewed-by: Keith Packard commit 0d5bb882600ee7734af034fbea935a79d21d1e70 -Merge: b33fcb1 61a99af +Merge: b33fcb1497 61a99aff9d Author: Peter Hutterer Date: Fri Feb 8 14:10:52 2013 +1000 @@ -37950,14 +47975,14 @@ Date: Tue Jan 22 07:39:53 2013 +1000 Signed-off-by: Keith Packard commit 069d8ed3eb659c48dd2b0f8b7b8c11f092fdb362 -Merge: 591c062 d6dcde7 +Merge: 591c06277b d6dcde7a03 Author: Keith Packard Date: Sun Jan 20 15:58:38 2013 -0800 Merge remote-tracking branch 'jturney/xserver-next' commit 591c06277bb120ab9615633f2d28addbd3a2aa5f -Merge: 6703a7c fa6ab7d +Merge: 6703a7c7cf fa6ab7d9b2 Author: Keith Packard Date: Sun Jan 20 15:52:26 2013 -0800 @@ -38140,7 +48165,7 @@ Date: Wed Oct 26 17:03:25 2011 -0500 Reviewed-by: Colin Harrison commit fa6ab7d9b2d7fd8184f1e068360607845f5c33ab -Merge: adde4e6 0e1ab43 +Merge: adde4e6448 0e1ab433f4 Author: Peter Hutterer Date: Fri Jan 11 14:58:17 2013 +1000 @@ -38557,14 +48582,14 @@ Date: Wed Dec 19 12:47:35 2012 -0800 Signed-off-by: Keith Packard commit 2a0b544f5c09f79e4ab04ea8103a5ecf59ee2e7b -Merge: 0eb1559 ba4bb3b +Merge: 0eb1559eb2 ba4bb3bc1b Author: Keith Packard Date: Wed Dec 19 12:26:00 2012 -0800 Merge remote-tracking branch 'jeremyhu/master' commit 0eb1559eb29d11e63c2b33e317590a88d86fe313 -Merge: 386e4d7 ea1d76d +Merge: 386e4d76ba ea1d76d1b6 Author: Keith Packard Date: Wed Dec 19 12:21:31 2012 -0800 @@ -38574,25 +48599,25 @@ Date: Wed Dec 19 12:21:31 2012 -0800 whitespace. commit 386e4d76baaffe226d2d561ff936509454eb0ac2 -Merge: 014a5c8 9ff2e83 +Merge: 014a5c8a9d 9ff2e83151 Author: Keith Packard Date: Wed Dec 19 12:17:59 2012 -0800 Merge remote-tracking branch 'alanc/master' commit 014a5c8a9d86f2f992183bff9106354fac2c3b0e -Merge: f793b5f 2eefa5d +Merge: f793b5fd3e 2eefa5d6e8 Author: Keith Packard Date: Wed Dec 19 12:09:31 2012 -0800 Merge remote-tracking branch 'whot/barriers' Conflicts: - Xi/xichangehierarchy.c + Xi/xichangehierarchy.c Small conflict with the patch from - Xi: don't use devices after removing them + Xi: don't use devices after removing them Was easily resolved by hand. @@ -38743,7 +48768,7 @@ Date: Wed Dec 12 11:02:19 2012 +1000 Signed-off-by: Keith Packard commit 6d508b81857edaed03c7ee06410434ea56d9b701 -Merge: d982d87 bb6f351 +Merge: d982d87743 bb6f3514ca Author: Keith Packard Date: Mon Dec 17 11:45:45 2012 -0800 @@ -38753,7 +48778,7 @@ Date: Mon Dec 17 11:45:45 2012 -0800 reviewed them... commit d982d877436377597b8ed04bca1438d2edaf53ee -Merge: da3eaf6 6b4aa8a +Merge: da3eaf6bdb 6b4aa8a359 Author: Keith Packard Date: Mon Dec 17 10:56:12 2012 -0800 @@ -39103,14 +49128,14 @@ Date: Thu Nov 1 14:14:13 2012 -0400 Reviewed-by: Peter Hutterer commit bb6f3514ca17d993c1af380e8d4480d61e5bbcae -Merge: f961c3a 08da994 +Merge: f961c3a3b9 08da994a08 Author: Peter Hutterer Date: Wed Dec 12 17:25:28 2012 +1000 Merge branch 'stack-smash-on-touchpoint' into for-keith commit f961c3a3b9dfbe1201da317c24797ba7f979731e -Merge: 36740d0 39f19b3 +Merge: 36740d02b9 39f19b3f3b Author: Peter Hutterer Date: Wed Dec 12 17:25:23 2012 +1000 @@ -39311,7 +49336,7 @@ Date: Tue Dec 4 15:03:37 2012 +1000 Tested-by: Frank Roscher commit b51a1bd2766e7dc975ca8f1cacc3f8bd0e1a68a3 -Merge: e9ea96d ce6b652 +Merge: e9ea96d6a8 ce6b652929 Author: Keith Packard Date: Fri Nov 30 09:31:46 2012 -0800 @@ -39333,7 +49358,7 @@ Date: Fri Nov 30 20:54:38 2012 +1000 Signed-off-by: Keith Packard commit ce6b6529290f7d42717aad3fd8a83aaaaf8962de -Merge: 6e18599 3b9f1c7 +Merge: 6e18599d69 3b9f1c7017 Author: Peter Hutterer Date: Thu Nov 29 14:49:22 2012 +1000 @@ -39446,7 +49471,7 @@ Date: Thu Nov 8 14:28:09 2012 +0100 Signed-off-by: Dave Airlie commit 1712a45422a63f11b2146541279616fcfda09ec6 -Merge: e54f71a 338bec3 +Merge: e54f71a2c7 338bec3005 Author: Keith Packard Date: Wed Nov 28 07:54:13 2012 -0800 @@ -39579,7 +49604,7 @@ Date: Wed Oct 17 12:06:47 2012 +0200 Signed-off-by: Keith Packard commit d50a94568e06a06df682a0028579d37a7b209d15 -Merge: 87b60ef cf05db8 +Merge: 87b60efb85 cf05db8dde Author: Keith Packard Date: Tue Nov 27 15:14:26 2012 -0800 @@ -39984,7 +50009,7 @@ Date: Sat Oct 13 22:43:26 2012 -0400 Signed-off-by: Peter Hutterer commit 6a6c3afe71ac82a93d9fd0034dd5bbdcf0eae1ea -Merge: 14c9e24 6f14508 +Merge: 14c9e245ba 6f145084d5 Author: Keith Packard Date: Sun Nov 18 21:50:20 2012 -0800 @@ -40094,7 +50119,7 @@ Date: Sat Nov 17 11:52:10 2012 -0500 Signed-off-by: Jeremy Huddleston Sequoia commit 011f8458805e443ac9130865d2840a929a00cabf -Merge: 54ba26c b4e44b2 +Merge: 54ba26cb1f b4e44b285e Author: Keith Packard Date: Mon Nov 5 17:16:07 2012 -0800 @@ -40421,7 +50446,7 @@ Date: Wed Oct 24 23:57:11 2012 -0500 Reviewed-by: Peter Hutterer commit 04f980ead5e9af066143a921e0a0e98f26f28ee5 -Merge: a194630 a4941ce +Merge: a194630f7f a4941ce496 Author: Keith Packard Date: Mon Nov 5 08:45:21 2012 -0800 @@ -40471,7 +50496,7 @@ Date: Tue Sep 4 17:28:16 2012 +0100 Reviewed-by: Colin Harrison commit a194630f7f7b287cb4ea4a459df0745f4c0d4c1a -Merge: 74a3130 d511a30 +Merge: 74a3130426 d511a3016a Author: Keith Packard Date: Thu Nov 1 13:38:54 2012 -0700 @@ -40506,7 +50531,7 @@ Date: Thu Oct 25 15:03:50 2012 +0200 Signed-off-by: Peter Hutterer commit 74a3130426d7e1b456e45daa517769cd3e4b58c0 -Merge: 1ca096d f32ad6d +Merge: 1ca096d5e0 f32ad6dd31 Author: Keith Packard Date: Mon Oct 29 09:09:16 2012 -0700 @@ -40660,14 +50685,14 @@ Date: Sun Oct 14 23:38:20 2012 -0500 Reviewed-by: Jon TURNEY commit 53830281b4da096f9c13107d73ec9c76ff1d14cc -Merge: abc2ef5 9cbcb5b +Merge: abc2ef590c 9cbcb5bd6a Author: Keith Packard Date: Fri Oct 26 18:04:34 2012 -0700 Merge remote-tracking branch 'sandmann/for-keithp' commit abc2ef590c7cb33ebe21726f83b7347406975f95 -Merge: 0e85e5e c5396ec +Merge: 0e85e5e628 c5396ec05a Author: Keith Packard Date: Fri Oct 26 17:11:58 2012 -0700 @@ -41455,14 +51480,14 @@ Date: Thu Oct 4 14:42:37 2012 -0700 In commit: - commit 092c57ab173c8b71056f6feb3b9d04d063a46579 - Author: Adam Jackson - Date: Fri Jun 17 14:03:01 2011 -0400 + commit 092c57ab173c8b71056f6feb3b9d04d063a46579 + Author: Adam Jackson + Date: Fri Jun 17 14:03:01 2011 -0400 - os: Hide the Connection{In,Out}put implementation details + os: Hide the Connection{In,Out}put implementation details - Reviewed-by: Daniel Stone - Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + Signed-off-by: Adam Jackson the check for an empty output buffer was moved from one calling location into the FlushClient implementation itself. However, this @@ -41478,7 +51503,7 @@ Date: Thu Oct 4 14:42:37 2012 -0700 Reviewed-by: Julien Cristau commit 8367dd9736d74eca971da345c2bf559ce5bbf649 -Merge: 36c18bb 7998e26 +Merge: 36c18bb81b 7998e26159 Author: Keith Packard Date: Thu Oct 4 13:08:35 2012 -0700 @@ -41542,7 +51567,7 @@ Date: Thu Oct 4 11:42:22 2012 -0700 Signed-off-by: Keith Packard commit f179b13b91c8891254d31345ee04e773839e6b87 -Merge: 4dd5989 3d2b768 +Merge: 4dd5989d15 3d2b768efa Author: Keith Packard Date: Thu Oct 4 11:39:46 2012 -0700 @@ -41694,7 +51719,7 @@ Date: Fri Sep 7 18:10:35 2012 +0100 Reviewed-by: Ian Romanick commit 4dd5989d15465f3f3480b521d4e36673972fa24a -Merge: 0b02150 506e343 +Merge: 0b02150c27 506e3437c7 Author: Keith Packard Date: Mon Sep 24 11:43:01 2012 -0700 @@ -41730,7 +51755,7 @@ Date: Mon Sep 24 14:03:31 2012 -0400 Signed-off-by: Keith Packard commit 7722bcbab2507d263c7685b15cccbfdd52fc3a24 -Merge: 4dc2a76 f54987d +Merge: 4dc2a76740 f54987de97 Author: Keith Packard Date: Sun Sep 23 16:04:13 2012 -0700 @@ -41976,7 +52001,7 @@ Date: Thu Jun 16 17:40:24 2011 -0400 Signed-off-by: Adam Jackson commit d01921ec18c21f21d377b60626cc2d3418b84a7c -Merge: 70e5766 245e7e0 +Merge: 70e5766874 245e7e0361 Author: Keith Packard Date: Thu Sep 20 17:26:48 2012 +0200 @@ -42163,7 +52188,7 @@ Date: Wed Sep 5 14:45:08 2012 -0700 Signed-off-by: Keith Packard commit 856f80c8d7f22b979c72d9c70b70187df6004a03 -Merge: 0db936a b8ab93d +Merge: 0db936a5b7 b8ab93dfbc Author: Keith Packard Date: Wed Sep 5 11:02:58 2012 -0700 @@ -42308,7 +52333,7 @@ Date: Mon Aug 27 17:15:19 2012 -0700 Reviewed-by: Peter Hutterer commit a557edca6152ad09c685a00e01534c35a1f00f2e -Merge: 6619f5c 24ffcfc +Merge: 6619f5c0e1 24ffcfcded Author: Keith Packard Date: Mon Aug 27 08:06:09 2012 -0700 @@ -42500,7 +52525,7 @@ Date: Thu Jul 19 22:15:10 2012 +0000 Signed-off-by: Adam Jackson commit ad5fe2d9614959b68bf71e23abf7e5abac9c2734 -Merge: 16d8da5 99b94af +Merge: 16d8da5ca9 99b94af1ff Author: Keith Packard Date: Wed Aug 15 13:29:17 2012 -0700 @@ -42641,21 +52666,21 @@ Date: Sat Jul 14 16:07:51 2012 +0200 Signed-off-by: Keith Packard commit 02f94b2d446f6700f791f318c551ac835af8445a -Merge: 360fa77 7f09126 +Merge: 360fa7736b 7f09126e06 Author: Keith Packard Date: Mon Aug 6 16:52:12 2012 -0700 Merge remote-tracking branch 'whot/for-keith' commit 360fa7736b214cae3ccd39feb4dc87b9e7e9734c -Merge: 2100e72 ac09a4a +Merge: 2100e72388 ac09a4a091 Author: Keith Packard Date: Mon Aug 6 16:42:34 2012 -0700 Merge remote-tracking branch 'airlied/for-keithp' commit 2100e72388a3dc174093d80c9723f021b4614d17 -Merge: 4a6f42d c37c650 +Merge: 4a6f42dda0 c37c65052f Author: Keith Packard Date: Mon Aug 6 16:40:54 2012 -0700 @@ -42871,21 +52896,21 @@ Date: Tue Jul 10 23:29:53 2012 -0700 Reviewed-by: Keith Packard commit 94b514d5e4b376d05e106eb3853da511256e8545 -Merge: 7d87545 7328900 +Merge: 7d87545ba7 7328900042 Author: Keith Packard Date: Mon Aug 6 15:13:17 2012 -0700 Merge remote-tracking branch 'whot/for-keith' commit 7d87545ba7395ade507cca7bdca7052b26ed18d8 -Merge: ad707a7 988d7ac +Merge: ad707a7dcc 988d7ace19 Author: Keith Packard Date: Mon Aug 6 15:11:13 2012 -0700 Merge remote-tracking branch 'jturney/master' commit ad707a7dcc65c30e030c7600b54f734090e56a91 -Merge: 5a51cb8 884f51e +Merge: 5a51cb86f3 884f51e977 Author: Keith Packard Date: Mon Aug 6 15:08:01 2012 -0700 @@ -43356,7 +53381,7 @@ Date: Thu Jul 19 15:00:03 2012 -0400 Signed-off-by: Keith Packard commit 20b4d90f32b3ca5def5be2fdf04a91ae6c47f125 -Merge: 83df169 fd228d3 +Merge: 83df169538 fd228d3184 Author: Keith Packard Date: Wed Jul 25 13:52:35 2012 -0700 @@ -43451,14 +53476,14 @@ Date: Tue Jul 17 15:47:39 2012 -0700 Signed-off-by: Keith Packard commit beeea70495a8d5c4afc1b1eb2cc06a24ab1a986d -Merge: 6e438a0 6910280 +Merge: 6e438a0e18 6910280297 Author: Keith Packard Date: Tue Jul 17 12:17:39 2012 -0700 Merge remote-tracking branch 'alanc/master' commit 6e438a0e183f5a6c22070746c038af53d5b935ca -Merge: 5884e7d 75966a4 +Merge: 5884e7dede 75966a4186 Author: Keith Packard Date: Tue Jul 17 12:12:53 2012 -0700 @@ -43823,7 +53848,7 @@ Date: Fri Jul 13 00:47:24 2012 +1000 Signed-off-by: Keith Packard commit 746193a7f10f11cccae05c98b933aadf58fc7375 -Merge: a2d0829 2b74949 +Merge: a2d0829531 2b74949ad0 Author: Keith Packard Date: Thu Jul 12 15:10:51 2012 -0700 @@ -43875,7 +53900,7 @@ Date: Thu Jul 12 00:36:43 2012 +0100 Reviewed-by: Colin Harrison commit 656e5fea6c9ca15f932889edcc590dd01c881945 -Merge: 8b820f2 1720cd9 +Merge: 8b820f221a 1720cd9bad Author: Keith Packard Date: Thu Jul 12 08:26:35 2012 -0700 @@ -44048,11 +54073,11 @@ Date: Tue Jul 10 15:58:48 2012 -0700 In: - commit d792ac125a0462a04a930af543cbc732f8cdab7d - Author: Alan Coopersmith - Date: Mon Jul 9 19:12:43 2012 -0700 + commit d792ac125a0462a04a930af543cbc732f8cdab7d + Author: Alan Coopersmith + Date: Mon Jul 9 19:12:43 2012 -0700 - Use C99 designated initializers in dix Replies + Use C99 designated initializers in dix Replies the initializer for the .length element of the xGetPointerMappingReply structure uses the value of rep.nElts, but that won't be set until @@ -44061,7 +54086,7 @@ Date: Tue Jul 10 15:58:48 2012 -0700 Easy to verify: - $ xmodmap -pp + $ xmodmap -pp Fixed by creating a local nElts variable and using that. @@ -44077,7 +54102,7 @@ Date: Tue Jul 10 01:14:13 2012 -0700 Signed-off-by: Keith Packard commit 6e12cb147da58bd12a158807b2cd5afac32ae70f -Merge: 532fbc2 0231279 +Merge: 532fbc29c9 023127915e Author: Keith Packard Date: Tue Jul 10 00:52:11 2012 -0700 @@ -45760,7 +55785,7 @@ Date: Thu Jul 5 21:11:16 2012 +0100 Signed-off-by: Dave Airlie commit 4d24192bd24fb20d16d0054d77bffda883faeb79 -Merge: 7c9d8cb 74b786f +Merge: 7c9d8cbd36 74b786f7ce Author: Keith Packard Date: Fri Jul 6 12:17:17 2012 -0700 @@ -46080,10 +56105,10 @@ Date: Tue Jul 3 15:45:09 2012 -0700 The objects which support screen-specific privates are: - Windows - Pixmaps - GCs - Pictures + Windows + Pixmaps + GCs + Pictures Extending this list to include Colormaps would be possible, but require slightly more work as the default colormap is created before @@ -46292,14 +56317,14 @@ Date: Thu Jun 28 17:17:12 2012 +0200 Signed-off-by: Peter Hutterer commit d84f0f823eeeecdf0498aadd3fbb1d11dabc0837 -Merge: 12bfb4c d04dfe3 +Merge: 12bfb4cf1b d04dfe3f75 Author: Peter Hutterer Date: Wed Jul 4 21:23:48 2012 +1000 Merge branch 'sigio-vt-switch-issues' into for-keith Conflicts: - test/Makefile.am + test/Makefile.am Signed-off-by: Peter Hutterer @@ -46410,7 +56435,7 @@ Date: Fri Jun 22 13:02:40 2012 +1000 Reviewed-by: Keith Packard commit 24525d96a3b9dba67eb75042500b2f208a2cc246 -Merge: 4cd91bd 35e3d22 +Merge: 4cd91bd4c6 35e3d22915 Author: Keith Packard Date: Mon Jul 2 22:35:39 2012 -0700 @@ -46730,14 +56755,14 @@ Date: Thu Jun 28 12:07:11 2012 +1000 Signed-off-by: Keith Packard commit 8b4f0a4fdd6c15f49458bc3a8c3135b8c389240d -Merge: 59294a2 d642e71 +Merge: 59294a2179 d642e71287 Author: Keith Packard Date: Thu Jun 28 10:38:26 2012 -0700 Merge remote-tracking branch 'jturney/master' commit 59294a2179bd5bb996693af004b470932df00ac6 -Merge: 855003c 191b630 +Merge: 855003c333 191b630656 Author: Keith Packard Date: Thu Jun 28 10:11:44 2012 -0700 @@ -46969,7 +56994,7 @@ Date: Fri Jun 24 13:32:10 2011 +0100 Reviewed-by: Colin Harrison commit 3ef3ce069d52dcfa932c90ccd30854a8d9daa15a -Merge: a0c8716 ff541e0 +Merge: a0c8716cdc ff541e0a1f Author: Keith Packard Date: Thu Jun 21 08:52:34 2012 -0700 @@ -47108,14 +57133,14 @@ Date: Thu Jun 7 16:52:20 2012 +1000 Reviewed-by: Chase Douglas commit 8dc70acbf3d82611ac9ec1ec2a52edcc01934850 -Merge: ffb47a1 b59adc9 +Merge: ffb47a123d b59adc9c24 Author: Keith Packard Date: Thu Jun 14 13:04:29 2012 -0700 Merge remote-tracking branch 'alanc/master' commit ffb47a123ddd1233fb4229cf23483652065c5e82 -Merge: db9d2b8 b840ba5 +Merge: db9d2b8a50 b840ba5f54 Author: Keith Packard Date: Thu Jun 14 13:01:17 2012 -0700 @@ -47134,7 +57159,7 @@ Date: Thu Jun 7 15:01:59 2012 +0100 Signed-off-by: Keith Packard commit 6d86b64dbaef5a16712fd1fdc3157f716d238877 -Merge: 812786f 4c68f5d +Merge: 812786f4d4 4c68f5d395 Author: Keith Packard Date: Thu Jun 14 11:05:22 2012 -0700 @@ -47771,7 +57796,7 @@ Date: Fri Apr 6 12:44:07 2012 -0700 Reviewed-by: Peter Hutterer commit 3476eb38063473a7a5fcd78e2095e284118de839 -Merge: 78f0d9c 42ae2e8 +Merge: 78f0d9cdc4 42ae2e8199 Author: Keith Packard Date: Sun Jun 3 20:24:24 2012 -0700 @@ -48082,7 +58107,7 @@ Date: Tue May 22 21:19:40 2012 -0700 Signed-off-by: Keith Packard commit 457fc77691b2df66f6dd3ba10ce7c1b61b9b42a3 -Merge: 2e237c8 5a3a98f +Merge: 2e237c838f 5a3a98fcb7 Author: Keith Packard Date: Tue May 22 10:32:29 2012 -0700 @@ -48302,7 +58327,7 @@ Date: Thu Jan 26 15:44:40 2012 -0800 Reviewed-by: Dave Airlie commit ba883a0f3435d5da82a8134e696c4905eea70f23 -Merge: ae1c48e acdc4f5 +Merge: ae1c48ebc8 acdc4f54ee Author: Keith Packard Date: Thu May 17 16:49:19 2012 -0700 @@ -48657,7 +58682,7 @@ Date: Tue Apr 24 18:11:16 2012 +0200 Signed-off-by: Dave Airlie commit 3a94b338aaa48b656aae1bb3a5a9d64300c0a093 -Merge: afc153a c91d00e +Merge: afc153a5b4 c91d00e0f3 Author: Keith Packard Date: Wed May 9 21:17:16 2012 -0700 @@ -48840,7 +58865,7 @@ Date: Wed Apr 18 17:51:50 2012 +0800 Signed-off-by: Peter Hutterer commit 97041364a6acb2b66b5cfd06757c90a006ad50e9 -Merge: 1908272 ee542b8 +Merge: 19082726cb ee542b8559 Author: Keith Packard Date: Wed May 2 20:47:25 2012 -0700 @@ -49232,7 +59257,7 @@ Date: Thu Apr 19 16:51:46 2012 -0700 Tested-By: Michal Suchanek commit d77eb7ee49ef19c2c4c7381d56e9d0f9c3fbc890 -Merge: 31e3c0f c7b1625 +Merge: 31e3c0ff7f c7b1625558 Author: Keith Packard Date: Thu Apr 19 15:48:34 2012 -0500 @@ -49251,7 +59276,7 @@ Date: Thu Apr 19 15:25:41 2012 -0500 Signed-off-by: Keith Packard commit e6308e32fe2b5f74133d4d238ffa512257f6327c -Merge: 3720aa3 51a8d8d +Merge: 3720aa33ee 51a8d8dd19 Author: Keith Packard Date: Thu Apr 19 10:45:07 2012 -0500 @@ -49260,7 +59285,7 @@ Date: Thu Apr 19 10:45:07 2012 -0500 Touch input changes from Chase commit 51a8d8dd19d7496fe84b37a1f0a7a03658120539 -Merge: ebf2148 00cf1c4 +Merge: ebf214876a 00cf1c40b2 Author: Peter Hutterer Date: Thu Apr 19 17:03:54 2012 +1000 @@ -49668,7 +59693,7 @@ Date: Tue Apr 17 11:48:03 2012 +0100 cursor: hide cursors on LeaveVT commit 80fefc42f5e67e6b4a4b440d8991bee7e5f38359 -Merge: 9779b90 12188c8 +Merge: 9779b904c7 12188c8a8a Author: Keith Packard Date: Sun Apr 15 21:05:30 2012 -0700 @@ -50037,7 +60062,7 @@ Date: Fri Mar 23 08:20:22 2012 +1000 Signed-off-by: Peter Hutterer commit 7f3997b01a8813c1d7055317eb06111aed8572c9 -Merge: 92d50c3 31646d8 +Merge: 92d50c38b2 31646d8fa9 Author: Keith Packard Date: Mon Mar 26 16:41:52 2012 -0700 @@ -50456,7 +60481,7 @@ Date: Fri Mar 23 14:54:05 2012 +0000 modesetting: fix build against older Xext commit a7eac500e652f30deffd9dc5e623fab701077738 -Merge: bf876c8 d645edd +Merge: bf876c87a9 d645edd11e Author: Peter Hutterer Date: Thu Mar 22 13:13:07 2012 +1000 @@ -50590,7 +60615,7 @@ Date: Wed Mar 14 17:22:18 2012 -0700 Signed-off-by: Peter Hutterer commit bf876c87a9099fdfa63ed599f8ed9a954dd023d9 -Merge: 908ab3d c0b0a9b +Merge: 908ab3d580 c0b0a9bce9 Author: Peter Hutterer Date: Thu Mar 22 11:34:43 2012 +1000 @@ -50632,7 +60657,7 @@ Date: Mon Mar 5 14:12:52 2012 +1000 s += sprintf(s, "nval: %d ::", (int)THIS->nvaluators); for (i = 0; i < THIS->nvaluators; i++) { - s += sprintf(s, " %d: ", i); + s += sprintf(s, " %d: ", i); if (BitIsSet(mask, i)) s += sprintf(s, "%d", (int)valuators[i]); } @@ -50914,13 +60939,13 @@ Date: Wed Mar 21 12:55:09 2012 -0700 from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: - -bap - -psl - -T PrivatePtr - -T pmWait - -T _XFUNCPROTOBEGIN - -T _XFUNCPROTOEND - -T _X_EXPORT + -bap + -psl + -T PrivatePtr + -T pmWait + -T _XFUNCPROTOBEGIN + -T _XFUNCPROTOEND + -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that @@ -50936,17 +60961,17 @@ Date: Wed Mar 21 12:55:09 2012 -0700 dir2=$2 for dir in $dir1 $dir2; do - (cd $dir && find . -name '*.o' | while read file; do - dir=`dirname $file` - base=`basename $file .o` - dump=$dir/$base.dump - objdump -d $file > $dump - done) + (cd $dir && find . -name '*.o' | while read file; do + dir=`dirname $file` + base=`basename $file .o` + dump=$dir/$base.dump + objdump -d $file > $dump + done) done find $dir1 -name '*.dump' | while read dump; do - otherdump=`echo $dump | sed "s;$dir1;$dir2;"` - diff -u $dump $otherdump + otherdump=`echo $dump | sed "s;$dir1;$dir2;"` + diff -u $dump $otherdump done Signed-off-by: Keith Packard @@ -51222,7 +61247,7 @@ Date: Sun Feb 19 08:34:25 2012 -0500 Signed-off-by: Dave Airlie commit 71594746c7da32e1c7986341a0da30f241a7a2be -Merge: d53235a eaba06a +Merge: d53235af85 eaba06a27c Author: Keith Packard Date: Wed Feb 22 18:07:20 2012 +1300 @@ -51467,7 +61492,7 @@ Date: Sat Feb 11 16:13:44 2012 +1300 Signed-off-by: Keith Packard commit 42b6756463ee0476340656707f1088dc6c2fd220 -Merge: 7674d00 ca64912 +Merge: 7674d00b04 ca64912c02 Author: Keith Packard Date: Sat Feb 11 15:36:43 2012 +1300 @@ -52246,14 +62271,14 @@ Date: Thu Jan 12 12:09:34 2012 -0800 ABI change pended for 1.13 commit e722ad6c3efa57b806ca0f2dc13114bd3619a88c -Merge: e476af4 4e44580 +Merge: e476af417d 4e44580efd Author: Keith Packard Date: Mon Jan 9 13:22:28 2012 -0800 Merge remote-tracking branch 'jturney/rpavlik-xwin-fixes' commit e476af417d83730b11054f4e5b127ab5540bb332 -Merge: f4956fa 1460083 +Merge: f4956faab9 146008358e Author: Keith Packard Date: Mon Jan 9 13:17:37 2012 -0800 @@ -52388,21 +62413,21 @@ Date: Fri Jan 6 07:21:37 2012 +0000 Signed-off-by: Keith Packard commit 0b113f7cdf5228dccd51a749a339c8669e3f20ff -Merge: 0b2c649 777bf90 +Merge: 0b2c6491c5 777bf90abe Author: Keith Packard Date: Mon Jan 9 13:07:25 2012 -0800 Merge commit '777bf90abeac37087a3d0538b847742523d5acf2' commit 0b2c6491c5e5e1c9ba067299f3de61f5acee263b -Merge: 1f5587e 6b19436 +Merge: 1f5587e144 6b19436536 Author: Keith Packard Date: Mon Jan 9 11:40:23 2012 -0800 Merge remote-tracking branch 'whot/for-keith' commit 1f5587e14406c083687203030db6a11691ac9d9f -Merge: a97252d 6269977 +Merge: a97252db24 6269977c91 Author: Keith Packard Date: Mon Jan 9 11:37:59 2012 -0800 @@ -52907,7 +62932,7 @@ Date: Tue Dec 27 14:02:01 2011 -0800 Signed-off-by: Keith Packard commit 8dedf9831bd80514d800f0085213296a3726dba7 -Merge: cfc4c3d cf96183 +Merge: cfc4c3d7fa cf96183122 Author: Keith Packard Date: Tue Dec 27 13:13:48 2011 -0800 @@ -52957,7 +62982,7 @@ Date: Thu Dec 22 09:35:51 2011 -0800 The touchid test was using a loop like: - for(i = 1; i < 0xffffffff; i <<= 1) + for(i = 1; i < 0xffffffff; i <<= 1) When 'i' is a 32-bit variable, this infinite loops as it goes from 0x80000000 to 0. 'i' is declared as 'long', which is 32-bit in 32-bit mode. @@ -53006,15 +63031,15 @@ Date: Thu Dec 22 10:00:15 2011 +1000 Reviewed-by: Chase Douglas commit e395efc25f9fd60377f32c2bf1a9153d70908236 -Merge: 2bb282c fcda98c +Merge: 2bb282cd45 fcda98c486 Author: Peter Hutterer Date: Thu Dec 22 09:29:59 2011 +1000 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into multitouch Conflicts: - configure.ac - dix/inpututils.c + configure.ac + dix/inpututils.c Signed-off-by: Peter Hutterer @@ -53444,14 +63469,14 @@ Date: Mon Dec 19 14:52:41 2011 +1000 Reviewed-by: Chase Douglas commit 2d34b34ed7547b829979756ccfb2cff79368d0a4 -Merge: e4b4d83 1deede3 +Merge: e4b4d83fad 1deede3c48 Author: Keith Packard Date: Tue Dec 20 00:23:33 2011 -0800 Merge remote-tracking branch 'jeremyhu/master' commit e4b4d83fad37bb737e25f7226dbcd15b892f9528 -Merge: 4df65d2 d26cb70 +Merge: 4df65d247b d26cb70272 Author: Keith Packard Date: Mon Dec 19 22:36:31 2011 -0800 @@ -53965,7 +63990,7 @@ Date: Wed Dec 14 10:34:19 2011 +1000 Signed-off-by: Keith Packard commit 7da7aa96a0acb895e1fe57a9d3f2d093479cf2a2 -Merge: b79de3f 7528a6b +Merge: b79de3f42f 7528a6b88e Author: Keith Packard Date: Wed Dec 14 11:40:10 2011 -0800 @@ -53983,7 +64008,7 @@ Date: Wed Dec 14 10:31:23 2011 +1000 Signed-off-by: Peter Hutterer commit 7528a6b88eb32098af4369a8bd9d70a808fa6f1c -Merge: f0de5e3 898d976 +Merge: f0de5e3990 898d976729 Author: Peter Hutterer Date: Tue Dec 13 14:19:54 2011 +1000 @@ -54863,7 +64888,7 @@ Date: Thu Dec 8 21:52:07 2011 -0800 Signed-off-by: Keith Packard commit 522f8bcc0360d6a117e929a004bc956ab92037e9 -Merge: 6369b59 2abe83d +Merge: 6369b59668 2abe83df68 Author: Keith Packard Date: Thu Dec 8 20:57:26 2011 -0800 @@ -55064,14 +65089,14 @@ Date: Thu Dec 1 16:24:32 2011 -0500 Signed-off-by: Keith Packard commit 3ab8ee32470f7cf1223e04238bb8c5f74ed52fc3 -Merge: 22a666f 98c4a88 +Merge: 22a666f995 98c4a888a4 Author: Keith Packard Date: Wed Dec 7 12:42:17 2011 -0800 Merge remote-tracking branch 'airlied/reviewed-fixes' commit 22a666f9952feb7248e9bb2faf777edaaac8175f -Merge: 3824f55 e89b032 +Merge: 3824f558cc e89b0324da Author: Keith Packard Date: Wed Dec 7 12:27:23 2011 -0800 @@ -55485,14 +65510,14 @@ Date: Tue Nov 8 10:13:15 2011 -0800 Reviewed-by: Jamey Sharp commit 05f09354a30a4f5edd421220e1aa97be754c71bb -Merge: 3197b77 08ec4da +Merge: 3197b773c8 08ec4da6a7 Author: Keith Packard Date: Thu Dec 1 14:44:52 2011 +0000 Merge remote-tracking branch 'jcristau/for-keith' commit 3197b773c81e58cd4aa412eccaee49526012ed6f -Merge: 2dc5ba4 dfcec1d +Merge: 2dc5ba4a1b dfcec1d3f9 Author: Keith Packard Date: Thu Dec 1 14:36:58 2011 +0000 @@ -55982,7 +66007,7 @@ Date: Sat Oct 29 11:19:44 2011 -0700 LogVMessageVerb: Fix const mismatch warning "log.c", line 382: warning: assignment type mismatch: - pointer to char "=" pointer to const char + pointer to char "=" pointer to const char Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston @@ -56368,7 +66393,7 @@ Date: Fri Nov 4 23:26:25 2011 -0700 Signed-off-by: Keith Packard commit bfa2a1857a1efda7f171f10e855d200ca0dbcc1a -Merge: f0d50cc e7cb8f8 +Merge: f0d50cc665 e7cb8f802a Author: Keith Packard Date: Mon Nov 14 09:07:06 2011 -0800 @@ -56531,7 +66556,7 @@ Date: Thu Nov 3 13:18:46 2011 +0000 Not needed in here commit 548c6fe044068ffba9b5306dc6b11f2ba22782a4 -Merge: 3881b0b ffe8ec8 +Merge: 3881b0bf1c ffe8ec86db Author: Keith Packard Date: Wed Nov 2 21:35:31 2011 -0700 @@ -56550,14 +66575,14 @@ Date: Tue Nov 1 07:17:07 2011 -0400 Signed-off-by: Keith Packard commit d91aa0e6601bdf3e2cfa57b3412ab14ac486edc4 -Merge: 8df3a9c 401150d +Merge: 8df3a9ca5a 401150d7dc Author: Keith Packard Date: Wed Nov 2 21:20:07 2011 -0700 Merge remote-tracking branch 'whot/two-screen-coordinates' commit 8df3a9ca5abbd56eb2013fa65250d21a8f18865b -Merge: 8329afa ef89548 +Merge: 8329afa59d ef895484c8 Author: Keith Packard Date: Wed Nov 2 21:18:16 2011 -0700 @@ -56712,7 +66737,7 @@ Date: Mon Oct 31 15:01:12 2011 -0700 Signed-off-by: Keith Packard commit 132545ff576cc69ed63f5a08127151fe550de4c3 -Merge: d0c6732 d7c44a7 +Merge: d0c6732a99 d7c44a7c97 Author: Keith Packard Date: Sun Oct 30 16:57:58 2011 -0700 @@ -56938,7 +66963,7 @@ Date: Tue Oct 25 23:48:16 2011 -0700 Signed-off-by: Jeremy Huddleston commit 5701ab4a441eb113abd0851b0d71b82d12112854 -Merge: 7d50211 a41214b +Merge: 7d50211ab5 a41214bc9a Author: Keith Packard Date: Mon Oct 24 22:09:00 2011 -0700 @@ -57163,7 +67188,7 @@ Date: Mon Oct 24 18:47:06 2011 -0700 Signed-off-by: Keith Packard commit d9d3a01ffca5e2de650d098231e16205781804c5 -Merge: 17416e8 fb55f8f +Merge: 17416e88dc fb55f8f790 Author: Keith Packard Date: Mon Oct 24 18:12:23 2011 -0700 @@ -57340,21 +67365,21 @@ Date: Thu Oct 20 14:28:56 2011 -0700 Reviewed-by: Julien Cristau commit ff61592441916b83aeb778c74352bb5b26247f84 -Merge: af3f64f 525d417 +Merge: af3f64fb77 525d4172b2 Author: Keith Packard Date: Wed Oct 19 19:14:32 2011 -0700 Merge remote-tracking branch 'aplattner/for-master' commit af3f64fb77c13180e513ee99d1fd9a1b624fd8ea -Merge: 15bbdc1 df0dd36 +Merge: 15bbdc103b df0dd36dee Author: Keith Packard Date: Wed Oct 19 17:33:07 2011 -0700 Merge remote-tracking branch 'hramrach/pull' commit 15bbdc103b34b6b374815698946e6c409421a644 -Merge: a5266dc 323869f +Merge: a5266dcb3a 323869f329 Author: Keith Packard Date: Wed Oct 19 17:26:50 2011 -0700 @@ -57461,7 +67486,7 @@ Date: Tue Aug 23 15:19:59 2011 -0700 Signed-off-by: Aaron Plattner commit c8413362049cee8c30e0a9d67f78f9ebefe8e71f -Merge: 64d2d1b b67581c +Merge: 64d2d1bef1 b67581cf82 Author: Keith Packard Date: Tue Oct 18 07:45:24 2011 -0700 @@ -57608,14 +67633,14 @@ Date: Fri Sep 30 10:59:47 2011 +1000 Reviewed-by: Daniel Stone commit 64d2d1bef14c7ec7156bb3aae64eff69f9f7be54 -Merge: fb84be4 679c84b +Merge: fb84be47db 679c84bce9 Author: Keith Packard Date: Mon Oct 17 14:36:34 2011 -0700 Merge remote-tracking branch 'jeremyhu/master' commit fb84be47db7cdaff406792c08e34670e8e0cbda9 -Merge: fae7ed6 32b289e +Merge: fae7ed62ad 32b289e46c Author: Keith Packard Date: Mon Oct 17 13:50:25 2011 -0700 @@ -58377,14 +68402,14 @@ Date: Tue Aug 30 13:37:31 2011 +1000 Reviewed-by: Daniel Stone commit 6378d0233d21088b6429755627b4253859892c72 -Merge: 6e965d8 98b2306 +Merge: 6e965d8a18 98b230669f Author: Keith Packard Date: Mon Oct 3 13:56:06 2011 -0700 Merge remote-tracking branch 'herrb/master' commit 6e965d8a185087a55b2100b817e18f05b3ce5a00 -Merge: 466e4b3 ac5881d +Merge: 466e4b3f17 ac5881d6d0 Author: Keith Packard Date: Mon Oct 3 13:47:49 2011 -0700 @@ -58520,14 +68545,14 @@ Date: Mon Sep 26 22:38:44 2011 -0700 Signed-off-by: Keith Packard commit 9a55b3661b4172f9a32cd6fefb254e06edb1a88a -Merge: cf11ca3 84bb020 +Merge: cf11ca360c 84bb0207f6 Author: Keith Packard Date: Mon Oct 3 11:49:23 2011 -0700 Merge remote-tracking branch 'alanc/master' commit cf11ca360c2ded5ca309faa9d039160947387bb8 -Merge: 463dd87 6eae9fa +Merge: 463dd87062 6eae9fa284 Author: Keith Packard Date: Mon Oct 3 11:44:59 2011 -0700 @@ -58550,7 +68575,7 @@ Date: Thu Sep 22 18:38:53 2011 +0300 Signed-off-by: Keith Packard commit f5d50b46ddeb039ab6564141f61261e94ee67637 -Merge: 57cd32e 524e544 +Merge: 57cd32e934 524e5445c0 Author: Keith Packard Date: Mon Oct 3 11:36:28 2011 -0700 @@ -58686,7 +68711,7 @@ Date: Sun Sep 25 20:44:26 2011 +0200 Signed-off-by: Peter Hutterer commit 4c6bc0e76599dbe5ede2e1f48c9936a0e996b638 -Merge: 057cc92 3304bbf +Merge: 057cc92ebf 3304bbff9b Author: Peter Hutterer Date: Fri Sep 30 09:24:56 2011 +1000 @@ -58895,15 +68920,15 @@ Date: Thu Sep 29 11:49:26 2011 +0100 server recycling. commit 057cc92ebfeebe81b7d01ff2c6aa2c066c8d1a64 -Merge: afb1fe6 52c9b59 +Merge: afb1fe695d 52c9b59a9f Author: Peter Hutterer Date: Thu Sep 29 14:18:35 2011 +1000 Merge branch 'raw-events' into next Conflicts: - configure.ac - dix/events.c + configure.ac + dix/events.c commit 52c9b59a9fed6abfeca775a7a04133cee18eac0b Author: Peter Hutterer @@ -59410,7 +69435,7 @@ Date: Thu Sep 22 18:55:19 2011 -0700 Reviewed-by: Aaron Plattner commit afb1fe695d197187a301c19863a128a65389b15c -Merge: 7fb4bef c7163fd +Merge: 7fb4bef039 c7163fdd30 Author: Keith Packard Date: Mon Sep 26 20:24:15 2011 -0700 @@ -61729,21 +71754,21 @@ Date: Thu Sep 1 16:48:37 2011 -0700 Reviewed-by: Matt Dew commit 7fb4bef0394a5d09680985d34bce8252b61493cb -Merge: 98f4940 c90903b +Merge: 98f4940093 c90903b4f7 Author: Keith Packard Date: Wed Sep 21 14:34:27 2011 -0700 Merge remote-tracking branch 'mattst88/for-keith' commit 98f4940093dc90c3366d3e4d3ddceacbaee299dc -Merge: b018b81 c8eacae +Merge: b018b81533 c8eacae4f8 Author: Keith Packard Date: Wed Sep 21 14:30:19 2011 -0700 Merge remote-tracking branch 'alanc/master' commit b018b815333b256b5e06dd6251b2e539f09f89fa -Merge: 03d0329 0f380a5 +Merge: 03d032991d 0f380a5005 Author: Keith Packard Date: Wed Sep 21 14:17:14 2011 -0700 @@ -61905,7 +71930,7 @@ Date: Thu Aug 4 15:35:41 2011 -0400 Use internal temp variable for swap macros Also, fix whitespace, mainly around - swaps(&rep.sequenceNumber) + swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris Signed-off-by: Matt Turner @@ -62073,7 +72098,7 @@ Date: Wed Sep 7 17:47:56 2011 +0200 Signed-off-by: Keith Packard commit c92c83523ede8bc361526ac93d09d089fbbdae08 -Merge: 4ad271d 24b2b43 +Merge: 4ad271d06c 24b2b43e85 Author: Keith Packard Date: Wed Sep 21 13:32:06 2011 -0700 @@ -62176,11 +72201,11 @@ Date: Sat Jul 10 09:28:47 2010 -0700 Conflicts: - ChangeLog - dix/colormap.c - dix/pixmap.c - dix/window.c - include/pixmapstr.h + ChangeLog + dix/colormap.c + dix/pixmap.c + dix/window.c + include/pixmapstr.h Signed-off-by: Jamey Sharp Reviewed-by: Aaron Plattner @@ -62215,9 +72240,9 @@ Date: Sun Sep 18 20:47:04 2011 -0500 Alan Coopersmith explains: - XmuSnprintf() can be replaced by snprintf() now. (It was a - implementation X provided for it's libraries to use in the days - before all platforms we cared about had snprintf in libc.) + XmuSnprintf() can be replaced by snprintf() now. (It was a + implementation X provided for it's libraries to use in the days + before all platforms we cared about had snprintf in libc.) Reported-by: walter harms Signed-off-by: Jamey Sharp @@ -62380,7 +72405,7 @@ Date: Tue Sep 13 14:31:24 2011 -0500 x86emu: There is no NO_INLINE implementation of unaligned access here. Patch produced with: - unifdef -UNO_INLINE -B + unifdef -UNO_INLINE -B This change isn't relevant to the similar code in hw/xfree86/common/compiler.h, because x86emu is expected to someday move @@ -63070,7 +73095,7 @@ Date: Thu Jul 28 15:17:59 2011 -0700 Conflicts: - composite/compalloc.c + composite/compalloc.c Signed-off-by: Keith Packard commit e87adcc9e024982fdad974de2876b00cf974dab8 @@ -63123,7 +73148,7 @@ Date: Fri Jul 29 16:12:06 2011 -0700 Signed-off-by: Keith Packard commit b8f61c11c94708d4f17720a55945dee4621315a4 -Merge: 5596f10 f51e42f +Merge: 5596f10cce f51e42f583 Author: Keith Packard Date: Fri Jul 29 14:58:58 2011 -0700 @@ -63439,7 +73464,7 @@ Date: Wed Jul 13 12:08:03 2011 +0100 Signed-off-by: Peter Hutterer commit 01dbf2514aa0cc8c40a876a24e3cb0737c41da19 -Merge: 5a801af af0fbc3 +Merge: 5a801af689 af0fbc37e3 Author: Keith Packard Date: Wed Jul 13 11:44:15 2011 -0700 @@ -63605,7 +73630,7 @@ Date: Mon Oct 11 16:21:40 2010 +0100 Signed-off-by: Jon TURNEY commit d4096abb591353405417e53816e5c46e904e7b25 -Merge: 61f87a7 87d4f90 +Merge: 61f87a75f2 87d4f90bfc Author: Keith Packard Date: Fri Jul 1 15:45:45 2011 -0700 @@ -63843,14 +73868,14 @@ Date: Tue Jun 7 21:22:15 2011 +0200 Signed-off-by: Peter Hutterer commit 61f87a75f2bcda939a1778d39be8cfa5c886e6d8 -Merge: 0d2153a 72d9143 +Merge: 0d2153a46c 72d914335c Author: Keith Packard Date: Wed Jun 29 20:14:51 2011 -0700 Merge remote-tracking branch 'jturney/master' commit 0d2153a46cc72d5f2e6a9081a3cf153aa3eb7787 -Merge: b631c39 932513e +Merge: b631c39a21 932513e23b Author: Keith Packard Date: Wed Jun 29 20:08:32 2011 -0700 @@ -63871,7 +73896,7 @@ Date: Thu Jun 23 13:37:45 2011 -0400 Signed-off-by: Keith Packard commit d5ca33ca2dd08e8436439da926d2dedaabc268fa -Merge: 38d55f0 4edf49d +Merge: 38d55f06cf 4edf49d032 Author: Keith Packard Date: Wed Jun 29 18:54:33 2011 -0700 @@ -64034,7 +74059,7 @@ Date: Tue Jun 28 09:33:25 2011 -0700 after 'make clean' causing 'make distcheck' to fail. commit f968f4ace9410d827fb6b68c4e38ea9516641309 -Merge: 4dbed26 163441f +Merge: 4dbed26254 163441fe53 Author: Keith Packard Date: Tue Jun 28 09:10:14 2011 -0700 @@ -64109,7 +74134,7 @@ Date: Tue Jun 14 17:21:48 2011 -0700 Tested-by: Peter Hutterer commit 8ac651552bb70ba36238f430adab2f7a7f24db6e -Merge: 945b2ff 47b6ba3 +Merge: 945b2ff814 47b6ba3204 Author: Keith Packard Date: Wed Jun 22 11:03:37 2011 -0700 @@ -64684,14 +74709,14 @@ Date: Fri May 27 11:40:56 2011 +1000 Reviewed-by: Daniel Stone commit 02d11af01211da55e9d93fe0e1851a0c6fe57472 -Merge: bf9fd0a ab0df72 +Merge: bf9fd0a83e ab0df72cd3 Author: Keith Packard Date: Tue Jun 7 12:31:15 2011 -0700 Merge remote-tracking branch 'kibi/master' commit bf9fd0a83eef771ee018438f05e2d9f20b43539b -Merge: 21eec36 0d14056 +Merge: 21eec367d0 0d140567ba Author: Keith Packard Date: Tue Jun 7 07:45:22 2011 -0700 @@ -65002,14 +75027,14 @@ Date: Tue May 31 13:01:05 2011 -0700 Fixes regression introduced by b0c665ac0fe6840dda581e4d0d0b76c703d62a7b - 0 X11.bin 0x0000000100118293 __glXAquaScreenCreateContext + 684 - 1 X11.bin 0x00000001001315b0 DoCreateContext + 163 - 2 X11.bin 0x000000010013509f __glXDispatch + 211 - 3 X11.bin 0x00000001000c7dad Dispatch + 785 - 4 X11.bin 0x00000001000b97e5 dix_main + 1022 - 5 X11.bin 0x00000001000122bc server_thread + 50 - 6 libSystem.B.dylib 0x00007fff836554f6 _pthread_start + 331 - 7 libSystem.B.dylib 0x00007fff836553a9 thread_start + 13 + 0 X11.bin 0x0000000100118293 __glXAquaScreenCreateContext + 684 + 1 X11.bin 0x00000001001315b0 DoCreateContext + 163 + 2 X11.bin 0x000000010013509f __glXDispatch + 211 + 3 X11.bin 0x00000001000c7dad Dispatch + 785 + 4 X11.bin 0x00000001000b97e5 dix_main + 1022 + 5 X11.bin 0x00000001000122bc server_thread + 50 + 6 libSystem.B.dylib 0x00007fff836554f6 _pthread_start + 331 + 7 libSystem.B.dylib 0x00007fff836553a9 thread_start + 13 http://lists.apple.com/archives/X11-users/2011/May/msg00045.html @@ -65041,14 +75066,14 @@ Date: Wed Jun 1 11:20:10 2011 -0700 Signed-off-by: Keith Packard commit 0643c056512d10be8db223d18d6563292d57e916 -Merge: a2e6cfc d45f5b2 +Merge: a2e6cfc18a d45f5b2493 Author: Keith Packard Date: Tue May 31 23:45:07 2011 -0700 Merge remote-tracking branch 'ajax/xserver-next' commit a2e6cfc18aec1c0027b51572b03ec9f2ab074b56 -Merge: bc04065 8d84fd2 +Merge: bc04065b5c 8d84fd2566 Author: Keith Packard Date: Tue May 31 23:42:52 2011 -0700 @@ -65184,7 +75209,7 @@ Date: Tue May 24 16:02:42 2011 -0700 Signed-off-by: Keith Packard commit 4725d6b0dbb6371af4a1b2fbef851dcfe155514a -Merge: 1b2d177 b5d8287 +Merge: 1b2d17748f b5d828789c Author: Keith Packard Date: Wed May 25 09:40:51 2011 -0600 @@ -65244,18 +75269,18 @@ Date: Thu May 19 09:39:52 2011 +0300 Usage example (tested on a dual-seat PC): Section "InputClass" - Identifier "keyboard-all" - MatchIsKeyboard "on" - MatchDevicePath "/dev/input/event*" - MatchLayout "!GeForce|!Matrox" - Driver "evdev" - Option "XkbLayout" "us" - Option "XkbOptions" "terminate:ctrl_alt_bksp" + Identifier "keyboard-all" + MatchIsKeyboard "on" + MatchDevicePath "/dev/input/event*" + MatchLayout "!GeForce|!Matrox" + Driver "evdev" + Option "XkbLayout" "us" + Option "XkbOptions" "terminate:ctrl_alt_bksp" EndSection It disables auto keyboard configuration for layouts "GeForce" and "Matrox". Note that "" in patterns means "no Layout sections found", e.g. - MatchLayout "GeForce|" + MatchLayout "GeForce|" is "in layout GeForce or without explicit layout at all". Signed-off-by: Oleh Nykyforchyn @@ -65626,21 +75651,21 @@ Date: Fri May 6 18:18:15 2011 +0300 Signed-off-by: Keith Packard commit ba5540221f2a46133371b4ff0d527b1a0a1443b1 -Merge: 6347a0b 728d0bf +Merge: 6347a0b802 728d0bf20e Author: Keith Packard Date: Fri May 13 13:59:36 2011 -0700 Merge remote-tracking branch 'whot/for-keith' commit 6347a0b802812bb185ada1bf0951add306935184 -Merge: 4d02c53 f144fb7 +Merge: 4d02c53971 f144fb771f Author: Keith Packard Date: Fri May 13 13:54:29 2011 -0700 Merge remote-tracking branch 'jeremyhu/master' commit 4d02c5397114ac4d15e794908f0708427e258261 -Merge: 043c175 eac37f3 +Merge: 043c175865 eac37f32b8 Author: Keith Packard Date: Fri May 13 13:52:18 2011 -0700 @@ -66342,7 +76367,7 @@ Date: Sat Apr 23 18:09:11 2011 -0700 Signed-off-by: Jeremy Huddleston commit 5cb31cd0cbf83fff5f17a475e7b0e45246b19bf3 -Merge: 0f284f0 4d8735d +Merge: 0f284f0f42 4d8735d388 Author: Keith Packard Date: Fri Apr 29 09:59:49 2011 -0700 @@ -66397,14 +76422,14 @@ Date: Wed Apr 27 22:12:59 2011 -0700 Signed-off-by: Jeremy Huddleston commit f6d4e75ec55ac6812f9dead42ecdffb9614578c7 -Merge: ec9ea40 4318e6a +Merge: ec9ea40178 4318e6a147 Author: Keith Packard Date: Wed Apr 27 12:08:51 2011 -0700 Merge remote-tracking branch 'jturney/master' commit ec9ea4017885cefe5519a4e890b0ff1a5518235a -Merge: c6cb70b 6f29dbf +Merge: c6cb70be1e 6f29dbf5e3 Author: Keith Packard Date: Wed Apr 27 12:01:56 2011 -0700 @@ -67118,7 +77143,7 @@ Date: Mon Mar 28 11:38:11 2011 -0400 Signed-off-by: Søren Sandmann commit 918a9c99cf2ebc73acb34b95f597904b93c690d9 -Merge: 88c4622 5f496bc +Merge: 88c4622b59 5f496bc919 Author: Keith Packard Date: Fri Apr 22 11:20:16 2011 -0700 @@ -67148,7 +77173,7 @@ Date: Mon Apr 18 08:23:48 2011 -0700 Signed-off-by: Keith Packard commit 302bdc3c9678c028bed71dbe9c5ba04997626b6b -Merge: 001b6b8 6f97fe5 +Merge: 001b6b8b70 6f97fe5df1 Author: Keith Packard Date: Fri Apr 22 10:48:37 2011 -0700 @@ -67878,14 +77903,14 @@ Date: Wed Apr 6 14:51:45 2011 -0400 Signed-off-by: Peter Hutterer commit 3085b178626c957854385c7a88a05ec3c7eb74f3 -Merge: c9d89ce 3c45b59 +Merge: c9d89cec14 3c45b59e67 Author: Keith Packard Date: Wed Apr 6 08:34:10 2011 -0700 Merge remote-tracking branch 'jturney/master' commit c9d89cec1407550cb2568f4cef146c93607bbae6 -Merge: a52049d bc61787 +Merge: a52049de2f bc61787a20 Author: Keith Packard Date: Mon Apr 4 11:57:39 2011 -0700 @@ -68132,7 +78157,7 @@ Date: Wed Mar 23 18:06:51 2011 +0200 Reviewed-by: Peter Hutterer commit a52049de2f846fe984d4db5ac8d2c1826c7b2d0b -Merge: d044d36 266ea63 +Merge: d044d36756 266ea63bc3 Author: Peter Hutterer Date: Mon Apr 4 09:58:53 2011 +1000 @@ -68308,7 +78333,7 @@ Date: Tue Mar 29 14:27:41 2011 +1000 Reviewed-by: Keith Packard commit e0a2ad51dfb7373aa602335490d9666d6101b5ea -Merge: 327e1d8 3d68831 +Merge: 327e1d8801 3d688316af Author: Keith Packard Date: Wed Mar 30 10:51:27 2011 -0700 @@ -68537,14 +78562,14 @@ Date: Mon Mar 28 17:18:39 2011 +0200 Signed-off-by: Keith Packard commit a095a6d4e8f5090907e8d3d66018636216300846 -Merge: a22486f ef9d04f +Merge: a22486f848 ef9d04f8ad Author: Keith Packard Date: Sun Mar 27 20:06:29 2011 -0700 Merge remote-tracking branch 'airlied/pwin-cleanup' commit a22486f848014000dc13dda470f77d4d8ea9e9f6 -Merge: 2ef4ff4 633b81e +Merge: 2ef4ff45ef 633b81e8ba Author: Keith Packard Date: Sun Mar 27 18:27:10 2011 -0700 @@ -68752,7 +78777,7 @@ Date: Tue Mar 22 19:01:48 2011 -0700 Reviewed-by: Dan Nicholson commit 03f45df93469f6aef391e97007b9614e0770cc4c -Merge: efcb727 5fb329a +Merge: efcb7275ce 5fb329a04a Author: Keith Packard Date: Wed Mar 23 13:38:37 2011 +0900 @@ -68941,7 +78966,7 @@ Date: Sun Mar 13 20:01:30 2011 +0000 Signed-off-by: Keith Packard commit 0ac4931753a5d5925fc844c8cbec08585aea57a7 -Merge: a8146f6 d7f8011 +Merge: a8146f6bec d7f8011418 Author: Keith Packard Date: Mon Mar 14 13:06:41 2011 -0700 @@ -69261,7 +79286,7 @@ Date: Wed Mar 9 15:11:42 2011 +1000 Reviewed-by: Peter Hutterer commit c3c0e2fdd326214e271ce144e8fc2725cbd738ef -Merge: a19771e 7355555 +Merge: a19771e433 73555555a4 Author: Keith Packard Date: Wed Mar 9 14:25:54 2011 -0800 @@ -69630,28 +79655,28 @@ Date: Fri Mar 4 01:12:01 2011 +0100 Signed-off-by: Keith Packard commit 6c90e839d9872a37d371578c9c423e8213922044 -Merge: 0bc95d5 edcceed +Merge: 0bc95d5b06 edcceedbd3 Author: Keith Packard Date: Thu Mar 3 14:41:44 2011 -0800 Merge remote branch 'whot/for-keith' commit 0bc95d5b06dcea65a1aa193ea907b50f7dd168b5 -Merge: 3f41f4a 69a9171 +Merge: 3f41f4adea 69a9171dbb Author: Keith Packard Date: Thu Mar 3 14:33:08 2011 -0800 Merge remote branch 'jeremyhu/master' commit 3f41f4adea4bbb90d4bda4dab600595b655e3ed8 -Merge: 8e4c3ce dae24ab +Merge: 8e4c3ce55b dae24abcd4 Author: Keith Packard Date: Thu Mar 3 14:12:36 2011 -0800 Merge remote branch 'sandmann/for-keithp' commit 8e4c3ce55b0f186bc6ba4039e30629669b6087b7 -Merge: f3d19c0 2965615 +Merge: f3d19c0cf3 296561506a Author: Keith Packard Date: Thu Mar 3 13:42:07 2011 -0800 @@ -69725,14 +79750,14 @@ Date: Mon Feb 28 12:32:53 2011 -0500 Signed-off-by: Peter Hutterer commit c2207d11f243900bc2f641e08d80da63d84e97a8 -Merge: 0077993 579ee8f +Merge: 00779932de 579ee8f5d8 Author: Peter Hutterer Date: Mon Feb 28 11:26:09 2011 +1000 Merge branch 'next' into for-keith Conflicts: - dix/devices.c + dix/devices.c Signed-off-by: Peter Hutterer @@ -69980,7 +80005,7 @@ Date: Fri Feb 25 11:08:19 2011 +1000 Reviewed-by: Fernando Carrijo commit 229b055bdbc53370944401649234e8a38183f4fb -Merge: 6178959 b17fc99 +Merge: 6178959e3d b17fc99cb9 Author: Keith Packard Date: Thu Feb 24 19:44:35 2011 -0800 @@ -70034,7 +80059,7 @@ Date: Thu Feb 24 19:18:35 2011 -0800 Signed-off-by: Jeremy Huddleston commit 83861595782aaa05907f9cf7b236d50261d404d9 -Merge: a1cc0e5 4102a00 +Merge: a1cc0e52b0 4102a00962 Author: Keith Packard Date: Thu Feb 24 18:59:07 2011 -0800 @@ -70054,7 +80079,7 @@ Date: Tue Nov 30 21:17:19 2010 +0500 Signed-off-by: Keith Packard commit 365ad68fb9f7029550505b7c276a808050cada9c -Merge: 0801afb 720c895 +Merge: 0801afbd7c 720c895db9 Author: Keith Packard Date: Thu Feb 24 18:49:40 2011 -0800 @@ -70388,7 +80413,7 @@ Date: Wed Feb 23 14:44:23 2011 +0100 Signed-off-by: Cyril Brulebois commit 579ee8f5d84c3a523b7b3e3941eabb226d1d19e2 -Merge: b636893 17265cc +Merge: b636893137 17265ccb02 Author: Peter Hutterer Date: Wed Feb 23 08:44:42 2011 +1000 @@ -70694,14 +80719,14 @@ Date: Fri Feb 18 14:46:33 2011 -0800 Signed-off-by: Keith Packard commit 2c77aeb39f59f1a94cc603a2e6256a62ce785c36 -Merge: 816d67d 402b329 +Merge: 816d67de2b 402b329c3a Author: Keith Packard Date: Fri Feb 18 14:29:32 2011 -0800 Merge remote branch 'jcristau/for-keith' commit 816d67de2ba9bdfe652da32cb6447a3056342b98 -Merge: a73c28f 3bbb70a +Merge: a73c28f0bd 3bbb70a1a7 Author: Keith Packard Date: Fri Feb 18 12:20:26 2011 -0800 @@ -70721,14 +80746,14 @@ Date: Thu Feb 10 16:27:29 2011 -0500 Signed-off-by: Keith Packard commit 0bc9b15a622377c57e617411ccd26c4b5bf8cba4 -Merge: d1123b6 93cd4b1 +Merge: d1123b66eb 93cd4b1034 Author: Keith Packard Date: Fri Feb 18 12:04:41 2011 -0800 Merge remote branch 'ajax/for-keithp' commit d1123b66ebbcf96dd816236f54befc568a5f7c68 -Merge: 5d020c3 f6e4ace +Merge: 5d020c3135 f6e4ace9ea Author: Keith Packard Date: Fri Feb 18 11:59:25 2011 -0800 @@ -71443,7 +81468,7 @@ Date: Thu Jan 13 20:19:18 2011 +0200 Reviewed-by: Ville Syrjälä commit ea1ffd3e60bdcedbec5a6f28929f8677bf45d450 -Merge: 12b0f7d 53602c3 +Merge: 12b0f7df2c 53602c3621 Author: Keith Packard Date: Wed Feb 2 15:19:55 2011 -0800 @@ -71534,21 +81559,21 @@ Date: Sun Jan 30 14:06:14 2011 +0100 Signed-off-by: Keith Packard commit 246d40b685292fa6393ba22127152137494af2af -Merge: 70f2d39 8c1f75a +Merge: 70f2d39fbd 8c1f75a1d4 Author: Keith Packard Date: Wed Feb 2 14:51:33 2011 -0800 Merge remote branch 'jeremyhu/master' commit 70f2d39fbde38d0baa687f1755b6c4c686f23052 -Merge: 3a91c2d a9d3c43 +Merge: 3a91c2d21c a9d3c43a57 Author: Keith Packard Date: Wed Feb 2 14:43:19 2011 -0800 Merge remote branch 'jturney/master' commit 3a91c2d21c3231e2a011d95c3cfc01785430c1cf -Merge: ac0a00a 82b1eaa +Merge: ac0a00a840 82b1eaa6ca Author: Keith Packard Date: Wed Feb 2 14:37:00 2011 -0800 @@ -71801,21 +81826,21 @@ Date: Thu Jan 13 16:08:29 2011 -0800 Signed-off-by: Jeremy Huddleston commit be3be7580b6f6fd2f7fa4d4abfe5e1ab19470223 -Merge: 57a1d9b a1d885f +Merge: 57a1d9b853 a1d885fdd6 Author: Keith Packard Date: Thu Jan 20 21:21:21 2011 -0800 Merge remote branch 'ajax/for-keithp' commit 57a1d9b85331f6fe19d5111f5163139572ffbf02 -Merge: 24ce650 6423769 +Merge: 24ce650cf4 6423769799 Author: Keith Packard Date: Thu Jan 20 21:16:24 2011 -0800 Merge remote branch 'whot/for-keith' commit 24ce650cf4f0c6fa72faecd38c53d40703e6c959 -Merge: bbdf81a 09fd010 +Merge: bbdf81a056 09fd010902 Author: Keith Packard Date: Thu Jan 20 21:11:53 2011 -0800 @@ -72323,14 +82348,14 @@ Date: Sat Jan 15 12:13:39 2011 -0800 Signed-off-by: Keith Packard commit abfea17342da774aa4e3a351a73c8f2af6e6fd28 -Merge: 3611283 e65c3f8 +Merge: 361128389e e65c3f8bcc Author: Keith Packard Date: Tue Jan 18 15:19:34 2011 -0800 Merge remote branch 'ajax/for-keithp' commit 361128389e5cb0101cbd091ff8de77cf34608f6c -Merge: 65ceaad d9225b9 +Merge: 65ceaadbf0 d9225b9602 Author: Keith Packard Date: Tue Jan 18 15:18:08 2011 -0800 @@ -72668,7 +82693,7 @@ Date: Tue Nov 23 11:38:50 2010 -0800 Acked-by: Gaetan Nadon commit 8456625d64bb0013a496f3b56ea3aa20cf7a6142 -Merge: aa30a86 ce74e75 +Merge: aa30a86583 ce74e7562d Author: Peter Hutterer Date: Fri Jan 7 09:35:07 2011 +1000 @@ -73013,14 +83038,14 @@ Date: Wed Jan 5 20:41:04 2011 +0200 Signed-off-by: Keith Packard commit 0dede200c9ac7adbe8b8c16efacc3edc1f183cd9 -Merge: 7714357 2e78145 +Merge: 7714357f50 2e781457d4 Author: Keith Packard Date: Wed Jan 5 08:51:46 2011 -0800 Merge remote branch 'vsyrjala/misc_fixes' commit 7714357f506782973d25e270f85140b42507ed35 -Merge: 02e18c9 b01dd9d +Merge: 02e18c9fb5 b01dd9d336 Author: Keith Packard Date: Wed Jan 5 08:43:18 2011 -0800 @@ -73713,7 +83738,7 @@ Date: Wed Dec 15 14:59:13 2010 -0500 Signed-off-by: Adam Jackson commit e7dc253452a1ba64718a08fdc070405b494f53cd -Merge: d110791 d5b0d58 +Merge: d1107918d4 d5b0d58573 Author: Keith Packard Date: Mon Dec 20 00:48:45 2010 -0800 @@ -73815,14 +83840,14 @@ Date: Fri Dec 10 00:08:24 2010 +0000 Reviewed-by: Alan Coopersmith commit f1542f1d716723cba7c323849086585635121893 -Merge: 9716d31 8a8fdd7 +Merge: 9716d31247 8a8fdd762a Author: Keith Packard Date: Tue Dec 14 15:04:12 2010 -0800 Merge remote branch 'whot/for-keith' commit 9716d3124799c6db0d1c782aa72c72f972d5a158 -Merge: 03ea0b7 f641e4b +Merge: 03ea0b7726 f641e4b34a Author: Keith Packard Date: Tue Dec 14 15:01:36 2010 -0800 @@ -73841,7 +83866,7 @@ Date: Tue Dec 7 16:31:55 2010 -0500 Remove --enable-builddocs as this was last use for BUILDDOCS - *** From the RELEASE NOTES *** + *** From the RELEASE NOTES *** New configure options for documentation in modules -------------------------------------------------- @@ -73999,7 +84024,7 @@ Date: Wed Dec 8 18:54:30 2010 +0000 Signed-off-by: Keith Packard commit 519d243f0c8e3c80226701f71d2cfa62e42dbff7 -Merge: 9f9c732 446482e +Merge: 9f9c732311 446482efaa Author: Keith Packard Date: Tue Dec 7 13:39:58 2010 -0800 @@ -74457,14 +84482,14 @@ Date: Sun Jun 6 15:23:37 2010 -0700 Reviewed-by: Aaron Plattner commit f5b8bd620f91214c0b87e9b04d57015655792352 -Merge: 01e9fa7 8127c83 +Merge: 01e9fa7da3 8127c83c81 Author: Keith Packard Date: Mon Dec 6 19:51:06 2010 -0800 Merge remote branch 'jajones/for-keith' commit 01e9fa7da389fc7ab834b4234b8484514144b7f4 -Merge: 79870db 68a1b0d +Merge: 79870dbf72 68a1b0de95 Author: Keith Packard Date: Mon Dec 6 19:45:11 2010 -0800 @@ -74487,14 +84512,14 @@ Date: Sat Dec 4 16:13:29 2010 -0500 Signed-off-by: Keith Packard commit c4a7a5917ab828d4a0bd825a98e4d641bcb378f1 -Merge: 5de312a 714b68d +Merge: 5de312a60d 714b68d9e5 Author: Keith Packard Date: Mon Dec 6 19:28:07 2010 -0800 Merge remote branch 'jeremyhu/master' commit 5de312a60d8227ed670849ecf888ea878aa81430 -Merge: 311cad3 8f42b2b +Merge: 311cad3315 8f42b2b693 Author: Keith Packard Date: Mon Dec 6 19:22:52 2010 -0800 @@ -74845,7 +84870,7 @@ Date: Wed Nov 24 00:11:11 2010 +0100 Signed-off-by: Keith Packard commit 3824417335ec00a87b51f8d05e592099b8507680 -Merge: dab064f f4f41c8 +Merge: dab064fa5e f4f41c812d Author: Keith Packard Date: Thu Dec 2 08:39:33 2010 -0800 @@ -75095,14 +85120,14 @@ Date: Sat Nov 27 00:14:51 2010 -0800 Reviewed-by: Jeremy Huddleston commit 02449ee24b484c9fea501df5274d95a9f87cab23 -Merge: afd6eb6 b85f906 +Merge: afd6eb66d5 b85f9063c2 Author: Keith Packard Date: Tue Nov 30 13:30:59 2010 -0800 Merge remote branch 'ajax/for-keithp' commit afd6eb66d5ef6a59be4c03da4588aaa2ee47b9ad -Merge: b169649 ffcbfa0 +Merge: b16964910d ffcbfa0063 Author: Keith Packard Date: Tue Nov 30 13:28:13 2010 -0800 @@ -75620,14 +85645,14 @@ Date: Wed Nov 24 14:20:30 2010 +1000 Reviewed-by: Keith Packard commit 4e0f8f666e61390206c42ad2087477a912525bc7 -Merge: 400ddf2 639600f +Merge: 400ddf2f58 639600fa7e Author: Keith Packard Date: Wed Nov 24 11:47:33 2010 -0800 Merge remote branch 'whot/for-keith' commit 400ddf2f58ce673c74d4e8ee829729cd3c75f8c9 -Merge: 7250f07 e074f74 +Merge: 7250f078c1 e074f745a8 Author: Keith Packard Date: Wed Nov 24 11:46:18 2010 -0800 @@ -75681,7 +85706,7 @@ Date: Sun Nov 21 14:27:55 2010 -0500 This will allow a dependency to be specified as done in libX11: %.html: %.xml $(dist_spec_DATA) - $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $< + $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $< Reviewed-by: Alan Coopersmith Signed-off-by: Gaetan Nadon @@ -75977,21 +86002,21 @@ Date: Tue Jun 22 19:45:26 2010 +0200 Signed-off-by: Peter Hutterer commit 38c46ccf796462d068d95acb9022de2acfc3a1f7 -Merge: 3051dd5 c8998af +Merge: 3051dd5135 c8998af3eb Author: Keith Packard Date: Mon Nov 15 09:06:33 2010 +0800 Merge remote branch 'whot/for-keith' commit 3051dd5135962283fc6c7de377a7c819d8a04e7f -Merge: ed547a9 c597572 +Merge: ed547a9fc8 c5975722a9 Author: Keith Packard Date: Mon Nov 15 08:58:02 2010 +0800 Merge remote branch 'jeremyhu/master' commit ed547a9fc8a4f5cd95ef882b656a376c163eda6d -Merge: 78f94f1 84e8de1 +Merge: 78f94f19aa 84e8de1271 Author: Keith Packard Date: Mon Nov 15 08:51:27 2010 +0800 @@ -76262,20 +86287,20 @@ Date: Wed Nov 10 21:35:58 2010 -0800 Reviewed-by: Adam Jackson commit 88cb61e1e55c54982b90e2a77465faaac6a0ba89 -Merge: 19f4383 4ed4915 +Merge: 19f43836d1 4ed4915bc0 Author: Peter Hutterer Date: Thu Nov 11 12:54:46 2010 +1000 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-api Conflicts: - dix/getevents.c - hw/xfree86/common/xf86Xinput.h + dix/getevents.c + hw/xfree86/common/xf86Xinput.h Signed-off-by: Peter Hutterer commit 4ed4915bc0fbe9b4419ca4a0d4e43c2fee032ae9 -Merge: 291c39d ec1bfbc +Merge: 291c39dfef ec1bfbc669 Author: Keith Packard Date: Wed Nov 10 16:58:21 2010 -0800 @@ -76335,14 +86360,14 @@ Date: Sat Sep 11 17:55:57 2010 -0400 Signed-off-by: Keith Packard commit c9c0f93f8ed42413a05193ee71c69fa6b41f6a03 -Merge: 73f6de1 4132b1c +Merge: 73f6de1ad8 4132b1c591 Author: Keith Packard Date: Wed Nov 10 16:11:29 2010 -0800 Merge remote branch 'whot/for-keith' commit 73f6de1ad8b5e1641102b54ff48a36ebb99ccacb -Merge: 333b6ed 3dc3aef +Merge: 333b6ed26e 3dc3aefb88 Author: Keith Packard Date: Wed Nov 10 16:02:22 2010 -0800 @@ -76503,7 +86528,7 @@ Date: Mon May 17 19:39:54 2010 +0200 Signed-off-by: Peter Hutterer commit acba00c0c1129fe4ef7655f018cd21dbb1ee9a1f -Merge: 383dfe2 44e8165 +Merge: 383dfe23f1 44e8165414 Author: Keith Packard Date: Wed Nov 10 14:41:08 2010 -0800 @@ -76697,7 +86722,7 @@ Date: Thu Nov 4 12:53:18 2010 +1000 Reviewed-by: Julien Cristau commit a52efb096e166e325deb3d6b502671f339a4fa15 -Merge: fe8d122 f72aadd +Merge: fe8d122b13 f72aadd38b Author: Keith Packard Date: Wed Nov 3 06:50:45 2010 -0700 @@ -77099,7 +87124,7 @@ Date: Sun Oct 17 09:58:50 2010 -0700 Signed-off-by: Keith Packard commit d738175eaf1098e29b8afb6de8e99b5098e366a7 -Merge: 8806a04 9872e0f +Merge: 8806a04f7f 9872e0f011 Author: Keith Packard Date: Tue Oct 19 22:50:15 2010 -0700 @@ -77515,7 +87540,7 @@ Date: Tue Mar 23 16:34:26 2010 +0000 Reviewed-by: Colin Harrison commit 5aff712a8d2eb9f965ecbb93216cc0bcdc327ae6 -Merge: 5b98c62 e354cca +Merge: 5b98c6267f e354ccac36 Author: Keith Packard Date: Mon Oct 18 17:16:23 2010 -0700 @@ -77726,18 +87751,18 @@ Date: Mon Sep 27 13:58:40 2010 -0400 Signed-off-by: Adam Jackson commit eaf0b6a4d83d49930d21d5191f335fcac962632e -Merge: 693e92d 23229c7 +Merge: 693e92d404 23229c7ce5 Author: Peter Hutterer Date: Fri Oct 15 13:46:59 2010 +1000 Merge branch 'master' into input-api Conflicts: - config/udev.c - hw/xfree86/common/xf86Helper.c - hw/xfree86/common/xf86Module.h - hw/xfree86/common/xf86Xinput.h - hw/xfree86/os-support/linux/lnx_init.c + config/udev.c + hw/xfree86/common/xf86Helper.c + hw/xfree86/common/xf86Module.h + hw/xfree86/common/xf86Xinput.h + hw/xfree86/os-support/linux/lnx_init.c Signed-off-by: Peter Hutterer @@ -78133,7 +88158,7 @@ Date: Sat Sep 25 10:05:10 2010 -0400 Signed-off-by: Keith Packard commit 5532687a929426c4b1c4667f4591ed362f097c9b -Merge: 9df4fb0 682a3ee +Merge: 9df4fb0adf 682a3ee608 Author: Keith Packard Date: Tue Sep 28 08:15:07 2010 -0700 @@ -78309,7 +88334,7 @@ Date: Tue Sep 21 15:13:30 2010 +0800 Signed-off-by: Keith Packard commit 98197d931b266674557b52b4a7099c6470114e55 -Merge: 01ad372 402942c +Merge: 01ad3725a8 402942cdbc Author: Keith Packard Date: Thu Sep 23 15:30:37 2010 -0700 @@ -78561,7 +88586,7 @@ Date: Sun May 30 19:12:31 2010 +0300 Reviewed-by: Mikhail Gusarov commit c768cdda92696b636c10bb2df64167d5274b4b99 -Merge: 5a72538 2079853 +Merge: 5a725385fb 2079853632 Author: Keith Packard Date: Mon Sep 13 16:48:33 2010 -0700 @@ -78951,7 +88976,7 @@ Date: Wed Sep 8 16:08:24 2010 -0400 Signed-off-by: Keith Packard commit bbffb85461eb63bfb1e01e2cb9674607b9221604 -Merge: 9a1a4cc 71972c2 +Merge: 9a1a4ccbe0 71972c2534 Author: Keith Packard Date: Fri Sep 10 11:55:34 2010 -0700 @@ -78990,7 +89015,7 @@ Date: Mon Aug 30 21:24:30 2010 +0300 Signed-off-by: Keith Packard commit ca0d578d29f37b61e62556fff59732741885625b -Merge: cf88363 08adf41 +Merge: cf88363db0 08adf41f63 Author: Keith Packard Date: Fri Sep 10 11:50:27 2010 -0700 @@ -79020,7 +89045,7 @@ Date: Fri Aug 27 10:20:29 2010 -0700 Signed-off-by: Keith Packard commit fa22f97af65efc2a147e9be0b7f288848965ff60 -Merge: 6edbdb7 6546665 +Merge: 6edbdb7f9e 6546665293 Author: Keith Packard Date: Fri Sep 10 11:47:41 2010 -0700 @@ -80645,7 +90670,7 @@ Date: Sat Jun 19 23:40:37 2010 -0700 Reviewed-by: Patrick E. Kane commit 9fbbff3c0456f1969d45cc957d3260723caf62d7 -Merge: 95756f4 9ac8e20 +Merge: 95756f410c 9ac8e206ff Author: Keith Packard Date: Wed Jul 21 11:56:39 2010 -0700 @@ -80730,7 +90755,7 @@ Date: Wed Jul 14 12:57:29 2010 -0700 Signed-off-by: Keith Packard commit 0fc02c0bf92f694889589e3648acc08d4684de37 -Merge: 0540c46 9d8ec71 +Merge: 0540c46066 9d8ec712a6 Author: Keith Packard Date: Tue Jul 13 15:05:36 2010 -0700 @@ -80827,7 +90852,7 @@ Date: Fri Jul 9 10:36:12 2010 -0700 Signed-off-by: Keith Packard commit 2307ab5bc9365ebbe04568edb7c7620a23689b70 -Merge: c65280c fd4f505 +Merge: c65280ce8d fd4f5059f0 Author: Keith Packard Date: Tue Jul 6 23:54:54 2010 -0400 @@ -80990,7 +91015,7 @@ Date: Thu Jun 3 19:00:53 2010 -0700 Signed-off-by: Peter Hutterer commit 69b2b5c85ec079ef49f84722daa5f148cedc2e1b -Merge: b90faa7 1432785 +Merge: b90faa7156 1432785839 Author: Keith Packard Date: Thu Jul 1 23:46:53 2010 -0400 @@ -81341,7 +91366,7 @@ Date: Fri Jun 25 09:48:10 2010 +1000 Conflicts: - dix/events.c + dix/events.c Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard @@ -81382,7 +91407,7 @@ Date: Thu Jun 24 12:52:53 2010 +1000 Conflicts: - dix/events.c + dix/events.c Signed-off-by: Peter Hutterer Acked-by: Daniel Stone @@ -81807,7 +91832,7 @@ Date: Thu Jun 10 19:21:18 2010 -0700 Signed-off-by: Keith Packard commit a41d6e9bffbe56cfa1c3b84388a3d9f5a982f1a9 -Merge: 7e8f100 f4190fe +Merge: 7e8f100121 f4190feb25 Author: Keith Packard Date: Fri Jun 11 10:08:13 2010 -0700 @@ -81960,7 +91985,7 @@ Date: Fri Jun 4 16:58:58 2010 +0700 Reviewed-by: Alan Coopersmith commit 620ca54aaa0b363fcf68cec1bd6c37e68c988352 -Merge: fd69234 8ff9b50 +Merge: fd69234db0 8ff9b502cf Author: Keith Packard Date: Thu Jun 10 19:18:53 2010 -0700 @@ -82032,7 +92057,7 @@ Date: Thu Jun 3 19:17:14 2010 -0700 Reviewed-by: Eamon Walsh commit 07a093add0b7e40c4d9b9b59273e3ff9e14a88a7 -Merge: 84190d2 dc61448 +Merge: 84190d2095 dc614484f9 Author: Keith Packard Date: Thu Jun 10 18:39:10 2010 -0700 @@ -82094,8 +92119,8 @@ Date: Mon Jun 7 20:39:58 2010 -0700 don't care how the driver was selected for that device. The MatchDriver entry can be used to match the current driver string: - MatchDriver "evdev|mouse" - Option "Emulate3Buttons" "yes" + MatchDriver "evdev|mouse" + Option "Emulate3Buttons" "yes" The driver string is a case sensitive match. @@ -82115,8 +92140,8 @@ Date: Mon Jun 7 20:39:57 2010 -0700 For instance, an InputClass with - MatchProduct "foo" - MatchProduct "bar" + MatchProduct "foo" + MatchProduct "bar" will require that the device's product name contain both foo and bar. This provides a complement to the || style matching when an entry is @@ -82153,7 +92178,7 @@ Date: Thu Jun 10 06:15:41 2010 -0700 has been added that supports shell pattern matching when fnmatch(3) is available. For example: - MatchUSBID "046d:*" + MatchUSBID "046d:*" The IDs are stored in lowercase hex separated by a ':' like "lsusb" or "lspci -n". @@ -82173,7 +92198,7 @@ Date: Thu Jun 10 06:11:10 2010 -0700 test against the PnP ID of the device. The entry supports a shell pattern match on platforms that support fnmatch(3). For example: - MatchPnPID "WACf*" + MatchPnPID "WACf*" A match type for non-path pattern matching, match_pattern, has been added. The difference between this and match_path_pattern is the FNM_PATHNAME @@ -82184,7 +92209,7 @@ Date: Thu Jun 10 06:11:10 2010 -0700 Signed-off-by: Peter Hutterer commit 84190d20954ef7888e4d96832c2a4b3225b4dfa2 -Merge: 4172aa1 5e1ef1f +Merge: 4172aa137c 5e1ef1f4dd Author: Keith Packard Date: Thu Jun 10 13:36:35 2010 -0700 @@ -82512,7 +92537,7 @@ Date: Fri Jun 4 14:22:06 2010 +0700 Reviewed-by: Daniel Stone commit 5d4e2c594059ffb536c8e506c2623320d3c6a787 -Merge: eacc421 793dd39 +Merge: eacc42132e 793dd39946 Author: Keith Packard Date: Sat Jun 5 22:20:28 2010 -0700 @@ -82696,8 +92721,8 @@ Date: Fri Apr 30 22:05:27 2010 -0700 This also renames the device private index and macros to better reflect their usage: - miDCSpriteKey -> miDCDeviceKey - MIDCBUFFER -> miGetDCDevice + miDCSpriteKey -> miDCDeviceKey + MIDCBUFFER -> miGetDCDevice Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp @@ -82917,7 +92942,7 @@ Date: Fri Jun 4 11:09:46 2010 +1000 Signed-off-by: Keith Packard commit 0f12e86e600522768f5f64eafc1230526e700ab7 -Merge: aa7c09f f114f54 +Merge: aa7c09f7d0 f114f54986 Author: Keith Packard Date: Thu Jun 3 15:09:32 2010 -0700 @@ -83099,7 +93124,7 @@ Date: Wed Jun 2 14:31:56 2010 -0700 Signed-off-by: Keith Packard commit b13d7a8e09c8e3eb5003420c3c0484431e5a052b -Merge: f0ab726 dcceb90 +Merge: f0ab726d89 dcceb90b1d Author: Keith Packard Date: Thu Jun 3 07:01:26 2010 -0700 @@ -83564,7 +93589,7 @@ Date: Mon May 24 09:14:27 2010 -0700 Reviewed-by: Dan Nicholson commit b11465a6ecdc2b8373e6fc8af427edc4602bcaa1 -Merge: 7c085ae 0abf065 +Merge: 7c085aebfe 0abf065e38 Author: Keith Packard Date: Mon May 24 22:18:31 2010 -0700 @@ -83703,7 +93728,7 @@ Date: Tue May 18 19:35:10 2010 +0300 Reviewed-by: Alex Deucher commit 2ffffb4daf6161e6a22d81442ecf6209acc9e975 -Merge: b5e0f6d d530608 +Merge: b5e0f6d8f4 d5306084b5 Author: Keith Packard Date: Sun May 23 23:22:08 2010 -0700 @@ -84078,14 +94103,14 @@ Date: Fri May 14 19:31:56 2010 +0300 Signed-off-by: Keith Packard commit 103507af0c0ce7d7482a67163249864af36a2374 -Merge: 8bd8d81 99fcf65 +Merge: 8bd8d81dc4 99fcf655bd Author: Keith Packard Date: Wed May 19 22:27:53 2010 -0700 Merge remote branch 'vignatti/bus-cleanup' commit 8bd8d81dc473bf72ea108b1896a55e32defa02e2 -Merge: c620a1c 66d5ecc +Merge: c620a1c0a4 66d5ecc5fd Author: Keith Packard Date: Wed May 19 22:27:20 2010 -0700 @@ -84105,7 +94130,7 @@ Date: Thu May 20 10:26:56 2010 +1000 Signed-off-by: Keith Packard commit 8b6c1809c09f832051327d86e1a25dc0ec5cc878 -Merge: d88ba77 c38552d +Merge: d88ba7721d c38552d115 Author: Keith Packard Date: Wed May 19 12:58:02 2010 -0700 @@ -84581,7 +94606,7 @@ Date: Fri May 14 16:25:43 2010 +0300 Signed-off-by: Keith Packard commit f87002cb7d8729b1da4cbefe7653f4cfd3a2d956 -Merge: a4fbc0f 890f536 +Merge: a4fbc0feda 890f536f8d Author: Keith Packard Date: Fri May 14 11:46:29 2010 -0700 @@ -84619,7 +94644,7 @@ Date: Thu May 13 07:12:43 2010 +0300 Reviewed-by: Keith Packard commit 795432d4a92ed5b9fa4d9163e73c8e4fe4c74534 -Merge: f2a0c32 92ed75a +Merge: f2a0c324e3 92ed75ac59 Author: Keith Packard Date: Thu May 13 18:22:49 2010 -0700 @@ -84901,7 +94926,7 @@ Date: Sat May 8 15:19:03 2010 -0700 Reviewed-by: Eamon Walsh commit 59857ee5da5f1f3f4900292581b9586477513211 -Merge: 21ceae9 432cbbe +Merge: 21ceae9002 432cbbec19 Author: Keith Packard Date: Wed May 12 16:48:08 2010 -0700 @@ -85122,7 +95147,7 @@ Date: Tue May 11 09:08:40 2010 -0700 Reviewed-by: Adam Jackson commit 3df22b293c1f1d27e7ce16662744c578d35b5aba -Merge: fa6c701 9de0e31 +Merge: fa6c701257 9de0e31746 Author: Keith Packard Date: Tue May 11 08:38:44 2010 -0700 @@ -85252,7 +95277,7 @@ Date: Mon May 10 14:00:49 2010 -0700 Signed-off-by: Keith Packard commit 95074538cce93abc1739a4d9dd78b0500fb8fec9 -Merge: c079977 2160ff5 +Merge: c0799779df 2160ff5240 Author: Keith Packard Date: Mon May 10 13:49:33 2010 -0700 @@ -85329,9 +95354,9 @@ Date: Thu May 6 17:58:29 2010 -0400 But no one cares, and it's a modest size win: - text data bss dec hex filename - 1773824 69552 59288 1902664 1d0848 hw/vfb/Xvfb.before - 1773112 69552 58648 1901312 1d0300 hw/vfb/Xvfb + text data bss dec hex filename + 1773824 69552 59288 1902664 1d0848 hw/vfb/Xvfb.before + 1773112 69552 58648 1901312 1d0300 hw/vfb/Xvfb Signed-off-by: Adam Jackson Reviewed-by: Keith Packard @@ -85480,7 +95505,7 @@ Date: Fri Apr 30 12:18:09 2010 -0700 Signed-off-by: Keith Packard commit a80b1f888f2f7674a715d512ab950eeadee20448 -Merge: 4971099 0efd7b8 +Merge: 4971099860 0efd7b8d82 Author: Keith Packard Date: Sun May 2 16:35:17 2010 -0700 @@ -85589,31 +95614,31 @@ Date: Wed Apr 28 12:37:08 2010 -0700 Signed-off-by: Keith Packard commit 986d46144b183a36b4e98aed95eca0c55a8b4251 -Merge: a974c8e b5b8f91 +Merge: a974c8e7cb b5b8f91b82 Author: Keith Packard Date: Fri Apr 30 12:40:53 2010 -0700 Merge remote branch 'jamey/for-keith' Conflicts: - hw/xfree86/common/xf86xv.c + hw/xfree86/common/xf86xv.c commit a974c8e7cba40c8d7d1b91e07de8c414627b71a2 -Merge: 6581bc4 02e8622 +Merge: 6581bc4591 02e86221b8 Author: Keith Packard Date: Fri Apr 30 12:33:00 2010 -0700 Merge remote branch 'whot/for-keith' commit 6581bc4591746c906d97f8b868f946c47bc6d756 -Merge: 0e91e19 d073e51 +Merge: 0e91e19f78 d073e51bee Author: Keith Packard Date: Fri Apr 30 12:29:52 2010 -0700 Merge remote branch 'yselkowitz/master' commit 0e91e19f783d21198fc2e210203e0f10040a9cd0 -Merge: 81a081c edbc56c +Merge: 81a081c1f0 edbc56c088 Author: Keith Packard Date: Fri Apr 30 12:27:51 2010 -0700 @@ -85807,7 +95832,7 @@ Date: Sat Apr 17 21:36:23 2010 +0200 Signed-off-by: Peter Hutterer commit 3f63db89191701139d45332ca80b9d6eb327c773 -Merge: 41bdb6c 54e51de +Merge: 41bdb6c003 54e51de8cd Author: Keith Packard Date: Mon Apr 26 20:18:13 2010 -0700 @@ -85964,7 +95989,7 @@ Date: Thu Apr 8 21:55:45 2010 -0500 Conflicts: - configure.ac + configure.ac Signed-off-by: Yaakov Selkowitz Reviewed-by: Peter Hutterer @@ -86204,14 +96229,14 @@ Date: Wed Apr 21 18:28:13 2010 +0300 Signed-off-by: Keith Packard commit 7ac6a6b7d0dfc5e021270b2898accd3425aa008a -Merge: 0782894 f7ef6fd +Merge: 0782894b57 f7ef6fd9a1 Author: Keith Packard Date: Wed Apr 21 16:07:38 2010 -0700 Merge remote branch 'vignatti/for-keith' Conflicts: - exa/exa.c + exa/exa.c Signed-off-by: Keith Packard @@ -86462,7 +96487,7 @@ Date: Mon Apr 19 09:26:10 2010 -0700 Signed-off-by: Keith Packard commit b3ab978df861c08298f57529e3db980489055c35 -Merge: a92b2c2 0ad022a +Merge: a92b2c2c8d 0ad022a729 Author: Keith Packard Date: Sun Apr 18 22:01:40 2010 -0700 @@ -86624,7 +96649,7 @@ Date: Wed Apr 14 17:27:51 2010 +0200 Signed-off-by: Peter Hutterer commit e424d5812300e82de375d83dc0b490a76d865016 -Merge: 5b0faf3 0e7703f +Merge: 5b0faf3554 0e7703f9b1 Author: Keith Packard Date: Thu Apr 15 15:01:34 2010 -0700 @@ -86810,7 +96835,7 @@ Date: Fri Apr 9 10:58:48 2010 -0400 Signed-off-by: Keith Packard commit ab60975fe28cb135b4183c57b7f50d3615921c1f -Merge: adbbc66 59edde7 +Merge: adbbc66108 59edde7c28 Author: Keith Packard Date: Mon Apr 12 21:40:41 2010 -0700 @@ -86870,7 +96895,7 @@ Date: Tue Feb 16 08:11:41 2010 -0800 Reviewed-by: Keith Packard commit d7c98c1c81ae272f66edb05fde20f4c616604add -Merge: 82cf3a4 03ccbd2 +Merge: 82cf3a4ae0 03ccbd2579 Author: Keith Packard Date: Wed Apr 7 22:25:51 2010 -0700 @@ -86909,15 +96934,15 @@ Date: Sat Apr 3 10:08:25 2010 -0700 for local administration, we also reserve a system directory for vendor and package usage. The simple search path is: - /usr/share/X11/xorg.conf.d - $datadir/X11/xorg.conf.d + /usr/share/X11/xorg.conf.d + $datadir/X11/xorg.conf.d Files from these directories will have the lowest config priority. The directory $datadir/X11/xorg.conf.d is exported from xorg-server.pc in the variable "sysconfigdir". Packages should install their .conf files to the directory specified by: - `pkg-config --variable=sysconfigdir xorg-server` + `pkg-config --variable=sysconfigdir xorg-server` Signed-off-by: Dan Nicholson Signed-off-by: Peter Hutterer @@ -86932,10 +96957,10 @@ Date: Sat Apr 3 09:33:49 2010 -0700 hostname to the search path for xorg.conf.d. This changes it to something very simple: - /etc/X11/ - $sysconfdir/X11/ - /etc/X11/xorg.conf.d - $sysconfdir/X11/xorg.conf.d + /etc/X11/ + $sysconfdir/X11/ + /etc/X11/xorg.conf.d + $sysconfdir/X11/xorg.conf.d Signed-off-by: Dan Nicholson Signed-off-by: Peter Hutterer @@ -87038,14 +97063,14 @@ Date: Mon Apr 5 19:12:22 2010 -0400 Signed-off-by: Keith Packard commit cbda58c963af5bb9c4643e9017dd4eec589ceff3 -Merge: a7698a6 c983f40 +Merge: a7698a6776 c983f40fe4 Author: Keith Packard Date: Wed Apr 7 15:51:38 2010 -0700 Merge remote branch 'yselkowitz/master' commit a7698a677682a32960b885c22fdba2add70f4658 -Merge: 495cec7 165a4a9 +Merge: 495cec794d 165a4a9c7d Author: Keith Packard Date: Tue Apr 6 12:36:15 2010 -0700 @@ -87192,14 +97217,14 @@ Date: Fri Mar 26 09:33:20 2010 -0700 Signed-off-by: Keith Packard commit 57cb1a854a1b6d91d214b3fa250a7df2ed20d433 -Merge: 4b3d67a 28a5f14 +Merge: 4b3d67a764 28a5f14b40 Author: Keith Packard Date: Mon Mar 29 11:46:00 2010 -0700 Merge remote branch 'jeremyhu/master' commit 4b3d67a7647f696957727948f9757a261e15d14e -Merge: 579715f aa91508 +Merge: 579715f830 aa91508356 Author: Keith Packard Date: Mon Mar 29 11:44:07 2010 -0700 @@ -87616,7 +97641,7 @@ Date: Mon Mar 22 18:01:17 2010 +0100 Signed-off-by: Keith Packard commit b29220dc765cb6f878c5466e00e4bd21f3bd803d -Merge: c3da766 ed31d50 +Merge: c3da76643a ed31d50b5f Author: Keith Packard Date: Sun Mar 21 23:01:58 2010 -0700 @@ -87864,7 +97889,7 @@ Date: Sun Mar 21 17:23:46 2010 -0700 Bump to 1.7.99.902 -- 1.8 RC2 commit 235fa5030428084368e5be57fca695647b7b79c4 -Merge: 1c612ac fa5103a +Merge: 1c612acca8 fa5103a02b Author: Keith Packard Date: Sun Mar 21 15:38:40 2010 -0700 @@ -87890,7 +97915,7 @@ Date: Wed Mar 17 14:32:38 2010 +1000 Signed-off-by: Keith Packard commit 95ca39b981624df5338a16b506289014c431ae82 -Merge: e7ff956 bf18191 +Merge: e7ff956638 bf181915e1 Author: Keith Packard Date: Sun Mar 21 15:24:06 2010 -0700 @@ -88078,7 +98103,7 @@ Date: Fri Mar 12 16:52:56 2010 +0100 Signed-off-by: Keith Packard commit df9b6f16b27398545cd4cff8a56dd59a3813351d -Merge: 5f169f5 5172253 +Merge: 5f169f5493 5172253bae Author: Keith Packard Date: Mon Mar 15 08:26:58 2010 -0700 @@ -88403,7 +98428,7 @@ Date: Wed Jan 27 20:38:38 2010 +0000 Signed-off-by: Keith Packard commit 780c95caf9888fa4548dfe4c1c78a7e7ce99a9ed -Merge: 018b177 758f697 +Merge: 018b177591 758f697175 Author: Keith Packard Date: Wed Feb 24 09:59:19 2010 -0800 @@ -88469,7 +98494,7 @@ Date: Wed Feb 3 15:40:47 2010 -0500 xselinux: Bump extension minor version. Changes introduced in this version: - - 3 window-related requests now handle pixmaps also. + - 3 window-related requests now handle pixmaps also. Signed-off-by: Eamon Walsh Reviewed-by: Keith Packard @@ -88481,9 +98506,9 @@ Date: Wed Feb 3 15:38:57 2010 -0500 xselinux: Rename window-related requests that now support pixmaps. Renamed requests: - SetWindowCreateContext -> SetDrawableCreateContext - GetWindowCreateContext -> GetDrawableCreateContext - GetWindowContext -> GetDrawableContext + SetWindowCreateContext -> SetDrawableCreateContext + GetWindowCreateContext -> GetDrawableCreateContext + GetWindowContext -> GetDrawableContext Signed-off-by: Eamon Walsh Reviewed-by: Keith Packard @@ -88571,7 +98596,7 @@ Date: Mon Feb 15 14:18:00 2010 +0200 Signed-off-by: Keith Packard commit ca9c2472d74c7107ccc117e2c9c723c168d2eccf -Merge: e40ba57 02d1116 +Merge: e40ba5798c 02d1116e7e Author: Keith Packard Date: Mon Feb 22 13:26:06 2010 -0800 @@ -88909,7 +98934,7 @@ Date: Fri Feb 12 13:46:03 2010 -0800 Bump to 1.7.99.901 -- 1.8 RC1 commit 57ffeb3f2b3313dcef92a396f1f55fdbc064b2c5 -Merge: c6d9bc0 c76248f +Merge: c6d9bc092c c76248fda9 Author: Keith Packard Date: Fri Feb 12 13:36:32 2010 -0800 @@ -89636,7 +99661,7 @@ Date: Wed Jan 27 11:34:45 2010 -0800 Signed-off-by: Keith Packard commit 0b21a0416b4cb2c32da5e3fda05a0682eb97d56e -Merge: 1e6fd65 837bd2b +Merge: 1e6fd65d0b 837bd2bbc0 Author: Keith Packard Date: Wed Jan 27 14:14:15 2010 -0800 @@ -89955,7 +99980,7 @@ Date: Mon Jan 11 18:02:55 2010 -0800 Signed-off-by: Jeremy Huddleston commit 44f9c3d16c9c9b3362306a9ba26ee52e7baafeca -Merge: 032f978 84956ca +Merge: 032f97808c 84956ca43b Author: Keith Packard Date: Wed Jan 13 10:19:21 2010 -0800 @@ -90111,7 +100136,7 @@ Date: Thu Jan 7 14:12:34 2010 -0500 Signed-off-by: Keith Packard commit 8ab4749aaefb3727b9fc58bb37b50a2d07eb1531 -Merge: 8d53d84 9437504 +Merge: 8d53d84485 9437504b21 Author: Keith Packard Date: Thu Jan 7 10:32:21 2010 -0800 @@ -90474,14 +100499,14 @@ Date: Wed Dec 23 16:05:16 2009 +1000 Signed-off-by: Julien Cristau commit 9fad8f06fb89ac2ae05bea0fa24cab3df7677297 -Merge: 871bbe1 42e8c92 +Merge: 871bbe1d87 42e8c9224e Author: Keith Packard Date: Wed Dec 30 09:28:19 2009 -0800 Merge remote branch 'dbn/inputclass' commit 871bbe1d87fa3c7ebd075e1d1eec33e45b08493d -Merge: db2c6f7 e116563 +Merge: db2c6f7c91 e1165632bd Author: Keith Packard Date: Wed Dec 30 09:16:45 2009 -0800 @@ -90796,7 +100821,7 @@ Date: Tue Dec 22 15:40:40 2009 +1000 Signed-off-by: Keith Packard commit 7dc78db79edd15b971110acaf16bbe7f69e40bdb -Merge: 81a623f b44c9be +Merge: 81a623f036 b44c9be244 Author: Keith Packard Date: Tue Dec 22 21:25:18 2009 -0800 @@ -90977,14 +101002,14 @@ Date: Mon Dec 14 08:41:18 2009 +1000 Reviewed-by: Alan Coopersmith commit 0cb638dc6822e54567a1731ea1cf588475a226e9 -Merge: 6a6a041 fbdf493 +Merge: 6a6a041c2d fbdf493a3e Author: Keith Packard Date: Wed Dec 16 21:58:44 2009 -0800 Merge remote branch 'alanc/master' commit 6a6a041c2d8d32f6355db77cd59cff371038c683 -Merge: 8127465 d503195 +Merge: 8127465f44 d503195504 Author: Keith Packard Date: Wed Dec 16 21:57:32 2009 -0800 @@ -91212,7 +101237,7 @@ Date: Tue Dec 1 11:09:32 2009 -0800 Conflicts: - fb/fbpict.c + fb/fbpict.c Signed-off-by: Keith Packard Acked-by: Soeren Sandmann @@ -91251,7 +101276,7 @@ Date: Tue Dec 1 11:04:06 2009 -0800 Acked-by: Soeren Sandmann commit d3e054ac07dae12a82ad764b0622fddbef4b9ec5 -Merge: 12fb318 97a6454 +Merge: 12fb31815d 97a6454ea5 Author: Keith Packard Date: Fri Dec 11 09:22:22 2009 -0800 @@ -91470,7 +101495,7 @@ Date: Wed Dec 2 20:24:02 2009 +0100 Signed-off-by: Keith Packard commit 98c8b752254a27ab1aaf881b36bfda0f74929d0a -Merge: 0e084d8 91c1bd7 +Merge: 0e084d8c71 91c1bd78f7 Author: Keith Packard Date: Wed Dec 2 15:28:07 2009 -0800 @@ -92468,7 +102493,7 @@ Date: Wed Nov 4 15:35:37 2009 +0200 Signed-off-by: Keith Packard commit 7442f3355ab8f0bb2b1a270da18c65d8d315d4dd -Merge: 0573042 7897b6c +Merge: 0573042cdd 7897b6c2d4 Author: Keith Packard Date: Wed Nov 4 08:55:20 2009 -0800 @@ -92550,7 +102575,7 @@ Date: Sun Nov 1 14:30:48 2009 -0500 Make sys.c use unaligned access functions provided in compiler. Favorite deleted line was definitely - /* to cope with broken egcs-1.1.2 :-(((( */ + /* to cope with broken egcs-1.1.2 :-(((( */ Signed-off-by: Matt Turner Signed-off-by: Keith Packard @@ -92729,7 +102754,7 @@ Date: Wed Oct 28 11:44:27 2009 -0700 Signed-off-by: Keith Packard commit deb72fc61464250af8185dab2da8ee09f13c55d8 -Merge: 55f4c80 a60e676 +Merge: 55f4c80a4c a60e676f1f Author: Keith Packard Date: Wed Oct 28 10:54:13 2009 -0700 @@ -92880,7 +102905,7 @@ Date: Thu Oct 22 00:00:35 2009 +0900 Signed-off-by: Keith Packard commit 1228e2d052f0bb98175c55c194340773b5fedb40 -Merge: 08e7f62 52bc6d9 +Merge: 08e7f62faf 52bc6d9449 Author: Keith Packard Date: Wed Oct 21 22:46:53 2009 +0900 @@ -93310,7 +103335,7 @@ Date: Tue Oct 13 20:14:58 2009 -0500 Signed-off-by: Keith Packard commit 6e158003e80534ce007290f75c89d698aec1d00b -Merge: 2b14e14 5e762f0 +Merge: 2b14e14203 5e762f0e2f Author: Keith Packard Date: Tue Oct 13 18:40:42 2009 -0700 @@ -93552,14 +103577,14 @@ Date: Wed Oct 7 09:07:03 2009 -0700 Signed-off-by: Keith Packard commit 68304215e25876ee639015969b4f07e1c9c515e0 -Merge: 6676f49 315aaef +Merge: 6676f49e34 315aaef557 Author: Keith Packard Date: Tue Oct 6 22:41:42 2009 -0700 Merge remote branch 'alanc/master' Conflicts: - configure.ac + configure.ac Signed-off-by: Keith Packard @@ -98704,7 +108729,7 @@ Date: Thu Jul 16 18:57:49 2009 +0300 Coverity Prevent: RESOURCE_LEAK in AccelSetProfileProperty: Event alloc_arg: Called allocation function "XIPropToInt" on "ptr" [details] - 167 rc = XIPropToInt(val, &nelem, &ptr); + 167 rc = XIPropToInt(val, &nelem, &ptr); Event leaked_storage: Variable "ptr" goes out of scope @@ -98722,10 +108747,10 @@ Date: Thu Jul 16 17:51:08 2009 +0300 Event var_tested_neg: Variable "fd" tested NEGATIVE At conditional (1): "fd != -1" taking false path - 335 if (fd != -1) { + 335 if (fd != -1) { Event negative_returns: Tracked variable "fd" was passed to a negative sink. - 347 close(fd); + 347 close(fd); commit 53ae6b63387e04324b23b6f8311cc22a154c1fb8 Author: Jeremy Huddleston @@ -100018,8 +110043,8 @@ Date: Sat Jun 13 10:28:21 2009 -0400 The new clipping rules: - - client clips happen after transformation - - pixels unavailable due to the hierarchy are undefined + - client clips happen after transformation + - pixels unavailable due to the hierarchy are undefined The first one is implemented in pixman; the second one is realized by making a copy of window sources (to prevent out-of-bounds access). @@ -100955,7 +110980,7 @@ Date: Thu Jun 4 17:33:25 2009 -0400 xace: fix a bad send access hook call. commit 993daf06497c85bb6a1e70592df380503d721dfb -Merge: 2bda50e e1e8c7d +Merge: 2bda50ee14 e1e8c7ddd7 Author: Peter Hutterer Date: Thu Jun 4 15:11:36 2009 +1000 @@ -101018,7 +111043,7 @@ Date: Wed Jun 3 13:37:32 2009 -0400 s/MIN/min/, s/MAX/max/ (#2968) commit 6de67d3206f0a4e307070714564c19efc84da2ec -Merge: af4e658 7f027d9 +Merge: af4e658401 7f027d9dc0 Author: Peter Hutterer Date: Wed Jun 3 16:11:33 2009 +1000 @@ -101413,23 +111438,23 @@ Date: Thu May 28 15:32:03 2009 -0400 These have been nops since 2006 and functionally void since 7.0. commit d7aef3f663f4b5d861799f8615dcd301d5ce2906 -Merge: a25f248 e08c6a0 +Merge: a25f248fc3 e08c6a0752 Author: Peter Hutterer Date: Thu May 28 17:20:58 2009 +1000 Merge branch 'master' into xi2 Conflicts: - Xext/geext.c - Xi/chdevcur.c - Xi/extgrbdev.c - Xi/xiproperty.c - configure.ac - dix/ptrveloc.c - hw/xfree86/common/xf86Config.c - mi/mipointer.h - test/input.c - xkb/xkb.c + Xext/geext.c + Xi/chdevcur.c + Xi/extgrbdev.c + Xi/xiproperty.c + configure.ac + dix/ptrveloc.c + hw/xfree86/common/xf86Config.c + mi/mipointer.h + test/input.c + xkb/xkb.c commit a25f248fc3bd0375d91ca8a44320200d445ecfbb Author: Peter Hutterer @@ -101465,7 +111490,7 @@ Date: Mon May 4 19:24:47 2009 -0500 Signed-off-by: Federico Mena Quintero commit b12010e10f38951358b48ff1076c026f943b7cc3 -Merge: 6e69272 f1441b8 +Merge: 6e69272473 f1441b8353 Author: Søren Sandmann Pedersen Date: Wed May 27 15:56:30 2009 -0400 @@ -102593,12 +112618,12 @@ Date: Thu Apr 30 18:49:06 2009 -0700 Array size is 128 elements (of 4 bytes each), index <= 128 Error: Buffer overflow at dix/events.c:592 - in function 'SetMaskForEvent' [Symbolic analysis] + in function 'SetMaskForEvent' [Symbolic analysis] In array dereference of filters[deviceid] with index 'deviceid' Array size is 20 elements (of 512 bytes each), index >= 0 and index <= 20 Error: Read buffer overflow at hw/xfree86/loader/loader.c:226 - in function 'LoaderOpen' [Symbolic analysis] + in function 'LoaderOpen' [Symbolic analysis] In array dereference of refCount[new_handle] with index 'new_handle' Array size is 256 elements (of 4 bytes each), index >= 1 and index <= 256 @@ -103299,15 +113324,15 @@ Date: Thu Apr 23 08:42:38 2009 -0700 Signed-off-by: Alan Coopersmith commit 057fc9a4f89282e440b5e11458f1dd8655879dd8 -Merge: 95628b7 932d6bc +Merge: 95628b797e 932d6bcbb6 Author: Peter Hutterer Date: Fri Apr 24 16:15:47 2009 +1000 Merge branch 'master' into xi2 Conflicts: - Xi/chdevhier.c - include/input.h + Xi/chdevhier.c + include/input.h commit 932d6bcbb68194c5bdfeb336f700dc8b31529223 Author: Peter Hutterer @@ -103475,7 +113500,7 @@ Date: Fri Apr 17 15:22:57 2009 +0200 Signed-off-by: Peter Hutterer commit d5ad14c8ed4d8360e1df8cd0bacf6a7c9c31df91 -Merge: 54716fd 0e0642e +Merge: 54716fd3db 0e0642ee94 Author: Peter Hutterer Date: Sun Apr 19 22:28:22 2009 +1000 @@ -104302,7 +114327,7 @@ Date: Thu Mar 26 22:22:32 2009 -0700 Signed-off-by: Alan Coopersmith commit 6c3b633299f12051fcf37fb8439f358de876cf03 -Merge: adf21db 0cfd481 +Merge: adf21dba76 0cfd481308 Author: Peter Hutterer Date: Tue Apr 7 19:36:27 2009 +1000 @@ -105715,7 +115740,7 @@ Date: Fri Feb 27 16:37:27 2009 +0100 Conflicts: - exa/exa_render.c + exa/exa_render.c commit d0dd649035fc3698c5b436f9d9d248116aa106a3 Author: Jon TURNEY @@ -110803,7 +120828,7 @@ Date: Thu Dec 4 09:47:25 2008 +1000 Signed-off-by: Peter Hutterer commit 22d4ddcc3d63b7fbf2a23f5162075e4ee06db781 -Merge: d2dad38 c3bf15b +Merge: d2dad384f5 c3bf15ba85 Author: Matthieu Herrb Date: Sun Dec 7 23:56:15 2008 +0100 @@ -111382,9 +121407,9 @@ Date: Mon Dec 1 16:28:45 2008 -0800 Remove xorgconfig & xorgcfg Update driver lists: - - Remove vga - - i810->intel - - via->openchrome + - Remove vga + - i810->intel + - via->openchrome commit bd147e6f4b03f344c967c88fd433877b14fe1912 Author: Alan Coopersmith @@ -111563,19 +121588,19 @@ Date: Sat Nov 29 23:56:06 2008 -0200 SPECIAL CASES o defined as _X_INTERNAL - xf86NewInputDevice() + xf86NewInputDevice() o defined as static - fbGCPrivateKey - fbOverlayScreenPrivateKey - fbScreenPrivateKey - fbWinPrivateKey + fbGCPrivateKey + fbOverlayScreenPrivateKey + fbScreenPrivateKey + fbWinPrivateKey o defined in libXfont.so, but declared in xorg/dixfont.h - GetGlyphs() - QueryGlyphExtents() - QueryTextExtents() - ParseGlyphCachingMode() - InitGlyphCaching() - SetGlyphCachingMode() + GetGlyphs() + QueryGlyphExtents() + QueryTextExtents() + ParseGlyphCachingMode() + InitGlyphCaching() + SetGlyphCachingMode() commit ffb484f7ef84099019b196ef97bfb2355eb6d52a Author: Maarten Maathuis @@ -111669,13 +121694,13 @@ Date: Fri Nov 28 01:55:11 2008 -0200 Still missing symbols worth mentioning are: sunleo - miFindMaxBand no longer available + miFindMaxBand no longer available - intel (uxa/uxa-accel.c) - fbShmPutImage no longer available (and should have been static) + intel (uxa/uxa-accel.c) + fbShmPutImage no longer available (and should have been static) mga - MGAGetClientPointer (should come from matrox's libhal) + MGAGetClientPointer (should come from matrox's libhal) This is not a definitive "visibility" patch, as all it does is to export missing symbols, but the modules that current don't compile, @@ -111759,7 +121784,7 @@ Date: Tue Nov 25 23:15:35 2008 -0800 New version of dolt commit 4715f079b9c61362755c95c1ebf89c97cc6fff2b -Merge: 9ffc671 ed597f1 +Merge: 9ffc671939 ed597f19fd Author: Keith Packard Date: Tue Nov 25 22:19:08 2008 -0800 @@ -111831,18 +121856,18 @@ Date: Tue Nov 25 15:46:39 2008 -0800 Includes fixes for: "xf86Config.c", line 2434: warning: argument #1 is incompatible with prototype: - prototype: pointer to struct _DisplayModeRec: "xf86.h", line 351 - argument : pointer to const struct _DisplayModeRec + prototype: pointer to struct _DisplayModeRec: "xf86.h", line 351 + argument : pointer to const struct _DisplayModeRec "xf86EdidModes.c", line 312: warning: argument #1 is incompatible with prototype: - prototype: pointer to struct _DisplayModeRec: "../../../hw/xfree86/common/xf86.h", line 351 - argument : pointer to const struct _DisplayModeRec + prototype: pointer to struct _DisplayModeRec: "../../../hw/xfree86/common/xf86.h", line 351 + argument : pointer to const struct _DisplayModeRec "xf86EdidModes.c", line 438: warning: assignment type mismatch: - pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec + pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec "xf86Modes.c", line 701: warning: assignment type mismatch: - pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec + pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec commit d5ad296869c38ab30136b5a293a0125b76aad994 Author: Alan Coopersmith @@ -112640,7 +122665,7 @@ Date: Fri Nov 21 12:21:45 2008 +1000 Signed-off-by: Peter Hutterer commit 387563b77743d92be83420d982eaf57f5459a883 -Merge: 85f650c f6e01fa +Merge: 85f650c9b7 f6e01fa1b8 Author: Matthieu Herrb Date: Sun Nov 23 13:15:46 2008 +0100 @@ -113042,7 +123067,7 @@ Date: Fri Nov 14 12:36:20 2008 -0500 Signed-off-by: James Cloos commit ba4e08244ed3923eecf26842dfc1df17c696e053 -Merge: 81fd17f 5bad5d2 +Merge: 81fd17f5f4 5bad5d2abe Author: Alex Deucher Date: Thu Nov 13 15:04:18 2008 -0500 @@ -114826,7 +124851,7 @@ Date: Tue Oct 7 13:08:38 2008 -0700 Conflicts: - hw/xfree86/loader/xf86sym.c + hw/xfree86/loader/xf86sym.c commit 94919480d8bb66e1807b4fe87b8f326ef6e012c6 Author: Adam Jackson @@ -116618,7 +126643,7 @@ Date: Wed Aug 20 09:56:06 2008 -0700 stuck-modifier fixes (capslock) 3button-emulation now doesn't send the modifier key with the click Added other options to fake_button2 and fake_button3 defaults options: - ({l,r}{control,alt,command,shift}) + ({l,r}{control,alt,command,shift}) (cherry picked from commit 8fb6a1cf44c35a20dfb0c05c9824f94898f88da7) (cherry picked from commit ae9c1b3cfb3874b4d1251681c24bda91c398bcab) @@ -120146,7 +130171,7 @@ Date: Mon May 26 17:56:08 2008 +0930 Signed-off-by: Peter Hutterer commit 26c1958c322be3ac4dfec9ba2c41c5202bd03709 -Merge: 5fe5778 2958610 +Merge: 5fe57787fa 29586101dc Author: Peter Hutterer Date: Mon May 26 17:37:31 2008 +0930 @@ -120625,7 +130650,7 @@ Date: Wed May 21 21:51:27 2008 +0930 Big boss says UniSA isn't unique enough. Who am I to argue? commit 7509fb498c02fe1cebe4139612b8871ec877c130 -Merge: 2ae3bed dfb7de6 +Merge: 2ae3bed337 dfb7de6571 Author: Peter Hutterer Date: Wed May 21 16:25:35 2008 +0930 @@ -120664,7 +130689,7 @@ Date: Mon May 19 18:43:29 2008 -0700 Restore return type on xf86SetScrnInfoModes - Seems to have been accidentally lost by commit 76943fec860315f3c93539e59a59080b8a7b3e75 + Seems to have been accidentally lost by commit 76943fec860315f3c93539e59a59080b8a7b3e75 commit 7a550cefd9417c22a4397ea4d103ddc347ab1a0f Author: Peter Hutterer @@ -120685,7 +130710,7 @@ Date: Tue May 20 10:54:32 2008 +0930 fb: shut up two compiler warnings. commit 99d28c3ef37aeffe7d8ec41e45a650ba248c6958 -Merge: fc7e256 0178b6a +Merge: fc7e2566cc 0178b6a4ab Author: Peter Hutterer Date: Tue May 20 10:20:14 2008 +0930 @@ -120693,13 +130718,13 @@ Date: Tue May 20 10:20:14 2008 +0930 Conflicts: - Xext/xprint.c (removed in master) - config/hal.c - dix/main.c - hw/kdrive/ati/ati_cursor.c (removed in master) - hw/kdrive/i810/i810_cursor.c (removed in master) - hw/xprint/ddxInit.c (removed in master) - xkb/ddxLoad.c + Xext/xprint.c (removed in master) + config/hal.c + dix/main.c + hw/kdrive/ati/ati_cursor.c (removed in master) + hw/kdrive/i810/i810_cursor.c (removed in master) + hw/xprint/ddxInit.c (removed in master) + xkb/ddxLoad.c commit 0178b6a4abed0df3e90ba393709ed566105e7c2c Author: Adam Jackson @@ -121285,7 +131310,7 @@ Date: Fri May 9 15:38:44 2008 -0700 commit 7b3066d9b9099135d9c49e0682161d5568fc535b -Merge: 2a3d142 315f089 +Merge: 2a3d1421e0 315f089056 Author: Drew Parsons Date: Sat May 10 00:01:15 2008 +1000 @@ -121385,7 +131410,7 @@ Date: Thu May 8 16:04:24 2008 -0400 Bug #13104: Remove broken XAA a1 glyph fast path. commit ddaecfa13cefee7c66b39b606c8640c6544d4943 -Merge: 9c2e087 cf20df3 +Merge: 9c2e0871cf cf20df39cc Author: Adam Jackson Date: Thu May 8 14:33:58 2008 -0400 @@ -121643,7 +131668,7 @@ Date: Fri May 2 14:56:58 2008 +0930 xfree86: don't try to repaint the cursor before cursors exist. commit 334456952930cb3e55c02fcdada2d0c074cd0520 -Merge: 8e56fd9 3b8d534 +Merge: 8e56fd9728 3b8d53452c Author: Peter Hutterer Date: Fri May 2 11:00:14 2008 +0930 @@ -121651,8 +131676,8 @@ Date: Fri May 2 11:00:14 2008 +0930 Conflicts: - Xi/exevents.c - dix/devices.c + Xi/exevents.c + dix/devices.c commit a338007be6fd4302af012109d959f43ac7eab2b1 Author: Jeremy Huddleston @@ -122552,7 +132577,7 @@ Date: Mon Apr 21 22:06:38 2008 -0700 (cherry picked from commit a033c0b3dbb3b963261faa39f0236457cb00ff44) commit 8190ef87547b704848231bde10b1cdffc6442790 -Merge: 179a082 2ddbfd3 +Merge: 179a082c26 2ddbfd3457 Author: Peter Hutterer Date: Tue Apr 22 18:04:05 2008 +0930 @@ -122560,12 +132585,12 @@ Date: Tue Apr 22 18:04:05 2008 +0930 Conflicts: - Xext/EVI.c - Xext/appgroup.c - Xext/cup.c - Xext/mitmisc.c - Xext/sampleEVI.c - dix/window.c + Xext/EVI.c + Xext/appgroup.c + Xext/cup.c + Xext/mitmisc.c + Xext/sampleEVI.c + dix/window.c commit 179a082c26f9e562492ee2e59e7f44f949f39f9c Author: Peter Hutterer @@ -123190,7 +133215,7 @@ Date: Mon Apr 14 09:58:49 2008 +0200 EXA: Teach exaCompositeFallbackPictDesc() about x8r8g8b8. commit 1a9d7205cd5640eb65f019336097d86301942ea7 -Merge: 90f491c 6866e84 +Merge: 90f491cf8e 6866e84e3c Author: Peter Hutterer Date: Mon Apr 14 16:25:58 2008 +0930 @@ -123375,7 +133400,7 @@ Date: Fri Feb 22 11:01:51 2008 +1030 X.Org Bug 14418 commit 90f491cf8eb869f27c4278b26c1bb84432b12d63 -Merge: cbe01b3 b4380d8 +Merge: cbe01b3083 b4380d8030 Author: Peter Hutterer Date: Fri Apr 11 08:29:52 2008 +0930 @@ -123568,7 +133593,7 @@ Date: Tue Apr 8 20:37:25 2008 -0700 (cherry picked from commit 126e9bc8c480b403dedc44c1e8c4fe1476340ed9) commit cbe01b3083eb65c9d4259b1071683febebf11600 -Merge: 5ffbcfe 389dae7 +Merge: 5ffbcfec3d 389dae73cc Author: Peter Hutterer Date: Wed Apr 9 10:46:46 2008 +0930 @@ -123668,7 +133693,7 @@ Date: Thu Apr 3 14:50:05 2008 -0400 EXA: Fix TS origin computation when implementing RenderComposite with tiling. commit fd06e8f8c1d82a9d91931e8532bee0fd9c9ca9ab -Merge: b46a009 6c0cfe3 +Merge: b46a009186 6c0cfe3d43 Author: Peter Hutterer Date: Mon Apr 7 07:56:41 2008 +0930 @@ -123676,11 +133701,11 @@ Date: Mon Apr 7 07:56:41 2008 +0930 Conflicts: - Xext/xevie.c - dix/dispatch.c + Xext/xevie.c + dix/dispatch.c commit 539bf3c2836727e7560c64144071b086f8ea32fe -Merge: 3ab33e7 6c0cfe3 +Merge: 3ab33e7cd4 6c0cfe3d43 Author: Sascha Hlusiak Date: Mon Apr 7 00:10:16 2008 +0200 @@ -124141,7 +134166,7 @@ Date: Thu Mar 27 15:18:39 2008 +1000 RH BZ 435216 commit 9df915b84d45d39aed7557c98883b20a66da2e96 -Merge: 47eb658 333e712 +Merge: 47eb658e80 333e7123dc Author: Sascha Hlusiak Date: Tue Mar 25 17:50:50 2008 +0100 @@ -124683,7 +134708,7 @@ Date: Tue Mar 4 02:44:48 2008 -0500 XACE: Check the return value of the selection create hook call. commit 4f2cd0ed96d3b10c78774c721c2ffbfb0556dddd -Merge: 23ae68a 453661a +Merge: 23ae68a4c7 453661a9e1 Author: Peter Hutterer Date: Tue Mar 4 18:11:10 2008 +1030 @@ -124694,25 +134719,25 @@ Date: Tue Mar 4 18:11:10 2008 +1030 Conflicts: - Xi/opendev.c - dix/devices.c - dix/dixfonts.c - dix/getevents.c - dix/resource.c - dix/window.c - hw/xfree86/common/xf86Xinput.c - mi/mipointer.c - xkb/ddxBeep.c - xkb/ddxCtrls.c - xkb/ddxKeyClick.c - xkb/ddxList.c - xkb/ddxLoad.c - xkb/xkb.c - xkb/xkbAccessX.c - xkb/xkbEvents.c - xkb/xkbInit.c - xkb/xkbPrKeyEv.c - xkb/xkbUtils.c + Xi/opendev.c + dix/devices.c + dix/dixfonts.c + dix/getevents.c + dix/resource.c + dix/window.c + hw/xfree86/common/xf86Xinput.c + mi/mipointer.c + xkb/ddxBeep.c + xkb/ddxCtrls.c + xkb/ddxKeyClick.c + xkb/ddxList.c + xkb/ddxLoad.c + xkb/xkb.c + xkb/xkbAccessX.c + xkb/xkbEvents.c + xkb/xkbInit.c + xkb/xkbPrKeyEv.c + xkb/xkbUtils.c commit 72f2197545e734cd0aa785d05a57b2fc0351a763 Author: Eamon Walsh @@ -125646,9 +135671,9 @@ Date: Sun Feb 17 11:21:01 2008 +0100 - This allows some compositing managers to work, even after randr12 has changed the root window size. - Thanks to ajax for figuring out the best place to put this. - Example: - - xf86RandR12SetMode() calls EnableDisableFBAccess(). - - That calls xf86SetRootClip() which in turn calls ResizeChildrenWinSize(). - - The final step is the call to PositionWindow(). + - xf86RandR12SetMode() calls EnableDisableFBAccess(). + - That calls xf86SetRootClip() which in turn calls ResizeChildrenWinSize(). + - The final step is the call to PositionWindow(). commit b95059c20746a71e60ef152bb627e1d5c2210d75 Author: Jeremy Huddleston @@ -126142,7 +136167,7 @@ Date: Fri Feb 1 14:13:29 2008 +1030 Reviewed-by: Peter Hutterer commit e5e531ce96264518f278f572a4d0bfcd345aa618 -Merge: 6c38682 1692dcf +Merge: 6c38682084 1692dcf197 Author: Peter Hutterer Date: Thu Jan 31 16:36:17 2008 +1030 @@ -126150,7 +136175,7 @@ Date: Thu Jan 31 16:36:17 2008 +1030 Conflicts: - dix/events.c + dix/events.c commit 6c38682084e24b18bac0ea75729b1183aeb01600 Author: Benjamin Tissoires @@ -126259,14 +136284,14 @@ Date: Mon Jan 28 12:18:43 2008 -0800 (cherry picked from commit 116800279d2ec783c63f43d3902627edde6a4cff) commit 16b0614c8c441eb1692bde9e58fadf54a9c6f00f -Merge: 1a88aed e915a26 +Merge: 1a88aed5c8 e915a26397 Author: David Nusinow Date: Sat Jan 26 16:13:25 2008 -0500 Merge commit 'upstream/master' commit 0ac175597712edfeae676f536746a4d26d625e30 -Merge: 210eeef e915a26 +Merge: 210eeef495 e915a26397 Author: Peter Hutterer Date: Sat Jan 26 13:55:07 2008 +1030 @@ -126274,7 +136299,7 @@ Date: Sat Jan 26 13:55:07 2008 +1030 Conflicts: - Xext/sampleEVI.c + Xext/sampleEVI.c commit e915a2639752bc0ea9e6e192e020cc2031c08063 Author: Eamon Walsh @@ -126720,7 +136745,7 @@ Date: Wed Jan 9 19:52:00 2008 -0800 More Xv extension byte swapping fixes commit 38bf01bd1c925614a6e67a38aa3cefc7b8fe3bca -Merge: 4e85c7c 0883e83 +Merge: 4e85c7c322 0883e838e2 Author: Peter Hutterer Date: Thu Jan 10 13:38:46 2008 +1030 @@ -126956,7 +136981,7 @@ Date: Thu Jan 3 18:09:56 2008 +1030 dix: free ClassesRec when a BadAlloc occurs during CoreKeyboardProc. commit 8da83836b60f7cdb75d08482f4311fa0e2ab4e1d -Merge: eace889 ae869fc +Merge: eace88989c ae869fc766 Author: Peter Hutterer Date: Thu Jan 3 17:04:54 2008 +1030 @@ -126964,35 +136989,35 @@ Date: Thu Jan 3 17:04:54 2008 +1030 Conflicts: - XTrap/xtrapddmi.c - Xext/security.c - Xext/xprint.c - Xext/xtest.c - Xext/xvdisp.c - Xi/exevents.c - Xi/grabdevb.c - Xi/grabdevk.c - Xi/opendev.c - Xi/ungrdev.c - Xi/ungrdevb.c - Xi/ungrdevk.c - dix/cursor.c - dix/devices.c - dix/dixutils.c - dix/events.c - dix/getevents.c - dix/main.c - dix/window.c - hw/xfree86/ramdac/xf86Cursor.c - include/dix.h - include/input.h - include/inputstr.h - mi/midispcur.c - mi/miinitext.c - mi/misprite.c - render/animcur.c - xfixes/cursor.c - xkb/xkbAccessX.c + XTrap/xtrapddmi.c + Xext/security.c + Xext/xprint.c + Xext/xtest.c + Xext/xvdisp.c + Xi/exevents.c + Xi/grabdevb.c + Xi/grabdevk.c + Xi/opendev.c + Xi/ungrdev.c + Xi/ungrdevb.c + Xi/ungrdevk.c + dix/cursor.c + dix/devices.c + dix/dixutils.c + dix/events.c + dix/getevents.c + dix/main.c + dix/window.c + hw/xfree86/ramdac/xf86Cursor.c + include/dix.h + include/input.h + include/inputstr.h + mi/midispcur.c + mi/miinitext.c + mi/misprite.c + render/animcur.c + xfixes/cursor.c + xkb/xkbAccessX.c commit ccf6636d2ca8acdaaeb8da34db507a10a082b0de Author: Alan Coopersmith @@ -127595,7 +137620,7 @@ Date: Fri Dec 14 00:53:54 2007 -0500 Bump video driver ABI and extension ABI for devPrivates rework. commit 86b2e59bfb79bd042a13c35fbb4ccecec576f629 -Merge: 1c1a4bc cb0d7e2 +Merge: 1c1a4bc970 cb0d7e2c26 Author: Eamon Walsh Date: Fri Dec 14 00:32:24 2007 -0500 @@ -127603,7 +137628,7 @@ Date: Fri Dec 14 00:32:24 2007 -0500 Conflicts: - configure.ac + configure.ac This is the last pull before merging to master. @@ -127643,7 +137668,7 @@ Date: Thu Dec 13 15:55:28 2007 -0800 (cherry picked from commit fc04c9759b30d062111d4a7f3f411ed0f18cbde4) commit c8feb73f5841e7812d8dfdb91f1064e2033d028c -Merge: 9a7ce57 a125ce4 +Merge: 9a7ce57363 a125ce4a84 Author: Eamon Walsh Date: Thu Dec 13 18:38:25 2007 -0500 @@ -127651,36 +137676,36 @@ Date: Thu Dec 13 18:38:25 2007 -0500 Conflicts: - Xext/EVI.c - Xext/bigreq.c - Xext/cup.c - Xext/dpms.c - Xext/fontcache.c - Xext/mitmisc.c - Xext/xcmisc.c - Xext/xf86bigfont.c - Xext/xtest.c - configure.ac - dbe/dbe.c - hw/darwin/darwin.h - hw/darwin/darwinEvents.c - hw/darwin/iokit/xfIOKit.h - hw/darwin/iokit/xfIOKitCursor.c - hw/darwin/quartz/fullscreen/fullscreen.c - hw/darwin/quartz/fullscreen/quartzCursor.c - hw/darwin/quartz/quartz.c - hw/darwin/quartz/quartzCommon.h - hw/darwin/quartz/quartzCursor.c - hw/darwin/quartz/xpr/dri.c - hw/darwin/quartz/xpr/dristruct.h - hw/darwin/quartz/xpr/xprCursor.c - hw/darwin/quartz/xpr/xprFrame.c - hw/xfree86/modes/xf86RandR12.c - include/cursor.h - miext/rootless/rootlessCommon.h - miext/rootless/rootlessScreen.c - miext/rootless/rootlessWindow.c - render/picturestr.h + Xext/EVI.c + Xext/bigreq.c + Xext/cup.c + Xext/dpms.c + Xext/fontcache.c + Xext/mitmisc.c + Xext/xcmisc.c + Xext/xf86bigfont.c + Xext/xtest.c + configure.ac + dbe/dbe.c + hw/darwin/darwin.h + hw/darwin/darwinEvents.c + hw/darwin/iokit/xfIOKit.h + hw/darwin/iokit/xfIOKitCursor.c + hw/darwin/quartz/fullscreen/fullscreen.c + hw/darwin/quartz/fullscreen/quartzCursor.c + hw/darwin/quartz/quartz.c + hw/darwin/quartz/quartzCommon.h + hw/darwin/quartz/quartzCursor.c + hw/darwin/quartz/xpr/dri.c + hw/darwin/quartz/xpr/dristruct.h + hw/darwin/quartz/xpr/xprCursor.c + hw/darwin/quartz/xpr/xprFrame.c + hw/xfree86/modes/xf86RandR12.c + include/cursor.h + miext/rootless/rootlessCommon.h + miext/rootless/rootlessScreen.c + miext/rootless/rootlessWindow.c + render/picturestr.h Trying to pick up the pieces from the darwin churn here... @@ -129088,7 +139113,7 @@ Author: Eamon Walsh Date: Tue Nov 20 15:21:31 2007 -0500 devPrivates rework: put back some changes that were mistakenly removed - during merge conflict resolution. + during merge conflict resolution. commit 709c1a70c8c6a9e132bf0d92f78a12be72beee51 Author: Eamon Walsh @@ -129107,10 +139132,10 @@ Author: Eamon Walsh Date: Mon Nov 19 21:01:22 2007 -0500 devPrivates rework: put back a comment that was mistakenly removed - during merge conflict resolution. + during merge conflict resolution. commit 2d17f47cc7d6b174857617d31ad1b437d8e97d94 -Merge: 60be452 ea9c63e +Merge: 60be452c2e ea9c63e93b Author: Eamon Walsh Date: Mon Nov 19 18:10:46 2007 -0500 @@ -129118,8 +139143,8 @@ Date: Mon Nov 19 18:10:46 2007 -0500 Conflicts: - hw/xnest/Pixmap.c - include/dix.h + hw/xnest/Pixmap.c + include/dix.h commit 60be452c2e88342f92a76ba5ec7d90b5b0211aaf Author: Eamon Walsh @@ -129438,7 +139463,7 @@ Date: Thu Nov 8 17:25:36 2007 -0500 Don't sleep(1) at server exit. commit 1603130236c55ddabc3854d4ba62d544debcf1f5 -Merge: f207e69 f7dd0c7 +Merge: f207e69d62 f7dd0c72b8 Author: Eamon Walsh Date: Wed Nov 14 13:35:50 2007 -0500 @@ -129446,8 +139471,8 @@ Date: Wed Nov 14 13:35:50 2007 -0500 Conflicts: - Xext/xace.c - Xext/xace.h + Xext/xace.c + Xext/xace.h commit f207e69d62bc04c7f254347b03e6d8fa8b569d66 Author: Eamon Walsh @@ -129815,7 +139840,7 @@ Date: Thu Nov 8 10:00:35 2007 +1030 Also clean up to return error codes instead of sending the error manually. commit 184a7b8917a15bb2c719153b9b016c03aab42101 -Merge: a8808ac 0b72905 +Merge: a8808ac3d0 0b729051c0 Author: Peter Hutterer Date: Thu Nov 8 09:34:35 2007 +1030 @@ -129823,10 +139848,10 @@ Date: Thu Nov 8 09:34:35 2007 +1030 Conflicts: - Xi/opendev.c + Xi/opendev.c commit e94ab0b502160376d1956345196f7e1c7e2e886f -Merge: 26e1fc7 9bee1c6 +Merge: 26e1fc7b42 9bee1c6912 Author: Dodji Seketeli Date: Wed Nov 7 19:04:24 2007 +0100 @@ -129865,7 +139890,7 @@ Date: Wed Nov 7 18:43:16 2007 +0100 XNEST_LIBS contains the right thing. commit 0b729051c04da7068f1e6dd319190bd0a362b2c0 -Merge: b7ee005 d7c5e8b +Merge: b7ee005d32 d7c5e8bfc1 Author: Peter Hutterer Date: Wed Nov 7 15:37:23 2007 +1030 @@ -129873,19 +139898,19 @@ Date: Wed Nov 7 15:37:23 2007 +1030 Conflicts: - Xi/extinit.c - Xi/grabdev.c - Xi/setmode.c - Xi/ungrdev.c - dix/devices.c - dix/events.c - dix/getevents.c - include/dix.h - mi/midispcur.c - mi/misprite.c - xkb/xkbActions.c - xkb/xkbEvents.c - xkb/xkbPrKeyEv.c + Xi/extinit.c + Xi/grabdev.c + Xi/setmode.c + Xi/ungrdev.c + dix/devices.c + dix/events.c + dix/getevents.c + include/dix.h + mi/midispcur.c + mi/misprite.c + xkb/xkbActions.c + xkb/xkbEvents.c + xkb/xkbPrKeyEv.c commit e717409bae355df9a617a226f12fbb8c54ae77e5 Author: Daniel Stone @@ -129964,7 +139989,7 @@ Date: Tue Nov 6 16:26:09 2007 -0500 on the x11perf benchmark. commit aaa50b64113b122aaebd46e3b78e3fb7a8d70500 -Merge: 868e303 ddce48e +Merge: 868e303630 ddce48ede0 Author: Dodji Seketeli Date: Tue Nov 6 16:25:40 2007 +0100 @@ -129991,7 +140016,7 @@ Date: Tue Nov 6 09:40:14 2007 +0000 to subsequent assertion failure in libdbus. commit a52c9b2a59f27266557ff9d5d2c08492e04135a6 -Merge: c7e18be 5833289 +Merge: c7e18beb3c 58332894c0 Author: Eamon Walsh Date: Mon Nov 5 19:08:36 2007 -0500 @@ -129999,12 +140024,12 @@ Date: Mon Nov 5 19:08:36 2007 -0500 Conflicts: - dix/dispatch.c - dix/property.c - hw/xfree86/common/xf86VidMode.c - include/xkbsrv.h - render/glyph.c - xkb/xkbActions.c + dix/dispatch.c + dix/property.c + hw/xfree86/common/xf86VidMode.c + include/xkbsrv.h + render/glyph.c + xkb/xkbActions.c commit 58332894c061ae96d6a457f65266660f5f65e88b Author: Adam Jackson @@ -130019,7 +140044,7 @@ Date: Mon Nov 5 15:01:13 2007 -0500 xselinux: Register SELinux extension protocol names. commit 632c33c5c18b3e091c4fce98280af4d583e99640 -Merge: 4113f04 dda10c9 +Merge: 4113f040c5 dda10c9066 Author: Dodji Seketeli Date: Mon Nov 5 17:52:33 2007 +0100 @@ -130689,7 +140714,7 @@ Date: Thu Oct 25 12:35:01 2007 -0400 xselinux: Label the default device directly with the process context. commit b633d54b94d746d26e13014634d9f63bbb7e8f7d -Merge: 4b05f19 48ca596 +Merge: 4b05f19cb9 48ca5961ca Author: Eamon Walsh Date: Thu Oct 25 12:19:30 2007 -0400 @@ -130697,11 +140722,11 @@ Date: Thu Oct 25 12:19:30 2007 -0400 Conflicts: - GL/glx/glxscreens.c - hw/xnest/Screen.c - render/glyph.c - render/glyphstr.h - render/render.c + GL/glx/glxscreens.c + hw/xnest/Screen.c + render/glyph.c + render/glyphstr.h + render/render.c commit 242f56f722243938e908d1957781ee53c2999783 Author: Naoki Hamada @@ -130891,7 +140916,7 @@ Date: Fri Oct 19 16:34:54 2007 -0700 they should be. commit a3a95d3475dc91ed2e8a55bf484a6b3f2b5ac32a -Merge: a358b87 7e1cada +Merge: a358b87f45 7e1cada6c6 Author: Eric Anholt Date: Fri Oct 19 15:44:17 2007 -0700 @@ -130899,7 +140924,7 @@ Date: Fri Oct 19 15:44:17 2007 -0700 Conflicts: - configure.ac + configure.ac commit 12e889d202ac9849f534c51167cbfed91c32027a Author: Eamon Walsh @@ -131097,7 +141122,7 @@ Date: Wed Oct 17 16:09:40 2007 -0400 Need to merge so this type of thing stops happening. commit c3f7b862550fa8f46633162f83db8c27e46fc672 -Merge: af4dde0 feac075 +Merge: af4dde0ac1 feac075952 Author: Eamon Walsh Date: Wed Oct 17 15:00:54 2007 -0400 @@ -131105,7 +141130,7 @@ Date: Wed Oct 17 15:00:54 2007 -0400 Conflicts: - os/access.c + os/access.c commit af4dde0ac19ecec1d0ad988eb25b15401e7c6b36 Author: Eamon Walsh @@ -131677,7 +141702,7 @@ Date: Sun Oct 14 14:59:12 2007 -0400 Fix GLX byteswapping. commit 927757e1028f45f7fd94b9a2ab35567e0f34b2a8 -Merge: ccda4b6 17ffc34 +Merge: ccda4b66bd 17ffc34ad5 Author: Kristian Høgsberg Date: Fri Oct 12 19:28:39 2007 -0400 @@ -131957,7 +141982,7 @@ Date: Fri Oct 5 12:19:03 2007 +0930 regardless of who is the pairing client. commit 4611f9568cdadf9c00f4b7ca4c77c8c6f07e94f8 -Merge: ab11bad 3549a12 +Merge: ab11bad547 3549a12823 Author: Dodji Seketeli Date: Thu Oct 4 13:07:50 2007 +0200 @@ -131969,8 +141994,8 @@ Date: Thu Oct 4 13:05:29 2007 +0200 Xephyr: remove a potential crasher - * hw/kdrive/ephyr/hostx.c: - (hostx_has_dri): be more defensive. + * hw/kdrive/ephyr/hostx.c: + (hostx_has_dri): be more defensive. commit 06c8977966e76255ce7798f4839ef6e3530264a8 Author: Dodji Seketeli @@ -132014,8 +142039,8 @@ Date: Thu Oct 4 12:06:19 2007 +0200 Xephyr: better compilation without GLX - * hw/kdrive/ephyr/ephyrinit.c: protect GLX related code with GLXEXT - macro + * hw/kdrive/ephyr/ephyrinit.c: protect GLX related code with GLXEXT + macro commit 3549a1282365e69e70c7c2546cfa7d25923cce31 Author: Michel Dänzer @@ -132030,7 +142055,7 @@ Date: Thu Oct 4 11:38:01 2007 +0200 it for them completely. commit 604ebb5a6de372e6a8a96e0ee997db7929126860 -Merge: 1365aef 4ba76a7 +Merge: 1365aeff54 4ba76a7e2b Author: Dodji Seketeli Date: Wed Oct 3 16:13:16 2007 +0200 @@ -132045,49 +142070,49 @@ Date: Wed Oct 3 13:03:34 2007 +0200 We can now launch GL or XV apps in any of the Xephyr screens we want. - * hw/kdrive/ephyr/hostx.c,h: - (hostx_get_window): - (hostx_create_window): make these functions be screen - number aware. - * hw/kdrive/ephyr/XF86dri.c : fix some compiler warnings. - * hw/kdrive/ephyr/ephyrdri.c: - (ephyrDRIQueryDirectRenderingCapable), - (ephyrDRIOpenConnection), - (ephyrDRIAuthConnection), - (ephyrDRICloseConnection), - (ephyrDRIGetClientDriverName), - (ephyrDRICreateContext), - (ephyrDRIDestroyContext), - (ephyrDRICreateDrawable), - (ephyrDRIGetDrawableInfo), - (ephyrDRIGetDeviceInfo): in all those functions, don't forward - the screen number we receive - from the client - to the host X. - We (Xephyr) are always targetting the same X display screen, which is - the one Xephyr got launched against. So we enforce that in the code. - * hw/kdrive/ephyr/ephyrdriext.c: - (EphyrMirrorHostVisuals): make this duplicate the visuals of the host X - default screen into a given Xephyr screen. This way we have a chance - to update the visuals of all Xephyr screen to make them mirror those - of the host X. - (many other places): specify screen number where required by the api - change in hostx.h. - * hw/kdrive/ephyr/ephyrglxext.c: specify screen number where required - by the api change in hostx.h - * hw/kdrive/ephyr/ephyrhostglx.c: don't forward the screen number we - receive - from the client - to the host X. - We (Xephyr) are always targetting the same - X display screen, which is - the one Xephyr got launched against. So we enforce that in the code. - * hw/kdrive/ephyr/ephyrhostvideo.c,h: take in account the screen number received - from the client app. This is useful to know on which Xephyr screen we - need to display video stuff. - * hw/kdrive/ephyr/ephyrvideo.c: update this to reflect the API change - in hw/kdrive/ephyr/ephyrhostvideo.h. - (ephyrSetPortAttribute): when parameters are not valid - - they exceed their validity range - send them to the host anyway - and do not return an error to clients. - Some host expose buggy validity range, so rejecting client for that - is too harsh. + * hw/kdrive/ephyr/hostx.c,h: + (hostx_get_window): + (hostx_create_window): make these functions be screen + number aware. + * hw/kdrive/ephyr/XF86dri.c : fix some compiler warnings. + * hw/kdrive/ephyr/ephyrdri.c: + (ephyrDRIQueryDirectRenderingCapable), + (ephyrDRIOpenConnection), + (ephyrDRIAuthConnection), + (ephyrDRICloseConnection), + (ephyrDRIGetClientDriverName), + (ephyrDRICreateContext), + (ephyrDRIDestroyContext), + (ephyrDRICreateDrawable), + (ephyrDRIGetDrawableInfo), + (ephyrDRIGetDeviceInfo): in all those functions, don't forward + the screen number we receive - from the client - to the host X. + We (Xephyr) are always targetting the same X display screen, which is + the one Xephyr got launched against. So we enforce that in the code. + * hw/kdrive/ephyr/ephyrdriext.c: + (EphyrMirrorHostVisuals): make this duplicate the visuals of the host X + default screen into a given Xephyr screen. This way we have a chance + to update the visuals of all Xephyr screen to make them mirror those + of the host X. + (many other places): specify screen number where required by the api + change in hostx.h. + * hw/kdrive/ephyr/ephyrglxext.c: specify screen number where required + by the api change in hostx.h + * hw/kdrive/ephyr/ephyrhostglx.c: don't forward the screen number we + receive - from the client - to the host X. + We (Xephyr) are always targetting the same + X display screen, which is + the one Xephyr got launched against. So we enforce that in the code. + * hw/kdrive/ephyr/ephyrhostvideo.c,h: take in account the screen number received + from the client app. This is useful to know on which Xephyr screen we + need to display video stuff. + * hw/kdrive/ephyr/ephyrvideo.c: update this to reflect the API change + in hw/kdrive/ephyr/ephyrhostvideo.h. + (ephyrSetPortAttribute): when parameters are not valid + - they exceed their validity range - send them to the host anyway + and do not return an error to clients. + Some host expose buggy validity range, so rejecting client for that + is too harsh. commit ab88cb8d2e7c1410f9ed2be928b38f176b132e11 Author: Peter Hutterer @@ -132168,7 +142193,7 @@ Date: Tue Oct 2 13:13:51 2007 -0700 Also fix incorrect library inclusion by kdrive which broke the build. commit 439edc768eea17667846ce573c843b8377e0dfb4 -Merge: c8ccf46 93ae6fe +Merge: c8ccf469dc 93ae6fe18c Author: Eric Anholt Date: Tue Oct 2 12:14:04 2007 -0700 @@ -132176,8 +142201,8 @@ Date: Tue Oct 2 12:14:04 2007 -0700 Conflicts: - configure.ac - exa/exa_render.c + configure.ac + exa/exa_render.c commit 59cebcd2e9302d15a52588ecafbbc2d2c5ae3a6c Author: Eamon Walsh @@ -132211,9 +142236,9 @@ Date: Wed Sep 19 15:46:09 2007 +0200 Xephyr: glx fixlet - * hw/kdrive/ephyr/ephyrhostglx.c: - (ephyrHostGLXQueryVersion): properly query - the host for its gxl version. + * hw/kdrive/ephyr/ephyrhostglx.c: + (ephyrHostGLXQueryVersion): properly query + the host for its gxl version. commit 6a435b00003fb00930299a0e0810c93afc23a72e Author: Dodji Seketeli @@ -132221,17 +142246,17 @@ Date: Wed Sep 19 15:35:51 2007 +0200 Xephyr: check presence of extensions in host X - * hw/kdrive/ephyr/hostx.c,h: - (hostx_has_xshape), - (hostx_has_glx), - (hostx_has_dri): added these new entry points - * hw/kdrive/ephyr/ephyrdriext.c: - (ephyrDRIExtensionInit): - check presence of DRI and XShape extensions before - trying to use them. - * hw/kdrive/ephyr/ephyrglxext.c: - (ephyrHijackGLXExtension): - check presence of glx extension before we use it. + * hw/kdrive/ephyr/hostx.c,h: + (hostx_has_xshape), + (hostx_has_glx), + (hostx_has_dri): added these new entry points + * hw/kdrive/ephyr/ephyrdriext.c: + (ephyrDRIExtensionInit): + check presence of DRI and XShape extensions before + trying to use them. + * hw/kdrive/ephyr/ephyrglxext.c: + (ephyrHijackGLXExtension): + check presence of glx extension before we use it. commit 2b217fc055300d4c709dd27c4e8ec8166183993b Author: Dodji Seketeli @@ -132245,9 +142270,9 @@ Date: Tue Sep 18 18:41:18 2007 +0200 Xephyr: add -nodri and -noxv switches. - * hw/kdrive/ephyr/ephyr.c,ephyrinit.c:: - add -nodri and -noxv to disable either DRI or XV. - When -nodri, mesa GL (non acceleretated) works. + * hw/kdrive/ephyr/ephyr.c,ephyrinit.c:: + add -nodri and -noxv to disable either DRI or XV. + When -nodri, mesa GL (non acceleretated) works. commit 50674391388b3cfe987782a3ad81b4f240f3db67 Author: Dodji Seketeli @@ -132255,12 +142280,12 @@ Date: Tue Sep 18 18:37:49 2007 +0200 Kdrive: use fbcmap_mi.c instead of fbcmap.c - * hw/kdrive/src/Makefile.am: use fb/fbcmap_mi.c - and not fb/fbcmap.c. This allows kdrive to take advantage of - extensions redefining the entry points of micmap.c stuff. - For instance it allows Xephyr to have a working GL, which is not - possible otherwise, because GL redefines mInitVisualsProc - to initialise its visuals. + * hw/kdrive/src/Makefile.am: use fb/fbcmap_mi.c + and not fb/fbcmap.c. This allows kdrive to take advantage of + extensions redefining the entry points of micmap.c stuff. + For instance it allows Xephyr to have a working GL, which is not + possible otherwise, because GL redefines mInitVisualsProc + to initialise its visuals. commit a5bd536869f646e4024befa84f6e677b990310bc Author: Dodji Seketeli @@ -132281,14 +142306,14 @@ Date: Tue Sep 18 18:22:44 2007 +0200 GLX: allow skipping of visual init wrapping - * GL/glx/glxvisuals.c: added boolean to disable - calling init_visuals(). This gives a chance to Xephyr - to take over visuals manipulation and avoid a crash at - server shutdown in __glXMesaScreenDestroy(), due to the fact - that mesa might sees more visual than what it has actually created in - init_visuals(). It might see more visuals because Xephyr can augment - the number of visuals, dynamically. - * os/utils.c: the boolean is actually defined here. + * GL/glx/glxvisuals.c: added boolean to disable + calling init_visuals(). This gives a chance to Xephyr + to take over visuals manipulation and avoid a crash at + server shutdown in __glXMesaScreenDestroy(), due to the fact + that mesa might sees more visual than what it has actually created in + init_visuals(). It might see more visuals because Xephyr can augment + the number of visuals, dynamically. + * os/utils.c: the boolean is actually defined here. commit ffe9ce6a843443606ad9367eca1645bf5e0635e5 Author: Dodji Seketeli @@ -132296,15 +142321,15 @@ Date: Mon Sep 17 22:13:51 2007 +0200 Xephyr: fix a clipping issue xephyr-dri - * hw/kdrive/ephyr/ephyrdri.c: - (ephyrDRIGetDrawableInfo): force the back clipping rects - to equal the front clipping rects. - * hw/kdrive/ephyr/ephyrdriext.c: - (ProcXF86DRIGetDrawableInfo): properly overclip the clipping rects we - got from the client. This bug fixes a clipping rect that was too - small in height, basically. Also fix a possible mem corruption. - * hw/kdrive/ephyr/hostx.c: - (hostx_set_window_geometry): remove a useless XSync + * hw/kdrive/ephyr/ephyrdri.c: + (ephyrDRIGetDrawableInfo): force the back clipping rects + to equal the front clipping rects. + * hw/kdrive/ephyr/ephyrdriext.c: + (ProcXF86DRIGetDrawableInfo): properly overclip the clipping rects we + got from the client. This bug fixes a clipping rect that was too + small in height, basically. Also fix a possible mem corruption. + * hw/kdrive/ephyr/hostx.c: + (hostx_set_window_geometry): remove a useless XSync commit 79782726617d4b5a4f9b376f21936d035fc870e1 Author: Dodji Seketeli @@ -132324,23 +142349,23 @@ Date: Sat Sep 8 00:33:59 2007 +0200 Xephyr: make accelerated glxgears work in Xephyr - * hw/kdrive/ephyr/ephyr.c: - (ephyrInitialize): cleanup ephyrDRI extension init. - remove functions that belongs in ephyrdriext.c . - * hw/kdrive/ephyr/ephyrdri.c: - (ephyrDRICreateDrawable): create the drawable on the host X peer - window, not on the host xephyr main window. - (ephyrDRIGetDrawableInfo): get drawable info of the host X peer - window. - * hw/kdrive/ephyr/ephyrdriext.c: make ephyr DRI extention wrap - a bunch of screen ops so that it can update the host X peer - window whenever DRI bound drawable are moved in Xephyr. - Also code the building blocks of the management of the - host X window peer. - * hw/kdrive/ephyr/hostx.c,h: - (hostx_create_window): added this new entry point - (hostx_destroy_window): ditto - ()hostx_set_window_geometry): ditto + * hw/kdrive/ephyr/ephyr.c: + (ephyrInitialize): cleanup ephyrDRI extension init. + remove functions that belongs in ephyrdriext.c . + * hw/kdrive/ephyr/ephyrdri.c: + (ephyrDRICreateDrawable): create the drawable on the host X peer + window, not on the host xephyr main window. + (ephyrDRIGetDrawableInfo): get drawable info of the host X peer + window. + * hw/kdrive/ephyr/ephyrdriext.c: make ephyr DRI extention wrap + a bunch of screen ops so that it can update the host X peer + window whenever DRI bound drawable are moved in Xephyr. + Also code the building blocks of the management of the + host X window peer. + * hw/kdrive/ephyr/hostx.c,h: + (hostx_create_window): added this new entry point + (hostx_destroy_window): ditto + ()hostx_set_window_geometry): ditto commit 6d1e44d3d53b451d466d43197be589d0ecc4b9f6 Author: Dodji Seketeli @@ -132348,22 +142373,22 @@ Date: Tue Sep 4 18:28:16 2007 +0200 Xephyr: fix a host X hang. - * hw/kdrive/ephyr/ephyrdri.c: - (ephyrDRIGetDrawableInfo): quickly hook - this into getting the drawable info from the host - X server. For the time being, this only gets the drawable info - of the Xephyr main window in the host. It should really get - the info of a the peer drawable in the host X. So there should be a - peer drawable to begin with. - * hw/kdrive/ephyr/ephyrdriext.c: - (ProcXF86DRIGetDrawableInfo): some cleanups. Properly get the + * hw/kdrive/ephyr/ephyrdri.c: + (ephyrDRIGetDrawableInfo): quickly hook + this into getting the drawable info from the host + X server. For the time being, this only gets the drawable info + of the Xephyr main window in the host. It should really get + the info of a the peer drawable in the host X. So there should be a + peer drawable to begin with. + * hw/kdrive/ephyr/ephyrdriext.c: + (ProcXF86DRIGetDrawableInfo): some cleanups. Properly get the the drawable info otherwise there is a host X hang. - * hw/kdrive/ephyr/ephyrhostglx.c: do not - (ephyrHostGLXQueryVersion): do not use C bindings of the glx protocol - calls. Some of those actually access DRI context directly, resulting - in the context having three clients. Instead all XF86DRI proto - fowarding request should be coded by hand and only forward the - protocol requests + * hw/kdrive/ephyr/ephyrhostglx.c: do not + (ephyrHostGLXQueryVersion): do not use C bindings of the glx protocol + calls. Some of those actually access DRI context directly, resulting + in the context having three clients. Instead all XF86DRI proto + fowarding request should be coded by hand and only forward the + protocol requests commit a39b57d2f784f14e3198c8506f5eb865bacc2440 Author: Dodji Seketeli @@ -132371,7 +142396,7 @@ Date: Fri Aug 31 16:53:18 2007 +0200 Xephyr: add more logging to GLX forwarding - * hw/kdrive/ephyr/ephyrhostglx.c: added more logging. + * hw/kdrive/ephyr/ephyrhostglx.c: added more logging. commit 9e192d2118246ad715e23cf5626a038274eb1eaa Author: Dodji Seketeli @@ -132379,14 +142404,14 @@ Date: Fri Aug 31 14:43:39 2007 +0200 Xephyr: better error handling in GLX forwarding - * hw/kdrive/ephyr/ephyrglxext.c: - fixed various logging functions - (ephyrGLXGetStringReal): make sure all the string is sent to clients - including the ending zero. - * hw/kdrive/ephyr/ephyrhostglx.c: - (ephyrHostGLXGetStringFromServer): better error handling. - (ephyrHostGLXSendClientInfo): ditto. - (ephyrHostGLXMakeCurrent): ditto + * hw/kdrive/ephyr/ephyrglxext.c: + fixed various logging functions + (ephyrGLXGetStringReal): make sure all the string is sent to clients + including the ending zero. + * hw/kdrive/ephyr/ephyrhostglx.c: + (ephyrHostGLXGetStringFromServer): better error handling. + (ephyrHostGLXSendClientInfo): ditto. + (ephyrHostGLXMakeCurrent): ditto commit 4dd4be99df38b70d43b02d9cb19e09e0ed94462b Author: Dodji Seketeli @@ -132394,34 +142419,34 @@ Date: Thu Aug 30 23:54:49 2007 +0200 Xephyr: Make glxinfo work on the ATI R200 free driver. - * hw/kdrive/ephyr/ephyr.c: - (EphyrDuplicateVisual): when duplicating the - visual, copy the color component masks and the class - from the hostX - (EphyrMirrorHostVisuals): don't mix blue and green mask. - * hw/kdrive/ephyr/ephyrdri.c: add more logs. - (ephyrDRICreateDrawable): actually implement this. - for the moment it creates a DRI drawable for the hostX window, - no matter what drawable this call was issued for. - (ephyrDRIGetDrawableInfo): actually implemented this. - for the moment the drawable info queried for its attrs is the - Xephyr main main window. - * hw/kdrive/ephyr/ephyrdriext.c: - (ProcXF86DRIGetDrawableInfo): properly hook this dispatch - function to the ephyrDRIGetDrawableInfo() function. - * hw/kdrive/ephyr/ephyrglxext.c: add a bunch of GLX implementation hooks - here. Hijack some of the xserver GLX hooks with them. Still need to - properly support byteswapped clients though. - * hw/kdrive/ephyr/ephyrhostglx.c,h: actually implemented the protocol - level forwarding functions used by the GLX entr points in - ephyrglxext.c. Here as well, there are a bunch of them, but we are - far from having implemented all the GLX calls. - * hw/kdrive/ephyr/hostx.c,h: - (hostx_get_window_attributes): added this new entry point - (hostx_allocate_resource_id_peer): added this to keep track of - resource IDs peers: one member of the peer is in Xephyr, the other - is in host X. - (hostx_get_resource_id_peer): ditto. + * hw/kdrive/ephyr/ephyr.c: + (EphyrDuplicateVisual): when duplicating the + visual, copy the color component masks and the class + from the hostX + (EphyrMirrorHostVisuals): don't mix blue and green mask. + * hw/kdrive/ephyr/ephyrdri.c: add more logs. + (ephyrDRICreateDrawable): actually implement this. + for the moment it creates a DRI drawable for the hostX window, + no matter what drawable this call was issued for. + (ephyrDRIGetDrawableInfo): actually implemented this. + for the moment the drawable info queried for its attrs is the + Xephyr main main window. + * hw/kdrive/ephyr/ephyrdriext.c: + (ProcXF86DRIGetDrawableInfo): properly hook this dispatch + function to the ephyrDRIGetDrawableInfo() function. + * hw/kdrive/ephyr/ephyrglxext.c: add a bunch of GLX implementation hooks + here. Hijack some of the xserver GLX hooks with them. Still need to + properly support byteswapped clients though. + * hw/kdrive/ephyr/ephyrhostglx.c,h: actually implemented the protocol + level forwarding functions used by the GLX entr points in + ephyrglxext.c. Here as well, there are a bunch of them, but we are + far from having implemented all the GLX calls. + * hw/kdrive/ephyr/hostx.c,h: + (hostx_get_window_attributes): added this new entry point + (hostx_allocate_resource_id_peer): added this to keep track of + resource IDs peers: one member of the peer is in Xephyr, the other + is in host X. + (hostx_get_resource_id_peer): ditto. commit 8c78df0ea36abc7d46c4f59670289f4280f75507 Author: Dodji Seketeli @@ -132429,9 +142454,9 @@ Date: Thu Aug 30 22:31:47 2007 +0200 Xserver: fix potential crash - * dix/extension.c: - (AddExtensionAlias): don't crash when failed to add - extension alias. + * dix/extension.c: + (AddExtensionAlias): don't crash when failed to add + extension alias. commit 024abe825cd702334266f6b8da289907bbd05970 Author: Dodji Seketeli @@ -132445,11 +142470,11 @@ Date: Tue Aug 28 15:58:55 2007 +0200 mirror the visuals of the host X at startup. - * hw/kdrive/ephyr/ephyr.c: make Xephyr mirror - the visuals of the host X upon startup. This - is important for GLX client apps. - * hw/kdrive/ephyr/hostx.c,h: add a hostx_get_visuals_info() - to get the visuals of the host X. + * hw/kdrive/ephyr/ephyr.c: make Xephyr mirror + the visuals of the host X upon startup. This + is important for GLX client apps. + * hw/kdrive/ephyr/hostx.c,h: add a hostx_get_visuals_info() + to get the visuals of the host X. commit 26da625055a3876c93a7a005520657b971748c4e Author: Dodji Seketeli @@ -132457,20 +142482,20 @@ Date: Tue Aug 28 15:55:05 2007 +0200 proxy the glXGetFBConfigSGIX call - * hw/kdrive/ephyr/ephyrglxext.c: - (ephyrGLXGetFBConfigsSGIX): proxy the GLXGetFBConfigsSGIX call. - It is a vendor extension to get the visual configs as a list of - name/value pairs. - (ephyrHijackGLXExtension): hijack the VendorPriv_dispatch_info - dispatch table to register our implementation of GLXGetFBConfigsSGIX - (ephyrGLXGetFBConfigsSGIXReal): added this where the real - implementation of GLXGetFBConfigsSGIX is. It support bytes swapping. - (ephyrGLXGetFBConfigsSGIX,ephyrGLXGetFBConfigsSGIXSwap): these are - the dispatch entry points. They just call - ephyrGLXGetFBConfigsSGIXReal. - * hw/kdrive/ephyr/ephyrhostglx.c,h: reorganize the proxies to get - visual params from the host so that they clearly support the different - methods of doing so. + * hw/kdrive/ephyr/ephyrglxext.c: + (ephyrGLXGetFBConfigsSGIX): proxy the GLXGetFBConfigsSGIX call. + It is a vendor extension to get the visual configs as a list of + name/value pairs. + (ephyrHijackGLXExtension): hijack the VendorPriv_dispatch_info + dispatch table to register our implementation of GLXGetFBConfigsSGIX + (ephyrGLXGetFBConfigsSGIXReal): added this where the real + implementation of GLXGetFBConfigsSGIX is. It support bytes swapping. + (ephyrGLXGetFBConfigsSGIX,ephyrGLXGetFBConfigsSGIXSwap): these are + the dispatch entry points. They just call + ephyrGLXGetFBConfigsSGIXReal. + * hw/kdrive/ephyr/ephyrhostglx.c,h: reorganize the proxies to get + visual params from the host so that they clearly support the different + methods of doing so. commit 5af73f98c46dfe5640185ca90feb20c39c6e06fa Author: Dodji Seketeli @@ -132478,16 +142503,16 @@ Date: Fri Aug 24 16:30:50 2007 +0200 EPHYR: Add an experiment proto proxy extension. - * hw/kdrive/ephyr/Makefile.am: add the proxy extension to - ephyr. The proxy extension is an experimental extension that - forwards protocol packets targeted at a given extension to the - host X. - * hw/kdrive/ephyr/ephyr.c: init proxy ext. - * hw/kdrive/ephyr/ephyrhostproxy.c,h: added this new file as part of the - proxy extension. - * hw/kdrive/ephyr/ephyrproxyext.c,h: ditto - * hw/kdrive/ephyr/hostx.c: add the hostx_get_get_extension_info() entry - point. + * hw/kdrive/ephyr/Makefile.am: add the proxy extension to + ephyr. The proxy extension is an experimental extension that + forwards protocol packets targeted at a given extension to the + host X. + * hw/kdrive/ephyr/ephyr.c: init proxy ext. + * hw/kdrive/ephyr/ephyrhostproxy.c,h: added this new file as part of the + proxy extension. + * hw/kdrive/ephyr/ephyrproxyext.c,h: ditto + * hw/kdrive/ephyr/hostx.c: add the hostx_get_get_extension_info() entry + point. commit c06fa924b4781a35b86e4a78d95ff3e9d95b02d1 Author: Dodji Seketeli @@ -132495,22 +142520,22 @@ Date: Thu Aug 23 11:53:02 2007 +0200 XEPHYR: more GLX/DRI proxying work. - * hw/kdrive/ephyr/XF86dri.c: re format this correctly. - Make function decls honour the Ansi-C standard. - * hw/kdrive/ephyr/ephyr.c: protect glx/dri related - extension initialisation with the XEPHYR_DRI - macro. Initialize the GLX ext hijacking - at startup. - * hw/kdrive/ephyr/ephyrdri.c: add more logging to ease debugging - * hw/kdrive/ephyr/ephyrdriext.c: ditto. reformat. - * hw/kdrive/ephyr/ephyrglxext.c,h: add this extension to - proxy GLX requests to the host X. started to proxy those nedded to - make glxinfo work with fglrx. Not yet finished. - * hw/kdrive/ephyr/ephyrhostglx.c,h: put here the actual - Xlib code used to hit the host X server because Xlib stuff cannot be - mixed with xserver internal code, otherwise compilation erros due to - type clashes happen. So no Xlib type should be exported by the - entrypoints defined here. + * hw/kdrive/ephyr/XF86dri.c: re format this correctly. + Make function decls honour the Ansi-C standard. + * hw/kdrive/ephyr/ephyr.c: protect glx/dri related + extension initialisation with the XEPHYR_DRI + macro. Initialize the GLX ext hijacking + at startup. + * hw/kdrive/ephyr/ephyrdri.c: add more logging to ease debugging + * hw/kdrive/ephyr/ephyrdriext.c: ditto. reformat. + * hw/kdrive/ephyr/ephyrglxext.c,h: add this extension to + proxy GLX requests to the host X. started to proxy those nedded to + make glxinfo work with fglrx. Not yet finished. + * hw/kdrive/ephyr/ephyrhostglx.c,h: put here the actual + Xlib code used to hit the host X server because Xlib stuff cannot be + mixed with xserver internal code, otherwise compilation erros due to + type clashes happen. So no Xlib type should be exported by the + entrypoints defined here. commit 0b8545144975bf7ed43c2564d01c697144eb1244 Author: Dodji Seketeli @@ -132518,14 +142543,14 @@ Date: Thu Aug 16 17:30:13 2007 +0200 Implement ReputImage and StopVideo - * hw/kdrive/ephyr/ephyrhostvideo.c/h: - (ephyrHostXVStopVideo): add this entry point. - * hw/kdrive/ephyr/ephyrvideo.c: - Basically add ReputImage and StopVideo implementations. - Now, when other windows obscur the video window, the reclipping - seems to be well handled using StopVideo and ReputImage. - To do this, I was obliged to save the frame in PutImage, so - that I could resend it un ReputImage. + * hw/kdrive/ephyr/ephyrhostvideo.c/h: + (ephyrHostXVStopVideo): add this entry point. + * hw/kdrive/ephyr/ephyrvideo.c: + Basically add ReputImage and StopVideo implementations. + Now, when other windows obscur the video window, the reclipping + seems to be well handled using StopVideo and ReputImage. + To do this, I was obliged to save the frame in PutImage, so + that I could resend it un ReputImage. commit 810dc55866d1c2343512354646c7ab309ea1fad2 Author: Dodji Seketeli @@ -132533,8 +142558,8 @@ Date: Thu Aug 16 17:11:22 2007 +0200 Ephyr-Xv: add a new line to a log - * hw/kdrive/ephyr/ephyrvideo.c: - (ephyrQueryImageAttributes): add newline to log. + * hw/kdrive/ephyr/ephyrvideo.c: + (ephyrQueryImageAttributes): add newline to log. commit 47e6dff89e48249828e828502e98951eee7f85bc Author: Dodji Seketeli @@ -132542,11 +142567,11 @@ Date: Thu Aug 16 17:07:36 2007 +0200 Xephyr-Xv: fix a crash when host X support several ports - * hw/kdrive/ephyr/ephyrvideo.c: - (ephyrXVPrivQueryHostAdaptors): properly set - port private luke. This fixes a crash when - the host Xv supports multiple ports. - Make sure number of ports cannot be zero. + * hw/kdrive/ephyr/ephyrvideo.c: + (ephyrXVPrivQueryHostAdaptors): properly set + port private luke. This fixes a crash when + the host Xv supports multiple ports. + Make sure number of ports cannot be zero. commit a38ad562a6f50e9d76a37917b936035215ea460e Author: Dodji Seketeli @@ -132554,15 +142579,15 @@ Date: Wed Aug 15 19:40:10 2007 +0200 make xephyr talk DRI protocol with hostX - * configure.ac,include/dix-config.h.in: define the XEPHYR_DRI macro. - define it when --enable-xephyr and --enable-dri are both turned on. - * hw/kdrive/ephyr/XF86dri.c: copy this from mesa source to enable - Xephyr to talk DRI protocol the host X. In mesa, this is used by libGL.so to - talk DRI protocol with the server. - * hw/kdrive/ephyr/ephyr.c: finally initialise the DRI extension - in the ephyrInitScreen() function. - * hw/kdrive/ephyr/ephyrdri.c,ephyrdriext.c: safeguard the compilation - using the XEPHYR_DRI macro. + * configure.ac,include/dix-config.h.in: define the XEPHYR_DRI macro. + define it when --enable-xephyr and --enable-dri are both turned on. + * hw/kdrive/ephyr/XF86dri.c: copy this from mesa source to enable + Xephyr to talk DRI protocol the host X. In mesa, this is used by libGL.so to + talk DRI protocol with the server. + * hw/kdrive/ephyr/ephyr.c: finally initialise the DRI extension + in the ephyrInitScreen() function. + * hw/kdrive/ephyr/ephyrdri.c,ephyrdriext.c: safeguard the compilation + using the XEPHYR_DRI macro. commit e4239a48075c77e6a8d2d5cb21f58dd67687482f Author: Dodji Seketeli @@ -132570,16 +142595,16 @@ Date: Tue Aug 14 22:48:41 2007 +0200 Initial dri forwarding big bricks. - * hw/kdrive/ephyr/ephyrdriext.c: added this to implement a DRI extension - into Xephyr. Normally the DRI extension is only present in the - xfree86 server, but I have ported it to Xephyr. The extension calls - functions that declared/defined in ephyrdri.h ephyrdri.c that - forwards the DRI calls to the host X. It does not work yet, as this - entry is just to put the big bricks in place. - * hw/kdrive/ephyr/ephyrdri.c,h: declaration & definition of the - DRI client API that would hit the hostX server. - * hw/kdrive/ephyr/GL/internal/dri_interface.h: added this, otherwise - inclusion of /usr/include/X11/dri/xf86dri.h won't compile + * hw/kdrive/ephyr/ephyrdriext.c: added this to implement a DRI extension + into Xephyr. Normally the DRI extension is only present in the + xfree86 server, but I have ported it to Xephyr. The extension calls + functions that declared/defined in ephyrdri.h ephyrdri.c that + forwards the DRI calls to the host X. It does not work yet, as this + entry is just to put the big bricks in place. + * hw/kdrive/ephyr/ephyrdri.c,h: declaration & definition of the + DRI client API that would hit the hostX server. + * hw/kdrive/ephyr/GL/internal/dri_interface.h: added this, otherwise + inclusion of /usr/include/X11/dri/xf86dri.h won't compile commit e01d3dd98d1b596e75d25f94dd89c7d41223011d Author: Dodji Seketeli @@ -132587,13 +142612,13 @@ Date: Thu Aug 9 10:55:10 2007 +0200 Support clipping region in PutImage. - * hw/kdrive/ephyr/ephyrhostvideo.c,h: - (ephyrHostXVPutImage): make this support clipping region. - The clipping region is propagated to host using XSetClipRectangles. - This changes the API of ephyrHostXVPutImage. - * hw/kdrive/ephyr/ephyrvideo.c: - (ephyrPutImage): propagate the clipping region to the new - ephyrHostXVPutImage() entry point. + * hw/kdrive/ephyr/ephyrhostvideo.c,h: + (ephyrHostXVPutImage): make this support clipping region. + The clipping region is propagated to host using XSetClipRectangles. + This changes the API of ephyrHostXVPutImage. + * hw/kdrive/ephyr/ephyrvideo.c: + (ephyrPutImage): propagate the clipping region to the new + ephyrHostXVPutImage() entry point. commit 39d3895469f07304d72800d8dcef6c7732f13d5f Author: Dodji Seketeli @@ -132601,10 +142626,10 @@ Date: Wed Aug 8 14:27:32 2007 +0200 make EphyrXVPriv be a singleton - * hw/kdrive/ephyr/ephyrvideo.c: - (ephyrInitVideo) make the EphyrXVPriv object be a - singleton instance, otherwise a new object is created at each - generation. + * hw/kdrive/ephyr/ephyrvideo.c: + (ephyrInitVideo) make the EphyrXVPriv object be a + singleton instance, otherwise a new object is created at each + generation. commit 4ed083095a13ec92bb4c8e705f26500f8312c138 Author: Dodji Seketeli @@ -132612,21 +142637,21 @@ Date: Tue Aug 7 14:16:13 2007 +0200 add [Get/Put]Video and [Get/Put]Still support - * hw/kdrive/ephyr/ephyrhostvideo.c,h: - (ephyrHostXVAdaptorHasXXX): fix these. - (ephyrHostXVAdaptorHasGetVideo): added this - (ephyrHostXVAdaptorHasGetStill): ditto - (ephyrHostXVPutVideo): added this - (ephyrHostXVGetVideo): ditto - (ephyrHostXVPutStill): ditto - (ephyrHostXVGetStill): ditto - * hw/kdrive/ephyr/ephyrvideo.c: - (ephyrPutVideo): implement this - (ephyrGetVideo): ditto - (ephyrPutStill): ditto - (ephyrGetStill): ditto - (ephyrXVPrivSetAdaptorsHooks): advertise GetVideo and GetStill - when the host X supports it. + * hw/kdrive/ephyr/ephyrhostvideo.c,h: + (ephyrHostXVAdaptorHasXXX): fix these. + (ephyrHostXVAdaptorHasGetVideo): added this + (ephyrHostXVAdaptorHasGetStill): ditto + (ephyrHostXVPutVideo): added this + (ephyrHostXVGetVideo): ditto + (ephyrHostXVPutStill): ditto + (ephyrHostXVGetStill): ditto + * hw/kdrive/ephyr/ephyrvideo.c: + (ephyrPutVideo): implement this + (ephyrGetVideo): ditto + (ephyrPutStill): ditto + (ephyrGetStill): ditto + (ephyrXVPrivSetAdaptorsHooks): advertise GetVideo and GetStill + when the host X supports it. commit 6f7961bc218169aaa0d10cfad0952adb7fac2f00 Author: Dodji Seketeli @@ -132799,21 +142824,21 @@ Date: Tue Oct 2 13:25:51 2007 +0200 Xephyr: add "multiscreen" suport - * This patch adds multiscreen support to Xephyr. For instance, - the command line : "Xephyr :4 -ac -screen 320x240 -screen 640x480" - will launch with two "screens" - namely two main windows. - The first main window represents a screen that has the number :4.0, with - a geometry of 320x240 pixels, and the second one represents a screen - that has the number :4.1 with a geometry of 640x480. - The command line: "DISPLAY=:4.1 xclock" will launch the xclock program - on the second screen, for intance. + * This patch adds multiscreen support to Xephyr. For instance, + the command line : "Xephyr :4 -ac -screen 320x240 -screen 640x480" + will launch with two "screens" - namely two main windows. + The first main window represents a screen that has the number :4.0, with + a geometry of 320x240 pixels, and the second one represents a screen + that has the number :4.1 with a geometry of 640x480. + The command line: "DISPLAY=:4.1 xclock" will launch the xclock program + on the second screen, for intance. - * this patch was edited by Dodji Seketeli for: - - better style compliance with the rest of the Xephyr code - - make sure Xephyr could be launched with no -screen option. By - default that creates a default screen of 640x480 pixel like before - - display full titles on the windows - with insctructions to grab - keyboard and mouse - like before. + * this patch was edited by Dodji Seketeli for: + - better style compliance with the rest of the Xephyr code + - make sure Xephyr could be launched with no -screen option. By + default that creates a default screen of 640x480 pixel like before + - display full titles on the windows - with insctructions to grab + keyboard and mouse - like before. commit 81692b628f41cb64329f3cccc0503fb216a2b8e3 Author: Dodji Seketeli @@ -132821,12 +142846,12 @@ Date: Tue Oct 2 13:11:28 2007 +0200 Fix #12650: "windows not receiving mouse events in multiple screens context" - * dix/events.c, include/dix.h: - (UpdateSpriteForScreen): added this to update the mouse sprite context - when we switch from a pScreen to another. - * mi/mipointer.c: - (miPointerWarpCursor): as we are switching to a new pScreen, - don't forget to update the mouse sprite context. + * dix/events.c, include/dix.h: + (UpdateSpriteForScreen): added this to update the mouse sprite context + when we switch from a pScreen to another. + * mi/mipointer.c: + (miPointerWarpCursor): as we are switching to a new pScreen, + don't forget to update the mouse sprite context. commit f965a5f3454a95ddffb2faf9b291feff46305adf Author: Peter Hutterer @@ -133101,7 +143126,7 @@ Date: Thu Sep 27 11:44:03 2007 +0930 This is hopefully better than hardcodey calling CoreProcessPointerEvent. commit 27612748e0ec20f3a23839f0a12e39f598dd722c -Merge: b614614 3b114f2 +Merge: b61461425e 3b114f2603 Author: Eamon Walsh Date: Wed Sep 26 07:47:29 2007 -0400 @@ -133109,7 +143134,7 @@ Date: Wed Sep 26 07:47:29 2007 -0400 Conflicts: - dix/devices.c + dix/devices.c commit 3b114f2603fc2adeec7f5f8f20fe4870afb8dff1 Author: Eamon Walsh @@ -133137,9 +143162,9 @@ Date: Wed Sep 26 15:26:42 2007 +0200 Xephyr: fix compiler warnings - * hw/kdrive/ephyr/ephyr_draw.c: - (ephyrDownloadFromScreen), - (ephyrUploadToScreen): fix compiler warnings + * hw/kdrive/ephyr/ephyr_draw.c: + (ephyrDownloadFromScreen), + (ephyrUploadToScreen): fix compiler warnings commit 8f9bf927e1beecf9b9ec8877131ec12c765e4d84 Author: Peter Hutterer @@ -133522,7 +143547,7 @@ Date: Wed Sep 19 04:46:10 2007 -0700 hey -- you have to start somewhere. ;) commit 97c150b61bbe436453b05d3c07cd2173870aac40 -Merge: 57907e0 547ad21 +Merge: 57907e0943 547ad2125e Author: Eamon Walsh Date: Wed Sep 19 07:25:55 2007 -0400 @@ -133530,24 +143555,24 @@ Date: Wed Sep 19 07:25:55 2007 -0400 Conflicts: - afb/afbpntwin.c - afb/afbscrinit.c - afb/afbwindow.c - cfb/cfb.h - cfb/cfballpriv.c - cfb/cfbscrinit.c - cfb/cfbwindow.c - configure.ac - fb/wfbrename.h - hw/xfree86/xf4bpp/ppcIO.c - hw/xfree86/xf4bpp/ppcPntWin.c - hw/xfree86/xf4bpp/ppcWindow.c - hw/xfree86/xf8_32bpp/cfbscrinit.c - mfb/mfb.h - mfb/mfbpntwin.c - mfb/mfbscrinit.c - mfb/mfbwindow.c - mi/miexpose.c + afb/afbpntwin.c + afb/afbscrinit.c + afb/afbwindow.c + cfb/cfb.h + cfb/cfballpriv.c + cfb/cfbscrinit.c + cfb/cfbwindow.c + configure.ac + fb/wfbrename.h + hw/xfree86/xf4bpp/ppcIO.c + hw/xfree86/xf4bpp/ppcPntWin.c + hw/xfree86/xf4bpp/ppcWindow.c + hw/xfree86/xf8_32bpp/cfbscrinit.c + mfb/mfb.h + mfb/mfbpntwin.c + mfb/mfbscrinit.c + mfb/mfbwindow.c + mi/miexpose.c Note: conflicts caused by devPrivates rework vs. paintwindow changes. @@ -133647,7 +143672,7 @@ Date: Sat Sep 15 14:01:57 2007 +0200 Initialize output->pendingProperties. commit b9f7aeb20015290a8acf938a11bf9272bf3527cf -Merge: e4d11e5 06d27f8 +Merge: e4d11e58ce 06d27f8045 Author: Eric Anholt Date: Thu Sep 13 00:15:45 2007 +0000 @@ -133655,7 +143680,7 @@ Date: Thu Sep 13 00:15:45 2007 +0000 Conflicts: - mi/miexpose.c + mi/miexpose.c commit e4d11e58ce349dfe6af2f73ff341317f9b39684c Author: Eric Anholt @@ -134061,7 +144086,7 @@ Date: Wed Sep 5 17:46:23 2007 -0700 broken uses. commit e332335241af28ef0ab66b102d0cbc4e5c73ac68 -Merge: 7381e91 accd71b +Merge: 7381e9149e accd71bda6 Author: Ben Byer Date: Wed Sep 5 15:51:23 2007 -0700 @@ -134106,7 +144131,7 @@ Date: Wed Sep 5 14:31:01 2007 -0700 so it doesn't make sense to require it when building on OSX/Darwin. commit ff01e44e33fd072958fb0157dae072f1b1c88944 -Merge: 8ba8c16 47300ed +Merge: 8ba8c16af7 47300ed2be Author: Ben Byer Date: Wed Sep 5 13:56:08 2007 -0700 @@ -134256,7 +144281,7 @@ Date: Tue Sep 4 14:49:49 2007 -0700 Revert part of 529acb175440969af9d7fa38aab8d7dea0dc2661 because libtool is smart. commit bf5948518763b5e21eff806a0a9abc5f7757fa10 -Merge: 4062db4 735da3d +Merge: 4062db4020 735da3dcd0 Author: Matthieu Herrb Date: Tue Sep 4 22:40:31 2007 +0200 @@ -134572,7 +144597,7 @@ Date: Tue Aug 28 09:28:25 2007 -0400 FontRec privates. commit 85547073265ae9bc4ae3af920a6d3214fd1ca0c5 -Merge: 860a09c 7d54399 +Merge: 860a09cfb8 7d54399cfd Author: Eamon Walsh Date: Tue Aug 28 07:25:21 2007 -0400 @@ -134580,10 +144605,10 @@ Date: Tue Aug 28 07:25:21 2007 -0400 Conflicts: - include/miscstruct.h - mi/mibstore.c - mi/midispcur.c - os/Makefile.am + include/miscstruct.h + mi/mibstore.c + mi/midispcur.c + os/Makefile.am commit 3fe67d23edaae3ddde20cd5f349aa5dfde1d26a3 Author: Eric Anholt @@ -134672,7 +144697,7 @@ Date: Fri Aug 24 16:00:31 2007 -0700 Bump video driver ABI for pci-rework. commit 91f358336f77c0e4f577be65cca977d17298e36c -Merge: b9a806f 8b6b40b +Merge: b9a806f0b3 8b6b40b727 Author: Ian Romanick Date: Fri Aug 24 15:04:21 2007 -0700 @@ -134726,7 +144751,7 @@ Date: Fri Aug 24 13:04:48 2007 +0200 case. commit 8b6b40b7271acd81a9548f502c18f46f3b640640 -Merge: ab7a6d8 3305d17 +Merge: ab7a6d860d 3305d17195 Author: Ian Romanick Date: Thu Aug 23 18:19:17 2007 -0700 @@ -134734,16 +144759,16 @@ Date: Thu Aug 23 18:19:17 2007 -0700 Conflicts: - hw/xfree86/common/xf86.h - hw/xfree86/common/xf86Init.c - hw/xfree86/common/xf86pciBus.c - hw/xfree86/int10/generic.c - hw/xfree86/int10/helper_exec.c - hw/xfree86/loader/xf86sym.c - hw/xfree86/os-support/bus/Pci.c - hw/xfree86/os-support/bus/Pci.h - hw/xfree86/os-support/bus/linuxPci.c - hw/xfree86/os-support/linux/int10/linux.c + hw/xfree86/common/xf86.h + hw/xfree86/common/xf86Init.c + hw/xfree86/common/xf86pciBus.c + hw/xfree86/int10/generic.c + hw/xfree86/int10/helper_exec.c + hw/xfree86/loader/xf86sym.c + hw/xfree86/os-support/bus/Pci.c + hw/xfree86/os-support/bus/Pci.h + hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/os-support/linux/int10/linux.c commit 93ae6fe18c417a22f1fccb22add4890a20cae713 Author: Carl Worth @@ -134863,7 +144888,7 @@ Date: Wed Aug 22 16:54:29 2007 +0100 Fix include to commit b6a7c0112c42a3287e53647c38b2c0c5bf8fefa0 -Merge: 53941c8 6ef4ecd +Merge: 53941c8e68 6ef4ecd826 Author: Søren Sandmann Pedersen Date: Tue Aug 21 14:26:34 2007 -0400 @@ -135175,7 +145200,7 @@ Date: Mon Aug 13 10:43:48 2007 -0400 current interface. commit f367285fd5825e0adc271982a529c9904ad65c89 -Merge: b1272ee ff4bd3a +Merge: b1272eefd9 ff4bd3addb Author: Peter Hutterer Date: Sun Aug 12 15:31:10 2007 +0930 @@ -135183,11 +145208,11 @@ Date: Sun Aug 12 15:31:10 2007 +0930 Conflicts: - Xi/exevents.c - dix/devices.c - dix/getevents.c - include/dix.h - mi/mieq.c + Xi/exevents.c + dix/devices.c + dix/getevents.c + include/dix.h + mi/mieq.c commit 03f9da672466b9ab9a9814d784b8c44f1030587e Author: Samuel Thibault @@ -135550,7 +145575,7 @@ Date: Wed Jul 25 14:57:13 2007 -0700 ProcRenderAddGlyphs: Convert while loops to for loops where more natural commit e34fcd2bf42dbd72ab6ce2df80f2dcaa13416e74 -Merge: 32c0dcc f3955c0 +Merge: 32c0dcc8c0 f3955c0a02 Author: Eamon Walsh Date: Thu Aug 2 14:27:03 2007 -0400 @@ -135558,9 +145583,9 @@ Date: Thu Aug 2 14:27:03 2007 -0400 Conflicts: - dix/devices.c - dix/property.c - include/dix.h + dix/devices.c + dix/property.c + include/dix.h commit f3955c0a020b39021050cd33c20a17f14fc4b579 Author: Arkadiusz Miskiewicz @@ -135743,7 +145768,7 @@ Date: Mon Apr 30 11:37:46 2007 -0400 find -name '*.c' -o -name '*.h' | xargs gvim egrep -Rli "permission|copyright" * | grep -v "\.[ch]" \ - | grep -v "\.in$" | xargs gvim + | grep -v "\.in$" | xargs gvim cd .. tar xvjf /usr/portage/distfiles/xorg-server-1.3.0.0.tar.bz2 @@ -136724,7 +146749,7 @@ Date: Tue Jun 19 18:20:05 2007 +0930 Conflicts: - Xi/exevents.c + Xi/exevents.c commit 24ee89fd60f489f2d3af0399e0d667057df74d02 Author: Peter Hutterer @@ -136858,7 +146883,7 @@ Date: Wed Jun 20 18:42:00 2007 +0200 can't actually occur when swapped out. commit 1f97a7647606226cde61d6ad7a94f2b0b571a06c -Merge: 5dee64f 2e7fef7 +Merge: 5dee64fc99 2e7fef7d08 Author: Peter Hutterer Date: Tue Jun 19 17:20:52 2007 +0930 @@ -136866,10 +146891,10 @@ Date: Tue Jun 19 17:20:52 2007 +0930 Conflicts: - dix/devices.c - hw/xfree86/common/xf86Xinput.c - hw/xfree86/loader/xf86sym.c - mi/mieq.c + dix/devices.c + hw/xfree86/common/xf86Xinput.c + hw/xfree86/loader/xf86sym.c + mi/mieq.c commit 40f27a2df4906d9ceb1c78f6163a62c497321535 Author: Michel Dänzer @@ -136900,7 +146925,7 @@ Date: Tue Jun 19 11:28:07 2007 +0930 device to interact, so this seems like a reasonable solution. commit ab7a6d860d4a275a810a64b1ba7b13726ed10575 -Merge: e9130b8 2e7fef7 +Merge: e9130b8bac 2e7fef7d08 Author: Ian Romanick Date: Mon Jun 18 16:51:13 2007 -0700 @@ -136908,8 +146933,8 @@ Date: Mon Jun 18 16:51:13 2007 -0700 Conflicts: - hw/xfree86/os-support/bus/Pci.c - hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/os-support/bus/Pci.c + hw/xfree86/os-support/bus/linuxPci.c commit 2e7fef7d0837939e822c40b6ac77e7f0e66d57bd Author: Adam Jackson @@ -136982,7 +147007,7 @@ Date: Mon Jun 11 21:25:42 2007 -0400 Delete fbBltmmx(). commit e2a720c9a17dc860ee0a858c2b21fd71e86cdcd0 -Merge: 878cac7 3f9adb1 +Merge: 878cac71aa 3f9adb18f1 Author: Eamon Walsh Date: Mon Jun 11 15:29:11 2007 -0400 @@ -136990,7 +147015,7 @@ Date: Mon Jun 11 15:29:11 2007 -0400 Conflicts: - dix/dixutils.c + dix/dixutils.c commit 3f9adb18f127318d054f30a57e3a77176e14c692 Author: Søren Sandmann Pedersen @@ -137306,7 +147331,7 @@ Date: Tue May 29 14:54:27 2007 -0600 Remove wscons keyboard handling stuff that doesn't belong there anymore. commit 60de6c7ef9bdcee043f63e8e0d493e6feba6a9d0 -Merge: 3a6549a 2f13b7c +Merge: 3a6549a163 2f13b7c113 Author: Matthieu Herrb Date: Tue May 29 12:14:49 2007 -0600 @@ -137479,7 +147504,7 @@ Date: Wed May 23 12:56:04 2007 -0400 Add missing offsets for window coordinates - reported by Colin Harrison commit 2a4aa63a23ddd816b647b851a01865861827a7eb -Merge: 9cee4ec cc648e6 +Merge: 9cee4ec5e6 cc648e609d Author: Eamon Walsh Date: Tue May 22 14:50:26 2007 -0400 @@ -137487,7 +147512,7 @@ Date: Tue May 22 14:50:26 2007 -0400 Conflicts: - include/miscstruct.h + include/miscstruct.h commit cc648e609d472472bac4a2e568eb3598b3690ba3 Author: Michel Dänzer @@ -137732,7 +147757,7 @@ Date: Tue May 15 10:24:22 2007 +0930 Conflicts: - dix/events.c + dix/events.c commit 81fc6a128b64ad412064405ed45db0175398e3f0 Author: Peter Hutterer @@ -138030,7 +148055,7 @@ Date: Mon Apr 30 10:33:12 2007 -0600 fix __glXErrorCallBack() proto commit 6b33459bf5aac23c3ecc7002d091c02f327d907a -Merge: 18252a5 3c91a99 +Merge: 18252a515d 3c91a993e8 Author: Brian Date: Mon Apr 30 10:26:19 2007 -0600 @@ -138218,7 +148243,7 @@ Date: Fri Apr 27 08:13:08 2007 -0400 are both 0. commit f28eea0647f007c2e2415ecc6fceef46201faad4 -Merge: 339b73e ae04f2c +Merge: 339b73e710 ae04f2cb0a Author: Peter Hutterer Date: Fri Apr 27 16:34:36 2007 +0930 @@ -138226,8 +148251,8 @@ Date: Fri Apr 27 16:34:36 2007 +0930 Conflicts: - dix/devices.c - dix/events.c + dix/devices.c + dix/events.c commit 339b73e710a0920608a3fbcb20b406f0f6c4e0f6 Author: Peter Hutterer @@ -138749,7 +148774,7 @@ Date: Tue Apr 17 13:46:55 2007 -0400 security: remove debugging code. commit 1f06d32ef58749d0f0c062193d237ee98f60e90f -Merge: cf962a8 fc162c6 +Merge: cf962a849d fc162c6cfa Author: Eamon Walsh Date: Tue Apr 17 12:10:22 2007 -0400 @@ -138757,7 +148782,7 @@ Date: Tue Apr 17 12:10:22 2007 -0400 Conflicts: - dix/privates.c + dix/privates.c commit b6aec7f6f906a18d13586d63afabf1ee4fbb11c3 Author: Peter Hutterer @@ -138920,7 +148945,7 @@ Date: Thu Apr 12 11:16:19 2007 +0930 This workaround is obsolete with 33a5d9605e3e282f6aa1921d7321a2a12ef02c42 commit d4dad6f84f82a4ade5005c3aa93511c1295875b8 -Merge: f1f8b56 33a5d96 +Merge: f1f8b562aa 33a5d9605e Author: Peter Hutterer Date: Thu Apr 12 11:11:03 2007 +0930 @@ -138928,9 +148953,9 @@ Date: Thu Apr 12 11:11:03 2007 +0930 Conflicts: - configure.ac - dix/events.c - hw/xfree86/common/xf86Xinput.c + configure.ac + dix/events.c + hw/xfree86/common/xf86Xinput.c commit 33a5d9605e3e282f6aa1921d7321a2a12ef02c42 Author: Daniel Stone @@ -139174,7 +149199,7 @@ Date: Fri Apr 6 13:38:12 2007 +0300 GLcore: fix after moving xf86glx_util.[hc] to Mesa. commit cf962a849db2b259ca558c6265ea7e3328a4d312 -Merge: 5ad5625 5a804f2 +Merge: 5ad562565a 5a804f2e97 Author: Eamon Walsh Date: Thu Apr 5 14:41:39 2007 -0400 @@ -139182,7 +149207,7 @@ Date: Thu Apr 5 14:41:39 2007 -0400 Conflicts: - configure.ac + configure.ac commit 5ad562565ac8ef9257da3afb0de1ae4f90f80fe9 Author: Eamon Walsh @@ -139320,7 +149345,7 @@ Date: Tue Apr 3 09:27:57 2007 -0600 about setting the XFree86Server symbol. commit 1cc8db72816cd079f30255046e10043c350bf683 -Merge: 645d87c a39f297 +Merge: 645d87cf8e a39f297ada Author: Matthieu Herrb Date: Tue Apr 3 16:04:45 2007 +0200 @@ -139339,7 +149364,7 @@ Date: Tue Apr 3 19:02:14 2007 +0930 Delete all grabs from all devices when deleting a window. commit 5f382c9c7fbda6eccf8e76c28a90b55ff2f0aef3 -Merge: 9b0b340 f09ee16 +Merge: 9b0b340668 f09ee168e2 Author: Peter Hutterer Date: Tue Apr 3 15:07:18 2007 +0930 @@ -139459,7 +149484,7 @@ Date: Mon Apr 2 12:26:27 2007 -0600 formatting fixes commit e8777a91f37d828b9df839bf3d9cf2f954bdddb0 -Merge: a120547 96ce17a +Merge: a12054757d 96ce17aa94 Author: Peter Hutterer Date: Mon Apr 2 15:36:26 2007 +0930 @@ -139467,14 +149492,14 @@ Date: Mon Apr 2 15:36:26 2007 +0930 Conflicts: - Xi/closedev.c - Xi/exevents.c - Xi/extinit.c - Xi/listdev.c - dix/window.c - hw/xfree86/common/xf86Xinput.c - include/extinit.h - mi/mipointer.c + Xi/closedev.c + Xi/exevents.c + Xi/extinit.c + Xi/listdev.c + dix/window.c + hw/xfree86/common/xf86Xinput.c + include/extinit.h + mi/mipointer.c commit 96ce17aa94413c4b8bcb61cae71167050130a307 Author: Peter Hutterer @@ -139524,7 +149549,7 @@ Date: Fri Mar 30 16:05:46 2007 -0600 values of 1280 (my screen width). commit e9130b8bac73a0843d5ff6b2216eccfb3e094a48 -Merge: 2c6d471 92e8cdb +Merge: 2c6d471088 92e8cdbd32 Author: Ian Romanick Date: Fri Mar 30 13:39:15 2007 -0700 @@ -139661,7 +149686,7 @@ Date: Wed Mar 28 12:57:11 2007 -0400 xace: provide creation-time resource hook call in CreateWindow(). commit 99b220969f2f8ba829bc8294b27ca90fd9311be4 -Merge: 728ad64 82a8b99 +Merge: 728ad64d97 82a8b99a6c Author: Eamon Walsh Date: Wed Mar 28 12:54:04 2007 -0400 @@ -139674,7 +149699,7 @@ Date: Wed Mar 28 12:03:19 2007 -0400 Refuse to create tiny modes from EDID detailed timing. commit 2c6d47108880584f1221ff86c6c8947627f9f607 -Merge: c4fe1bc 8522044 +Merge: c4fe1bcce1 8522044635 Author: Ian Romanick Date: Wed Mar 28 08:08:04 2007 -0700 @@ -139682,8 +149707,8 @@ Date: Wed Mar 28 08:08:04 2007 -0700 Conflicts: - hw/xfree86/Makefile.am - hw/xfree86/dri/dri.c + hw/xfree86/Makefile.am + hw/xfree86/dri/dri.c commit 85220446359a75ea2c359b418b4051c04eea739c Author: Daniel Stone @@ -139744,7 +149769,7 @@ Date: Mon Mar 26 16:04:50 2007 -0700 Fix indentation of fakexa help text. commit 728ad64d979fd9e5cca28e8c15118c18d707c431 -Merge: 0331c6a 6a0bed1 +Merge: 0331c6a8fc 6a0bed16e8 Author: Eamon Walsh Date: Tue Mar 27 13:16:40 2007 -0400 @@ -139781,7 +149806,7 @@ Date: Mon Mar 26 12:44:58 2007 -0700 Update xorg.conf manpage for new RandR 1.2 monitor options. commit 0331c6a8fcba1dc27ef45aaf5f694799d0085413 -Merge: 84a066c f7c5aa0 +Merge: 84a066cc88 f7c5aa0dc0 Author: Eamon Walsh Date: Mon Mar 26 10:28:05 2007 -0400 @@ -139902,8 +149927,8 @@ Date: Fri Mar 23 23:41:36 2007 -0700 Conflicts: - randr/randrstr.h - randr/rrcrtc.c + randr/randrstr.h + randr/rrcrtc.c I think master and server-1.3-branch are more in sync now. @@ -140146,7 +150171,7 @@ Date: Mon Mar 19 16:11:01 2007 +1030 by the evdev driver). commit 015d728bcde5b16a72a976579755421e3023626b -Merge: 65b0eb6 b167583 +Merge: 65b0eb60b0 b167583fe2 Author: Peter Hutterer Date: Mon Mar 19 09:42:56 2007 +1030 @@ -140154,9 +150179,9 @@ Date: Mon Mar 19 09:42:56 2007 +1030 Conflicts: - dix/devices.c - dix/events.c - mi/misprite.c + dix/devices.c + dix/events.c + mi/misprite.c commit 720f302d241e88e6e9f2962207da1aa9a79728b7 Author: Keith Packard @@ -140224,7 +150249,7 @@ Date: Sun Feb 18 23:49:38 2007 -0800 Conflicts: - randr/randrstr.h + randr/randrstr.h Updated code to work in master with recent security API changes. @@ -140453,7 +150478,7 @@ Date: Wed Mar 7 09:57:02 2007 -0500 devPrivates rework: move reset functions into a single call. commit bb111291d854b4329e47367ce3c67e8a2785e6e9 -Merge: 74175e0 e9bfb2b +Merge: 74175e0af7 e9bfb2b3d7 Author: Eamon Walsh Date: Wed Mar 7 09:03:46 2007 -0500 @@ -140525,7 +150550,7 @@ Date: Tue Mar 6 11:09:30 2007 -0800 updated todo list commit 81d581e655fc989da3be4256b83849a63b8607b7 -Merge: a05ffca d5aba03 +Merge: a05ffca8dd d5aba03fef Author: Ben Byer Date: Tue Mar 6 10:37:29 2007 -0800 @@ -140556,7 +150581,7 @@ Date: Tue Mar 6 02:31:59 2007 -0800 moved new event-handling code from X11Application.m to darwinEvents.c in preparation for making all Darwin servers use it commit 0ccd1443fd6db397b42e5b99ce733ce1316c785e -Merge: ec1ef8a 9b6bb06 +Merge: ec1ef8a56d 9b6bb06f13 Author: Ben Byer Date: Tue Mar 6 01:04:50 2007 -0800 @@ -140631,7 +150656,7 @@ Date: Mon Mar 5 12:34:37 2007 -0500 devPrivates rework: remove some debugging code from dixFreePrivates. commit 23fc429aad5b2721911862617772c314e1036bb0 -Merge: e684824 fe7b8f4 +Merge: e684824709 fe7b8f4237 Author: Eamon Walsh Date: Mon Mar 5 12:18:54 2007 -0500 @@ -140677,7 +150702,7 @@ Date: Mon Feb 26 09:40:00 2007 +1100 modes: add commit/prepare hooks commit 1f0075786fedde538a95e2f39681052e25021d88 -Merge: 57aa5e9 12175b6 +Merge: 57aa5e908d 12175b668a Author: Peter Hutterer Date: Mon Mar 5 12:37:17 2007 +1030 @@ -140685,11 +150710,11 @@ Date: Mon Mar 5 12:37:17 2007 +1030 Conflicts: - configure.ac - dix/getevents.c - hw/xfree86/ramdac/xf86Cursor.c - mi/mipointer.c - xkb/xkbUtils.c + configure.ac + dix/getevents.c + hw/xfree86/ramdac/xf86Cursor.c + mi/mipointer.c + xkb/xkbUtils.c commit 06b01186f6ae17aafdd1f628c306466ddea9e065 Author: Keith Packard @@ -140878,7 +150903,7 @@ Date: Wed Feb 28 15:43:06 2007 +1030 between coordinates stored in device and coordinates sent by the event. commit d9bcb22d199e8444b9762a35754e04d327dd5915 -Merge: 272d934 c16343a +Merge: 272d9341d0 c16343ac2c Author: Ben Byer Date: Tue Feb 27 16:28:20 2007 -0800 @@ -140998,9 +151023,9 @@ commit 4b8b0e377a27ec904b2028c89aed11c6416af26c Author: Peter Hutterer Date: Thu Feb 22 20:00:59 2007 +1030 - Xi: Add access control request handling. + Xi: Add access control request handling. - dix: New file access.c to handle all access control for devices. + dix: New file access.c to handle all access control for devices. commit 9a3eb0357e779d5d5f76858f23667956c4c5d721 Author: Eamon Walsh @@ -141303,14 +151328,14 @@ Date: Thu Feb 15 17:07:42 2007 +0200 http://xorg.freedesktop.org/wiki/XDC2007Notes#head-2719037a1905516c45cf74f0e155c8703221e446 commit f452507ca9209598401d15da0039aaa4e1fed1a3 -Merge: 0463283 8116757 +Merge: 04632835b7 811675733e Author: Eamon Walsh Date: Thu Feb 15 09:47:20 2007 -0500 Merge branch 'master' into my-XACE-SELINUX commit 04632835b7402456fdcf6c8fa01970cd2804e27c -Merge: 88f89b9 9ecf79c +Merge: 88f89b9ac1 9ecf79ca01 Author: Eamon Walsh Date: Thu Feb 15 09:27:05 2007 -0500 @@ -141358,7 +151383,7 @@ Date: Wed Feb 14 17:09:33 2007 +1030 fix: WarpCursor needs to send MotionNotify. commit c4fe1bcce1c1e4822e688959b331b47a051d6e0a -Merge: e540d57 d570ff7 +Merge: e540d572c5 d570ff7c81 Author: Ian Romanick Date: Wed Feb 14 15:39:52 2007 -0800 @@ -141422,7 +151447,7 @@ Date: Mon Feb 12 17:18:29 2007 -0500 Remove spurious LIBADD from xf4bpp commit 16eb7254f861465f988ae3861ac3449c2c966062 -Merge: 3814862 c4b7e9d +Merge: 3814862a86 c4b7e9d1c1 Author: Ian Romanick Date: Fri Feb 9 12:38:49 2007 -0800 @@ -141484,7 +151509,7 @@ Date: Mon Feb 5 14:48:48 2007 +1030 dix: If POINTER_CORE_ONLY is set, GetPointerEvents() only creates a core event - mi: fix: Create motion event in miPointerMoved + mi: fix: Create motion event in miPointerMoved commit 760a38c4c7ab66ae653d3acb92f5cda4bd44edd6 Author: Daniel Stone @@ -141509,9 +151534,9 @@ commit a309c936bb79e2fea04a96ce33c7da99ed902484 Author: Peter Hutterer Date: Mon Feb 5 11:38:44 2007 +1030 - xkb: Daniel's patch to stop evdev keyboard segfaults. + xkb: Daniel's patch to stop evdev keyboard segfaults. - mi: Remove quickfix from ba547d4f6a2707f51f0d826389d2d418fb62367a + mi: Remove quickfix from ba547d4f6a2707f51f0d826389d2d418fb62367a commit 236f04b638e7d4d1656c6bedd8a6e8d7cec285ec Author: Dave Airlie @@ -141601,7 +151626,7 @@ Date: Mon Jan 29 17:30:59 2007 -0800 Typical results were failure to sync, and a black screen. commit 3814862a869ee83d307eb01225d5949039f435d8 -Merge: a216de9 31f2d4a +Merge: a216de9b7f 31f2d4a57e Author: Ian Romanick Date: Mon Jan 29 15:14:31 2007 -0800 @@ -141609,7 +151634,7 @@ Date: Mon Jan 29 15:14:31 2007 -0800 Conflicts: - hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/os-support/bus/linuxPci.c commit 31f2d4a57e04f5ea635fbb50c508405c4fc37b65 Author: Eric Anholt @@ -141628,12 +151653,12 @@ commit 4aaaa70d1b52346213fad46777c006a93c4ece5d Author: Peter Hutterer Date: Mon Jan 29 18:23:24 2007 +1030 - Xi: Adding ChangePointerKeyboardPairing request - Adding PointerKeyboardPairingChanged event - Correct error values for XWarpDevicePointer + Xi: Adding ChangePointerKeyboardPairing request + Adding PointerKeyboardPairingChanged event + Correct error values for XWarpDevicePointer - dix: Adding device argument to SendMappingNotify - Adding spriteOwner flag to devices + dix: Adding device argument to SendMappingNotify + Adding spriteOwner flag to devices commit f3418b52dcf2ab4982504856ab9fae3e726ee6d2 Author: Peter Hutterer @@ -141642,7 +151667,7 @@ Date: Mon Jan 29 16:10:03 2007 +1030 mi: Fix cursor rendering issues. commit 15a81b6325d359990017b8e9f17ce18a7eff1354 -Merge: 3759254 cc3d66d +Merge: 3759254c09 cc3d66d4a5 Author: Peter Hutterer Date: Sun Jan 28 17:18:57 2007 +1030 @@ -141655,7 +151680,7 @@ Date: Wed Nov 15 17:50:02 2006 +1030 o fix minor error in comment for GetPointerEvents() commit 3759254c0967ae83bdcbf097d9e8a58733c8e6f9 -Merge: ba547d4 ca5ebe3 +Merge: ba547d4f6a ca5ebe3971 Author: Peter Hutterer Date: Sun Jan 28 17:05:55 2007 +1030 @@ -141674,7 +151699,7 @@ Date: Fri Jan 26 13:00:45 2007 +0100 Xorg #9692 commit a216de9b7ff55e2b73c487d037f248f00bd2e63b -Merge: 24506ea cf7ca9d +Merge: 24506ea65b cf7ca9d09c Author: Ian Romanick Date: Thu Jan 25 10:17:32 2007 -0800 @@ -141709,7 +151734,7 @@ Date: Wed Jan 24 15:33:49 2007 -0800 read_legcay_BIOS, and delete all remnants of it from all other places. commit fdb3a0798f0d17e72ec7293d59a7a81b5ffdf95b -Merge: 39b51e1 a53586e +Merge: 39b51e1bfc a53586eebc Author: Ian Romanick Date: Wed Jan 24 14:49:39 2007 -0800 @@ -141737,7 +151762,7 @@ Date: Thu Jan 25 00:29:20 2007 +0800 Make Xinearama screen information reflect CRTC rotation. commit 39b51e1bfc4924fc3bda4342ef9c6c0125d9f4fa -Merge: 637b19b 788cfce +Merge: 637b19b3ee 788cfce911 Author: Ian Romanick Date: Tue Jan 23 13:25:56 2007 -0800 @@ -141779,7 +151804,7 @@ Date: Mon Jan 22 09:13:59 2007 -0800 ARCH_PCI_OS_INIT mechanism useless. Remove it. commit 7dfb3cea913b02a6b36c308d1330bd40abe6b41f -Merge: c279d5f 2dc8662 +Merge: c279d5fdc5 2dc866252c Author: Ian Romanick Date: Mon Jan 22 08:44:36 2007 -0800 @@ -141817,7 +151842,7 @@ Date: Fri Jan 19 14:52:23 2007 -0800 -ardelay and -arinterval, respectively. commit c279d5fdc53612a90f33fafe9e9c59ced008dd51 -Merge: 88f248e 14d6a9b +Merge: 88f248e671 14d6a9b327 Author: Ian Romanick Date: Fri Jan 19 12:59:54 2007 -0800 @@ -142074,8 +152099,8 @@ commit 5e2f8dee6331645fcbd2734c43698eb4f9c5b116 Author: Peter Hutterer Date: Thu Jan 11 14:05:39 2007 +1030 - mi: remove core pointer special handling. No event has core pointer as - device now. + mi: remove core pointer special handling. No event has core pointer as + device now. dix: zero pSprite memory, stop segfaults on server restart. @@ -142100,8 +152125,8 @@ Author: Peter Hutterer Date: Wed Jan 10 14:52:13 2007 +1030 Xi: add missing call for SProcXChangeDeviceCursor - add DeviceEnterNotify and DeviceLeaveNotify - fix: QueryDevicePointer crashed if called with keyboard device + add DeviceEnterNotify and DeviceLeaveNotify + fix: QueryDevicePointer crashed if called with keyboard device commit 6a2fb2928714ce77ee342cdc23a1178e5e766cf2 Author: Eric Anholt @@ -142110,7 +152135,7 @@ Date: Tue Jan 9 16:34:40 2007 -0800 Track rename of DamagePost -> DamageAdd. commit da09964a931cc64d05ab571bf545fdad35a6d395 -Merge: e1f73d2 e3aa6ad +Merge: e1f73d2208 e3aa6ad201 Author: Ian Romanick Date: Tue Jan 9 15:27:34 2007 -0800 @@ -142118,7 +152143,7 @@ Date: Tue Jan 9 15:27:34 2007 -0800 Conflicts: - hw/xfree86/int10/generic.c + hw/xfree86/int10/generic.c commit e3aa6ad201eb20862c11c000e76206e317a96dc9 Author: Matthieu Herrb @@ -142195,7 +152220,7 @@ Date: Thu Jan 4 15:37:33 2007 -0800 Incorporate new byte-order related configure changes. commit 8dd5771a1b91c331860b667fb18e484452000aad -Merge: 45aa26c 7d2ec92 +Merge: 45aa26ccb4 7d2ec92170 Author: Ian Romanick Date: Thu Jan 4 15:01:38 2007 -0800 @@ -142203,8 +152228,8 @@ Date: Thu Jan 4 15:01:38 2007 -0800 Conflicts: - GL/glx/indirect_dispatch_swap.c - GL/glx/swap_interval.c + GL/glx/indirect_dispatch_swap.c + GL/glx/swap_interval.c commit 45aa26ccb4f61c2919ce2475d0907c6e1b177da2 Author: Ian Romanick @@ -142361,7 +152386,7 @@ Date: Thu Dec 28 13:15:11 2006 -0800 Export exaMove{In,Out}Pixmap(). commit 683ca3f7afaf15fd3ca7918f6175b5a9e4a6f05b -Merge: 05f9150 9563b2e +Merge: 05f915050c 9563b2eea2 Author: Eric Anholt Date: Wed Dec 27 16:11:31 2006 -0800 @@ -142402,7 +152427,7 @@ Date: Sat Dec 9 22:51:59 2006 +0200 Make sure we're not copying sym_interpret across from an empty source. commit 43a4376bd72ef1b6486cddb60ad57b2d6169292a -Merge: 4b1c9ac d9e079d +Merge: 4b1c9ac3d1 d9e079d2a3 Author: Eamon Walsh Date: Fri Dec 22 13:53:55 2006 -0500 @@ -142452,10 +152477,10 @@ Author: Peter Hutterer Date: Wed Dec 20 13:05:53 2006 +1030 xfree86: Changing "IsMPDevice" to "SharedPointer" option. Devices will default - to MP devices. + to MP devices. - Xi: Adding QueryDevicePointer request/reply - Adding WarpDevicePointer request/reply + Xi: Adding QueryDevicePointer request/reply + Adding WarpDevicePointer request/reply commit e437f357b6850a6c87ca6696870b3abd40e5b8ed Author: Alan Coopersmith @@ -142464,7 +152489,7 @@ Date: Tue Dec 19 16:38:34 2006 -0800 xorg.conf man page should say "XFree86-DGA", not "Xorg-DGA" commit a81dbaae0597492f0245080c6f5af7158e05e2d0 -Merge: fb6d676 d442998 +Merge: fb6d676de5 d442998e39 Author: Eamon Walsh Date: Tue Dec 19 16:11:19 2006 -0500 @@ -142504,7 +152529,7 @@ Date: Tue Dec 19 18:45:25 2006 +0100 This affects drivers with no UploadToScreen or UploadToScreen failures. commit 4334860e69e7d5b156082bd05c7a86708e5bad4c -Merge: 7e47176 fdcc22c +Merge: 7e4717683d fdcc22ca17 Author: Michel Dänzer Date: Tue Dec 19 16:29:26 2006 +0100 @@ -142512,8 +152537,8 @@ Date: Tue Dec 19 16:29:26 2006 +0100 Conflicts: - exa/exa_accel.c - exa/exa_migration.c + exa/exa_accel.c + exa/exa_migration.c commit fdcc22ca1704d3519156c66804528c21b04fea65 Author: Michel Dänzer @@ -142539,14 +152564,14 @@ Date: Tue Dec 19 15:24:19 2006 +0100 See https://bugs.freedesktop.org/show_bug.cgi?id=6772 . commit ca5ebe3971d8ebcfed00c5ebcd026cdd0ce0c6ba -Merge: 4d07b50 1b029fd +Merge: 4d07b50372 1b029fd896 Author: Peter Hutterer Date: Tue Dec 19 10:51:01 2006 +1030 Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver commit 2d0a63126b3d3a17005b7e122617ee0c5f44a55b -Merge: d8b5394 1b029fd +Merge: d8b5394eda 1b029fd896 Author: Peter Hutterer Date: Tue Dec 19 10:31:40 2006 +1030 @@ -142578,14 +152603,14 @@ Author: Peter Hutterer Date: Mon Dec 18 15:33:54 2006 +1030 mi: removing MPX ifdefs - global sprite renaming in mipointer and misprite - fixed: multiple remove cursor call in miSpriteInstallColormap - fixed: wrong core pointer usage in miSpriteStoreColors + global sprite renaming in mipointer and misprite + fixed: multiple remove cursor call in miSpriteInstallColormap + fixed: wrong core pointer usage in miSpriteStoreColors dix: bugfix in CheckCursorConfinement - removing MPX ifdefs - removing MPX event generation (using Xi solely now) - bugfix GrabDevice: uninitialized field in grab struct caused segfault + removing MPX ifdefs + removing MPX event generation (using Xi solely now) + bugfix GrabDevice: uninitialized field in grab struct caused segfault xfree86: removing MPX fdefs @@ -142738,13 +152763,13 @@ Author: Peter Hutterer Date: Thu Dec 14 10:50:18 2006 +1030 mi: removing MPX ifdefs - global sprite renaming in mipointer and misprite - fixed: multiple remove cursor call in miSpriteInstallColormap - fixed: wrong core pointer usage in miSpriteStoreColors + global sprite renaming in mipointer and misprite + fixed: multiple remove cursor call in miSpriteInstallColormap + fixed: wrong core pointer usage in miSpriteStoreColors dix: bugfix in CheckCursorConfinement - removing MPX ifdefs - removing MPX event generation (using Xi solely now) + removing MPX ifdefs + removing MPX event generation (using Xi solely now) commit b88ad820fac81d0dfd557a384bf0406e8893e7af Author: Alan Hourihane @@ -142773,7 +152798,7 @@ Date: Tue Dec 12 15:59:08 2006 -0500 Split AssignClientState() into two routines, new routine is server-specific. commit 62e7722ebd8d341a23eb56cb330eeb00e6a975a6 -Merge: e124806 f3c6090 +Merge: e124806994 f3c60900e5 Author: Eamon Walsh Date: Tue Dec 12 13:54:33 2006 -0500 @@ -142865,8 +152890,8 @@ Author: Peter Hutterer Date: Mon Dec 11 18:09:59 2006 +1030 dix: Moving SpriteRec into DeviceIntRec - removing global sprite structure - beginning to remove MPX ifdefs + removing global sprite structure + beginning to remove MPX ifdefs xnest: Fix to make xnest compile again @@ -142877,7 +152902,7 @@ Date: Sun Dec 10 11:24:05 2006 -0500 Accept EDID > 1.3 but < 2.0 if we find it, assume it's compatible. commit e1f73d220873fa091695e46b7fcd008663a95a6f -Merge: 27d682f d56249a +Merge: 27d682fa03 d56249a15e Author: Ian Romanick Date: Fri Dec 8 17:24:15 2006 -0800 @@ -142885,19 +152910,19 @@ Date: Fri Dec 8 17:24:15 2006 -0800 Conflicts: - hw/xfree86/common/xf86Configure.c - hw/xfree86/common/xf86Helper.c - hw/xfree86/common/xf86pciBus.c - hw/xfree86/int10/helper_exec.c - hw/xfree86/os-support/bus/Pci.c - hw/xfree86/os-support/bus/linuxPci.c - hw/xfree86/os-support/linux/lnx_pci.c - hw/xfree86/scanpci/Makefile.am - hw/xfree86/utils/pcitweak/Makefile.am - hw/xfree86/utils/scanpci/Makefile.am + hw/xfree86/common/xf86Configure.c + hw/xfree86/common/xf86Helper.c + hw/xfree86/common/xf86pciBus.c + hw/xfree86/int10/helper_exec.c + hw/xfree86/os-support/bus/Pci.c + hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/os-support/linux/lnx_pci.c + hw/xfree86/scanpci/Makefile.am + hw/xfree86/utils/pcitweak/Makefile.am + hw/xfree86/utils/scanpci/Makefile.am commit d56249a15ead51ad4d2117d5538ada24af05b693 -Merge: f1f8df1 ec84f72 +Merge: f1f8df1889 ec84f72d07 Author: Jeremy C. Reed Date: Fri Dec 8 15:52:37 2006 -0600 @@ -143059,7 +153084,7 @@ Date: Tue Dec 5 18:50:19 2006 +1030 Ironing some glitches caused by the merge commit 3c8f166022a2d19af14eb670fa382503ba1451cd -Merge: 2a51149 f9f7d7f +Merge: 2a511492f9 f9f7d7f3be Author: Peter Hutterer Date: Tue Dec 5 18:28:33 2006 +1030 @@ -143067,7 +153092,7 @@ Date: Tue Dec 5 18:28:33 2006 +1030 Conflicts: - dix/events.c + dix/events.c commit 2a511492f9a235d3f5390ab87b6c643cbea92d88 Author: Peter Hutterer @@ -143076,8 +153101,8 @@ Date: Tue Dec 5 15:45:18 2006 +1030 Xi: adding MPX checks to ProcessOtherEvents mpx: adding QueryPointer request and reply - adjusting names of requests to Xlib compatible naming (xMPX*** instead of - mpx***) + adjusting names of requests to Xlib compatible naming (xMPX*** instead of + mpx***) commit f9f7d7f3be53c808abb5eaceb7a1abc55744a210 Author: Alan Coopersmith @@ -143131,16 +153156,16 @@ Author: Peter Hutterer Date: Fri Dec 1 15:56:52 2006 +1030 mpx: SelectEvents and GetEventBase requests. - Some renaming and cleaning up in extinit.c - MPXLastEvent added + Some renaming and cleaning up in extinit.c + MPXLastEvent added - Xi: ShouldFreeInputMask() from XI is not static any more, used in mpx + Xi: ShouldFreeInputMask() from XI is not static any more, used in mpx - dix: GetPointerEvents() allocates MPX event for MPX devices. - DeliverDeviceEvents() caters for MPX devices. + dix: GetPointerEvents() allocates MPX event for MPX devices. + DeliverDeviceEvents() caters for MPX devices. commit ccd804c6c01cdfffe938fa5336be9b5668a6f0c0 -Merge: 9423ac1 82912ad +Merge: 9423ac134a 82912ad770 Author: Drew Parsons Date: Fri Dec 1 15:21:57 2006 +1100 @@ -143179,7 +153204,7 @@ Date: Wed Nov 29 22:19:57 2006 -0500 Add required root window context to config file. commit 143558500a89a5c887c75c03798bae68c953cac9 -Merge: e3d3d29 ee9bdd3 +Merge: e3d3d29db5 ee9bdd3f4a Author: Eamon Walsh Date: Wed Nov 29 20:41:41 2006 -0500 @@ -143288,9 +153313,9 @@ commit bdf718907b3202815a04ec28a868689708f43da9 Author: Peter Hutterer Date: Tue Nov 28 18:06:34 2006 +1030 - dix: missing parameter to SetCursorPosition in CheckMotion ifndef MPX + dix: missing parameter to SetCursorPosition in CheckMotion ifndef MPX - mi: missing include in misprite.c ifndef MPX + mi: missing include in misprite.c ifndef MPX commit e88bc0e55a6937ff0b47fe38f60bfa8991196578 Author: Peter Hutterer @@ -143313,7 +153338,7 @@ Date: Mon Nov 27 16:21:31 2006 -0800 Move mode handling helpers from ddcProperty.c to xf86Mode.c. commit b4b0d901d98371a8aa7b17d195e18e83e2a6a618 -Merge: 64de3ba d6cd031 +Merge: 64de3baf85 d6cd0313c7 Author: Eric Anholt Date: Mon Nov 27 15:43:15 2006 -0800 @@ -143321,12 +153346,12 @@ Date: Mon Nov 27 15:43:15 2006 -0800 Conflicts: - dix/events.c - dix/getevents.c - hw/xfree86/common/xf86Mode.c - hw/xfree86/dri/Makefile.am - hw/xfree86/os-support/drm/xf86drm.c - hw/xfree86/os-support/xf86drm.h + dix/events.c + dix/getevents.c + hw/xfree86/common/xf86Mode.c + hw/xfree86/dri/Makefile.am + hw/xfree86/os-support/drm/xf86drm.c + hw/xfree86/os-support/xf86drm.h commit d6cd0313c7f23f32c9c7dda00ff739e772bf7db3 Author: Eric Anholt @@ -143343,49 +153368,49 @@ Author: Peter Hutterer Date: Mon Nov 27 18:07:16 2006 +1030 mi: malloc checks for misprite and midispcur, code cleanup - removed IsMPDev() + removed IsMPDev() commit 023da4e804ad260eaf0c50d2ec7213dd514e2113 Author: Peter Hutterer Date: Mon Nov 27 15:54:33 2006 +1030 mi: mipointer.c cleanup, reducing code duplication, using MPHasCursor() - instead of IsMPDev() + instead of IsMPDev() commit a2340a73687dfd93affb6de28a33d73fd808c96b Author: Peter Hutterer Date: Mon Nov 27 14:47:23 2006 +1030 mi: free allocated memory in miDCCloseScreen and in miDCInitialize in case - of errors. - Some copyright notices. - misprite.c passes DeviceIntPtr around and down to DC (previously - miCursorInfoPtr and the plain device id). - Large cleanup in misprite.c to avoid code duplication. + of errors. + Some copyright notices. + misprite.c passes DeviceIntPtr around and down to DC (previously + miCursorInfoPtr and the plain device id). + Large cleanup in misprite.c to avoid code duplication. commit 1c7568b8a1417257fa67c7fca69aa253099b9461 Author: Peter Hutterer Date: Thu Nov 23 17:15:14 2006 +1030 - mi: closing memory leak, miPointer is freed in miPointerCloseScreen - bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX - adding DeviceIntPtr parameter to ScreenRec's cursor functions. - cleanup of miPointer code to use same scheme in each function + mi: closing memory leak, miPointer is freed in miPointerCloseScreen + bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX + adding DeviceIntPtr parameter to ScreenRec's cursor functions. + cleanup of miPointer code to use same scheme in each function - dix: MPHasCursor() function determines checking whether to invoke - cursor rendering. + dix: MPHasCursor() function determines checking whether to invoke + cursor rendering. animcur: adding DeviceIntPtr parameter to cursor functions but animcur relies - on the core pointer right now. + on the core pointer right now. xfixes: adding DeviceIntPtr parameter to cursor functions but xfixes relies on - the core pointer right now. + the core pointer right now. - rac: adding DeviceIntPtr parameter to cursor functions but RAC relies on - the core pointer right now. + rac: adding DeviceIntPtr parameter to cursor functions but RAC relies on + the core pointer right now. - ramdac: adding DeviceIntPtr parameter to cursor functions but ramdac relies on - the core pointer right now. + ramdac: adding DeviceIntPtr parameter to cursor functions but ramdac relies on + the core pointer right now. commit 64de3baf85f6df274f71f736016f0848567cd9f6 Author: Aaron Plattner @@ -143422,7 +153447,7 @@ commit f52d53e060d0468b658a565688d1f92c156405c7 Author: Peter Hutterer Date: Wed Nov 22 17:58:57 2006 +1030 - dix: DeliverEventsToWindow adjusted for MPX + dix: DeliverEventsToWindow adjusted for MPX mi: sprite debugging disabled @@ -143430,10 +153455,10 @@ commit 8c16f21d5df08b028e93440d632939a5fdbf5876 Author: Peter Hutterer Date: Wed Nov 22 17:06:47 2006 +1030 - dix GetSpriteWindow() adjusted for MPX - added device dependency for MPX to DoEnterLeaveEvents, - EnterLeaveEvents, EnterNotifies, LeaveNotifies and - FixUpEventFromWindow. + dix GetSpriteWindow() adjusted for MPX + added device dependency for MPX to DoEnterLeaveEvents, + EnterLeaveEvents, EnterNotifies, LeaveNotifies and + FixUpEventFromWindow. commit 70383105de279df553874efa56b37a7b3e426ea1 Author: Peter Hutterer @@ -143446,7 +153471,7 @@ Date: Wed Nov 22 15:27:16 2006 +1030 events.c (XineramaChangeToCursor, XineramaCheckPhysLimits, XineramaConstrainCursor) - Xi: fix: accessing other->buttons for keyboard segfaulted the server + Xi: fix: accessing other->buttons for keyboard segfaulted the server commit 33ff4cec5ff7533ec725f71d357c096dfb0acb79 Author: Alan Hourihane @@ -143460,27 +153485,27 @@ commit efd4f3c6ffec804c68ba5df17cc117da264fb7c4 Author: Peter Hutterer Date: Tue Nov 21 20:31:30 2006 +1030 - dix: WindowsRestructured() calls CheckMotion() on all devices + dix: WindowsRestructured() calls CheckMotion() on all devices - mi: core pointer was checked twice in miSpriteReportDamage, - miSpriteInstallColormap, miSpriteStoreColors, miSpriteSaveDoomedAreas - and miSpriteRealiseCursor - using damage bug (see comment in file) to avoid artefacts + mi: core pointer was checked twice in miSpriteReportDamage, + miSpriteInstallColormap, miSpriteStoreColors, miSpriteSaveDoomedAreas + and miSpriteRealiseCursor + using damage bug (see comment in file) to avoid artefacts commit 9db851c22d4befb95bfb074b96620261d8e32ac9 Author: Peter Hutterer Date: Tue Nov 21 18:15:04 2006 +1030 dix: moved sprite from static to be pointer of type SpritePtr - added SpriteRecs for MPX devices - changed sprite dependency and added MPX functionality to parts - of events.c (ConfineToShape, PostNewCursor, XineramaCheckMotion, - CheckMotion, XineramaChangeToCursor, ChangeToCursor, CheckPhysLimits, - PointerConfinedToScreen) - added DeviceIntRec param to GetSpritePosition(). This required some - minor changes in ddx, xtest, xkb and xfixes. + added SpriteRecs for MPX devices + changed sprite dependency and added MPX functionality to parts + of events.c (ConfineToShape, PostNewCursor, XineramaCheckMotion, + CheckMotion, XineramaChangeToCursor, ChangeToCursor, CheckPhysLimits, + PointerConfinedToScreen) + added DeviceIntRec param to GetSpritePosition(). This required some + minor changes in ddx, xtest, xkb and xfixes. - mi: changed miPointer to pointer instead of static struct. + mi: changed miPointer to pointer instead of static struct. commit fd8b9a6eaee28a453a00af14195b81ef1890a577 Author: Peter Hutterer @@ -143492,7 +153517,7 @@ commit 447efdc01d4f8922205ba26e52c9e5ff9f5cb90e Author: Peter Hutterer Date: Tue Nov 21 14:46:00 2006 +1030 - mi: constrain MPX cursors to screen + mi: constrain MPX cursors to screen commit 1107d8bea22eea26f7b666f1c00a53360b7d237e Author: Peter Hutterer @@ -143532,7 +153557,7 @@ Date: Mon Nov 20 13:10:07 2006 +1030 bugfix in mipointer, semicolon after preprocessor statement commit ca2874b273232d9f51881b1cd754ed6847bfaf47 -Merge: c9a5f9d e2f6dac +Merge: c9a5f9d391 e2f6dacc73 Author: Alan Hourihane Date: Sat Nov 18 19:56:32 2006 +0000 @@ -143705,7 +153730,7 @@ Date: Tue Nov 14 15:33:07 2006 +0100 Bug #9023: Only check mice for "mouse" or "void" if identifier is != NULL. commit a724b7f1302ba7a59f140b521f13d2ddf0fcf9bf -Merge: 6facd95 f80a8ae +Merge: 6facd958c2 f80a8ae6e6 Author: Jeremy C. Reed Date: Mon Nov 13 20:32:26 2006 -0600 @@ -144029,7 +154054,7 @@ Date: Tue Nov 7 15:48:05 2006 -0800 A couple more cases of error message before freeing strings. commit 05f1c302460a14c8fa9a943a12d69adcd3c30d58 -Merge: 3e7e0e3 46af6d1 +Merge: 3e7e0e3509 46af6d1e95 Author: Adam Jackson Date: Tue Nov 7 18:42:54 2006 -0500 @@ -144075,7 +154100,7 @@ Date: Tue Nov 7 01:29:51 2006 -0800 getevents.c commit c20d3bf7533da0bf26beaf7d8c359d18edbd70e8 -Merge: 028bbdc 3d39c02 +Merge: 028bbdc041 3d39c02fe6 Author: Keith Packard Date: Tue Nov 7 01:21:28 2006 -0800 @@ -144114,14 +154139,14 @@ Date: Mon Nov 6 00:30:09 2006 +0100 Fix typo in Xvesa: incorrect reporting of DAC capabilities. commit 028bbdc0417173803695808ba9f48498519273a3 -Merge: 50504c6 8deaaa3 +Merge: 50504c68e1 8deaaa312a Author: Keith Packard Date: Sat Nov 4 17:46:26 2006 -0800 Merge master back to randr-1.2 commit 50504c68e1d407232cf83465981b235e542ef31f -Merge: 8b87ce1 cde8806 +Merge: 8b87ce1974 cde8806c29 Author: Keith Packard Date: Sat Nov 4 17:43:19 2006 -0800 @@ -144201,7 +154226,7 @@ Date: Fri Oct 27 12:36:56 2006 -0700 and 1024x768@75 modes. commit 22ee2e4e1f1d9fd9ca9f25c9bf25370034b771d4 -Merge: 49a2668 bd0c829 +Merge: 49a26681b2 bd0c829654 Author: Alan Coopersmith Date: Fri Nov 3 12:54:56 2006 -0800 @@ -144314,7 +154339,7 @@ Date: Thu Nov 2 12:25:03 2006 +0100 Build with -D_PC on ix86 only. commit 543b397277d1f03b8091e44812010abcd5d80102 -Merge: 4056e6e 645d057 +Merge: 4056e6e79a 645d057620 Author: Keith Packard Date: Thu Nov 2 19:00:35 2006 -0800 @@ -144385,14 +154410,14 @@ Date: Thu Nov 2 03:22:09 2006 +0200 bump to 1.2.99.0 commit 18c246a13b887b865de6a17e6cd1c259b9bc383d -Merge: 794f2e7 4843d82 +Merge: 794f2e7291 4843d823f4 Author: Daniel Stone Date: Thu Nov 2 03:21:37 2006 +0200 Merge branch 'input-hotplug' commit 4843d823f4d38d8bd468ce3a8feddbff229ed416 -Merge: ba9f513 a7b944f +Merge: ba9f5138fc a7b944f0d9 Author: Daniel Stone Date: Thu Nov 2 03:18:13 2006 +0200 @@ -144408,7 +154433,7 @@ Date: Thu Nov 2 03:16:10 2006 +0200 config file. commit be291a6d9764cf29a7d9a8114d47d9f41ce856e9 -Merge: a2d6242 6fdfd9d +Merge: a2d6242106 6fdfd9dad9 Author: Daniel Stone Date: Thu Nov 2 03:15:25 2006 +0200 @@ -144525,7 +154550,7 @@ Date: Sun Oct 29 17:49:46 2006 +0100 kill GNU-make'ism. commit 0107320fac0913aae2cb169992e31c670b4bd2f7 -Merge: 06b6b97 a34446f +Merge: 06b6b971d0 a34446f5b3 Author: Thomas Hellstrom Date: Sun Oct 29 15:23:35 2006 +0100 @@ -144596,7 +154621,7 @@ Date: Fri Oct 27 18:26:30 2006 +0200 Import libdrm functions for the drm memory manager. commit e3d3d29db5eef057b4e8294377c9c3147436bc2f -Merge: 92387e9 004d00e +Merge: 92387e99d0 004d00e668 Author: Eamon Walsh Date: Thu Oct 26 20:21:16 2006 -0400 @@ -144647,7 +154672,7 @@ Date: Thu Oct 26 20:38:58 2006 +0300 lnx_ia64.c. commit 8c0556e7cb1de8c387ddd886a03a8f8afff1fd0e -Merge: cdc8a4b 004d00e +Merge: cdc8a4b7b2 004d00e668 Author: Daniel Stone Date: Thu Oct 26 15:21:22 2006 +0300 @@ -144665,7 +154690,7 @@ Date: Thu Oct 26 01:10:08 2006 +0300 The fallthrough to gettimeofday() is preserved. commit cdc8a4b7b2f099b8860a54c5c9f488e6f7c4913a -Merge: 3da918a d285833 +Merge: 3da918a16c d285833290 Author: Daniel Stone Date: Thu Oct 26 00:28:30 2006 +0300 @@ -144706,14 +154731,14 @@ Date: Wed Oct 25 11:39:27 2006 +0200 without pretending it's always on. commit 59511974db843fa7e11133894cfc10c20fdaf60f -Merge: 054f8cd 598ac7a +Merge: 054f8cd267 598ac7a836 Author: Keith Packard Date: Tue Oct 24 17:26:20 2006 -0700 Merge branch 'master' into randr-1.2 commit 598ac7a83698327b607084abaebcbd22f8d25fbb -Merge: 828c34e 948a97b +Merge: 828c34e83c 948a97b97e Author: Keith Packard Date: Tue Oct 24 17:23:12 2006 -0700 @@ -144812,7 +154837,7 @@ Date: Tue Oct 24 09:04:14 2006 -0700 Fix from HEAD accidentally reverted during merge. commit 8b909135664abb69ada522e8e39495d9eca717ac -Merge: 21291d6 948a97b +Merge: 21291d6ca7 948a97b97e Author: Ian Romanick Date: Tue Oct 24 08:57:59 2006 -0700 @@ -144820,14 +154845,14 @@ Date: Tue Oct 24 08:57:59 2006 -0700 Conflicts: - hw/xfree86/Makefile.am - hw/xfree86/common/xf86.h - hw/xfree86/common/xf86DoScanPci.c - hw/xfree86/os-support/bus/linuxPci.c - hw/xfree86/scanpci/extrapci.ids - hw/xfree86/scanpci/pci.ids - hw/xfree86/scanpci/pciid2c.pl - hw/xfree86/scanpci/xf86PciStdIds.h + hw/xfree86/Makefile.am + hw/xfree86/common/xf86.h + hw/xfree86/common/xf86DoScanPci.c + hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/scanpci/extrapci.ids + hw/xfree86/scanpci/pci.ids + hw/xfree86/scanpci/pciid2c.pl + hw/xfree86/scanpci/xf86PciStdIds.h commit 0cd6a3d8efb5cc1ce4f85ab95bcdf4fb66c7245d Author: Daniel Stone @@ -144869,7 +154894,7 @@ Date: Mon Oct 23 05:12:15 2006 +0300 Remove unused xf86CheckButton. commit c5b5b046e86b159a9d32451308f38246cc4587f7 -Merge: fab1d37 948a97b +Merge: fab1d37ecb 948a97b97e Author: Daniel Stone Date: Mon Oct 23 02:58:30 2006 +0300 @@ -145055,7 +155080,7 @@ Date: Sat Oct 21 22:06:43 2006 +1000 Minor typos in Xserver man page. commit e26a494f417c3c700636ee68892c3015b2e0f27a -Merge: 736b0d5 aeba855 +Merge: 736b0d5078 aeba855b07 Author: Zephaniah E. Hull Date: Sat Oct 21 04:26:14 2006 -0400 @@ -145369,7 +155394,7 @@ Date: Fri Oct 13 17:34:53 2006 -0700 Separate configuration from layout changes to send correct events. commit 335b503c5e7041bb0c44611e496d1c46f554e630 -Merge: bd3d93b cf948b7 +Merge: bd3d93be82 cf948b7b04 Author: Daniel Stone Date: Fri Oct 13 18:10:45 2006 +0300 @@ -145383,7 +155408,7 @@ Date: Fri Oct 13 14:48:10 2006 +0100 to avoid cursor movements signalling io. commit 4b53a5e4b147ab748b28dffc1d330b7148d8efa6 -Merge: 23f6f08 042d4a4 +Merge: 23f6f08b7b 042d4a407d Author: Eamon Walsh Date: Wed Oct 11 20:50:31 2006 -0400 @@ -145597,7 +155622,7 @@ Date: Sat Oct 7 14:16:51 2006 +0300 layer. commit 4c342246300e06bdf5c9c62cc1d2f6aa57a524db -Merge: 8382234 49a70c8 +Merge: 8382234a7f 49a70c8570 Author: Alan Coopersmith Date: Fri Oct 6 18:01:13 2006 -0700 @@ -145650,14 +155675,14 @@ Date: Thu Oct 5 16:07:26 2006 -0400 Improve error handling, messages during initialization. commit de63a469dcd0a8ae98554bca540ac0106cccf2a5 -Merge: 9c7440b 8382234 +Merge: 9c7440bdf5 8382234a7f Author: Daniel Stone Date: Thu Oct 5 20:29:19 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit b4659faf9b455b44ac8e691cc7a8fc00a967c80b -Merge: c4f30c6 8382234 +Merge: c4f30c6353 8382234a7f Author: Keith Packard Date: Wed Oct 4 14:46:04 2006 -0700 @@ -145693,7 +155718,7 @@ Date: Tue Oct 3 17:48:50 2006 -0700 Don't insert RCS tag into generated pci id header files commit 75e0cc41b201b9ceb2615e7cec0dd5b4c136b343 -Merge: 6926776 20c0cee +Merge: 6926776f0e 20c0ceedfb Author: Eamon Walsh Date: Tue Oct 3 13:58:03 2006 -0400 @@ -145727,7 +155752,7 @@ Date: Mon Oct 2 02:17:14 2006 +0300 Use XkbCharToInt as that's what we're doing. commit 3c98cebb6e954855528794fec46830f456cbdec1 -Merge: fa1ac94 2cf1098 +Merge: fa1ac94178 2cf1098436 Author: Daniel Stone Date: Mon Oct 2 02:18:17 2006 +0300 @@ -145755,21 +155780,21 @@ Date: Sat Sep 30 17:05:46 2006 +0300 if built with --enable-debug. commit 20c0ceedfbce9ae5c70703900b52973917ac4cd0 -Merge: 49a70c8 84eb2c0 +Merge: 49a70c8570 84eb2c0a06 Author: Eamon Walsh Date: Fri Sep 29 15:37:00 2006 -0400 Merge branch 'master' into my-XACE-modular commit 518db35ca3f569e7cb95dbddeddb93f3691de498 -Merge: 5d99e05 84eb2c0 +Merge: 5d99e05f05 84eb2c0a06 Author: Daniel Stone Date: Fri Sep 29 00:35:21 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit 5d99e05f05a42a82a9f02844df9bfebaa673759d -Merge: ad631af 5893375 +Merge: ad631afcf3 5893375786 Author: Daniel Stone Date: Fri Sep 29 00:35:07 2006 +0300 @@ -145793,7 +155818,7 @@ Date: Thu Sep 28 15:09:40 2006 -0600 Patch by Dan Nicholson. commit 4bc5dc2854e33bf343cdea44a3c3b4c41f6f4145 -Merge: cf6e968 f9542e7 +Merge: cf6e9687ff f9542e7495 Author: Aaron Plattner Date: Thu Sep 28 13:27:13 2006 -0700 @@ -145833,7 +155858,7 @@ Date: Wed Aug 30 19:12:17 2006 +0200 Add wrapper for new ioctl to update drawable information in the DRM. commit ad321fad4b9ab3a2c70cfff37ca6c8faaa5cce9c -Merge: 5e9d33f f7c1d94 +Merge: 5e9d33fe87 f7c1d94241 Author: Daniel Stone Date: Sun Sep 24 17:56:43 2006 +0300 @@ -146037,14 +156062,14 @@ Date: Sat Sep 16 03:49:11 2006 -0400 Thanks, automake. commit 6926776f0ecd1e8e81c5c40ccd3a97227bc44dcb -Merge: 6950267 49a70c8 +Merge: 6950267dd6 49a70c8570 Author: Eamon Walsh Date: Fri Sep 15 15:28:13 2006 -0400 Merge branch 'my-XACE-modular' into my-XACE-SELINUX commit 49a70c8570b03aff8239324a2474918a6fbc52a0 -Merge: d1110c5 05231e3 +Merge: d1110c5c83 05231e336d Author: Eamon Walsh Date: Fri Sep 15 15:26:57 2006 -0400 @@ -146272,7 +156297,7 @@ Date: Sun Sep 10 11:13:18 2006 -0700 so I think we can tolerate the extra #ifdef for the next release. commit 60db190ecfce52cbfa888c0af3210634f9186bed -Merge: 5e9d33f 6525610 +Merge: 5e9d33fe87 65256109bb Author: Zephaniah E. Hull Date: Sun Sep 10 03:49:17 2006 -0400 @@ -146284,8 +156309,8 @@ Date: Sun Sep 10 17:40:37 2006 +1000 * Define XPSERVERLIST with `/etc/init.d/xprint get_xpserverlist` instead of `/bin/sh /etc/init.d/xprint get_xpserverlist` - - allows the initscript to set its own different shell under #! - - allows disabling of XPSERVERLIST by making the script non-executable + - allows the initscript to set its own different shell under #! + - allows disabling of XPSERVERLIST by making the script non-executable * Allow files to be installed by using dist_*_DATA instead of EXTRA_DIST. Also, use dist_*_SCRIPTS to install scripts. * Fix minor typos in man pages. @@ -146297,7 +156322,7 @@ Date: Fri Sep 8 15:31:18 2006 -0400 Add SELinux extension configure-time support. commit fb34c02861ab3629c1c85c156e73b158518db7c7 -Merge: 9c503f0 d1110c5 +Merge: 9c503f09ce d1110c5c83 Author: Eamon Walsh Date: Fri Sep 8 15:30:12 2006 -0400 @@ -146365,7 +156390,7 @@ Date: Thu Sep 7 15:35:16 2006 -0400 DRI locking between 2D and 3D drivers around VT switch. commit 5e9d33fe87f9d24e55c468d4b2bb761c9efdb26a -Merge: 629798c 64479ff +Merge: 629798c73a 64479fffa2 Author: Daniel Stone Date: Thu Sep 7 15:43:31 2006 +0300 @@ -146417,7 +156442,7 @@ Date: Tue Sep 5 15:23:54 2006 -0700 (unsigned long)(1 << 31) = bad news on x86_64. commit 0b81fccd2ee4e054e5cffb739de07460ff2c13f7 -Merge: 20c4ac6 c281351 +Merge: 20c4ac6e03 c2813514cf Author: Eamon Walsh Date: Tue Sep 5 18:03:25 2006 -0400 @@ -146425,7 +156450,7 @@ Date: Tue Sep 5 18:03:25 2006 -0400 Conflicts: - configure.ac + configure.ac commit c2813514cf7b1a36caa848cbc2ceef99cf2eb769 Author: Ian Romanick @@ -146483,7 +156508,7 @@ Date: Tue Aug 29 16:35:32 2006 -0700 appear in the server's string. commit 1c8851ad491dd02d1c79e620b46384956838ed42 -Merge: d59b52f 5ddbf4b +Merge: d59b52fc08 5ddbf4bcd4 Author: Ian Romanick Date: Tue Aug 29 16:34:04 2006 -0700 @@ -146519,7 +156544,7 @@ Date: Tue Aug 29 23:49:26 2006 +0300 Yeah. That was dumb. commit 942b4369990a255257f66835caf8671432c405a3 -Merge: 77d315b 393dc0a +Merge: 77d315bd2f 393dc0a338 Author: Ian Romanick Date: Tue Aug 29 13:30:37 2006 -0700 @@ -146579,7 +156604,7 @@ Date: Tue Aug 29 13:19:12 2006 +0300 couple of range-related thinkos in level name copying. commit 7fa3383e3c8eea7d1eb0e556393f2431cf8e6ed2 -Merge: 8d77d44 ebbdc13 +Merge: 8d77d44fda ebbdc1342a Author: Daniel Stone Date: Tue Aug 29 15:16:01 2006 +0300 @@ -146592,14 +156617,14 @@ Date: Mon Aug 28 18:17:32 2006 -0400 Remove calls to LoaderCheckUnresolved(), since it's now a stub. commit 8d77d44fda3aacbae62864a3620e09095b79e92d -Merge: d6f36bd 2fde560 +Merge: d6f36bd280 2fde560bbb Author: Daniel Stone Date: Sun Aug 27 23:08:49 2006 +0300 Merge branch 'origin' into input-hotplug commit 20c4ac6e038607ebbf6c04639670514c016d8597 -Merge: 13c6713 8d4f21a +Merge: 13c6713c82 8d4f21ab53 Author: Eamon Walsh Date: Fri Aug 25 18:49:46 2006 -0400 @@ -146632,7 +156657,7 @@ Date: Fri Aug 25 12:05:16 2006 -0700 GL_NV_{vertex,fragment}_program, and related extensions can be enabled. commit 21291d6ca7188e5733ed0c93215ee0f1f0f90cc9 -Merge: 1a5561c cd2da4e +Merge: 1a5561c4ec cd2da4e41e Author: Ian Romanick Date: Fri Aug 25 09:34:21 2006 -0700 @@ -146647,7 +156672,7 @@ Date: Fri Aug 25 12:43:17 2006 +0300 best-effort attempt to keep configs working. commit 7c4167f0d6b33c9c602b04fcfd246fd3aeddd709 -Merge: 393f834 cd2da4e +Merge: 393f8347ed cd2da4e41e Author: Daniel Stone Date: Fri Aug 25 11:15:33 2006 +0300 @@ -146689,7 +156714,7 @@ Date: Thu Aug 24 17:58:52 2006 -0700 Add some missing bits of GL_SGI_color_table. commit ae608b2071d882966e9c7ede71f846b1ecec0b23 -Merge: 2c86527 b879356 +Merge: 2c865277fe b879356ce9 Author: Ian Romanick Date: Thu Aug 24 14:56:33 2006 -0700 @@ -146712,7 +156737,7 @@ Date: Thu Aug 24 14:49:46 2006 -0700 Regenerate from gl_API.xml 1.62. Functions move, no real changes. commit 3a36b0a24aa9e9e238faa7f00100f59800f5142b -Merge: db1ab1b b879356 +Merge: db1ab1bdb2 b879356ce9 Author: Daniel Stone Date: Thu Aug 24 23:35:28 2006 +0300 @@ -146750,7 +156775,7 @@ Date: Thu Aug 24 15:50:15 2006 -0400 More #ifdef USE_DEPRECATED_KEYBOARD_DRIVER. commit 4ed311cf1c29090c53e474a3001c5702ff8409df -Merge: 73e58ad b29b236 +Merge: 73e58adda9 b29b236d88 Author: Matthias Hopf Date: Thu Aug 24 20:17:10 2006 +0200 @@ -146783,7 +156808,7 @@ Date: Thu Aug 24 14:51:26 2006 +0300 Fix horrendous thinko. Indicators now work perfectly. commit 4adf9af313c9f63b6ad734e174efe1d36ddb5813 -Merge: 33af05d 67bd672 +Merge: 33af05d58f 67bd672c88 Author: Daniel Stone Date: Thu Aug 24 10:59:33 2006 +0300 @@ -146802,7 +156827,7 @@ Date: Wed Aug 23 22:39:42 2006 +0000 Add xorg.conf IgnoreABI option which does the same thing as -ignoreABI commit b983773d446cef6a0948ca264ed48126e404ae9a -Merge: 0623d36 d9a8656 +Merge: 0623d3643f d9a86566c2 Author: Ian Romanick Date: Wed Aug 23 17:16:50 2006 -0700 @@ -146924,14 +156949,14 @@ Date: Wed Aug 23 14:33:41 2006 +0300 the moment), and use that instead of nasty pointer assignments. commit 52ba722e4c89c052609b4fc62e965d92778aa2dd -Merge: 9138d5a 0554125 +Merge: 9138d5a51e 05541259bd Author: Eamon Walsh Date: Mon Aug 21 18:49:31 2006 -0400 Merge branch 'XACE-modular' into my-XACE-modular commit 05541259bdb0dfaab015a01caa3722b7a1b782e2 -Merge: c2535f6 a1ac044 +Merge: c2535f6792 a1ac0440bb Author: Alan Coopersmith Date: Mon Aug 21 13:07:41 2006 -0700 @@ -146947,7 +156972,7 @@ Date: Fri Aug 18 18:03:41 2006 +0300 configure time. commit 0704bb298cc826cd117815898c6bc015a693c2c9 -Merge: c140369 a1ac044 +Merge: c14036977f a1ac0440bb Author: Daniel Stone Date: Fri Aug 18 17:30:14 2006 +0300 @@ -146967,14 +156992,14 @@ Date: Fri Aug 18 17:24:34 2006 +0300 input.h: add InitCoreDevices prototype commit 1c2cb30cd88ba4453f9da339025f8ff39f7f5412 -Merge: 633b6a6 70ddd0f +Merge: 633b6a69f5 70ddd0f39d Author: Daniel Stone Date: Fri Aug 18 17:05:50 2006 +0300 Merge branch 'origin' into input-hotplug commit 19f673b7788d32c220e7e06734f1074b0e4a999c -Merge: cb0a565 70ddd0f +Merge: cb0a565d2b 70ddd0f39d Author: Daniel Stone Date: Fri Aug 18 17:05:41 2006 +0300 @@ -146997,7 +157022,7 @@ Date: Fri Aug 18 14:43:10 2006 +0100 (Brett Stahlman & Colin Harrison) commit 708b225689b5a4ba9ffe3372b584b715ef9eacdc -Merge: e1f4565 ee5e2cb +Merge: e1f4565be5 ee5e2cbd2b Author: Alan Hourihane Date: Fri Aug 18 09:13:52 2006 +0100 @@ -147042,7 +157067,7 @@ Date: Thu Aug 17 16:22:07 2006 -0400 It would be really nice if we only did this in one place instead of 40. commit 633b6a69f560c0a77dcff78fdef5fcf0041e2e04 -Merge: 95dbfcf 7da5144 +Merge: 95dbfcf882 7da51447ea Author: Daniel Stone Date: Thu Aug 17 21:25:14 2006 +0300 @@ -147150,21 +157175,21 @@ Date: Tue Aug 15 15:23:53 2006 +0300 Fix debug_events prototype. commit d003bada3352ec7d734498c4c732904876a9d1e2 -Merge: d6433be a815b9b +Merge: d6433be3cc a815b9b990 Author: Daniel Stone Date: Sat Aug 12 22:48:55 2006 +0300 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug commit a815b9b990e068f02d9cbba2b17f2cc3a30a9310 -Merge: 37943e2 984babe +Merge: 37943e2f1a 984babe86b Author: George Sapountzis Date: Sat Aug 12 21:58:33 2006 +0300 Merge branch 'master' of git+ssh://gsap7@git.freedesktop.org/git/xorg/xserver commit d6433be3cca807dd78fbb1f45d9ba0212283083d -Merge: 2bf9e3d 984babe +Merge: 2bf9e3dc1e 984babe86b Author: Daniel Stone Date: Sat Aug 12 21:50:52 2006 +0300 @@ -147223,7 +157248,7 @@ Date: Sat Aug 12 19:25:06 2006 +0300 Define HAVE_EXECINFO_H as well as HAVE_BACKTRACE, when we find execinfo.h. commit 26c3cd1c9e3f52548389817a6d89a377e20c4269 -Merge: 008aa7e c4951e0 +Merge: 008aa7eb6e c4951e0a6b Author: Daniel Stone Date: Sat Aug 12 18:58:18 2006 +0300 @@ -147252,7 +157277,7 @@ Date: Thu Aug 10 20:43:15 2006 -0400 mode. Also add M_T_PREFERRED bit, to select a 'best' mode out of a set. commit c2535f67923bde0bfb0e72363467110806e2f40f -Merge: c0cb8d1 db82e12 +Merge: c0cb8d1fb8 db82e12fac Author: Alan Coopersmith Date: Thu Aug 10 10:37:59 2006 -0700 @@ -147274,7 +157299,7 @@ Date: Thu Aug 10 20:28:06 2006 +0300 auto. commit 1a5561c4ecccaf32b03c41373adf376100d457aa -Merge: 190f229 db82e12 +Merge: 190f229ed7 db82e12fac Author: Ian Romanick Date: Thu Aug 10 10:20:37 2006 -0700 @@ -147295,7 +157320,7 @@ Date: Thu Aug 10 18:02:47 2006 +0300 XKB (and thus don't need to count the extra repeat events). commit 172d45b9b75f95c997d1e9358040eead496e2a06 -Merge: 3832a3d db82e12 +Merge: 3832a3d7db db82e12fac Author: Daniel Stone Date: Thu Aug 10 14:14:54 2006 +0300 @@ -147340,7 +157365,7 @@ Date: Wed Aug 9 14:48:51 2006 -0400 Remove the bc flag from the -help text, since it's gone. commit 767f372dd02232469f9fd804b811a17eaf762e1e -Merge: c4f5de6 462bb61 +Merge: c4f5de6cc3 462bb61b0f Author: Tilman Sauerbeck Date: Wed Aug 9 20:23:30 2006 +0200 @@ -147358,7 +157383,7 @@ Date: Wed Aug 9 20:21:52 2006 +0200 hooks. commit 5506b4ad200745236f997c121e8200179c47b749 -Merge: 4be9abb 462bb61 +Merge: 4be9abb850 462bb61b0f Author: Daniel Stone Date: Wed Aug 9 07:21:01 2006 +0300 @@ -147419,7 +157444,7 @@ Date: Tue Aug 8 14:54:10 2006 +0300 Sending MapNotify is more correct in this case than NKN, so do that. commit 31089816317f27c668b12a15c74fdd226a8df9f7 -Merge: ab3ebfe 12dbd8a +Merge: ab3ebfefdb 12dbd8a02f Author: Daniel Stone Date: Tue Aug 8 12:01:12 2006 +0300 @@ -147543,7 +157568,7 @@ Date: Mon Aug 7 16:51:09 2006 +0300 memcpy events into our event structure instead of doing pointer assignment. commit c85e64cba1d2d88f676ca7cf23b52a6f8219e90e -Merge: a406f6b f54b71b +Merge: a406f6bfea f54b71b772 Author: Daniel Stone Date: Mon Aug 7 15:54:55 2006 +0300 @@ -147630,7 +157655,7 @@ Date: Wed Aug 2 09:55:32 2006 -0700 Remove pciConfigPtr and all of the associated cruft. commit 966ebd3d2d84b440e89504d055a0e937303ed11d -Merge: a941766 39169fd +Merge: a94176627c 39169fd373 Author: Ian Romanick Date: Wed Aug 2 08:14:58 2006 -0700 @@ -147685,14 +157710,14 @@ Date: Mon Jul 31 13:54:36 2006 -0700 Build fixes for last pull from HEAD. commit 65dc25d8f86b962f2adc765a9ff327419f98092b -Merge: 69533fc b74c845 +Merge: 69533fc04f b74c845a12 Author: Ian Romanick Date: Mon Jul 31 12:30:30 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit b74c845a1233f78b841ff8840272c50873300c20 -Merge: 3112a6c 02daa6b +Merge: 3112a6c4f2 02daa6bb10 Author: Ian Romanick Date: Mon Jul 31 10:26:06 2006 -0700 @@ -147716,7 +157741,7 @@ Date: Mon Jul 31 17:32:05 2006 +0100 and GC stripple and tile pixmaps. commit 69533fc04f38c67fd424776c5191a4ba57ba8c8f -Merge: ef1aeca 24051ef +Merge: ef1aecaaf6 24051ef974 Author: Ian Romanick Date: Mon Jul 31 09:26:04 2006 -0700 @@ -147724,8 +157749,8 @@ Date: Mon Jul 31 09:26:04 2006 -0700 Conflicts: - hw/xfree86/Makefile.am - hw/xfree86/common/xf86AutoConfig.c + hw/xfree86/Makefile.am + hw/xfree86/common/xf86AutoConfig.c commit 24051ef97406f28c102cf46a78223400b61fdae2 Author: Daniel Stone @@ -147764,7 +157789,7 @@ Date: Sun Jul 30 11:08:47 2006 +0300 remove README (which doesn't exist) from EXTRA_DIST commit 87fe85f38b6f781bf0e2eb555526e3d77779f9fa -Merge: 3518e2d 654619d +Merge: 3518e2d0de 654619d76c Author: Daniel Stone Date: Sun Jul 30 10:51:34 2006 +0300 @@ -147862,7 +157887,7 @@ Date: Wed Jul 26 13:25:13 2006 -0700 Pass correct pointer to xf86MapLegacyIO. commit 3518e2d0debc97e2bacdefe604b280e7fdfdd216 -Merge: eb7733a 3821f6a +Merge: eb7733a48a 3821f6aeaa Author: Daniel Stone Date: Wed Jul 26 11:29:21 2006 +0300 @@ -147889,7 +157914,7 @@ Date: Tue Jul 25 15:38:09 2006 -0700 pci_device_get_bridge_buses can be used. commit 380b51d605a82c98082a2cebd70a0d1d0735eaa7 -Merge: 82f6b7e 8977b07 +Merge: 82f6b7e75e 8977b07434 Author: Ian Romanick Date: Tue Jul 25 11:30:04 2006 -0700 @@ -147897,14 +157922,14 @@ Date: Tue Jul 25 11:30:04 2006 -0700 Conflicts: - hw/xfree86/common/xf86Init.c - hw/xfree86/int10/pci.c - hw/xfree86/scanpci/xf86PciData.h - hw/xfree86/scanpci/xf86PciStdIds.h - hw/xfree86/scanpci/xf86PciStr.h - hw/xfree86/scanpci/xf86ScanPci.h - hw/xfree86/utils/pcitweak/pcitweak.c - hw/xfree86/utils/scanpci/scanpci.c + hw/xfree86/common/xf86Init.c + hw/xfree86/int10/pci.c + hw/xfree86/scanpci/xf86PciData.h + hw/xfree86/scanpci/xf86PciStdIds.h + hw/xfree86/scanpci/xf86PciStr.h + hw/xfree86/scanpci/xf86ScanPci.h + hw/xfree86/utils/pcitweak/pcitweak.c + hw/xfree86/utils/scanpci/scanpci.c Re-removed most of the conflicting files. @@ -147987,7 +158012,7 @@ Date: Sun Jul 23 19:02:12 2006 -0400 Allow XOpenDevice on closed devices. commit e73e5e2a4d8f22889d840a7719479f9af686cb9c -Merge: a73cef1 8977b07 +Merge: a73cef1f00 8977b07434 Author: Daniel Stone Date: Sat Jul 22 13:56:30 2006 -0400 @@ -148000,7 +158025,7 @@ Date: Sun Jul 23 03:36:47 2006 +1000 glx: fix typo from tag removal commit a73cef1f005ca66db18e952e676ee5a21b829700 -Merge: 672ca15 70869fc +Merge: 672ca156bf 70869fc677 Author: Daniel Stone Date: Sat Jul 22 12:07:22 2006 -0400 @@ -148043,7 +158068,7 @@ Date: Fri Jul 21 19:16:38 2006 -0700 Fix stupid typos. commit 672ca156bfb11440e6e234650bfba9d38e1edb52 -Merge: d14d91f 6cf844a +Merge: d14d91f094 6cf844ab69 Author: Daniel Stone Date: Fri Jul 21 19:58:42 2006 -0400 @@ -148076,7 +158101,7 @@ Date: Fri Jul 21 16:47:45 2006 -0700 which in turn allows the elimination of hw/xfree86/int10/pci.c. commit 87a6346bf7f086b5f98b2b2ecd52f27efe864e56 -Merge: b73fb2a 0486d39 +Merge: b73fb2ae35 0486d3966d Author: Daniel Stone Date: Fri Jul 21 19:36:25 2006 -0400 @@ -148091,7 +158116,7 @@ Date: Fri Jul 21 19:35:04 2006 -0400 XkbSA_XFree86Private. commit b73fb2ae35a82e0bdd48f01132e971fb84946ff1 -Merge: e7ac27a aff404f +Merge: e7ac27ad81 aff404f293 Author: Daniel Stone Date: Fri Jul 21 19:30:26 2006 -0400 @@ -148113,7 +158138,7 @@ Date: Fri Jul 21 19:10:26 2006 -0400 Ugh. commit 7465010d59ec435bd00b738f0cef766b352dc7eb -Merge: 1d31ed7 0aaac95 +Merge: 1d31ed7782 0aaac95b0d Author: Daniel Stone Date: Fri Jul 21 19:05:41 2006 -0400 @@ -148139,7 +158164,7 @@ Date: Fri Jul 21 18:41:46 2006 -0400 Remove the loader's required and referenced symbol lists, dead code. commit 07ad92d2c4cb07db8487d76efc822fd7b88137cb -Merge: 18624a9 22db3fd +Merge: 18624a9b7c 22db3fdb54 Author: Ian Romanick Date: Fri Jul 21 15:25:35 2006 -0700 @@ -148147,9 +158172,9 @@ Date: Fri Jul 21 15:25:35 2006 -0700 Conflicts: - hw/xfree86/common/xf86DoScanPci.c - hw/xfree86/common/xf86Init.c - hw/xfree86/common/xf86pciBus.c + hw/xfree86/common/xf86DoScanPci.c + hw/xfree86/common/xf86Init.c + hw/xfree86/common/xf86pciBus.c commit aff404f293ed86a44a093a51a9f11e79e6c3f4f6 Author: Adam Jackson @@ -148170,7 +158195,7 @@ Date: Thu Jul 20 18:19:07 2006 -0700 Fix the RandR failure path for rotated screens. commit 22db3fdb54d2f7f6b72638b46c186af6db04e214 -Merge: 2f98841 93cd538 +Merge: 2f98841fde 93cd53860c Author: Ian Romanick Date: Fri Jul 21 13:55:37 2006 -0700 @@ -148413,7 +158438,7 @@ Date: Thu Jul 20 17:33:13 2006 -0400 Remove the DDXTIME conditional, for being unused. commit c69c00d6523a35232a32e54a533811fc2b37815a -Merge: 4636935 84683f1 +Merge: 46369350d4 84683f19b4 Author: Ian Romanick Date: Thu Jul 20 12:08:38 2006 -0700 @@ -148487,7 +158512,7 @@ Date: Thu Jul 13 21:10:48 2006 -0700 Modify linuxGetSizesStruct to use pci_device instead of pciConfigPtr. commit 12595a77d6c2f037f48dfe751bdc10505b3317df -Merge: 37838de 4c225a3 +Merge: 37838de62e 4c225a3a8b Author: Ian Romanick Date: Thu Jul 13 12:48:03 2006 -0700 @@ -148528,7 +158553,7 @@ Date: Sat Jul 8 21:57:07 2006 +0100 Fix crash in Xephyr when running on host X with keymap width < 4 ( i.e xvnc ) commit 21e3e3ca298dce22e5fad6ef38aa6fe9736a1d3b -Merge: e805621 39b2f7b +Merge: e805621894 39b2f7b218 Author: Matthew Allum Date: Sat Jul 8 21:13:52 2006 +0100 @@ -148615,7 +158640,7 @@ Date: Thu Jul 6 17:39:14 2006 -0400 Switch the default mouse device on Linux to /dev/input/mice. commit 37838de62edc474f44c0a48bd56470a6c23f8956 -Merge: fd49a0d 8d07ee0 +Merge: fd49a0dcc1 8d07ee070e Author: Ian Romanick Date: Thu Jul 6 13:01:57 2006 -0700 @@ -148623,7 +158648,7 @@ Date: Thu Jul 6 13:01:57 2006 -0700 Conflicts: - hw/xfree86/os-support/bus/linuxPci.c + hw/xfree86/os-support/bus/linuxPci.c commit 8d07ee070ecf0d403d9d27c80764d343b80af6f0 Author: Ian Romanick @@ -148641,7 +158666,7 @@ Date: Thu Jul 6 14:22:33 2006 -0400 Spotted by Aaron Plattner. commit fd49a0dcc13280cf195bd6c7ee0f23d0840cb665 -Merge: e66e7b4 28b95fd +Merge: e66e7b48e1 28b95fd9d1 Author: Ian Romanick Date: Thu Jul 6 09:52:15 2006 -0700 @@ -148699,7 +158724,7 @@ Date: Wed Jun 28 15:59:01 2006 -0400 DoGetDrawableAttributes and __glXQueryContextInfoEXT. commit e66e7b48e15543f3753951a19376f0446759963a -Merge: a9d4842 eb35f81 +Merge: a9d4842893 eb35f812a5 Author: Ian Romanick Date: Wed Jul 5 15:21:36 2006 -0700 @@ -148758,7 +158783,7 @@ Date: Wed Jun 28 18:35:59 2006 +0200 Optimize out computing a gradient pixel if the mask value is 0. - Obtained from: kdrive CVS (DavidR XGL fb/ megapatch) + Obtained from: kdrive CVS (DavidR XGL fb/ megapatch) commit a838fb70c52a829872680f6a2a2e7dd6d2dc9247 Author: Eric Anholt @@ -148813,7 +158838,7 @@ Date: Sat Jul 1 12:34:36 2006 -0700 Missing close parenthesis in one of the setuid() fixes. commit 124a81eb389dfa510ac07ca93ee17c4c9d6e56ea -Merge: d3d6c5f 179737d +Merge: d3d6c5f4d0 179737d4a0 Author: Keith Packard Date: Sat Jul 1 11:12:50 2006 -0700 @@ -148841,7 +158866,7 @@ Date: Wed Jun 7 01:46:00 2006 -0700 Move variable declarations to start of blocks as required by c89 commit a9d4842893b65232d61fe4c63f074d30e81021d2 -Merge: 66cac9b 6bd4c25 +Merge: 66cac9b174 6bd4c25439 Author: Ian Romanick Date: Fri Jun 30 11:49:29 2006 -0700 @@ -148855,7 +158880,7 @@ Date: Mon Jun 26 01:52:24 2006 +0200 Updated for Solaris 10 changes to DDI commit 66cac9b17498497d939bfb7a4075bcee5a485e5f -Merge: 7c4e540 54d9acd +Merge: 7c4e540253 54d9acd511 Author: Ian Romanick Date: Wed Jun 28 14:11:49 2006 -0700 @@ -148892,14 +158917,14 @@ Date: Tue Jun 27 04:11:47 2006 +0200 cairo's clip-operator test. commit 7c4e54025345455f420cd2abaa7a40679689d3cb -Merge: 9d0a15d ff6b59a +Merge: 9d0a15dca5 ff6b59a0db Author: Ian Romanick Date: Mon Jun 26 14:39:44 2006 -0700 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework commit ff6b59a0dbadbe61a53e48c23965d3073d95791b -Merge: b3c8693 48c8715 +Merge: b3c869304c 48c871564d Author: Alan Coopersmith Date: Mon Jun 26 13:02:33 2006 -0700 @@ -148982,7 +159007,7 @@ Date: Wed Jun 21 09:30:59 2006 -0700 Add a manpage for EXA. commit 9d0a15dca56b14821cad474f9db9c332acb3b1e6 -Merge: 6c514ca d67fd10 +Merge: 6c514ca14c d67fd10696 Author: Ian Romanick Date: Thu Jun 22 16:21:10 2006 -0700 @@ -148990,7 +159015,7 @@ Date: Thu Jun 22 16:21:10 2006 -0700 Conflicts: - hw/xfree86/loader/xf86sym.c + hw/xfree86/loader/xf86sym.c commit 6c514ca14c2326c2cf82b73196429789d11e4a01 Author: Ian Romanick @@ -149018,7 +159043,7 @@ Date: Wed Jun 21 18:12:41 2006 -0700 Use XACE, not XCSECURITY to decide if SecurityLookup* are exported commit 3177dc498a955cd58cd6054a7c7e69724db4a59b -Merge: 3f19803 91dcac5 +Merge: 3f19803e0b 91dcac5295 Author: Alan Coopersmith Date: Wed Jun 21 18:06:06 2006 -0700 @@ -149031,7 +159056,7 @@ Date: Wed Jun 21 18:05:51 2006 -0700 APPGROUP requires both X-ACE & XC-SECURITY now commit 91dcac5295486cc55a34ad91704bfa483bd31eeb -Merge: d8135eb 77c947b +Merge: d8135eb9e4 77c947b900 Author: Adam Jackson Date: Wed Jun 21 20:49:30 2006 -0400 @@ -149058,7 +159083,7 @@ Date: Wed Jun 21 16:24:20 2006 -0700 Correct ifdef - should be XACE, not XSECURITY commit 90af38fa0c46c2081d2becac262a614c26ba6ef1 -Merge: 3e098ef 77c947b +Merge: 3e098efa35 77c947b900 Author: Alan Coopersmith Date: Wed Jun 21 16:23:31 2006 -0700 @@ -149066,7 +159091,7 @@ Date: Wed Jun 21 16:23:31 2006 -0700 Conflicts: - Xext/appgroup.c + Xext/appgroup.c commit 3e098efa35ba70ad4d5699af3130a3b02e1cb06e Author: Alan Coopersmith @@ -149085,7 +159110,7 @@ Date: Wed Jun 21 16:18:41 2006 -0700 of updates.) commit aa131c51e06e735d7b54cadf51205f703a3de4ef -Merge: 1708b0c 77aa701 +Merge: 1708b0c7d9 77aa701e89 Author: Ian Romanick Date: Wed Jun 21 14:39:52 2006 -0700 @@ -149153,7 +159178,7 @@ Date: Tue Jun 20 19:01:34 2006 -0700 - Added X-ACE sources to Xext/Makefile.am commit a46c06dab8392cf8012c7cc0b916de9a9e569671 -Merge: 49b368c d44b2a0 +Merge: 49b368c0bb d44b2a0a57 Author: Alan Coopersmith Date: Tue Jun 20 18:40:18 2006 -0700 @@ -149161,16 +159186,16 @@ Date: Tue Jun 20 18:40:18 2006 -0700 Conflicts: - Xext/appgroup.c - Xext/security.c - dix/devices.c - dix/dispatch.c - dix/dixutils.c - dix/events.c - dix/extension.c - dix/property.c - dix/window.c - os/access.c + Xext/appgroup.c + Xext/security.c + dix/devices.c + dix/dispatch.c + dix/dixutils.c + dix/events.c + dix/extension.c + dix/property.c + dix/window.c + os/access.c commit d44b2a0a57fb89741173c31676af0ccc822387dc Author: Alan Coopersmith @@ -149185,7 +159210,7 @@ Date: Tue Jun 20 18:14:27 2006 -0700 Move Xserver API for security extension to securitysrv.h commit 49b368c0bb04816c4a3579071c596b2398cae3ec -Merge: 63f6e6b 481d401 +Merge: 63f6e6bbfd 481d4012e7 Author: Alan Coopersmith Date: Tue Jun 20 16:22:39 2006 -0700 @@ -149198,7 +159223,7 @@ Date: Tue Jun 20 16:16:19 2006 -0700 Don't add -ldl to XORG_LIBS if it's not needed for dlopen commit 63f6e6bbfd0d3677e29621af982c9392ead98dd7 -Merge: 88ede2c 6df52fb +Merge: 88ede2cec7 6df52fb774 Author: Alan Coopersmith Date: Tue Jun 20 16:03:34 2006 -0700 @@ -149211,7 +159236,7 @@ Date: Tue Jun 20 16:02:55 2006 -0700 Delete code that's been inside #if 0 since X11R6.7. commit 75398cff82b56c0a8fc301e84e2087f59a61a360 -Merge: 1f91b57 2b58685 +Merge: 1f91b5726c 2b58685402 Author: Ian Romanick Date: Tue Jun 20 15:49:47 2006 -0700 @@ -149219,11 +159244,11 @@ Date: Tue Jun 20 15:49:47 2006 -0700 Conflicts: - hw/xfree86/loader/Makefile.am - hw/xfree86/loader/xf86sym.c + hw/xfree86/loader/Makefile.am + hw/xfree86/loader/xf86sym.c commit 88ede2cec79281a43cecb43ee6dec65770f82530 -Merge: 227a319 2b58685 +Merge: 227a319340 2b58685402 Author: Alan Coopersmith Date: Tue Jun 20 15:29:55 2006 -0700 @@ -149262,8 +159287,8 @@ Date: Mon Jun 19 22:13:22 2006 -0400 Cherry-picking patches: - 8a5ea68800b9d7dca90ff4e573ad8533852f1ea3 and - 4d755fe14274a7293748ce9aa666ab85df6297c5 + 8a5ea68800b9d7dca90ff4e573ad8533852f1ea3 and + 4d755fe14274a7293748ce9aa666ab85df6297c5 commit f818e0ab60da3779ab2602c6e6d3ff261b50917e Author: Eamon Walsh @@ -149273,7 +159298,7 @@ Date: Wed May 5 20:07:37 2004 +0000 (cherry picked from 0106715000196c7b349a0b4494b61545f0f5e138 commit) commit 0707eb33d6826e1300a905edea28c12134600b12 -Merge: 37f0ae0 98d17bb +Merge: 37f0ae0245 98d17bba71 Author: Alan Coopersmith Date: Mon Jun 19 17:09:51 2006 -0700 @@ -149326,7 +159351,7 @@ Date: Mon Jun 19 14:06:02 2006 -0700 Correct component ordering when fetching [ax]4b4g4r4 pixels. - Noticed by: rendercheck + Noticed by: rendercheck commit e1672a12eb70836a2ceec803d505294897ae8cd2 Author: Eric Anholt @@ -149438,7 +159463,7 @@ Date: Fri Jun 16 10:14:30 2006 -0700 hadn't been bumped. commit 72ac20c0e878ad48ff61f7e846cbf1005a4eb435 -Merge: fc3e814 b900883 +Merge: fc3e81473a b90088321e Author: Ian Romanick Date: Tue Jun 13 21:13:02 2006 -0700 @@ -149465,7 +159490,7 @@ Date: Mon Jun 12 20:12:31 2006 +0200 Provide option to report damage after operation is complete. commit fc3e81473a98d3b932faa73c0c01c21366a48a9e -Merge: 4bedaad 041ef23 +Merge: 4bedaad17d 041ef23192 Author: Ian Romanick Date: Mon Jun 12 09:41:06 2006 -0700 @@ -149502,7 +159527,7 @@ Date: Fri Jun 9 16:08:06 2006 -0700 another function that was already in that file. commit 7810d87cd6ae9316d88f6a2e7696deb8837cec27 -Merge: dcfaa9f caad8b7 +Merge: dcfaa9f4f8 caad8b724b Author: Ian Romanick Date: Fri Jun 9 15:16:50 2006 -0700 @@ -149574,7 +159599,7 @@ Date: Fri Jun 9 09:51:28 2006 -0700 based on FIXME in mi/miinitext.c commit dcfaa9f4f8fb10b75be50c9a49ccd88caf6d0f6a -Merge: af9afe4 576e6fb +Merge: af9afe4cc5 576e6fb112 Author: Ian Romanick Date: Thu Jun 8 15:03:00 2006 -0700 @@ -149594,7 +159619,7 @@ Date: Thu Jun 8 17:46:53 2006 -0400 Bug #7121: fix clipboard handling in Xming (Colin Harrison) commit af9afe4cc50df973bea2293a803f7dfdefaa6411 -Merge: caffac3 3930da3 +Merge: caffac3843 3930da3f62 Author: Ian Romanick Date: Thu Jun 8 11:37:09 2006 -0700 @@ -149671,7 +159696,7 @@ Date: Thu Jun 8 10:40:24 2006 -0700 if anyone really cares about this code. commit caffac38432009e8dc01e7d3e72a7fa6fba2f078 -Merge: c5b3aa1 9fa7372 +Merge: c5b3aa120b 9fa73721f0 Author: Ian Romanick Date: Thu Jun 8 10:38:43 2006 -0700 @@ -149782,7 +159807,7 @@ Date: Wed Jun 7 17:44:06 2006 -0700 when the symbol PCI_DOM_FROM_TAG couldn't be resolved at run-time. commit 23182315f34e3a0065739b43b15d4560e75b41a1 -Merge: bc05158 757f40f +Merge: bc05158a5a 757f40fca5 Author: Ian Romanick Date: Wed Jun 7 17:03:48 2006 -0700 @@ -149819,7 +159844,7 @@ Date: Wed Jun 7 14:09:13 2006 -0700 updated the .gitignore file with more auto-generated files commit bc05158a5ab00c548e4b04b5638afe07bc702260 -Merge: 46f55f5 cc46580 +Merge: 46f55f5dea cc465800dd Author: Ian Romanick Date: Wed Jun 7 14:09:12 2006 -0700 @@ -149839,7 +159864,7 @@ Date: Wed Jun 7 14:03:35 2006 -0700 Fix compiler warnings about SetVendorRelease and SetVendorString commit 785c9789704ed142fe98cd17b5995e4a95b7141f -Merge: 21ebcfd 36d786e +Merge: 21ebcfd702 36d786e9f0 Author: Greg Kroah-Hartman Date: Wed Jun 7 13:20:21 2006 -0700 diff --git a/xserver/Makefile.in b/xserver/Makefile.in index 04a801446..e7149d1c8 100644 --- a/xserver/Makefile.in +++ b/xserver/Makefile.in @@ -54,13 +54,14 @@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/xorg-server.pc.in \ $(srcdir)/xserver.ent.in $(top_srcdir)/configure COPYING \ - ChangeLog INSTALL TODO config.guess config.sub depcomp \ - install-sh ltmain.sh missing ylwrap + ChangeLog INSTALL config.guess config.sub depcomp install-sh \ + ltmain.sh missing ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -357,6 +358,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -387,7 +391,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -482,6 +489,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/TODO b/xserver/TODO deleted file mode 100644 index 85a2b3105..000000000 --- a/xserver/TODO +++ /dev/null @@ -1,92 +0,0 @@ -tree inheritance: - -init-cleanup - -driver todo for megamerge: -nuke ddc1 paths -nuke weak functions -i810 kms -mach64 LinearVidMem removal -openbsd pciaccess fd inversion -fix linux int10 ReadBIOS and/or merge int10 and generic -geode/sis/xgi *apVidMem removal -i128/mga BiosBase removal -sis virtualFrom removal -mach64/rendition max[HV]Value removal -cirrus should prefer 16bpp -external RAMDAC code motion for glint/s3/tga -freedreno oslib.h detangle - -unify xinerama protocol ~-1kloc -- add screen id token -- add removal api -- add primary flag dealie? - -fold up pre-1.2 randr -s/xf86DefaultModes/DMTModes/ -100 -GLX for Xnest (works-ish on other branch) -rootless-merge merge -rootless-using xwayland -glxproxy something something, -15kloc if you can delete it... -maybe merge int10/vbe -fix shadow for multiple pixmaps -top-level loader (almost, ported api, needs motion) -loadable glx for all ddxes -un-special-case colormap privates -redo fbbits a la sna -merge the one snafb bugfix -render: FindGlyph -> FindGlyphs -miValidateTree: 'forward' might be a pessimization -RegionOp's overlapFunc is constant -detach dmx from fb -destroywindow should return void -redo de-sdking of opaque.h - -PRIVATE_COLORMAP -only reason this is special is xf86HandleColormaps, which the ddx drivers -call _after_ creating default colormap, but which registers a devprivate. -should find some symbol always called before xf86HC but never called in -randr 1.2 drivers? xf86ValidateModes perhaps? - -XRT Must Die -Class: Drawable -Types: Colormap, Damage, GC, Picture, Pixmap, Window - -colormaps: -CreateColormap has a special case for the default cmap -uninstall is skipped for server cmaps? because default? -WindowOptRec->colormap is an id not a pointer -ScreenRec->defColormap is an id not a pointer, but, okay? -CopyColormapAndFree is... odd. -AllocColor's CMAPENTRY special case should be moved -ListInstalledColormaps is godawful -not clear why vfb/nest duplicate micmap so much - -pixmap/window: -aaaaaaaaaa - ---- - -FakeClientID(0): -weird lifetimes: - screensaver window - applewm/winwm event resource -visuals should use separate allocator (fbconfigs too?) -GetNewFontClientID? -hmm: xwin GenerateAuthorization, auth .Add - -FakeClientID(client->index): - dri2 add_frame_event hurrr - DRI2CreateDrawable2 - ---- - -dmx wraps render, fuck. - -Create/Free GlyphSet: Annoying because GlyphSets are display-wide, so there's -no obvious place to add a wrap chain. Likewise Add/FreeGlyphs, although there -the problem is that glyphs embed their own per-screen list! Fuck sake. - -RenderCompositeGlyphs is correspondingly weird. - -Not entirely sure why SetPictureTransform/Filter are wrapped. diff --git a/xserver/Xext/Makefile.in b/xserver/Xext/Makefile.in index 7e98c4db6..244e9df2f 100644 --- a/xserver/Xext/Makefile.in +++ b/xserver/Xext/Makefile.in @@ -69,9 +69,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -387,6 +388,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -417,7 +421,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -512,6 +519,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/Xext/geext.c b/xserver/Xext/geext.c index 6285f69f7..6312f248b 100644 --- a/xserver/Xext/geext.c +++ b/xserver/Xext/geext.c @@ -145,28 +145,10 @@ SProcGEDispatch(ClientPtr client) return (*SProcGEVector[stuff->ReqType]) (client); } -/** - * Called when a new client inits a connection to the X server. - * - * We alloc a simple struct to store the client's major/minor version. Can be - * used in the furture for versioning support. - */ -static void -GEClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - GEClientInfoPtr pGEClient = GEGetClient(pClient); - - pGEClient->major_version = 0; - pGEClient->minor_version = 0; -} - /* Reset extension. Called on server shutdown. */ static void GEResetProc(ExtensionEntry * extEntry) { - DeleteCallback(&ClientStateCallback, GEClientCallback, 0); EventSwapVector[GenericEvent] = NotImplemented; } @@ -205,10 +187,6 @@ GEExtensionInit(void) (&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec))) FatalError("GEExtensionInit: GE private request failed.\n"); - if (!AddCallback(&ClientStateCallback, GEClientCallback, 0)) { - FatalError("GEExtensionInit: register client callback failed.\n"); - } - if ((extEntry = AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, SProcGEDispatch, diff --git a/xserver/Xext/panoramiXprocs.c b/xserver/Xext/panoramiXprocs.c index 18f3ac715..f31b1e054 100644 --- a/xserver/Xext/panoramiXprocs.c +++ b/xserver/Xext/panoramiXprocs.c @@ -1050,7 +1050,7 @@ PanoramiXClearToBackground(ClientPtr client) int PanoramiXCopyArea(ClientPtr client) { - int j, result, srcx, srcy, dstx, dsty; + int j, result, srcx, srcy, dstx, dsty, width, height; PanoramiXRes *gc, *src, *dst; Bool srcIsRoot = FALSE; Bool dstIsRoot = FALSE; @@ -1091,6 +1091,8 @@ PanoramiXCopyArea(ClientPtr client) srcy = stuff->srcY; dstx = stuff->dstX; dsty = stuff->dstY; + width = stuff->width; + height = stuff->height; if ((dst->type == XRT_PIXMAP) && (src->type == XRT_WINDOW)) { DrawablePtr drawables[MAXSCREENS]; DrawablePtr pDst; @@ -1105,13 +1107,12 @@ PanoramiXCopyArea(ClientPtr client) return rc; } - pitch = PixmapBytePad(stuff->width, drawables[0]->depth); - if (!(data = calloc(stuff->height, pitch))) + pitch = PixmapBytePad(width, drawables[0]->depth); + if (!(data = calloc(height, pitch))) return BadAlloc; - XineramaGetImageData(drawables, srcx, srcy, - stuff->width, stuff->height, ZPixmap, ~0, data, - pitch, srcIsRoot); + XineramaGetImageData(drawables, srcx, srcy, width, height, ZPixmap, ~0, + data, pitch, srcIsRoot); FOR_NSCREENS_BACKWARD(j) { stuff->gc = gc->info[j].id; @@ -1123,14 +1124,63 @@ PanoramiXCopyArea(ClientPtr client) } (*pGC->ops->PutImage) (pDst, pGC, pDst->depth, dstx, dsty, - stuff->width, stuff->height, - 0, ZPixmap, data); - + width, height, 0, ZPixmap, data); if (dstShared) break; } - free(data); + + if (pGC->graphicsExposures) { + RegionRec rgn; + int dx, dy; + BoxRec sourceBox; + + dx = drawables[0]->x; + dy = drawables[0]->y; + if (srcIsRoot) { + dx += screenInfo.screens[0]->x; + dy += screenInfo.screens[0]->y; + } + + sourceBox.x1 = min(srcx + dx, 0); + sourceBox.y1 = min(srcy + dy, 0); + sourceBox.x2 = max(sourceBox.x1 + width, 32767); + sourceBox.y2 = max(sourceBox.y1 + height, 32767); + + RegionInit(&rgn, &sourceBox, 1); + + /* subtract the (screen-space) clips of the source drawables */ + FOR_NSCREENS(j) { + ScreenPtr screen = screenInfo.screens[j]; + RegionPtr sd; + + if (pGC->subWindowMode == IncludeInferiors) + sd = NotClippedByChildren((WindowPtr)drawables[j]); + else + sd = &((WindowPtr)drawables[j])->clipList; + + if (srcIsRoot) + RegionTranslate(&rgn, -screen->x, -screen->y); + + RegionSubtract(&rgn, &rgn, sd); + + if (srcIsRoot) + RegionTranslate(&rgn, screen->x, screen->y); + + if (pGC->subWindowMode == IncludeInferiors) + RegionDestroy(sd); + } + + /* -dx/-dy to get back to dest-relative, plus request offsets */ + RegionTranslate(&rgn, -dx + dstx, -dy + dsty); + + /* intersect with gc clip; just one screen is fine because pixmap */ + RegionIntersect(&rgn, &rgn, pGC->pCompositeClip); + + /* and expose */ + SendGraphicsExpose(client, &rgn, dst->info[0].id, X_CopyArea, 0); + RegionUninit(&rgn); + } } else { DrawablePtr pDst = NULL, pSrc = NULL; diff --git a/xserver/Xext/security.c b/xserver/Xext/security.c index 04382ff4d..8cb3a2c73 100644 --- a/xserver/Xext/security.c +++ b/xserver/Xext/security.c @@ -63,7 +63,7 @@ typedef struct { XID authId; } SecurityStateRec; -/* Extensions that untrusted clients shouldn't have access to */ +/* The only extensions that untrusted clients have access to */ static const char *SecurityTrustedExtensions[] = { "XC-MISC", "BIG-REQUESTS", diff --git a/xserver/Xext/shape.c b/xserver/Xext/shape.c index 2fc789ec1..142f9c178 100644 --- a/xserver/Xext/shape.c +++ b/xserver/Xext/shape.c @@ -881,6 +881,7 @@ SendShapeNotify(WindowPtr pWin, int which) default: return; } + UpdateCurrentTimeIf(); for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) { xShapeNotifyEvent se = { .type = ShapeNotify + ShapeEventBase, diff --git a/xserver/Xext/shm.c b/xserver/Xext/shm.c index 3201e8d71..b9e7f1821 100644 --- a/xserver/Xext/shm.c +++ b/xserver/Xext/shm.c @@ -153,7 +153,6 @@ static ShmFuncs fbFuncs = { fbShmCreatePixmap, NULL }; } #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__) -#include static Bool badSysCall = FALSE; @@ -170,7 +169,7 @@ CheckForShmSyscall(void) int shmid = -1; /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ - oldHandler = signal(SIGSYS, SigSysHandler); + oldHandler = OsSignal(SIGSYS, SigSysHandler); badSysCall = FALSE; shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); @@ -183,7 +182,7 @@ CheckForShmSyscall(void) /* Allocation failed */ badSysCall = TRUE; } - signal(SIGSYS, oldHandler); + OsSignal(SIGSYS, oldHandler); return !badSysCall; } @@ -992,7 +991,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client) RT_PIXMAP, pMap, RT_NONE, NULL, DixCreateAccess); if (result != Success) { pDraw->pScreen->DestroyPixmap(pMap); - return result; + break; } dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc); shmdesc->refcnt++; @@ -1009,7 +1008,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client) } } - if (result == BadAlloc) { + if (result != Success) { while (j--) FreeResource(newPix->info[j].id, RT_NONE); free(newPix); @@ -1214,7 +1213,8 @@ shm_tmpfile(void) if (fd < 0) return -1; unlink(template); - if (fcntl(fd, F_GETFD, &flags) >= 0) { + flags = fcntl(fd, F_GETFD); + if (flags != -1) { flags |= FD_CLOEXEC; (void) fcntl(fd, F_SETFD, &flags); } diff --git a/xserver/Xext/sleepuntil.c b/xserver/Xext/sleepuntil.c index 993c028b8..68a7a9bee 100644 --- a/xserver/Xext/sleepuntil.c +++ b/xserver/Xext/sleepuntil.c @@ -63,14 +63,11 @@ static void ClientAwaken(ClientPtr /* client */ , static int SertafiedDelete(void * /* value */ , XID /* id */ ); -static void SertafiedBlockHandler(void * /* data */ , - OSTimePtr /* wt */ , - void * /* LastSelectMask */ - ); -static void SertafiedWakeupHandler(void * /* data */ , - int /* i */ , - void * /* LastSelectMask */ - ); +static void SertafiedBlockHandler(void *data, + void *timeout); + +static void SertafiedWakeupHandler(void *data, + int i); int ClientSleepUntil(ClientPtr client, @@ -154,7 +151,7 @@ SertafiedDelete(void *value, XID id) } static void -SertafiedBlockHandler(void *data, OSTimePtr wt, void *LastSelectMask) +SertafiedBlockHandler(void *data, void *wt) { SertafiedPtr pReq, pNext; unsigned long delay; @@ -186,7 +183,7 @@ SertafiedBlockHandler(void *data, OSTimePtr wt, void *LastSelectMask) } static void -SertafiedWakeupHandler(void *data, int i, void *LastSelectMask) +SertafiedWakeupHandler(void *data, int i) { SertafiedPtr pReq, pNext; TimeStamp now; diff --git a/xserver/Xext/sync.c b/xserver/Xext/sync.c index 41405619c..63350685c 100644 --- a/xserver/Xext/sync.c +++ b/xserver/Xext/sync.c @@ -984,20 +984,7 @@ SyncCreateSystemCounter(const char *name, SyncSystemCounterBracketValues BracketValues ) { - SyncCounter *pCounter; - - /* this function may be called before SYNC has been initialized, so we - * have to make sure RTCounter is created. - */ - if (RTCounter == 0) { - RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter"); - if (RTCounter == 0) { - return NULL; - } - xorg_list_init(&SysCounterList); - } - - pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial); + SyncCounter *pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial); if (pCounter) { SysCounterInfo *psci; @@ -1912,7 +1899,7 @@ ProcSyncCreateFence(ClientPtr client) if (!AddResource(stuff->fid, RTFence, (void *) pFence)) return BadAlloc; - return client->noClientException; + return Success; } static int @@ -1953,7 +1940,7 @@ ProcSyncTriggerFence(ClientPtr client) miSyncTriggerFence(pFence); - return client->noClientException; + return Success; } static int @@ -1975,7 +1962,7 @@ ProcSyncResetFence(ClientPtr client) pFence->funcs.Reset(pFence); - return client->noClientException; + return Success; } static int @@ -1993,7 +1980,7 @@ ProcSyncDestroyFence(ClientPtr client) return rc; FreeResource(stuff->fid, RT_NONE); - return client->noClientException; + return Success; } static int @@ -2025,7 +2012,7 @@ ProcSyncQueryFence(ClientPtr client) } WriteToClient(client, sizeof(xSyncQueryFenceReply), &rep); - return client->noClientException; + return Success; } static int @@ -2103,7 +2090,7 @@ ProcSyncAwaitFence(ClientPtr client) SyncAwaitEpilogue(client, items, pAwaitUnion); - return client->noClientException; + return Success; } /* @@ -2501,10 +2488,8 @@ SyncExtensionInit(void) for (s = 0; s < screenInfo.numScreens; s++) miSyncSetup(screenInfo.screens[s]); - if (RTCounter == 0) { - RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter"); - xorg_list_init(&SysCounterList); - } + RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter"); + xorg_list_init(&SysCounterList); RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm"); RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait"); RTFence = CreateNewResourceType(FreeFence, "SyncFence"); @@ -2571,8 +2556,8 @@ static XSyncValue *pnext_time; *** Server Block Handler *** code inspired by multibuffer extension (now deprecated) */ - /*ARGSUSED*/ static void -ServertimeBlockHandler(void *env, struct timeval **wt, void *LastSelectMask) +/*ARGSUSED*/ static void +ServertimeBlockHandler(void *env, void *wt) { XSyncValue delay; unsigned long timeout; @@ -2597,8 +2582,8 @@ ServertimeBlockHandler(void *env, struct timeval **wt, void *LastSelectMask) /* *** Wakeup Handler */ - /*ARGSUSED*/ static void -ServertimeWakeupHandler(void *env, int rc, void *LastSelectMask) +/*ARGSUSED*/ static void +ServertimeWakeupHandler(void *env, int rc) { if (pnext_time) { GetTime(); @@ -2673,7 +2658,7 @@ IdleTimeQueryValue(void *pCounter, CARD64 * pValue_return) } static void -IdleTimeBlockHandler(void *pCounter, struct timeval **wt, void *LastSelectMask) +IdleTimeBlockHandler(void *pCounter, void *wt) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); @@ -2766,7 +2751,7 @@ IdleTimeCheckBrackets(SyncCounter *counter, XSyncValue idle, XSyncValue *less, X } static void -IdleTimeWakeupHandler(void *pCounter, int rc, void *LastSelectMask) +IdleTimeWakeupHandler(void *pCounter, int rc) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); diff --git a/xserver/Xext/vidmode.c b/xserver/Xext/vidmode.c index dd92caf53..76055c89a 100644 --- a/xserver/Xext/vidmode.c +++ b/xserver/Xext/vidmode.c @@ -1374,7 +1374,7 @@ ProcVidModeGetDotClocks(ClientPtr client) WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), &rep); if (!ClockProg) { for (n = 0; n < numClocks; n++) { - dotclock = *Clocks++; + dotclock = Clocks[n]; if (client->swapped) { WriteSwappedDataToClient(client, 4, (char *) &dotclock); } diff --git a/xserver/Xext/xace.c b/xserver/Xext/xace.c index fcb38db8c..f8f8d139b 100644 --- a/xserver/Xext/xace.c +++ b/xserver/Xext/xace.c @@ -33,28 +33,17 @@ _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = { 0 }; /* Special-cased hook functions. Called by Xserver. */ +#undef XaceHookDispatch int XaceHookDispatch(ClientPtr client, int major) { - /* Call the audit begin callback, there is no return value. */ - XaceAuditRec rec = { client, 0 }; - CallCallbacks(&XaceHooks[XACE_AUDIT_BEGIN], &rec); - - if (major < 128) { - /* Call the core dispatch hook */ - XaceCoreDispatchRec drec = { client, Success /* default allow */ }; - CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &drec); - return drec.status; - } - else { - /* Call the extension dispatch hook */ - ExtensionEntry *ext = GetExtensionEntry(major); - XaceExtAccessRec erec = { client, ext, DixUseAccess, Success }; - if (ext) - CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &erec); - /* On error, pretend extension doesn't exist */ - return (erec.status == Success) ? Success : BadRequest; - } + /* Call the extension dispatch hook */ + ExtensionEntry *ext = GetExtensionEntry(major); + XaceExtAccessRec erec = { client, ext, DixUseAccess, Success }; + if (ext) + CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &erec); + /* On error, pretend extension doesn't exist */ + return (erec.status == Success) ? Success : BadRequest; } int @@ -74,14 +63,6 @@ XaceHookSelectionAccess(ClientPtr client, Selection ** ppSel, Mask access_mode) return rec.status; } -void -XaceHookAuditEnd(ClientPtr ptr, int result) -{ - XaceAuditRec rec = { ptr, result }; - /* call callbacks, there is no return value. */ - CallCallbacks(&XaceHooks[XACE_AUDIT_END], &rec); -} - /* Entry point for hook functions. Called by Xserver. */ int @@ -255,10 +236,10 @@ XaceCensorImage(ClientPtr client, BoxRec imageBox; int nRects; - imageBox.x1 = x; - imageBox.y1 = y; - imageBox.x2 = x + w; - imageBox.y2 = y + h; + imageBox.x1 = pDraw->x + x; + imageBox.y1 = pDraw->y + y; + imageBox.x2 = pDraw->x + x + w; + imageBox.y2 = pDraw->y + y + h; RegionInit(&imageRegion, &imageBox, 1); RegionNull(&censorRegion); @@ -283,7 +264,7 @@ XaceCensorImage(ClientPtr client, goto failSafe; } for (pBox = RegionRects(&censorRegion), i = 0; i < nRects; i++, pBox++) { - pRects[i].x = pBox->x1; + pRects[i].x = pBox->x1 - imageBox.x1; pRects[i].y = pBox->y1 - imageBox.y1; pRects[i].width = pBox->x2 - pBox->x1; pRects[i].height = pBox->y2 - pBox->y1; diff --git a/xserver/Xext/xace.h b/xserver/Xext/xace.h index 6a8d0c4bd..8c8723288 100644 --- a/xserver/Xext/xace.h +++ b/xserver/Xext/xace.h @@ -52,9 +52,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define XACE_SCREENSAVER_ACCESS 12 #define XACE_AUTH_AVAIL 13 #define XACE_KEY_AVAIL 14 -#define XACE_AUDIT_BEGIN 15 -#define XACE_AUDIT_END 16 -#define XACE_NUM_HOOKS 17 +#define XACE_NUM_HOOKS 15 extern _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS]; @@ -71,12 +69,16 @@ extern _X_EXPORT int XaceHookIsSet(int hook); /* Special-cased hook functions */ extern _X_EXPORT int XaceHookDispatch(ClientPtr ptr, int major); +#define XaceHookDispatch(c, m) \ + ((XaceHooks[XACE_EXT_DISPATCH] && (m) >= EXTENSION_BASE) ? \ + XaceHookDispatch((c), (m)) : \ + Success) + extern _X_EXPORT int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin, PropertyPtr *ppProp, Mask access_mode); extern _X_EXPORT int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel, Mask access_mode); -extern _X_EXPORT void XaceHookAuditEnd(ClientPtr ptr, int result); /* Register a callback for a given hook. */ @@ -116,7 +118,6 @@ extern _X_EXPORT void XaceCensorImage(ClientPtr client, #define XaceHookDispatch(args...) Success #define XaceHookPropertyAccess(args...) Success #define XaceHookSelectionAccess(args...) Success -#define XaceHookAuditEnd(args...) { ; } #define XaceCensorImage(args...) { ; } #else #define XaceHook(...) Success @@ -124,7 +125,6 @@ extern _X_EXPORT void XaceCensorImage(ClientPtr client, #define XaceHookDispatch(...) Success #define XaceHookPropertyAccess(...) Success #define XaceHookSelectionAccess(...) Success -#define XaceHookAuditEnd(...) { ; } #define XaceCensorImage(...) { ; } #endif diff --git a/xserver/Xext/xf86bigfont.c b/xserver/Xext/xf86bigfont.c index 95b537170..f2584c221 100644 --- a/xserver/Xext/xf86bigfont.c +++ b/xserver/Xext/xf86bigfont.c @@ -96,8 +96,6 @@ static Bool badSysCall = FALSE; #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__) -#include - static void SigSysHandler(int signo) { @@ -111,7 +109,7 @@ CheckForShmSyscall(void) int shmid = -1; /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ - oldHandler = signal(SIGSYS, SigSysHandler); + oldHandler = OsSignal(SIGSYS, SigSysHandler); badSysCall = FALSE; shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); @@ -123,7 +121,7 @@ CheckForShmSyscall(void) /* Allocation failed */ badSysCall = TRUE; } - signal(SIGSYS, oldHandler); + OsSignal(SIGSYS, oldHandler); return !badSysCall; } @@ -439,7 +437,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) #ifdef HAS_SHM if (pDesc && !badSysCall) { *(CARD32 *) (pCI + nCharInfos) = signature; - if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) { + if (!xfont2_font_set_private(pFont, FontShmdescIndex, pDesc)) { shmdealloc(pDesc); return BadAlloc; } @@ -723,7 +721,7 @@ XFree86BigfontExtensionInit(void) + (unsigned int) (65536.0 / (RAND_MAX + 1.0) * rand()); /* fprintf(stderr, "signature = 0x%08X\n", signature); */ - FontShmdescIndex = AllocateFontPrivateIndex(); + FontShmdescIndex = xfont2_allocate_font_private_index(); #if !defined(CSRG_BASED) && !defined(__CYGWIN__) pagesize = SHMLBA; diff --git a/xserver/Xext/xres.c b/xserver/Xext/xres.c index 2dbdd4738..bc54133d2 100644 --- a/xserver/Xext/xres.c +++ b/xserver/Xext/xres.c @@ -349,21 +349,6 @@ ProcXResQueryClientResources(ClientPtr client) return Success; } -static unsigned long -ResGetApproxPixmapBytes(PixmapPtr pix) -{ - unsigned long nPixels; - float bytesPerPixel; - - bytesPerPixel = (float)pix->drawable.bitsPerPixel / 8.0; - nPixels = pix->drawable.width * pix->drawable.height; - - /* Divide by refcnt as pixmap could be shared between clients, - * so total pixmap mem is shared between these. - */ - return (nPixels * bytesPerPixel) / pix->refcnt; -} - static void ResFindResourcePixmaps(void *value, XID id, RESTYPE type, void *cdata) { @@ -375,57 +360,6 @@ ResFindResourcePixmaps(void *value, XID id, RESTYPE type, void *cdata) *bytes += size.pixmapRefSize; } -static void -ResFindPixmaps(void *value, XID id, void *cdata) -{ - unsigned long *bytes = (unsigned long *) cdata; - PixmapPtr pix = (PixmapPtr) value; - - *bytes += ResGetApproxPixmapBytes(pix); -} - -static void -ResFindWindowPixmaps(void *value, XID id, void *cdata) -{ - unsigned long *bytes = (unsigned long *) cdata; - WindowPtr pWin = (WindowPtr) value; - - if (pWin->backgroundState == BackgroundPixmap) - *bytes += ResGetApproxPixmapBytes(pWin->background.pixmap); - - if (pWin->border.pixmap != NULL && !pWin->borderIsPixel) - *bytes += ResGetApproxPixmapBytes(pWin->border.pixmap); -} - -static void -ResFindGCPixmaps(void *value, XID id, void *cdata) -{ - unsigned long *bytes = (unsigned long *) cdata; - GCPtr pGC = (GCPtr) value; - - if (pGC->stipple != NULL) - *bytes += ResGetApproxPixmapBytes(pGC->stipple); - - if (pGC->tile.pixmap != NULL && !pGC->tileIsPixel) - *bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap); -} - -#ifdef RENDER -static void -ResFindPicturePixmaps(void *value, XID id, void *cdata) -{ - ResFindResourcePixmaps(value, id, PictureType, cdata); -} -#endif - -#ifdef COMPOSITE -static void -ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata) -{ - ResFindResourcePixmaps(value, id, CompositeClientWindowType, cdata); -} -#endif - static int ProcXResQueryClientPixmapBytes(ClientPtr client) { @@ -445,34 +379,8 @@ ProcXResQueryClientPixmapBytes(ClientPtr client) bytes = 0; - FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps, - (void *) (&bytes)); - - /* - * Make sure win background pixmaps also held to account. - */ - FindClientResourcesByType(clients[clientID], RT_WINDOW, - ResFindWindowPixmaps, (void *) (&bytes)); - - /* - * GC Tile & Stipple pixmaps too. - */ - FindClientResourcesByType(clients[clientID], RT_GC, - ResFindGCPixmaps, (void *) (&bytes)); - -#ifdef RENDER - /* Render extension picture pixmaps. */ - FindClientResourcesByType(clients[clientID], PictureType, - ResFindPicturePixmaps, - (void *)(&bytes)); -#endif - -#ifdef COMPOSITE - /* Composite extension client window pixmaps. */ - FindClientResourcesByType(clients[clientID], CompositeClientWindowType, - ResFindCompositeClientWindowPixmaps, - (void *)(&bytes)); -#endif + FindAllClientResources(clients[clientID], ResFindResourcePixmaps, + (void *) (&bytes)); rep = (xXResQueryClientPixmapBytesReply) { .type = X_Reply, diff --git a/xserver/Xext/xselinux_hooks.c b/xserver/Xext/xselinux_hooks.c index d9f2f681b..2d85928f5 100644 --- a/xserver/Xext/xselinux_hooks.c +++ b/xserver/Xext/xselinux_hooks.c @@ -810,15 +810,9 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata) static int netlink_fd; static void -SELinuxBlockHandler(void *data, struct timeval **tv, void *read_mask) +SELinuxNetlinkNotify(int fd, int ready, void *data) { -} - -static void -SELinuxWakeupHandler(void *data, int num_fds, void *read_mask) -{ - if (num_fds > 0 && FD_ISSET(netlink_fd, (fd_set *) read_mask)) - avc_netlink_check_nb(); + avc_netlink_check_nb(); } void @@ -844,9 +838,7 @@ SELinuxFlaskReset(void) /* Tear down SELinux stuff */ audit_close(audit_fd); avc_netlink_release_fd(); - RemoveBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler, - NULL); - RemoveGeneralSocket(netlink_fd); + RemoveNotifyFd(netlink_fd); avc_destroy(); } @@ -918,9 +910,7 @@ SELinuxFlaskInit(void) FatalError("SELinux: Failed to create atom\n"); netlink_fd = avc_netlink_acquire_fd(); - AddGeneralSocket(netlink_fd); - RegisterBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler, - NULL); + SetNotifyFd(netlink_fd, SELinuxNetlinkNotify, X_NOTIFY_READ, NULL); /* Register callbacks */ ret &= AddCallback(&ClientStateCallback, SELinuxClientState, NULL); diff --git a/xserver/Xext/xvdisp.c b/xserver/Xext/xvdisp.c index bfeabfd3b..4d412b857 100644 --- a/xserver/Xext/xvdisp.c +++ b/xserver/Xext/xvdisp.c @@ -949,7 +949,6 @@ ProcXvShmPutImage(ClientPtr client) static int ProcXvShmPutImage(ClientPtr client) { - SendErrorToClient(client, XvReqCode, xv_ShmPutImage, 0, BadImplementation); return BadImplementation; } #endif @@ -1108,7 +1107,6 @@ ProcXvDispatch(ClientPtr client) UpdateCurrentTime(); if (stuff->data >= xvNumRequests) { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); return BadRequest; } @@ -1429,7 +1427,6 @@ SProcXvDispatch(ClientPtr client) UpdateCurrentTime(); if (stuff->data >= xvNumRequests) { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); return BadRequest; } diff --git a/xserver/Xi/Makefile.in b/xserver/Xi/Makefile.in index 52f64f05a..61e4a5d7d 100644 --- a/xserver/Xi/Makefile.in +++ b/xserver/Xi/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -312,6 +313,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -342,7 +346,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -437,6 +444,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/Xi/exevents.c b/xserver/Xi/exevents.c index 52b91e893..17d751e31 100644 --- a/xserver/Xi/exevents.c +++ b/xserver/Xi/exevents.c @@ -661,7 +661,7 @@ void DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to, DeviceChangedEvent *dce) { - OsBlockSIGIO(); + input_lock(); /* generic feedback classes, not tied to pointer and/or keyboard */ DeepCopyFeedbackClasses(from, to); @@ -671,7 +671,7 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to, if ((dce->flags & DEVCHANGE_POINTER_EVENT)) DeepCopyPointerClasses(from, to); - OsReleaseSIGIO(); + input_unlock(); } /** @@ -1763,6 +1763,10 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device) switch (event->type) { case ET_KeyPress: + /* Don't deliver focus events (e.g. from KeymapNotify when running + * nested) to clients. */ + if (event->source_type == EVENT_SOURCE_FOCUS) + return; if (!grab && CheckDeviceGrabs(device, event, 0)) return; break; @@ -1794,15 +1798,19 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device) break; } - if (grab) - DeliverGrabbedEvent((InternalEvent *) event, device, - deactivateDeviceGrab); - else if (device->focus && !IsPointerEvent(ev)) - DeliverFocusedEvent(device, (InternalEvent *) event, - GetSpriteWindow(device)); - else - DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event, - NullGrab, NullWindow, device); + /* Don't deliver focus events (e.g. from KeymapNotify when running + * nested) to clients. */ + if (event->source_type != EVENT_SOURCE_FOCUS) { + if (grab) + DeliverGrabbedEvent((InternalEvent *) event, device, + deactivateDeviceGrab); + else if (device->focus && !IsPointerEvent(ev)) + DeliverFocusedEvent(device, (InternalEvent *) event, + GetSpriteWindow(device)); + else + DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event, + NullGrab, NullWindow, device); + } if (deactivateDeviceGrab == TRUE) { (*device->deviceGrab.DeactivateGrab) (device); diff --git a/xserver/Xi/extinit.c b/xserver/Xi/extinit.c index 26c628cbd..7a86ee2e7 100644 --- a/xserver/Xi/extinit.c +++ b/xserver/Xi/extinit.c @@ -380,18 +380,6 @@ DevPrivateKeyRec XIClientPrivateKeyRec; * */ -static void -XIClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - XIClientPtr pXIClient; - - pXIClient = dixLookupPrivate(&pClient->devPrivates, XIClientPrivateKey); - pXIClient->major_version = 0; - pXIClient->minor_version = 0; -} - /************************************************************************* * * ProcIDispatch - main dispatch routine for requests to this extension. @@ -406,6 +394,7 @@ ProcIDispatch(ClientPtr client) if (stuff->data >= ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data]) return BadRequest; + UpdateCurrentTimeIf(); return (*ProcIVector[stuff->data]) (client); } @@ -425,6 +414,7 @@ SProcIDispatch(ClientPtr client) if (stuff->data >= ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data]) return BadRequest; + UpdateCurrentTimeIf(); return (*SProcIVector[stuff->data]) (client); } @@ -1296,9 +1286,6 @@ XInputExtensionInit(void) (&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec))) FatalError("Cannot request private for XI.\n"); - if (!AddCallback(&ClientStateCallback, XIClientCallback, 0)) - FatalError("Failed to add callback to XI.\n"); - if (!XIBarrierInit()) FatalError("Could not initialize barriers.\n"); diff --git a/xserver/Xi/stubs.c b/xserver/Xi/stubs.c index 39bee7c27..27848a2f6 100644 --- a/xserver/Xi/stubs.c +++ b/xserver/Xi/stubs.c @@ -143,3 +143,17 @@ DeleteInputDeviceRequest(DeviceIntPtr dev) { RemoveDevice(dev, TRUE); } + +/**************************************************************************** + * + * Caller: configRemoveDevice (and others) + * + * Remove any traces of the input device specified in config_info. + * This is only necessary if the ddx keeps information around beyond + * the NewInputDeviceRequest/DeleteInputDeviceRequest + * + */ +void +RemoveInputDeviceTraces(const char *config_info) +{ +} diff --git a/xserver/Xi/xichangehierarchy.c b/xserver/Xi/xichangehierarchy.c index 0f96c9164..7286eff55 100644 --- a/xserver/Xi/xichangehierarchy.c +++ b/xserver/Xi/xichangehierarchy.c @@ -194,7 +194,8 @@ add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES]) flags[XTestptr->id] |= XISlaveAttached; flags[XTestkeybd->id] |= XISlaveAttached; - XIBarrierNewMasterDevice(client, ptr->id); + for (int i = 0; i < currentMaxClients; i++) + XIBarrierNewMasterDevice(clients[i], ptr->id); unwind: free(name); @@ -300,7 +301,8 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES]) } } - XIBarrierRemoveMasterDevice(client, ptr->id); + for (int i = 0; i < currentMaxClients; i++) + XIBarrierRemoveMasterDevice(clients[i], ptr->id); /* disable the remove the devices, XTest devices must be done first else the sprites they rely on will be destroyed */ diff --git a/xserver/Xi/xiproperty.c b/xserver/Xi/xiproperty.c index e3b8f5abe..b7a1f59f4 100644 --- a/xserver/Xi/xiproperty.c +++ b/xserver/Xi/xiproperty.c @@ -622,6 +622,7 @@ XIDeleteAllDeviceProperties(DeviceIntPtr device) XIPropertyPtr prop, next; XIPropertyHandlerPtr curr_handler, next_handler; + UpdateCurrentTimeIf(); for (prop = device->properties.properties; prop; prop = next) { next = prop->next; send_property_event(device, prop->propertyName, XIPropertyDeleted); @@ -672,6 +673,7 @@ XIDeleteDeviceProperty(DeviceIntPtr device, Atom property, Bool fromClient) } if (prop) { + UpdateCurrentTimeIf(); *prev = prop->next; send_property_event(device, prop->propertyName, XIPropertyDeleted); XIDestroyDeviceProperty(prop); @@ -767,8 +769,10 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, handler = dev->properties.handlers; while (handler) { if (handler->SetProperty) { + input_lock(); rc = handler->SetProperty(dev, prop->propertyName, &new_value, checkonly); + input_unlock(); if (checkonly && rc != Success) { free(new_value.data); if (add) @@ -793,9 +797,11 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, dev->properties.properties = prop; } - if (sendevent) + if (sendevent) { + UpdateCurrentTimeIf(); send_property_event(dev, prop->propertyName, (add) ? XIPropertyCreated : XIPropertyModified); + } return Success; } diff --git a/xserver/Xi/xiquerypointer.c b/xserver/Xi/xiquerypointer.c index b9e295815..c5b0ba7b6 100644 --- a/xserver/Xi/xiquerypointer.c +++ b/xserver/Xi/xiquerypointer.c @@ -110,8 +110,8 @@ ProcXIQueryPointer(ClientPtr client) rc = dixLookupWindow(&pWin, stuff->win, client, DixGetAttrAccess); if (rc != Success) { - SendErrorToClient(client, IReqCode, X_XIQueryPointer, stuff->win, rc); - return Success; + client->errorValue = stuff->win; + return rc; } if (pDev->valuator->motionHintWindow) diff --git a/xserver/Xi/xiwarppointer.c b/xserver/Xi/xiwarppointer.c index 780758a9e..8426443fa 100644 --- a/xserver/Xi/xiwarppointer.c +++ b/xserver/Xi/xiwarppointer.c @@ -186,6 +186,10 @@ ProcXIWarpPointer(ClientPtr client) pDev->last.valuators[1] = y; miPointerUpdateSprite(pDev); + if (*newScreen->CursorWarpedTo) + (*newScreen->CursorWarpedTo) (pDev, newScreen, client, + dest, pSprite, x, y); + /* FIXME: XWarpPointer is supposed to generate an event. It doesn't do it here though. */ return Success; diff --git a/xserver/aclocal.m4 b/xserver/aclocal.m4 index 62c38694f..b32dc640a 100644 --- a/xserver/aclocal.m4 +++ b/xserver/aclocal.m4 @@ -1261,6 +1261,7 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ac_define_dir.m4]) +m4_include([m4/ax_pthread.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) diff --git a/xserver/composite/Makefile.in b/xserver/composite/Makefile.in index 2bb27799e..4446f1151 100644 --- a/xserver/composite/Makefile.in +++ b/xserver/composite/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -330,6 +331,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -360,7 +364,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -455,6 +462,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/composite/compalloc.c b/xserver/composite/compalloc.c index 8daded0a5..05ffc7e85 100644 --- a/xserver/composite/compalloc.c +++ b/xserver/composite/compalloc.c @@ -55,13 +55,13 @@ compScreenUpdate(ScreenPtr pScreen) } static void -compBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) +compBlockHandler(ScreenPtr pScreen, void *pTimeout) { CompScreenPtr cs = GetCompScreen(pScreen); pScreen->BlockHandler = cs->BlockHandler; compScreenUpdate(pScreen); - (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout); /* Next damage will restore the block handler */ cs->BlockHandler = NULL; @@ -612,7 +612,7 @@ compAllocPixmap(WindowPtr pWin) else pWin->redirectDraw = RedirectDrawManual; - compSetPixmap(pWin, pPixmap); + compSetPixmap(pWin, pPixmap, bw); cw->oldx = COMP_ORIGIN_INVALID; cw->oldy = COMP_ORIGIN_INVALID; cw->damageRegistered = FALSE; @@ -651,7 +651,7 @@ compSetParentPixmap(WindowPtr pWin) RegionCopy(&pWin->borderClip, &cw->borderClip); pParentPixmap = (*pScreen->GetWindowPixmap) (pWin->parent); pWin->redirectDraw = RedirectDrawNone; - compSetPixmap(pWin, pParentPixmap); + compSetPixmap(pWin, pParentPixmap, pWin->borderWidth); } /* @@ -682,7 +682,7 @@ compReallocPixmap(WindowPtr pWin, int draw_x, int draw_y, if (!pNew) return FALSE; cw->pOldPixmap = pOld; - compSetPixmap(pWin, pNew); + compSetPixmap(pWin, pNew, bw); } else { pNew = pOld; diff --git a/xserver/composite/compext.c b/xserver/composite/compext.c index f1a825573..5b17dae53 100644 --- a/xserver/composite/compext.c +++ b/xserver/composite/compext.c @@ -66,17 +66,6 @@ typedef struct _CompositeClient { #define GetCompositeClient(pClient) ((CompositeClientPtr) \ dixLookupPrivate(&(pClient)->devPrivates, CompositeClientPrivateKey)) -static void -CompositeClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - CompositeClientPtr pCompositeClient = GetCompositeClient(pClient); - - pCompositeClient->major_version = 0; - pCompositeClient->minor_version = 0; -} - static int FreeCompositeClientWindow(void *value, XID ccwid) { @@ -510,16 +499,17 @@ SProcCompositeDispatch(ClientPtr client) } /** @see GetDefaultBytes */ +static SizeType coreGetWindowBytes; + static void -GetCompositeClientWindowBytes(void *value, XID id, ResourceSizePtr size) +GetCompositeWindowBytes(void *value, XID id, ResourceSizePtr size) { WindowPtr window = value; - /* Currently only pixmap bytes are reported to clients. */ - size->resourceSize = 0; + /* call down */ + coreGetWindowBytes(value, id, size); - /* Calculate pixmap reference sizes. */ - size->pixmapRefSize = 0; + /* account for redirection */ if (window->redirectDraw != RedirectDrawNone) { SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); @@ -563,8 +553,8 @@ CompositeExtensionInit(void) if (!CompositeClientWindowType) return; - SetResourceTypeSizeFunc(CompositeClientWindowType, - GetCompositeClientWindowBytes); + coreGetWindowBytes = GetResourceTypeSizeFunc(RT_WINDOW); + SetResourceTypeSizeFunc(RT_WINDOW, GetCompositeWindowBytes); CompositeClientSubwindowsType = CreateNewResourceType (FreeCompositeClientSubwindows, "CompositeClientSubwindows"); @@ -580,9 +570,6 @@ CompositeExtensionInit(void) sizeof(CompositeClientRec))) return; - if (!AddCallback(&ClientStateCallback, CompositeClientCallback, 0)) - return; - for (s = 0; s < screenInfo.numScreens; s++) if (!compScreenInit(screenInfo.screens[s])) return; diff --git a/xserver/composite/compint.h b/xserver/composite/compint.h index 09241f2a2..f05c2d8a5 100644 --- a/xserver/composite/compint.h +++ b/xserver/composite/compint.h @@ -274,7 +274,7 @@ void #endif void - compSetPixmap(WindowPtr pWin, PixmapPtr pPixmap); + compSetPixmap(WindowPtr pWin, PixmapPtr pPixmap, int bw); Bool compCheckRedirect(WindowPtr pWin); diff --git a/xserver/composite/compwindow.c b/xserver/composite/compwindow.c index 344138ad7..bcd230c37 100644 --- a/xserver/composite/compwindow.c +++ b/xserver/composite/compwindow.c @@ -89,6 +89,7 @@ compCheckTree(ScreenPtr pScreen) typedef struct _compPixmapVisit { WindowPtr pWindow; PixmapPtr pPixmap; + int bw; } CompPixmapVisitRec, *CompPixmapVisitPtr; static Bool @@ -126,19 +127,20 @@ compSetPixmapVisitWindow(WindowPtr pWindow, void *data) */ SetWinSize(pWindow); SetBorderSize(pWindow); - if (HasBorder(pWindow)) + if (pVisit->bw) QueueWorkProc(compRepaintBorder, serverClient, (void *) (intptr_t) pWindow->drawable.id); return WT_WALKCHILDREN; } void -compSetPixmap(WindowPtr pWindow, PixmapPtr pPixmap) +compSetPixmap(WindowPtr pWindow, PixmapPtr pPixmap, int bw) { CompPixmapVisitRec visitRec; visitRec.pWindow = pWindow; visitRec.pPixmap = pPixmap; + visitRec.bw = bw; TraverseTree(pWindow, compSetPixmapVisitWindow, (void *) &visitRec); compCheckTree(pWindow->drawable.pScreen); } @@ -463,7 +465,8 @@ compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent) * Reset pixmap pointers as appropriate */ if (pWin->parent && pWin->redirectDraw == RedirectDrawNone) - compSetPixmap(pWin, (*pScreen->GetWindowPixmap) (pWin->parent)); + compSetPixmap(pWin, (*pScreen->GetWindowPixmap) (pWin->parent), + pWin->borderWidth); /* * Call down to next function */ diff --git a/xserver/config/Makefile.in b/xserver/config/Makefile.in index f06ec8ef1..0f92a4ab6 100644 --- a/xserver/config/Makefile.in +++ b/xserver/config/Makefile.in @@ -66,9 +66,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -351,6 +352,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -381,7 +385,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -476,6 +483,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/config/config.c b/xserver/config/config.c index de45cc350..fb60295ae 100644 --- a/xserver/config/config.c +++ b/xserver/config/config.c @@ -86,10 +86,10 @@ remove_device(const char *backend, DeviceIntPtr dev) /* Call PIE here so we don't try to dereference a device that's * already been removed. */ - OsBlockSignals(); + input_lock(); ProcessInputEvents(); DeleteInputDeviceRequest(dev); - OsReleaseSignals(); + input_unlock(); } void @@ -107,6 +107,8 @@ remove_devices(const char *backend, const char *config_info) if (dev->config_info && strcmp(dev->config_info, config_info) == 0) remove_device(backend, dev); } + + RemoveInputDeviceTraces(config_info); } BOOL diff --git a/xserver/config/dbus-api b/xserver/config/dbus-api new file mode 100644 index 000000000..018e98657 --- /dev/null +++ b/xserver/config/dbus-api @@ -0,0 +1,40 @@ +D-BUS Configuration API v2 +---------------------------- + +The X server will register the bus name org.x.config.displayN, and the +object /org/x/config/N, where N is the display number. + +Currently only hotplugging of input devices is supported. + +org.x.config.input: + org.x.config.input.version: + Returns one unsigned int32, which is the API version. + + org.x.config.input.add: + Takes an argument of key/value option pairs in arrays, e.g.: + [ss][ss][ss][ss] + is the signature for four options. These options will be passed + to the input driver as with any others. + Option names beginning with _ are not allowed; they are reserved + for internal use. + + Returns a number of signed int32s. Positive integers are the + device IDs of new devices; negative numbers are X error codes, + as defined in X.h. BadMatch will be returned if the options + given do not match any device. BadValue is returned for a malformed + message. (Example: 8 is new device ID 8; -8 is BadMatch.) + + Notably, BadAlloc is never returned: the server internally signals + to D-BUS that the attempt failed for lack of memory. + + org.x.config.input.remove: + Takes one uint32 argument, which is the device ID to remove, i.e.: + u + is the signature. + + Returns one signed int32 which represents an X status as defined in + X.h. See org.x.config.input.add. Error codes are negative numbers. + + org.x.config.input.listDevices: + Lists the currently active devices. No argument. + Return value is sequence of [ ] [ ] ..., i.e. [us]. diff --git a/xserver/config/dbus-core.c b/xserver/config/dbus-core.c index 8351ea4b3..6d9a3f917 100644 --- a/xserver/config/dbus-core.c +++ b/xserver/config/dbus-core.c @@ -43,16 +43,16 @@ struct dbus_core_info { OsTimerPtr timer; struct dbus_core_hook *hooks; }; -static struct dbus_core_info bus_info; +static struct dbus_core_info bus_info = { .fd = -1 }; static CARD32 reconnect_timer(OsTimerPtr timer, CARD32 time, void *arg); static void -wakeup_handler(void *data, int num_fds, void *read_mask) +socket_handler(int fd, int ready, void *data) { struct dbus_core_info *info = data; - if (info->connection && num_fds > 0 && FD_ISSET(info->fd, (fd_set *) read_mask)) { + if (info->connection) { do { dbus_connection_read_write_dispatch(info->connection, 0); } while (info->connection && @@ -62,11 +62,6 @@ wakeup_handler(void *data, int num_fds, void *read_mask) } } -static void -block_handler(void *data, struct timeval **tv, void *read_mask) -{ -} - /** * Disconnect (if we haven't already been forcefully disconnected), clean up * after ourselves, and call all registered disconnect hooks. @@ -87,9 +82,8 @@ teardown(void) if (bus_info.connection) dbus_connection_unref(bus_info.connection); - RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info); if (bus_info.fd != -1) - RemoveGeneralSocket(bus_info.fd); + RemoveNotifyFd(bus_info.fd); bus_info.fd = -1; bus_info.connection = NULL; @@ -162,9 +156,7 @@ connect_to_bus(void) } dbus_error_free(&error); - AddGeneralSocket(bus_info.fd); - - RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info); + SetNotifyFd(bus_info.fd, socket_handler, X_NOTIFY_READ, &bus_info); for (hook = bus_info.hooks; hook; hook = hook->next) { if (hook->connect) diff --git a/xserver/config/hal.c b/xserver/config/hal.c index ea574ca52..e33e3330b 100644 --- a/xserver/config/hal.c +++ b/xserver/config/hal.c @@ -170,13 +170,15 @@ device_added(LibHalContext * hal_ctx, const char *udi) free(hal_tags); if (libhal_device_query_capability(hal_ctx, udi, "input.keys", NULL)) - attrs.flags |= ATTR_KEYBOARD; + attrs.flags |= ATTR_KEY | ATTR_KEYBOARD; if (libhal_device_query_capability(hal_ctx, udi, "input.mouse", NULL)) attrs.flags |= ATTR_POINTER; if (libhal_device_query_capability(hal_ctx, udi, "input.joystick", NULL)) attrs.flags |= ATTR_JOYSTICK; if (libhal_device_query_capability(hal_ctx, udi, "input.tablet", NULL)) attrs.flags |= ATTR_TABLET; + if (libhal_device_query_capability(hal_ctx, udi, "input.tablet_pad", NULL)) + attrs.flags |= ATTR_TABLET_PAD; if (libhal_device_query_capability(hal_ctx, udi, "input.touchpad", NULL)) attrs.flags |= ATTR_TOUCHPAD; if (libhal_device_query_capability(hal_ctx, udi, "input.touchscreen", NULL)) diff --git a/xserver/config/udev.c b/xserver/config/udev.c index 28c265817..932f230c7 100644 --- a/xserver/config/udev.c +++ b/xserver/config/udev.c @@ -239,6 +239,10 @@ device_added(struct udev_device *udev_device) attrs.vendor = strdup(value); } else if (!strcmp(key, "ID_INPUT_KEY")) { + LOG_PROPERTY(path, key, value); + attrs.flags |= ATTR_KEY; + } + else if (!strcmp(key, "ID_INPUT_KEYBOARD")) { LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_KEYBOARD; } @@ -254,6 +258,10 @@ device_added(struct udev_device *udev_device) LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_TABLET; } + else if (!strcmp(key, "ID_INPUT_TABLET_PAD")) { + LOG_PROPERTY(path, key, value); + attrs.flags |= ATTR_TABLET_PAD; + } else if (!strcmp(key, "ID_INPUT_TOUCHPAD")) { LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_TOUCHPAD; @@ -332,41 +340,34 @@ device_removed(struct udev_device *device) } static void -wakeup_handler(void *data, int err, void *read_mask) +socket_handler(int fd, int ready, void *data) { - int udev_fd = udev_monitor_get_fd(udev_monitor); struct udev_device *udev_device; const char *action; - if (err < 0) + input_lock(); + udev_device = udev_monitor_receive_device(udev_monitor); + if (!udev_device) { + input_unlock(); return; - - if (FD_ISSET(udev_fd, (fd_set *) read_mask)) { - udev_device = udev_monitor_receive_device(udev_monitor); - if (!udev_device) - return; - action = udev_device_get_action(udev_device); - if (action) { - if (!strcmp(action, "add")) { + } + action = udev_device_get_action(udev_device); + if (action) { + if (!strcmp(action, "add")) { + device_removed(udev_device); + device_added(udev_device); + } else if (!strcmp(action, "change")) { + /* ignore change for the drm devices */ + if (strcmp(udev_device_get_subsystem(udev_device), "drm")) { device_removed(udev_device); device_added(udev_device); - } else if (!strcmp(action, "change")) { - /* ignore change for the drm devices */ - if (strcmp(udev_device_get_subsystem(udev_device), "drm")) { - device_removed(udev_device); - device_added(udev_device); - } } - else if (!strcmp(action, "remove")) - device_removed(udev_device); } - udev_device_unref(udev_device); + else if (!strcmp(action, "remove")) + device_removed(udev_device); } -} - -static void -block_handler(void *data, struct timeval **tv, void *read_mask) -{ + udev_device_unref(udev_device); + input_unlock(); } int @@ -441,8 +442,7 @@ config_udev_init(void) } udev_enumerate_unref(enumerate); - RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); - AddGeneralSocket(udev_monitor_get_fd(udev_monitor)); + SetNotifyFd(udev_monitor_get_fd(udev_monitor), socket_handler, X_NOTIFY_READ, NULL); return 1; } @@ -457,8 +457,7 @@ config_udev_fini(void) udev = udev_monitor_get_udev(udev_monitor); - RemoveGeneralSocket(udev_monitor_get_fd(udev_monitor)); - RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); + RemoveNotifyFd(udev_monitor_get_fd(udev_monitor)); udev_monitor_unref(udev_monitor); udev_monitor = NULL; udev_unref(udev); diff --git a/xserver/config/wscons.c b/xserver/config/wscons.c index 7e37b99ca..ff5880a17 100644 --- a/xserver/config/wscons.c +++ b/xserver/config/wscons.c @@ -164,7 +164,7 @@ wscons_add_keyboard(void) } kbd_config_done: - attrs.flags |= ATTR_KEYBOARD; + attrs.flags |= ATTR_KEY | ATTR_KEYBOARD; rc = NewInputDeviceRequest(input_options, &attrs, &dev); if (rc != Success) goto unwind; diff --git a/xserver/configure b/xserver/configure index e788697db..ac59da96e 100644 --- a/xserver/configure +++ b/xserver/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for xorg-server 1.18.4. +# Generated by GNU Autoconf 2.69 for xorg-server 1.19.5. # # Report bugs to . # @@ -651,8 +651,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xorg-server' PACKAGE_TARNAME='xorg-server' -PACKAGE_VERSION='1.18.4' -PACKAGE_STRING='xorg-server 1.18.4' +PACKAGE_VERSION='1.19.5' +PACKAGE_STRING='xorg-server 1.19.5' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' @@ -693,6 +693,7 @@ ac_includes_default="\ # include #endif" +ac_config_libobj_dir=os ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -702,6 +703,7 @@ BUILD_DATE RELEASE_DATE SYSCONFDIR PROJECTROOT +WAYLAND_PROTOCOLS_DATADIR WAYLAND_SCANNER XWAYLAND_SYS_LIBS XWAYLAND_LIBS @@ -788,6 +790,8 @@ XWIN_XV_FALSE XWIN_XV_TRUE XWIN_RANDR_FALSE XWIN_RANDR_TRUE +XWIN_WINDOWS_DRI_FALSE +XWIN_WINDOWS_DRI_TRUE XWIN_GLX_WINDOWS_FALSE XWIN_GLX_WINDOWS_TRUE XWIN_CLIPBOARD_FALSE @@ -805,6 +809,8 @@ PYTHON3 XWIN_SYS_LIBS XWIN_SERVER_NAME XWIN_LIBS +WINDOWSDRI_LIBS +WINDOWSDRI_CFLAGS WINDOWSWM_LIBS WINDOWSWM_CFLAGS XWINMODULES_LIBS @@ -963,16 +969,12 @@ PRESENT_FALSE PRESENT_TRUE GLX_SYS_LIBS GLX_DEFINES -AIGLX_DRI_LOADER_FALSE -AIGLX_DRI_LOADER_TRUE GLX_FALSE GLX_TRUE GL_LIBS GL_CFLAGS XLIB_LIBS XLIB_CFLAGS -DRI2_AIGLX_FALSE -DRI2_AIGLX_TRUE LIBDRM_LIBS LIBDRM_CFLAGS DRI3_FALSE @@ -1034,6 +1036,10 @@ HAVE_SYSTEMD_DAEMON_FALSE HAVE_SYSTEMD_DAEMON_TRUE SYSTEMD_DAEMON_LIBS SYSTEMD_DAEMON_CFLAGS +PTHREAD_CFLAGS +PTHREAD_LIBS +PTHREAD_CC +ax_pthread_config SDK_REQUIRED_MODULES PIXMAN_LIBS PIXMAN_CFLAGS @@ -1092,6 +1098,8 @@ FBDEVHW_FALSE FBDEVHW_TRUE AGP_FALSE AGP_TRUE +POLL_FALSE +POLL_TRUE LIBOBJS DLOPEN_LIBS SPECIAL_DTRACE_OBJECTS_FALSE @@ -1308,7 +1316,6 @@ enable_largefile with_dtrace enable_werror enable_debug -enable_use_sigio_by_default with_int10 with_vendor_name with_vendor_name_short @@ -1322,6 +1329,7 @@ with_builderstring enable_listen_tcp enable_listen_unix enable_listen_local +with_fallback_input_driver with_fontrootdir with_fontmiscdir with_fontotfdir @@ -1346,7 +1354,6 @@ with_bundle_version_string enable_sparkle with_sparkle_feed_url enable_visibility -enable_aiglx with_khronos_spec_dir enable_privsep enable_composite @@ -1382,6 +1389,7 @@ enable_vgahw enable_vbe enable_int10_module enable_windowswm +enable_windowsdri enable_libdrm enable_clientids enable_pciaccess @@ -1413,6 +1421,7 @@ enable_tcp_transport enable_ipv6 enable_local_transport enable_secure_rpc +enable_input_thread with_systemd_daemon with_shared_memory_dir enable_xtrans_send_fds @@ -1493,6 +1502,8 @@ XWINMODULES_CFLAGS XWINMODULES_LIBS WINDOWSWM_CFLAGS WINDOWSWM_LIBS +WINDOWSDRI_CFLAGS +WINDOWSDRI_LIBS KHRONOS_OPENGL_REGISTRY_CFLAGS KHRONOS_OPENGL_REGISTRY_LIBS XPBPROXY_CFLAGS @@ -2059,7 +2070,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xorg-server 1.18.4 to adapt to many kinds of systems. +\`configure' configures xorg-server 1.19.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2129,7 +2140,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xorg-server 1.18.4:";; + short | recursive ) echo "Configuration of xorg-server 1.19.5:";; esac cat <<\_ACEOF @@ -2164,16 +2175,12 @@ Optional Features: --disable-largefile omit support for large files --enable-werror Obsolete - use --enable-strict-compilation instead --enable-debug Enable debugging (default: disabled) - --enable-use-sigio-by-default - Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT) - --enable-listen-tcp Listen on TCP by default (default:disabled) --disable-listen-unix Listen on Unix by default (default:enabled) --disable-listen-local Listen on local by default (default:enabled) --enable-sparkle Enable updating of X11.app using the Sparkle Framework (default: disabled) --enable-visibility Enable symbol visibility (default: auto) - --enable-aiglx Build accelerated indirect GLX (default: enabled) --enable-privsep Build support for X server privilege separation (default is NO) --disable-composite Build Composite extension (default: enabled) @@ -2211,6 +2218,7 @@ Optional Features: --enable-vbe Build Xorg with VBE module (default: enabled) --enable-int10-module Build Xorg with int10 module (default: enabled) --enable-windowswm Build XWin with WindowsWM extension (default: no) + --enable-windowsdri Build XWin with WindowsDRI extension (default: auto) --enable-libdrm Build Xorg with libdrm support (default: enabled) --disable-clientids Build Xorg with client ID tracking (default: enabled) @@ -2233,7 +2241,7 @@ Optional Features: integrated into Xquartz as a separate thread) (default: no) --enable-xwin Build XWin server (default: auto) - --enable-glamor Build glamor dix module (default: no) + --enable-glamor Build glamor dix module (default: auto) --enable-kdrive Build kdrive servers (default: no) --enable-xephyr Build the kdrive Xephyr server (default: auto) --enable-xfake Build the kdrive 'fake' server (default: auto) @@ -2252,6 +2260,7 @@ Optional Features: --enable-local-transport Enable os-specific local transport --enable-secure-rpc Enable Secure RPC + --enable-input-thread Enable input threads --disable-xtrans-send-fds Use Xtrans support for fd passing (default: auto) @@ -2291,6 +2300,9 @@ Optional Packages: Name of OS vendor --with-builderstring=BUILDERSTRING Additional builder string + --with-fallback-input-driver=$FALLBACK_INPUT_DRIVER + Input driver fallback if the requested driver for a + device is unavailable --with-fontrootdir=DIR Path to root directory for font files --with-fontmiscdir=DIR Path to misc files [FONTROOTDIR/misc] --with-fontotfdir=DIR Path to OTF files [FONTROOTDIR/OTF] @@ -2327,10 +2339,10 @@ Optional Packages: org.x) --with-bundle-version=VERSION Version to use for X11.app's CFBundleVersion - (default: 1.18.4) + (default: 1.19.5) --with-bundle-version-string=VERSION Version to use for X11.app's - CFBundleShortVersionString (default: 1.18.4) + CFBundleShortVersionString (default: 1.19.5) --with-sparkle-feed-url=URL URL for the Sparkle feed (default: https://www.xquartz.org/releases/sparkle/release.xml) @@ -2463,6 +2475,10 @@ Some influential environment variables: C compiler flags for WINDOWSWM, overriding pkg-config WINDOWSWM_LIBS linker flags for WINDOWSWM, overriding pkg-config + WINDOWSDRI_CFLAGS + C compiler flags for WINDOWSDRI, overriding pkg-config + WINDOWSDRI_LIBS + linker flags for WINDOWSDRI, overriding pkg-config KHRONOS_OPENGL_REGISTRY_CFLAGS C compiler flags for KHRONOS_OPENGL_REGISTRY, overriding pkg-config @@ -2581,7 +2597,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xorg-server configure 1.18.4 +xorg-server configure 1.19.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -3290,7 +3306,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xorg-server $as_me 1.18.4, which was +It was created by xorg-server $as_me 1.19.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3638,8 +3654,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -RELEASE_DATE="2016-07-19" -RELEASE_NAME="Skordalia" +RELEASE_DATE="2017-10-12" +RELEASE_NAME="Shahi Paneer" am__api_version='1.12' @@ -4118,7 +4134,7 @@ fi # Define the identity of the package. PACKAGE='xorg-server' - VERSION='1.18.4' + VERSION='1.19.5' cat >>confdefs.h <<_ACEOF @@ -21420,7 +21436,7 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h \ - fnmatch.h sys/mkdev.h sys/utsname.h + fnmatch.h sys/mkdev.h sys/sysmacros.h sys/utsname.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -22025,7 +22041,7 @@ fi for ac_func in backtrace ffs geteuid getuid issetugid getresuid \ getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \ - walkcontext + walkcontext setitimer poll epoll_create1 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -22037,6 +22053,7 @@ _ACEOF fi done + ac_fn_c_check_func "$LINENO" "reallocarray" "ac_cv_func_reallocarray" if test "x$ac_cv_func_reallocarray" = xyes; then : $as_echo "#define HAVE_REALLOCARRAY 1" >>confdefs.h @@ -22129,6 +22146,15 @@ esac fi + if test "x$ac_cv_func_poll" = "xyes"; then + POLL_TRUE= + POLL_FALSE='#' +else + POLL_TRUE='#' + POLL_FALSE= +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" >&5 $as_echo_n "checking for arc4random_buf in -lbsd... " >&6; } if ${ac_cv_lib_bsd_arc4random_buf+:} false; then : @@ -22676,7 +22702,6 @@ fi DRI=no -USE_SIGIO_BY_DEFAULT="yes" case $host_os in *freebsd* | *dragonfly*) case $host_os in @@ -22727,19 +22752,7 @@ $as_echo "#define WSCONS_SUPPORT 1" >>confdefs.h DRI=yes ;; *solaris*) - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libdrm") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - DRI=yes -else - DRI=no -fi - # Disable use of SIGIO by default until some system bugs are - # fixed - see Sun/OpenSolaris bug id 6879897 - USE_SIGIO_BY_DEFAULT="no" + DRI=yes ;; darwin*) @@ -22777,11 +22790,6 @@ else DEBUGGING=no fi -# Check whether --enable-use-sigio-by-default was given. -if test "${enable_use_sigio_by_default+set}" = set; then : - enableval=$enable_use_sigio_by_default; USE_SIGIO_BY_DEFAULT=$enableval -fi - # Check whether --with-int10 was given. if test "${with_int10+set}" = set; then : @@ -22878,6 +22886,33 @@ else fi +case $host_os in + linux*) + FALLBACK_INPUT_DRIVER="libinput" + ;; + *) + FALLBACK_INPUT_DRIVER="" + ;; +esac + +# Check whether --with-fallback-input-driver was given. +if test "${with_fallback_input_driver+set}" = set; then : + withval=$with_fallback_input_driver; FALLBACK_INPUT_DRIVER=$withval +fi + +if test "x$FALLBACK_INPUT_DRIVER" = "xno"; then + FALLBACK_INPUT_DRIVER="" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fallback input driver" >&5 +$as_echo_n "checking for fallback input driver... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FALLBACK_INPUT_DRIVER" >&5 +$as_echo "$FALLBACK_INPUT_DRIVER" >&6; } + +cat >>confdefs.h <<_ACEOF +#define FALLBACK_INPUT_DRIVER "$FALLBACK_INPUT_DRIVER" +_ACEOF + + @@ -23123,7 +23158,7 @@ _ACEOF if test "${with_bundle_version+set}" = set; then : withval=$with_bundle_version; BUNDLE_VERSION="${withval}" else - BUNDLE_VERSION="1.18.4" + BUNDLE_VERSION="1.19.5" fi @@ -23161,14 +23196,6 @@ else fi -# Check whether --enable-aiglx was given. -if test "${enable_aiglx+set}" = set; then : - enableval=$enable_aiglx; AIGLX=$enableval -else - AIGLX=yes -fi - - # Check whether --with-khronos-spec-dir was given. if test "${with_khronos_spec_dir+set}" = set; then : @@ -23428,6 +23455,13 @@ else WINDOWSWM=no fi +# Check whether --enable-windowsdri was given. +if test "${enable_windowsdri+set}" = set; then : + enableval=$enable_windowsdri; WINDOWSDRI=$enableval +else + WINDOWSDRI=auto +fi + # Check whether --enable-libdrm was given. if test "${enable_libdrm+set}" = set; then : enableval=$enable_libdrm; DRM=$enableval @@ -23538,7 +23572,7 @@ fi if test "${enable_glamor+set}" = set; then : enableval=$enable_glamor; GLAMOR=$enableval else - GLAMOR=no + GLAMOR=auto fi # Check whether --enable-kdrive was given. @@ -24210,7 +24244,7 @@ WINDOWSWMPROTO="windowswmproto" APPLEWMPROTO="applewmproto >= 1.4" LIBXSHMFENCE="xshmfence >= 1.1" -XPROTO="xproto >= 7.0.28" +XPROTO="xproto >= 7.0.31" RANDRPROTO="randrproto >= 1.5.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.2.99.901" @@ -24227,12 +24261,12 @@ PRESENTPROTO="presentproto >= 1.0" LIBAPPLEWM="applewm >= 1.4" LIBDMX="dmx >= 1.0.99.1" LIBDRI="dri >= 7.8.0" -LIBDRM="libdrm >= 2.3.0" +LIBDRM="libdrm >= 2.3.1" LIBEGL="egl" LIBGBM="gbm >= 10.2.0" LIBGL="gl >= 7.1.0" LIBXEXT="xext >= 1.0.99.4" -LIBXFONT="xfont >= 1.4.2" +LIBXFONT="xfont2 >= 2.0.0" LIBXI="xi >= 1.2.99.1" LIBXTST="xtst >= 1.0.99.2" LIBPCIACCESS="pciaccess >= 0.12.901" @@ -24338,6 +24372,538 @@ SDK_REQUIRED_MODULES="$XPROTO $RANDRPROTO $RENDERPROTO $XEXTPROTO $INPUTPROTO $K # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc +ac_fn_c_check_decl "$LINENO" "PTHREAD_MUTEX_RECURSIVE" "ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" "#include +" +if test "x$ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" = xyes; then : + HAVE_RECURSIVE_MUTEX=yes +else + HAVE_RECURSIVE_MUTEX=no +fi + + +THREAD_DEFAULT=no + +if test "x$HAVE_RECURSIVE_MUTEX" = "xyes" ; then + THREAD_DEFAULT=yes +fi + +# Check whether --enable-input-thread was given. +if test "${enable_input_thread+set}" = set; then : + enableval=$enable_input_thread; INPUTTHREAD=$enableval +else + INPUTTHREAD=$THREAD_DEFAULT +fi + + +if test "x$INPUTTHREAD" = "xyes" ; then + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 +$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (); +int +main () +{ +return pthread_join (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case ${host_os} in + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; + netbsd*) + # use libc stubs, don't link against libpthread, to allow + # dynamic loading + ax_pthread_flags="" + ;; +esac + +# Clang doesn't consider unrecognized options an error unless we specify +# -Werror. We throw in some extra Clang-specific options to ensure that +# this doesn't happen for GCC, which also accepts -Werror. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler needs -Werror to reject unknown flags" >&5 +$as_echo_n "checking if compiler needs -Werror to reject unknown flags... " >&6; } +save_CFLAGS="$CFLAGS" +ax_pthread_extra_flags="-Werror" +CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(void); +int +main () +{ +foo() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + ax_pthread_extra_flags= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$save_CFLAGS" + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +$as_echo_n "checking whether pthreads work without any flags... " >&6; } + ;; + + -*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 +$as_echo_n "checking whether pthreads work with $flag... " >&6; } + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ax_pthread_config+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ax_pthread_config"; then + ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ax_pthread_config="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" +fi +fi +ax_pthread_config=$ac_cv_prog_ax_pthread_config +if test -n "$ax_pthread_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +$as_echo "$ax_pthread_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 +$as_echo_n "checking for the pthreads library -l$flag... " >&6; } + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; } +int +main () +{ +pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +$as_echo_n "checking for joinable pthread attribute... " >&6; } + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int attr = $attr; return attr /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + attr_name=$attr; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 +$as_echo "$attr_name" >&6; } + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $attr_name +_ACEOF + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 +$as_echo_n "checking if more special flags are required for pthreads... " >&6; } + flag=no + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + # TODO: What about Clang on Solaris? + flag="-mt -D_REENTRANT" + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag" >&5 +$as_echo "$flag" >&6; } + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 +$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } +if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int i = PTHREAD_PRIO_INHERIT; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_PTHREAD_PRIO_INHERIT=yes +else + ax_cv_PTHREAD_PRIO_INHERIT=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 +$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } + if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then : + +$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h + +fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != xyes; then + case $host_os in + aix*) + case "x/$CC" in #( + x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : + #handle absolute path differently from PATH based program lookup + case "x$CC" in #( + x/*) : + if as_fn_executable_p ${CC}_r; then : + PTHREAD_CC="${CC}_r" +fi ;; #( + *) : + for ac_prog in ${CC}_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PTHREAD_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +$as_echo "$PTHREAD_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + ;; +esac ;; #( + *) : + ;; +esac + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + + + + + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + +$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h + + : +else + ax_pthread_ok=no + as_fn_error $? "threaded input requested but no pthread support has been found" "$LINENO" 5 +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + SYS_LIBS="$SYS_LIBS $PTHREAD_LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + +$as_echo "#define INPUTTHREAD 1" >>confdefs.h + + + save_LIBS="$LIBS" + LIBS="$LIBS $SYS_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setname_np(const char*)" >&5 +$as_echo_n "checking for pthread_setname_np(const char*)... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +pthread_setname_np("example") + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setname_np(pthread_t, const char*)" >&5 +$as_echo_n "checking for pthread_setname_np(pthread_t, const char*)... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +pthread_setname_np(pthread_self(), "example") + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_PTHREAD_SETNAME_NP_WITH_TID 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" +fi + REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $SDK_REQUIRED_MODULES" LIBSYSTEMD="libsystemd >= 209" @@ -24999,16 +25565,6 @@ $as_echo "#define CONFIG_WSCONS 1" >>confdefs.h fi -if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then - USE_SIGIO_BY_DEFAULT_VALUE=TRUE -else - USE_SIGIO_BY_DEFAULT_VALUE=FALSE -fi - -cat >>confdefs.h <<_ACEOF -#define USE_SIGIO_BY_DEFAULT $USE_SIGIO_BY_DEFAULT_VALUE -_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glibc..." >&5 $as_echo_n "checking for glibc...... " >&6; } @@ -25482,7 +26038,7 @@ fi case "x$XTRANS_SEND_FDS" in xauto) case "$host_os" in - linux*|openbsd*|solaris*) + linux*|solaris*|freebsd*|dragonfly*|openbsd*) XTRANS_SEND_FDS=yes ;; *) @@ -25875,44 +26431,6 @@ fi fi fi -if test "x$DRI2" = xyes; then - save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $GL_CFLAGS $LIBDRM_CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#ifndef __DRI_DRI2 -#error DRI2 extension not available. -#endif -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - HAVE_DRI2EXTENSION=yes -else - HAVE_DRI2EXTENSION=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$save_CFLAGS - if test "x$HAVE_DRI2EXTENSION" = xyes; then - -$as_echo "#define DRI2_AIGLX 1" >>confdefs.h - - DRI2_AIGLX=yes - else - { $as_echo "$as_me:${as_lineno-$LINENO}: DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h." >&5 -$as_echo "$as_me: DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h." >&6;} - DRI2_AIGLX=no - fi -fi - if test "x$DRI2_AIGLX" = xyes; then - DRI2_AIGLX_TRUE= - DRI2_AIGLX_FALSE='#' -else - DRI2_AIGLX_TRUE='#' - DRI2_AIGLX_FALSE= -fi - - if test "x$GLX" = xyes; then pkg_failed=no @@ -26114,24 +26632,6 @@ else fi -if test "x$GLX" = xno; then - AIGLX=no -fi - -if test "x$AIGLX" = xyes -a \( "x$DRI2" = xyes \); then - -$as_echo "#define AIGLX 1" >>confdefs.h - -fi - if { test "x$DRI2" = xyes; } && test "x$AIGLX" = xyes; then - AIGLX_DRI_LOADER_TRUE= - AIGLX_DRI_LOADER_FALSE='#' -else - AIGLX_DRI_LOADER_TRUE='#' - AIGLX_DRI_LOADER_FALSE= -fi - - @@ -27972,7 +28472,7 @@ if test "x$XNEST" = xyes; then if test "x$have_xnest" = xno; then as_fn_error $? "Xnest build explicitly requested, but required modules not found." "$LINENO" 5 fi - XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" + XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $RENDER_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS" @@ -28939,6 +29439,15 @@ else fi +if test "x$GLAMOR" = xauto; then + if test "x$XORG" = xyes; then + GLAMOR=yes + fi + if test "x$XEPHYR" = xyes; then + GLAMOR=yes + fi +fi + if test "x$GLAMOR" = xyes; then GLAMOR_TRUE= GLAMOR_FALSE='#' @@ -28947,6 +29456,7 @@ else GLAMOR_FALSE= fi + if test "x$GLAMOR" = xyes; then $as_echo "#define GLAMOR 1" >>confdefs.h @@ -29127,8 +29637,11 @@ $as_echo "#define GLAMOR_HAS_GBM_LINEAR 1" >>confdefs.h fi + else + if test "x$XORG" = xyes; then + as_fn_error $? "Glamor for Xorg requires $LIBGBM" "$LINENO" 5 + fi fi - fi if test "x$GBM" = xyes; then GLAMOR_EGL_TRUE= @@ -29282,12 +29795,12 @@ if test -n "$XWINMODULES_CFLAGS"; then pkg_cv_XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_XWINMODULES_CFLAGS=`$PKG_CONFIG --cflags "x11 xdmcp xau xfixes" 2>/dev/null` + pkg_cv_XWINMODULES_CFLAGS=`$PKG_CONFIG --cflags "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -29299,12 +29812,12 @@ if test -n "$XWINMODULES_LIBS"; then pkg_cv_XWINMODULES_LIBS="$XWINMODULES_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_XWINMODULES_LIBS=`$PKG_CONFIG --libs "x11 xdmcp xau xfixes" 2>/dev/null` + pkg_cv_XWINMODULES_LIBS=`$PKG_CONFIG --libs "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -29325,14 +29838,14 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xdmcp xau xfixes" 2>&1` + XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm" 2>&1` else - XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xdmcp xau xfixes" 2>&1` + XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XWINMODULES_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (x11 xdmcp xau xfixes) were not met: + as_fn_error $? "Package requirements (x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm) were not met: $XWINMODULES_PKG_ERRORS @@ -29475,6 +29988,112 @@ $as_echo "#define ROOTLESS 1" >>confdefs.h fi + if test "x$WINDOWSDRI" = xauto; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"windowsdriproto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "windowsdriproto") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + WINDOWSDRI=yes +else + WINDOWSDRI=no +fi + fi + if test "x$WINDOWSDRI" = xyes ; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WINDOWSDRI" >&5 +$as_echo_n "checking for WINDOWSDRI... " >&6; } + +if test -n "$WINDOWSDRI_CFLAGS"; then + pkg_cv_WINDOWSDRI_CFLAGS="$WINDOWSDRI_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"windowsdriproto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "windowsdriproto") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WINDOWSDRI_CFLAGS=`$PKG_CONFIG --cflags "windowsdriproto" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$WINDOWSDRI_LIBS"; then + pkg_cv_WINDOWSDRI_LIBS="$WINDOWSDRI_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"windowsdriproto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "windowsdriproto") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WINDOWSDRI_LIBS=`$PKG_CONFIG --libs "windowsdriproto" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + WINDOWSDRI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "windowsdriproto" 2>&1` + else + WINDOWSDRI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "windowsdriproto" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$WINDOWSDRI_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (windowsdriproto) were not met: + +$WINDOWSDRI_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables WINDOWSDRI_CFLAGS +and WINDOWSDRI_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables WINDOWSDRI_CFLAGS +and WINDOWSDRI_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + WINDOWSDRI_CFLAGS=$pkg_cv_WINDOWSDRI_CFLAGS + WINDOWSDRI_LIBS=$pkg_cv_WINDOWSDRI_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + fi + case $host_os in cygwin*) XWIN_SERVER_NAME=XWin @@ -29519,7 +30138,7 @@ $as_echo "#define DDXOSVERRORF 1" >>confdefs.h $as_echo "#define DDXBEFORERESET 1" >>confdefs.h - if test "x$XWIN" = xyes && test "x$AIGLX" = xyes ; then + if test "x$XWIN" = xyes && test "x$GLX" = xyes ; then # Extract the first word of "python3", so it can be a program name with args. set dummy python3; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -29698,7 +30317,7 @@ else XWIN_CLIPBOARD_FALSE= fi - if test "x$XWIN" = xyes && test "x$AIGLX" = xyes; then + if test "x$XWIN" = xyes && test "x$GLX" = xyes; then XWIN_GLX_WINDOWS_TRUE= XWIN_GLX_WINDOWS_FALSE='#' else @@ -29706,6 +30325,14 @@ else XWIN_GLX_WINDOWS_FALSE= fi + if test "x$XWIN" = xyes && test "x$WINDOWSDRI" = xyes; then + XWIN_WINDOWS_DRI_TRUE= + XWIN_WINDOWS_DRI_FALSE='#' +else + XWIN_WINDOWS_DRI_TRUE='#' + XWIN_WINDOWS_DRI_FALSE= +fi + if test "x$XWIN" = xyes; then XWIN_RANDR_TRUE= XWIN_RANDR_FALSE='#' @@ -30222,7 +30849,7 @@ if test "x$DMX" = xyes; then fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" XDMX_CFLAGS="$DMXMODULES_CFLAGS" - XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $RANDR_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" + XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $PRESENT_LIB $RANDR_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" XDMX_SYS_LIBS="$DMXMODULES_LIBS" @@ -31036,12 +31663,12 @@ $as_echo "#define KDRIVE_MOUSE 1" >>confdefs.h fi - XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms xcb-randr" + XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms xcb-randr xcb-xkb" if test "x$XV" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv" fi if test "x$DRI" = xyes && test "x$GLX" = xyes; then - XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS libdrm xcb-glx xcb-xf86dri > 1.6" + XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBDRM xcb-glx xcb-xf86dri > 1.6" fi if test "x$GLAMOR" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS x11-xcb" @@ -31361,7 +31988,7 @@ fi -XWAYLANDMODULES="wayland-client >= 1.3.0 libdrm epoxy" +XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.1 $LIBDRM epoxy" if test "x$XF86VIDMODE" = xyes; then XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO" fi @@ -31462,6 +32089,10 @@ if test "x$XWAYLAND" = xyes; then + if test "x$MONOTONIC_CLOCK" != xyes; then + as_fn_error $? "Xwayland requires CLOCK_MONOTONIC support." "$LINENO" 5 + fi + WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client` # Extract the first word of "wayland-scanner", so it can be a program name with args. set dummy wayland-scanner; ac_word=$2 @@ -31503,6 +32134,9 @@ $as_echo "no" >&6; } fi + + WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols` + fi @@ -31595,7 +32229,7 @@ $as_echo "$as_me: WARNING: ***********************************************" >&2;} fi -ac_config_files="$ac_config_files Makefile glx/Makefile include/Makefile composite/Makefile damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile doc/dtrace/Makefile man/Makefile fb/Makefile glamor/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile dri3/Makefile present/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/Xorg.sh hw/xfree86/common/Makefile hw/xfree86/common/xf86Build.h hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile hw/xfree86/dri2/pci_ids/Makefile hw/xfree86/drivers/Makefile hw/xfree86/drivers/modesetting/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/glamor_egl/Makefile hw/xfree86/i2c/Makefile hw/xfree86/int10/Makefile hw/xfree86/loader/Makefile hw/xfree86/man/Makefile hw/xfree86/modes/Makefile hw/xfree86/os-support/Makefile hw/xfree86/os-support/bsd/Makefile hw/xfree86/os-support/bus/Makefile hw/xfree86/os-support/hurd/Makefile hw/xfree86/os-support/misc/Makefile hw/xfree86/os-support/linux/Makefile hw/xfree86/os-support/solaris/Makefile hw/xfree86/os-support/stub/Makefile hw/xfree86/parser/Makefile hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/gtf/Makefile hw/dmx/config/Makefile hw/dmx/config/man/Makefile hw/dmx/doc/Makefile hw/dmx/doxygen/doxygen.conf hw/dmx/doxygen/Makefile hw/dmx/examples/Makefile hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile hw/dmx/man/Makefile hw/vfb/Makefile hw/vfb/man/Makefile hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile hw/xwin/winclipboard/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile hw/xquartz/man/Makefile hw/xquartz/mach-startup/Makefile hw/xquartz/pbproxy/Makefile hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/ephyr/man/Makefile hw/kdrive/fake/Makefile hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/src/Makefile hw/xwayland/Makefile test/Makefile test/xi1/Makefile test/xi2/Makefile xserver.ent xorg-server.pc" +ac_config_files="$ac_config_files Makefile glx/Makefile include/Makefile composite/Makefile damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile doc/dtrace/Makefile man/Makefile fb/Makefile glamor/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile dri3/Makefile present/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/Xorg.sh hw/xfree86/common/Makefile hw/xfree86/common/xf86Build.h hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile hw/xfree86/dri2/pci_ids/Makefile hw/xfree86/drivers/Makefile hw/xfree86/drivers/modesetting/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/glamor_egl/Makefile hw/xfree86/i2c/Makefile hw/xfree86/int10/Makefile hw/xfree86/loader/Makefile hw/xfree86/man/Makefile hw/xfree86/modes/Makefile hw/xfree86/os-support/Makefile hw/xfree86/os-support/bsd/Makefile hw/xfree86/os-support/bus/Makefile hw/xfree86/os-support/hurd/Makefile hw/xfree86/os-support/misc/Makefile hw/xfree86/os-support/linux/Makefile hw/xfree86/os-support/solaris/Makefile hw/xfree86/os-support/stub/Makefile hw/xfree86/parser/Makefile hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/xkb/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/gtf/Makefile hw/dmx/config/Makefile hw/dmx/config/man/Makefile hw/dmx/doc/Makefile hw/dmx/doxygen/doxygen.conf hw/dmx/doxygen/Makefile hw/dmx/examples/Makefile hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile hw/dmx/man/Makefile hw/vfb/Makefile hw/vfb/man/Makefile hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/dri/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile hw/xwin/winclipboard/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile hw/xquartz/man/Makefile hw/xquartz/mach-startup/Makefile hw/xquartz/pbproxy/Makefile hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/ephyr/man/Makefile hw/kdrive/fake/Makefile hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/src/Makefile hw/xwayland/Makefile test/Makefile test/xi1/Makefile test/xi2/Makefile xserver.ent xorg-server.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -31791,6 +32425,10 @@ if test -z "${SPECIAL_DTRACE_OBJECTS_TRUE}" && test -z "${SPECIAL_DTRACE_OBJECTS Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${POLL_TRUE}" && test -z "${POLL_FALSE}"; then + as_fn_error $? "conditional \"POLL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${AGP_TRUE}" && test -z "${AGP_FALSE}"; then as_fn_error $? "conditional \"AGP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -31959,18 +32597,10 @@ if test -z "${DRI3_TRUE}" && test -z "${DRI3_FALSE}"; then as_fn_error $? "conditional \"DRI3\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${DRI2_AIGLX_TRUE}" && test -z "${DRI2_AIGLX_FALSE}"; then - as_fn_error $? "conditional \"DRI2_AIGLX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${GLX_TRUE}" && test -z "${GLX_FALSE}"; then as_fn_error $? "conditional \"GLX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${AIGLX_DRI_LOADER_TRUE}" && test -z "${AIGLX_DRI_LOADER_FALSE}"; then - as_fn_error $? "conditional \"AIGLX_DRI_LOADER\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${PRESENT_TRUE}" && test -z "${PRESENT_FALSE}"; then as_fn_error $? "conditional \"PRESENT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32127,6 +32757,10 @@ if test -z "${XWIN_GLX_WINDOWS_TRUE}" && test -z "${XWIN_GLX_WINDOWS_FALSE}"; th as_fn_error $? "conditional \"XWIN_GLX_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${XWIN_WINDOWS_DRI_TRUE}" && test -z "${XWIN_WINDOWS_DRI_FALSE}"; then + as_fn_error $? "conditional \"XWIN_WINDOWS_DRI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${XWIN_RANDR_TRUE}" && test -z "${XWIN_RANDR_FALSE}"; then as_fn_error $? "conditional \"XWIN_RANDR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32608,7 +33242,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xorg-server $as_me 1.18.4, which was +This file was extended by xorg-server $as_me 1.19.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -32674,7 +33308,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -xorg-server config.status 1.18.4 +xorg-server config.status 1.19.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -33161,6 +33795,7 @@ do "hw/xfree86/vbe/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/vbe/Makefile" ;; "hw/xfree86/vgahw/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/vgahw/Makefile" ;; "hw/xfree86/x86emu/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/x86emu/Makefile" ;; + "hw/xfree86/xkb/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/xkb/Makefile" ;; "hw/xfree86/utils/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/utils/Makefile" ;; "hw/xfree86/utils/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/utils/man/Makefile" ;; "hw/xfree86/utils/cvt/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/utils/cvt/Makefile" ;; @@ -33180,6 +33815,7 @@ do "hw/xnest/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xnest/Makefile" ;; "hw/xnest/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xnest/man/Makefile" ;; "hw/xwin/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/Makefile" ;; + "hw/xwin/dri/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/dri/Makefile" ;; "hw/xwin/glx/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/glx/Makefile" ;; "hw/xwin/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/man/Makefile" ;; "hw/xwin/winclipboard/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/winclipboard/Makefile" ;; diff --git a/xserver/configure.ac b/xserver/configure.ac index 1e1577124..2988bd3e8 100644 --- a/xserver/configure.ac +++ b/xserver/configure.ac @@ -26,9 +26,9 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.18.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2016-07-19" -RELEASE_NAME="Skordalia" +AC_INIT([xorg-server], 1.19.5, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2017-10-12" +RELEASE_NAME="Shahi Paneer" AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) @@ -134,7 +134,7 @@ AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h \ - fnmatch.h sys/mkdev.h sys/utsname.h]) + fnmatch.h sys/mkdev.h sys/sysmacros.h sys/utsname.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -219,9 +219,12 @@ dnl Checks for library functions. AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \ getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \ - walkcontext]) -AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup \ + walkcontext setitimer poll epoll_create1]) +AC_CONFIG_LIBOBJ_DIR([os]) +AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup\ timingsafe_memcmp]) +AM_CONDITIONAL(POLL, [test "x$ac_cv_func_poll" = "xyes"]) + AC_CHECK_LIB([bsd], [arc4random_buf]) AC_CHECK_FUNCS([arc4random_buf]) @@ -407,7 +410,6 @@ AM_CONDITIONAL(SGI_VIDEO, [test "x$SGI_VIDEO" = xyes]) AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes]) DRI=no -USE_SIGIO_BY_DEFAULT="yes" dnl it would be nice to autodetect these *CONS_SUPPORTs case $host_os in *freebsd* | *dragonfly*) @@ -439,10 +441,7 @@ case $host_os in DRI=yes ;; *solaris*) - PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no) - # Disable use of SIGIO by default until some system bugs are - # fixed - see Sun/OpenSolaris bug id 6879897 - USE_SIGIO_BY_DEFAULT="no" + DRI=yes ;; darwin*) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) @@ -475,9 +474,6 @@ AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror], AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debugging (default: disabled)]), [DEBUGGING=$enableval], [DEBUGGING=no]) -AC_ARG_ENABLE(use-sigio-by-default, AS_HELP_STRING([--enable-use-sigio-by-default] - [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]), - [USE_SIGIO_BY_DEFAULT=$enableval], []) AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]), [INT10="$withval"], [INT10="$DEFAULT_INT10"]) @@ -522,6 +518,25 @@ AC_ARG_ENABLE(listen-local, AS_HELP_STRING([--disable-listen-local], [Listen on local by default (default:enabled)]), [LISTEN_LOCAL=$enableval], [LISTEN_LOCAL=yes]) +case $host_os in + linux*) + FALLBACK_INPUT_DRIVER="libinput" + ;; + *) + FALLBACK_INPUT_DRIVER="" + ;; +esac +AC_ARG_WITH(fallback-input-driver, + AC_HELP_STRING([--with-fallback-input-driver=$FALLBACK_INPUT_DRIVER], + [Input driver fallback if the requested driver for a device is unavailable]), + [ FALLBACK_INPUT_DRIVER=$withval ], []) +if test "x$FALLBACK_INPUT_DRIVER" = "xno"; then + FALLBACK_INPUT_DRIVER="" +fi +AC_MSG_CHECKING([for fallback input driver]) +AC_MSG_RESULT([$FALLBACK_INPUT_DRIVER]) +AC_DEFINE_UNQUOTED(FALLBACK_INPUT_DRIVER, ["$FALLBACK_INPUT_DRIVER"], [ Fallback input driver ]) + dnl Determine font path XORG_FONTROOTDIR XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc) @@ -610,10 +625,6 @@ AC_ARG_ENABLE(visibility, AS_HELP_STRING([--enable-visibility], [Enable symb [SYMBOL_VISIBILITY=auto]) dnl GLX build options -AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]), - [AIGLX=$enableval], - [AIGLX=yes]) - AC_ARG_WITH(khronos-spec-dir, AS_HELP_STRING([--with-khronos-spec-dir=PATH], [Path to Khronos OpenGL registry database files (default: auto)]), [KHRONOS_SPEC_DIR="${withval}"], [KHRONOS_SPEC_DIR=auto]) @@ -662,6 +673,7 @@ AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes]) AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes]) AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no]) +AC_ARG_ENABLE(windowsdri, AS_HELP_STRING([--enable-windowsdri], [Build XWin with WindowsDRI extension (default: auto)]), [WINDOWSDRI=$enableval], [WINDOWSDRI=auto]) AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes]) AC_ARG_ENABLE(clientids, AS_HELP_STRING([--disable-clientids], [Build Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], [CLIENTIDS=yes]) AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess], [Build Xorg with pciaccess library (default: enabled)]), [PCI=$enableval], [PCI=yes]) @@ -679,7 +691,7 @@ AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz AC_ARG_ENABLE(xwayland, AS_HELP_STRING([--enable-xwayland], [Build Xwayland server (default: auto)]), [XWAYLAND=$enableval], [XWAYLAND=auto]) AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no]) AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) -AC_ARG_ENABLE(glamor, AS_HELP_STRING([--enable-glamor], [Build glamor dix module (default: no)]), [GLAMOR=$enableval], [GLAMOR=no]) +AC_ARG_ENABLE(glamor, AS_HELP_STRING([--enable-glamor], [Build glamor dix module (default: auto)]), [GLAMOR=$enableval], [GLAMOR=auto]) dnl kdrive and its subsystems AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no]) AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto]) @@ -836,7 +848,7 @@ APPLEWMPROTO="applewmproto >= 1.4" LIBXSHMFENCE="xshmfence >= 1.1" dnl Required modules -XPROTO="xproto >= 7.0.28" +XPROTO="xproto >= 7.0.31" RANDRPROTO="randrproto >= 1.5.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.2.99.901" @@ -854,12 +866,12 @@ dnl List of libraries that require a specific version LIBAPPLEWM="applewm >= 1.4" LIBDMX="dmx >= 1.0.99.1" LIBDRI="dri >= 7.8.0" -LIBDRM="libdrm >= 2.3.0" +LIBDRM="libdrm >= 2.3.1" LIBEGL="egl" LIBGBM="gbm >= 10.2.0" LIBGL="gl >= 7.1.0" LIBXEXT="xext >= 1.0.99.4" -LIBXFONT="xfont >= 1.4.2" +LIBXFONT="xfont2 >= 2.0.0" LIBXI="xi >= 1.2.99.1" LIBXTST="xtst >= 1.0.99.2" LIBPCIACCESS="pciaccess >= 0.12.901" @@ -878,6 +890,45 @@ SDK_REQUIRED_MODULES="$XPROTO $RANDRPROTO $RENDERPROTO $XEXTPROTO $INPUTPROTO $K # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc AC_SUBST(SDK_REQUIRED_MODULES) +AC_CHECK_DECL([PTHREAD_MUTEX_RECURSIVE], [HAVE_RECURSIVE_MUTEX=yes], [HAVE_RECURSIVE_MUTEX=no], [[#include ]]) + +THREAD_DEFAULT=no + +if test "x$HAVE_RECURSIVE_MUTEX" = "xyes" ; then + THREAD_DEFAULT=yes +fi + +AC_ARG_ENABLE(input-thread, AS_HELP_STRING([--enable-input-thread], + [Enable input threads]), + [INPUTTHREAD=$enableval], [INPUTTHREAD=$THREAD_DEFAULT]) + +if test "x$INPUTTHREAD" = "xyes" ; then + AX_PTHREAD(,AC_MSG_ERROR([threaded input requested but no pthread support has been found])) + SYS_LIBS="$SYS_LIBS $PTHREAD_LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + AC_DEFINE(INPUTTHREAD, 1, [Use a separate input thread]) + + save_LIBS="$LIBS" + LIBS="$LIBS $SYS_LIBS" + dnl MacOS X 10.6 & higher + AC_MSG_CHECKING(for pthread_setname_np(const char*)) + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [pthread_setname_np("example")])], + [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID,1, + [Have function pthread_setname_np(const char*)])], + [AC_MSG_RESULT(no)]) + dnl GNU libc 2.12 & higher, Solaris 11.3 & higher + AC_MSG_CHECKING(for pthread_setname_np(pthread_t, const char*)) + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [pthread_setname_np(pthread_self(), "example")])], + [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_WITH_TID,1, + [Have function pthread_setname_np(pthread_t, const char*)])], + [AC_MSG_RESULT(no)]) + LIBS="$save_LIBS" +fi + REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $SDK_REQUIRED_MODULES" dnl systemd socket activation @@ -1006,13 +1057,6 @@ if test "x$CONFIG_WSCONS" = xyes; then AC_DEFINE(CONFIG_WSCONS, 1, [Use wscons for input auto configuration]) fi -if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then - USE_SIGIO_BY_DEFAULT_VALUE=TRUE -else - USE_SIGIO_BY_DEFAULT_VALUE=FALSE -fi -AC_DEFINE_UNQUOTED([USE_SIGIO_BY_DEFAULT], [$USE_SIGIO_BY_DEFAULT_VALUE], - [Use SIGIO handlers for input device events by default]) AC_MSG_CHECKING([for glibc...]) AC_PREPROC_IFELSE([AC_LANG_SOURCE([ @@ -1223,7 +1267,7 @@ AC_ARG_ENABLE(xtrans-send-fds, AS_HELP_STRING([--disable-xtrans-send-fds], [Use case "x$XTRANS_SEND_FDS" in xauto) case "$host_os" in - linux*|openbsd*|solaris*) + linux*|solaris*|freebsd*|dragonfly*|openbsd*) XTRANS_SEND_FDS=yes ;; *) @@ -1340,27 +1384,6 @@ if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test " fi fi -if test "x$DRI2" = xyes; then - save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $GL_CFLAGS $LIBDRM_CFLAGS" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include -#include -#ifndef __DRI_DRI2 -#error DRI2 extension not available. -#endif]])], - [HAVE_DRI2EXTENSION=yes], - [HAVE_DRI2EXTENSION=no]) - CFLAGS=$save_CFLAGS - if test "x$HAVE_DRI2EXTENSION" = xyes; then - AC_DEFINE(DRI2_AIGLX, 1, [Build DRI2 AIGLX loader]) - DRI2_AIGLX=yes - else - AC_MSG_NOTICE([DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h.]) - DRI2_AIGLX=no - fi -fi -AM_CONDITIONAL(DRI2_AIGLX, test "x$DRI2_AIGLX" = xyes) - if test "x$GLX" = xyes; then PKG_CHECK_MODULES([XLIB], [x11]) PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL) @@ -1373,15 +1396,6 @@ else fi AM_CONDITIONAL(GLX, test "x$GLX" = xyes) -if test "x$GLX" = xno; then - AIGLX=no -fi - -if test "x$AIGLX" = xyes -a \( "x$DRI2" = xyes \); then - AC_DEFINE(AIGLX, 1, [Build AIGLX loader]) -fi -AM_CONDITIONAL(AIGLX_DRI_LOADER, { test "x$DRI2" = xyes; } && test "x$AIGLX" = xyes) - AC_SUBST([GLX_DEFINES]) AC_SUBST([GLX_SYS_LIBS]) @@ -1891,7 +1905,7 @@ if test "x$XNEST" = xyes; then if test "x$have_xnest" = xno; then AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.]) fi - XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" + XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $RENDER_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XNEST_LIBS]) AC_SUBST([XNEST_SYS_LIBS]) @@ -2191,7 +2205,17 @@ AM_CONDITIONAL([XORG_BUS_PLATFORM], [test "x$CONFIG_UDEV_KMS" = xyes]) AM_CONDITIONAL([XORG_DRIVER_MODESETTING], [test "x$XORG_DRIVER_MODESETTING" = xyes]) dnl glamor +if test "x$GLAMOR" = xauto; then + if test "x$XORG" = xyes; then + GLAMOR=yes + fi + if test "x$XEPHYR" = xyes; then + GLAMOR=yes + fi +fi + AM_CONDITIONAL([GLAMOR], [test "x$GLAMOR" = xyes]) + if test "x$GLAMOR" = xyes; then AC_DEFINE(GLAMOR, 1, [Build glamor]) PKG_CHECK_MODULES([GLAMOR], [epoxy]) @@ -2204,8 +2228,11 @@ if test "x$GLAMOR" = xyes; then [AC_DEFINE(GLAMOR_HAS_GBM_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], [], [#include #include ]) + else + if test "x$XORG" = xyes; then + AC_MSG_ERROR([Glamor for Xorg requires $LIBGBM]) + fi fi - fi AM_CONDITIONAL([GLAMOR_EGL], [test "x$GBM" = xyes]) @@ -2227,7 +2254,7 @@ if test "x$XWIN" = xyes; then AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) AC_CHECK_TOOL(WINDRES, windres) - PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfixes]) + PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm]) if test "x$WINDOWSWM" = xauto; then PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no]) @@ -2238,6 +2265,13 @@ if test "x$XWIN" = xyes; then AC_DEFINE(ROOTLESS,1,[Build Rootless code]) fi + if test "x$WINDOWSDRI" = xauto; then + PKG_CHECK_EXISTS([windowsdriproto], [WINDOWSDRI=yes], [WINDOWSDRI=no]) + fi + if test "x$WINDOWSDRI" = xyes ; then + PKG_CHECK_MODULES(WINDOWSDRI, [windowsdriproto]) + fi + case $host_os in cygwin*) XWIN_SERVER_NAME=XWin @@ -2266,8 +2300,8 @@ if test "x$XWIN" = xyes; then AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF]) AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ]) -dnl XWin with AIGLX requires OpenGL spec files in order to generate wrapper code for native GL functions - if [test "x$XWIN" = xyes && test "x$AIGLX" = xyes] ; then +dnl XWin requires OpenGL spec files in order to generate wrapper code for native GL functions + if [test "x$XWIN" = xyes && test "x$GLX" = xyes] ; then AC_CHECK_PROG(PYTHON3, python3, python3) if test -z "$PYTHON3"; then AC_MSG_ERROR([python3 not found]) @@ -2290,7 +2324,8 @@ AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes]) AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$AIGLX" = xyes]) +AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$GLX" = xyes]) +AM_CONDITIONAL(XWIN_WINDOWS_DRI, [test "x$XWIN" = xyes && test "x$WINDOWSDRI" = xyes]) AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes]) @@ -2363,7 +2398,7 @@ if test "x$DMX" = xyes; then fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" XDMX_CFLAGS="$DMXMODULES_CFLAGS" - XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $RANDR_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" + XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $PRESENT_LIB $RANDR_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" XDMX_SYS_LIBS="$DMXMODULES_LIBS" AC_SUBST([XDMX_CFLAGS]) AC_SUBST([XDMX_LIBS]) @@ -2473,12 +2508,12 @@ if test "$KDRIVE" = yes; then AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver]) fi - XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms xcb-randr" + XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms xcb-randr xcb-xkb" if test "x$XV" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv" fi if test "x$DRI" = xyes && test "x$GLX" = xyes; then - XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS libdrm xcb-glx xcb-xf86dri > 1.6" + XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBDRM xcb-glx xcb-xf86dri > 1.6" fi if test "x$GLAMOR" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS x11-xcb" @@ -2532,7 +2567,7 @@ AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes]) dnl Xwayland DDX -XWAYLANDMODULES="wayland-client >= 1.3.0 libdrm epoxy" +XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.1 $LIBDRM epoxy" if test "x$XF86VIDMODE" = xyes; then XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO" fi @@ -2554,9 +2589,15 @@ if test "x$XWAYLAND" = xyes; then AC_SUBST([XWAYLAND_LIBS]) AC_SUBST([XWAYLAND_SYS_LIBS]) + if test "x$MONOTONIC_CLOCK" != xyes; then + AC_MSG_ERROR([Xwayland requires CLOCK_MONOTONIC support.]) + fi + WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client` AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],, [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH]) + + AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`) fi @@ -2670,6 +2711,7 @@ hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile +hw/xfree86/xkb/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile @@ -2689,6 +2731,7 @@ hw/vfb/man/Makefile hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile +hw/xwin/dri/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile hw/xwin/winclipboard/Makefile diff --git a/xserver/damageext/Makefile.in b/xserver/damageext/Makefile.in index 6859219a7..ac19f4161 100644 --- a/xserver/damageext/Makefile.in +++ b/xserver/damageext/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -298,6 +299,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -328,7 +332,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -423,6 +430,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/damageext/damageext.c b/xserver/damageext/damageext.c index 886f56d9e..86b54eef4 100644 --- a/xserver/damageext/damageext.c +++ b/xserver/damageext/damageext.c @@ -568,24 +568,6 @@ SProcDamageDispatch(ClientPtr client) return (*SProcDamageVector[stuff->damageReqType]) (client); } -static void -DamageClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - DamageClientPtr pDamageClient = GetDamageClient(pClient); - - pDamageClient->critical = 0; - pDamageClient->major_version = 0; - pDamageClient->minor_version = 0; -} - - /*ARGSUSED*/ static void -DamageResetProc(ExtensionEntry * extEntry) -{ - DeleteCallback(&ClientStateCallback, DamageClientCallback, 0); -} - static int FreeDamageExt(void *value, XID did) { @@ -757,13 +739,10 @@ DamageExtensionInit(void) (&DamageClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(DamageClientRec))) return; - if (!AddCallback(&ClientStateCallback, DamageClientCallback, 0)) - return; - if ((extEntry = AddExtension(DAMAGE_NAME, XDamageNumberEvents, XDamageNumberErrors, ProcDamageDispatch, SProcDamageDispatch, - DamageResetProc, StandardMinorOpcode)) != 0) { + NULL, StandardMinorOpcode)) != 0) { DamageReqCode = (unsigned char) extEntry->base; DamageEventBase = extEntry->eventBase; EventSwapVector[DamageEventBase + XDamageNotify] = diff --git a/xserver/hw/kdrive/ephyr/ephyrglxext.h b/xserver/damageext/damageext.h similarity index 57% rename from xserver/hw/kdrive/ephyr/ephyrglxext.h rename to xserver/damageext/damageext.h index 8b4b3a248..bd9963509 100644 --- a/xserver/hw/kdrive/ephyr/ephyrglxext.h +++ b/xserver/damageext/damageext.h @@ -1,34 +1,33 @@ /* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd + * Copyright © 2002 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the name of OpenedHand Ltd not be used in + * documentation, and that the name of Keith Packard not be used in * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no + * specific, written prior permission. Keith Packard makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: - * Dodji Seketeli */ -#ifndef __EPHYR_GLXEXT_H__ -#define __EPHYR_GLXEXT_H__ -#include -Bool ephyrHijackGLXExtension(void); +#ifdef HAVE_DIX_CONFIG_H +#include +#endif -#endif /*__EPHYR_GLXEXT_H__*/ +#ifndef _DAMAGEEXT_H_ +#define _DAMAGEEXT_H_ + +void + DamageExtensionInit(void); + +#endif /* _DAMAGEEXT_H_ */ diff --git a/xserver/dbe/Makefile.in b/xserver/dbe/Makefile.in index 3ae882397..e805ad42e 100644 --- a/xserver/dbe/Makefile.in +++ b/xserver/dbe/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -329,6 +330,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -359,7 +363,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -454,6 +461,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/dix/Makefile.am b/xserver/dix/Makefile.am index e7ca2369c..a4171d7e1 100644 --- a/xserver/dix/Makefile.am +++ b/xserver/dix/Makefile.am @@ -61,13 +61,13 @@ endif if SPECIAL_DTRACE_OBJECTS # Generate dtrace object code for probes in libdix -dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS) +dtrace-dix.o: $(top_srcdir)/dix/Xserver.d libdix.la $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) noinst_PROGRAMS = dix.O dix_O_SOURCES = -dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS) +dix.O: dtrace-dix.o libdix.la $(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) endif diff --git a/xserver/dix/Makefile.in b/xserver/dix/Makefile.in index e095b6dab..d650ccb7b 100644 --- a/xserver/dix/Makefile.in +++ b/xserver/dix/Makefile.in @@ -58,9 +58,10 @@ DIST_COMMON = $(dist_miscconfig_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -344,6 +345,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -374,7 +378,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -469,6 +476,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -952,9 +960,9 @@ uninstall-am: uninstall-dist_miscconfigDATA @XSERVER_DTRACE_TRUE@ || cp Xserver-dtrace.h.in $@ # Generate dtrace object code for probes in libdix -@SPECIAL_DTRACE_OBJECTS_TRUE@dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS) +@SPECIAL_DTRACE_OBJECTS_TRUE@dtrace-dix.o: $(top_srcdir)/dix/Xserver.d libdix.la @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) -@SPECIAL_DTRACE_OBJECTS_TRUE@dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS) +@SPECIAL_DTRACE_OBJECTS_TRUE@dix.O: dtrace-dix.o libdix.la @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o) # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/xserver/dix/devices.c b/xserver/dix/devices.c index a532dcfaa..ea3c6c8a9 100644 --- a/xserver/dix/devices.c +++ b/xserver/dix/devices.c @@ -281,6 +281,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) dev->startup = autoStart; /* device grab defaults */ + UpdateCurrentTimeIf(); dev->deviceGrab.grabTime = currentTime; dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; @@ -336,12 +337,13 @@ void SendDevicePresenceEvent(int deviceid, int type) { DeviceIntRec dummyDev = { .id = XIAllDevices }; - devicePresenceNotify ev = { - .type = DevicePresenceNotify, - .time = currentTime.milliseconds, - .devchange = type, - .deviceid = deviceid - }; + devicePresenceNotify ev; + + UpdateCurrentTimeIf(); + ev.type = DevicePresenceNotify; + ev.time = currentTime.milliseconds; + ev.devchange = type; + ev.deviceid = deviceid; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); @@ -397,9 +399,11 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) } } + input_lock(); if ((*prev != dev) || !dev->inited || ((ret = (*dev->deviceProc) (dev, DEVICE_ON)) != Success)) { ErrorF("[dix] couldn't enable device %d\n", dev->id); + input_unlock(); return FALSE; } dev->enabled = TRUE; @@ -408,6 +412,7 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) for (prev = &inputInfo.devices; *prev; prev = &(*prev)->next); *prev = dev; dev->next = NULL; + input_unlock(); enabled = TRUE; XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), @@ -486,19 +491,19 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) if (dev->spriteInfo->paired) dev->spriteInfo->paired = NULL; + input_lock(); (void) (*dev->deviceProc) (dev, DEVICE_OFF); dev->enabled = FALSE; - FreeSprite(dev); - - /* now that the device is disabled, we can reset the signal handler's + /* now that the device is disabled, we can reset the event reader's * last.slave */ - OsBlockSignals(); for (other = inputInfo.devices; other; other = other->next) { if (other->last.slave == dev) other->last.slave = NULL; } - OsReleaseSignals(); + input_unlock(); + + FreeSprite(dev); LeaveWindow(dev); SetFocusOut(dev); @@ -567,7 +572,9 @@ ActivateDevice(DeviceIntPtr dev, BOOL sendevent) if (!dev || !dev->deviceProc) return BadImplementation; + input_lock(); ret = (*dev->deviceProc) (dev, DEVICE_INIT); + input_unlock(); dev->inited = (ret == Success); if (!dev->inited) return ret; @@ -702,17 +709,32 @@ CorePointerProc(DeviceIntPtr pDev, int what) void InitCoreDevices(void) { - if (AllocDevicePair(serverClient, "Virtual core", - &inputInfo.pointer, &inputInfo.keyboard, - CorePointerProc, CoreKeyboardProc, TRUE) != Success) - FatalError("Failed to allocate core devices"); + int result; - if (ActivateDevice(inputInfo.pointer, TRUE) != Success || - ActivateDevice(inputInfo.keyboard, TRUE) != Success) - FatalError("Failed to activate core devices."); - if (!EnableDevice(inputInfo.pointer, TRUE) || - !EnableDevice(inputInfo.keyboard, TRUE)) - FatalError("Failed to enable core devices."); + result = AllocDevicePair(serverClient, "Virtual core", + &inputInfo.pointer, &inputInfo.keyboard, + CorePointerProc, CoreKeyboardProc, TRUE); + if (result != Success) { + FatalError("Failed to allocate virtual core devices: %d", result); + } + + result = ActivateDevice(inputInfo.pointer, TRUE); + if (result != Success) { + FatalError("Failed to activate virtual core pointer: %d", result); + } + + result = ActivateDevice(inputInfo.keyboard, TRUE); + if (result != Success) { + FatalError("Failed to activate virtual core keyboard: %d", result); + } + + if (!EnableDevice(inputInfo.pointer, TRUE)) { + FatalError("Failed to enable virtual core pointer."); + } + + if (!EnableDevice(inputInfo.keyboard, TRUE)) { + FatalError("Failed to enable virtual core keyboard."); + } InitXTestDevices(); } @@ -933,6 +955,8 @@ FreeAllDeviceClasses(ClassesPtr classes) * enable it again and free associated structs. If you want the device to just * be disabled, DisableDevice(). * Don't call this function directly, use RemoveDevice() instead. + * + * Called with input lock held. */ static void CloseDevice(DeviceIntPtr dev) @@ -1031,7 +1055,7 @@ CloseDownDevices(void) { DeviceIntPtr dev; - OsBlockSignals(); + input_lock(); /* Float all SDs before closing them. Note that at this point resources * (e.g. cursors) have been freed already, so we can't just call @@ -1058,7 +1082,7 @@ CloseDownDevices(void) XkbDeleteRulesDflts(); XkbDeleteRulesUsed(); - OsReleaseSignals(); + input_unlock(); } /** @@ -1069,6 +1093,11 @@ void AbortDevices(void) { DeviceIntPtr dev; + + /* Do not call input_lock as we don't know what + * state the input thread might be in, and that could + * cause a dead-lock. + */ nt_list_for_each_entry(dev, inputInfo.devices, next) { if (!IsMaster(dev)) (*dev->deviceProc) (dev, DEVICE_ABORT); @@ -1133,6 +1162,8 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent) flags[dev->id] = XIDeviceDisabled; } + input_lock(); + prev = NULL; for (tmp = inputInfo.devices; tmp; (prev = tmp), (tmp = next)) { next = tmp->next; @@ -1165,6 +1196,8 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent) } } + input_unlock(); + if (ret == Success && initialized) { inputInfo.numDevices--; SendDevicePresenceEvent(deviceid, DeviceRemoved); @@ -1403,6 +1436,7 @@ InitFocusClassDeviceStruct(DeviceIntPtr dev) focc = malloc(sizeof(FocusClassRec)); if (!focc) return FALSE; + UpdateCurrentTimeIf(); focc->win = PointerRootWin; focc->revert = None; focc->time = currentTime; @@ -2354,6 +2388,7 @@ ProcGetMotionEvents(ClientPtr client) if (rc != Success) return rc; + UpdateCurrentTimeIf(); if (mouse->valuator->motionHintWindow) MaybeStopHint(mouse, client); rep = (xGetMotionEventsReply) { diff --git a/xserver/dix/dispatch.c b/xserver/dix/dispatch.c index 0d6bd914e..0fdfe117e 100644 --- a/xserver/dix/dispatch.c +++ b/xserver/dix/dispatch.c @@ -108,7 +108,7 @@ int ProcInitialConnection(); #include "windowstr.h" #include -#include +#include #include "dixfontstr.h" #include "gcstruct.h" #include "selection.h" @@ -151,7 +151,6 @@ static ClientPtr grabClient; #define GrabNone 0 #define GrabActive 1 -#define GrabKickout 2 static int grabState = GrabNone; static long grabWaiters[mskcnt]; CallbackListPtr ServerGrabCallback = NULL; @@ -196,7 +195,7 @@ UpdateCurrentTime(void) systime.milliseconds = GetTimeInMillis(); if (systime.milliseconds < currentTime.milliseconds) systime.months++; - if (*checkForInput[0] != *checkForInput[1]) + if (InputCheckPending()) ProcessInputEvents(); if (CompareTimeStamps(systime, currentTime) == LATER) currentTime = systime; @@ -222,11 +221,11 @@ UpdateCurrentTimeIf(void) #define SMART_SCHEDULE_DEFAULT_INTERVAL 5 #define SMART_SCHEDULE_MAX_SLICE 15 -#if defined(WIN32) && !defined(__CYGWIN__) -Bool SmartScheduleDisable = TRUE; -#else -Bool SmartScheduleDisable = FALSE; +#ifdef HAVE_SETITIMER +#define SMART_SCHEDULE_DEFAULT_SIGNAL_ENABLE HAVE_SETITIMER +Bool SmartScheduleSignalEnable = SMART_SCHEDULE_DEFAULT_SIGNAL_ENABLE; #endif + long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; @@ -241,23 +240,88 @@ long SmartLastPrint; void Dispatch(void); -static int -SmartScheduleClient(int *clientReady, int nready) +static struct xorg_list ready_clients; +static struct xorg_list saved_ready_clients; +struct xorg_list output_pending_clients; + +static void +init_client_ready(void) { - ClientPtr pClient; - int i; - int client; - int bestPrio, best = 0; + xorg_list_init(&ready_clients); + xorg_list_init(&saved_ready_clients); + xorg_list_init(&output_pending_clients); +} + +Bool +clients_are_ready(void) +{ + return !xorg_list_is_empty(&ready_clients); +} + +/* Client has requests queued or data on the network */ +void +mark_client_ready(ClientPtr client) +{ + if (xorg_list_is_empty(&client->ready)) + xorg_list_append(&client->ready, &ready_clients); +} + +/* + * Client has requests queued or data on the network, but awaits a + * server grab release + */ +void mark_client_saved_ready(ClientPtr client) +{ + if (xorg_list_is_empty(&client->ready)) + xorg_list_append(&client->ready, &saved_ready_clients); +} + +/* Client has no requests queued and no data on network */ +void +mark_client_not_ready(ClientPtr client) +{ + xorg_list_del(&client->ready); +} + +static void +mark_client_grab(ClientPtr grab) +{ + ClientPtr client, tmp; + + xorg_list_for_each_entry_safe(client, tmp, &ready_clients, ready) { + if (client != grab) { + xorg_list_del(&client->ready); + xorg_list_append(&client->ready, &saved_ready_clients); + } + } +} + +static void +mark_client_ungrab(void) +{ + ClientPtr client, tmp; + + xorg_list_for_each_entry_safe(client, tmp, &saved_ready_clients, ready) { + xorg_list_del(&client->ready); + xorg_list_append(&client->ready, &ready_clients); + } +} + +static ClientPtr +SmartScheduleClient(void) +{ + ClientPtr pClient, best = NULL; int bestRobin, robin; long now = SmartScheduleTime; long idle; + int nready = 0; - bestPrio = -0x7fffffff; bestRobin = 0; idle = 2 * SmartScheduleSlice; - for (i = 0; i < nready; i++) { - client = clientReady[i]; - pClient = clients[client]; + + xorg_list_for_each_entry(pClient, &ready_clients, ready) { + nready++; + /* Praise clients which haven't run in a while */ if ((now - pClient->smart_stop_tick) >= idle) { if (pClient->smart_priority < 0) @@ -269,31 +333,35 @@ SmartScheduleClient(int *clientReady, int nready) (pClient->index - SmartLastIndex[pClient->smart_priority - SMART_MIN_PRIORITY]) & 0xff; - if (pClient->smart_priority > bestPrio || - (pClient->smart_priority == bestPrio && robin > bestRobin)) { - bestPrio = pClient->smart_priority; + + /* pick the best client */ + if (!best || + pClient->priority > best->priority || + (pClient->priority == best->priority && + (pClient->smart_priority > best->smart_priority || + (pClient->smart_priority == best->smart_priority && robin > bestRobin)))) + { + best = pClient; bestRobin = robin; - best = client; } #ifdef SMART_DEBUG if ((now - SmartLastPrint) >= 5000) - fprintf(stderr, " %2d: %3d", client, pClient->smart_priority); + fprintf(stderr, " %2d: %3d", pClient->index, pClient->smart_priority); #endif } #ifdef SMART_DEBUG if ((now - SmartLastPrint) >= 5000) { - fprintf(stderr, " use %2d\n", best); + fprintf(stderr, " use %2d\n", best->index); SmartLastPrint = now; } #endif - pClient = clients[best]; - SmartLastIndex[bestPrio - SMART_MIN_PRIORITY] = pClient->index; + SmartLastIndex[best->smart_priority - SMART_MIN_PRIORITY] = best->index; /* * Set current client pointer */ - if (SmartLastClient != pClient) { - pClient->smart_start_tick = now; - SmartLastClient = pClient; + if (SmartLastClient != best) { + best->smart_start_tick = now; + SmartLastClient = best; } /* * Adjust slice @@ -304,7 +372,7 @@ SmartScheduleClient(int *clientReady, int nready) * has run, bump the slice up to get maximal * performance from a single client */ - if ((now - pClient->smart_start_tick) > 1000 && + if ((now - best->smart_start_tick) > 1000 && SmartScheduleSlice < SmartScheduleMaxSlice) { SmartScheduleSlice += SmartScheduleInterval; } @@ -335,69 +403,50 @@ DisableLimitedSchedulingLatency(void) void Dispatch(void) { - int *clientReady; /* array of request ready clients */ int result; ClientPtr client; - int nready; - HWEventQueuePtr *icheck = checkForInput; long start_tick; nextFreeClientID = 1; nClients = 0; - clientReady = xallocarray(MaxClients, sizeof(int)); - if (!clientReady) - return; - SmartScheduleSlice = SmartScheduleInterval; + init_client_ready(); + while (!dispatchException) { - if (*icheck[0] != *icheck[1]) { + if (InputCheckPending()) { ProcessInputEvents(); FlushIfCriticalOutputPending(); } - nready = WaitForSomething(clientReady); + if (!WaitForSomething(clients_are_ready())) + continue; - if (nready && !SmartScheduleDisable) { - clientReady[0] = SmartScheduleClient(clientReady, nready); - nready = 1; - } /***************** * Handle events in round robin fashion, doing input between * each round *****************/ - while (!dispatchException && (--nready >= 0)) { - client = clients[clientReady[nready]]; - if (!client) { - /* KillClient can cause this to happen */ - continue; - } - /* GrabServer activation can cause this to be true */ - if (grabState == GrabKickout) { - grabState = GrabActive; - break; - } + if (!dispatchException && clients_are_ready()) { + client = SmartScheduleClient(); + isItTimeToYield = FALSE; start_tick = SmartScheduleTime; while (!isItTimeToYield) { - if (*icheck[0] != *icheck[1]) + if (InputCheckPending()) ProcessInputEvents(); FlushIfCriticalOutputPending(); - if (!SmartScheduleDisable && - (SmartScheduleTime - start_tick) >= SmartScheduleSlice) { + if ((SmartScheduleTime - start_tick) >= SmartScheduleSlice) + { /* Penalize clients which consume ticks */ if (client->smart_priority > SMART_MIN_PRIORITY) client->smart_priority--; break; } - /* now, finally, deal with client requests */ - /* Update currentTime so request time checks, such as for input - * device grabs, are calculated correctly */ - UpdateCurrentTimeIf(); + /* now, finally, deal with client requests */ result = ReadRequestFromClient(client); if (result <= 0) { if (result < 0) @@ -429,8 +478,10 @@ Dispatch(void) if (result == Success) result = (*client->requestVector[client->majorOp]) (client); - XaceHookAuditEnd(client, result); } + if (!SmartScheduleSignalEnable) + SmartScheduleTime = GetTimeInMillis(); + #ifdef XSERVER_DTRACE if (XSERVER_REQUEST_DONE_ENABLED()) XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp), @@ -450,8 +501,7 @@ Dispatch(void) } } FlushAllOutput(); - client = clients[clientReady[nready]]; - if (client) + if (client == SmartLastClient) client->smart_stop_tick = SmartScheduleTime; } dispatchException &= ~DE_PRIORITYCHANGE; @@ -460,7 +510,6 @@ Dispatch(void) ddxBeforeReset(); #endif KillAllClients(); - free(clientReady); dispatchException &= ~DE_RESET; SmartScheduleLatencyLimited = 0; ResetOsBuffers(); @@ -1058,8 +1107,9 @@ ProcGrabServer(ClientPtr client) rc = OnlyListenToOneClient(client); if (rc != Success) return rc; - grabState = GrabKickout; + grabState = GrabActive; grabClient = client; + mark_client_grab(client); if (ServerGrabCallback) { ServerGrabInfoRec grabinfo; @@ -1079,6 +1129,7 @@ UngrabServer(ClientPtr client) grabState = GrabNone; ListenToAllClients(); + mark_client_ungrab(); for (i = mskcnt; --i >= 0 && !grabWaiters[i];); if (i >= 0) { i <<= 5; @@ -1286,7 +1337,7 @@ ProcQueryTextExtents(ClientPtr client) return BadLength; length--; } - if (!QueryTextExtents(pFont, length, (unsigned char *) &stuff[1], &info)) + if (!xfont2_query_text_extents(pFont, length, (unsigned char *) &stuff[1], &info)) return BadAlloc; reply = (xQueryTextExtentsReply) { .type = X_Reply, @@ -2146,12 +2197,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, return BadAlloc; WriteReplyToClient(client, sizeof(xGetImageReply), &xgi); - if (pDraw->type == DRAWABLE_WINDOW) { - pVisibleRegion = NotClippedByChildren((WindowPtr) pDraw); - if (pVisibleRegion) { - RegionTranslate(pVisibleRegion, -pDraw->x, -pDraw->y); - } - } + if (pDraw->type == DRAWABLE_WINDOW) + pVisibleRegion = &((WindowPtr) pDraw)->borderClip; if (linesPerBuf == 0) { /* nothing to do */ @@ -2210,8 +2257,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, } } } - if (pVisibleRegion) - RegionDestroy(pVisibleRegion); free(pBuf); return Success; } @@ -3399,6 +3444,8 @@ CloseDownClient(ClientPtr client) ClientSignal(client); ProcessWorkQueueZombies(); CloseDownConnection(client); + output_pending_clear(client); + mark_client_not_ready(client); /* If the client made it to the Running stage, nClients has * been incremented on its behalf, so we need to decrement it @@ -3459,6 +3506,8 @@ void InitClient(ClientPtr client, int i, void *ospriv) { client->index = i; + xorg_list_init(&client->ready); + xorg_list_init(&client->output_pending); client->clientAsMask = ((Mask) i) << CLIENTOFFSET; client->closeDownMode = i ? DestroyAll : RetainPermanent; client->requestVector = InitialVector; @@ -3795,9 +3844,7 @@ static int init_screen(ScreenPtr pScreen, int i, Bool gpu) pScreen->CreateScreenResources = 0; xorg_list_init(&pScreen->pixmap_dirty_list); - xorg_list_init(&pScreen->unattached_list); - xorg_list_init(&pScreen->output_slave_list); - xorg_list_init(&pScreen->offload_slave_list); + xorg_list_init(&pScreen->slave_list); /* * This loop gets run once for every Screen that gets added, @@ -3926,6 +3973,16 @@ AddGPUScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ , update_desktop_dimensions(); + /* + * We cannot register the Screen PRIVATE_CURSOR key if cursors are already + * created, because dix/privates.c does not have relocation code for + * PRIVATE_CURSOR. Once this is fixed the if() can be removed and we can + * register the Screen PRIVATE_CURSOR key unconditionally. + */ + if (!dixPrivatesCreated(PRIVATE_CURSOR)) + dixRegisterScreenPrivateKey(&cursorScreenDevPriv, pScreen, + PRIVATE_CURSOR, 0); + return i; } @@ -3956,7 +4013,7 @@ AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new) { assert(new->isGPU); assert(!new->current_master); - xorg_list_add(&new->unattached_head, &pScreen->unattached_list); + xorg_list_add(&new->slave_head, &pScreen->slave_list); new->current_master = pScreen; } @@ -3964,7 +4021,9 @@ void DetachUnboundGPU(ScreenPtr slave) { assert(slave->isGPU); - xorg_list_del(&slave->unattached_head); + assert(!slave->is_output_slave); + assert(!slave->is_offload_slave); + xorg_list_del(&slave->slave_head); slave->current_master = NULL; } @@ -3972,31 +4031,35 @@ void AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new) { assert(new->isGPU); - xorg_list_add(&new->output_head, &pScreen->output_slave_list); - new->current_master = pScreen; + assert(!new->is_output_slave); + assert(new->current_master == pScreen); + new->is_output_slave = TRUE; + new->current_master->output_slaves++; } void DetachOutputGPU(ScreenPtr slave) { assert(slave->isGPU); - xorg_list_del(&slave->output_head); - slave->current_master = NULL; + assert(slave->is_output_slave); + slave->current_master->output_slaves--; + slave->is_output_slave = FALSE; } void AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr new) { assert(new->isGPU); - xorg_list_add(&new->offload_head, &pScreen->offload_slave_list); - new->current_master = pScreen; + assert(!new->is_offload_slave); + assert(new->current_master == pScreen); + new->is_offload_slave = TRUE; } void DetachOffloadGPU(ScreenPtr slave) { assert(slave->isGPU); - xorg_list_del(&slave->offload_head); - slave->current_master = NULL; + assert(slave->is_offload_slave); + slave->is_offload_slave = FALSE; } diff --git a/xserver/dix/dixfonts.c b/xserver/dix/dixfonts.c index 300bf043a..cca92ed27 100644 --- a/xserver/dix/dixfonts.c +++ b/xserver/dix/dixfonts.c @@ -65,6 +65,7 @@ Equipment Corporation. #include "closestr.h" #include "dixfont.h" #include "xace.h" +#include #ifdef XF86BIGFONT #include "xf86bigfontsrv.h" @@ -75,7 +76,7 @@ extern FontPtr defaultFont; static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; static int num_fpes = 0; -static FPEFunctions *fpe_functions = (FPEFunctions *) 0; +static xfont2_fpe_funcs_rec const **fpe_functions; static int num_fpe_types = 0; static unsigned char *font_path_string; @@ -83,7 +84,7 @@ static unsigned char *font_path_string; static int num_slept_fpes = 0; static int size_slept_fpes = 0; static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0; -static FontPatternCachePtr patternCache; +static xfont2_pattern_cache_ptr patternCache; static int FontToXError(int err) @@ -108,18 +109,18 @@ static int LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size, unsigned char *data) { - if (fpe_functions[pfont->fpe->type].load_glyphs) - return (*fpe_functions[pfont->fpe->type].load_glyphs) + if (fpe_functions[pfont->fpe->type]->load_glyphs) + return (*fpe_functions[pfont->fpe->type]->load_glyphs) (client, pfont, 0, nchars, item_size, data); else return Successful; } void -dixGetGlyphs(FontPtr font, unsigned long count, unsigned char *chars, - FontEncoding fontEncoding, - unsigned long *glyphcount, /* RETURN */ - CharInfoPtr *glyphs) /* RETURN */ +GetGlyphs(FontPtr font, unsigned long count, unsigned char *chars, + FontEncoding fontEncoding, + unsigned long *glyphcount, /* RETURN */ + CharInfoPtr *glyphs) /* RETURN */ { (*font->get_glyphs) (font, count, chars, fontEncoding, glyphcount, glyphs); } @@ -196,7 +197,7 @@ RemoveFontWakeup(FontPathElementPtr fpe) } static void -FontWakeup(void *data, int count, void *LastSelectMask) +FontWakeup(void *data, int count) { int i; FontPathElementPtr fpe; @@ -206,7 +207,7 @@ FontWakeup(void *data, int count, void *LastSelectMask) /* wake up any fpe's that may be waiting for information */ for (i = 0; i < num_slept_fpes; i++) { fpe = slept_fpes[i]; - (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask); + (void) (*fpe_functions[fpe->type]->wakeup_fpe) (fpe); } } @@ -222,7 +223,7 @@ FreeFPE(FontPathElementPtr fpe) { fpe->refcount--; if (fpe->refcount == 0) { - (*fpe_functions[fpe->type].free_fpe) (fpe); + (*fpe_functions[fpe->type]->free_fpe) (fpe); free((void *) fpe->name); free(fpe); } @@ -266,14 +267,14 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (client->clientGone) { if (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); } err = Successful; goto bail; } while (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; - err = (*fpe_functions[fpe->type].open_font) + err = (*fpe_functions[fpe->type]->open_font) ((void *) client, fpe, c->flags, c->fontname, c->fnamelen, FontFormat, BitmapFormatMaskByte | @@ -352,8 +353,8 @@ doOpenFont(ClientPtr client, OFclosurePtr c) goto bail; } if (patternCache && pfont != c->non_cachable_font) - CacheFontPattern(patternCache, c->origFontName, c->origFontNameLen, - pfont); + xfont2_cache_font_pattern(patternCache, c->origFontName, c->origFontNameLen, + pfont); bail: if (err != Successful && c->client != serverClient) { SendErrorToClient(c->client, X_OpenFont, 0, @@ -398,7 +399,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, ** having to create another instance of a font that already exists. */ - cached = FindCachedFontPattern(patternCache, pfontname, lenfname); + cached = xfont2_find_cached_font_pattern(patternCache, pfontname, lenfname); if (cached && cached->info.cachable) { if (!AddResource(fid, RT_FONT, (void *) cached)) return BadAlloc; @@ -460,7 +461,7 @@ CloseFont(void *value, XID fid) return Success; if (--pfont->refcnt == 0) { if (patternCache) - RemoveCachedFontPattern(patternCache, pfont); + xfont2_remove_cached_font_pattern(patternCache, pfont); /* * since the last reference is gone, ask each screen to free any * storage it may have allocated locally for it. @@ -476,7 +477,7 @@ CloseFont(void *value, XID fid) XF86BigfontFreeFontShm(pfont); #endif fpe = pfont->fpe; - (*fpe_functions[fpe->type].close_font) (fpe, pfont); + (*fpe_functions[fpe->type]->close_font) (fpe, pfont); FreeFPE(fpe); } return Success; @@ -567,7 +568,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) if (client->clientGone) { if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -580,10 +581,10 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) fpe = c->fpe_list[c->current.current_fpe]; err = Successful; - if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) { + if (!fpe_functions[fpe->type]->start_list_fonts_and_aliases) { /* This FPE doesn't support/require list_fonts_and_aliases */ - err = (*fpe_functions[fpe->type].list_fonts) + err = (*fpe_functions[fpe->type]->list_fonts) ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, c->names); @@ -608,7 +609,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) the FPEs. */ if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) + err = (*fpe_functions[fpe->type]->start_list_fonts_and_aliases) ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, &c->current.private); @@ -626,7 +627,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) char *tmpname; name = 0; - err = (*fpe_functions[fpe->type].list_next_font_or_alias) + err = (*fpe_functions[fpe->type]->list_next_font_or_alias) ((void *) c->client, fpe, &name, &namelen, &tmpname, &resolvedlen, c->current.private); if (err == Suspended) { @@ -647,11 +648,11 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) if (err == Successful) { if (c->haveSaved) { if (c->savedName) - (void) AddFontNamesName(c->names, c->savedName, + (void) xfont2_add_font_names_name(c->names, c->savedName, c->savedNameLen); } else - (void) AddFontNamesName(c->names, name, namelen); + (void) xfont2_add_font_names_name(c->names, name, namelen); } /* @@ -676,7 +677,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) int tmpnamelen; tmpname = 0; - (void) (*fpe_functions[fpe->type].list_next_font_or_alias) + (void) (*fpe_functions[fpe->type]->list_next_font_or_alias) ((void *) c->client, fpe, &tmpname, &tmpnamelen, &tmpname, &tmpnamelen, c->current.private); if (--aliascount <= 0) { @@ -782,7 +783,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) FreeFPE(c->fpe_list[i]); free(c->fpe_list); free(c->savedName); - FreeFontNames(names); + xfont2_free_font_names(names); free(c); free(resolved); return TRUE; @@ -815,7 +816,7 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, free(c); return BadAlloc; } - c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100); + c->names = xfont2_make_font_names_record(max_names < 100 ? max_names : 100); if (!c->names) { free(c->fpe_list); free(c); @@ -858,7 +859,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) if (client->clientGone) { if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -870,7 +871,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) fpe = c->fpe_list[c->current.current_fpe]; err = Successful; if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_with_info) + err = (*fpe_functions[fpe->type]->start_list_fonts_with_info) (client, fpe, c->current.pattern, c->current.patlen, c->current.max_names, &c->current.private); if (err == Suspended) { @@ -885,7 +886,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) if (err == Successful) { name = 0; pFontInfo = &fontInfo; - err = (*fpe_functions[fpe->type].list_next_font_with_info) + err = (*fpe_functions[fpe->type]->list_next_font_with_info) (client, fpe, &name, &namelen, &pFontInfo, &numFonts, c->current.private); if (err == Suspended) { @@ -915,7 +916,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) tmpname = 0; tmpFontInfo = &fontInfo; - (void) (*fpe_functions[fpe->type].list_next_font_with_info) + (void) (*fpe_functions[fpe->type]->list_next_font_with_info) (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo, &numFonts, c->current.private); if (--aliascount <= 0) { @@ -1102,7 +1103,7 @@ doPolyText(ClientPtr client, PTclosurePtr c) if (client->clientGone) { fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); if (ClientIsAsleep(client)) { /* Client has died, but we cannot bail out right now. We @@ -1128,7 +1129,7 @@ doPolyText(ClientPtr client, PTclosurePtr c) the FPE code to clean up after client and avoid further rendering while we clean up after ourself. */ fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); c->pDraw = (DrawablePtr) 0; } } @@ -1380,7 +1381,7 @@ doImageText(ClientPtr client, ITclosurePtr c) if (client->clientGone) { fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); err = Success; goto bail; } @@ -1394,7 +1395,7 @@ doImageText(ClientPtr client, ITclosurePtr c) /* Our drawable has disappeared. Treat like client died... ask the FPE code to clean up after client. */ fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); err = Success; goto bail; } @@ -1520,7 +1521,7 @@ DetermineFPEType(const char *pathname) int i; for (i = 0; i < num_fpe_types; i++) { - if ((*fpe_functions[i].name_check) (pathname)) + if ((*fpe_functions[i]->name_check) (pathname)) return i; } return -1; @@ -1581,8 +1582,8 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) return BadAlloc; } for (i = 0; i < num_fpe_types; i++) { - if (fpe_functions[i].set_path_hook) - (*fpe_functions[i].set_path_hook) (); + if (fpe_functions[i]->set_path_hook) + (*fpe_functions[i]->set_path_hook) (); } for (i = 0; i < npaths; i++) { len = (unsigned int) (*cp++); @@ -1601,7 +1602,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) */ fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len); if (fpe) { - err = (*fpe_functions[fpe->type].reset_fpe) (fpe); + err = (*fpe_functions[fpe->type]->reset_fpe) (fpe); if (err == Successful) { UseFPE(fpe); /* since it'll be decref'd later when freed * from the old list */ @@ -1633,7 +1634,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) if (fpe->type == -1) err = BadValue; else - err = (*fpe_functions[fpe->type].init_fpe) (fpe); + err = (*fpe_functions[fpe->type]->init_fpe) (fpe); if (err != Successful) { if (persist) { DebugF @@ -1658,7 +1659,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) FreeFontPath(font_path_elements, num_fpes, FALSE); font_path_elements = fplist; if (patternCache) - EmptyFontPatternCache(patternCache); + xfont2_empty_font_pattern_cache(patternCache); num_fpes = valid_paths; return Success; @@ -1799,29 +1800,47 @@ DeleteClientFontStuff(ClientPtr client) for (i = 0; i < num_fpes; i++) { fpe = font_path_elements[i]; - if (fpe_functions[fpe->type].client_died) - (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); + if (fpe_functions[fpe->type]->client_died) + (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe); } } -void -InitFonts(void) +static int +register_fpe_funcs(const xfont2_fpe_funcs_rec *funcs) { - patternCache = MakeFontPatternCache(); + xfont2_fpe_funcs_rec const **new; - register_fpe_functions(); + /* grow the list */ + new = reallocarray(fpe_functions, num_fpe_types + 1, sizeof(xfont2_fpe_funcs_ptr)); + if (!new) + return -1; + fpe_functions = new; + + fpe_functions[num_fpe_types] = funcs; + + return num_fpe_types++; } -_X_EXPORT -int -GetDefaultPointSize(void) +static unsigned long +get_server_generation(void) +{ + return serverGeneration; +} + +static void * +get_server_client(void) +{ + return serverClient; +} + +static int +get_default_point_size(void) { return 120; } -_X_EXPORT -FontResolutionPtr -GetClientResolutions(int *num) +static FontResolutionPtr +get_client_resolutions(int *num) { static struct _FontResolution res; ScreenPtr pScreen; @@ -1846,62 +1865,11 @@ GetClientResolutions(int *num) return &res; } -/* - * returns the type index of the new fpe - * - * should be called (only once!) by each type of fpe when initialized - */ - -_X_EXPORT -int -RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, SetPathFunc set_path_func) -{ - FPEFunctions *new; - - /* grow the list */ - new = reallocarray(fpe_functions, num_fpe_types + 1, sizeof(FPEFunctions)); - if (!new) - return -1; - fpe_functions = new; - - fpe_functions[num_fpe_types].name_check = name_func; - fpe_functions[num_fpe_types].open_font = open_func; - fpe_functions[num_fpe_types].close_font = close_func; - fpe_functions[num_fpe_types].wakeup_fpe = wakeup_func; - fpe_functions[num_fpe_types].list_fonts = list_func; - fpe_functions[num_fpe_types].start_list_fonts_with_info = start_lfwi_func; - fpe_functions[num_fpe_types].list_next_font_with_info = next_lfwi_func; - fpe_functions[num_fpe_types].init_fpe = init_func; - fpe_functions[num_fpe_types].free_fpe = free_func; - fpe_functions[num_fpe_types].reset_fpe = reset_func; - fpe_functions[num_fpe_types].client_died = client_died; - fpe_functions[num_fpe_types].load_glyphs = load_glyphs; - fpe_functions[num_fpe_types].start_list_fonts_and_aliases = - start_list_alias_func; - fpe_functions[num_fpe_types].list_next_font_or_alias = next_list_alias_func; - fpe_functions[num_fpe_types].set_path_hook = set_path_func; - - return num_fpe_types++; -} - void FreeFonts(void) { if (patternCache) { - FreeFontPatternCache(patternCache); + xfont2_free_font_pattern_cache(patternCache); patternCache = 0; } FreeFontPath(font_path_elements, num_fpes, TRUE); @@ -1909,12 +1877,12 @@ FreeFonts(void) num_fpes = 0; free(fpe_functions); num_fpe_types = 0; - fpe_functions = (FPEFunctions *) 0; + fpe_functions = NULL; } /* convenience functions for FS interface */ -FontPtr +static FontPtr find_old_font(XID id) { void *pFont; @@ -1923,30 +1891,26 @@ find_old_font(XID id) return (FontPtr) pFont; } -_X_EXPORT -Font -GetNewFontClientID(void) +static Font +get_new_font_client_id(void) { return FakeClientID(0); } -_X_EXPORT -int -StoreFontClientFont(FontPtr pfont, Font id) +static int +store_font_Client_font(FontPtr pfont, Font id) { return AddResource(id, RT_NONE, (void *) pfont); } -_X_EXPORT -void -DeleteFontClientID(Font id) +static void +delete_font_client_id(Font id) { FreeResource(id, RT_NONE); } -_X_EXPORT -int -client_auth_generation(ClientPtr client) +static int +_client_auth_generation(ClientPtr client) { return 0; } @@ -1954,9 +1918,72 @@ client_auth_generation(ClientPtr client) static int fs_handlers_installed = 0; static unsigned int last_server_gen; -_X_EXPORT -int -init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) +static void fs_block_handler(void *blockData, void *timeout) +{ + FontBlockHandlerProcPtr block_handler = blockData; + + (*block_handler)(timeout); +} + +struct fs_fd_entry { + struct xorg_list entry; + int fd; + void *data; + FontFdHandlerProcPtr handler; +}; + +static void +fs_fd_handler(int fd, int ready, void *data) +{ + struct fs_fd_entry *entry = data; + + entry->handler(fd, entry->data); +} + +static struct xorg_list fs_fd_list; + +static int +add_fs_fd(int fd, FontFdHandlerProcPtr handler, void *data) +{ + struct fs_fd_entry *entry = calloc(1, sizeof (struct fs_fd_entry)); + + if (!entry) + return FALSE; + + entry->fd = fd; + entry->data = data; + entry->handler = handler; + if (!SetNotifyFd(fd, fs_fd_handler, X_NOTIFY_READ, entry)) { + free(entry); + return FALSE; + } + xorg_list_add(&entry->entry, &fs_fd_list); + return TRUE; +} + +static void +remove_fs_fd(int fd) +{ + struct fs_fd_entry *entry, *temp; + + xorg_list_for_each_entry_safe(entry, temp, &fs_fd_list, entry) { + if (entry->fd == fd) { + xorg_list_del(&entry->entry); + free(entry); + break; + } + } + RemoveNotifyFd(fd); +} + +static void +adjust_fs_wait_for_delay(void *wt, unsigned long newdelay) +{ + AdjustWaitForDelay(wt, newdelay); +} + +static int +_init_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handler) { /* if server has reset, make sure the b&w handlers are reinstalled */ if (last_server_gen < serverGeneration) { @@ -1964,26 +1991,63 @@ init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) fs_handlers_installed = 0; } if (fs_handlers_installed == 0) { - if (!RegisterBlockAndWakeupHandlers(block_handler, - FontWakeup, (void *) 0)) + if (!RegisterBlockAndWakeupHandlers(fs_block_handler, + FontWakeup, (void *) block_handler)) return AllocError; + xorg_list_init(&fs_fd_list); fs_handlers_installed++; } QueueFontWakeup(fpe); return Successful; } -_X_EXPORT -void -remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, - Bool all) +static void +_remove_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handler, + Bool all) { if (all) { /* remove the handlers if no one else is using them */ if (--fs_handlers_installed == 0) { - RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, - (void *) 0); + RemoveBlockAndWakeupHandlers(fs_block_handler, FontWakeup, + (void *) block_handler); } } RemoveFontWakeup(fpe); } + +static const xfont2_client_funcs_rec xfont2_client_funcs = { + .version = XFONT2_CLIENT_FUNCS_VERSION, + .client_auth_generation = _client_auth_generation, + .client_signal = ClientSignal, + .delete_font_client_id = delete_font_client_id, + .verrorf = VErrorF, + .find_old_font = find_old_font, + .get_client_resolutions = get_client_resolutions, + .get_default_point_size = get_default_point_size, + .get_new_font_client_id = get_new_font_client_id, + .get_time_in_millis = GetTimeInMillis, + .init_fs_handlers = _init_fs_handlers, + .register_fpe_funcs = register_fpe_funcs, + .remove_fs_handlers = _remove_fs_handlers, + .get_server_client = get_server_client, + .set_font_authorizations = set_font_authorizations, + .store_font_client_font = store_font_Client_font, + .make_atom = MakeAtom, + .valid_atom = ValidAtom, + .name_for_atom = NameForAtom, + .get_server_generation = get_server_generation, + .add_fs_fd = add_fs_fd, + .remove_fs_fd = remove_fs_fd, + .adjust_fs_wait_for_delay = adjust_fs_wait_for_delay, +}; + +xfont2_pattern_cache_ptr fontPatternCache; + +void +InitFonts(void) +{ + if (fontPatternCache) + xfont2_free_font_pattern_cache(fontPatternCache); + fontPatternCache = xfont2_make_font_pattern_cache(); + xfont2_init(&xfont2_client_funcs); +} diff --git a/xserver/dix/dixutils.c b/xserver/dix/dixutils.c index b6b002385..540023cbd 100644 --- a/xserver/dix/dixutils.c +++ b/xserver/dix/dixutils.c @@ -360,8 +360,8 @@ NoopDDA(void) } typedef struct _BlockHandler { - BlockHandlerProcPtr BlockHandler; - WakeupHandlerProcPtr WakeupHandler; + ServerBlockHandlerProcPtr BlockHandler; + ServerWakeupHandlerProcPtr WakeupHandler; void *blockData; Bool deleted; } BlockHandlerRec, *BlockHandlerPtr; @@ -378,21 +378,21 @@ static Bool handlerDeleted; * \param pReadMask nor how it represents the det of descriptors */ void -BlockHandler(void *pTimeout, void *pReadmask) +BlockHandler(void *pTimeout) { int i, j; ++inHandler; - for (i = 0; i < screenInfo.numScreens; i++) - (*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i], - pTimeout, pReadmask); - for (i = 0; i < screenInfo.numGPUScreens; i++) - (*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i], - pTimeout, pReadmask); for (i = 0; i < numHandlers; i++) if (!handlers[i].deleted) - (*handlers[i].BlockHandler) (handlers[i].blockData, - pTimeout, pReadmask); + (*handlers[i].BlockHandler) (handlers[i].blockData, pTimeout); + + for (i = 0; i < screenInfo.numGPUScreens; i++) + (*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i], pTimeout); + + for (i = 0; i < screenInfo.numScreens; i++) + (*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i], pTimeout); + if (handlerDeleted) { for (i = 0; i < numHandlers;) if (handlers[i].deleted) { @@ -413,21 +413,18 @@ BlockHandler(void *pTimeout, void *pReadmask) * \param pReadmask the resulting descriptor mask */ void -WakeupHandler(int result, void *pReadmask) +WakeupHandler(int result) { int i, j; ++inHandler; + for (i = 0; i < screenInfo.numScreens; i++) + (*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i], result); + for (i = 0; i < screenInfo.numGPUScreens; i++) + (*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i], result); for (i = numHandlers - 1; i >= 0; i--) if (!handlers[i].deleted) - (*handlers[i].WakeupHandler) (handlers[i].blockData, - result, pReadmask); - for (i = 0; i < screenInfo.numScreens; i++) - (*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i], - result, pReadmask); - for (i = 0; i < screenInfo.numGPUScreens; i++) - (*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i], - result, pReadmask); + (*handlers[i].WakeupHandler) (handlers[i].blockData, result); if (handlerDeleted) { for (i = 0; i < numHandlers;) if (handlers[i].deleted) { @@ -447,8 +444,8 @@ WakeupHandler(int result, void *pReadmask) * get called until next time */ Bool -RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, - WakeupHandlerProcPtr wakeupHandler, +RegisterBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler, + ServerWakeupHandlerProcPtr wakeupHandler, void *blockData) { BlockHandlerPtr new; @@ -470,8 +467,8 @@ RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, } void -RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, - WakeupHandlerProcPtr wakeupHandler, +RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler, + ServerWakeupHandlerProcPtr wakeupHandler, void *blockData) { int i; diff --git a/xserver/dix/events.c b/xserver/dix/events.c index 0591f8fcb..3faad53a8 100644 --- a/xserver/dix/events.c +++ b/xserver/dix/events.c @@ -882,6 +882,8 @@ ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents, SyntheticMotion(pDev, pSprite->hot.x, pSprite->hot.y); } else { + ScreenPtr pScreen = pWin->drawable.pScreen; + #ifdef PANORAMIX if (!noPanoramiXExtension) { XineramaConfineCursorToWindow(pDev, pWin, generateEvents); @@ -893,6 +895,9 @@ ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents, : NullRegion; CheckPhysLimits(pDev, pSprite->current, generateEvents, confineToScreen, pWin->drawable.pScreen); + + if (*pScreen->CursorConfinedTo) + (*pScreen->CursorConfinedTo) (pDev, pScreen, pWin); } } @@ -1822,6 +1827,7 @@ ProcAllowEvents(ClientPtr client) REQUEST(xAllowEventsReq); REQUEST_SIZE_MATCH(xAllowEventsReq); + UpdateCurrentTime(); time = ClientTimeToServerTime(stuff->time); mouse = PickPointer(client); @@ -2891,7 +2897,7 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win) if (dev->deviceGrab.grab) { if (!dev->deviceGrab.fromPassiveGrab || - dev->deviceGrab.grab->type != XI_Enter || + dev->deviceGrab.grab->type != XI_FocusIn || dev->deviceGrab.grab->window == win || IsParent(dev->deviceGrab.grab->window, win)) return FALSE; @@ -2914,7 +2920,7 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win) rc = (CheckPassiveGrabsOnWindow(win, dev, (InternalEvent *) &event, FALSE, TRUE) != NULL); if (rc) - DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab); + DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveGrab); return rc; } @@ -3608,6 +3614,9 @@ ProcWarpPointer(ClientPtr client) else if (!PointerConfinedToScreen(dev)) { NewCurrentScreen(dev, newScreen, x, y); } + if (*newScreen->CursorWarpedTo) + (*newScreen->CursorWarpedTo) (dev, newScreen, client, + dest, pSprite, x, y); return Success; } @@ -4952,6 +4961,7 @@ ProcChangeActivePointerGrab(ClientPtr client) return Success; if (!SameClient(grab, client)) return Success; + UpdateCurrentTime(); time = ClientTimeToServerTime(stuff->time); if ((CompareTimeStamps(time, currentTime) == LATER) || (CompareTimeStamps(time, device->deviceGrab.grabTime) == EARLIER)) @@ -5132,6 +5142,7 @@ ProcGrabKeyboard(ClientPtr client) GrabMask mask; REQUEST_SIZE_MATCH(xGrabKeyboardReq); + UpdateCurrentTime(); mask.core = KeyPressMask | KeyReleaseMask; @@ -5550,6 +5561,7 @@ ProcGrabButton(ClientPtr client) int rc; REQUEST_SIZE_MATCH(xGrabButtonReq); + UpdateCurrentTime(); if ((stuff->pointerMode != GrabModeSync) && (stuff->pointerMode != GrabModeAsync)) { client->errorValue = stuff->pointerMode; @@ -5638,6 +5650,7 @@ ProcUngrabButton(ClientPtr client) DeviceIntPtr ptr; REQUEST_SIZE_MATCH(xUngrabButtonReq); + UpdateCurrentTime(); if ((stuff->modifiers != AnyModifier) && (stuff->modifiers & ~AllModifiersMask)) { client->errorValue = stuff->modifiers; diff --git a/xserver/dix/getevents.c b/xserver/dix/getevents.c index 7ebddc419..0d87453e5 100644 --- a/xserver/dix/getevents.c +++ b/xserver/dix/getevents.c @@ -1092,6 +1092,7 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type, CARD32 ms = 0; DeviceEvent *event; RawDeviceEvent *raw; + enum DeviceEventSource source_type = EVENT_SOURCE_NORMAL; #if XSERVER_DTRACE if (XSERVER_INPUT_EVENT_ENABLED()) { @@ -1100,6 +1101,14 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type, } #endif + if (type == EnterNotify) { + source_type = EVENT_SOURCE_FOCUS; + type = KeyPress; + } else if (type == LeaveNotify) { + source_type = EVENT_SOURCE_FOCUS; + type = KeyRelease; + } + /* refuse events from disabled devices */ if (!pDev->enabled) return 0; @@ -1126,14 +1135,15 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type, ms = GetTimeInMillis(); - raw = &events->raw_event; - events++; - num_events++; - - init_raw(pDev, raw, ms, type, key_code); + if (source_type == EVENT_SOURCE_NORMAL) { + raw = &events->raw_event; + init_raw(pDev, raw, ms, type, key_code); + events++; + num_events++; + } event = &events->device_event; - init_device_event(event, pDev, ms); + init_device_event(event, pDev, ms, source_type); event->detail.key = key_code; if (type == KeyPress) { @@ -1468,7 +1478,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, } event = &events->device_event; - init_device_event(event, pDev, ms); + init_device_event(event, pDev, ms, EVENT_SOURCE_NORMAL); if (type == MotionNotify) { event->type = ET_Motion; @@ -1804,7 +1814,7 @@ GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type, UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events); event = &events->device_event; - init_device_event(event, pDev, GetTimeInMillis()); + init_device_event(event, pDev, GetTimeInMillis(), EVENT_SOURCE_NORMAL); event->type = (type == ProximityIn) ? ET_ProximityIn : ET_ProximityOut; clipValuators(pDev, &mask); @@ -1939,7 +1949,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, event = &events->device_event; num_events++; - init_device_event(event, dev, ms); + init_device_event(event, dev, ms, EVENT_SOURCE_NORMAL); switch (type) { case XI_TouchBegin: @@ -2054,7 +2064,7 @@ GetDixTouchEnd(InternalEvent *ievent, DeviceIntPtr dev, TouchPointInfoPtr ti, BUG_WARN(!dev->enabled); - init_device_event(event, dev, ms); + init_device_event(event, dev, ms, EVENT_SOURCE_NORMAL); event->sourceid = ti->sourceid; event->type = ET_TouchEnd; @@ -2098,7 +2108,7 @@ PostSyntheticMotion(DeviceIntPtr pDev, #endif memset(&ev, 0, sizeof(DeviceEvent)); - init_device_event(&ev, pDev, time); + init_device_event(&ev, pDev, time, EVENT_SOURCE_NORMAL); ev.root_x = x; ev.root_y = y; ev.type = ET_Motion; diff --git a/xserver/dix/inpututils.c b/xserver/dix/inpututils.c index 136398842..6bff9efab 100644 --- a/xserver/dix/inpututils.c +++ b/xserver/dix/inpututils.c @@ -636,6 +636,19 @@ valuator_mask_drop_unaccelerated(ValuatorMask *mask) mask->has_unaccelerated = FALSE; } +void +valuator_mask_set_absolute_unaccelerated(ValuatorMask *mask, + int valuator, + int absolute, + double unaccel) +{ + BUG_WARN_MSG(mask->last_bit != -1 && !mask->has_unaccelerated, + "Do not mix valuator types, zero mask first\n"); + _valuator_mask_set_double(mask, valuator, absolute); + mask->has_unaccelerated = TRUE; + mask->unaccelerated[valuator] = unaccel; +} + /** * Set both accelerated and unaccelerated value for this mask. */ @@ -727,7 +740,8 @@ verify_internal_event(const InternalEvent *ev) * device. */ void -init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms) +init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms, + enum DeviceEventSource source_type) { memset(event, 0, sizeof(DeviceEvent)); event->header = ET_Internal; @@ -735,6 +749,7 @@ init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms) event->time = ms; event->deviceid = dev->id; event->sourceid = dev->id; + event->source_type = source_type; } int diff --git a/xserver/dix/main.c b/xserver/dix/main.c index 549567660..4947062a5 100644 --- a/xserver/dix/main.c +++ b/xserver/dix/main.c @@ -96,7 +96,7 @@ Equipment Corporation. #include "selection.h" #include #include -#include +#include #include "opaque.h" #include "servermd.h" #include "hotplug.h" @@ -120,14 +120,7 @@ Equipment Corporation. extern void Dispatch(void); -#ifdef XQUARTZ -#include - -BOOL serverRunning = FALSE; -pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; - -#endif +CallbackListPtr RootWindowFinalizeCallback = NULL; int dix_main(int argc, char *argv[], char *envp[]) @@ -197,9 +190,9 @@ dix_main(int argc, char *argv[], char *envp[]) InitAtoms(); InitEvents(); - InitGlyphCaching(); + xfont2_init_glyph_caching(); dixResetRegistry(); - ResetFontPrivateIndex(); + InitFonts(); InitCallbackManager(); InitOutput(&screenInfo, argc, argv); @@ -230,9 +223,9 @@ dix_main(int argc, char *argv[], char *envp[]) FatalError("failed to create default stipple"); if (!CreateRootWindow(pScreen)) FatalError("failed to create root window"); + CallCallbacks(&RootWindowFinalizeCallback, pScreen); } - InitFonts(); if (SetDefaultFontPath(defaultFontPath) != Success) { ErrorF("[dix] failed to set default font path '%s'", defaultFontPath); @@ -287,24 +280,11 @@ dix_main(int argc, char *argv[], char *envp[]) } } -#ifdef XQUARTZ - /* Let the other threads know the server is done with its init */ - pthread_mutex_lock(&serverRunningMutex); - serverRunning = TRUE; - pthread_cond_broadcast(&serverRunningCond); - pthread_mutex_unlock(&serverRunningMutex); -#endif - NotifyParentProcess(); - Dispatch(); + InputThreadInit(); -#ifdef XQUARTZ - /* Let the other threads know the server is no longer running */ - pthread_mutex_lock(&serverRunningMutex); - serverRunning = FALSE; - pthread_mutex_unlock(&serverRunningMutex); -#endif + Dispatch(); UndisplayDevices(); DisableAllDevices(); @@ -329,6 +309,8 @@ dix_main(int argc, char *argv[], char *envp[]) CloseInput(); + InputThreadFini(); + for (i = 0; i < screenInfo.numScreens; i++) screenInfo.screens[i]->root = NullWindow; diff --git a/xserver/dix/pixmap.c b/xserver/dix/pixmap.c index 11d83fe00..7a6402411 100644 --- a/xserver/dix/pixmap.c +++ b/xserver/dix/pixmap.c @@ -132,6 +132,13 @@ FreePixmap(PixmapPtr pPixmap) free(pPixmap); } +void PixmapUnshareSlavePixmap(PixmapPtr slave_pixmap) +{ + int ihandle = -1; + ScreenPtr pScreen = slave_pixmap->drawable.pScreen; + pScreen->SetSharedPixmapBacking(slave_pixmap, ((void *)(long)ihandle)); +} + PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave) { PixmapPtr spix; @@ -165,6 +172,14 @@ PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave) return spix; } +static void +PixmapDirtyDamageDestroy(DamagePtr damage, void *closure) +{ + PixmapDirtyUpdatePtr dirty = closure; + + dirty->damage = NULL; +} + Bool PixmapStartDirtyTracking(PixmapPtr src, PixmapPtr slave_dst, @@ -188,10 +203,10 @@ PixmapStartDirtyTracking(PixmapPtr src, dirty_update->dst_x = dst_x; dirty_update->dst_y = dst_y; dirty_update->rotation = rotation; - dirty_update->damage = DamageCreate(NULL, NULL, + dirty_update->damage = DamageCreate(NULL, PixmapDirtyDamageDestroy, DamageReportNone, TRUE, src->drawable.pScreen, - src->drawable.pScreen); + dirty_update); if (rotation != RR_Rotate_0) { RRTransformCompute(x, y, @@ -239,7 +254,8 @@ PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst) xorg_list_for_each_entry_safe(ent, safe, &screen->pixmap_dirty_list, ent) { if (ent->src == src && ent->slave_dst == slave_dst) { - DamageDestroy(ent->damage); + if (ent->damage) + DamageDestroy(ent->damage); xorg_list_del(&ent->ent); free(ent); } diff --git a/xserver/dix/privates.c b/xserver/dix/privates.c index 969d0141c..478f52cbe 100644 --- a/xserver/dix/privates.c +++ b/xserver/dix/privates.c @@ -783,3 +783,12 @@ dixResetPrivates(void) global_keys[t].allocated = 0; } } + +Bool +dixPrivatesCreated(DevPrivateType type) +{ + if (global_keys[type].created) + return TRUE; + else + return FALSE; +} diff --git a/xserver/dix/property.c b/xserver/dix/property.c index 99608af72..fa4da2d42 100644 --- a/xserver/dix/property.c +++ b/xserver/dix/property.c @@ -108,11 +108,13 @@ dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom propertyName, static void deliverPropertyNotifyEvent(WindowPtr pWin, int state, Atom atom) { - xEvent event = { + xEvent event; + UpdateCurrentTimeIf(); + event = (xEvent) { .u.property.window = pWin->drawable.id, .u.property.state = state, .u.property.atom = atom, - .u.property.time = currentTime.milliseconds + .u.property.time = currentTime.milliseconds, }; event.u.u.type = PropertyNotify; DeliverEvents(pWin, &event, 1, (WindowPtr) NULL); @@ -354,14 +356,6 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, return Success; } -int -ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, - int mode, unsigned long len, void *value, Bool sendevent) -{ - return dixChangeWindowProperty(serverClient, pWin, property, type, format, - mode, len, value, sendevent); -} - int DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName) { diff --git a/xserver/dix/ptrveloc.c b/xserver/dix/ptrveloc.c index 050c12a0c..ff39d7bba 100644 --- a/xserver/dix/ptrveloc.c +++ b/xserver/dix/ptrveloc.c @@ -165,7 +165,7 @@ AccelerationDefaultCleanup(DeviceIntPtr dev) * AccelSchemeProc(), but that seems impossible. Schemes don't get * switched often anyway. */ - OsBlockSignals(); + input_lock(); dev->valuator->accelScheme.AccelSchemeProc = NULL; FreeVelocityData(vel); free(vel); @@ -175,7 +175,7 @@ AccelerationDefaultCleanup(DeviceIntPtr dev) accelData); free(dev->valuator->accelScheme.accelData); dev->valuator->accelScheme.accelData = NULL; - OsReleaseSignals(); + input_unlock(); } } @@ -794,12 +794,12 @@ ComputeAcceleration(DeviceIntPtr dev, BasicComputeAcceleration(dev, vel, vel->last_velocity, threshold, acc); result += - 4.0f * BasicComputeAcceleration(dev, vel, + 4.0 * BasicComputeAcceleration(dev, vel, (vel->last_velocity + vel->velocity) / 2, threshold, acc); - result /= 6.0f; + result /= 6.0; DebugAccelF("profile average [%.2f ... %.2f] is %.3f\n", vel->velocity, vel->last_velocity, result); } @@ -860,7 +860,7 @@ PowerProfile(DeviceIntPtr dev, { double vel_dist; - acc = (acc - 1.0) * 0.1f + 1.0; /* without this, acc of 2 is unuseable */ + acc = (acc - 1.0) * 0.1 + 1.0; /* without this, acc of 2 is unuseable */ if (velocity <= threshold) return vel->min_acceleration; @@ -878,9 +878,9 @@ PowerProfile(DeviceIntPtr dev, static inline double CalcPenumbralGradient(double x) { - x *= 2.0f; - x -= 1.0f; - return 0.5f + (x * sqrt(1.0 - x * x) + asin(x)) / M_PI; + x *= 2.0; + x -= 1.0; + return 0.5 + (x * sqrt(1.0 - x * x) + asin(x)) / M_PI; } /** @@ -916,23 +916,23 @@ SmoothLinearProfile(DeviceIntPtr dev, { double res, nv; - if (acc > 1.0f) - acc -= 1.0f; /*this is so acc = 1 is no acceleration */ + if (acc > 1.0) + acc -= 1.0; /*this is so acc = 1 is no acceleration */ else - return 1.0f; + return 1.0; - nv = (velocity - threshold) * acc * 0.5f; + nv = (velocity - threshold) * acc * 0.5; if (nv < 0) { res = 0; } else if (nv < 2) { - res = CalcPenumbralGradient(nv * 0.25f) * 2.0f; + res = CalcPenumbralGradient(nv * 0.25) * 2.0; } else { - nv -= 2.0f; - res = nv * 2.0f / M_PI /* steepness of gradient at 0.5 */ - + 1.0f; /* gradient crosses 2|1 */ + nv -= 2.0; + res = nv * 2.0 / M_PI /* steepness of gradient at 0.5 */ + + 1.0; /* gradient crosses 2|1 */ } res += vel->min_acceleration; return res; @@ -949,7 +949,7 @@ SmoothLimitedProfile(DeviceIntPtr dev, { double res; - if (velocity >= threshold || threshold == 0.0f) + if (velocity >= threshold || threshold == 0.0) return acc; velocity /= threshold; /* should be [0..1[ now */ @@ -971,7 +971,7 @@ static double NoProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc) { - return 1.0f; + return 1.0; } static PointerAccelerationProfileFunc @@ -1091,7 +1091,7 @@ acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime) return; if (velocitydata->statistics.profile_number == AccelProfileNone && - velocitydata->const_acceleration == 1.0f) { + velocitydata->const_acceleration == 1.0) { return; /*we're inactive anyway, so skip the whole thing. */ } @@ -1119,8 +1119,8 @@ acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime) (double) dev->ptrfeed->ctrl.den); DebugAccelF("mult is %f\n", mult); - if (mult != 1.0f || velocitydata->const_acceleration != 1.0f) { - if (mult > 1.0f && soften) + if (mult != 1.0 || velocitydata->const_acceleration != 1.0) { + if (mult > 1.0 && soften) ApplySoftening(velocitydata, &dx, &dy); ApplyConstantDeceleration(velocitydata, &dx, &dy); diff --git a/xserver/dix/resource.c b/xserver/dix/resource.c index ad71b2437..b6ef99f10 100644 --- a/xserver/dix/resource.c +++ b/xserver/dix/resource.c @@ -156,7 +156,7 @@ static void RebuildTable(int /*client */ #define INITBUCKETS 64 #define INITHASHSIZE 6 -#define MAXHASHSIZE 11 +#define MAXHASHSIZE 16 typedef struct _Resource { struct _Resource *next; @@ -668,29 +668,14 @@ InitClientResources(ClientPtr client) int HashResourceID(XID id, int numBits) { - id &= RESOURCE_ID_MASK; - switch (numBits) - { - case 6: - return ((int)(0x03F & (id ^ (id>>6) ^ (id>>12)))); - case 7: - return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13)))); - case 8: - return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16)))); - case 9: - return ((int)(0x1FF & (id ^ (id>>9)))); - case 10: - return ((int)(0x3FF & (id ^ (id>>10)))); - case 11: - return ((int)(0x7FF & (id ^ (id>>11)))); - } - if (numBits >= 11) - return ((int)(0x7FF & (id ^ (id>>11)))); - else - { - assert(numBits >= 0); - return id & ~((~0) << numBits); - } + static XID mask; + + if (!mask) + mask = RESOURCE_ID_MASK; + id &= mask; + if (numBits < 9) + return (id ^ (id >> numBits) ^ (id >> (numBits<<1))) & ~((~0) << numBits); + return (id ^ (id >> numBits)) & ~((~0) << numBits); } static XID @@ -1220,11 +1205,13 @@ dixLookupResourceByType(void **result, XID id, RESTYPE rtype, if (res->id == id && res->type == rtype) break; } + if (client) { + client->errorValue = id; + } if (!res) return resourceTypes[rtype & TypeMask].errorValue; if (client) { - client->errorValue = id; cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type, res->value, RT_NONE, NULL, mode); if (cid == BadValue) @@ -1253,11 +1240,13 @@ dixLookupResourceByClass(void **result, XID id, RESTYPE rclass, if (res->id == id && (res->type & rclass)) break; } + if (client) { + client->errorValue = id; + } if (!res) return BadValue; if (client) { - client->errorValue = id; cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type, res->value, RT_NONE, NULL, mode); if (cid != Success) diff --git a/xserver/dix/selection.c b/xserver/dix/selection.c index 4e994b1ec..d46103f70 100644 --- a/xserver/dix/selection.c +++ b/xserver/dix/selection.c @@ -279,6 +279,9 @@ ProcConvertSelection(ClientPtr client) return BadAtom; } + if (stuff->time == CurrentTime) + UpdateCurrentTime(); + rc = dixLookupSelection(&pSel, stuff->selection, client, DixReadAccess); memset(&event, 0, sizeof(xEvent)); diff --git a/xserver/dix/touch.c b/xserver/dix/touch.c index 54da13247..37902bd05 100644 --- a/xserver/dix/touch.c +++ b/xserver/dix/touch.c @@ -42,9 +42,6 @@ #define TOUCH_HISTORY_SIZE 100 -/* If a touch queue resize is needed, the device id's bit is set. */ -static unsigned char resize_waiting[(MAXDEVICES + 7) / 8]; - /** * Some documentation about touch points: * The driver submits touch events with it's own (unique) touch point ID. @@ -74,47 +71,27 @@ static unsigned char resize_waiting[(MAXDEVICES + 7) / 8]; * @return Always True. If we fail to grow we probably will topple over soon * anyway and re-executing this won't help. */ + static Bool -TouchResizeQueue(ClientPtr client, void *closure) +TouchResizeQueue(DeviceIntPtr dev) { - int i; + DDXTouchPointInfoPtr tmp; + size_t size; - OsBlockSignals(); + /* Grow sufficiently so we don't need to do it often */ + size = dev->last.num_touches + dev->last.num_touches / 2 + 1; - /* first two ids are reserved */ - for (i = 2; i < MAXDEVICES; i++) { - DeviceIntPtr dev; - DDXTouchPointInfoPtr tmp; - size_t size; - - if (!BitIsOn(resize_waiting, i)) - continue; - - ClearBit(resize_waiting, i); - - /* device may have disappeared by now */ - dixLookupDevice(&dev, i, serverClient, DixWriteAccess); - if (!dev) - continue; - - /* Need to grow the queue means dropping events. Grow sufficiently so we - * don't need to do it often */ - size = dev->last.num_touches + dev->last.num_touches / 2 + 1; - - tmp = reallocarray(dev->last.touches, size, sizeof(*dev->last.touches)); - if (tmp) { - int j; - - dev->last.touches = tmp; - for (j = dev->last.num_touches; j < size; j++) - TouchInitDDXTouchPoint(dev, &dev->last.touches[j]); - dev->last.num_touches = size; - } + tmp = reallocarray(dev->last.touches, size, sizeof(*dev->last.touches)); + if (tmp) { + int j; + dev->last.touches = tmp; + for (j = dev->last.num_touches; j < size; j++) + TouchInitDDXTouchPoint(dev, &dev->last.touches[j]); + dev->last.num_touches = size; + return TRUE; } - OsReleaseSignals(); - - return TRUE; + return FALSE; } /** @@ -172,14 +149,20 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id) if (TouchFindByDDXID(dev, ddx_id, FALSE)) return NULL; - for (i = 0; i < dev->last.num_touches; i++) { - /* Only emulate pointer events on the first touch */ - if (dev->last.touches[i].active) - emulate_pointer = FALSE; - else if (!ti) /* ti is now first non-active touch rec */ - ti = &dev->last.touches[i]; + for (;;) { + for (i = 0; i < dev->last.num_touches; i++) { + /* Only emulate pointer events on the first touch */ + if (dev->last.touches[i].active) + emulate_pointer = FALSE; + else if (!ti) /* ti is now first non-active touch rec */ + ti = &dev->last.touches[i]; - if (!emulate_pointer && ti) + if (!emulate_pointer && ti) + break; + } + if (ti) + break; + if (!TouchResizeQueue(dev)) break; } @@ -194,21 +177,8 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id) next_client_id = 1; ti->client_id = client_id; ti->emulate_pointer = emulate_pointer; - return ti; } - - /* If we get here, then we've run out of touches and we need to drop the - * event (we're inside the SIGIO handler here) schedule a WorkProc to - * grow the queue for us for next time. */ - ErrorFSigSafe("%s: not enough space for touch events (max %u touchpoints). " - "Dropping this event.\n", dev->name, dev->last.num_touches); - - if (!BitIsOn(resize_waiting, dev->id)) { - SetBit(resize_waiting, dev->id); - QueueWorkProc(TouchResizeQueue, serverClient, NULL); - } - - return NULL; + return ti; } void @@ -1077,7 +1047,7 @@ TouchEndPhysicallyActiveTouches(DeviceIntPtr dev) InternalEvent *eventlist = InitEventList(GetMaximumEventsNum()); int i; - OsBlockSignals(); + input_lock(); mieqProcessInputEvents(); for (i = 0; i < dev->last.num_touches; i++) { DDXTouchPointInfoPtr ddxti = dev->last.touches + i; @@ -1091,7 +1061,7 @@ TouchEndPhysicallyActiveTouches(DeviceIntPtr dev) mieqProcessDeviceEvent(dev, eventlist + j, NULL); } } - OsReleaseSignals(); + input_unlock(); FreeEventList(eventlist, GetMaximumEventsNum()); } diff --git a/xserver/doc/Makefile.in b/xserver/doc/Makefile.in index e18af2e57..9a398f806 100644 --- a/xserver/doc/Makefile.in +++ b/xserver/doc/Makefile.in @@ -74,9 +74,10 @@ DIST_COMMON = $(am__dist_noinst_DATA_DIST) $(srcdir)/Makefile.am \ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -327,6 +328,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -357,7 +361,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -452,6 +459,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/doc/Xinput.xml b/xserver/doc/Xinput.xml index 083b10908..0e7fbda72 100644 --- a/xserver/doc/Xinput.xml +++ b/xserver/doc/Xinput.xml @@ -210,7 +210,7 @@ A sample InitInput implementation is shown below. InitInput(argc,argv) { - int i, numdevs, ReadInput(); + int i, numdevs; DeviceIntPtr dev; LocalDevice localdevs[LOCAL_MAX_DEVS]; DeviceProc kbdproc, ptrproc, extproc; @@ -223,12 +223,6 @@ InitInput(argc,argv) open_input_devices (&numdevs, localdevs); - /************************************************************** - * Register a WakeupHandler to handle input when it is generated. - ***************************************************************/ - - RegisterBlockAndWakeupHandlers (NoopDDA, ReadInput, NULL); - /************************************************************** * Register the input devices with DIX. ***************************************************************/ diff --git a/xserver/doc/Xserver-spec.xml b/xserver/doc/Xserver-spec.xml index 72a544b55..7867544e4 100644 --- a/xserver/doc/Xserver-spec.xml +++ b/xserver/doc/Xserver-spec.xml @@ -674,30 +674,22 @@ If WaitForSomething() decides it is about to do something that might block routine called BlockHandler().
- void BlockHandler(pTimeout, pReadmask) - pointer pTimeout; - pointer pReadmask; + void BlockHandler(void *pTimeout)
The types of the arguments are for agreement between the OS and DDX implementations, but the pTimeout is a pointer to the information -determining how long the block is allowed to last, and the -pReadmask is a pointer to the information describing the descriptors -that will be waited on. +determining how long the block is allowed to last. -In the sample server, pTimeout is a pointer, and pReadmask is -the address of the select() mask for reading. +In the sample server, pTimeout is a pointer. The DIX BlockHandler() iterates through the Screens, for each one calling its BlockHandler. A BlockHandler is declared thus:
- void xxxBlockHandler(pScreen, pTimeout, pReadmask) - ScreenPtr pScreen; - pointer pTimeout; - pointer pReadmask; + void xxxBlockHandler(ScreenPtr pScreen, void *pTimeout)
The arguments are a pointer to the Screen, and the arguments to the @@ -709,27 +701,20 @@ block, even if it didn't actually block, it must call the DIX routine WakeupHandler().
- void WakeupHandler(result, pReadmask) - int result; - pointer pReadmask; + void WakeupHandler(int result)
Once again, the types are not specified by DIX. The result is the -success indicator for the thing that (may have) blocked, -and the pReadmask is a mask of the descriptors that came active. -In the sample server, result is the result from select() (or equivalent -operating system function), and pReadmask is -the address of the select() mask for reading. +success indicator for the thing that (may have) blocked. +In the sample server, result is the result from select() (or equivalent +operating system function).
The DIX WakeupHandler() calls each Screen's WakeupHandler. A WakeupHandler is declared thus:
- void xxxWakeupHandler(pScreen, result, pReadmask) - ScreenPtr pScreen; - unsigned long result; - pointer pReadmask; + void xxxWakeupHandler(ScreenPtr pScreen, int result)
The arguments are the Screen, of the Screen, and the arguments to @@ -741,8 +726,8 @@ block and wakeup handlers (only together) using:
Bool RegisterBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData) - BlockHandlerProcPtr blockHandler; - WakeupHandlerProcPtr wakeupHandler; + ServerBlockHandlerProcPtr blockHandler; + ServerWakeupHandlerProcPtr wakeupHandler; pointer blockData;
@@ -752,8 +737,8 @@ memory. To remove a registered Block handler at other than server reset time
RemoveBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData) - BlockHandlerProcPtr blockHandler; - WakeupHandlerProcPtr wakeupHandler; + ServerBlockHandlerProcPtr blockHandler; + ServerWakeupHandlerProcPtr wakeupHandler; pointer blockData;
@@ -761,18 +746,15 @@ All three arguments must match the values passed to RegisterBlockAndWakeupHandlers.
-These registered block handlers are called after the per-screen handlers: +These registered block handlers are called before the per-screen handlers:
- void (*BlockHandler) (blockData, pptv, pReadmask) - pointer blockData; - OsTimerPtr pptv; - pointer pReadmask; + void (*ServerBlockHandler) (void *blockData, void *pTimeout)
-Sometimes block handlers need to adjust the time in a OSTimePtr structure, +Sometimes block handlers need to adjust the time referenced by pTimeout, which on UNIX family systems is generally represented by a struct timeval consisting of seconds and microseconds in 32 bit values. As a convenience to reduce error prone struct timeval computations which @@ -780,20 +762,17 @@ require modulus arithmetic and correct overflow behavior in the face of millisecond wrapping through 32 bits,
- void AdjustWaitForDelay(pointer /*waitTime*, unsigned long /* newdelay */) + void AdjustWaitForDelay(void *pTimeout, unsigned long newdelay)
has been provided.
Any wakeup handlers registered with RegisterBlockAndWakeupHandlers will -be called before the Screen handlers: +be called after the Screen handlers:
- void (*WakeupHandler) (blockData, err, pReadmask) - pointer blockData; - int err; - pointer pReadmask; + void (*ServerWakeupHandler) (void *blockData, int result)
diff --git a/xserver/doc/c-extensions b/xserver/doc/c-extensions new file mode 100644 index 000000000..e5fde3440 --- /dev/null +++ b/xserver/doc/c-extensions @@ -0,0 +1,68 @@ +First of all: C89 or better. If you don't have that, port gcc first. + +Use of C language extensions throughout the X server tree +--------------------------------------------------------- + +Optional extensions: +The server will still build if your toolchain does not support these +extensions, although the results may not be optimal. + + * _X_SENTINEL(x): member x of the passed structure must be NULL, e.g.: + void parseOptions(Option *options _X_SENTINEL(0)); + parseOptions("foo", "bar", NULL); /* this is OK */ + parseOptions("foo", "bar", "baz"); /* this is not */ + This definition comes from Xfuncproto.h in the core + protocol headers. + * _X_ATTRIBUTE_PRINTF(x, y): This function has printf-like semantics; + check the format string when built with + -Wformat (gcc) or similar. + * _X_EXPORT: this function should appear in symbol tables. + * _X_HIDDEN: this function should not appear in the _dynamic_ symbol + table. + * _X_INTERNAL: like _X_HIDDEN, but attempt to ensure that this function + is never called from another module. + * _X_INLINE: inline this function if possible (generally obeyed unless + disabling optimisations). + * _X_DEPRECATED: warn on use of this function. + +Mandatory extensions: +The server will not build if your toolchain does not support these extensions. + + * named initialisers: explicitly initialising structure members, e.g.: + struct foo bar = { .baz = quux, .brian = "dog" }; + * variadic macros: macros with a variable number of arguments, e.g.: + #define DebugF(x, ...) /**/ + * interleaved code and declarations: { foo = TRUE; int bar; do_stuff(); } + + +Use of library facilities throughout the X server tree +------------------------------------------------------------- + +Non-OS-dependent code can assume facilities at least as good as +the non-OS-facility parts of POSIX-1.2001. Ideally this would +be C99, but even gcc+glibc doesn't implement that yet. + +Unix-like systems are assumed to be at least as good as UNIX03. + +Note that there are two Windows ports, Cygwin and MinGW: +- Cygwin is more or less like Linux. +- MinGW is more restrictive. Windows does not provide the required +POSIX facilities, so some non-OS-dependent code is stubbed out or +has an alternate implementation if WIN32 is defined. Code that +needs to be portable to Windows should be careful to, well, be portable. + + +Required OS facilities +------------------------------------------------------------- + +Linux systems must be at least 2.4 or later. As a practical matter +though, 2.4 kernels never receive any testing. Use 2.6 already. + +TODO: Solaris. + +TODO: *BSD. + +Windows-dependent code assumes at least NT 5.1. + +OSX support is generally limited to the most recent version. Currently +that means 10.5. diff --git a/xserver/doc/dtrace/Makefile.in b/xserver/doc/dtrace/Makefile.in index f175422a5..f1f2d1351 100644 --- a/xserver/doc/dtrace/Makefile.in +++ b/xserver/doc/dtrace/Makefile.in @@ -77,9 +77,10 @@ DIST_COMMON = $(am__dist_shelf_DATA_DIST) $(srcdir)/Makefile.am \ subdir = doc/dtrace ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -318,6 +319,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -348,7 +352,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -443,6 +450,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/dri3/Makefile.in b/xserver/dri3/Makefile.in index 770765949..322d840cf 100644 --- a/xserver/dri3/Makefile.in +++ b/xserver/dri3/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -328,6 +329,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -358,7 +362,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -453,6 +460,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/dri3/dri3_request.c b/xserver/dri3/dri3_request.c index 2b3622148..8c15dbe16 100644 --- a/xserver/dri3/dri3_request.c +++ b/xserver/dri3/dri3_request.c @@ -178,8 +178,8 @@ proc_dri3_pixmap_from_buffer(ClientPtr client) (*drawable->pScreen->DestroyPixmap) (pixmap); return rc; } - if (AddResource(stuff->pixmap, RT_PIXMAP, (void *) pixmap)) - return Success; + if (!AddResource(stuff->pixmap, RT_PIXMAP, (void *) pixmap)) + return BadAlloc; return Success; } @@ -230,7 +230,7 @@ proc_dri3_buffer_from_pixmap(ClientPtr client) WriteToClient(client, sizeof(rep), &rep); - return client->noClientException; + return Success; } static int @@ -296,7 +296,7 @@ proc_dri3_fd_from_fence(ClientPtr client) WriteToClient(client, sizeof(rep), &rep); - return client->noClientException; + return Success; } int (*proc_dri3_vector[DRI3NumberRequests]) (ClientPtr) = { diff --git a/xserver/exa/Makefile.in b/xserver/exa/Makefile.in index 2388e3d05..3b44caac9 100644 --- a/xserver/exa/Makefile.in +++ b/xserver/exa/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -331,6 +332,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -361,7 +365,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -456,6 +463,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/exa/exa.c b/xserver/exa/exa.c index 51d36f3f3..7266b71f9 100644 --- a/xserver/exa/exa.c +++ b/xserver/exa/exa.c @@ -702,8 +702,7 @@ exaCreateScreenResources(ScreenPtr pScreen) } static void -ExaBlockHandler(ScreenPtr pScreen, void *pTimeout, - void *pReadmask) +ExaBlockHandler(ScreenPtr pScreen, void *pTimeout) { ExaScreenPriv(pScreen); @@ -712,7 +711,7 @@ ExaBlockHandler(ScreenPtr pScreen, void *pTimeout, exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap); unwrap(pExaScr, pScreen, BlockHandler); - (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout); wrap(pExaScr, pScreen, BlockHandler, ExaBlockHandler); /* The rest only applies to classic EXA */ @@ -732,13 +731,12 @@ ExaBlockHandler(ScreenPtr pScreen, void *pTimeout, } static void -ExaWakeupHandler(ScreenPtr pScreen, unsigned long result, - void *pReadmask) +ExaWakeupHandler(ScreenPtr pScreen, int result) { ExaScreenPriv(pScreen); unwrap(pExaScr, pScreen, WakeupHandler); - (*pScreen->WakeupHandler) (pScreen, result, pReadmask); + (*pScreen->WakeupHandler) (pScreen, result); wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler); if (result == 0 && pExaScr->numOffscreenAvailable > 1) { diff --git a/xserver/fb/Makefile.in b/xserver/fb/Makefile.in index 974066778..5905022f7 100644 --- a/xserver/fb/Makefile.in +++ b/xserver/fb/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -360,6 +361,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -390,7 +394,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -485,6 +492,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/fb/fbimage.c b/xserver/fb/fbimage.c index 59daa21bb..bac5de655 100644 --- a/xserver/fb/fbimage.c +++ b/xserver/fb/fbimage.c @@ -63,8 +63,8 @@ fbPutImage(DrawablePtr pDrawable, fbReplicatePixel(i, pDrawable->bitsPerPixel), pGC->alu, TRUE, x, y, w, h, src, srcStride, leftPad); - src += srcStride * h; } + src += srcStride * h; } break; case ZPixmap: diff --git a/xserver/fix-miregion b/xserver/fix-miregion new file mode 100644 index 000000000..fc502bbfd --- /dev/null +++ b/xserver/fix-miregion @@ -0,0 +1,29 @@ +#!/bin/sh +sed -i \ +-e 's/miRegionCreate\b/RegionCreate/g' \ +-e 's/miRegionInit\b/RegionInit/g' \ +-e 's/miRegionDestroy\b/RegionDestroy/g' \ +-e 's/miRegionUninit\b/RegionUninit/g' \ +-e 's/miRegionCopy\b/RegionCopy/g' \ +-e 's/miIntersect\b/RegionIntersect/g' \ +-e 's/miUnion\b/RegionUnion/g' \ +-e 's/miRegionAppend\b/RegionAppend/g' \ +-e 's/miRegionValidate\b/RegionValidate/g' \ +-e 's/miRectsToRegion\b/RegionFromRects/g' \ +-e 's/miSubtract\b/RegionSubtract/g' \ +-e 's/miInverse\b/RegionInverse/g' \ +-e 's/miRectIn\b/RegionContainsRect/g' \ +-e 's/miTranslateRegion\b/RegionTranslate/g' \ +-e 's/miRegionReset\b/RegionReset/g' \ +-e 's/miRegionBreak\b/RegionBreak/g' \ +-e 's/miPointInRegion\b/RegionContainsPoint/g' \ +-e 's/miRegionEqual\b/RegionEqual/g' \ +-e 's/miRegionNotEmpty\b/RegionNotEmpty/g' \ +-e 's/miRegionEmpty\b/RegionEmpty/g' \ +-e 's/miRegionExtents\b/RegionExtents/g' \ +-e 's/miPrintRegion\b/RegionPrint/g' \ +-e 's/miRectAlloc\b/RegionRectAlloc/g' \ +-e 's/miValidRegion\b/RegionIsValid/g' \ +-e 's/miRegionBroken\b/RegionBroken/g' \ +-e 's/miClipSpans\b/RegionClipSpans/g' \ +"$@" diff --git a/xserver/fix-miregion-private b/xserver/fix-miregion-private new file mode 100644 index 000000000..ebc24fac0 --- /dev/null +++ b/xserver/fix-miregion-private @@ -0,0 +1,14 @@ +#!/bin/sh +sed -i \ +-e 's/miEmptyBox\b/RegionEmptyBox/g' \ +-e 's/miEmptyData\b/RegionEmptyData/g' \ +-e 's/miBrokenData\b/RegionBrokenData/g' \ +-e 's/miBrokenRegion\b/RegionBrokenRegion/g' \ +-e 's/miCoalesce\b/RegionCoalesce/g' \ +-e 's/miAppendNonO\b/RegionAppendNonO/g' \ +-e 's/miRegionOp\b/RegionOp/g' \ +-e 's/miSetExtents\b/RegionSetExtents/g' \ +-e 's/miIntersectO\b/RegionIntersectO/g' \ +-e 's/miUnionO\b/RegionUnionO/g' \ +-e 's/miSubtractO\b/RegionSubtractO/g' \ +"$@" diff --git a/xserver/fix-patch-whitespace b/xserver/fix-patch-whitespace new file mode 100644 index 000000000..2d06d8ea8 --- /dev/null +++ b/xserver/fix-patch-whitespace @@ -0,0 +1,4 @@ +#!/bin/sh +git diff --check | +sed -n 's!^\([^:]*\):\([^:]*\):.*!sed -i "\2 s/[ \t]*$//; \2 s/ *\t/\t/g" \1!p' | +sh diff --git a/xserver/fix-region b/xserver/fix-region new file mode 100644 index 000000000..ef8eb4218 --- /dev/null +++ b/xserver/fix-region @@ -0,0 +1,38 @@ +#!/bin/sh +sed -i \ + -e 's/REGION_NIL\b/RegionNil/g' \ + -e 's/REGION_NAR\b/RegionNar/g' \ + -e 's/REGION_NUM_RECTS\b/RegionNumRects/g' \ + -e 's/REGION_SIZE\b/RegionSize/g' \ + -e 's/REGION_RECTS\b/RegionRects/g' \ + -e 's/REGION_BOXPTR\b/RegionBoxptr/g' \ + -e 's/REGION_BOX\b/RegionBox/g' \ + -e 's/REGION_TOP\b/RegionTop/g' \ + -e 's/REGION_END\b/RegionEnd/g' \ + -e 's/REGION_SZOF\b/RegionSizeof/g' \ + -e 's/REGION_CREATE *([^,]*, */RegionCreate(/g' \ + -e 's/REGION_COPY *([^,]*, */RegionCopy(/g' \ + -e 's/REGION_DESTROY *([^,]*, */RegionDestroy(/g' \ + -e 's/REGION_INTERSECT *([^,]*, */RegionIntersect(/g' \ + -e 's/REGION_UNION *([^,]*, */RegionUnion(/g' \ + -e 's/REGION_SUBTRACT *([^,]*, */RegionSubtract(/g' \ + -e 's/REGION_INVERSE *([^,]*, */RegionInverse(/g' \ + -e 's/REGION_TRANSLATE *([^,]*, */RegionTranslate(/g' \ + -e 's/RECT_IN_REGION *([^,]*, */RegionContainsRect(/g' \ + -e 's/POINT_IN_REGION *([^,]*, */RegionContainsPoint(/g' \ + -e 's/REGION_EQUAL *([^,]*, */RegionEqual(/g' \ + -e 's/REGION_APPEND *([^,]*, */RegionAppend(/g' \ + -e 's/REGION_VALIDATE *([^,]*, */RegionValidate(/g' \ + -e 's/BITMAP_TO_REGION\b/BitmapToRegion/g' \ + -e 's/RECTS_TO_REGION *([^,]*, */RegionFromRects(/g' \ + -e 's/REGION_BREAK *([^,]*, */RegionBreak(/g' \ + -e 's/REGION_INIT *([^,]*, */RegionInit(/g' \ + -e 's/REGION_UNINIT *([^,]*, */RegionUninit(/g' \ + -e 's/REGION_RESET *([^,]*, */RegionReset(/g' \ + -e 's/REGION_NOTEMPTY *([^,]*, */RegionNotEmpty(/g' \ + -e 's/REGION_BROKEN *([^,]*, */RegionBroken(/g' \ + -e 's/REGION_EMPTY *([^,]*, */RegionEmpty(/g' \ + -e 's/REGION_EXTENTS *([^,]*, */RegionExtents(/g' \ + -e 's/REGION_NULL *([^,]*, */RegionNull(/g' \ + -e 's/REGION_NULL$/RegionNull/g' \ + "$@" diff --git a/xserver/glamor/Makefile.am b/xserver/glamor/Makefile.am index c631c530b..8c79994e0 100644 --- a/xserver/glamor/Makefile.am +++ b/xserver/glamor/Makefile.am @@ -54,6 +54,8 @@ libglamor_la_SOURCES += \ glamor_xv.c endif -libglamor_egl_stubs_la_SOURCES = glamor_egl_stubs.c +libglamor_egl_stubs_la_SOURCES = \ + glamor_egl_stubs.c \ + glamor_egl.h sdk_HEADERS = glamor.h diff --git a/xserver/glamor/Makefile.in b/xserver/glamor/Makefile.in index fa9a54462..aad01ca4c 100644 --- a/xserver/glamor/Makefile.in +++ b/xserver/glamor/Makefile.in @@ -59,9 +59,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -362,6 +363,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -392,7 +396,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -487,6 +494,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -551,7 +559,10 @@ libglamor_la_SOURCES = glamor.c glamor_context.h glamor_copy.c \ glamor_vbo.c glamor_window.c glamor_fbo.c \ glamor_compositerects.c glamor_utils.c glamor_utils.h \ glamor_sync.c glamor.h $(am__append_1) -libglamor_egl_stubs_la_SOURCES = glamor_egl_stubs.c +libglamor_egl_stubs_la_SOURCES = \ + glamor_egl_stubs.c \ + glamor_egl.h + sdk_HEADERS = glamor.h all: all-am diff --git a/xserver/glamor/glamor.c b/xserver/glamor/glamor.c index 3956d6663..2467443e0 100644 --- a/xserver/glamor/glamor.c +++ b/xserver/glamor/glamor.c @@ -110,7 +110,6 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) ErrorF("XXX fail to create fbo.\n"); return; } - fbo->external = TRUE; glamor_pixmap_attach_fbo(pixmap, fbo); } @@ -134,6 +133,9 @@ glamor_get_pixmap_texture(PixmapPtr pixmap) { glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); + if (!pixmap_priv) + return 0; + if (pixmap_priv->type != GLAMOR_TEXTURE_ONLY) return 0; @@ -238,21 +240,13 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, return pixmap; } -void -glamor_destroy_textured_pixmap(PixmapPtr pixmap) -{ - if (pixmap->refcnt == 1) { -#if GLAMOR_HAS_GBM - glamor_egl_destroy_pixmap_image(pixmap); -#endif - glamor_pixmap_destroy_fbo(pixmap); - } -} - Bool glamor_destroy_pixmap(PixmapPtr pixmap) { - glamor_destroy_textured_pixmap(pixmap); + if (pixmap->refcnt == 1) { + glamor_pixmap_destroy_fbo(pixmap); + } + return fbDestroyPixmap(pixmap); } @@ -262,23 +256,21 @@ glamor_block_handler(ScreenPtr screen) glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_make_current(glamor_priv); - glamor_priv->tick++; glFlush(); - glamor_fbo_expire(glamor_priv); } static void -_glamor_block_handler(ScreenPtr screen, void *timeout, void *readmask) +_glamor_block_handler(ScreenPtr screen, void *timeout) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - screen->BlockHandler = glamor_priv->saved_procs.block_handler; - screen->BlockHandler(screen, timeout, readmask); - glamor_priv->saved_procs.block_handler = screen->BlockHandler; - screen->BlockHandler = _glamor_block_handler; - glamor_make_current(glamor_priv); glFlush(); + + screen->BlockHandler = glamor_priv->saved_procs.block_handler; + screen->BlockHandler(screen, timeout); + glamor_priv->saved_procs.block_handler = screen->BlockHandler; + screen->BlockHandler = _glamor_block_handler; } static void @@ -481,7 +473,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) LogMessage(X_WARNING, "glamor%d: Failed to allocate screen private\n", screen->myNum); - goto fail; + goto free_glamor_private; } glamor_set_screen_private(screen, glamor_priv); @@ -491,7 +483,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) LogMessage(X_WARNING, "glamor%d: Failed to allocate pixmap private\n", screen->myNum); - goto fail; + goto free_glamor_private; } if (!dixRegisterPrivateKey(&glamor_gc_private_key, PRIVATE_GC, @@ -499,12 +491,15 @@ glamor_init(ScreenPtr screen, unsigned int flags) LogMessage(X_WARNING, "glamor%d: Failed to allocate gc private\n", screen->myNum); - goto fail; + goto free_glamor_private; } glamor_priv->saved_procs.close_screen = screen->CloseScreen; screen->CloseScreen = glamor_close_screen; + glamor_priv->saved_procs.destroy_pixmap = screen->DestroyPixmap; + screen->DestroyPixmap = glamor_destroy_pixmap; + /* If we are using egl screen, call egl screen init to * register correct close screen function. */ if (flags & GLAMOR_USE_EGL_SCREEN) { @@ -523,6 +518,10 @@ glamor_init(ScreenPtr screen, unsigned int flags) gl_version = epoxy_gl_version(); + /* assume a core profile if we are GL 3.1 and don't have ARB_compatibility */ + glamor_priv->is_core_profile = + gl_version >= 31 && !epoxy_has_gl_extension("GL_ARB_compatibility"); + shading_version_string = (char *) glGetString(GL_SHADING_LANGUAGE_VERSION); if (!shading_version_string) { @@ -577,6 +576,12 @@ glamor_init(ScreenPtr screen, unsigned int flags) goto fail; } + if (!glamor_priv->is_core_profile && + !epoxy_has_gl_extension("GL_ARB_texture_border_clamp")) { + ErrorF("GL_ARB_texture_border_clamp required\n"); + goto fail; + } + if (!glamor_check_instruction_count(gl_version)) goto fail; } else { @@ -589,6 +594,11 @@ glamor_init(ScreenPtr screen, unsigned int flags) ErrorF("GL_EXT_texture_format_BGRA8888 required\n"); goto fail; } + + if (!epoxy_has_gl_extension("GL_OES_texture_border_clamp")) { + ErrorF("GL_OES_texture_border_clamp required\n"); + goto fail; + } } glamor_priv->has_rw_pbo = FALSE; @@ -620,9 +630,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_priv->has_dual_blend = epoxy_has_gl_extension("GL_ARB_blend_func_extended"); - /* assume a core profile if we are GL 3.1 and don't have ARB_compatibility */ - glamor_priv->is_core_profile = - gl_version >= 31 && !epoxy_has_gl_extension("GL_ARB_compatibility"); + glamor_priv->can_copyplane = (gl_version >= 30); glamor_setup_debug_output(screen); @@ -646,9 +654,15 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_priv->max_fbo_size = MAX_FBO_SIZE; #endif + glamor_priv->has_texture_swizzle = + (epoxy_has_gl_extension("GL_ARB_texture_swizzle") || + (glamor_priv->gl_flavor != GLAMOR_GL_DESKTOP && gl_version >= 30)); + glamor_priv->one_channel_format = GL_ALPHA; - if (epoxy_has_gl_extension("GL_ARB_texture_rg") && epoxy_has_gl_extension("GL_ARB_texture_swizzle")) + if (epoxy_has_gl_extension("GL_ARB_texture_rg") && + glamor_priv->has_texture_swizzle) { glamor_priv->one_channel_format = GL_RED; + } glamor_set_debug_level(&glamor_debug_level); @@ -673,9 +687,6 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_priv->saved_procs.create_pixmap = screen->CreatePixmap; screen->CreatePixmap = glamor_create_pixmap; - glamor_priv->saved_procs.destroy_pixmap = screen->DestroyPixmap; - screen->DestroyPixmap = glamor_destroy_pixmap; - glamor_priv->saved_procs.get_spans = screen->GetSpans; screen->GetSpans = glamor_get_spans; @@ -711,8 +722,6 @@ glamor_init(ScreenPtr screen, unsigned int flags) ps->Glyphs = glamor_composite_glyphs; glamor_init_vbo(screen); - glamor_init_pixmap_fbo(screen); - glamor_init_finish_access_shaders(screen); #ifdef GLAMOR_GRADIENT_SHADER glamor_init_gradient_shader(screen); @@ -725,6 +734,11 @@ glamor_init(ScreenPtr screen, unsigned int flags) return TRUE; fail: + /* Restore default CloseScreen and DestroyPixmap handlers */ + screen->CloseScreen = glamor_priv->saved_procs.close_screen; + screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap; + + free_glamor_private: free(glamor_priv); glamor_set_screen_private(screen, NULL); return FALSE; @@ -737,7 +751,6 @@ glamor_release_screen_priv(ScreenPtr screen) glamor_priv = glamor_get_screen_private(screen); glamor_fini_vbo(screen); - glamor_fini_pixmap_fbo(screen); glamor_pixmap_fini(screen); free(glamor_priv); @@ -829,12 +842,30 @@ glamor_fd_from_pixmap(ScreenPtr screen, return -1; } +_X_EXPORT int +glamor_shareable_fd_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap, CARD16 *stride, CARD32 *size) +{ + unsigned orig_usage_hint = pixmap->usage_hint; + int ret; + + /* + * The actual difference between a sharable and non sharable buffer + * is decided 4 call levels deep in glamor_make_pixmap_exportable() + * based on pixmap->usage_hint == CREATE_PIXMAP_USAGE_SHARED + * 2 of those calls are also exported API, so we cannot just add a flag. + */ + pixmap->usage_hint = CREATE_PIXMAP_USAGE_SHARED; + ret = glamor_fd_from_pixmap(screen, pixmap, stride, size); + pixmap->usage_hint = orig_usage_hint; + + return ret; +} + int glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size) { glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - glamor_screen_private *glamor_priv = - glamor_get_screen_private(pixmap->drawable.pScreen); switch (pixmap_priv->type) { case GLAMOR_TEXTURE_DRM: diff --git a/xserver/glamor/glamor.h b/xserver/glamor/glamor.h index 250dc83e4..bdd2374cf 100644 --- a/xserver/glamor/glamor.h +++ b/xserver/glamor/glamor.h @@ -40,6 +40,8 @@ #endif struct glamor_context; +struct gbm_bo; +struct gbm_device; /* * glamor_pixmap_type : glamor pixmap's type. @@ -114,7 +116,6 @@ extern _X_EXPORT void glamor_set_pixmap_texture(PixmapPtr pixmap, extern _X_EXPORT void glamor_set_pixmap_type(PixmapPtr pixmap, glamor_pixmap_type_t type); -extern _X_EXPORT void glamor_destroy_textured_pixmap(PixmapPtr pixmap); extern _X_EXPORT void glamor_block_handler(ScreenPtr screen); extern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h, @@ -143,18 +144,11 @@ extern _X_EXPORT void glamor_pixmap_exchange_fbos(PixmapPtr front, /* The DDX is not supposed to call these three functions */ extern _X_EXPORT void glamor_enable_dri3(ScreenPtr screen); -extern _X_EXPORT unsigned int glamor_egl_create_argb8888_based_texture(ScreenPtr - screen, - int w, - int h, - Bool linear); extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr, unsigned int, Bool, CARD16 *, CARD32 *); -extern void glamor_egl_destroy_pixmap_image(PixmapPtr pixmap); - -extern _X_EXPORT void *glamor_egl_get_gbm_device(ScreenPtr screen); +extern _X_EXPORT struct gbm_device *glamor_egl_get_gbm_device(ScreenPtr screen); /* @glamor_supports_pixmap_import_export: Returns whether * glamor_fd_from_pixmap(), glamor_name_from_pixmap(), and @@ -187,6 +181,26 @@ extern _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, CARD16 *stride, CARD32 *size); +/* @glamor_shareable_fd_from_pixmap: Get a dma-buf fd suitable for sharing + * with other GPUs from a pixmap. + * + * @screen: Current screen pointer. + * @pixmap: The pixmap from which we want the fd. + * @stride, @size: Pointers to fill the stride and size of the + * buffer associated to the fd. + * + * The returned fd will point to a buffer which is suitable for sharing + * across GPUs (not using GPU specific tiling). + * The pixmap and the buffer associated by the fd will share the same + * content. + * The pixmap's stride may be modified by this function. + * Returns the fd on success, -1 on error. + * */ +extern _X_EXPORT int glamor_shareable_fd_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap, + CARD16 *stride, + CARD32 *size); + /** * @glamor_name_from_pixmap: Gets a gem name from a pixmap. * @@ -214,8 +228,8 @@ extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap, * * Returns the gbm_bo on success, NULL on error. * */ -extern _X_EXPORT void *glamor_gbm_bo_from_pixmap(ScreenPtr screen, - PixmapPtr pixmap); +extern _X_EXPORT struct gbm_bo *glamor_gbm_bo_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap); /* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd. * @@ -322,13 +336,13 @@ extern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap, * This function is similar to glamor_egl_create_textured_pixmap. */ extern _X_EXPORT Bool - glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo); + glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, + struct gbm_bo *bo); #endif extern _X_EXPORT void glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx); -extern _X_EXPORT void glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap); extern _X_EXPORT int glamor_create_gc(GCPtr gc); diff --git a/xserver/glamor/glamor_composite_glyphs.c b/xserver/glamor/glamor_composite_glyphs.c index cc0aa6f37..b65127477 100644 --- a/xserver/glamor/glamor_composite_glyphs.c +++ b/xserver/glamor/glamor_composite_glyphs.c @@ -199,7 +199,8 @@ static const glamor_facet glamor_facet_composite_glyphs_120 = { .vs_vars = ("attribute vec2 primitive;\n" "attribute vec2 source;\n" "varying vec2 glyph_pos;\n"), - .vs_exec = (GLAMOR_POS(gl_Position, primitive) + .vs_exec = (" vec2 pos = vec2(0,0);\n" + GLAMOR_POS(gl_Position, primitive.xy) " glyph_pos = source.xy * ATLAS_DIM_INV;\n"), .fs_vars = ("varying vec2 glyph_pos;\n"), .fs_exec = (" vec4 mask = texture2D(atlas, glyph_pos);\n"), diff --git a/xserver/glamor/glamor_copy.c b/xserver/glamor/glamor_copy.c index 3501a0d24..ed96b2b1e 100644 --- a/xserver/glamor/glamor_copy.c +++ b/xserver/glamor/glamor_copy.c @@ -220,11 +220,39 @@ glamor_copy_cpu_fbo(DrawablePtr src, glamor_get_drawable_deltas(dst, dst_pixmap, &dst_xoff, &dst_yoff); - fbGetDrawable(src, src_bits, src_stride, src_bpp, src_xoff, src_yoff); + if (bitplane) { + PixmapPtr src_pix = fbCreatePixmap(screen, dst_pixmap->drawable.width, + dst_pixmap->drawable.height, + dst->depth, 0); - glamor_upload_boxes(dst_pixmap, box, nbox, src_xoff + dx, src_yoff + dy, - dst_xoff, dst_yoff, - (uint8_t *) src_bits, src_stride * sizeof (FbBits)); + if (!src_pix) { + glamor_finish_access(src); + goto bail; + } + + src_pix->drawable.x = dst_xoff; + src_pix->drawable.y = dst_yoff; + + fbGetDrawable(&src_pix->drawable, src_bits, src_stride, src_bpp, src_xoff, + src_yoff); + + if (src->bitsPerPixel > 1) + fbCopyNto1(src, &src_pix->drawable, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); + else + fbCopy1toN(src, &src_pix->drawable, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); + + glamor_upload_boxes(dst_pixmap, box, nbox, src_xoff, src_yoff, + dst_xoff, dst_yoff, (uint8_t *) src_bits, + src_stride * sizeof(FbBits)); + fbDestroyPixmap(src_pix); + } else { + fbGetDrawable(src, src_bits, src_stride, src_bpp, src_xoff, src_yoff); + glamor_upload_boxes(dst_pixmap, box, nbox, src_xoff + dx, src_yoff + dy, + dst_xoff, dst_yoff, + (uint8_t *) src_bits, src_stride * sizeof (FbBits)); + } glamor_finish_access(src); return TRUE; @@ -316,6 +344,7 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src, glamor_program *prog; const glamor_facet *copy_facet; int n; + Bool ret = FALSE; glamor_make_current(glamor_priv); @@ -325,6 +354,9 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src, if (!glamor_set_alu(screen, gc ? gc->alu : GXcopy)) goto bail_ctx; + if (bitplane && !glamor_priv->can_copyplane) + goto bail_ctx; + if (bitplane) { prog = &glamor_priv->copy_plane_prog; copy_facet = &glamor_facet_copyplane; @@ -379,9 +411,10 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src, goto bail_ctx; glamor_pixmap_loop(dst_priv, dst_box_index) { - glamor_set_destination_drawable(dst, dst_box_index, FALSE, FALSE, - prog->matrix_uniform, - &dst_off_x, &dst_off_y); + if (!glamor_set_destination_drawable(dst, dst_box_index, FALSE, FALSE, + prog->matrix_uniform, + &dst_off_x, &dst_off_y)) + goto bail_ctx; glScissor(dst_off_x - args.dx, dst_off_y - args.dy, @@ -391,13 +424,14 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src, glamor_glDrawArrays_GL_QUADS(glamor_priv, nbox); } } + + ret = TRUE; + +bail_ctx: glDisable(GL_SCISSOR_TEST); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - return TRUE; - -bail_ctx: - return FALSE; + return ret; } /** @@ -616,9 +650,9 @@ glamor_copy_gl(DrawablePtr src, return glamor_copy_fbo_fbo_draw(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); } - if (bitplane == 0) - return glamor_copy_cpu_fbo(src, dst, gc, box, nbox, dx, dy, - reverse, upsidedown, bitplane, closure); + + return glamor_copy_cpu_fbo(src, dst, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); } else if (GLAMOR_PIXMAP_PRIV_HAS_FBO(src_priv) && dst_priv->type != GLAMOR_DRM_ONLY && bitplane == 0) { diff --git a/xserver/glamor/glamor_core.c b/xserver/glamor/glamor_core.c index b9948b569..7b2b39633 100644 --- a/xserver/glamor/glamor_core.c +++ b/xserver/glamor/glamor_core.c @@ -113,174 +113,6 @@ glamor_link_glsl_prog(ScreenPtr screen, GLint prog, const char *format, ...) } } -/* - * When downloading a unsupported color format to CPU memory, - we need to shuffle the color elements and then use a supported - color format to read it back to CPU memory. - - For an example, the picture's format is PICT_b8g8r8a8, - Then the expecting color layout is as below (little endian): - 0 1 2 3 : address - a r g b - - Now the in GLES2 the supported color format is GL_RGBA, type is - GL_UNSIGNED_TYPE, then we need to shuffle the fragment - color as : - frag_color = sample(texture).argb; - before we use glReadPixel to get it back. - - For the uploading process, the shuffle is a revert shuffle. - We still use GL_RGBA, GL_UNSIGNED_BYTE to upload the color - to a texture, then let's see - 0 1 2 3 : address - a r g b : correct colors - R G B A : GL_RGBA with GL_UNSIGNED_BYTE - - Now we need to shuffle again, the mapping rule is - r = G, g = B, b = A, a = R. Then the uploading shuffle is as - below: - frag_color = sample(texture).gbar; -*/ - -void -glamor_init_finish_access_shaders(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv; - const char *vs_source = - "attribute vec4 v_position;\n" - "attribute vec4 v_texcoord0;\n" - "varying vec2 source_texture;\n" - "void main()\n" - "{\n" - " gl_Position = v_position;\n" - " source_texture = v_texcoord0.xy;\n" - "}\n"; - - const char *common_source = - GLAMOR_DEFAULT_PRECISION - "varying vec2 source_texture;\n" - "uniform sampler2D sampler;\n" - "uniform int revert;\n" - "uniform int swap_rb;\n" - "#define REVERT_NONE 0\n" - "#define REVERT_NORMAL 1\n" - "#define SWAP_NONE_DOWNLOADING 0\n" - "#define SWAP_DOWNLOADING 1\n" - "#define SWAP_UPLOADING 2\n" - "#define SWAP_NONE_UPLOADING 3\n"; - - const char *fs_source = - "void main()\n" - "{\n" - " vec4 color = texture2D(sampler, source_texture);\n" - " if (revert == REVERT_NONE) \n" - " { \n" - " if ((swap_rb != SWAP_NONE_DOWNLOADING) && (swap_rb != SWAP_NONE_UPLOADING)) \n" - " gl_FragColor = color.bgra;\n" - " else \n" - " gl_FragColor = color.rgba;\n" - " } \n" - " else \n" - " { \n" - " if (swap_rb == SWAP_DOWNLOADING) \n" - " gl_FragColor = color.argb;\n" - " else if (swap_rb == SWAP_NONE_DOWNLOADING)\n" - " gl_FragColor = color.abgr;\n" - " else if (swap_rb == SWAP_UPLOADING)\n" - " gl_FragColor = color.gbar;\n" - " else if (swap_rb == SWAP_NONE_UPLOADING)\n" - " gl_FragColor = color.abgr;\n" - " } \n" - "}\n"; - - const char *set_alpha_source = - "void main()\n" - "{\n" - " vec4 color = texture2D(sampler, source_texture);\n" - " if (revert == REVERT_NONE) \n" - " { \n" - " if ((swap_rb != SWAP_NONE_DOWNLOADING) && (swap_rb != SWAP_NONE_UPLOADING)) \n" - " gl_FragColor = vec4(color.bgr, 1);\n" - " else \n" - " gl_FragColor = vec4(color.rgb, 1);\n" - " } \n" - " else \n" - " { \n" - " if (swap_rb == SWAP_DOWNLOADING) \n" - " gl_FragColor = vec4(1, color.rgb);\n" - " else if (swap_rb == SWAP_NONE_DOWNLOADING)\n" - " gl_FragColor = vec4(1, color.bgr);\n" - " else if (swap_rb == SWAP_UPLOADING)\n" - " gl_FragColor = vec4(color.gba, 1);\n" - " else if (swap_rb == SWAP_NONE_UPLOADING)\n" - " gl_FragColor = vec4(color.abg, 1);\n" - " } \n" - "}\n"; - GLint fs_prog, vs_prog, avs_prog, set_alpha_prog; - GLint sampler_uniform_location; - char *source; - - glamor_priv = glamor_get_screen_private(screen); - glamor_make_current(glamor_priv); - glamor_priv->finish_access_prog[0] = glCreateProgram(); - glamor_priv->finish_access_prog[1] = glCreateProgram(); - - vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, vs_source); - - XNFasprintf(&source, "%s%s", common_source, fs_source); - fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, source); - free(source); - - glAttachShader(glamor_priv->finish_access_prog[0], vs_prog); - glAttachShader(glamor_priv->finish_access_prog[0], fs_prog); - - avs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, vs_source); - - XNFasprintf(&source, "%s%s", common_source, set_alpha_source); - set_alpha_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, - source); - free(source); - - glAttachShader(glamor_priv->finish_access_prog[1], avs_prog); - glAttachShader(glamor_priv->finish_access_prog[1], set_alpha_prog); - - glBindAttribLocation(glamor_priv->finish_access_prog[0], - GLAMOR_VERTEX_POS, "v_position"); - glBindAttribLocation(glamor_priv->finish_access_prog[0], - GLAMOR_VERTEX_SOURCE, "v_texcoord0"); - glamor_link_glsl_prog(screen, glamor_priv->finish_access_prog[0], - "finish access 0"); - - glBindAttribLocation(glamor_priv->finish_access_prog[1], - GLAMOR_VERTEX_POS, "v_position"); - glBindAttribLocation(glamor_priv->finish_access_prog[1], - GLAMOR_VERTEX_SOURCE, "v_texcoord0"); - glamor_link_glsl_prog(screen, glamor_priv->finish_access_prog[1], - "finish access 1"); - - glamor_priv->finish_access_revert[0] = - glGetUniformLocation(glamor_priv->finish_access_prog[0], "revert"); - - glamor_priv->finish_access_swap_rb[0] = - glGetUniformLocation(glamor_priv->finish_access_prog[0], "swap_rb"); - sampler_uniform_location = - glGetUniformLocation(glamor_priv->finish_access_prog[0], "sampler"); - glUseProgram(glamor_priv->finish_access_prog[0]); - glUniform1i(sampler_uniform_location, 0); - glUniform1i(glamor_priv->finish_access_revert[0], 0); - glUniform1i(glamor_priv->finish_access_swap_rb[0], 0); - - glamor_priv->finish_access_revert[1] = - glGetUniformLocation(glamor_priv->finish_access_prog[1], "revert"); - glamor_priv->finish_access_swap_rb[1] = - glGetUniformLocation(glamor_priv->finish_access_prog[1], "swap_rb"); - sampler_uniform_location = - glGetUniformLocation(glamor_priv->finish_access_prog[1], "sampler"); - glUseProgram(glamor_priv->finish_access_prog[1]); - glUniform1i(glamor_priv->finish_access_revert[1], 0); - glUniform1i(sampler_uniform_location, 0); - glUniform1i(glamor_priv->finish_access_swap_rb[1], 0); -} static GCOps glamor_gc_ops = { .FillSpans = glamor_fill_spans, diff --git a/xserver/glamor/glamor_dash.c b/xserver/glamor/glamor_dash.c index 3c19dba32..b53ce5c50 100644 --- a/xserver/glamor/glamor_dash.c +++ b/xserver/glamor/glamor_dash.c @@ -32,6 +32,7 @@ static const char dash_vs_vars[] = static const char dash_vs_exec[] = " dash_offset = primitive.z / dash_length;\n" + " vec2 pos = vec2(0,0);\n" GLAMOR_POS(gl_Position, primitive.xy); static const char dash_fs_vars[] = @@ -146,7 +147,7 @@ glamor_dash_setup(DrawablePtr drawable, GCPtr gc) goto bail; dash_pixmap = glamor_get_dash_pixmap(gc); - dash_priv = glamor_get_pixmap_private(pixmap); + dash_priv = glamor_get_pixmap_private(dash_pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dash_priv)) goto bail; diff --git a/xserver/glamor/glamor_egl.c b/xserver/glamor/glamor_egl.c index 5aacbedef..4bde637a0 100644 --- a/xserver/glamor/glamor_egl.c +++ b/xserver/glamor/glamor_egl.c @@ -43,9 +43,7 @@ #include #endif -#define MESA_EGL_NO_X11_HEADERS -#include -#include +#include "glamor_egl.h" #include "glamor.h" #include "glamor_priv.h" @@ -78,6 +76,7 @@ struct glamor_egl_screen_private { int dri3_capable; CloseScreenProcPtr saved_close_screen; + DestroyPixmapProcPtr saved_destroy_pixmap; xf86FreeScreenProc *saved_free_screen; }; @@ -174,7 +173,7 @@ glamor_create_texture_from_image(ScreenPtr screen, return TRUE; } -void * +struct gbm_device * glamor_egl_get_gbm_device(ScreenPtr screen) { #ifdef GLAMOR_HAS_GBM @@ -186,49 +185,6 @@ glamor_egl_get_gbm_device(ScreenPtr screen) #endif } -unsigned int -glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h, Bool linear) -{ - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - struct glamor_egl_screen_private *glamor_egl; - EGLImageKHR image; - GLuint texture; - -#ifdef GLAMOR_HAS_GBM - struct gbm_bo *bo; - EGLNativePixmapType native_pixmap; - - glamor_egl = glamor_egl_get_screen_private(scrn); - bo = gbm_bo_create(glamor_egl->gbm, w, h, GBM_FORMAT_ARGB8888, -#ifdef GLAMOR_HAS_GBM_LINEAR - (linear ? GBM_BO_USE_LINEAR : 0) | -#endif - GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT); - if (!bo) - return 0; - - /* If the following assignment raises an error or a warning - * then that means EGLNativePixmapType is not struct gbm_bo * - * on your platform: This code won't work and you should not - * compile with dri3 support enabled */ - native_pixmap = bo; - - image = eglCreateImageKHR(glamor_egl->display, - EGL_NO_CONTEXT, - EGL_NATIVE_PIXMAP_KHR, - native_pixmap, NULL); - gbm_bo_destroy(bo); - if (image == EGL_NO_IMAGE_KHR) - return 0; - glamor_create_texture_from_image(screen, image, &texture); - eglDestroyImageKHR(glamor_egl->display, image); - - return texture; -#else - return 0; /* this path should never happen */ -#endif -} - Bool glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride) { @@ -334,7 +290,8 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) } Bool -glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo) +glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, + struct gbm_bo *bo) { ScreenPtr screen = pixmap->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); @@ -367,24 +324,7 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo) } #ifdef GLAMOR_HAS_GBM -int glamor_get_fd_from_bo(int gbm_fd, struct gbm_bo *bo, int *fd); -void glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name); -int -glamor_get_fd_from_bo(int gbm_fd, struct gbm_bo *bo, int *fd) -{ - union gbm_bo_handle handle; - struct drm_prime_handle args; - - handle = gbm_bo_get_handle(bo); - args.handle = handle.u32; - args.flags = DRM_CLOEXEC; - if (ioctl(gbm_fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args)) - return FALSE; - *fd = args.fd; - return TRUE; -} - -void +static void glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name) { union gbm_bo_handle handle; @@ -468,7 +408,7 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap) #endif } -void * +struct gbm_bo * glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) { struct glamor_egl_screen_private *glamor_egl = @@ -507,8 +447,7 @@ glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, glamor_get_name_from_bo(glamor_egl->fd, bo, &fd); } else { - if (glamor_get_fd_from_bo(glamor_egl->fd, bo, &fd)) { - } + fd = gbm_bo_get_fd(bo); } *stride = pixmap->devKind; *size = pixmap->devKind * gbm_bo_get_height(bo); @@ -587,20 +526,29 @@ glamor_pixmap_from_fd(ScreenPtr screen, #endif } -void -glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) +static Bool +glamor_egl_destroy_pixmap(PixmapPtr pixmap) { - struct glamor_pixmap_private *pixmap_priv = - glamor_get_pixmap_private(pixmap); + ScreenPtr screen = pixmap->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + struct glamor_egl_screen_private *glamor_egl = + glamor_egl_get_screen_private(scrn); + Bool ret; - if (pixmap_priv->image) { - ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen); - struct glamor_egl_screen_private *glamor_egl = - glamor_egl_get_screen_private(scrn); + if (pixmap->refcnt == 1) { + struct glamor_pixmap_private *pixmap_priv = + glamor_get_pixmap_private(pixmap); - eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image); - pixmap_priv->image = NULL; + if (pixmap_priv->image) + eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image); } + + screen->DestroyPixmap = glamor_egl->saved_destroy_pixmap; + ret = screen->DestroyPixmap(pixmap); + glamor_egl->saved_destroy_pixmap = screen->DestroyPixmap; + screen->DestroyPixmap = glamor_egl_destroy_pixmap; + + return ret; } _X_EXPORT void @@ -622,12 +570,6 @@ glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back) glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM); } -void -glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap) -{ - glamor_destroy_textured_pixmap(pixmap); -} - static Bool glamor_egl_close_screen(ScreenPtr screen) { @@ -718,6 +660,9 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) glamor_egl->saved_close_screen = screen->CloseScreen; screen->CloseScreen = glamor_egl_close_screen; + glamor_egl->saved_destroy_pixmap = screen->DestroyPixmap; + screen->DestroyPixmap = glamor_egl_destroy_pixmap; + glamor_ctx->ctx = glamor_egl->context; glamor_ctx->display = glamor_egl->display; @@ -756,6 +701,11 @@ static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl) if (glamor_egl->display != EGL_NO_DISPLAY) { eglMakeCurrent(glamor_egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + /* + * Force the next glamor_make_current call to update the context + * (on hot unplug another GPU may still be using glamor) + */ + lastGLContext = NULL; eglTerminate(glamor_egl->display); } #ifdef GLAMOR_HAS_GBM @@ -816,7 +766,13 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) ErrorF("couldn't get display device\n"); goto error; } - glamor_egl->display = eglGetDisplay(glamor_egl->gbm); + + glamor_egl->display = glamor_egl_get_display(EGL_PLATFORM_GBM_MESA, + glamor_egl->gbm); + if (!glamor_egl->display) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglGetDisplay() failed\n"); + goto error; + } #else glamor_egl->display = eglGetDisplay((EGLNativeDisplayType) (intptr_t) fd); #endif @@ -884,6 +840,11 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) "Failed to make EGL context current\n"); goto error; } + /* + * Force the next glamor_make_current call to set the right context + * (in case of multiple GPUs using glamor) + */ + lastGLContext = NULL; #ifdef GLAMOR_HAS_GBM if (epoxy_has_egl_extension(glamor_egl->display, "EGL_KHR_gl_texture_2D_image") && diff --git a/xserver/glamor/glamor_egl.h b/xserver/glamor/glamor_egl.h new file mode 100644 index 000000000..6bb1185bf --- /dev/null +++ b/xserver/glamor/glamor_egl.h @@ -0,0 +1,75 @@ +/* + * Copyright © 2016 Red Hat, Inc. + * + * 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 (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + * + * Authors: + * Adam Jackson + */ + +#ifndef GLAMOR_EGL_H +#define GLAMOR_EGL_H + +#define MESA_EGL_NO_X11_HEADERS +#include +#include + +/* + * Create an EGLDisplay from a native display type. This is a little quirky + * for a few reasons. + * + * 1: GetPlatformDisplayEXT and GetPlatformDisplay are the API you want to + * use, but have different function signatures in the third argument; this + * happens not to matter for us, at the moment, but it means epoxy won't alias + * them together. + * + * 2: epoxy 1.3 and earlier don't understand EGL client extensions, which + * means you can't call "eglGetPlatformDisplayEXT" directly, as the resolver + * will crash. + * + * 3: You can't tell whether you have EGL 1.5 at this point, because + * eglQueryString(EGL_VERSION) is a property of the display, which we don't + * have yet. So you have to query for extensions no matter what. Fortunately + * epoxy_has_egl_extension _does_ let you query for client extensions, so + * we don't have to write our own extension string parsing. + * + * 4. There is no EGL_KHR_platform_base to complement the EXT one, thus one + * needs to know EGL 1.5 is supported in order to use the eglGetPlatformDisplay + * function pointer. + * We can workaround this (circular dependency) by probing for the EGL 1.5 + * platform extensions (EGL_KHR_platform_gbm and friends) yet it doesn't seem + * like mesa will be able to adverise these (even though it can do EGL 1.5). + */ +static inline EGLDisplay +glamor_egl_get_display(EGLint type, void *native) +{ + /* In practise any EGL 1.5 implementation would support the EXT extension */ + if (epoxy_has_egl_extension(NULL, "EGL_EXT_platform_base")) { + PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplayEXT = + (void *) eglGetProcAddress("eglGetPlatformDisplayEXT"); + if (getPlatformDisplayEXT) + return getPlatformDisplayEXT(type, native, NULL); + } + + /* Welp, everything is awful. */ + return eglGetDisplay(native); +} + +#endif diff --git a/xserver/glamor/glamor_egl_stubs.c b/xserver/glamor/glamor_egl_stubs.c index 5dbbfe4b2..40f7fcc01 100644 --- a/xserver/glamor/glamor_egl_stubs.c +++ b/xserver/glamor/glamor_egl_stubs.c @@ -35,11 +35,6 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) { } -void -glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) -{ -} - int glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, PixmapPtr pixmap, diff --git a/xserver/glamor/glamor_fbo.c b/xserver/glamor/glamor_fbo.c index 5bfffe501..9f1288c60 100644 --- a/xserver/glamor/glamor_fbo.c +++ b/xserver/glamor/glamor_fbo.c @@ -30,107 +30,9 @@ #include "glamor_priv.h" -#define GLAMOR_CACHE_EXPIRE_MAX 100 - -#define GLAMOR_CACHE_DEFAULT 0 -#define GLAMOR_CACHE_EXACT_SIZE 1 - -//#define NO_FBO_CACHE 1 -#define FBO_CACHE_THRESHOLD (256*1024*1024) - -/* Loop from the tail to the head. */ -#define xorg_list_for_each_entry_reverse(pos, head, member) \ - for (pos = __container_of((head)->prev, pos, member); \ - &pos->member != (head); \ - pos = __container_of(pos->member.prev, pos, member)) - -#define xorg_list_for_each_entry_safe_reverse(pos, tmp, head, member) \ - for (pos = __container_of((head)->prev, pos, member), \ - tmp = __container_of(pos->member.prev, pos, member); \ - &pos->member != (head); \ - pos = tmp, tmp = __container_of(pos->member.prev, tmp, member)) - -inline static int -cache_wbucket(int size) -{ - int order = __fls(size / 32); - - if (order >= CACHE_BUCKET_WCOUNT) - order = CACHE_BUCKET_WCOUNT - 1; - return order; -} - -inline static int -cache_hbucket(int size) -{ - int order = __fls(size / 32); - - if (order >= CACHE_BUCKET_HCOUNT) - order = CACHE_BUCKET_HCOUNT - 1; - return order; -} - -static int -cache_format(GLenum format) -{ - switch (format) { - case GL_ALPHA: - case GL_LUMINANCE: - case GL_RED: - return 2; - case GL_RGB: - return 1; - case GL_RGBA: - return 0; - default: - return -1; - } -} - -static glamor_pixmap_fbo * -glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv, - int w, int h, GLenum format) -{ - struct xorg_list *cache; - glamor_pixmap_fbo *fbo_entry, *ret_fbo = NULL; - int n_format; - -#ifdef NO_FBO_CACHE - return NULL; -#else - n_format = cache_format(format); - if (n_format == -1) - return NULL; - cache = &glamor_priv->fbo_cache[n_format] - [cache_wbucket(w)] - [cache_hbucket(h)]; - - xorg_list_for_each_entry(fbo_entry, cache, list) { - if (fbo_entry->width == w && fbo_entry->height == h) { - - DEBUGF("Request w %d h %d format %x \n", w, h, format); - DEBUGF("got cache entry %p w %d h %d fbo %d tex %d format %x\n", - fbo_entry, fbo_entry->width, fbo_entry->height, - fbo_entry->fb, fbo_entry->tex, fbo_entry->format); - assert(format == fbo_entry->format); - xorg_list_del(&fbo_entry->list); - ret_fbo = fbo_entry; - break; - } - } - - if (ret_fbo) - glamor_priv->fbo_cache_watermark -= ret_fbo->width * ret_fbo->height; - - assert(glamor_priv->fbo_cache_watermark >= 0); - - return ret_fbo; -#endif -} - -static void -glamor_purge_fbo(glamor_screen_private *glamor_priv, - glamor_pixmap_fbo *fbo) +void +glamor_destroy_fbo(glamor_screen_private *glamor_priv, + glamor_pixmap_fbo *fbo) { glamor_make_current(glamor_priv); @@ -142,40 +44,6 @@ glamor_purge_fbo(glamor_screen_private *glamor_priv, free(fbo); } -static void -glamor_pixmap_fbo_cache_put(glamor_screen_private *glamor_priv, - glamor_pixmap_fbo *fbo) -{ - struct xorg_list *cache; - int n_format; - -#ifdef NO_FBO_CACHE - glamor_purge_fbo(fbo); - return; -#else - n_format = cache_format(fbo->format); - - if (fbo->fb == 0 || fbo->external || n_format == -1 - || glamor_priv->fbo_cache_watermark >= FBO_CACHE_THRESHOLD) { - glamor_priv->tick += GLAMOR_CACHE_EXPIRE_MAX; - glamor_fbo_expire(glamor_priv); - glamor_purge_fbo(glamor_priv, fbo); - return; - } - - cache = &glamor_priv->fbo_cache[n_format] - [cache_wbucket(fbo->width)] - [cache_hbucket(fbo->height)]; - DEBUGF - ("Put cache entry %p to cache %p w %d h %d format %x fbo %d tex %d \n", - fbo, cache, fbo->width, fbo->height, fbo->format, fbo->fb, fbo->tex); - - glamor_priv->fbo_cache_watermark += fbo->width * fbo->height; - xorg_list_add(&fbo->list, cache); - fbo->expire = glamor_priv->tick + GLAMOR_CACHE_EXPIRE_MAX; -#endif -} - static int glamor_pixmap_ensure_fb(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo) @@ -235,20 +103,14 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, if (fbo == NULL) return NULL; - xorg_list_init(&fbo->list); - fbo->tex = tex; fbo->width = w; fbo->height = h; - fbo->external = FALSE; fbo->format = format; - if (flag == CREATE_PIXMAP_USAGE_SHARED) - fbo->external = TRUE; - if (flag != GLAMOR_CREATE_FBO_NO_FBO) { if (glamor_pixmap_ensure_fb(glamor_priv, fbo) != 0) { - glamor_purge_fbo(glamor_priv, fbo); + glamor_destroy_fbo(glamor_priv, fbo); fbo = NULL; } } @@ -256,79 +118,6 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, return fbo; } -void -glamor_fbo_expire(glamor_screen_private *glamor_priv) -{ - struct xorg_list *cache; - glamor_pixmap_fbo *fbo_entry, *tmp; - int i, j, k; - - for (i = 0; i < CACHE_FORMAT_COUNT; i++) - for (j = 0; j < CACHE_BUCKET_WCOUNT; j++) - for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) { - cache = &glamor_priv->fbo_cache[i][j][k]; - xorg_list_for_each_entry_safe_reverse(fbo_entry, tmp, cache, - list) { - if (GLAMOR_TICK_AFTER(fbo_entry->expire, glamor_priv->tick)) { - break; - } - - glamor_priv->fbo_cache_watermark -= - fbo_entry->width * fbo_entry->height; - xorg_list_del(&fbo_entry->list); - DEBUGF("cache %p fbo %p expired %d current %d \n", cache, - fbo_entry, fbo_entry->expire, glamor_priv->tick); - glamor_purge_fbo(glamor_priv, fbo_entry); - } - } - -} - -void -glamor_init_pixmap_fbo(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv; - int i, j, k; - - glamor_priv = glamor_get_screen_private(screen); - for (i = 0; i < CACHE_FORMAT_COUNT; i++) - for (j = 0; j < CACHE_BUCKET_WCOUNT; j++) - for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) { - xorg_list_init(&glamor_priv->fbo_cache[i][j][k]); - } - glamor_priv->fbo_cache_watermark = 0; -} - -void -glamor_fini_pixmap_fbo(ScreenPtr screen) -{ - struct xorg_list *cache; - glamor_screen_private *glamor_priv; - glamor_pixmap_fbo *fbo_entry, *tmp; - int i, j, k; - - glamor_priv = glamor_get_screen_private(screen); - for (i = 0; i < CACHE_FORMAT_COUNT; i++) - for (j = 0; j < CACHE_BUCKET_WCOUNT; j++) - for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) { - cache = &glamor_priv->fbo_cache[i][j][k]; - xorg_list_for_each_entry_safe_reverse(fbo_entry, tmp, cache, - list) { - xorg_list_del(&fbo_entry->list); - glamor_purge_fbo(glamor_priv, fbo_entry); - } - } -} - -void -glamor_destroy_fbo(glamor_screen_private *glamor_priv, - glamor_pixmap_fbo *fbo) -{ - xorg_list_del(&fbo->list); - glamor_pixmap_fbo_cache_put(glamor_priv, fbo); - -} - static int _glamor_create_tex(glamor_screen_private *glamor_priv, int w, int h, GLenum format) @@ -366,22 +155,12 @@ glamor_pixmap_fbo * glamor_create_fbo(glamor_screen_private *glamor_priv, int w, int h, GLenum format, int flag) { - glamor_pixmap_fbo *fbo; - GLint tex = 0; + GLint tex = _glamor_create_tex(glamor_priv, w, h, format); - if (flag == GLAMOR_CREATE_FBO_NO_FBO || flag == CREATE_PIXMAP_USAGE_SHARED) - goto new_fbo; - - fbo = glamor_pixmap_fbo_cache_get(glamor_priv, w, h, format); - if (fbo) - return fbo; - new_fbo: - tex = _glamor_create_tex(glamor_priv, w, h, format); - if (!tex) + if (!tex) /* Texture creation failed due to GL_OUT_OF_MEMORY */ return NULL; - fbo = glamor_create_fbo_from_tex(glamor_priv, w, h, format, tex, flag); - return fbo; + return glamor_create_fbo_from_tex(glamor_priv, w, h, format, tex, flag); } /** @@ -510,6 +289,7 @@ glamor_pixmap_destroy_fbo(PixmapPtr pixmap) for (i = 0; i < priv->block_wcnt * priv->block_hcnt; i++) glamor_destroy_fbo(glamor_priv, priv->fbo_array[i]); free(priv->fbo_array); + priv->fbo_array = NULL; } else { fbo = glamor_pixmap_detach_fbo(priv); diff --git a/xserver/glamor/glamor_font.c b/xserver/glamor/glamor_font.c index 637e0dce1..9199a355b 100644 --- a/xserver/glamor/glamor_font.c +++ b/xserver/glamor/glamor_font.c @@ -55,7 +55,7 @@ glamor_font_get(ScreenPtr screen, FontPtr font) privates = calloc(glamor_font_screen_count, sizeof (glamor_font_t)); if (!privates) return NULL; - FontSetPrivate(font, glamor_font_private_index, privates); + xfont2_font_set_private(font, glamor_font_private_index, privates); } glamor_font = &privates[screen->myNum]; @@ -201,7 +201,7 @@ glamor_unrealize_font(ScreenPtr screen, FontPtr font) return TRUE; free(privates); - FontSetPrivate(font, glamor_font_private_index, NULL); + xfont2_font_set_private(font, glamor_font_private_index, NULL); return TRUE; } @@ -214,7 +214,7 @@ glamor_font_init(ScreenPtr screen) return TRUE; if (glamor_font_generation != serverGeneration) { - glamor_font_private_index = AllocateFontPrivateIndex(); + glamor_font_private_index = xfont2_allocate_font_private_index(); if (glamor_font_private_index == -1) return FALSE; glamor_font_screen_count = 0; diff --git a/xserver/glamor/glamor_glyphblt.c b/xserver/glamor/glamor_glyphblt.c index b21aa068e..78315ea9b 100644 --- a/xserver/glamor/glamor_glyphblt.c +++ b/xserver/glamor/glamor_glyphblt.c @@ -49,6 +49,7 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc, glamor_program *prog; RegionPtr clip = gc->pCompositeClip; int box_index; + Bool ret = FALSE; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) @@ -75,8 +76,9 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc, int off_x, off_y; char *vbo_offset; - glamor_set_destination_drawable(drawable, box_index, FALSE, TRUE, - prog->matrix_uniform, &off_x, &off_y); + if (!glamor_set_destination_drawable(drawable, box_index, FALSE, TRUE, + prog->matrix_uniform, &off_x, &off_y)) + goto bail; max_points = 500; num_points = 0; @@ -138,11 +140,12 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc, } } + ret = TRUE; + +bail: glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - return TRUE; -bail: - return FALSE; + return ret; } void @@ -174,6 +177,7 @@ glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap, int num_points; INT16 *points = NULL; char *vbo_offset; + Bool ret = FALSE; if (w * h > MAXINT / (2 * sizeof(float))) goto bail; @@ -221,17 +225,19 @@ glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap, glamor_put_vbo_space(screen); glamor_pixmap_loop(pixmap_priv, box_index) { - glamor_set_destination_drawable(drawable, box_index, FALSE, TRUE, - prog->matrix_uniform, NULL, NULL); + if (!glamor_set_destination_drawable(drawable, box_index, FALSE, TRUE, + prog->matrix_uniform, NULL, NULL)) + goto bail; glDrawArrays(GL_POINTS, 0, num_points); } - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - return TRUE; + ret = TRUE; bail: - return FALSE; + glDisableVertexAttribArray(GLAMOR_VERTEX_POS); + + return ret; } void diff --git a/xserver/glamor/glamor_gradient.c b/xserver/glamor/glamor_gradient.c index c50542a32..0c97ce7cb 100644 --- a/xserver/glamor/glamor_gradient.c +++ b/xserver/glamor/glamor_gradient.c @@ -603,7 +603,7 @@ _glamor_gradient_convert_trans_matrix(PictTransform *from, float to[3][3], * So, to get the correct v_s, we need to cacula1 the matrix: (A*T*inv(A)), and * we name this matrix T_s. * - * Firstly, because A is for the scale convertion, we find + * Firstly, because A is for the scale conversion, we find * -- -- * |1/w 0 0 | * A = | 0 1/h 0 | @@ -884,7 +884,7 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen, stops_count = src_picture->pSourcePict->radial.nstops + 2; - /* Because the max value of nstops is unkown, so create a program + /* Because the max value of nstops is unknown, so create a program when nstops > LINEAR_LARGE_STOPS. */ if (stops_count <= RADIAL_SMALL_STOPS) { gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][0]; @@ -1193,7 +1193,7 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, stops_count = src_picture->pSourcePict->linear.nstops + 2; - /* Because the max value of nstops is unkown, so create a program + /* Because the max value of nstops is unknown, so create a program when nstops > LINEAR_LARGE_STOPS. */ if (stops_count <= LINEAR_SMALL_STOPS) { gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][0]; @@ -1403,7 +1403,7 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, } else { /* The slope need to compute here. In shader, the viewport set will change - the orginal slope and the slope which is vertical to it will not be correct. */ + the original slope and the slope which is vertical to it will not be correct. */ slope = -(float) (src_picture->pSourcePict->linear.p2.x - src_picture->pSourcePict->linear.p1.x) / (float) (src_picture->pSourcePict->linear.p2.y diff --git a/xserver/glamor/glamor_largepixmap.c b/xserver/glamor/glamor_largepixmap.c index 9a6c95ee9..f9adb93bc 100644 --- a/xserver/glamor/glamor_largepixmap.c +++ b/xserver/glamor/glamor_largepixmap.c @@ -1,4 +1,5 @@ #include +#include /* For INT16_MAX */ #include "glamor_priv.h" @@ -722,11 +723,11 @@ glamor_compute_transform_clipped_regions(PixmapPtr pixmap, temp_box.x2 = MIN(temp_box.x2, pixmap->drawable.width); temp_box.y2 = MIN(temp_box.y2, pixmap->drawable.height); } - /* Now copy back the box32 to a box16 box. */ - short_box.x1 = temp_box.x1; - short_box.y1 = temp_box.y1; - short_box.x2 = temp_box.x2; - short_box.y2 = temp_box.y2; + /* Now copy back the box32 to a box16 box, avoiding overflow. */ + short_box.x1 = MIN(temp_box.x1, INT16_MAX); + short_box.y1 = MIN(temp_box.y1, INT16_MAX); + short_box.x2 = MIN(temp_box.x2, INT16_MAX); + short_box.y2 = MIN(temp_box.y2, INT16_MAX); RegionInitBoxes(temp_region, &short_box, 1); DEBUGF("copy to temp source region \n"); DEBUGRegionPrint(temp_region); @@ -1259,7 +1260,7 @@ glamor_composite_largepixmap_region(CARD8 op, is_normal_mask_fbo = 1; } else { - /* This mask region has transform or repeatpad, we need clip it agains the previous + /* This mask region has transform or repeatpad, we need clip it against the previous * valid region rather than the mask region. */ if (!is_normal_source_fbo) clipped_mask_regions = diff --git a/xserver/glamor/glamor_lines.c b/xserver/glamor/glamor_lines.c index a2c9b1fcc..5d95333fe 100644 --- a/xserver/glamor/glamor_lines.c +++ b/xserver/glamor/glamor_lines.c @@ -46,6 +46,7 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc, char *vbo_offset; int box_index; int add_last; + Bool ret = FALSE; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) @@ -103,8 +104,9 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc, int nbox = RegionNumRects(gc->pCompositeClip); BoxPtr box = RegionRects(gc->pCompositeClip); - glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE, - prog->matrix_uniform, &off_x, &off_y); + if (!glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE, + prog->matrix_uniform, &off_x, &off_y)) + goto bail; while (nbox--) { glScissor(box->x1 + off_x, @@ -116,12 +118,13 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc, } } + ret = TRUE; + +bail: glDisable(GL_SCISSOR_TEST); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - return TRUE; -bail: - return FALSE; + return ret; } static Bool diff --git a/xserver/glamor/glamor_picture.c b/xserver/glamor/glamor_picture.c index b069ce56b..84a33ad6a 100644 --- a/xserver/glamor/glamor_picture.c +++ b/xserver/glamor/glamor_picture.c @@ -1,4 +1,5 @@ /* + * Copyright © 2016 Broadcom * Copyright © 2009 Intel Corporation * Copyright © 1998 Keith Packard * @@ -20,10 +21,19 @@ * 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. + */ + +/** + * @file glamor_picture.c * - * Authors: - * Zhigang Gong + * Implements temporary uploads of GL_MEMORY Pixmaps to a texture that + * is swizzled appropriately for a given Render picture format. + * laid * * + * This is important because GTK likes to use SHM Pixmaps for Render + * blending operations, and we don't want a blend operation to fall + * back to software (readback is more expensive than the upload we do + * here, and you'd have to re-upload the fallback output anyway). */ #include @@ -31,64 +41,122 @@ #include "glamor_priv.h" #include "mipict.h" -/* - * Map picture's format to the correct gl texture format and type. - * no_alpha is used to indicate whehter we need to wire alpha to 1. +static void byte_swap_swizzle(GLenum *swizzle) +{ + GLenum temp; + + temp = swizzle[0]; + swizzle[0] = swizzle[3]; + swizzle[3] = temp; + + temp = swizzle[1]; + swizzle[1] = swizzle[2]; + swizzle[2] = temp; +} + +/** + * Returns the GL format and type for uploading our bits to a given PictFormat. * - * Although opengl support A1/GL_BITMAP, we still don't use it - * here, it seems that mesa has bugs when uploading a A1 bitmap. - * - * Return 0 if find a matched texture type. Otherwise return -1. - **/ -static int -glamor_get_tex_format_type_from_pictformat_gl(ScreenPtr pScreen, - PictFormatShort format, - GLenum *tex_format, - GLenum *tex_type, - int *no_alpha, - int *revert, - int *swap_rb, int is_upload) + * We may need to tell the caller to translate the bits to another + * format, as in PICT_a1 (which GL doesn't support). We may also need + * to tell the GL to swizzle the texture on sampling, because GLES3 + * doesn't support the GL_UNSIGNED_INT_8_8_8_8{,_REV} types, so we + * don't have enough channel reordering options at upload time without + * it. + */ +static Bool +glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, + PictFormatShort format, + PictFormatShort *temp_format, + GLenum *tex_format, + GLenum *tex_type, + GLenum *swizzle) { glamor_screen_private *glamor_priv = glamor_get_screen_private(pScreen); - *no_alpha = 0; - *revert = REVERT_NONE; - *swap_rb = is_upload ? SWAP_NONE_UPLOADING : SWAP_NONE_DOWNLOADING; + Bool is_little_endian = IMAGE_BYTE_ORDER == LSBFirst; + + *temp_format = format; + swizzle[0] = GL_RED; + swizzle[1] = GL_GREEN; + swizzle[2] = GL_BLUE; + swizzle[3] = GL_ALPHA; + switch (format) { case PICT_a1: *tex_format = glamor_priv->one_channel_format; *tex_type = GL_UNSIGNED_BYTE; - *revert = is_upload ? REVERT_UPLOADING_A1 : REVERT_DOWNLOADING_A1; + *temp_format = PICT_a8; break; + case PICT_b8g8r8x8: - *no_alpha = 1; case PICT_b8g8r8a8: - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_INT_8_8_8_8; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_BGRA; + *tex_type = GL_UNSIGNED_INT_8_8_8_8; + } else { + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_BYTE; + + swizzle[0] = GL_GREEN; + swizzle[1] = GL_BLUE; + swizzle[2] = GL_ALPHA; + swizzle[3] = GL_RED; + + if (!is_little_endian) + byte_swap_swizzle(swizzle); + } break; case PICT_x8r8g8b8: - *no_alpha = 1; case PICT_a8r8g8b8: - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_BGRA; + *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; + } else { + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_BYTE; + + swizzle[0] = GL_BLUE; + swizzle[2] = GL_RED; + + if (!is_little_endian) + byte_swap_swizzle(swizzle); + break; + } break; + case PICT_x8b8g8r8: - *no_alpha = 1; case PICT_a8b8g8r8: *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; + } else { + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_BYTE; + + if (!is_little_endian) + byte_swap_swizzle(swizzle); + } break; + case PICT_x2r10g10b10: - *no_alpha = 1; case PICT_a2r10g10b10: - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_BGRA; + *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; + } else { + return FALSE; + } break; + case PICT_x2b10g10r10: - *no_alpha = 1; case PICT_a2b10g10r10: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; + } else { + return FALSE; + } break; case PICT_r5g6b5: @@ -97,275 +165,94 @@ glamor_get_tex_format_type_from_pictformat_gl(ScreenPtr pScreen, break; case PICT_b5g6r5: *tex_format = GL_RGB; - *tex_type = GL_UNSIGNED_SHORT_5_6_5_REV; - break; - case PICT_x1b5g5r5: - *no_alpha = 1; - case PICT_a1b5g5r5: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - break; - - case PICT_x1r5g5b5: - *no_alpha = 1; - case PICT_a1r5g5b5: - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - break; - case PICT_a8: - *tex_format = glamor_priv->one_channel_format; - *tex_type = GL_UNSIGNED_BYTE; - break; - case PICT_x4r4g4b4: - *no_alpha = 1; - case PICT_a4r4g4b4: - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; - break; - - case PICT_x4b4g4r4: - *no_alpha = 1; - case PICT_a4b4g4r4: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; - break; - - default: - return -1; - } - return 0; -} - -#define IS_LITTLE_ENDIAN (IMAGE_BYTE_ORDER == LSBFirst) - -static int -glamor_get_tex_format_type_from_pictformat_gles2(ScreenPtr pScreen, - PictFormatShort format, - GLenum *tex_format, - GLenum *tex_type, - int *no_alpha, - int *revert, - int *swap_rb, int is_upload) -{ - glamor_screen_private *glamor_priv = glamor_get_screen_private(pScreen); - int need_swap_rb = 0; - - *no_alpha = 0; - *revert = IS_LITTLE_ENDIAN ? REVERT_NONE : REVERT_NORMAL; - - switch (format) { - case PICT_b8g8r8x8: - *no_alpha = 1; - case PICT_b8g8r8a8: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_BYTE; - need_swap_rb = 1; - *revert = IS_LITTLE_ENDIAN ? REVERT_NORMAL : REVERT_NONE; - break; - - case PICT_x8r8g8b8: - *no_alpha = 1; - case PICT_a8r8g8b8: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_BYTE; - need_swap_rb = 1; - break; - - case PICT_x8b8g8r8: - *no_alpha = 1; - case PICT_a8b8g8r8: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_BYTE; - break; - - case PICT_x2r10g10b10: - *no_alpha = 1; - case PICT_a2r10g10b10: - *tex_format = GL_RGBA; - /* glReadPixmap doesn't support GL_UNSIGNED_INT_10_10_10_2. - * we have to use GL_UNSIGNED_BYTE and do the conversion in - * shader latter.*/ - *tex_type = GL_UNSIGNED_BYTE; - if (is_upload == 1) { - if (!IS_LITTLE_ENDIAN) - *revert = REVERT_UPLOADING_10_10_10_2; - else - *revert = REVERT_UPLOADING_2_10_10_10; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_type = GL_UNSIGNED_SHORT_5_6_5_REV; + } else { + *tex_type = GL_UNSIGNED_SHORT_5_6_5; + swizzle[0] = GL_BLUE; + swizzle[2] = GL_RED; } - else { - if (!IS_LITTLE_ENDIAN) { - *revert = REVERT_DOWNLOADING_10_10_10_2; - } - else { - *revert = REVERT_DOWNLOADING_2_10_10_10; - } - } - need_swap_rb = 1; - - break; - - case PICT_x2b10g10r10: - *no_alpha = 1; - case PICT_a2b10g10r10: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_BYTE; - if (is_upload == 1) { - if (!IS_LITTLE_ENDIAN) - *revert = REVERT_UPLOADING_10_10_10_2; - else - *revert = REVERT_UPLOADING_2_10_10_10; - } - else { - if (!IS_LITTLE_ENDIAN) { - *revert = REVERT_DOWNLOADING_10_10_10_2; - } - else { - *revert = REVERT_DOWNLOADING_2_10_10_10; - } - } - break; - - case PICT_r5g6b5: - *tex_format = GL_RGB; - *tex_type = GL_UNSIGNED_SHORT_5_6_5; - *revert = IS_LITTLE_ENDIAN ? REVERT_NONE : REVERT_NORMAL; - - break; - - case PICT_b5g6r5: - *tex_format = GL_RGB; - *tex_type = GL_UNSIGNED_SHORT_5_6_5; - need_swap_rb = IS_LITTLE_ENDIAN ? 1 : 0; break; case PICT_x1b5g5r5: - *no_alpha = 1; case PICT_a1b5g5r5: *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_5_5_5_1; - if (IS_LITTLE_ENDIAN) { - *revert = - is_upload ? REVERT_UPLOADING_1_5_5_5 : - REVERT_DOWNLOADING_1_5_5_5; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; + } else { + return FALSE; } - else - *revert = REVERT_NONE; break; case PICT_x1r5g5b5: - *no_alpha = 1; case PICT_a1r5g5b5: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_5_5_5_1; - if (IS_LITTLE_ENDIAN) { - *revert = - is_upload ? REVERT_UPLOADING_1_5_5_5 : - REVERT_DOWNLOADING_1_5_5_5; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_BGRA; + *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; + } else { + return FALSE; } - else - *revert = REVERT_NONE; - need_swap_rb = 1; - break; - - case PICT_a1: - *tex_format = glamor_priv->one_channel_format; - *tex_type = GL_UNSIGNED_BYTE; - *revert = is_upload ? REVERT_UPLOADING_A1 : REVERT_DOWNLOADING_A1; break; case PICT_a8: *tex_format = glamor_priv->one_channel_format; *tex_type = GL_UNSIGNED_BYTE; - *revert = REVERT_NONE; break; case PICT_x4r4g4b4: - *no_alpha = 1; case PICT_a4r4g4b4: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_4_4_4_4; - *revert = IS_LITTLE_ENDIAN ? REVERT_NORMAL : REVERT_NONE; - need_swap_rb = 1; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_BGRA; + *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; + } else { + /* XXX */ + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_SHORT_4_4_4_4; + } break; case PICT_x4b4g4r4: - *no_alpha = 1; case PICT_a4b4g4r4: - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_4_4_4_4; - *revert = IS_LITTLE_ENDIAN ? REVERT_NORMAL : REVERT_NONE; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; + } else { + /* XXX */ + *tex_format = GL_RGBA; + *tex_type = GL_UNSIGNED_SHORT_4_4_4_4; + } break; default: - LogMessageVerb(X_INFO, 0, - "fail to get matched format for %x \n", format); - return -1; + return FALSE; } - if (need_swap_rb) - *swap_rb = is_upload ? SWAP_UPLOADING : SWAP_DOWNLOADING; - else - *swap_rb = is_upload ? SWAP_NONE_UPLOADING : SWAP_NONE_DOWNLOADING; - return 0; + if (!PICT_FORMAT_A(format)) + swizzle[3] = GL_ONE; + + return TRUE; } -static int -glamor_get_tex_format_type_from_pixmap(PixmapPtr pixmap, - PictFormatShort pict_format, - GLenum *format, - GLenum *type, - int *no_alpha, - int *revert, int *swap_rb, int is_upload) +/** + * Takes a set of source bits with a given format and returns an + * in-memory pixman image of those bits in a destination format. + */ +static pixman_image_t * +glamor_get_converted_image(PictFormatShort dst_format, + PictFormatShort src_format, + void *src_bits, + int src_stride, + int w, int h) { - glamor_screen_private *glamor_priv = - glamor_get_screen_private(pixmap->drawable.pScreen); - - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { - return glamor_get_tex_format_type_from_pictformat_gl(pixmap->drawable.pScreen, - pict_format, - format, type, - no_alpha, - revert, - swap_rb, - is_upload); - } else { - return glamor_get_tex_format_type_from_pictformat_gles2(pixmap->drawable.pScreen, - pict_format, - format, type, - no_alpha, - revert, - swap_rb, - is_upload); - } -} - -static void * -_glamor_color_convert_a1_a8(void *src_bits, void *dst_bits, int w, int h, - int stride, int revert) -{ - PictFormatShort dst_format, src_format; pixman_image_t *dst_image; pixman_image_t *src_image; - int src_stride; - if (revert == REVERT_UPLOADING_A1) { - src_format = PICT_a1; - dst_format = PICT_a8; - src_stride = PixmapBytePad(w, 1); - } - else { - dst_format = PICT_a1; - src_format = PICT_a8; - src_stride = (((w * 8 + 7) / 8) + 3) & ~3; - } - - dst_image = pixman_image_create_bits(dst_format, w, h, dst_bits, stride); + dst_image = pixman_image_create_bits(dst_format, w, h, NULL, 0); if (dst_image == NULL) { return NULL; } - src_image = pixman_image_create_bits(src_format, - w, h, src_bits, src_stride); + src_image = pixman_image_create_bits(src_format, w, h, src_bits, src_stride); if (src_image == NULL) { pixman_image_unref(dst_image); @@ -376,559 +263,113 @@ _glamor_color_convert_a1_a8(void *src_bits, void *dst_bits, int w, int h, 0, 0, 0, 0, 0, 0, w, h); pixman_image_unref(src_image); - pixman_image_unref(dst_image); - return dst_bits; -} - -#define ADJUST_BITS(d, src_bits, dst_bits) (((dst_bits) == (src_bits)) ? (d) : \ - (((dst_bits) > (src_bits)) ? \ - (((d) << ((dst_bits) - (src_bits))) \ - + (( 1 << ((dst_bits) - (src_bits))) >> 1)) \ - : ((d) >> ((src_bits) - (dst_bits))))) - -#define GLAMOR_DO_CONVERT(src, dst, no_alpha, swap, \ - a_shift_src, a_bits_src, \ - b_shift_src, b_bits_src, \ - g_shift_src, g_bits_src, \ - r_shift_src, r_bits_src, \ - a_shift, a_bits, \ - b_shift, b_bits, \ - g_shift, g_bits, \ - r_shift, r_bits) \ - do { \ - typeof(src) a,b,g,r; \ - typeof(src) a_mask_src, b_mask_src, g_mask_src, r_mask_src;\ - a_mask_src = (((1 << (a_bits_src)) - 1) << a_shift_src);\ - b_mask_src = (((1 << (b_bits_src)) - 1) << b_shift_src);\ - g_mask_src = (((1 << (g_bits_src)) - 1) << g_shift_src);\ - r_mask_src = (((1 << (r_bits_src)) - 1) << r_shift_src);\ - if (no_alpha) \ - a = (a_mask_src) >> (a_shift_src); \ - else \ - a = ((src) & (a_mask_src)) >> (a_shift_src); \ - b = ((src) & (b_mask_src)) >> (b_shift_src); \ - g = ((src) & (g_mask_src)) >> (g_shift_src); \ - r = ((src) & (r_mask_src)) >> (r_shift_src); \ - a = ADJUST_BITS(a, a_bits_src, a_bits); \ - b = ADJUST_BITS(b, b_bits_src, b_bits); \ - g = ADJUST_BITS(g, g_bits_src, g_bits); \ - r = ADJUST_BITS(r, r_bits_src, r_bits); \ - if (swap == 0) \ - (*dst) = ((a) << (a_shift)) | ((b) << (b_shift)) | ((g) << (g_shift)) | ((r) << (r_shift)); \ - else \ - (*dst) = ((a) << (a_shift)) | ((r) << (b_shift)) | ((g) << (g_shift)) | ((b) << (r_shift)); \ - } while (0) - -static void * -_glamor_color_revert_x2b10g10r10(void *src_bits, void *dst_bits, int w, int h, - int stride, int no_alpha, int revert, - int swap_rb) -{ - int x, y; - unsigned int *words, *saved_words, *source_words; - int swap = !(swap_rb == SWAP_NONE_DOWNLOADING || - swap_rb == SWAP_NONE_UPLOADING); - - source_words = src_bits; - words = dst_bits; - saved_words = words; - - for (y = 0; y < h; y++) { - DEBUGF("Line %d : ", y); - for (x = 0; x < w; x++) { - unsigned int pixel = source_words[x]; - - if (revert == REVERT_DOWNLOADING_2_10_10_10) - GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, - 24, 8, 16, 8, 8, 8, 0, 8, - 30, 2, 20, 10, 10, 10, 0, 10); - else - GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, - 30, 2, 20, 10, 10, 10, 0, 10, - 24, 8, 16, 8, 8, 8, 0, 8); - DEBUGF("%x:%x ", pixel, words[x]); - } - DEBUGF("\n"); - words += stride / sizeof(*words); - source_words += stride / sizeof(*words); - } - DEBUGF("\n"); - return saved_words; - -} - -static void * -_glamor_color_revert_x1b5g5r5(void *src_bits, void *dst_bits, int w, int h, - int stride, int no_alpha, int revert, int swap_rb) -{ - int x, y; - unsigned short *words, *saved_words, *source_words; - int swap = !(swap_rb == SWAP_NONE_DOWNLOADING || - swap_rb == SWAP_NONE_UPLOADING); - - words = dst_bits; - source_words = src_bits; - saved_words = words; - - for (y = 0; y < h; y++) { - DEBUGF("Line %d : ", y); - for (x = 0; x < w; x++) { - unsigned short pixel = source_words[x]; - - if (revert == REVERT_DOWNLOADING_1_5_5_5) - GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, - 0, 1, 1, 5, 6, 5, 11, 5, - 15, 1, 10, 5, 5, 5, 0, 5); - else - GLAMOR_DO_CONVERT(pixel, &words[x], no_alpha, swap, - 15, 1, 10, 5, 5, 5, 0, 5, - 0, 1, 1, 5, 6, 5, 11, 5); - DEBUGF("%04x:%04x ", pixel, words[x]); - } - DEBUGF("\n"); - words += stride / sizeof(*words); - source_words += stride / sizeof(*words); - } - DEBUGF("\n"); - return saved_words; -} - -/* - * This function is to convert an unsupported color format to/from a - * supported GL format. - * Here are the current scenarios: - * - * @no_alpha: - * If it is set, then we need to wire the alpha value to 1. - * @revert: - REVERT_DOWNLOADING_A1 : convert an Alpha8 buffer to a A1 buffer. - REVERT_UPLOADING_A1 : convert an A1 buffer to an Alpha8 buffer - REVERT_DOWNLOADING_2_10_10_10 : convert r10G10b10X2 to X2B10G10R10 - REVERT_UPLOADING_2_10_10_10 : convert X2B10G10R10 to R10G10B10X2 - REVERT_DOWNLOADING_1_5_5_5 : convert B5G5R5X1 to X1R5G5B5 - REVERT_UPLOADING_1_5_5_5 : convert X1R5G5B5 to B5G5R5X1 - @swap_rb: if we have the swap_rb set, then we need to swap the R and B's position. - * - */ - -static void * -glamor_color_convert_to_bits(void *src_bits, void *dst_bits, int w, int h, - int stride, int no_alpha, int revert, int swap_rb) -{ - if (revert == REVERT_DOWNLOADING_A1 || revert == REVERT_UPLOADING_A1) { - return _glamor_color_convert_a1_a8(src_bits, dst_bits, w, h, stride, - revert); - } - else if (revert == REVERT_DOWNLOADING_2_10_10_10 || - revert == REVERT_UPLOADING_2_10_10_10) { - return _glamor_color_revert_x2b10g10r10(src_bits, dst_bits, w, h, - stride, no_alpha, revert, - swap_rb); - } - else if (revert == REVERT_DOWNLOADING_1_5_5_5 || - revert == REVERT_UPLOADING_1_5_5_5) { - return _glamor_color_revert_x1b5g5r5(src_bits, dst_bits, w, h, stride, - no_alpha, revert, swap_rb); - } - else - ErrorF("convert a non-supported mode %x.\n", revert); - - return NULL; + return dst_image; } /** - * Upload pixmap to a specified texture. - * This texture may not be the one attached to it. - **/ -static Bool -__glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex, - GLenum format, - GLenum type, - int x, int y, int w, int h, - void *bits, int pbo) + * Uploads a picture based on a GLAMOR_MEMORY pixmap to a texture in a + * temporary FBO. + */ +Bool +glamor_upload_picture_to_texture(PicturePtr picture) { - glamor_screen_private *glamor_priv = - glamor_get_screen_private(pixmap->drawable.pScreen); - int non_sub = 0; - unsigned int iformat = 0; + PixmapPtr pixmap = glamor_get_drawable_pixmap(picture->pDrawable); + ScreenPtr screen = pixmap->drawable.pScreen; + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); + PictFormatShort converted_format; + void *bits = pixmap->devPrivate.ptr; + int stride = pixmap->devKind; + GLenum format, type; + GLenum swizzle[4]; + GLenum iformat; + Bool ret = TRUE; + Bool needs_swizzle; + pixman_image_t *converted_image = NULL; + + assert(glamor_pixmap_is_memory(pixmap)); + assert(!pixmap_priv->fbo); glamor_make_current(glamor_priv); - if (*tex == 0) { - glGenTextures(1, tex); - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) - iformat = gl_iformat_for_pixmap(pixmap); - else - iformat = format; - non_sub = 1; - assert(x == 0 && y == 0); - } - glBindTexture(GL_TEXTURE_2D, *tex); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - - assert(pbo || bits != 0); - if (bits == NULL) { - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo); - glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); - } - glamor_priv->suppress_gl_out_of_memory_logging = true; - if (non_sub) - glTexImage2D(GL_TEXTURE_2D, 0, iformat, w, h, 0, format, type, bits); - else - glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, format, type, bits); - glamor_priv->suppress_gl_out_of_memory_logging = false; - if (glGetError() == GL_OUT_OF_MEMORY) { - if (non_sub) { - glDeleteTextures(1, tex); - *tex = 0; - } + /* No handling of large pixmap pictures here (would need to make + * an FBO array and split the uploads across it). + */ + if (!glamor_check_fbo_size(glamor_priv, + pixmap->drawable.width, + pixmap->drawable.height)) { return FALSE; } - if (bits == NULL) - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - - return TRUE; -} - -static Bool -_glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, - GLenum type, int no_alpha, int revert, - int swap_rb, int x, int y, int w, int h, - int stride, void *bits, int pbo) -{ - ScreenPtr screen = pixmap->drawable.pScreen; - glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - glamor_screen_private *glamor_priv = - glamor_get_screen_private(pixmap->drawable.pScreen); - float dst_xscale, dst_yscale; - GLuint tex = 0; - int need_free_bits = 0; - - if (bits == NULL) - goto ready_to_upload; - - if (revert > REVERT_NORMAL) { - /* XXX if we are restoring the pixmap, then we may not need to allocate - * new buffer */ - void *converted_bits; - - if (pixmap->drawable.depth == 1) - stride = (((w * 8 + 7) / 8) + 3) & ~3; - - converted_bits = xallocarray(h, stride); - - if (converted_bits == NULL) - return FALSE; - bits = glamor_color_convert_to_bits(bits, converted_bits, w, h, - stride, no_alpha, revert, swap_rb); - if (bits == NULL) { - free(converted_bits); - ErrorF("Failed to convert pixmap no_alpha %d," - "revert mode %d, swap mode %d\n", no_alpha, revert, swap_rb); - return FALSE; - } - no_alpha = 0; - revert = REVERT_NONE; - swap_rb = SWAP_NONE_UPLOADING; - need_free_bits = TRUE; + if (!glamor_get_tex_format_type_from_pictformat(screen, + picture->format, + &converted_format, + &format, + &type, + swizzle)) { + glamor_fallback("Unknown pixmap depth %d.\n", pixmap->drawable.depth); + return FALSE; } - ready_to_upload: + needs_swizzle = (swizzle[0] != GL_RED || + swizzle[1] != GL_GREEN || + swizzle[2] != GL_BLUE || + swizzle[3] != GL_ALPHA); - /* Try fast path firstly, upload the pixmap to the texture attached - * to the fbo directly. */ - if (no_alpha == 0 - && revert == REVERT_NONE && swap_rb == SWAP_NONE_UPLOADING -#ifdef WALKAROUND_LARGE_TEXTURE_MAP - && glamor_pixmap_priv_is_small(pixmap_priv) -#endif - ) { - int fbo_x_off, fbo_y_off; + if (!glamor_priv->has_texture_swizzle && needs_swizzle) { + glamor_fallback("Couldn't upload temporary picture due to missing " + "GL_ARB_texture_swizzle.\n"); + return FALSE; + } - assert(pixmap_priv->fbo->tex); - pixmap_priv_get_fbo_off(pixmap_priv, &fbo_x_off, &fbo_y_off); - - assert(x + fbo_x_off >= 0 && y + fbo_y_off >= 0); - assert(x + fbo_x_off + w <= pixmap_priv->fbo->width); - assert(y + fbo_y_off + h <= pixmap_priv->fbo->height); - if (!__glamor_upload_pixmap_to_texture(pixmap, &pixmap_priv->fbo->tex, - format, type, - x + fbo_x_off, y + fbo_y_off, - w, h, - bits, pbo)) { - if (need_free_bits) - free(bits); + if (converted_format != picture->format) { + converted_image = glamor_get_converted_image(converted_format, + picture->format, + bits, stride, + pixmap->drawable.width, + pixmap->drawable.height); + if (!converted_image) return FALSE; - } - } else { - static const float texcoords_inv[8] = { 0, 0, - 1, 0, - 1, 1, - 0, 1 - }; - GLfloat *v; - char *vbo_offset; - v = glamor_get_vbo_space(screen, 16 * sizeof(GLfloat), &vbo_offset); - - pixmap_priv_get_dest_scale(pixmap, pixmap_priv, &dst_xscale, &dst_yscale); - glamor_set_normalize_vcoords(pixmap_priv, dst_xscale, - dst_yscale, - x, y, - x + w, y + h, - v); - /* Slow path, we need to flip y or wire alpha to 1. */ - glamor_make_current(glamor_priv); - - if (!__glamor_upload_pixmap_to_texture(pixmap, &tex, - format, type, 0, 0, w, h, bits, - pbo)) { - if (need_free_bits) - free(bits); - return FALSE; - } - - memcpy(&v[8], texcoords_inv, 8 * sizeof(GLfloat)); - - glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, - GL_FALSE, 2 * sizeof(float), vbo_offset); - glEnableVertexAttribArray(GLAMOR_VERTEX_POS); - glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, - GL_FALSE, 2 * sizeof(float), vbo_offset + 8 * sizeof(GLfloat)); - glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - - glamor_put_vbo_space(screen); - glamor_set_destination_pixmap_priv_nc(glamor_priv, pixmap, pixmap_priv); - glamor_set_alu(screen, GXcopy); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, tex); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glUseProgram(glamor_priv->finish_access_prog[no_alpha]); - glUniform1i(glamor_priv->finish_access_revert[no_alpha], revert); - glUniform1i(glamor_priv->finish_access_swap_rb[no_alpha], swap_rb); - - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glDeleteTextures(1, &tex); - glBindFramebuffer(GL_FRAMEBUFFER, 0); + bits = pixman_image_get_data(converted_image); + stride = pixman_image_get_stride(converted_image); } - if (need_free_bits) - free(bits); - return TRUE; -} - -/* - * Prepare to upload a pixmap to texture memory. - * no_alpha equals 1 means the format needs to wire alpha to 1. - */ -static int -glamor_pixmap_upload_prepare(PixmapPtr pixmap, GLenum format, int no_alpha, - int revert, int swap_rb) -{ - int flag = 0; - glamor_pixmap_private *pixmap_priv; - glamor_screen_private *glamor_priv; - glamor_pixmap_fbo *fbo; - GLenum iformat; - - pixmap_priv = glamor_get_pixmap_private(pixmap); - glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); - - if (pixmap_priv->gl_fbo != GLAMOR_FBO_UNATTACHED) - return 0; - - if (pixmap_priv->fbo - && (pixmap_priv->fbo->width < pixmap->drawable.width - || pixmap_priv->fbo->height < pixmap->drawable.height)) { - fbo = glamor_pixmap_detach_fbo(pixmap_priv); - glamor_destroy_fbo(glamor_priv, fbo); - } - - if (pixmap_priv->fbo && pixmap_priv->fbo->fb) - return 0; - - if (!(no_alpha || (revert == REVERT_NORMAL) - || (swap_rb != SWAP_NONE_UPLOADING))) { - /* We don't need a fbo, a simple texture uploading should work. */ - - flag = GLAMOR_CREATE_FBO_NO_FBO; - } - - if ((flag == GLAMOR_CREATE_FBO_NO_FBO - && pixmap_priv->fbo && pixmap_priv->fbo->tex)) - return 0; - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) iformat = gl_iformat_for_pixmap(pixmap); else iformat = format; - if (!glamor_pixmap_ensure_fbo(pixmap, iformat, flag)) - return -1; + if (!glamor_pixmap_ensure_fbo(pixmap, iformat, GLAMOR_CREATE_FBO_NO_FBO)) + goto fail; - return 0; -} + glPixelStorei(GL_UNPACK_ALIGNMENT, 4); -/* - * upload sub region to a large region. - * */ -static void -glamor_put_bits(char *dst_bits, int dst_stride, char *src_bits, - int src_stride, int bpp, int x, int y, int w, int h) -{ - int j; - int byte_per_pixel; + glamor_priv->suppress_gl_out_of_memory_logging = true; - byte_per_pixel = bpp / 8; - src_bits += y * src_stride + (x * byte_per_pixel); + /* We can't use glamor_pixmap_loop() because GLAMOR_MEMORY pixmaps + * don't have initialized boxes. + */ + glBindTexture(GL_TEXTURE_2D, pixmap_priv->fbo->tex); + glTexImage2D(GL_TEXTURE_2D, 0, iformat, + pixmap->drawable.width, pixmap->drawable.height, 0, + format, type, bits); - for (j = y; j < y + h; j++) { - memcpy(dst_bits, src_bits, w * byte_per_pixel); - src_bits += src_stride; - dst_bits += dst_stride; + if (needs_swizzle) { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, swizzle[0]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, swizzle[1]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, swizzle[2]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, swizzle[3]); } -} -static Bool -glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w, - int h, int stride, void *bits, int pbo, - PictFormatShort pict_format) -{ - ScreenPtr screen = pixmap->drawable.pScreen; - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - GLenum format, type; - int no_alpha, revert, swap_rb; - glamor_pixmap_private *pixmap_priv; - Bool force_clip; - - if (glamor_get_tex_format_type_from_pixmap(pixmap, - pict_format, - &format, - &type, - &no_alpha, - &revert, &swap_rb, 1)) { - glamor_fallback("Unknown pixmap depth %d.\n", pixmap->drawable.depth); - return FALSE; + glamor_priv->suppress_gl_out_of_memory_logging = false; + if (glGetError() == GL_OUT_OF_MEMORY) { + ret = FALSE; } - if (glamor_pixmap_upload_prepare(pixmap, format, no_alpha, revert, swap_rb)) - return FALSE; - pixmap_priv = glamor_get_pixmap_private(pixmap); - force_clip = glamor_priv->gl_flavor != GLAMOR_GL_DESKTOP - && !glamor_check_fbo_size(glamor_priv, w, h); +fail: + if (converted_image) + pixman_image_unref(converted_image); - if (glamor_pixmap_priv_is_large(pixmap_priv) || force_clip) { - RegionRec region; - BoxRec box; - int n_region; - glamor_pixmap_clipped_regions *clipped_regions; - void *sub_bits; - int i, j; - - sub_bits = xallocarray(h, stride); - if (sub_bits == NULL) - return FALSE; - box.x1 = x; - box.y1 = y; - box.x2 = x + w; - box.y2 = y + h; - RegionInitBoxes(®ion, &box, 1); - if (!force_clip) - clipped_regions = - glamor_compute_clipped_regions(pixmap, ®ion, &n_region, - 0, 0, 0); - else - clipped_regions = - glamor_compute_clipped_regions_ext(pixmap, ®ion, - &n_region, - pixmap_priv->block_w, - pixmap_priv->block_h, - 0, - 0); - DEBUGF("prepare upload %dx%d to a large pixmap %p\n", w, h, pixmap); - for (i = 0; i < n_region; i++) { - BoxPtr boxes; - int nbox; - int temp_stride; - void *temp_bits; - - assert(pbo == 0); - - glamor_set_pixmap_fbo_current(pixmap_priv, clipped_regions[i].block_idx); - - boxes = RegionRects(clipped_regions[i].region); - nbox = RegionNumRects(clipped_regions[i].region); - DEBUGF("split to %d boxes\n", nbox); - for (j = 0; j < nbox; j++) { - temp_stride = PixmapBytePad(boxes[j].x2 - boxes[j].x1, - pixmap->drawable.depth); - - if (boxes[j].x1 == x && temp_stride == stride) { - temp_bits = (char *) bits + (boxes[j].y1 - y) * stride; - } - else { - temp_bits = sub_bits; - glamor_put_bits(temp_bits, temp_stride, bits, stride, - pixmap->drawable.bitsPerPixel, - boxes[j].x1 - x, boxes[j].y1 - y, - boxes[j].x2 - boxes[j].x1, - boxes[j].y2 - boxes[j].y1); - } - DEBUGF("upload x %d y %d w %d h %d temp stride %d \n", - boxes[j].x1 - x, boxes[j].y1 - y, - boxes[j].x2 - boxes[j].x1, - boxes[j].y2 - boxes[j].y1, temp_stride); - if (_glamor_upload_bits_to_pixmap_texture - (pixmap, format, type, no_alpha, revert, swap_rb, - boxes[j].x1, boxes[j].y1, boxes[j].x2 - boxes[j].x1, - boxes[j].y2 - boxes[j].y1, temp_stride, temp_bits, - pbo) == FALSE) { - RegionUninit(®ion); - free(sub_bits); - assert(0); - return FALSE; - } - } - RegionDestroy(clipped_regions[i].region); - } - free(sub_bits); - free(clipped_regions); - RegionUninit(®ion); - return TRUE; - } - else - return _glamor_upload_bits_to_pixmap_texture(pixmap, format, type, - no_alpha, revert, swap_rb, - x, y, w, h, stride, bits, - pbo); -} - -/* Upload picture to texture. We may need to flip the y axis or - * wire alpha to 1. So we may conditional create fbo for the picture. - * */ -enum glamor_pixmap_status -glamor_upload_picture_to_texture(PicturePtr picture) -{ - PixmapPtr pixmap; - - assert(picture->pDrawable); - pixmap = glamor_get_drawable_pixmap(picture->pDrawable); - - if (glamor_upload_sub_pixmap_to_texture(pixmap, 0, 0, - pixmap->drawable.width, - pixmap->drawable.height, - pixmap->devKind, - pixmap->devPrivate.ptr, 0, - picture->format)) - return GLAMOR_UPLOAD_DONE; - else - return GLAMOR_UPLOAD_FAILED; + return ret; } diff --git a/xserver/glamor/glamor_points.c b/xserver/glamor/glamor_points.c index facfe8240..faf6f433b 100644 --- a/xserver/glamor/glamor_points.c +++ b/xserver/glamor/glamor_points.c @@ -47,6 +47,7 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint GLshort *vbo_ppt; char *vbo_offset; int box_index; + Bool ret = FALSE; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) @@ -90,8 +91,9 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint int nbox = RegionNumRects(gc->pCompositeClip); BoxPtr box = RegionRects(gc->pCompositeClip); - glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE, - prog->matrix_uniform, &off_x, &off_y); + if (!glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE, + prog->matrix_uniform, &off_x, &off_y)) + goto bail; while (nbox--) { glScissor(box->x1 + off_x, @@ -103,13 +105,13 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint } } + ret = TRUE; + +bail: glDisable(GL_SCISSOR_TEST); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - return TRUE; - -bail: - return FALSE; + return ret; } void diff --git a/xserver/glamor/glamor_priv.h b/xserver/glamor/glamor_priv.h index 9d403977f..27f95521d 100644 --- a/xserver/glamor/glamor_priv.h +++ b/xserver/glamor/glamor_priv.h @@ -184,16 +184,7 @@ struct glamor_saved_procs { ScreenBlockHandlerProcPtr block_handler; }; -#define CACHE_FORMAT_COUNT 3 - -#define CACHE_BUCKET_WCOUNT 4 -#define CACHE_BUCKET_HCOUNT 4 - -#define GLAMOR_TICK_AFTER(t0, t1) \ - (((int)(t1) - (int)(t0)) < 0) - typedef struct glamor_screen_private { - unsigned int tick; enum glamor_gl_flavor gl_flavor; int glsl_version; Bool has_pack_invert; @@ -208,15 +199,13 @@ typedef struct glamor_screen_private { Bool use_quads; Bool has_vertex_array_object; Bool has_dual_blend; + Bool has_texture_swizzle; Bool is_core_profile; + Bool can_copyplane; int max_fbo_size; GLuint one_channel_format; - struct xorg_list - fbo_cache[CACHE_FORMAT_COUNT][CACHE_BUCKET_WCOUNT][CACHE_BUCKET_HCOUNT]; - unsigned long fbo_cache_watermark; - /* glamor point shader */ glamor_program point_prog; @@ -286,11 +275,6 @@ typedef struct glamor_screen_private { [glamor_program_alpha_count] [SHADER_DEST_SWIZZLE_COUNT]; - /* shaders to restore a texture to another texture. */ - GLint finish_access_prog[2]; - GLint finish_access_revert[2]; - GLint finish_access_swap_rb[2]; - /* glamor gradient, 0 for small nstops, 1 for large nstops and 2 for dynamic generate. */ GLint gradient_prog[SHADER_GRADIENT_COUNT][3]; @@ -330,21 +314,10 @@ enum glamor_fbo_state { }; typedef struct glamor_pixmap_fbo { - struct xorg_list list; /**< linked list pointers when in the fbo cache */ - /** glamor_priv->tick number when this FBO will be expired from the cache. */ - unsigned int expire; GLuint tex; /**< GL texture name */ GLuint fb; /**< GL FBO name */ int width; /**< width in pixels */ int height; /**< height in pixels */ - /** - * Flag for when texture contents might be shared with a - * non-glamor user. - * - * This is used to avoid putting textures used by other clients - * into the FBO cache. - */ - Bool external; GLenum format; /**< GL format used to create the texture. */ GLenum type; /**< GL type used to create the texture. */ } glamor_pixmap_fbo; @@ -514,22 +487,6 @@ glamor_pixmap_hcnt(glamor_pixmap_private *priv) for (box_index = 0; box_index < glamor_pixmap_hcnt(priv) * \ glamor_pixmap_wcnt(priv); box_index++) \ -/** - * Pixmap upload status, used by glamor_render.c's support for - * temporarily uploading pixmaps to GL textures to get a Composite - * operation done. - */ -typedef enum glamor_pixmap_status { - /** initial status, don't need to do anything. */ - GLAMOR_NONE, - /** marked as need to be uploaded to gl texture. */ - GLAMOR_UPLOAD_PENDING, - /** the pixmap has been uploaded successfully. */ - GLAMOR_UPLOAD_DONE, - /** fail to upload the pixmap. */ - GLAMOR_UPLOAD_FAILED -} glamor_pixmap_status_t; - /* GC private structure. Currently holds only any computed dash pixmap */ typedef struct { @@ -588,10 +545,7 @@ glamor_pixmap_fbo *glamor_create_fbo(glamor_screen_private *glamor_priv, int w, void glamor_destroy_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo); void glamor_pixmap_destroy_fbo(PixmapPtr pixmap); -void glamor_init_pixmap_fbo(ScreenPtr screen); -void glamor_fini_pixmap_fbo(ScreenPtr screen); Bool glamor_pixmap_fbo_fixup(ScreenPtr screen, PixmapPtr pixmap); -void glamor_fbo_expire(glamor_screen_private *glamor_priv); /* Return whether 'picture' is alpha-only */ static inline Bool glamor_picture_is_alpha(PicturePtr picture) @@ -630,8 +584,6 @@ void glamor_gldrawarrays_quads_using_indices(glamor_screen_private *glamor_priv, unsigned count); /* glamor_core.c */ -void glamor_init_finish_access_shaders(ScreenPtr screen); - Bool glamor_get_drawable_location(const DrawablePtr drawable); void glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, int *x, int *y); @@ -767,7 +719,7 @@ Bool glamor_composite_largepixmap_region(CARD8 op, * Upload a picture to gl texture. Similar to the * glamor_upload_pixmap_to_texture. Used in rendering. **/ -enum glamor_pixmap_status glamor_upload_picture_to_texture(PicturePtr picture); +Bool glamor_upload_picture_to_texture(PicturePtr picture); void glamor_add_traps(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap *traps); @@ -970,7 +922,6 @@ void glamor_xv_render(glamor_port_private *port_priv); #define GLAMOR_PIXMAP_DYNAMIC_UPLOAD #define GLAMOR_GRADIENT_SHADER #define GLAMOR_TEXTURED_LARGE_PIXMAP 1 -#define WALKAROUND_LARGE_TEXTURE_MAP #if 0 #define MAX_FBO_SIZE 32 /* For test purpose only. */ #endif diff --git a/xserver/glamor/glamor_program.c b/xserver/glamor/glamor_program.c index dec116c75..23c102bc3 100644 --- a/xserver/glamor/glamor_program.c +++ b/xserver/glamor/glamor_program.c @@ -122,8 +122,7 @@ static glamor_location_var location_vars[] = { .vs_vars = ("uniform vec2 fill_offset;\n" "uniform vec2 fill_size_inv;\n" "varying vec2 fill_pos;\n"), - .fs_vars = ("uniform vec2 fill_size_inv;\n" - "varying vec2 fill_pos;\n") + .fs_vars = ("varying vec2 fill_pos;\n") }, { .location = glamor_program_location_font, diff --git a/xserver/glamor/glamor_rects.c b/xserver/glamor/glamor_rects.c index e4473209d..cc029c8c0 100644 --- a/xserver/glamor/glamor_rects.c +++ b/xserver/glamor/glamor_rects.c @@ -52,6 +52,7 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, GLshort *v; char *vbo_offset; int box_index; + Bool ret = FALSE; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) @@ -115,8 +116,9 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, int nbox = RegionNumRects(gc->pCompositeClip); BoxPtr box = RegionRects(gc->pCompositeClip); - glamor_set_destination_drawable(drawable, box_index, TRUE, FALSE, - prog->matrix_uniform, &off_x, &off_y); + if (!glamor_set_destination_drawable(drawable, box_index, TRUE, FALSE, + prog->matrix_uniform, &off_x, &off_y)) + goto bail; while (nbox--) { glScissor(box->x1 + off_x, @@ -132,14 +134,15 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, } } + ret = TRUE; + +bail: glDisable(GL_SCISSOR_TEST); if (glamor_priv->glsl_version >= 130) glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - return TRUE; -bail: - return FALSE; + return ret; } static void diff --git a/xserver/glamor/glamor_render.c b/xserver/glamor/glamor_render.c index d70316d36..a8b208101 100644 --- a/xserver/glamor/glamor_render.c +++ b/xserver/glamor/glamor_render.c @@ -533,16 +533,8 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, repeat_type = picture->repeatType; switch (picture->repeatType) { case RepeatNone: - if (glamor_priv->gl_flavor != GLAMOR_GL_ES2) { - /* XXX GLES2 doesn't support GL_CLAMP_TO_BORDER. */ - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_BORDER); - } else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - } + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); break; case RepeatNormal: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); @@ -573,12 +565,12 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, break; } - /* - * GLES2 doesn't support RepeatNone. We need to fix it anyway. - * - **/ + /* Handle RepeatNone in the shader when the source is missing the + * alpha channel, as GL will return an alpha for 1 if the texture + * is RGB (no alpha), which we use for 16bpp textures. + */ if (glamor_pixmap_priv_is_large(pixmap_priv) || - ((!PICT_FORMAT_A(picture->format) || glamor_priv->gl_flavor == GLAMOR_GL_ES2) && + (!PICT_FORMAT_A(picture->format) && repeat_type == RepeatNone && picture->transform)) { glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap, pixmap_priv); glUniform4fv(wh_location, 1, wh); @@ -809,8 +801,8 @@ glamor_composite_choose_shader(CARD8 op, { ScreenPtr screen = dest->pDrawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - enum glamor_pixmap_status source_status = GLAMOR_NONE; - enum glamor_pixmap_status mask_status = GLAMOR_NONE; + Bool source_needs_upload = FALSE; + Bool mask_needs_upload = FALSE; PictFormatShort saved_source_format = 0; struct shader_key key; GLfloat source_solid_color[4]; @@ -868,7 +860,10 @@ glamor_composite_choose_shader(CARD8 op, goto fail; } else { - key.mask = SHADER_MASK_TEXTURE_ALPHA; + if (PICT_FORMAT_A(mask->format)) + key.mask = SHADER_MASK_TEXTURE_ALPHA; + else + key.mask = SHADER_MASK_TEXTURE; } if (!mask->componentAlpha) { @@ -921,7 +916,7 @@ glamor_composite_choose_shader(CARD8 op, } if (source_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) { #ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD - source_status = GLAMOR_UPLOAD_PENDING; + source_needs_upload = TRUE; #else glamor_fallback("no texture in source\n"); goto fail; @@ -937,7 +932,7 @@ glamor_composite_choose_shader(CARD8 op, } if (mask_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) { #ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD - mask_status = GLAMOR_UPLOAD_PENDING; + mask_needs_upload = TRUE; #else glamor_fallback("no texture in mask\n"); goto fail; @@ -946,8 +941,7 @@ glamor_composite_choose_shader(CARD8 op, } #ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD - if (source_status == GLAMOR_UPLOAD_PENDING - && mask_status == GLAMOR_UPLOAD_PENDING + if (source_needs_upload && mask_needs_upload && source_pixmap == mask_pixmap) { if (source->format != mask->format) { @@ -983,33 +977,29 @@ glamor_composite_choose_shader(CARD8 op, if (!PICT_FORMAT_A(mask->format) && PICT_FORMAT_A(saved_source_format)) key.mask = SHADER_MASK_TEXTURE; - - mask_status = GLAMOR_NONE; } - source_status = glamor_upload_picture_to_texture(source); - if (source_status != GLAMOR_UPLOAD_DONE) { + if (!glamor_upload_picture_to_texture(source)) { glamor_fallback("Failed to upload source texture.\n"); goto fail; } + mask_needs_upload = FALSE; } else { - if (source_status == GLAMOR_UPLOAD_PENDING) { - source_status = glamor_upload_picture_to_texture(source); - if (source_status != GLAMOR_UPLOAD_DONE) { + if (source_needs_upload) { + if (!glamor_upload_picture_to_texture(source)) { glamor_fallback("Failed to upload source texture.\n"); goto fail; } } else { - if (!glamor_render_format_is_supported(source->format)) { + if (source && !glamor_render_format_is_supported(source->format)) { glamor_fallback("Unsupported source picture format.\n"); goto fail; } } - if (mask_status == GLAMOR_UPLOAD_PENDING) { - mask_status = glamor_upload_picture_to_texture(mask); - if (mask_status != GLAMOR_UPLOAD_DONE) { + if (mask_needs_upload) { + if (!glamor_upload_picture_to_texture(mask)) { glamor_fallback("Failed to upload mask texture.\n"); goto fail; } @@ -1156,7 +1146,7 @@ glamor_composite_with_shader(CARD8 op, &key, &shader, &op_info, &saved_source_format, ca_state)) { glamor_fallback("glamor_composite_choose_shader failed\n"); - return ret; + goto fail; } if (ca_state == CA_TWO_PASS) { if (!glamor_composite_choose_shader(PictOpAdd, source, mask, dest, @@ -1166,7 +1156,7 @@ glamor_composite_with_shader(CARD8 op, &key_ca, &shader_ca, &op_info_ca, &saved_source_format, ca_state)) { glamor_fallback("glamor_composite_choose_shader failed\n"); - return ret; + goto fail; } } @@ -1298,6 +1288,13 @@ glamor_composite_with_shader(CARD8 op, source->format = saved_source_format; ret = TRUE; + +fail: + if (mask_pixmap && glamor_pixmap_is_memory(mask_pixmap)) + glamor_pixmap_destroy_fbo(mask_pixmap); + if (source_pixmap && glamor_pixmap_is_memory(source_pixmap)) + glamor_pixmap_destroy_fbo(source_pixmap); + return ret; } @@ -1337,11 +1334,6 @@ glamor_convert_gradient_picture(ScreenPtr screen, } if (dst) { -#if 0 /* Debug to compare it to pixman, Enable it if needed. */ - glamor_compare_pictures(screen, source, - dst, x_source, y_source, width, height, - 0, 3); -#endif return dst; } } @@ -1419,8 +1411,11 @@ glamor_composite_clipped_region(CARD8 op, x_source, y_source, x_mask, y_mask, x_dest, y_dest, width, height); /* Is the composite operation equivalent to a copy? */ - if (!mask && !source->alphaMap && !dest->alphaMap + if (source && + !mask && !source->alphaMap && !dest->alphaMap && source->pDrawable && !source->transform + /* CopyArea is only defined with matching depths. */ + && dest->pDrawable->depth == source->pDrawable->depth && ((op == PictOpSrc && (source->format == dest->format || (PICT_FORMAT_COLOR(dest->format) @@ -1479,7 +1474,7 @@ glamor_composite_clipped_region(CARD8 op, && (mask_pixmap->drawable.width != width || mask_pixmap->drawable.height != height)))) { /* XXX if mask->pDrawable is the same as source->pDrawable, we have an opportunity - * to do reduce one convertion. */ + * to do reduce one conversion. */ temp_mask = glamor_convert_gradient_picture(screen, mask, extent->x1 + x_mask - x_dest - dest->pDrawable->x, @@ -1500,6 +1495,10 @@ glamor_composite_clipped_region(CARD8 op, ca_state = CA_DUAL_BLEND; } else { if (op == PictOpOver) { + if (glamor_pixmap_is_memory(mask_pixmap)) { + glamor_fallback("two pass not supported on memory pximaps\n"); + goto out; + } ca_state = CA_TWO_PASS; op = PictOpOutReverse; } @@ -1710,12 +1709,12 @@ glamor_composite(CARD8 op, source, source->pDrawable, source->pDrawable ? source->pDrawable->width : 0, source->pDrawable ? source->pDrawable->height : 0, mask, - (!mask) ? NULL : mask->pDrawable, (!mask - || !mask->pDrawable) ? 0 : - mask->pDrawable->width, (!mask - || !mask->pDrawable) ? 0 : mask-> - pDrawable->height, glamor_get_picture_location(source), - glamor_get_picture_location(mask), dest, dest->pDrawable, + (!mask) ? NULL : mask->pDrawable, + (!mask || !mask->pDrawable) ? 0 : mask->pDrawable->width, + (!mask || !mask->pDrawable) ? 0 : mask->pDrawable->height, + glamor_get_picture_location(source), + glamor_get_picture_location(mask), + dest, dest->pDrawable, dest->pDrawable->width, dest->pDrawable->height, glamor_get_picture_location(dest)); diff --git a/xserver/glamor/glamor_segs.c b/xserver/glamor/glamor_segs.c index 5fffa3b0f..4dfa6553b 100644 --- a/xserver/glamor/glamor_segs.c +++ b/xserver/glamor/glamor_segs.c @@ -46,6 +46,7 @@ glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc, char *vbo_offset; int box_index; int add_last; + Bool ret = FALSE; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) @@ -62,7 +63,7 @@ glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc, &glamor_facet_poly_segment); if (!prog) - goto bail_ctx; + goto bail; /* Set up the vertex buffers for the points */ @@ -95,8 +96,9 @@ glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc, int nbox = RegionNumRects(gc->pCompositeClip); BoxPtr box = RegionRects(gc->pCompositeClip); - glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE, - prog->matrix_uniform, &off_x, &off_y); + if (!glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE, + prog->matrix_uniform, &off_x, &off_y)) + goto bail; while (nbox--) { glScissor(box->x1 + off_x, @@ -108,13 +110,13 @@ glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc, } } + ret = TRUE; + glDisable(GL_SCISSOR_TEST); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - return TRUE; -bail_ctx: bail: - return FALSE; + return ret; } static Bool diff --git a/xserver/glamor/glamor_spans.c b/xserver/glamor/glamor_spans.c index 5217d0434..b3c028d67 100644 --- a/xserver/glamor/glamor_spans.c +++ b/xserver/glamor/glamor_spans.c @@ -56,6 +56,7 @@ glamor_fill_spans_gl(DrawablePtr drawable, char *vbo_offset; int c; int box_index; + Bool ret = FALSE; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) @@ -123,8 +124,9 @@ glamor_fill_spans_gl(DrawablePtr drawable, int nbox = RegionNumRects(gc->pCompositeClip); BoxPtr box = RegionRects(gc->pCompositeClip); - glamor_set_destination_drawable(drawable, box_index, FALSE, FALSE, - prog->matrix_uniform, &off_x, &off_y); + if (!glamor_set_destination_drawable(drawable, box_index, FALSE, FALSE, + prog->matrix_uniform, &off_x, &off_y)) + goto bail; while (nbox--) { glScissor(box->x1 + off_x, @@ -135,19 +137,20 @@ glamor_fill_spans_gl(DrawablePtr drawable, if (glamor_priv->glsl_version >= 130) glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, n); else { - glamor_glDrawArrays_GL_QUADS(glamor_priv, nbox); + glamor_glDrawArrays_GL_QUADS(glamor_priv, n); } } } + ret = TRUE; + +bail: glDisable(GL_SCISSOR_TEST); if (glamor_priv->glsl_version >= 130) glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - return TRUE; -bail: - return FALSE; + return ret; } static void diff --git a/xserver/glamor/glamor_transform.c b/xserver/glamor/glamor_transform.c index eff500c6d..2d5a634a8 100644 --- a/xserver/glamor/glamor_transform.c +++ b/xserver/glamor/glamor_transform.c @@ -33,7 +33,7 @@ * clipping computations can be adjusted as appropriate */ -void +Bool glamor_set_destination_drawable(DrawablePtr drawable, int box_index, Bool do_drawable_translate, @@ -53,6 +53,11 @@ glamor_set_destination_drawable(DrawablePtr drawable, float scale_x = 2.0f / (float) w; float scale_y = 2.0f / (float) h; float center_adjust = 0.0f; + glamor_pixmap_fbo *pixmap_fbo; + + pixmap_fbo = glamor_pixmap_fbo_at(pixmap_priv, box_index); + if (!pixmap_fbo) + return FALSE; glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); @@ -94,8 +99,10 @@ glamor_set_destination_drawable(DrawablePtr drawable, scale_x, (off_x + center_adjust) * scale_x - 1.0f, scale_y, (off_y + center_adjust) * scale_y - 1.0f); - glamor_set_destination_pixmap_fbo(glamor_priv, glamor_pixmap_fbo_at(pixmap_priv, box_index), + glamor_set_destination_pixmap_fbo(glamor_priv, pixmap_fbo, 0, 0, w, h); + + return TRUE; } /* diff --git a/xserver/glamor/glamor_transform.h b/xserver/glamor/glamor_transform.h index 70d2c1671..28855e3d3 100644 --- a/xserver/glamor/glamor_transform.h +++ b/xserver/glamor/glamor_transform.h @@ -23,7 +23,7 @@ #ifndef _GLAMOR_TRANSFORM_H_ #define _GLAMOR_TRANSFORM_H_ -void +Bool glamor_set_destination_drawable(DrawablePtr drawable, int box_index, Bool do_drawable_translate, diff --git a/xserver/glamor/glamor_utils.h b/xserver/glamor/glamor_utils.h index 5128a33d8..a35917c37 100644 --- a/xserver/glamor/glamor_utils.h +++ b/xserver/glamor/glamor_utils.h @@ -334,21 +334,6 @@ DEBUGF("normalized tx %f ty %f \n", (texcoord)[0], (texcoord)[1]); \ } while(0) -#define glamor_set_transformed_normalize_tri_tcoords(priv, \ - matrix, \ - xscale, \ - yscale, \ - vtx, \ - texcoords) \ - do { \ - glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords, (vtx)[0], (vtx)[1]); \ - glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords+2, (vtx)[2], (vtx)[3]); \ - glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords+4, (vtx)[4], (vtx)[5]); \ - } while (0) - #define glamor_set_transformed_normalize_tcoords_ext( priv, \ matrix, \ xscale, \ @@ -367,38 +352,6 @@ texcoords + 3 * stride, tx1, ty2); \ } while (0) -#define glamor_set_transformed_normalize_tcoords( priv, \ - matrix, \ - xscale, \ - yscale, \ - tx1, ty1, tx2, ty2, \ - texcoords) \ - do { \ - glamor_set_transformed_normalize_tcoords_ext( priv, \ - matrix, \ - xscale, \ - yscale, \ - tx1, ty1, tx2, ty2, \ - texcoords, \ - 2); \ - } while (0) - -#define glamor_set_normalize_tri_tcoords(xscale, \ - yscale, \ - vtx, \ - texcoords) \ - do { \ - _glamor_set_normalize_tpoint(xscale, yscale, \ - (vtx)[0], (vtx)[1], \ - texcoords); \ - _glamor_set_normalize_tpoint(xscale, yscale, \ - (vtx)[2], (vtx)[3], \ - texcoords+2); \ - _glamor_set_normalize_tpoint(xscale, yscale, \ - (vtx)[4], (vtx)[5], \ - texcoords+4); \ - } while (0) - #define glamor_set_repeat_transformed_normalize_tcoords_ext(pixmap, priv, \ repeat_type, \ matrix, \ @@ -508,15 +461,6 @@ x2, y2, vertices, stride); \ } while(0) -#define glamor_set_normalize_tcoords(priv, xscale, yscale, \ - x1, y1, x2, y2, \ - vertices) \ - do { \ - glamor_set_normalize_tcoords_ext(priv, xscale, yscale, \ - x1, y1, x2, y2, \ - vertices, 2); \ - } while(0) - #define glamor_set_repeat_normalize_tcoords_ext(pixmap, priv, repeat_type, \ xscale, yscale, \ _x1_, _y1_, _x2_, _y2_, \ @@ -543,17 +487,6 @@ stride); \ } while(0) -#define glamor_set_repeat_normalize_tcoords(priv, repeat_type, \ - xscale, yscale, \ - _x1_, _y1_, _x2_, _y2_, \ - vertices) \ - do { \ - glamor_set_repeat_normalize_tcoords_ext(priv, repeat_type, \ - xscale, yscale, \ - _x1_, _y1_, _x2_, _y2_, \ - vertices, 2); \ - } while(0) - #define glamor_set_normalize_tcoords_tri_stripe(xscale, yscale, \ x1, y1, x2, y2, \ vertices) \ @@ -568,51 +501,6 @@ (vertices)[5] = (vertices)[7]; \ } while(0) -#define glamor_set_tcoords(x1, y1, x2, y2, vertices) \ - do { \ - (vertices)[0] = (x1); \ - (vertices)[2] = (x2); \ - (vertices)[4] = (vertices)[2]; \ - (vertices)[6] = (vertices)[0]; \ - (vertices)[1] = (y1); \ - (vertices)[5] = (y2); \ - (vertices)[3] = (vertices)[1]; \ - (vertices)[7] = (vertices)[5]; \ - } while(0) - -#define glamor_set_tcoords_ext(x1, y1, x2, y2, vertices, stride) \ - do { \ - (vertices)[0] = (x1); \ - (vertices)[1*stride] = (x2); \ - (vertices)[2*stride] = (vertices)[1*stride]; \ - (vertices)[3*stride] = (vertices)[0]; \ - (vertices)[1] = (y1); \ - (vertices)[2*stride + 1] = (y2); \ - (vertices)[1*stride + 1] = (vertices)[1]; \ - (vertices)[3*stride + 1] = (vertices)[2*stride + 1]; \ - } while(0) - -#define glamor_set_normalize_one_vcoord(xscale, yscale, x, y, \ - vertices) \ - do { \ - (vertices)[0] = v_from_x_coord_x(xscale, x); \ - (vertices)[1] = v_from_x_coord_y(yscale, y); \ - } while(0) - -#define glamor_set_normalize_tri_vcoords(xscale, yscale, vtx, \ - vertices) \ - do { \ - glamor_set_normalize_one_vcoord(xscale, yscale, \ - (vtx)[0], (vtx)[1], \ - vertices); \ - glamor_set_normalize_one_vcoord(xscale, yscale, \ - (vtx)[2], (vtx)[3], \ - vertices+2); \ - glamor_set_normalize_one_vcoord(xscale, yscale, \ - (vtx)[4], (vtx)[5], \ - vertices+4); \ - } while(0) - #define glamor_set_tcoords_tri_strip(x1, y1, x2, y2, vertices) \ do { \ (vertices)[0] = (x1); \ @@ -646,25 +534,6 @@ (vertices)[3 * stride + 1] = _t5_; \ } while(0) -#define glamor_set_normalize_vcoords(priv, xscale, yscale, \ - x1, y1, x2, y2, \ - vertices) \ - do { \ - glamor_set_normalize_vcoords_ext(priv, xscale, yscale, \ - x1, y1, x2, y2, \ - vertices, 2); \ - } while(0) - -#define glamor_set_const_ext(params, nparam, vertices, nverts, stride) \ - do { \ - int _i_ = 0, _j_ = 0; \ - for(; _i_ < nverts; _i_++) { \ - for(_j_ = 0; _j_ < nparam; _j_++) { \ - vertices[stride*_i_ + _j_] = params[_j_]; \ - } \ - } \ - } while(0) - #define glamor_set_normalize_vcoords_tri_strip(xscale, yscale, \ x1, y1, x2, y2, \ vertices) \ @@ -767,17 +636,8 @@ format_for_pixmap(PixmapPtr pixmap) #define REVERT_NONE 0 #define REVERT_NORMAL 1 -#define REVERT_DOWNLOADING_A1 2 #define REVERT_UPLOADING_A1 3 -#define REVERT_DOWNLOADING_2_10_10_10 4 -#define REVERT_UPLOADING_2_10_10_10 5 -#define REVERT_DOWNLOADING_1_5_5_5 7 -#define REVERT_UPLOADING_1_5_5_5 8 -#define REVERT_DOWNLOADING_10_10_10_2 9 -#define REVERT_UPLOADING_10_10_10_2 10 -#define SWAP_NONE_DOWNLOADING 0 -#define SWAP_DOWNLOADING 1 #define SWAP_UPLOADING 2 #define SWAP_NONE_UPLOADING 3 @@ -860,430 +720,11 @@ glamor_is_large_pixmap(PixmapPtr pixmap) return (glamor_pixmap_priv_is_large(priv)); } -static inline void -_glamor_dump_pixmap_bits(PixmapPtr pixmap, int x, int y, int w, int h) -{ - int i, j; - unsigned char *p = (pixmap)->devPrivate.ptr; - int stride = (pixmap)->devKind; - - p = p + y * stride + x; - - for (i = 0; i < h; i++) { - ErrorF("line %3d: ", i); - for (j = 0; j < w; j++) - ErrorF("%2d ", (p[j / 8] & (1 << (j % 8))) >> (j % 8)); - p += stride; - ErrorF("\n"); - } -} - -static inline void -_glamor_dump_pixmap_byte(PixmapPtr pixmap, int x, int y, int w, int h) -{ - int i, j; - unsigned char *p = (pixmap)->devPrivate.ptr; - int stride = (pixmap)->devKind; - - p = p + y * stride + x; - - for (i = 0; i < h; i++) { - ErrorF("line %3d: ", i); - for (j = 0; j < w; j++) - ErrorF("%2x ", p[j]); - p += stride; - ErrorF("\n"); - } -} - -static inline void -_glamor_dump_pixmap_sword(PixmapPtr pixmap, int x, int y, int w, int h) -{ - int i, j; - unsigned short *p = (pixmap)->devPrivate.ptr; - int stride = (pixmap)->devKind / 2; - - p = p + y * stride + x; - - for (i = 0; i < h; i++) { - ErrorF("line %3d: ", i); - for (j = 0; j < w; j++) - ErrorF("%2x ", p[j]); - p += stride; - ErrorF("\n"); - } -} - -static inline void -_glamor_dump_pixmap_word(PixmapPtr pixmap, int x, int y, int w, int h) -{ - int i, j; - unsigned int *p = (pixmap)->devPrivate.ptr; - int stride = (pixmap)->devKind / 4; - - p = p + y * stride + x; - - for (i = 0; i < h; i++) { - ErrorF("line %3d: ", i); - for (j = 0; j < w; j++) - ErrorF("%2x ", p[j]); - p += stride; - ErrorF("\n"); - } -} - -static inline void -glamor_dump_pixmap(PixmapPtr pixmap, int x, int y, int w, int h) -{ - w = ((x + w) > (pixmap)->drawable.width) ? ((pixmap)->drawable.width - x) : w; - h = ((y + h) > (pixmap)->drawable.height) ? ((pixmap)->drawable.height - y) : h; - - glamor_prepare_access(&(pixmap)->drawable, GLAMOR_ACCESS_RO); - switch ((pixmap)->drawable.depth) { - case 8: - _glamor_dump_pixmap_byte(pixmap, x, y, w, h); - break; - case 15: - case 16: - _glamor_dump_pixmap_sword(pixmap, x, y, w, h); - break; - - case 24: - case 32: - _glamor_dump_pixmap_word(pixmap, x, y, w, h); - break; - case 1: - _glamor_dump_pixmap_bits(pixmap, x, y, w, h); - break; - default: - ErrorF("dump depth %d, not implemented.\n", (pixmap)->drawable.depth); - } - glamor_finish_access(&(pixmap)->drawable); -} - -static inline void -_glamor_compare_pixmaps(PixmapPtr pixmap1, PixmapPtr pixmap2, - int x, int y, int w, int h, - PictFormatShort short_format, int all, int diffs) -{ - int i, j; - unsigned char *p1 = pixmap1->devPrivate.ptr; - unsigned char *p2 = pixmap2->devPrivate.ptr; - int line_need_printed = 0; - int test_code = 0xAABBCCDD; - int little_endian = 0; - unsigned char *p_test; - int bpp = pixmap1->drawable.depth == 8 ? 1 : 4; - int stride = pixmap1->devKind; - - assert(pixmap1->devKind == pixmap2->devKind); - - ErrorF("stride:%d, width:%d, height:%d\n", stride, w, h); - - p1 = p1 + y * stride + x; - p2 = p2 + y * stride + x; - - if (all) { - for (i = 0; i < h; i++) { - ErrorF("line %3d: ", i); - - for (j = 0; j < stride; j++) { - if (j % bpp == 0) - ErrorF("[%d]%2x:%2x ", j / bpp, p1[j], p2[j]); - else - ErrorF("%2x:%2x ", p1[j], p2[j]); - } - - p1 += stride; - p2 += stride; - ErrorF("\n"); - } - } - else { - if (short_format == PICT_a8r8g8b8) { - p_test = (unsigned char *) &test_code; - little_endian = (*p_test == 0xDD); - bpp = 4; - - for (i = 0; i < h; i++) { - line_need_printed = 0; - - for (j = 0; j < stride; j++) { - if (p1[j] != p2[j] && - (p1[j] - p2[j] > diffs || p2[j] - p1[j] > diffs)) { - if (line_need_printed) { - if (little_endian) { - switch (j % 4) { - case 2: - ErrorF("[%d]RED:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 1: - ErrorF("[%d]GREEN:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 0: - ErrorF("[%d]BLUE:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 3: - ErrorF("[%d]Alpha:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - } - } - else { - switch (j % 4) { - case 1: - ErrorF("[%d]RED:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 2: - ErrorF("[%d]GREEN:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 3: - ErrorF("[%d]BLUE:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - case 0: - ErrorF("[%d]Alpha:%2x:%2x ", j / bpp, p1[j], - p2[j]); - break; - } - } - } - else { - line_need_printed = 1; - j = -1; - ErrorF("line %3d: ", i); - continue; - } - } - } - - p1 += stride; - p2 += stride; - ErrorF("\n"); - } - } //more format can be added here. - else { // the default format, just print. - for (i = 0; i < h; i++) { - line_need_printed = 0; - - for (j = 0; j < stride; j++) { - if (p1[j] != p2[j]) { - if (line_need_printed) { - ErrorF("[%d]%2x:%2x ", j / bpp, p1[j], p2[j]); - } - else { - line_need_printed = 1; - j = -1; - ErrorF("line %3d: ", i); - continue; - } - } - } - - p1 += stride; - p2 += stride; - ErrorF("\n"); - } - } - } -} - -static inline void -glamor_compare_pixmaps(PixmapPtr pixmap1, PixmapPtr pixmap2, - int x, int y, int w, int h, int all, int diffs) -{ - assert(pixmap1->drawable.depth == pixmap2->drawable.depth); - - if (glamor_prepare_access(&pixmap1->drawable, GLAMOR_ACCESS_RO) && - glamor_prepare_access(&pixmap2->drawable, GLAMOR_ACCESS_RO)) { - _glamor_compare_pixmaps(pixmap1, pixmap2, x, y, w, h, -1, all, diffs); - } - glamor_finish_access(&pixmap1->drawable); - glamor_finish_access(&pixmap2->drawable); -} - -/* This function is used to compare two pictures. - If the picture has no drawable, we use fb functions to generate it. */ -static inline void -glamor_compare_pictures(ScreenPtr screen, - PicturePtr fst_picture, - PicturePtr snd_picture, - int x_source, int y_source, - int width, int height, int all, int diffs) -{ - PixmapPtr fst_pixmap; - PixmapPtr snd_pixmap; - int fst_generated, snd_generated; - int error; - int fst_type = -1; - int snd_type = -1; // -1 represent has drawable. - - if (fst_picture->format != snd_picture->format) { - ErrorF("Different picture format can not compare!\n"); - return; - } - - if (!fst_picture->pDrawable) { - fst_type = fst_picture->pSourcePict->type; - } - - if (!snd_picture->pDrawable) { - snd_type = snd_picture->pSourcePict->type; - } - - if ((fst_type != -1) && (snd_type != -1) && (fst_type != snd_type)) { - ErrorF("Different picture type will never be same!\n"); - return; - } - - fst_generated = snd_generated = 0; - - if (!fst_picture->pDrawable) { - PicturePtr pixman_pic; - PixmapPtr pixmap = NULL; - PictFormatShort format; - - format = fst_picture->format; - - pixmap = glamor_create_pixmap(screen, - width, height, - PIXMAN_FORMAT_DEPTH(format), - GLAMOR_CREATE_PIXMAP_CPU); - - pixman_pic = CreatePicture(0, - &(pixmap)->drawable, - PictureMatchFormat(screen, - PIXMAN_FORMAT_DEPTH - (format), format), 0, 0, - serverClient, &error); - - fbComposite(PictOpSrc, fst_picture, NULL, pixman_pic, - x_source, y_source, 0, 0, 0, 0, width, height); - - glamor_destroy_pixmap(pixmap); - - fst_picture = pixman_pic; - fst_generated = 1; - } - - if (!snd_picture->pDrawable) { - PicturePtr pixman_pic; - PixmapPtr pixmap = NULL; - PictFormatShort format; - - format = snd_picture->format; - - pixmap = glamor_create_pixmap(screen, - width, height, - PIXMAN_FORMAT_DEPTH(format), - GLAMOR_CREATE_PIXMAP_CPU); - - pixman_pic = CreatePicture(0, - &(pixmap)->drawable, - PictureMatchFormat(screen, - PIXMAN_FORMAT_DEPTH - (format), format), 0, 0, - serverClient, &error); - - fbComposite(PictOpSrc, snd_picture, NULL, pixman_pic, - x_source, y_source, 0, 0, 0, 0, width, height); - - glamor_destroy_pixmap(pixmap); - - snd_picture = pixman_pic; - snd_generated = 1; - } - - fst_pixmap = glamor_get_drawable_pixmap(fst_picture->pDrawable); - snd_pixmap = glamor_get_drawable_pixmap(snd_picture->pDrawable); - - if (fst_pixmap->drawable.depth != snd_pixmap->drawable.depth) { - if (fst_generated) - miDestroyPicture(fst_picture); - if (snd_generated) - miDestroyPicture(snd_picture); - - ErrorF("Different pixmap depth can not compare!\n"); - return; - } - - if ((fst_type == SourcePictTypeLinear) || - (fst_type == SourcePictTypeRadial) || - (fst_type == SourcePictTypeConical) || - (snd_type == SourcePictTypeLinear) || - (snd_type == SourcePictTypeRadial) || - (snd_type == SourcePictTypeConical)) { - x_source = y_source = 0; - } - - if (glamor_prepare_access(&fst_pixmap->drawable, GLAMOR_ACCESS_RO) && - glamor_prepare_access(&snd_pixmap->drawable, GLAMOR_ACCESS_RO)) { - _glamor_compare_pixmaps(fst_pixmap, snd_pixmap, - x_source, y_source, - width, height, fst_picture->format, - all, diffs); - } - glamor_finish_access(&fst_pixmap->drawable); - glamor_finish_access(&snd_pixmap->drawable); - - if (fst_generated) - miDestroyPicture(fst_picture); - if (snd_generated) - miDestroyPicture(snd_picture); - - return; -} - -#ifdef __i386__ -static inline unsigned long -__fls(unsigned long x) -{ - asm("bsr %1,%0":"=r"(x) - : "rm"(x)); - return x; -} -#else -static inline unsigned long -__fls(unsigned long x) -{ - int n; - - if (x == 0) - return (0); - n = 0; - if (x <= 0x0000FFFF) { - n = n + 16; - x = x << 16; - } - if (x <= 0x00FFFFFF) { - n = n + 8; - x = x << 8; - } - if (x <= 0x0FFFFFFF) { - n = n + 4; - x = x << 4; - } - if (x <= 0x3FFFFFFF) { - n = n + 2; - x = x << 2; - } - if (x <= 0x7FFFFFFF) { - n = n + 1; - } - return 31 - n; -} -#endif - static inline void glamor_make_current(glamor_screen_private *glamor_priv) { - if (lastGLContext != &glamor_priv->ctx) { - lastGLContext = &glamor_priv->ctx; + if (lastGLContext != glamor_priv->ctx.ctx) { + lastGLContext = glamor_priv->ctx.ctx; glamor_priv->ctx.make_current(&glamor_priv->ctx); } } diff --git a/xserver/glamor/glamor_xv.c b/xserver/glamor/glamor_xv.c index 3bcf909b0..31320d124 100644 --- a/xserver/glamor/glamor_xv.c +++ b/xserver/glamor/glamor_xv.c @@ -430,11 +430,14 @@ glamor_xv_put_image(glamor_port_private *port_priv, glamor_destroy_pixmap(port_priv->src_pix[i]); port_priv->src_pix[0] = - glamor_create_pixmap(pScreen, width, height, 8, 0); + glamor_create_pixmap(pScreen, width, height, 8, + GLAMOR_CREATE_FBO_NO_FBO); port_priv->src_pix[1] = - glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, 0); + glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, + GLAMOR_CREATE_FBO_NO_FBO); port_priv->src_pix[2] = - glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, 0); + glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, + GLAMOR_CREATE_FBO_NO_FBO); port_priv->src_pix_w = width; port_priv->src_pix_h = height; diff --git a/xserver/glx/Makefile.am b/xserver/glx/Makefile.am index 54e81406d..699de63b8 100644 --- a/xserver/glx/Makefile.am +++ b/xserver/glx/Makefile.am @@ -1,4 +1,4 @@ -if AIGLX_DRI_LOADER +if DRI2 GLXDRI_LIBRARY = libglxdri.la endif @@ -20,13 +20,10 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/hw/xfree86/os-support/bus \ -I$(top_srcdir)/hw/xfree86/common \ -I$(top_srcdir)/hw/xfree86/dri \ + -I$(top_srcdir)/hw/xfree86/dri2 \ -I$(top_srcdir)/mi \ -I$(top_srcdir)/present -if DRI2_AIGLX -AM_CPPFLAGS += -I$(top_srcdir)/hw/xfree86/dri2 -endif - indirect_sources = \ indirect_dispatch.c \ indirect_dispatch.h \ @@ -39,8 +36,7 @@ indirect_sources = \ indirect_table.c libglxdri_la_SOURCES = - -if DRI2_AIGLX +if DRI2 libglxdri_la_SOURCES += glxdri2.c endif diff --git a/xserver/glx/Makefile.in b/xserver/glx/Makefile.in index d1babfec7..5f4239d93 100644 --- a/xserver/glx/Makefile.in +++ b/xserver/glx/Makefile.in @@ -50,16 +50,16 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@DRI2_AIGLX_TRUE@am__append_1 = -I$(top_srcdir)/hw/xfree86/dri2 -@DRI2_AIGLX_TRUE@am__append_2 = glxdri2.c +@DRI2_TRUE@am__append_1 = glxdri2.c subdir = glx DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -92,10 +92,10 @@ am__v_lt_0 = --silent am__v_lt_1 = libglxdri_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__libglxdri_la_SOURCES_DIST = glxdri2.c -@DRI2_AIGLX_TRUE@am__objects_2 = glxdri2.lo +@DRI2_TRUE@am__objects_2 = glxdri2.lo am_libglxdri_la_OBJECTS = $(am__objects_2) libglxdri_la_OBJECTS = $(am_libglxdri_la_OBJECTS) -@AIGLX_DRI_LOADER_TRUE@am_libglxdri_la_rpath = +@DRI2_TRUE@am_libglxdri_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -315,6 +315,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -345,7 +348,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -440,6 +446,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -487,7 +494,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@AIGLX_DRI_LOADER_TRUE@GLXDRI_LIBRARY = libglxdri.la +@DRI2_TRUE@GLXDRI_LIBRARY = libglxdri.la noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY) AM_CFLAGS = \ @DIX_CFLAGS@ \ @@ -500,11 +507,15 @@ AM_CFLAGS = \ # none yet #sdk_HEADERS = -AM_CPPFLAGS = -I$(top_srcdir)/hw/xfree86/os-support \ +AM_CPPFLAGS = \ + -I$(top_srcdir)/hw/xfree86/os-support \ -I$(top_srcdir)/hw/xfree86/os-support/bus \ -I$(top_srcdir)/hw/xfree86/common \ - -I$(top_srcdir)/hw/xfree86/dri -I$(top_srcdir)/mi \ - -I$(top_srcdir)/present $(am__append_1) + -I$(top_srcdir)/hw/xfree86/dri \ + -I$(top_srcdir)/hw/xfree86/dri2 \ + -I$(top_srcdir)/mi \ + -I$(top_srcdir)/present + indirect_sources = \ indirect_dispatch.c \ indirect_dispatch.h \ @@ -516,7 +527,7 @@ indirect_sources = \ indirect_size_get.h \ indirect_table.c -libglxdri_la_SOURCES = $(am__append_2) +libglxdri_la_SOURCES = $(am__append_1) libglxdri_la_LIBADD = $(DLOPEN_LIBS) libglx_la_SOURCES = \ $(indirect_sources) \ diff --git a/xserver/glx/createcontext.c b/xserver/glx/createcontext.c index 9157e2fb8..c8b36ebb0 100644 --- a/xserver/glx/createcontext.c +++ b/xserver/glx/createcontext.c @@ -315,16 +315,8 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) ctx->id = req->context; ctx->share_id = req->shareList; ctx->idExists = True; - ctx->currentClient = False; ctx->isDirect = req->isDirect; - ctx->hasUnflushedCommands = False; ctx->renderMode = GL_RENDER; - ctx->feedbackBuf = NULL; - ctx->feedbackBufSize = 0; - ctx->selectBuf = NULL; - ctx->selectBufSize = 0; - ctx->drawPriv = NULL; - ctx->readPriv = NULL; ctx->resetNotificationStrategy = reset; #ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB ctx->releaseBehavior = flush; diff --git a/xserver/glx/extension_string.c b/xserver/glx/extension_string.c index 616c7932e..d1da4815c 100644 --- a/xserver/glx/extension_string.c +++ b/xserver/glx/extension_string.c @@ -85,14 +85,15 @@ static const struct extension_info known_glx_extensions[] = { { GLX(EXT_fbconfig_packed_float), VER(0,0), N, }, { GLX(EXT_framebuffer_sRGB), VER(0,0), N, }, { GLX(EXT_import_context), VER(0,0), Y, }, + { GLX(EXT_libglvnd), VER(0,0), N, }, { GLX(EXT_stereo_tree), VER(0,0), N, }, - { GLX(EXT_texture_from_pixmap), VER(0,0), Y, }, + { GLX(EXT_texture_from_pixmap), VER(0,0), N, }, { GLX(EXT_visual_info), VER(0,0), Y, }, { GLX(EXT_visual_rating), VER(0,0), Y, }, { GLX(MESA_copy_sub_buffer), VER(0,0), N, }, { GLX(OML_swap_method), VER(0,0), Y, }, - { GLX(SGI_make_current_read), VER(1,3), N, }, + { GLX(SGI_make_current_read), VER(1,3), Y, }, { GLX(SGI_swap_control), VER(0,0), N, }, { GLX(SGIS_multisample), VER(0,0), Y, }, { GLX(SGIX_fbconfig), VER(1,3), Y, }, diff --git a/xserver/glx/extension_string.h b/xserver/glx/extension_string.h index 425a8058b..a10d7108a 100644 --- a/xserver/glx/extension_string.h +++ b/xserver/glx/extension_string.h @@ -47,6 +47,7 @@ enum { EXT_create_context_es2_profile_bit, EXT_fbconfig_packed_float_bit, EXT_import_context_bit, + EXT_libglvnd_bit, EXT_stereo_tree_bit, EXT_texture_from_pixmap_bit, EXT_visual_info_bit, diff --git a/xserver/glx/glxcmds.c b/xserver/glx/glxcmds.c index 561faebb4..5873cb49c 100644 --- a/xserver/glx/glxcmds.c +++ b/xserver/glx/glxcmds.c @@ -45,6 +45,7 @@ #include "indirect_dispatch.h" #include "indirect_table.h" #include "indirect_util.h" +#include "protocol-versions.h" static char GLXServerVendorName[] = "SGI"; @@ -145,7 +146,7 @@ validGlxContext(ClientPtr client, XID id, int access_mode, return TRUE; } -static int +int validGlxDrawable(ClientPtr client, XID id, int type, int access_mode, __GLXdrawable ** drawable, int *err) { @@ -313,16 +314,8 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId, glxc->id = gcId; glxc->share_id = shareList; glxc->idExists = GL_TRUE; - glxc->currentClient = NULL; glxc->isDirect = isDirect; - glxc->hasUnflushedCommands = GL_FALSE; glxc->renderMode = GL_RENDER; - glxc->feedbackBuf = NULL; - glxc->feedbackBufSize = 0; - glxc->selectBuf = NULL; - glxc->selectBufSize = 0; - glxc->drawPriv = NULL; - glxc->readPriv = NULL; /* The GLX_ARB_create_context_robustness spec says: * @@ -643,10 +636,9 @@ DoMakeCurrent(__GLXclientState * cl, if (prevglxc->releaseBehavior == GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB) need_flush = GL_FALSE; #endif - if (prevglxc->hasUnflushedCommands && need_flush) { + if (need_flush) { if (__glXForceCurrent(cl, tag, (int *) &error)) { glFlush(); - prevglxc->hasUnflushedCommands = GL_FALSE; } else { return error; @@ -797,8 +789,8 @@ __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc) .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, - .majorVersion = glxMajorVersion, - .minorVersion = glxMinorVersion + .majorVersion = SERVER_GLX_MAJOR_VERSION, + .minorVersion = SERVER_GLX_MINOR_VERSION }; if (client->swapped) { @@ -929,7 +921,6 @@ __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc) ** in both streams are completed before the copy is executed. */ glFinish(); - tagcx->hasUnflushedCommands = GL_FALSE; } else { return error; @@ -1113,7 +1104,10 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen) WRITE_PAIR(GLX_VISUAL_ID, modes->visualID); WRITE_PAIR(GLX_FBCONFIG_ID, modes->fbconfigID); - WRITE_PAIR(GLX_X_RENDERABLE, GL_TRUE); + WRITE_PAIR(GLX_X_RENDERABLE, + (modes->drawableType & (GLX_WINDOW_BIT | GLX_PIXMAP_BIT) + ? GL_TRUE + : GL_FALSE)); WRITE_PAIR(GLX_RGBA, (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE); @@ -1703,7 +1697,6 @@ __glXDisp_SwapBuffers(__GLXclientState * cl, GLbyte * pc) ** in both streams are completed before the swap is executed. */ glFinish(); - glxc->hasUnflushedCommands = GL_FALSE; } else { return error; @@ -1900,7 +1893,6 @@ __glXDisp_CopySubBufferMESA(__GLXclientState * cl, GLbyte * pc) ** in both streams are completed before the swap is executed. */ glFinish(); - glxc->hasUnflushedCommands = GL_FALSE; } else { return error; @@ -2123,7 +2115,6 @@ __glXDisp_Render(__GLXclientState * cl, GLbyte * pc) left -= cmdlen; commandsDone++; } - glxc->hasUnflushedCommands = GL_TRUE; return Success; } @@ -2334,7 +2325,6 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) ** Skip over the header and execute the command. */ (*proc) (cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE); - glxc->hasUnflushedCommands = GL_TRUE; /* ** Reset for the next RenderLarge series. @@ -2443,6 +2433,10 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) return Success; } +#ifndef GLX_VENDOR_NAMES_EXT +#define GLX_VENDOR_NAMES_EXT 0x20F6 +#endif + int __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc) { @@ -2454,7 +2448,6 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc) char *buf; __GLXscreen *pGlxScreen; int err; - char ver_str[16]; REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); @@ -2466,15 +2459,17 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc) ptr = GLXServerVendorName; break; case GLX_VERSION: - /* Return to the server version rather than the screen version - * to prevent confusion when they do not match. - */ - snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion); - ptr = ver_str; + ptr = "1.4"; break; case GLX_EXTENSIONS: ptr = pGlxScreen->GLXextensions; break; + case GLX_VENDOR_NAMES_EXT: + if (pGlxScreen->glvnd) { + ptr = pGlxScreen->glvnd; + break; + } + /* else fall through */ default: return BadValue; } diff --git a/xserver/glx/glxcontext.h b/xserver/glx/glxcontext.h index 0733281d7..edbd491ff 100644 --- a/xserver/glx/glxcontext.h +++ b/xserver/glx/glxcontext.h @@ -93,11 +93,6 @@ struct __GLXcontext { */ GLboolean isDirect; - /* - ** This flag keeps track of whether there are unflushed GL commands. - */ - GLboolean hasUnflushedCommands; - /* ** Current rendering mode for this context. */ diff --git a/xserver/glx/glxdrawable.h b/xserver/glx/glxdrawable.h index 007658961..441d72dd7 100644 --- a/xserver/glx/glxdrawable.h +++ b/xserver/glx/glxdrawable.h @@ -74,4 +74,7 @@ struct __GLXdrawable { unsigned long eventMask; }; +extern int validGlxDrawable(ClientPtr client, XID id, int type, int access_mode, + __GLXdrawable **drawable, int *err); + #endif /* !__GLX_drawable_h__ */ diff --git a/xserver/glx/glxdri2.c b/xserver/glx/glxdri2.c index 58e60b976..484b4aeab 100644 --- a/xserver/glx/glxdri2.c +++ b/xserver/glx/glxdri2.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include @@ -40,7 +39,6 @@ #include #define _XF86DRI_SERVER_ -#include #include #include @@ -75,8 +73,6 @@ struct __GLXDRIscreen { const __DRIswapControlExtension *swapControl; const __DRItexBufferExtension *texBuffer; const __DRIconfig **driConfigs; - - unsigned char glx_enable_bits[__GLX_EXT_BYTES]; }; struct __GLXDRIcontext { @@ -99,21 +95,6 @@ struct __GLXDRIdrawable { XID dri2_id; }; -static void -__glXDRIdrawableDestroy(__GLXdrawable * drawable) -{ - __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; - const __DRIcoreExtension *core = private->screen->core; - - FreeResource(private->dri2_id, FALSE); - - (*core->destroyDrawable) (private->driDrawable); - - __glXDrawableRelease(drawable); - - free(private); -} - static void copy_box(__GLXdrawable * drawable, int dst, int src, @@ -136,6 +117,24 @@ copy_box(__GLXdrawable * drawable, } } +/* white lie */ +extern glx_func_ptr glXGetProcAddressARB(const char *); + +static void +__glXDRIdrawableDestroy(__GLXdrawable * drawable) +{ + __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; + const __DRIcoreExtension *core = private->screen->core; + + FreeResource(private->dri2_id, FALSE); + + (*core->destroyDrawable) (private->driDrawable); + + __glXDrawableRelease(drawable); + + free(private); +} + static void __glXDRIdrawableCopySubBuffer(__GLXdrawable * drawable, int x, int y, int w, int h) @@ -296,7 +295,7 @@ __glXDRIcontextWait(__GLXcontext * baseContext, } if (ret) { - *error = cl->client->noClientException; + *error = -1; return TRUE; } @@ -341,32 +340,6 @@ static __GLXtextureFromPixmap __glXDRItextureFromPixmap = { __glXDRIreleaseTexImage }; -static void -__glXDRIscreenDestroy(__GLXscreen * baseScreen) -{ - int i; - - ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen); - __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; - - (*screen->core->destroyScreen) (screen->driScreen); - - dlclose(screen->driver); - - __glXScreenDestroy(baseScreen); - - if (screen->driConfigs) { - for (i = 0; screen->driConfigs[i] != NULL; i++) - free((__DRIconfig **) screen->driConfigs[i]); - free(screen->driConfigs); - } - - pScrn->EnterVT = screen->enterVT; - pScrn->LeaveVT = screen->leaveVT; - - free(screen); -} - static Bool dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, const uint32_t *attribs, @@ -779,8 +752,11 @@ dri2GetBuffersWithFormat(__DRIdrawable * driDrawable, static void dri2FlushFrontBuffer(__DRIdrawable * driDrawable, void *loaderPrivate) { + __GLXDRIdrawable *private = (__GLXDRIdrawable *) loaderPrivate; (void) driDrawable; - __glXDRIdrawableWaitGL((__GLXdrawable *) loaderPrivate); + + copy_box(loaderPrivate, DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft, + 0, 0, private->width, private->height); } static const __DRIdri2LoaderExtension loaderExtension = { @@ -847,18 +823,19 @@ glxDRILeaveVT(ScrnInfoPtr scrn) * @param screen The screen where glx_enable_bits are to be set. */ static void -initializeExtensions(__GLXDRIscreen * screen) +initializeExtensions(__GLXscreen * screen) { - ScreenPtr pScreen = screen->base.pScreen; + ScreenPtr pScreen = screen->pScreen; + __GLXDRIscreen *dri = (__GLXDRIscreen *)screen; const __DRIextension **extensions; int i; - extensions = screen->core->getExtensions(screen->driScreen); + extensions = dri->core->getExtensions(dri->driScreen); __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer"); LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); - if (screen->dri2->base.version >= 3) { + if (dri->dri2->base.version >= 3) { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); __glXEnableExtension(screen->glx_enable_bits, @@ -876,10 +853,8 @@ initializeExtensions(__GLXDRIscreen * screen) if (DRI2HasSwapControl(pScreen)) { __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event"); __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_swap_control"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_swap_control"); LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n"); - LogMessage(X_INFO, - "AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n"); + LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_swap_control\n"); } /* enable EXT_framebuffer_sRGB extension (even if there are no sRGB capable fbconfigs) */ @@ -902,27 +877,21 @@ initializeExtensions(__GLXDRIscreen * screen) } for (i = 0; extensions[i]; i++) { - if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) { - __glXEnableExtension(screen->glx_enable_bits, - "GLX_SGI_make_current_read"); - - LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n"); - } - if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { - screen->texBuffer = (const __DRItexBufferExtension *) extensions[i]; - /* GLX_EXT_texture_from_pixmap is always enabled. */ + dri->texBuffer = (const __DRItexBufferExtension *) extensions[i]; + __glXEnableExtension(screen->glx_enable_bits, + "GLX_EXT_texture_from_pixmap"); LogMessage(X_INFO, "AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n"); } if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 && extensions[i]->version >= 3) { - screen->flush = (__DRI2flushExtension *) extensions[i]; + dri->flush = (__DRI2flushExtension *) extensions[i]; } if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0 && - screen->dri2->base.version >= 3) { + dri->dri2->base.version >= 3) { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_robustness"); LogMessage(X_INFO, @@ -940,16 +909,49 @@ initializeExtensions(__GLXDRIscreen * screen) } } -/* white lie */ -extern glx_func_ptr glXGetProcAddressARB(const char *); +static void +__glXDRIscreenDestroy(__GLXscreen * baseScreen) +{ + int i; + + ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen); + __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; + + (*screen->core->destroyScreen) (screen->driScreen); + + dlclose(screen->driver); + + __glXScreenDestroy(baseScreen); + + if (screen->driConfigs) { + for (i = 0; screen->driConfigs[i] != NULL; i++) + free((__DRIconfig **) screen->driConfigs[i]); + free(screen->driConfigs); + } + + pScrn->EnterVT = screen->enterVT; + pScrn->LeaveVT = screen->leaveVT; + + free(screen); +} + +enum { + GLXOPT_VENDOR_LIBRARY, +}; + +static const OptionInfoRec GLXOptions[] = { + { GLXOPT_VENDOR_LIBRARY, "GlxVendorLibrary", OPTV_STRING, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE }, +}; static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName, *deviceName; __GLXDRIscreen *screen; - size_t buffer_size; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + const char *glvnd = NULL; + OptionInfoPtr options; screen = calloc(1, sizeof *screen); if (screen == NULL) @@ -968,7 +970,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->base.swapInterval = __glXDRIdrawableSwapInterval; screen->base.pScreen = pScreen; - __glXInitExtensionEnableBits(screen->glx_enable_bits); + __glXInitExtensionEnableBits(screen->base.glx_enable_bits); screen->driver = glxProbeDriver(driverName, (void **) &screen->core, __DRI_CORE, 1, @@ -988,40 +990,24 @@ __glXDRIscreenProbe(ScreenPtr pScreen) goto handle_error; } - initializeExtensions(screen); + initializeExtensions(&screen->base); - screen->base.fbconfigs = glxConvertConfigs(screen->core, screen->driConfigs, - GLX_WINDOW_BIT | - GLX_PIXMAP_BIT | - GLX_PBUFFER_BIT); + screen->base.fbconfigs = glxConvertConfigs(screen->core, + screen->driConfigs); + + options = xnfalloc(sizeof(GLXOptions)); + memcpy(options, GLXOptions, sizeof(GLXOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); + glvnd = xf86GetOptValString(options, GLXOPT_VENDOR_LIBRARY); + if (glvnd) + screen->base.glvnd = xnfstrdup(glvnd); + free(options); + + if (!screen->base.glvnd) + screen->base.glvnd = strdup("mesa"); __glXScreenInit(&screen->base, pScreen); - /* The first call simply determines the length of the extension string. - * This allows us to allocate some memory to hold the extension string, - * but it requires that we call __glXGetExtensionString a second time. - */ - buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); - if (buffer_size > 0) { - free(screen->base.GLXextensions); - - screen->base.GLXextensions = xnfalloc(buffer_size); - (void) __glXGetExtensionString(screen->glx_enable_bits, - screen->base.GLXextensions); - } - - /* We're going to assume (perhaps incorrectly?) that all DRI2-enabled - * drivers support the required extensions for GLX 1.4. The extensions - * we're assuming are: - * - * - GLX_SGI_make_current_read (1.3) - * - GLX_SGIX_fbconfig (1.3) - * - GLX_SGIX_pbuffer (1.3) - * - GLX_ARB_multisample (1.4) - */ - screen->base.GLXmajor = 1; - screen->base.GLXminor = 4; - screen->enterVT = pScrn->EnterVT; pScrn->EnterVT = glxDRIEnterVT; screen->leaveVT = pScrn->LeaveVT; diff --git a/xserver/glx/glxdricommon.c b/xserver/glx/glxdricommon.c index 62cce131d..f6c6fcdf2 100644 --- a/xserver/glx/glxdricommon.c +++ b/xserver/glx/glxdricommon.c @@ -122,14 +122,28 @@ setScalar(__GLXconfig * config, unsigned int attrib, unsigned int value) } } +static Bool +render_type_is_pbuffer_only(unsigned renderType) +{ + /* The GL_ARB_color_buffer_float spec says: + * + * "Note that floating point rendering is only supported for + * GLXPbuffer drawables. The GLX_DRAWABLE_TYPE attribute of the + * GLXFBConfig must have the GLX_PBUFFER_BIT bit set and the + * GLX_RENDER_TYPE attribute must have the GLX_RGBA_FLOAT_BIT set." + */ + return !!(renderType & (__DRI_ATTRIB_UNSIGNED_FLOAT_BIT + | __DRI_ATTRIB_FLOAT_BIT)); +} + static __GLXconfig * createModeFromConfig(const __DRIcoreExtension * core, const __DRIconfig * driConfig, - unsigned int visualType, unsigned int drawableType) + unsigned int visualType) { __GLXDRIconfig *config; GLint renderType = 0; - unsigned int attrib, value; + unsigned int attrib, value, drawableType = GLX_PBUFFER_BIT; int i; config = calloc(1, sizeof *config); @@ -173,8 +187,10 @@ createModeFromConfig(const __DRIcoreExtension * core, } } + if (!render_type_is_pbuffer_only(renderType)) + drawableType |= GLX_WINDOW_BIT | GLX_PIXMAP_BIT; + config->config.next = NULL; - config->config.xRenderable = GL_TRUE; config->config.visualType = visualType; config->config.renderType = renderType; config->config.drawableType = drawableType; @@ -183,23 +199,9 @@ createModeFromConfig(const __DRIcoreExtension * core, return &config->config; } -static Bool -render_type_is_pbuffer_only(unsigned renderType) -{ - /* The GL_ARB_color_buffer_float spec says: - * - * "Note that floating point rendering is only supported for - * GLXPbuffer drawables. The GLX_DRAWABLE_TYPE attribute of the - * GLXFBConfig must have the GLX_PBUFFER_BIT bit set and the - * GLX_RENDER_TYPE attribute must have the GLX_RGBA_FLOAT_BIT set." - */ - return !!(renderType & (__DRI_ATTRIB_UNSIGNED_FLOAT_BIT - | __DRI_ATTRIB_FLOAT_BIT)); -} - __GLXconfig * glxConvertConfigs(const __DRIcoreExtension * core, - const __DRIconfig ** configs, unsigned int drawableType) + const __DRIconfig ** configs) { __GLXconfig head, *tail; int i; @@ -208,17 +210,7 @@ glxConvertConfigs(const __DRIcoreExtension * core, head.next = NULL; for (i = 0; configs[i]; i++) { - unsigned renderType = 0; - if (core->getConfigAttrib(configs[i], __DRI_ATTRIB_RENDER_TYPE, - &renderType)) { - if (render_type_is_pbuffer_only(renderType) && - !(drawableType & GLX_PBUFFER_BIT)) - continue; - } - /* Add all the others */ - tail->next = createModeFromConfig(core, - configs[i], GLX_TRUE_COLOR, - drawableType); + tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR); if (tail->next == NULL) break; @@ -226,17 +218,7 @@ glxConvertConfigs(const __DRIcoreExtension * core, } for (i = 0; configs[i]; i++) { - unsigned int renderType = 0; - if (core->getConfigAttrib(configs[i], __DRI_ATTRIB_RENDER_TYPE, - &renderType)) { - if (render_type_is_pbuffer_only(renderType) && - !(drawableType & GLX_PBUFFER_BIT)) - continue; - } - /* Add all the others */ - tail->next = createModeFromConfig(core, - configs[i], GLX_DIRECT_COLOR, - drawableType); + tail->next = createModeFromConfig(core, configs[i], GLX_DIRECT_COLOR); if (tail->next == NULL) break; diff --git a/xserver/glx/glxdricommon.h b/xserver/glx/glxdricommon.h index f4fcf009e..2db46dc07 100644 --- a/xserver/glx/glxdricommon.h +++ b/xserver/glx/glxdricommon.h @@ -33,8 +33,7 @@ struct __GLXDRIconfig { }; __GLXconfig *glxConvertConfigs(const __DRIcoreExtension * core, - const __DRIconfig ** configs, - unsigned int drawableType); + const __DRIconfig ** configs); extern const __DRIsystemTimeExtension systemTimeExtension; diff --git a/xserver/glx/glxdriswrast.c b/xserver/glx/glxdriswrast.c index 924067c79..ed0469fd6 100644 --- a/xserver/glx/glxdriswrast.c +++ b/xserver/glx/glxdriswrast.c @@ -89,6 +89,9 @@ struct __GLXDRIdrawable { GCPtr swapgc; /* GC for swapping the color buffers */ }; +/* white lie */ +extern glx_func_ptr glXGetProcAddressARB(const char *); + static void __glXDRIdrawableDestroy(__GLXdrawable * drawable) { @@ -210,28 +213,6 @@ static __GLXtextureFromPixmap __glXDRItextureFromPixmap = { __glXDRIreleaseTexImage }; -static void -__glXDRIscreenDestroy(__GLXscreen * baseScreen) -{ - int i; - - __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; - - (*screen->core->destroyScreen) (screen->driScreen); - - dlclose(screen->driver); - - __glXScreenDestroy(baseScreen); - - if (screen->driConfigs) { - for (i = 0; screen->driConfigs[i] != NULL; i++) - free((__DRIconfig **) screen->driConfigs[i]); - free(screen->driConfigs); - } - - free(screen); -} - static __GLXcontext * __glXDRIscreenCreateContext(__GLXscreen * baseScreen, __GLXconfig * glxConfig, @@ -391,15 +372,16 @@ static const __DRIextension *loader_extensions[] = { }; static void -initializeExtensions(__GLXDRIscreen * screen) +initializeExtensions(__GLXscreen * screen) { const __DRIextension **extensions; + __GLXDRIscreen *dri = (__GLXDRIscreen *)screen; int i; __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer"); - LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); + LogMessage(X_INFO, "IGLX: enabled GLX_MESA_copy_sub_buffer\n"); - if (screen->swrast->base.version >= 3) { + if (dri->swrast->base.version >= 3) { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); __glXEnableExtension(screen->glx_enable_bits, @@ -414,19 +396,18 @@ initializeExtensions(__GLXDRIscreen * screen) __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_framebuffer_sRGB"); __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_fbconfig_float"); __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_fbconfig_packed_float"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_make_current_read"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_texture_from_pixmap"); - extensions = screen->core->getExtensions(screen->driScreen); + extensions = dri->core->getExtensions(dri->driScreen); for (i = 0; extensions[i]; i++) { if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) { - screen->copySubBuffer = + dri->copySubBuffer = (const __DRIcopySubBufferExtension *) extensions[i]; } if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { - screen->texBuffer = (const __DRItexBufferExtension *) extensions[i]; - /* GLX_EXT_texture_from_pixmap is always enabled. */ + dri->texBuffer = (const __DRItexBufferExtension *) extensions[i]; } #ifdef __DRI2_FLUSH_CONTROL @@ -439,15 +420,33 @@ initializeExtensions(__GLXDRIscreen * screen) } } -/* white lie */ -extern glx_func_ptr glXGetProcAddressARB(const char *); +static void +__glXDRIscreenDestroy(__GLXscreen * baseScreen) +{ + int i; + + __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; + + (*screen->core->destroyScreen) (screen->driScreen); + + dlclose(screen->driver); + + __glXScreenDestroy(baseScreen); + + if (screen->driConfigs) { + for (i = 0; screen->driConfigs[i] != NULL; i++) + free((__DRIconfig **) screen->driConfigs[i]); + free(screen->driConfigs); + } + + free(screen); +} static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName = "swrast"; __GLXDRIscreen *screen; - size_t buffer_size; screen = calloc(1, sizeof *screen); if (screen == NULL) @@ -459,7 +458,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->base.swapInterval = NULL; screen->base.pScreen = pScreen; - __glXInitExtensionEnableBits(screen->glx_enable_bits); + __glXInitExtensionEnableBits(screen->base.glx_enable_bits); screen->driver = glxProbeDriver(driverName, (void **) &screen->core, @@ -476,38 +475,23 @@ __glXDRIscreenProbe(ScreenPtr pScreen) &screen->driConfigs, screen); if (screen->driScreen == NULL) { - LogMessage(X_ERROR, "AIGLX error: Calling driver entry point failed\n"); + LogMessage(X_ERROR, "IGLX error: Calling driver entry point failed\n"); goto handle_error; } - initializeExtensions(screen); + initializeExtensions(&screen->base); - screen->base.fbconfigs = glxConvertConfigs(screen->core, screen->driConfigs, - GLX_WINDOW_BIT | - GLX_PIXMAP_BIT | - GLX_PBUFFER_BIT); + screen->base.fbconfigs = glxConvertConfigs(screen->core, + screen->driConfigs); +#if !defined(XQUARTZ) && !defined(WIN32) + screen->base.glvnd = strdup("mesa"); +#endif __glXScreenInit(&screen->base, pScreen); - /* The first call simply determines the length of the extension string. - * This allows us to allocate some memory to hold the extension string, - * but it requires that we call __glXGetExtensionString a second time. - */ - buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); - if (buffer_size > 0) { - free(screen->base.GLXextensions); - - screen->base.GLXextensions = xnfalloc(buffer_size); - (void) __glXGetExtensionString(screen->glx_enable_bits, - screen->base.GLXextensions); - } - - screen->base.GLXmajor = 1; - screen->base.GLXminor = 4; - __glXsetGetProcAddress(glXGetProcAddressARB); - LogMessage(X_INFO, "AIGLX: Loaded and initialized %s\n", driverName); + LogMessage(X_INFO, "IGLX: Loaded and initialized %s\n", driverName); return &screen->base; diff --git a/xserver/glx/glxext.c b/xserver/glx/glxext.c index c201fba86..d595a05cb 100644 --- a/xserver/glx/glxext.c +++ b/xserver/glx/glxext.c @@ -136,7 +136,6 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid) (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { /* flush the context */ glFlush(); - c->hasUnflushedCommands = GL_FALSE; /* just force a re-bind the next time through */ (*c->loseCurrent) (c); lastGLContext = NULL; @@ -337,6 +336,23 @@ checkScreenVisuals(void) return False; } +static void +GetGLXDrawableBytes(void *value, XID id, ResourceSizePtr size) +{ + __GLXdrawable *draw = value; + + size->resourceSize = 0; + size->pixmapRefSize = 0; + size->refCnt = 1; + + if (draw->type == GLX_DRAWABLE_PIXMAP) { + SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); + ResourceSizeRec pixmapSize = { 0, }; + pixmapSizeFunc((PixmapPtr)draw->pDraw, draw->pDraw->id, &pixmapSize); + size->pixmapRefSize += pixmapSize.pixmapRefSize; + } +} + /* ** Initialize the GLX extension. */ @@ -366,6 +382,8 @@ GlxExtensionInit(void) if (!__glXContextRes || !__glXDrawableRes) return; + SetResourceTypeSizeFunc(__glXDrawableRes, GetGLXDrawableBytes); + if (!dixRegisterPrivateKey (&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState))) return; @@ -380,8 +398,6 @@ GlxExtensionInit(void) glxScreen = p->screenProbe(pScreen); if (glxScreen != NULL) { - if (glxScreen->GLXminor < glxMinorVersion) - glxMinorVersion = glxScreen->GLXminor; LogMessage(X_INFO, "GLX: Initialized %s GL provider for screen %d\n", p->name, i); diff --git a/xserver/glx/glxscreens.c b/xserver/glx/glxscreens.c index b0ad3b7bc..536c0c495 100644 --- a/xserver/glx/glxscreens.c +++ b/xserver/glx/glxscreens.c @@ -154,27 +154,6 @@ static const char GLServerExtensions[] = "GL_SGIX_shadow_ambient " "GL_SUN_slice_accum "; -/* -** We have made the simplifying assuption that the same extensions are -** supported across all screens in a multi-screen system. -*/ -unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION; -unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION; -static char GLXServerExtensions[] = - "GLX_ARB_multisample " - "GLX_EXT_visual_info " - "GLX_EXT_visual_rating " - "GLX_EXT_import_context " - "GLX_EXT_texture_from_pixmap " - "GLX_OML_swap_method " - "GLX_SGI_make_current_read " -#ifndef __APPLE__ - "GLX_SGIS_multisample " -#endif - "GLX_SGIX_fbconfig " - "GLX_SGIX_pbuffer " - "GLX_MESA_copy_sub_buffer "; - static Bool glxCloseScreen(ScreenPtr pScreen) { @@ -329,16 +308,7 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) pGlxScreen->pScreen = pScreen; pGlxScreen->GLextensions = strdup(GLServerExtensions); - pGlxScreen->GLXextensions = strdup(GLXServerExtensions); - - /* All GLX providers must support all of the functionality required for at - * least GLX 1.2. If the provider supports a higher version, the GLXminor - * version can be changed in the provider's screen-probe routine. For - * most providers, the screen-probe routine is the caller of this - * function. - */ - pGlxScreen->GLXmajor = 1; - pGlxScreen->GLXminor = 2; + pGlxScreen->GLXextensions = NULL; pGlxScreen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = glxCloseScreen; @@ -413,11 +383,23 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) } dixSetPrivate(&pScreen->devPrivates, glxScreenPrivateKey, pGlxScreen); + + if (pGlxScreen->glvnd) + __glXEnableExtension(pGlxScreen->glx_enable_bits, "GLX_EXT_libglvnd"); + + i = __glXGetExtensionString(pGlxScreen->glx_enable_bits, NULL); + if (i > 0) { + pGlxScreen->GLXextensions = xnfalloc(i); + (void) __glXGetExtensionString(pGlxScreen->glx_enable_bits, + pGlxScreen->GLXextensions); + } + } void __glXScreenDestroy(__GLXscreen * screen) { + free(screen->glvnd); free(screen->GLXextensions); free(screen->GLextensions); free(screen->visuals); diff --git a/xserver/glx/glxscreens.h b/xserver/glx/glxscreens.h index a90587732..0f9a2b9af 100644 --- a/xserver/glx/glxscreens.h +++ b/xserver/glx/glxscreens.h @@ -35,6 +35,8 @@ * Silicon Graphics, Inc. */ +#include "extension_string.h" + typedef struct __GLXconfig __GLXconfig; struct __GLXconfig { __GLXconfig *next; @@ -76,7 +78,6 @@ struct __GLXconfig { /* SGIX_fbconfig / GLX 1.3 */ GLint drawableType; GLint renderType; - GLint xRenderable; GLint fbconfigID; /* SGIX_pbuffer / GLX 1.3 */ @@ -140,19 +141,9 @@ struct __GLXscreen { GLint numVisuals; char *GLextensions; - char *GLXextensions; - - /** - * \name GLX version supported by this screen. - * - * Since the GLX version advertised by the server is for the whole server, - * the GLX protocol code uses the minimum version supported on all screens. - */ - /*@{ */ - unsigned GLXmajor; - unsigned GLXminor; - /*@} */ + char *glvnd; + unsigned char glx_enable_bits[__GLX_EXT_BYTES]; Bool (*CloseScreen) (ScreenPtr pScreen); }; diff --git a/xserver/glx/single2.c b/xserver/glx/single2.c index acc66ac07..62dcd79ef 100644 --- a/xserver/glx/single2.c +++ b/xserver/glx/single2.c @@ -71,7 +71,6 @@ __glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc) cx->feedbackBufSize = size; } glFeedbackBuffer(size, type, cx->feedbackBuf); - cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -102,7 +101,6 @@ __glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc) cx->selectBufSize = size; } glSelectBuffer(size, cx->selectBuf); - cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -225,7 +223,6 @@ __glXDisp_Flush(__GLXclientState * cl, GLbyte * pc) } glFlush(); - cx->hasUnflushedCommands = GL_FALSE; return Success; } @@ -245,7 +242,6 @@ __glXDisp_Finish(__GLXclientState * cl, GLbyte * pc) /* Do a local glFinish */ glFinish(); - cx->hasUnflushedCommands = GL_FALSE; /* Send empty reply packet to indicate finish is finished */ client = cl->client; diff --git a/xserver/glx/single2swap.c b/xserver/glx/single2swap.c index d5bb1c03c..c1df248e8 100644 --- a/xserver/glx/single2swap.c +++ b/xserver/glx/single2swap.c @@ -72,7 +72,6 @@ __glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc) cx->feedbackBufSize = size; } glFeedbackBuffer(size, type, cx->feedbackBuf); - cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -107,7 +106,6 @@ __glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc) cx->selectBufSize = size; } glSelectBuffer(size, cx->selectBuf); - cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -245,7 +243,6 @@ __glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc) } glFlush(); - cx->hasUnflushedCommands = GL_FALSE; return Success; } @@ -268,7 +265,6 @@ __glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc) /* Do a local glFinish */ glFinish(); - cx->hasUnflushedCommands = GL_FALSE; /* Send empty reply packet to indicate finish is finished */ __GLX_BEGIN_REPLY(0); diff --git a/xserver/glx/singlepix.c b/xserver/glx/singlepix.c index 54ed7fd21..b253a59be 100644 --- a/xserver/glx/singlepix.c +++ b/xserver/glx/singlepix.c @@ -86,7 +86,6 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc) __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } - cx->hasUnflushedCommands = GL_FALSE; return Success; } diff --git a/xserver/glx/singlepixswap.c b/xserver/glx/singlepixswap.c index 9eff5923d..684f4e834 100644 --- a/xserver/glx/singlepixswap.c +++ b/xserver/glx/singlepixswap.c @@ -98,7 +98,6 @@ __glXDispSwap_ReadPixels(__GLXclientState * cl, GLbyte * pc) __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } - cx->hasUnflushedCommands = GL_FALSE; return Success; } diff --git a/xserver/hw/Makefile.in b/xserver/hw/Makefile.in index ad9308075..08e7a32aa 100644 --- a/xserver/hw/Makefile.in +++ b/xserver/hw/Makefile.in @@ -53,9 +53,10 @@ subdir = hw DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -303,6 +304,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -333,7 +337,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -428,6 +435,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/dmx/Makefile.in b/xserver/hw/dmx/Makefile.in index 83b5380f6..0a487b13a 100644 --- a/xserver/hw/dmx/Makefile.in +++ b/xserver/hw/dmx/Makefile.in @@ -57,9 +57,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -363,6 +364,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -393,7 +397,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -497,6 +504,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/dmx/config/Makefile.in b/xserver/hw/dmx/config/Makefile.in index 92951802e..85b57a30a 100644 --- a/xserver/hw/dmx/config/Makefile.in +++ b/xserver/hw/dmx/config/Makefile.in @@ -58,9 +58,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ parser.h scanner.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -380,6 +381,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -410,7 +414,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -505,6 +512,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/dmx/config/man/Makefile.in b/xserver/hw/dmx/config/man/Makefile.in index 3c10a27ba..ddffcc578 100644 --- a/xserver/hw/dmx/config/man/Makefile.in +++ b/xserver/hw/dmx/config/man/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/dmx/config/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -313,6 +314,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -343,7 +347,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -438,6 +445,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/dmx/dmxfont.c b/xserver/hw/dmx/dmxfont.c index 25a04a6f0..addfa6abf 100644 --- a/xserver/hw/dmx/dmxfont.c +++ b/xserver/hw/dmx/dmxfont.c @@ -46,6 +46,7 @@ #include "dmxlog.h" #include +#include #include "dixfont.h" #include "dixstruct.h" @@ -447,7 +448,7 @@ dmxRealizeFont(ScreenPtr pScreen, FontPtr pFont) dmxFontPrivPtr pFontPriv; if (!(pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex))) { - FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); + xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL); pFontPriv = malloc(sizeof(dmxFontPrivRec)); if (!pFontPriv) return FALSE; @@ -460,7 +461,7 @@ dmxRealizeFont(ScreenPtr pScreen, FontPtr pFont) pFontPriv->refcnt = 0; } - FontSetPrivate(pFont, dmxFontPrivateIndex, (void *) pFontPriv); + xfont2_font_set_private(pFont, dmxFontPrivateIndex, (void *) pFontPriv); if (dmxScreen->beDisplay) { if (!dmxBELoadFont(pScreen, pFont)) @@ -504,7 +505,7 @@ dmxUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) if (!pFontPriv->refcnt) { MAXSCREENSFREE(pFontPriv->font); free(pFontPriv); - FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); + xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL); } else if (pFontPriv->font[pScreen->myNum]) { if (dmxScreen->beDisplay) @@ -563,7 +564,7 @@ dmxUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) ) { MAXSCREENSFREE(pFontPriv->font); free(pFontPriv); - FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); + xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL); } } } diff --git a/xserver/hw/dmx/dmxinit.c b/xserver/hw/dmx/dmxinit.c index 3d394c52b..24bb875fb 100644 --- a/xserver/hw/dmx/dmxinit.c +++ b/xserver/hw/dmx/dmxinit.c @@ -532,63 +532,6 @@ dmxDisplayInit(DMXScreenInfo * dmxScreen) dmxGetPixmapFormats(dmxScreen); } -/* If this doesn't compile, just add || defined(yoursystem) to the line - * below. This information is to help with bug reports and is not - * critical. */ -#if !defined(_POSIX_SOURCE) -static const char * -dmxExecOS(void) -{ - return ""; -} -#else -#include -static const char * -dmxExecOS(void) -{ - static char buffer[128]; - static int initialized = 0; - struct utsname u; - - if (!initialized++) { - memset(buffer, 0, sizeof(buffer)); - uname(&u); - snprintf(buffer, sizeof(buffer) - 1, "%s %s %s", - u.sysname, u.release, u.version); - } - return buffer; -} -#endif - -static const char * -dmxBuildCompiler(void) -{ - static char buffer[128]; - static int initialized = 0; - - if (!initialized++) { - memset(buffer, 0, sizeof(buffer)); -#if defined(__GNUC__) && defined(__GNUC_MINOR__) &&defined(__GNUC_PATCHLEVEL__) - snprintf(buffer, sizeof(buffer) - 1, "gcc %d.%d.%d", - __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); -#endif - } - return buffer; -} - -static const char * -dmxExecHost(void) -{ - static char buffer[128]; - static int initialized = 0; - - if (!initialized++) { - memset(buffer, 0, sizeof(buffer)); - XmuGetHostname(buffer, sizeof(buffer) - 1); - } - return buffer; -} - static void dmxAddExtensions(Bool glxSupported) { const ExtensionModule dmxExtensions[] = { @@ -641,12 +584,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) SetVendorRelease(VENDOR_RELEASE); SetVendorString(VENDOR_STRING); - if (dmxGeneration == 1) { - dmxLog(dmxInfo, "DMX Build OS: %s (%s)\n", OSNAME, OSVENDOR); - dmxLog(dmxInfo, "DMX Build Compiler: %s\n", dmxBuildCompiler()); - dmxLog(dmxInfo, "DMX Execution OS: %s\n", dmxExecOS()); - dmxLog(dmxInfo, "DMX Execution Host: %s\n", dmxExecHost()); - } dmxLog(dmxInfo, "MAXSCREENS: %d\n", MAXSCREENS); for (i = 0; i < dmxNumScreens; i++) { diff --git a/xserver/hw/dmx/dmxinput.c b/xserver/hw/dmx/dmxinput.c index 4ccb43903..d201034c6 100644 --- a/xserver/hw/dmx/dmxinput.c +++ b/xserver/hw/dmx/dmxinput.c @@ -123,3 +123,8 @@ void DeleteInputDeviceRequest(DeviceIntPtr pDev) { } + +void +RemoveInputDeviceTraces(const char *config_info) +{ +} diff --git a/xserver/hw/dmx/dmxinput.h b/xserver/hw/dmx/dmxinput.h index 83c9c8b95..210fd7ad0 100644 --- a/xserver/hw/dmx/dmxinput.h +++ b/xserver/hw/dmx/dmxinput.h @@ -47,9 +47,6 @@ #ifndef DMXINPUT_H #define DMXINPUT_H -/** Maximum number of file descriptors for SIGIO handling */ -#define DMX_MAX_SIGIO_FDS 4 - struct _DMXInputInfo; /** Reason why window layout was updated. */ @@ -69,15 +66,6 @@ typedef void (*UpdateWindowInfoProc) (struct _DMXInputInfo *, /** An opaque structure that is only exposed in the dmx/input layer. */ typedef struct _DMXLocalInputInfo *DMXLocalInputInfoPtr; -/** State of the SIGIO engine */ -typedef enum { - DMX_NOSIGIO = 0, /**< Device does not use SIGIO at all. */ - DMX_USESIGIO, /**< Device can use SIGIO, but is not - * (e.g., because the VT is switch - * away). */ - DMX_ACTIVESIGIO /**< Device is currently using SIGIO. */ -} dmxSigioState; - /** DMXInputInfo is typedef'd in \a dmx.h so that all routines can have * access to the global pointers. However, the elements are only * available to input-related routines. */ @@ -102,12 +90,6 @@ struct _DMXInputInfo { ProcessInputEventsProc processInputEvents; UpdateWindowInfoProc updateWindowInfo; - /* Local input information */ - dmxSigioState sigioState; /**< Current stat */ - int sigioFdCount; /**< Number of fds in use */ - int sigioFd[DMX_MAX_SIGIO_FDS]; /**< List of fds */ - Bool sigioAdded[DMX_MAX_SIGIO_FDS]; /**< Active fds */ - /** True if a VT switch is pending, but has not yet happened. */ int vt_switch_pending; diff --git a/xserver/hw/dmx/dmxscrinit.c b/xserver/hw/dmx/dmxscrinit.c index 097418d05..e441dceef 100644 --- a/xserver/hw/dmx/dmxscrinit.c +++ b/xserver/hw/dmx/dmxscrinit.c @@ -58,6 +58,8 @@ #include "mipointer.h" #include "micmap.h" +#include + extern Bool dmxCloseScreen(ScreenPtr pScreen); static Bool dmxSaveScreen(ScreenPtr pScreen, int what); @@ -187,7 +189,7 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[]) if (dmxGeneration != serverGeneration) { /* Allocate font private index */ - dmxFontPrivateIndex = AllocateFontPrivateIndex(); + dmxFontPrivateIndex = xfont2_allocate_font_private_index(); if (dmxFontPrivateIndex == -1) return FALSE; diff --git a/xserver/hw/dmx/dmxsync.c b/xserver/hw/dmx/dmxsync.c index 81dbbc64d..b55c9ddf3 100644 --- a/xserver/hw/dmx/dmxsync.c +++ b/xserver/hw/dmx/dmxsync.c @@ -99,13 +99,13 @@ dmxSyncCallback(OsTimerPtr timer, CARD32 time, void *arg) } static void -dmxSyncBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask) +dmxSyncBlockHandler(void *blockData, void *timeout) { TimerForce(dmxSyncTimer); } static void -dmxSyncWakeupHandler(void *blockData, int result, void *pReadMask) +dmxSyncWakeupHandler(void *blockData, int result) { } @@ -182,7 +182,7 @@ dmxSync(DMXScreenInfo * dmxScreen, Bool now) /* Do sync or set time for later */ if (now || !dmxScreen) { - if (!TimerForce(dmxSyncTimer)) + if (dmxSyncTimer == NULL || !TimerForce(dmxSyncTimer)) dmxSyncCallback(NULL, 0, NULL); /* At this point, dmxSyncPending == 0 because * dmxSyncCallback must have been called. */ diff --git a/xserver/hw/dmx/doc/DMXSpec-v1.txt b/xserver/hw/dmx/doc/DMXSpec-v1.txt index 9f5f69cd9..4808fef8e 100644 --- a/xserver/hw/dmx/doc/DMXSpec-v1.txt +++ b/xserver/hw/dmx/doc/DMXSpec-v1.txt @@ -2,7 +2,7 @@ Client-to-Server DMX Extension to the X Protocol - $Date: 2013/06/07 17:28:48 $, $Revision: 1.8 $ + $Date: 2017/12/08 15:02:00 $, $Revision: 1.9 $ Rickard E. (Rik) Faith (faith@redhat.com) Kevin E. Martin (kem@redhat.com) diff --git a/xserver/hw/dmx/doc/DMXSpec.txt b/xserver/hw/dmx/doc/DMXSpec.txt index b7a968f96..498df2d3d 100644 --- a/xserver/hw/dmx/doc/DMXSpec.txt +++ b/xserver/hw/dmx/doc/DMXSpec.txt @@ -2,7 +2,7 @@ Client-to-Server DMX Extension to the X Protocol - $Date: 2013/06/07 17:28:48 $, $Revision: 1.8 $ + $Date: 2017/12/08 15:02:00 $, $Revision: 1.9 $ Rickard E. (Rik) Faith (faith@redhat.com) Kevin E. Martin (kem@redhat.com) diff --git a/xserver/hw/dmx/doc/Makefile.in b/xserver/hw/dmx/doc/Makefile.in index aab99540c..4577d6b9e 100644 --- a/xserver/hw/dmx/doc/Makefile.in +++ b/xserver/hw/dmx/doc/Makefile.in @@ -95,9 +95,10 @@ DIST_COMMON = $(am__dist_noinst_DATA_DIST) $(srcdir)/Makefile.am \ subdir = hw/dmx/doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -308,6 +309,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -338,7 +342,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -433,6 +440,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/dmx/doc/dmx.xml b/xserver/hw/dmx/doc/dmx.xml index 40b9e421c..f10cf79dc 100644 --- a/xserver/hw/dmx/doc/dmx.xml +++ b/xserver/hw/dmx/doc/dmx.xml @@ -944,14 +944,9 @@ are missing. devReadInput() Each device will have some function that gets called to read its -physical input. These may be called in a number of different ways. In -the case of synchronous I/O, they will be called from a DDX -wakeup-handler that gets called after the server detects that new input is -available. In the case of asynchronous I/O, they will be called from a -(SIGIO) signal handler triggered when new input is available. This -function should do at least two things: make sure that input events get -enqueued, and make sure that the cursor gets moved for motion events -(except if these are handled later by the driver's own event queue +physical input. This function should do at least two things: make sure that +input events get enqueued, and make sure that the cursor gets moved for motion +events (except if these are handled later by the driver's own event queue processing function, which cannot be done when using the MI event queue handling). diff --git a/xserver/hw/dmx/doxygen/Makefile.in b/xserver/hw/dmx/doxygen/Makefile.in index 644c1405a..e54da2405 100644 --- a/xserver/hw/dmx/doxygen/Makefile.in +++ b/xserver/hw/dmx/doxygen/Makefile.in @@ -76,9 +76,10 @@ DIST_COMMON = $(am__dist_noinst_DATA_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/doxygen.conf.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -289,6 +290,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -319,7 +323,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -414,6 +421,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/dmx/examples/Makefile.in b/xserver/hw/dmx/examples/Makefile.in index 805ca8da5..0ac5a75d5 100644 --- a/xserver/hw/dmx/examples/Makefile.in +++ b/xserver/hw/dmx/examples/Makefile.in @@ -60,9 +60,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -403,6 +404,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -433,7 +437,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -528,6 +535,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/dmx/glxProxy/Makefile.in b/xserver/hw/dmx/glxProxy/Makefile.in index 9bc2ae56c..e73cda1a5 100644 --- a/xserver/hw/dmx/glxProxy/Makefile.in +++ b/xserver/hw/dmx/glxProxy/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -309,6 +310,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -339,7 +343,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -434,6 +441,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/dmx/input/Makefile.am b/xserver/hw/dmx/input/Makefile.am index 185aaf84e..b56ee8e29 100644 --- a/xserver/hw/dmx/input/Makefile.am +++ b/xserver/hw/dmx/input/Makefile.am @@ -34,8 +34,6 @@ DMXSRCS = dmxinputinit.c \ dmxinputinit.h \ dmxarg.c \ dmxarg.h \ - dmxsigio.c \ - dmxsigio.h \ dmxevents.c \ dmxevents.h \ dmxxinput.c \ diff --git a/xserver/hw/dmx/input/Makefile.in b/xserver/hw/dmx/input/Makefile.in index b5e45399a..a5e7dcb1f 100644 --- a/xserver/hw/dmx/input/Makefile.in +++ b/xserver/hw/dmx/input/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -85,9 +86,9 @@ am__libdmxinput_a_SOURCES_DIST = ChkNotMaskEv.c ChkNotMaskEv.h \ usb-mouse.h usb-other.c usb-other.h usb-common.c usb-common.h \ usb-private.h dmxdummy.c dmxdummy.h dmxbackend.c dmxbackend.h \ dmxconsole.c dmxconsole.h dmxcommon.c dmxcommon.h \ - dmxinputinit.c dmxinputinit.h dmxarg.c dmxarg.h dmxsigio.c \ - dmxsigio.h dmxevents.c dmxevents.h dmxxinput.c dmxmotion.c \ - dmxmotion.h dmxmap.c dmxmap.h + dmxinputinit.c dmxinputinit.h dmxarg.c dmxarg.h dmxevents.c \ + dmxevents.h dmxxinput.c dmxmotion.c dmxmotion.h dmxmap.c \ + dmxmap.h @DMX_BUILD_LNX_TRUE@am__objects_1 = lnx-keyboard.$(OBJEXT) \ @DMX_BUILD_LNX_TRUE@ lnx-ms.$(OBJEXT) lnx-ps2.$(OBJEXT) @DMX_BUILD_USB_TRUE@am__objects_2 = usb-keyboard.$(OBJEXT) \ @@ -96,8 +97,8 @@ am__libdmxinput_a_SOURCES_DIST = ChkNotMaskEv.c ChkNotMaskEv.h \ am__objects_3 = dmxdummy.$(OBJEXT) dmxbackend.$(OBJEXT) \ dmxconsole.$(OBJEXT) dmxcommon.$(OBJEXT) am__objects_4 = dmxinputinit.$(OBJEXT) dmxarg.$(OBJEXT) \ - dmxsigio.$(OBJEXT) dmxevents.$(OBJEXT) dmxxinput.$(OBJEXT) \ - dmxmotion.$(OBJEXT) dmxmap.$(OBJEXT) + dmxevents.$(OBJEXT) dmxxinput.$(OBJEXT) dmxmotion.$(OBJEXT) \ + dmxmap.$(OBJEXT) am_libdmxinput_a_OBJECTS = ChkNotMaskEv.$(OBJEXT) $(am__objects_1) \ $(am__objects_2) $(am__objects_3) $(am__objects_4) libdmxinput_a_OBJECTS = $(am_libdmxinput_a_OBJECTS) @@ -324,6 +325,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -354,7 +358,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -449,6 +456,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -527,8 +535,6 @@ DMXSRCS = dmxinputinit.c \ dmxinputinit.h \ dmxarg.c \ dmxarg.h \ - dmxsigio.c \ - dmxsigio.h \ dmxevents.c \ dmxevents.h \ dmxxinput.c \ @@ -612,7 +618,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmxinputinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmxmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmxmotion.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmxsigio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmxxinput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx-keyboard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx-ms.Po@am__quote@ diff --git a/xserver/hw/dmx/input/dmxcommon.c b/xserver/hw/dmx/input/dmxcommon.c index 90154ef3e..c7aed68b7 100644 --- a/xserver/hw/dmx/input/dmxcommon.c +++ b/xserver/hw/dmx/input/dmxcommon.c @@ -480,17 +480,26 @@ dmxCommonXSelect(DMXScreenInfo * dmxScreen, void *closure) return NULL; } +static void +dmxCommonFdNotify(int fd, int ready, void *data) +{ + /* This should process input on this fd, but instead all + * of that is delayed until the block and wakeup handlers are called + */ + ; +} + static void * dmxCommonAddEnabledDevice(DMXScreenInfo * dmxScreen, void *closure) { - AddEnabledDevice(XConnectionNumber(dmxScreen->beDisplay)); + SetNotifyFd(XConnectionNumber(dmxScreen->beDisplay), dmxCommonFdNotify, X_NOTIFY_READ, closure); return NULL; } static void * dmxCommonRemoveEnabledDevice(DMXScreenInfo * dmxScreen, void *closure) { - RemoveEnabledDevice(XConnectionNumber(dmxScreen->beDisplay)); + RemoveNotifyFd(XConnectionNumber(dmxScreen->beDisplay)); return NULL; } @@ -504,7 +513,7 @@ dmxCommonMouOn(DevicePtr pDev) priv->eventMask |= DMX_POINTER_EVENT_MASK; if (!priv->be) { XSelectInput(priv->display, priv->window, priv->eventMask); - AddEnabledDevice(XConnectionNumber(priv->display)); + SetNotifyFd(XConnectionNumber(priv->display), dmxCommonFdNotify,X_NOTIFY_READ, pDev); } else { dmxPropertyIterate(priv->be, dmxCommonXSelect, priv); @@ -523,7 +532,7 @@ dmxCommonMouOff(DevicePtr pDev) priv->eventMask &= ~DMX_POINTER_EVENT_MASK; if (!priv->be) { - RemoveEnabledDevice(XConnectionNumber(priv->display)); + RemoveNotifyFd(XConnectionNumber(priv->display)); XSelectInput(priv->display, priv->window, priv->eventMask); } else { diff --git a/xserver/hw/dmx/input/dmxevents.c b/xserver/hw/dmx/input/dmxevents.c index 2b579ee87..fb0c00fe1 100644 --- a/xserver/hw/dmx/input/dmxevents.c +++ b/xserver/hw/dmx/input/dmxevents.c @@ -47,7 +47,6 @@ #include "dmxcommon.h" #include "dmxcursor.h" #include "dmxmotion.h" -#include "dmxsigio.h" #include "dmxmap.h" #include @@ -227,25 +226,25 @@ dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block) && pScreen->myNum == dmxScreen->index) { /* Screen is old screen */ if (block) - OsBlockSIGIO(); + input_lock(); if (pDev) enqueueMotion(pDev, localX, localY); if (block) - OsReleaseSIGIO(); + input_unlock(); } else { /* Screen is new */ DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n", pScreen->myNum, dmxScreen->index, localX, localY); if (block) - OsBlockSIGIO(); + input_lock(); mieqProcessInputEvents(); miPointerSetScreen(inputInfo.pointer, dmxScreen->index, localX, localY); if (pDev) enqueueMotion(pDev, localX, localY); if (block) - OsReleaseSIGIO(); + input_unlock(); } #if 00 miPointerGetPosition(inputInfo.pointer, &localX, &localY); @@ -387,12 +386,12 @@ dmxExtMotion(DMXLocalInputInfoPtr dmxLocal, } if (block) - OsBlockSIGIO(); + input_lock(); valuator_mask_set_range(&mask, firstAxis, axesCount, v); QueuePointerEvents(pDevice, MotionNotify, 0, POINTER_ABSOLUTE, &mask); if (block) - OsReleaseSIGIO(); + input_unlock(); } static int @@ -489,10 +488,10 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, case XI_DeviceKeyPress: case XI_DeviceKeyRelease: if (block) - OsBlockSIGIO(); + input_lock(); QueueKeyboardEvents(pDevice, event, ke->keycode); if (block) - OsReleaseSIGIO(); + input_unlock(); break; case XI_DeviceButtonPress: case XI_DeviceButtonRelease: @@ -500,11 +499,11 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) - OsBlockSIGIO(); + input_lock(); QueuePointerEvents(pDevice, event, ke->keycode, POINTER_ABSOLUTE, &mask); if (block) - OsReleaseSIGIO(); + input_unlock(); break; case XI_ProximityIn: case XI_ProximityOut: @@ -512,10 +511,10 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) - OsBlockSIGIO(); + input_lock(); QueueProximityEvents(pDevice, event, &mask); if (block) - OsReleaseSIGIO(); + input_unlock(); break; break; @@ -586,7 +585,7 @@ dmxInvalidateGlobalPosition(void) * \a DMX_ABSOLUTE_CONFINED (in the latter case, the pointer will not be * allowed to move outside the global boundaires). * - * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be + * If \a block is set to \a DMX_BLOCK, then the input thread will be * blocked around calls to \a enqueueMotion(). */ void dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount, @@ -690,7 +689,7 @@ dmxFixup(DevicePtr pDev, int detail, KeySym keySym) * KeyRelease event, then the \a keySym is also specified. * * FIXME: make the code do what the comment says, or remove this comment. - * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be + * If \a block is set to \a DMX_BLOCK, then the input thread will be * blocked around calls to dmxeqEnqueue(). */ void diff --git a/xserver/hw/dmx/input/dmxinputinit.c b/xserver/hw/dmx/input/dmxinputinit.c index cdefd9ae0..554d234e9 100644 --- a/xserver/hw/dmx/input/dmxinputinit.c +++ b/xserver/hw/dmx/input/dmxinputinit.c @@ -63,7 +63,6 @@ #include "usb-other.h" #include "usb-common.h" -#include "dmxsigio.h" #include "dmxarg.h" #include "inputstr.h" @@ -434,7 +433,6 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) { GETDMXINPUTFROMPDEVICE; - int fd; DMXLocalInitInfo info; int i; Atom btn_labels[MAX_BUTTONS] = { 0 }; /* FIXME */ @@ -523,8 +521,8 @@ dmxDeviceOnOff(DeviceIntPtr pDevice, int what) break; case DEVICE_ON: if (!pDev->on) { - if (dmxLocal->on && (fd = dmxLocal->on(pDev)) >= 0) - dmxSigioRegister(dmxInput, fd); + if (dmxLocal->on) + dmxLocal->on(pDev); pDev->on = TRUE; } break; @@ -534,7 +532,6 @@ dmxDeviceOnOff(DeviceIntPtr pDevice, int what) * detached screen (DEVICE_OFF), and then again at server * generation time (DEVICE_CLOSE). */ if (pDev->on) { - dmxSigioUnregister(dmxInput); if (dmxLocal->off) dmxLocal->off(pDev); pDev->on = FALSE; @@ -633,7 +630,7 @@ dmxCollectAll(DMXInputInfo * dmxInput) } static void -dmxBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask) +dmxBlockHandler(void *blockData, void *timeout) { DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t) blockData]; static unsigned long generation = 0; @@ -654,7 +651,6 @@ dmxSwitchReturn(void *p) if (!dmxInput->vt_switched) dmxLog(dmxFatal, "dmxSwitchReturn called, but not switched\n"); - dmxSigioEnableInput(); for (i = 0; i < dmxInput->numDevs; i++) if (dmxInput->devs[i]->vt_post_switch) dmxInput->devs[i]->vt_post_switch(dmxInput->devs[i]->private); @@ -662,7 +658,7 @@ dmxSwitchReturn(void *p) } static void -dmxWakeupHandler(void *blockData, int result, void *pReadMask) +dmxWakeupHandler(void *blockData, int result) { DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t) blockData]; int i; @@ -676,7 +672,6 @@ dmxWakeupHandler(void *blockData, int result, void *pReadMask) dmxInput->vt_switch_pending = 0; for (i = 0; i < dmxInput->numDevs; i++) { if (dmxInput->devs[i]->vt_switch) { - dmxSigioDisableInput(); if (!dmxInput->devs[i]->vt_switch(dmxInput->devs[i]->private, dmxInput->vt_switched, dmxSwitchReturn, dmxInput)) diff --git a/xserver/hw/dmx/input/dmxsigio.c b/xserver/hw/dmx/input/dmxsigio.c deleted file mode 100644 index 6ef543c8b..000000000 --- a/xserver/hw/dmx/input/dmxsigio.c +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina. - * - * 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 on 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 (including the - * next paragraph) 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 - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * 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. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * - * Provides an interface for handling SIGIO signals for input devices. */ - -#ifdef HAVE_DMX_CONFIG_H -#include -#endif - -#include "inputstr.h" -#include "dmxinputinit.h" -#include "dmxsigio.h" -#include "dmxevents.h" -#include -#include -#include - -static int dmxFdCount = 0; -static Bool dmxInputEnabled = TRUE; - -/* Define equivalents for non-POSIX systems (e.g., SGI IRIX, Solaris) */ -#ifndef O_ASYNC -#ifdef FASYNC -#define O_ASYNC FASYNC -#else -#define O_ASYNC 0 -#endif -#endif -#ifndef O_NONBLOCK -#define O_NONBLOCK FNONBLK -#endif - -static void -dmxSigioHandler(int sig) -{ - int i, j; - DMXInputInfo *dmxInput; - - for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) { - if (dmxInput->sigioState == DMX_ACTIVESIGIO) { - for (j = 0; j < dmxInput->numDevs; j++) { - DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[j]; - - if (dmxLocal->collect_events) { - dmxLocal->collect_events(&dmxLocal->pDevice->public, - dmxMotion, - dmxEnqueue, - dmxCheckSpecialKeys, DMX_NO_BLOCK); - } - } - } - } -} - -static void -dmxSigioHook(void) -{ - struct sigaction a; - sigset_t s; - - memset(&a, 0, sizeof(a)); - a.sa_handler = dmxSigioHandler; - sigemptyset(&a.sa_mask); - sigaddset(&a.sa_mask, SIGIO); - sigaddset(&a.sa_mask, SIGALRM); - sigaddset(&a.sa_mask, SIGVTALRM); - sigaction(SIGIO, &a, 0); - - sigemptyset(&s); - sigprocmask(SIG_SETMASK, &s, 0); -} - -static void -dmxSigioUnhook(void) -{ - struct sigaction a; - - memset(&a, 0, sizeof(a)); - a.sa_handler = SIG_IGN; - sigemptyset(&a.sa_mask); - sigaction(SIGIO, &a, 0); -} - -static void -dmxSigioAdd(DMXInputInfo * dmxInput) -{ - int flags; - int i; - - switch (dmxInput->sigioState) { - case DMX_NOSIGIO: - return; - case DMX_USESIGIO: - dmxInput->sigioState = DMX_ACTIVESIGIO; - break; - case DMX_ACTIVESIGIO: - return; - } - - for (i = 0; i < dmxInput->sigioFdCount; i++) { - if (!dmxInput->sigioAdded[i]) { - int fd = dmxInput->sigioFd[i]; - - fcntl(fd, F_SETOWN, getpid()); - flags = fcntl(fd, F_GETFL); - flags |= O_ASYNC | O_NONBLOCK; - fcntl(fd, F_SETFL, flags); - - AddEnabledDevice(fd); - dmxInput->sigioAdded[i] = TRUE; - - if (++dmxFdCount == 1) - dmxSigioHook(); - } - } -} - -static void -dmxSigioRemove(DMXInputInfo * dmxInput) -{ - int flags; - int i; - - switch (dmxInput->sigioState) { - case DMX_NOSIGIO: - return; - case DMX_USESIGIO: - return; - case DMX_ACTIVESIGIO: - dmxInput->sigioState = DMX_USESIGIO; - break; - } - - for (i = 0; i < dmxInput->sigioFdCount; i++) { - if (dmxInput->sigioAdded[i]) { - int fd = dmxInput->sigioFd[i]; - - dmxInput->sigioAdded[i] = FALSE; - RemoveEnabledDevice(fd); - - flags = fcntl(fd, F_GETFL); - flags &= ~(O_ASYNC | O_NONBLOCK); - fcntl(fd, F_SETFL, flags); - - if (!--dmxFdCount) - dmxSigioUnhook(); - } - } -} - -/** Enable SIGIO handling. This instantiates the handler with the OS. */ -void -dmxSigioEnableInput(void) -{ - int i; - DMXInputInfo *dmxInput; - - dmxInputEnabled = TRUE; - for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) - dmxSigioAdd(dmxInput); -} - -/** Disable SIGIO handling. This removes the hanlder from the OS. */ -void -dmxSigioDisableInput(void) -{ - int i; - DMXInputInfo *dmxInput; - - dmxInputEnabled = FALSE; - for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) - dmxSigioRemove(dmxInput); -} - -/** Make a note that the input device described in \a dmxInput will be - * using the file descriptor \a fd for SIGIO signals. Calls - * AddEnabledDevice ifi SIGIO handling has been enabled with - * #dmxSigioEnableInput(). */ -void -dmxSigioRegister(DMXInputInfo * dmxInput, int fd) -{ - dmxInput->sigioState = DMX_USESIGIO; - if (dmxInput->sigioFdCount >= DMX_MAX_SIGIO_FDS) - dmxLog(dmxFatal, "Too many SIGIO file descriptors (%d >= %d)\n", - dmxInput->sigioFdCount, DMX_MAX_SIGIO_FDS); - - dmxInput->sigioFd[dmxInput->sigioFdCount++] = fd; - if (dmxInputEnabled) - dmxSigioAdd(dmxInput); -} - -/** Remove the notes that \a dmxInput is using any file descriptors for - * SIGIO signals. Calls RemoveEnabledDevice. */ -void -dmxSigioUnregister(DMXInputInfo * dmxInput) -{ - if (dmxInput->sigioState == DMX_NOSIGIO) - return; - dmxSigioRemove(dmxInput); - dmxInput->sigioState = DMX_NOSIGIO; - dmxInput->sigioFdCount = 0; -} diff --git a/xserver/hw/dmx/input/dmxsigio.h b/xserver/hw/dmx/input/dmxsigio.h deleted file mode 100644 index 9f30662d1..000000000 --- a/xserver/hw/dmx/input/dmxsigio.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2001 Red Hat Inc., Durham, North Carolina. - * - * 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 on 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 (including the - * next paragraph) 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 - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * 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. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith - * - */ - -/** \file - * Interface to SIGIO handling support. \see dmxsigio.c */ - -#ifndef _DMXSIGIO_H_ -#define _DMXSIGIO_H_ -extern void dmxSigioEnableInput(void); -extern void dmxSigioDisableInput(void); -extern void dmxSigioRegister(DMXInputInfo * dmxInput, int fd); -extern void dmxSigioUnregister(DMXInputInfo * dmxInput); -#endif diff --git a/xserver/hw/dmx/input/lnx-keyboard.c b/xserver/hw/dmx/input/lnx-keyboard.c index 0aa62f452..a273f6b71 100644 --- a/xserver/hw/dmx/input/lnx-keyboard.c +++ b/xserver/hw/dmx/input/lnx-keyboard.c @@ -158,7 +158,6 @@ #include #include #include -#include #include #include #include @@ -505,7 +504,7 @@ kbdLinuxVTSignalHandler(int sig) { myPrivate *priv = PRIV; - signal(sig, kbdLinuxVTSignalHandler); + OsSignal(sig, kbdLinuxVTSignalHandler); if (priv) { ioctl(priv->fd, VT_RELDISP, VT_ACKACQ); priv->switched = !priv->switched; @@ -537,7 +536,7 @@ kbdLinuxActivate(int fd, int vtno, int setSig) VT.acqsig = SIGUSR1; if (ioctl(fd, VT_SETMODE, &VT)) FATAL0("kbdLinuxActivate: VT_SETMODE VT_PROCESS failed\n"); - signal(SIGUSR1, kbdLinuxVTSignalHandler); + OsSignal(SIGUSR1, kbdLinuxVTSignalHandler); } return Success; } @@ -821,7 +820,7 @@ kbdLinuxConvert(DevicePtr pDev, * event, enqueue it with the \a motion function. Otherwise, check for * special keys with the \a checkspecial function and enqueue the event * with the \a enqueue function. The \a block type is passed to the - * functions so that they may block SIGIO handling as appropriate to the + * functions so that they may block the input thread as appropriate to the * caller of this function. */ void kbdLinuxRead(DevicePtr pDev, diff --git a/xserver/hw/dmx/input/lnx-ms.c b/xserver/hw/dmx/input/lnx-ms.c index 621f0fecc..1a5786c7e 100644 --- a/xserver/hw/dmx/input/lnx-ms.c +++ b/xserver/hw/dmx/input/lnx-ms.c @@ -76,6 +76,7 @@ #include #include #include +#include /*****************************************************************************/ /* Define some macros to make it easier to move this file to another @@ -120,10 +121,11 @@ static int msLinuxReadBytes(int fd, unsigned char *buf, int len, int min) { int n, tot; - fd_set set; - struct timeval tv; + struct pollfd poll_fd; tot = 0; + poll_fd.fd = fd; + poll_fd.events = POLLIN; while (len) { n = read(fd, buf, len); if (n > 0) { @@ -133,11 +135,7 @@ msLinuxReadBytes(int fd, unsigned char *buf, int len, int min) } if (tot % min == 0) break; - FD_ZERO(&set); - FD_SET(fd, &set); - tv.tv_sec = 0; - tv.tv_usec = 100 * 1000; - n = select(fd + 1, &set, 0, 0, &tv); + n = xserver_poll(&poll_fd, 1, 100); if (n <= 0) break; } @@ -191,7 +189,7 @@ msLinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue, int buttons, BLOCK block) * event, enqueue it with the \a motion function. Otherwise, check for * special keys with the \a checkspecial function and enqueue the event * with the \a enqueue function. The \a block type is passed to the - * functions so that they may block SIGIO handling as appropriate to the + * functions so that they may block the input thread as appropriate to the * caller of this function. */ void msLinuxRead(DevicePtr pDev, @@ -246,7 +244,8 @@ msLinuxInit(DevicePtr pDev) if (tcgetattr(priv->fd, &priv->tty) < 0) FATAL1("msLinuxInit: tcgetattr failed (%s)\n", strerror(errno)); - write(priv->fd, "*n", 2); /* 1200 baud */ + i = write(priv->fd, "*n", 2); /* 1200 baud */ + (void) i; usleep(100000); } @@ -256,6 +255,7 @@ msLinuxOn(DevicePtr pDev) { GETPRIV; struct termios nTty; + int i; if (priv->fd < 0) msLinuxInit(pDev); @@ -273,7 +273,8 @@ msLinuxOn(DevicePtr pDev) cfsetospeed(&nTty, B1200); if (tcsetattr(priv->fd, TCSANOW, &nTty) < 0) FATAL1("msLinuxInit: tcsetattr failed (%s)\n", strerror(errno)); - write(priv->fd, "*V", 2); /* 2 button 3 byte protocol */ + i = write(priv->fd, "*V", 2); /* 2 button 3 byte protocol */ + (void) i; return priv->fd; } diff --git a/xserver/hw/dmx/input/lnx-ps2.c b/xserver/hw/dmx/input/lnx-ps2.c index dd70cb8ea..2b6e8d63b 100644 --- a/xserver/hw/dmx/input/lnx-ps2.c +++ b/xserver/hw/dmx/input/lnx-ps2.c @@ -73,6 +73,7 @@ #include #include #include +#include /*****************************************************************************/ /* Define some macros to make it easier to move this file to another @@ -116,9 +117,10 @@ static int ps2LinuxReadBytes(int fd, unsigned char *buf, int len, int min) { int n, tot; - fd_set set; - struct timeval tv; + struct pollfd poll_fd; + poll_fd.fd = fd; + poll_fd.events = POLLIN; tot = 0; while (len) { n = read(fd, buf, len); @@ -129,11 +131,7 @@ ps2LinuxReadBytes(int fd, unsigned char *buf, int len, int min) } if (tot % min == 0) break; - FD_ZERO(&set); - FD_SET(fd, &set); - tv.tv_sec = 0; - tv.tv_usec = 100 * 1000; - n = select(fd + 1, &set, 0, 0, &tv); + n = xserver_poll(&poll_fd, 1, 100); if (n <= 0) break; } @@ -187,7 +185,7 @@ ps2LinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue, int buttons, BLOCK block) * event, enqueue it with the \a motion function. Otherwise, check for * special keys with the \a checkspecial function and enqueue the event * with the \a enqueue function. The \a block type is passed to the - * functions so that they may block SIGIO handling as appropriate to the + * functions so that they may block the input thread as appropriate to the * caller of this function. */ void ps2LinuxRead(DevicePtr pDev, MOTIONPROC motion, diff --git a/xserver/hw/dmx/input/usb-common.c b/xserver/hw/dmx/input/usb-common.c index 67aa07e0a..8c62abafb 100644 --- a/xserver/hw/dmx/input/usb-common.c +++ b/xserver/hw/dmx/input/usb-common.c @@ -77,7 +77,7 @@ /** Read an event from the \a pDev device. If the event is a motion * event, enqueue it with the \a motion function. Otherwise, enqueue * the event with the \a enqueue function. The \a block type is passed - * to the functions so that they may block SIGIO handling as appropriate + * to the functions so that they may block the input thread as appropriate * to the caller of this function. * * Since USB devices return EV_KEY events for buttons and keys, \a diff --git a/xserver/hw/dmx/input/usb-keyboard.c b/xserver/hw/dmx/input/usb-keyboard.c index 65bfcd00d..b26c822c0 100644 --- a/xserver/hw/dmx/input/usb-keyboard.c +++ b/xserver/hw/dmx/input/usb-keyboard.c @@ -289,7 +289,8 @@ kbdUSBCtrl(DevicePtr pDev, KeybdCtrl * ctrl) led = i; event.code = led; event.value = ! !(ctrl->leds & (1 << led)); - write(priv->fd, &event, sizeof(event)); + if (write(priv->fd, &event, sizeof(event)) != sizeof(event)) + DebugF("Failed to set LEDs!\n"); } } @@ -379,7 +380,7 @@ kbdUSBConvert(DevicePtr pDev, * event, enqueue it with the \a motion function. Otherwise, check for * special keys with the \a checkspecial function and enqueue the event * with the \a enqueue function. The \a block type is passed to the - * functions so that they may block SIGIO handling as appropriate to the + * functions so that they may block the input thread as appropriate to the * caller of this function. */ void kbdUSBRead(DevicePtr pDev, diff --git a/xserver/hw/dmx/man/Makefile.in b/xserver/hw/dmx/man/Makefile.in index 6de913826..8146dbb80 100644 --- a/xserver/hw/dmx/man/Makefile.in +++ b/xserver/hw/dmx/man/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/dmx/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -313,6 +314,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -343,7 +347,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -438,6 +445,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/kdrive/Makefile.in b/xserver/hw/kdrive/Makefile.in index e0c6ab242..f7d479d09 100644 --- a/xserver/hw/kdrive/Makefile.in +++ b/xserver/hw/kdrive/Makefile.in @@ -53,9 +53,10 @@ subdir = hw/kdrive DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -303,6 +304,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -333,7 +337,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -428,6 +435,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/kdrive/Xkdrive.man b/xserver/hw/kdrive/Xkdrive.man index b37f9f10a..c3e2089bc 100644 --- a/xserver/hw/kdrive/Xkdrive.man +++ b/xserver/hw/kdrive/Xkdrive.man @@ -4,10 +4,6 @@ .SH NAME Xkdrive \- tiny X server .SH SYNOPSIS -.B Xvesa -.RI [ :display ] -.RI [ option ...] - .B Xfbdev .RI [ :display ] .RI [ option ...] @@ -24,9 +20,6 @@ Xserver(1)), all the .B Xkdrive servers accept the following options: .TP 8 -.B -card \fIpcmcia\fP -use pcmcia card as additional screen. -.TP 8 .B -dumb disable hardware acceleration. .TP 8 diff --git a/xserver/hw/kdrive/ephyr/Makefile.am b/xserver/hw/kdrive/ephyr/Makefile.am index 155e11eb3..6ce0d6fa0 100644 --- a/xserver/hw/kdrive/ephyr/Makefile.am +++ b/xserver/hw/kdrive/ephyr/Makefile.am @@ -46,19 +46,6 @@ GLAMOR_SRCS = \ $() endif -if DRI -DRI_SRCS = \ - ephyrdriext.c \ - ephyrdriext.h \ - ephyrdri.c \ - ephyrdri.h \ - ephyrglxext.c \ - ephyrglxext.h \ - ephyrhostglx.c \ - ephyrhostglx.h \ - $() -endif - bin_PROGRAMS = Xephyr Xephyr_SOURCES = \ @@ -72,7 +59,6 @@ Xephyr_SOURCES = \ hostx.c \ hostx.h \ $(XV_SRCS) \ - $(DRI_SRCS) \ $(GLAMOR_SRCS) \ $() diff --git a/xserver/hw/kdrive/ephyr/Makefile.in b/xserver/hw/kdrive/ephyr/Makefile.in index f8786bef8..1049504c8 100644 --- a/xserver/hw/kdrive/ephyr/Makefile.in +++ b/xserver/hw/kdrive/ephyr/Makefile.in @@ -78,9 +78,10 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -98,18 +99,14 @@ am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__Xephyr_SOURCES_DIST = ephyr.c ephyr.h ephyrlog.h ephyr_draw.c os.c \ ephyrinit.c ephyrcursor.c hostx.c hostx.h ephyrvideo.c \ - ephyrdriext.c ephyrdriext.h ephyrdri.c ephyrdri.h \ - ephyrglxext.c ephyrglxext.h ephyrhostglx.c ephyrhostglx.h \ ephyr_glamor_glx.c ephyr_glamor_glx.h ephyr_glamor_xv.c @XV_TRUE@am__objects_1 = ephyrvideo.$(OBJEXT) -@DRI_TRUE@am__objects_2 = ephyrdriext.$(OBJEXT) ephyrdri.$(OBJEXT) \ -@DRI_TRUE@ ephyrglxext.$(OBJEXT) ephyrhostglx.$(OBJEXT) -@GLAMOR_TRUE@@XV_TRUE@am__objects_3 = ephyr_glamor_xv.$(OBJEXT) -@GLAMOR_TRUE@am__objects_4 = ephyr_glamor_glx.$(OBJEXT) \ -@GLAMOR_TRUE@ $(am__objects_3) +@GLAMOR_TRUE@@XV_TRUE@am__objects_2 = ephyr_glamor_xv.$(OBJEXT) +@GLAMOR_TRUE@am__objects_3 = ephyr_glamor_glx.$(OBJEXT) \ +@GLAMOR_TRUE@ $(am__objects_2) am_Xephyr_OBJECTS = ephyr.$(OBJEXT) ephyr_draw.$(OBJEXT) os.$(OBJEXT) \ ephyrinit.$(OBJEXT) ephyrcursor.$(OBJEXT) hostx.$(OBJEXT) \ - $(am__objects_1) $(am__objects_2) $(am__objects_4) + $(am__objects_1) $(am__objects_3) Xephyr_OBJECTS = $(am_Xephyr_OBJECTS) @GLAMOR_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/glamor/libglamor.la \ @GLAMOR_TRUE@ $(top_builddir)/glamor/libglamor_egl_stubs.la @@ -377,6 +374,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -407,7 +407,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -502,6 +505,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -561,17 +565,6 @@ AM_CPPFLAGS = @KDRIVE_INCS@ @KDRIVE_CFLAGS@ @XEPHYR_INCS@ \ @GLAMOR_TRUE@ $(GLAMOR_XV_SRCS) \ @GLAMOR_TRUE@ $() -@DRI_TRUE@DRI_SRCS = \ -@DRI_TRUE@ ephyrdriext.c \ -@DRI_TRUE@ ephyrdriext.h \ -@DRI_TRUE@ ephyrdri.c \ -@DRI_TRUE@ ephyrdri.h \ -@DRI_TRUE@ ephyrglxext.c \ -@DRI_TRUE@ ephyrglxext.h \ -@DRI_TRUE@ ephyrhostglx.c \ -@DRI_TRUE@ ephyrhostglx.h \ -@DRI_TRUE@ $() - Xephyr_SOURCES = \ ephyr.c \ ephyr.h \ @@ -583,7 +576,6 @@ Xephyr_SOURCES = \ hostx.c \ hostx.h \ $(XV_SRCS) \ - $(DRI_SRCS) \ $(GLAMOR_SRCS) \ $() @@ -695,10 +687,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr_glamor_glx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr_glamor_xv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrcursor.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrdri.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrdriext.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrglxext.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrhostglx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrvideo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostx.Po@am__quote@ diff --git a/xserver/hw/kdrive/ephyr/ephyr.c b/xserver/hw/kdrive/ephyr/ephyr.c index cb1c16e4e..ef5350e18 100644 --- a/xserver/hw/kdrive/ephyr/ephyr.c +++ b/xserver/hw/kdrive/ephyr/ephyr.c @@ -36,13 +36,6 @@ #include "scrnintstr.h" #include "ephyrlog.h" -#ifdef XF86DRI -#include -#include "ephyrdri.h" -#include "ephyrdriext.h" -#include "ephyrglxext.h" -#endif /* XF86DRI */ - #ifdef GLAMOR #include "glamor.h" #endif @@ -54,7 +47,6 @@ extern Bool ephyr_glamor; KdKeyboardInfo *ephyrKbd; KdPointerInfo *ephyrMouse; -EphyrKeySyms ephyrKeySyms; Bool ephyrNoDRI = FALSE; Bool ephyrNoXV = FALSE; @@ -345,17 +337,35 @@ ephyrInternalDamageRedisplay(ScreenPtr pScreen) } static void -ephyrInternalDamageBlockHandler(void *data, OSTimePtr pTimeout, void *pRead) -{ - ScreenPtr pScreen = (ScreenPtr) data; +ephyrXcbProcessEvents(Bool queued_only); - ephyrInternalDamageRedisplay(pScreen); +static Bool +ephyrEventWorkProc(ClientPtr client, void *closure) +{ + ephyrXcbProcessEvents(TRUE); + return TRUE; } static void -ephyrInternalDamageWakeupHandler(void *data, int i, void *LastSelectMask) +ephyrScreenBlockHandler(ScreenPtr pScreen, void *timeout) { - /* FIXME: Not needed ? */ + KdScreenPriv(pScreen); + KdScreenInfo *screen = pScreenPriv->screen; + EphyrScrPriv *scrpriv = screen->driver; + + pScreen->BlockHandler = scrpriv->BlockHandler; + (*pScreen->BlockHandler)(pScreen, timeout); + scrpriv->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = ephyrScreenBlockHandler; + + if (scrpriv->pDamage) + ephyrInternalDamageRedisplay(pScreen); + + if (hostx_has_queued_event()) { + if (!QueueWorkProc(ephyrEventWorkProc, NULL, NULL)) + FatalError("cannot queue event processing in ephyr block handler"); + AdjustWaitForDelay(timeout, 0); + } } Bool @@ -370,11 +380,6 @@ ephyrSetInternalDamage(ScreenPtr pScreen) (DamageDestroyFunc) 0, DamageReportNone, TRUE, pScreen, pScreen); - if (!RegisterBlockAndWakeupHandlers(ephyrInternalDamageBlockHandler, - ephyrInternalDamageWakeupHandler, - (void *) pScreen)) - return FALSE; - pPixmap = (*pScreen->GetScreenPixmap) (pScreen); DamageRegister(&pPixmap->drawable, scrpriv->pDamage); @@ -390,10 +395,7 @@ ephyrUnsetInternalDamage(ScreenPtr pScreen) EphyrScrPriv *scrpriv = screen->driver; DamageDestroy(scrpriv->pDamage); - - RemoveBlockAndWakeupHandlers(ephyrInternalDamageBlockHandler, - ephyrInternalDamageWakeupHandler, - (void *) pScreen); + scrpriv->pDamage = NULL; } #ifdef RANDR @@ -508,6 +510,14 @@ ephyrRandRSetConfig(ScreenPtr pScreen, screen->width = newwidth; screen->height = newheight; + scrpriv->win_width = screen->width; + scrpriv->win_height = screen->height; +#ifdef GLAMOR + ephyr_glamor_set_window_size(scrpriv->glamor, + scrpriv->win_width, + scrpriv->win_height); +#endif + if (!ephyrMapFramebuffer(screen)) goto bail4; @@ -518,12 +528,18 @@ ephyrRandRSetConfig(ScreenPtr pScreen, else ephyrUnsetInternalDamage(screen->pScreen); + ephyrSetScreenSizes(screen->pScreen); + if (scrpriv->shadow) { if (!KdShadowSet(screen->pScreen, scrpriv->randr, ephyrShadowUpdate, ephyrWindowLinear)) goto bail4; } else { +#ifdef GLAMOR + if (ephyr_glamor) + ephyr_glamor_create_screen_resources(pScreen); +#endif /* Without shadow fb ( non rotated ) we need * to use damage to efficiently update display * via signal regions what to copy from 'fb'. @@ -532,8 +548,6 @@ ephyrRandRSetConfig(ScreenPtr pScreen, goto bail4; } - ephyrSetScreenSizes(screen->pScreen); - /* * Set frame buffer mapping */ @@ -611,7 +625,9 @@ ephyrResizeScreen (ScreenPtr pScreen, size.width = newwidth; size.height = newheight; + hostx_size_set_from_configure(TRUE); ret = ephyrRandRSetConfig (pScreen, screen->randr, 0, &size); + hostx_size_set_from_configure(FALSE); if (ret) { RROutputPtr output; @@ -658,16 +674,6 @@ ephyrInitScreen(ScreenPtr pScreen) } } #endif /*XV*/ -#ifdef XF86DRI - if (!ephyrNoDRI && !hostx_has_extension(&xcb_xf86dri_id)) { - EPHYR_LOG("host x does not support DRI. Disabling DRI forwarding\n"); - ephyrNoDRI = TRUE; - } - if (!ephyrNoDRI) { - ephyrDRIExtensionInit(pScreen); - ephyrHijackGLXExtension(); - } -#endif return TRUE; } @@ -676,6 +682,10 @@ ephyrInitScreen(ScreenPtr pScreen) Bool ephyrFinishInitScreen(ScreenPtr pScreen) { + KdScreenPriv(pScreen); + KdScreenInfo *screen = pScreenPriv->screen; + EphyrScrPriv *scrpriv = screen->driver; + /* FIXME: Calling this even if not using shadow. * Seems harmless enough. But may be safer elsewhere. */ @@ -687,6 +697,9 @@ ephyrFinishInitScreen(ScreenPtr pScreen) return FALSE; #endif + scrpriv->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = ephyrScreenBlockHandler; + return TRUE; } @@ -712,8 +725,10 @@ ephyrCreateResources(ScreenPtr pScreen) ephyrShadowUpdate, ephyrWindowLinear); else { #ifdef GLAMOR - if (ephyr_glamor) - ephyr_glamor_create_screen_resources(pScreen); + if (ephyr_glamor) { + if (!ephyr_glamor_create_screen_resources(pScreen)) + return FALSE; + } #endif return ephyrSetInternalDamage(pScreen); } @@ -754,6 +769,7 @@ ephyrScreenFini(KdScreenInfo * screen) if (scrpriv->shadow) { KdShadowFbFree(screen); } + scrpriv->BlockHandler = NULL; } void @@ -836,11 +852,11 @@ ScreenPtr ephyrCursorScreen; /* screen containing the cursor */ static void ephyrWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { - OsBlockSIGIO(); + input_lock(); ephyrCursorScreen = pScreen; miPointerWarpCursor(inputInfo.pointer, pScreen, x, y); - OsReleaseSIGIO(); + input_unlock(); } miPointerScreenFuncRec ephyrPointerScreenFuncs = { @@ -849,40 +865,6 @@ miPointerScreenFuncRec ephyrPointerScreenFuncs = { ephyrWarpCursor, }; -#ifdef XF86DRI -/** - * find if the remote window denoted by a_remote - * is paired with an internal Window within the Xephyr server. - * If the remove window is paired with an internal window, send an - * expose event to the client insterested in the internal window expose event. - * - * Pairing happens when a drawable inside Xephyr is associated with - * a GL surface in a DRI environment. - * Look at the function ProcXF86DRICreateDrawable in ephyrdriext.c to - * know a paired window is created. - * - * This is useful to make GL drawables (only windows for now) handle - * expose events and send those events to clients. - */ -static void -ephyrExposePairedWindow(int a_remote) -{ - EphyrWindowPair *pair = NULL; - RegionRec reg; - ScreenPtr screen; - - if (!findWindowPairFromRemote(a_remote, &pair)) { - EPHYR_LOG("did not find a pair for this window\n"); - return; - } - screen = pair->local->drawable.pScreen; - RegionNull(®); - RegionCopy(®, &pair->local->clipList); - screen->WindowExposures(pair->local, ®); - RegionUninit(®); -} -#endif /* XF86DRI */ - static KdScreenInfo * screen_from_window(Window w) { @@ -939,16 +921,6 @@ ephyrProcessExpose(xcb_generic_event_t *xev) scrpriv->win_height); } else { EPHYR_LOG_ERROR("failed to get host screen\n"); -#ifdef XF86DRI - /* - * We only receive expose events when the expose event - * have be generated for a drawable that is a host X - * window managed by Xephyr. Host X windows managed by - * Xephyr exists for instance when Xephyr is asked to - * create a GL drawable in a DRI environment. - */ - ephyrExposePairedWindow(expose->window); -#endif /* XF86DRI */ } } @@ -974,25 +946,10 @@ ephyrProcessMouseMotion(xcb_generic_event_t *xev) else { int x = 0, y = 0; -#ifdef XF86DRI - EphyrWindowPair *pair = NULL; -#endif EPHYR_LOG("enqueuing mouse motion:%d\n", screen->pScreen->myNum); x = motion->event_x; y = motion->event_y; EPHYR_LOG("initial (x,y):(%d,%d)\n", x, y); -#ifdef XF86DRI - EPHYR_LOG("is this window peered by a gl drawable ?\n"); - if (findWindowPairFromRemote(motion->event, &pair)) { - EPHYR_LOG("yes, it is peered\n"); - x += pair->local->drawable.x; - y += pair->local->drawable.y; - } - else { - EPHYR_LOG("no, it is not peered\n"); - } - EPHYR_LOG("final (x,y):(%d,%d)\n", x, y); -#endif /* convert coords into desktop-wide coordinates. * fill_pointer_events will convert that back to @@ -1182,13 +1139,15 @@ ephyrProcessConfigureNotify(xcb_generic_event_t *xev) #endif /* RANDR */ } -void -ephyrPoll(void) +static void +ephyrXcbProcessEvents(Bool queued_only) { xcb_connection_t *conn = hostx_get_xcbconn(); + xcb_generic_event_t *expose = NULL, *configure = NULL; while (TRUE) { - xcb_generic_event_t *xev = xcb_poll_for_event(conn); + xcb_generic_event_t *xev = hostx_get_event(queued_only); + if (!xev) { /* If our XCB connection has died (for example, our window was * closed), exit now. @@ -1208,7 +1167,9 @@ ephyrPoll(void) break; case XCB_EXPOSE: - ephyrProcessExpose(xev); + free(expose); + expose = xev; + xev = NULL; break; case XCB_MOTION_NOTIFY: @@ -1232,15 +1193,35 @@ ephyrPoll(void) break; case XCB_CONFIGURE_NOTIFY: - ephyrProcessConfigureNotify(xev); + free(configure); + configure = xev; + xev = NULL; break; } - if (ephyr_glamor) - ephyr_glamor_process_event(xev); + if (xev) { + if (ephyr_glamor) + ephyr_glamor_process_event(xev); - free(xev); + free(xev); + } } + + if (configure) { + ephyrProcessConfigureNotify(configure); + free(configure); + } + + if (expose) { + ephyrProcessExpose(expose); + free(expose); + } +} + +static void +ephyrXcbNotify(int fd, int ready, void *data) +{ + ephyrXcbProcessEvents(FALSE); } void @@ -1334,6 +1315,7 @@ static Status MouseEnable(KdPointerInfo * pi) { ((EphyrPointerPrivate *) pi->driverPrivate)->enabled = TRUE; + SetNotifyFd(hostx_get_fd(), ephyrXcbNotify, X_NOTIFY_READ, NULL); return Success; } @@ -1341,6 +1323,7 @@ static void MouseDisable(KdPointerInfo * pi) { ((EphyrPointerPrivate *) pi->driverPrivate)->enabled = FALSE; + RemoveNotifyFd(hostx_get_fd()); return; } @@ -1365,16 +1348,29 @@ KdPointerDriver EphyrMouseDriver = { static Status EphyrKeyboardInit(KdKeyboardInfo * ki) { + KeySymsRec keySyms; + CARD8 modmap[MAP_LENGTH]; + XkbControlsRec controls; + ki->driverPrivate = (EphyrKbdPrivate *) calloc(sizeof(EphyrKbdPrivate), 1); - hostx_load_keymap(); - if (!ephyrKeySyms.minKeyCode) { - ErrorF("Couldn't load keymap from host\n"); - return BadAlloc; + + if (hostx_load_keymap(&keySyms, modmap, &controls)) { + XkbApplyMappingChange(ki->dixdev, &keySyms, + keySyms.minKeyCode, + keySyms.maxKeyCode - keySyms.minKeyCode + 1, + modmap, serverClient); + XkbDDXChangeControls(ki->dixdev, &controls, &controls); + free(keySyms.map); } - ki->minScanCode = ephyrKeySyms.minKeyCode; - ki->maxScanCode = ephyrKeySyms.maxKeyCode; - free(ki->name); + + ki->minScanCode = keySyms.minKeyCode; + ki->maxScanCode = keySyms.maxKeyCode; + + if (ki->name != NULL) { + free(ki->name); + } + ki->name = strdup("Xephyr virtual keyboard"); ephyrKbd = ki; return Success; diff --git a/xserver/hw/kdrive/ephyr/ephyr.h b/xserver/hw/kdrive/ephyr/ephyr.h index 18bfe11ff..b48a21ce2 100644 --- a/xserver/hw/kdrive/ephyr/ephyr.h +++ b/xserver/hw/kdrive/ephyr/ephyr.h @@ -27,7 +27,6 @@ #define _EPHYR_H_ #include #include -#include #include #include @@ -85,6 +84,8 @@ typedef struct _ephyrScrPriv { int mynum; /* Screen number */ unsigned long cmap[256]; + ScreenBlockHandlerProcPtr BlockHandler; + /** * Per-screen Xlib-using state for glamor (private to * ephyr_glamor_glx.c) @@ -168,9 +169,6 @@ Bool Bool ephyrCreateColormap(ColormapPtr pmap); -void - ephyrPoll(void); - #ifdef RANDR Bool ephyrRandRGetInfo(ScreenPtr pScreen, Rotation * rotations); diff --git a/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c b/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c index 2f219141e..007123c31 100644 --- a/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c +++ b/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c @@ -57,6 +57,7 @@ static Display *dpy; static XVisualInfo *visual_info; static GLXFBConfig fb_config; Bool ephyr_glamor_gles2; +Bool ephyr_glamor_skip_present; /** @} */ /** @@ -220,6 +221,13 @@ ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor, { GLint old_vao; + /* Skip presenting the output in this mode. Presentation is + * expensive, and if we're just running the X Test suite headless, + * nobody's watching. + */ + if (ephyr_glamor_skip_present) + return; + glXMakeCurrent(dpy, glamor->glx_win, glamor->ctx); if (glamor->vao) { diff --git a/xserver/hw/kdrive/ephyr/ephyrdri.c b/xserver/hw/kdrive/ephyr/ephyrdri.c deleted file mode 100644 index 1e34301e1..000000000 --- a/xserver/hw/kdrive/ephyr/ephyrdri.c +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: - * Dodji Seketeli - */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include "hostx.h" -#include "ephyrdri.h" -#define _HAVE_XALLOC_DECLS -#include "ephyrlog.h" -#include "dixstruct.h" -#include "pixmapstr.h" - -#ifndef TRUE -#define TRUE 1 -#endif /*TRUE*/ -#ifndef FALSE -#define FALSE 0 -#endif /*FALSE*/ - Bool -ephyrDRIQueryDirectRenderingCapable(int a_screen, Bool *a_is_capable) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - xcb_xf86dri_query_direct_rendering_capable_cookie_t cookie; - xcb_xf86dri_query_direct_rendering_capable_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(a_is_capable, FALSE); - EPHYR_LOG("enter\n"); - cookie = xcb_xf86dri_query_direct_rendering_capable(conn, - hostx_get_screen()); - reply = xcb_xf86dri_query_direct_rendering_capable_reply(conn, cookie, NULL); - if (reply) { - is_ok = TRUE; - *a_is_capable = reply->is_capable; - free(reply); - } - EPHYR_LOG("leave. is_capable:%d, is_ok=%d\n", *a_is_capable, is_ok); - - return is_ok; -} - -Bool -ephyrDRIOpenConnection(int a_screen, - drm_handle_t * a_sarea, char **a_bus_id_string) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - xcb_xf86dri_open_connection_cookie_t cookie; - xcb_xf86dri_open_connection_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(a_bus_id_string, FALSE); - EPHYR_LOG("enter. screen:%d\n", a_screen); - cookie = xcb_xf86dri_open_connection(conn, hostx_get_screen()); - reply = xcb_xf86dri_open_connection_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_sarea = reply->sarea_handle_low; - if (sizeof(drm_handle_t) == 8) { - int shift = 32; - *a_sarea |= ((drm_handle_t) reply->sarea_handle_high) << shift; - } - *a_bus_id_string = malloc(reply->bus_id_len + 1); - if (!*a_bus_id_string) - goto out; - memcpy(*a_bus_id_string, xcb_xf86dri_open_connection_bus_id(reply), reply->bus_id_len); - *a_bus_id_string[reply->bus_id_len] = '\0'; - is_ok = TRUE; -out: - free(reply); - EPHYR_LOG("leave. bus_id_string:%s, is_ok:%d\n", *a_bus_id_string, is_ok); - return is_ok; -} - -Bool -ephyrDRIAuthConnection(int a_screen, drm_magic_t a_magic) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - xcb_xf86dri_auth_connection_cookie_t cookie; - xcb_xf86dri_auth_connection_reply_t *reply; - Bool is_ok = FALSE; - - EPHYR_LOG("enter\n"); - cookie = xcb_xf86dri_auth_connection(conn, screen, a_magic); - reply = xcb_xf86dri_auth_connection_reply(conn, cookie, NULL); - is_ok = reply->authenticated; - free(reply); - EPHYR_LOG("leave. is_ok:%d\n", is_ok); - return is_ok; -} - -Bool -ephyrDRICloseConnection(int a_screen) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - - EPHYR_LOG("enter\n"); - xcb_xf86dri_close_connection(conn, screen); - EPHYR_LOG("leave\n"); - return TRUE; -} - -Bool -ephyrDRIGetClientDriverName(int a_screen, - int *a_ddx_driver_major_version, - int *a_ddx_driver_minor_version, - int *a_ddx_driver_patch_version, - char **a_client_driver_name) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - xcb_xf86dri_get_client_driver_name_cookie_t cookie; - xcb_xf86dri_get_client_driver_name_reply_t *reply; - Bool is_ok = FALSE; - - EPHYR_RETURN_VAL_IF_FAIL(a_ddx_driver_major_version - && a_ddx_driver_minor_version - && a_ddx_driver_patch_version - && a_client_driver_name, FALSE); - EPHYR_LOG("enter\n"); - cookie = xcb_xf86dri_get_client_driver_name(conn, screen); - reply = xcb_xf86dri_get_client_driver_name_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_ddx_driver_major_version = reply->client_driver_major_version; - *a_ddx_driver_minor_version = reply->client_driver_minor_version; - *a_ddx_driver_patch_version = reply->client_driver_patch_version; - *a_client_driver_name = malloc(reply->client_driver_name_len + 1); - if (!*a_client_driver_name) - goto out; - memcpy(*a_client_driver_name, - xcb_xf86dri_get_client_driver_name_client_driver_name(reply), - reply->client_driver_name_len); - (*a_client_driver_name)[reply->client_driver_name_len] = '\0'; - is_ok = TRUE; - EPHYR_LOG("major:%d, minor:%d, patch:%d, name:%s\n", - *a_ddx_driver_major_version, - *a_ddx_driver_minor_version, - *a_ddx_driver_patch_version, *a_client_driver_name); - out: - free(reply); - EPHYR_LOG("leave:%d\n", is_ok); - return is_ok; -} - -Bool -ephyrDRICreateContext(int a_screen, - int a_visual_id, - CARD32 ctxt_id, drm_context_t * a_hw_ctxt) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - Bool is_ok = FALSE; - xcb_xf86dri_create_context_cookie_t cookie; - xcb_xf86dri_create_context_reply_t *reply; - - ctxt_id = xcb_generate_id(conn); - - EPHYR_LOG("enter. screen:%d, visual:%d\n", a_screen, a_visual_id); - cookie = xcb_xf86dri_create_context(conn, screen, a_visual_id, ctxt_id); - reply = xcb_xf86dri_create_context_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_hw_ctxt = reply->hw_context; - is_ok = TRUE; -out: - free(reply); - EPHYR_LOG("leave:%d\n", is_ok); - return is_ok; -} - -Bool -ephyrDRIDestroyContext(int a_screen, int a_context_id) -{ - xcb_connection_t *conn = hostx_get_xcbconn (); - int screen = hostx_get_screen(); - - EPHYR_LOG("enter\n"); - xcb_xf86dri_destroy_context(conn, screen, a_context_id); - EPHYR_LOG("leave\n"); - return TRUE; -} - -Bool -ephyrDRICreateDrawable(int a_screen, - int a_drawable, drm_drawable_t * a_hw_drawable) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - xcb_xf86dri_create_drawable_cookie_t cookie; - xcb_xf86dri_create_drawable_reply_t *reply; - - EPHYR_LOG("enter\n"); - cookie = xcb_xf86dri_create_drawable(conn, screen, a_drawable); - reply = xcb_xf86dri_create_drawable_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_hw_drawable = reply->hw_drawable_handle; - is_ok = TRUE; -out: - free(reply); - EPHYR_LOG("leave. is_ok:%d\n", is_ok); - return is_ok; -} - -Bool -ephyrDRIDestroyDrawable(int a_screen, int a_drawable) -{ - EPHYR_LOG("enter\n"); - EPHYR_LOG_ERROR("not implemented yet\n"); - EPHYR_LOG("leave\n"); - return FALSE; -} - -Bool -ephyrDRIGetDrawableInfo(int a_screen, - int a_drawable, - unsigned int *a_index, - unsigned int *a_stamp, - int *a_x, - int *a_y, - int *a_w, - int *a_h, - int *a_num_clip_rects, - drm_clip_rect_t ** a_clip_rects, - int *a_back_x, - int *a_back_y, - int *a_num_back_clip_rects, - drm_clip_rect_t ** a_back_clip_rects) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - xcb_xf86dri_get_drawable_info_cookie_t cookie; - xcb_xf86dri_get_drawable_info_reply_t *reply = NULL; - EphyrHostWindowAttributes attrs; - - EPHYR_RETURN_VAL_IF_FAIL(a_x && a_y && a_w && a_h - && a_num_clip_rects, FALSE); - - EPHYR_LOG("enter\n"); - memset(&attrs, 0, sizeof(attrs)); - if (!hostx_get_window_attributes(a_drawable, &attrs)) { - EPHYR_LOG_ERROR("failed to query host window attributes\n"); - goto out; - } - cookie = xcb_xf86dri_get_drawable_info(conn, screen, a_drawable); - reply = xcb_xf86dri_get_drawable_info_reply(conn, cookie, NULL); - if (!reply) { - EPHYR_LOG_ERROR ("XF86DRIGetDrawableInfo ()\n"); - goto out; - } - *a_index = reply->drawable_table_index; - *a_stamp = reply->drawable_table_stamp; - *a_x = reply->drawable_origin_X; - *a_y = reply->drawable_origin_Y; - *a_w = reply->drawable_size_W; - *a_h = reply->drawable_size_H; - *a_num_clip_rects = reply->num_clip_rects; - *a_clip_rects = calloc(*a_num_clip_rects, sizeof(drm_clip_rect_t)); - memcpy(*a_clip_rects, xcb_xf86dri_get_drawable_info_clip_rects(reply), - *a_num_clip_rects * sizeof(drm_clip_rect_t)); - EPHYR_LOG("host x,y,w,h: (%d,%d,%d,%d)\n", *a_x, *a_y, *a_w, *a_h); - if (*a_num_clip_rects) { - free(*a_back_clip_rects); - *a_back_clip_rects = calloc(*a_num_clip_rects, sizeof(drm_clip_rect_t)); - memmove(*a_back_clip_rects, - *a_clip_rects, *a_num_clip_rects * sizeof(drm_clip_rect_t)); - *a_num_back_clip_rects = *a_num_clip_rects; - } - EPHYR_LOG("num back clip rects:%d, num clip rects:%d\n", - *a_num_clip_rects, *a_num_back_clip_rects); - *a_back_x = *a_x; - *a_back_y = *a_y; - *a_w = attrs.width; - *a_h = attrs.height; - - is_ok = TRUE; - out: - EPHYR_LOG("leave. index:%d, stamp:%d, x,y:(%d,%d), w,y:(%d,%d)\n", - *a_index, *a_stamp, *a_x, *a_y, *a_w, *a_h); - free(reply); - return is_ok; -} - -Bool -ephyrDRIGetDeviceInfo(int a_screen, - drm_handle_t * a_frame_buffer, - int *a_fb_origin, - int *a_fb_size, - int *a_fb_stride, - int *a_dev_private_size, void **a_dev_private) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn (); - int screen = hostx_get_screen(); - xcb_xf86dri_get_device_info_cookie_t cookie; - xcb_xf86dri_get_device_info_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(conn, FALSE); - EPHYR_LOG("enter\n"); - cookie = xcb_xf86dri_get_device_info(conn, screen); - reply = xcb_xf86dri_get_device_info_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_frame_buffer = reply->framebuffer_handle_low; - if (sizeof(drm_handle_t) == 8) { - int shift = 32; - *a_frame_buffer |= ((drm_handle_t)reply->framebuffer_handle_high) << shift; - } - *a_fb_origin = reply->framebuffer_origin_offset; - *a_fb_size = reply->framebuffer_size; - *a_fb_stride = reply->framebuffer_stride; - *a_dev_private_size = reply->device_private_size; - *a_dev_private = calloc(reply->device_private_size, 1); - if (!*a_dev_private) - goto out; - memcpy(*a_dev_private, - xcb_xf86dri_get_device_info_device_private(reply), - reply->device_private_size); - is_ok = TRUE; -out: - free(reply); - EPHYR_LOG("leave:%d\n", is_ok); - return is_ok; -} diff --git a/xserver/hw/kdrive/ephyr/ephyrdri.h b/xserver/hw/kdrive/ephyr/ephyrdri.h deleted file mode 100644 index b312e62d9..000000000 --- a/xserver/hw/kdrive/ephyr/ephyrdri.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: - * Dodji Seketeli - */ - -#ifndef __EPHYRDRI_H__ -#define __EPHYRDRI_H__ - -#include - -Bool ephyrDRIQueryDirectRenderingCapable(int a_screen, Bool *a_is_capable); -Bool ephyrDRIOpenConnection(int screen, drm_handle_t * a_sarea, - char **a_bus_id_string); -Bool ephyrDRIAuthConnection(int a_screen, drm_magic_t a_magic); -Bool ephyrDRICloseConnection(int a_screen); -Bool ephyrDRIGetClientDriverName(int a_screen, - int *a_ddx_driver_major_version, - int *a_ddx_driver_minor_version, - int *a_ddx_driver_patch_version, - char **a_client_driver_name); -Bool ephyrDRICreateContext(int a_screen, - int a_visual_id, - CARD32 ctx_id, drm_context_t * a_hw_ctx); -Bool ephyrDRIDestroyContext(int a_screen, int a_context_id); -Bool ephyrDRICreateDrawable(int a_screen, - int a_drawable, drm_drawable_t * a_hw_drawable); -Bool ephyrDRIDestroyDrawable(int a_screen, int a_drawable); -Bool ephyrDRIGetDrawableInfo(int a_screen, int /*Drawable */ a_drawable, - unsigned int *a_index, - unsigned int *a_stamp, - int *a_x, - int *a_y, - int *a_w, - int *a_h, - int *a_num_clip_rects, - drm_clip_rect_t ** a_clip_rects, - int *a_back_x, - int *a_back_y, - int *num_back_clip_rects, - drm_clip_rect_t ** a_back_clip_rects); -Bool ephyrDRIGetDeviceInfo(int a_screen, - drm_handle_t * a_frame_buffer, - int *a_fb_origin, - int *a_fb_size, - int *a_fb_stride, - int *a_dev_private_size, void **a_dev_private); -#endif /*__EPHYRDRI_H__*/ diff --git a/xserver/hw/kdrive/ephyr/ephyrdriext.c b/xserver/hw/kdrive/ephyr/ephyrdriext.c deleted file mode 100644 index 3703adf8c..000000000 --- a/xserver/hw/kdrive/ephyr/ephyrdriext.c +++ /dev/null @@ -1,1376 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * This file is heavily copied from hw/xfree86/dri/xf86dri.c - * - * Authors: - * Dodji Seketeli - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include -#include -#define _XF86DRI_SERVER_ -#include -#include -#include -#include -#include -#include "misc.h" -#include "privates.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "servermd.h" -#include "swaprep.h" -#include "ephyrdri.h" -#include "ephyrdriext.h" -#include "hostx.h" -#define _HAVE_XALLOC_DECLS -#include "ephyrlog.h" -#include "protocol-versions.h" - -typedef struct { - int foo; -} EphyrDRIWindowPrivRec; -typedef EphyrDRIWindowPrivRec *EphyrDRIWindowPrivPtr; - -typedef struct { - CreateWindowProcPtr CreateWindow; - DestroyWindowProcPtr DestroyWindow; - MoveWindowProcPtr MoveWindow; - PositionWindowProcPtr PositionWindow; - ClipNotifyProcPtr ClipNotify; -} EphyrDRIScreenPrivRec; -typedef EphyrDRIScreenPrivRec *EphyrDRIScreenPrivPtr; - -static int DRIErrorBase; - -static Bool ephyrDRIScreenInit(ScreenPtr a_screen); -static Bool ephyrDRICreateWindow(WindowPtr a_win); -static Bool ephyrDRIDestroyWindow(WindowPtr a_win); -static void ephyrDRIMoveWindow(WindowPtr a_win, - int a_x, int a_y, - WindowPtr a_siblings, VTKind a_kind); -static Bool ephyrDRIPositionWindow(WindowPtr a_win, int x, int y); -static void ephyrDRIClipNotify(WindowPtr a_win, int a_x, int a_y); - -static Bool EphyrMirrorHostVisuals(ScreenPtr a_screen); -static Bool destroyHostPeerWindow(const WindowPtr a_win); -static Bool findWindowPairFromLocal(WindowPtr a_local, - EphyrWindowPair ** a_pair); - -static unsigned char DRIReqCode = 0; - -static DevPrivateKeyRec ephyrDRIWindowKeyRec; - -#define ephyrDRIWindowKey (&ephyrDRIWindowKeyRec) -static DevPrivateKeyRec ephyrDRIScreenKeyRec; - -#define ephyrDRIScreenKey (&ephyrDRIScreenKeyRec) - -#define GET_EPHYR_DRI_WINDOW_PRIV(win) ((EphyrDRIWindowPrivPtr) \ - dixLookupPrivate(&(win)->devPrivates, ephyrDRIWindowKey)) -#define GET_EPHYR_DRI_SCREEN_PRIV(screen) ((EphyrDRIScreenPrivPtr) \ - dixLookupPrivate(&(screen)->devPrivates, ephyrDRIScreenKey)) - -static Bool -ephyrDRIScreenInit(ScreenPtr a_screen) -{ - Bool is_ok = FALSE; - EphyrDRIScreenPrivPtr screen_priv = NULL; - - EPHYR_RETURN_VAL_IF_FAIL(a_screen, FALSE); - - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(a_screen); - EPHYR_RETURN_VAL_IF_FAIL(screen_priv, FALSE); - - screen_priv->CreateWindow = a_screen->CreateWindow; - screen_priv->DestroyWindow = a_screen->DestroyWindow; - screen_priv->MoveWindow = a_screen->MoveWindow; - screen_priv->PositionWindow = a_screen->PositionWindow; - screen_priv->ClipNotify = a_screen->ClipNotify; - - a_screen->CreateWindow = ephyrDRICreateWindow; - a_screen->DestroyWindow = ephyrDRIDestroyWindow; - a_screen->MoveWindow = ephyrDRIMoveWindow; - a_screen->PositionWindow = ephyrDRIPositionWindow; - a_screen->ClipNotify = ephyrDRIClipNotify; - - is_ok = TRUE; - - return is_ok; -} - -static Bool -ephyrDRICreateWindow(WindowPtr a_win) -{ - Bool is_ok = FALSE; - ScreenPtr screen = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - - EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); - screen = a_win->drawable.pScreen; - EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); - EPHYR_RETURN_VAL_IF_FAIL(screen_priv && screen_priv->CreateWindow, FALSE); - - EPHYR_LOG("enter. win:%p\n", a_win); - - screen->CreateWindow = screen_priv->CreateWindow; - is_ok = (*screen->CreateWindow) (a_win); - screen->CreateWindow = ephyrDRICreateWindow; - - if (is_ok) { - dixSetPrivate(&a_win->devPrivates, ephyrDRIWindowKey, NULL); - } - return is_ok; -} - -static Bool -ephyrDRIDestroyWindow(WindowPtr a_win) -{ - Bool is_ok = FALSE; - ScreenPtr screen = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - - EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); - screen = a_win->drawable.pScreen; - EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); - EPHYR_RETURN_VAL_IF_FAIL(screen_priv && screen_priv->DestroyWindow, FALSE); - - screen->DestroyWindow = screen_priv->DestroyWindow; - if (screen->DestroyWindow) { - is_ok = (*screen->DestroyWindow) (a_win); - } - screen->DestroyWindow = ephyrDRIDestroyWindow; - - if (is_ok) { - EphyrDRIWindowPrivPtr win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); - - if (win_priv) { - destroyHostPeerWindow(a_win); - free(win_priv); - dixSetPrivate(&a_win->devPrivates, ephyrDRIWindowKey, NULL); - EPHYR_LOG("destroyed the remote peer window\n"); - } - } - return is_ok; -} - -static void -ephyrDRIMoveWindow(WindowPtr a_win, - int a_x, int a_y, WindowPtr a_siblings, VTKind a_kind) -{ - ScreenPtr screen = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - EphyrDRIWindowPrivPtr win_priv = NULL; - EphyrWindowPair *pair = NULL; - EphyrBox geo; - int x = 0, y = 0; /*coords relative to parent window */ - - EPHYR_RETURN_IF_FAIL(a_win); - - EPHYR_LOG("enter\n"); - screen = a_win->drawable.pScreen; - EPHYR_RETURN_IF_FAIL(screen); - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); - EPHYR_RETURN_IF_FAIL(screen_priv && screen_priv->MoveWindow); - - screen->MoveWindow = screen_priv->MoveWindow; - if (screen->MoveWindow) { - (*screen->MoveWindow) (a_win, a_x, a_y, a_siblings, a_kind); - } - screen->MoveWindow = ephyrDRIMoveWindow; - - EPHYR_LOG("window: %p\n", a_win); - if (!a_win->parent) { - EPHYR_LOG("cannot move root window\n"); - return; - } - win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); - if (!win_priv) { - EPHYR_LOG("not a DRI peered window\n"); - return; - } - if (!findWindowPairFromLocal(a_win, &pair) || !pair) { - EPHYR_LOG_ERROR("failed to get window pair\n"); - return; - } - /*compute position relative to parent window */ - x = a_win->drawable.x - a_win->parent->drawable.x; - y = a_win->drawable.y - a_win->parent->drawable.y; - /*set the geometry to pass to hostx_set_window_geometry */ - memset(&geo, 0, sizeof(geo)); - geo.x = x; - geo.y = y; - geo.width = a_win->drawable.width; - geo.height = a_win->drawable.height; - hostx_set_window_geometry(pair->remote, &geo); -} - -static Bool -ephyrDRIPositionWindow(WindowPtr a_win, int a_x, int a_y) -{ - Bool is_ok = FALSE; - ScreenPtr screen = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - EphyrDRIWindowPrivPtr win_priv = NULL; - EphyrWindowPair *pair = NULL; - EphyrBox geo; - - EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); - - EPHYR_LOG("enter\n"); - screen = a_win->drawable.pScreen; - EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); - EPHYR_RETURN_VAL_IF_FAIL(screen_priv && screen_priv->PositionWindow, FALSE); - - screen->PositionWindow = screen_priv->PositionWindow; - if (screen->PositionWindow) { - (*screen->PositionWindow) (a_win, a_x, a_y); - } - screen->PositionWindow = ephyrDRIPositionWindow; - - EPHYR_LOG("window: %p\n", a_win); - win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); - if (!win_priv) { - EPHYR_LOG("not a DRI peered window\n"); - is_ok = TRUE; - goto out; - } - if (!findWindowPairFromLocal(a_win, &pair) || !pair) { - EPHYR_LOG_ERROR("failed to get window pair\n"); - goto out; - } - /*set the geometry to pass to hostx_set_window_geometry */ - memset(&geo, 0, sizeof(geo)); - geo.x = a_x; - geo.y = a_y; - geo.width = a_win->drawable.width; - geo.height = a_win->drawable.height; - hostx_set_window_geometry(pair->remote, &geo); - is_ok = TRUE; - - out: - EPHYR_LOG("leave. is_ok:%d\n", is_ok); - /*do cleanup here */ - return is_ok; -} - -static void -ephyrDRIClipNotify(WindowPtr a_win, int a_x, int a_y) -{ - ScreenPtr screen = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - EphyrDRIWindowPrivPtr win_priv = NULL; - EphyrWindowPair *pair = NULL; - EphyrRect *rects = NULL; - int i = 0; - - EPHYR_RETURN_IF_FAIL(a_win); - - EPHYR_LOG("enter\n"); - screen = a_win->drawable.pScreen; - EPHYR_RETURN_IF_FAIL(screen); - screen_priv = GET_EPHYR_DRI_SCREEN_PRIV(screen); - EPHYR_RETURN_IF_FAIL(screen_priv && screen_priv->ClipNotify); - - screen->ClipNotify = screen_priv->ClipNotify; - if (screen->ClipNotify) { - (*screen->ClipNotify) (a_win, a_x, a_y); - } - screen->ClipNotify = ephyrDRIClipNotify; - - EPHYR_LOG("window: %p\n", a_win); - win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); - if (!win_priv) { - EPHYR_LOG("not a DRI peered window\n"); - goto out; - } - if (!findWindowPairFromLocal(a_win, &pair) || !pair) { - EPHYR_LOG_ERROR("failed to get window pair\n"); - goto out; - } - rects = calloc(RegionNumRects(&a_win->clipList), sizeof(EphyrRect)); - for (i = 0; i < RegionNumRects(&a_win->clipList); i++) { - memmove(&rects[i], - &RegionRects(&a_win->clipList)[i], sizeof(EphyrRect)); - rects[i].x1 -= a_win->drawable.x; - rects[i].x2 -= a_win->drawable.x; - rects[i].y1 -= a_win->drawable.y; - rects[i].y2 -= a_win->drawable.y; - } - /* - * push the clipping region of this window - * to the peer window in the host - */ - hostx_set_window_bounding_rectangles - (pair->remote, rects, RegionNumRects(&a_win->clipList)); - - out: - free(rects); - rects = NULL; - - EPHYR_LOG("leave.\n"); - /*do cleanup here */ -} - -/** - * Duplicates a visual of a_screen - * In screen a_screen, for depth a_depth, find a visual which - * bitsPerRGBValue and colormap size equal - * a_bits_per_rgb_values and a_colormap_entries. - * The ID of that duplicated visual is set to a_new_id. - * That duplicated visual is then added to the list of visuals - * of the screen. - */ -static Bool -EphyrDuplicateVisual(unsigned int a_screen, - short a_depth, - short a_class, - short a_bits_per_rgb_values, - short a_colormap_entries, - unsigned int a_red_mask, - unsigned int a_green_mask, - unsigned int a_blue_mask, unsigned int a_new_id) -{ - Bool is_ok = FALSE, found_visual = FALSE, found_depth = FALSE; - ScreenPtr screen = NULL; - VisualRec new_visual, *new_visuals = NULL; - int i = 0; - - EPHYR_LOG("enter\n"); - if (a_screen >= screenInfo.numScreens) { - EPHYR_LOG_ERROR("bad screen number\n"); - goto out; - } - memset(&new_visual, 0, sizeof(VisualRec)); - - /*get the screen pointed to by a_screen */ - screen = screenInfo.screens[a_screen]; - EPHYR_RETURN_VAL_IF_FAIL(screen, FALSE); - - /* - * In that screen, first look for an existing visual that has the - * same characteristics as those passed in parameter - * to this function and copy it. - */ - for (i = 0; i < screen->numVisuals; i++) { - if (screen->visuals[i].bitsPerRGBValue == a_bits_per_rgb_values && - screen->visuals[i].ColormapEntries == a_colormap_entries) { - /*copy the visual found */ - memcpy(&new_visual, &screen->visuals[i], sizeof(new_visual)); - new_visual.vid = a_new_id; - new_visual.class = a_class; - new_visual.redMask = a_red_mask; - new_visual.greenMask = a_green_mask; - new_visual.blueMask = a_blue_mask; - found_visual = TRUE; - EPHYR_LOG("found a visual that matches visual id: %d\n", a_new_id); - break; - } - } - if (!found_visual) { - EPHYR_LOG("did not find any visual matching %d\n", a_new_id); - goto out; - } - /* - * be prepare to extend screen->visuals to add new_visual to it - */ - new_visuals = calloc(screen->numVisuals + 1, sizeof(VisualRec)); - memmove(new_visuals, - screen->visuals, screen->numVisuals * sizeof(VisualRec)); - memmove(&new_visuals[screen->numVisuals], &new_visual, sizeof(VisualRec)); - /* - * Now, in that same screen, update the screen->allowedDepths member. - * In that array, each element represents the visuals applicable to - * a given depth. So we need to add an entry matching the new visual - * that we are going to add to screen->visuals - */ - for (i = 0; i < screen->numDepths; i++) { - VisualID *vids = NULL; - DepthPtr cur_depth = NULL; - - /*find the entry matching a_depth */ - if (screen->allowedDepths[i].depth != a_depth) - continue; - cur_depth = &screen->allowedDepths[i]; - /* - * extend the list of visual IDs in that entry, - * so to add a_new_id in there. - */ - vids = reallocarray(cur_depth->vids, - cur_depth->numVids + 1, sizeof(VisualID)); - if (!vids) { - EPHYR_LOG_ERROR("failed to realloc numids\n"); - goto out; - } - vids[cur_depth->numVids] = a_new_id; - /* - * Okay now commit our change. - * Do really update screen->allowedDepths[i] - */ - cur_depth->numVids++; - cur_depth->vids = vids; - found_depth = TRUE; - } - if (!found_depth) { - EPHYR_LOG_ERROR("failed to update screen[%d]->allowedDepth\n", - a_screen); - goto out; - } - /* - * Commit our change to screen->visuals - */ - free(screen->visuals); - screen->visuals = new_visuals; - screen->numVisuals++; - new_visuals = NULL; - - is_ok = TRUE; - out: - free(new_visuals); - new_visuals = NULL; - - EPHYR_LOG("leave\n"); - return is_ok; -} - -/** - * Duplicates the visuals of the host X server. - * This is necessary to have visuals that have the same - * ID as those of the host X. It is important to have that for - * GLX. - */ -static Bool -EphyrMirrorHostVisuals(ScreenPtr a_screen) -{ - Bool is_ok = FALSE; - EphyrHostVisualInfo *visuals = NULL; - int nb_visuals = 0, i = 0; - - EPHYR_LOG("enter\n"); - if (!hostx_get_visuals_info(&visuals, &nb_visuals)) { - EPHYR_LOG_ERROR("failed to get host visuals\n"); - goto out; - } - for (i = 0; i < nb_visuals; i++) { - if (!EphyrDuplicateVisual(a_screen->myNum, - visuals[i].depth, - visuals[i].class, - visuals[i].bits_per_rgb, - visuals[i].colormap_size, - visuals[i].red_mask, - visuals[i].green_mask, - visuals[i].blue_mask, visuals[i].visualid)) { - EPHYR_LOG_ERROR("failed to duplicate host visual %d\n", - (int) visuals[i].visualid); - } - } - - is_ok = TRUE; - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -static int -ProcXF86DRIQueryVersion(register ClientPtr client) -{ - xXF86DRIQueryVersionReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .majorVersion = SERVER_XF86DRI_MAJOR_VERSION, - .minorVersion = SERVER_XF86DRI_MINOR_VERSION, - .patchVersion = SERVER_XF86DRI_PATCH_VERSION - }; - - REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq); - - EPHYR_LOG("enter\n"); - - if (client->swapped) { - swaps(&rep.sequenceNumber); - swapl(&rep.length); - swaps(&rep.majorVersion); - swaps(&rep.minorVersion); - swapl(&rep.patchVersion); - } - WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), &rep); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) -{ - xXF86DRIQueryDirectRenderingCapableReply rep; - Bool isCapable; - - REQUEST(xXF86DRIQueryDirectRenderingCapableReq); - REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!ephyrDRIQueryDirectRenderingCapable(stuff->screen, &isCapable)) { - return BadValue; - } - - if (!client->local || client->swapped) - isCapable = 0; - - rep = (xXF86DRIQueryDirectRenderingCapableReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .isCapable = isCapable - }; - - if (client->swapped) { - swaps(&rep.sequenceNumber); - swapl(&rep.length); - } - - WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), - &rep); - EPHYR_LOG("leave\n"); - - return Success; -} - -static int -ProcXF86DRIOpenConnection(register ClientPtr client) -{ - xXF86DRIOpenConnectionReply rep; - drm_handle_t hSAREA; - char *busIdString = NULL; - CARD32 busIdStringLength = 0; - - REQUEST(xXF86DRIOpenConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!ephyrDRIOpenConnection(stuff->screen, &hSAREA, &busIdString)) { - return BadValue; - } - - if (busIdString) - busIdStringLength = strlen(busIdString); - - rep = (xXF86DRIOpenConnectionReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) - - SIZEOF(xGenericReply) + - pad_to_int32(busIdStringLength)), - .hSAREALow = (CARD32) (hSAREA & 0xffffffff), -#if defined(LONG64) && !defined(__linux__) - .hSAREAHigh = (CARD32) (hSAREA >> 32), -#else - .hSAREAHigh = 0, -#endif - .busIdStringLength = busIdStringLength - }; - - WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), &rep); - if (busIdStringLength) - WriteToClient(client, busIdStringLength, busIdString); - free(busIdString); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIAuthConnection(register ClientPtr client) -{ - xXF86DRIAuthConnectionReply rep; - - REQUEST(xXF86DRIAuthConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep = (xXF86DRIAuthConnectionReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .authenticated = 1 - }; - - if (!ephyrDRIAuthConnection(stuff->screen, stuff->magic)) { - ErrorF("Failed to authenticate %lu\n", (unsigned long) stuff->magic); - rep.authenticated = 0; - } - WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), &rep); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRICloseConnection(register ClientPtr client) -{ - REQUEST(xXF86DRICloseConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRICloseConnectionReq); - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - /* - DRICloseConnection( screenInfo.screens[stuff->screen]); - */ - - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIGetClientDriverName(register ClientPtr client) -{ - xXF86DRIGetClientDriverNameReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .clientDriverNameLength = 0 - }; - char *clientDriverName; - - REQUEST(xXF86DRIGetClientDriverNameReq); - REQUEST_SIZE_MATCH(xXF86DRIGetClientDriverNameReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - ephyrDRIGetClientDriverName(stuff->screen, - (int *) &rep.ddxDriverMajorVersion, - (int *) &rep.ddxDriverMinorVersion, - (int *) &rep.ddxDriverPatchVersion, - &clientDriverName); - if (clientDriverName) - rep.clientDriverNameLength = strlen(clientDriverName); - rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetClientDriverNameReply) - - SIZEOF(xGenericReply) + - pad_to_int32(rep.clientDriverNameLength)); - - WriteToClient(client, sizeof(xXF86DRIGetClientDriverNameReply), &rep); - if (rep.clientDriverNameLength) - WriteToClient(client, rep.clientDriverNameLength, clientDriverName); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRICreateContext(register ClientPtr client) -{ - xXF86DRICreateContextReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0 - }; - ScreenPtr pScreen; - VisualPtr visual; - int i = 0; - - REQUEST(xXF86DRICreateContextReq); - REQUEST_SIZE_MATCH(xXF86DRICreateContextReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - pScreen = screenInfo.screens[stuff->screen]; - visual = pScreen->visuals; - - /* Find the requested X visual */ - for (i = 0; i < pScreen->numVisuals; i++, visual++) - if (visual->vid == stuff->visual) - break; - if (i == pScreen->numVisuals) { - /* No visual found */ - return BadValue; - } - - if (!ephyrDRICreateContext(stuff->screen, - stuff->visual, - stuff->context, - (drm_context_t *) &rep.hHWContext)) { - return BadValue; - } - - WriteToClient(client, sizeof(xXF86DRICreateContextReply), &rep); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIDestroyContext(register ClientPtr client) -{ - REQUEST(xXF86DRIDestroyContextReq); - REQUEST_SIZE_MATCH(xXF86DRIDestroyContextReq); - EPHYR_LOG("enter\n"); - - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!ephyrDRIDestroyContext(stuff->screen, stuff->context)) { - return BadValue; - } - - EPHYR_LOG("leave\n"); - return Success; -} - -static Bool -getWindowVisual(const WindowPtr a_win, VisualPtr * a_visual) -{ - int i = 0, visual_id = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_win - && a_win->drawable.pScreen - && a_win->drawable.pScreen->visuals, FALSE); - - visual_id = wVisual(a_win); - for (i = 0; i < a_win->drawable.pScreen->numVisuals; i++) { - if (a_win->drawable.pScreen->visuals[i].vid == visual_id) { - *a_visual = &a_win->drawable.pScreen->visuals[i]; - return TRUE; - } - } - return FALSE; -} - -#define NUM_WINDOW_PAIRS 256 -static EphyrWindowPair window_pairs[NUM_WINDOW_PAIRS]; - -static Bool -appendWindowPairToList(WindowPtr a_local, int a_remote) -{ - int i = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_local, FALSE); - - EPHYR_LOG("(local,remote):(%p, %d)\n", a_local, a_remote); - - for (i = 0; i < NUM_WINDOW_PAIRS; i++) { - if (window_pairs[i].local == NULL) { - window_pairs[i].local = a_local; - window_pairs[i].remote = a_remote; - return TRUE; - } - } - return FALSE; -} - -static Bool -findWindowPairFromLocal(WindowPtr a_local, EphyrWindowPair ** a_pair) -{ - int i = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_pair && a_local, FALSE); - - for (i = 0; i < NUM_WINDOW_PAIRS; i++) { - if (window_pairs[i].local == a_local) { - *a_pair = &window_pairs[i]; - EPHYR_LOG("found (%p, %d)\n", (*a_pair)->local, (*a_pair)->remote); - return TRUE; - } - } - return FALSE; -} - -Bool -findWindowPairFromRemote(int a_remote, EphyrWindowPair ** a_pair) -{ - int i = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_pair, FALSE); - - for (i = 0; i < NUM_WINDOW_PAIRS; i++) { - if (window_pairs[i].remote == a_remote) { - *a_pair = &window_pairs[i]; - EPHYR_LOG("found (%p, %d)\n", (*a_pair)->local, (*a_pair)->remote); - return TRUE; - } - } - return FALSE; -} - -static Bool -createHostPeerWindow(const WindowPtr a_win, int *a_peer_win) -{ - Bool is_ok = FALSE; - VisualPtr visual = NULL; - EphyrBox geo; - - EPHYR_RETURN_VAL_IF_FAIL(a_win && a_peer_win, FALSE); - EPHYR_RETURN_VAL_IF_FAIL(a_win->drawable.pScreen, FALSE); - - EPHYR_LOG("enter. a_win '%p'\n", a_win); - if (!getWindowVisual(a_win, &visual)) { - EPHYR_LOG_ERROR("failed to get window visual\n"); - goto out; - } - if (!visual) { - EPHYR_LOG_ERROR("failed to create visual\n"); - goto out; - } - memset(&geo, 0, sizeof(geo)); - geo.x = a_win->drawable.x; - geo.y = a_win->drawable.y; - geo.width = a_win->drawable.width; - geo.height = a_win->drawable.height; - if (!hostx_create_window(a_win->drawable.pScreen->myNum, - &geo, visual->vid, a_peer_win)) { - EPHYR_LOG_ERROR("failed to create host peer window\n"); - goto out; - } - if (!appendWindowPairToList(a_win, *a_peer_win)) { - EPHYR_LOG_ERROR("failed to append window to pair list\n"); - goto out; - } - is_ok = TRUE; - out: - EPHYR_LOG("leave:remote win%d\n", *a_peer_win); - return is_ok; -} - -static Bool -destroyHostPeerWindow(const WindowPtr a_win) -{ - Bool is_ok = FALSE; - EphyrWindowPair *pair = NULL; - - EPHYR_RETURN_VAL_IF_FAIL(a_win, FALSE); - - EPHYR_LOG("enter\n"); - - if (!findWindowPairFromLocal(a_win, &pair) || !pair) { - EPHYR_LOG_ERROR("failed to find peer to local window\n"); - goto out; - } - hostx_destroy_window(pair->remote); - is_ok = TRUE; - - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -static int -ProcXF86DRICreateDrawable(ClientPtr client) -{ - xXF86DRICreateDrawableReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0 - }; - DrawablePtr drawable = NULL; - WindowPtr window = NULL; - EphyrWindowPair *pair = NULL; - EphyrDRIWindowPrivPtr win_priv = NULL; - int rc = 0, remote_win = 0; - - REQUEST(xXF86DRICreateDrawableReq); - REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0, - DixReadAccess); - if (rc != Success) - return rc; - if (drawable->type != DRAWABLE_WINDOW) { - EPHYR_LOG_ERROR("non drawable windows are not yet supported\n"); - return BadImplementation; - } - EPHYR_LOG("lookedup drawable %p\n", drawable); - window = (WindowPtr) drawable; - if (findWindowPairFromLocal(window, &pair) && pair) { - remote_win = pair->remote; - EPHYR_LOG("found window '%p' paire with remote '%d'\n", - window, remote_win); - } - else if (!createHostPeerWindow(window, &remote_win)) { - EPHYR_LOG_ERROR("failed to create host peer window\n"); - return BadAlloc; - } - - if (!ephyrDRICreateDrawable(stuff->screen, - remote_win, - (drm_drawable_t *) &rep.hHWDrawable)) { - EPHYR_LOG_ERROR("failed to create dri drawable\n"); - return BadValue; - } - - win_priv = GET_EPHYR_DRI_WINDOW_PRIV(window); - if (!win_priv) { - win_priv = calloc(1, sizeof(EphyrDRIWindowPrivRec)); - if (!win_priv) { - EPHYR_LOG_ERROR("failed to allocate window private\n"); - return BadAlloc; - } - dixSetPrivate(&window->devPrivates, ephyrDRIWindowKey, win_priv); - EPHYR_LOG("paired window '%p' with remote '%d'\n", window, remote_win); - } - - WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), &rep); - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIDestroyDrawable(register ClientPtr client) -{ - DrawablePtr drawable = NULL; - WindowPtr window = NULL; - EphyrWindowPair *pair = NULL; - int rc = 0; - - REQUEST(xXF86DRIDestroyDrawableReq); - REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rc = dixLookupDrawable(&drawable, - stuff->drawable, client, 0, DixReadAccess); - if (rc != Success) - return rc; - if (drawable->type != DRAWABLE_WINDOW) { - EPHYR_LOG_ERROR("non drawable windows are not yet supported\n"); - return BadImplementation; - } - window = (WindowPtr) drawable; - if (!findWindowPairFromLocal(window, &pair) && pair) { - EPHYR_LOG_ERROR("failed to find pair window\n"); - return BadImplementation; - } - if (!ephyrDRIDestroyDrawable(stuff->screen, - pair->remote /*drawable in host x */ )) { - EPHYR_LOG_ERROR("failed to destroy dri drawable\n"); - return BadImplementation; - } - pair->local = NULL; - pair->remote = 0; - - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIGetDrawableInfo(register ClientPtr client) -{ - xXF86DRIGetDrawableInfoReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0 - }; - DrawablePtr drawable; - WindowPtr window = NULL; - EphyrWindowPair *pair = NULL; - int X = 0, Y = 0, W = 0, H = 0, backX = 0, backY = 0, rc = 0, i = 0; - drm_clip_rect_t *clipRects = NULL; - drm_clip_rect_t *backClipRects = NULL; - - REQUEST(xXF86DRIGetDrawableInfoReq); - REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0, - DixReadAccess); - if (rc != Success || !drawable) { - EPHYR_LOG_ERROR("could not get drawable\n"); - return rc; - } - - if (drawable->type != DRAWABLE_WINDOW) { - EPHYR_LOG_ERROR("non windows type drawables are not yes supported\n"); - return BadImplementation; - } - window = (WindowPtr) drawable; - memset(&pair, 0, sizeof(pair)); - if (!findWindowPairFromLocal(window, &pair) || !pair) { - EPHYR_LOG_ERROR("failed to find remote peer drawable\n"); - return BadMatch; - } - EPHYR_LOG("clip list of xephyr gl drawable:\n"); - for (i = 0; i < RegionNumRects(&window->clipList); i++) { - EPHYR_LOG("x1:%d, y1:%d, x2:%d, y2:%d\n", - RegionRects(&window->clipList)[i].x1, - RegionRects(&window->clipList)[i].y1, - RegionRects(&window->clipList)[i].x2, - RegionRects(&window->clipList)[i].y2); - } - - if (!ephyrDRIGetDrawableInfo(stuff->screen, - pair->remote /*the drawable in hostx */ , - (unsigned int *) &rep.drawableTableIndex, - (unsigned int *) &rep.drawableTableStamp, - (int *) &X, - (int *) &Y, - (int *) &W, - (int *) &H, - (int *) &rep.numClipRects, - &clipRects, - &backX, - &backY, - (int *) &rep.numBackClipRects, - &backClipRects)) { - return BadValue; - } - EPHYR_LOG("num clip rects:%d, num back clip rects:%d\n", - (int) rep.numClipRects, (int) rep.numBackClipRects); - - rep.drawableX = X; - rep.drawableY = Y; - rep.drawableWidth = W; - rep.drawableHeight = H; - rep.length = (SIZEOF(xXF86DRIGetDrawableInfoReply) - SIZEOF(xGenericReply)); - - rep.backX = backX; - rep.backY = backY; - - if (rep.numClipRects) { - if (clipRects) { - ScreenPtr pScreen = screenInfo.screens[stuff->screen]; - - EPHYR_LOG("clip list of host gl drawable:\n"); - for (i = 0; i < rep.numClipRects; i++) { - clipRects[i].x1 = max(clipRects[i].x1, 0); - clipRects[i].y1 = max(clipRects[i].y1, 0); - clipRects[i].x2 = min(clipRects[i].x2, - pScreen->width + clipRects[i].x1); - clipRects[i].y2 = min(clipRects[i].y2, - pScreen->width + clipRects[i].y1); - - EPHYR_LOG("x1:%d, y1:%d, x2:%d, y2:%d\n", - clipRects[i].x1, clipRects[i].y1, - clipRects[i].x2, clipRects[i].y2); - } - } - else { - rep.numClipRects = 0; - } - } - else { - EPHYR_LOG("got zero host gl drawable clipping rects\n"); - } - rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects; - backClipRects = clipRects; - rep.numBackClipRects = rep.numClipRects; - if (rep.numBackClipRects) - rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects; - EPHYR_LOG("num host clip rects:%d\n", (int) rep.numClipRects); - EPHYR_LOG("num host back clip rects:%d\n", (int) rep.numBackClipRects); - - rep.length = bytes_to_int32(rep.length); - - WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), &rep); - - if (rep.numClipRects) { - WriteToClient(client, - sizeof(drm_clip_rect_t) * rep.numClipRects, - clipRects); - } - - if (rep.numBackClipRects) { - WriteToClient(client, - sizeof(drm_clip_rect_t) * rep.numBackClipRects, - backClipRects); - } - free(clipRects); - clipRects = NULL; - - EPHYR_LOG("leave\n"); - - return Success; -} - -static int -ProcXF86DRIGetDeviceInfo(register ClientPtr client) -{ - xXF86DRIGetDeviceInfoReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0 - }; - drm_handle_t hFrameBuffer; - void *pDevPrivate; - - REQUEST(xXF86DRIGetDeviceInfoReq); - REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq); - - EPHYR_LOG("enter\n"); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!ephyrDRIGetDeviceInfo(stuff->screen, - &hFrameBuffer, - (int *) &rep.framebufferOrigin, - (int *) &rep.framebufferSize, - (int *) &rep.framebufferStride, - (int *) &rep.devPrivateSize, &pDevPrivate)) { - return BadValue; - } - - rep.hFrameBufferLow = (CARD32) (hFrameBuffer & 0xffffffff); -#if defined(LONG64) && !defined(__linux__) - rep.hFrameBufferHigh = (CARD32) (hFrameBuffer >> 32); -#else - rep.hFrameBufferHigh = 0; -#endif - - if (rep.devPrivateSize) { - rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetDeviceInfoReply) - - SIZEOF(xGenericReply) + - pad_to_int32(rep.devPrivateSize)); - } - - WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), &rep); - if (rep.length) { - WriteToClient(client, rep.devPrivateSize, pDevPrivate); - } - EPHYR_LOG("leave\n"); - return Success; -} - -static int -ProcXF86DRIDispatch(register ClientPtr client) -{ - REQUEST(xReq); - EPHYR_LOG("enter\n"); - - switch (stuff->data) { - case X_XF86DRIQueryVersion:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIQueryVersion(client); - } - case X_XF86DRIQueryDirectRenderingCapable:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIQueryDirectRenderingCapable(client); - } - } - - if (!client->local) - return DRIErrorBase + XF86DRIClientNotLocal; - - switch (stuff->data) { - case X_XF86DRIOpenConnection:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIOpenConnection(client); - } - case X_XF86DRICloseConnection:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRICloseConnection(client); - } - case X_XF86DRIGetClientDriverName:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIGetClientDriverName(client); - } - case X_XF86DRICreateContext:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRICreateContext(client); - } - case X_XF86DRIDestroyContext:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIDestroyContext(client); - } - case X_XF86DRICreateDrawable:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRICreateDrawable(client); - } - case X_XF86DRIDestroyDrawable:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIDestroyDrawable(client); - } - case X_XF86DRIGetDrawableInfo:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIGetDrawableInfo(client); - } - case X_XF86DRIGetDeviceInfo:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIGetDeviceInfo(client); - } - case X_XF86DRIAuthConnection:{ - EPHYR_LOG("leave\n"); - return ProcXF86DRIAuthConnection(client); - } - /* {Open,Close}FullScreen are deprecated now */ - default:{ - EPHYR_LOG("leave\n"); - return BadRequest; - } - } -} - -static int -SProcXF86DRIQueryVersion(register ClientPtr client) -{ - REQUEST(xXF86DRIQueryVersionReq); - swaps(&stuff->length); - return ProcXF86DRIQueryVersion(client); -} - -static int -SProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) -{ - REQUEST(xXF86DRIQueryDirectRenderingCapableReq); - swaps(&stuff->length); - swapl(&stuff->screen); - return ProcXF86DRIQueryDirectRenderingCapable(client); -} - -static int -SProcXF86DRIDispatch(register ClientPtr client) -{ - REQUEST(xReq); - - EPHYR_LOG("enter\n"); - /* - * Only local clients are allowed DRI access, but remote clients still need - * these requests to find out cleanly. - */ - switch (stuff->data) { - case X_XF86DRIQueryVersion:{ - EPHYR_LOG("leave\n"); - return SProcXF86DRIQueryVersion(client); - } - case X_XF86DRIQueryDirectRenderingCapable:{ - EPHYR_LOG("leave\n"); - return SProcXF86DRIQueryDirectRenderingCapable(client); - } - default:{ - EPHYR_LOG("leave\n"); - return DRIErrorBase + XF86DRIClientNotLocal; - } - } -} - -Bool -ephyrDRIExtensionInit(ScreenPtr a_screen) -{ - Bool is_ok = FALSE; - ExtensionEntry *extEntry = NULL; - EphyrDRIScreenPrivPtr screen_priv = NULL; - - EPHYR_LOG("enter\n"); - if (!hostx_has_extension(&xcb_xf86dri_id)) { - EPHYR_LOG("host does not have DRI extension\n"); - goto out; - } - EPHYR_LOG("host X does have DRI extension\n"); - if (!hostx_has_extension(&xcb_shape_id)) { - EPHYR_LOG("host does not have XShape extension\n"); - goto out; - } - EPHYR_LOG("host X does have XShape extension\n"); - -#ifdef XF86DRI_EVENTS - EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvents"); - if (!EventType) { - EPHYR_LOG_ERROR("failed to register DRI event resource type\n"); - goto out; - } -#endif - - if ((extEntry = AddExtension(XF86DRINAME, - XF86DRINumberEvents, - XF86DRINumberErrors, - ProcXF86DRIDispatch, - SProcXF86DRIDispatch, - NULL, StandardMinorOpcode))) { - DRIReqCode = (unsigned char) extEntry->base; - DRIErrorBase = extEntry->errorBase; - } - else { - EPHYR_LOG_ERROR("failed to register DRI extension\n"); - goto out; - } - if (!dixRegisterPrivateKey(&ephyrDRIScreenKeyRec, PRIVATE_SCREEN, 0)) - goto out; - if (!dixRegisterPrivateKey(&ephyrDRIWindowKeyRec, PRIVATE_WINDOW, 0)) - goto out; - screen_priv = calloc(1, sizeof(EphyrDRIScreenPrivRec)); - if (!screen_priv) { - EPHYR_LOG_ERROR("failed to allocate screen_priv\n"); - goto out; - } - dixSetPrivate(&a_screen->devPrivates, ephyrDRIScreenKey, screen_priv); - - if (!ephyrDRIScreenInit(a_screen)) { - EPHYR_LOG_ERROR("ephyrDRIScreenInit() failed\n"); - goto out; - } - EphyrMirrorHostVisuals(a_screen); - is_ok = TRUE; - out: - EPHYR_LOG("leave\n"); - return is_ok; -} diff --git a/xserver/hw/kdrive/ephyr/ephyrdriext.h b/xserver/hw/kdrive/ephyr/ephyrdriext.h deleted file mode 100644 index 975571582..000000000 --- a/xserver/hw/kdrive/ephyr/ephyrdriext.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: - * Dodji Seketeli - */ -#ifndef __EPHYRDRIEXT_H__ -#define __EPHYRDRIEXT_H__ - -typedef struct { - WindowPtr local; - int remote; -} EphyrWindowPair; - -Bool ephyrDRIExtensionInit(ScreenPtr a_screen); - -Bool findWindowPairFromRemote(int a_remote, EphyrWindowPair ** a_pair); - -#endif /*__EPHYRDRIEXT_H__*/ diff --git a/xserver/hw/kdrive/ephyr/ephyrglxext.c b/xserver/hw/kdrive/ephyr/ephyrglxext.c deleted file mode 100644 index c6d156900..000000000 --- a/xserver/hw/kdrive/ephyr/ephyrglxext.c +++ /dev/null @@ -1,854 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: - * Dodji Seketeli - */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include "extnsionst.h" -#include "ephyrglxext.h" -#include "ephyrhostglx.h" -#define _HAVE_XALLOC_DECLS -#include "ephyrlog.h" -#include -#include "glx/glxserver.h" -#include "glx/indirect_table.h" -#include "glx/indirect_util.h" -#include "glx/unpack.h" -#include "hostx.h" - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -int ephyrGLXQueryVersion(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXQueryVersionSwap(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXGetVisualConfigsSwap(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXClientInfo(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXClientInfoSwap(__GLXclientState * cl, GLbyte * pc); -int ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXQueryServerStringSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetFBConfigsSGIX(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetFBConfigsSGIXSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXCreateContext(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXCreateContextSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXCreateNewContext(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXCreateNewContextSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXDestroyContext(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXDestroyContextSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeCurrent(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeCurrentReadSGI(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeCurrentReadSGISwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeContextCurrent(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXMakeContextCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetString(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetStringSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetIntegerv(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXGetIntegervSwap(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXIsDirect(__GLXclientState * a_cl, GLbyte * a_pc); -int ephyrGLXIsDirectSwap(__GLXclientState * a_cl, GLbyte * a_pc); - -Bool -ephyrHijackGLXExtension(void) -{ - const void *(*dispatch_functions)[2]; - - if (!hostx_has_extension(&xcb_glx_id)) { - EPHYR_LOG("host X does not have GLX\n"); - return FALSE; - } - EPHYR_LOG("host X does have GLX\n"); - - if (!Single_dispatch_info.dispatch_functions) { - EPHYR_LOG_ERROR("could not get dispatch functions table\n"); - return FALSE; - } - /* - * hijack some single entry point dispatch functions - */ - dispatch_functions = Single_dispatch_info.dispatch_functions; - EPHYR_RETURN_VAL_IF_FAIL(dispatch_functions, FALSE); - - dispatch_functions[X_GLXQueryVersion][0] = ephyrGLXQueryVersion; - dispatch_functions[X_GLXQueryVersion][1] = ephyrGLXQueryVersionSwap; - - dispatch_functions[X_GLXGetVisualConfigs][0] = ephyrGLXGetVisualConfigs; - dispatch_functions[X_GLXGetVisualConfigs][1] = ephyrGLXGetVisualConfigsSwap; - dispatch_functions[X_GLXClientInfo][0] = ephyrGLXClientInfo; - dispatch_functions[X_GLXClientInfo][1] = ephyrGLXClientInfoSwap; - - dispatch_functions[X_GLXQueryServerString][0] = ephyrGLXQueryServerString; - dispatch_functions[X_GLXQueryServerString][1] = - ephyrGLXQueryServerStringSwap; - - dispatch_functions[X_GLXCreateContext][0] = ephyrGLXCreateContext; - dispatch_functions[X_GLXCreateContext][1] = ephyrGLXCreateContextSwap; - - dispatch_functions[X_GLXCreateNewContext][0] = ephyrGLXCreateNewContext; - dispatch_functions[X_GLXCreateNewContext][1] = ephyrGLXCreateNewContextSwap; - - dispatch_functions[X_GLXDestroyContext][0] = ephyrGLXDestroyContext; - dispatch_functions[X_GLXDestroyContext][1] = ephyrGLXDestroyContextSwap; - - dispatch_functions[X_GLXMakeCurrent][0] = ephyrGLXMakeCurrent; - dispatch_functions[X_GLXMakeCurrent][1] = ephyrGLXMakeCurrentSwap; - - dispatch_functions[X_GLXIsDirect][0] = ephyrGLXIsDirect; - dispatch_functions[X_GLXIsDirect][1] = ephyrGLXIsDirectSwap; - - dispatch_functions[73][0] = ephyrGLXGetString; - dispatch_functions[73][1] = ephyrGLXGetStringSwap; - - dispatch_functions[61][0] = ephyrGLXGetIntegerv; - dispatch_functions[61][1] = ephyrGLXGetIntegervSwap; - - dispatch_functions[X_GLXMakeContextCurrent][0] = - ephyrGLXMakeContextCurrent; - dispatch_functions[X_GLXMakeContextCurrent][1] = - ephyrGLXMakeContextCurrentSwap; - - /* - * hijack some vendor priv entry point dispatch functions - */ - dispatch_functions = VendorPriv_dispatch_info.dispatch_functions; - dispatch_functions[92][0] = ephyrGLXGetFBConfigsSGIX; - dispatch_functions[92][1] = ephyrGLXGetFBConfigsSGIXSwap; - - dispatch_functions[89][0] = ephyrGLXMakeCurrentReadSGI; - dispatch_functions[89][1] = ephyrGLXMakeCurrentReadSGISwap; - - EPHYR_LOG("hijacked glx entry points to forward requests to host X\n"); - - - return TRUE; -} - -/********************* - * implementation of - * hijacked GLX entry - * points - ********************/ - -int -ephyrGLXQueryVersion(__GLXclientState * a_cl, GLbyte * a_pc) -{ - ClientPtr client = a_cl->client; - xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) a_pc; - xGLXQueryVersionReply reply; - int major, minor; - int res = BadImplementation; - - EPHYR_LOG("enter\n"); - - major = req->majorVersion; - minor = req->minorVersion; - - if (!ephyrHostGLXQueryVersion(&major, &minor)) { - EPHYR_LOG_ERROR("ephyrHostGLXQueryVersion() failed\n"); - goto out; - } - EPHYR_LOG("major:%d, minor:%d\n", major, minor); - reply = (xGLXQueryVersionReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .majorVersion = major, - .minorVersion = minor - }; - - if (client->swapped) { - __glXSwapQueryVersionReply(client, &reply); - } - else { - WriteToClient(client, sz_xGLXQueryVersionReply, &reply); - } - - res = Success; - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXQueryVersionSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) a_pc; - - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->majorVersion); - __GLX_SWAP_INT(&req->minorVersion); - return ephyrGLXQueryVersion(a_cl, a_pc); -} - -static int -ephyrGLXGetVisualConfigsReal(__GLXclientState * a_cl, - GLbyte * a_pc, Bool a_do_swap) -{ - xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) a_pc; - ClientPtr client = a_cl->client; - xGLXGetVisualConfigsReply reply; - int32_t *props_buf = NULL, num_visuals = 0, - num_props = 0, res = BadImplementation, i = 0, - props_per_visual_size = 0, props_buf_size = 0; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - EPHYR_LOG("enter\n"); - - if (!ephyrHostGLXGetVisualConfigs(req->screen, - &num_visuals, - &num_props, - &props_buf_size, &props_buf)) { - EPHYR_LOG_ERROR("ephyrHostGLXGetVisualConfigs() failed\n"); - goto out; - } - EPHYR_LOG("num_visuals:%d, num_props:%d\n", num_visuals, num_props); - - reply = (xGLXGetVisualConfigsReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = (num_visuals * __GLX_SIZE_CARD32 * num_props) >> 2, - .numVisuals = num_visuals, - .numProps = num_props - }; - - if (a_do_swap) { - __GLX_SWAP_SHORT(&reply.sequenceNumber); - __GLX_SWAP_INT(&reply.length); - __GLX_SWAP_INT(&reply.numVisuals); - __GLX_SWAP_INT(&reply.numProps); - __GLX_SWAP_INT_ARRAY(props_buf, num_props); - } - WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); - props_per_visual_size = props_buf_size / num_visuals; - for (i = 0; i < num_visuals; i++) { - WriteToClient(client, - props_per_visual_size, - (char *) props_buf + i * props_per_visual_size); - } - res = Success; - - out: - EPHYR_LOG("leave\n"); - free(props_buf); - props_buf = NULL; - - return res; -} - -static int -ephyrGLXGetFBConfigsSGIXReal(__GLXclientState * a_cl, - GLbyte * a_pc, Bool a_do_swap) -{ - xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) a_pc; - ClientPtr client = a_cl->client; - xGLXGetVisualConfigsReply reply; - int32_t *props_buf = NULL, num_visuals = 0, - num_props = 0, res = BadImplementation, i = 0, - props_per_visual_size = 0, props_buf_size = 0; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - EPHYR_LOG("enter\n"); - - if (!ephyrHostGLXVendorPrivGetFBConfigsSGIX(req->screen, - &num_visuals, - &num_props, - &props_buf_size, &props_buf)) { - EPHYR_LOG_ERROR("ephyrHostGLXGetVisualConfigs() failed\n"); - goto out; - } - EPHYR_LOG("num_visuals:%d, num_props:%d\n", num_visuals, num_props); - - reply = (xGLXGetVisualConfigsReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = props_buf_size >> 2, - .numVisuals = num_visuals, - .numProps = num_props - }; - - if (a_do_swap) { - __GLX_SWAP_SHORT(&reply.sequenceNumber); - __GLX_SWAP_INT(&reply.length); - __GLX_SWAP_INT(&reply.numVisuals); - __GLX_SWAP_INT(&reply.numProps); - __GLX_SWAP_INT_ARRAY(props_buf, num_props); - } - WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); - props_per_visual_size = props_buf_size / num_visuals; - for (i = 0; i < num_visuals; i++) { - WriteToClient(client, - props_per_visual_size, - &((char *) props_buf)[i * props_per_visual_size]); - } - res = Success; - - out: - EPHYR_LOG("leave\n"); - free(props_buf); - props_buf = NULL; - - return res; -} - -int -ephyrGLXGetVisualConfigs(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetVisualConfigsReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXGetVisualConfigsSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetVisualConfigsReal(a_cl, a_pc, TRUE); -} - -int -ephyrGLXClientInfo(__GLXclientState * a_cl, GLbyte * a_pc) -{ - int res = BadImplementation; - xGLXClientInfoReq *req = (xGLXClientInfoReq *) a_pc; - - EPHYR_LOG("enter\n"); - if (!ephyrHostGLXSendClientInfo(req->major, req->minor, (char *) req + 1)) { - EPHYR_LOG_ERROR("failed to send client info to host\n"); - goto out; - } - res = Success; - - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXClientInfoSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXClientInfoReq *req = (xGLXClientInfoReq *) a_pc; - - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->major); - __GLX_SWAP_INT(&req->minor); - __GLX_SWAP_INT(&req->numbytes); - - return ephyrGLXClientInfo(a_cl, a_pc); -} - -int -ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc) -{ - int res = BadImplementation; - ClientPtr client = a_cl->client; - xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) a_pc; - xGLXQueryServerStringReply reply; - char *server_string = NULL; - int length = 0; - - EPHYR_LOG("enter\n"); - if (!ephyrHostGLXQueryServerString(req->screen, - req->name, - &server_string)) { - EPHYR_LOG_ERROR("failed to query string from host\n"); - goto out; - } - EPHYR_LOG("string: %s\n", server_string); - length = strlen(server_string) + 1; - reply = (xGLXQueryServerStringReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = __GLX_PAD(length) >> 2, - .n = length - }; - - WriteToClient(client, sz_xGLXQueryServerStringReply, &reply); - WriteToClient(client, (int) (reply.length << 2), server_string); - - res = Success; - - out: - EPHYR_LOG("leave\n"); - free(server_string); - server_string = NULL; - - return res; -} - -int -ephyrGLXQueryServerStringSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - EPHYR_LOG_ERROR("not yet implemented\n"); - return BadImplementation; -} - -int -ephyrGLXGetFBConfigsSGIX(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetFBConfigsSGIXReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXGetFBConfigsSGIXSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetFBConfigsSGIXReal(a_cl, a_pc, TRUE); -} - -static int -ephyrGLXCreateContextReal(xGLXCreateContextReq * a_req, Bool a_do_swap) -{ - int res = BadImplementation; - EphyrHostWindowAttributes host_w_attrs; - - __GLX_DECLARE_SWAP_VARIABLES; - - EPHYR_RETURN_VAL_IF_FAIL(a_req, BadValue); - EPHYR_LOG("enter\n"); - - if (a_do_swap) { - __GLX_SWAP_SHORT(&a_req->length); - __GLX_SWAP_INT(&a_req->context); - __GLX_SWAP_INT(&a_req->visual); - __GLX_SWAP_INT(&a_req->screen); - __GLX_SWAP_INT(&a_req->shareList); - } - - EPHYR_LOG("context creation requested. localid:%d, " - "screen:%d, visual:%d, direct:%d\n", - (int) a_req->context, (int) a_req->screen, - (int) a_req->visual, (int) a_req->isDirect); - - memset(&host_w_attrs, 0, sizeof(host_w_attrs)); - if (!hostx_get_window_attributes(hostx_get_window(a_req->screen), - &host_w_attrs)) { - EPHYR_LOG_ERROR("failed to get host window attrs\n"); - goto out; - } - - EPHYR_LOG("host window visual id: %d\n", host_w_attrs.visualid); - - if (!ephyrHostGLXCreateContext(a_req->screen, - host_w_attrs.visualid, - a_req->context, - a_req->shareList, 0, - a_req->isDirect, X_GLXCreateContext)) { - EPHYR_LOG_ERROR("ephyrHostGLXCreateContext() failed\n"); - goto out; - } - res = Success; - out: - EPHYR_LOG("leave\n"); - return res; -} - -static int -ephyrGLXCreateNewContextReal(xGLXCreateNewContextReq * a_req, Bool a_do_swap) -{ - int res = BadImplementation; - - __GLX_DECLARE_SWAP_VARIABLES; - - EPHYR_RETURN_VAL_IF_FAIL(a_req, BadValue); - EPHYR_LOG("enter\n"); - - if (a_do_swap) { - __GLX_SWAP_SHORT(&a_req->length); - __GLX_SWAP_INT(&a_req->context); - __GLX_SWAP_INT(&a_req->fbconfig); - __GLX_SWAP_INT(&a_req->screen); - __GLX_SWAP_INT(&a_req->renderType); - __GLX_SWAP_INT(&a_req->shareList); - } - - EPHYR_LOG("context creation requested. localid:%d, " - "screen:%d, fbconfig:%d, renderType:%d, direct:%d\n", - (int) a_req->context, (int) a_req->screen, - (int) a_req->fbconfig, (int) a_req->renderType, - (int) a_req->isDirect); - - if (!ephyrHostGLXCreateContext(a_req->screen, - a_req->fbconfig, - a_req->context, - a_req->shareList, a_req->renderType, - a_req->isDirect, X_GLXCreateNewContext)) { - EPHYR_LOG_ERROR("ephyrHostGLXCreateNewContext() failed\n"); - goto out; - } - res = Success; - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXCreateContext(__GLXclientState * cl, GLbyte * pc) -{ - xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; - - return ephyrGLXCreateContextReal(req, FALSE); -} - -int -ephyrGLXCreateContextSwap(__GLXclientState * cl, GLbyte * pc) -{ - xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; - - return ephyrGLXCreateContextReal(req, TRUE); -} - -int -ephyrGLXCreateNewContext(__GLXclientState * cl, GLbyte * pc) -{ - xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; - - return ephyrGLXCreateNewContextReal(req, FALSE); -} - -int -ephyrGLXCreateNewContextSwap(__GLXclientState * cl, GLbyte * pc) -{ - xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; - - return ephyrGLXCreateNewContextReal(req, TRUE); -} - -static int -ephyrGLXDestroyContextReal(__GLXclientState * a_cl, - GLbyte * a_pc, Bool a_do_swap) -{ - int res = BadImplementation; - ClientPtr client = a_cl->client; - xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) a_pc; - - EPHYR_LOG("enter. id:%d\n", (int) req->context); - if (!ephyrHostDestroyContext(req->context)) { - EPHYR_LOG_ERROR("ephyrHostDestroyContext() failed\n"); - client->errorValue = req->context; - goto out; - } - res = Success; - - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXDestroyContext(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXDestroyContextReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXDestroyContextSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXDestroyContextReal(a_cl, a_pc, TRUE); -} - -static int -ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLXDrawable write, - GLXDrawable read, GLXContextTag ctx, - GLXContextTag old_ctx, Bool a_do_swap) -{ - int res = BadImplementation; - xGLXMakeCurrentReply reply; - DrawablePtr drawableR = NULL, drawableW = NULL; - GLXContextTag new_ctx = 0; - - EPHYR_LOG("enter\n"); - res = dixLookupDrawable(&drawableW, write, a_cl->client, 0, DixReadAccess); - EPHYR_RETURN_VAL_IF_FAIL(drawableW, BadValue); - EPHYR_RETURN_VAL_IF_FAIL(drawableW->pScreen, BadValue); - EPHYR_LOG("screen nummber requested:%d\n", drawableW->pScreen->myNum); - - if (read != write) { - res = dixLookupDrawable(&drawableR, read, a_cl->client, 0, - DixReadAccess); - EPHYR_RETURN_VAL_IF_FAIL(drawableR, BadValue); - EPHYR_RETURN_VAL_IF_FAIL(drawableR->pScreen, BadValue); - } - else { - drawableR = drawableW; - } - - if (!ephyrHostGLXMakeCurrent(hostx_get_window(drawableW->pScreen->myNum), - hostx_get_window(drawableR->pScreen->myNum), - ctx, old_ctx, (int *) &new_ctx)) { - EPHYR_LOG_ERROR("ephyrHostGLXMakeCurrent() failed\n"); - goto out; - } - reply = (xGLXMakeCurrentReply) { - .type = X_Reply, - .sequenceNumber = a_cl->client->sequence, - .length = 0, - .contextTag = new_ctx - }; - if (a_do_swap) { - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply.sequenceNumber); - __GLX_SWAP_INT(&reply.length); - __GLX_SWAP_INT(&reply.contextTag); - } - WriteToClient(a_cl->client, sz_xGLXMakeCurrentReply, &reply); - - res = Success; - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXMakeCurrent(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) a_pc; - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->drawable, - req->context, req->oldContextTag, FALSE); -} - -int -ephyrGLXMakeCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) a_pc; - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->drawable, - req->context, req->oldContextTag, TRUE); -} - -int -ephyrGLXMakeCurrentReadSGI(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) a_pc; - - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readable, - req->context, req->oldContextTag, FALSE); -} - -int -ephyrGLXMakeCurrentReadSGISwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) a_pc; - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->readable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readable, - req->context, req->oldContextTag, TRUE); -} - -int -ephyrGLXMakeContextCurrent(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) a_pc; - - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readdrawable, - req->context, req->oldContextTag, FALSE); -} - -int -ephyrGLXMakeContextCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) a_pc; - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->readdrawable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readdrawable, - req->context, req->oldContextTag, TRUE); -} - -static int -ephyrGLXGetStringReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) -{ - ClientPtr client = NULL; - int context_tag = 0, name = 0, res = BadImplementation, length = 0; - char *string = NULL; - - __GLX_DECLARE_SWAP_VARIABLES; - - EPHYR_RETURN_VAL_IF_FAIL(a_cl && a_pc, BadValue); - - EPHYR_LOG("enter\n"); - - client = a_cl->client; - - if (a_do_swap) { - __GLX_SWAP_INT(a_pc + 4); - __GLX_SWAP_INT(a_pc + __GLX_SINGLE_HDR_SIZE); - } - context_tag = __GLX_GET_SINGLE_CONTEXT_TAG(a_pc); - a_pc += __GLX_SINGLE_HDR_SIZE; - name = *(GLenum *) (a_pc + 0); - EPHYR_LOG("context_tag:%d, name:%d\n", context_tag, name); - if (!ephyrHostGLXGetString(context_tag, name, &string)) { - EPHYR_LOG_ERROR("failed to get string from server\n"); - goto out; - } - if (string) { - length = strlen(string) + 1; - EPHYR_LOG("got string:'%s', size:%d\n", string, length); - } - else { - EPHYR_LOG("got string: string (null)\n"); - } - __GLX_BEGIN_REPLY(length); - __GLX_PUT_SIZE(length); - __GLX_SEND_HEADER(); - if (a_do_swap) { - __GLX_SWAP_REPLY_SIZE(); - __GLX_SWAP_REPLY_HEADER(); - } - WriteToClient(client, length, string); - - res = Success; - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXGetString(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetStringReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXGetStringSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetStringReal(a_cl, a_pc, TRUE); -} - -static int -ephyrGLXGetIntegervReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) -{ - int res = BadImplementation; - xGLXSingleReq *const req = (xGLXSingleReq *) a_pc; - GLenum int_name; - int value = 0; - GLint answer_buf_room[200]; - GLint *buf = NULL; - - EPHYR_LOG("enter\n"); - - a_pc += __GLX_SINGLE_HDR_SIZE; - - int_name = *(GLenum *) (a_pc + 0); - if (!ephyrHostGetIntegerValue(req->contextTag, int_name, &value)) { - EPHYR_LOG_ERROR("ephyrHostGetIntegerValue() failed\n"); - goto out; - } - buf = __glXGetAnswerBuffer(a_cl, sizeof(value), - answer_buf_room, sizeof(answer_buf_room), 4); - - if (!buf) { - EPHYR_LOG_ERROR("failed to allocate reply buffer\n"); - res = BadAlloc; - goto out; - } - __glXSendReply(a_cl->client, buf, 1, sizeof(value), GL_FALSE, 0); - res = Success; - - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXGetIntegerv(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetIntegervReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXGetIntegervSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXGetIntegervReal(a_cl, a_pc, TRUE); -} - -static int -ephyrGLXIsDirectReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) -{ - int res = BadImplementation; - ClientPtr client = a_cl->client; - xGLXIsDirectReq *req = (xGLXIsDirectReq *) a_pc; - xGLXIsDirectReply reply; - int is_direct = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_cl && a_pc, FALSE); - - EPHYR_LOG("enter\n"); - - if (!ephyrHostIsContextDirect(req->context, (int *) &is_direct)) { - EPHYR_LOG_ERROR("ephyrHostIsContextDirect() failed\n"); - goto out; - } - reply = (xGLXIsDirectReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .isDirect = is_direct - }; - - WriteToClient(client, sz_xGLXIsDirectReply, &reply); - res = Success; - - out: - EPHYR_LOG("leave\n"); - return res; -} - -int -ephyrGLXIsDirect(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXIsDirectReal(a_cl, a_pc, FALSE); -} - -int -ephyrGLXIsDirectSwap(__GLXclientState * a_cl, GLbyte * a_pc) -{ - return ephyrGLXIsDirectReal(a_cl, a_pc, TRUE); -} diff --git a/xserver/hw/kdrive/ephyr/ephyrhostglx.c b/xserver/hw/kdrive/ephyr/ephyrhostglx.c deleted file mode 100644 index 0b98cce71..000000000 --- a/xserver/hw/kdrive/ephyr/ephyrhostglx.c +++ /dev/null @@ -1,490 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * a lots of the content of this file has been adapted from the mesa source - * code. - * Authors: - * Dodji Seketeli - */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include "ephyrhostglx.h" -#define _HAVE_XALLOC_DECLS -#include "ephyrlog.h" -#include "hostx.h" - -static int glx_major, glx_minor; - -enum VisualConfRequestType { - EPHYR_GET_FB_CONFIG, - EPHYR_VENDOR_PRIV_GET_FB_CONFIG_SGIX, - EPHYR_GET_VISUAL_CONFIGS -}; - -static Bool ephyrHostGLXGetVisualConfigsInternal - (enum VisualConfRequestType a_type, - xcb_glx_get_visual_configs_reply_t *reply, - int32_t a_screen, - int32_t *a_num_visuals, - int32_t *a_num_props, - int32_t *a_props_buf_size, - int32_t **a_props_buf); - -Bool -ephyrHostGLXQueryVersion(int *a_major, int *a_minor) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - xcb_glx_query_version_cookie_t cookie; - xcb_glx_query_version_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(a_major && a_minor, FALSE); - EPHYR_LOG("enter\n"); - - if (glx_major) { - *a_major = glx_major; - *a_minor = glx_minor; - return TRUE; - } - - /* Send the glXQueryVersion request */ - cookie = xcb_glx_query_version(conn, 2, 1); - reply = xcb_glx_query_version_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_major = reply->major_version; - *a_minor = reply->minor_version; - free(reply); - - EPHYR_LOG("major:%d, minor:%d\n", *a_major, *a_minor); - - is_ok = TRUE; - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostGLXGetString(int a_context_tag, - int a_string_name, - char **a_string) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - xcb_glx_get_string_cookie_t cookie; - xcb_glx_get_string_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(conn && a_string, FALSE); - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_get_string(conn, a_context_tag, a_string_name); - reply = xcb_glx_get_string_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_string = malloc(reply->n + 1); - memcpy(*a_string, xcb_glx_get_string_string(reply), reply->n); - (*a_string)[reply->n] = '\0'; - free(reply); - is_ok = TRUE; -out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool ephyrHostGLXQueryServerString(int a_screen_number, - int a_string_name, - char **a_string) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - int default_screen = hostx_get_screen(); - xcb_glx_query_server_string_cookie_t cookie; - xcb_glx_query_server_string_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(conn && a_string, FALSE); - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_query_server_string(conn, default_screen, a_string_name); - reply = xcb_glx_query_server_string_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_string = malloc(reply->str_len + 1); - memcpy(*a_string, xcb_glx_query_server_string_string(reply), reply->str_len); - (*a_string)[reply->str_len] = '\0'; - free(reply); - is_ok = TRUE; -out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -static Bool -ephyrHostGLXGetVisualConfigsInternal(enum VisualConfRequestType a_type, - xcb_glx_get_visual_configs_reply_t *reply, - int32_t a_screen, - int32_t * a_num_visuals, - int32_t * a_num_props, - int32_t * a_props_buf_size, - int32_t ** a_props_buf) -{ - Bool is_ok = FALSE; - int num_props = 0, num_visuals = 0, props_buf_size = 0; - int props_per_visual_size = 0; - int32_t *props_buf = NULL; - - if (!reply->num_visuals) { - EPHYR_LOG_ERROR("screen does not support GL rendering\n"); - goto out; - } - num_visuals = reply->num_visuals; - - num_props = reply->num_properties; - - if (a_type != EPHYR_GET_VISUAL_CONFIGS) { - num_props *= 2; - } - props_per_visual_size = num_props * sizeof(uint32_t); - props_buf_size = props_per_visual_size * reply->num_visuals; - props_buf = malloc(props_buf_size); - if (!props_buf) - goto out; - memcpy(props_buf, xcb_glx_get_visual_configs_property_list(reply), - props_buf_size); - - *a_num_visuals = num_visuals; - *a_num_props = reply->num_properties; - *a_props_buf_size = props_buf_size; - *a_props_buf = props_buf; - is_ok = TRUE; - -out: - return is_ok; -} - -Bool -ephyrHostGLXGetVisualConfigs(int32_t a_screen, - int32_t * a_num_visuals, - int32_t * a_num_props, - int32_t * a_props_buf_size, int32_t ** a_props_buf) -{ - Bool is_ok = FALSE; - xcb_glx_get_visual_configs_cookie_t cookie; - xcb_glx_get_visual_configs_reply_t *reply; - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_get_visual_configs(conn, screen); - reply = xcb_glx_get_visual_configs_reply(conn, cookie, NULL); - if (!reply) - goto out; - is_ok = ephyrHostGLXGetVisualConfigsInternal - (EPHYR_GET_VISUAL_CONFIGS, - reply, - a_screen, - a_num_visuals, - a_num_props, - a_props_buf_size, - a_props_buf); - -out: - free(reply); - EPHYR_LOG("leave:%d\n", is_ok); - return is_ok; -} - -Bool -ephyrHostGLXVendorPrivGetFBConfigsSGIX(int a_screen, - int32_t * a_num_visuals, - int32_t * a_num_props, - int32_t * a_props_buf_size, - int32_t ** a_props_buf) -{ - Bool is_ok=FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - int screen = hostx_get_screen(); - xcb_glx_vendor_private_with_reply_cookie_t cookie; - union { - xcb_glx_vendor_private_with_reply_reply_t *vprep; - xcb_glx_get_visual_configs_reply_t *rep; - } reply; - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_vendor_private_with_reply(conn, - X_GLXvop_GetFBConfigsSGIX, - 0, 4, (uint8_t *)&screen); - reply.vprep = xcb_glx_vendor_private_with_reply_reply(conn, cookie, NULL); - if (!reply.vprep) - goto out; - is_ok = ephyrHostGLXGetVisualConfigsInternal - (EPHYR_VENDOR_PRIV_GET_FB_CONFIG_SGIX, - reply.rep, - a_screen, - a_num_visuals, - a_num_props, - a_props_buf_size, - a_props_buf); -out: - free(reply.vprep); - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostGLXSendClientInfo(int32_t a_major, int32_t a_minor, - const char *a_extension_list) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - int size; - - EPHYR_RETURN_VAL_IF_FAIL(conn && a_extension_list, FALSE); - - size = strlen (a_extension_list) + 1; - xcb_glx_client_info(conn, a_major, a_minor, size, a_extension_list); - - return TRUE; -} - -Bool -ephyrHostGLXCreateContext(int a_screen, - int a_generic_id, - int a_context_id, - int a_share_list_ctxt_id, - int a_render_type, - Bool a_direct, - int code) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - int remote_context_id = 0; - - EPHYR_LOG("enter. screen:%d, generic_id:%d, contextid:%d, rendertype:%d, " - "direct:%d\n", a_screen, a_generic_id, a_context_id, - a_render_type, a_direct); - - if (!hostx_allocate_resource_id_peer(a_context_id, &remote_context_id)) { - EPHYR_LOG_ERROR("failed to peer the context id %d host X", - remote_context_id); - goto out; - } - - switch (code) { - case X_GLXCreateContext: { - xcb_glx_create_context(conn, - remote_context_id, - a_generic_id, - hostx_get_screen(), - a_share_list_ctxt_id, - a_direct); - } - - case X_GLXCreateNewContext: { - xcb_glx_create_new_context(conn, - remote_context_id, - a_generic_id, - hostx_get_screen(), - a_render_type, - a_share_list_ctxt_id, - a_direct); - } - - default: - /* This should never be reached !*/ - EPHYR_LOG("Internal error! Invalid CreateContext code!\n"); - } - - is_ok = TRUE; - - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostDestroyContext(int a_ctxt_id) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - int remote_ctxt_id = 0; - - EPHYR_LOG("enter:%d\n", a_ctxt_id); - - if (!hostx_get_resource_id_peer(a_ctxt_id, &remote_ctxt_id)) { - EPHYR_LOG_ERROR("failed to get remote glx ctxt id\n"); - goto out; - } - EPHYR_LOG("host context id:%d\n", remote_ctxt_id); - - xcb_glx_destroy_context(conn, remote_ctxt_id); - - is_ok = TRUE; - - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostGLXMakeCurrent(int a_drawable, int a_readable, - int a_glx_ctxt_id, int a_old_ctxt_tag, int *a_ctxt_tag) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - int remote_glx_ctxt_id = 0; - - EPHYR_RETURN_VAL_IF_FAIL(a_ctxt_tag, FALSE); - - EPHYR_LOG("enter. drawable:%d, read:%d, context:%d, oldtag:%d\n", - a_drawable, a_readable, a_glx_ctxt_id, a_old_ctxt_tag); - - if (!hostx_get_resource_id_peer(a_glx_ctxt_id, &remote_glx_ctxt_id)) { - EPHYR_LOG_ERROR("failed to get remote glx ctxt id\n"); - goto out; - } - - /* If both drawables are the same, use the old MakeCurrent request. - * Otherwise, if we have GLX 1.3 or higher, use the MakeContextCurrent - * request which supports separate read and draw targets. Failing that, - * try the SGI MakeCurrentRead extension. Logic cribbed from Mesa. */ - if (a_drawable == a_readable) { - xcb_glx_make_current_cookie_t cookie; - xcb_glx_make_current_reply_t *reply; - cookie = xcb_glx_make_current(conn, - a_drawable, - remote_glx_ctxt_id, - a_old_ctxt_tag); - reply = xcb_glx_make_current_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_ctxt_tag = reply->context_tag; - free(reply); - } - else if (glx_major > 1 || glx_minor >= 3) { - xcb_glx_make_context_current_cookie_t cookie; - xcb_glx_make_context_current_reply_t *reply; - cookie = xcb_glx_make_context_current(conn, - a_old_ctxt_tag, - a_drawable, - a_readable, - remote_glx_ctxt_id); - reply = xcb_glx_make_context_current_reply(conn, cookie, NULL); - if (!reply) - goto out; - *a_ctxt_tag = reply->context_tag; - free(reply); - } - else { - xcb_glx_vendor_private_with_reply_cookie_t cookie; - xcb_glx_vendor_private_with_reply_reply_t *reply; - uint32_t data[3] = { - a_drawable, a_readable, remote_glx_ctxt_id, - }; - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_vendor_private_with_reply(conn, - X_GLXvop_MakeCurrentReadSGI, - a_old_ctxt_tag, - sizeof(data), - (uint8_t *)data); - reply = xcb_glx_vendor_private_with_reply_reply(conn, cookie, NULL); - - *a_ctxt_tag = reply->retval; - - free(reply); - } - - EPHYR_LOG("context tag:%d\n", *a_ctxt_tag); - is_ok = TRUE; - - out: - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostGetIntegerValue(int a_current_context_tag, int a_int, int *a_val) -{ - xcb_connection_t *conn = hostx_get_xcbconn(); - Bool is_ok = FALSE; - int size = 0; - xcb_glx_get_integerv_cookie_t cookie; - xcb_glx_get_integerv_reply_t *reply; - - EPHYR_RETURN_VAL_IF_FAIL(a_val, FALSE); - - EPHYR_LOG("enter\n"); - cookie = xcb_glx_get_integerv(conn, a_current_context_tag, a_int); - reply = xcb_glx_get_integerv_reply(conn, cookie, NULL); - if (!reply) - goto out; - size = reply->n; - if (!size) { - EPHYR_LOG_ERROR("X_GLsop_GetIngerv failed\n"); - goto out; - } - *a_val = reply->datum; - is_ok = TRUE; - -out: - free(reply); - EPHYR_LOG("leave\n"); - return is_ok; -} - -Bool -ephyrHostIsContextDirect(int a_ctxt_id, int *a_is_direct) -{ - Bool is_ok = FALSE; - xcb_connection_t *conn = hostx_get_xcbconn(); - xcb_glx_is_direct_cookie_t cookie; - xcb_glx_is_direct_reply_t *reply = NULL; - int remote_glx_ctxt_id = 0; - - EPHYR_LOG("enter\n"); - if (!hostx_get_resource_id_peer (a_ctxt_id, &remote_glx_ctxt_id)) { - EPHYR_LOG_ERROR ("failed to get remote glx ctxt id\n"); - goto out; - } - - /* Send the glXIsDirect request */ - cookie = xcb_glx_is_direct(conn, remote_glx_ctxt_id); - reply = xcb_glx_is_direct_reply(conn, cookie, NULL); - if (!reply) { - EPHYR_LOG_ERROR("fail in reading reply from host\n"); - goto out; - } - *a_is_direct = reply->is_direct; - is_ok = TRUE; - -out: - free(reply); - EPHYR_LOG("leave\n"); - return is_ok; -} diff --git a/xserver/hw/kdrive/ephyr/ephyrhostglx.h b/xserver/hw/kdrive/ephyr/ephyrhostglx.h deleted file mode 100644 index f1eec5f0b..000000000 --- a/xserver/hw/kdrive/ephyr/ephyrhostglx.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Xephyr - A kdrive X server thats runs in a host X window. - * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of OpenedHand Ltd not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. OpenedHand Ltd makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * OpenedHand Ltd DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OpenedHand Ltd BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: - * Dodji Seketeli - */ -#ifndef __EPHYRHOSTGLX_H__ -#define __EPHYRHOSTGLX_H__ - -enum EphyrHostGLXGetStringOps { - EPHYR_HOST_GLX_UNDEF, - EPHYR_HOST_GLX_QueryServerString, - EPHYR_HOST_GLX_GetString, -}; - -Bool ephyrHostGLXQueryVersion(int *a_maj, int *a_min); -Bool ephyrHostGLXGetString(int a_context_tag, - int a_string_name, - char **a_string); -Bool ephyrHostGLXQueryServerString(int a_screen_number, - int a_string_name, - char **a_string); -Bool ephyrHostGLXGetVisualConfigs(int a_screen, - int32_t * a_num_visuals, - int32_t * a_num_props, - int32_t * a_props_buf_size, - int32_t ** a_props_buf); -Bool - -ephyrHostGLXVendorPrivGetFBConfigsSGIX(int a_screen, - int32_t * a_num_visuals, - int32_t * a_num_props, - int32_t * a_props_buf_size, - int32_t ** a_props_buf); -Bool ephyrHostGLXSendClientInfo(int32_t a_major, int32_t a_minor, - const char *a_extension_list); -Bool ephyrHostGLXCreateContext(int a_screen, - int a_generic_id, - int a_context_id, - int a_share_list_ctxt_id, - int a_render_type, - Bool a_direct, - int code); - -Bool ephyrHostDestroyContext(int a_ctxt_id); - -Bool ephyrHostGLXMakeCurrent(int a_drawable, int a_readable, int a_glx_ctxt_id, - int a_olg_ctxt_tag, int *a_ctxt_tag); - -Bool ephyrHostGetIntegerValue(int a_current_context_tag, int a_int, int *a_val); - -Bool ephyrHostIsContextDirect(int a_ctxt_id, int *a_is_direct); - -#endif /*__EPHYRHOSTGLX_H__*/ diff --git a/xserver/hw/kdrive/ephyr/ephyrinit.c b/xserver/hw/kdrive/ephyr/ephyrinit.c index d86baf295..7632c2643 100644 --- a/xserver/hw/kdrive/ephyr/ephyrinit.c +++ b/xserver/hw/kdrive/ephyr/ephyrinit.c @@ -36,11 +36,8 @@ extern Bool EphyrWantResize; extern Bool EphyrWantNoHostGrab; extern Bool kdHasPointer; extern Bool kdHasKbd; -extern Bool ephyr_glamor, ephyr_glamor_gles2; +extern Bool ephyr_glamor, ephyr_glamor_gles2, ephyr_glamor_skip_present; -#ifdef GLXEXT -extern Bool ephyrNoDRI; -#endif extern Bool ephyrNoXV; #ifdef KDRIVE_EVDEV @@ -94,29 +91,30 @@ InitInput(int argc, char **argv) KdKeyboardInfo *ki; KdPointerInfo *pi; - KdAddKeyboardDriver(&EphyrKeyboardDriver); #ifdef KDRIVE_EVDEV KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver); -#endif - KdAddPointerDriver(&EphyrMouseDriver); -#ifdef KDRIVE_EVDEV KdAddPointerDriver(&LinuxEvdevMouseDriver); #endif - if (!kdHasKbd) { - ki = KdNewKeyboard(); - if (!ki) - FatalError("Couldn't create Xephyr keyboard\n"); - ki->driver = &EphyrKeyboardDriver; - KdAddKeyboard(ki); - } + if (!SeatId) { + KdAddKeyboardDriver(&EphyrKeyboardDriver); + KdAddPointerDriver(&EphyrMouseDriver); - if (!kdHasPointer) { - pi = KdNewPointer(); - if (!pi) - FatalError("Couldn't create Xephyr pointer\n"); - pi->driver = &EphyrMouseDriver; - KdAddPointer(pi); + if (!kdHasKbd) { + ki = KdNewKeyboard(); + if (!ki) + FatalError("Couldn't create Xephyr keyboard\n"); + ki->driver = &EphyrKeyboardDriver; + KdAddKeyboard(ki); + } + + if (!kdHasPointer) { + pi = KdNewPointer(); + if (!pi) + FatalError("Couldn't create Xephyr pointer\n"); + pi->driver = &EphyrMouseDriver; + KdAddPointer(pi); + } } KdInitInput(); @@ -150,13 +148,11 @@ ddxUseMsg(void) #ifdef GLAMOR ErrorF("-glamor Enable 2D acceleration using glamor\n"); ErrorF("-glamor_gles2 Enable 2D acceleration using glamor (with GLES2 only)\n"); + ErrorF("-glamor-skip-present Skip presenting the output when using glamor (for internal testing optimization)\n"); #endif ErrorF ("-fakexa Simulate acceleration using software rendering\n"); ErrorF("-verbosity Set log verbosity level\n"); -#ifdef GLXEXT - ErrorF("-nodri do not use DRI\n"); -#endif ErrorF("-noxv do not use XV\n"); ErrorF("-name [name] define the name in the WM_CLASS property\n"); ErrorF @@ -293,6 +289,10 @@ ddxProcessArgument(int argc, char **argv, int i) ephyrFuncs.finiAccel = ephyr_glamor_fini; return 1; } + else if (!strcmp (argv[i], "-glamor-skip-present")) { + ephyr_glamor_skip_present = TRUE; + return 1; + } #endif else if (!strcmp(argv[i], "-fakexa")) { ephyrFuncs.initAccel = ephyrDrawInit; @@ -314,13 +314,6 @@ ddxProcessArgument(int argc, char **argv, int i) exit(1); } } -#ifdef GLXEXT - else if (!strcmp(argv[i], "-nodri")) { - ephyrNoDRI = TRUE; - EPHYR_LOG("no direct rendering enabled\n"); - return 1; - } -#endif else if (!strcmp(argv[i], "-noxv")) { ephyrNoXV = TRUE; EPHYR_LOG("no XVideo enabled\n"); @@ -369,6 +362,13 @@ ddxProcessArgument(int argc, char **argv, int i) EphyrWantNoHostGrab = 1; return 1; } + else if (!strcmp(argv[i], "-sharevts") || + !strcmp(argv[i], "-novtswitch")) { + return 1; + } + else if (!strcmp(argv[i], "-layout")) { + return 2; + } return KdProcessArgument(argc, argv, i); } @@ -378,6 +378,9 @@ OsVendorInit(void) { EPHYR_DBG("mark"); + if (SeatId) + hostx_use_sw_cursor(); + if (hostx_want_host_cursor()) ephyrFuncs.initCursor = &ephyrCursorInit; diff --git a/xserver/hw/kdrive/ephyr/ephyrvideo.c b/xserver/hw/kdrive/ephyr/ephyrvideo.c index 56a5ff1f8..17336ab2b 100644 --- a/xserver/hw/kdrive/ephyr/ephyrvideo.c +++ b/xserver/hw/kdrive/ephyr/ephyrvideo.c @@ -226,6 +226,11 @@ ephyrInitVideo(ScreenPtr pScreen) return FALSE; } + if (!hostx_has_extension(&xcb_xv_id)) { + EPHYR_LOG_ERROR("Host has no XVideo extension\n"); + return FALSE; + } + if (!xv_priv) { xv_priv = ephyrXVPrivNew(); } @@ -462,7 +467,7 @@ ephyrXVPrivQueryHostAdaptors(EphyrXVPriv * a_this) if (a_this->host_adaptors) a_this->num_adaptors = a_this->host_adaptors->num_adaptors; - if (a_this->num_adaptors < 0) { + if (a_this->num_adaptors <= 0) { EPHYR_LOG_ERROR("failed to get number of host adaptors\n"); goto out; } diff --git a/xserver/hw/kdrive/ephyr/hostx.c b/xserver/hw/kdrive/ephyr/hostx.c index 3991c51dc..d5578deaa 100644 --- a/xserver/hw/kdrive/ephyr/hostx.c +++ b/xserver/hw/kdrive/ephyr/hostx.c @@ -52,10 +52,7 @@ #include #include #include -#ifdef XF86DRI -#include -#include -#endif /* XF86DRI */ +#include #ifdef GLAMOR #include #include "glamor.h" @@ -73,6 +70,7 @@ struct EphyrHostXVars { xcb_gcontext_t gc; xcb_render_pictformat_t argb_format; xcb_cursor_t empty_cursor; + xcb_generic_event_t *saved_event; int depth; Bool use_sw_cursor; Bool use_fullscreen; @@ -82,6 +80,7 @@ struct EphyrHostXVars { KdScreenInfo **screens; long damage_debug_msec; + Bool size_set_from_configure; }; /* memset ( missing> ) instead of below */ @@ -90,14 +89,13 @@ static EphyrHostXVars HostX; static int HostXWantDamageDebug = 0; -extern EphyrKeySyms ephyrKeySyms; - extern Bool EphyrWantResize; char *ephyrResName = NULL; int ephyrResNameFromCmd = 0; char *ephyrTitle = NULL; Bool ephyr_glamor = FALSE; +extern Bool ephyr_glamor_skip_present; Bool hostx_has_extension(xcb_extension_t *extension) @@ -883,6 +881,7 @@ hostx_screen_init(KdScreenInfo *screen, xallocarray(scrpriv->ximg->stride, buffer_height); } + if (!HostX.size_set_from_configure) { uint32_t mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; uint32_t values[2] = {width, height}; @@ -900,7 +899,10 @@ hostx_screen_init(KdScreenInfo *screen, &size_hints); } - xcb_map_window(HostX.conn, scrpriv->win); +#ifdef GLAMOR + if (!ephyr_glamor_skip_present) +#endif + xcb_map_window(HostX.conn, scrpriv->win); /* Set explicit window position if it was informed in * -screen option (WxH+X or WxH+X+Y). Otherwise, accept the @@ -925,7 +927,6 @@ hostx_screen_init(KdScreenInfo *screen, #ifdef GLAMOR if (ephyr_glamor) { *bytes_per_line = 0; - *bits_per_pixel = 0; ephyr_glamor_set_window_size(scrpriv->glamor, scrpriv->win_width, scrpriv->win_height); return NULL; @@ -1086,18 +1087,142 @@ hostx_paint_debug_rect(KdScreenInfo *screen, nanosleep(&tspec, NULL); } -void -hostx_load_keymap(void) +Bool +hostx_load_keymap(KeySymsPtr keySyms, CARD8 *modmap, XkbControlsPtr controls) { int min_keycode, max_keycode; + int map_width; + size_t i, j; + int keymap_len; + xcb_keysym_t *keymap; + xcb_keycode_t *modifier_map; + xcb_get_keyboard_mapping_cookie_t mapping_c; + xcb_get_keyboard_mapping_reply_t *mapping_r; + xcb_get_modifier_mapping_cookie_t modifier_c; + xcb_get_modifier_mapping_reply_t *modifier_r; + xcb_xkb_use_extension_cookie_t use_c; + xcb_xkb_use_extension_reply_t *use_r; + xcb_xkb_get_controls_cookie_t controls_c; + xcb_xkb_get_controls_reply_t *controls_r; + /* First of all, collect host X server's + * min_keycode and max_keycode, which are + * independent from XKB support. */ min_keycode = xcb_get_setup(HostX.conn)->min_keycode; max_keycode = xcb_get_setup(HostX.conn)->max_keycode; EPHYR_DBG("min: %d, max: %d", min_keycode, max_keycode); - ephyrKeySyms.minKeyCode = min_keycode; - ephyrKeySyms.maxKeyCode = max_keycode; + keySyms->minKeyCode = min_keycode; + keySyms->maxKeyCode = max_keycode; + + /* Check for XKB availability in host X server */ + if (!hostx_has_extension(&xcb_xkb_id)) { + EPHYR_LOG_ERROR("XKB extension is not supported in host X server."); + return FALSE; + } + + use_c = xcb_xkb_use_extension(HostX.conn, + XCB_XKB_MAJOR_VERSION, + XCB_XKB_MINOR_VERSION); + use_r = xcb_xkb_use_extension_reply(HostX.conn, use_c, NULL); + + if (!use_r) { + EPHYR_LOG_ERROR("Couldn't use XKB extension."); + return FALSE; + } else if (!use_r->supported) { + EPHYR_LOG_ERROR("XKB extension is not supported in host X server."); + free(use_r); + return FALSE; + } + + free(use_r); + + /* Send all needed XCB requests at once, + * and process the replies as needed. */ + mapping_c = xcb_get_keyboard_mapping(HostX.conn, + min_keycode, + max_keycode - min_keycode + 1); + modifier_c = xcb_get_modifier_mapping(HostX.conn); + controls_c = xcb_xkb_get_controls(HostX.conn, + XCB_XKB_ID_USE_CORE_KBD); + + mapping_r = xcb_get_keyboard_mapping_reply(HostX.conn, + mapping_c, + NULL); + + if (!mapping_r) { + EPHYR_LOG_ERROR("xcb_get_keyboard_mapping_reply() failed."); + return FALSE; + } + + map_width = mapping_r->keysyms_per_keycode; + keymap = xcb_get_keyboard_mapping_keysyms(mapping_r); + keymap_len = xcb_get_keyboard_mapping_keysyms_length(mapping_r); + + keySyms->mapWidth = map_width; + keySyms->map = calloc(keymap_len, sizeof(KeySym)); + + if (!keySyms->map) { + EPHYR_LOG_ERROR("Failed to allocate KeySym map."); + free(mapping_r); + return FALSE; + } + + for (i = 0; i < keymap_len; i++) { + keySyms->map[i] = keymap[i]; + } + + free(mapping_r); + + modifier_r = xcb_get_modifier_mapping_reply(HostX.conn, + modifier_c, + NULL); + + if (!modifier_r) { + EPHYR_LOG_ERROR("xcb_get_modifier_mapping_reply() failed."); + return FALSE; + } + + modifier_map = xcb_get_modifier_mapping_keycodes(modifier_r); + memset(modmap, 0, sizeof(CARD8) * MAP_LENGTH); + + for (j = 0; j < 8; j++) { + for (i = 0; i < modifier_r->keycodes_per_modifier; i++) { + CARD8 keycode; + + if ((keycode = modifier_map[j * modifier_r->keycodes_per_modifier + i])) { + modmap[keycode] |= 1 << j; + } + } + } + + free(modifier_r); + + controls_r = xcb_xkb_get_controls_reply(HostX.conn, + controls_c, + NULL); + + if (!controls_r) { + EPHYR_LOG_ERROR("xcb_xkb_get_controls_reply() failed."); + return FALSE; + } + + controls->enabled_ctrls = controls_r->enabledControls; + + for (i = 0; i < XkbPerKeyBitArraySize; i++) { + controls->per_key_repeat[i] = controls_r->perKeyRepeat[i]; + } + + free(controls_r); + + return TRUE; +} + +void +hostx_size_set_from_configure(Bool ss) +{ + HostX.size_set_from_configure = ss; } xcb_connection_t * @@ -1106,12 +1231,43 @@ hostx_get_xcbconn(void) return HostX.conn; } +xcb_generic_event_t * +hostx_get_event(Bool queued_only) +{ + xcb_generic_event_t *xev; + + if (HostX.saved_event) { + xev = HostX.saved_event; + HostX.saved_event = NULL; + } else { + if (queued_only) + xev = xcb_poll_for_queued_event(HostX.conn); + else + xev = xcb_poll_for_event(HostX.conn); + } + return xev; +} + +Bool +hostx_has_queued_event(void) +{ + if (!HostX.saved_event) + HostX.saved_event = xcb_poll_for_queued_event(HostX.conn); + return HostX.saved_event != NULL; +} + int hostx_get_screen(void) { return HostX.screen; } +int +hostx_get_fd(void) +{ + return xcb_get_file_descriptor(HostX.conn); +} + int hostx_get_window(int a_screen_number) { @@ -1339,80 +1495,6 @@ out: return is_ok; } -#ifdef XF86DRI -typedef struct { - int is_valid; - int local_id; - int remote_id; -} ResourcePair; - -#define RESOURCE_PEERS_SIZE 1024*10 -static ResourcePair resource_peers[RESOURCE_PEERS_SIZE]; - -int -hostx_allocate_resource_id_peer(int a_local_resource_id, - int *a_remote_resource_id) -{ - int i = 0; - ResourcePair *peer = NULL; - - /* - * first make sure a resource peer - * does not exist already for - * a_local_resource_id - */ - for (i = 0; i < RESOURCE_PEERS_SIZE; i++) { - if (resource_peers[i].is_valid - && resource_peers[i].local_id == a_local_resource_id) { - peer = &resource_peers[i]; - break; - } - } - /* - * find one free peer entry, an feed it with - */ - if (!peer) { - for (i = 0; i < RESOURCE_PEERS_SIZE; i++) { - if (!resource_peers[i].is_valid) { - peer = &resource_peers[i]; - break; - } - } - if (peer) { - peer->remote_id = xcb_generate_id(HostX.conn); - peer->local_id = a_local_resource_id; - peer->is_valid = TRUE; - } - } - if (peer) { - *a_remote_resource_id = peer->remote_id; - return TRUE; - } - return FALSE; -} - -int -hostx_get_resource_id_peer(int a_local_resource_id, int *a_remote_resource_id) -{ - int i = 0; - ResourcePair *peer = NULL; - - for (i = 0; i < RESOURCE_PEERS_SIZE; i++) { - if (resource_peers[i].is_valid - && resource_peers[i].local_id == a_local_resource_id) { - peer = &resource_peers[i]; - break; - } - } - if (peer) { - *a_remote_resource_id = peer->remote_id; - return TRUE; - } - return FALSE; -} - -#endif /* XF86DRI */ - #ifdef GLAMOR Bool ephyr_glamor_init(ScreenPtr screen) @@ -1433,13 +1515,25 @@ ephyr_glamor_init(ScreenPtr screen) return TRUE; } +static int +ephyrSetPixmapVisitWindow(WindowPtr window, void *data) +{ + ScreenPtr screen = window->drawable.pScreen; + + if (screen->GetWindowPixmap(window) == data) { + screen->SetWindowPixmap(window, screen->GetScreenPixmap(screen)); + return WT_WALKCHILDREN; + } + return WT_DONTWALKCHILDREN; +} + Bool ephyr_glamor_create_screen_resources(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *kd_screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = kd_screen->driver; - PixmapPtr screen_pixmap; + PixmapPtr old_screen_pixmap, screen_pixmap; uint32_t tex; if (!ephyr_glamor) @@ -1456,19 +1550,26 @@ ephyr_glamor_create_screen_resources(ScreenPtr pScreen) * * Thus, delete the current screen pixmap, and put a fresh one in. */ - screen_pixmap = pScreen->GetScreenPixmap(pScreen); - pScreen->DestroyPixmap(screen_pixmap); + old_screen_pixmap = pScreen->GetScreenPixmap(pScreen); + pScreen->DestroyPixmap(old_screen_pixmap); screen_pixmap = pScreen->CreatePixmap(pScreen, pScreen->width, pScreen->height, pScreen->rootDepth, GLAMOR_CREATE_NO_LARGE); + if (!screen_pixmap) + return FALSE; pScreen->SetScreenPixmap(screen_pixmap); + if (pScreen->root && pScreen->SetWindowPixmap) + TraverseTree(pScreen->root, ephyrSetPixmapVisitWindow, old_screen_pixmap); /* Tell the GLX code what to GL texture to read from. */ tex = glamor_get_pixmap_texture(screen_pixmap); + if (!tex) + return FALSE; + ephyr_glamor_set_texture(scrpriv->glamor, tex); return TRUE; diff --git a/xserver/hw/kdrive/ephyr/hostx.h b/xserver/hw/kdrive/ephyr/hostx.h index 9299e8dd4..d0f30119c 100644 --- a/xserver/hw/kdrive/ephyr/hostx.h +++ b/xserver/hw/kdrive/ephyr/hostx.h @@ -43,11 +43,6 @@ typedef struct EphyrHostXVars EphyrHostXVars; -typedef struct { - int minKeyCode; - int maxKeyCode; -} EphyrKeySyms; - typedef struct { VisualID visualid; int screen; @@ -153,12 +148,21 @@ void hostx_paint_rect(KdScreenInfo *screen, int sx, int sy, int dx, int dy, int width, int height); +Bool +hostx_load_keymap(KeySymsPtr keySyms, CARD8 *modmap, XkbControlsPtr controls); + void - hostx_load_keymap(void); +hostx_size_set_from_configure(Bool); xcb_connection_t * hostx_get_xcbconn(void); +xcb_generic_event_t * +hostx_get_event(Bool queued_only); + +Bool +hostx_has_queued_event(void); + int hostx_get_screen(void); @@ -184,18 +188,6 @@ int hostx_set_window_bounding_rectangles(int a_window, int hostx_has_extension(xcb_extension_t *extension); -#ifdef XF86DRI -int hostx_lookup_peer_window(void *a_local_window, - int *a_host_peer /*out parameter */ ); -int - -hostx_allocate_resource_id_peer(int a_local_resource_id, - int *a_remote_resource_id); -int - hostx_get_resource_id_peer(int a_local_resource_id, int *a_remote_resource_id); -int hostx_has_dri(void); - -int hostx_has_glx(void); -#endif /* XF86DRI */ +int hostx_get_fd(void); #endif /*_XLIBS_STUFF_H_*/ diff --git a/xserver/hw/kdrive/ephyr/man/Makefile.in b/xserver/hw/kdrive/ephyr/man/Makefile.in index 66b853c94..67cd15e2a 100644 --- a/xserver/hw/kdrive/ephyr/man/Makefile.in +++ b/xserver/hw/kdrive/ephyr/man/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/kdrive/ephyr/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -313,6 +314,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -343,7 +347,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -438,6 +445,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/kdrive/ephyr/os.c b/xserver/hw/kdrive/ephyr/os.c index 0dbcbb883..b481d0a11 100644 --- a/xserver/hw/kdrive/ephyr/os.c +++ b/xserver/hw/kdrive/ephyr/os.c @@ -45,5 +45,4 @@ EphyrInit(void) KdOsFuncs EphyrOsFuncs = { .Init = EphyrInit, - .pollEvents = ephyrPoll, }; diff --git a/xserver/hw/kdrive/fake/Makefile.in b/xserver/hw/kdrive/fake/Makefile.in index 81be26872..d08098be5 100644 --- a/xserver/hw/kdrive/fake/Makefile.in +++ b/xserver/hw/kdrive/fake/Makefile.in @@ -57,9 +57,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -307,6 +308,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -337,7 +341,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -432,6 +439,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/kdrive/fake/mouse.c b/xserver/hw/kdrive/fake/mouse.c index bb4c25eeb..564dae445 100644 --- a/xserver/hw/kdrive/fake/mouse.c +++ b/xserver/hw/kdrive/fake/mouse.c @@ -27,7 +27,6 @@ #include #include #include -#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" diff --git a/xserver/hw/kdrive/fbdev/Makefile.in b/xserver/hw/kdrive/fbdev/Makefile.in index 2d2562c82..3083a1ad7 100644 --- a/xserver/hw/kdrive/fbdev/Makefile.in +++ b/xserver/hw/kdrive/fbdev/Makefile.in @@ -57,9 +57,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -308,6 +309,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -338,7 +342,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -433,6 +440,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/kdrive/linux/Makefile.in b/xserver/hw/kdrive/linux/Makefile.in index 0781c5bee..bd1292a34 100644 --- a/xserver/hw/kdrive/linux/Makefile.in +++ b/xserver/hw/kdrive/linux/Makefile.in @@ -59,9 +59,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -309,6 +310,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -339,7 +343,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -434,6 +441,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/kdrive/linux/evdev.c b/xserver/hw/kdrive/linux/evdev.c index 752489489..9590413be 100644 --- a/xserver/hw/kdrive/linux/evdev.c +++ b/xserver/hw/kdrive/linux/evdev.c @@ -27,7 +27,6 @@ #include #include #include -#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" @@ -220,7 +219,8 @@ EvdevPtrInit(KdPointerInfo * pi) close(fd); - pi->name = strdup("Evdev mouse"); + if (!pi->name) + pi->name = strdup("Evdev mouse"); return Success; } @@ -390,7 +390,8 @@ EvdevKbdInit(KdKeyboardInfo * ki) close(fd); - ki->name = strdup("Evdev keyboard"); + if (!ki->name) + ki->name = strdup("Evdev keyboard"); readMapping(ki); @@ -442,6 +443,7 @@ EvdevKbdLeds(KdKeyboardInfo * ki, int leds) { struct input_event event; Kevdev *ke; + int i; if (!ki) return; @@ -456,22 +458,26 @@ EvdevKbdLeds(KdKeyboardInfo * ki, int leds) event.type = EV_LED; event.code = LED_CAPSL; event.value = leds & (1 << 0) ? 1 : 0; - write(ke->fd, (char *) &event, sizeof(event)); + i = write(ke->fd, (char *) &event, sizeof(event)); + (void) i; event.type = EV_LED; event.code = LED_NUML; event.value = leds & (1 << 1) ? 1 : 0; - write(ke->fd, (char *) &event, sizeof(event)); + i = write(ke->fd, (char *) &event, sizeof(event)); + (void) i; event.type = EV_LED; event.code = LED_SCROLLL; event.value = leds & (1 << 2) ? 1 : 0; - write(ke->fd, (char *) &event, sizeof(event)); + i = write(ke->fd, (char *) &event, sizeof(event)); + (void) i; event.type = EV_LED; event.code = LED_COMPOSE; event.value = leds & (1 << 3) ? 1 : 0; - write(ke->fd, (char *) &event, sizeof(event)); + i = write(ke->fd, (char *) &event, sizeof(event)); + (void) i; } static void diff --git a/xserver/hw/kdrive/linux/linux.c b/xserver/hw/kdrive/linux/linux.c index 73a8169bf..56c2cb79c 100644 --- a/xserver/hw/kdrive/linux/linux.c +++ b/xserver/hw/kdrive/linux/linux.c @@ -25,7 +25,6 @@ #endif #include "kdrive.h" #include -#include #include #include #include @@ -169,53 +168,44 @@ LinuxSetSwitchMode(int mode) } } -static void -LinuxApmBlock(void *blockData, OSTimePtr pTimeout, void *pReadmask) -{ -} - static Bool LinuxApmRunning; static void -LinuxApmWakeup(void *blockData, int result, void *pReadmask) +LinuxApmNotify(int fd, int mask, void *blockData) { - fd_set *readmask = (fd_set *) pReadmask; + apm_event_t event; + Bool running = LinuxApmRunning; + int cmd = APM_IOC_SUSPEND; - if (result > 0 && LinuxApmFd >= 0 && FD_ISSET(LinuxApmFd, readmask)) { - apm_event_t event; - Bool running = LinuxApmRunning; - int cmd = APM_IOC_SUSPEND; - - while (read(LinuxApmFd, &event, sizeof(event)) == sizeof(event)) { - switch (event) { - case APM_SYS_STANDBY: - case APM_USER_STANDBY: - running = FALSE; - cmd = APM_IOC_STANDBY; - break; - case APM_SYS_SUSPEND: - case APM_USER_SUSPEND: - case APM_CRITICAL_SUSPEND: - running = FALSE; - cmd = APM_IOC_SUSPEND; - break; - case APM_NORMAL_RESUME: - case APM_CRITICAL_RESUME: - case APM_STANDBY_RESUME: - running = TRUE; - break; - } - } - if (running && !LinuxApmRunning) { - KdResume(); - LinuxApmRunning = TRUE; - } - else if (!running && LinuxApmRunning) { - KdSuspend(); - LinuxApmRunning = FALSE; - ioctl(LinuxApmFd, cmd, 0); + while (read(fd, &event, sizeof(event)) == sizeof(event)) { + switch (event) { + case APM_SYS_STANDBY: + case APM_USER_STANDBY: + running = FALSE; + cmd = APM_IOC_STANDBY; + break; + case APM_SYS_SUSPEND: + case APM_USER_SUSPEND: + case APM_CRITICAL_SUSPEND: + running = FALSE; + cmd = APM_IOC_SUSPEND; + break; + case APM_NORMAL_RESUME: + case APM_CRITICAL_RESUME: + case APM_STANDBY_RESUME: + running = TRUE; + break; } } + if (running && !LinuxApmRunning) { + KdResume(); + LinuxApmRunning = TRUE; + } + else if (!running && LinuxApmRunning) { + KdSuspend(); + LinuxApmRunning = FALSE; + ioctl(fd, cmd, 0); + } } #ifdef FNONBLOCK @@ -242,8 +232,7 @@ LinuxEnable(void) if (LinuxApmFd >= 0) { LinuxApmRunning = TRUE; fcntl(LinuxApmFd, F_SETFL, fcntl(LinuxApmFd, F_GETFL) | NOBLOCK); - RegisterBlockAndWakeupHandlers(LinuxApmBlock, LinuxApmWakeup, 0); - AddEnabledDevice(LinuxApmFd); + SetNotifyFd(LinuxApmFd, LinuxApmNotify, X_NOTIFY_READ, NULL); } /* @@ -273,8 +262,7 @@ LinuxDisable(void) } enabled = FALSE; if (LinuxApmFd >= 0) { - RemoveBlockAndWakeupHandlers(LinuxApmBlock, LinuxApmWakeup, 0); - RemoveEnabledDevice(LinuxApmFd); + RemoveNotifyFd(LinuxApmFd); close(LinuxApmFd); LinuxApmFd = -1; } diff --git a/xserver/hw/kdrive/linux/mouse.c b/xserver/hw/kdrive/linux/mouse.c index 2bfe7f242..6bdd28651 100644 --- a/xserver/hw/kdrive/linux/mouse.c +++ b/xserver/hw/kdrive/linux/mouse.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" @@ -47,23 +47,15 @@ typedef struct _kbufio { static Bool MouseWaitForReadable(int fd, int timeout) { - fd_set set; - struct timeval tv, *tp; + struct pollfd poll_fd; int n; CARD32 done; done = GetTimeInMillis() + timeout; + poll_fd.fd = fd; + poll_fd.events = POLLIN; for (;;) { - FD_ZERO(&set); - FD_SET(fd, &set); - if (timeout == -1) - tp = 0; - else { - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout % 1000) * 1000; - tp = &tv; - } - n = select(fd + 1, &set, 0, 0, tp); + n = xserver_poll(&poll_fd, 1, timeout); if (n > 0) return TRUE; if (n < 0 && (errno == EAGAIN || errno == EINTR)) { @@ -139,20 +131,12 @@ MousePeekByte(Kbufio * b, int timeout) static Bool MouseWaitForWritable(int fd, int timeout) { - fd_set set; - struct timeval tv, *tp; + struct pollfd poll_fd; int n; - FD_ZERO(&set); - FD_SET(fd, &set); - if (timeout == -1) - tp = 0; - else { - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout % 1000) * 1000; - tp = &tv; - } - n = select(fd + 1, 0, &set, 0, tp); + poll_fd.fd = fd; + poll_fd.events = POLLOUT; + n = xserver_poll(&poll_fd, 1, timeout); if (n > 0) return TRUE; return FALSE; diff --git a/xserver/hw/kdrive/linux/ms.c b/xserver/hw/kdrive/linux/ms.c index e82350ac5..3934682ad 100644 --- a/xserver/hw/kdrive/linux/ms.c +++ b/xserver/hw/kdrive/linux/ms.c @@ -26,9 +26,9 @@ THE SOFTWARE. #endif #include #include +#include #include #include -#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" @@ -37,9 +37,10 @@ static int MsReadBytes(int fd, char *buf, int len, int min) { int n, tot; - fd_set set; - struct timeval tv; + struct pollfd poll_fd; + poll_fd.fd = fd; + poll_fd.events = POLLIN; tot = 0; while (len) { n = read(fd, buf, len); @@ -50,11 +51,7 @@ MsReadBytes(int fd, char *buf, int len, int min) } if (tot % min == 0) break; - FD_ZERO(&set); - FD_SET(fd, &set); - tv.tv_sec = 0; - tv.tv_usec = 100 * 1000; - n = select(fd + 1, &set, 0, 0, &tv); + n = xserver_poll(&poll_fd, 1, 100); if (n <= 0) break; } diff --git a/xserver/hw/kdrive/linux/ps2.c b/xserver/hw/kdrive/linux/ps2.c index e5417a567..4fec02408 100644 --- a/xserver/hw/kdrive/linux/ps2.c +++ b/xserver/hw/kdrive/linux/ps2.c @@ -25,7 +25,7 @@ #endif #include #include -#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" @@ -34,10 +34,11 @@ static int Ps2ReadBytes(int fd, char *buf, int len, int min) { int n, tot; - fd_set set; - struct timeval tv; + struct pollfd poll_fd; tot = 0; + poll_fd.fd = fd; + poll_fd.events = POLLIN; while (len) { n = read(fd, buf, len); if (n > 0) { @@ -47,11 +48,7 @@ Ps2ReadBytes(int fd, char *buf, int len, int min) } if (tot % min == 0) break; - FD_ZERO(&set); - FD_SET(fd, &set); - tv.tv_sec = 0; - tv.tv_usec = 100 * 1000; - n = select(fd + 1, &set, 0, 0, &tv); + n = xserver_poll(&poll_fd, 1, 100); if (n <= 0) break; } diff --git a/xserver/hw/kdrive/linux/tslib.c b/xserver/hw/kdrive/linux/tslib.c index 1403c7968..0cdb4ea7d 100644 --- a/xserver/hw/kdrive/linux/tslib.c +++ b/xserver/hw/kdrive/linux/tslib.c @@ -36,7 +36,6 @@ #include #include -#include #include "inputstr.h" #include "scrnintstr.h" #include "kdrive.h" diff --git a/xserver/hw/kdrive/src/Makefile.am b/xserver/hw/kdrive/src/Makefile.am index d69f0dd99..b7f94b058 100644 --- a/xserver/hw/kdrive/src/Makefile.am +++ b/xserver/hw/kdrive/src/Makefile.am @@ -23,3 +23,11 @@ libkdrive_la_SOURCES = \ kshadow.c \ $(KDRIVE_XV_SOURCES) \ $(top_srcdir)/mi/miinitext.c + +if CONFIG_UDEV +libkdrive_la_LIBADD = $(top_builddir)/config/libconfig.la +else +if CONFIG_HAL +libkdrive_la_LIBADD = $(top_builddir)/config/libconfig.la +endif +endif diff --git a/xserver/hw/kdrive/src/Makefile.in b/xserver/hw/kdrive/src/Makefile.in index 60d446ef0..d679b82a8 100644 --- a/xserver/hw/kdrive/src/Makefile.in +++ b/xserver/hw/kdrive/src/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -72,7 +73,9 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) -libkdrive_la_LIBADD = +@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@libkdrive_la_DEPENDENCIES = $(top_builddir)/config/libconfig.la +@CONFIG_UDEV_TRUE@libkdrive_la_DEPENDENCIES = \ +@CONFIG_UDEV_TRUE@ $(top_builddir)/config/libconfig.la am__libkdrive_la_SOURCES_DIST = fourcc.h kcmap.c kdrive.c kdrive.h \ kinfo.c kinput.c kmode.c kshadow.c kxv.c kxv.h \ $(top_srcdir)/mi/miinitext.c @@ -303,6 +306,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -333,7 +339,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -428,6 +437,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -497,6 +507,8 @@ libkdrive_la_SOURCES = \ $(KDRIVE_XV_SOURCES) \ $(top_srcdir)/mi/miinitext.c +@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@libkdrive_la_LIBADD = $(top_builddir)/config/libconfig.la +@CONFIG_UDEV_TRUE@libkdrive_la_LIBADD = $(top_builddir)/config/libconfig.la all: all-am .SUFFIXES: diff --git a/xserver/hw/kdrive/src/kdrive.c b/xserver/hw/kdrive/src/kdrive.c index 582ff66d2..f02d8262b 100644 --- a/xserver/hw/kdrive/src/kdrive.c +++ b/xserver/hw/kdrive/src/kdrive.c @@ -43,7 +43,13 @@ #include #endif -#include +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) +#include +#endif + +/* This stub can be safely removed once we can + * split input and GPU parts in hotplug.h et al. */ +#include typedef struct _kdDepths { CARD8 depth; @@ -81,6 +87,11 @@ char *kdSwitchCmd; DDXPointRec kdOrigin; Bool kdHasPointer = FALSE; Bool kdHasKbd = FALSE; +const char *kdGlobalXkbRules = NULL; +const char *kdGlobalXkbModel = NULL; +const char *kdGlobalXkbLayout = NULL; +const char *kdGlobalXkbVariant = NULL; +const char *kdGlobalXkbOptions = NULL; static Bool kdCaughtSignal = FALSE; @@ -447,6 +458,11 @@ KdUseMsg(void) ("-mouse driver [,n,,options] Specify the pointer driver and its options (n is the number of buttons)\n"); ErrorF ("-keybd driver [,,options] Specify the keyboard driver and its options\n"); + ErrorF("-xkb-rules Set default XkbRules value (can be overriden by -keybd options)\n"); + ErrorF("-xkb-model Set default XkbModel value (can be overriden by -keybd options)\n"); + ErrorF("-xkb-layout Set default XkbLayout value (can be overriden by -keybd options)\n"); + ErrorF("-xkb-variant Set default XkbVariant value (can be overriden by -keybd options)\n"); + ErrorF("-xkb-options Set default XkbOptions value (can be overriden by -keybd options)\n"); ErrorF("-zaphod Disable cursor screen switching\n"); ErrorF("-2button Emulate 3 button mouse\n"); ErrorF("-3button Disable 3 button mouse emulation\n"); @@ -555,6 +571,46 @@ KdProcessArgument(int argc, char **argv, int i) sscanf(argv[i], "vt%2d", &kdVirtualTerminal) == 1) { return 1; } + if (!strcmp(argv[i], "-xkb-rules")) { + if (i + 1 >= argc) { + UseMsg(); + FatalError("Missing argument for option -xkb-rules.\n"); + } + kdGlobalXkbRules = argv[i + 1]; + return 2; + } + if (!strcmp(argv[i], "-xkb-model")) { + if (i + 1 >= argc) { + UseMsg(); + FatalError("Missing argument for option -xkb-model.\n"); + } + kdGlobalXkbModel = argv[i + 1]; + return 2; + } + if (!strcmp(argv[i], "-xkb-layout")) { + if (i + 1 >= argc) { + UseMsg(); + FatalError("Missing argument for option -xkb-layout.\n"); + } + kdGlobalXkbLayout = argv[i + 1]; + return 2; + } + if (!strcmp(argv[i], "-xkb-variant")) { + if (i + 1 >= argc) { + UseMsg(); + FatalError("Missing argument for option -xkb-variant.\n"); + } + kdGlobalXkbVariant = argv[i + 1]; + return 2; + } + if (!strcmp(argv[i], "-xkb-options")) { + if (i + 1 >= argc) { + UseMsg(); + FatalError("Missing argument for option -xkb-options.\n"); + } + kdGlobalXkbOptions = argv[i + 1]; + return 2; + } if (!strcmp(argv[i], "-mouse") || !strcmp(argv[i], "-pointer")) { if (i + 1 >= argc) UseMsg(); @@ -1125,6 +1181,11 @@ KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) KdAddScreen(pScreenInfo, screen, argc, argv); OsRegisterSigWrapper(KdSignalWrapper); + +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + if (SeatId) /* Enable input hot-plugging */ + config_pre_init(); +#endif } void @@ -1143,3 +1204,36 @@ DPMSSupported(void) { return FALSE; } + +/* These stubs can be safely removed once we can + * split input and GPU parts in hotplug.h et al. */ +#ifdef CONFIG_UDEV_KMS +void +NewGPUDeviceRequest(struct OdevAttributes *attribs) +{ +} + +void +DeleteGPUDeviceRequest(struct OdevAttributes *attribs) +{ +} +#endif + +struct xf86_platform_device * +xf86_find_platform_device_by_devnum(int major, int minor) +{ + return NULL; +} + +#ifdef SYSTEMD_LOGIND +void +systemd_logind_vtenter(void) +{ +} + +void +systemd_logind_release_fd(int major, int minor, int fd) +{ + close(fd); +} +#endif diff --git a/xserver/hw/kdrive/src/kdrive.h b/xserver/hw/kdrive/src/kdrive.h index e1d2b5927..3c7f2cdf2 100644 --- a/xserver/hw/kdrive/src/kdrive.h +++ b/xserver/hw/kdrive/src/kdrive.h @@ -527,12 +527,10 @@ void KdScreenToPointerCoords(int *x, int *y); void - -KdBlockHandler(ScreenPtr pScreen, void *timeout, void *readmask); +KdBlockHandler(ScreenPtr pScreen, void *timeout); void - -KdWakeupHandler(ScreenPtr pScreen, unsigned long result, void *readmask); +KdWakeupHandler(ScreenPtr pScreen, int result); void KdDisableInput(void); diff --git a/xserver/hw/kdrive/src/kinfo.c b/xserver/hw/kdrive/src/kinfo.c index 01ae1e491..f91d57504 100644 --- a/xserver/hw/kdrive/src/kinfo.c +++ b/xserver/hw/kdrive/src/kinfo.c @@ -134,6 +134,7 @@ KdFreePointer(KdPointerInfo * pi) free(pi->name); free(pi->path); input_option_free_list(&pi->options); + pi->next = NULL; free(pi); } @@ -145,6 +146,9 @@ KdFreeKeyboard(KdKeyboardInfo * ki) free(ki->xkbRules); free(ki->xkbModel); free(ki->xkbLayout); + free(ki->xkbVariant); + free(ki->xkbOptions); + input_option_free_list(&ki->options); ki->next = NULL; free(ki); } diff --git a/xserver/hw/kdrive/src/kinput.c b/xserver/hw/kdrive/src/kinput.c index d5741f100..8b08747a6 100644 --- a/xserver/hw/kdrive/src/kinput.c +++ b/xserver/hw/kdrive/src/kinput.c @@ -32,9 +32,8 @@ #if HAVE_X11_XF86KEYSYM_H #include #endif -#include #include -#ifdef sun +#ifdef __sun #include /* needed for FNONBLOCK & FASYNC */ #endif @@ -51,6 +50,15 @@ #include "inpututils.h" #include "optionstr.h" +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) +#include +#endif + +#ifdef KDRIVE_EVDEV +#define DEV_INPUT_EVENT_PREFIX "/dev/input/event" +#define DEV_INPUT_EVENT_PREFIX_LEN (sizeof(DEV_INPUT_EVENT_PREFIX) - 1) +#endif + #define AtomFromName(x) MakeAtom(x, strlen(x), 1) struct KdConfigDevice { @@ -93,37 +101,11 @@ static int kdNumInputFds; extern Bool kdRawPointerCoordinates; -static void -KdSigio(int sig) -{ - int i; - - for (i = 0; i < kdNumInputFds; i++) - (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure); -} - -#ifdef DEBUG_SIGIO - -void -KdAssertSigioBlocked(char *where) -{ - sigset_t set, old; - - sigemptyset(&set); - sigprocmask(SIG_BLOCK, &set, &old); - if (!sigismember(&old, SIGIO)) { - ErrorF("SIGIO not blocked at %s\n", where); - KdBacktrace(0); - } -} - -#else - -#define KdAssertSigioBlocked(s) - -#endif - -static int kdnFds; +extern const char *kdGlobalXkbRules; +extern const char *kdGlobalXkbModel; +extern const char *kdGlobalXkbLayout; +extern const char *kdGlobalXkbVariant; +extern const char *kdGlobalXkbOptions; #ifdef FNONBLOCK #define NOBLOCK FNONBLOCK @@ -153,43 +135,28 @@ KdNonBlockFd(int fd) } static void -KdAddFd(int fd) +KdNotifyFd(int fd, int ready, void *data) { - struct sigaction act; - sigset_t set; + int i = (int) (intptr_t) data; + (*kdInputFds[i].read)(fd, kdInputFds[i].closure); +} - kdnFds++; - fcntl(fd, F_SETOWN, getpid()); +static void +KdAddFd(int fd, int i) +{ KdNonBlockFd(fd); - AddEnabledDevice(fd); - memset(&act, '\0', sizeof act); - act.sa_handler = KdSigio; - sigemptyset(&act.sa_mask); - sigaddset(&act.sa_mask, SIGIO); - sigaddset(&act.sa_mask, SIGALRM); - sigaddset(&act.sa_mask, SIGVTALRM); - sigaction(SIGIO, &act, 0); - sigemptyset(&set); - sigprocmask(SIG_SETMASK, &set, 0); + InputThreadRegisterDev(fd, KdNotifyFd, (void *) (intptr_t) i); } static void KdRemoveFd(int fd) { - struct sigaction act; int flags; - kdnFds--; - RemoveEnabledDevice(fd); + InputThreadUnregisterDev(fd); flags = fcntl(fd, F_GETFL); flags &= ~(FASYNC | NOBLOCK); fcntl(fd, F_SETFL, flags); - if (kdnFds == 0) { - memset(&act, '\0', sizeof act); - act.sa_handler = SIG_IGN; - sigemptyset(&act.sa_mask); - sigaction(SIGIO, &act, 0); - } } Bool @@ -202,9 +169,9 @@ KdRegisterFd(int fd, void (*read) (int fd, void *closure), void *closure) kdInputFds[kdNumInputFds].enable = 0; kdInputFds[kdNumInputFds].disable = 0; kdInputFds[kdNumInputFds].closure = closure; - kdNumInputFds++; if (kdInputEnabled) - KdAddFd(fd); + KdAddFd(fd, kdNumInputFds); + kdNumInputFds++; return TRUE; } @@ -241,7 +208,7 @@ KdDisableInput(void) KdPointerInfo *pi; int found = 0, i = 0; - OsBlockSIGIO(); + input_lock(); for (ki = kdKeyboards; ki; ki = ki->next) { if (ki->driver && ki->driver->Disable) @@ -324,7 +291,7 @@ KdEnableInput(void) NoticeEventTime (&ev, pi->dixdev); } - OsReleaseSIGIO(); + input_unlock(); } static KdKeyboardDriver * @@ -391,7 +358,8 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff) #endif if (!pi->driver) { if (!pi->driverPrivate) { - ErrorF("no driver specified for %s\n", pi->name); + ErrorF("no driver specified for pointer device \"%s\" (%s)\n", + pi->name ? pi->name : "(unnamed)", pi->path); return BadImplementation; } @@ -711,7 +679,8 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff) #endif if (!ki->driver) { if (!ki->driverPrivate) { - ErrorF("no driver specified!\n"); + ErrorF("no driver specified for keyboard device \"%s\" (%s)\n", + ki->name ? ki->name : "(unnamed)", ki->path); return BadImplementation; } @@ -731,10 +700,6 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff) return BadImplementation; } - if ((*ki->driver->Init) (ki) != Success) { - return !Success; - } - memset(&rmlvo, 0, sizeof(rmlvo)); rmlvo.rules = ki->xkbRules; rmlvo.model = ki->xkbModel; @@ -747,6 +712,10 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff) return BadImplementation; } + if ((*ki->driver->Init) (ki) != Success) { + return !Success; + } + xiclass = AtomFromName(XI_KEYBOARD); AssignTypeAndName(pDevice, xiclass, ki->name ? ki->name : "Generic KDrive Keyboard"); @@ -885,11 +854,13 @@ KdNewKeyboard(void) ki->bellDuration = 200; ki->next = NULL; ki->options = NULL; - ki->xkbRules = strdup(XKB_DFLT_RULES); - ki->xkbModel = strdup(XKB_DFLT_MODEL); - ki->xkbLayout = strdup(XKB_DFLT_LAYOUT); - ki->xkbVariant = strdup(XKB_DFLT_VARIANT); - ki->xkbOptions = strdup(XKB_DFLT_OPTIONS); + ki->name = strdup("Generic Keyboard"); + ki->path = NULL; + ki->xkbRules = strdup(kdGlobalXkbRules ? kdGlobalXkbRules : XKB_DFLT_RULES); + ki->xkbModel = strdup(kdGlobalXkbModel ? kdGlobalXkbModel : XKB_DFLT_MODEL); + ki->xkbLayout = strdup(kdGlobalXkbLayout ? kdGlobalXkbLayout : XKB_DFLT_LAYOUT); + ki->xkbVariant = strdup(kdGlobalXkbVariant ? kdGlobalXkbVariant :XKB_DFLT_VARIANT); + ki->xkbOptions = strdup(kdGlobalXkbOptions ? kdGlobalXkbOptions : XKB_DFLT_OPTIONS); return ki; } @@ -1068,22 +1039,68 @@ KdParseKbdOptions(KdKeyboardInfo * ki) const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); - if (strcasecmp(key, "XkbRules") == 0) + if ( +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + strcasecmp(key, "xkb_rules") == 0 || +#endif + strcasecmp(key, "XkbRules") == 0) ki->xkbRules = strdup(value); - else if (strcasecmp(key, "XkbModel") == 0) + else if ( +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + strcasecmp(key, "xkb_model") == 0 || +#endif + strcasecmp(key, "XkbModel") == 0) ki->xkbModel = strdup(value); - else if (strcasecmp(key, "XkbLayout") == 0) + else if ( +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + strcasecmp(key, "xkb_layout") == 0 || +#endif + strcasecmp(key, "XkbLayout") == 0) ki->xkbLayout = strdup(value); - else if (strcasecmp(key, "XkbVariant") == 0) + else if ( +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + strcasecmp(key, "xkb_variant") == 0 || +#endif + strcasecmp(key, "XkbVariant") == 0) ki->xkbVariant = strdup(value); - else if (strcasecmp(key, "XkbOptions") == 0) + else if ( +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + strcasecmp(key, "xkb_options") == 0 || +#endif + strcasecmp(key, "XkbOptions") == 0) ki->xkbOptions = strdup(value); - else if (!strcasecmp(key, "device")) + else if (!strcasecmp(key, "device")) { + if (ki->path != NULL) + free(ki->path); ki->path = strdup(value); + } +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + else if (!strcasecmp(key, "path")) { + if (ki->path != NULL) + free(ki->path); + ki->path = strdup(value); + } + else if (!strcasecmp(key, "name")) { + free(ki->name); + ki->name = strdup(value); + } +#endif + else if (!strcasecmp(key, "driver")) + ki->driver = KdFindKeyboardDriver(value); else ErrorF("Kbd option key (%s) of value (%s) not assigned!\n", key, value); } + +#ifdef KDRIVE_EVDEV + if (!ki->driver && ki->path != NULL && + strncasecmp(ki->path, + DEV_INPUT_EVENT_PREFIX, + DEV_INPUT_EVENT_PREFIX_LEN) == 0) { + ki->driver = KdFindKeyboardDriver("evdev"); + ki->options = input_option_new(ki->options, "driver", "evdev"); + } +#endif } KdKeyboardInfo * @@ -1160,22 +1177,48 @@ KdParsePointerOptions(KdPointerInfo * pi) const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); - if (!strcmp(key, "emulatemiddle")) + if (!strcasecmp(key, "emulatemiddle")) pi->emulateMiddleButton = TRUE; - else if (!strcmp(key, "noemulatemiddle")) + else if (!strcasecmp(key, "noemulatemiddle")) pi->emulateMiddleButton = FALSE; - else if (!strcmp(key, "transformcoord")) + else if (!strcasecmp(key, "transformcoord")) pi->transformCoordinates = TRUE; - else if (!strcmp(key, "rawcoord")) + else if (!strcasecmp(key, "rawcoord")) pi->transformCoordinates = FALSE; - else if (!strcasecmp(key, "device")) + else if (!strcasecmp(key, "device")) { + if (pi->path != NULL) + free(pi->path); pi->path = strdup(value); + } +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + else if (!strcasecmp(key, "path")) { + if (pi->path != NULL) + free(pi->path); + pi->path = strdup(value); + } + else if (!strcasecmp(key, "name")) { + free(pi->name); + pi->name = strdup(value); + } +#endif else if (!strcasecmp(key, "protocol")) pi->protocol = strdup(value); + else if (!strcasecmp(key, "driver")) + pi->driver = KdFindPointerDriver(value); else ErrorF("Pointer option key (%s) of value (%s) not assigned!\n", key, value); } + +#ifdef KDRIVE_EVDEV + if (!pi->driver && pi->path != NULL && + strncasecmp(pi->path, + DEV_INPUT_EVENT_PREFIX, + DEV_INPUT_EVENT_PREFIX_LEN) == 0) { + pi->driver = KdFindPointerDriver("evdev"); + pi->options = input_option_new(pi->options, "driver", "evdev"); + } +#endif } KdPointerInfo * @@ -1262,6 +1305,9 @@ KdInitInput(void) KdKeyboardInfo *ki; struct KdConfigDevice *dev; + if (kdConfigPointers || kdConfigKeyboards) + InputThreadPreInit(); + kdInputEnabled = TRUE; for (dev = kdConfigPointers; dev; dev = dev->next) { @@ -1280,11 +1326,21 @@ KdInitInput(void) } mieqInit(); + +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + if (SeatId) /* Enable input hot-plugging */ + config_init(); +#endif } void KdCloseInput(void) { +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) + if (SeatId) /* Input hot-plugging is enabled */ + config_fini(); +#endif + mieqFini(); } @@ -1740,7 +1796,7 @@ KdReleaseAllKeys(void) int key; KdKeyboardInfo *ki; - OsBlockSIGIO(); + input_lock(); for (ki = kdKeyboards; ki; ki = ki->next) { for (key = ki->keySyms.minKeyCode; key < ki->keySyms.maxKeyCode; key++) { @@ -1751,7 +1807,7 @@ KdReleaseAllKeys(void) } } - OsReleaseSIGIO(); + input_unlock(); #endif } @@ -1905,7 +1961,7 @@ _KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, } void -KdBlockHandler(ScreenPtr pScreen, void *timeo, void *readmask) +KdBlockHandler(ScreenPtr pScreen, void *timeo) { KdPointerInfo *pi; int myTimeout = 0; @@ -1931,28 +1987,17 @@ KdBlockHandler(ScreenPtr pScreen, void *timeo, void *readmask) } void -KdWakeupHandler(ScreenPtr pScreen, unsigned long lresult, void *readmask) +KdWakeupHandler(ScreenPtr pScreen, int result) { - int result = (int) lresult; - fd_set *pReadmask = (fd_set *) readmask; - int i; KdPointerInfo *pi; - if (kdInputEnabled && result > 0) { - for (i = 0; i < kdNumInputFds; i++) - if (FD_ISSET(kdInputFds[i].fd, pReadmask)) { - OsBlockSIGIO(); - (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure); - OsReleaseSIGIO(); - } - } for (pi = kdPointers; pi; pi = pi->next) { if (pi->timeoutPending) { if ((long) (GetTimeInMillis() - pi->emulationTimeout) >= 0) { pi->timeoutPending = FALSE; - OsBlockSIGIO(); + input_lock(); KdReceiveTimeout(pi); - OsReleaseSIGIO(); + input_unlock(); } } } @@ -2049,10 +2094,10 @@ int KdCurScreen; /* current event screen */ static void KdWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { - OsBlockSIGIO(); + input_lock(); KdCurScreen = pScreen->myNum; miPointerWarpCursor(pDev, pScreen, x, y); - OsReleaseSIGIO(); + input_unlock(); } miPointerScreenFuncRec kdPointerScreenFuncs = { @@ -2112,24 +2157,29 @@ int NewInputDeviceRequest(InputOption *options, InputAttributes * attrs, DeviceIntPtr *pdev) { - InputOption *option = NULL; + InputOption *option = NULL, *optionsdup = NULL; KdPointerInfo *pi = NULL; KdKeyboardInfo *ki = NULL; nt_list_for_each_entry(option, options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); + optionsdup = input_option_new(optionsdup, key, value); if (strcmp(key, "type") == 0) { if (strcmp(value, "pointer") == 0) { pi = KdNewPointer(); - if (!pi) + if (!pi) { + input_option_free_list(&optionsdup); return BadAlloc; + } } else if (strcmp(value, "keyboard") == 0) { ki = KdNewKeyboard(); - if (!ki) + if (!ki) { + input_option_free_list(&optionsdup); return BadAlloc; + } } else { ErrorF("unrecognised device type!\n"); @@ -2139,81 +2189,110 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs, #ifdef CONFIG_HAL else if (strcmp(key, "_source") == 0 && strcmp(value, "server/hal") == 0) { - ErrorF("Ignoring device from HAL.\n"); - return BadValue; + if (SeatId) { + /* Input hot-plugging is enabled */ + if (attrs->flags & ATTR_POINTER) { + pi = KdNewPointer(); + if (!pi) { + input_option_free_list(&optionsdup); + return BadAlloc; + } + } + else if (attrs->flags & ATTR_KEYBOARD) { + ki = KdNewKeyboard(); + if (!ki) { + input_option_free_list(&optionsdup); + return BadAlloc; + } + } + } + else { + ErrorF("Ignoring device from HAL.\n"); + input_option_free_list(&optionsdup); + return BadValue; + } } #endif #ifdef CONFIG_UDEV else if (strcmp(key, "_source") == 0 && strcmp(value, "server/udev") == 0) { - ErrorF("Ignoring device from udev.\n"); - return BadValue; + if (SeatId) { + /* Input hot-plugging is enabled */ + if (attrs->flags & ATTR_POINTER) { + pi = KdNewPointer(); + if (!pi) { + input_option_free_list(&optionsdup); + return BadAlloc; + } + } + else if (attrs->flags & ATTR_KEYBOARD) { + ki = KdNewKeyboard(); + if (!ki) { + input_option_free_list(&optionsdup); + return BadAlloc; + } + } + } + else { + ErrorF("Ignoring device from udev.\n"); + input_option_free_list(&optionsdup); + return BadValue; + } } #endif } - if (!ki && !pi) { - ErrorF("unrecognised device identifier!\n"); - return BadValue; - } - - /* FIXME: change this code below to use KdParseKbdOptions and - * KdParsePointerOptions */ - nt_list_for_each_entry(option, options, list.next) { - const char *key = input_option_get_key(option); - const char *value = input_option_get_value(option); - - if (strcmp(key, "device") == 0) { - if (pi && value) - pi->path = strdup(value); - else if (ki && value) - ki->path = strdup(value); - } - else if (strcmp(key, "driver") == 0) { - if (pi) { - pi->driver = KdFindPointerDriver(value); - if (!pi->driver) { - ErrorF("couldn't find driver!\n"); - KdFreePointer(pi); - return BadValue; - } - pi->options = options; - } - else if (ki) { - ki->driver = KdFindKeyboardDriver(value); - if (!ki->driver) { - ErrorF("couldn't find driver!\n"); - KdFreeKeyboard(ki); - return BadValue; - } - ki->options = options; - } - } - } - if (pi) { + pi->options = optionsdup; + KdParsePointerOptions(pi); + + if (!pi->driver) { + ErrorF("couldn't find driver for pointer device \"%s\" (%s)\n", + pi->name ? pi->name : "(unnamed)", pi->path); + KdFreePointer(pi); + return BadValue; + } + if (KdAddPointer(pi) != Success || ActivateDevice(pi->dixdev, TRUE) != Success || EnableDevice(pi->dixdev, TRUE) != TRUE) { - ErrorF("couldn't add or enable pointer\n"); + ErrorF("couldn't add or enable pointer \"%s\" (%s)\n", + pi->name ? pi->name : "(unnamed)", pi->path); + KdFreePointer(pi); return BadImplementation; } - } - else if (ki) { - if (KdAddKeyboard(ki) != Success || - ActivateDevice(ki->dixdev, TRUE) != Success || - EnableDevice(ki->dixdev, TRUE) != TRUE) { - ErrorF("couldn't add or enable keyboard\n"); - return BadImplementation; - } - } - if (pi) { *pdev = pi->dixdev; } else if (ki) { + ki->options = optionsdup; + KdParseKbdOptions(ki); + + if (!ki->driver) { + ErrorF("couldn't find driver for keyboard device \"%s\" (%s)\n", + ki->name ? ki->name : "(unnamed)", ki->path); + KdFreeKeyboard(ki); + return BadValue; + } + + if (KdAddKeyboard(ki) != Success || + ActivateDevice(ki->dixdev, TRUE) != Success || + EnableDevice(ki->dixdev, TRUE) != TRUE) { + ErrorF("couldn't add or enable keyboard \"%s\" (%s)\n", + ki->name ? ki->name : "(unnamed)", ki->path); + KdFreeKeyboard(ki); + return BadImplementation; + } + *pdev = ki->dixdev; } + else { + ErrorF("unrecognised device identifier: %s\n", + input_option_get_value(input_option_find(optionsdup, + "device"))); + input_option_free_list(&optionsdup); + return BadValue; + } return Success; } @@ -2223,3 +2302,8 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) { RemoveDevice(pDev, TRUE); } + +void +RemoveInputDeviceTraces(const char *config_info) +{ +} diff --git a/xserver/hw/vfb/InitOutput.c b/xserver/hw/vfb/InitOutput.c index 01bb63128..d7bfd70e9 100644 --- a/xserver/hw/vfb/InitOutput.c +++ b/xserver/hw/vfb/InitOutput.c @@ -471,7 +471,7 @@ vfbSaveScreen(ScreenPtr pScreen, int on) /* this flushes any changes to the screens out to the mmapped file */ static void -vfbBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask) +vfbBlockHandler(void *blockData, void *timeout) { int i; @@ -492,7 +492,7 @@ vfbBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask) } static void -vfbWakeupHandler(void *blockData, int result, void *pReadmask) +vfbWakeupHandler(void *blockData, int result) { } diff --git a/xserver/hw/vfb/Makefile.in b/xserver/hw/vfb/Makefile.in index 959729e12..b73e97463 100644 --- a/xserver/hw/vfb/Makefile.in +++ b/xserver/hw/vfb/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -346,6 +347,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -376,7 +380,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/vfb/man/Makefile.in b/xserver/hw/vfb/man/Makefile.in index f8b9ba801..77d26f3c0 100644 --- a/xserver/hw/vfb/man/Makefile.in +++ b/xserver/hw/vfb/man/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/vfb/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -313,6 +314,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -343,7 +347,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -438,6 +445,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/Makefile.am b/xserver/hw/xfree86/Makefile.am index 85bd0bed0..b876b79ab 100644 --- a/xserver/hw/xfree86/Makefile.am +++ b/xserver/hw/xfree86/Makefile.am @@ -36,13 +36,13 @@ endif SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \ ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \ - $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods \ + $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods xkb \ fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \ $(GLAMOR_EGL_SUBDIR) drivers DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ parser ramdac shadowfb vbe vgahw \ - loader dixmods dri dri2 exa modes \ + loader dixmods xkb dri dri2 exa modes \ utils doc man glamor_egl drivers bin_PROGRAMS = Xorg @@ -66,7 +66,7 @@ LOCAL_LIBS = \ ddc/libddc.la \ i2c/libi2c.la \ $(XORG_LIBS) \ - dixmods/libxorgxkb.la \ + xkb/libxorgxkb.la \ $(DRI_LIB) \ $(DRI2_LIB) \ $(DRI3_LIB) \ @@ -148,5 +148,5 @@ i2c/libi2c.la: dixmods/libdixmods.la: $(AM_V_at)cd dixmods && $(MAKE) libdixmods.la -dixmods/libxorgxkb.la: - $(AM_V_at)cd dixmods && $(MAKE) libxorgxkb.la +xkb/libxorgxkb.la: + $(AM_V_at)cd xkb && $(MAKE) libxorgxkb.la diff --git a/xserver/hw/xfree86/Makefile.in b/xserver/hw/xfree86/Makefile.in index 129785ada..5da17959a 100644 --- a/xserver/hw/xfree86/Makefile.in +++ b/xserver/hw/xfree86/Makefile.in @@ -57,9 +57,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/Xorg.sh.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -83,8 +84,8 @@ am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ os-support/libxorgos.la parser/libxf86config.la \ dixmods/libdixmods.la modes/libxf86modes.la \ ramdac/libramdac.la ddc/libddc.la i2c/libi2c.la \ - $(am__DEPENDENCIES_1) dixmods/libxorgxkb.la $(DRI_LIB) \ - $(DRI2_LIB) $(DRI3_LIB) $(top_builddir)/miext/sync/libsync.la \ + $(am__DEPENDENCIES_1) xkb/libxorgxkb.la $(DRI_LIB) $(DRI2_LIB) \ + $(DRI3_LIB) $(top_builddir)/miext/sync/libsync.la \ $(top_builddir)/mi/libmi.la $(top_builddir)/os/libos.la \ $(top_builddir)/Xext/libXvidmode.la AM_V_lt = $(am__v_lt_@AM_V@) @@ -354,6 +355,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -384,7 +388,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -479,6 +486,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -539,13 +547,13 @@ top_srcdir = @top_srcdir@ @INT10MODULE_TRUE@INT10_SUBDIR = int10 SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \ ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \ - $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods \ + $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods xkb \ fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \ $(GLAMOR_EGL_SUBDIR) drivers DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ parser ramdac shadowfb vbe vgahw \ - loader dixmods dri dri2 exa modes \ + loader dixmods xkb dri dri2 exa modes \ utils doc man glamor_egl drivers nodist_Xorg_SOURCES = sdksyms.c @@ -567,7 +575,7 @@ LOCAL_LIBS = \ ddc/libddc.la \ i2c/libi2c.la \ $(XORG_LIBS) \ - dixmods/libxorgxkb.la \ + xkb/libxorgxkb.la \ $(DRI_LIB) \ $(DRI2_LIB) \ $(DRI3_LIB) \ @@ -1127,8 +1135,8 @@ i2c/libi2c.la: dixmods/libdixmods.la: $(AM_V_at)cd dixmods && $(MAKE) libdixmods.la -dixmods/libxorgxkb.la: - $(AM_V_at)cd dixmods && $(MAKE) libxorgxkb.la +xkb/libxorgxkb.la: + $(AM_V_at)cd xkb && $(MAKE) libxorgxkb.la # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/xserver/hw/xfree86/common/Makefile.in b/xserver/hw/xfree86/common/Makefile.in index a37b5118f..767488a9f 100644 --- a/xserver/hw/xfree86/common/Makefile.in +++ b/xserver/hw/xfree86/common/Makefile.in @@ -59,9 +59,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -361,6 +362,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -391,7 +395,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -486,6 +493,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/common/xf86.h b/xserver/hw/xfree86/common/xf86.h index 1cde47873..e54c81170 100644 --- a/xserver/hw/xfree86/common/xf86.h +++ b/xserver/hw/xfree86/common/xf86.h @@ -61,10 +61,6 @@ extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec; #define xf86ScreenKey (&xf86ScreenKeyRec) -extern _X_EXPORT DevPrivateKeyRec xf86CreateRootWindowKeyRec; - -#define xf86CreateRootWindowKey (&xf86CreateRootWindowKeyRec) - extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */ extern _X_EXPORT const unsigned char byte_reversed[256]; extern _X_EXPORT Bool fbSlotClaimed; @@ -97,6 +93,10 @@ extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */ #define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \ (((p) == Pix24Use32) ? 32 : 0)) +/* Compatibility functions for pre-input-thread drivers */ +static inline _X_DEPRECATED int xf86BlockSIGIO(void) { input_lock(); return 0; } +static inline _X_DEPRECATED void xf86UnblockSIGIO(int wasset) { input_unlock(); } + /* Function Prototypes */ #ifndef _NO_XF86_PROTOTYPES @@ -306,8 +306,6 @@ xf86ServerIsExiting(void); extern _X_EXPORT Bool xf86ServerIsResetting(void); extern _X_EXPORT Bool -xf86ServerIsInitialising(void); -extern _X_EXPORT Bool xf86ServerIsOnlyDetecting(void); extern _X_EXPORT Bool xf86CaughtSignal(void); @@ -353,9 +351,6 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, extern _X_EXPORT Bool xf86IsScreenPrimary(ScrnInfoPtr pScrn); -extern _X_EXPORT int -xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, - int format, unsigned long len, void *value); extern _X_EXPORT Bool xf86IsUnblank(int mode); diff --git a/xserver/hw/xfree86/common/xf86AutoConfig.c b/xserver/hw/xfree86/common/xf86AutoConfig.c index 4df6a4dfc..dfde795d7 100644 --- a/xserver/hw/xfree86/common/xf86AutoConfig.c +++ b/xserver/hw/xfree86/common/xf86AutoConfig.c @@ -45,7 +45,7 @@ #include "xf86sbusBus.h" #endif -#ifdef sun +#ifdef __sun #include #include #endif @@ -149,6 +149,15 @@ xf86AutoConfig(void) char buf[1024]; ConfigStatus ret; + /* Make sure config rec is there */ + if (xf86allocateConfig() != NULL) { + ret = CONFIG_OK; /* OK so far */ + } + else { + xf86Msg(X_ERROR, "Couldn't allocate Config record.\n"); + return FALSE; + } + listPossibleVideoDrivers(deviceList, 20); for (p = deviceList; *p; p++) { @@ -247,7 +256,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches) #ifdef XSERVER_PLATFORM_BUS i = xf86PlatformMatchDriver(matches, nmatches); #endif -#ifdef sun +#ifdef __sun /* Check for driver type based on /dev/fb type and if valid, use it instead of PCI bus probe results */ if (xf86Info.consoleFd >= 0 && (i < (nmatches - 1))) { @@ -316,7 +325,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches) matches[i++] = xnfstrdup("modesetting"); #endif -#if !defined(sun) +#if !defined(__sun) /* Fallback to platform default frame buffer driver */ if (i < (nmatches - 1)) { #if defined(__OpenBSD__) @@ -331,7 +340,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches) matches[i++] = xnfstrdup("fbdev"); #endif } -#endif /* !sun */ +#endif /* !__sun */ /* Fallback to platform default hardware */ if (i < (nmatches - 1)) { diff --git a/xserver/hw/xfree86/common/xf86Bus.c b/xserver/hw/xfree86/common/xf86Bus.c index 2b412fa2f..377a4211e 100644 --- a/xserver/hw/xfree86/common/xf86Bus.c +++ b/xserver/hw/xfree86/common/xf86Bus.c @@ -78,7 +78,8 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only) Bool foundScreen = FALSE; #ifdef XSERVER_PLATFORM_BUS - if (drv->platformProbe != NULL) { + /* xf86platformBus.c does not support Xorg -configure */ + if (!xf86DoConfigure && drv->platformProbe != NULL) { foundScreen = xf86platformProbeDev(drv); } if (ServerIsNotSeat0() && foundScreen) diff --git a/xserver/hw/xfree86/common/xf86Config.c b/xserver/hw/xfree86/common/xf86Config.c index c7dfd6886..21f0110c1 100644 --- a/xserver/hw/xfree86/common/xf86Config.c +++ b/xserver/hw/xfree86/common/xf86Config.c @@ -710,7 +710,6 @@ typedef enum { FLAG_LOG, FLAG_RENDER_COLORMAP_MODE, FLAG_RANDR, - FLAG_AIGLX, FLAG_IGNORE_ABI, FLAG_ALLOW_EMPTY_INPUT, FLAG_USE_DEFAULT_FONT_PATH, @@ -763,8 +762,6 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE}, {FLAG_RANDR, "RandR", OPTV_BOOLEAN, {0}, FALSE}, - {FLAG_AIGLX, "AIGLX", OPTV_BOOLEAN, - {0}, FALSE}, {FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN, {0}, FALSE}, {FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN, @@ -828,27 +825,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Msg(X_CONFIG, "Ignoring ABI Version\n"); } - if (xf86SIGIOSupported()) { - xf86Info.useSIGIO = - xf86ReturnOptValBool(FlagOptions, FLAG_USE_SIGIO, - USE_SIGIO_BY_DEFAULT); - if (xf86IsOptionSet(FlagOptions, FLAG_USE_SIGIO)) { - from = X_CONFIG; - } - else { - from = X_DEFAULT; - } - if (!xf86Info.useSIGIO) { - xf86Msg(from, "Disabling SIGIO handlers for input devices\n"); - } - else if (from == X_CONFIG) { - xf86Msg(from, "Enabling SIGIO handlers for input devices\n"); - } - } - else { - xf86Info.useSIGIO = FALSE; - } - if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) { xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_DEVICES, &xf86Info.autoAddDevices); @@ -938,13 +914,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } #endif - xf86Info.aiglx = TRUE; - xf86Info.aiglxFrom = X_DEFAULT; - if (xf86GetOptValBool(FlagOptions, FLAG_AIGLX, &value)) { - xf86Info.aiglx = value; - xf86Info.aiglxFrom = X_CONFIG; - } - #ifdef GLXEXT xf86Info.glxVisuals = XF86_GlxVisualsTypical; xf86Info.glxVisualsFrom = X_DEFAULT; @@ -963,10 +932,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } } - if (xf86GetOptValBool(FlagOptions, FLAG_AIGLX, &value)) { - xf86Info.aiglx = value; - xf86Info.aiglxFrom = X_CONFIG; - } if (xf86Info.iglxFrom != X_CMDLINE) { if (xf86GetOptValBool(FlagOptions, FLAG_IGLX, &value)) { enableIndirectGLX = value; diff --git a/xserver/hw/xfree86/common/xf86Cursor.c b/xserver/hw/xfree86/common/xf86Cursor.c index 92c08af9e..de054fbc9 100644 --- a/xserver/hw/xfree86/common/xf86Cursor.c +++ b/xserver/hw/xfree86/common/xf86Cursor.c @@ -221,7 +221,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) if (pScreen == pCursorScreen) miPointerGetPosition(dev, &px, &py); - OsBlockSIGIO(); + input_lock(); Switched = (*pScr->SwitchMode) (pScr, mode); if (Switched) { pScr->currentMode = mode; @@ -260,7 +260,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) pScr->frameY1 = pScr->virtualY - 1; } } - OsReleaseSIGIO(); + input_unlock(); if (pScr->AdjustFrame) (*pScr->AdjustFrame) (pScr, pScr->frameX0, pScr->frameY0); @@ -452,11 +452,11 @@ xf86CrossScreen(ScreenPtr pScreen, Bool entering) static void xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { - OsBlockSIGIO(); + input_lock(); miPointerWarpCursor(pDev, pScreen, x, y); xf86Info.currentScreen = pScreen; - OsReleaseSIGIO(); + input_unlock(); } void * diff --git a/xserver/hw/xfree86/common/xf86Events.c b/xserver/hw/xfree86/common/xf86Events.c index 6570f0be9..9a8f432a0 100644 --- a/xserver/hw/xfree86/common/xf86Events.c +++ b/xserver/hw/xfree86/common/xf86Events.c @@ -54,7 +54,6 @@ #endif #include -#include #include #include #include "misc.h" @@ -101,8 +100,6 @@ Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for switches when using the DRI automatic full screen mode.*/ -extern fd_set EnabledDevices; - #ifdef XF86PM extern void (*xf86OSPMClose) (void); #endif @@ -245,64 +242,23 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) /* ARGSUSED */ void -xf86Wakeup(void *blockData, int err, void *pReadmask) +xf86Wakeup(void *blockData, int err) { - fd_set *LastSelectMask = (fd_set *) pReadmask; - fd_set devicesWithInput; - InputInfoPtr pInfo; - - if (err >= 0) { - - XFD_ANDSET(&devicesWithInput, LastSelectMask, &EnabledDevices); - if (XFD_ANYSET(&devicesWithInput)) { - pInfo = xf86InputDevs; - while (pInfo) { - if (pInfo->read_input && pInfo->fd >= 0 && - (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) { - OsBlockSIGIO(); - - /* - * Remove the descriptior from the set because more than one - * device may share the same file descriptor. - */ - FD_CLR(pInfo->fd, &devicesWithInput); - - pInfo->read_input(pInfo); - OsReleaseSIGIO(); - } - pInfo = pInfo->next; - } - } - } - - if (err >= 0) { /* we don't want the handlers called if select() */ - IHPtr ih, ih_tmp; /* returned with an error condition, do we? */ - - nt_list_for_each_entry_safe(ih, ih_tmp, InputHandlers, next) { - if (ih->enabled && ih->fd >= 0 && ih->ihproc && - (FD_ISSET(ih->fd, ((fd_set *) pReadmask)) != 0)) { - ih->ihproc(ih->fd, ih->data); - } - } - } - if (xf86VTSwitchPending()) xf86VTSwitch(); } /* - * xf86SigioReadInput -- - * signal handler for the SIGIO signal. + * xf86ReadInput -- + * input thread handler */ + static void -xf86SigioReadInput(int fd, void *closure) +xf86ReadInput(int fd, int ready, void *closure) { - int errno_save = errno; InputInfoPtr pInfo = closure; pInfo->read_input(pInfo); - - errno = errno_save; } /* @@ -312,9 +268,7 @@ xf86SigioReadInput(int fd, void *closure) void xf86AddEnabledDevice(InputInfoPtr pInfo) { - if (!xf86InstallSIGIOHandler(pInfo->fd, xf86SigioReadInput, pInfo)) { - AddEnabledDevice(pInfo->fd); - } + InputThreadRegisterDev(pInfo->fd, xf86ReadInput, pInfo); } /* @@ -324,9 +278,7 @@ xf86AddEnabledDevice(InputInfoPtr pInfo) void xf86RemoveEnabledDevice(InputInfoPtr pInfo) { - if (!xf86RemoveSIGIOHandler(pInfo->fd)) { - RemoveEnabledDevice(pInfo->fd); - } + InputThreadUnregisterDev(pInfo->fd); } static int *xf86SignalIntercept = NULL; @@ -402,9 +354,9 @@ xf86ReleaseKeys(DeviceIntPtr pDev) for (i = keyc->xkbInfo->desc->min_key_code; i < keyc->xkbInfo->desc->max_key_code; i++) { if (key_is_down(pDev, i, KEY_POSTED)) { - OsBlockSIGIO(); + input_lock(); QueueKeyboardEvents(pDev, KeyRelease, i); - OsReleaseSIGIO(); + input_unlock(); } } } @@ -448,9 +400,10 @@ xf86UpdateHasVTProperty(Bool hasVT) if (property_name == BAD_RESOURCE) FatalError("Failed to retrieve \"HAS_VT\" atom\n"); for (i = 0; i < xf86NumScreens; i++) { - ChangeWindowProperty(xf86ScrnToScreen(xf86Screens[i])->root, - property_name, XA_INTEGER, 32, - PropModeReplace, 1, &value, TRUE); + dixChangeWindowProperty(serverClient, + xf86ScrnToScreen(xf86Screens[i])->root, + property_name, XA_INTEGER, 32, + PropModeReplace, 1, &value, TRUE); } } @@ -486,7 +439,7 @@ xf86VTLeave(void) for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) xf86DisableInputDeviceForVTSwitch(pInfo); - OsBlockSIGIO(); + input_lock(); for (i = 0; i < xf86NumScreens; i++) xf86Screens[i]->LeaveVT(xf86Screens[i]); for (i = 0; i < xf86NumGPUScreens; i++) @@ -544,7 +497,7 @@ switch_failed: else xf86EnableGeneralHandler(ih); } - OsReleaseSIGIO(); + input_unlock(); } void @@ -602,7 +555,7 @@ xf86VTEnter(void) xf86UpdateHasVTProperty(TRUE); - OsReleaseSIGIO(); + input_unlock(); } /* @@ -635,6 +588,16 @@ xf86VTSwitch(void) /* Input handler registration */ +static void +xf86InputHandlerNotify(int fd, int ready, void *data) +{ + IHPtr ih = data; + + if (ih->enabled && ih->fd >= 0 && ih->ihproc) { + ih->ihproc(ih->fd, ih->data); + } +} + static void * addInputHandler(int fd, InputHandlerProc proc, void *data) { @@ -652,6 +615,11 @@ addInputHandler(int fd, InputHandlerProc proc, void *data) ih->data = data; ih->enabled = TRUE; + if (!SetNotifyFd(fd, xf86InputHandlerNotify, X_NOTIFY_READ, ih)) { + free(ih); + return NULL; + } + ih->next = InputHandlers; InputHandlers = ih; @@ -663,10 +631,8 @@ xf86AddInputHandler(int fd, InputHandlerProc proc, void *data) { IHPtr ih = addInputHandler(fd, proc, data); - if (ih) { - AddEnabledDevice(fd); + if (ih) ih->is_input = TRUE; - } return ih; } @@ -675,8 +641,6 @@ xf86AddGeneralHandler(int fd, InputHandlerProc proc, void *data) { IHPtr ih = addInputHandler(fd, proc, data); - if (ih) - AddGeneralSocket(fd); return ih; } @@ -706,6 +670,8 @@ removeInputHandler(IHPtr ih) { IHPtr p; + if (ih->fd >= 0) + RemoveNotifyFd(ih->fd); if (ih == InputHandlers) InputHandlers = ih->next; else { @@ -730,8 +696,6 @@ xf86RemoveInputHandler(void *handler) ih = handler; fd = ih->fd; - if (ih->fd >= 0) - RemoveEnabledDevice(ih->fd); removeInputHandler(ih); return fd; @@ -749,8 +713,6 @@ xf86RemoveGeneralHandler(void *handler) ih = handler; fd = ih->fd; - if (ih->fd >= 0) - RemoveGeneralSocket(ih->fd); removeInputHandler(ih); return fd; @@ -767,7 +729,7 @@ xf86DisableInputHandler(void *handler) ih = handler; ih->enabled = FALSE; if (ih->fd >= 0) - RemoveEnabledDevice(ih->fd); + RemoveNotifyFd(ih->fd); } void @@ -781,7 +743,7 @@ xf86DisableGeneralHandler(void *handler) ih = handler; ih->enabled = FALSE; if (ih->fd >= 0) - RemoveGeneralSocket(ih->fd); + RemoveNotifyFd(ih->fd); } void @@ -795,7 +757,7 @@ xf86EnableInputHandler(void *handler) ih = handler; ih->enabled = TRUE; if (ih->fd >= 0) - AddEnabledDevice(ih->fd); + SetNotifyFd(ih->fd, xf86InputHandlerNotify, X_NOTIFY_READ, ih); } void @@ -809,7 +771,7 @@ xf86EnableGeneralHandler(void *handler) ih = handler; ih->enabled = TRUE; if (ih->fd >= 0) - AddGeneralSocket(ih->fd); + SetNotifyFd(ih->fd, xf86InputHandlerNotify, X_NOTIFY_READ, ih); } /* diff --git a/xserver/hw/xfree86/common/xf86Globals.c b/xserver/hw/xfree86/common/xf86Globals.c index 93a35b80e..07cfabf89 100644 --- a/xserver/hw/xfree86/common/xf86Globals.c +++ b/xserver/hw/xfree86/common/xf86Globals.c @@ -98,7 +98,7 @@ xf86InfoRec xf86Info = { .vtno = -1, .lastEventTime = -1, .vtRequestsPending = FALSE, -#ifdef sun +#ifdef __sun .vtPendingNum = -1, #endif .dontVTSwitch = FALSE, @@ -201,5 +201,4 @@ Bool xf86AllowMouseOpenFail = FALSE; Bool xf86VidModeDisabled = FALSE; Bool xf86VidModeAllowNonLocal = FALSE; #endif -RootWinPropPtr *xf86RegisteredPropertiesTable = NULL; Bool xorgHWAccess = FALSE; diff --git a/xserver/hw/xfree86/common/xf86Helper.c b/xserver/hw/xfree86/common/xf86Helper.c index 3b01a49b5..6f3a6086b 100644 --- a/xserver/hw/xfree86/common/xf86Helper.c +++ b/xserver/hw/xfree86/common/xf86Helper.c @@ -54,7 +54,6 @@ #include "xf86Xinput.h" #include "xf86InPriv.h" #include "mivalidate.h" -#include "xf86Crtc.h" /* For xf86GetClocks */ #if defined(CSRG_BASED) || defined(__GNU__) @@ -908,11 +907,7 @@ xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma) scrp->gamma.green = 1.0; scrp->gamma.blue = 1.0; } - /* Pretend we succeeded if we support better a gamma system. - * This avoids a confusing message. - */ - if (xf86_crtc_supports_gamma(scrp)) - return TRUE; + xf86DrvMsg(scrp->scrnIndex, from, "Using gamma correction (%.1f, %.1f, %.1f)\n", scrp->gamma.red, scrp->gamma.green, scrp->gamma.blue); @@ -1515,12 +1510,6 @@ xf86ServerIsResetting(void) return xf86Resetting; } -Bool -xf86ServerIsInitialising(void) -{ - return xf86Initialising; -} - Bool xf86ServerIsOnlyDetecting(void) { @@ -1725,11 +1714,9 @@ xf86SetSilkenMouse(ScreenPtr pScreen) } free(options); /* - * XXX quick hack to report correctly for OSs that can't do SilkenMouse - * yet. Should handle this differently so that alternate async methods - * work correctly with this too. + * Use silken mouse if requested and if we have threaded input */ - pScrn->silkenMouse = useSM && xf86Info.useSIGIO && xf86SIGIOSupported(); + pScrn->silkenMouse = useSM && InputThreadEnable; if (serverGeneration == 1) xf86DrvMsg(pScreen->myNum, from, "Silken mouse %s\n", pScrn->silkenMouse ? "enabled" : "disabled"); @@ -1823,81 +1810,6 @@ xf86IsScreenPrimary(ScrnInfoPtr pScrn) return FALSE; } -int -xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, - int format, unsigned long len, void *value) -{ - RootWinPropPtr pNewProp = NULL, pRegProp; - Bool existing = FALSE; - - DebugF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n", - ScrnIndex, (long)property, (long)type, format, len, value); - - if (ScrnIndex < 0 || ScrnIndex >= xf86NumScreens) { - return BadMatch; - } - - if (xf86RegisteredPropertiesTable && - xf86RegisteredPropertiesTable[ScrnIndex]) { - for (pNewProp = xf86RegisteredPropertiesTable[ScrnIndex]; - pNewProp; pNewProp = pNewProp->next) { - if (strcmp(pNewProp->name, NameForAtom(property)) == 0) - break; - } - } - - if (!pNewProp) { - if ((pNewProp = (RootWinPropPtr) malloc(sizeof(RootWinProp))) == NULL) { - return BadAlloc; - } - /* - * We will put this property at the end of the list so that - * the changes are made in the order they were requested. - */ - pNewProp->next = NULL; - } - else { - free((void *) pNewProp->name); - existing = TRUE; - } - - pNewProp->name = xnfstrdup(NameForAtom(property)); - pNewProp->type = type; - pNewProp->format = format; - pNewProp->size = len; - pNewProp->data = value; - - DebugF("new property filled\n"); - - if (xf86RegisteredPropertiesTable == NULL) { - DebugF("creating xf86RegisteredPropertiesTable[] size %d\n", - xf86NumScreens); - xf86RegisteredPropertiesTable = - xnfcalloc(sizeof(RootWinProp), xf86NumScreens); - } - - DebugF("xf86RegisteredPropertiesTable %p\n", - (void *) xf86RegisteredPropertiesTable); - DebugF("xf86RegisteredPropertiesTable[%d] %p\n", - ScrnIndex, (void *) xf86RegisteredPropertiesTable[ScrnIndex]); - - if (!existing) { - if (xf86RegisteredPropertiesTable[ScrnIndex] == NULL) { - xf86RegisteredPropertiesTable[ScrnIndex] = pNewProp; - } - else { - pRegProp = xf86RegisteredPropertiesTable[ScrnIndex]; - while (pRegProp->next != NULL) { - DebugF("- next %p\n", (void *) pRegProp); - pRegProp = pRegProp->next; - } - pRegProp->next = pNewProp; - } - } - DebugF("xf86RegisterRootWindowProperty succeeded\n"); - return Success; -} - Bool xf86IsUnblank(int mode) { diff --git a/xserver/hw/xfree86/common/xf86Init.c b/xserver/hw/xfree86/common/xf86Init.c index 7f64a709b..546c07f2b 100644 --- a/xserver/hw/xfree86/common/xf86Init.c +++ b/xserver/hw/xfree86/common/xf86Init.c @@ -301,50 +301,6 @@ xf86PrivsElevated(void) return privsElevated; } -static Bool -xf86CreateRootWindow(WindowPtr pWin) -{ - int ret = TRUE; - int err = Success; - ScreenPtr pScreen = pWin->drawable.pScreen; - RootWinPropPtr pProp; - CreateWindowProcPtr create_window = (CreateWindowProcPtr) - dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey); - - DebugF("xf86CreateRootWindow(%p)\n", pWin); - - /* Unhook this function ... */ - pScreen->CreateWindow = create_window; - dixSetPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey, NULL); - - /* ... and call the previous CreateWindow fuction, if any */ - if (NULL != pScreen->CreateWindow) { - ret = (*pScreen->CreateWindow) (pWin); - } - - /* Now do our stuff */ - if (xf86RegisteredPropertiesTable != NULL) { - if (pWin->parent == NULL && xf86RegisteredPropertiesTable != NULL) { - for (pProp = xf86RegisteredPropertiesTable[pScreen->myNum]; - pProp != NULL && err == Success; pProp = pProp->next) { - Atom prop; - - prop = MakeAtom(pProp->name, strlen(pProp->name), TRUE); - err = dixChangeWindowProperty(serverClient, pWin, - prop, pProp->type, - pProp->format, PropModeReplace, - pProp->size, pProp->data, FALSE); - } - - /* Look at err */ - ret &= (err == Success); - - } - } - - return ret; -} - static void InstallSignalHandlers(void) { @@ -356,23 +312,67 @@ InstallSignalHandlers(void) OsRegisterSigWrapper(xf86SigWrapper); } else { - signal(SIGSEGV, SIG_DFL); - signal(SIGILL, SIG_DFL); + OsSignal(SIGSEGV, SIG_DFL); + OsSignal(SIGABRT, SIG_DFL); + OsSignal(SIGILL, SIG_DFL); #ifdef SIGEMT - signal(SIGEMT, SIG_DFL); + OsSignal(SIGEMT, SIG_DFL); #endif - signal(SIGFPE, SIG_DFL); - signal(SIGBUS, SIG_DFL); - signal(SIGSYS, SIG_DFL); - signal(SIGXCPU, SIG_DFL); - signal(SIGXFSZ, SIG_DFL); + OsSignal(SIGFPE, SIG_DFL); + OsSignal(SIGBUS, SIG_DFL); + OsSignal(SIGSYS, SIG_DFL); + OsSignal(SIGXCPU, SIG_DFL); + OsSignal(SIGXFSZ, SIG_DFL); } } -/* The memory storing the initial value of the XFree86_has_VT root window - * property. This has to remain available until server start-up, so we just - * use a global. */ -static CARD32 HasVTValue = 1; +static void +AddSeatId(CallbackListPtr *pcbl, void *data, void *screen) +{ + ScreenPtr pScreen = screen; + Atom SeatAtom = MakeAtom(SEAT_ATOM_NAME, sizeof(SEAT_ATOM_NAME) - 1, TRUE); + int err; + + err = dixChangeWindowProperty(serverClient, pScreen->root, SeatAtom, + XA_STRING, 8, PropModeReplace, + strlen(data) + 1, data, FALSE); + + if (err != Success) + xf86DrvMsg(pScreen->myNum, X_WARNING, + "Failed to register seat property\n"); +} + +static void +AddVTAtoms(CallbackListPtr *pcbl, void *data, void *screen) +{ +#define VT_ATOM_NAME "XFree86_VT" + int err, HasVT = 1; + ScreenPtr pScreen = screen; + Atom VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME) - 1, TRUE); + Atom HasVTAtom = MakeAtom(HAS_VT_ATOM_NAME, sizeof(HAS_VT_ATOM_NAME) - 1, + TRUE); + + err = dixChangeWindowProperty(serverClient, pScreen->root, VTAtom, + XA_INTEGER, 32, PropModeReplace, 1, + &xf86Info.vtno, FALSE); + + err |= dixChangeWindowProperty(serverClient, pScreen->root, HasVTAtom, + XA_INTEGER, 32, PropModeReplace, 1, + &HasVT, FALSE); + + if (err != Success) + xf86DrvMsg(pScreen->myNum, X_WARNING, + "Failed to register VT properties\n"); +} + +static Bool +xf86ScreenInit(ScreenPtr pScreen, int argc, char **argv) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + + pScrn->pScreen = pScreen; + return pScrn->ScreenInit (pScreen, argc, argv); +} /* * InitOutput -- @@ -715,64 +715,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) } formatsDone = TRUE; - if (xf86Info.vtno >= 0) { -#define VT_ATOM_NAME "XFree86_VT" - Atom VTAtom = -1; - Atom HasVTAtom = -1; - CARD32 *VT = NULL; - CARD32 *HasVT = &HasVTValue; - int ret; - - /* This memory needs to stay available until the screen has been - initialized, and we can create the property for real. - */ - if ((VT = malloc(sizeof(CARD32))) == NULL) { - FatalError - ("Unable to make VT property - out of memory. Exiting...\n"); - } - *VT = xf86Info.vtno; - - VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME) - 1, TRUE); - HasVTAtom = MakeAtom(HAS_VT_ATOM_NAME, - sizeof(HAS_VT_ATOM_NAME) - 1, TRUE); - - for (i = 0, ret = Success; i < xf86NumScreens && ret == Success; - i++) { - ret = - xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex, - VTAtom, XA_INTEGER, 32, 1, - VT); - if (ret == Success) - ret = xf86RegisterRootWindowProperty(xf86Screens[i] - ->scrnIndex, - HasVTAtom, XA_INTEGER, - 32, 1, HasVT); - if (ret != Success) - xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING, - "Failed to register VT properties\n"); - } - } - - if (SeatId) { - Atom SeatAtom; - - SeatAtom = - MakeAtom(SEAT_ATOM_NAME, sizeof(SEAT_ATOM_NAME) - 1, TRUE); - - for (i = 0; i < xf86NumScreens; i++) { - int ret; - - ret = xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex, - SeatAtom, XA_STRING, 8, - strlen(SeatId) + 1, - SeatId); - if (ret != Success) { - xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING, - "Failed to register seat property\n"); - } - } - } - /* If a screen uses depth 24, show what the pixmap format is */ for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->depth == 24) { @@ -806,6 +748,12 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) xf86EnableIO(); } + if (xf86Info.vtno >= 0) + AddCallback(&RootWindowFinalizeCallback, AddVTAtoms, NULL); + + if (SeatId) + AddCallback(&RootWindowFinalizeCallback, AddSeatId, SeatId); + /* * Use the previously collected parts to setup pScreenInfo */ @@ -828,7 +776,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ); #endif xf86AccessEnter(); - OsBlockSIGIO(); + input_lock(); sigio_blocked = TRUE; } } @@ -837,8 +785,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) if (!xf86ColormapAllocatePrivates(xf86Screens[i])) FatalError("Cannot register DDX private keys"); - if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0) || - !dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0)) + if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0)) FatalError("Cannot register DDX private keys"); for (i = 0; i < xf86NumGPUScreens; i++) { @@ -858,7 +805,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) pScrn->SetOverscan = NULL; pScrn->DriverFunc = NULL; pScrn->pScreen = NULL; - scr_index = AddGPUScreen(pScrn->ScreenInit, argc, argv); + scr_index = AddGPUScreen(xf86ScreenInit, argc, argv); xf86VGAarbiterUnlock(pScrn); if (scr_index == i) { dixSetPrivate(&screenInfo.gpuscreens[scr_index]->devPrivates, @@ -886,7 +833,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) xf86Screens[i]->SetOverscan = NULL; xf86Screens[i]->DriverFunc = NULL; xf86Screens[i]->pScreen = NULL; - scr_index = AddScreen(xf86Screens[i]->ScreenInit, argc, argv); + scr_index = AddScreen(xf86ScreenInit, argc, argv); xf86VGAarbiterUnlock(xf86Screens[i]); if (scr_index == i) { /* @@ -909,11 +856,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) DebugF("xf86Screens[%d]->pScreen->CreateWindow = %p\n", i, xf86Screens[i]->pScreen->CreateWindow); - dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates, - xf86CreateRootWindowKey, - xf86Screens[i]->pScreen->CreateWindow); - xf86Screens[i]->pScreen->CreateWindow = xf86CreateRootWindow; - if (PictureGetSubpixelOrder(xf86Screens[i]->pScreen) == SubPixelUnknown) { xf86MonPtr DDC = (xf86MonPtr) (xf86Screens[i]->monitor->DDC); @@ -936,14 +878,14 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) xf86VGAarbiterWrapFunctions(); if (sigio_blocked) - OsReleaseSIGIO(); + input_unlock(); xf86InitOrigins(); xf86Resetting = FALSE; xf86Initialising = FALSE; - RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr) NoopDDA, xf86Wakeup, + RegisterBlockAndWakeupHandlers((ServerBlockHandlerProcPtr) NoopDDA, xf86Wakeup, NULL); } @@ -959,6 +901,9 @@ InitInput(int argc, char **argv) xf86Info.vtRequestsPending = FALSE; + /* Enable threaded input */ + InputThreadPreInit(); + mieqInit(); /* Initialize all configured input devices */ @@ -993,7 +938,7 @@ OsVendorInit(void) { static Bool beenHere = FALSE; - signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */ + OsSignal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */ if (!beenHere) { umask(022); @@ -1088,7 +1033,7 @@ AbortDDX(enum ExitCode error) { int i; - OsBlockSIGIO(); + input_lock(); /* * try to restore the original video state @@ -1168,6 +1113,16 @@ xf86PrintDefaultLibraryPath(void) ErrorF("%s\n", DEFAULT_LIBRARY_PATH); } +static void +xf86CheckPrivs(const char *option, const char *arg) +{ + if (xf86PrivsElevated() && !xf86PathIsSafe(arg)) { + FatalError("\nInvalid argument for %s - \"%s\"\n" + "\tWith elevated privileges %s must specify a relative path\n" + "\twithout any \"..\" elements.\n\n", option, arg, option); + } +} + /* * ddxProcessArgument -- * Process device-dependent command line args. Returns 0 if argument is @@ -1188,43 +1143,23 @@ ddxProcessArgument(int argc, char **argv, int i) } /* First the options that are not allowed with elevated privileges */ - if (!strcmp(argv[i], "-modulepath") || !strcmp(argv[i], "-logfile")) { - if (xf86PrivsElevated()) { - FatalError("The '%s' option cannot be used with " - "elevated privileges.\n", argv[i]); - } - else if (!strcmp(argv[i], "-modulepath")) { - char *mp; - - CHECK_FOR_REQUIRED_ARGUMENT(); - mp = strdup(argv[i + 1]); - if (!mp) - FatalError("Can't allocate memory for ModulePath\n"); - xf86ModulePath = mp; - xf86ModPathFrom = X_CMDLINE; - return 2; - } - else if (!strcmp(argv[i], "-logfile")) { - char *lf; - - CHECK_FOR_REQUIRED_ARGUMENT(); - lf = strdup(argv[i + 1]); - if (!lf) - FatalError("Can't allocate memory for LogFile\n"); - xf86LogFile = lf; - xf86LogFileFrom = X_CMDLINE; - return 2; - } + if (!strcmp(argv[i], "-modulepath")) { + CHECK_FOR_REQUIRED_ARGUMENT(); + xf86CheckPrivs(argv[i], argv[i + 1]); + xf86ModulePath = argv[i + 1]; + xf86ModPathFrom = X_CMDLINE; + return 2; + } + if (!strcmp(argv[i], "-logfile")) { + CHECK_FOR_REQUIRED_ARGUMENT(); + xf86CheckPrivs(argv[i], argv[i + 1]); + xf86LogFile = argv[i + 1]; + xf86LogFileFrom = X_CMDLINE; + return 2; } if (!strcmp(argv[i], "-config") || !strcmp(argv[i], "-xf86config")) { CHECK_FOR_REQUIRED_ARGUMENT(); - if (xf86PrivsElevated() && !xf86PathIsSafe(argv[i + 1])) { - FatalError("\nInvalid argument for %s\n" - "\tWith elevated privileges, the file specified with %s must be\n" - "\ta relative path and must not contain any \"..\" elements.\n" - "\tUsing default " __XCONFIGFILE__ " search path.\n\n", - argv[i], argv[i]); - } + xf86CheckPrivs(argv[i], argv[i + 1]); xf86ConfigFile = argv[i + 1]; #ifdef X_PRIVSEP /* Cannot drop privs when -xf86config is used with unsafe path */ @@ -1235,13 +1170,7 @@ ddxProcessArgument(int argc, char **argv, int i) } if (!strcmp(argv[i], "-configdir")) { CHECK_FOR_REQUIRED_ARGUMENT(); - if (xf86PrivsElevated() && !xf86PathIsSafe(argv[i + 1])) { - FatalError("\nInvalid argument for %s\n" - "\tWith elevated privileges, the file specified with %s must be\n" - "\ta relative path and must not contain any \"..\" elements.\n" - "\tUsing default " __XCONFIGDIR__ " search path.\n\n", - argv[i], argv[i]); - } + xf86CheckPrivs(argv[i], argv[i + 1]); xf86ConfigDir = argv[i + 1]; return 2; } diff --git a/xserver/hw/xfree86/common/xf86Module.h b/xserver/hw/xfree86/common/xf86Module.h index 9e5dc6dad..e0212cf3c 100644 --- a/xserver/hw/xfree86/common/xf86Module.h +++ b/xserver/hw/xfree86/common/xf86Module.h @@ -62,7 +62,6 @@ typedef enum { #define ABI_CLASS_VIDEODRV "X.Org Video Driver" #define ABI_CLASS_XINPUT "X.Org XInput driver" #define ABI_CLASS_EXTENSION "X.Org Server Extension" -#define ABI_CLASS_FONT "X.Org Font Renderer" #define ABI_MINOR_MASK 0x0000FFFF #define ABI_MAJOR_MASK 0xFFFF0000 @@ -80,10 +79,9 @@ typedef enum { * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(20, 0) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(22, 1) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(9, 0) -#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(23, 0) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(24, 1) +#define ABI_EXTENSION_VERSION SET_ABI_VERSION(10, 0) #define MODINFOSTRING1 0xef23fdc5 #define MODINFOSTRING2 0x10dc023a @@ -122,7 +120,6 @@ typedef enum { #define MOD_CLASS_NONE NULL #define MOD_CLASS_VIDEODRV "X.Org Video Driver" #define MOD_CLASS_XINPUT "X.Org XInput Driver" -#define MOD_CLASS_FONT "X.Org Font Renderer" #define MOD_CLASS_EXTENSION "X.Org Server Extension" /* This structure is expected to be returned by the initfunc */ diff --git a/xserver/hw/xfree86/common/xf86Option.c b/xserver/hw/xfree86/common/xf86Option.c index 0e8bc1f83..e9393fa16 100644 --- a/xserver/hw/xfree86/common/xf86Option.c +++ b/xserver/hw/xfree86/common/xf86Option.c @@ -84,7 +84,7 @@ xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts) if (device && device->options) { tmp = xf86optionListDup(device->options); if (pScrn->options) - xf86optionListMerge(pScrn->options, tmp); + pScrn->options = xf86optionListMerge(pScrn->options, tmp); else pScrn->options = tmp; } diff --git a/xserver/hw/xfree86/common/xf86PM.c b/xserver/hw/xfree86/common/xf86PM.c index 9e49e8eaf..3f08c8166 100644 --- a/xserver/hw/xfree86/common/xf86PM.c +++ b/xserver/hw/xfree86/common/xf86PM.c @@ -107,7 +107,7 @@ suspend(pmEvent event, Bool undo) DisableDevice(pInfo->dev, TRUE); pInfo = pInfo->next; } - OsBlockSIGIO(); + input_lock(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); @@ -135,7 +135,7 @@ resume(pmEvent event, Bool undo) xf86Screens[i]->EnterVT(xf86Screens[i]); } } - OsReleaseSIGIO(); + input_unlock(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE); @@ -182,13 +182,13 @@ DoApmEvent(pmEvent event, Bool undo) } break; default: - OsBlockSIGIO(); + input_lock(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) { xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); } } - OsReleaseSIGIO(); + input_unlock(); break; } } diff --git a/xserver/hw/xfree86/common/xf86Priv.h b/xserver/hw/xfree86/common/xf86Priv.h index 6e374eb7e..c1f8a18d7 100644 --- a/xserver/hw/xfree86/common/xf86Priv.h +++ b/xserver/hw/xfree86/common/xf86Priv.h @@ -86,14 +86,12 @@ extern _X_EXPORT serverLayoutRec xf86ConfigLayout; extern _X_EXPORT DriverPtr *xf86DriverList; extern _X_EXPORT int xf86NumDrivers; extern _X_EXPORT Bool xf86Resetting; -extern _X_EXPORT Bool xf86Initialising; +extern Bool xf86Initialising; extern _X_EXPORT int xf86NumScreens; extern _X_EXPORT const char *xf86VisualNames[]; extern _X_EXPORT int xf86Verbose; /* verbosity level */ extern _X_EXPORT int xf86LogVerbose; /* log file verbosity level */ -extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable; - extern ScrnInfoPtr *xf86GPUScreens; /* List of pointers to ScrnInfoRecs */ extern int xf86NumGPUScreens; #ifndef DEFAULT_VERBOSE @@ -139,7 +137,7 @@ DoShowOptions(void) /* xf86Events.c */ extern _X_EXPORT void -xf86Wakeup(void *blockData, int err, void *pReadmask); +xf86Wakeup(void *blockData, int err); extern _X_HIDDEN int xf86SigWrapper(int signo); extern _X_EXPORT void diff --git a/xserver/hw/xfree86/common/xf86Privstr.h b/xserver/hw/xfree86/common/xf86Privstr.h index c5d24eac0..c29b3ccc8 100644 --- a/xserver/hw/xfree86/common/xf86Privstr.h +++ b/xserver/hw/xfree86/common/xf86Privstr.h @@ -55,7 +55,7 @@ typedef struct { /* event handler part */ int lastEventTime; Bool vtRequestsPending; -#ifdef sun +#ifdef __sun int vtPendingNum; #endif Bool dontVTSwitch; @@ -80,15 +80,12 @@ typedef struct { Bool miscModInDevEnabled; /* Allow input devices to be * changed */ Bool miscModInDevAllowNonLocal; - Bool useSIGIO; /* Use SIGIO for handling - input device events */ + Bool useSIGIO; /* Use SIGIO for handling DRI1 swaps */ Pix24Flags pixmap24; MessageType pix24From; Bool pmFlag; Bool disableRandR; MessageType randRFrom; - Bool aiglx; - MessageType aiglxFrom; MessageType iglxFrom; XF86_GlxVisuals glxVisuals; MessageType glxVisualsFrom; @@ -116,16 +113,6 @@ typedef struct { } DPMSRec, *DPMSPtr; #endif -/* Information for root window properties. */ -typedef struct _RootWinProp { - struct _RootWinProp *next; - const char *name; - Atom type; - short format; - long size; - void *data; -} RootWinProp, *RootWinPropPtr; - /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */ #define XLED1 ((unsigned long) 0x00000001) #define XLED2 ((unsigned long) 0x00000002) diff --git a/xserver/hw/xfree86/common/xf86VGAarbiter.c b/xserver/hw/xfree86/common/xf86VGAarbiter.c index 5cc24298b..40f241aee 100644 --- a/xserver/hw/xfree86/common/xf86VGAarbiter.c +++ b/xserver/hw/xfree86/common/xf86VGAarbiter.c @@ -105,7 +105,7 @@ Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen) { int vga_count; - int rsrc_decodes; + int rsrc_decodes = 0; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (vga_no_arb) @@ -265,23 +265,21 @@ VGAarbiterCloseScreen(ScreenPtr pScreen) } static void -VGAarbiterBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadmask) +VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout) { SCREEN_PROLOG(BlockHandler); VGAGet(pScreen); - pScreen->BlockHandler(pScreen, pTimeout, pReadmask); + pScreen->BlockHandler(pScreen, pTimeout); VGAPut(); SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler); } static void -VGAarbiterWakeupHandler(ScreenPtr pScreen, unsigned long result, - void *pReadmask) +VGAarbiterWakeupHandler(ScreenPtr pScreen, int result) { SCREEN_PROLOG(WakeupHandler); VGAGet(pScreen); - pScreen->WakeupHandler(pScreen, result, pReadmask); + pScreen->WakeupHandler(pScreen, result); VGAPut(); SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler); } diff --git a/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h b/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h index b832c9a5f..09be10aa3 100644 --- a/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h +++ b/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h @@ -146,10 +146,8 @@ typedef struct _VGAarbiterGC { } VGAarbiterGCRec, *VGAarbiterGCPtr; /* Screen funcs */ -static void VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout, - void *pReadmask); -static void VGAarbiterWakeupHandler(ScreenPtr pScreen, - unsigned long result, void *pReadmask); +static void VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout); +static void VGAarbiterWakeupHandler(ScreenPtr pScreen, int result); static Bool VGAarbiterCloseScreen(ScreenPtr pScreen); static void VGAarbiterGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, diff --git a/xserver/hw/xfree86/common/xf86Xinput.c b/xserver/hw/xfree86/common/xf86Xinput.c index c56a2b9a3..136bf50ff 100644 --- a/xserver/hw/xfree86/common/xf86Xinput.c +++ b/xserver/hw/xfree86/common/xf86Xinput.c @@ -84,6 +84,9 @@ #include #include #include +#ifdef HAVE_SYS_SYSMACROS_H +#include +#endif #ifdef HAVE_SYS_MKDEV_H #include /* for major() & minor() on Solaris */ #endif @@ -110,8 +113,16 @@ static int xf86InputDevicePostInit(DeviceIntPtr dev); -static InputInfoPtr *new_input_devices; -static int new_input_devices_count; +typedef struct { + struct xorg_list node; + InputInfoPtr pInfo; +} PausedInputDeviceRec; +typedef PausedInputDeviceRec *PausedInputDevicePtr; + +static struct xorg_list new_input_devices_list = { + .next = &new_input_devices_list, + .prev = &new_input_devices_list, +}; /** * Eval config and modify DeviceVelocityRec accordingly @@ -130,7 +141,7 @@ ProcessVelocityConfiguration(DeviceIntPtr pDev, const char *devname, void *list, /* common settings (available via device properties) */ tempf = xf86SetRealOption(list, "ConstantDeceleration", 1.0); - if (tempf > 1.0) { + if (tempf != 1.0) { xf86Msg(X_CONFIG, "%s: (accel) constant deceleration by %.1f\n", devname, tempf); prop = XIGetKnownProperty(ACCEL_PROP_CONSTANT_DECELERATION); @@ -540,21 +551,24 @@ MatchAttrToken(const char *attr, struct xorg_list *patterns, if (xorg_list_is_empty(patterns)) return TRUE; - /* If there are patterns but no attribute, reject the match */ - if (!attr) - return FALSE; - /* - * Otherwise, iterate the list of patterns ensuring each entry has a + * Iterate the list of patterns ensuring each entry has a * match. Each list entry is a separate Match line of the same type. */ xorg_list_for_each_entry(group, patterns, entry) { char *const *cur; - Bool match = FALSE; + Bool is_negated = group->is_negated; + Bool match = is_negated; + + /* If there's a pattern but no attribute, we reject the match for a + * MatchFoo directive, and accept it for a NoMatchFoo directive + */ + if (!attr) + return is_negated; for (cur = group->values; *cur; cur++) if ((*compare) (attr, *cur) == 0) { - match = TRUE; + match = !is_negated; break; } if (!match) @@ -632,7 +646,7 @@ InputClassMatches(const XF86ConfInputClassPtr iclass, const InputInfoPtr idev, /* MatchIs* booleans */ if (iclass->is_keyboard.set && - iclass->is_keyboard.val != ! !(attrs->flags & ATTR_KEYBOARD)) + iclass->is_keyboard.val != ! !(attrs->flags & (ATTR_KEY|ATTR_KEYBOARD))) return FALSE; if (iclass->is_pointer.set && iclass->is_pointer.val != ! !(attrs->flags & ATTR_POINTER)) @@ -643,6 +657,9 @@ InputClassMatches(const XF86ConfInputClassPtr iclass, const InputInfoPtr idev, if (iclass->is_tablet.set && iclass->is_tablet.val != ! !(attrs->flags & ATTR_TABLET)) return FALSE; + if (iclass->is_tablet_pad.set && + iclass->is_tablet_pad.val != ! !(attrs->flags & ATTR_TABLET_PAD)) + return FALSE; if (iclass->is_touchpad.set && iclass->is_touchpad.val != ! !(attrs->flags & ATTR_TOUCHPAD)) return FALSE; @@ -819,6 +836,22 @@ xf86stat(const char *path, int *maj, int *min) *min = minor(st.st_rdev); } +static inline InputDriverPtr +xf86LoadInputDriver(const char *driver_name) +{ + InputDriverPtr drv = NULL; + + /* Memory leak for every attached device if we don't + * test if the module is already loaded first */ + drv = xf86LookupInputDriver(driver_name); + if (!drv) { + if (xf86LoadOneModule(driver_name, NULL)) + drv = xf86LookupInputDriver(driver_name); + } + + return drv; +} + /** * Create a new input device, activate and enable it. * @@ -845,15 +878,33 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable) int rval; char *path = NULL; - /* Memory leak for every attached device if we don't - * test if the module is already loaded first */ - drv = xf86LookupInputDriver(pInfo->driver); - if (!drv) - if (xf86LoadOneModule(pInfo->driver, NULL)) - drv = xf86LookupInputDriver(pInfo->driver); + drv = xf86LoadInputDriver(pInfo->driver); if (!drv) { xf86Msg(X_ERROR, "No input driver matching `%s'\n", pInfo->driver); - rval = BadName; + + if (strlen(FALLBACK_INPUT_DRIVER) > 0) { + xf86Msg(X_INFO, "Falling back to input driver `%s'\n", + FALLBACK_INPUT_DRIVER); + drv = xf86LoadInputDriver(FALLBACK_INPUT_DRIVER); + if (drv) { + free(pInfo->driver); + pInfo->driver = strdup(FALLBACK_INPUT_DRIVER); + } + } + if (!drv) { + rval = BadName; + goto unwind; + } + } + + xf86Msg(X_INFO, "Using input driver '%s' for '%s'\n", drv->driverName, + pInfo->name); + + if (!drv->PreInit) { + xf86Msg(X_ERROR, + "Input driver `%s' has no PreInit function (ignoring)\n", + drv->driverName); + rval = BadImplementation; goto unwind; } @@ -867,11 +918,10 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable) if (fd != -1) { if (paused) { /* Put on new_input_devices list for delayed probe */ - new_input_devices = xnfreallocarray(new_input_devices, - new_input_devices_count + 1, - sizeof(pInfo)); - new_input_devices[new_input_devices_count] = pInfo; - new_input_devices_count++; + PausedInputDevicePtr new_device = xnfalloc(sizeof *new_device); + new_device->pInfo = pInfo; + + xorg_list_append(&new_device->node, &new_input_devices_list); systemd_logind_release_fd(pInfo->major, pInfo->minor, fd); free(path); return BadMatch; @@ -884,20 +934,11 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable) free(path); - xf86Msg(X_INFO, "Using input driver '%s' for '%s'\n", drv->driverName, - pInfo->name); - - if (!drv->PreInit) { - xf86Msg(X_ERROR, - "Input driver `%s' has no PreInit function (ignoring)\n", - drv->driverName); - rval = BadImplementation; - goto unwind; - } - xf86AddInput(drv, pInfo); + input_lock(); rval = drv->PreInit(drv, pInfo, 0); + input_unlock(); if (rval != Success) { xf86Msg(X_ERROR, "PreInit returned %d for \"%s\"\n", rval, pInfo->name); @@ -925,18 +966,18 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable) /* Enable it if it's properly initialised and we're currently in the VT */ if (enable && dev->inited && dev->startup && xf86VTOwner()) { - OsBlockSignals(); + input_lock(); EnableDevice(dev, TRUE); if (!dev->enabled) { - OsReleaseSignals(); xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name); RemoveDevice(dev, TRUE); rval = BadMatch; + input_unlock(); goto unwind; } /* send enter/leave event, update sprite window */ CheckMotion(NULL, dev); - OsReleaseSignals(); + input_unlock(); } *pdev = dev; @@ -1069,7 +1110,7 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) if (pInfo) /* need to get these before RemoveDevice */ drv = pInfo->drv; - OsBlockSignals(); + input_lock(); RemoveDevice(pDev, TRUE); if (!isMaster && pInfo != NULL) { @@ -1078,7 +1119,22 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) else xf86DeleteInput(pInfo, 0); } - OsReleaseSignals(); + input_unlock(); +} + +void +RemoveInputDeviceTraces(const char *config_info) +{ + PausedInputDevicePtr d, tmp; + + xorg_list_for_each_entry_safe(d, tmp, &new_input_devices_list, node) { + const char *ci = xf86findOptionValue(d->pInfo->options, "config_info"); + if (!ci || strcmp(ci, config_info) != 0) + continue; + + xorg_list_del(&d->node); + free(d); + } } /* @@ -1509,29 +1565,27 @@ xf86PostTouchEvent(DeviceIntPtr dev, uint32_t touchid, uint16_t type, void xf86InputEnableVTProbe(void) { - int i, is_auto = 0; - InputOption *option = NULL; + int is_auto = 0; DeviceIntPtr pdev; + PausedInputDevicePtr d, tmp; - for (i = 0; i < new_input_devices_count; i++) { - InputInfoPtr pInfo = new_input_devices[i]; + xorg_list_for_each_entry_safe(d, tmp, &new_input_devices_list, node) { + InputInfoPtr pInfo = d->pInfo; + const char *value = xf86findOptionValue(pInfo->options, "_source"); is_auto = 0; - nt_list_for_each_entry(option, pInfo->options, list.next) { - const char *key = input_option_get_key(option); - const char *value = input_option_get_value(option); + if (value && + (strcmp(value, "server/hal") == 0 || + strcmp(value, "server/udev") == 0 || + strcmp(value, "server/wscons") == 0)) + is_auto = 1; - if (strcmp(key, "_source") == 0 && - (strcmp(value, "server/hal") == 0 || - strcmp(value, "server/udev") == 0 || - strcmp(value, "server/wscons") == 0)) - is_auto = 1; - } xf86NewInputDevice(pInfo, &pdev, (!is_auto || (is_auto && xf86Info.autoEnableDevices))); + xorg_list_del(&d->node); + free(d); } - new_input_devices_count = 0; } /* end of xf86Xinput.c */ diff --git a/xserver/hw/xfree86/common/xf86cmap.c b/xserver/hw/xfree86/common/xf86cmap.c index 704e35358..8588c9fba 100644 --- a/xserver/hw/xfree86/common/xf86cmap.c +++ b/xserver/hw/xfree86/common/xf86cmap.c @@ -29,7 +29,7 @@ #include #endif -#if defined(_XOPEN_SOURCE) || defined(sun) && defined(__SVR4) +#if defined(_XOPEN_SOURCE) || defined(__sun) && defined(__SVR4) #include #else #define _XOPEN_SOURCE /* to get prototype for pow on some systems */ @@ -49,6 +49,7 @@ #include "xf86_OSproc.h" #include "xf86str.h" #include "micmap.h" +#include "xf86RandR12.h" #include "xf86Crtc.h" #ifdef XFreeXDGA @@ -132,9 +133,6 @@ static void CMapUnwrapScreen(ScreenPtr pScreen); Bool xf86ColormapAllocatePrivates(ScrnInfoPtr pScrn) { - /* If we support a better colormap system, then pretend we succeeded. */ - if (xf86_crtc_supports_gamma(pScrn)) - return TRUE; if (!dixRegisterPrivateKey(&CMapScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; @@ -157,11 +155,8 @@ xf86HandleColormaps(ScreenPtr pScreen, int *indices; int elements; - /* If we support a better colormap system, then pretend we succeeded. */ - if (xf86_crtc_supports_gamma(pScrn)) - return TRUE; - - if (!maxColors || !sigRGBbits || !loadPalette) + if (!maxColors || !sigRGBbits || + (!loadPalette && !xf86_crtc_supports_gamma(pScrn))) return FALSE; elements = 1 << sigRGBbits; @@ -230,6 +225,15 @@ xf86HandleColormaps(ScreenPtr pScreen, return FALSE; } + if (xf86_crtc_supports_gamma(pScrn)) { + pScrn->LoadPalette = xf86RandR12LoadPalette; + + if (!xf86RandR12InitGamma(pScrn, elements)) { + CMapUnwrapScreen(pScreen); + return FALSE; + } + } + /* Force the initial map to be loaded */ SetInstalledmiColormap(pScreen, NULL); CMapInstallColormap(pDefMap); @@ -1005,19 +1009,6 @@ xf86ChangeGammaRamp(ScreenPtr pScreen, CMapScreenPtr pScreenPriv; CMapLinkPtr pLink; - if (xf86_crtc_supports_gamma(pScrn)) { - RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); - - if (crtc) { - if (crtc->gammaSize != size) - return BadValue; - - RRCrtcGammaSet(crtc, red, green, blue); - - return Success; - } - } - if (!CMapScreenKeyRegistered) return BadImplementation; @@ -1077,16 +1068,8 @@ xf86ChangeGammaRamp(ScreenPtr pScreen, int xf86GetGammaRampSize(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CMapScreenPtr pScreenPriv; - if (xf86_crtc_supports_gamma(pScrn)) { - RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); - - if (crtc) - return crtc->gammaSize; - } - if (!CMapScreenKeyRegistered) return 0; @@ -1104,29 +1087,10 @@ xf86GetGammaRamp(ScreenPtr pScreen, unsigned short *red, unsigned short *green, unsigned short *blue) { - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CMapScreenPtr pScreenPriv; LOCO *entry; int shift, sigbits; - if (xf86_crtc_supports_gamma(pScrn)) { - RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); - - if (crtc) { - if (crtc->gammaSize < size) - return BadValue; - - if (!RRCrtcGammaGet(crtc)) - return BadImplementation; - - memcpy(red, crtc->gammaRed, size * sizeof(*red)); - memcpy(green, crtc->gammaGreen, size * sizeof(*green)); - memcpy(blue, crtc->gammaBlue, size * sizeof(*blue)); - - return Success; - } - } - if (!CMapScreenKeyRegistered) return BadImplementation; diff --git a/xserver/hw/xfree86/common/xf86pciBus.c b/xserver/hw/xfree86/common/xf86pciBus.c index 624662688..d8a79cb1a 100644 --- a/xserver/hw/xfree86/common/xf86pciBus.c +++ b/xserver/hw/xfree86/common/xf86pciBus.c @@ -1326,7 +1326,7 @@ xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip, char *line = NULL; size_t len; ssize_t read; - char path_name[256], vendor_str[5], chip_str[5]; + char path_name[512], vendor_str[5], chip_str[5]; uint16_t vendor, chip; int i = 0, j; diff --git a/xserver/hw/xfree86/common/xf86platformBus.c b/xserver/hw/xfree86/common/xf86platformBus.c index 96895a6e1..39fb1dd36 100644 --- a/xserver/hw/xfree86/common/xf86platformBus.c +++ b/xserver/hw/xfree86/common/xf86platformBus.c @@ -114,7 +114,15 @@ xf86_find_platform_device_by_devnum(int major, int minor) static Bool xf86IsPrimaryPlatform(struct xf86_platform_device *plat) { - return ((primaryBus.type == BUS_PLATFORM) && (plat == primaryBus.id.plat)); + if (primaryBus.type == BUS_PLATFORM) + return plat == primaryBus.id.plat; +#ifdef XSERVER_LIBPCIACCESS + if (primaryBus.type == BUS_PCI) + if (plat->pdev) + if (MATCH_PCI_DEVICES(primaryBus.id.pci, plat->pdev)) + return TRUE; +#endif + return FALSE; } static void @@ -418,6 +426,19 @@ probeSingleDevice(struct xf86_platform_device *dev, DriverPtr drvp, GDevPtr gdev return foundScreen; } +static Bool +isGPUDevice(GDevPtr gdev) +{ + int i; + + for (i = 0; i < gdev->myScreenSection->num_gpu_devices; i++) { + if (gdev == gdev->myScreenSection->gpu_devices[i]) + return TRUE; + } + + return FALSE; +} + int xf86platformProbeDev(DriverPtr drvp) { @@ -450,9 +471,8 @@ xf86platformProbeDev(DriverPtr drvp) if (j == xf86_num_platform_devices) continue; - foundScreen = probeSingleDevice(&xf86_platform_devices[j], drvp, devList[i], 0); - if (!foundScreen) - continue; + foundScreen = probeSingleDevice(&xf86_platform_devices[j], drvp, devList[i], + isGPUDevice(devList[i]) ? PLATFORM_PROBE_GPU_SCREEN : 0); } /* if autoaddgpu devices is enabled then go find any unclaimed platform diff --git a/xserver/hw/xfree86/common/xf86str.h b/xserver/hw/xfree86/common/xf86str.h index 5e6e97778..bfcb75ec0 100644 --- a/xserver/hw/xfree86/common/xf86str.h +++ b/xserver/hw/xfree86/common/xf86str.h @@ -678,7 +678,7 @@ typedef struct _ScrnInfoRec { /* Allow screens to be enabled/disabled individually */ Bool vtSema; - /* hw cursor moves at SIGIO time */ + /* hw cursor moves from input thread */ Bool silkenMouse; /* Storage for clockRanges and adjustFlags for use with the VidMode ext */ diff --git a/xserver/hw/xfree86/ddc/Makefile.in b/xserver/hw/xfree86/ddc/Makefile.in index 0d0bdb918..85c293657 100644 --- a/xserver/hw/xfree86/ddc/Makefile.in +++ b/xserver/hw/xfree86/ddc/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -329,6 +330,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -359,7 +363,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -454,6 +461,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/ddc/ddc.c b/xserver/hw/xfree86/ddc/ddc.c index ee533db1c..b82dfc185 100644 --- a/xserver/hw/xfree86/ddc/ddc.c +++ b/xserver/hw/xfree86/ddc/ddc.c @@ -149,7 +149,7 @@ GetEDID_DDC1(unsigned int *s_ptr) return NULL; s_end = s_ptr + NUM; s_pos = s_ptr + s_start; - d_block = malloc(EDID1_LEN); + d_block = calloc(1, EDID1_LEN); if (!d_block) return NULL; d_pos = d_block; diff --git a/xserver/hw/xfree86/ddc/ddcProperty.c b/xserver/hw/xfree86/ddc/ddcProperty.c index fc63f0e8a..e68672e43 100644 --- a/xserver/hw/xfree86/ddc/ddcProperty.c +++ b/xserver/hw/xfree86/ddc/ddcProperty.c @@ -27,6 +27,7 @@ #include "xf86.h" #include "xf86DDC.h" +#include "xf86Priv.h" #include #include "property.h" #include "propertyst.h" @@ -34,40 +35,35 @@ #define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA" -static void -edidMakeAtom(int i, const char *name, CARD8 *data, int size) +static int +edidSize(const xf86MonPtr DDC) { - Atom atom; - unsigned char *atom_data; + int ret = 128; - if (!(atom_data = malloc(size * sizeof(CARD8)))) - return; + if (DDC->flags & EDID_COMPLETE_RAWDATA) + ret += DDC->no_sections * 128; - atom = MakeAtom(name, strlen(name), TRUE); - memcpy(atom_data, data, size); - xf86RegisterRootWindowProperty(i, atom, XA_INTEGER, 8, size, atom_data); + return ret; } static void -addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC) +setRootWindowEDID(ScreenPtr pScreen, xf86MonPtr DDC) { - int scrnIndex = pScrn->scrnIndex; + Atom atom = MakeAtom(EDID1_ATOM_NAME, strlen(EDID1_ATOM_NAME), TRUE); - if (DDC->flags & MONITOR_DISPLAYID) { - /* Don't bother, use RANDR already */ - return; - } - else if (DDC->ver.version == 1) { - int size = 128 + - (DDC->flags & EDID_COMPLETE_RAWDATA ? DDC->no_sections * 128 : 0); + dixChangeWindowProperty(serverClient, pScreen->root, atom, XA_INTEGER, + 8, PropModeReplace, edidSize(DDC), DDC->rawData, + FALSE); +} - edidMakeAtom(scrnIndex, EDID1_ATOM_NAME, DDC->rawData, size); - } - else { - xf86DrvMsg(scrnIndex, X_PROBED, "unexpected EDID version %d.%d\n", - DDC->ver.version, DDC->ver.revision); - return; - } +static void +addEDIDProp(CallbackListPtr *pcbl, void *scrn, void *screen) +{ + ScreenPtr pScreen = screen; + ScrnInfoPtr pScrn = scrn; + + if (xf86ScreenToScrn(pScreen) == pScrn) + setRootWindowEDID(pScreen, pScrn->monitor->DDC); } Bool @@ -76,11 +72,12 @@ xf86SetDDCproperties(ScrnInfoPtr pScrn, xf86MonPtr DDC) if (!pScrn || !pScrn->monitor || !DDC) return FALSE; - if (DDC->flags & MONITOR_DISPLAYID); - else - xf86EdidMonitorSet(pScrn->scrnIndex, pScrn->monitor, DDC); + xf86EdidMonitorSet(pScrn->scrnIndex, pScrn->monitor, DDC); - addRootWindowProperties(pScrn, DDC); + if (xf86Initialising) + AddCallback(&RootWindowFinalizeCallback, addEDIDProp, pScrn); + else + setRootWindowEDID(pScrn->pScreen, DDC); return TRUE; } diff --git a/xserver/hw/xfree86/ddc/edid.h b/xserver/hw/xfree86/ddc/edid.h index 4c2da51c1..750e4270b 100644 --- a/xserver/hw/xfree86/ddc/edid.h +++ b/xserver/hw/xfree86/ddc/edid.h @@ -537,7 +537,6 @@ struct detailed_monitor_section { #define MONITOR_EDID_COMPLETE_RAWDATA 0x01 /* old, don't use */ #define EDID_COMPLETE_RAWDATA 0x01 -#define MONITOR_DISPLAYID 0x02 /* * For DisplayID devices, only the scrnIndex, flags, and rawData fields diff --git a/xserver/hw/xfree86/dixmods/Makefile.am b/xserver/hw/xfree86/dixmods/Makefile.am index dd076e421..856659f98 100644 --- a/xserver/hw/xfree86/dixmods/Makefile.am +++ b/xserver/hw/xfree86/dixmods/Makefile.am @@ -1,4 +1,4 @@ -noinst_LTLIBRARIES = libdixmods.la libxorgxkb.la +noinst_LTLIBRARIES = libdixmods.la if GLX GLXMODS = libglx.la @@ -29,7 +29,7 @@ libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER libglx_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libglx_la_LIBADD = $(top_builddir)/glx/libglx.la $(GLX_SYS_LIBS) -if AIGLX_DRI_LOADER +if DRI2 libglx_la_LIBADD += $(top_builddir)/glx/libglxdri.la if NO_UNDEFINED libglx_la_LIBADD += $(LIBDRM_LIBS) $(PIXMAN_LIBS) @@ -46,5 +46,3 @@ libshadow_la_SOURCES = shmodule.c libdixmods_la_SOURCES = $(top_srcdir)/mi/miinitext.c libdixmods_la_CFLAGS = $(AM_CFLAGS) - -libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c diff --git a/xserver/hw/xfree86/dixmods/Makefile.in b/xserver/hw/xfree86/dixmods/Makefile.in index f85309840..a7b514d45 100644 --- a/xserver/hw/xfree86/dixmods/Makefile.in +++ b/xserver/hw/xfree86/dixmods/Makefile.in @@ -50,17 +50,18 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@AIGLX_DRI_LOADER_TRUE@am__append_1 = $(top_builddir)/glx/libglxdri.la -@AIGLX_DRI_LOADER_TRUE@@NO_UNDEFINED_TRUE@am__append_2 = $(LIBDRM_LIBS) $(PIXMAN_LIBS) +@DRI2_TRUE@am__append_1 = $(top_builddir)/glx/libglxdri.la +@DRI2_TRUE@@NO_UNDEFINED_TRUE@am__append_2 = $(LIBDRM_LIBS) $(PIXMAN_LIBS) @NO_UNDEFINED_TRUE@am__append_3 = libfb.la subdir = hw/xfree86/dixmods DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -122,8 +123,9 @@ libfb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libfb_la_CFLAGS) \ $(CFLAGS) $(libfb_la_LDFLAGS) $(LDFLAGS) -o $@ am__DEPENDENCIES_1 = -@AIGLX_DRI_LOADER_TRUE@@NO_UNDEFINED_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ -@AIGLX_DRI_LOADER_TRUE@@NO_UNDEFINED_TRUE@ $(am__DEPENDENCIES_1) +@DRI2_TRUE@@NO_UNDEFINED_TRUE@am__DEPENDENCIES_2 = \ +@DRI2_TRUE@@NO_UNDEFINED_TRUE@ $(am__DEPENDENCIES_1) \ +@DRI2_TRUE@@NO_UNDEFINED_TRUE@ $(am__DEPENDENCIES_1) libglx_la_DEPENDENCIES = $(top_builddir)/glx/libglx.la \ $(am__DEPENDENCIES_1) $(am__append_1) $(am__DEPENDENCIES_2) am_libglx_la_OBJECTS = glxmodule.lo @@ -145,9 +147,6 @@ libwfb_la_OBJECTS = $(am_libwfb_la_OBJECTS) libwfb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libwfb_la_CFLAGS) \ $(CFLAGS) $(libwfb_la_LDFLAGS) $(LDFLAGS) -o $@ -libxorgxkb_la_LIBADD = -am_libxorgxkb_la_OBJECTS = xkbVT.lo xkbPrivate.lo xkbKillSrv.lo -libxorgxkb_la_OBJECTS = $(am_libxorgxkb_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -184,10 +183,10 @@ am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libdixmods_la_SOURCES) $(libfb_la_SOURCES) \ $(libglx_la_SOURCES) $(libshadow_la_SOURCES) \ - $(libwfb_la_SOURCES) $(libxorgxkb_la_SOURCES) + $(libwfb_la_SOURCES) DIST_SOURCES = $(libdixmods_la_SOURCES) $(libfb_la_SOURCES) \ $(libglx_la_SOURCES) $(libshadow_la_SOURCES) \ - $(libwfb_la_SOURCES) $(libxorgxkb_la_SOURCES) + $(libwfb_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -371,6 +370,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -401,7 +403,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -496,6 +501,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -543,7 +549,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -noinst_LTLIBRARIES = libdixmods.la libxorgxkb.la +noinst_LTLIBRARIES = libdixmods.la @GLX_TRUE@GLXMODS = libglx.la module_LTLIBRARIES = libfb.la \ libwfb.la \ @@ -575,7 +581,6 @@ libshadow_la_LIBADD = $(top_builddir)/miext/shadow/libshadow.la \ libshadow_la_SOURCES = shmodule.c libdixmods_la_SOURCES = $(top_srcdir)/mi/miinitext.c libdixmods_la_CFLAGS = $(AM_CFLAGS) -libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c all: all-am .SUFFIXES: @@ -699,8 +704,6 @@ libshadow.la: $(libshadow_la_OBJECTS) $(libshadow_la_DEPENDENCIES) $(EXTRA_libsh $(AM_V_CCLD)$(libshadow_la_LINK) -rpath $(moduledir) $(libshadow_la_OBJECTS) $(libshadow_la_LIBADD) $(LIBS) libwfb.la: $(libwfb_la_OBJECTS) $(libwfb_la_DEPENDENCIES) $(EXTRA_libwfb_la_DEPENDENCIES) $(AM_V_CCLD)$(libwfb_la_LINK) -rpath $(moduledir) $(libwfb_la_OBJECTS) $(libwfb_la_LIBADD) $(LIBS) -libxorgxkb.la: $(libxorgxkb_la_OBJECTS) $(libxorgxkb_la_DEPENDENCIES) $(EXTRA_libxorgxkb_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libxorgxkb_la_OBJECTS) $(libxorgxkb_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -713,9 +716,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbmodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbmodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmodule.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbKillSrv.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbPrivate.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbVT.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/xserver/hw/xfree86/dixmods/glxmodule.c b/xserver/hw/xfree86/dixmods/glxmodule.c index d53c6652d..bf7e65911 100644 --- a/xserver/hw/xfree86/dixmods/glxmodule.c +++ b/xserver/hw/xfree86/dixmods/glxmodule.c @@ -80,13 +80,9 @@ glxSetup(void *module, void *opts, int *errmaj, int *errmin) setupDone = TRUE; - xf86Msg(xf86Info.aiglxFrom, "AIGLX %s\n", - xf86Info.aiglx ? "enabled" : "disabled"); - if (xf86Info.aiglx) { - provider = LoaderSymbol("__glXDRI2Provider"); - if (provider) - GlxPushProvider(provider); - } + provider = LoaderSymbol("__glXDRI2Provider"); + if (provider) + GlxPushProvider(provider); LoadExtensionList(GLXExt, ARRAY_SIZE(GLXExt), FALSE); diff --git a/xserver/hw/xfree86/doc/Makefile.am b/xserver/hw/xfree86/doc/Makefile.am index 1c3620abb..392bdfa03 100644 --- a/xserver/hw/xfree86/doc/Makefile.am +++ b/xserver/hw/xfree86/doc/Makefile.am @@ -14,5 +14,4 @@ endif ENABLE_DEVEL_DOCS EXTRA_DIST = \ Registry \ exa-driver.txt \ - README.DRIcomp \ README.modes diff --git a/xserver/hw/xfree86/doc/Makefile.in b/xserver/hw/xfree86/doc/Makefile.in index b8a706858..e1cd937ee 100644 --- a/xserver/hw/xfree86/doc/Makefile.in +++ b/xserver/hw/xfree86/doc/Makefile.in @@ -74,9 +74,10 @@ DIST_COMMON = $(am__dist_noinst_DATA_DIST) $(srcdir)/Makefile.am \ subdir = hw/xfree86/doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -287,6 +288,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -317,7 +321,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -412,6 +419,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -489,7 +497,6 @@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ Registry \ exa-driver.txt \ - README.DRIcomp \ README.modes all: all-am diff --git a/xserver/hw/xfree86/doc/README.DRIcomp b/xserver/hw/xfree86/doc/README.DRIcomp deleted file mode 100644 index 73886504f..000000000 --- a/xserver/hw/xfree86/doc/README.DRIcomp +++ /dev/null @@ -1,551 +0,0 @@ - DRI Compilation Guide - - VA Linux Systems, Inc. Professional Services - Graphics. - - 21 April 2001 - -1. Preamble - -1.1 Copyright - -Copyright 2000-2001 by VA Linux Systems, Inc. All Rights Reserved. - -Permission is granted to make and distribute verbatim copies of this document -provided the copyright notice and this permission notice are preserved on all -copies. - -1.2 Trademarks - -OpenGL is a registered trademark and SGI is a trademark of Silicon Graphics, -Inc. Unix is a registered trademark of The Open Group. The `X' device and X -Window System are trademarks of The Open Group. XFree86 is a trademark of -The XFree86 Project. Linux is a registered trademark of Linus Torvalds. -Intel is a registered trademark of Intel Corporation. 3Dlabs, GLINT, and -Oxygen are either registered trademarks or trademarks of 3Dlabs Inc. Ltd. -3dfx, Voodoo3, Voodoo4, and Voodoo5 are registered trademarks of 3dfx Inter- -active, Incorporated. Matrox is a registered trademark of Matrox Electronic -Systems Ltd. ATI Rage and Radeon is a registered trademark of ATI Technolo- -gies, Inc. All other trademarks mentioned are the property of their respec- -tive owners. - -2. Introduction - -This document describes how to download, compile and install the DRI. The -DRI provides 3D graphics hardware acceleration for the XFree86 project. This -information is intended for experienced Linux developers. Beginners are -probably better off installing precompiled packages. - -Edits, corrections and updates to this document may be mailed to . - -Last updated on 13 February 2002 by Brian Paul. - -3. Prerequisites - -You'll need the following: - - o An installation of XFree86 4.1 or later. The DRI tree has been pruned - down to minimize its size. But in order to build the DRI tree you need - to have recent X header files, etc. already installed. If you don't - have XFree86 4.1 (or later) installed you can probably install it from - RPMs (or another package format). Or, you can download XFree86 as - sources and compile/install it yourself. - - o At least 200MB of free disk space. If you compile for debugging (the -g - option) then you'll need about 600MB. - - o GCC compiler and related tools. - - o ssh (secure shell) if you're a DRI developer and don't want to use - anonymous CVS download. - - o A 2.4.x Linux Kernel. See below for details. - - o FreeBSD support is not currently being maintained and may not work. - -The DRI 3D drivers generally work on systems with Intel or AMD CPUs. How- -ever, limited support for Alpha and PowerPC support is underway. - -For 3dfx Voodoo hardware, you'll also need the Glide3 runtime library -(libglide3-v3.so for Voodoo3 or libglide3-v5.so for Voodoo4/5). These can be -downloaded from the DRI website. You can compile them yourself, but it's -often a painful process. - -For Matrox G200/G400, Intel i810/i830 or ATI Rage128/Radeon hardware, you'll -also need AGP support in your Linux kernel, either built-in or as a loadable -module. - -4. Linux Kernel Preparation - -Only the Linux 2.4.x kernels are currently supported by the DRI hardware -drivers. 2.5.x kernels may work, but aren't tested. - -Most of the DRI drivers require AGP support and using Intel Pentium III SSE -optimizations also requires an up-to-date Linux kernel. Configuring your -kernel correctly is very important, as features such as SSE optimizations -will be disabled if your kernel does not support them. Thus, if you have a -Pentium III processor, you must configure your kernel for the Pentium III -processor family. - -Building a new Linux kernel can be difficult for beginners but there are -resources on the Internet to help. This document assumes experience with -configuring, building and installing Linux kernels. - -Linux kernels can be downloaded from www.kernel.org - -Here are the basic steps for kernel setup. - - o Download the needed kernel and put it in /usr/src. Create a directory - for the source and unpack it. For example: - - cd /usr/src - rm -f linux - mkdir linux-2.4.x - ln -s linux-2.4.x linux - bzcat linux-2.4.x.tar.bz2 | tar xf - - - It is critical that /usr/src/linux point to your new kernel sources, - otherwise the kernel headers will not be used when building the DRI. - This will almost certainly cause compilation problems. - - o Read /usr/src/linux/Documentation/Changes. This file lists the minimum - requirements for all software packages required to build the kernel. - You must upgrade at least gcc, make, binutils and modutils to at least - the versions specified in this file. The other packages may not be - needed. If you are upgrading from Linux 2.2.x you must upgrade your - modutils package for Linux 2.4.x. - - o Configure your kernel. You might, for example, use make menuconfig and - do the following: - - o Go to Code maturity level options - - o Enable Prompt for development and/or incomplete code/drivers - - o hit ESC to return to the top-level menu - - o Go to Processor type and features - - o Select your processor type from Processor Family - - o hit ESC to return to the top-level menu - - o Go to Character devices - - o Disable Direct Rendering Manager (XFree86 DRI support) since we'll - use the DRI code from the XFree86/DRI tree and will compile it - there. - - o Go to /dev/agpgart (AGP Support) (EXPERIMENTAL) (NEW) - - o Hit SPACE twice to build AGP support into the kernel - - o Enable all chipsets' support for AGP - - o Configure the rest of the kernel as required for your system (i.e. Eth- - ernet, SCSI, etc) - - o Exit, saving your kernel configuration. - - o Edit your /etc/lilo.conf file. Make sure you have an image entry as - follows (or similar): - - image=/boot/vmlinuz - label=linux.2.4.x - read-only - root=/dev/hda1 - - The important part is that you have /boot/vmlinuz without a trailing - version number. If this is the first entry in your /etc/lilo.conf AND - you haven't set a default, then this will be your default kernel. - - o Compile the new kernel. - - cd /usr/src/linux-2.4.x - make dep - make bzImage - make modules - make modules_install - make install - - Note that last make command will automatically run lilo for you. - - o Now reboot to use the new kernel. - -5. CPU Architectures - -In general, nothing special has to be done to use the DRI on different CPU -architectures. There are, however, a few optimizations that are CPU-depen- -dent. Mesa will determine at runtime which CPU-dependent optimizations -should be used and enable them where appropriate. - -5.1 Intel Pentium III Features - -The Pentium III SSE instructions are used in optimized vertex transformation -functions in the Mesa-based DRI drivers. On Linux, SSE requires a recent -kernel (such as 2.4.0-test11 or later) both at compile time and runtime. - -5.2 AMD 3DNow! Features - -AMD's 3DNow! instructions are used in optimized vertex transformation func- -tions in the Mesa-based DRI drivers. 3DNow! is supported in most versions of -Linux. - -5.3 Alpha Features - -On newer Alpha processors a significant performance increase can be seen with -the addition of the -mcpu= option to GCC. This option is dependent on the -architecture of the processor. For example, -mcpu=ev6 will build specifi- -cally for the EV6 based AXP's, giving both byte and word alignment access to -the DRI/Mesa drivers. - -To enable this optimization edit your xc/config/host.def file and add the -line: - -#define DefaultGcc2AxpOpt -O2 -mcpu=ev6 - -Additional speed improvements to 3D rendering can be achieved by installing -Compaq's Math Libraries (CPML) which can be obtained from http://www.sup- -port.compaq.com/alpha-tools/software/index.html - -Once installed, you can add this line to your host.def to build with the CPML -libraries: - -#define UseCompaqMathLibrary YES - -The host.def file is explained below. - -6. Downloading the XFree86/DRI CVS Sources - -The DRI project is hosted by SourceForge. The DRI source code, which is a -subset of the XFree86 source tree, is kept in a CVS repository there. - -The DRI CVS sources may be accessed either anonymously or as a registered -SourceForge user. It's recommended that you become a registered SourceForge -user so that you may submit non-anonymous bug reports and can participate in -the mailing lists. - -6.1 Anonymous CVS download: - - 1. Create a directory to store the CVS files: - - cd ~ - mkdir DRI-CVS - - You could put your CVS directory in a different place but we'll use - ~/DRI-CVS/ here. - - 2. Check out the CVS sources: - - cd ~/DRI-CVS - cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login - (hit ENTER when prompted for a password) - cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc - - The -z3 flag causes compression to be used in order to reduce the down- - load time. - -6.2 Registered CVS download: - - 1. Create a directory to store the CVS files: - - cd ~ - mkdir DRI-CVS - - You could put your CVS directory in a different place but we'll use - ~/DRI-CVS/ here. - - 2. Set the CVS_RSH environment variable: - - setenv CVS_RSH ssh // if using csh or tcsh - export CVS_RSH=ssh // if using sh or bash - - 3. Check out the CVS sources: - - cd ~/DRI-CVS - cvs -z3 -d:ext:YOURID@cvs.dri.sourceforge.net:/cvsroot/dri co xc - - Replace YOURID with your CVS login name. You'll be prompted to enter - your sourceforge password. - - The -z3 flag causes compression to be used in order to reduce the down- - load time. - -6.3 Updating your CVS sources - -In the future you'll want to occasionally update your local copy of the DRI -source code to get the latest changes. This can be done with: - - cd ~/DRI-CVS - cvs -z3 update -dA xc - -The -d flag causes any new subdirectories to be created and -A causes most -recent trunk sources to be fetched, not branch sources. - -7. Mesa - -Most of the DRI 3D drivers are based on Mesa (the free implementation of the -OpenGL API). The relevant files from Mesa are already included in the -XFree86/DRI source tree. There is no need to download or install the Mesa -source files separately. - -Sometimes a newer version of Mesa will be available than the version included -in XFree86/DRI. Upgrading Mesa within XFree86/DRI is not always straightfor- -ward. It can be an error-prone undertaking, especially for beginners, and is -not generally recommended. The DRI developers will upgrade Mesa when appro- -priate. - -8. Compiling the XFree86/DRI tree - -8.1 Make a build tree - -Rather than placing object files and library files right in the source tree, -they're instead put into a parallel build tree. The build tree is made with -the lndir command: - - cd ~/DRI-CVS - ln -s xc XFree40 - mkdir build - cd build - lndir -silent -ignorelinks ../XFree40 - -The build tree will be populated with symbolic links which point back into -the CVS source tree. - -Advanced users may have several build trees for compiling and testing with -different options. - -8.2 Edit the host.def file - -The ~/DRI-CVS/build/xc/config/cf/host.def file is used to configure the -XFree86 build process. You can change it to customize your build options or -make adjustments for your particular system configuration - -The default host.def file will look something like this: - - #define DefaultCCOptions -Wall - (i386) #define DefaultGcc2i386Opt -O2 - (Alpha) #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar) - #define LibraryCDebugFlags -O2 - #define BuildServersOnly YES - #define XF86CardDrivers vga tdfx mga ati i810 - #define LinuxDistribution LinuxRedHat - #define DefaultCCOptions -ansi GccWarningOptions -pipe - #define BuildXF86DRI YES - /* Optionally turn these on for debugging */ - /* #define GlxBuiltInTdfx YES */ - /* #define GlxBuiltInMga YES */ - /* #define GlxBuiltInR128 YES */ - /* #define GlxBuiltInRadeon YES */ - /* #define DoLoadableServer NO */ - #define SharedLibFont NO - -The ProjectRoot variable specifies where the XFree86 files will be installed. -We recommend installing the DRI files over your existing XFree86 installation -- it's generally safe to do and less error-prone. This policy is different -than what we used to recommend. - -If XFree86 4.x is not installed in /usr/X11R6/ you'll have to add the follow- -ing to the host.def file: - - #define ProjectRoot pathToYourXFree86installation - -Note the XF86CardDrivers line to be sure your card's driver is listed. - -If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you -should add the following: - - #define MesaUse3DNow YES - -You don't have to be using an AMD processor in order to enable this option. -The DRI will look for 3DNow! support and runtime and only enable it if appli- -cable. - -If you want to enable SSE optimizations in Mesa and the DRI drivers, you must -upgrade to a Linux 2.4.x kernel. Mesa will verify that SSE is supported by -both your processor and your operating system, but to build Mesa inside the -DRI you need to have the Linux 2.4.x kernel headers in /usr/src/linux. If -you enable SSE optimizations with an earlier version of the Linux kernel in -/usr/src/linux, Mesa will not compile. You have been warned. If you do have -a 2.4.x kernel, you should add the following: - - #define MesaUseSSE YES - -If you want to build the DRM kernel modules as part of the full build pro- -cess, add the following: - - #define BuildXF86DRM YES - -Otherwise, you'll need to build them separately as described below. - -8.3 Compilation - -To compile the complete DRI tree: - - cd ~/DRI-CVS/build/xc/ - make World >& world.log - -Or if you want to watch the compilation progress: - - cd ~/DRI-CVS/build/xc/ - make World >& world.log & - tail -f world.log - -With the default compilation flags it's normal to get a lot of warnings dur- -ing compilation. - -Building will take some time so you may want to go check your email or visit -slashdot. - -WARNING: do not use the -j option with make. It's reported that it does not -work with XFree86/DRI. - -8.4 Check for compilation errors - -Using your text editor, examine world.log for errors by searching for the -pattern ***. - -After fixing the errors, run make World again. Later, you might just compile -parts of the source tree but it's important that the whole tree will build -first. - -If you edited your host.def file to enable automatic building of the DRI ker- -nel module(s), verify that they were built: - - cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel - ls - -Otherwise, build them now by running - - cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel - make -f Makefile.linux - -For the 3dfx Voodoo, you should see tdfx.o. For the Matrox G200/G400, you -should see mga.o. For the ATI Rage 128, you should see r128.o. For the ATI -Radeon, you should see radeon.o. For the Intel i810, you should see i810.o. - -If the DRI kernel module(s) failed to build you should verify that you're -using the right version of the Linux kernel. The most recent kernels are not -always supported. - -If your build machine is running a different version of the kernel than your -target machine (i.e. 2.2.x vs. 2.4.x), make will select the wrong kernel -source tree. This can be fixed by explicitly setting the value of LINUXDIR. -If the path to your kernel source is /usr/src/linux-2.4.x, - - cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel - make -f Makefile.linux LINUXDIR=/usr/src/linux-2.4.x - -or alternatively, edit Makefile.linux to set LINUXDIR before the ifndef LIN- -UXDIR line. - -8.5 DRI kernel module installation - -The DRI kernel modules will be in ~/DRI-CVS/build/xc/pro- -grams/Xserver/hw/xfree86/os-support/linux/drm/kernel/. - -To load the appropriate DRM module in your running kernel you can either use -ismod and restart your X server or copy the kernel module to /lib/mod- -ules/2.4.x/kernel/drivers/char/drm/ then run depmod and restart your X -server. - -Make sure you first unload any older DRI kernel modules that might be already -loaded. - -Note that some DRM modules require that the agpgart module be loaded first. - -9. Normal Installation and Configuration - -Most users will want to install the new X server and use it in place of their -old X server. This section explains how to do that. - -Developers, on the other hand, may just want to test the X server without -actually installing it as their default server. If you want to do that, skip -to the next section. - -9.1 Installation - -Here are the installation commands: - - su - cd ~/DRI-CVS/build/xc - make install - -9.2 Update the XF86Config File - -You may need to edit your XF86Config file to enable the DRI. The config file -is usually installed as /etc/X11/XF86Config-4. See the DRI User Guide for -details, but basically, you need to load the "glx" and "dri" modules and add -a "DRI" section. - -On the DRI web site, in the resources section, you'll find example XF86Config -files for a number of graphics cards. These configuration files also setup -DRI options so it's highly recommended that you look at these examples. - -The XFree86 4.x server can generate a basic configuration file itself. Sim- -ply do this: - - cd /usr/X11R6/bin - ./XFree86 -configure - -A file named /root/XF86Config.new will be created. It should allow you to -try your X server but you'll almost certainly have to edit it. For example, -you should add HorizSync and VertRefresh options to the Monitor section and -Modes options to the Screen section. Also, the ModulePath option in the -Files section should be set to /usr/X11R6/lib/modules. - -9.3 Start the New X Server - -The new X server should be ready to use now. Start your X server in your -usual manner. Often times the startx command is used: - - startx - -10. Testing the Server Without Installing It - -As mentioned at the start of section 9, developers may want to simply run the -X server without installing it. This can save some time and allow you to -keep a number of X servers available for testing. - -10.1 Configuration - -As described in the preceding section, you'll need to create a configuration -file for the new server. Put the XF86Config file in your ~/DRI- -CVS/build/xc/programs/Xserver directory. - -Be sure the ModulePath option in your XF86Config file is set correctly. - -10.2 A Startup Script - -A simple shell script can be used to start the X server. Here's an example. - - #!/bin/sh - export DISPLAY=:0 - ./XFree86 -xf86config XF86Config & \ - sleep 2 - fvwm2 & - xset b off - xmodmap -e "clear mod4" - xsetroot -solid "#00306f" - xterm -geometry 80x40+0+0 - -You might name this script start-dri. Put it in your ~/DRI-CVS/build/xc/pro- -grams/Xserver directory. - -To test the server run the script: - - cd ~/DRI-CVS/build/xc/programs/Xserver - ./start-dri - -For debugging, you may also want to capture the log messages printed by the -server in a file. If you're using the C-shell: - - ./start-dri >& log - -11. Where To Go From Here - -At this point your X server should be up and running with hardware-acceler- -ated direct rendering. Please read the DRI User Guide for information about -trouble shooting and how to use the DRI-enabled X server for 3D applications. - - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.19 dawes Exp $ diff --git a/xserver/hw/xfree86/doc/ddxDesign.xml b/xserver/hw/xfree86/doc/ddxDesign.xml index aed77a9f0..f7d66285e 100644 --- a/xserver/hw/xfree86/doc/ddxDesign.xml +++ b/xserver/hw/xfree86/doc/ddxDesign.xml @@ -2052,18 +2052,6 @@ functions is as follows: -
- - Bool xf86ServerIsInitialising(); - -
- Returns TRUE if the server is at the beginning of - a generation and is in the process of initialising, and - FALSE otherwise. -
- -
-
Bool xf86ServerIsOnlyProbing(); @@ -5560,10 +5548,6 @@ The fields are used as follows: ABI_CLASS_EXTENSION requires the extension module ABI - - ABI_CLASS_FONT - requires the font module ABI - @@ -5583,7 +5567,6 @@ The fields are used as follows: ABI_VIDEODRV_VERSION ABI_XINPUT_VERSION ABI_EXTENSION_VERSION - ABI_FONT_VERSION @@ -5603,7 +5586,6 @@ The fields are used as follows: MOD_CLASS_NONE MOD_CLASS_VIDEODRV MOD_CLASS_XINPUT - MOD_CLASS_FONT MOD_CLASS_EXTENSION diff --git a/xserver/hw/xfree86/dri/Makefile.in b/xserver/hw/xfree86/dri/Makefile.in index 0b21bfad6..d9cce8ef8 100644 --- a/xserver/hw/xfree86/dri/Makefile.in +++ b/xserver/hw/xfree86/dri/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -328,6 +329,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -358,7 +362,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -453,6 +460,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/dri/dri.c b/xserver/hw/xfree86/dri/dri.c index 161d96fd0..acc5bca58 100644 --- a/xserver/hw/xfree86/dri/dri.c +++ b/xserver/hw/xfree86/dri/dri.c @@ -158,9 +158,6 @@ DRIOpenDRMMaster(ScrnInfoPtr pScrn, Bool drmWasAvailable; DRIEntPrivPtr pDRIEntPriv; DRIEntPrivRec tmp; - drmVersionPtr drmlibv; - int drmlibmajor, drmlibminor; - const char *openBusID; int count; int err; @@ -176,23 +173,6 @@ DRIOpenDRMMaster(ScrnInfoPtr pScrn, memset(&tmp, 0, sizeof(tmp)); - /* Check the DRM lib version. - */ - - drmlibmajor = 1; - drmlibminor = 0; - drmlibv = drmGetLibVersion(-1); - if (drmlibv != NULL) { - drmlibmajor = drmlibv->version_major; - drmlibminor = drmlibv->version_minor; - drmFreeVersion(drmlibv); - } - - /* Check if the libdrm can handle falling back to loading based on name - * if a busid string is passed. - */ - openBusID = (drmlibmajor == 1 && drmlibminor >= 2) ? busID : NULL; - tmp.drmFD = -1; sv.drm_di_major = 1; sv.drm_di_minor = 1; @@ -201,7 +181,7 @@ DRIOpenDRMMaster(ScrnInfoPtr pScrn, saveSv = sv; count = 10; while (count--) { - tmp.drmFD = drmOpen(drmDriverName, openBusID); + tmp.drmFD = drmOpen(drmDriverName, busID); if (tmp.drmFD < 0) { DRIDrvMsg(-1, X_ERROR, "[drm] drmOpen failed.\n"); @@ -310,6 +290,68 @@ dri_crtc_notify(ScreenPtr pScreen) xf86_wrap_crtc_notify(pScreen, dri_crtc_notify); } +static void +drmSIGIOHandler(int interrupt, void *closure) +{ + unsigned long key; + void *value; + ssize_t count; + drm_ctx_t ctx; + typedef void (*_drmCallback) (int, void *, void *); + char buf[256]; + drm_context_t old; + drm_context_t new; + void *oldctx; + void *newctx; + char *pt; + drmHashEntry *entry; + void *hash_table; + + hash_table = drmGetHashTable(); + + if (!hash_table) + return; + if (drmHashFirst(hash_table, &key, &value)) { + entry = value; + do { + if ((count = read(entry->fd, buf, sizeof(buf) - 1)) > 0) { + buf[count] = '\0'; + + for (pt = buf; *pt != ' '; ++pt); /* Find first space */ + ++pt; + old = strtol(pt, &pt, 0); + new = strtol(pt, NULL, 0); + oldctx = drmGetContextTag(entry->fd, old); + newctx = drmGetContextTag(entry->fd, new); + ((_drmCallback) entry->f) (entry->fd, oldctx, newctx); + ctx.handle = new; + ioctl(entry->fd, DRM_IOCTL_NEW_CTX, &ctx); + } + } while (drmHashNext(hash_table, &key, &value)); + } +} + +static int +drmInstallSIGIOHandler(int fd, void (*f) (int, void *, void *)) +{ + drmHashEntry *entry; + + entry = drmGetEntry(fd); + entry->f = f; + + return xf86InstallSIGIOHandler(fd, drmSIGIOHandler, 0); +} + +static int +drmRemoveSIGIOHandler(int fd) +{ + drmHashEntry *entry = drmGetEntry(fd); + + entry->f = NULL; + + return xf86RemoveSIGIOHandler(fd); +} + Bool DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) { @@ -1580,7 +1622,7 @@ DRIDestroyInfoRec(DRIInfoPtr DRIInfo) } void -DRIWakeupHandler(void *wakeupData, int result, void *pReadmask) +DRIWakeupHandler(void *wakeupData, int result) { int i; @@ -1589,13 +1631,12 @@ DRIWakeupHandler(void *wakeupData, int result, void *pReadmask) DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.WakeupHandler) - (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (pScreen, - result, pReadmask); + (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (pScreen, result); } } void -DRIBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask) +DRIBlockHandler(void *blockData, void *pTimeout) { int i; @@ -1604,14 +1645,12 @@ DRIBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask) DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.BlockHandler) - (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (pScreen, - pTimeout, pReadmask); + (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (pScreen, pTimeout); } } void -DRIDoWakeupHandler(ScreenPtr pScreen, - unsigned long result, void *pReadmask) +DRIDoWakeupHandler(ScreenPtr pScreen, int result) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); @@ -1628,8 +1667,7 @@ DRIDoWakeupHandler(ScreenPtr pScreen, } void -DRIDoBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadmask) +DRIDoBlockHandler(ScreenPtr pScreen, void *timeout) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); diff --git a/xserver/hw/xfree86/dri/dri.h b/xserver/hw/xfree86/dri/dri.h index 2802da56a..dfd2f827e 100644 --- a/xserver/hw/xfree86/dri/dri.h +++ b/xserver/hw/xfree86/dri/dri.h @@ -263,18 +263,13 @@ extern _X_EXPORT void DRIDestroyInfoRec(DRIInfoPtr DRIInfo); extern _X_EXPORT Bool DRIFinishScreenInit(ScreenPtr pScreen); -extern _X_EXPORT void DRIWakeupHandler(void *wakeupData, - int result, void *pReadmask); +extern _X_EXPORT void DRIWakeupHandler(void *wakeupData, int result); -extern _X_EXPORT void DRIBlockHandler(void *blockData, - OSTimePtr pTimeout, void *pReadmask); +extern _X_EXPORT void DRIBlockHandler(void *blockData, void *timeout); -extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, - unsigned long result, - void *pReadmask); +extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, int result); -extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadmask); +extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen, void *timeout); extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx); @@ -332,11 +327,6 @@ extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen, extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *PciInfo); -#if 0 -extern _X_EXPORT int drmInstallSIGIOHandler(int fd, - void (*f) (int, void *, void *)); -extern _X_EXPORT int drmRemoveSIGIOHandler(int fd); -#endif extern _X_EXPORT int DRIMasterFD(ScrnInfoPtr pScrn); extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn); diff --git a/xserver/hw/xfree86/dri2/Makefile.in b/xserver/hw/xfree86/dri2/Makefile.in index 8c53abae6..60270506c 100644 --- a/xserver/hw/xfree86/dri2/Makefile.in +++ b/xserver/hw/xfree86/dri2/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -366,6 +367,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -396,7 +400,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -491,6 +498,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/dri2/dri2.c b/xserver/hw/xfree86/dri2/dri2.c index d55be1913..2165603d9 100644 --- a/xserver/hw/xfree86/dri2/dri2.c +++ b/xserver/hw/xfree86/dri2/dri2.c @@ -186,12 +186,15 @@ static ScreenPtr GetScreenPrime(ScreenPtr master, int prime_id) { ScreenPtr slave; - if (prime_id == 0 || xorg_list_is_empty(&master->offload_slave_list)) { + if (prime_id == 0) { return master; } - xorg_list_for_each_entry(slave, &master->offload_slave_list, offload_head) { + xorg_list_for_each_entry(slave, &master->slave_list, slave_head) { DRI2ScreenPtr ds; + if (!slave->is_offload_slave) + continue; + ds = DRI2GetScreen(slave); if (ds == NULL) continue; @@ -859,6 +862,7 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest) if (pPriv->prime_slave_pixmap->master_pixmap == mpix) return &pPriv->prime_slave_pixmap->drawable; else { + PixmapUnshareSlavePixmap(pPriv->prime_slave_pixmap); (*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap->master_pixmap); (*slave->DestroyPixmap)(pPriv->prime_slave_pixmap); pPriv->prime_slave_pixmap = NULL; diff --git a/xserver/hw/xfree86/dri2/pci_ids/Makefile.in b/xserver/hw/xfree86/dri2/pci_ids/Makefile.in index a333a0a0c..118ff6fb4 100644 --- a/xserver/hw/xfree86/dri2/pci_ids/Makefile.in +++ b/xserver/hw/xfree86/dri2/pci_ids/Makefile.in @@ -53,9 +53,10 @@ subdir = hw/xfree86/dri2/pci_ids DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -264,6 +265,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -294,7 +298,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -389,6 +396,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h index 5139e279b..57e70b7ae 100644 --- a/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h +++ b/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h @@ -109,9 +109,14 @@ CHIPSET(0x162A, bdw_gt3, "Intel(R) Iris Pro P6300 (Broadwell GT3e)") CHIPSET(0x162B, bdw_gt3, "Intel(R) Iris 6100 (Broadwell GT3)") CHIPSET(0x162D, bdw_gt3, "Intel(R) Broadwell GT3") CHIPSET(0x162E, bdw_gt3, "Intel(R) Broadwell GT3") +CHIPSET(0x22B0, chv, "Intel(R) HD Graphics (Cherrytrail)") +CHIPSET(0x22B1, chv, "Intel(R) HD Graphics XXX (Braswell)") /* Overridden in brw_get_renderer_string */ +CHIPSET(0x22B2, chv, "Intel(R) HD Graphics (Cherryview)") +CHIPSET(0x22B3, chv, "Intel(R) HD Graphics (Cherryview)") CHIPSET(0x1902, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)") CHIPSET(0x1906, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)") CHIPSET(0x190A, skl_gt1, "Intel(R) Skylake GT1") +CHIPSET(0x190B, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)") CHIPSET(0x190E, skl_gt1, "Intel(R) Skylake GT1") CHIPSET(0x1912, skl_gt2, "Intel(R) HD Graphics 530 (Skylake GT2)") CHIPSET(0x1913, skl_gt2, "Intel(R) Skylake GT2f") @@ -122,42 +127,64 @@ CHIPSET(0x191A, skl_gt2, "Intel(R) Skylake GT2") CHIPSET(0x191B, skl_gt2, "Intel(R) HD Graphics 530 (Skylake GT2)") CHIPSET(0x191D, skl_gt2, "Intel(R) HD Graphics P530 (Skylake GT2)") CHIPSET(0x191E, skl_gt2, "Intel(R) HD Graphics 515 (Skylake GT2)") -CHIPSET(0x1921, skl_gt2, "Intel(R) Skylake GT2") -CHIPSET(0x1923, skl_gt3, "Intel(R) Iris Graphics 540 (Skylake GT3e)") -CHIPSET(0x1926, skl_gt3, "Intel(R) HD Graphics 535 (Skylake GT3)") +CHIPSET(0x1921, skl_gt2, "Intel(R) HD Graphics 520 (Skylake GT2)") +CHIPSET(0x1923, skl_gt3, "Intel(R) Skylake GT3e") +CHIPSET(0x1926, skl_gt3, "Intel(R) Iris Graphics 540 (Skylake GT3e)") CHIPSET(0x1927, skl_gt3, "Intel(R) Iris Graphics 550 (Skylake GT3e)") CHIPSET(0x192A, skl_gt4, "Intel(R) Skylake GT4") -CHIPSET(0x192B, skl_gt3, "Intel(R) Iris Graphics (Skylake GT3fe)") -CHIPSET(0x1932, skl_gt4, "Intel(R) Skylake GT4") -CHIPSET(0x193A, skl_gt4, "Intel(R) Skylake GT4") -CHIPSET(0x193B, skl_gt4, "Intel(R) Skylake GT4") -CHIPSET(0x193D, skl_gt4, "Intel(R) Skylake GT4") -CHIPSET(0x5902, kbl_gt1, "Intel(R) Kabylake GT1") -CHIPSET(0x5906, kbl_gt1, "Intel(R) Kabylake GT1") +CHIPSET(0x192B, skl_gt3, "Intel(R) Iris Graphics 555 (Skylake GT3e)") +CHIPSET(0x192D, skl_gt3, "Intel(R) Iris Graphics P555 (Skylake GT3e)") +CHIPSET(0x1932, skl_gt4, "Intel(R) Iris Pro Graphics 580 (Skylake GT4e)") +CHIPSET(0x193A, skl_gt4, "Intel(R) Iris Pro Graphics P580 (Skylake GT4e)") +CHIPSET(0x193B, skl_gt4, "Intel(R) Iris Pro Graphics 580 (Skylake GT4e)") +CHIPSET(0x193D, skl_gt4, "Intel(R) Iris Pro Graphics P580 (Skylake GT4e)") +CHIPSET(0x0A84, bxt, "Intel(R) HD Graphics (Broxton)") +CHIPSET(0x1A84, bxt, "Intel(R) HD Graphics (Broxton)") +CHIPSET(0x1A85, bxt_2x6, "Intel(R) HD Graphics (Broxton 2x6)") +CHIPSET(0x5A84, bxt, "Intel(R) HD Graphics 505 (Broxton)") +CHIPSET(0x5A85, bxt_2x6, "Intel(R) HD Graphics 500 (Broxton 2x6)") +CHIPSET(0x5902, kbl_gt1, "Intel(R) HD Graphics 610 (Kaby Lake GT1)") +CHIPSET(0x5906, kbl_gt1, "Intel(R) HD Graphics 610 (Kaby Lake GT1)") CHIPSET(0x590A, kbl_gt1, "Intel(R) Kabylake GT1") +CHIPSET(0x5908, kbl_gt1, "Intel(R) Kabylake GT1") CHIPSET(0x590B, kbl_gt1, "Intel(R) Kabylake GT1") CHIPSET(0x590E, kbl_gt1, "Intel(R) Kabylake GT1") CHIPSET(0x5913, kbl_gt1_5, "Intel(R) Kabylake GT1.5") CHIPSET(0x5915, kbl_gt1_5, "Intel(R) Kabylake GT1.5") CHIPSET(0x5917, kbl_gt1_5, "Intel(R) Kabylake GT1.5") -CHIPSET(0x5912, kbl_gt2, "Intel(R) Kabylake GT2") -CHIPSET(0x5916, kbl_gt2, "Intel(R) Kabylake GT2") -CHIPSET(0x591A, kbl_gt2, "Intel(R) Kabylake GT2") -CHIPSET(0x591B, kbl_gt2, "Intel(R) Kabylake GT2") -CHIPSET(0x591D, kbl_gt2, "Intel(R) Kabylake GT2") -CHIPSET(0x591E, kbl_gt2, "Intel(R) Kabylake GT2") +CHIPSET(0x5912, kbl_gt2, "Intel(R) HD Graphics 630 (Kaby Lake GT2)") +CHIPSET(0x5916, kbl_gt2, "Intel(R) HD Graphics 620 (Kaby Lake GT2)") +CHIPSET(0x591A, kbl_gt2, "Intel(R) HD Graphics P630 (Kaby Lake GT2)") +CHIPSET(0x591B, kbl_gt2, "Intel(R) HD Graphics 630 (Kaby Lake GT2)") +CHIPSET(0x591D, kbl_gt2, "Intel(R) HD Graphics P630 (Kaby Lake GT2)") +CHIPSET(0x591E, kbl_gt2, "Intel(R) HD Graphics 615 (Kaby Lake GT2)") CHIPSET(0x5921, kbl_gt2, "Intel(R) Kabylake GT2F") -CHIPSET(0x5926, kbl_gt3, "Intel(R) Kabylake GT3") -CHIPSET(0x592A, kbl_gt3, "Intel(R) Kabylake GT3") -CHIPSET(0x592B, kbl_gt3, "Intel(R) Kabylake GT3") -CHIPSET(0x5932, kbl_gt4, "Intel(R) Kabylake GT4") -CHIPSET(0x593A, kbl_gt4, "Intel(R) Kabylake GT4") +CHIPSET(0x5923, kbl_gt3, "Intel(R) Kabylake GT3") +CHIPSET(0x5926, kbl_gt3, "Intel(R) Iris Plus Graphics 640 (Kaby Lake GT3)") +CHIPSET(0x5927, kbl_gt3, "Intel(R) Iris Plus Graphics 650 (Kaby Lake GT3)") CHIPSET(0x593B, kbl_gt4, "Intel(R) Kabylake GT4") -CHIPSET(0x593D, kbl_gt4, "Intel(R) Kabylake GT4") -CHIPSET(0x22B0, chv, "Intel(R) HD Graphics (Cherryview)") -CHIPSET(0x22B1, chv, "Intel(R) HD Graphics (Cherryview)") -CHIPSET(0x22B2, chv, "Intel(R) HD Graphics (Cherryview)") -CHIPSET(0x22B3, chv, "Intel(R) HD Graphics (Cherryview)") -CHIPSET(0x0A84, bxt, "Intel(R) HD Graphics (Broxton)") -CHIPSET(0x1A84, bxt, "Intel(R) HD Graphics (Broxton)") -CHIPSET(0x5A84, bxt, "Intel(R) HD Graphics (Broxton)") +CHIPSET(0x3184, glk, "Intel(R) HD Graphics (Geminilake)") +CHIPSET(0x3185, glk_2x6, "Intel(R) HD Graphics (Geminilake 2x6)") +CHIPSET(0x3E90, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") +CHIPSET(0x3E93, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)") +CHIPSET(0x3E91, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +CHIPSET(0x3E92, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +CHIPSET(0x3E96, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +CHIPSET(0x3E9B, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +CHIPSET(0x3E94, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)") +CHIPSET(0x3EA6, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") +CHIPSET(0x3EA7, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") +CHIPSET(0x3EA8, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") +CHIPSET(0x3EA5, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)") +CHIPSET(0x5A49, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)") +CHIPSET(0x5A4A, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)") +CHIPSET(0x5A41, cnl_3x8, "Intel(R) HD Graphics (Cannonlake 3x8 GT1)") +CHIPSET(0x5A42, cnl_3x8, "Intel(R) HD Graphics (Cannonlake 3x8 GT1)") +CHIPSET(0x5A44, cnl_3x8, "Intel(R) HD Graphics (Cannonlake 3x8 GT1)") +CHIPSET(0x5A59, cnl_4x8, "Intel(R) HD Graphics (Cannonlake 4x8 GT1.5)") +CHIPSET(0x5A5A, cnl_4x8, "Intel(R) HD Graphics (Cannonlake 4x8 GT1.5)") +CHIPSET(0x5A5C, cnl_4x8, "Intel(R) HD Graphics (Cannonlake 4x8 GT1.5)") +CHIPSET(0x5A50, cnl_5x8, "Intel(R) HD Graphics (Cannonlake 5x8 GT2)") +CHIPSET(0x5A51, cnl_5x8, "Intel(R) HD Graphics (Cannonlake 5x8 GT2)") +CHIPSET(0x5A52, cnl_5x8, "Intel(R) HD Graphics (Cannonlake 5x8 GT2)") +CHIPSET(0x5A54, cnl_5x8, "Intel(R) HD Graphics (Cannonlake 5x8 GT2)") diff --git a/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h index 4df8e9d83..20c15837a 100644 --- a/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h +++ b/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h @@ -184,12 +184,24 @@ CHIPSET(0x7300, FIJI_, FIJI) CHIPSET(0x67E0, POLARIS11_, POLARIS11) CHIPSET(0x67E1, POLARIS11_, POLARIS11) +CHIPSET(0x67E3, POLARIS11_, POLARIS11) +CHIPSET(0x67E7, POLARIS11_, POLARIS11) CHIPSET(0x67E8, POLARIS11_, POLARIS11) CHIPSET(0x67E9, POLARIS11_, POLARIS11) CHIPSET(0x67EB, POLARIS11_, POLARIS11) +CHIPSET(0x67EF, POLARIS11_, POLARIS11) CHIPSET(0x67FF, POLARIS11_, POLARIS11) CHIPSET(0x67C0, POLARIS10_, POLARIS10) +CHIPSET(0x67C1, POLARIS10_, POLARIS10) +CHIPSET(0x67C2, POLARIS10_, POLARIS10) +CHIPSET(0x67C4, POLARIS10_, POLARIS10) +CHIPSET(0x67C7, POLARIS10_, POLARIS10) +CHIPSET(0x67C8, POLARIS10_, POLARIS10) +CHIPSET(0x67C9, POLARIS10_, POLARIS10) +CHIPSET(0x67CA, POLARIS10_, POLARIS10) +CHIPSET(0x67CC, POLARIS10_, POLARIS10) +CHIPSET(0x67CF, POLARIS10_, POLARIS10) CHIPSET(0x67DF, POLARIS10_, POLARIS10) CHIPSET(0x98E4, STONEY_, STONEY) diff --git a/xserver/hw/xfree86/drivers/Makefile.in b/xserver/hw/xfree86/drivers/Makefile.in index 4430fdf7b..f386f1691 100644 --- a/xserver/hw/xfree86/drivers/Makefile.in +++ b/xserver/hw/xfree86/drivers/Makefile.in @@ -54,9 +54,10 @@ subdir = hw/xfree86/drivers DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -305,6 +306,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -335,7 +339,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -430,6 +437,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/drivers/modesetting/Makefile.am b/xserver/hw/xfree86/drivers/modesetting/Makefile.am index ca7e05aac..44823b0fb 100644 --- a/xserver/hw/xfree86/drivers/modesetting/Makefile.am +++ b/xserver/hw/xfree86/drivers/modesetting/Makefile.am @@ -54,6 +54,7 @@ modesetting_drv_la_SOURCES = \ sh3224.c \ sh3224.h \ vblank.c \ + pageflip.c \ $(NULL) drivermandir = $(DRIVER_MAN_DIR) diff --git a/xserver/hw/xfree86/drivers/modesetting/Makefile.in b/xserver/hw/xfree86/drivers/modesetting/Makefile.in index 8fcf0d84a..ed8bf34d9 100644 --- a/xserver/hw/xfree86/drivers/modesetting/Makefile.in +++ b/xserver/hw/xfree86/drivers/modesetting/Makefile.in @@ -82,9 +82,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -131,7 +132,7 @@ LTLIBRARIES = $(modesetting_drv_la_LTLIBRARIES) am__DEPENDENCIES_1 = modesetting_drv_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_modesetting_drv_la_OBJECTS = dri2.lo driver.lo drmmode_display.lo \ - dumb_bo.lo present.lo sh3224.lo vblank.lo + dumb_bo.lo present.lo sh3224.lo vblank.lo pageflip.lo modesetting_drv_la_OBJECTS = $(am_modesetting_drv_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -361,6 +362,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -391,7 +395,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -486,6 +493,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -561,6 +569,7 @@ modesetting_drv_la_SOURCES = \ sh3224.c \ sh3224.h \ vblank.c \ + pageflip.c \ $(NULL) drivermandir = $(DRIVER_MAN_DIR) @@ -652,6 +661,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmmode_display.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dumb_bo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pageflip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh3224.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vblank.Plo@am__quote@ diff --git a/xserver/hw/xfree86/drivers/modesetting/dri2.c b/xserver/hw/xfree86/drivers/modesetting/dri2.c index 83cb3e0e7..8944ef136 100644 --- a/xserver/hw/xfree86/drivers/modesetting/dri2.c +++ b/xserver/hw/xfree86/drivers/modesetting/dri2.c @@ -46,6 +46,7 @@ enum ms_dri2_frame_event_type { MS_DRI2_QUEUE_SWAP, + MS_DRI2_QUEUE_FLIP, MS_DRI2_WAIT_MSC, }; @@ -117,22 +118,10 @@ get_drawable_pixmap(DrawablePtr drawable) return screen->GetWindowPixmap((WindowPtr) drawable); } -static PixmapPtr -get_front_buffer(DrawablePtr drawable) -{ - PixmapPtr pixmap; - - pixmap = get_drawable_pixmap(drawable); - pixmap->refcnt++; - - return pixmap; -} - static DRI2Buffer2Ptr -ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment, - unsigned int format) +ms_dri2_create_buffer2(ScreenPtr screen, DrawablePtr drawable, + unsigned int attachment, unsigned int format) { - ScreenPtr screen = drawable->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); DRI2Buffer2Ptr buffer; PixmapPtr pixmap; @@ -151,8 +140,13 @@ ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment, } pixmap = NULL; - if (attachment == DRI2BufferFrontLeft) - pixmap = get_front_buffer(drawable); + if (attachment == DRI2BufferFrontLeft) { + pixmap = get_drawable_pixmap(drawable); + if (pixmap && pixmap->drawable.pScreen != screen) + pixmap = NULL; + if (pixmap) + pixmap->refcnt++; + } if (pixmap == NULL) { int pixmap_width = drawable->width; @@ -192,8 +186,6 @@ ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment, pixmap_cpp, 0); if (pixmap == NULL) { - if (pixmap) - screen->DestroyPixmap(pixmap); free(private); free(buffer); return NULL; @@ -226,6 +218,14 @@ ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment, return buffer; } +static DRI2Buffer2Ptr +ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment, + unsigned int format) +{ + return ms_dri2_create_buffer2(drawable->pScreen, drawable, attachment, + format); +} + static void ms_dri2_reference_buffer(DRI2Buffer2Ptr buffer) { @@ -235,7 +235,8 @@ ms_dri2_reference_buffer(DRI2Buffer2Ptr buffer) } } -static void ms_dri2_destroy_buffer(DrawablePtr drawable, DRI2Buffer2Ptr buffer) +static void ms_dri2_destroy_buffer2(ScreenPtr unused, DrawablePtr unused2, + DRI2Buffer2Ptr buffer) { if (!buffer) return; @@ -253,28 +254,55 @@ static void ms_dri2_destroy_buffer(DrawablePtr drawable, DRI2Buffer2Ptr buffer) } } +static void ms_dri2_destroy_buffer(DrawablePtr drawable, DRI2Buffer2Ptr buffer) +{ + ms_dri2_destroy_buffer2(NULL, drawable, buffer); +} + static void -ms_dri2_copy_region(DrawablePtr drawable, RegionPtr pRegion, - DRI2BufferPtr destBuffer, DRI2BufferPtr sourceBuffer) +ms_dri2_copy_region2(ScreenPtr screen, DrawablePtr drawable, RegionPtr pRegion, + DRI2BufferPtr destBuffer, DRI2BufferPtr sourceBuffer) { ms_dri2_buffer_private_ptr src_priv = sourceBuffer->driverPrivate; ms_dri2_buffer_private_ptr dst_priv = destBuffer->driverPrivate; PixmapPtr src_pixmap = src_priv->pixmap; PixmapPtr dst_pixmap = dst_priv->pixmap; - ScreenPtr screen = drawable->pScreen; DrawablePtr src = (sourceBuffer->attachment == DRI2BufferFrontLeft) ? drawable : &src_pixmap->drawable; DrawablePtr dst = (destBuffer->attachment == DRI2BufferFrontLeft) ? drawable : &dst_pixmap->drawable; + int off_x = 0, off_y = 0; + Bool translate = FALSE; RegionPtr pCopyClip; GCPtr gc; + if (destBuffer->attachment == DRI2BufferFrontLeft && + drawable->pScreen != screen) { + dst = DRI2UpdatePrime(drawable, destBuffer); + if (!dst) + return; + if (dst != drawable) + translate = TRUE; + } + + if (translate && drawable->type == DRAWABLE_WINDOW) { +#ifdef COMPOSITE + PixmapPtr pixmap = get_drawable_pixmap(drawable); + off_x = -pixmap->screen_x; + off_y = -pixmap->screen_y; +#endif + off_x += drawable->x; + off_y += drawable->y; + } + gc = GetScratchGC(dst->depth, screen); if (!gc) return; pCopyClip = REGION_CREATE(screen, NULL, 0); REGION_COPY(screen, pCopyClip, pRegion); + if (translate) + REGION_TRANSLATE(screen, pCopyClip, off_x, off_y); (*gc->funcs->ChangeClip) (gc, CT_REGION, pCopyClip, 0); ValidateGC(dst, gc); @@ -290,11 +318,19 @@ ms_dri2_copy_region(DrawablePtr drawable, RegionPtr pRegion, gc->ops->CopyArea(src, dst, gc, 0, 0, drawable->width, drawable->height, - 0, 0); + off_x, off_y); FreeScratchGC(gc); } +static void +ms_dri2_copy_region(DrawablePtr drawable, RegionPtr pRegion, + DRI2BufferPtr destBuffer, DRI2BufferPtr sourceBuffer) +{ + ms_dri2_copy_region2(drawable->pScreen, drawable, pRegion, destBuffer, + sourceBuffer); +} + static uint64_t gettime_us(void) { @@ -399,6 +435,197 @@ ms_dri2_blit_swap(DrawablePtr drawable, ms_dri2_copy_region(drawable, ®ion, dst, src); } +struct ms_dri2_vblank_event { + XID drawable_id; + ClientPtr client; + DRI2SwapEventPtr event_complete; + void *event_data; +}; + +static void +ms_dri2_flip_abort(modesettingPtr ms, void *data) +{ + struct ms_present_vblank_event *event = data; + + ms->drmmode.dri2_flipping = FALSE; + free(event); +} + +static void +ms_dri2_flip_handler(modesettingPtr ms, uint64_t msc, + uint64_t ust, void *data) +{ + struct ms_dri2_vblank_event *event = data; + uint32_t frame = msc; + uint32_t tv_sec = ust / 1000000; + uint32_t tv_usec = ust % 1000000; + DrawablePtr drawable; + int status; + + status = dixLookupDrawable(&drawable, event->drawable_id, serverClient, + M_ANY, DixWriteAccess); + if (status == Success) + DRI2SwapComplete(event->client, drawable, frame, tv_sec, tv_usec, + DRI2_FLIP_COMPLETE, event->event_complete, + event->event_data); + + ms->drmmode.dri2_flipping = FALSE; + free(event); +} + +static Bool +ms_dri2_schedule_flip(ms_dri2_frame_event_ptr info) +{ + DrawablePtr draw = info->drawable; + ScreenPtr screen = draw->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + ms_dri2_buffer_private_ptr back_priv = info->back->driverPrivate; + struct ms_dri2_vblank_event *event; + drmmode_crtc_private_ptr drmmode_crtc = info->crtc->driver_private; + + event = calloc(1, sizeof(struct ms_dri2_vblank_event)); + if (!event) + return FALSE; + + event->drawable_id = draw->id; + event->client = info->client; + event->event_complete = info->event_complete; + event->event_data = info->event_data; + + if (ms_do_pageflip(screen, back_priv->pixmap, event, + drmmode_crtc->vblank_pipe, FALSE, + ms_dri2_flip_handler, + ms_dri2_flip_abort)) { + ms->drmmode.dri2_flipping = TRUE; + return TRUE; + } + return FALSE; +} + +static Bool +update_front(DrawablePtr draw, DRI2BufferPtr front) +{ + ScreenPtr screen = draw->pScreen; + PixmapPtr pixmap = get_drawable_pixmap(draw); + ms_dri2_buffer_private_ptr priv = front->driverPrivate; + CARD32 size; + CARD16 pitch; + + front->name = glamor_name_from_pixmap(pixmap, &pitch, &size); + if (front->name < 0) + return FALSE; + + (*screen->DestroyPixmap) (priv->pixmap); + front->pitch = pixmap->devKind; + front->cpp = pixmap->drawable.bitsPerPixel / 8; + priv->pixmap = pixmap; + pixmap->refcnt++; + + return TRUE; +} + +static Bool +can_exchange(ScrnInfoPtr scrn, DrawablePtr draw, + DRI2BufferPtr front, DRI2BufferPtr back) +{ + ms_dri2_buffer_private_ptr front_priv = front->driverPrivate; + ms_dri2_buffer_private_ptr back_priv = back->driverPrivate; + PixmapPtr front_pixmap; + PixmapPtr back_pixmap = back_priv->pixmap; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int num_crtcs_on = 0; + int i; + + for (i = 0; i < config->num_crtc; i++) { + drmmode_crtc_private_ptr drmmode_crtc = config->crtc[i]->driver_private; + + /* Don't do pageflipping if CRTCs are rotated. */ +#ifdef GLAMOR_HAS_GBM + if (drmmode_crtc->rotate_bo.gbm) + return FALSE; +#endif + + if (ms_crtc_on(config->crtc[i])) + num_crtcs_on++; + } + + /* We can't do pageflipping if all the CRTCs are off. */ + if (num_crtcs_on == 0) + return FALSE; + + if (!update_front(draw, front)) + return FALSE; + + front_pixmap = front_priv->pixmap; + + if (front_pixmap->drawable.width != back_pixmap->drawable.width) + return FALSE; + + if (front_pixmap->drawable.height != back_pixmap->drawable.height) + return FALSE; + + if (front_pixmap->drawable.bitsPerPixel != + back_pixmap->drawable.bitsPerPixel) + return FALSE; + + if (front_pixmap->devKind != back_pixmap->devKind) + return FALSE; + + return TRUE; +} + +static Bool +can_flip(ScrnInfoPtr scrn, DrawablePtr draw, + DRI2BufferPtr front, DRI2BufferPtr back) +{ + modesettingPtr ms = modesettingPTR(scrn); + + return draw->type == DRAWABLE_WINDOW && + ms->drmmode.pageflip && + !ms->drmmode.present_flipping && + scrn->vtSema && + DRI2CanFlip(draw) && can_exchange(scrn, draw, front, back); +} + +static void +ms_dri2_exchange_buffers(DrawablePtr draw, DRI2BufferPtr front, + DRI2BufferPtr back) +{ + ms_dri2_buffer_private_ptr front_priv = front->driverPrivate; + ms_dri2_buffer_private_ptr back_priv = back->driverPrivate; + ScreenPtr screen = draw->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + msPixmapPrivPtr front_pix = msGetPixmapPriv(&ms->drmmode, front_priv->pixmap); + msPixmapPrivPtr back_pix = msGetPixmapPriv(&ms->drmmode, back_priv->pixmap); + msPixmapPrivRec tmp_pix; + RegionRec region; + int tmp; + + /* Swap BO names so DRI works */ + tmp = front->name; + front->name = back->name; + back->name = tmp; + + /* Swap pixmap privates */ + tmp_pix = *front_pix; + *front_pix = *back_pix; + *back_pix = tmp_pix; + + glamor_egl_exchange_buffers(front_priv->pixmap, back_priv->pixmap); + + /* Post damage on the front buffer so that listeners, such + * as DisplayLink know take a copy and shove it over the USB. + */ + region.extents.x1 = region.extents.y1 = 0; + region.extents.x2 = front_priv->pixmap->drawable.width; + region.extents.y2 = front_priv->pixmap->drawable.height; + region.data = NULL; + DamageRegionAppend(&front_priv->pixmap->drawable, ®ion); + DamageRegionProcessPending(&front_priv->pixmap->drawable); +} + static void ms_dri2_frame_event_handler(uint64_t msc, uint64_t usec, @@ -417,6 +644,13 @@ ms_dri2_frame_event_handler(uint64_t msc, } switch (frame_info->type) { + case MS_DRI2_QUEUE_FLIP: + if (can_flip(scrn, drawable, frame_info->front, frame_info->back) && + ms_dri2_schedule_flip(frame_info)) { + ms_dri2_exchange_buffers(drawable, frame_info->front, frame_info->back); + break; + } + /* else fall through to blit */ case MS_DRI2_QUEUE_SWAP: ms_dri2_blit_swap(drawable, frame_info->front, frame_info->back); DRI2SwapComplete(frame_info->client, drawable, msc, tv_sec, tv_usec, @@ -607,7 +841,7 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); drmVBlank vbl; - int ret; + int ret, flip = 0; xf86CrtcPtr crtc = ms_dri2_crtc_covering_drawable(draw); drmmode_crtc_private_ptr drmmode_crtc; ms_dri2_frame_event_ptr frame_info = NULL; @@ -645,20 +879,36 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, ret = ms_get_crtc_ust_msc(crtc, ¤t_ust, ¤t_msc); + /* Flips need to be submitted one frame before */ + if (can_flip(scrn, draw, front, back)) { + frame_info->type = MS_DRI2_QUEUE_FLIP; + flip = 1; + } + + /* Correct target_msc by 'flip' if frame_info->type == MS_DRI2_QUEUE_FLIP. + * Do it early, so handling of different timing constraints + * for divisor, remainder and msc vs. target_msc works. + */ + if (*target_msc > 0) + *target_msc -= flip; + /* * If divisor is zero, or current_msc is smaller than target_msc * we just need to make sure target_msc passes before initiating * the swap. */ if (divisor == 0 || current_msc < *target_msc) { - /* We need to use DRM_VBLANK_NEXTONMISS to avoid unreliable - * timestamping later on. - */ vbl.request.type = (DRM_VBLANK_ABSOLUTE | - DRM_VBLANK_NEXTONMISS | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe); + /* If non-pageflipping, but blitting/exchanging, we need to use + * DRM_VBLANK_NEXTONMISS to avoid unreliable timestamping later + * on. + */ + if (flip == 0) + vbl.request.type |= DRM_VBLANK_NEXTONMISS; + /* If target_msc already reached or passed, set it to * current_msc to ensure we return a reasonable value back * to the caller. This makes swap_interval logic more robust. @@ -683,7 +933,8 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, goto blit_fallback; } - *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); + *target_msc = ms_kernel_msc_to_crtc_msc(crtc, + vbl.reply.sequence + flip); frame_info->frame = *target_msc; return TRUE; @@ -695,9 +946,10 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, * equation. */ vbl.request.type = (DRM_VBLANK_ABSOLUTE | - DRM_VBLANK_NEXTONMISS | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe); + if (flip == 0) + vbl.request.type |= DRM_VBLANK_NEXTONMISS; request_msc = current_msc - (current_msc % divisor) + remainder; @@ -721,7 +973,8 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, if (!seq) goto blit_fallback; - vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, request_msc); + /* Account for 1 frame extra pageflip delay if flip > 0 */ + vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, request_msc) - flip; vbl.request.signal = (unsigned long)seq; ret = drmWaitVBlank(ms->fd, &vbl); @@ -732,7 +985,8 @@ ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, goto blit_fallback; } - *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); + /* Adjust returned value for 1 fame pageflip offset of flip > 0 */ + *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence + flip); frame_info->frame = *target_msc; return TRUE; @@ -835,13 +1089,16 @@ ms_dri2_screen_init(ScreenPtr screen) info.driverName = NULL; /* Compat field, unused. */ info.deviceName = drmGetDeviceNameFromFd(ms->fd); - info.version = 4; + info.version = 9; info.CreateBuffer = ms_dri2_create_buffer; info.DestroyBuffer = ms_dri2_destroy_buffer; info.CopyRegion = ms_dri2_copy_region; info.ScheduleSwap = ms_dri2_schedule_swap; info.GetMSC = ms_dri2_get_msc; info.ScheduleWaitMSC = ms_dri2_schedule_wait_msc; + info.CreateBuffer2 = ms_dri2_create_buffer2; + info.DestroyBuffer2 = ms_dri2_destroy_buffer2; + info.CopyRegion2 = ms_dri2_copy_region2; /* These two will be filled in by dri2.c */ info.numDrivers = 0; diff --git a/xserver/hw/xfree86/drivers/modesetting/driver.c b/xserver/hw/xfree86/drivers/modesetting/driver.c index 03807a82f..bdb848bd1 100644 --- a/xserver/hw/xfree86/drivers/modesetting/driver.c +++ b/xserver/hw/xfree86/drivers/modesetting/driver.c @@ -136,6 +136,7 @@ static const OptionInfoRec Options[] = { {OPTION_ACCEL_METHOD, "AccelMethod", OPTV_STRING, {0}, FALSE}, {OPTION_PAGEFLIP, "PageFlip", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE}, + {OPTION_DOUBLE_SHADOW, "DoubleShadow", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; @@ -221,14 +222,26 @@ open_hw(const char *dev) } static int -check_outputs(int fd) +check_outputs(int fd, int *count) { drmModeResPtr res = drmModeGetResources(fd); int ret; if (!res) return FALSE; + + if (count) + *count = res->count_connectors; + ret = res->count_connectors > 0; +#if defined DRM_CAP_PRIME && GLAMOR_HAS_GBM_LINEAR + if (ret == FALSE) { + uint64_t value = 0; + if (drmGetCap(fd, DRM_CAP_PRIME, &value) == 0 && + (value & DRM_PRIME_CAP_EXPORT)) + ret = TRUE; + } +#endif drmModeFreeResources(res); return ret; } @@ -243,13 +256,13 @@ probe_hw(const char *dev, struct xf86_platform_device *platform_dev) fd = xf86_platform_device_odev_attributes(platform_dev)->fd; if (fd == -1) return FALSE; - return check_outputs(fd); + return check_outputs(fd, NULL); } #endif fd = open_hw(dev); if (fd != -1) { - int ret = check_outputs(fd); + int ret = check_outputs(fd, NULL); close(fd); return ret; @@ -292,7 +305,7 @@ probe_hw_pci(const char *dev, struct pci_device *pdev) devid = ms_DRICreatePCIBusID(pdev); if (id && devid && !strcmp(id, devid)) - ret = check_outputs(fd); + ret = check_outputs(fd, NULL); close(fd); free(id); @@ -545,20 +558,14 @@ dispatch_dirty(ScreenPtr pScreen) } static void -dispatch_dirty_crtc(ScrnInfoPtr scrn, xf86CrtcPtr crtc) +dispatch_dirty_pixmap(ScrnInfoPtr scrn, xf86CrtcPtr crtc, PixmapPtr ppix) { modesettingPtr ms = modesettingPTR(scrn); - PixmapPtr pixmap = crtc->randr_crtc->scanout_pixmap; - msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, pixmap); - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - DamagePtr damage = drmmode_crtc->slave_damage; + msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix); + DamagePtr damage = ppriv->slave_damage; int fb_id = ppriv->fb_id; - int ret; - ret = dispatch_dirty_region(scrn, pixmap, damage, fb_id); - if (ret) { - - } + dispatch_dirty_region(scrn, ppix, damage, fb_id); } static void @@ -570,55 +577,105 @@ dispatch_slave_dirty(ScreenPtr pScreen) for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - if (!crtc->randr_crtc) - continue; - if (!crtc->randr_crtc->scanout_pixmap) + if (!drmmode_crtc) continue; - dispatch_dirty_crtc(scrn, crtc); + if (drmmode_crtc->prime_pixmap) + dispatch_dirty_pixmap(scrn, crtc, drmmode_crtc->prime_pixmap); + if (drmmode_crtc->prime_pixmap_back) + dispatch_dirty_pixmap(scrn, crtc, drmmode_crtc->prime_pixmap_back); } } static void -redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty) +redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty, int *timeout) { + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen)); + RegionRec pixregion; - RegionRec pixregion; + PixmapRegionInit(&pixregion, dirty->slave_dst); + DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion); + PixmapSyncDirtyHelper(dirty); - PixmapRegionInit(&pixregion, dirty->slave_dst); - DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion); - PixmapSyncDirtyHelper(dirty); + if (!screen->isGPU) { +#ifdef GLAMOR + /* + * When copying from the master framebuffer to the shared pixmap, + * we must ensure the copy is complete before the slave starts a + * copy to its own framebuffer (some slaves scanout directly from + * the shared pixmap, but not all). + */ + if (ms->drmmode.glamor) + glamor_finish(screen); +#endif + /* Ensure the slave processes the damage immediately */ + if (timeout) + *timeout = 0; + } - DamageRegionProcessPending(&dirty->slave_dst->drawable); - RegionUninit(&pixregion); + DamageRegionProcessPending(&dirty->slave_dst->drawable); + RegionUninit(&pixregion); } static void -ms_dirty_update(ScreenPtr screen) +ms_dirty_update(ScreenPtr screen, int *timeout) { - RegionPtr region; - PixmapDirtyUpdatePtr ent; + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen)); - if (xorg_list_is_empty(&screen->pixmap_dirty_list)) - return; + RegionPtr region; + PixmapDirtyUpdatePtr ent; - xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) { - region = DamageRegion(ent->damage); - if (RegionNotEmpty(region)) { - redisplay_dirty(screen, ent); - DamageEmpty(ent->damage); - } + if (xorg_list_is_empty(&screen->pixmap_dirty_list)) + return; + + xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) { + region = DamageRegion(ent->damage); + if (RegionNotEmpty(region)) { + msPixmapPrivPtr ppriv = + msGetPixmapPriv(&ms->drmmode, ent->slave_dst); + + if (ppriv->notify_on_damage) { + ppriv->notify_on_damage = FALSE; + + ent->slave_dst->drawable.pScreen-> + SharedPixmapNotifyDamage(ent->slave_dst); + } + + /* Requested manual updating */ + if (ppriv->defer_dirty_update) + continue; + + redisplay_dirty(screen, ent, timeout); + DamageEmpty(ent->damage); } + } +} + +static PixmapDirtyUpdatePtr +ms_dirty_get_ent(ScreenPtr screen, PixmapPtr slave_dst) +{ + PixmapDirtyUpdatePtr ent; + + if (xorg_list_is_empty(&screen->pixmap_dirty_list)) + return NULL; + + xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) { + if (ent->slave_dst == slave_dst) + return ent; + } + + return NULL; } static void -msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) +msBlockHandler(ScreenPtr pScreen, void *timeout) { modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); pScreen->BlockHandler = ms->BlockHandler; - pScreen->BlockHandler(pScreen, pTimeout, pReadmask); + pScreen->BlockHandler(pScreen, timeout); ms->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = msBlockHandler; if (pScreen->isGPU && !ms->drmmode.reverse_prime_offload_mode) @@ -626,7 +683,18 @@ msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) else if (ms->dirty_enabled) dispatch_dirty(pScreen); - ms_dirty_update(pScreen); + ms_dirty_update(pScreen, timeout); +} + +static void +msBlockHandler_oneshot(ScreenPtr pScreen, void *pTimeout) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + modesettingPtr ms = modesettingPTR(pScrn); + + msBlockHandler(pScreen, pTimeout); + + drmmode_set_desired_modes(pScrn, &ms->drmmode, TRUE); } static void @@ -708,6 +776,35 @@ try_enable_glamor(ScrnInfoPtr pScrn) #endif } +static Bool +msShouldDoubleShadow(ScrnInfoPtr pScrn, modesettingPtr ms) +{ + Bool ret = FALSE, asked; + int from; + drmVersionPtr v = drmGetVersion(ms->fd); + + if (!ms->drmmode.shadow_enable) + return FALSE; + + if (!strcmp(v->name, "mgag200") || + !strcmp(v->name, "ast")) /* XXX || rn50 */ + ret = TRUE; + + drmFreeVersion(v); + + asked = xf86GetOptValBool(ms->drmmode.Options, OPTION_DOUBLE_SHADOW, &ret); + + if (asked) + from = X_CONFIG; + else + from = X_INFO; + + xf86DrvMsg(pScrn->scrnIndex, from, + "Double-buffered shadow updates: %s\n", ret ? "on" : "off"); + + return ret; +} + #ifndef DRM_CAP_CURSOR_WIDTH #define DRM_CAP_CURSOR_WIDTH 0x8 #endif @@ -758,7 +855,7 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn) if (pEnt->location.type == BUS_PCI) { ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index); if (ms->PciInfo) { - BusID = malloc(64); + BusID = XNFalloc(64); sprintf(BusID, "PCI:%d:%d:%d", #if XSERVER_LIBPCIACCESS ((ms->PciInfo->domain << 8) | ms->PciInfo->bus), @@ -771,6 +868,7 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn) ); } ms->fd = drmOpen(NULL, BusID); + free(BusID); } else { const char *devicename; @@ -793,7 +891,7 @@ PreInit(ScrnInfoPtr pScrn, int flags) EntityInfoPtr pEnt; uint64_t value = 0; int ret; - int bppflags; + int bppflags, connector_count; int defaultdepth, defaultbpp; if (pScrn->numEntities != 1) @@ -830,6 +928,9 @@ PreInit(ScrnInfoPtr pScrn, int flags) return FALSE; ms->drmmode.fd = ms->fd; + if (!check_outputs(ms->fd, &connector_count)) + return FALSE; + drmmode_get_default_bpp(pScrn, &ms->drmmode, &defaultdepth, &defaultbpp); if (defaultdepth == 24 && defaultbpp == 24) { ms->drmmode.force_24_32 = TRUE; @@ -888,10 +989,7 @@ PreInit(ScrnInfoPtr pScrn, int flags) try_enable_glamor(pScrn); - if (ms->drmmode.glamor) { - ms->drmmode.pageflip = - xf86ReturnOptValBool(ms->drmmode.Options, OPTION_PAGEFLIP, TRUE); - } else { + if (!ms->drmmode.glamor) { Bool prefer_shadow = TRUE; if (ms->drmmode.force_24_32) { @@ -914,14 +1012,17 @@ PreInit(ScrnInfoPtr pScrn, int flags) ms->drmmode.force_24_32 ? "FORCE" : ms->drmmode.shadow_enable ? "YES" : "NO"); - ms->drmmode.pageflip = FALSE; + ms->drmmode.shadow_enable2 = msShouldDoubleShadow(pScrn, ms); } + ms->drmmode.pageflip = + xf86ReturnOptValBool(ms->drmmode.Options, OPTION_PAGEFLIP, TRUE); + pScrn->capabilities = 0; #ifdef DRM_CAP_PRIME ret = drmGetCap(ms->fd, DRM_CAP_PRIME, &value); if (ret == 0) { - if (value & DRM_PRIME_CAP_IMPORT) { + if (connector_count && (value & DRM_PRIME_CAP_IMPORT)) { pScrn->capabilities |= RR_Capability_SinkOutput; if (ms->drmmode.glamor) pScrn->capabilities |= RR_Capability_SinkOffload; @@ -949,7 +1050,7 @@ PreInit(ScrnInfoPtr pScrn, int flags) } } - if (pScrn->modes == NULL) { + if (!(pScrn->is_gpu && connector_count == 0) && pScrn->modes == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n"); return FALSE; } @@ -989,28 +1090,248 @@ msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode, return ((uint8_t *) ms->drmmode.front_bo.dumb->ptr + row * stride + offset); } +/* somewhat arbitrary tile size, in pixels */ +#define TILE 16 + +static int +msUpdateIntersect(modesettingPtr ms, shadowBufPtr pBuf, BoxPtr box, + xRectangle *prect) +{ + int i, dirty = 0, stride = pBuf->pPixmap->devKind, cpp = ms->drmmode.cpp; + int width = (box->x2 - box->x1) * cpp; + unsigned char *old, *new; + + old = ms->drmmode.shadow_fb2; + old += (box->y1 * stride) + (box->x1 * cpp); + new = ms->drmmode.shadow_fb; + new += (box->y1 * stride) + (box->x1 * cpp); + + for (i = box->y2 - box->y1 - 1; i >= 0; i--) { + unsigned char *o = old + i * stride, + *n = new + i * stride; + if (memcmp(o, n, width) != 0) { + dirty = 1; + memcpy(o, n, width); + } + } + + if (dirty) { + prect->x = box->x1; + prect->y = box->y1; + prect->width = box->x2 - box->x1; + prect->height = box->y2 - box->y1; + } + + return dirty; +} + static void msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) { - shadowUpdatePacked(pScreen, pBuf); + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + modesettingPtr ms = modesettingPTR(pScrn); + Bool use_ms_shadow = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; + + if (ms->drmmode.shadow_enable2 && ms->drmmode.shadow_fb2) do { + RegionPtr damage = DamageRegion(pBuf->pDamage), tiles; + BoxPtr extents = RegionExtents(damage); + xRectangle *prect; + int nrects; + int i, j, tx1, tx2, ty1, ty2; + + tx1 = extents->x1 / TILE; + tx2 = (extents->x2 + TILE - 1) / TILE; + ty1 = extents->y1 / TILE; + ty2 = (extents->y2 + TILE - 1) / TILE; + + nrects = (tx2 - tx1) * (ty2 - ty1); + if (!(prect = calloc(nrects, sizeof(xRectangle)))) + break; + + nrects = 0; + for (j = ty2 - 1; j >= ty1; j--) { + for (i = tx2 - 1; i >= tx1; i--) { + BoxRec box; + + box.x1 = max(i * TILE, extents->x1); + box.y1 = max(j * TILE, extents->y1); + box.x2 = min((i+1) * TILE, extents->x2); + box.y2 = min((j+1) * TILE, extents->y2); + + if (RegionContainsRect(damage, &box) != rgnOUT) { + if (msUpdateIntersect(ms, pBuf, &box, prect + nrects)) { + nrects++; + } + } + } + } + + tiles = RegionFromRects(nrects, prect, CT_NONE); + RegionIntersect(damage, damage, tiles); + RegionDestroy(tiles); + free(prect); + } while (0); + + if (use_ms_shadow) + ms_shadowUpdate32to24(pScreen, pBuf); + else + shadowUpdatePacked(pScreen, pBuf); +} + +static Bool +msEnableSharedPixmapFlipping(RRCrtcPtr crtc, PixmapPtr front, PixmapPtr back) +{ + ScreenPtr screen = crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + EntityInfoPtr pEnt = ms->pEnt; + xf86CrtcPtr xf86Crtc = crtc->devPrivate; + + if (!xf86Crtc) + return FALSE; + + /* Not supported if we can't flip */ + if (!ms->drmmode.pageflip) + return FALSE; + + /* Not currently supported with reverse PRIME */ + if (ms->drmmode.reverse_prime_offload_mode) + return FALSE; + +#if XSERVER_PLATFORM_BUS + if (pEnt->location.type == BUS_PLATFORM) { + char *syspath = + xf86_platform_device_odev_attributes(pEnt->location.id.plat)-> + syspath; + + /* Not supported for devices using USB transport due to misbehaved + * vblank events */ + if (syspath && strstr(syspath, "usb")) + return FALSE; + + /* EVDI uses USB transport but is platform device, not usb. + * Blacklist it explicitly */ + if (syspath && strstr(syspath, "evdi")) + return FALSE; + } +#endif + + return drmmode_EnableSharedPixmapFlipping(xf86Crtc, &ms->drmmode, + front, back); +} + +static void +msDisableSharedPixmapFlipping(RRCrtcPtr crtc) +{ + ScreenPtr screen = crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + xf86CrtcPtr xf86Crtc = crtc->devPrivate; + + if (xf86Crtc) + drmmode_DisableSharedPixmapFlipping(xf86Crtc, &ms->drmmode); +} + +static Bool +msStartFlippingPixmapTracking(RRCrtcPtr crtc, PixmapPtr src, + PixmapPtr slave_dst1, PixmapPtr slave_dst2, + int x, int y, int dst_x, int dst_y, + Rotation rotation) +{ + ScreenPtr pScreen = src->drawable.pScreen; + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); + + msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1), + ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2); + + if (!PixmapStartDirtyTracking(src, slave_dst1, x, y, + dst_x, dst_y, rotation)) { + return FALSE; + } + + if (!PixmapStartDirtyTracking(src, slave_dst2, x, y, + dst_x, dst_y, rotation)) { + PixmapStopDirtyTracking(src, slave_dst1); + return FALSE; + } + + ppriv1->slave_src = src; + ppriv2->slave_src = src; + + ppriv1->dirty = ms_dirty_get_ent(pScreen, slave_dst1); + ppriv2->dirty = ms_dirty_get_ent(pScreen, slave_dst2); + + ppriv1->defer_dirty_update = TRUE; + ppriv2->defer_dirty_update = TRUE; + + return TRUE; +} + +static Bool +msPresentSharedPixmap(PixmapPtr slave_dst) +{ + ScreenPtr pScreen = slave_dst->drawable.pScreen; + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); + + msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, slave_dst); + + RegionPtr region = DamageRegion(ppriv->dirty->damage); + + if (RegionNotEmpty(region)) { + redisplay_dirty(ppriv->slave_src->drawable.pScreen, ppriv->dirty, NULL); + DamageEmpty(ppriv->dirty->damage); + + return TRUE; + } + + return FALSE; +} + +static Bool +msStopFlippingPixmapTracking(PixmapPtr src, + PixmapPtr slave_dst1, PixmapPtr slave_dst2) +{ + ScreenPtr pScreen = src->drawable.pScreen; + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); + + msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1), + ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2); + + Bool ret = TRUE; + + ret &= PixmapStopDirtyTracking(src, slave_dst1); + ret &= PixmapStopDirtyTracking(src, slave_dst2); + + if (ret) { + ppriv1->slave_src = NULL; + ppriv2->slave_src = NULL; + + ppriv1->dirty = NULL; + ppriv2->dirty = NULL; + + ppriv1->defer_dirty_update = FALSE; + ppriv2->defer_dirty_update = FALSE; + } + + return ret; } static Bool CreateScreenResources(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); modesettingPtr ms = modesettingPTR(pScrn); PixmapPtr rootPixmap; Bool ret; void *pixels = NULL; int err; - Bool use_ms_shadow = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; pScreen->CreateScreenResources = ms->createScreenResources; ret = pScreen->CreateScreenResources(pScreen); pScreen->CreateScreenResources = CreateScreenResources; - if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) + if (!drmmode_set_desired_modes(pScrn, &ms->drmmode, pScrn->is_gpu)) return FALSE; if (!drmmode_glamor_handle_new_screen_pixmap(&ms->drmmode)) @@ -1032,13 +1353,18 @@ CreateScreenResources(ScreenPtr pScreen) if (ms->drmmode.shadow_enable) pixels = ms->drmmode.shadow_fb; + if (ms->drmmode.shadow_enable2) { + ms->drmmode.shadow_fb2 = calloc(1, pScrn->displayWidth * pScrn->virtualY * ((pScrn->bitsPerPixel + 7) >> 3)); + if (!ms->drmmode.shadow_fb2) + ms->drmmode.shadow_enable2 = FALSE; + } + if (!pScreen->ModifyPixmapHeader(rootPixmap, -1, -1, -1, -1, -1, pixels)) FatalError("Couldn't adjust screen pixmap\n"); if (ms->drmmode.shadow_enable) { - if (!shadowAdd(pScreen, rootPixmap, - use_ms_shadow ? ms_shadowUpdate32to24 : msUpdatePacked, - msShadowWindow, 0, 0)) + if (!shadowAdd(pScreen, rootPixmap, msUpdatePacked, msShadowWindow, + 0, 0)) return FALSE; } @@ -1059,6 +1385,12 @@ CreateScreenResources(ScreenPtr pScreen) return FALSE; } } + + pScrPriv->rrEnableSharedPixmapFlipping = msEnableSharedPixmapFlipping; + pScrPriv->rrDisableSharedPixmapFlipping = msDisableSharedPixmapFlipping; + + pScrPriv->rrStartFlippingPixmapTracking = msStartFlippingPixmapTracking; + return ret; } @@ -1078,7 +1410,8 @@ msSharePixmapBacking(PixmapPtr ppix, ScreenPtr screen, void **handle) int ret; CARD16 stride; CARD32 size; - ret = glamor_fd_from_pixmap(ppix->drawable.pScreen, ppix, &stride, &size); + ret = glamor_shareable_fd_from_pixmap(ppix->drawable.pScreen, ppix, + &stride, &size); if (ret == -1) return FALSE; @@ -1098,6 +1431,10 @@ msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle) Bool ret; int ihandle = (int) (long) fd_handle; + if (ihandle == -1) + if (!ms->drmmode.reverse_prime_offload_mode) + return drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, 0, 0); + if (ms->drmmode.reverse_prime_offload_mode) { ret = glamor_back_pixmap_from_fd(ppix, ihandle, ppix->drawable.width, @@ -1117,6 +1454,53 @@ msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle) #endif } +static Bool +msRequestSharedPixmapNotifyDamage(PixmapPtr ppix) +{ + ScreenPtr screen = ppix->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix); + + ppriv->notify_on_damage = TRUE; + + return TRUE; +} + +static Bool +msSharedPixmapNotifyDamage(PixmapPtr ppix) +{ + Bool ret = FALSE; + int c; + + ScreenPtr screen = ppix->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + + msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix); + + if (!ppriv->wait_for_damage) + return ret; + ppriv->wait_for_damage = FALSE; + + for (c = 0; c < xf86_config->num_crtc; c++) { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + if (!drmmode_crtc) + continue; + if (!(drmmode_crtc->prime_pixmap && drmmode_crtc->prime_pixmap_back)) + continue; + + // Received damage on master screen pixmap, schedule present on vblank + ret |= drmmode_SharedPixmapPresentOnVBlank(ppix, crtc, &ms->drmmode); + } + + return ret; +} + static Bool SetMaster(ScrnInfoPtr pScrn) { @@ -1137,6 +1521,25 @@ SetMaster(ScrnInfoPtr pScrn) return ret == 0; } +/* When the root window is created, initialize the screen contents from + * console if -background none was specified on the command line + */ +static Bool +CreateWindow_oneshot(WindowPtr pWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + modesettingPtr ms = modesettingPTR(pScrn); + Bool ret; + + pScreen->CreateWindow = ms->CreateWindow; + ret = pScreen->CreateWindow(pWin); + + if (ret) + drmmode_copy_fb(pScrn, &ms->drmmode); + return ret; +} + static Bool ScreenInit(ScreenPtr pScreen, int argc, char **argv) { @@ -1245,18 +1648,30 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) * later memory should be bound when allocating, e.g rotate_mem */ pScrn->vtSema = TRUE; + if (serverGeneration == 1 && bgNoneRoot && ms->drmmode.glamor) { + ms->CreateWindow = pScreen->CreateWindow; + pScreen->CreateWindow = CreateWindow_oneshot; + } + pScreen->SaveScreen = xf86SaveScreen; ms->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = CloseScreen; ms->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = msBlockHandler; + pScreen->BlockHandler = msBlockHandler_oneshot; pScreen->SharePixmapBacking = msSharePixmapBacking; pScreen->SetSharedPixmapBacking = msSetSharedPixmapBacking; pScreen->StartPixmapTracking = PixmapStartDirtyTracking; pScreen->StopPixmapTracking = PixmapStopDirtyTracking; + pScreen->SharedPixmapNotifyDamage = msSharedPixmapNotifyDamage; + pScreen->RequestSharedPixmapNotifyDamage = + msRequestSharedPixmapNotifyDamage; + + pScreen->PresentSharedPixmap = msPresentSharedPixmap; + pScreen->StopFlippingPixmapTracking = msStopFlippingPixmapTracking; + if (!xf86CrtcScreenInit(pScreen)) return FALSE; @@ -1298,13 +1713,28 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize the Present extension.\n"); } - /* enable reverse prime if we are a GPU screen, and accelerated */ - if (pScreen->isGPU) + /* enable reverse prime if we are a GPU screen, and accelerated, and not + * i915. i915 is happy scanning out from sysmem. */ + if (pScreen->isGPU) { + drmVersionPtr version; + + /* enable if we are an accelerated GPU screen */ ms->drmmode.reverse_prime_offload_mode = TRUE; + + /* disable if we detect i915 */ + if ((version = drmGetVersion(ms->drmmode.fd))) { + if (!strncmp("i915", version->name, version->name_len)) { + ms->drmmode.reverse_prime_offload_mode = FALSE; + } + drmFreeVersion(version); + } + } } #endif - return EnterVT(pScrn); + pScrn->vtSema = TRUE; + + return TRUE; } static void @@ -1351,7 +1781,7 @@ EnterVT(ScrnInfoPtr pScrn) SetMaster(pScrn); - if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) + if (!drmmode_set_desired_modes(pScrn, &ms->drmmode, TRUE)) return FALSE; return TRUE; @@ -1391,6 +1821,8 @@ CloseScreen(ScreenPtr pScreen) shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen)); free(ms->drmmode.shadow_fb); ms->drmmode.shadow_fb = NULL; + free(ms->drmmode.shadow_fb2); + ms->drmmode.shadow_fb2 = NULL; } drmmode_uevent_fini(pScrn, &ms->drmmode); diff --git a/xserver/hw/xfree86/drivers/modesetting/driver.h b/xserver/hw/xfree86/drivers/modesetting/driver.h index 5e1c5d988..eee96e50f 100644 --- a/xserver/hw/xfree86/drivers/modesetting/driver.h +++ b/xserver/hw/xfree86/drivers/modesetting/driver.h @@ -52,6 +52,7 @@ typedef enum { OPTION_ACCEL_METHOD, OPTION_PAGEFLIP, OPTION_ZAPHOD_HEADS, + OPTION_DOUBLE_SHADOW, } modesettingOpts; typedef struct @@ -97,7 +98,7 @@ typedef struct _modesettingRec { Bool noAccel; CloseScreenProcPtr CloseScreen; - + CreateWindowProcPtr CreateWindow; unsigned int SaveGeneration; CreateScreenResourcesProcPtr createScreenResources; @@ -136,8 +137,6 @@ void ms_drm_abort_seq(ScrnInfoPtr scrn, uint32_t seq); Bool ms_crtc_on(xf86CrtcPtr crtc); xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw); -xf86CrtcPtr ms_covering_crtc(ScrnInfoPtr scrn, BoxPtr box, - xf86CrtcPtr desired, BoxPtr crtc_box_ret); int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc); @@ -152,3 +151,24 @@ Bool ms_vblank_screen_init(ScreenPtr screen); void ms_vblank_close_screen(ScreenPtr screen); Bool ms_present_screen_init(ScreenPtr screen); + +#ifdef GLAMOR + +typedef void (*ms_pageflip_handler_proc)(modesettingPtr ms, + uint64_t frame, + uint64_t usec, + void *data); + +typedef void (*ms_pageflip_abort_proc)(modesettingPtr ms, void *data); + +Bool ms_do_pageflip(ScreenPtr screen, + PixmapPtr new_front, + void *event, + int ref_crtc_vblank_pipe, + Bool async, + ms_pageflip_handler_proc pageflip_handler, + ms_pageflip_abort_proc pageflip_abort); + +#endif + +int ms_flush_drm_events(ScreenPtr screen); diff --git a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c index 8766d82b4..7981665a3 100644 --- a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -51,7 +51,9 @@ #include "driver.h" static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height); - +static PixmapPtr drmmode_create_pixmap_header(ScreenPtr pScreen, int width, int height, + int depth, int bitsPerPixel, int devKind, + void *pPixData); static Bool drmmode_zaphod_string_matches(ScrnInfoPtr scrn, const char *s, char *output_name) { @@ -176,42 +178,18 @@ drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo, return bo->dumb != NULL; } -Bool -drmmode_bo_for_pixmap(drmmode_ptr drmmode, drmmode_bo *bo, PixmapPtr pixmap) -{ -#ifdef GLAMOR - ScreenPtr screen = xf86ScrnToScreen(drmmode->scrn); - CARD16 pitch; - CARD32 size; - int fd; - -#ifdef GLAMOR_HAS_GBM - if (drmmode->glamor) { - bo->gbm = glamor_gbm_bo_from_pixmap(screen, pixmap); - bo->dumb = NULL; - return bo->gbm != NULL; - } -#endif - - fd = glamor_fd_from_pixmap(screen, pixmap, &pitch, &size); - if (fd < 0) { - xf86DrvMsg(drmmode->scrn->scrnIndex, X_ERROR, - "Failed to get fd for flip to new front.\n"); - return FALSE; - } - bo->dumb = dumb_get_bo_from_fd(drmmode->fd, fd, pitch, size); - close(fd); -#endif - - return bo->dumb != NULL; -} - Bool drmmode_SetSlaveBO(PixmapPtr ppix, drmmode_ptr drmmode, int fd_handle, int pitch, int size) { msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); + if (fd_handle == -1) { + dumb_bo_destroy(drmmode->fd, ppriv->backing_bo); + ppriv->backing_bo = NULL; + return TRUE; + } + ppriv->backing_bo = dumb_get_bo_from_fd(drmmode->fd, fd_handle, pitch, size); if (!ppriv->backing_bo) @@ -221,6 +199,239 @@ drmmode_SetSlaveBO(PixmapPtr ppix, return TRUE; } +static Bool +drmmode_SharedPixmapPresent(PixmapPtr ppix, xf86CrtcPtr crtc, + drmmode_ptr drmmode) +{ + ScreenPtr master = crtc->randr_crtc->pScreen->current_master; + + if (master->PresentSharedPixmap(ppix)) { + /* Success, queue flip to back target */ + if (drmmode_SharedPixmapFlip(ppix, crtc, drmmode)) + return TRUE; + + xf86DrvMsg(drmmode->scrn->scrnIndex, X_WARNING, + "drmmode_SharedPixmapFlip() failed, trying again next vblank\n"); + + return drmmode_SharedPixmapPresentOnVBlank(ppix, crtc, drmmode); + } + + /* Failed to present, try again on next vblank after damage */ + if (master->RequestSharedPixmapNotifyDamage) { + msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); + + /* Set flag first in case we are immediately notified */ + ppriv->wait_for_damage = TRUE; + + if (master->RequestSharedPixmapNotifyDamage(ppix)) + return TRUE; + else + ppriv->wait_for_damage = FALSE; + } + + /* Damage notification not available, just try again on vblank */ + return drmmode_SharedPixmapPresentOnVBlank(ppix, crtc, drmmode); +} + +struct vblank_event_args { + PixmapPtr frontTarget; + PixmapPtr backTarget; + xf86CrtcPtr crtc; + drmmode_ptr drmmode; + Bool flip; +}; +static void +drmmode_SharedPixmapVBlankEventHandler(uint64_t frame, uint64_t usec, + void *data) +{ + struct vblank_event_args *args = data; + + drmmode_crtc_private_ptr drmmode_crtc = args->crtc->driver_private; + + if (args->flip) { + /* frontTarget is being displayed, update crtc to reflect */ + drmmode_crtc->prime_pixmap = args->frontTarget; + drmmode_crtc->prime_pixmap_back = args->backTarget; + + /* Safe to present on backTarget, no longer displayed */ + drmmode_SharedPixmapPresent(args->backTarget, args->crtc, args->drmmode); + } else { + /* backTarget is still being displayed, present on frontTarget */ + drmmode_SharedPixmapPresent(args->frontTarget, args->crtc, args->drmmode); + } + + free(args); +} + +static void +drmmode_SharedPixmapVBlankEventAbort(void *data) +{ + struct vblank_event_args *args = data; + + msGetPixmapPriv(args->drmmode, args->frontTarget)->flip_seq = 0; + + free(args); +} + +Bool +drmmode_SharedPixmapPresentOnVBlank(PixmapPtr ppix, xf86CrtcPtr crtc, + drmmode_ptr drmmode) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); + + drmVBlank vbl; + struct vblank_event_args *event_args; + + if (ppix == drmmode_crtc->prime_pixmap) + return FALSE; /* Already flipped to this pixmap */ + if (ppix != drmmode_crtc->prime_pixmap_back) + return FALSE; /* Pixmap is not a scanout pixmap for CRTC */ + + event_args = calloc(1, sizeof(*event_args)); + if (!event_args) + return FALSE; + + event_args->frontTarget = ppix; + event_args->backTarget = drmmode_crtc->prime_pixmap; + event_args->crtc = crtc; + event_args->drmmode = drmmode; + event_args->flip = FALSE; + + ppriv->flip_seq = + ms_drm_queue_alloc(crtc, event_args, + drmmode_SharedPixmapVBlankEventHandler, + drmmode_SharedPixmapVBlankEventAbort); + + vbl.request.type = + DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe; + vbl.request.sequence = 1; + vbl.request.signal = (unsigned long) ppriv->flip_seq; + + return drmWaitVBlank(drmmode->fd, &vbl) >= 0; +} + +Bool +drmmode_SharedPixmapFlip(PixmapPtr frontTarget, xf86CrtcPtr crtc, + drmmode_ptr drmmode) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + msPixmapPrivPtr ppriv_front = msGetPixmapPriv(drmmode, frontTarget); + + struct vblank_event_args *event_args; + + event_args = calloc(1, sizeof(*event_args)); + if (!event_args) + return FALSE; + + event_args->frontTarget = frontTarget; + event_args->backTarget = drmmode_crtc->prime_pixmap; + event_args->crtc = crtc; + event_args->drmmode = drmmode; + event_args->flip = TRUE; + + ppriv_front->flip_seq = + ms_drm_queue_alloc(crtc, event_args, + drmmode_SharedPixmapVBlankEventHandler, + drmmode_SharedPixmapVBlankEventAbort); + + if (drmModePageFlip(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + ppriv_front->fb_id, DRM_MODE_PAGE_FLIP_EVENT, + (void *)(intptr_t) ppriv_front->flip_seq) < 0) { + ms_drm_abort_seq(crtc->scrn, ppriv_front->flip_seq); + return FALSE; + } + + return TRUE; +} + +static Bool +drmmode_InitSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + if (!drmmode_crtc->enable_flipping) + return FALSE; + + if (drmmode_crtc->flipping_active) + return TRUE; + + drmmode_crtc->flipping_active = + drmmode_SharedPixmapPresent(drmmode_crtc->prime_pixmap_back, + crtc, drmmode); + + return drmmode_crtc->flipping_active; +} + +static void +drmmode_FiniSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode) +{ + uint32_t seq; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + if (!drmmode_crtc->flipping_active) + return; + + drmmode_crtc->flipping_active = FALSE; + + /* Abort page flip event handler on prime_pixmap */ + seq = msGetPixmapPriv(drmmode, drmmode_crtc->prime_pixmap)->flip_seq; + if (seq) + ms_drm_abort_seq(crtc->scrn, seq); + + /* Abort page flip event handler on prime_pixmap_back */ + seq = msGetPixmapPriv(drmmode, + drmmode_crtc->prime_pixmap_back)->flip_seq; + if (seq) + ms_drm_abort_seq(crtc->scrn, seq); +} + +static Bool drmmode_set_target_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix, + PixmapPtr *target); + +Bool +drmmode_EnableSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode, + PixmapPtr front, PixmapPtr back) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + drmmode_crtc->enable_flipping = TRUE; + + /* Set front scanout pixmap */ + drmmode_crtc->enable_flipping &= + drmmode_set_target_scanout_pixmap(crtc, front, + &drmmode_crtc->prime_pixmap); + if (!drmmode_crtc->enable_flipping) + return FALSE; + + /* Set back scanout pixmap */ + drmmode_crtc->enable_flipping &= + drmmode_set_target_scanout_pixmap(crtc, back, + &drmmode_crtc->prime_pixmap_back); + if (!drmmode_crtc->enable_flipping) { + drmmode_set_target_scanout_pixmap(crtc, NULL, + &drmmode_crtc->prime_pixmap); + return FALSE; + } + + return TRUE; +} + +void +drmmode_DisableSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + drmmode_crtc->enable_flipping = FALSE; + + drmmode_FiniSharedPixmapFlipping(crtc, drmmode); + + drmmode_set_target_scanout_pixmap(crtc, NULL, &drmmode_crtc->prime_pixmap); + + drmmode_set_target_scanout_pixmap(crtc, NULL, + &drmmode_crtc->prime_pixmap_back); +} + static void drmmode_ConvertFromKMode(ScrnInfoPtr scrn, drmModeModeInfo * kmode, DisplayModePtr mode) @@ -285,50 +496,106 @@ drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode) drmmode_crtc->dpms_mode = mode; } -#if 0 +#ifdef GLAMOR static PixmapPtr -create_pixmap_for_fbcon(drmmode_ptr drmmode, ScrnInfoPtr pScrn, int crtc_id) +create_pixmap_for_fbcon(drmmode_ptr drmmode, ScrnInfoPtr pScrn, int fbcon_id) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - drmmode_crtc_private_ptr drmmode_crtc; - ScreenPtr pScreen = pScrn->pScreen; - PixmapPtr pixmap; - struct radeon_bo *bo; + PixmapPtr pixmap = drmmode->fbcon_pixmap; drmModeFBPtr fbcon; struct drm_gem_flink flink; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); + Bool ret; - drmmode_crtc = xf86_config->crtc[crtc_id]->driver_private; + if (pixmap) + return pixmap; - fbcon = drmModeGetFB(drmmode->fd, drmmode_crtc->mode_crtc->buffer_id); + fbcon = drmModeGetFB(drmmode->fd, fbcon_id); if (fbcon == NULL) return NULL; + if (fbcon->depth != pScrn->depth || + fbcon->width != pScrn->virtualX || + fbcon->height != pScrn->virtualY) + goto out_free_fb; + flink.handle = fbcon->handle; if (ioctl(drmmode->fd, DRM_IOCTL_GEM_FLINK, &flink) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't flink fbcon handle\n"); - return NULL; + goto out_free_fb; } - bo = radeon_bo_open(drmmode->bufmgr, flink.name, 0, 0, 0, 0); - if (bo == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Couldn't allocate bo for fbcon handle\n"); - return NULL; - } - - pixmap = drmmode_create_bo_pixmap(pScreen, fbcon->width, fbcon->height, - fbcon->depth, fbcon->bpp, - fbcon->pitch, bo); + pixmap = drmmode_create_pixmap_header(pScreen, fbcon->width, + fbcon->height, fbcon->depth, + fbcon->bpp, fbcon->pitch, NULL); if (!pixmap) - return NULL; + goto out_free_fb; - radeon_bo_unref(bo); + ret = glamor_egl_create_textured_pixmap(pixmap, fbcon->handle, fbcon->pitch); + if (!ret) { + FreePixmap(pixmap); + pixmap = NULL; + } + + drmmode->fbcon_pixmap = pixmap; +out_free_fb: drmModeFreeFB(fbcon); return pixmap; } - #endif +void +drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) +{ +#ifdef GLAMOR + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); + PixmapPtr src, dst; + int fbcon_id = 0; + GCPtr gc; + int i; + + for (i = 0; i < xf86_config->num_crtc; i++) { + drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[i]->driver_private; + if (drmmode_crtc->mode_crtc->buffer_id) + fbcon_id = drmmode_crtc->mode_crtc->buffer_id; + } + + if (!fbcon_id) + return; + + if (fbcon_id == drmmode->fb_id) { + /* in some rare case there might be no fbcon and we might already + * be the one with the current fb to avoid a false deadlck in + * kernel ttm code just do nothing as anyway there is nothing + * to do + */ + return; + } + + src = create_pixmap_for_fbcon(drmmode, pScrn, fbcon_id); + if (!src) + return; + + dst = pScreen->GetScreenPixmap(pScreen); + + gc = GetScratchGC(pScrn->depth, pScreen); + ValidateGC(&dst->drawable, gc); + + (*gc->ops->CopyArea)(&src->drawable, &dst->drawable, gc, 0, 0, + pScrn->virtualX, pScrn->virtualY, 0, 0); + + FreeScratchGC(gc); + + glamor_finish(pScreen); + + pScreen->canDoBGNoneRoot = TRUE; + + if (drmmode->fbcon_pixmap) + pScrn->pScreen->DestroyPixmap(drmmode->fbcon_pixmap); + drmmode->fbcon_pixmap = NULL; +#endif +} + static Bool drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y) @@ -390,10 +657,10 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, drmmode_ConvertToKMode(crtc->scrn, &kmode, mode); fb_id = drmmode->fb_id; - if (crtc->randr_crtc->scanout_pixmap) { + if (drmmode_crtc->prime_pixmap) { if (!drmmode->reverse_prime_offload_mode) { msPixmapPrivPtr ppriv = - msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap); + msGetPixmapPriv(drmmode, drmmode_crtc->prime_pixmap); fb_id = ppriv->fb_id; x = 0; } else @@ -435,6 +702,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, drmmode_crtc->need_modeset = FALSE; crtc->funcs->dpms(crtc, DPMSModeOn); + if (drmmode_crtc->prime_pixmap_back) + drmmode_InitSharedPixmapFlipping(crtc, drmmode); + /* go through all the outputs and force DPMS them back on? */ for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; @@ -450,11 +720,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, } } -#if 0 - if (pScrn->pScreen && - !xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) - xf86_reload_cursors(pScrn->pScreen); -#endif done: if (!ret) { crtc->x = saved_x; @@ -491,12 +756,10 @@ drmmode_set_cursor(xf86CrtcPtr crtc) drmmode_ptr drmmode = drmmode_crtc->drmmode; uint32_t handle = drmmode_crtc->cursor_bo->handle; modesettingPtr ms = modesettingPTR(crtc->scrn); - static Bool use_set_cursor2 = TRUE; - int ret; + int ret = -EINVAL; - if (use_set_cursor2) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); - CursorPtr cursor = xf86_config->cursor; + if (!drmmode_crtc->set_cursor2_failed) { + CursorPtr cursor = xf86CurrentCursor(crtc->scrn->pScreen); ret = drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, @@ -505,11 +768,15 @@ drmmode_set_cursor(xf86CrtcPtr crtc) if (!ret) return TRUE; - use_set_cursor2 = FALSE; + /* -EINVAL can mean that an old kernel supports drmModeSetCursor but + * not drmModeSetCursor2, though it can mean other things too. */ + if (ret == -EINVAL) + drmmode_crtc->set_cursor2_failed = TRUE; } - ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, - ms->cursor_width, ms->cursor_height); + if (ret == -EINVAL) + ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + handle, ms->cursor_width, ms->cursor_height); if (ret) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); @@ -539,7 +806,6 @@ drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image) drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; int i; uint32_t *ptr; - static Bool first_time = TRUE; /* cursor should be mapped already */ ptr = (uint32_t *) (drmmode_crtc->cursor_bo->ptr); @@ -547,11 +813,11 @@ drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image) for (i = 0; i < ms->cursor_width * ms->cursor_height; i++) ptr[i] = image[i]; // cpu_to_le32(image[i]); - if (drmmode_crtc->cursor_up || first_time) { + if (drmmode_crtc->cursor_up || !drmmode_crtc->first_cursor_load_done) { Bool ret = drmmode_set_cursor(crtc); if (!drmmode_crtc->cursor_up) drmmode_hide_cursor(crtc); - first_time = FALSE; + drmmode_crtc->first_cursor_load_done = TRUE; return ret; } return TRUE; @@ -589,7 +855,8 @@ drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t * red, uint16_t * green, } static Bool -drmmode_set_scanout_pixmap_gpu(xf86CrtcPtr crtc, PixmapPtr ppix) +drmmode_set_target_scanout_pixmap_gpu(xf86CrtcPtr crtc, PixmapPtr ppix, + PixmapPtr *target) { ScreenPtr screen = xf86ScrnToScreen(crtc->scrn); PixmapPtr screenpix = screen->GetScreenPixmap(screen); @@ -598,17 +865,19 @@ drmmode_set_scanout_pixmap_gpu(xf86CrtcPtr crtc, PixmapPtr ppix) drmmode_ptr drmmode = drmmode_crtc->drmmode; int c, total_width = 0, max_height = 0, this_x = 0; - if (!ppix) { - if (crtc->randr_crtc->scanout_pixmap) { - PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, screenpix); - if (drmmode->fb_id) { - drmModeRmFB(drmmode->fd, drmmode->fb_id); - drmmode->fb_id = 0; - } + if (*target) { + PixmapStopDirtyTracking(*target, screenpix); + if (drmmode->fb_id) { + drmModeRmFB(drmmode->fd, drmmode->fb_id); + drmmode->fb_id = 0; } drmmode_crtc->prime_pixmap_x = 0; - return TRUE; + *target = NULL; } + + if (!ppix) + return TRUE; + /* iterate over all the attached crtcs to work out the bounding box */ for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr iter = xf86_config->crtc[c]; @@ -638,40 +907,44 @@ drmmode_set_scanout_pixmap_gpu(xf86CrtcPtr crtc, PixmapPtr ppix) } drmmode_crtc->prime_pixmap_x = this_x; PixmapStartDirtyTracking(ppix, screenpix, 0, 0, this_x, 0, RR_Rotate_0); + *target = ppix; return TRUE; } static Bool -drmmode_set_scanout_pixmap_cpu(xf86CrtcPtr crtc, PixmapPtr ppix) +drmmode_set_target_scanout_pixmap_cpu(xf86CrtcPtr crtc, PixmapPtr ppix, + PixmapPtr *target) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; msPixmapPrivPtr ppriv; void *ptr; - if (!ppix) { - if (crtc->randr_crtc->scanout_pixmap) { - ppriv = msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap); - drmModeRmFB(drmmode->fd, ppriv->fb_id); + if (*target) { + ppriv = msGetPixmapPriv(drmmode, *target); + drmModeRmFB(drmmode->fd, ppriv->fb_id); + ppriv->fb_id = 0; + if (ppriv->slave_damage) { + DamageUnregister(ppriv->slave_damage); + ppriv->slave_damage = NULL; } - if (drmmode_crtc->slave_damage) { - DamageUnregister(drmmode_crtc->slave_damage); - drmmode_crtc->slave_damage = NULL; - } - return TRUE; + *target = NULL; } + if (!ppix) + return TRUE; + ppriv = msGetPixmapPriv(drmmode, ppix); - if (!drmmode_crtc->slave_damage) { - drmmode_crtc->slave_damage = DamageCreate(NULL, NULL, - DamageReportNone, - TRUE, - crtc->randr_crtc->pScreen, - NULL); + if (!ppriv->slave_damage) { + ppriv->slave_damage = DamageCreate(NULL, NULL, + DamageReportNone, + TRUE, + crtc->randr_crtc->pScreen, + NULL); } ptr = drmmode_map_slave_bo(drmmode, ppriv); ppix->devPrivate.ptr = ptr; - DamageRegister(&ppix->drawable, drmmode_crtc->slave_damage); + DamageRegister(&ppix->drawable, ppriv->slave_damage); if (ppriv->fb_id == 0) { drmModeAddFB(drmmode->fd, ppix->drawable.width, @@ -680,19 +953,34 @@ drmmode_set_scanout_pixmap_cpu(xf86CrtcPtr crtc, PixmapPtr ppix) ppix->drawable.bitsPerPixel, ppix->devKind, ppriv->backing_bo->handle, &ppriv->fb_id); } + *target = ppix; return TRUE; } +static Bool +drmmode_set_target_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix, + PixmapPtr *target) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + + if (drmmode->reverse_prime_offload_mode) + return drmmode_set_target_scanout_pixmap_gpu(crtc, ppix, target); + else + return drmmode_set_target_scanout_pixmap_cpu(crtc, ppix, target); +} + static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - drmmode_ptr drmmode = drmmode_crtc->drmmode; - if (drmmode->reverse_prime_offload_mode) - return drmmode_set_scanout_pixmap_gpu(crtc, ppix); - else - return drmmode_set_scanout_pixmap_cpu(crtc, ppix); + /* Use DisableSharedPixmapFlipping before switching to single buf */ + if (drmmode_crtc->enable_flipping) + return FALSE; + + return drmmode_set_target_scanout_pixmap(crtc, ppix, + &drmmode_crtc->prime_pixmap); } static void * @@ -803,7 +1091,6 @@ drmmode_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data) drmmode_ptr drmmode = drmmode_crtc->drmmode; if (rotate_pixmap) { - drmmode_set_pixmap_bo(drmmode, rotate_pixmap, NULL); rotate_pixmap->drawable.pScreen->DestroyPixmap(rotate_pixmap); } @@ -862,6 +1149,9 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res drmmode_crtc->vblank_pipe = drmmode_crtc_vblank_pipe(num); crtc->driver_private = drmmode_crtc; + /* Hide any cursors which may be active from previous users */ + drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0); + /* Mark num'th crtc as in use on this device. */ ms_ent->assigned_crtcs |= (1 << num); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, MS_LOGLEVEL_DEBUG, @@ -1109,12 +1399,22 @@ drmmode_output_dpms(xf86OutputPtr output, int mode) drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id, drmmode_output->dpms_enum_id, mode); - if (mode == DPMSModeOn && crtc) { + if (crtc) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - if (drmmode_crtc->need_modeset) - drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, - crtc->x, crtc->y); + + if (mode == DPMSModeOn) { + if (drmmode_crtc->need_modeset) + drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, + crtc->x, crtc->y); + + if (drmmode_crtc->enable_flipping) + drmmode_InitSharedPixmapFlipping(crtc, drmmode_crtc->drmmode); + } else { + if (drmmode_crtc->enable_flipping) + drmmode_FiniSharedPixmapFlipping(crtc, drmmode_crtc->drmmode); + } } + return; } @@ -1271,7 +1571,8 @@ drmmode_output_set_property(xf86OutputPtr output, Atom property, value->size != 1) return FALSE; memcpy(&atom, value->data, 4); - name = NameForAtom(atom); + if (!(name = NameForAtom(atom))) + return FALSE; /* search for matching name string, then set its value down */ for (j = 0; j < p->mode_prop->count_enums; j++) { @@ -1447,10 +1748,8 @@ drmmode_create_name(ScrnInfoPtr pScrn, drmModeConnectorPtr koutput, char *name, fallback: if (koutput->connector_type >= MS_ARRAY_SIZE(output_names)) snprintf(name, 32, "Unknown%d-%d", koutput->connector_type, koutput->connector_type_id); -#ifdef MODESETTING_OUTPUT_SLAVE_SUPPORT else if (pScrn->is_gpu) snprintf(name, 32, "%s-%d-%d", output_names[koutput->connector_type], pScrn->scrnIndex - GPU_SCREEN_OFFSET + 1, koutput->connector_type_id); -#endif else snprintf(name, 32, "%s-%d", output_names[koutput->connector_type], koutput->connector_type_id); } @@ -1657,11 +1956,6 @@ drmmode_set_pixmap_bo(drmmode_ptr drmmode, PixmapPtr pixmap, drmmode_bo *bo) if (!drmmode->glamor) return TRUE; - if (bo == NULL) { - glamor_egl_destroy_textured_pixmap(pixmap); - return TRUE; - } - #ifdef GLAMOR_HAS_GBM if (!glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo->gbm)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed"); @@ -1703,12 +1997,9 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - - drmmode_crtc_private_ptr - drmmode_crtc = xf86_config->crtc[0]->driver_private; - drmmode_ptr drmmode = drmmode_crtc->drmmode; + modesettingPtr ms = modesettingPTR(scrn); + drmmode_ptr drmmode = &ms->drmmode; drmmode_bo old_front; - Bool ret; ScreenPtr screen = xf86ScrnToScreen(scrn); uint32_t old_fb_id; int i, pitch, old_width, old_height, old_pitch; @@ -1723,16 +2014,12 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) xf86DrvMsg(scrn->scrnIndex, X_INFO, "Allocate new frame buffer %dx%d stride\n", width, height); - if (drmmode->triple_buffer_pixmap) { - screen->DestroyPixmap(drmmode->triple_buffer_pixmap); - drmmode->triple_buffer_pixmap = NULL; - } - old_width = scrn->virtualX; old_height = scrn->virtualY; old_pitch = drmmode_bo_get_pitch(&drmmode->front_bo); - old_fb_id = drmmode->fb_id; old_front = drmmode->front_bo; + old_fb_id = drmmode->fb_id; + drmmode->fb_id = 0; if (!drmmode_create_bo(drmmode, &drmmode->front_bo, width, height, drmmode->kbpp)) @@ -1744,13 +2031,6 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) scrn->virtualY = height; scrn->displayWidth = pitch / kcpp; - ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth, - scrn->bitsPerPixel, pitch, - drmmode_bo_get_handle(&drmmode->front_bo), - &drmmode->fb_id); - if (ret) - goto fail; - if (!drmmode->gbm) { new_pixels = drmmode_map_front_bo(drmmode); if (!new_pixels) @@ -1766,6 +2046,13 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) drmmode->shadow_fb = new_pixels; } + if (drmmode->shadow_enable2) { + uint32_t size = scrn->displayWidth * scrn->virtualY * cpp; + void *fb2 = calloc(1, size); + free(drmmode->shadow_fb2); + drmmode->shadow_fb2 = fb2; + } + screen->ModifyPixmapHeader(ppix, width, height, -1, -1, scrn->displayWidth * cpp, new_pixels); @@ -1876,7 +2163,7 @@ drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y) } Bool -drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode) +drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; @@ -1889,8 +2176,10 @@ drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode) /* Skip disabled CRTCs */ if (!crtc->enabled) { - drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, - 0, 0, 0, NULL, 0, NULL); + if (set_hw) { + drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + 0, 0, 0, NULL, 0, NULL); + } continue; } @@ -1921,10 +2210,19 @@ drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode) crtc->desiredY = 0; } - if (!crtc->funcs-> - set_mode_major(crtc, &crtc->desiredMode, crtc->desiredRotation, - crtc->desiredX, crtc->desiredY)) - return FALSE; + if (set_hw) { + if (!crtc->funcs-> + set_mode_major(crtc, &crtc->desiredMode, crtc->desiredRotation, + crtc->desiredX, crtc->desiredY)) + return FALSE; + } else { + crtc->mode = crtc->desiredMode; + crtc->rotation = crtc->desiredRotation; + crtc->x = crtc->desiredX; + crtc->y = crtc->desiredY; + if (!xf86CrtcRotate(crtc)) + return FALSE; + } } return TRUE; } @@ -2011,6 +2309,10 @@ drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn) } #ifdef CONFIG_UDEV_KMS + +#define DRM_MODE_LINK_STATUS_GOOD 0 +#define DRM_MODE_LINK_STATUS_BAD 1 + static void drmmode_handle_uevents(int fd, void *closure) { @@ -2020,13 +2322,62 @@ drmmode_handle_uevents(int fd, void *closure) drmModeResPtr mode_res; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int i, j; - Bool found; + Bool found = FALSE; Bool changed = FALSE; - dev = udev_monitor_receive_device(drmmode->uevent_monitor); - if (!dev) + while ((dev = udev_monitor_receive_device(drmmode->uevent_monitor))) { + udev_device_unref(dev); + found = TRUE; + } + if (!found) return; + /* Try to re-set the mode on all the connectors with a BAD link-state: + * This may happen if a link degrades and a new modeset is necessary, using + * different link-training parameters. If the kernel found that the current + * mode is not achievable anymore, it should have pruned the mode before + * sending the hotplug event. Try to re-set the currently-set mode to keep + * the display alive, this will fail if the mode has been pruned. + * In any case, we will send randr events for the Desktop Environment to + * deal with it, if it wants to. + */ + for (i = 0; i < config->num_output; i++) { + xf86OutputPtr output = config->output[i]; + drmmode_output_private_ptr drmmode_output = output->driver_private; + uint32_t con_id; + drmModeConnectorPtr koutput; + + if (drmmode_output->mode_output == NULL) + continue; + con_id = drmmode_output->mode_output->connector_id; + /* Get an updated view of the properties for the current connector and + * look for the link-status property + */ + koutput = drmModeGetConnectorCurrent(drmmode->fd, con_id); + for (j = 0; koutput && j < koutput->count_props; j++) { + drmModePropertyPtr props; + props = drmModeGetProperty(drmmode->fd, koutput->props[j]); + if (props && props->flags & DRM_MODE_PROP_ENUM && + !strcmp(props->name, "link-status") && + koutput->prop_values[j] == DRM_MODE_LINK_STATUS_BAD) { + xf86CrtcPtr crtc = output->crtc; + if (!crtc) + continue; + + /* the connector got a link failure, re-set the current mode */ + drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, + crtc->x, crtc->y); + + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "hotplug event: connector %u's link-state is BAD, " + "tried resetting the current mode. You may be left" + "with a black screen if this fails...\n", con_id); + } + drmModeFreeProperty(props); + } + drmModeFreeConnector(koutput); + } + mode_res = drmModeGetResources(drmmode->fd); if (!mode_res) goto out; @@ -2090,8 +2441,11 @@ out_free_res: drmModeFreeResources(mode_res); out: RRGetInfo(xf86ScrnToScreen(scrn), TRUE); - udev_device_unref(dev); } + +#undef DRM_MODE_LINK_STATUS_BAD +#undef DRM_MODE_LINK_STATUS_GOOD + #endif void diff --git a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h index 9139ed4c2..50976b849 100644 --- a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h +++ b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h @@ -66,29 +66,23 @@ typedef struct { Bool glamor; Bool shadow_enable; + Bool shadow_enable2; /** Is Option "PageFlip" enabled? */ Bool pageflip; Bool force_24_32; void *shadow_fb; - - /** - * A screen-sized pixmap when we're doing triple-buffered DRI2 - * pageflipping. - * - * One is shared between all drawables that flip to the front - * buffer, and it only gets reallocated when root pixmap size - * changes. - */ - PixmapPtr triple_buffer_pixmap; - - /** The GEM name for triple_buffer_pixmap */ - uint32_t triple_buffer_name; + void *shadow_fb2; DevPrivateKeyRec pixmapPrivateKeyRec; Bool reverse_prime_offload_mode; Bool is_secondary; + + PixmapPtr fbcon_pixmap; + + Bool dri2_flipping; + Bool present_flipping; } drmmode_rec, *drmmode_ptr; typedef struct { @@ -98,12 +92,17 @@ typedef struct { int dpms_mode; struct dumb_bo *cursor_bo; Bool cursor_up; + Bool set_cursor2_failed; + Bool first_cursor_load_done; uint16_t lut_r[256], lut_g[256], lut_b[256]; - DamagePtr slave_damage; drmmode_bo rotate_bo; unsigned rotate_fb_id; + + PixmapPtr prime_pixmap; + PixmapPtr prime_pixmap_back; unsigned prime_pixmap_x; + /** * @{ MSC (vblank count) handling for the PRESENT extension. * @@ -117,6 +116,9 @@ typedef struct { /** @} */ Bool need_modeset; + + Bool enable_flipping; + Bool flipping_active; } drmmode_crtc_private_rec, *drmmode_crtc_private_ptr; typedef struct { @@ -143,6 +145,18 @@ typedef struct { typedef struct _msPixmapPriv { uint32_t fb_id; struct dumb_bo *backing_bo; /* if this pixmap is backed by a dumb bo */ + + DamagePtr slave_damage; + + /** Sink fields for flipping shared pixmaps */ + int flip_seq; /* seq of current page flip event handler */ + Bool wait_for_damage; /* if we have requested damage notification from source */ + + /** Source fields for flipping shared pixmaps */ + Bool defer_dirty_update; /* if we want to manually update */ + PixmapDirtyUpdatePtr dirty; /* cached dirty ent to avoid searching list */ + PixmapPtr slave_src; /* if we exported shared pixmap, dirty tracking src */ + Bool notify_on_damage; /* if sink has requested damage notification */ } msPixmapPrivRec, *msPixmapPrivPtr; extern DevPrivateKeyRec msPixmapPrivateKeyRec; @@ -151,7 +165,6 @@ extern DevPrivateKeyRec msPixmapPrivateKeyRec; #define msGetPixmapPriv(drmmode, p) ((msPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &(drmmode)->pixmapPrivateKeyRec)) -Bool drmmode_bo_for_pixmap(drmmode_ptr drmmode, drmmode_bo *bo, PixmapPtr pixmap); int drmmode_bo_destroy(drmmode_ptr drmmode, drmmode_bo *bo); uint32_t drmmode_bo_get_pitch(drmmode_bo *bo); uint32_t drmmode_bo_get_handle(drmmode_bo *bo); @@ -161,9 +174,17 @@ Bool drmmode_SetSlaveBO(PixmapPtr ppix, drmmode_ptr drmmode, int fd_handle, int pitch, int size); +Bool drmmode_EnableSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode, + PixmapPtr front, PixmapPtr back); +Bool drmmode_SharedPixmapPresentOnVBlank(PixmapPtr frontTarget, xf86CrtcPtr crtc, + drmmode_ptr drmmode); +Bool drmmode_SharedPixmapFlip(PixmapPtr frontTarget, xf86CrtcPtr crtc, + drmmode_ptr drmmode); +void drmmode_DisableSharedPixmapFlipping(xf86CrtcPtr crtc, drmmode_ptr drmmode); + extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp); void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y); -extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode); +extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw); extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn); extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode); @@ -176,7 +197,7 @@ void drmmode_free_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode); void drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmmode, int *depth, int *bpp); - +void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode); #ifndef DRM_CAP_DUMB_PREFERRED_DEPTH #define DRM_CAP_DUMB_PREFERRED_DEPTH 3 #endif diff --git a/xserver/hw/xfree86/drivers/modesetting/pageflip.c b/xserver/hw/xfree86/drivers/modesetting/pageflip.c new file mode 100644 index 000000000..4dc05ec81 --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/pageflip.c @@ -0,0 +1,344 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#include +#include + +#include "driver.h" + +/* + * Flush the DRM event queue when full; makes space for new events. + * + * Returns a negative value on error, 0 if there was nothing to process, + * or 1 if we handled any events. + */ +int +ms_flush_drm_events(ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + struct pollfd p = { .fd = ms->fd, .events = POLLIN }; + int r; + + do { + r = xserver_poll(&p, 1, 0); + } while (r == -1 && (errno == EINTR || errno == EAGAIN)); + + /* If there was an error, r will be < 0. Return that. If there was + * nothing to process, r == 0. Return that. + */ + if (r <= 0) + return r; + + /* Try to handle the event. If there was an error, return it. */ + r = drmHandleEvent(ms->fd, &ms->event_context); + if (r < 0) + return r; + + /* Otherwise return 1 to indicate that we handled an event. */ + return 1; +} + +#ifdef GLAMOR + +/* + * Event data for an in progress flip. + * This contains a pointer to the vblank event, + * and information about the flip in progress. + * a reference to this is stored in the per-crtc + * flips. + */ +struct ms_flipdata { + ScreenPtr screen; + void *event; + ms_pageflip_handler_proc event_handler; + ms_pageflip_abort_proc abort_handler; + /* number of CRTC events referencing this */ + int flip_count; + uint64_t fe_msc; + uint64_t fe_usec; + uint32_t old_fb_id; +}; + +/* + * Per crtc pageflipping infomation, + * These are submitted to the queuing code + * one of them per crtc per flip. + */ +struct ms_crtc_pageflip { + Bool on_reference_crtc; + /* reference to the ms_flipdata */ + struct ms_flipdata *flipdata; +}; + +/** + * Free an ms_crtc_pageflip. + * + * Drops the reference count on the flipdata. + */ +static void +ms_pageflip_free(struct ms_crtc_pageflip *flip) +{ + struct ms_flipdata *flipdata = flip->flipdata; + + free(flip); + if (--flipdata->flip_count > 0) + return; + free(flipdata); +} + +/** + * Callback for the DRM event queue when a single flip has completed + * + * Once the flip has been completed on all pipes, notify the + * extension code telling it when that happened + */ +static void +ms_pageflip_handler(uint64_t msc, uint64_t ust, void *data) +{ + struct ms_crtc_pageflip *flip = data; + struct ms_flipdata *flipdata = flip->flipdata; + ScreenPtr screen = flipdata->screen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + if (flip->on_reference_crtc) { + flipdata->fe_msc = msc; + flipdata->fe_usec = ust; + } + + if (flipdata->flip_count == 1) { + flipdata->event_handler(ms, flipdata->fe_msc, + flipdata->fe_usec, + flipdata->event); + + drmModeRmFB(ms->fd, flipdata->old_fb_id); + } + ms_pageflip_free(flip); +} + +/* + * Callback for the DRM queue abort code. A flip has been aborted. + */ +static void +ms_pageflip_abort(void *data) +{ + struct ms_crtc_pageflip *flip = data; + struct ms_flipdata *flipdata = flip->flipdata; + ScreenPtr screen = flipdata->screen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + if (flipdata->flip_count == 1) + flipdata->abort_handler(ms, flipdata->event); + + ms_pageflip_free(flip); +} + +static Bool +queue_flip_on_crtc(ScreenPtr screen, xf86CrtcPtr crtc, + struct ms_flipdata *flipdata, + int ref_crtc_vblank_pipe, uint32_t flags) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + struct ms_crtc_pageflip *flip; + uint32_t seq; + int err; + + flip = calloc(1, sizeof(struct ms_crtc_pageflip)); + if (flip == NULL) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "flip queue: carrier alloc failed.\n"); + return FALSE; + } + + /* Only the reference crtc will finally deliver its page flip + * completion event. All other crtc's events will be discarded. + */ + flip->on_reference_crtc = (drmmode_crtc->vblank_pipe == ref_crtc_vblank_pipe); + flip->flipdata = flipdata; + + seq = ms_drm_queue_alloc(crtc, flip, ms_pageflip_handler, ms_pageflip_abort); + if (!seq) { + free(flip); + return FALSE; + } + + /* take a reference on flipdata for use in flip */ + flipdata->flip_count++; + + while (drmModePageFlip(ms->fd, drmmode_crtc->mode_crtc->crtc_id, + ms->drmmode.fb_id, flags, (void *) (uintptr_t) seq)) { + err = errno; + /* We may have failed because the event queue was full. Flush it + * and retry. If there was nothing to flush, then we failed for + * some other reason and should just return an error. + */ + if (ms_flush_drm_events(screen) <= 0) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "flip queue failed: %s\n", strerror(err)); + /* Aborting will also decrement flip_count and free(flip). */ + ms_drm_abort_seq(scrn, seq); + return FALSE; + } + + /* We flushed some events, so try again. */ + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue retry\n"); + } + + /* The page flip succeded. */ + return TRUE; +} + + +Bool +ms_do_pageflip(ScreenPtr screen, + PixmapPtr new_front, + void *event, + int ref_crtc_vblank_pipe, + Bool async, + ms_pageflip_handler_proc pageflip_handler, + ms_pageflip_abort_proc pageflip_abort) +{ +#ifndef GLAMOR_HAS_GBM + return FALSE; +#else + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + drmmode_bo new_front_bo; + uint32_t flags; + int i; + struct ms_flipdata *flipdata; + glamor_block_handler(screen); + + new_front_bo.gbm = glamor_gbm_bo_from_pixmap(screen, new_front); + new_front_bo.dumb = NULL; + if (!new_front_bo.gbm) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to get GBM bo for flip to new front.\n"); + return FALSE; + } + + flipdata = calloc(1, sizeof(struct ms_flipdata)); + if (!flipdata) { + drmmode_bo_destroy(&ms->drmmode, &new_front_bo); + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to allocate flipdata.\n"); + return FALSE; + } + + flipdata->event = event; + flipdata->screen = screen; + flipdata->event_handler = pageflip_handler; + flipdata->abort_handler = pageflip_abort; + + /* + * Take a local reference on flipdata. + * if the first flip fails, the sequence abort + * code will free the crtc flip data, and drop + * it's reference which would cause this to be + * freed when we still required it. + */ + flipdata->flip_count++; + + /* Create a new handle for the back buffer */ + flipdata->old_fb_id = ms->drmmode.fb_id; + if (drmModeAddFB(ms->fd, scrn->virtualX, scrn->virtualY, + scrn->depth, scrn->bitsPerPixel, + drmmode_bo_get_pitch(&new_front_bo), + drmmode_bo_get_handle(&new_front_bo), &ms->drmmode.fb_id)) { + goto error_out; + } + + drmmode_bo_destroy(&ms->drmmode, &new_front_bo); + + flags = DRM_MODE_PAGE_FLIP_EVENT; + if (async) + flags |= DRM_MODE_PAGE_FLIP_ASYNC; + + /* Queue flips on all enabled CRTCs. + * + * Note that if/when we get per-CRTC buffers, we'll have to update this. + * Right now it assumes a single shared fb across all CRTCs, with the + * kernel fixing up the offset of each CRTC as necessary. + * + * Also, flips queued on disabled or incorrectly configured displays + * may never complete; this is a configuration error. + */ + for (i = 0; i < config->num_crtc; i++) { + xf86CrtcPtr crtc = config->crtc[i]; + + if (!ms_crtc_on(crtc)) + continue; + + if (!queue_flip_on_crtc(screen, crtc, flipdata, + ref_crtc_vblank_pipe, + flags)) { + goto error_undo; + } + } + + /* + * Do we have more than our local reference, + * if so and no errors, then drop our local + * reference and return now. + */ + if (flipdata->flip_count > 1) { + flipdata->flip_count--; + return TRUE; + } + +error_undo: + + /* + * Have we just got the local reference? + * free the framebuffer if so since nobody successfully + * submitted anything + */ + if (flipdata->flip_count == 1) { + drmModeRmFB(ms->fd, ms->drmmode.fb_id); + ms->drmmode.fb_id = flipdata->old_fb_id; + } + +error_out: + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n", + strerror(errno)); + /* if only the local reference - free the structure, + * else drop the local reference and return */ + if (flipdata->flip_count == 1) + free(flipdata); + else + flipdata->flip_count--; + + return FALSE; +#endif /* GLAMOR_HAS_GBM */ +} + +#endif diff --git a/xserver/hw/xfree86/drivers/modesetting/present.c b/xserver/hw/xfree86/drivers/modesetting/present.c index 9a596de75..55b622cbc 100644 --- a/xserver/hw/xfree86/drivers/modesetting/present.c +++ b/xserver/hw/xfree86/drivers/modesetting/present.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -54,6 +53,7 @@ struct ms_present_vblank_event { uint64_t event_id; + Bool unflip; }; static RRCrtcPtr @@ -71,40 +71,6 @@ ms_present_get_ust_msc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *msc) return ms_get_crtc_ust_msc(xf86_crtc, ust, msc); } -/* - * Flush the DRM event queue when full; makes space for new events. - * - * Returns a negative value on error, 0 if there was nothing to process, - * or 1 if we handled any events. - */ -static int -ms_flush_drm_events(ScreenPtr screen) -{ - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); - - struct pollfd p = { .fd = ms->fd, .events = POLLIN }; - int r; - - do { - r = poll(&p, 1, 0); - } while (r == -1 && (errno == EINTR || errno == EAGAIN)); - - /* If there was an error, r will be < 0. Return that. If there was - * nothing to process, r == 0. Return that. - */ - if (r <= 0) - return r; - - /* Try to handle the event. If there was an error, return it. */ - r = drmHandleEvent(ms->fd, &ms->event_context); - if (r < 0) - return r; - - /* Otherwise return 1 to indicate that we handled an event. */ - return 1; -} - /* * Called when the queued vblank event has occurred */ @@ -226,289 +192,38 @@ ms_present_flush(WindowPtr window) #ifdef GLAMOR -/* - * Event data for an in progress flip. - * This contains a pointer to the vblank event, - * and information about the flip in progress. - * a reference to this is stored in the per-crtc - * flips. - */ -struct ms_flipdata { - ScreenPtr screen; - struct ms_present_vblank_event *event; - /* number of CRTC events referencing this */ - int flip_count; - uint64_t fe_msc; - uint64_t fe_usec; - uint32_t old_fb_id; -}; - -/* - * Per crtc pageflipping infomation, - * These are submitted to the queuing code - * one of them per crtc per flip. - */ -struct ms_crtc_pageflip { - Bool on_reference_crtc; - /* reference to the ms_flipdata */ - struct ms_flipdata *flipdata; -}; - /** - * Free an ms_crtc_pageflip. + * Callback for the DRM event queue when a flip has completed on all pipes * - * Drops the reference count on the flipdata. + * Notify the extension code */ static void -ms_present_flip_free(struct ms_crtc_pageflip *flip) +ms_present_flip_handler(modesettingPtr ms, uint64_t msc, + uint64_t ust, void *data) { - struct ms_flipdata *flipdata = flip->flipdata; + struct ms_present_vblank_event *event = data; - free(flip); - if (--flipdata->flip_count > 0) - return; - free(flipdata); -} - -/** - * Callback for the DRM event queue when a single flip has completed - * - * Once the flip has been completed on all pipes, notify the - * extension code telling it when that happened - */ -static void -ms_flip_handler(uint64_t msc, uint64_t ust, void *data) -{ - struct ms_crtc_pageflip *flip = data; - ScreenPtr screen = flip->flipdata->screen; - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); - struct ms_flipdata *flipdata = flip->flipdata; - - DebugPresent(("\t\tms:fh %lld c %d msc %llu ust %llu\n", - (long long) flipdata->event->event_id, - flipdata->flip_count, + DebugPresent(("\t\tms:fc %lld msc %llu ust %llu\n", + (long long) event->event_id, (long long) msc, (long long) ust)); - if (flip->on_reference_crtc) { - flipdata->fe_msc = msc; - flipdata->fe_usec = ust; - } + if (event->unflip) + ms->drmmode.present_flipping = FALSE; - if (flipdata->flip_count == 1) { - DebugPresent(("\t\tms:fc %lld c %d msc %llu ust %llu\n", - (long long) flipdata->event->event_id, - flipdata->flip_count, - (long long) flipdata->fe_msc, (long long) flipdata->fe_usec)); - - - ms_present_vblank_handler(flipdata->fe_msc, - flipdata->fe_usec, - flipdata->event); - - drmModeRmFB(ms->fd, flipdata->old_fb_id); - } - ms_present_flip_free(flip); + ms_present_vblank_handler(msc, ust, event); } /* * Callback for the DRM queue abort code. A flip has been aborted. */ static void -ms_present_flip_abort(void *data) +ms_present_flip_abort(modesettingPtr ms, void *data) { - struct ms_crtc_pageflip *flip = data; - struct ms_flipdata *flipdata = flip->flipdata; + struct ms_present_vblank_event *event = data; - DebugPresent(("\t\tms:fa %lld c %d\n", (long long) flipdata->event->event_id, flipdata->flip_count)); + DebugPresent(("\t\tms:fa %lld\n", (long long) event->event_id)); - if (flipdata->flip_count == 1) - free(flipdata->event); - - ms_present_flip_free(flip); -} - -static Bool -queue_flip_on_crtc(ScreenPtr screen, xf86CrtcPtr crtc, - struct ms_flipdata *flipdata, - int ref_crtc_vblank_pipe, uint32_t flags) -{ - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - struct ms_crtc_pageflip *flip; - uint32_t seq; - int err; - - flip = calloc(1, sizeof(struct ms_crtc_pageflip)); - if (flip == NULL) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "flip queue: carrier alloc failed.\n"); - return FALSE; - } - - /* Only the reference crtc will finally deliver its page flip - * completion event. All other crtc's events will be discarded. - */ - flip->on_reference_crtc = (drmmode_crtc->vblank_pipe == ref_crtc_vblank_pipe); - flip->flipdata = flipdata; - - seq = ms_drm_queue_alloc(crtc, flip, ms_flip_handler, ms_present_flip_abort); - if (!seq) { - free(flip); - return FALSE; - } - - DebugPresent(("\t\tms:fq %lld c %d -> %d seq %llu\n", - (long long) flipdata->event->event_id, - flipdata->flip_count, flipdata->flip_count + 1, - (long long) seq)); - - /* take a reference on flipdata for use in flip */ - flipdata->flip_count++; - - while (drmModePageFlip(ms->fd, drmmode_crtc->mode_crtc->crtc_id, - ms->drmmode.fb_id, flags, (void *) (uintptr_t) seq)) { - err = errno; - /* We may have failed because the event queue was full. Flush it - * and retry. If there was nothing to flush, then we failed for - * some other reason and should just return an error. - */ - if (ms_flush_drm_events(screen) <= 0) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "flip queue failed: %s\n", strerror(err)); - /* Aborting will also decrement flip_count and free(flip). */ - ms_drm_abort_seq(scrn, seq); - return FALSE; - } - - /* We flushed some events, so try again. */ - xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue retry\n"); - } - - /* The page flip succeded. */ - return TRUE; -} - - -static Bool -ms_do_pageflip(ScreenPtr screen, - PixmapPtr new_front, - struct ms_present_vblank_event *event, - int ref_crtc_vblank_pipe, - Bool async) -{ -#ifndef GLAMOR_HAS_GBM - return FALSE; -#else - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - drmmode_bo new_front_bo; - uint32_t flags; - int i; - struct ms_flipdata *flipdata; - glamor_block_handler(screen); - - new_front_bo.gbm = glamor_gbm_bo_from_pixmap(screen, new_front); - new_front_bo.dumb = NULL; - if (!new_front_bo.gbm) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to get GBM bo for flip to new front.\n"); - return FALSE; - } - - flipdata = calloc(1, sizeof(struct ms_flipdata)); - if (!flipdata) { - drmmode_bo_destroy(&ms->drmmode, &new_front_bo); - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to allocate flipdata.\n"); - return FALSE; - } - - flipdata->event = event; - flipdata->screen = screen; - - /* - * Take a local reference on flipdata. - * if the first flip fails, the sequence abort - * code will free the crtc flip data, and drop - * it's reference which would cause this to be - * freed when we still required it. - */ - flipdata->flip_count++; - - /* Create a new handle for the back buffer */ - flipdata->old_fb_id = ms->drmmode.fb_id; - if (drmModeAddFB(ms->fd, scrn->virtualX, scrn->virtualY, - scrn->depth, scrn->bitsPerPixel, - drmmode_bo_get_pitch(&new_front_bo), - drmmode_bo_get_handle(&new_front_bo), &ms->drmmode.fb_id)) { - goto error_out; - } - - drmmode_bo_destroy(&ms->drmmode, &new_front_bo); - - flags = DRM_MODE_PAGE_FLIP_EVENT; - if (async) - flags |= DRM_MODE_PAGE_FLIP_ASYNC; - - /* Queue flips on all enabled CRTCs. - * - * Note that if/when we get per-CRTC buffers, we'll have to update this. - * Right now it assumes a single shared fb across all CRTCs, with the - * kernel fixing up the offset of each CRTC as necessary. - * - * Also, flips queued on disabled or incorrectly configured displays - * may never complete; this is a configuration error. - */ - for (i = 0; i < config->num_crtc; i++) { - xf86CrtcPtr crtc = config->crtc[i]; - - if (!ms_crtc_on(crtc)) - continue; - - if (!queue_flip_on_crtc(screen, crtc, flipdata, - ref_crtc_vblank_pipe, - flags)) { - goto error_undo; - } - } - - /* - * Do we have more than our local reference, - * if so and no errors, then drop our local - * reference and return now. - */ - if (flipdata->flip_count > 1) { - flipdata->flip_count--; - return TRUE; - } - -error_undo: - - /* - * Have we just got the local reference? - * free the framebuffer if so since nobody successfully - * submitted anything - */ - if (flipdata->flip_count == 1) { - drmModeRmFB(ms->fd, ms->drmmode.fb_id); - ms->drmmode.fb_id = flipdata->old_fb_id; - } - -error_out: - xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n", - strerror(errno)); - /* if only the local reference - free the structure, - * else drop the local reference and return */ - if (flipdata->flip_count == 1) - free(flipdata); - else - flipdata->flip_count--; - - return FALSE; -#endif /* GLAMOR_HAS_GBM */ + free(event); } /* @@ -530,6 +245,9 @@ ms_present_check_flip(RRCrtcPtr crtc, if (!ms->drmmode.pageflip) return FALSE; + if (ms->drmmode.dri2_flipping) + return FALSE; + if (!scrn->vtSema) return FALSE; @@ -576,6 +294,7 @@ ms_present_flip(RRCrtcPtr crtc, { ScreenPtr screen = crtc->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); xf86CrtcPtr xf86_crtc = crtc->devPrivate; drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; Bool ret; @@ -588,10 +307,18 @@ ms_present_flip(RRCrtcPtr crtc, if (!event) return FALSE; + DebugPresent(("\t\tms:pf %lld msc %llu\n", + (long long) event_id, (long long) target_msc)); + event->event_id = event_id; - ret = ms_do_pageflip(screen, pixmap, event, drmmode_crtc->vblank_pipe, !sync_flip); + event->unflip = FALSE; + + ret = ms_do_pageflip(screen, pixmap, event, drmmode_crtc->vblank_pipe, !sync_flip, + ms_present_flip_handler, ms_present_flip_abort); if (!ret) xf86DrvMsg(scrn->scrnIndex, X_ERROR, "present flip failed\n"); + else + ms->drmmode.present_flipping = TRUE; return ret; } @@ -603,6 +330,7 @@ static void ms_present_unflip(ScreenPtr screen, uint64_t event_id) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); PixmapPtr pixmap = screen->GetScreenPixmap(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int i; @@ -613,9 +341,11 @@ ms_present_unflip(ScreenPtr screen, uint64_t event_id) return; event->event_id = event_id; + event->unflip = TRUE; if (ms_present_check_flip(NULL, screen->root, pixmap, TRUE) && - ms_do_pageflip(screen, pixmap, event, -1, FALSE)) { + ms_do_pageflip(screen, pixmap, event, -1, FALSE, + ms_present_flip_handler, ms_present_flip_abort)) { return; } @@ -643,6 +373,7 @@ ms_present_unflip(ScreenPtr screen, uint64_t event_id) } present_event_notify(event_id, 0, 0); + ms->drmmode.present_flipping = FALSE; } #endif diff --git a/xserver/hw/xfree86/drivers/modesetting/vblank.c b/xserver/hw/xfree86/drivers/modesetting/vblank.c index 77e0848e7..8682f4d91 100644 --- a/xserver/hw/xfree86/drivers/modesetting/vblank.c +++ b/xserver/hw/xfree86/drivers/modesetting/vblank.c @@ -32,7 +32,6 @@ #include #include #include -#include #include "driver.h" #include "drmmode_display.h" @@ -93,46 +92,68 @@ ms_crtc_on(xf86CrtcPtr crtc) /* * Return the crtc covering 'box'. If two crtcs cover a portion of - * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc - * with greater coverage + * 'box', then prefer the crtc with greater coverage. */ -xf86CrtcPtr -ms_covering_crtc(ScrnInfoPtr scrn, - BoxPtr box, xf86CrtcPtr desired, BoxPtr crtc_box_ret) +static xf86CrtcPtr +ms_covering_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms) { + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcPtr crtc, best_crtc; int coverage, best_coverage; int c; BoxRec crtc_box, cover_box; + Bool crtc_on; best_crtc = NULL; best_coverage = 0; - crtc_box_ret->x1 = 0; - crtc_box_ret->x2 = 0; - crtc_box_ret->y1 = 0; - crtc_box_ret->y2 = 0; for (c = 0; c < xf86_config->num_crtc; c++) { crtc = xf86_config->crtc[c]; + if (screen_is_ms) + crtc_on = ms_crtc_on(crtc); + else + crtc_on = crtc->enabled; + /* If the CRTC is off, treat it as not covering */ - if (!ms_crtc_on(crtc)) + if (!crtc_on) continue; ms_crtc_box(crtc, &crtc_box); ms_box_intersect(&cover_box, &crtc_box, box); coverage = ms_box_area(&cover_box); - if (coverage && crtc == desired) { - *crtc_box_ret = crtc_box; - return crtc; - } if (coverage > best_coverage) { - *crtc_box_ret = crtc_box; best_crtc = crtc; best_coverage = coverage; } } + + /* Fallback to primary crtc for drawable's on slave outputs */ + if (best_crtc == NULL && !pScreen->isGPU) { + RROutputPtr primary_output = NULL; + ScreenPtr slave; + + if (dixPrivateKeyRegistered(rrPrivKey)) + primary_output = RRFirstOutput(scrn->pScreen); + if (!primary_output || !primary_output->crtc) + return NULL; + + crtc = primary_output->crtc->devPrivate; + if (!ms_crtc_on(crtc)) + return NULL; + + xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { + if (!slave->is_output_slave) + continue; + + if (ms_covering_crtc(slave, box, FALSE)) { + /* The drawable is on a slave output, return primary crtc */ + return crtc; + } + } + } + return best_crtc; } @@ -140,15 +161,14 @@ xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw) { ScreenPtr pScreen = pDraw->pScreen; - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - BoxRec box, crtcbox; + BoxRec box; box.x1 = pDraw->x; box.y1 = pDraw->y; box.x2 = box.x1 + pDraw->width; box.y2 = box.y1 + pDraw->height; - return ms_covering_crtc(pScrn, &box, NULL, &crtcbox); + return ms_covering_crtc(pScreen, &box, TRUE); } static Bool @@ -244,18 +264,16 @@ ms_crtc_msc_to_kernel_msc(xf86CrtcPtr crtc, uint64_t expect) * Check for pending DRM events and process them. */ static void -ms_drm_wakeup_handler(void *data, int err, void *mask) +ms_drm_socket_handler(int fd, int ready, void *data) { ScreenPtr screen = data; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); - fd_set *read_mask = mask; - if (data == NULL || err < 0) + if (data == NULL) return; - if (FD_ISSET(ms->fd, read_mask)) - drmHandleEvent(ms->fd, &ms->event_context); + drmHandleEvent(fd, &ms->event_context); } /* @@ -384,7 +402,7 @@ ms_vblank_screen_init(ScreenPtr screen) modesettingEntPtr ms_ent = ms_ent_priv(scrn); xorg_list_init(&ms_drm_queue); - ms->event_context.version = DRM_EVENT_CONTEXT_VERSION; + ms->event_context.version = 2; ms->event_context.vblank_handler = ms_drm_handler; ms->event_context.page_flip_handler = ms_drm_handler; @@ -393,9 +411,7 @@ ms_vblank_screen_init(ScreenPtr screen) * registration within ScreenInit and not PreInit. */ if (ms_ent->fd_wakeup_registered != serverGeneration) { - AddGeneralSocket(ms->fd); - RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, - ms_drm_wakeup_handler, screen); + SetNotifyFd(ms->fd, ms_drm_socket_handler, X_NOTIFY_READ, screen); ms_ent->fd_wakeup_registered = serverGeneration; ms_ent->fd_wakeup_ref = 1; } else @@ -415,8 +431,6 @@ ms_vblank_close_screen(ScreenPtr screen) if (ms_ent->fd_wakeup_registered == serverGeneration && !--ms_ent->fd_wakeup_ref) { - RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, - ms_drm_wakeup_handler, screen); - RemoveGeneralSocket(ms->fd); + RemoveNotifyFd(ms->fd); } } diff --git a/xserver/hw/xfree86/exa/Makefile.in b/xserver/hw/xfree86/exa/Makefile.in index c6cbb47f9..ed5242185 100644 --- a/xserver/hw/xfree86/exa/Makefile.in +++ b/xserver/hw/xfree86/exa/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -368,6 +369,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -398,7 +402,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -493,6 +500,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/exa/man/Makefile.in b/xserver/hw/xfree86/exa/man/Makefile.in index 681a67407..b1b288a25 100644 --- a/xserver/hw/xfree86/exa/man/Makefile.in +++ b/xserver/hw/xfree86/exa/man/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/xfree86/exa/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -313,6 +314,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -343,7 +347,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -438,6 +445,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/fbdevhw/Makefile.in b/xserver/hw/xfree86/fbdevhw/Makefile.in index f43d8e469..22b75922a 100644 --- a/xserver/hw/xfree86/fbdevhw/Makefile.in +++ b/xserver/hw/xfree86/fbdevhw/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = README $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -371,6 +372,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -401,7 +405,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -496,6 +503,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/fbdevhw/man/Makefile.in b/xserver/hw/xfree86/fbdevhw/man/Makefile.in index 827ca8c30..7613ec3a6 100644 --- a/xserver/hw/xfree86/fbdevhw/man/Makefile.in +++ b/xserver/hw/xfree86/fbdevhw/man/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/xfree86/fbdevhw/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -313,6 +314,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -343,7 +347,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -438,6 +445,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/glamor_egl/Makefile.in b/xserver/hw/xfree86/glamor_egl/Makefile.in index 89c780fc6..2030fbd06 100644 --- a/xserver/hw/xfree86/glamor_egl/Makefile.in +++ b/xserver/hw/xfree86/glamor_egl/Makefile.in @@ -76,9 +76,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -352,6 +353,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -382,7 +386,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -477,6 +484,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/i2c/Makefile.in b/xserver/hw/xfree86/i2c/Makefile.in index b08c2da7a..fe12e2fb2 100644 --- a/xserver/hw/xfree86/i2c/Makefile.in +++ b/xserver/hw/xfree86/i2c/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -328,6 +329,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -358,7 +362,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -453,6 +460,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/i2c/xf86i2c.c b/xserver/hw/xfree86/i2c/xf86i2c.c index 2a8b8df22..22109cfbc 100644 --- a/xserver/hw/xfree86/i2c/xf86i2c.c +++ b/xserver/hw/xfree86/i2c/xf86i2c.c @@ -614,7 +614,7 @@ xf86CreateI2CDevRec(void) void xf86DestroyI2CDevRec(I2CDevPtr d, Bool unalloc) { - if (d) { + if (d && d->pI2CBus) { I2CDevPtr *p; /* Remove this from the list of active I2C devices. */ @@ -628,10 +628,10 @@ xf86DestroyI2CDevRec(I2CDevPtr d, Bool unalloc) xf86DrvMsg(d->pI2CBus->scrnIndex, X_INFO, "I2C device \"%s:%s\" removed.\n", d->pI2CBus->BusName, d->DevName); - - if (unalloc) - free(d); } + + if (unalloc) + free(d); } /* I2C transmissions are related to an I2CDevRec you must link to a diff --git a/xserver/hw/xfree86/int10/Makefile.in b/xserver/hw/xfree86/int10/Makefile.in index ebcfe23d6..a55c2743c 100644 --- a/xserver/hw/xfree86/int10/Makefile.in +++ b/xserver/hw/xfree86/int10/Makefile.in @@ -57,9 +57,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -347,6 +348,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -377,7 +381,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -472,6 +479,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/loader/Makefile.in b/xserver/hw/xfree86/loader/Makefile.in index 81c4b2a91..75e358893 100644 --- a/xserver/hw/xfree86/loader/Makefile.in +++ b/xserver/hw/xfree86/loader/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -299,6 +300,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -329,7 +333,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -424,6 +431,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/loader/loader.c b/xserver/hw/xfree86/loader/loader.c index 31329846a..c8d7540b5 100644 --- a/xserver/hw/xfree86/loader/loader.c +++ b/xserver/hw/xfree86/loader/loader.c @@ -180,7 +180,6 @@ LoaderGetABIVersion(const char *abiclass) {ABI_CLASS_VIDEODRV, LoaderVersionInfo.videodrvVersion}, {ABI_CLASS_XINPUT, LoaderVersionInfo.xinputVersion}, {ABI_CLASS_EXTENSION, LoaderVersionInfo.extensionVersion}, - {ABI_CLASS_FONT, LoaderVersionInfo.fontVersion}, {NULL, 0} }; int i; diff --git a/xserver/hw/xfree86/loader/loadmod.c b/xserver/hw/xfree86/loader/loadmod.c index 73dc1b8dc..8bf6836d6 100644 --- a/xserver/hw/xfree86/loader/loadmod.c +++ b/xserver/hw/xfree86/loader/loadmod.c @@ -86,7 +86,6 @@ const ModuleVersions LoaderVersionInfo = { ABI_VIDEODRV_VERSION, ABI_XINPUT_VERSION, ABI_EXTENSION_VERSION, - ABI_FONT_VERSION }; static int ModuleDuplicated[] = { }; @@ -613,8 +612,6 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, ver = LoaderVersionInfo.xinputVersion; else if (!strcmp(data->abiclass, ABI_CLASS_EXTENSION)) ver = LoaderVersionInfo.extensionVersion; - else if (!strcmp(data->abiclass, ABI_CLASS_FONT)) - ver = LoaderVersionInfo.fontVersion; abimaj = GET_ABI_MAJOR(data->abiversion); abimin = GET_ABI_MINOR(data->abiversion); @@ -629,9 +626,9 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, else errtype = X_ERROR; xf86MsgVerb(errtype, 0, - "module ABI major version (%d) doesn't" + "%s: module ABI major version (%d) doesn't" " match the server's version (%d)\n", - abimaj, vermaj); + module, abimaj, vermaj); if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) return FALSE; } @@ -641,9 +638,9 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, else errtype = X_ERROR; xf86MsgVerb(errtype, 0, - "module ABI minor version (%d) is " + "%s: module ABI minor version (%d) is " "newer than the server's version " - "(%d)\n", abimin, vermin); + "(%d)\n", module, abimin, vermin); if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) return FALSE; } @@ -654,24 +651,24 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, if (req) { if (req->majorversion != MAJOR_UNSPEC) { if (data->majorversion != req->majorversion) { - xf86MsgVerb(X_WARNING, 2, "module major version (%d) " + xf86MsgVerb(X_WARNING, 2, "%s: module major version (%d) " "doesn't match required major version (%d)\n", - data->majorversion, req->majorversion); + module, data->majorversion, req->majorversion); return FALSE; } else if (req->minorversion != MINOR_UNSPEC) { if (data->minorversion < req->minorversion) { - xf86MsgVerb(X_WARNING, 2, "module minor version (%d) " + xf86MsgVerb(X_WARNING, 2, "%s: module minor version (%d) " "is less than the required minor version (%d)\n", - data->minorversion, req->minorversion); + module, data->minorversion, req->minorversion); return FALSE; } else if (data->minorversion == req->minorversion && req->patchlevel != PATCH_UNSPEC) { if (data->patchlevel < req->patchlevel) { - xf86MsgVerb(X_WARNING, 2, "module patch level (%d) " + xf86MsgVerb(X_WARNING, 2, "%s: module patch level (%d) " "is less than the required patch level (%d)\n", - data->patchlevel, req->patchlevel); + module, data->patchlevel, req->patchlevel); return FALSE; } } @@ -680,8 +677,9 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, if (req->moduleclass) { if (!data->moduleclass || strcmp(req->moduleclass, data->moduleclass)) { - xf86MsgVerb(X_WARNING, 2, "Module class (%s) doesn't match " + xf86MsgVerb(X_WARNING, 2, "%s: Module class (%s) doesn't match " "the required class (%s)\n", + module, data->moduleclass ? data->moduleclass : "", req->moduleclass); return FALSE; @@ -689,8 +687,9 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, } else if (req->abiclass != ABI_CLASS_NONE) { if (!data->abiclass || strcmp(req->abiclass, data->abiclass)) { - xf86MsgVerb(X_WARNING, 2, "ABI class (%s) doesn't match the " + xf86MsgVerb(X_WARNING, 2, "%s: ABI class (%s) doesn't match the " "required ABI class (%s)\n", + module, data->abiclass ? data->abiclass : "", req->abiclass); return FALSE; @@ -705,15 +704,16 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, maj = GET_ABI_MAJOR(data->abiversion); min = GET_ABI_MINOR(data->abiversion); if (maj != reqmaj) { - xf86MsgVerb(X_WARNING, 2, "ABI major version (%d) doesn't " + xf86MsgVerb(X_WARNING, 2, "%s: ABI major version (%d) doesn't " "match the required ABI major version (%d)\n", - maj, reqmaj); + module, maj, reqmaj); return FALSE; } /* XXX Maybe this should be the other way around? */ if (min > reqmin) { - xf86MsgVerb(X_WARNING, 2, "module ABI minor version (%d) " - "is newer than that available (%d)\n", min, reqmin); + xf86MsgVerb(X_WARNING, 2, "%s: module ABI minor version (%d) " + "is newer than that available (%d)\n", + module, min, reqmin); return FALSE; } } diff --git a/xserver/hw/xfree86/loader/os.c b/xserver/hw/xfree86/loader/os.c index e3a9ac448..8d037217b 100644 --- a/xserver/hw/xfree86/loader/os.c +++ b/xserver/hw/xfree86/loader/os.c @@ -50,7 +50,7 @@ #define OSNAME "openbsd" #elif defined(__GNU__) #define OSNAME "hurd" -#elif defined(SVR4) && defined(sun) +#elif defined(SVR4) && defined(__sun) #define OSNAME "solaris" #elif defined(SVR5) #define OSNAME "svr5" diff --git a/xserver/hw/xfree86/man/Makefile.in b/xserver/hw/xfree86/man/Makefile.in index 6441a8d71..82ba96717 100644 --- a/xserver/hw/xfree86/man/Makefile.in +++ b/xserver/hw/xfree86/man/Makefile.in @@ -58,9 +58,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/xfree86/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -316,6 +317,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -346,7 +350,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -441,6 +448,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/man/xorg.conf.man b/xserver/hw/xfree86/man/xorg.conf.man index e33114dda..7d0c52495 100644 --- a/xserver/hw/xfree86/man/xorg.conf.man +++ b/xserver/hw/xfree86/man/xorg.conf.man @@ -511,15 +511,6 @@ core file. In general you never want to use this option unless you are debugging an Xorg server problem and know how to deal with the consequences. .TP 7 -.BI "Option \*qUseSIGIO\*q \*q" boolean \*q -This controls whether the Xorg server requests that events from -input devices be reported via a SIGIO signal handler (also known as SIGPOLL -on some platforms), or only reported via the standard select(3) loop. -The default behaviour is platform specific. In general you do not want to -use this option unless you are debugging the Xorg server, or -working around a specific bug until it is fixed, and understand the -consequences. -.TP 7 .BI "Option \*qDontVTSwitch\*q \*q" boolean \*q This disallows the use of the .BI Ctrl+Alt+F n @@ -641,9 +632,6 @@ Default: PM enabled on platforms that support it. enable or disable XINERAMA extension. Default is disabled. .TP 7 -.BI "Option \*qAIGLX\*q \*q" boolean \*q -enable or disable AIGLX. AIGLX is enabled by default. -.TP 7 .BI "Option \*qIndirectGLX\*q \*q" boolean \*q enable or disable indirect GLX contexts. Indirect GLX contexts are disabled by default. @@ -1096,6 +1084,7 @@ attribute. For example: .B " # either gizmo or gadget .B " MatchProduct \*qexample\*q .B " MatchProduct \*qgizmo|gadget\*q +.B " NoMatchDriver \*qdrivername\*q .I " ..." .B "EndSection" .fi @@ -1164,6 +1153,20 @@ if no named .B ServerLayout sections have been found. .PP +The above directives have equivalents for negative matching with the +.B NoMatchProduct, +.B NoMatchVendor, +.B NoMatchDevicePath, +.B NoMatchOS, +.B NoMatchPnPID, +.B NoMatchUSBID, +.B NoMatchDriver, +.B NoMatchTag, +and +.B NoMatchLayout +directives. These NoMatch directives match if the subsequent match is not +met by the device. +.PP The second type of entry is used to match device types. These entries take a boolean argument similar to .B Option @@ -1177,6 +1180,8 @@ entries. .TP 7 .BI "MatchIsTablet \*q" bool \*q .TP 7 +.BI "MatchIsTabletPad \*q" bool \*q +.TP 7 .BI "MatchIsTouchpad \*q" bool \*q .TP 7 .BI "MatchIsTouchscreen \*q" bool \*q @@ -2028,6 +2033,12 @@ Note that disabling an operation will have no effect if the operation is not accelerated (whether due to lack of support in the hardware or in the driver). .TP 7 +.BI "Option \*qGlxVendorLibrary\*q \*q" string \*q +This option specifies a space-separated list of OpenGL vendor libraries to +use for the screen. This may be used to select an alternate implementation +for development, debugging, or alternate feature sets. +Default: mesa. +.TP 7 .BI "Option \*qInitPrimary\*q \*q" boolean \*q Use the Int10 module to initialize the primary graphics card. Normally, only secondary cards are soft-booted using the Int10 module, as the diff --git a/xserver/hw/xfree86/modes/Makefile.in b/xserver/hw/xfree86/modes/Makefile.in index 4dd79bae1..902d50aa5 100644 --- a/xserver/hw/xfree86/modes/Makefile.in +++ b/xserver/hw/xfree86/modes/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -334,6 +335,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -364,7 +368,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -459,6 +466,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/modes/xf86Crtc.c b/xserver/hw/xfree86/modes/xf86Crtc.c index 4a13c1329..966a16891 100644 --- a/xserver/hw/xfree86/modes/xf86Crtc.c +++ b/xserver/hw/xfree86/modes/xf86Crtc.c @@ -2451,108 +2451,6 @@ xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, return FALSE; } -static Bool -xf86CrtcSetInitialGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green, - float gamma_blue) -{ - int i, size = 256; - CARD16 *red, *green, *blue; - - red = xallocarray(size, 3 * sizeof(CARD16)); - green = red + size; - blue = green + size; - - /* Only cause warning if user wanted gamma to be set. */ - if (!crtc->funcs->gamma_set && - (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0)) { - free(red); - return FALSE; - } - else if (!crtc->funcs->gamma_set) { - free(red); - return TRUE; - } - - /* At this early stage none of the randr-interface stuff is up. - * So take the default gamma size for lack of something better. - */ - for (i = 0; i < size; i++) { - if (gamma_red == 1.0) - red[i] = i << 8; - else - red[i] = (CARD16) (pow((double) i / (double) (size - 1), - 1. / (double) gamma_red) * (double) (size - - 1) * - 256); - - if (gamma_green == 1.0) - green[i] = i << 8; - else - green[i] = (CARD16) (pow((double) i / (double) (size - 1), - 1. / (double) gamma_green) * - (double) (size - 1) * 256); - - if (gamma_blue == 1.0) - blue[i] = i << 8; - else - blue[i] = (CARD16) (pow((double) i / (double) (size - 1), - 1. / (double) gamma_blue) * (double) (size - - 1) * - 256); - } - - /* Default size is 256, so anything else is failure. */ - if (size != crtc->gamma_size) { - free(red); - return FALSE; - } - - crtc->gamma_size = size; - memcpy(crtc->gamma_red, red, crtc->gamma_size * sizeof(CARD16)); - memcpy(crtc->gamma_green, green, crtc->gamma_size * sizeof(CARD16)); - memcpy(crtc->gamma_blue, blue, crtc->gamma_size * sizeof(CARD16)); - - /* Do not set gamma now, delay until the crtc is activated. */ - - free(red); - - return TRUE; -} - -static Bool -xf86OutputSetInitialGamma(xf86OutputPtr output) -{ - XF86ConfMonitorPtr mon = output->conf_monitor; - float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0; - - if (!mon) - return TRUE; - - if (!output->crtc) - return FALSE; - - /* Get configured values, where they exist. */ - if (mon->mon_gamma_red >= GAMMA_MIN && mon->mon_gamma_red <= GAMMA_MAX) - gamma_red = mon->mon_gamma_red; - - if (mon->mon_gamma_green >= GAMMA_MIN && mon->mon_gamma_green <= GAMMA_MAX) - gamma_green = mon->mon_gamma_green; - - if (mon->mon_gamma_blue >= GAMMA_MIN && mon->mon_gamma_blue <= GAMMA_MAX) - gamma_blue = mon->mon_gamma_blue; - - /* This avoids setting gamma 1.0 in case another cloned output on this crtc has a specific gamma. */ - if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) { - xf86DrvMsg(output->scrn->scrnIndex, X_INFO, - "Output %s wants gamma correction (%.1f, %.1f, %.1f)\n", - output->name, gamma_red, gamma_green, gamma_blue); - return xf86CrtcSetInitialGamma(output->crtc, gamma_red, gamma_green, - gamma_blue); - } - else - return TRUE; -} - /** * Construct default screen configuration * @@ -2672,15 +2570,8 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) crtc->enabled = FALSE; memset(&crtc->desiredMode, '\0', sizeof(crtc->desiredMode)); - /* Set default gamma for all crtc's. */ - /* This is done to avoid problems later on with cloned outputs. */ - xf86CrtcSetInitialGamma(crtc, 1.0, 1.0, 1.0); } - if (xf86_crtc_supports_gamma(scrn)) - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.\n"); - /* * Set initial configuration */ @@ -2703,10 +2594,6 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) memcpy(crtc->panningBorder, output->initialBorder, 4 * sizeof(INT16)); output->crtc = crtc; - if (!xf86OutputSetInitialGamma(output)) - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "Initial gamma correction for output %s: failed.\n", - output->name); } else { output->crtc = NULL; diff --git a/xserver/hw/xfree86/modes/xf86Crtc.h b/xserver/hw/xfree86/modes/xf86Crtc.h index 8b0160845..14ba9d714 100644 --- a/xserver/hw/xfree86/modes/xf86Crtc.h +++ b/xserver/hw/xfree86/modes/xf86Crtc.h @@ -70,6 +70,14 @@ typedef enum _xf86OutputStatus { XF86OutputStatusUnknown } xf86OutputStatus; +typedef enum _xf86DriverTransforms { + XF86DriverTransformNone = 0, + XF86DriverTransformOutput = 1 << 0, + XF86DriverTransformCursorImage = 1 << 1, + XF86DriverTransformCursorPosition = 1 << 2, +} xf86DriverTransforms; + + struct xf86CrtcTileInfo { uint32_t group_id; uint32_t flags; @@ -237,7 +245,7 @@ typedef struct _xf86CrtcFuncs { } xf86CrtcFuncsRec, *xf86CrtcFuncsPtr; -#define XF86_CRTC_VERSION 6 +#define XF86_CRTC_VERSION 7 struct _xf86Crtc { /** @@ -377,21 +385,30 @@ struct _xf86Crtc { Bool shadowClear; /** - * Indicates that the driver is handling the transform, so the shadow - * surface should be disabled. The driver writes this field before calling - * xf86CrtcRotate to indicate that it is handling the transform (including - * rotation and reflection). + * Indicates that the driver is handling some or all transforms: * - * Setting this flag also causes the server to stop adjusting the cursor - * image and position. + * XF86DriverTransformOutput: The driver handles the output transform, so + * the shadow surface should be disabled. The driver writes this field + * before calling xf86CrtcRotate to indicate that it is handling the + * transform (including rotation and reflection). * - * Added in ABI version 4 + * XF86DriverTransformCursorImage: Setting this flag causes the server to + * pass the untransformed cursor image to the driver hook. + * + * XF86DriverTransformCursorPosition: Setting this flag causes the server + * to pass the untransformed cursor position to the driver hook. + * + * Added in ABI version 4, changed to xf86DriverTransforms in ABI version 7 */ - Bool driverIsPerformingTransform; + xf86DriverTransforms driverIsPerformingTransform; /* Added in ABI version 5 */ PixmapPtr current_scanout; + + /* Added in ABI version 6 + */ + PixmapPtr current_scanout_back; }; typedef struct _xf86OutputFuncs { @@ -968,14 +985,10 @@ extern _X_EXPORT Bool xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags); /** - * Called when anything on the screen is reconfigured. - * - * Reloads cursor images as needed, then adjusts cursor positions. - * - * Driver should call this from crtc commit function. + * Superseeded by xf86CursorResetCursor, which is getting called + * automatically when necessary. */ -extern _X_EXPORT void - xf86_reload_cursors(ScreenPtr screen); +static _X_INLINE _X_DEPRECATED void xf86_reload_cursors(ScreenPtr screen) {} /** * Called from EnterVT to turn the cursors back on @@ -995,14 +1008,6 @@ extern _X_EXPORT void extern _X_EXPORT void xf86_cursors_fini(ScreenPtr screen); -/** - * Transform the cursor's coordinates based on the crtc transform. Normally - * this is done by the server, but if crtc->driverIsPerformingTransform is TRUE, - * then the server does not transform the cursor position automatically. - */ -extern _X_EXPORT void - xf86CrtcTransformCursorPos(xf86CrtcPtr crtc, int *x, int *y); - #ifdef XV /* * For overlay video, compute the relevant CRTC and diff --git a/xserver/hw/xfree86/modes/xf86Cursors.c b/xserver/hw/xfree86/modes/xf86Cursors.c index 5df1ab73a..1bc2b27c3 100644 --- a/xserver/hw/xfree86/modes/xf86Cursors.c +++ b/xserver/hw/xfree86/modes/xf86Cursors.c @@ -54,7 +54,7 @@ static Rotation xf86_crtc_cursor_rotation(xf86CrtcPtr crtc) { - if (crtc->driverIsPerformingTransform) + if (crtc->driverIsPerformingTransform & XF86DriverTransformCursorImage) return RR_Rotate_0; return crtc->rotation; } @@ -74,7 +74,7 @@ xf86_crtc_rotate_coord(Rotation rotation, break; case RR_Rotate_90: t = x_dst; - x_dst = height - y_dst - 1; + x_dst = width - y_dst - 1; y_dst = t; break; case RR_Rotate_180: @@ -84,7 +84,7 @@ xf86_crtc_rotate_coord(Rotation rotation, case RR_Rotate_270: t = x_dst; x_dst = y_dst; - y_dst = width - t - 1; + y_dst = height - t - 1; break; } if (rotation & RR_Reflect_X) @@ -287,7 +287,7 @@ xf86_set_cursor_colors(ScrnInfoPtr scrn, int bg, int fg) { ScreenPtr screen = scrn->pScreen; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - CursorPtr cursor = xf86_config->cursor; + CursorPtr cursor = xf86CurrentCursor(screen); int c; CARD8 *bits = cursor ? dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey, screen) @@ -357,8 +357,8 @@ xf86_show_cursors(ScrnInfoPtr scrn) } } -void -xf86CrtcTransformCursorPos(xf86CrtcPtr crtc, int *x, int *y) +static void +xf86_crtc_transform_cursor_position(xf86CrtcPtr crtc, int *x, int *y) { ScrnInfoPtr scrn = crtc->scrn; ScreenPtr screen = scrn->pScreen; @@ -367,16 +367,45 @@ xf86CrtcTransformCursorPos(xf86CrtcPtr crtc, int *x, int *y) xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&screen->devPrivates, xf86CursorScreenKey); - struct pict_f_vector v; - int dx, dy; + int dx, dy, t; + Bool swap_reflection = FALSE; + + *x = *x - crtc->x + ScreenPriv->HotX; + *y = *y - crtc->y + ScreenPriv->HotY; + + switch (crtc->rotation & 0xf) { + case RR_Rotate_0: + break; + case RR_Rotate_90: + t = *x; + *x = *y; + *y = crtc->mode.VDisplay - t - 1; + swap_reflection = TRUE; + break; + case RR_Rotate_180: + *x = crtc->mode.HDisplay - *x - 1; + *y = crtc->mode.VDisplay - *y - 1; + break; + case RR_Rotate_270: + t = *x; + *x = crtc->mode.HDisplay - *y - 1; + *y = t; + swap_reflection = TRUE; + break; + } + + if (swap_reflection) { + if (crtc->rotation & RR_Reflect_Y) + *x = crtc->mode.HDisplay - *x - 1; + if (crtc->rotation & RR_Reflect_X) + *y = crtc->mode.VDisplay - *y - 1; + } else { + if (crtc->rotation & RR_Reflect_X) + *x = crtc->mode.HDisplay - *x - 1; + if (crtc->rotation & RR_Reflect_Y) + *y = crtc->mode.VDisplay - *y - 1; + } - v.v[0] = (*x + ScreenPriv->HotX) + 0.5; - v.v[1] = (*y + ScreenPriv->HotY) + 0.5; - v.v[2] = 1; - pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &v); - /* cursor will have 0.5 added to it already so floor is sufficent */ - *x = floor(v.v[0]); - *y = floor(v.v[1]); /* * Transform position of cursor upper left corner */ @@ -394,37 +423,33 @@ xf86_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; DisplayModePtr mode = &crtc->mode; - Bool in_range; + int crtc_x = x, crtc_y = y; /* * Transform position of cursor on screen */ - if (crtc->transform_in_use && !crtc->driverIsPerformingTransform) - xf86CrtcTransformCursorPos(crtc, &x, &y); + if (crtc->rotation != RR_Rotate_0) + xf86_crtc_transform_cursor_position(crtc, &crtc_x, &crtc_y); else { - x -= crtc->x; - y -= crtc->y; + crtc_x -= crtc->x; + crtc_y -= crtc->y; } /* * Disable the cursor when it is outside the viewport */ - in_range = TRUE; - if (x >= mode->HDisplay || y >= mode->VDisplay || - x <= -cursor_info->MaxWidth || y <= -cursor_info->MaxHeight) { - in_range = FALSE; - x = 0; - y = 0; - } - - crtc->cursor_in_range = in_range; - - if (in_range) { - crtc->funcs->set_cursor_position(crtc, x, y); + if (crtc_x >= mode->HDisplay || crtc_y >= mode->VDisplay || + crtc_x <= -cursor_info->MaxWidth || crtc_y <= -cursor_info->MaxHeight) { + crtc->cursor_in_range = FALSE; + xf86_crtc_hide_cursor(crtc); + } else { + crtc->cursor_in_range = TRUE; + if (crtc->driverIsPerformingTransform & XF86DriverTransformCursorPosition) + crtc->funcs->set_cursor_position(crtc, x, y); + else + crtc->funcs->set_cursor_position(crtc, crtc_x, crtc_y); xf86_crtc_show_cursor(crtc); } - else - xf86_crtc_hide_cursor(crtc); } static void @@ -492,6 +517,7 @@ xf86_load_cursor_image(ScrnInfoPtr scrn, unsigned char *src) xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; + xf86_config->cursor = xf86CurrentCursor(scrn->pScreen); for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; @@ -517,11 +543,6 @@ xf86_use_hw_cursor(ScreenPtr screen, CursorPtr cursor) xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; int c; - cursor = RefCursor(cursor); - if (xf86_config->cursor) - FreeCursor(xf86_config->cursor, None); - xf86_config->cursor = cursor; - if (cursor->bits->width > cursor_info->MaxWidth || cursor->bits->height > cursor_info->MaxHeight) return FALSE; @@ -593,6 +614,7 @@ xf86_load_cursor_argb(ScrnInfoPtr scrn, CursorPtr cursor) xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; + xf86_config->cursor = cursor; for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; @@ -638,69 +660,11 @@ xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags) cursor_info->LoadCursorARGBCheck = xf86_load_cursor_argb; } - xf86_config->cursor = NULL; xf86_hide_cursors(scrn); return xf86InitCursor(screen, cursor_info); } -/** - * Called when anything on the screen is reconfigured. - * - * Reloads cursor images as needed, then adjusts cursor positions - * @note We assume that all hardware cursors to be loaded have already been - * found to be usable by the hardware. - */ - -void -xf86_reload_cursors(ScreenPtr screen) -{ - ScrnInfoPtr scrn; - xf86CrtcConfigPtr xf86_config; - xf86CursorInfoPtr cursor_info; - CursorPtr cursor; - int x, y; - xf86CursorScreenPtr cursor_screen_priv; - - /* initial mode setting will not have set a screen yet. - May be called before the devices are initialised. - */ - if (!screen || !inputInfo.pointer) - return; - cursor_screen_priv = dixLookupPrivate(&screen->devPrivates, - xf86CursorScreenKey); - /* return if HW cursor is inactive, to avoid displaying two cursors */ - if (!cursor_screen_priv || !cursor_screen_priv->isUp) - return; - - scrn = xf86ScreenToScrn(screen); - xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - - /* make sure the cursor code has been initialized */ - cursor_info = xf86_config->cursor_info; - if (!cursor_info) - return; - - cursor = xf86_config->cursor; - GetSpritePosition(inputInfo.pointer, &x, &y); - if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN)) - (*cursor_info->HideCursor) (scrn); - - if (cursor) { - void *src = - dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey, - screen); - if (cursor->bits->argb && xf86DriverHasLoadCursorARGB(cursor_info)) - xf86DriverLoadCursorARGB(cursor_info, cursor); - else if (src) - xf86DriverLoadCursorImage(cursor_info, src); - - x += scrn->frameX0 + cursor_screen_priv->HotX; - y += scrn->frameY0 + cursor_screen_priv->HotY; - (*cursor_info->SetCursorPosition) (scrn, x, y); - } -} - /** * Clean up CRTC-based cursor code */ @@ -716,8 +680,5 @@ xf86_cursors_fini(ScreenPtr screen) } free(xf86_config->cursor_image); xf86_config->cursor_image = NULL; - if (xf86_config->cursor) { - FreeCursor(xf86_config->cursor, None); - xf86_config->cursor = NULL; - } + xf86_config->cursor = NULL; } diff --git a/xserver/hw/xfree86/modes/xf86EdidModes.c b/xserver/hw/xfree86/modes/xf86EdidModes.c index f24294ee3..f0e1e974b 100644 --- a/xserver/hw/xfree86/modes/xf86EdidModes.c +++ b/xserver/hw/xfree86/modes/xf86EdidModes.c @@ -153,6 +153,11 @@ quirk_detailed_v_in_cm(int scrnIndex, xf86MonPtr DDC) static Bool quirk_detailed_use_maximum_size(int scrnIndex, xf86MonPtr DDC) { + /* ADA 1024x600 7" display */ + if (memcmp(DDC->vendor.name, "ADA", 4) == 0 && + DDC->vendor.prod_id == 4) + return TRUE; + /* Bug #21324: Iiyama Vision Master 450 */ if (memcmp(DDC->vendor.name, "IVM", 4) == 0 && DDC->vendor.prod_id == 6400) return TRUE; diff --git a/xserver/hw/xfree86/modes/xf86RandR12.c b/xserver/hw/xfree86/modes/xf86RandR12.c index 622f4cde4..2f6f92211 100644 --- a/xserver/hw/xfree86/modes/xf86RandR12.c +++ b/xserver/hw/xfree86/modes/xf86RandR12.c @@ -40,6 +40,7 @@ #include #include +#include "xf86cmap.h" #include "xf86Crtc.h" #include "xf86RandR12.h" @@ -55,6 +56,13 @@ typedef struct _xf86RandR12Info { Rotation rotation; /* current mode */ Rotation supported_rotations; /* driver supported */ + /* Compatibility with colormaps and XF86VidMode's gamma */ + int palette_red_size; + int palette_green_size; + int palette_blue_size; + int palette_size; + LOCO *palette; + /* Used to wrap EnterVT so we can re-probe the outputs when a laptop unsuspends * (actually, any time that we switch back into our VT). * @@ -883,6 +891,9 @@ xf86RandR12Init(ScreenPtr pScreen) randrp->maxX = randrp->maxY = 0; + randrp->palette_size = 0; + randrp->palette = NULL; + dixSetPrivate(&pScreen->devPrivates, xf86RandR12Key, randrp); #if RANDR_12_INTERFACE @@ -906,6 +917,7 @@ xf86RandR12CloseScreen(ScreenPtr pScreen) pScreen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder; #endif + free(randrp->palette); free(randrp); } @@ -1155,15 +1167,15 @@ xf86RandR12CrtcSet(ScreenPtr pScreen, if (rotation != crtc->rotation) changed = TRUE; - if (crtc->current_scanout != randr_crtc->scanout_pixmap) + if (crtc->current_scanout != randr_crtc->scanout_pixmap || + crtc->current_scanout_back != randr_crtc->scanout_pixmap_back) changed = TRUE; transform = RRCrtcGetTransform(randr_crtc); if ((transform != NULL) != crtc->transformPresent) changed = TRUE; else if (transform && - memcmp(&transform->transform, &crtc->transform.transform, - sizeof(transform->transform)) != 0) + !RRTransformEqual(transform, &crtc->transform)) changed = TRUE; if (x != crtc->x || y != crtc->y) @@ -1220,6 +1232,7 @@ xf86RandR12CrtcSet(ScreenPtr pScreen, xf86SaveModeContents(&crtc->desiredMode, &mode); crtc->desiredRotation = rotation; crtc->current_scanout = randr_crtc->scanout_pixmap; + crtc->current_scanout_back = randr_crtc->scanout_pixmap_back; if (transform) { crtc->desiredTransform = *transform; crtc->desiredTransformPresent = TRUE; @@ -1236,37 +1249,62 @@ xf86RandR12CrtcSet(ScreenPtr pScreen, return xf86RandR12CrtcNotify(randr_crtc); } -static Bool -xf86RandR12CrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) +static void +xf86RandR12CrtcComputeGamma(xf86CrtcPtr crtc, LOCO *palette, + int palette_red_size, int palette_green_size, + int palette_blue_size, CARD16 *gamma_red, + CARD16 *gamma_green, CARD16 *gamma_blue, + int gamma_size) { - xf86CrtcPtr crtc = randr_crtc->devPrivate; + int gamma_slots; + unsigned shift; + CARD32 value; + int i, j; - if (crtc->funcs->gamma_set == NULL) - return FALSE; + for (shift = 0; (gamma_size << shift) < (1 << 16); shift++); - if (!crtc->scrn->vtSema) - return TRUE; + gamma_slots = crtc->gamma_size / palette_red_size; + for (i = 0; i < palette_red_size; i++) { + value = palette[i].red; + if (gamma_red) + value = gamma_red[value]; + else + value <<= shift; - /* Realloc local gamma if needed. */ - if (randr_crtc->gammaSize != crtc->gamma_size) { - CARD16 *tmp_ptr; - - tmp_ptr = reallocarray(crtc->gamma_red, - randr_crtc->gammaSize, 3 * sizeof(CARD16)); - if (!tmp_ptr) - return FALSE; - crtc->gamma_red = tmp_ptr; - crtc->gamma_green = crtc->gamma_red + randr_crtc->gammaSize; - crtc->gamma_blue = crtc->gamma_green + randr_crtc->gammaSize; + for (j = 0; j < gamma_slots; j++) + crtc->gamma_red[i * gamma_slots + j] = value; } - crtc->gamma_size = randr_crtc->gammaSize; - memcpy(crtc->gamma_red, randr_crtc->gammaRed, - crtc->gamma_size * sizeof(CARD16)); - memcpy(crtc->gamma_green, randr_crtc->gammaGreen, - crtc->gamma_size * sizeof(CARD16)); - memcpy(crtc->gamma_blue, randr_crtc->gammaBlue, - crtc->gamma_size * sizeof(CARD16)); + gamma_slots = crtc->gamma_size / palette_green_size; + for (i = 0; i < palette_green_size; i++) { + value = palette[i].green; + if (gamma_green) + value = gamma_green[value]; + else + value <<= shift; + + for (j = 0; j < gamma_slots; j++) + crtc->gamma_green[i * gamma_slots + j] = value; + } + + gamma_slots = crtc->gamma_size / palette_blue_size; + for (i = 0; i < palette_blue_size; i++) { + value = palette[i].blue; + if (gamma_blue) + value = gamma_blue[value]; + else + value <<= shift; + + for (j = 0; j < gamma_slots; j++) + crtc->gamma_blue[i * gamma_slots + j] = value; + } +} + +static void +xf86RandR12CrtcReloadGamma(xf86CrtcPtr crtc) +{ + if (!crtc->scrn->vtSema || !crtc->funcs->gamma_set) + return; /* Only set it when the crtc is actually running. * Otherwise it will be set when it's activated. @@ -1274,40 +1312,157 @@ xf86RandR12CrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) if (crtc->active) crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, crtc->gamma_blue, crtc->gamma_size); +} + +static Bool +xf86RandR12CrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) +{ + XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); + xf86CrtcPtr crtc = randr_crtc->devPrivate; + + if (crtc->funcs->gamma_set == NULL) + return FALSE; + + if (randrp->palette_size) { + xf86RandR12CrtcComputeGamma(crtc, randrp->palette, + randrp->palette_red_size, + randrp->palette_green_size, + randrp->palette_blue_size, + randr_crtc->gammaRed, + randr_crtc->gammaGreen, + randr_crtc->gammaBlue, + randr_crtc->gammaSize); + } else { + memcpy(crtc->gamma_red, randr_crtc->gammaRed, + crtc->gamma_size * sizeof(crtc->gamma_red[0])); + memcpy(crtc->gamma_green, randr_crtc->gammaGreen, + crtc->gamma_size * sizeof(crtc->gamma_green[0])); + memcpy(crtc->gamma_blue, randr_crtc->gammaBlue, + crtc->gamma_size * sizeof(crtc->gamma_blue[0])); + } + + xf86RandR12CrtcReloadGamma(crtc); + + return TRUE; +} + +static void +init_one_component(CARD16 *comp, unsigned size, float gamma) +{ + int i; + unsigned shift; + + for (shift = 0; (size << shift) < (1 << 16); shift++); + + if (gamma == 1.0) { + for (i = 0; i < size; i++) + comp[i] = i << shift; + } else { + for (i = 0; i < size; i++) + comp[i] = (CARD16) (pow((double) i / (double) (size - 1), + 1. / (double) gamma) * + (double) (size - 1) * (1 << shift)); + } +} + +static Bool +xf86RandR12CrtcInitGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green, + float gamma_blue) +{ + unsigned size = crtc->randr_crtc->gammaSize; + CARD16 *red, *green, *blue; + + if (!crtc->funcs->gamma_set && + (gamma_red != 1.0f || gamma_green != 1.0f || gamma_blue != 1.0f)) + return FALSE; + + red = xallocarray(size, 3 * sizeof(CARD16)); + if (!red) + return FALSE; + + green = red + size; + blue = green + size; + + init_one_component(red, size, gamma_red); + init_one_component(green, size, gamma_green); + init_one_component(blue, size, gamma_blue); + + RRCrtcGammaSet(crtc->randr_crtc, red, green, blue); + free(red); return TRUE; } static Bool -xf86RandR12CrtcGetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) +xf86RandR12OutputInitGamma(xf86OutputPtr output) { - xf86CrtcPtr crtc = randr_crtc->devPrivate; + XF86ConfMonitorPtr mon = output->conf_monitor; + float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0; - if (!crtc->gamma_size) - return FALSE; + if (!mon) + return TRUE; - if (!crtc->gamma_red || !crtc->gamma_green || !crtc->gamma_blue) - return FALSE; + /* Get configured values, where they exist. */ + if (mon->mon_gamma_red >= GAMMA_MIN && mon->mon_gamma_red <= GAMMA_MAX) + gamma_red = mon->mon_gamma_red; - /* Realloc randr gamma if needed. */ - if (randr_crtc->gammaSize != crtc->gamma_size) { - CARD16 *tmp_ptr; + if (mon->mon_gamma_green >= GAMMA_MIN && mon->mon_gamma_green <= GAMMA_MAX) + gamma_green = mon->mon_gamma_green; - tmp_ptr = reallocarray(randr_crtc->gammaRed, - crtc->gamma_size, 3 * sizeof(CARD16)); - if (!tmp_ptr) - return FALSE; - randr_crtc->gammaRed = tmp_ptr; - randr_crtc->gammaGreen = randr_crtc->gammaRed + crtc->gamma_size; - randr_crtc->gammaBlue = randr_crtc->gammaGreen + crtc->gamma_size; + if (mon->mon_gamma_blue >= GAMMA_MIN && mon->mon_gamma_blue <= GAMMA_MAX) + gamma_blue = mon->mon_gamma_blue; + + /* Don't set gamma 1.0 if another cloned output on this CRTC already set a + * different gamma + */ + if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) { + if (!output->crtc->randr_crtc) { + xf86DrvMsg(output->scrn->scrnIndex, X_WARNING, + "Gamma correction for output %s not possible because " + "RandR is disabled\n", output->name); + return TRUE; + } + + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, + "Output %s wants gamma correction (%.1f, %.1f, %.1f)\n", + output->name, gamma_red, gamma_green, gamma_blue); + return xf86RandR12CrtcInitGamma(output->crtc, gamma_red, gamma_green, + gamma_blue); + } + + return TRUE; +} + +Bool +xf86RandR12InitGamma(ScrnInfoPtr pScrn, unsigned gammaSize) { + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + int o, c; + + /* Set default gamma for all CRTCs + * This is done to avoid problems later on with cloned outputs + */ + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + + if (!crtc->randr_crtc) + continue; + + if (!RRCrtcGammaSetSize(crtc->randr_crtc, gammaSize) || + !xf86RandR12CrtcInitGamma(crtc, 1.0f, 1.0f, 1.0f)) + return FALSE; + } + + /* Set initial gamma per monitor configuration + */ + for (o = 0; o < config->num_output; o++) { + xf86OutputPtr output = config->output[o]; + + if (output->crtc && + !xf86RandR12OutputInitGamma(output)) + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Initial gamma correction for output %s: failed.\n", + output->name); } - randr_crtc->gammaSize = crtc->gamma_size; - memcpy(randr_crtc->gammaRed, crtc->gamma_red, - crtc->gamma_size * sizeof(CARD16)); - memcpy(randr_crtc->gammaGreen, crtc->gamma_green, - crtc->gamma_size * sizeof(CARD16)); - memcpy(randr_crtc->gammaBlue, crtc->gamma_blue, - crtc->gamma_size * sizeof(CARD16)); return TRUE; } @@ -1532,7 +1687,6 @@ xf86RandR12CreateObjects12(ScreenPtr pScreen) xf86CrtcPtr crtc = config->crtc[c]; crtc->randr_crtc = RRCrtcCreate(pScreen, crtc); - RRCrtcGammaSetSize(crtc->randr_crtc, 256); } /* * Configure outputs @@ -1627,6 +1781,7 @@ xf86RandR12CreateScreenResources12(ScreenPtr pScreen) { int c; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + rrScrPrivPtr rp = rrGetScrPriv(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); if (xf86RandR12Key == NULL) @@ -1639,6 +1794,13 @@ xf86RandR12CreateScreenResources12(ScreenPtr pScreen) config->maxWidth, config->maxHeight); xf86RandR12CreateMonitors(pScreen); + + if (!pScreen->isGPU) { + rp->primaryOutput = config->output[0]->randr_output; + RROutputChanged(rp->primaryOutput, FALSE); + rp->layoutChanged = TRUE; + } + return TRUE; } @@ -1739,53 +1901,98 @@ xf86RandR13SetPanning(ScreenPtr pScreen, } /* - * Compatibility with XF86VidMode's gamma changer. This necessarily clobbers - * any per-crtc setup. You asked for it... + * Compatibility with colormaps and XF86VidMode's gamma */ - -static void -gamma_to_ramp(float gamma, CARD16 *ramp, int size) +void +xf86RandR12LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, + LOCO *colors, VisualPtr pVisual) { - int i; + ScreenPtr pScreen = pScrn->pScreen; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + int reds, greens, blues, index, palette_size; + int c, i; - for (i = 0; i < size; i++) { - if (gamma == 1.0) - ramp[i] = i | i << 8; - else - ramp[i] = - (CARD16) (pow((double) i / (double) (size - 1), 1. / gamma) - * (double) (size - 1) * 257); + if (pVisual->class == TrueColor || pVisual->class == DirectColor) { + reds = (pVisual->redMask >> pVisual->offsetRed) + 1; + greens = (pVisual->greenMask >> pVisual->offsetGreen) + 1; + blues = (pVisual->blueMask >> pVisual->offsetBlue) + 1; + } else { + reds = greens = blues = pVisual->ColormapEntries; + } + + palette_size = max(reds, max(greens, blues)); + + if (dixPrivateKeyRegistered(rrPrivKey)) { + XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); + + if (randrp->palette_size != palette_size) { + randrp->palette = reallocarray(randrp->palette, palette_size, + sizeof(colors[0])); + if (!randrp->palette) { + randrp->palette_size = 0; + return; + } + + randrp->palette_size = palette_size; + } + randrp->palette_red_size = reds; + randrp->palette_green_size = greens; + randrp->palette_blue_size = blues; + + for (i = 0; i < numColors; i++) { + index = indices[i]; + + if (index < reds) + randrp->palette[index].red = colors[index].red; + if (index < greens) + randrp->palette[index].green = colors[index].green; + if (index < blues) + randrp->palette[index].blue = colors[index].blue; + } + } + + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + RRCrtcPtr randr_crtc = crtc->randr_crtc; + + if (randr_crtc) { + xf86RandR12CrtcComputeGamma(crtc, colors, reds, greens, blues, + randr_crtc->gammaRed, + randr_crtc->gammaGreen, + randr_crtc->gammaBlue, + randr_crtc->gammaSize); + } else { + xf86RandR12CrtcComputeGamma(crtc, colors, reds, greens, blues, + NULL, NULL, NULL, + xf86GetGammaRampSize(pScreen)); + } + xf86RandR12CrtcReloadGamma(crtc); } } +/* + * Compatibility pScrn->ChangeGamma provider for ddx drivers which do not call + * xf86HandleColormaps(). Note such drivers really should be fixed to call + * xf86HandleColormaps() as this clobbers the per-CRTC gamma ramp of the CRTC + * assigned to the RandR compatibility output. + */ static int xf86RandR12ChangeGamma(ScrnInfoPtr pScrn, Gamma gamma) { - CARD16 *points, *red, *green, *blue; - RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); + RRCrtcPtr randr_crtc = xf86CompatRRCrtc(pScrn); int size; - if (!crtc) + if (!randr_crtc) return Success; - size = max(0, crtc->gammaSize); + size = max(0, randr_crtc->gammaSize); if (!size) return Success; - points = calloc(size, 3 * sizeof(CARD16)); - if (!points) - return BadAlloc; - - red = points; - green = points + size; - blue = points + 2 * size; - - gamma_to_ramp(gamma.red, red, size); - gamma_to_ramp(gamma.green, green, size); - gamma_to_ramp(gamma.blue, blue, size); - RRCrtcGammaSet(crtc, red, green, blue); - - free(points); + init_one_component(randr_crtc->gammaRed, size, gamma.red); + init_one_component(randr_crtc->gammaGreen, size, gamma.green); + init_one_component(randr_crtc->gammaBlue, size, gamma.blue); + xf86RandR12CrtcSetGamma(xf86ScrnToScreen(pScrn), randr_crtc); pScrn->gamma = gamma; @@ -1812,7 +2019,7 @@ xf86RandR12EnterVT(ScrnInfoPtr pScrn) /* reload gamma */ for (i = 0; i < rp->numCrtcs; i++) - xf86RandR12CrtcSetGamma(pScreen, rp->crtcs[i]); + xf86RandR12CrtcReloadGamma(rp->crtcs[i]->devPrivate); return RRGetInfo(pScreen, TRUE); /* force a re-probe of outputs and notify clients about changes */ } @@ -1837,10 +2044,7 @@ xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen, { if (!source_provider) { if (provider->output_source) { - ScreenPtr cmScreen = pScreen->current_master; - xf86DetachOutputGPU(pScreen); - AttachUnboundGPU(cmScreen, pScreen); } provider->output_source = NULL; return TRUE; @@ -1851,7 +2055,6 @@ xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen, SetRootClip(source_provider->pScreen, ROOT_CLIP_NONE); - DetachUnboundGPU(pScreen); AttachOutputGPU(source_provider->pScreen, pScreen); provider->output_source = source_provider; @@ -1866,9 +2069,7 @@ xf86RandR14ProviderSetOffloadSink(ScreenPtr pScreen, { if (!sink_provider) { if (provider->offload_sink) { - ScreenPtr cmScreen = pScreen->current_master; xf86DetachOutputGPU(pScreen); - AttachUnboundGPU(cmScreen, pScreen); } provider->offload_sink = NULL; @@ -1878,7 +2079,6 @@ xf86RandR14ProviderSetOffloadSink(ScreenPtr pScreen, if (provider->offload_sink == sink_provider) return TRUE; - DetachUnboundGPU(pScreen); AttachOffloadGPU(sink_provider->pScreen, pScreen); provider->offload_sink = sink_provider; @@ -1957,12 +2157,12 @@ xf86RandR14ProviderDestroy(ScreenPtr screen, RRProviderPtr provider) config->randr_provider->offload_sink = NULL; RRSetChanged(screen); } - else if (config->randr_provider->output_source) { + if (config->randr_provider->output_source) { xf86DetachOutputGPU(screen); config->randr_provider->output_source = NULL; RRSetChanged(screen); } - else if (screen->current_master) + if (screen->current_master) DetachUnboundGPU(screen); } config->randr_provider = NULL; @@ -1974,13 +2174,11 @@ xf86RandR12Init12(ScreenPtr pScreen) ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); rrScrPrivPtr rp = rrGetScrPriv(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); - int i; rp->rrGetInfo = xf86RandR12GetInfo12; rp->rrScreenSetSize = xf86RandR12ScreenSetSize; rp->rrCrtcSet = xf86RandR12CrtcSet; rp->rrCrtcSetGamma = xf86RandR12CrtcSetGamma; - rp->rrCrtcGetGamma = xf86RandR12CrtcGetGamma; rp->rrOutputSetProperty = xf86RandR12OutputSetProperty; rp->rrOutputValidateMode = xf86RandR12OutputValidateMode; #if RANDR_13_INTERFACE @@ -2017,9 +2215,10 @@ xf86RandR12Init12(ScreenPtr pScreen) */ if (!xf86RandR12SetInfo12(pScreen)) return FALSE; - for (i = 0; i < rp->numCrtcs; i++) { - xf86RandR12CrtcGetGamma(pScreen, rp->crtcs[i]); - } + + if (!xf86RandR12InitGamma(pScrn, 256)) + return FALSE; + return TRUE; } diff --git a/xserver/hw/xfree86/modes/xf86RandR12.h b/xserver/hw/xfree86/modes/xf86RandR12.h index e603799be..31aaaaf28 100644 --- a/xserver/hw/xfree86/modes/xf86RandR12.h +++ b/xserver/hw/xfree86/modes/xf86RandR12.h @@ -40,4 +40,9 @@ extern _X_EXPORT void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, extern _X_EXPORT Bool xf86RandR12PreInit(ScrnInfoPtr pScrn); 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_ */ diff --git a/xserver/hw/xfree86/modes/xf86Rotate.c b/xserver/hw/xfree86/modes/xf86Rotate.c index 4aa8f8d82..13e5a5059 100644 --- a/xserver/hw/xfree86/modes/xf86Rotate.c +++ b/xserver/hw/xfree86/modes/xf86Rotate.c @@ -57,7 +57,7 @@ xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, RegionPtr region) BoxPtr b = RegionRects(region); XID include_inferiors = IncludeInferiors; - if (crtc->driverIsPerformingTransform) + if (crtc->driverIsPerformingTransform & XF86DriverTransformOutput) return; src = CreatePicture(None, @@ -221,8 +221,7 @@ xf86RotateRedisplay(ScreenPtr pScreen) } static void -xf86RotateBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadmask) +xf86RotateBlockHandler(ScreenPtr pScreen, void *pTimeout) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); @@ -235,7 +234,7 @@ xf86RotateBlockHandler(ScreenPtr pScreen, xf86RotateRedisplay(pScreen); - (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout); /* Re-wrap if we still need this hook */ if (xf86_config->rotation_damage != NULL) { @@ -387,7 +386,7 @@ xf86CrtcRotate(xf86CrtcPtr crtc) new_height = 0; } else { - if (crtc->driverIsPerformingTransform) { + if (crtc->driverIsPerformingTransform & XF86DriverTransformOutput) { xf86RotateDestroy(crtc); } else { diff --git a/xserver/hw/xfree86/os-support/Makefile.in b/xserver/hw/xfree86/os-support/Makefile.in index 51e61a288..3d6f65a09 100644 --- a/xserver/hw/xfree86/os-support/Makefile.in +++ b/xserver/hw/xfree86/os-support/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -363,6 +364,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -393,7 +397,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -488,6 +495,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/os-support/bsd/Makefile.in b/xserver/hw/xfree86/os-support/bsd/Makefile.in index a4ecc3dc1..2e41e7664 100644 --- a/xserver/hw/xfree86/os-support/bsd/Makefile.in +++ b/xserver/hw/xfree86/os-support/bsd/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -334,6 +335,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -364,7 +368,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -459,6 +466,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_init.c b/xserver/hw/xfree86/os-support/bsd/bsd_init.c index 8c1e28f06..be2db06c4 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_init.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_init.c @@ -285,7 +285,7 @@ acquire_vt: xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n"); } - signal(SIGUSR2, xf86VTRequest); + OsSignal(SIGUSR2, xf86VTRequest); vtmode.mode = VT_PROCESS; vtmode.relsig = SIGUSR2; diff --git a/xserver/hw/xfree86/os-support/bsd/ppc_video.c b/xserver/hw/xfree86/os-support/bsd/ppc_video.c index cb7d4ed92..aea0d9902 100644 --- a/xserver/hw/xfree86/os-support/bsd/ppc_video.c +++ b/xserver/hw/xfree86/os-support/bsd/ppc_video.c @@ -53,9 +53,9 @@ void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { xf86OpenConsole(); - + pVidMem->initialised = TRUE; - + pci_system_init_dev_mem(xf86Info.consoleFd); xf86EnableIO(); } diff --git a/xserver/hw/xfree86/os-support/bsd/sparc64_video.c b/xserver/hw/xfree86/os-support/bsd/sparc64_video.c index cfee3e1da..ec24c5c05 100644 --- a/xserver/hw/xfree86/os-support/bsd/sparc64_video.c +++ b/xserver/hw/xfree86/os-support/bsd/sparc64_video.c @@ -38,9 +38,6 @@ /* Video Memory Mapping section */ /***************************************************************************/ -static void *sparc64MapVidMem(int, unsigned long, unsigned long, int); -static void sparc64UnmapVidMem(int, void *, unsigned long); - void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { diff --git a/xserver/hw/xfree86/os-support/bus/Makefile.in b/xserver/hw/xfree86/os-support/bus/Makefile.in index 859a7ca27..c3ae11787 100644 --- a/xserver/hw/xfree86/os-support/bus/Makefile.in +++ b/xserver/hw/xfree86/os-support/bus/Makefile.in @@ -59,9 +59,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -337,6 +338,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -367,7 +371,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -462,6 +469,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/os-support/bus/Sbus.c b/xserver/hw/xfree86/os-support/bus/Sbus.c index 86b4d685a..a5265770c 100644 --- a/xserver/hw/xfree86/os-support/bus/Sbus.c +++ b/xserver/hw/xfree86/os-support/bus/Sbus.c @@ -31,7 +31,7 @@ #include #include #include -#ifdef sun +#ifdef __sun #include #endif #include "xf86.h" @@ -173,7 +173,7 @@ promIsP1275(void) break; } fclose(f); -#elif defined(sun) +#elif defined(__sun) struct utsname buffer; if ((uname(&buffer) >= 0) && !strcmp(buffer.machine, "sun4u")) diff --git a/xserver/hw/xfree86/os-support/hurd/Makefile.in b/xserver/hw/xfree86/os-support/hurd/Makefile.in index bc9000072..504c9e483 100644 --- a/xserver/hw/xfree86/os-support/hurd/Makefile.in +++ b/xserver/hw/xfree86/os-support/hurd/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -300,6 +301,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -330,7 +334,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -425,6 +432,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/os-support/linux/Makefile.in b/xserver/hw/xfree86/os-support/linux/Makefile.in index 55df9d3ee..014eaab38 100644 --- a/xserver/hw/xfree86/os-support/linux/Makefile.in +++ b/xserver/hw/xfree86/os-support/linux/Makefile.in @@ -59,9 +59,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -324,6 +325,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -354,7 +358,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -450,6 +457,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/os-support/linux/lnx_init.c b/xserver/hw/xfree86/os-support/linux/lnx_init.c index ca174938d..9e5ddcd50 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_init.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_init.c @@ -38,6 +38,9 @@ #include "xf86_OSlib.h" #include +#ifdef HAVE_SYS_SYSMACROS_H +#include +#endif #ifndef K_OFF #define K_OFF 0x4 @@ -239,7 +242,7 @@ xf86OpenConsole(void) FatalError("xf86OpenConsole: VT_GETMODE failed %s\n", strerror(errno)); - signal(SIGUSR1, xf86VTRequest); + OsSignal(SIGUSR1, xf86VTRequest); VT.mode = VT_PROCESS; VT.relsig = SIGUSR1; diff --git a/xserver/hw/xfree86/os-support/misc/Makefile.in b/xserver/hw/xfree86/os-support/misc/Makefile.in index 05340042d..bb80b923a 100644 --- a/xserver/hw/xfree86/os-support/misc/Makefile.in +++ b/xserver/hw/xfree86/os-support/misc/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -298,6 +299,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -328,7 +332,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -423,6 +430,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/os-support/shared/VTsw_usl.c b/xserver/hw/xfree86/os-support/shared/VTsw_usl.c index f20106c90..64402616e 100644 --- a/xserver/hw/xfree86/os-support/shared/VTsw_usl.c +++ b/xserver/hw/xfree86/os-support/shared/VTsw_usl.c @@ -43,7 +43,7 @@ void xf86VTRequest(int sig) { - signal(sig, (void (*)(int)) xf86VTRequest); + OsSignal(sig, (void (*)(int)) xf86VTRequest); xf86Info.vtRequestsPending = TRUE; return; } diff --git a/xserver/hw/xfree86/os-support/shared/posix_tty.c b/xserver/hw/xfree86/os-support/shared/posix_tty.c index ce758602d..2b287b38f 100644 --- a/xserver/hw/xfree86/os-support/shared/posix_tty.c +++ b/xserver/hw/xfree86/os-support/shared/posix_tty.c @@ -57,6 +57,7 @@ #endif #include +#include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" @@ -391,26 +392,22 @@ xf86CloseSerial(int fd) int xf86WaitForInput(int fd, int timeout) { - fd_set readfds; - struct timeval to; int r; + struct pollfd poll_fd; - FD_ZERO(&readfds); + poll_fd.fd = fd; + poll_fd.events = POLLIN; + + /* convert microseconds to milliseconds */ + timeout = (timeout + 999) / 1000; if (fd >= 0) { - FD_SET(fd, &readfds); - } - - to.tv_sec = timeout / 1000000; - to.tv_usec = timeout % 1000000; - - if (fd >= 0) { - SYSCALL(r = select(FD_SETSIZE, &readfds, NULL, NULL, &to)); + SYSCALL(r = xserver_poll(&poll_fd, 1, timeout)); } else { - SYSCALL(r = select(FD_SETSIZE, NULL, NULL, NULL, &to)); + SYSCALL(r = xserver_poll(&poll_fd, 0, timeout)); } - xf86ErrorFVerb(9, "select returned %d\n", r); + xf86ErrorFVerb(9, "poll returned %d\n", r); return r; } @@ -427,8 +424,7 @@ xf86SerialSendBreak(int fd, int duration) int xf86FlushInput(int fd) { - fd_set fds; - struct timeval timeout; + struct pollfd poll_fd; /* this needs to be big enough to flush an evdev event. */ char c[256]; @@ -436,15 +432,11 @@ xf86FlushInput(int fd) if (tcflush(fd, TCIFLUSH) == 0) return 0; - timeout.tv_sec = 0; - timeout.tv_usec = 0; - FD_ZERO(&fds); - FD_SET(fd, &fds); - while (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) { + poll_fd.fd = fd; + poll_fd.events = POLLIN; + while (xserver_poll(&poll_fd, 1, 0) > 0) { if (read(fd, &c, sizeof(c)) < 1) return 0; - FD_ZERO(&fds); - FD_SET(fd, &fds); } return 0; } diff --git a/xserver/hw/xfree86/os-support/shared/sigio.c b/xserver/hw/xfree86/os-support/shared/sigio.c index c746d02fc..884a71c61 100644 --- a/xserver/hw/xfree86/os-support/shared/sigio.c +++ b/xserver/hw/xfree86/os-support/shared/sigio.c @@ -57,6 +57,7 @@ #endif #include +#include #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" @@ -83,8 +84,36 @@ typedef struct _xf86SigIOFunc { static Xf86SigIOFunc xf86SigIOFuncs[MAX_FUNCS]; static int xf86SigIOMax; -static int xf86SigIOMaxFd; -static fd_set xf86SigIOMask; +static struct pollfd *xf86SigIOFds; +static int xf86SigIONum; + +static Bool +xf86SigIOAdd(int fd) +{ + struct pollfd *n; + + n = realloc(xf86SigIOFds, (xf86SigIONum + 1) * sizeof (struct pollfd)); + if (!n) + return FALSE; + + n[xf86SigIONum].fd = fd; + n[xf86SigIONum].events = POLLIN; + xf86SigIONum++; + xf86SigIOFds = n; + return TRUE; +} + +static void +xf86SigIORemove(int fd) +{ + int i; + for (i = 0; i < xf86SigIONum; i++) + if (xf86SigIOFds[i].fd == fd) { + memmove(&xf86SigIOFds[i], &xf86SigIOFds[i+1], (xf86SigIONum - i - 1) * sizeof (struct pollfd)); + xf86SigIONum--; + break; + } +} /* * SIGIO gives no way of discovering which fd signalled, select @@ -93,24 +122,22 @@ static fd_set xf86SigIOMask; static void xf86SIGIO(int sig) { - int i; - fd_set ready; - struct timeval to; + int i, f; int save_errno = errno; /* do not clobber the global errno */ int r; inSignalContext = TRUE; - ready = xf86SigIOMask; - to.tv_sec = 0; - to.tv_usec = 0; - SYSCALL(r = select(xf86SigIOMaxFd, &ready, 0, 0, &to)); - for (i = 0; r > 0 && i < xf86SigIOMax; i++) - if (xf86SigIOFuncs[i].f && FD_ISSET(xf86SigIOFuncs[i].fd, &ready)) { - (*xf86SigIOFuncs[i].f) (xf86SigIOFuncs[i].fd, - xf86SigIOFuncs[i].closure); + SYSCALL(r = xserver_poll(xf86SigIOFds, xf86SigIONum, 0)); + for (f = 0; r > 0 && f < xf86SigIONum; f++) { + if (xf86SigIOFds[f].revents & POLLIN) { + for (i = 0; i < xf86SigIOMax; i++) + if (xf86SigIOFuncs[i].f && xf86SigIOFuncs[i].fd == xf86SigIOFds[f].fd) + (*xf86SigIOFuncs[i].f) (xf86SigIOFuncs[i].fd, + xf86SigIOFuncs[i].closure); r--; } + } if (r > 0) { xf86Msg(X_ERROR, "SIGIO %d descriptors not handled\n", r); } @@ -130,6 +157,26 @@ xf86IsPipe(int fd) return S_ISFIFO(buf.st_mode); } +static void +block_sigio(void) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGIO); + xthread_sigmask(SIG_BLOCK, &set, NULL); +} + +static void +release_sigio(void) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGIO); + xthread_sigmask(SIG_UNBLOCK, &set, NULL); +} + int xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) { @@ -145,7 +192,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) if (!xf86SigIOFuncs[i].f) { if (xf86IsPipe(fd)) return 0; - OsBlockSIGIO(); + block_sigio(); #ifdef O_ASYNC if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) { xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n", @@ -173,7 +220,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) } #endif if (!installed) { - OsReleaseSIGIO(); + release_sigio(); return 0; } sigemptyset(&sa.sa_mask); @@ -186,10 +233,8 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) xf86SigIOFuncs[i].f = f; if (i >= xf86SigIOMax) xf86SigIOMax = i + 1; - if (fd >= xf86SigIOMaxFd) - xf86SigIOMaxFd = fd + 1; - FD_SET(fd, &xf86SigIOMask); - OsReleaseSIGIO(); + xf86SigIOAdd(fd); + release_sigio(); return 1; } /* Allow overwriting of the closure and callback */ @@ -209,14 +254,12 @@ xf86RemoveSIGIOHandler(int fd) struct sigaction osa; int i; int max; - int maxfd; int ret; if (!xf86Info.useSIGIO) return 0; max = 0; - maxfd = -1; ret = 0; for (i = 0; i < MAX_FUNCS; i++) { if (xf86SigIOFuncs[i].f) { @@ -224,13 +267,11 @@ xf86RemoveSIGIOHandler(int fd) xf86SigIOFuncs[i].f = 0; xf86SigIOFuncs[i].fd = 0; xf86SigIOFuncs[i].closure = 0; - FD_CLR(fd, &xf86SigIOMask); + xf86SigIORemove(fd); ret = 1; } else { max = i + 1; - if (xf86SigIOFuncs[i].fd >= maxfd) - maxfd = xf86SigIOFuncs[i].fd + 1; } } } @@ -247,7 +288,6 @@ xf86RemoveSIGIOHandler(int fd) } #endif xf86SigIOMax = max; - xf86SigIOMaxFd = maxfd; if (!max) { sigemptyset(&sa.sa_mask); sigaddset(&sa.sa_mask, SIGIO); @@ -258,34 +298,3 @@ xf86RemoveSIGIOHandler(int fd) } return ret; } - -int -xf86BlockSIGIO(void) -{ - return OsBlockSIGIO(); -} - -void -xf86UnblockSIGIO(int wasset) -{ - OsReleaseSIGIO(); -} - -void -xf86AssertBlockedSIGIO(char *where) -{ - sigset_t set, old; - - sigemptyset(&set); - sigprocmask(SIG_BLOCK, &set, &old); - if (!sigismember(&old, SIGIO)) - xf86Msg(X_ERROR, "SIGIO not blocked at %s\n", where); -} - -/* XXX This is a quick hack for the benefit of xf86SetSilkenMouse() */ - -int -xf86SIGIOSupported(void) -{ - return 1; -} diff --git a/xserver/hw/xfree86/os-support/shared/sigiostubs.c b/xserver/hw/xfree86/os-support/shared/sigiostubs.c index ba8e234f4..d1792e8ac 100644 --- a/xserver/hw/xfree86/os-support/shared/sigiostubs.c +++ b/xserver/hw/xfree86/os-support/shared/sigiostubs.c @@ -45,26 +45,3 @@ xf86RemoveSIGIOHandler(int fd) { return 0; } - -int -xf86BlockSIGIO(void) -{ - return 0; -} - -void -xf86UnblockSIGIO(int wasset) -{ -} - -void -xf86AssertBlockedSIGIO(char *where) -{ -} - -/* XXX This is a quick hack for the benefit of xf86SetSilkenMouse() */ -Bool -xf86SIGIOSupported() -{ - return FALSE; -} diff --git a/xserver/hw/xfree86/os-support/solaris/Makefile.in b/xserver/hw/xfree86/os-support/solaris/Makefile.in index 8995199f3..00e3566cf 100644 --- a/xserver/hw/xfree86/os-support/solaris/Makefile.in +++ b/xserver/hw/xfree86/os-support/solaris/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -353,6 +354,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -383,7 +387,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -478,6 +485,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/os-support/solaris/sun_bell.c b/xserver/hw/xfree86/os-support/solaris/sun_bell.c index beb13d2e9..883728e51 100644 --- a/xserver/hw/xfree86/os-support/solaris/sun_bell.c +++ b/xserver/hw/xfree86/os-support/solaris/sun_bell.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "xf86.h" #include "xf86Priv.h" @@ -163,7 +163,7 @@ xf86OSRingBell(int loudness, int pitch, int duration) /* sleep a little to allow audio buffer to drain */ naptime = BELL_MS * i; - poll(NULL, 0, naptime); + xserver_poll(NULL, 0, naptime); i = ((sizeof(samples) * iovcnt) - written) % sizeof(samples); iovcnt = 0; diff --git a/xserver/hw/xfree86/os-support/stub/Makefile.in b/xserver/hw/xfree86/os-support/stub/Makefile.in index a4827ca85..fbf7416b7 100644 --- a/xserver/hw/xfree86/os-support/stub/Makefile.in +++ b/xserver/hw/xfree86/os-support/stub/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -300,6 +301,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -330,7 +334,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -425,6 +432,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/os-support/xf86_OSlib.h b/xserver/hw/xfree86/os-support/xf86_OSlib.h index c7b295ae9..5d78c66e3 100644 --- a/xserver/hw/xfree86/os-support/xf86_OSlib.h +++ b/xserver/hw/xfree86/os-support/xf86_OSlib.h @@ -84,7 +84,7 @@ /* SYSV386 (SVR3, SVR4), including Solaris */ /**************************************************************************/ #if (defined(SYSV) || defined(SVR4)) && \ - (defined(sun) || defined(__i386__)) + (defined(__sun) || defined(__i386__)) #include #include #include @@ -94,21 +94,21 @@ #include #if defined(_NEED_SYSI86) -#if !(defined (sun) && defined (SVR4)) +#if !(defined (__sun) && defined (SVR4)) #include #include #include #endif #include #include -#if defined(SVR4) && !defined(sun) +#if defined(SVR4) && !defined(__sun) #include -#endif /* SVR4 && !sun */ +#endif /* SVR4 && !__sun */ /* V86SC_IOPL was moved to on Solaris 7 and later */ #if !defined(V86SC_IOPL) /* Solaris 7 or later? */ #include /* Nope */ #endif -#if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4) +#if defined(__sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4) #include #endif #endif /* _NEED_SYSI86 */ @@ -122,14 +122,14 @@ #include /* MMAP driver header */ #endif -#if !defined(sun) || defined(HAVE_SYS_VT_H) +#if !defined(__sun) || defined(HAVE_SYS_VT_H) #define HAS_USL_VTS #endif -#if !defined(sun) +#if !defined(__sun) #include #endif #if defined(HAS_USL_VTS) -#if !defined(sun) +#if !defined(__sun) #include #endif #include @@ -139,7 +139,7 @@ extern _X_HIDDEN void xf86VTAcquire(int); extern _X_HIDDEN void xf86VTRelease(int); #endif -#if defined(sun) +#if defined(__sun) #include extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; @@ -156,7 +156,7 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; #define LED_NUM LED_NUM_LOCK #define LED_SCR LED_SCROLL_LOCK #define LED_COMP LED_COMPOSE -#endif /* sun */ +#endif /* __sun */ #if !defined(VT_ACKACQ) #define VT_ACKACQ 2 @@ -164,7 +164,7 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; #if defined(SVR4) #include -#if !(defined(sun) && defined (SVR4)) +#if !(defined(__sun) && defined (SVR4)) #define DEV_MEM "/dev/pmem" #endif #define CLEARDTR_SUPPORT diff --git a/xserver/hw/xfree86/os-support/xf86_OSproc.h b/xserver/hw/xfree86/os-support/xf86_OSproc.h index 8d69d321c..fd8d4bdeb 100644 --- a/xserver/hw/xfree86/os-support/xf86_OSproc.h +++ b/xserver/hw/xfree86/os-support/xf86_OSproc.h @@ -169,10 +169,6 @@ extern _X_EXPORT Bool xf86GARTCloseScreen(int screenNum); extern _X_EXPORT int xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *); extern _X_EXPORT int xf86RemoveSIGIOHandler(int fd); -extern _X_EXPORT int xf86BlockSIGIO(void); -extern _X_EXPORT void xf86UnblockSIGIO(int); -extern _X_EXPORT void xf86AssertBlockedSIGIO(char *); -extern _X_EXPORT Bool xf86SIGIOSupported(void); #ifdef XF86_OS_PRIVS typedef void (*PMClose) (void); diff --git a/xserver/hw/xfree86/parser/DRI.c b/xserver/hw/xfree86/parser/DRI.c index 9ed5b9ea9..31f447d05 100644 --- a/xserver/hw/xfree86/parser/DRI.c +++ b/xserver/hw/xfree86/parser/DRI.c @@ -37,7 +37,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec DRITab[] = { +static const xf86ConfigSymTabRec DRITab[] = { {ENDSECTION, "endsection"}, {GROUP, "group"}, {MODE, "mode"}, diff --git a/xserver/hw/xfree86/parser/Device.c b/xserver/hw/xfree86/parser/Device.c index 7e49843bd..353d48c64 100644 --- a/xserver/hw/xfree86/parser/Device.c +++ b/xserver/hw/xfree86/parser/Device.c @@ -61,8 +61,7 @@ #include "Configint.h" -static -xf86ConfigSymTabRec DeviceTab[] = { +static const xf86ConfigSymTabRec DeviceTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {VENDOR, "vendorname"}, diff --git a/xserver/hw/xfree86/parser/Extensions.c b/xserver/hw/xfree86/parser/Extensions.c index a6fcb56f0..3a2195901 100644 --- a/xserver/hw/xfree86/parser/Extensions.c +++ b/xserver/hw/xfree86/parser/Extensions.c @@ -41,7 +41,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec ExtensionsTab[] = { +static const xf86ConfigSymTabRec ExtensionsTab[] = { {ENDSECTION, "endsection"}, {OPTION, "option"}, {-1, ""}, diff --git a/xserver/hw/xfree86/parser/Files.c b/xserver/hw/xfree86/parser/Files.c index 849bf92bb..c86ac7af2 100644 --- a/xserver/hw/xfree86/parser/Files.c +++ b/xserver/hw/xfree86/parser/Files.c @@ -61,7 +61,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec FilesTab[] = { +static const xf86ConfigSymTabRec FilesTab[] = { {ENDSECTION, "endsection"}, {FONTPATH, "fontpath"}, {MODULEPATH, "modulepath"}, diff --git a/xserver/hw/xfree86/parser/Flags.c b/xserver/hw/xfree86/parser/Flags.c index 516966508..0f69734ba 100644 --- a/xserver/hw/xfree86/parser/Flags.c +++ b/xserver/hw/xfree86/parser/Flags.c @@ -63,7 +63,7 @@ #include "optionstr.h" -static xf86ConfigSymTabRec ServerFlagsTab[] = { +static const xf86ConfigSymTabRec ServerFlagsTab[] = { {ENDSECTION, "endsection"}, {NOTRAPSIGNALS, "notrapsignals"}, {DONTZAP, "dontzap"}, diff --git a/xserver/hw/xfree86/parser/Input.c b/xserver/hw/xfree86/parser/Input.c index cfacd4eee..88d19b6b5 100644 --- a/xserver/hw/xfree86/parser/Input.c +++ b/xserver/hw/xfree86/parser/Input.c @@ -62,8 +62,7 @@ #include "Configint.h" -static -xf86ConfigSymTabRec InputTab[] = { +static const xf86ConfigSymTabRec InputTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, diff --git a/xserver/hw/xfree86/parser/InputClass.c b/xserver/hw/xfree86/parser/InputClass.c index 29bd9fa64..7281659e0 100644 --- a/xserver/hw/xfree86/parser/InputClass.c +++ b/xserver/hw/xfree86/parser/InputClass.c @@ -34,8 +34,7 @@ #include "Configint.h" -static -xf86ConfigSymTabRec InputClassTab[] = { +static const xf86ConfigSymTabRec InputClassTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, @@ -53,8 +52,18 @@ xf86ConfigSymTabRec InputClassTab[] = { {MATCH_IS_POINTER, "matchispointer"}, {MATCH_IS_JOYSTICK, "matchisjoystick"}, {MATCH_IS_TABLET, "matchistablet"}, + {MATCH_IS_TABLET_PAD, "matchistabletpad"}, {MATCH_IS_TOUCHPAD, "matchistouchpad"}, {MATCH_IS_TOUCHSCREEN, "matchistouchscreen"}, + {NOMATCH_PRODUCT, "nomatchproduct"}, + {NOMATCH_VENDOR, "nomatchvendor"}, + {NOMATCH_DEVICE_PATH, "nomatchdevicepath"}, + {NOMATCH_OS, "nomatchos"}, + {NOMATCH_PNPID, "nomatchpnpid"}, + {NOMATCH_USBID, "nomatchusbid"}, + {NOMATCH_DRIVER, "nomatchdriver"}, + {NOMATCH_TAG, "nomatchtag"}, + {NOMATCH_LAYOUT, "nomatchlayout"}, {-1, ""}, }; @@ -138,13 +147,19 @@ xf86freeInputClassList(XF86ConfInputClassPtr ptr) #define TOKEN_SEP "|" +enum MatchType { + MATCH_NORMAL, + MATCH_NEGATED, +}; + static void -add_group_entry(struct xorg_list *head, char **values) +add_group_entry(struct xorg_list *head, char **values, enum MatchType type) { xf86MatchGroup *group; group = malloc(sizeof(*group)); if (group) { + group->is_negated = (type == MATCH_NEGATED); group->values = values; xorg_list_add(&group->entry, head); } @@ -155,11 +170,12 @@ xf86parseInputClassSection(void) { int has_ident = FALSE; int token; + enum MatchType matchtype; parsePrologue(XF86ConfInputClassPtr, XF86ConfInputClassRec) - /* Initialize MatchGroup lists */ - xorg_list_init(&ptr->match_product); + /* Initialize MatchGroup lists */ + xorg_list_init(&ptr->match_product); xorg_list_init(&ptr->match_vendor); xorg_list_init(&ptr->match_device); xorg_list_init(&ptr->match_os); @@ -170,6 +186,8 @@ xf86parseInputClassSection(void) xorg_list_init(&ptr->match_layout); while ((token = xf86getToken(InputClassTab)) != ENDSECTION) { + matchtype = MATCH_NORMAL; + switch (token) { case COMMENT: ptr->comment = xf86addComment(ptr->comment, xf86_lex_val.str); @@ -195,65 +213,103 @@ xf86parseInputClassSection(void) case OPTION: ptr->option_lst = xf86parseOption(ptr->option_lst); break; + case NOMATCH_PRODUCT: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_PRODUCT: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchProduct"); add_group_entry(&ptr->match_product, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_VENDOR: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_VENDOR: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchVendor"); add_group_entry(&ptr->match_vendor, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_DEVICE_PATH: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_DEVICE_PATH: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchDevicePath"); add_group_entry(&ptr->match_device, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_OS: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_OS: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchOS"); - add_group_entry(&ptr->match_os, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + add_group_entry(&ptr->match_os, xstrtokenize(xf86_lex_val.str, + TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_PNPID: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_PNPID: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchPnPID"); add_group_entry(&ptr->match_pnpid, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_USBID: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_USBID: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchUSBID"); add_group_entry(&ptr->match_usbid, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_DRIVER: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_DRIVER: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchDriver"); add_group_entry(&ptr->match_driver, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_TAG: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_TAG: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchTag"); - add_group_entry(&ptr->match_tag, xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + add_group_entry(&ptr->match_tag, xstrtokenize(xf86_lex_val.str, + TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; + case NOMATCH_LAYOUT: + matchtype = MATCH_NEGATED; + /* fallthrough */ case MATCH_LAYOUT: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchLayout"); add_group_entry(&ptr->match_layout, - xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + xstrtokenize(xf86_lex_val.str, TOKEN_SEP), + matchtype); free(xf86_lex_val.str); break; case MATCH_IS_KEYBOARD: @@ -291,6 +347,14 @@ xf86parseInputClassSection(void) if (!ptr->is_tablet.set) Error(BOOL_MSG, "MatchIsTablet"); break; + case MATCH_IS_TABLET_PAD: + if (xf86getSubToken(&(ptr->comment)) != STRING) + Error(QUOTE_MSG, "MatchIsTabletPad"); + ptr->is_tablet_pad.set = xf86getBoolValue(&ptr->is_tablet_pad.val, xf86_lex_val.str); + free(xf86_lex_val.str); + if (!ptr->is_tablet_pad.set) + Error(BOOL_MSG, "MatchIsTabletPad"); + break; case MATCH_IS_TOUCHPAD: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchIsTouchpad"); @@ -419,6 +483,9 @@ xf86printInputClassSection(FILE * cf, XF86ConfInputClassPtr ptr) if (ptr->is_tablet.set) fprintf(cf, "\tIsTablet \"%s\"\n", ptr->is_tablet.val ? "yes" : "no"); + if (ptr->is_tablet_pad.set) + fprintf(cf, "\tIsTabletPad \"%s\"\n", + ptr->is_tablet_pad.val ? "yes" : "no"); if (ptr->is_touchpad.set) fprintf(cf, "\tIsTouchpad \"%s\"\n", ptr->is_touchpad.val ? "yes" : "no"); diff --git a/xserver/hw/xfree86/parser/Layout.c b/xserver/hw/xfree86/parser/Layout.c index 0ace5da4a..2c829f4ee 100644 --- a/xserver/hw/xfree86/parser/Layout.c +++ b/xserver/hw/xfree86/parser/Layout.c @@ -66,7 +66,7 @@ extern int xf86CheckBoolOption(void *optlist, const char *name, int deflt); -static xf86ConfigSymTabRec LayoutTab[] = { +static const xf86ConfigSymTabRec LayoutTab[] = { {ENDSECTION, "endsection"}, {SCREEN, "screen"}, {IDENTIFIER, "identifier"}, @@ -77,7 +77,7 @@ static xf86ConfigSymTabRec LayoutTab[] = { {-1, ""}, }; -static xf86ConfigSymTabRec AdjTab[] = { +static const xf86ConfigSymTabRec AdjTab[] = { {RIGHTOF, "rightof"}, {LEFTOF, "leftof"}, {ABOVE, "above"}, diff --git a/xserver/hw/xfree86/parser/Makefile.in b/xserver/hw/xfree86/parser/Makefile.in index 849e18e7a..8bf545e8c 100644 --- a/xserver/hw/xfree86/parser/Makefile.in +++ b/xserver/hw/xfree86/parser/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -332,6 +333,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -362,7 +366,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -457,6 +464,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/parser/Module.c b/xserver/hw/xfree86/parser/Module.c index 0dcf4bac4..38bf777ed 100644 --- a/xserver/hw/xfree86/parser/Module.c +++ b/xserver/hw/xfree86/parser/Module.c @@ -61,13 +61,13 @@ #include "Configint.h" -static xf86ConfigSymTabRec SubModuleTab[] = { +static const xf86ConfigSymTabRec SubModuleTab[] = { {ENDSUBSECTION, "endsubsection"}, {OPTION, "option"}, {-1, ""}, }; -static xf86ConfigSymTabRec ModuleTab[] = { +static const xf86ConfigSymTabRec ModuleTab[] = { {ENDSECTION, "endsection"}, {LOAD, "load"}, {DISABLE, "disable"}, diff --git a/xserver/hw/xfree86/parser/Monitor.c b/xserver/hw/xfree86/parser/Monitor.c index 0a8c08178..a33c968bc 100644 --- a/xserver/hw/xfree86/parser/Monitor.c +++ b/xserver/hw/xfree86/parser/Monitor.c @@ -61,7 +61,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec MonitorTab[] = { +static const xf86ConfigSymTabRec MonitorTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {VENDOR, "vendorname"}, @@ -77,7 +77,7 @@ static xf86ConfigSymTabRec MonitorTab[] = { {-1, ""}, }; -static xf86ConfigSymTabRec ModesTab[] = { +static const xf86ConfigSymTabRec ModesTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {MODELINE, "modeline"}, @@ -85,7 +85,7 @@ static xf86ConfigSymTabRec ModesTab[] = { {-1, ""}, }; -static xf86ConfigSymTabRec TimingTab[] = { +static const xf86ConfigSymTabRec TimingTab[] = { {TT_INTERLACE, "interlace"}, {TT_PHSYNC, "+hsync"}, {TT_NHSYNC, "-hsync"}, @@ -101,7 +101,7 @@ static xf86ConfigSymTabRec TimingTab[] = { {-1, ""}, }; -static xf86ConfigSymTabRec ModeTab[] = { +static const xf86ConfigSymTabRec ModeTab[] = { {DOTCLOCK, "dotclock"}, {HTIMINGS, "htimings"}, {VTIMINGS, "vtimings"}, diff --git a/xserver/hw/xfree86/parser/OutputClass.c b/xserver/hw/xfree86/parser/OutputClass.c index 3f2082ecb..8064e0cc0 100644 --- a/xserver/hw/xfree86/parser/OutputClass.c +++ b/xserver/hw/xfree86/parser/OutputClass.c @@ -32,8 +32,7 @@ #include "xf86tokens.h" #include "Configint.h" -static -xf86ConfigSymTabRec OutputClassTab[] = { +static const xf86ConfigSymTabRec OutputClassTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {DRIVER, "driver"}, diff --git a/xserver/hw/xfree86/parser/Pointer.c b/xserver/hw/xfree86/parser/Pointer.c index 2f9d505ff..ff63deb31 100644 --- a/xserver/hw/xfree86/parser/Pointer.c +++ b/xserver/hw/xfree86/parser/Pointer.c @@ -62,7 +62,7 @@ #include "Xprintf.h" -static xf86ConfigSymTabRec PointerTab[] = { +static const xf86ConfigSymTabRec PointerTab[] = { {PROTOCOL, "protocol"}, {EMULATE3, "emulate3buttons"}, {EM3TIMEOUT, "emulate3timeout"}, @@ -83,7 +83,7 @@ static xf86ConfigSymTabRec PointerTab[] = { {-1, ""}, }; -static xf86ConfigSymTabRec ZMapTab[] = { +static const xf86ConfigSymTabRec ZMapTab[] = { {XAXIS, "x"}, {YAXIS, "y"}, {-1, ""}, diff --git a/xserver/hw/xfree86/parser/Screen.c b/xserver/hw/xfree86/parser/Screen.c index 47319706f..a831c30cd 100644 --- a/xserver/hw/xfree86/parser/Screen.c +++ b/xserver/hw/xfree86/parser/Screen.c @@ -61,7 +61,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec DisplayTab[] = { +static const xf86ConfigSymTabRec DisplayTab[] = { {ENDSUBSECTION, "endsubsection"}, {MODES, "modes"}, {VIEWPORT, "viewport"}, @@ -222,7 +222,7 @@ xf86parseDisplaySubSection(void) #undef CLEANUP -static xf86ConfigSymTabRec ScreenTab[] = { +static const xf86ConfigSymTabRec ScreenTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {MATCHSEAT, "matchseat"}, diff --git a/xserver/hw/xfree86/parser/Vendor.c b/xserver/hw/xfree86/parser/Vendor.c index f137a4eb9..50ea68956 100644 --- a/xserver/hw/xfree86/parser/Vendor.c +++ b/xserver/hw/xfree86/parser/Vendor.c @@ -61,7 +61,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec VendorSubTab[] = { +static const xf86ConfigSymTabRec VendorSubTab[] = { {ENDSUBSECTION, "endsubsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, @@ -129,7 +129,7 @@ xf86parseVendorSubSection(void) #undef CLEANUP -static xf86ConfigSymTabRec VendorTab[] = { +static const xf86ConfigSymTabRec VendorTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, diff --git a/xserver/hw/xfree86/parser/Video.c b/xserver/hw/xfree86/parser/Video.c index 666b0ab9a..4e8526f3f 100644 --- a/xserver/hw/xfree86/parser/Video.c +++ b/xserver/hw/xfree86/parser/Video.c @@ -61,7 +61,7 @@ #include "Configint.h" -static xf86ConfigSymTabRec VideoPortTab[] = { +static const xf86ConfigSymTabRec VideoPortTab[] = { {ENDSUBSECTION, "endsubsection"}, {IDENTIFIER, "identifier"}, {OPTION, "option"}, @@ -128,7 +128,7 @@ xf86parseVideoPortSubSection(void) #undef CLEANUP -static xf86ConfigSymTabRec VideoAdaptorTab[] = { +static const xf86ConfigSymTabRec VideoAdaptorTab[] = { {ENDSECTION, "endsection"}, {IDENTIFIER, "identifier"}, {VENDOR, "vendorname"}, diff --git a/xserver/hw/xfree86/parser/configProcs.h b/xserver/hw/xfree86/parser/configProcs.h index 171f8e85f..7a46e0160 100644 --- a/xserver/hw/xfree86/parser/configProcs.h +++ b/xserver/hw/xfree86/parser/configProcs.h @@ -102,9 +102,9 @@ void xf86printVideoAdaptorSection(FILE * cf, XF86ConfVideoAdaptorPtr ptr); void xf86freeVideoAdaptorList(XF86ConfVideoAdaptorPtr ptr); /* scan.c */ -int xf86getToken(xf86ConfigSymTabRec * tab); +int xf86getToken(const xf86ConfigSymTabRec * tab); int xf86getSubToken(char **comment); -int xf86getSubTokenWithTab(char **comment, xf86ConfigSymTabRec * tab); +int xf86getSubTokenWithTab(char **comment, const xf86ConfigSymTabRec * tab); void xf86unGetToken(int token); char *xf86tokenString(void); void @@ -116,7 +116,7 @@ _X_ATTRIBUTE_PRINTF(1, 2); void xf86setSection(const char *section); int -xf86getStringToken(xf86ConfigSymTabRec * tab); +xf86getStringToken(const xf86ConfigSymTabRec * tab); /* write.c */ /* DRI.c */ diff --git a/xserver/hw/xfree86/parser/read.c b/xserver/hw/xfree86/parser/read.c index 327c02a4d..d7e731217 100644 --- a/xserver/hw/xfree86/parser/read.c +++ b/xserver/hw/xfree86/parser/read.c @@ -56,12 +56,13 @@ #include #endif +#include "xf86Config.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" -static xf86ConfigSymTabRec TopLevelTab[] = { +static const xf86ConfigSymTabRec TopLevelTab[] = { {SECTION, "section"}, {-1, ""}, }; @@ -91,7 +92,7 @@ xf86readConfigFile(void) int token; XF86ConfigPtr ptr = NULL; - if ((ptr = calloc(1, sizeof(XF86ConfigRec))) == NULL) { + if ((ptr = xf86allocateConfig()) == NULL) { return NULL; } @@ -270,6 +271,19 @@ xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2) return (!(last_1 == last_2)); } +/* + * Conditionally allocate config struct, but only allocate it + * if it's not already there. In either event, return the pointer + * to the global config struct. + */ +XF86ConfigPtr xf86allocateConfig(void) +{ + if (!xf86configptr) { + xf86configptr = calloc(1, sizeof(XF86ConfigRec)); + } + return xf86configptr; +} + void xf86freeConfig(XF86ConfigPtr p) { diff --git a/xserver/hw/xfree86/parser/scan.c b/xserver/hw/xfree86/parser/scan.c index b8a08cf5d..3356224ce 100644 --- a/xserver/hw/xfree86/parser/scan.c +++ b/xserver/hw/xfree86/parser/scan.c @@ -87,8 +87,6 @@ #define CONFIG_BUF_LEN 1024 #define CONFIG_MAX_FILES 64 -static int StringToToken(const char *, xf86ConfigSymTabRec *); - static struct { FILE *file; char *path; @@ -241,13 +239,25 @@ xf86getNextLine(void) return ret; } +static int +StringToToken(const char *str, const xf86ConfigSymTabRec * tab) +{ + int i; + + for (i = 0; tab[i].token != -1; i++) { + if (!xf86nameCompare(tab[i].name, str)) + return tab[i].token; + } + return ERROR_TOKEN; +} + /* * xf86getToken -- * Read next Token from the config file. Handle the global variable * pushToken. */ int -xf86getToken(xf86ConfigSymTabRec * tab) +xf86getToken(const xf86ConfigSymTabRec * tab) { int c, i; @@ -431,14 +441,8 @@ xf86getToken(xf86ConfigSymTabRec * tab) /* * Joop, at last we have to lookup the token ... */ - if (tab) { - i = 0; - while (tab[i].token != -1) - if (xf86nameCompare(configRBuf, tab[i].name) == 0) - return tab[i].token; - else - i++; - } + if (tab) + return StringToToken(configRBuf, tab); return ERROR_TOKEN; /* Error catcher */ } @@ -460,7 +464,7 @@ xf86getSubToken(char **comment) /*NOTREACHED*/} int -xf86getSubTokenWithTab(char **comment, xf86ConfigSymTabRec * tab) +xf86getSubTokenWithTab(char **comment, const xf86ConfigSymTabRec * tab) { int token; @@ -1023,23 +1027,11 @@ xf86setSection(const char *section) * Lookup a string if it is actually a token in disguise. */ int -xf86getStringToken(xf86ConfigSymTabRec * tab) +xf86getStringToken(const xf86ConfigSymTabRec * tab) { return StringToToken(xf86_lex_val.str, tab); } -static int -StringToToken(const char *str, xf86ConfigSymTabRec * tab) -{ - int i; - - for (i = 0; tab[i].token != -1; i++) { - if (!xf86nameCompare(tab[i].name, str)) - return tab[i].token; - } - return ERROR_TOKEN; -} - /* * Compare two names. The characters '_', ' ', and '\t' are ignored * in the comparison. @@ -1054,6 +1046,8 @@ xf86nameCompare(const char *s1, const char *s2) return 0; else return 1; + } else if (!s2 || *s2 == 0) { + return -1; } while (*s1 == '_' || *s1 == ' ' || *s1 == '\t') diff --git a/xserver/hw/xfree86/parser/write.c b/xserver/hw/xfree86/parser/write.c index 8792783ef..122e96730 100644 --- a/xserver/hw/xfree86/parser/write.c +++ b/xserver/hw/xfree86/parser/write.c @@ -63,7 +63,6 @@ #include #include #include -#include #include #if defined(HAVE_SETEUID) && defined(_POSIX_SAVED_IDS) && _POSIX_SAVED_IDS > 0 @@ -73,14 +72,7 @@ #define HAS_NO_UIDS #endif -#ifdef HAS_NO_UIDS -#define doWriteConfigFile xf86writeConfigFile -#define Local /**/ -#else -#define Local static -#endif - -Local int +static int doWriteConfigFile(const char *filename, XF86ConfigPtr cptr) { FILE *cf; @@ -134,26 +126,21 @@ doWriteConfigFile(const char *filename, XF86ConfigPtr cptr) return 1; } -#ifndef HAS_NO_UIDS - int xf86writeConfigFile(const char *filename, XF86ConfigPtr cptr) { +#ifndef HAS_NO_UIDS int ret; -#if !defined(HAS_SAVED_IDS_AND_SETEUID) - int pid, p; - int status; - void (*csig) (int); -#else - int ruid, euid; -#endif - if (getuid() != geteuid()) { #if !defined(HAS_SAVED_IDS_AND_SETEUID) + int pid, p; + int status; + void (*csig) (int); + /* Need to fork to change ruid without loosing euid */ - csig = signal(SIGCHLD, SIG_DFL); + csig = OsSignal(SIGCHLD, SIG_DFL); switch ((pid = fork())) { case -1: ErrorF("xf86writeConfigFile(): fork failed (%s)\n", @@ -171,13 +158,14 @@ xf86writeConfigFile(const char *filename, XF86ConfigPtr cptr) p = waitpid(pid, &status, 0); } while (p == -1 && errno == EINTR); } - signal(SIGCHLD, csig); + OsSignal(SIGCHLD, csig); if (p != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0) return 1; /* success */ else return 0; #else /* HAS_SAVED_IDS_AND_SETEUID */ + int ruid, euid; ruid = getuid(); euid = geteuid(); @@ -198,9 +186,7 @@ xf86writeConfigFile(const char *filename, XF86ConfigPtr cptr) #endif /* HAS_SAVED_IDS_AND_SETEUID */ } - else { - return doWriteConfigFile(filename, cptr); - } -} - + else #endif /* !HAS_NO_UIDS */ + return doWriteConfigFile(filename, cptr); +} diff --git a/xserver/hw/xfree86/parser/xf86Parser.h b/xserver/hw/xfree86/parser/xf86Parser.h index b3a50e52f..9c4b40370 100644 --- a/xserver/hw/xfree86/parser/xf86Parser.h +++ b/xserver/hw/xfree86/parser/xf86Parser.h @@ -306,6 +306,7 @@ typedef struct { typedef struct { struct xorg_list entry; char **values; + Bool is_negated; } xf86MatchGroup; typedef struct { @@ -325,6 +326,7 @@ typedef struct { xf86TriState is_pointer; xf86TriState is_joystick; xf86TriState is_tablet; + xf86TriState is_tablet_pad; xf86TriState is_touchpad; xf86TriState is_touchscreen; XF86OptionPtr option_lst; @@ -447,6 +449,7 @@ extern char *xf86openConfigDirFiles(const char *path, const char *cmdline, 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, diff --git a/xserver/hw/xfree86/parser/xf86tokens.h b/xserver/hw/xfree86/parser/xf86tokens.h index bbd6b90d1..15792c618 100644 --- a/xserver/hw/xfree86/parser/xf86tokens.h +++ b/xserver/hw/xfree86/parser/xf86tokens.h @@ -285,8 +285,19 @@ typedef enum { MATCH_IS_POINTER, MATCH_IS_JOYSTICK, MATCH_IS_TABLET, + MATCH_IS_TABLET_PAD, MATCH_IS_TOUCHPAD, - MATCH_IS_TOUCHSCREEN + MATCH_IS_TOUCHSCREEN, + + NOMATCH_PRODUCT, + NOMATCH_VENDOR, + NOMATCH_DEVICE_PATH, + NOMATCH_OS, + NOMATCH_PNPID, + NOMATCH_USBID, + NOMATCH_DRIVER, + NOMATCH_TAG, + NOMATCH_LAYOUT, } ParserTokens; #endif /* _xf86_tokens_h */ diff --git a/xserver/hw/xfree86/ramdac/Makefile.in b/xserver/hw/xfree86/ramdac/Makefile.in index b4fa41d77..96222e47b 100644 --- a/xserver/hw/xfree86/ramdac/Makefile.in +++ b/xserver/hw/xfree86/ramdac/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -329,6 +330,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -359,7 +363,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -454,6 +461,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/ramdac/xf86Cursor.c b/xserver/hw/xfree86/ramdac/xf86Cursor.c index c061b8028..afcce5353 100644 --- a/xserver/hw/xfree86/ramdac/xf86Cursor.c +++ b/xserver/hw/xfree86/ramdac/xf86Cursor.c @@ -337,16 +337,9 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, return; } - if (infoPtr->pScrn->vtSema && xorg_list_is_empty(&pScreen->pixmap_dirty_list) && + if (infoPtr->pScrn->vtSema && (ScreenPriv->ForceHWCursorCount || - (( - cursor->bits->argb && - infoPtr->UseHWCursorARGB && - (*infoPtr->UseHWCursorARGB)(pScreen, cursor)) || - (cursor->bits->argb == 0 && - (cursor->bits->height <= infoPtr->MaxHeight) && - (cursor->bits->width <= infoPtr->MaxWidth) && - (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, cursor)))))) { + xf86CheckHWCursor(pScreen, cursor, infoPtr))) { if (ScreenPriv->SWCursor) /* remove the SW cursor */ (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, @@ -462,6 +455,18 @@ xf86ForceHWCursor(ScreenPtr pScreen, Bool on) } } +CursorPtr +xf86CurrentCursor(ScreenPtr pScreen) +{ + xf86CursorScreenPtr ScreenPriv; + + if (pScreen->is_output_slave) + pScreen = pScreen->current_master; + + ScreenPriv = dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); + return ScreenPriv->CurrentCursor; +} + xf86CursorInfoPtr xf86CreateCursorInfoRec(void) { diff --git a/xserver/hw/xfree86/ramdac/xf86Cursor.h b/xserver/hw/xfree86/ramdac/xf86Cursor.h index 6e88240d9..320ec0ce6 100644 --- a/xserver/hw/xfree86/ramdac/xf86Cursor.h +++ b/xserver/hw/xfree86/ramdac/xf86Cursor.h @@ -61,6 +61,7 @@ extern _X_EXPORT xf86CursorInfoPtr xf86CreateCursorInfoRec(void); extern _X_EXPORT void xf86DestroyCursorInfoRec(xf86CursorInfoPtr); extern _X_EXPORT void xf86CursorResetCursor(ScreenPtr pScreen); extern _X_EXPORT void xf86ForceHWCursor(ScreenPtr pScreen, Bool on); +extern _X_EXPORT CursorPtr xf86CurrentCursor(ScreenPtr pScreen); #define HARDWARE_CURSOR_INVERT_MASK 0x00000001 #define HARDWARE_CURSOR_AND_SOURCE_WITH_MASK 0x00000002 diff --git a/xserver/hw/xfree86/ramdac/xf86CursorPriv.h b/xserver/hw/xfree86/ramdac/xf86CursorPriv.h index f34c1c7fc..397d2a14b 100644 --- a/xserver/hw/xfree86/ramdac/xf86CursorPriv.h +++ b/xserver/hw/xfree86/ramdac/xf86CursorPriv.h @@ -43,6 +43,7 @@ void xf86MoveCursor(ScreenPtr pScreen, int x, int y); void xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed); Bool xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr); +Bool xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr); extern _X_EXPORT DevPrivateKeyRec xf86CursorScreenKeyRec; #define xf86CursorScreenKey (&xf86CursorScreenKeyRec) diff --git a/xserver/hw/xfree86/ramdac/xf86HWCurs.c b/xserver/hw/xfree86/ramdac/xf86HWCurs.c index 84febe0df..7043a9c72 100644 --- a/xserver/hw/xfree86/ramdac/xf86HWCurs.c +++ b/xserver/hw/xfree86/ramdac/xf86HWCurs.c @@ -17,10 +17,14 @@ #include "cursorstr.h" #include "mi.h" #include "mipointer.h" +#include "randrstr.h" #include "xf86CursorPriv.h" #include "servermd.h" +static void +xf86RecolorCursor_locked(xf86CursorScreenPtr ScreenPriv, CursorPtr pCurs); + static CARD32 xf86ReverseBitOrder(CARD32 v) { @@ -119,8 +123,59 @@ xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr) return TRUE; } +static Bool +xf86ScreenCheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr) +{ + return + (cursor->bits->argb && infoPtr->UseHWCursorARGB && + infoPtr->UseHWCursorARGB(pScreen, cursor)) || + (cursor->bits->argb == 0 && + cursor->bits->height <= infoPtr->MaxHeight && + cursor->bits->width <= infoPtr->MaxWidth && + (!infoPtr->UseHWCursor || infoPtr->UseHWCursor(pScreen, cursor))); +} + Bool -xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) +xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr) +{ + ScreenPtr pSlave; + Bool use_hw_cursor = TRUE; + + input_lock(); + + if (!xf86ScreenCheckHWCursor(pScreen, cursor, infoPtr)) { + use_hw_cursor = FALSE; + goto unlock; + } + + /* ask each driver consuming a pixmap if it can support HW cursor */ + xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { + xf86CursorScreenPtr sPriv; + + if (!RRHasScanoutPixmap(pSlave)) + continue; + + sPriv = dixLookupPrivate(&pSlave->devPrivates, xf86CursorScreenKey); + if (!sPriv) { /* NULL if Option "SWCursor", possibly other conditions */ + use_hw_cursor = FALSE; + break; + } + + /* FALSE if HWCursor not supported by slave */ + if (!xf86ScreenCheckHWCursor(pSlave, cursor, sPriv->CursorInfoPtr)) { + use_hw_cursor = FALSE; + break; + } + } + +unlock: + input_unlock(); + + return use_hw_cursor; +} + +static Bool +xf86ScreenSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) { xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, @@ -133,11 +188,19 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) return TRUE; } + /* + * Hot plugged GPU's do not have a CursorScreenKey, force sw cursor. + * This check can be removed once dix/privates.c gets relocation code for + * PRIVATE_CURSOR. Also see the related comment in AddGPUScreen(). + */ + if (!_dixGetScreenPrivateKey(CursorScreenKey, pScreen)) + return FALSE; + bits = dixLookupScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen); - x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX; - y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY; + x -= infoPtr->pScrn->frameX0; + y -= infoPtr->pScrn->frameY0; if (!pCurs->bits->argb || !xf86DriverHasLoadCursorARGB(infoPtr)) if (!bits) { @@ -157,7 +220,7 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) if (!xf86DriverLoadCursorImage (infoPtr, bits)) return FALSE; - xf86RecolorCursor(pScreen, pCurs, 1); + xf86RecolorCursor_locked (ScreenPriv, pCurs); (*infoPtr->SetCursorPosition) (infoPtr->pScrn, x, y); @@ -165,6 +228,44 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) return TRUE; } +Bool +xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) +{ + xf86CursorScreenPtr ScreenPriv = + (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, + xf86CursorScreenKey); + ScreenPtr pSlave; + Bool ret = FALSE; + + input_lock(); + + x -= ScreenPriv->HotX; + y -= ScreenPriv->HotY; + + if (!xf86ScreenSetCursor(pScreen, pCurs, x, y)) + goto out; + + /* ask each slave driver to set the cursor. */ + xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { + if (!RRHasScanoutPixmap(pSlave)) + continue; + + if (!xf86ScreenSetCursor(pSlave, pCurs, x, y)) { + /* + * hide the master (and successfully set slave) cursors, + * otherwise both the hw and sw cursor will show. + */ + xf86SetCursor(pScreen, NullCursor, x, y); + goto out; + } + } + ret = TRUE; + + out: + input_unlock(); + return ret; +} + void xf86SetTransparentCursor(ScreenPtr pScreen) { @@ -173,6 +274,8 @@ xf86SetTransparentCursor(ScreenPtr pScreen) xf86CursorScreenKey); xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; + input_lock(); + if (!ScreenPriv->transparentData) ScreenPriv->transparentData = (*infoPtr->RealizeCursor) (infoPtr, NullCursor); @@ -185,6 +288,22 @@ xf86SetTransparentCursor(ScreenPtr pScreen) ScreenPriv->transparentData); (*infoPtr->ShowCursor) (infoPtr->pScrn); + + input_unlock(); +} + +static void +xf86ScreenMoveCursor(ScreenPtr pScreen, int x, int y) +{ + xf86CursorScreenPtr ScreenPriv = + (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, + xf86CursorScreenKey); + xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; + + x -= infoPtr->pScrn->frameX0; + y -= infoPtr->pScrn->frameY0; + + (*infoPtr->SetCursorPosition) (infoPtr->pScrn, x, y); } void @@ -193,20 +312,29 @@ xf86MoveCursor(ScreenPtr pScreen, int x, int y) xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); - xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; + ScreenPtr pSlave; - x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX; - y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY; + input_lock(); - (*infoPtr->SetCursorPosition) (infoPtr->pScrn, x, y); + x -= ScreenPriv->HotX; + y -= ScreenPriv->HotY; + + xf86ScreenMoveCursor(pScreen, x, y); + + /* ask each slave driver to move the cursor */ + xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { + if (!RRHasScanoutPixmap(pSlave)) + continue; + + xf86ScreenMoveCursor(pSlave, x, y); + } + + input_unlock(); } -void -xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed) +static void +xf86RecolorCursor_locked(xf86CursorScreenPtr ScreenPriv, CursorPtr pCurs) { - xf86CursorScreenPtr ScreenPriv = - (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, - xf86CursorScreenKey); xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; /* recoloring isn't applicable to ARGB cursors and drivers @@ -246,6 +374,18 @@ xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed) } } +void +xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed) +{ + xf86CursorScreenPtr ScreenPriv = + (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, + xf86CursorScreenKey); + + input_lock(); + xf86RecolorCursor_locked (ScreenPriv, pCurs); + input_unlock(); +} + /* These functions assume that MaxWidth is a multiple of 32 */ static unsigned char * RealizeCursorInterleave0(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) diff --git a/xserver/hw/xfree86/sdksyms.sh b/xserver/hw/xfree86/sdksyms.sh index 1f6bcf505..03d0a5d68 100644 --- a/xserver/hw/xfree86/sdksyms.sh +++ b/xserver/hw/xfree86/sdksyms.sh @@ -251,7 +251,6 @@ cat > sdksyms.c << EOF #define _FONTPROTO_H #include "dixfont.h" #include "dixfontstr.h" -#include "dixfontstubs.h" #include "dixgrabs.h" #include "dixstruct.h" #include "exevents.h" diff --git a/xserver/hw/xfree86/shadowfb/Makefile.in b/xserver/hw/xfree86/shadowfb/Makefile.in index 3512e376b..64143cd55 100644 --- a/xserver/hw/xfree86/shadowfb/Makefile.in +++ b/xserver/hw/xfree86/shadowfb/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -333,6 +334,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -363,7 +367,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -458,6 +465,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/utils/Makefile.in b/xserver/hw/xfree86/utils/Makefile.in index 4bc2e4a54..a499e3ef7 100644 --- a/xserver/hw/xfree86/utils/Makefile.in +++ b/xserver/hw/xfree86/utils/Makefile.in @@ -53,9 +53,10 @@ subdir = hw/xfree86/utils DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -304,6 +305,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -334,7 +338,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -429,6 +436,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/utils/cvt/Makefile.in b/xserver/hw/xfree86/utils/cvt/Makefile.in index f20862932..88fbe5ef6 100644 --- a/xserver/hw/xfree86/utils/cvt/Makefile.in +++ b/xserver/hw/xfree86/utils/cvt/Makefile.in @@ -78,9 +78,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -326,6 +327,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -356,7 +360,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -451,6 +458,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/utils/gtf/Makefile.in b/xserver/hw/xfree86/utils/gtf/Makefile.in index 193403274..83c9c10fd 100644 --- a/xserver/hw/xfree86/utils/gtf/Makefile.in +++ b/xserver/hw/xfree86/utils/gtf/Makefile.in @@ -78,9 +78,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -325,6 +326,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -355,7 +359,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -450,6 +457,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/utils/gtf/gtf.c b/xserver/hw/xfree86/utils/gtf/gtf.c index e88387df0..c31bc8f93 100644 --- a/xserver/hw/xfree86/utils/gtf/gtf.c +++ b/xserver/hw/xfree86/utils/gtf/gtf.c @@ -692,6 +692,8 @@ main(int argc, char *argv[]) if (o->fbmode) print_fb_mode(m); + free(m); + return 0; } diff --git a/xserver/hw/xfree86/utils/man/Makefile.in b/xserver/hw/xfree86/utils/man/Makefile.in index f006ee7e8..69b7ca20c 100644 --- a/xserver/hw/xfree86/utils/man/Makefile.in +++ b/xserver/hw/xfree86/utils/man/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/xfree86/utils/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -313,6 +314,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -343,7 +347,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -438,6 +445,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/vbe/Makefile.in b/xserver/hw/xfree86/vbe/Makefile.in index 7287f3c64..ac0e87a5f 100644 --- a/xserver/hw/xfree86/vbe/Makefile.in +++ b/xserver/hw/xfree86/vbe/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -331,6 +332,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -361,7 +365,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -456,6 +463,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/vbe/vbe.c b/xserver/hw/xfree86/vbe/vbe.c index ef12cb805..d23e0f589 100644 --- a/xserver/hw/xfree86/vbe/vbe.c +++ b/xserver/hw/xfree86/vbe/vbe.c @@ -325,7 +325,7 @@ vbeDoEDID(vbeInfoPtr pVbe, void *unused) if (!pVbe) return NULL; - if (pVbe->version < 0x200) + if (pVbe->version < 0x102) return NULL; DDC_data = vbeReadEDID(pVbe); diff --git a/xserver/hw/xfree86/vgahw/Makefile.in b/xserver/hw/xfree86/vgahw/Makefile.in index e9873a826..5a86d5a1c 100644 --- a/xserver/hw/xfree86/vgahw/Makefile.in +++ b/xserver/hw/xfree86/vgahw/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -332,6 +333,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -362,7 +366,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -457,6 +464,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/x86emu/Makefile.in b/xserver/hw/xfree86/x86emu/Makefile.in index e9ac8b069..cc7a58233 100644 --- a/xserver/hw/xfree86/x86emu/Makefile.in +++ b/xserver/hw/xfree86/x86emu/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -300,6 +301,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -330,7 +334,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -425,6 +432,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xfree86/xkb/Makefile.am b/xserver/hw/xfree86/xkb/Makefile.am new file mode 100644 index 000000000..252cf3b5d --- /dev/null +++ b/xserver/hw/xfree86/xkb/Makefile.am @@ -0,0 +1,6 @@ +noinst_LTLIBRARIES = libxorgxkb.la + +AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@ +AM_CPPFLAGS = @XORG_INCS@ + +libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c diff --git a/xserver/hw/xfree86/xkb/Makefile.in b/xserver/hw/xfree86/xkb/Makefile.in new file mode 100644 index 000000000..2cdb18173 --- /dev/null +++ b/xserver/hw/xfree86/xkb/Makefile.in @@ -0,0 +1,790 @@ +# Makefile.in generated by automake 1.12.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = hw/xfree86/xkb +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ + $(top_builddir)/include/xorg-server.h \ + $(top_builddir)/include/dix-config.h \ + $(top_builddir)/include/xorg-config.h \ + $(top_builddir)/include/xkb-config.h \ + $(top_builddir)/include/xwin-config.h \ + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libxorgxkb_la_LIBADD = +am_libxorgxkb_la_OBJECTS = xkbVT.lo xkbPrivate.lo xkbKillSrv.lo +libxorgxkb_la_OBJECTS = $(am_libxorgxkb_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libxorgxkb_la_SOURCES) +DIST_SOURCES = $(libxorgxkb_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ +BASE_FONT_PATH = @BASE_FONT_PATH@ +BUILD_DATE = @BUILD_DATE@ +BUILD_TIME = @BUILD_TIME@ +BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ +BUNDLE_VERSION = @BUNDLE_VERSION@ +BUNDLE_VERSION_STRING = @BUNDLE_VERSION_STRING@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ +DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ +DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ +DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DGA_CFLAGS = @DGA_CFLAGS@ +DGA_LIBS = @DGA_LIBS@ +DIX_CFLAGS = @DIX_CFLAGS@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ +DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ +DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ +DMXMODULES_LIBS = @DMXMODULES_LIBS@ +DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ +DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ +DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ +DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOT = @DOT@ +DOXYGEN = @DOXYGEN@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ +DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ +DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GBM_CFLAGS = @GBM_CFLAGS@ +GBM_LIBS = @GBM_LIBS@ +GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ +GLAMOR_LIBS = @GLAMOR_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +HAVE_DOT = @HAVE_DOT@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ +KDRIVE_INCS = @KDRIVE_INCS@ +KDRIVE_LIBS = @KDRIVE_LIBS@ +KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ +KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ +KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ +KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ +KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ +KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIBS = @LIBDRM_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ +LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +PYTHON3 = @PYTHON3@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRICT_CFLAGS = @STRICT_CFLAGS@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ +SYSCONFDIR = @SYSCONFDIR@ +SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ +SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ +TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ +WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ +X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XDMCP_CFLAGS = @XDMCP_CFLAGS@ +XDMCP_LIBS = @XDMCP_LIBS@ +XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ +XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ +XDMX_CFLAGS = @XDMX_CFLAGS@ +XDMX_LIBS = @XDMX_LIBS@ +XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ +XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ +XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ +XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ +XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ +XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ +XKB_DFLT_RULES = @XKB_DFLT_RULES@ +XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ +XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ +XLIB_CFLAGS = @XLIB_CFLAGS@ +XLIB_LIBS = @XLIB_LIBS@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_LIBS = @XQUARTZ_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XQUARTZ_SPARKLE_FEED_URL = @XQUARTZ_SPARKLE_FEED_URL@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ +XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ +XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ +XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ +XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ +XSERVER_LIBS = @XSERVER_LIBS@ +XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ +XSHMFENCE_LIBS = @XSHMFENCE_LIBS@ +XSLTPROC = @XSLTPROC@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ +XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ +XVFB_LIBS = @XVFB_LIBS@ +XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ +XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ +XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ +XWAYLAND_LIBS = @XWAYLAND_LIBS@ +XWAYLAND_SYS_LIBS = @XWAYLAND_SYS_LIBS@ +XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ +XWINMODULES_LIBS = @XWINMODULES_LIBS@ +XWIN_LIBS = @XWIN_LIBS@ +XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ +XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__XCONFIGDIR__ = @__XCONFIGDIR__@ +__XCONFIGFILE__ = @__XCONFIGFILE__@ +abi_ansic = @abi_ansic@ +abi_extension = @abi_extension@ +abi_videodrv = @abi_videodrv@ +abi_xinput = @abi_xinput@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverdir = @driverdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extdir = @extdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +logdir = @logdir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sdkdir = @sdkdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libxorgxkb.la +AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@ +AM_CPPFLAGS = @XORG_INCS@ +libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/xkb/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xfree86/xkb/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libxorgxkb.la: $(libxorgxkb_la_OBJECTS) $(libxorgxkb_la_DEPENDENCIES) $(EXTRA_libxorgxkb_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libxorgxkb_la_OBJECTS) $(libxorgxkb_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbKillSrv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbPrivate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbVT.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xserver/hw/xfree86/xkb/meson.build b/xserver/hw/xfree86/xkb/meson.build new file mode 100644 index 000000000..894aa5ca3 --- /dev/null +++ b/xserver/hw/xfree86/xkb/meson.build @@ -0,0 +1,12 @@ +srcs_xorg_xkb = [ + 'xkbVT.c', + 'xkbPrivate.c', + 'xkbKillSrv.c', +] + +xorg_xkb = static_library('xorg_xkb', + srcs_xorg_xkb, + include_directories: [inc, xorg_inc], + dependencies: common_dep, + c_args: xorg_c_args, +) diff --git a/xserver/hw/xfree86/dixmods/xkbKillSrv.c b/xserver/hw/xfree86/xkb/xkbKillSrv.c similarity index 100% rename from xserver/hw/xfree86/dixmods/xkbKillSrv.c rename to xserver/hw/xfree86/xkb/xkbKillSrv.c diff --git a/xserver/hw/xfree86/dixmods/xkbPrivate.c b/xserver/hw/xfree86/xkb/xkbPrivate.c similarity index 100% rename from xserver/hw/xfree86/dixmods/xkbPrivate.c rename to xserver/hw/xfree86/xkb/xkbPrivate.c diff --git a/xserver/hw/xfree86/dixmods/xkbVT.c b/xserver/hw/xfree86/xkb/xkbVT.c similarity index 100% rename from xserver/hw/xfree86/dixmods/xkbVT.c rename to xserver/hw/xfree86/xkb/xkbVT.c diff --git a/xserver/hw/xfree86/xorg-wrapper.c b/xserver/hw/xfree86/xorg-wrapper.c index d93096294..c5e4a278b 100644 --- a/xserver/hw/xfree86/xorg-wrapper.c +++ b/xserver/hw/xfree86/xorg-wrapper.c @@ -35,6 +35,9 @@ #include #include #include +#ifdef HAVE_SYS_SYSMACROS_H +#include +#endif #include #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include @@ -240,7 +243,7 @@ int main(int argc, char *argv[]) memset(&res, 0, sizeof(struct drm_mode_card_res)); r = ioctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res); - if (r == 0 && res.count_connectors > 0) + if (r == 0) kms_cards++; close(fd); diff --git a/xserver/hw/xnest/Font.c b/xserver/hw/xnest/Font.c index ffdfd2497..192b80f53 100644 --- a/xserver/hw/xnest/Font.c +++ b/xserver/hw/xnest/Font.c @@ -23,6 +23,7 @@ is" without express or implied warranty. #include "regionstr.h" #include #include +#include "dixfontstr.h" #include "scrnintstr.h" #include "Xnest.h" @@ -42,7 +43,7 @@ xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont) int i; const char *name; - FontSetPrivate(pFont, xnestFontPrivateIndex, NULL); + xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL); name_atom = MakeAtom("FONT", 4, True); value_atom = 0L; @@ -65,7 +66,7 @@ xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont) return False; priv = (void *) malloc(sizeof(xnestPrivFont)); - FontSetPrivate(pFont, xnestFontPrivateIndex, priv); + xfont2_font_set_private(pFont, xnestFontPrivateIndex, priv); xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name); @@ -82,7 +83,7 @@ xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) if (xnestFontStruct(pFont)) XFreeFont(xnestDisplay, xnestFontStruct(pFont)); free(xnestFontPriv(pFont)); - FontSetPrivate(pFont, xnestFontPrivateIndex, NULL); + xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL); } return True; } diff --git a/xserver/hw/xnest/Handlers.c b/xserver/hw/xnest/Handlers.c index 05d559d8f..e90a6168f 100644 --- a/xserver/hw/xnest/Handlers.c +++ b/xserver/hw/xnest/Handlers.c @@ -32,14 +32,14 @@ is" without express or implied warranty. #include "Handlers.h" void -xnestBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask) +xnestBlockHandler(void *blockData, void *timout) { xnestCollectExposures(); XFlush(xnestDisplay); } void -xnestWakeupHandler(void *blockData, int result, void *pReadMask) +xnestWakeupHandler(void *blockData, int result) { xnestCollectEvents(); } diff --git a/xserver/hw/xnest/Handlers.h b/xserver/hw/xnest/Handlers.h index d4ad6d254..6ebcc8b98 100644 --- a/xserver/hw/xnest/Handlers.h +++ b/xserver/hw/xnest/Handlers.h @@ -15,8 +15,7 @@ is" without express or implied warranty. #ifndef XNESTHANDLERS_H #define XNESTHANDLERS_H -void xnestBlockHandler(void *blockData, OSTimePtr pTimeout, - void *pReadMask); -void xnestWakeupHandler(void *blockData, int result, void *pReadMask); +void xnestBlockHandler(void *blockData, void *timeout); +void xnestWakeupHandler(void *blockData, int result); #endif /* XNESTHANDLERS_H */ diff --git a/xserver/hw/xnest/Init.c b/xserver/hw/xnest/Init.c index d9f490b85..e8a700e88 100644 --- a/xserver/hw/xnest/Init.c +++ b/xserver/hw/xnest/Init.c @@ -26,6 +26,7 @@ is" without express or implied warranty. #include "servermd.h" #include "mi.h" #include +#include "dixfontstr.h" #include "Xnest.h" @@ -34,6 +35,7 @@ is" without express or implied warranty. #include "Pointer.h" #include "Keyboard.h" #include "Handlers.h" +#include "Events.h" #include "Init.h" #include "Args.h" #include "Drawable.h" @@ -72,7 +74,7 @@ InitOutput(ScreenInfo * screen_info, int argc, char *argv[]) break; } - xnestFontPrivateIndex = AllocateFontPrivateIndex(); + xnestFontPrivateIndex = xfont2_allocate_font_private_index(); if (!xnestNumScreens) xnestNumScreens = 1; @@ -85,6 +87,12 @@ InitOutput(ScreenInfo * screen_info, int argc, char *argv[]) xnestDoFullGeneration = xnestFullGeneration; } +static void +xnestNotifyConnection(int fd, int ready, void *data) +{ + xnestCollectEvents(); +} + void InitInput(int argc, char *argv[]) { @@ -100,7 +108,7 @@ InitInput(int argc, char *argv[]) mieqInit(); - AddEnabledDevice(XConnectionNumber(xnestDisplay)); + SetNotifyFd(XConnectionNumber(xnestDisplay), xnestNotifyConnection, X_NOTIFY_READ, NULL); RegisterBlockAndWakeupHandlers(xnestBlockHandler, xnestWakeupHandler, NULL); } diff --git a/xserver/hw/xnest/Makefile.in b/xserver/hw/xnest/Makefile.in index f22cb1d4e..23e9c87c2 100644 --- a/xserver/hw/xnest/Makefile.in +++ b/xserver/hw/xnest/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -349,6 +350,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -379,7 +383,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -478,6 +485,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xnest/man/Makefile.in b/xserver/hw/xnest/man/Makefile.in index 13a51aeed..6f92ab520 100644 --- a/xserver/hw/xnest/man/Makefile.in +++ b/xserver/hw/xnest/man/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/xnest/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -313,6 +314,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -343,7 +347,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -438,6 +445,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xquartz/GL/Makefile.in b/xserver/hw/xquartz/GL/Makefile.in index 38996425f..b7c0c0ff9 100644 --- a/xserver/hw/xquartz/GL/Makefile.in +++ b/xserver/hw/xquartz/GL/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -299,6 +300,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -329,7 +333,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -424,6 +431,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xquartz/GL/glcontextmodes.c b/xserver/hw/xquartz/GL/glcontextmodes.c new file mode 100644 index 000000000..17e7a5874 --- /dev/null +++ b/xserver/hw/xquartz/GL/glcontextmodes.c @@ -0,0 +1,585 @@ +/* + * (C) Copyright IBM Corporation 2003 + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. + */ + +/** + * \file glcontextmodes.c + * Utility routines for working with \c __GLcontextModes structures. At + * some point most or all of these functions will be moved to the Mesa + * code base. + * + * \author Ian Romanick + */ + +#if defined(IN_MINI_GLX) +#include +#else +#if defined(HAVE_DIX_CONFIG_H) +#include +#endif +#include +#include +#include "GL/glxint.h" +#endif + +/* Memory macros */ +#if defined(IN_MINI_GLX) +#include +#include +#define _mesa_malloc(b) malloc(b) +#define _mesa_free(m) free(m) +#define _mesa_memset memset +#else +#ifdef XFree86Server +#include +#include +#define _mesa_malloc(b) malloc(b) +#define _mesa_free(m) free(m) +#define _mesa_memset memset +#else +#include +#define _mesa_memset memset +#define _mesa_malloc(b) Xmalloc(b) +#define _mesa_free(m) free(m) +#endif /* XFree86Server */ +#endif /* !defined(IN_MINI_GLX) */ + +#include "glcontextmodes.h" + +#if !defined(IN_MINI_GLX) +#define NUM_VISUAL_TYPES 6 + +/** + * Convert an X visual type to a GLX visual type. + * + * \param visualType X visual type (i.e., \c TrueColor, \c StaticGray, etc.) + * to be converted. + * \return If \c visualType is a valid X visual type, a GLX visual type will + * be returned. Otherwise \c GLX_NONE will be returned. + */ +GLint +_gl_convert_from_x_visual_type(int visualType) +{ + static const int glx_visual_types[NUM_VISUAL_TYPES] = { + GLX_STATIC_GRAY, GLX_GRAY_SCALE, + GLX_STATIC_COLOR, GLX_PSEUDO_COLOR, + GLX_TRUE_COLOR, GLX_DIRECT_COLOR + }; + + return ((unsigned)visualType < NUM_VISUAL_TYPES) + ? glx_visual_types[visualType] : GLX_NONE; +} + +/** + * Convert a GLX visual type to an X visual type. + * + * \param visualType GLX visual type (i.e., \c GLX_TRUE_COLOR, + * \c GLX_STATIC_GRAY, etc.) to be converted. + * \return If \c visualType is a valid GLX visual type, an X visual type will + * be returned. Otherwise -1 will be returned. + */ +GLint +_gl_convert_to_x_visual_type(int visualType) +{ + static const int x_visual_types[NUM_VISUAL_TYPES] = { + TrueColor, DirectColor, + PseudoColor, StaticColor, + GrayScale, StaticGray + }; + + return ((unsigned)(visualType - GLX_TRUE_COLOR) < NUM_VISUAL_TYPES) + ? x_visual_types[visualType - GLX_TRUE_COLOR] : -1; +} + +/** + * Copy a GLX visual config structure to a GL context mode structure. All + * of the fields in \c config are copied to \c mode. Additional fields in + * \c mode that can be derrived from the fields of \c config (i.e., + * \c haveDepthBuffer) are also filled in. The remaining fields in \c mode + * that cannot be derived are set to default values. + * + * \param mode Destination GL context mode. + * \param config Source GLX visual config. + * + * \note + * The \c fbconfigID and \c visualID fields of the \c __GLcontextModes + * structure will be set to the \c vid of the \c __GLXvisualConfig structure. + */ +void +_gl_copy_visual_to_context_mode(__GLcontextModes * mode, + const __GLXvisualConfig * config) +{ + __GLcontextModes * const next = mode->next; + + (void)_mesa_memset(mode, 0, sizeof(__GLcontextModes)); + mode->next = next; + + mode->visualID = config->vid; + mode->visualType = _gl_convert_from_x_visual_type(config->class); + mode->fbconfigID = config->vid; + mode->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT; + + mode->rgbMode = (config->rgba != 0); + mode->renderType = (mode->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT; + + mode->colorIndexMode = !(mode->rgbMode); + mode->doubleBufferMode = (config->doubleBuffer != 0); + mode->stereoMode = (config->stereo != 0); + + mode->haveAccumBuffer = ((config->accumRedSize + + config->accumGreenSize + + config->accumBlueSize + + config->accumAlphaSize) > 0); + mode->haveDepthBuffer = (config->depthSize > 0); + mode->haveStencilBuffer = (config->stencilSize > 0); + + mode->redBits = config->redSize; + mode->greenBits = config->greenSize; + mode->blueBits = config->blueSize; + mode->alphaBits = config->alphaSize; + mode->redMask = config->redMask; + mode->greenMask = config->greenMask; + mode->blueMask = config->blueMask; + mode->alphaMask = config->alphaMask; + mode->rgbBits = mode->rgbMode ? config->bufferSize : 0; + mode->indexBits = mode->colorIndexMode ? config->bufferSize : 0; + + mode->accumRedBits = config->accumRedSize; + mode->accumGreenBits = config->accumGreenSize; + mode->accumBlueBits = config->accumBlueSize; + mode->accumAlphaBits = config->accumAlphaSize; + mode->depthBits = config->depthSize; + mode->stencilBits = config->stencilSize; + + mode->numAuxBuffers = config->auxBuffers; + mode->level = config->level; + + mode->visualRating = config->visualRating; + mode->transparentPixel = config->transparentPixel; + mode->transparentRed = config->transparentRed; + mode->transparentGreen = config->transparentGreen; + mode->transparentBlue = config->transparentBlue; + mode->transparentAlpha = config->transparentAlpha; + mode->transparentIndex = config->transparentIndex; + mode->samples = config->multiSampleSize; + mode->sampleBuffers = config->nMultiSampleBuffers; + /* mode->visualSelectGroup = config->visualSelectGroup; ? */ + + mode->swapMethod = GLX_SWAP_UNDEFINED_OML; + + mode->bindToTextureRgb = (mode->rgbMode) ? GL_TRUE : GL_FALSE; + mode->bindToTextureRgba = (mode->rgbMode && mode->alphaBits) ? + GL_TRUE : GL_FALSE; + mode->bindToMipmapTexture = mode->rgbMode ? GL_TRUE : GL_FALSE; + mode->bindToTextureTargets = mode->rgbMode ? + GLX_TEXTURE_1D_BIT_EXT | + GLX_TEXTURE_2D_BIT_EXT | + GLX_TEXTURE_RECTANGLE_BIT_EXT : 0; + mode->yInverted = GL_FALSE; +} + +/** + * Get data from a GL context mode. + * + * \param mode GL context mode whose data is to be returned. + * \param attribute Attribute of \c mode that is to be returned. + * \param value_return Location to store the data member of \c mode. + * \return If \c attribute is a valid attribute of \c mode, zero is + * returned. Otherwise \c GLX_BAD_ATTRIBUTE is returned. + */ +int +_gl_get_context_mode_data(const __GLcontextModes *mode, int attribute, + int *value_return) +{ + switch (attribute) { + case GLX_USE_GL: + *value_return = GL_TRUE; + return 0; + + case GLX_BUFFER_SIZE: + *value_return = mode->rgbBits; + return 0; + + case GLX_RGBA: + *value_return = mode->rgbMode; + return 0; + + case GLX_RED_SIZE: + *value_return = mode->redBits; + return 0; + + case GLX_GREEN_SIZE: + *value_return = mode->greenBits; + return 0; + + case GLX_BLUE_SIZE: + *value_return = mode->blueBits; + return 0; + + case GLX_ALPHA_SIZE: + *value_return = mode->alphaBits; + return 0; + + case GLX_DOUBLEBUFFER: + *value_return = mode->doubleBufferMode; + return 0; + + case GLX_STEREO: + *value_return = mode->stereoMode; + return 0; + + case GLX_AUX_BUFFERS: + *value_return = mode->numAuxBuffers; + return 0; + + case GLX_DEPTH_SIZE: + *value_return = mode->depthBits; + return 0; + + case GLX_STENCIL_SIZE: + *value_return = mode->stencilBits; + return 0; + + case GLX_ACCUM_RED_SIZE: + *value_return = mode->accumRedBits; + return 0; + + case GLX_ACCUM_GREEN_SIZE: + *value_return = mode->accumGreenBits; + return 0; + + case GLX_ACCUM_BLUE_SIZE: + *value_return = mode->accumBlueBits; + return 0; + + case GLX_ACCUM_ALPHA_SIZE: + *value_return = mode->accumAlphaBits; + return 0; + + case GLX_LEVEL: + *value_return = mode->level; + return 0; + + case GLX_TRANSPARENT_TYPE_EXT: + *value_return = mode->transparentPixel; + return 0; + + case GLX_TRANSPARENT_RED_VALUE: + *value_return = mode->transparentRed; + return 0; + + case GLX_TRANSPARENT_GREEN_VALUE: + *value_return = mode->transparentGreen; + return 0; + + case GLX_TRANSPARENT_BLUE_VALUE: + *value_return = mode->transparentBlue; + return 0; + + case GLX_TRANSPARENT_ALPHA_VALUE: + *value_return = mode->transparentAlpha; + return 0; + + case GLX_TRANSPARENT_INDEX_VALUE: + *value_return = mode->transparentIndex; + return 0; + + case GLX_X_VISUAL_TYPE: + *value_return = mode->visualType; + return 0; + + case GLX_CONFIG_CAVEAT: + *value_return = mode->visualRating; + return 0; + + case GLX_VISUAL_ID: + *value_return = mode->visualID; + return 0; + + case GLX_DRAWABLE_TYPE: + *value_return = mode->drawableType; + return 0; + + case GLX_RENDER_TYPE: + *value_return = mode->renderType; + return 0; + + case GLX_X_RENDERABLE: + *value_return = mode->xRenderable; + return 0; + + case GLX_FBCONFIG_ID: + *value_return = mode->fbconfigID; + return 0; + + case GLX_MAX_PBUFFER_WIDTH: + *value_return = mode->maxPbufferWidth; + return 0; + + case GLX_MAX_PBUFFER_HEIGHT: + *value_return = mode->maxPbufferHeight; + return 0; + + case GLX_MAX_PBUFFER_PIXELS: + *value_return = mode->maxPbufferPixels; + return 0; + + case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX: + *value_return = mode->optimalPbufferWidth; + return 0; + + case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX: + *value_return = mode->optimalPbufferHeight; + return 0; + + case GLX_SWAP_METHOD_OML: + *value_return = mode->swapMethod; + return 0; + + case GLX_SAMPLE_BUFFERS_SGIS: + *value_return = mode->sampleBuffers; + return 0; + + case GLX_SAMPLES_SGIS: + *value_return = mode->samples; + return 0; + + case GLX_BIND_TO_TEXTURE_RGB_EXT: + *value_return = mode->bindToTextureRgb; + return 0; + + case GLX_BIND_TO_TEXTURE_RGBA_EXT: + *value_return = mode->bindToTextureRgba; + return 0; + + case GLX_BIND_TO_MIPMAP_TEXTURE_EXT: + *value_return = mode->bindToMipmapTexture == GL_TRUE ? GL_TRUE : + GL_FALSE; + return 0; + + case GLX_BIND_TO_TEXTURE_TARGETS_EXT: + *value_return = mode->bindToTextureTargets; + return 0; + + case GLX_Y_INVERTED_EXT: + *value_return = mode->yInverted; + return 0; + + /* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX. + * It is ONLY for communication between the GLX client and the GLX + * server. + */ + case GLX_VISUAL_SELECT_GROUP_SGIX: + default: + return GLX_BAD_ATTRIBUTE; + } +} +#endif /* !defined(IN_MINI_GLX) */ + +/** + * Allocate a linked list of \c __GLcontextModes structures. The fields of + * each structure will be initialized to "reasonable" default values. In + * most cases this is the default value defined by table 3.4 of the GLX + * 1.3 specification. This means that most values are either initialized to + * zero or \c GLX_DONT_CARE (which is -1). As support for additional + * extensions is added, the new values will be initialized to appropriate + * values from the extension specification. + * + * \param count Number of structures to allocate. + * \param minimum_size Minimum size of a structure to allocate. This allows + * for differences in the version of the + * \c __GLcontextModes stucture used in libGL and in a + * DRI-based driver. + * \returns A pointer to the first element in a linked list of \c count + * stuctures on success, or \c NULL on failure. + * + * \warning Use of \c minimum_size does \b not guarantee binary compatibility. + * The fundamental assumption is that if the \c minimum_size + * specified by the driver and the size of the \c __GLcontextModes + * structure in libGL is the same, then the meaning of each byte in + * the structure is the same in both places. \b Be \b careful! + * Basically this means that fields have to be added in libGL and + * then propagated to drivers. Drivers should \b never arbitrarilly + * extend the \c __GLcontextModes data-structure. + */ +__GLcontextModes * +_gl_context_modes_create(unsigned count, size_t minimum_size) +{ + const size_t size = (minimum_size > sizeof(__GLcontextModes)) + ? minimum_size : sizeof(__GLcontextModes); + __GLcontextModes * base = NULL; + __GLcontextModes ** next; + unsigned i; + + next = &base; + for (i = 0; i < count; i++) { + *next = (__GLcontextModes *)_mesa_malloc(size); + if (*next == NULL) { + _gl_context_modes_destroy(base); + base = NULL; + break; + } + + (void)_mesa_memset(*next, 0, size); + (*next)->visualID = GLX_DONT_CARE; + (*next)->visualType = GLX_DONT_CARE; + (*next)->visualRating = GLX_NONE; + (*next)->transparentPixel = GLX_NONE; + (*next)->transparentRed = GLX_DONT_CARE; + (*next)->transparentGreen = GLX_DONT_CARE; + (*next)->transparentBlue = GLX_DONT_CARE; + (*next)->transparentAlpha = GLX_DONT_CARE; + (*next)->transparentIndex = GLX_DONT_CARE; + (*next)->xRenderable = GLX_DONT_CARE; + (*next)->fbconfigID = GLX_DONT_CARE; + (*next)->swapMethod = GLX_SWAP_UNDEFINED_OML; + (*next)->bindToTextureRgb = GLX_DONT_CARE; + (*next)->bindToTextureRgba = GLX_DONT_CARE; + (*next)->bindToMipmapTexture = GLX_DONT_CARE; + (*next)->bindToTextureTargets = GLX_DONT_CARE; + (*next)->yInverted = GLX_DONT_CARE; + + next = &((*next)->next); + } + + return base; +} + +/** + * Destroy a linked list of \c __GLcontextModes structures created by + * \c _gl_context_modes_create. + * + * \param modes Linked list of structures to be destroyed. All structres + * in the list will be freed. + */ +void +_gl_context_modes_destroy(__GLcontextModes * modes) +{ + while (modes != NULL) { + __GLcontextModes * const next = modes->next; + + _mesa_free(modes); + modes = next; + } +} + +/** + * Find a context mode matching a Visual ID. + * + * \param modes List list of context-mode structures to be searched. + * \param vid Visual ID to be found. + * \returns A pointer to a context-mode in \c modes if \c vid was found in + * the list, or \c NULL if it was not. + */ + +__GLcontextModes * +_gl_context_modes_find_visual(__GLcontextModes *modes, int vid) +{ + __GLcontextModes *m; + + for (m = modes; m != NULL; m = m->next) + if (m->visualID == vid) + return m; + + return NULL; +} + +__GLcontextModes * +_gl_context_modes_find_fbconfig(__GLcontextModes *modes, int fbid) +{ + __GLcontextModes *m; + + for (m = modes; m != NULL; m = m->next) + if (m->fbconfigID == fbid) + return m; + + return NULL; +} + +/** + * Determine if two context-modes are the same. This is intended to be used + * by libGL implementations to compare to sets of driver generated FBconfigs. + * + * \param a Context-mode to be compared. + * \param b Context-mode to be compared. + * \returns \c GL_TRUE if the two context-modes are the same. \c GL_FALSE is + * returned otherwise. + */ +GLboolean +_gl_context_modes_are_same(const __GLcontextModes * a, + const __GLcontextModes * b) +{ + return ((a->rgbMode == b->rgbMode) && + (a->floatMode == b->floatMode) && + (a->colorIndexMode == b->colorIndexMode) && + (a->doubleBufferMode == b->doubleBufferMode) && + (a->stereoMode == b->stereoMode) && + (a->redBits == b->redBits) && + (a->greenBits == b->greenBits) && + (a->blueBits == b->blueBits) && + (a->alphaBits == b->alphaBits) && +#if 0 /* For some reason these don't get set on the client-side in libGL. */ + (a->redMask == b->redMask) && + (a->greenMask == b->greenMask) && + (a->blueMask == b->blueMask) && + (a->alphaMask == b->alphaMask) && +#endif + (a->rgbBits == b->rgbBits) && + (a->indexBits == b->indexBits) && + (a->accumRedBits == b->accumRedBits) && + (a->accumGreenBits == b->accumGreenBits) && + (a->accumBlueBits == b->accumBlueBits) && + (a->accumAlphaBits == b->accumAlphaBits) && + (a->depthBits == b->depthBits) && + (a->stencilBits == b->stencilBits) && + (a->numAuxBuffers == b->numAuxBuffers) && + (a->level == b->level) && + (a->visualRating == b->visualRating) && + + (a->transparentPixel == b->transparentPixel) && + + ((a->transparentPixel != GLX_TRANSPARENT_RGB) || + ((a->transparentRed == b->transparentRed) && + (a->transparentGreen == b->transparentGreen) && + (a->transparentBlue == b->transparentBlue) && + (a->transparentAlpha == b->transparentAlpha))) && + + ((a->transparentPixel != GLX_TRANSPARENT_INDEX) || + (a->transparentIndex == b->transparentIndex)) && + + (a->sampleBuffers == b->sampleBuffers) && + (a->samples == b->samples) && + ((a->drawableType & b->drawableType) != 0) && + (a->renderType == b->renderType) && + (a->maxPbufferWidth == b->maxPbufferWidth) && + (a->maxPbufferHeight == b->maxPbufferHeight) && + (a->maxPbufferPixels == b->maxPbufferPixels) && + (a->optimalPbufferWidth == b->optimalPbufferWidth) && + (a->optimalPbufferHeight == b->optimalPbufferHeight) && + (a->swapMethod == b->swapMethod) && + (a->bindToTextureRgb == b->bindToTextureRgb) && + (a->bindToTextureRgba == b->bindToTextureRgba) && + (a->bindToMipmapTexture == b->bindToMipmapTexture) && + (a->bindToTextureTargets == b->bindToTextureTargets) && + (a->yInverted == b->yInverted)); +} diff --git a/xserver/hw/xquartz/GL/glcontextmodes.h b/xserver/hw/xquartz/GL/glcontextmodes.h new file mode 100644 index 000000000..7237ccc06 --- /dev/null +++ b/xserver/hw/xquartz/GL/glcontextmodes.h @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corporation 2003 + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. + */ + +/** + * \file glcontextmodes.h + * \author Ian Romanick + */ + +#ifndef GLCONTEXTMODES_H +#define GLCONTEXTMODES_H + +#include "GL/internal/glcore.h" + +#if !defined(IN_MINI_GLX) +extern GLint +_gl_convert_from_x_visual_type(int visualType); +extern GLint +_gl_convert_to_x_visual_type(int visualType); +extern void +_gl_copy_visual_to_context_mode(__GLcontextModes * mode, + const __GLXvisualConfig * config); +extern int +_gl_get_context_mode_data(const __GLcontextModes *mode, int attribute, + int *value_return); +#endif /* !defined(IN_MINI_GLX) */ + +extern __GLcontextModes * +_gl_context_modes_create(unsigned count, size_t minimum_size); +extern void +_gl_context_modes_destroy(__GLcontextModes * modes); +extern __GLcontextModes * +_gl_context_modes_find_visual(__GLcontextModes *modes, int vid); +extern __GLcontextModes * +_gl_context_modes_find_fbconfig(__GLcontextModes *modes, int fbid); +extern GLboolean +_gl_context_modes_are_same(const __GLcontextModes * a, + const __GLcontextModes * b); + +#endif /* GLCONTEXTMODES_H */ diff --git a/xserver/hw/xquartz/GL/indirect.c b/xserver/hw/xquartz/GL/indirect.c index 4e6ab3d13..2d88ef284 100644 --- a/xserver/hw/xquartz/GL/indirect.c +++ b/xserver/hw/xquartz/GL/indirect.c @@ -112,12 +112,6 @@ typedef struct __GLXAquaDrawable __GLXAquaDrawable; */ struct __GLXAquaScreen { __GLXscreen base; - - /* Supported GLX extensions */ - unsigned char glx_enable_bits[__GLX_EXT_BYTES]; - - int index; - int num_vis; }; struct __GLXAquaContext { @@ -387,6 +381,9 @@ __glXAquaContextMakeCurrent(__GLXcontext *baseContext) GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%p)\n", baseContext); + if (context->base.drawPriv != context->base.readPriv) + return 0; + if (attach(context, drawPriv)) return /*error*/ 0; @@ -542,38 +539,9 @@ __glXAquaScreenProbe(ScreenPtr pScreen) screen->base.fbconfigs = __glXAquaCreateVisualConfigs( &screen->base.numFBConfigs, pScreen->myNum); + __glXInitExtensionEnableBits(screen->base.glx_enable_bits); __glXScreenInit(&screen->base, pScreen); - screen->base.GLXmajor = 1; - screen->base.GLXminor = 4; - - memset(screen->glx_enable_bits, 0, __GLX_EXT_BYTES); - - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_info"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_rating"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_import_context"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_OML_swap_method"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIX_fbconfig"); - - __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIS_multisample"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_multisample"); - - //__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); - //__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_profile"); - - // Generate the GLX extensions string (overrides that set by __glXScreenInit()) - { - unsigned int buffer_size = - __glXGetExtensionString(screen->glx_enable_bits, NULL); - if (buffer_size > 0) { - free(screen->base.GLXextensions); - - screen->base.GLXextensions = xnfalloc(buffer_size); - __glXGetExtensionString(screen->glx_enable_bits, - screen->base.GLXextensions); - } - } - return &screen->base; } diff --git a/xserver/hw/xquartz/GL/visualConfigs.c b/xserver/hw/xquartz/GL/visualConfigs.c index 687bf80d8..ce68663cd 100644 --- a/xserver/hw/xquartz/GL/visualConfigs.c +++ b/xserver/hw/xquartz/GL/visualConfigs.c @@ -229,7 +229,6 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) /* SGIX_fbconfig / GLX 1.3 */ c->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT; c->renderType = GLX_RGBA_BIT; - c->xRenderable = GL_TRUE; c->fbconfigID = -1; /* SGIX_pbuffer / GLX 1.3 */ diff --git a/xserver/hw/xquartz/Makefile.in b/xserver/hw/xquartz/Makefile.in index 91896f488..ba0a5f7ef 100644 --- a/xserver/hw/xquartz/Makefile.in +++ b/xserver/hw/xquartz/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -355,6 +356,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -385,7 +389,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -480,6 +487,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xquartz/X11Application.h b/xserver/hw/xquartz/X11Application.h index 87cba6dec..740a8070a 100644 --- a/xserver/hw/xquartz/X11Application.h +++ b/xserver/hw/xquartz/X11Application.h @@ -86,9 +86,6 @@ X11ApplicationLaunchClient(const char *cmd); Bool X11ApplicationCanEnterRandR(void); -void -X11ApplicationFatalError(const char *f, va_list args) __printflike(1, 0); - void X11ApplicationMain(int argc, char **argv, char **envp); diff --git a/xserver/hw/xquartz/X11Application.m b/xserver/hw/xquartz/X11Application.m index d2c5d3083..768eecf68 100644 --- a/xserver/hw/xquartz/X11Application.m +++ b/xserver/hw/xquartz/X11Application.m @@ -84,7 +84,6 @@ static dispatch_queue_t eventTranslationQueue; extern Bool noTestExtensions; extern Bool noRenderExtension; -extern BOOL serverRunning; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 static TISInputSourceRef last_key_layout; @@ -366,6 +365,15 @@ message_kit_thread(SEL selector, NSObject *arg) else { /* No kit window is focused, so send it to X. */ for_appkit = NO; + + /* Reset our swallow state if we're seeing the same keyCode again. + * This can happen if we become !_x_active when the keyCode we + * intended to swallow is delivered. See: + * https://bugs.freedesktop.org/show_bug.cgi?id=92648 + */ + if ([e keyCode] == swallow_keycode) { + do_swallow = NO; + } } } else { /* KeyUp */ @@ -1087,53 +1095,6 @@ X11ApplicationCanEnterRandR(void) } } -void -X11ApplicationFatalError(const char *f, va_list args) -{ -#ifdef HAVE_LIBDISPATCH - NSString *title, *msg; - char *error_msg; - - /* This is called by FatalError() in the server thread just before - * we would abort. If the server never got off the ground, We should - * inform the user of the error rather than letting the ever-so-friendly - * CrashReporter do it for us. - * - * This also has the benefit of forcing user interaction rather than - * allowing an infinite throttled-restart if the crash occurs before - * we can drain the launchd socket. - */ - - if (serverRunning) { - return; - } - - title = NSLocalizedString(@"The application X11 could not be opened.", - @"Dialog title when encountering a fatal error"); - msg = NSLocalizedString( - @"An error occurred while starting the X11 server: \"%s\"\n\nClick Quit to quit X11. Click Report to see more details or send a report to Apple.", - @"Dialog when encountering a fatal error"); - - vasprintf(&error_msg, f, args); - msg = [NSString stringWithFormat:msg, error_msg]; - - /* We want the AppKit thread to actually service the alert or we will race [NSApp run] and create an - * 'NSInternalInconsistencyException', reason: 'NSApp with wrong _running count' - */ - dispatch_sync(dispatch_get_main_queue(), ^{ - if (NSAlertDefaultReturn == - NSRunAlertPanel (title, @"%@", - NSLocalizedString (@"Quit", @""), - NSLocalizedString (@"Report...", @""), - nil, msg)) { - exit (EXIT_FAILURE); - } - }); - - /* fall back to caller to do the abort() in the DIX */ -#endif -} - static void check_xinitrc(void) { @@ -1350,9 +1311,7 @@ untrusted_str(NSEvent *e) #endif extern void -darwinEvents_lock(void); -extern void -darwinEvents_unlock(void); +wait_for_mieq_init(void); - (void) sendX11NSEvent:(NSEvent *)e { @@ -1368,8 +1327,7 @@ darwinEvents_unlock(void); if (!darwinTabletCurrent) { /* Ensure that the event system is initialized */ - darwinEvents_lock(); - darwinEvents_unlock(); + wait_for_mieq_init(); assert(darwinTabletStylus); tilt = NSZeroPoint; diff --git a/xserver/hw/xquartz/bundle/Makefile.in b/xserver/hw/xquartz/bundle/Makefile.in index 6c7191a21..dd4fed6ce 100644 --- a/xserver/hw/xquartz/bundle/Makefile.in +++ b/xserver/hw/xquartz/bundle/Makefile.in @@ -63,9 +63,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/xquartz/bundle ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -303,6 +304,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -333,7 +337,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -428,6 +435,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xquartz/darwin.c b/xserver/hw/xquartz/darwin.c index 340343672..36c149cba 100644 --- a/xserver/hw/xquartz/darwin.c +++ b/xserver/hw/xquartz/darwin.c @@ -303,6 +303,11 @@ DarwinScreenInit(ScreenPtr pScreen, int argc, char **argv) ============================================================================= */ +static void +DarwinInputHandlerNotify(int fd __unused, int ready __unused, void *data __unused) +{ +} + /* * DarwinMouseProc: Handle the initialization, etc. of a mouse */ @@ -362,13 +367,13 @@ DarwinMouseProc(DeviceIntPtr pPointer, int what) case DEVICE_ON: pPointer->public.on = TRUE; - AddEnabledDevice(darwinEventReadFD); + SetNotifyFd(darwinEventReadFD, DarwinInputHandlerNotify, X_NOTIFY_READ, NULL); return Success; case DEVICE_CLOSE: case DEVICE_OFF: pPointer->public.on = FALSE; - RemoveEnabledDevice(darwinEventReadFD); + RemoveNotifyFd(darwinEventReadFD); return Success; } @@ -431,13 +436,13 @@ DarwinTabletProc(DeviceIntPtr pPointer, int what) case DEVICE_ON: pPointer->public.on = TRUE; - AddEnabledDevice(darwinEventReadFD); + SetNotifyFd(darwinEventReadFD, DarwinInputHandlerNotify, X_NOTIFY_READ, NULL); return Success; case DEVICE_CLOSE: case DEVICE_OFF: pPointer->public.on = FALSE; - RemoveEnabledDevice(darwinEventReadFD); + RemoveNotifyFd(darwinEventReadFD); return Success; } return Success; @@ -459,12 +464,12 @@ DarwinKeybdProc(DeviceIntPtr pDev, int onoff) case DEVICE_ON: pDev->public.on = TRUE; - AddEnabledDevice(darwinEventReadFD); + SetNotifyFd(darwinEventReadFD, DarwinInputHandlerNotify, X_NOTIFY_READ, NULL); break; case DEVICE_OFF: pDev->public.on = FALSE; - RemoveEnabledDevice(darwinEventReadFD); + RemoveNotifyFd(darwinEventReadFD); break; case DEVICE_CLOSE: @@ -675,7 +680,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) void OsVendorFatalError(const char *f, va_list args) { - X11ApplicationFatalError(f, args); } /* diff --git a/xserver/hw/xquartz/darwinEvents.c b/xserver/hw/xquartz/darwinEvents.c index 7f34e0c68..fd87e968b 100644 --- a/xserver/hw/xquartz/darwinEvents.c +++ b/xserver/hw/xquartz/darwinEvents.c @@ -92,10 +92,32 @@ static pthread_mutex_t fd_add_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t fd_add_ready_cond = PTHREAD_COND_INITIALIZER; static pthread_t fd_add_tid = NULL; -static InternalEvent* darwinEvents = NULL; +static BOOL mieqInitialized; +static pthread_mutex_t mieqInitializedMutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t mieqInitializedCond = PTHREAD_COND_INITIALIZER; -static pthread_mutex_t mieq_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t mieq_ready_cond = PTHREAD_COND_INITIALIZER; +_X_NOTSAN +extern inline void +wait_for_mieq_init(void) +{ + if (!mieqInitialized) { + pthread_mutex_lock(&mieqInitializedMutex); + while (!mieqInitialized) { + pthread_cond_wait(&mieqInitializedCond, &mieqInitializedMutex); + } + pthread_mutex_unlock(&mieqInitializedMutex); + } +} + +_X_NOTSAN +static inline void +signal_mieq_init(void) +{ + pthread_mutex_lock(&mieqInitializedMutex); + mieqInitialized = TRUE; + pthread_cond_broadcast(&mieqInitializedCond); + pthread_mutex_unlock(&mieqInitializedMutex); +} /*** Pthread Magics ***/ static pthread_t @@ -113,35 +135,6 @@ create_thread(void *(*func)(void *), void *arg) return tid; } -void -darwinEvents_lock(void); -void -darwinEvents_lock(void) -{ - int err; - if ((err = pthread_mutex_lock(&mieq_lock))) { - ErrorF("%s:%s:%d: Failed to lock mieq_lock: %d\n", - __FILE__, __FUNCTION__, __LINE__, err); - xorg_backtrace(); - } - if (darwinEvents == NULL) { - pthread_cond_wait(&mieq_ready_cond, &mieq_lock); - } -} - -void -darwinEvents_unlock(void); -void -darwinEvents_unlock(void) -{ - int err; - if ((err = pthread_mutex_unlock(&mieq_lock))) { - ErrorF("%s:%s:%d: Failed to unlock mieq_lock: %d\n", - __FILE__, __FUNCTION__, __LINE__, err); - xorg_backtrace(); - } -} - /* * DarwinPressModifierKey * Press or release the given modifier key (one of NX_MODIFIERKEY_* constants) @@ -379,24 +372,11 @@ DarwinEQInit(void) mieqInit(); mieqSetHandler(ET_XQuartz, DarwinEventHandler); - /* Note that this *could* cause a potential async issue, since we're checking - * darwinEvents without holding the lock, but darwinEvents is only ever set - * here, so I don't bother. - */ - if (!darwinEvents) { - darwinEvents = InitEventList(GetMaximumEventsNum()); - - if (!darwinEvents) - FatalError("Couldn't allocate event buffer\n"); - - darwinEvents_lock(); - pthread_cond_broadcast(&mieq_ready_cond); - darwinEvents_unlock(); - } - if (!fd_add_tid) fd_add_tid = create_thread(DarwinProcessFDAdditionQueue_thread, NULL); + signal_mieq_init(); + return TRUE; } @@ -437,7 +417,7 @@ DarwinPokeEQ(void) void DarwinInputReleaseButtonsAndKeys(DeviceIntPtr pDev) { - darwinEvents_lock(); + input_lock(); { int i; if (pDev->button) { @@ -458,7 +438,7 @@ DarwinInputReleaseButtonsAndKeys(DeviceIntPtr pDev) } } DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } void @@ -470,12 +450,6 @@ DarwinSendTabletEvents(DeviceIntPtr pDev, int ev_type, int ev_button, ScreenPtr screen; ValuatorMask valuators; - if (!darwinEvents) { - DEBUG_LOG("%s called before darwinEvents was initialized\n", - __FUNCTION__); - return; - } - screen = miPointerGetScreen(pDev); if (!screen) { DEBUG_LOG("%s called before screen was initialized\n", @@ -498,7 +472,7 @@ DarwinSendTabletEvents(DeviceIntPtr pDev, int ev_type, int ev_button, valuator_mask_set_double(&valuators, 3, XQUARTZ_VALUATOR_LIMIT * tilt_x); valuator_mask_set_double(&valuators, 4, XQUARTZ_VALUATOR_LIMIT * tilt_y); - darwinEvents_lock(); + input_lock(); { if (ev_type == ProximityIn || ev_type == ProximityOut) { QueueProximityEvents(pDev, ev_type, &valuators); @@ -507,7 +481,7 @@ DarwinSendTabletEvents(DeviceIntPtr pDev, int ev_type, int ev_button, &valuators); } DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } void @@ -519,12 +493,6 @@ DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, ScreenPtr screen; ValuatorMask valuators; - if (!darwinEvents) { - DEBUG_LOG("%s called before darwinEvents was initialized\n", - __FUNCTION__); - return; - } - screen = miPointerGetScreen(pDev); if (!screen) { DEBUG_LOG("%s called before screen was initialized\n", @@ -587,29 +555,22 @@ DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, valuator_mask_set_double(&valuators, 3, pointer_dy); } - darwinEvents_lock(); + input_lock(); { QueuePointerEvents(pDev, ev_type, ev_button, POINTER_ABSOLUTE, &valuators); DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } void DarwinSendKeyboardEvents(int ev_type, int keycode) { - - if (!darwinEvents) { - DEBUG_LOG( - "DarwinSendKeyboardEvents called before darwinEvents was initialized\n"); - return; - } - - darwinEvents_lock(); + input_lock(); { QueueKeyboardEvents(darwinKeyboard, ev_type, keycode + MIN_KEYCODE); DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } /* Send the appropriate number of button clicks to emulate scroll wheel */ @@ -618,12 +579,6 @@ DarwinSendScrollEvents(double scroll_x, double scroll_y) { ScreenPtr screen; ValuatorMask valuators; - if (!darwinEvents) { - DEBUG_LOG( - "DarwinSendScrollEvents called before darwinEvents was initialized\n"); - return; - } - screen = miPointerGetScreen(darwinPointer); if (!screen) { DEBUG_LOG( @@ -635,12 +590,12 @@ DarwinSendScrollEvents(double scroll_x, double scroll_y) { valuator_mask_set_double(&valuators, 4, scroll_y); valuator_mask_set_double(&valuators, 5, scroll_x); - darwinEvents_lock(); + input_lock(); { QueuePointerEvents(darwinPointer, MotionNotify, 0, POINTER_RELATIVE, &valuators); DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } /* Send the appropriate KeyPress/KeyRelease events to GetKeyboardEvents to @@ -682,9 +637,11 @@ DarwinSendDDXEvent(int type, int argc, ...) va_end(args); } - darwinEvents_lock(); + wait_for_mieq_init(); + + input_lock(); { mieqEnqueue(NULL, (InternalEvent *)&e); DarwinPokeEQ(); - } darwinEvents_unlock(); + } input_unlock(); } diff --git a/xserver/hw/xquartz/darwinXinput.c b/xserver/hw/xquartz/darwinXinput.c index 3efaa2ca4..fea7e921e 100644 --- a/xserver/hw/xquartz/darwinXinput.c +++ b/xserver/hw/xquartz/darwinXinput.c @@ -147,3 +147,18 @@ DeleteInputDeviceRequest(DeviceIntPtr dev) { DEBUG_LOG("DeleteInputDeviceRequest(%p)\n", dev); } + +/**************************************************************************** + * + * Caller: configRemoveDevice (and others) + * + * Remove any traces of the input device specified in config_info. + * This is only necessary if the ddx keeps information around beyond + * the NewInputDeviceRequest/DeleteInputDeviceRequest + * + */ +void +RemoveInputDeviceTraces(const char *config_info) +{ + DEBUG_LOG("RemoveInputDeviceTraces(%s)\n", config_info); +} diff --git a/xserver/hw/xquartz/mach-startup/Makefile.in b/xserver/hw/xquartz/mach-startup/Makefile.in index 5874de66e..661020c29 100644 --- a/xserver/hw/xquartz/mach-startup/Makefile.in +++ b/xserver/hw/xquartz/mach-startup/Makefile.in @@ -70,9 +70,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -334,6 +335,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -364,7 +368,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -459,6 +466,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xquartz/man/Makefile.in b/xserver/hw/xquartz/man/Makefile.in index 262c8d19c..f5ed0fd7c 100644 --- a/xserver/hw/xquartz/man/Makefile.in +++ b/xserver/hw/xquartz/man/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/xquartz/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -313,6 +314,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -343,7 +347,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -438,6 +445,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xquartz/pbproxy/Makefile.am b/xserver/hw/xquartz/pbproxy/Makefile.am index 1b14dffce..9429ea25d 100644 --- a/xserver/hw/xquartz/pbproxy/Makefile.am +++ b/xserver/hw/xquartz/pbproxy/Makefile.am @@ -1,7 +1,6 @@ -AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \ - -DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" +AM_CPPFLAGS=-DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" -AM_CFLAGS=$(XPBPROXY_CFLAGS) +AM_CFLAGS=$(XPBPROXY_CFLAGS) AM_OBJCFLAGS=$(XPBPROXY_CFLAGS) noinst_LTLIBRARIES = libxpbproxy.la diff --git a/xserver/hw/xquartz/pbproxy/Makefile.in b/xserver/hw/xquartz/pbproxy/Makefile.in index ab9631dc5..9561699af 100644 --- a/xserver/hw/xquartz/pbproxy/Makefile.in +++ b/xserver/hw/xquartz/pbproxy/Makefile.in @@ -58,9 +58,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -329,6 +330,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -359,7 +363,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -454,6 +461,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -501,9 +509,9 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \ - -DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" $(am__append_1) -AM_CFLAGS = $(XPBPROXY_CFLAGS) +AM_CPPFLAGS = -DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" \ + $(am__append_1) +AM_CFLAGS = $(XPBPROXY_CFLAGS) AM_OBJCFLAGS = $(XPBPROXY_CFLAGS) noinst_LTLIBRARIES = libxpbproxy.la libxpbproxy_la_SOURCES = \ diff --git a/xserver/hw/xquartz/pbproxy/app-main.m b/xserver/hw/xquartz/pbproxy/app-main.m index 37b578223..eda9a9e67 100644 --- a/xserver/hw/xquartz/pbproxy/app-main.m +++ b/xserver/hw/xquartz/pbproxy/app-main.m @@ -40,9 +40,6 @@ CFStringRef app_prefs_domain_cfstr; /* Stubs */ char *display = NULL; -BOOL serverRunning = YES; -pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; static void signal_handler(int sig) diff --git a/xserver/hw/xquartz/pbproxy/main.m b/xserver/hw/xquartz/pbproxy/main.m index abedb0839..2d2f76108 100644 --- a/xserver/hw/xquartz/pbproxy/main.m +++ b/xserver/hw/xquartz/pbproxy/main.m @@ -48,22 +48,6 @@ BOOL xpbproxy_is_standalone = NO; x_selection *_selection_object; -extern BOOL serverRunning; -extern pthread_mutex_t serverRunningMutex; -extern pthread_cond_t serverRunningCond; - -static inline void -wait_for_server_init(void) -{ - /* If the server hasn't finished initializing, wait for it... */ - if (!serverRunning) { - pthread_mutex_lock(&serverRunningMutex); - while (!serverRunning) - pthread_cond_wait(&serverRunningCond, &serverRunningMutex); - pthread_mutex_unlock(&serverRunningMutex); - } -} - static int x_io_error_handler(Display *dpy) { @@ -97,8 +81,6 @@ xpbproxy_run(void) NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; size_t i; - wait_for_server_init(); - for (i = 0, xpbproxy_dpy = NULL; !xpbproxy_dpy && i < 5; i++) { xpbproxy_dpy = XOpenDisplay(NULL); diff --git a/xserver/hw/xquartz/quartz.c b/xserver/hw/xquartz/quartz.c index c8b6f966d..c8ea3bf8b 100644 --- a/xserver/hw/xquartz/quartz.c +++ b/xserver/hw/xquartz/quartz.c @@ -178,6 +178,7 @@ QuartzInitOutput(int argc, { /* For XQuartz, we want to just use the default signal handler to work better with CrashTracer */ signal(SIGSEGV, SIG_DFL); + signal(SIGABRT, SIG_DFL); signal(SIGILL, SIG_DFL); #ifdef SIGEMT signal(SIGEMT, SIG_DFL); diff --git a/xserver/hw/xquartz/quartzCocoa.m b/xserver/hw/xquartz/quartzCocoa.m index d21fb7d91..ac6f67e2b 100644 --- a/xserver/hw/xquartz/quartzCocoa.m +++ b/xserver/hw/xquartz/quartzCocoa.m @@ -48,9 +48,7 @@ * Clean out any autoreleased objects. */ void -QuartzBlockHandler(void *blockData, - OSTimePtr pTimeout, - void *pReadmask) +QuartzBlockHandler(void *blockData, void *pTimeout) { static NSAutoreleasePool *aPool = nil; @@ -62,9 +60,7 @@ QuartzBlockHandler(void *blockData, * QuartzWakeupHandler */ void -QuartzWakeupHandler(void *blockData, - int result, - void *pReadmask) +QuartzWakeupHandler(void *blockData, int result) { // nothing here } diff --git a/xserver/hw/xquartz/quartzCommon.h b/xserver/hw/xquartz/quartzCommon.h index 308a3f173..721886b87 100644 --- a/xserver/hw/xquartz/quartzCommon.h +++ b/xserver/hw/xquartz/quartzCommon.h @@ -47,8 +47,9 @@ extern int aquaMenuBarHeight; extern const char *quartzOpenGLBundle; void -QuartzBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask); +QuartzBlockHandler(void *blockData, void *pTimeout); + void -QuartzWakeupHandler(void *blockData, int result, void *pReadmask); +QuartzWakeupHandler(void *blockData, int result); #endif /* _QUARTZCOMMON_H */ diff --git a/xserver/hw/xquartz/quartzStartup.c b/xserver/hw/xquartz/quartzStartup.c index 4dc4dd630..bb92b6d3c 100644 --- a/xserver/hw/xquartz/quartzStartup.c +++ b/xserver/hw/xquartz/quartzStartup.c @@ -95,6 +95,15 @@ QuartzInitServer(int argc, char **argv, char **envp) if (!create_thread(server_thread, args)) { FatalError("can't create secondary thread\n"); } + + /* Block signals on the AppKit thread that the X11 expects to handle on its thread */ + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGALRM); +#ifdef BUSFAULT + sigaddset(&set, SIGBUS); +#endif + pthread_sigmask(SIG_BLOCK, &set, NULL); } int diff --git a/xserver/hw/xquartz/xpr/Makefile.in b/xserver/hw/xquartz/xpr/Makefile.in index e3ff61d91..86a9423c7 100644 --- a/xserver/hw/xquartz/xpr/Makefile.in +++ b/xserver/hw/xquartz/xpr/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -300,6 +301,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -330,7 +334,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -425,6 +432,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xwayland/Makefile.am b/xserver/hw/xwayland/Makefile.am index 0e6a1eaa2..a3c9fce48 100644 --- a/xserver/hw/xwayland/Makefile.am +++ b/xserver/hw/xwayland/Makefile.am @@ -30,6 +30,7 @@ Xwayland_LDADD = \ $(XSERVER_SYS_LIBS) Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) +Xwayland_built_sources = if GLAMOR_EGL Xwayland_SOURCES += \ @@ -39,26 +40,45 @@ Xwayland_SOURCES += \ xwayland-glamor-xv.c endif -nodist_Xwayland_SOURCES = \ +glamor_built_sources = \ drm-client-protocol.h \ drm-protocol.c -CLEANFILES = $(nodist_Xwayland_SOURCES) - -xwayland-glamor.c : $(nodist_Xwayland_SOURCES) +Xwayland_built_sources += $(glamor_built_sources) glamor_lib = $(top_builddir)/glamor/libglamor.la Xwayland_LDADD += $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL -Xwayland_DEPENDENCIES = $(glamor_lib) +Xwayland_DEPENDENCIES = $(glamor_lib) $(XWAYLAND_LIBS) endif +Xwayland_built_sources += \ + relative-pointer-unstable-v1-client-protocol.h \ + relative-pointer-unstable-v1-protocol.c \ + pointer-constraints-unstable-v1-client-protocol.h \ + pointer-constraints-unstable-v1-protocol.c + +nodist_Xwayland_SOURCES = $(Xwayland_built_sources) +CLEANFILES = $(Xwayland_built_sources) + EXTRA_DIST = drm.xml +$(Xwayland_SOURCES): $(Xwayland_built_sources) + relink: $(AM_V_at)rm -f Xwayland$(EXEEXT) && $(MAKE) Xwayland$(EXEEXT) +relative-pointer-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ +relative-pointer-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + +pointer-constraints-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ +pointer-constraints-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + %-protocol.c : %.xml $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ diff --git a/xserver/hw/xwayland/Makefile.in b/xserver/hw/xwayland/Makefile.in index 59bb3e029..7b9a37e89 100644 --- a/xserver/hw/xwayland/Makefile.in +++ b/xserver/hw/xwayland/Makefile.in @@ -57,7 +57,8 @@ bin_PROGRAMS = Xwayland$(EXEEXT) @GLAMOR_EGL_TRUE@@XV_TRUE@am__append_2 = \ @GLAMOR_EGL_TRUE@@XV_TRUE@ xwayland-glamor-xv.c -@GLAMOR_EGL_TRUE@am__append_3 = $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL +@GLAMOR_EGL_TRUE@am__append_3 = $(glamor_built_sources) +@GLAMOR_EGL_TRUE@am__append_4 = $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL @GLAMOR_EGL_FALSE@Xwayland_DEPENDENCIES = $(glamor_lib) \ @GLAMOR_EGL_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @GLAMOR_EGL_FALSE@ $(top_builddir)/Xext/libXvidmode.la \ @@ -67,9 +68,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -102,8 +104,12 @@ am_Xwayland_OBJECTS = Xwayland-xwayland.$(OBJEXT) \ Xwayland-xwayland-vidmode.$(OBJEXT) \ Xwayland-dpmsstubs.$(OBJEXT) Xwayland-stubs.$(OBJEXT) \ Xwayland-miinitext.$(OBJEXT) $(am__objects_1) $(am__objects_2) -@GLAMOR_EGL_TRUE@nodist_Xwayland_OBJECTS = \ -@GLAMOR_EGL_TRUE@ Xwayland-drm-protocol.$(OBJEXT) +@GLAMOR_EGL_TRUE@am__objects_3 = Xwayland-drm-protocol.$(OBJEXT) +@GLAMOR_EGL_TRUE@am__objects_4 = $(am__objects_3) +am__objects_5 = $(am__objects_4) \ + Xwayland-relative-pointer-unstable-v1-protocol.$(OBJEXT) \ + Xwayland-pointer-constraints-unstable-v1-protocol.$(OBJEXT) +nodist_Xwayland_OBJECTS = $(am__objects_5) Xwayland_OBJECTS = $(am_Xwayland_OBJECTS) $(nodist_Xwayland_OBJECTS) am__DEPENDENCIES_1 = @GLAMOR_EGL_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ @@ -334,6 +340,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -364,7 +373,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -459,6 +471,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -522,15 +535,21 @@ Xwayland_SOURCES = xwayland.c xwayland-input.c xwayland-cursor.c \ $(am__append_1) $(am__append_2) Xwayland_LDADD = $(glamor_lib) $(XWAYLAND_LIBS) $(XWAYLAND_SYS_LIBS) \ $(top_builddir)/Xext/libXvidmode.la $(XSERVER_SYS_LIBS) \ - $(am__append_3) + $(am__append_4) Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -@GLAMOR_EGL_TRUE@nodist_Xwayland_SOURCES = \ +Xwayland_built_sources = $(am__append_3) \ + relative-pointer-unstable-v1-client-protocol.h \ + relative-pointer-unstable-v1-protocol.c \ + pointer-constraints-unstable-v1-client-protocol.h \ + pointer-constraints-unstable-v1-protocol.c +@GLAMOR_EGL_TRUE@glamor_built_sources = \ @GLAMOR_EGL_TRUE@ drm-client-protocol.h \ @GLAMOR_EGL_TRUE@ drm-protocol.c -@GLAMOR_EGL_TRUE@CLEANFILES = $(nodist_Xwayland_SOURCES) @GLAMOR_EGL_TRUE@glamor_lib = $(top_builddir)/glamor/libglamor.la -@GLAMOR_EGL_TRUE@Xwayland_DEPENDENCIES = $(glamor_lib) +@GLAMOR_EGL_TRUE@Xwayland_DEPENDENCIES = $(glamor_lib) $(XWAYLAND_LIBS) +nodist_Xwayland_SOURCES = $(Xwayland_built_sources) +CLEANFILES = $(Xwayland_built_sources) EXTRA_DIST = drm.xml all: all-am @@ -625,6 +644,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-dpmsstubs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-drm-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-miinitext.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-stubs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-cursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-cvt.Po@am__quote@ @@ -839,6 +860,34 @@ Xwayland-drm-protocol.obj: drm-protocol.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-drm-protocol.obj `if test -f 'drm-protocol.c'; then $(CYGPATH_W) 'drm-protocol.c'; else $(CYGPATH_W) '$(srcdir)/drm-protocol.c'; fi` +Xwayland-relative-pointer-unstable-v1-protocol.o: relative-pointer-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-relative-pointer-unstable-v1-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Tpo -c -o Xwayland-relative-pointer-unstable-v1-protocol.o `test -f 'relative-pointer-unstable-v1-protocol.c' || echo '$(srcdir)/'`relative-pointer-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='relative-pointer-unstable-v1-protocol.c' object='Xwayland-relative-pointer-unstable-v1-protocol.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-relative-pointer-unstable-v1-protocol.o `test -f 'relative-pointer-unstable-v1-protocol.c' || echo '$(srcdir)/'`relative-pointer-unstable-v1-protocol.c + +Xwayland-relative-pointer-unstable-v1-protocol.obj: relative-pointer-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-relative-pointer-unstable-v1-protocol.obj -MD -MP -MF $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Tpo -c -o Xwayland-relative-pointer-unstable-v1-protocol.obj `if test -f 'relative-pointer-unstable-v1-protocol.c'; then $(CYGPATH_W) 'relative-pointer-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/relative-pointer-unstable-v1-protocol.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-relative-pointer-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='relative-pointer-unstable-v1-protocol.c' object='Xwayland-relative-pointer-unstable-v1-protocol.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-relative-pointer-unstable-v1-protocol.obj `if test -f 'relative-pointer-unstable-v1-protocol.c'; then $(CYGPATH_W) 'relative-pointer-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/relative-pointer-unstable-v1-protocol.c'; fi` + +Xwayland-pointer-constraints-unstable-v1-protocol.o: pointer-constraints-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-pointer-constraints-unstable-v1-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Tpo -c -o Xwayland-pointer-constraints-unstable-v1-protocol.o `test -f 'pointer-constraints-unstable-v1-protocol.c' || echo '$(srcdir)/'`pointer-constraints-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pointer-constraints-unstable-v1-protocol.c' object='Xwayland-pointer-constraints-unstable-v1-protocol.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-pointer-constraints-unstable-v1-protocol.o `test -f 'pointer-constraints-unstable-v1-protocol.c' || echo '$(srcdir)/'`pointer-constraints-unstable-v1-protocol.c + +Xwayland-pointer-constraints-unstable-v1-protocol.obj: pointer-constraints-unstable-v1-protocol.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-pointer-constraints-unstable-v1-protocol.obj -MD -MP -MF $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Tpo -c -o Xwayland-pointer-constraints-unstable-v1-protocol.obj `if test -f 'pointer-constraints-unstable-v1-protocol.c'; then $(CYGPATH_W) 'pointer-constraints-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/pointer-constraints-unstable-v1-protocol.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Tpo $(DEPDIR)/Xwayland-pointer-constraints-unstable-v1-protocol.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pointer-constraints-unstable-v1-protocol.c' object='Xwayland-pointer-constraints-unstable-v1-protocol.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -c -o Xwayland-pointer-constraints-unstable-v1-protocol.obj `if test -f 'pointer-constraints-unstable-v1-protocol.c'; then $(CYGPATH_W) 'pointer-constraints-unstable-v1-protocol.c'; else $(CYGPATH_W) '$(srcdir)/pointer-constraints-unstable-v1-protocol.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -1066,11 +1115,21 @@ uninstall-am: uninstall-binPROGRAMS tags uninstall uninstall-am uninstall-binPROGRAMS -@GLAMOR_EGL_TRUE@xwayland-glamor.c : $(nodist_Xwayland_SOURCES) +$(Xwayland_SOURCES): $(Xwayland_built_sources) relink: $(AM_V_at)rm -f Xwayland$(EXEEXT) && $(MAKE) Xwayland$(EXEEXT) +relative-pointer-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ +relative-pointer-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + +pointer-constraints-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ +pointer-constraints-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml + $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ + %-protocol.c : %.xml $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ diff --git a/xserver/hw/xwayland/drm.xml b/xserver/hw/xwayland/drm.xml index 8a3ad69b2..5e64622df 100644 --- a/xserver/hw/xwayland/drm.xml +++ b/xserver/hw/xwayland/drm.xml @@ -135,22 +135,6 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/xserver/hw/xwayland/xwayland-cursor.c b/xserver/hw/xwayland/xwayland-cursor.c index 74dfe4e7e..f334f1ca5 100644 --- a/xserver/hw/xwayland/xwayland-cursor.c +++ b/xserver/hw/xwayland/xwayland-cursor.c @@ -76,6 +76,7 @@ static Bool xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor) { PixmapPtr pixmap; + struct xwl_screen *xwl_screen; struct xwl_seat *xwl_seat; pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key); @@ -85,22 +86,32 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor) dixSetPrivate(&cursor->devPrivates, &xwl_cursor_private_key, NULL); /* When called from FreeCursor(), device is always NULL */ - if (device) { - xwl_seat = device->public.devicePrivate; - if (xwl_seat && cursor == xwl_seat->x_cursor) + xwl_screen = xwl_screen_get(screen); + xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { + if (cursor == xwl_seat->x_cursor) xwl_seat->x_cursor = NULL; } return xwl_shm_destroy_pixmap(pixmap); } +static void +clear_cursor_frame_callback(struct xwl_seat *xwl_seat) +{ + if (xwl_seat->cursor_frame_cb) { + wl_callback_destroy (xwl_seat->cursor_frame_cb); + xwl_seat->cursor_frame_cb = NULL; + } +} + static void frame_callback(void *data, struct wl_callback *callback, uint32_t time) { struct xwl_seat *xwl_seat = data; - xwl_seat->cursor_frame_cb = NULL; + + clear_cursor_frame_callback(xwl_seat); if (xwl_seat->cursor_needs_update) { xwl_seat->cursor_needs_update = FALSE; xwl_seat_set_cursor(xwl_seat); @@ -124,6 +135,8 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) if (!xwl_seat->x_cursor) { wl_pointer_set_cursor(xwl_seat->wl_pointer, xwl_seat->pointer_enter_serial, NULL, 0, 0); + clear_cursor_frame_callback(xwl_seat); + xwl_seat->cursor_needs_update = FALSE; return; } @@ -166,12 +179,19 @@ xwl_set_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor, int x, int y) { struct xwl_seat *xwl_seat; + Bool cursor_visibility_changed; xwl_seat = device->public.devicePrivate; if (xwl_seat == NULL) return; + cursor_visibility_changed = !!xwl_seat->x_cursor ^ !!cursor; + xwl_seat->x_cursor = cursor; + + if (cursor_visibility_changed) + xwl_seat_cursor_visibility_changed(xwl_seat); + xwl_seat_set_cursor(xwl_seat); } diff --git a/xserver/hw/xwayland/xwayland-cvt.c b/xserver/hw/xwayland/xwayland-cvt.c index 9655e104e..8564fdbae 100644 --- a/xserver/hw/xwayland/xwayland-cvt.c +++ b/xserver/hw/xwayland/xwayland-cvt.c @@ -296,6 +296,13 @@ xwayland_cvt(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, if (Interlaced) modeinfo.modeFlags |= RR_Interlace; + /* FWXGA hack adapted from hw/xfree86/modes/xf86EdidModes.c, because you can't say 1366 */ + if (HDisplay == 1366 && VDisplay == 768) { + modeinfo.width = 1366; + modeinfo.hSyncStart--; + modeinfo.hSyncEnd--; + } + snprintf(name, sizeof name, "%dx%d", modeinfo.width, modeinfo.height); modeinfo.nameLength = strlen(name); diff --git a/xserver/hw/xwayland/xwayland-glamor.c b/xserver/hw/xwayland/xwayland-glamor.c index a7ae78603..63f230369 100644 --- a/xserver/hw/xwayland/xwayland-glamor.c +++ b/xserver/hw/xwayland/xwayland-glamor.c @@ -31,14 +31,15 @@ #define MESA_EGL_NO_X11_HEADERS #include -#include -#include +#include #include #include #include #include "drm-client-protocol.h" +static DevPrivateKeyRec xwl_auth_state_private_key; + struct xwl_pixmap { struct wl_buffer *buffer; struct gbm_bo *bo; @@ -292,9 +293,10 @@ xwl_drm_init_egl(struct xwl_screen *xwl_screen) return; } - xwl_screen->egl_display = eglGetDisplay(xwl_screen->gbm); + xwl_screen->egl_display = glamor_egl_get_display(EGL_PLATFORM_GBM_MESA, + xwl_screen->gbm); if (xwl_screen->egl_display == EGL_NO_DISPLAY) { - ErrorF("eglGetDisplay() failed\n"); + ErrorF("glamor_egl_get_display() failed\n"); return; } @@ -347,7 +349,7 @@ xwl_drm_handle_device(void *data, struct wl_drm *drm, const char *device) xwl_screen->drm_fd = open(xwl_screen->device_name, O_RDWR | O_CLOEXEC); if (xwl_screen->drm_fd == -1) { ErrorF("wayland-egl: could not open %s (%s)\n", - xwl_screen->device_name, strerror(errno)); + xwl_screen->device_name, strerror(errno)); return; } @@ -417,11 +419,6 @@ xwl_screen_init_glamor(struct xwl_screen *xwl_screen, return TRUE; } -void -glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) -{ -} - int glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, PixmapPtr pixmap, @@ -434,17 +431,49 @@ glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, struct xwl_auth_state { int fd; ClientPtr client; + struct wl_callback *callback; }; +static void +free_xwl_auth_state(ClientPtr pClient, struct xwl_auth_state *state) +{ + dixSetPrivate(&pClient->devPrivates, &xwl_auth_state_private_key, NULL); + if (state) { + wl_callback_destroy(state->callback); + free(state); + } +} + +static void +xwl_auth_state_client_callback(CallbackListPtr *pcbl, void *unused, void *data) +{ + NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; + ClientPtr pClient = clientinfo->client; + struct xwl_auth_state *state; + + switch (pClient->clientState) { + case ClientStateGone: + case ClientStateRetained: + state = dixLookupPrivate(&pClient->devPrivates, &xwl_auth_state_private_key); + free_xwl_auth_state(pClient, state); + break; + default: + break; + } +} + static void sync_callback(void *data, struct wl_callback *callback, uint32_t serial) { struct xwl_auth_state *state = data; + ClientPtr client = state->client; - dri3_send_open_reply(state->client, state->fd); - AttendClient(state->client); - free(state); - wl_callback_destroy(callback); + /* if the client is gone, the callback is cancelled so it's safe to + * assume the client is still in ClientStateRunning at this point... + */ + dri3_send_open_reply(client, state->fd); + AttendClient(client); + free_xwl_auth_state(client, state); } static const struct wl_callback_listener sync_listener = { @@ -459,7 +488,6 @@ xwl_dri3_open_client(ClientPtr client, { struct xwl_screen *xwl_screen = xwl_screen_get(screen); struct xwl_auth_state *state; - struct wl_callback *callback; drm_magic_t magic; int fd; @@ -487,8 +515,9 @@ xwl_dri3_open_client(ClientPtr client, } wl_drm_authenticate(xwl_screen->drm, magic); - callback = wl_display_sync(xwl_screen->display); - wl_callback_add_listener(callback, &sync_listener, state); + state->callback = wl_display_sync(xwl_screen->display); + wl_callback_add_listener(state->callback, &sync_listener, state); + dixSetPrivate(&client->devPrivates, &xwl_auth_state_private_key, state); IgnoreClient(client); @@ -570,6 +599,16 @@ xwl_glamor_init(struct xwl_screen *xwl_screen) return FALSE; } + if (!dixRegisterPrivateKey(&xwl_auth_state_private_key, PRIVATE_CLIENT, 0)) { + ErrorF("Failed to register private key\n"); + return FALSE; + } + + if (!AddCallback(&ClientStateCallback, xwl_auth_state_client_callback, NULL)) { + ErrorF("Failed to add client state callback\n"); + return FALSE; + } + xwl_screen->CreateScreenResources = screen->CreateScreenResources; screen->CreateScreenResources = xwl_glamor_create_screen_resources; screen->CreatePixmap = xwl_glamor_create_pixmap; diff --git a/xserver/hw/xwayland/xwayland-input.c b/xserver/hw/xwayland/xwayland-input.c index 23e138d53..f2564d5d3 100644 --- a/xserver/hw/xwayland/xwayland-input.c +++ b/xserver/hw/xwayland/xwayland-input.c @@ -41,44 +41,77 @@ (miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \ (miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey)) +struct sync_pending { + struct xorg_list l; + DeviceIntPtr pending_dev; +}; + +static void +xwl_pointer_warp_emulator_handle_motion(struct xwl_pointer_warp_emulator *warp_emulator, + double dx, + double dy, + double dx_unaccel, + double dy_unaccel); +static void +xwl_pointer_warp_emulator_maybe_lock(struct xwl_pointer_warp_emulator *warp_emulator, + struct xwl_window *xwl_window, + SpritePtr sprite, + int x, int y); + +static void +xwl_seat_destroy_confined_pointer(struct xwl_seat *xwl_seat); + static void xwl_pointer_control(DeviceIntPtr device, PtrCtrl *ctrl) { /* Nothing to do, dix handles all settings */ } -static int -xwl_pointer_proc(DeviceIntPtr device, int what) +static Bool +init_pointer_buttons(DeviceIntPtr device) { #define NBUTTONS 10 -#define NAXES 4 BYTE map[NBUTTONS + 1]; int i = 0; Atom btn_labels[NBUTTONS] = { 0 }; + + for (i = 1; i <= NBUTTONS; i++) + map[i] = i; + + btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); + btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); + btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); + btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); + btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); + btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); + btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); + /* don't know about the rest */ + + if (!InitButtonClassDeviceStruct(device, NBUTTONS, btn_labels, map)) + return FALSE; + + return TRUE; +} + +static int +xwl_pointer_proc(DeviceIntPtr device, int what) +{ +#define NAXES 4 Atom axes_labels[NAXES] = { 0 }; switch (what) { case DEVICE_INIT: device->public.on = FALSE; - for (i = 1; i <= NBUTTONS; i++) - map[i] = i; - - btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); - btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); - btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); - btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); - btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); - btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); - btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); - /* don't know about the rest */ + if (!init_pointer_buttons(device)) + return BadValue; axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HWHEEL); axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_WHEEL); - if (!InitValuatorClassDeviceStruct(device, NAXES, btn_labels, + if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels, GetMotionHistorySize(), Absolute)) return BadValue; @@ -98,7 +131,55 @@ xwl_pointer_proc(DeviceIntPtr device, int what) if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) return BadValue; - if (!InitButtonClassDeviceStruct(device, 3, btn_labels, map)) + return Success; + + case DEVICE_ON: + device->public.on = TRUE; + return Success; + + case DEVICE_OFF: + case DEVICE_CLOSE: + device->public.on = FALSE; + return Success; + } + + return BadMatch; + +#undef NBUTTONS +#undef NAXES +} + +static int +xwl_pointer_proc_relative(DeviceIntPtr device, int what) +{ +#define NAXES 2 + Atom axes_labels[NAXES] = { 0 }; + + switch (what) { + case DEVICE_INIT: + device->public.on = FALSE; + + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); + + /* + * We'll never send buttons, but XGetPointerMapping might in certain + * situations make the client think we have no buttons. + */ + if (!init_pointer_buttons(device)) + return BadValue; + + if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels, + GetMotionHistorySize(), Relative)) + return BadValue; + + /* Valuators */ + InitValuatorAxisStruct(device, 0, axes_labels[0], + NO_AXIS_LIMITS, NO_AXIS_LIMITS, 1, 0, 1, Relative); + InitValuatorAxisStruct(device, 1, axes_labels[1], + NO_AXIS_LIMITS, NO_AXIS_LIMITS, 1, 0, 1, Relative); + + if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) return BadValue; return Success; @@ -115,7 +196,6 @@ xwl_pointer_proc(DeviceIntPtr device, int what) return BadMatch; -#undef NBUTTONS #undef NAXES } @@ -162,7 +242,6 @@ xwl_touch_proc(DeviceIntPtr device, int what) #define NTOUCHPOINTS 20 #define NBUTTONS 1 #define NAXES 2 - struct xwl_seat *xwl_seat = device->public.devicePrivate; Atom btn_labels[NBUTTONS] = { 0 }; Atom axes_labels[NAXES] = { 0 }; BYTE map[NBUTTONS + 1] = { 0 }; @@ -186,13 +265,10 @@ xwl_touch_proc(DeviceIntPtr device, int what) return BadValue; /* Valuators */ - /* FIXME: devices might be mapped to a single wl_output */ InitValuatorAxisStruct(device, 0, axes_labels[0], - 0, xwl_seat->xwl_screen->width, - 10000, 0, 10000, Absolute); + 0, 0xFFFF, 10000, 0, 10000, Absolute); InitValuatorAxisStruct(device, 1, axes_labels[1], - 0, xwl_seat->xwl_screen->height, - 10000, 0, 10000, Absolute); + 0, 0xFFFF, 10000, 0, 10000, Absolute); return Success; case DEVICE_ON: @@ -219,10 +295,10 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, struct xwl_seat *xwl_seat = data; DeviceIntPtr dev = xwl_seat->pointer; DeviceIntPtr master; - miPointerPtr mipointer; int i; int sx = wl_fixed_to_int(sx_w); int sy = wl_fixed_to_int(sy_w); + int dx, dy; ScreenPtr pScreen = xwl_seat->xwl_screen->screen; ValuatorMask mask; @@ -239,17 +315,16 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, xwl_seat->pointer_enter_serial = serial; xwl_seat->focus_window = wl_surface_get_user_data(surface); + dx = xwl_seat->focus_window->window->drawable.x; + dy = xwl_seat->focus_window->window->drawable.y; + + /* We just entered a new xwindow, forget about the old last xwindow */ + xwl_seat->last_xwindow = NullWindow; master = GetMaster(dev, POINTER_OR_FLOAT); - (*pScreen->SetCursorPosition) (dev, pScreen, sx, sy, TRUE); + (*pScreen->SetCursorPosition) (dev, pScreen, dx + sx, dy + sy, TRUE); - /* X is very likely to have the wrong idea of what the actual cursor - * sprite is, so in order to force updating the cursor lets set the - * current sprite to some invalid cursor behind its back so that it - * always will think it changed to the not invalid cursor. - */ - mipointer = MIPOINTER(master); - mipointer->pSpriteCursor = (CursorPtr) 1; + miPointerInvalidateSprite(master); CheckMotion(NULL, master); @@ -277,6 +352,12 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, xwl_seat->cursor_frame_cb = NULL; xwl_seat_set_cursor(xwl_seat); } + + if (xwl_seat->pointer_warp_emulator) { + xwl_pointer_warp_emulator_maybe_lock(xwl_seat->pointer_warp_emulator, + xwl_seat->focus_window, + NULL, 0, 0); + } } static void @@ -288,8 +369,72 @@ pointer_handle_leave(void *data, struct wl_pointer *pointer, xwl_seat->xwl_screen->serial = serial; - xwl_seat->focus_window = NULL; - CheckMotion(NULL, GetMaster(dev, POINTER_OR_FLOAT)); + /* The pointer has left a known xwindow, save it for a possible match + * in sprite_check_lost_focus() + */ + if (xwl_seat->focus_window) { + xwl_seat->last_xwindow = xwl_seat->focus_window->window; + xwl_seat->focus_window = NULL; + CheckMotion(NULL, GetMaster(dev, POINTER_OR_FLOAT)); + } +} + +static void +dispatch_pointer_motion_event(struct xwl_seat *xwl_seat) +{ + ValuatorMask mask; + + if (xwl_seat->pointer_warp_emulator && + xwl_seat->pending_pointer_event.has_relative) { + double dx; + double dy; + double dx_unaccel; + double dy_unaccel; + + dx = xwl_seat->pending_pointer_event.dx; + dy = xwl_seat->pending_pointer_event.dy; + dx_unaccel = xwl_seat->pending_pointer_event.dx_unaccel; + dy_unaccel = xwl_seat->pending_pointer_event.dy_unaccel; + xwl_pointer_warp_emulator_handle_motion(xwl_seat->pointer_warp_emulator, + dx, dy, + dx_unaccel, dy_unaccel); + } else if (xwl_seat->pending_pointer_event.has_absolute || + xwl_seat->pending_pointer_event.has_relative) { + int x; + int y; + + if (xwl_seat->pending_pointer_event.has_absolute) { + int sx = wl_fixed_to_int(xwl_seat->pending_pointer_event.x); + int sy = wl_fixed_to_int(xwl_seat->pending_pointer_event.y); + int dx = xwl_seat->focus_window->window->drawable.x; + int dy = xwl_seat->focus_window->window->drawable.y; + + x = dx + sx; + y = dy + sy; + } else { + miPointerGetPosition(xwl_seat->pointer, &x, &y); + } + + valuator_mask_zero(&mask); + if (xwl_seat->pending_pointer_event.has_relative) { + double dx_unaccel; + double dy_unaccel; + + dx_unaccel = xwl_seat->pending_pointer_event.dx_unaccel; + dy_unaccel = xwl_seat->pending_pointer_event.dy_unaccel; + valuator_mask_set_absolute_unaccelerated(&mask, 0, x, dx_unaccel); + valuator_mask_set_absolute_unaccelerated(&mask, 1, y, dy_unaccel); + } else { + valuator_mask_set(&mask, 0, x); + valuator_mask_set(&mask, 1, y); + } + + QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, + POINTER_ABSOLUTE | POINTER_SCREEN, &mask); + } + + xwl_seat->pending_pointer_event.has_absolute = FALSE; + xwl_seat->pending_pointer_event.has_relative = FALSE; } static void @@ -297,23 +442,16 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) { struct xwl_seat *xwl_seat = data; - int32_t dx, dy; - int sx = wl_fixed_to_int(sx_w); - int sy = wl_fixed_to_int(sy_w); - ValuatorMask mask; if (!xwl_seat->focus_window) return; - dx = xwl_seat->focus_window->window->drawable.x; - dy = xwl_seat->focus_window->window->drawable.y; + xwl_seat->pending_pointer_event.has_absolute = TRUE; + xwl_seat->pending_pointer_event.x = sx_w; + xwl_seat->pending_pointer_event.y = sy_w; - valuator_mask_zero(&mask); - valuator_mask_set(&mask, 0, dx + sx); - valuator_mask_set(&mask, 1, dy + sy); - - QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, - POINTER_ABSOLUTE | POINTER_SCREEN, &mask); + if (wl_proxy_get_version((struct wl_proxy *) xwl_seat->wl_pointer) < 5) + dispatch_pointer_motion_event(xwl_seat); } static void @@ -373,12 +511,73 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer, QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, POINTER_RELATIVE, &mask); } +static void +pointer_handle_frame(void *data, struct wl_pointer *wl_pointer) +{ + struct xwl_seat *xwl_seat = data; + + if (!xwl_seat->focus_window) + return; + + dispatch_pointer_motion_event(xwl_seat); +} + +static void +pointer_handle_axis_source(void *data, struct wl_pointer *wl_pointer, uint32_t axis_source) +{ +} + +static void +pointer_handle_axis_stop(void *data, struct wl_pointer *wl_pointer, + uint32_t time, uint32_t axis) +{ +} + +static void +pointer_handle_axis_discrete(void *data, struct wl_pointer *wl_pointer, + uint32_t axis, int32_t discrete) +{ +} + static const struct wl_pointer_listener pointer_listener = { pointer_handle_enter, pointer_handle_leave, pointer_handle_motion, pointer_handle_button, pointer_handle_axis, + pointer_handle_frame, + pointer_handle_axis_source, + pointer_handle_axis_stop, + pointer_handle_axis_discrete, +}; + +static void +relative_pointer_handle_relative_motion(void *data, + struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1, + uint32_t utime_hi, + uint32_t utime_lo, + wl_fixed_t dxf, + wl_fixed_t dyf, + wl_fixed_t dx_unaccelf, + wl_fixed_t dy_unaccelf) +{ + struct xwl_seat *xwl_seat = data; + + xwl_seat->pending_pointer_event.has_relative = TRUE; + xwl_seat->pending_pointer_event.dx = wl_fixed_to_double(dxf); + xwl_seat->pending_pointer_event.dy = wl_fixed_to_double(dyf); + xwl_seat->pending_pointer_event.dx_unaccel = wl_fixed_to_double(dx_unaccelf); + xwl_seat->pending_pointer_event.dy_unaccel = wl_fixed_to_double(dy_unaccelf); + + if (!xwl_seat->focus_window) + return; + + if (wl_proxy_get_version((struct wl_proxy *) xwl_seat->wl_pointer) < 5) + dispatch_pointer_motion_event(xwl_seat); +} + +static const struct zwp_relative_pointer_v1_listener relative_pointer_listener = { + relative_pointer_handle_relative_motion, }; static void @@ -462,7 +661,7 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, wl_array_copy(&xwl_seat->keys, keys); wl_array_for_each(k, &xwl_seat->keys) - QueueKeyboardEvents(xwl_seat->keyboard, KeyPress, *k + 8); + QueueKeyboardEvents(xwl_seat->keyboard, EnterNotify, *k + 8); } static void @@ -475,7 +674,7 @@ keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, xwl_seat->xwl_screen->serial = serial; wl_array_for_each(k, &xwl_seat->keys) - QueueKeyboardEvents(xwl_seat->keyboard, KeyRelease, *k + 8); + QueueKeyboardEvents(xwl_seat->keyboard, LeaveNotify, *k + 8); xwl_seat->keyboard_focus = NULL; } @@ -492,6 +691,8 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, xkbStateNotify sn; CARD16 changed; + mieqProcessInputEvents(); + for (dev = inputInfo.devices; dev; dev = dev->next) { if (dev != xwl_seat->keyboard && dev != GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD)) @@ -500,12 +701,11 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, old_state = dev->key->xkbInfo->state; new_state = &dev->key->xkbInfo->state; - if (!xwl_seat->keyboard_focus) { - new_state->locked_mods = mods_locked & XkbAllModifiersMask; - XkbLatchModifiers(dev, XkbAllModifiersMask, - mods_latched & XkbAllModifiersMask); - } new_state->locked_group = group & XkbAllGroupsMask; + new_state->base_mods = mods_depressed & XkbAllModifiersMask; + new_state->locked_mods = mods_locked & XkbAllModifiersMask; + XkbLatchModifiers(dev, XkbAllModifiersMask, + mods_latched & XkbAllModifiersMask); XkbComputeDerivedState(dev->key->xkbInfo); @@ -522,6 +722,64 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, } } +static void +remove_sync_pending(DeviceIntPtr dev) +{ + struct xwl_seat *xwl_seat = dev->public.devicePrivate; + struct sync_pending *p, *npd; + + xorg_list_for_each_entry_safe(p, npd, &xwl_seat->sync_pending, l) { + if (p->pending_dev == dev) { + xorg_list_del(&xwl_seat->sync_pending); + free (p); + return; + } + } +} + +static void +sync_callback(void *data, struct wl_callback *callback, uint32_t serial) +{ + DeviceIntPtr dev = (DeviceIntPtr) data; + + remove_sync_pending(dev); + wl_callback_destroy(callback); +} + +static const struct wl_callback_listener sync_listener = { + sync_callback +}; + +static Bool +keyboard_check_repeat (DeviceIntPtr dev, XkbSrvInfoPtr xkbi, unsigned key) +{ + struct xwl_seat *xwl_seat = dev->public.devicePrivate; + struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; + struct wl_callback *callback; + struct sync_pending *p; + + /* Make sure we didn't miss a possible reply from the compositor */ + xwl_sync_events (xwl_screen); + + xorg_list_for_each_entry(p, &xwl_seat->sync_pending, l) { + if (p->pending_dev == dev) { + ErrorF("Key repeat discarded, Wayland compositor doesn't " + "seem to be processing events fast enough!\n"); + + return FALSE; + } + } + + p = xnfalloc(sizeof(struct sync_pending)); + p->pending_dev = dev; + callback = wl_display_sync (xwl_screen->display); + xorg_list_add(&p->l, &xwl_seat->sync_pending); + + wl_callback_add_listener(callback, &sync_listener, dev); + + return TRUE; +} + static void keyboard_handle_repeat_info (void *data, struct wl_keyboard *keyboard, int32_t rate, int32_t delay) @@ -531,8 +789,8 @@ keyboard_handle_repeat_info (void *data, struct wl_keyboard *keyboard, XkbControlsPtr ctrl; if (rate < 0 || delay < 0) { - ErrorF("Wrong rate/delay: %d, %d\n", rate, delay); - return; + ErrorF("Wrong rate/delay: %d, %d\n", rate, delay); + return; } for (dev = inputInfo.devices; dev; dev = dev->next) { @@ -540,15 +798,15 @@ keyboard_handle_repeat_info (void *data, struct wl_keyboard *keyboard, dev != GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD)) continue; - if (rate != 0) { + if (rate != 0) { ctrl = dev->key->xkbInfo->desc->ctrls; ctrl->repeat_delay = delay; /* rate is number of keys per second */ ctrl->repeat_interval = 1000 / rate; - XkbSetRepeatKeys(dev, -1, AutoRepeatModeOn); - } else - XkbSetRepeatKeys(dev, -1, AutoRepeatModeOff); + XkbSetRepeatKeys(dev, -1, AutoRepeatModeOn); + } else + XkbSetRepeatKeys(dev, -1, AutoRepeatModeOff); } } @@ -579,15 +837,18 @@ static void xwl_touch_send_event(struct xwl_touch *xwl_touch, struct xwl_seat *xwl_seat, int type) { - int32_t dx, dy; + double dx, dy, x, y; ValuatorMask mask; dx = xwl_touch->window->window->drawable.x; dy = xwl_touch->window->window->drawable.y; + x = (dx + xwl_touch->x) * 0xFFFF / xwl_seat->xwl_screen->width; + y = (dy + xwl_touch->y) * 0xFFFF / xwl_seat->xwl_screen->height; + valuator_mask_zero(&mask); - valuator_mask_set(&mask, 0, dx + xwl_touch->x); - valuator_mask_set(&mask, 1, dy + xwl_touch->y); + valuator_mask_set_double(&mask, 0, x); + valuator_mask_set_double(&mask, 1, y); QueueTouchEvents(xwl_seat->touch, type, xwl_touch->id, 0, &mask); } @@ -707,6 +968,122 @@ add_device(struct xwl_seat *xwl_seat, return dev; } +static void +init_pointer(struct xwl_seat *xwl_seat) +{ + xwl_seat->wl_pointer = wl_seat_get_pointer(xwl_seat->seat); + wl_pointer_add_listener(xwl_seat->wl_pointer, + &pointer_listener, xwl_seat); + + if (xwl_seat->pointer == NULL) { + xwl_seat_set_cursor(xwl_seat); + xwl_seat->pointer = + add_device(xwl_seat, "xwayland-pointer", xwl_pointer_proc); + ActivateDevice(xwl_seat->pointer, TRUE); + } + EnableDevice(xwl_seat->pointer, TRUE); +} + +static void +release_pointer(struct xwl_seat *xwl_seat) +{ + wl_pointer_release(xwl_seat->wl_pointer); + xwl_seat->wl_pointer = NULL; + + if (xwl_seat->pointer) + DisableDevice(xwl_seat->pointer, TRUE); +} + +static void +init_relative_pointer(struct xwl_seat *xwl_seat) +{ + struct zwp_relative_pointer_manager_v1 *relative_pointer_manager = + xwl_seat->xwl_screen->relative_pointer_manager; + + if (relative_pointer_manager) { + xwl_seat->wp_relative_pointer = + zwp_relative_pointer_manager_v1_get_relative_pointer( + relative_pointer_manager, xwl_seat->wl_pointer); + zwp_relative_pointer_v1_add_listener(xwl_seat->wp_relative_pointer, + &relative_pointer_listener, + xwl_seat); + } + + if (xwl_seat->relative_pointer == NULL) { + xwl_seat->relative_pointer = + add_device(xwl_seat, "xwayland-relative-pointer", + xwl_pointer_proc_relative); + ActivateDevice(xwl_seat->relative_pointer, TRUE); + } + EnableDevice(xwl_seat->relative_pointer, TRUE); +} + +static void +release_relative_pointer(struct xwl_seat *xwl_seat) +{ + if (xwl_seat->wp_relative_pointer) { + zwp_relative_pointer_v1_destroy(xwl_seat->wp_relative_pointer); + xwl_seat->wp_relative_pointer = NULL; + } + + if (xwl_seat->relative_pointer) + DisableDevice(xwl_seat->relative_pointer, TRUE); +} + +static void +init_keyboard(struct xwl_seat *xwl_seat) +{ + xwl_seat->wl_keyboard = wl_seat_get_keyboard(xwl_seat->seat); + wl_keyboard_add_listener(xwl_seat->wl_keyboard, + &keyboard_listener, xwl_seat); + + if (xwl_seat->keyboard == NULL) { + xwl_seat->keyboard = + add_device(xwl_seat, "xwayland-keyboard", xwl_keyboard_proc); + ActivateDevice(xwl_seat->keyboard, TRUE); + } + EnableDevice(xwl_seat->keyboard, TRUE); + xwl_seat->keyboard->key->xkbInfo->checkRepeat = keyboard_check_repeat; +} + +static void +release_keyboard(struct xwl_seat *xwl_seat) +{ + wl_keyboard_release(xwl_seat->wl_keyboard); + xwl_seat->wl_keyboard = NULL; + + if (xwl_seat->keyboard) { + remove_sync_pending(xwl_seat->keyboard); + DisableDevice(xwl_seat->keyboard, TRUE); + } +} + +static void +init_touch(struct xwl_seat *xwl_seat) +{ + xwl_seat->wl_touch = wl_seat_get_touch(xwl_seat->seat); + wl_touch_add_listener(xwl_seat->wl_touch, + &touch_listener, xwl_seat); + + if (xwl_seat->touch == NULL) { + xwl_seat->touch = + add_device(xwl_seat, "xwayland-touch", xwl_touch_proc); + ActivateDevice(xwl_seat->touch, TRUE); + } + EnableDevice(xwl_seat->touch, TRUE); + +} + +static void +release_touch(struct xwl_seat *xwl_seat) +{ + wl_touch_release(xwl_seat->wl_touch); + xwl_seat->wl_touch = NULL; + + if (xwl_seat->touch) + DisableDevice(xwl_seat->touch, TRUE); +} + static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) @@ -714,61 +1091,23 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, struct xwl_seat *xwl_seat = data; if (caps & WL_SEAT_CAPABILITY_POINTER && xwl_seat->wl_pointer == NULL) { - xwl_seat->wl_pointer = wl_seat_get_pointer(seat); - wl_pointer_add_listener(xwl_seat->wl_pointer, - &pointer_listener, xwl_seat); - - if (xwl_seat->pointer == NULL) { - xwl_seat_set_cursor(xwl_seat); - xwl_seat->pointer = - add_device(xwl_seat, "xwayland-pointer", xwl_pointer_proc); - ActivateDevice(xwl_seat->pointer, TRUE); - } - EnableDevice(xwl_seat->pointer, TRUE); + init_pointer(xwl_seat); + init_relative_pointer(xwl_seat); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && xwl_seat->wl_pointer) { - wl_pointer_release(xwl_seat->wl_pointer); - xwl_seat->wl_pointer = NULL; - - if (xwl_seat->pointer) - DisableDevice(xwl_seat->pointer, TRUE); + release_pointer(xwl_seat); + release_relative_pointer(xwl_seat); } if (caps & WL_SEAT_CAPABILITY_KEYBOARD && xwl_seat->wl_keyboard == NULL) { - xwl_seat->wl_keyboard = wl_seat_get_keyboard(seat); - wl_keyboard_add_listener(xwl_seat->wl_keyboard, - &keyboard_listener, xwl_seat); - - if (xwl_seat->keyboard == NULL) { - xwl_seat->keyboard = - add_device(xwl_seat, "xwayland-keyboard", xwl_keyboard_proc); - ActivateDevice(xwl_seat->keyboard, TRUE); - } - EnableDevice(xwl_seat->keyboard, TRUE); + init_keyboard(xwl_seat); } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && xwl_seat->wl_keyboard) { - wl_keyboard_release(xwl_seat->wl_keyboard); - xwl_seat->wl_keyboard = NULL; - - if (xwl_seat->keyboard) - DisableDevice(xwl_seat->keyboard, TRUE); + release_keyboard(xwl_seat); } if (caps & WL_SEAT_CAPABILITY_TOUCH && xwl_seat->wl_touch == NULL) { - xwl_seat->wl_touch = wl_seat_get_touch(seat); - wl_touch_add_listener(xwl_seat->wl_touch, - &touch_listener, xwl_seat); - - if (xwl_seat->touch) - EnableDevice(xwl_seat->touch, TRUE); - else { - xwl_seat->touch = - add_device(xwl_seat, "xwayland-touch", xwl_touch_proc); - } + init_touch(xwl_seat); } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && xwl_seat->wl_touch) { - wl_touch_release(xwl_seat->wl_touch); - xwl_seat->wl_touch = NULL; - - if (xwl_seat->touch) - DisableDevice(xwl_seat->touch, TRUE); + release_touch(xwl_seat); } xwl_seat->xwl_screen->expecting_event--; @@ -776,7 +1115,7 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, static void seat_handle_name(void *data, struct wl_seat *seat, - const char *name) + const char *name) { } @@ -802,7 +1141,7 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version xwl_seat->seat = wl_registry_bind(xwl_screen->registry, id, - &wl_seat_interface, min(version, 4)); + &wl_seat_interface, min(version, 5)); xwl_seat->id = id; xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor); @@ -810,12 +1149,14 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version wl_array_init(&xwl_seat->keys); xorg_list_init(&xwl_seat->touches); + xorg_list_init(&xwl_seat->sync_pending); } void xwl_seat_destroy(struct xwl_seat *xwl_seat) { struct xwl_touch *xwl_touch, *next_xwl_touch; + struct sync_pending *p, *npd; xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, &xwl_seat->touches, link_touch) { @@ -823,6 +1164,11 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) free(xwl_touch); } + xorg_list_for_each_entry_safe(p, npd, &xwl_seat->sync_pending, l) { + xorg_list_del(&xwl_seat->sync_pending); + free (p); + } + wl_seat_destroy(xwl_seat->seat); wl_surface_destroy(xwl_seat->cursor); if (xwl_seat->cursor_frame_cb) @@ -831,6 +1177,26 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) free(xwl_seat); } +static void +init_relative_pointer_manager(struct xwl_screen *xwl_screen, + uint32_t id, uint32_t version) +{ + xwl_screen->relative_pointer_manager = + wl_registry_bind(xwl_screen->registry, id, + &zwp_relative_pointer_manager_v1_interface, + 1); +} + +static void +init_pointer_constraints(struct xwl_screen *xwl_screen, + uint32_t id, uint32_t version) +{ + xwl_screen->pointer_constraints = + wl_registry_bind(xwl_screen->registry, id, + &zwp_pointer_constraints_v1_interface, + 1); +} + static void input_handler(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) @@ -840,6 +1206,10 @@ input_handler(void *data, struct wl_registry *registry, uint32_t id, if (strcmp(interface, "wl_seat") == 0 && version >= 3) { create_input_device(xwl_screen, id, version); xwl_screen->expecting_event++; + } else if (strcmp(interface, "zwp_relative_pointer_manager_v1") == 0) { + init_relative_pointer_manager(xwl_screen, id, version); + } else if (strcmp(interface, "zwp_pointer_constraints_v1") == 0) { + init_pointer_constraints(xwl_screen, id, version); } } @@ -870,6 +1240,68 @@ DDXRingBell(int volume, int pitch, int duration) { } +static Bool +sprite_check_lost_focus(SpritePtr sprite, WindowPtr window) +{ + DeviceIntPtr device, master; + struct xwl_seat *xwl_seat; + + for (device = inputInfo.devices; device; device = device->next) { + /* Ignore non-wayland devices */ + if (device->deviceProc == xwl_pointer_proc && + device->spriteInfo->sprite == sprite) + break; + } + + if (!device) + return FALSE; + + xwl_seat = device->public.devicePrivate; + + master = GetMaster(device, POINTER_OR_FLOAT); + if (!master || !master->lastSlave) + return FALSE; + + /* We do want the last active slave, we only check on slave xwayland + * devices so we can find out the xwl_seat, but those don't actually own + * their sprite, so the match doesn't mean a lot. + */ + if (master->lastSlave == xwl_seat->pointer && + xwl_seat->focus_window == NULL && + xwl_seat->last_xwindow != NullWindow && + IsParent(xwl_seat->last_xwindow, window)) + return TRUE; + + return FALSE; +} + +static WindowPtr +xwl_xy_to_window(ScreenPtr screen, SpritePtr sprite, int x, int y) +{ + struct xwl_screen *xwl_screen; + WindowPtr ret; + + xwl_screen = xwl_screen_get(screen); + + screen->XYToWindow = xwl_screen->XYToWindow; + ret = screen->XYToWindow(screen, sprite, x, y); + xwl_screen->XYToWindow = screen->XYToWindow; + screen->XYToWindow = xwl_xy_to_window; + + /* If the device controlling the sprite has left the Wayland surface but + * the DIX still finds the pointer within the X11 window, it means that + * the pointer has crossed to another native Wayland window, in this + * case, pretend we entered the root window so that a LeaveNotify + * event is emitted. + */ + if (sprite_check_lost_focus(sprite, ret)) { + sprite->spriteTraceGood = 1; + return sprite->spriteTrace[0]; + } + + return ret; +} + void xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window) { @@ -884,6 +1316,311 @@ xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window) } } +static void +xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_emulator, + int x, + int y) +{ + struct zwp_locked_pointer_v1 *locked_pointer = + warp_emulator->locked_pointer; + WindowPtr window; + int sx, sy; + + if (!warp_emulator->locked_pointer) + return; + + if (!warp_emulator->xwl_seat->focus_window) + return; + + window = warp_emulator->xwl_seat->focus_window->window; + if (x >= window->drawable.x || + y >= window->drawable.y || + x < (window->drawable.x + window->drawable.width) || + y < (window->drawable.y + window->drawable.height)) { + sx = x - window->drawable.x; + sy = y - window->drawable.y; + zwp_locked_pointer_v1_set_cursor_position_hint(locked_pointer, + wl_fixed_from_int(sx), + wl_fixed_from_int(sy)); + wl_surface_commit(warp_emulator->xwl_seat->focus_window->surface); + } +} + +static Bool +xwl_pointer_warp_emulator_is_locked(struct xwl_pointer_warp_emulator *warp_emulator) +{ + if (warp_emulator->locked_pointer) + return TRUE; + else + return FALSE; +} + +static void +xwl_pointer_warp_emulator_lock(struct xwl_pointer_warp_emulator *warp_emulator) +{ + struct xwl_seat *xwl_seat = warp_emulator->xwl_seat; + struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; + struct zwp_pointer_constraints_v1 *pointer_constraints = + xwl_screen->pointer_constraints; + struct xwl_window *lock_window = xwl_seat->focus_window; + + warp_emulator->locked_window = lock_window; + + warp_emulator->locked_pointer = + zwp_pointer_constraints_v1_lock_pointer(pointer_constraints, + lock_window->surface, + xwl_seat->wl_pointer, + NULL, + ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT); +} + +static void +xwl_pointer_warp_emulator_maybe_lock(struct xwl_pointer_warp_emulator *warp_emulator, + struct xwl_window *xwl_window, + SpritePtr sprite, + int x, int y) +{ + struct xwl_seat *xwl_seat = warp_emulator->xwl_seat; + GrabPtr pointer_grab = xwl_seat->pointer->deviceGrab.grab; + + if (warp_emulator->locked_pointer) + return; + + /* + * If there is no grab, and the window doesn't have pointer focus, ignore + * the warp, as under Wayland it won't receive input anyway. + */ + if (!pointer_grab && xwl_seat->focus_window != xwl_window) + return; + + /* + * If there is a grab, but it's not an ownerEvents grab and the destination + * is not the pointer focus, ignore it, as events wouldn't be delivered + * there anyway. + */ + if (pointer_grab && + !pointer_grab->ownerEvents && + XYToWindow(sprite, x, y) != xwl_seat->focus_window->window) + return; + + xwl_pointer_warp_emulator_lock(warp_emulator); +} + +static void +xwl_pointer_warp_emulator_warp(struct xwl_pointer_warp_emulator *warp_emulator, + struct xwl_window *xwl_window, + SpritePtr sprite, + int x, int y) +{ + xwl_pointer_warp_emulator_maybe_lock(warp_emulator, + xwl_window, + sprite, + x, y); + xwl_pointer_warp_emulator_set_fake_pos(warp_emulator, x, y); +} + +static void +xwl_pointer_warp_emulator_handle_motion(struct xwl_pointer_warp_emulator *warp_emulator, + double dx, + double dy, + double dx_unaccel, + double dy_unaccel) +{ + struct xwl_seat *xwl_seat = warp_emulator->xwl_seat; + ValuatorMask mask; + WindowPtr window; + int x, y; + + valuator_mask_zero(&mask); + valuator_mask_set_unaccelerated(&mask, 0, dx, dx_unaccel); + valuator_mask_set_unaccelerated(&mask, 1, dy, dy_unaccel); + + QueuePointerEvents(xwl_seat->relative_pointer, MotionNotify, 0, + POINTER_RELATIVE, &mask); + + window = xwl_seat->focus_window->window; + miPointerGetPosition(xwl_seat->pointer, &x, &y); + + if (xwl_pointer_warp_emulator_is_locked(warp_emulator) && + xwl_seat->cursor_confinement_window != warp_emulator->locked_window && + (x < window->drawable.x || + y < window->drawable.y || + x >= (window->drawable.x + window->drawable.width) || + y >= (window->drawable.y + window->drawable.height))) + xwl_seat_destroy_pointer_warp_emulator(xwl_seat); + else + xwl_pointer_warp_emulator_set_fake_pos(warp_emulator, x, y); +} + +static struct xwl_pointer_warp_emulator * +xwl_pointer_warp_emulator_create(struct xwl_seat *xwl_seat) +{ + struct xwl_pointer_warp_emulator *warp_emulator; + + warp_emulator = calloc(sizeof *warp_emulator, 1); + if (!warp_emulator) { + ErrorF("%s: ENOMEM", __func__); + return NULL; + } + + warp_emulator->xwl_seat = xwl_seat; + + return warp_emulator; +} + +static void +xwl_pointer_warp_emulator_destroy(struct xwl_pointer_warp_emulator *warp_emulator) +{ + if (warp_emulator->locked_pointer) + zwp_locked_pointer_v1_destroy(warp_emulator->locked_pointer); + free(warp_emulator); +} + +static void +xwl_seat_create_pointer_warp_emulator(struct xwl_seat *xwl_seat) +{ + if (xwl_seat->confined_pointer) + xwl_seat_destroy_confined_pointer(xwl_seat); + + xwl_seat->pointer_warp_emulator = + xwl_pointer_warp_emulator_create(xwl_seat); +} + +static Bool +xwl_seat_can_emulate_pointer_warp(struct xwl_seat *xwl_seat) +{ + struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; + + if (!xwl_screen->relative_pointer_manager) + return FALSE; + + if (!xwl_screen->pointer_constraints) + return FALSE; + + return TRUE; +} + +void +xwl_seat_emulate_pointer_warp(struct xwl_seat *xwl_seat, + struct xwl_window *xwl_window, + SpritePtr sprite, + int x, int y) +{ + if (!xwl_seat_can_emulate_pointer_warp(xwl_seat)) + return; + + if (xwl_seat->x_cursor != NULL) + return; + + if (!xwl_seat->pointer_warp_emulator) + xwl_seat_create_pointer_warp_emulator(xwl_seat); + + if (!xwl_seat->pointer_warp_emulator) + return; + + xwl_pointer_warp_emulator_warp(xwl_seat->pointer_warp_emulator, + xwl_window, + sprite, + x, y); +} + +static Bool +xwl_seat_maybe_lock_on_hidden_cursor(struct xwl_seat *xwl_seat) +{ + /* Some clients use hidden cursor+confineTo+relative motion + * to implement infinite panning (eg. 3D views), lock the + * pointer for so the relative pointer is used. + */ + if (xwl_seat->x_cursor || + !xwl_seat->cursor_confinement_window) + return FALSE; + + if (!xwl_seat->focus_window) + return FALSE; + + if (xwl_seat->confined_pointer) + xwl_seat_destroy_confined_pointer(xwl_seat); + + xwl_seat_create_pointer_warp_emulator(xwl_seat); + xwl_pointer_warp_emulator_lock(xwl_seat->pointer_warp_emulator); + return TRUE; +} + +void +xwl_seat_cursor_visibility_changed(struct xwl_seat *xwl_seat) +{ + if (xwl_seat->pointer_warp_emulator && xwl_seat->x_cursor != NULL) { + xwl_seat_destroy_pointer_warp_emulator(xwl_seat); + } else if (!xwl_seat->x_cursor && xwl_seat->cursor_confinement_window) { + /* If the cursor goes hidden as is confined, lock it for + * relative motion to work. */ + xwl_seat_maybe_lock_on_hidden_cursor(xwl_seat); + } +} + +void +xwl_seat_destroy_pointer_warp_emulator(struct xwl_seat *xwl_seat) +{ + if (!xwl_seat->pointer_warp_emulator) + return; + + xwl_pointer_warp_emulator_destroy(xwl_seat->pointer_warp_emulator); + xwl_seat->pointer_warp_emulator = NULL; + + if (xwl_seat->cursor_confinement_window) { + xwl_seat_confine_pointer(xwl_seat, + xwl_seat->cursor_confinement_window); + } +} + +void +xwl_seat_confine_pointer(struct xwl_seat *xwl_seat, + struct xwl_window *xwl_window) +{ + struct zwp_pointer_constraints_v1 *pointer_constraints = + xwl_seat->xwl_screen->pointer_constraints; + + if (!pointer_constraints) + return; + + if (xwl_seat->cursor_confinement_window == xwl_window && + xwl_seat->confined_pointer) + return; + + xwl_seat_unconfine_pointer(xwl_seat); + + xwl_seat->cursor_confinement_window = xwl_window; + + if (xwl_seat->pointer_warp_emulator) + return; + + if (xwl_seat_maybe_lock_on_hidden_cursor(xwl_seat)) + return; + + xwl_seat->confined_pointer = + zwp_pointer_constraints_v1_confine_pointer(pointer_constraints, + xwl_window->surface, + xwl_seat->wl_pointer, + NULL, + ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT); +} + +static void +xwl_seat_destroy_confined_pointer(struct xwl_seat *xwl_seat) +{ + zwp_confined_pointer_v1_destroy(xwl_seat->confined_pointer); + xwl_seat->confined_pointer = NULL; +} + +void +xwl_seat_unconfine_pointer(struct xwl_seat *xwl_seat) +{ + xwl_seat->cursor_confinement_window = NULL; + + if (xwl_seat->confined_pointer) + xwl_seat_destroy_confined_pointer(xwl_seat); +} + void InitInput(int argc, char *argv[]) { @@ -896,7 +1633,9 @@ InitInput(int argc, char *argv[]) wl_registry_add_listener(xwl_screen->input_registry, &input_listener, xwl_screen); - xwl_screen->expecting_event = 0; + xwl_screen->XYToWindow = pScreen->XYToWindow; + pScreen->XYToWindow = xwl_xy_to_window; + wl_display_roundtrip(xwl_screen->display); while (xwl_screen->expecting_event) wl_display_roundtrip(xwl_screen->display); diff --git a/xserver/hw/xwayland/xwayland-output.c b/xserver/hw/xwayland/xwayland-output.c index b66da13cb..5a0f739f3 100644 --- a/xserver/hw/xwayland/xwayland-output.c +++ b/xserver/hw/xwayland/xwayland-output.c @@ -31,6 +31,12 @@ #include #define DEFAULT_DPI 96 +#define ALL_ROTATIONS (RR_Rotate_0 | \ + RR_Rotate_90 | \ + RR_Rotate_180 | \ + RR_Rotate_270 | \ + RR_Reflect_X | \ + RR_Reflect_Y) static Rotation wl_transform_to_xrandr(enum wl_output_transform transform) @@ -102,26 +108,30 @@ output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, if (!(flags & WL_OUTPUT_MODE_CURRENT)) return; - if (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) { - xwl_output->width = width; - xwl_output->height = height; - } else { - xwl_output->width = height; - xwl_output->height = width; - } - + xwl_output->width = width; + xwl_output->height = height; xwl_output->refresh = refresh; } static inline void output_get_new_size(struct xwl_output *xwl_output, - int *height, int *width) + int *height, int *width) { - if (*width < xwl_output->x + xwl_output->width) - *width = xwl_output->x + xwl_output->width; + int output_width, output_height; - if (*height < xwl_output->y + xwl_output->height) - *height = xwl_output->y + xwl_output->height; + if (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) { + output_width = xwl_output->width; + output_height = xwl_output->height; + } else { + output_width = xwl_output->height; + output_height = xwl_output->width; + } + + if (*width < xwl_output->x + output_width) + *width = xwl_output->x + output_width; + + if (*height < xwl_output->y + output_height) + *height = xwl_output->y + output_height; } /* Approximate some kind of mmpd (m.m. per dot) of the screen given the outputs @@ -177,8 +187,11 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) SetRootClip(xwl_screen->screen, xwl_screen->root_clip_mode); if (xwl_screen->screen->root) { + BoxRec box = { 0, 0, width, height }; + xwl_screen->screen->root->drawable.width = width; xwl_screen->screen->root->drawable.height = height; + RegionReset(&xwl_screen->screen->root->winSize, &box); RRScreenSizeNotify(xwl_screen->screen); } @@ -266,6 +279,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) ErrorF("Failed creating RandR CRTC\n"); goto err; } + RRCrtcSetRotations (xwl_output->randr_crtc, ALL_ROTATIONS); xwl_output->randr_output = RROutputCreate(xwl_screen->screen, name, strlen(name), xwl_output); @@ -291,27 +305,33 @@ err: void xwl_output_destroy(struct xwl_output *xwl_output) +{ + wl_output_destroy(xwl_output->output); + free(xwl_output); +} + +void +xwl_output_remove(struct xwl_output *xwl_output) { struct xwl_output *it; struct xwl_screen *xwl_screen = xwl_output->xwl_screen; int width = 0, height = 0; - wl_output_destroy(xwl_output->output); - xorg_list_del(&xwl_output->link); RRCrtcDestroy(xwl_output->randr_crtc); RROutputDestroy(xwl_output->randr_output); + xorg_list_del(&xwl_output->link); xorg_list_for_each_entry(it, &xwl_screen->output_list, link) output_get_new_size(it, &height, &width); update_screen_size(xwl_output, width, height); - free(xwl_output); + xwl_output_destroy(xwl_output); } static Bool xwl_randr_get_info(ScreenPtr pScreen, Rotation * rotations) { - *rotations = 0; + *rotations = ALL_ROTATIONS; return TRUE; } diff --git a/xserver/hw/xwayland/xwayland-shm.c b/xserver/hw/xwayland/xwayland-shm.c index c199e5efb..452d1f509 100644 --- a/xserver/hw/xwayland/xwayland-shm.c +++ b/xserver/hw/xwayland/xwayland-shm.c @@ -28,6 +28,8 @@ #include #endif +#include "os.h" + #include "xwayland.h" #include @@ -40,7 +42,6 @@ struct xwl_pixmap { struct wl_buffer *buffer; - int fd; void *data; size_t size; }; @@ -140,9 +141,17 @@ os_create_anonymous_file(off_t size) return -1; #ifdef HAVE_POSIX_FALLOCATE + /* + * posix_fallocate does an explicit rollback if it gets EINTR. + * Temporarily block signals to allow the call to succeed on + * slow systems where the smart scheduler's SIGALRM prevents + * large allocation attempts from ever succeeding. + */ + OsBlockSignals(); do { ret = posix_fallocate(fd, 0, size); } while (ret == EINTR); + OsReleaseSignals(); if (ret != 0) { close(fd); @@ -184,9 +193,13 @@ PixmapPtr xwl_shm_create_pixmap(ScreenPtr screen, int width, int height, int depth, unsigned int hint) { - PixmapPtr pixmap; + struct xwl_screen *xwl_screen = xwl_screen_get(screen); struct xwl_pixmap *xwl_pixmap; + struct wl_shm_pool *pool; + PixmapPtr pixmap; size_t size, stride; + uint32_t format; + int fd; if (hint == CREATE_PIXMAP_USAGE_GLYPH_PICTURE || (width == 0 && height == 0) || depth < 15) @@ -204,12 +217,12 @@ xwl_shm_create_pixmap(ScreenPtr screen, size = stride * height; xwl_pixmap->buffer = NULL; xwl_pixmap->size = size; - xwl_pixmap->fd = os_create_anonymous_file(size); - if (xwl_pixmap->fd < 0) + fd = os_create_anonymous_file(size); + if (fd < 0) goto err_free_xwl_pixmap; xwl_pixmap->data = mmap(NULL, size, PROT_READ | PROT_WRITE, - MAP_SHARED, xwl_pixmap->fd, 0); + MAP_SHARED, fd, 0); if (xwl_pixmap->data == MAP_FAILED) goto err_close_fd; @@ -218,6 +231,15 @@ xwl_shm_create_pixmap(ScreenPtr screen, stride, xwl_pixmap->data)) goto err_munmap; + format = shm_format_for_depth(pixmap->drawable.depth); + pool = wl_shm_create_pool(xwl_screen->shm, fd, xwl_pixmap->size); + xwl_pixmap->buffer = wl_shm_pool_create_buffer(pool, 0, + pixmap->drawable.width, + pixmap->drawable.height, + pixmap->devKind, format); + wl_shm_pool_destroy(pool); + close(fd); + xwl_pixmap_set_private(pixmap, xwl_pixmap); return pixmap; @@ -225,7 +247,7 @@ xwl_shm_create_pixmap(ScreenPtr screen, err_munmap: munmap(xwl_pixmap->data, size); err_close_fd: - close(xwl_pixmap->fd); + close(fd); err_free_xwl_pixmap: free(xwl_pixmap); err_destroy_pixmap: @@ -243,7 +265,6 @@ xwl_shm_destroy_pixmap(PixmapPtr pixmap) if (xwl_pixmap->buffer) wl_buffer_destroy(xwl_pixmap->buffer); munmap(xwl_pixmap->data, xwl_pixmap->size); - close(xwl_pixmap->fd); free(xwl_pixmap); } @@ -253,26 +274,7 @@ xwl_shm_destroy_pixmap(PixmapPtr pixmap) struct wl_buffer * xwl_shm_pixmap_get_wl_buffer(PixmapPtr pixmap) { - struct xwl_screen *xwl_screen = xwl_screen_get(pixmap->drawable.pScreen); - struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); - struct wl_shm_pool *pool; - uint32_t format; - - if (xwl_pixmap->buffer) - return xwl_pixmap->buffer; - - pool = wl_shm_create_pool(xwl_screen->shm, - xwl_pixmap->fd, xwl_pixmap->size); - - format = shm_format_for_depth(pixmap->drawable.depth); - xwl_pixmap->buffer = wl_shm_pool_create_buffer(pool, 0, - pixmap->drawable.width, - pixmap->drawable.height, - pixmap->devKind, format); - - wl_shm_pool_destroy(pool); - - return xwl_pixmap->buffer; + return xwl_pixmap_get(pixmap)->buffer; } Bool diff --git a/xserver/hw/xwayland/xwayland.c b/xserver/hw/xwayland/xwayland.c index 2d44d0709..939f3392c 100644 --- a/xserver/hw/xwayland/xwayland.c +++ b/xserver/hw/xwayland/xwayland.c @@ -32,6 +32,8 @@ #include #include #include +#include +#include #ifdef XF86VIDMODE #include @@ -52,6 +54,8 @@ AbortDDX(enum ExitCode error) void OsVendorInit(void) { + if (serverGeneration == 1) + ForceClockId(CLOCK_MONOTONIC); } void @@ -99,6 +103,12 @@ static DevPrivateKeyRec xwl_window_private_key; static DevPrivateKeyRec xwl_screen_private_key; static DevPrivateKeyRec xwl_pixmap_private_key; +static struct xwl_window * +xwl_window_get(WindowPtr window) +{ + return dixLookupPrivate(&window->devPrivates, &xwl_window_private_key); +} + struct xwl_screen * xwl_screen_get(ScreenPtr screen) { @@ -120,6 +130,8 @@ xwl_close_screen(ScreenPtr screen) &xwl_screen->seat_list, link) xwl_seat_destroy(xwl_seat); + RemoveNotifyFd(xwl_screen->wayland_fd); + wl_display_disconnect(xwl_screen->display); screen->CloseScreen = xwl_screen->CloseScreen; @@ -128,6 +140,105 @@ xwl_close_screen(ScreenPtr screen) return screen->CloseScreen(screen); } +static struct xwl_window * +xwl_window_from_window(WindowPtr window) +{ + struct xwl_window *xwl_window; + + while (window) { + xwl_window = xwl_window_get(window); + if (xwl_window) + return xwl_window; + + window = window->parent; + } + + return NULL; +} + +static struct xwl_seat * +xwl_screen_get_default_seat(struct xwl_screen *xwl_screen) +{ + return container_of(xwl_screen->seat_list.prev, + struct xwl_seat, + link); +} + +static void +xwl_cursor_warped_to(DeviceIntPtr device, + ScreenPtr screen, + ClientPtr client, + WindowPtr window, + SpritePtr sprite, + int x, int y) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + struct xwl_seat *xwl_seat = device->public.devicePrivate; + struct xwl_window *xwl_window; + WindowPtr focus; + + if (!xwl_seat) + xwl_seat = xwl_screen_get_default_seat(xwl_screen); + + xwl_window = xwl_window_from_window(window); + if (!xwl_window && xwl_seat->focus_window) { + focus = xwl_seat->focus_window->window; + + /* Warps on non wl_surface backed Windows are only allowed + * as long as the pointer stays within the focus window. + */ + if (x >= focus->drawable.x && + y >= focus->drawable.y && + x < focus->drawable.x + focus->drawable.width && + y < focus->drawable.y + focus->drawable.height) { + if (!window) { + DebugF("Warp relative to pointer, assuming pointer focus\n"); + xwl_window = xwl_seat->focus_window; + } else if (window == screen->root) { + DebugF("Warp on root window, assuming pointer focus\n"); + xwl_window = xwl_seat->focus_window; + } + } + } + if (!xwl_window) + return; + + xwl_seat_emulate_pointer_warp(xwl_seat, xwl_window, sprite, x, y); +} + +static void +xwl_cursor_confined_to(DeviceIntPtr device, + ScreenPtr screen, + WindowPtr window) +{ + struct xwl_screen *xwl_screen = xwl_screen_get(screen); + struct xwl_seat *xwl_seat = device->public.devicePrivate; + struct xwl_window *xwl_window; + + if (!xwl_seat) + xwl_seat = xwl_screen_get_default_seat(xwl_screen); + + if (window == screen->root) { + xwl_seat_unconfine_pointer(xwl_seat); + return; + } + + xwl_window = xwl_window_from_window(window); + if (!xwl_window && xwl_seat->focus_window) { + /* Allow confining on InputOnly windows, but only if the geometry + * is the same than the focus window. + */ + if (window->drawable.class == InputOnly) { + DebugF("Confine on InputOnly window, assuming pointer focus\n"); + xwl_window = xwl_seat->focus_window; + } + } + if (!xwl_window) + return; + + xwl_seat_confine_pointer(xwl_seat, xwl_window); +} + static void damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data) { @@ -223,9 +334,11 @@ xwl_realize_window(WindowPtr window) screen->RealizeWindow = xwl_realize_window; if (xwl_screen->rootless && !window->parent) { + BoxRec box = { 0, 0, xwl_screen->width, xwl_screen->height }; + + RegionReset(&window->winSize, &box); RegionNull(&window->clipList); RegionNull(&window->borderClip); - RegionNull(&window->winSize); } if (xwl_screen->rootless) { @@ -319,7 +432,15 @@ xwl_unrealize_window(WindowPtr window) xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { if (xwl_seat->focus_window && xwl_seat->focus_window->window == window) xwl_seat->focus_window = NULL; - + if (xwl_seat->last_xwindow == window) + xwl_seat->last_xwindow = NullWindow; + if (xwl_seat->cursor_confinement_window && + xwl_seat->cursor_confinement_window->window == window) + xwl_seat_unconfine_pointer(xwl_seat); + if (xwl_seat->pointer_warp_emulator && + xwl_seat->pointer_warp_emulator->locked_window && + xwl_seat->pointer_warp_emulator->locked_window->window == window) + xwl_seat_destroy_pointer_warp_emulator(xwl_seat); xwl_seat_clear_touch(xwl_seat, window); } @@ -328,8 +449,7 @@ xwl_unrealize_window(WindowPtr window) xwl_screen->UnrealizeWindow = screen->UnrealizeWindow; screen->UnrealizeWindow = xwl_unrealize_window; - xwl_window = - dixLookupPrivate(&window->devPrivates, &xwl_window_private_key); + xwl_window = xwl_window_get(window); if (!xwl_window) return ret; @@ -359,6 +479,8 @@ frame_callback(void *data, uint32_t time) { struct xwl_window *xwl_window = data; + + wl_callback_destroy (xwl_window->frame_callback); xwl_window->frame_callback = NULL; } @@ -446,7 +568,7 @@ global_remove(void *data, struct wl_registry *registry, uint32_t name) xorg_list_for_each_entry_safe(xwl_output, tmp_xwl_output, &xwl_screen->output_list, link) { if (xwl_output->server_output_id == name) { - xwl_output_destroy(xwl_output); + xwl_output_remove(xwl_output); break; } } @@ -458,20 +580,16 @@ static const struct wl_registry_listener registry_listener = { }; static void -wakeup_handler(void *data, int err, void *read_mask) +xwl_read_events (struct xwl_screen *xwl_screen) { - struct xwl_screen *xwl_screen = data; int ret; - if (err < 0) - return; - - if (!FD_ISSET(xwl_screen->wayland_fd, (fd_set *) read_mask)) + if (xwl_screen->wait_flush) return; ret = wl_display_read_events(xwl_screen->display); if (ret == -1) - FatalError("failed to dispatch Wayland events: %s\n", strerror(errno)); + FatalError("failed to read Wayland events: %s\n", strerror(errno)); xwl_screen->prepare_read = 0; @@ -480,13 +598,25 @@ wakeup_handler(void *data, int err, void *read_mask) FatalError("failed to dispatch Wayland events: %s\n", strerror(errno)); } -static void -block_handler(void *data, struct timeval **tv, void *read_mask) +static int +xwl_display_pollout (struct xwl_screen *xwl_screen, int timeout) { - struct xwl_screen *xwl_screen = data; - int ret; + struct pollfd poll_fd; - xwl_screen_post_damage(xwl_screen); + poll_fd.fd = wl_display_get_fd(xwl_screen->display); + poll_fd.events = POLLOUT; + + return xserver_poll(&poll_fd, 1, timeout); +} + +static void +xwl_dispatch_events (struct xwl_screen *xwl_screen) +{ + int ret = 0; + int ready; + + if (xwl_screen->wait_flush) + goto pollout; while (xwl_screen->prepare_read == 0 && wl_display_prepare_read(xwl_screen->display) == -1) { @@ -498,9 +628,47 @@ block_handler(void *data, struct timeval **tv, void *read_mask) xwl_screen->prepare_read = 1; - ret = wl_display_flush(xwl_screen->display); - if (ret == -1) +pollout: + ready = xwl_display_pollout(xwl_screen, 5); + if (ready == -1 && errno != EINTR) + FatalError("error polling on XWayland fd: %s\n", strerror(errno)); + + if (ready > 0) + ret = wl_display_flush(xwl_screen->display); + + if (ret == -1 && errno != EAGAIN) FatalError("failed to write to XWayland fd: %s\n", strerror(errno)); + + xwl_screen->wait_flush = (ready == 0 || ready == -1 || ret == -1); +} + +static void +socket_handler(int fd, int ready, void *data) +{ + struct xwl_screen *xwl_screen = data; + + xwl_read_events (xwl_screen); +} + +static void +wakeup_handler(void *data, int err) +{ +} + +static void +block_handler(void *data, void *timeout) +{ + struct xwl_screen *xwl_screen = data; + + xwl_screen_post_damage(xwl_screen); + xwl_dispatch_events (xwl_screen); +} + +void +xwl_sync_events (struct xwl_screen *xwl_screen) +{ + xwl_dispatch_events (xwl_screen); + xwl_read_events (xwl_screen); } static CARD32 @@ -663,7 +831,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) #endif xwl_screen->wayland_fd = wl_display_get_fd(xwl_screen->display); - AddGeneralSocket(xwl_screen->wayland_fd); + SetNotifyFd(xwl_screen->wayland_fd, socket_handler, X_NOTIFY_READ, xwl_screen); RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, xwl_screen); pScreen->SaveScreen = xwl_save_screen; @@ -699,6 +867,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xwl_close_screen; + pScreen->CursorWarpedTo = xwl_cursor_warped_to; + pScreen->CursorConfinedTo = xwl_cursor_confined_to; + return ret; } @@ -740,8 +911,9 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv) screen_info->bitmapBitOrder = BITMAP_BIT_ORDER; screen_info->numPixmapFormats = ARRAY_SIZE(depths); - LoadExtensionList(xwayland_extensions, - ARRAY_SIZE(xwayland_extensions), FALSE); + if (serverGeneration == 1) + LoadExtensionList(xwayland_extensions, + ARRAY_SIZE(xwayland_extensions), FALSE); /* Cast away warning from missing printf annotation for * wl_log_func_t. Wayland 1.5 will have the annotation, so we can diff --git a/xserver/hw/xwayland/xwayland.h b/xserver/hw/xwayland/xwayland.h index 232d9f45c..5e5624be0 100644 --- a/xserver/hw/xwayland/xwayland.h +++ b/xserver/hw/xwayland/xwayland.h @@ -42,12 +42,14 @@ #include #include +#include "relative-pointer-unstable-v1-client-protocol.h" +#include "pointer-constraints-unstable-v1-client-protocol.h" + struct xwl_screen { int width; int height; int depth; ScreenPtr screen; - WindowPtr pointer_limbo_window; int expecting_event; enum RootClipMode root_clip_mode; @@ -63,6 +65,7 @@ struct xwl_screen { DestroyWindowProcPtr DestroyWindow; RealizeWindowProcPtr RealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow; + XYToWindowProcPtr XYToWindow; struct xorg_list output_list; struct xorg_list seat_list; @@ -75,6 +78,8 @@ struct xwl_screen { struct wl_compositor *compositor; struct wl_shm *shm; struct wl_shell *shell; + struct zwp_relative_pointer_manager_v1 *relative_pointer_manager; + struct zwp_pointer_constraints_v1 *pointer_constraints; uint32_t serial; @@ -83,6 +88,7 @@ struct xwl_screen { #define XWL_FORMAT_RGB565 (1 << 2) int prepare_read; + int wait_flush; char *device_name; int drm_fd; @@ -114,13 +120,21 @@ struct xwl_touch { struct xorg_list link_touch; }; +struct xwl_pointer_warp_emulator { + struct xwl_seat *xwl_seat; + struct xwl_window *locked_window; + struct zwp_locked_pointer_v1 *locked_pointer; +}; + struct xwl_seat { DeviceIntPtr pointer; + DeviceIntPtr relative_pointer; DeviceIntPtr keyboard; DeviceIntPtr touch; struct xwl_screen *xwl_screen; struct wl_seat *seat; struct wl_pointer *wl_pointer; + struct zwp_relative_pointer_v1 *wp_relative_pointer; struct wl_keyboard *wl_keyboard; struct wl_touch *wl_touch; struct wl_array keys; @@ -132,12 +146,32 @@ struct xwl_seat { struct wl_surface *cursor; struct wl_callback *cursor_frame_cb; Bool cursor_needs_update; + WindowPtr last_xwindow; struct xorg_list touches; size_t keymap_size; char *keymap; struct wl_surface *keyboard_focus; + + struct xorg_list sync_pending; + + struct xwl_pointer_warp_emulator *pointer_warp_emulator; + + struct xwl_window *cursor_confinement_window; + struct zwp_confined_pointer_v1 *confined_pointer; + + struct { + Bool has_absolute; + wl_fixed_t x; + wl_fixed_t y; + + Bool has_relative; + double dx; + double dy; + double dx_unaccel; + double dy_unaccel; + } pending_pointer_event; }; struct xwl_output { @@ -153,6 +187,8 @@ struct xwl_output { struct xwl_pixmap; +void xwl_sync_events (struct xwl_screen *xwl_screen); + Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); struct xwl_screen *xwl_screen_get(ScreenPtr screen); @@ -163,6 +199,19 @@ void xwl_seat_destroy(struct xwl_seat *xwl_seat); void xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window); +void xwl_seat_emulate_pointer_warp(struct xwl_seat *xwl_seat, + struct xwl_window *xwl_window, + SpritePtr sprite, + int x, int y); + +void xwl_seat_destroy_pointer_warp_emulator(struct xwl_seat *xwl_seat); + +void xwl_seat_cursor_visibility_changed(struct xwl_seat *xwl_seat); + +void xwl_seat_confine_pointer(struct xwl_seat *xwl_seat, + struct xwl_window *xwl_window); +void xwl_seat_unconfine_pointer(struct xwl_seat *xwl_seat); + Bool xwl_screen_init_output(struct xwl_screen *xwl_screen); struct xwl_output *xwl_output_create(struct xwl_screen *xwl_screen, @@ -170,6 +219,8 @@ struct xwl_output *xwl_output_create(struct xwl_screen *xwl_screen, void xwl_output_destroy(struct xwl_output *xwl_output); +void xwl_output_remove(struct xwl_output *xwl_output); + RRModePtr xwayland_cvt(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, Bool Interlaced); diff --git a/xserver/hw/xwin/InitInput.c b/xserver/hw/xwin/InitInput.c index 6cd9e060a..ae837e8c5 100644 --- a/xserver/hw/xwin/InitInput.c +++ b/xserver/hw/xwin/InitInput.c @@ -89,6 +89,18 @@ DDXRingBell(int volume, int pitch, int duration) return; } + +#ifdef HAS_DEVWINDOWS +static void +xwinDevWindowsHandlerNotify(int fd, int ready, void *data) +{ + /* This should process Windows messages, but instead all of that is delayed + * until the wakeup handler is called. + */ + ; +} +#endif + /* See Porting Layer Definition - p. 17 */ void InitInput(int argc, char *argv[]) @@ -129,7 +141,7 @@ InitInput(int argc, char *argv[]) } /* Add the message queue as a device to wait for in WaitForSomething */ - AddEnabledDevice(g_fdMessageQueue); + SetNotifyFd(g_fdMessageQueue, xwinDevWindowsHandlerNotify, X_NOTIFY_READ, NULL); } #endif diff --git a/xserver/hw/xwin/InitOutput.c b/xserver/hw/xwin/InitOutput.c index b6f258313..edd526647 100644 --- a/xserver/hw/xwin/InitOutput.c +++ b/xserver/hw/xwin/InitOutput.c @@ -66,6 +66,7 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner, #include "glx_extinit.h" #ifdef XWIN_GLX_WINDOWS #include "glx/glwindows.h" +#include "dri/windowsdri.h" #endif /* @@ -76,9 +77,6 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner, * Function prototypes */ -static Bool - winCheckDisplayNumber(void); - void winLogCommandLine(int argc, char *argv[]); @@ -120,6 +118,9 @@ const int NUMFORMATS = sizeof(g_PixmapFormats) / sizeof(g_PixmapFormats[0]); static const ExtensionModule xwinExtensions[] = { #ifdef GLXEXT { GlxExtensionInit, "GLX", &noGlxExtension }, +#ifdef XWIN_WINDOWS_DRI + { WindowsDRIExtensionInit, "Windows-DRI", &noDriExtension }, +#endif #endif }; @@ -213,7 +214,7 @@ ddxGiveUp(enum ExitCode error) #endif if (!g_fLogInited) { - g_pszLogFile = LogInit(g_pszLogFile, NULL); + g_pszLogFile = LogInit(g_pszLogFile, ".old"); g_fLogInited = TRUE; } LogClose(error); @@ -638,7 +639,8 @@ OsVendorInit(void) * avoid the second call */ g_fLogInited = TRUE; - g_pszLogFile = LogInit(g_pszLogFile, NULL); + g_pszLogFile = LogInit(g_pszLogFile, ".old"); + } LogSetParameter(XLOG_FLUSH, 1); LogSetParameter(XLOG_VERBOSITY, g_iLogVerbose); @@ -692,6 +694,20 @@ OsVendorInit(void) } } } + + /* Work out what the default resize setting should be, and apply it if it + was not explicitly specified */ + { + int j; + for (j = 0; j < g_iNumScreens; j++) { + if (g_ScreenInfo[j].iResizeMode == resizeDefault) { + if (g_ScreenInfo[j].fFullScreen) + g_ScreenInfo[j].iResizeMode = resizeNotAllowed; + else + g_ScreenInfo[j].iResizeMode = resizeWithRandr; + } + } + } } static void @@ -748,10 +764,6 @@ winUseMsg(void) ErrorF("-ignoreinput\n" "\tIgnore keyboard and mouse input.\n"); -#ifdef XWIN_MULTIWINDOWEXTWM - ErrorF("-internalwm\n" "\tRun the internal window manager.\n"); -#endif - #ifdef XWIN_XF86CONFIG ErrorF("-keyboard\n" "\tSpecify a keyboard device from the configuration file.\n"); @@ -824,11 +836,6 @@ winUseMsg(void) "\t -screen 0 1024x768@3 ; 3rd monitor size 1024x768\n" "\t -screen 0 @1 ; on 1st monitor using its full resolution (the default)\n"); - ErrorF("-silent-dup-error\n" - "\tIf another instance of " EXECUTABLE_NAME - " with the same display number is running\n" - "\texit silently and don't display any error message.\n"); - ErrorF("-swcursor\n" "\tDisable the usage of the Windows cursor and use the X11 software\n" "\tcursor instead.\n"); @@ -877,7 +884,7 @@ ddxUseMsg(void) /* Log file will not be opened for UseMsg unless we open it now */ if (!g_fLogInited) { - g_pszLogFile = LogInit(g_pszLogFile, NULL); + g_pszLogFile = LogInit(g_pszLogFile, ".old"); g_fLogInited = TRUE; } LogClose(EXIT_NO_ERROR); @@ -918,14 +925,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) "Exiting.\n"); } - /* Check for duplicate invocation on same display number. */ - if (serverGeneration == 1 && !winCheckDisplayNumber()) { - if (g_fSilentDupError) - g_fSilentFatalError = TRUE; - FatalError("InitOutput - Duplicate invocation on display " - "number: %s. Exiting.\n", display); - } - #ifdef XWIN_XF86CONFIG /* Try to read the xorg.conf-style configuration file */ if (!winReadConfigfile()) @@ -1050,70 +1049,3 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) winDebug("InitOutput - Returning.\n"); #endif } - -/* - * winCheckDisplayNumber - Check if another instance of Cygwin/X is - * already running on the same display number. If no one exists, - * make a mutex to prevent new instances from running on the same display. - * - * return FALSE if the display number is already used. - */ - -static Bool -winCheckDisplayNumber(void) -{ - int nDisp; - HANDLE mutex; - char name[MAX_PATH]; - const char *pszPrefix = '\0'; - OSVERSIONINFO osvi = { 0 }; - - /* Check display range */ - nDisp = atoi(display); - if (nDisp < 0 || nDisp > 65535) { - ErrorF("winCheckDisplayNumber - Bad display number: %d\n", nDisp); - return FALSE; - } - - /* Set first character of mutex name to null */ - name[0] = '\0'; - - /* Get operating system version information */ - osvi.dwOSVersionInfoSize = sizeof(osvi); - GetVersionEx(&osvi); - - /* Want a mutex shared among all terminals on NT > 4.0 */ - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5) { - pszPrefix = "Global\\"; - } - - /* Setup Cygwin/X specific part of name */ - snprintf(name, sizeof(name), "%sCYGWINX_DISPLAY:%d", pszPrefix, nDisp); - - /* Windows automatically releases the mutex when this process exits */ - mutex = CreateMutex(NULL, FALSE, name); - if (!mutex) { - LPVOID lpMsgBuf; - - /* Display a fancy error message */ - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, 0, NULL); - ErrorF("winCheckDisplayNumber - CreateMutex failed: %s\n", - (LPSTR) lpMsgBuf); - LocalFree(lpMsgBuf); - - return FALSE; - } - if (GetLastError() == ERROR_ALREADY_EXISTS) { - ErrorF("winCheckDisplayNumber - " - PROJECT_NAME " is already running on display %d\n", nDisp); - return FALSE; - } - - return TRUE; -} diff --git a/xserver/hw/xwin/Makefile.am b/xserver/hw/xwin/Makefile.am index 4da3d12a4..0846230b0 100644 --- a/xserver/hw/xwin/Makefile.am +++ b/xserver/hw/xwin/Makefile.am @@ -9,9 +9,17 @@ CLIPBOARD_LIBS = $(top_builddir)/hw/xwin/winclipboard/libXWinclipboard.la endif if XWIN_GLX_WINDOWS -GLX_DIR = glx -DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS -XWIN_GLX_LIBS = $(top_builddir)/hw/xwin/glx/libXwinGLX.la +GLX_DIR = +DEFS_GLX_WINDOWS = +XWIN_GLX_LIBS = +if XWIN_WINDOWS_DRI +GLX_DIR += dri +DEFS_GLX_WINDOWS += -DXWIN_WINDOWS_DRI +XWIN_GLX_LIBS += $(top_builddir)/hw/xwin/dri/libWindowsDRI.la +endif +GLX_DIR += glx +DEFS_GLX_WINDOWS += -DXWIN_GLX_WINDOWS +XWIN_GLX_LIBS += $(top_builddir)/hw/xwin/glx/libXwinGLX.la XWIN_GLX_SYS_LIBS = -lopengl32 endif @@ -189,4 +197,4 @@ relink: $(AM_V_at)rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT) SUBDIRS = man $(GLX_DIR) winclipboard . -DIST_SUBDIRS = man glx winclipboard . +DIST_SUBDIRS = man dri glx winclipboard . diff --git a/xserver/hw/xwin/Makefile.in b/xserver/hw/xwin/Makefile.in index ddb9e53c0..7ab9bf613 100644 --- a/xserver/hw/xwin/Makefile.in +++ b/xserver/hw/xwin/Makefile.in @@ -52,15 +52,19 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = XWin$(EXEEXT) +@XWIN_GLX_WINDOWS_TRUE@@XWIN_WINDOWS_DRI_TRUE@am__append_1 = dri +@XWIN_GLX_WINDOWS_TRUE@@XWIN_WINDOWS_DRI_TRUE@am__append_2 = -DXWIN_WINDOWS_DRI +@XWIN_GLX_WINDOWS_TRUE@@XWIN_WINDOWS_DRI_TRUE@am__append_3 = $(top_builddir)/hw/xwin/dri/libWindowsDRI.la subdir = hw/xwin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp $(top_srcdir)/ylwrap winprefslex.c \ winprefsyacc.c winprefsyacc.h ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -450,6 +454,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -480,7 +487,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -577,6 +587,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -630,9 +641,11 @@ top_srcdir = @top_srcdir@ @XWIN_CLIPBOARD_TRUE@DEFS_CLIPBOARD = -DXWIN_CLIPBOARD @XWIN_CLIPBOARD_TRUE@CLIPBOARD_LIBS = $(top_builddir)/hw/xwin/winclipboard/libXWinclipboard.la -@XWIN_GLX_WINDOWS_TRUE@GLX_DIR = glx -@XWIN_GLX_WINDOWS_TRUE@DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS -@XWIN_GLX_WINDOWS_TRUE@XWIN_GLX_LIBS = $(top_builddir)/hw/xwin/glx/libXwinGLX.la +@XWIN_GLX_WINDOWS_TRUE@GLX_DIR = $(am__append_1) glx +@XWIN_GLX_WINDOWS_TRUE@DEFS_GLX_WINDOWS = $(am__append_2) \ +@XWIN_GLX_WINDOWS_TRUE@ -DXWIN_GLX_WINDOWS +@XWIN_GLX_WINDOWS_TRUE@XWIN_GLX_LIBS = $(am__append_3) \ +@XWIN_GLX_WINDOWS_TRUE@ $(top_builddir)/hw/xwin/glx/libXwinGLX.la @XWIN_GLX_WINDOWS_TRUE@XWIN_GLX_SYS_LIBS = -lopengl32 @XWIN_MULTIWINDOW_TRUE@SRCS_MULTIWINDOW = \ @XWIN_MULTIWINDOW_TRUE@ winmultiwindowshape.c \ @@ -763,7 +776,7 @@ EXTRA_DIST = \ XWin.exe.manifest SUBDIRS = man $(GLX_DIR) winclipboard . -DIST_SUBDIRS = man glx winclipboard . +DIST_SUBDIRS = man dri glx winclipboard . all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/xserver/hw/xwin/dri/Makefile.am b/xserver/hw/xwin/dri/Makefile.am new file mode 100644 index 000000000..948c2b5c6 --- /dev/null +++ b/xserver/hw/xwin/dri/Makefile.am @@ -0,0 +1,9 @@ +noinst_LTLIBRARIES = libWindowsDRI.la + +libWindowsDRI_la_SOURCES = \ + windowsdri.c \ + windowsdri.h + +AM_CFLAGS = $(DIX_CFLAGS) \ + @WINDOWSDRI_CFLAGS@ \ + -I$(top_srcdir)/hw/xwin/ diff --git a/xserver/hw/xwin/dri/Makefile.in b/xserver/hw/xwin/dri/Makefile.in new file mode 100644 index 000000000..22408630a --- /dev/null +++ b/xserver/hw/xwin/dri/Makefile.in @@ -0,0 +1,793 @@ +# Makefile.in generated by automake 1.12.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = hw/xwin/dri +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ + $(top_builddir)/include/xorg-server.h \ + $(top_builddir)/include/dix-config.h \ + $(top_builddir)/include/xorg-config.h \ + $(top_builddir)/include/xkb-config.h \ + $(top_builddir)/include/xwin-config.h \ + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libWindowsDRI_la_LIBADD = +am_libWindowsDRI_la_OBJECTS = windowsdri.lo +libWindowsDRI_la_OBJECTS = $(am_libWindowsDRI_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libWindowsDRI_la_SOURCES) +DIST_SOURCES = $(libWindowsDRI_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ +BASE_FONT_PATH = @BASE_FONT_PATH@ +BUILD_DATE = @BUILD_DATE@ +BUILD_TIME = @BUILD_TIME@ +BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ +BUNDLE_VERSION = @BUNDLE_VERSION@ +BUNDLE_VERSION_STRING = @BUNDLE_VERSION_STRING@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ +DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ +DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ +DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DGA_CFLAGS = @DGA_CFLAGS@ +DGA_LIBS = @DGA_LIBS@ +DIX_CFLAGS = @DIX_CFLAGS@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ +DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ +DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ +DMXMODULES_LIBS = @DMXMODULES_LIBS@ +DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ +DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ +DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ +DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOT = @DOT@ +DOXYGEN = @DOXYGEN@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ +DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ +DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GBM_CFLAGS = @GBM_CFLAGS@ +GBM_LIBS = @GBM_LIBS@ +GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ +GLAMOR_LIBS = @GLAMOR_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +HAVE_DOT = @HAVE_DOT@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ +KDRIVE_INCS = @KDRIVE_INCS@ +KDRIVE_LIBS = @KDRIVE_LIBS@ +KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ +KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ +KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ +KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ +KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ +KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIBS = @LIBDRM_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ +LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +PYTHON3 = @PYTHON3@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRICT_CFLAGS = @STRICT_CFLAGS@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ +SYSCONFDIR = @SYSCONFDIR@ +SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ +SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ +TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ +WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ +X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XDMCP_CFLAGS = @XDMCP_CFLAGS@ +XDMCP_LIBS = @XDMCP_LIBS@ +XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ +XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ +XDMX_CFLAGS = @XDMX_CFLAGS@ +XDMX_LIBS = @XDMX_LIBS@ +XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ +XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ +XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ +XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ +XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ +XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ +XKB_DFLT_RULES = @XKB_DFLT_RULES@ +XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ +XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ +XLIB_CFLAGS = @XLIB_CFLAGS@ +XLIB_LIBS = @XLIB_LIBS@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_LIBS = @XQUARTZ_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XQUARTZ_SPARKLE_FEED_URL = @XQUARTZ_SPARKLE_FEED_URL@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ +XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ +XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ +XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ +XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ +XSERVER_LIBS = @XSERVER_LIBS@ +XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ +XSHMFENCE_LIBS = @XSHMFENCE_LIBS@ +XSLTPROC = @XSLTPROC@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ +XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ +XVFB_LIBS = @XVFB_LIBS@ +XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ +XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ +XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ +XWAYLAND_LIBS = @XWAYLAND_LIBS@ +XWAYLAND_SYS_LIBS = @XWAYLAND_SYS_LIBS@ +XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ +XWINMODULES_LIBS = @XWINMODULES_LIBS@ +XWIN_LIBS = @XWIN_LIBS@ +XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ +XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__XCONFIGDIR__ = @__XCONFIGDIR__@ +__XCONFIGFILE__ = @__XCONFIGFILE__@ +abi_ansic = @abi_ansic@ +abi_extension = @abi_extension@ +abi_videodrv = @abi_videodrv@ +abi_xinput = @abi_xinput@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverdir = @driverdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extdir = @extdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +logdir = @logdir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sdkdir = @sdkdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libWindowsDRI.la +libWindowsDRI_la_SOURCES = \ + windowsdri.c \ + windowsdri.h + +AM_CFLAGS = $(DIX_CFLAGS) \ + @WINDOWSDRI_CFLAGS@ \ + -I$(top_srcdir)/hw/xwin/ + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xwin/dri/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xwin/dri/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libWindowsDRI.la: $(libWindowsDRI_la_OBJECTS) $(libWindowsDRI_la_DEPENDENCIES) $(EXTRA_libWindowsDRI_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libWindowsDRI_la_OBJECTS) $(libWindowsDRI_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windowsdri.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xserver/hw/xwin/dri/windowsdri.c b/xserver/hw/xwin/dri/windowsdri.c new file mode 100644 index 000000000..3666e97dd --- /dev/null +++ b/xserver/hw/xwin/dri/windowsdri.c @@ -0,0 +1,274 @@ +/* + * Copyright © 2014 Jon Turney + * + * 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 (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "dixstruct.h" +#include "extnsionst.h" +#include "scrnintstr.h" +#include "swaprep.h" +#include "protocol-versions.h" +#include "windowsdri.h" +#include "glx/dri_helpers.h" + +static int WindowsDRIErrorBase = 0; +static unsigned char WindowsDRIReqCode = 0; +static int WindowsDRIEventBase = 0; + +static void +WindowsDRIResetProc(ExtensionEntry* extEntry) +{ +} + +static int +ProcWindowsDRIQueryVersion(ClientPtr client) +{ + xWindowsDRIQueryVersionReply rep; + + REQUEST_SIZE_MATCH(xWindowsDRIQueryVersionReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.majorVersion = SERVER_WINDOWSDRI_MAJOR_VERSION; + rep.minorVersion = SERVER_WINDOWSDRI_MINOR_VERSION; + rep.patchVersion = SERVER_WINDOWSDRI_PATCH_VERSION; + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.majorVersion); + swaps(&rep.minorVersion); + swapl(&rep.patchVersion); + } + WriteToClient(client, sizeof(xWindowsDRIQueryVersionReply), &rep); + return Success; +} + +static int +ProcWindowsDRIQueryDirectRenderingCapable(ClientPtr client) +{ + xWindowsDRIQueryDirectRenderingCapableReply rep; + + REQUEST(xWindowsDRIQueryDirectRenderingCapableReq); + REQUEST_SIZE_MATCH(xWindowsDRIQueryDirectRenderingCapableReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if (!client->local) + rep.isCapable = 0; + else + rep.isCapable = glxWinGetScreenAiglxIsActive(screenInfo.screens[stuff->screen]); + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + } + + WriteToClient(client, + sizeof(xWindowsDRIQueryDirectRenderingCapableReply), + &rep); + return Success; +} + +static int +ProcWindowsDRIQueryDrawable(ClientPtr client) +{ + xWindowsDRIQueryDrawableReply rep; + int rc; + + REQUEST(xWindowsDRIQueryDrawableReq); + REQUEST_SIZE_MATCH(xWindowsDRIQueryDrawableReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + rc = glxWinQueryDrawable(client, stuff->drawable, &(rep.drawable_type), &(rep.handle)); + + if (rc) + return rc; + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.handle); + swapl(&rep.drawable_type); + } + + WriteToClient(client, sizeof(xWindowsDRIQueryDrawableReply), &rep); + return Success; +} + +static int +ProcWindowsDRIFBConfigToPixelFormat(ClientPtr client) +{ + xWindowsDRIFBConfigToPixelFormatReply rep; + + REQUEST(xWindowsDRIFBConfigToPixelFormatReq); + REQUEST_SIZE_MATCH(xWindowsDRIFBConfigToPixelFormatReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + rep.pixelFormatIndex = glxWinFBConfigIDToPixelFormatIndex(stuff->screen, stuff->fbConfigID); + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.pixelFormatIndex); + } + + WriteToClient(client, sizeof(xWindowsDRIFBConfigToPixelFormatReply), &rep); + return Success; +} + +/* dispatch */ + +static int +ProcWindowsDRIDispatch(ClientPtr client) +{ + REQUEST(xReq); + + switch (stuff->data) { + case X_WindowsDRIQueryVersion: + return ProcWindowsDRIQueryVersion(client); + + case X_WindowsDRIQueryDirectRenderingCapable: + return ProcWindowsDRIQueryDirectRenderingCapable(client); + } + + if (!client->local) + return WindowsDRIErrorBase + WindowsDRIClientNotLocal; + + switch (stuff->data) { + case X_WindowsDRIQueryDrawable: + return ProcWindowsDRIQueryDrawable(client); + + case X_WindowsDRIFBConfigToPixelFormat: + return ProcWindowsDRIFBConfigToPixelFormat(client); + + default: + return BadRequest; + } +} + +static void +SNotifyEvent(xWindowsDRINotifyEvent *from, + xWindowsDRINotifyEvent *to) +{ + to->type = from->type; + to->kind = from->kind; + cpswaps(from->sequenceNumber, to->sequenceNumber); + cpswapl(from->time, to->time); +} + +static int +SProcWindowsDRIQueryVersion(ClientPtr client) +{ + REQUEST(xWindowsDRIQueryVersionReq); + swaps(&stuff->length); + return ProcWindowsDRIQueryVersion(client); +} + +static int +SProcWindowsDRIQueryDirectRenderingCapable(ClientPtr client) +{ + REQUEST(xWindowsDRIQueryDirectRenderingCapableReq); + swaps(&stuff->length); + swapl(&stuff->screen); + return ProcWindowsDRIQueryDirectRenderingCapable(client); +} + +static int +SProcWindowsDRIQueryDrawable(ClientPtr client) +{ + REQUEST(xWindowsDRIQueryDrawableReq); + swaps(&stuff->length); + swapl(&stuff->screen); + swapl(&stuff->drawable); + return ProcWindowsDRIQueryDrawable(client); +} + +static int +SProcWindowsDRIFBConfigToPixelFormat(ClientPtr client) +{ + REQUEST(xWindowsDRIFBConfigToPixelFormatReq); + swaps(&stuff->length); + swapl(&stuff->screen); + swapl(&stuff->fbConfigID); + return ProcWindowsDRIFBConfigToPixelFormat(client); +} + +static int +SProcWindowsDRIDispatch(ClientPtr client) +{ + REQUEST(xReq); + + switch (stuff->data) { + case X_WindowsDRIQueryVersion: + return SProcWindowsDRIQueryVersion(client); + + case X_WindowsDRIQueryDirectRenderingCapable: + return SProcWindowsDRIQueryDirectRenderingCapable(client); + } + + if (!client->local) + return WindowsDRIErrorBase + WindowsDRIClientNotLocal; + + switch (stuff->data) { + case X_WindowsDRIQueryDrawable: + return SProcWindowsDRIQueryDrawable(client); + + case X_WindowsDRIFBConfigToPixelFormat: + return SProcWindowsDRIFBConfigToPixelFormat(client); + + default: + return BadRequest; + } +} + +void +WindowsDRIExtensionInit(void) +{ + ExtensionEntry* extEntry; + + if ((extEntry = AddExtension(WINDOWSDRINAME, + WindowsDRINumberEvents, + WindowsDRINumberErrors, + ProcWindowsDRIDispatch, + SProcWindowsDRIDispatch, + WindowsDRIResetProc, + StandardMinorOpcode))) { + size_t i; + WindowsDRIReqCode = (unsigned char)extEntry->base; + WindowsDRIErrorBase = extEntry->errorBase; + WindowsDRIEventBase = extEntry->eventBase; + for (i = 0; i < WindowsDRINumberEvents; i++) + EventSwapVector[WindowsDRIEventBase + i] = (EventSwapPtr)SNotifyEvent; + } +} diff --git a/xserver/hw/xwin/dri/windowsdri.h b/xserver/hw/xwin/dri/windowsdri.h new file mode 100644 index 000000000..852b716b0 --- /dev/null +++ b/xserver/hw/xwin/dri/windowsdri.h @@ -0,0 +1,30 @@ +/* + * Copyright © 2014 Jon Turney + * + * 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 (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +#ifndef windowsdri_h +#define windowsdri_h + +void WindowsDRIExtensionInit(void); +Bool noDriExtension; + +#endif /* windowsdri_h */ diff --git a/xserver/hw/xwin/glx/Makefile.am b/xserver/hw/xwin/glx/Makefile.am index f2dffbffb..599ec37cc 100644 --- a/xserver/hw/xwin/glx/Makefile.am +++ b/xserver/hw/xwin/glx/Makefile.am @@ -7,9 +7,16 @@ libXwinGLX_la_SOURCES = \ glwindows.h \ glshim.c \ indirect.c \ + indirect.h \ wgl_ext_api.c \ wgl_ext_api.h +if XWIN_WINDOWS_DRI +libXwinGLX_la_SOURCES += \ + dri_helpers.c \ + dri_helpers.h +endif + libnativeGLthunk_la_SOURCES = \ glthunk.c diff --git a/xserver/hw/xwin/glx/Makefile.in b/xserver/hw/xwin/glx/Makefile.in index 434310b4e..8dfc6b033 100644 --- a/xserver/hw/xwin/glx/Makefile.in +++ b/xserver/hw/xwin/glx/Makefile.in @@ -50,14 +50,19 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@XWIN_WINDOWS_DRI_TRUE@am__append_1 = \ +@XWIN_WINDOWS_DRI_TRUE@ dri_helpers.c \ +@XWIN_WINDOWS_DRI_TRUE@ dri_helpers.h + subdir = hw/xwin/glx DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -101,8 +106,12 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libXwinGLX_la_LIBADD = +am__libXwinGLX_la_SOURCES_DIST = winpriv.c winpriv.h glwindows.h \ + glshim.c indirect.c indirect.h wgl_ext_api.c wgl_ext_api.h \ + dri_helpers.c dri_helpers.h +@XWIN_WINDOWS_DRI_TRUE@am__objects_1 = dri_helpers.lo am_libXwinGLX_la_OBJECTS = winpriv.lo glshim.lo indirect.lo \ - wgl_ext_api.lo + wgl_ext_api.lo $(am__objects_1) libXwinGLX_la_OBJECTS = $(am_libXwinGLX_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -150,7 +159,8 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libXwinGLX_la_SOURCES) $(libnativeGLthunk_la_SOURCES) -DIST_SOURCES = $(libXwinGLX_la_SOURCES) $(libnativeGLthunk_la_SOURCES) +DIST_SOURCES = $(am__libXwinGLX_la_SOURCES_DIST) \ + $(libnativeGLthunk_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -334,6 +344,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -364,7 +377,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -459,6 +475,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -508,15 +525,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libXwinGLX.la lib_LTLIBRARIES = libnativeGLthunk.la -libXwinGLX_la_SOURCES = \ - winpriv.c \ - winpriv.h \ - glwindows.h \ - glshim.c \ - indirect.c \ - wgl_ext_api.c \ - wgl_ext_api.h - +libXwinGLX_la_SOURCES = winpriv.c winpriv.h glwindows.h glshim.c \ + indirect.c indirect.h wgl_ext_api.c wgl_ext_api.h \ + $(am__append_1) libnativeGLthunk_la_SOURCES = \ glthunk.c @@ -628,6 +639,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri_helpers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glshim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnativeGLthunk_la-glthunk.Plo@am__quote@ diff --git a/xserver/hw/xwin/glx/dri_helpers.c b/xserver/hw/xwin/glx/dri_helpers.c new file mode 100644 index 000000000..5ccec74b6 --- /dev/null +++ b/xserver/hw/xwin/glx/dri_helpers.c @@ -0,0 +1,120 @@ +/* + * Copyright © 2014 Jon Turney + * + * 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 (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "indirect.h" +#include "winpriv.h" +#include "dri_helpers.h" +#include "win.h" + +int +glxWinQueryDrawable(ClientPtr client, XID drawId, unsigned int *type, unsigned int *handle) +{ + __GLXWinDrawable *pDrawable; + int err; + + if (validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, + DixReadAccess, (__GLXdrawable **)&pDrawable, &err)) { + + switch (pDrawable->base.type) + { + case GLX_DRAWABLE_WINDOW: + { + HWND h = winGetWindowInfo((WindowPtr)(pDrawable->base.pDraw)); + *handle = (uintptr_t)h; + *type = WindowsDRIDrawableWindow; + } + break; + + case GLX_DRAWABLE_PIXMAP: + glxWinDeferredCreateDrawable(pDrawable, pDrawable->base.config); + *handle = pDrawable->base.pDraw->id; + // The XID is used to create a unique name for a file mapping + // shared with the requesting process + // + // XXX: Alternatively, we could use an anonymous file mapping + // and use DuplicateHandle to make pDrawable->hSection available + // to the requesting process... ? + *type = WindowsDRIDrawablePixmap; + break; + + case GLX_DRAWABLE_PBUFFER: + glxWinDeferredCreateDrawable(pDrawable, pDrawable->base.config); + *handle = (uintptr_t)(pDrawable->hPbuffer); + *type = WindowsDRIDrawablePbuffer; + break; + + default: + assert(FALSE); + *handle = 0; + } + } + else { + HWND h; + /* The drawId XID doesn't identify a GLX drawable. The only other valid + alternative is that it is the XID of a window drawable that is being + used by the pre-GLX 1.3 interface */ + DrawablePtr pDraw; + int rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess); + if (rc != Success || pDraw->type != DRAWABLE_WINDOW) { + return err; + } + + h = winGetWindowInfo((WindowPtr)(pDraw)); + *handle = (uintptr_t)h; + *type = WindowsDRIDrawableWindow; + } + + winDebug("glxWinQueryDrawable: type %d, handle %p\n", *type, (void *)(uintptr_t)*handle); + return Success; +} + +int +glxWinFBConfigIDToPixelFormatIndex(int scr, int fbConfigID) +{ + __GLXscreen *screen = glxGetScreen(screenInfo.screens[scr]); + __GLXconfig *c; + + for (c = screen->fbconfigs; + c != NULL; + c = c->next) { + if (c->fbconfigID == fbConfigID) + return ((GLXWinConfig *)c)->pixelFormatIndex; + } + + return 0; +} + +Bool +glxWinGetScreenAiglxIsActive(ScreenPtr pScreen) +{ + winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); + return pWinScreen->fNativeGlActive; +} diff --git a/xserver/hw/xwin/glx/dri_helpers.h b/xserver/hw/xwin/glx/dri_helpers.h new file mode 100644 index 000000000..a32c965d7 --- /dev/null +++ b/xserver/hw/xwin/glx/dri_helpers.h @@ -0,0 +1,38 @@ +/* + * Copyright © 2014 Jon Turney + * + * 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 (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +#ifndef dri_helpers_h +#define dri_helpers_h + +#include "dixstruct.h" + +int +glxWinQueryDrawable(ClientPtr client, XID drawId, unsigned int *type, unsigned int *handle); + +int +glxWinFBConfigIDToPixelFormatIndex(int scr, int fbConfigID); + +Bool +glxWinGetScreenAiglxIsActive(ScreenPtr pScreen); + +#endif /* dri_helpers_h */ diff --git a/xserver/hw/xwin/glx/indirect.c b/xserver/hw/xwin/glx/indirect.c index e4be64228..239327ed4 100644 --- a/xserver/hw/xwin/glx/indirect.c +++ b/xserver/hw/xwin/glx/indirect.c @@ -81,12 +81,12 @@ #include "glwindows.h" #include #include -#include #include #include #include #include +#include #define NUM_ELEMENTS(x) (sizeof(x)/ sizeof(x[1])) @@ -101,59 +101,6 @@ #define PFD_SUPPORT_COMPOSITION 0x00008000 #endif -/* ---------------------------------------------------------------------- */ -/* - * structure definitions - */ - -typedef struct __GLXWinContext __GLXWinContext; -typedef struct __GLXWinDrawable __GLXWinDrawable; -typedef struct __GLXWinScreen glxWinScreen; -typedef struct __GLXWinConfig GLXWinConfig; - -struct __GLXWinContext { - __GLXcontext base; - HGLRC ctx; /* Windows GL Context */ - __GLXWinContext *shareContext; /* Context with which we will share display lists and textures */ - HWND hwnd; /* For detecting when HWND has changed */ -}; - -struct __GLXWinDrawable { - __GLXdrawable base; - __GLXWinContext *drawContext; - __GLXWinContext *readContext; - - /* If this drawable is GLX_DRAWABLE_PBUFFER */ - HPBUFFERARB hPbuffer; - - /* If this drawable is GLX_DRAWABLE_PIXMAP */ - HDC dibDC; - HBITMAP hDIB; - HBITMAP hOldDIB; /* original DIB for DC */ - void *pOldBits; /* original pBits for this drawable's pixmap */ -}; - -struct __GLXWinScreen { - __GLXscreen base; - - /* Supported GLX extensions */ - unsigned char glx_enable_bits[__GLX_EXT_BYTES]; - - Bool has_WGL_ARB_multisample; - Bool has_WGL_ARB_pixel_format; - Bool has_WGL_ARB_pbuffer; - Bool has_WGL_ARB_render_texture; - - /* wrapped screen functions */ - RealizeWindowProcPtr RealizeWindow; - UnrealizeWindowProcPtr UnrealizeWindow; - CopyWindowProcPtr CopyWindow; -}; - -struct __GLXWinConfig { - __GLXconfig base; - int pixelFormatIndex; -}; /* ---------------------------------------------------------------------- */ /* @@ -419,7 +366,8 @@ static Bool glxWinRealizeWindow(WindowPtr pWin); static Bool glxWinUnrealizeWindow(WindowPtr pWin); static void glxWinCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); - +static Bool glxWinSetPixelFormat(HDC hdc, int bppOverride, int drawableTypeOverride, + __GLXscreen *screen, __GLXconfig *config); static HDC glxWinMakeDC(__GLXWinContext * gc, __GLXWinDrawable * draw, HDC * hdc, HWND * hwnd); static void glxWinReleaseDC(HWND hwnd, HDC hdc, __GLXWinDrawable * draw); @@ -627,75 +575,46 @@ glxWinScreenProbe(ScreenPtr pScreen) // those screens to be accelerated in XP and earlier... { - // testing facility to not use any WGL extensions - char *envptr = getenv("GLWIN_NO_WGL_EXTENSIONS"); - - if ((envptr != NULL) && (atoi(envptr) != 0)) { - ErrorF("GLWIN_NO_WGL_EXTENSIONS is set, ignoring WGL_EXTENSIONS\n"); - wgl_extensions = ""; - } - } - - { - Bool glx_sgi_make_current_read = FALSE; - // // Based on the WGL extensions available, enable various GLX extensions // XXX: make this table-driven ? // - memset(screen->glx_enable_bits, 0, __GLX_EXT_BYTES); + __glXInitExtensionEnableBits(screen->base.glx_enable_bits); - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_info"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_rating"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_import_context"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_OML_swap_method"); - __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIX_fbconfig"); - - if (strstr(wgl_extensions, "WGL_ARB_make_current_read")) { - __glXEnableExtension(screen->glx_enable_bits, - "GLX_SGI_make_current_read"); - LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n"); - glx_sgi_make_current_read = TRUE; - } + if (strstr(wgl_extensions, "WGL_ARB_make_current_read")) + screen->has_WGL_ARB_make_current_read = TRUE; + else + LogMessage(X_WARNING, "AIGLX: missing WGL_ARB_make_current_read\n"); if (strstr(gl_extensions, "GL_WIN_swap_hint")) { - __glXEnableExtension(screen->glx_enable_bits, + __glXEnableExtension(screen->base.glx_enable_bits, "GLX_MESA_copy_sub_buffer"); LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); } if (strstr(wgl_extensions, "WGL_EXT_swap_control")) { - __glXEnableExtension(screen->glx_enable_bits, + __glXEnableExtension(screen->base.glx_enable_bits, "GLX_SGI_swap_control"); - __glXEnableExtension(screen->glx_enable_bits, - "GLX_MESA_swap_control"); - LogMessage(X_INFO, - "AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n"); + LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_swap_control\n"); } /* // Hmm? screen->texOffset */ /* if (strstr(wgl_extensions, "WGL_ARB_render_texture")) */ /* { */ -/* __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_texture_from_pixmap"); */ +/* __glXEnableExtension(screen->base.glx_enable_bits, "GLX_EXT_texture_from_pixmap"); */ /* LogMessage(X_INFO, "AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n"); */ /* screen->has_WGL_ARB_render_texture = TRUE; */ /* } */ - if (strstr(wgl_extensions, "WGL_ARB_pbuffer")) { - __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIX_pbuffer"); - LogMessage(X_INFO, "AIGLX: enabled GLX_SGIX_pbuffer\n"); + if (strstr(wgl_extensions, "WGL_ARB_pbuffer")) screen->has_WGL_ARB_pbuffer = TRUE; - } + else + LogMessage(X_WARNING, "AIGLX: missing WGL_ARB_pbuffer\n"); - if (strstr(wgl_extensions, "WGL_ARB_multisample")) { - __glXEnableExtension(screen->glx_enable_bits, - "GLX_ARB_multisample"); - __glXEnableExtension(screen->glx_enable_bits, - "GLX_SGIS_multisample"); - LogMessage(X_INFO, - "AIGLX: enabled GLX_ARB_multisample and GLX_SGIS_multisample\n"); + if (strstr(wgl_extensions, "WGL_ARB_multisample")) screen->has_WGL_ARB_multisample = TRUE; - } + else + LogMessage(X_WARNING, "AIGLX: missing WGL_ARB_multisample\n"); screen->base.destroy = glxWinScreenDestroy; screen->base.createContext = glxWinCreateContext; @@ -737,40 +656,7 @@ glxWinScreenProbe(ScreenPtr pScreen) screen->base.numVisuals = 0; __glXScreenInit(&screen->base, pScreen); - - // Generate the GLX extensions string (overrides that set by __glXScreenInit()) - { - unsigned int buffer_size = - __glXGetExtensionString(screen->glx_enable_bits, NULL); - if (buffer_size > 0) { - free(screen->base.GLXextensions); - - screen->base.GLXextensions = xnfalloc(buffer_size); - __glXGetExtensionString(screen->glx_enable_bits, - screen->base.GLXextensions); - } - } - - // - // Override the GLX version (__glXScreenInit() sets it to "1.2") - // if we have all the needed extensions to operate as a higher version - // - // SGIX_fbconfig && SGIX_pbuffer && SGI_make_current_read -> 1.3 - // ARB_multisample -> 1.4 - // - if (screen->has_WGL_ARB_pbuffer && glx_sgi_make_current_read) { - if (screen->has_WGL_ARB_multisample) { - screen->base.GLXmajor = 1; - screen->base.GLXminor = 4; - } - else { - screen->base.GLXmajor = 1; - screen->base.GLXminor = 3; - } - } } - LogMessage(X_INFO, "AIGLX: Set GLX version to %d.%d\n", - screen->base.GLXmajor, screen->base.GLXminor); wglMakeCurrent(NULL, NULL); wglDeleteContext(hglrc); @@ -788,6 +674,9 @@ glxWinScreenProbe(ScreenPtr pScreen) screen->CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = glxWinCopyWindow; + // Note that WGL is active on this screen + winSetScreenAiglxIsActive(pScreen); + return &screen->base; error: @@ -934,6 +823,10 @@ glxWinDrawableDestroy(__GLXdrawable * base) } if (glxPriv->hDIB) { + if (!CloseHandle(glxPriv->hSection)) { + ErrorF("CloseHandle failed: %s\n", glxWinErrorMessage()); + } + if (!DeleteObject(glxPriv->hDIB)) { ErrorF("DeleteObject failed: %s\n", glxWinErrorMessage()); } @@ -977,6 +870,179 @@ glxWinCreateDrawable(ClientPtr client, return &glxPriv->base; } +void +glxWinDeferredCreateDrawable(__GLXWinDrawable *draw, __GLXconfig *config) +{ + switch (draw->base.type) { + case GLX_DRAWABLE_WINDOW: + { + WindowPtr pWin = (WindowPtr) draw->base.pDraw; + + if (!(config->drawableType & GLX_WINDOW_BIT)) { + ErrorF + ("glxWinDeferredCreateDrawable: tried to create a GLX_DRAWABLE_WINDOW drawable with a fbConfig which doesn't have drawableType GLX_WINDOW_BIT\n"); + } + + if (pWin == NULL) { + GLWIN_DEBUG_MSG("Deferring until X window is created"); + return; + } + + GLWIN_DEBUG_MSG("glxWinDeferredCreateDrawable: pWin %p", pWin); + + if (winGetWindowInfo(pWin) == NULL) { + GLWIN_DEBUG_MSG("Deferring until native window is created"); + return; + } + } + break; + + case GLX_DRAWABLE_PBUFFER: + { + if (draw->hPbuffer == NULL) { + __GLXscreen *screen; + glxWinScreen *winScreen; + int pixelFormat; + + // XXX: which DC are we supposed to use??? + HDC screenDC = GetDC(NULL); + + if (!(config->drawableType & GLX_PBUFFER_BIT)) { + ErrorF + ("glxWinDeferredCreateDrawable: tried to create a GLX_DRAWABLE_PBUFFER drawable with a fbConfig which doesn't have drawableType GLX_PBUFFER_BIT\n"); + } + + screen = glxGetScreen(screenInfo.screens[draw->base.pDraw->pScreen->myNum]); + winScreen = (glxWinScreen *) screen; + + pixelFormat = + fbConfigToPixelFormatIndex(screenDC, config, + GLX_PBUFFER_BIT, winScreen); + if (pixelFormat == 0) { + return; + } + + draw->hPbuffer = + wglCreatePbufferARBWrapper(screenDC, pixelFormat, + draw->base.pDraw->width, + draw->base.pDraw->height, NULL); + ReleaseDC(NULL, screenDC); + + if (draw->hPbuffer == NULL) { + ErrorF("wglCreatePbufferARBWrapper error: %s\n", + glxWinErrorMessage()); + return; + } + + GLWIN_DEBUG_MSG + ("glxWinDeferredCreateDrawable: pBuffer %p created for drawable %p", + draw->hPbuffer, draw); + } + } + break; + + case GLX_DRAWABLE_PIXMAP: + { + if (draw->dibDC == NULL) { + BITMAPINFOHEADER bmpHeader; + void *pBits; + __GLXscreen *screen; + DWORD size; + char name[MAX_PATH]; + + memset(&bmpHeader, 0, sizeof(BITMAPINFOHEADER)); + bmpHeader.biSize = sizeof(BITMAPINFOHEADER); + bmpHeader.biWidth = draw->base.pDraw->width; + bmpHeader.biHeight = draw->base.pDraw->height; + bmpHeader.biPlanes = 1; + bmpHeader.biBitCount = draw->base.pDraw->bitsPerPixel; + bmpHeader.biCompression = BI_RGB; + + if (!(config->drawableType & GLX_PIXMAP_BIT)) { + ErrorF + ("glxWinDeferredCreateDrawable: tried to create a GLX_DRAWABLE_PIXMAP drawable with a fbConfig which doesn't have drawableType GLX_PIXMAP_BIT\n"); + } + + draw->dibDC = CreateCompatibleDC(NULL); + if (draw->dibDC == NULL) { + ErrorF("CreateCompatibleDC error: %s\n", glxWinErrorMessage()); + return; + } + +#define RASTERWIDTHBYTES(bmi) (((((bmi)->biWidth*(bmi)->biBitCount)+31)&~31)>>3) + size = bmpHeader.biHeight * RASTERWIDTHBYTES(&bmpHeader); + GLWIN_DEBUG_MSG("shared memory region size %zu + %u\n", sizeof(BITMAPINFOHEADER), (unsigned int)size); + + // Create unique name for mapping based on XID + // + // XXX: not quite unique as potentially this name could be used in + // another server instance. Not sure how to deal with that. + snprintf(name, sizeof(name), "Local\\CYGWINX_WINDOWSDRI_%08x", (unsigned int)draw->base.pDraw->id); + GLWIN_DEBUG_MSG("shared memory region name %s\n", name); + + // Create a file mapping backed by the pagefile + draw->hSection = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, + PAGE_READWRITE, 0, sizeof(BITMAPINFOHEADER) + size, name); + if (draw->hSection == NULL) { + ErrorF("CreateFileMapping error: %s\n", glxWinErrorMessage()); + return; + } + + draw->hDIB = + CreateDIBSection(draw->dibDC, (BITMAPINFO *) &bmpHeader, + DIB_RGB_COLORS, &pBits, draw->hSection, sizeof(BITMAPINFOHEADER)); + if (draw->dibDC == NULL) { + ErrorF("CreateDIBSection error: %s\n", glxWinErrorMessage()); + return; + } + + // Store a copy of the BITMAPINFOHEADER at the start of the shared + // memory for the information of the receiving process + { + LPVOID pData = MapViewOfFile(draw->hSection, FILE_MAP_WRITE, 0, 0, 0); + memcpy(pData, (void *)&bmpHeader, sizeof(BITMAPINFOHEADER)); + UnmapViewOfFile(pData); + } + + // XXX: CreateDIBSection insists on allocating the bitmap memory for us, so we're going to + // need some jiggery pokery to point the underlying X Drawable's bitmap at the same set of bits + // so that they can be read with XGetImage as well as glReadPixels, assuming the formats are + // even compatible ... + draw->pOldBits = ((PixmapPtr) draw->base.pDraw)->devPrivate.ptr; + ((PixmapPtr) draw->base.pDraw)->devPrivate.ptr = pBits; + + // Select the DIB into the DC + draw->hOldDIB = SelectObject(draw->dibDC, draw->hDIB); + if (!draw->hOldDIB) { + ErrorF("SelectObject error: %s\n", glxWinErrorMessage()); + } + + screen = glxGetScreen(screenInfo.screens[draw->base.pDraw->pScreen->myNum]); + + // Set the pixel format of the bitmap + glxWinSetPixelFormat(draw->dibDC, + draw->base.pDraw->bitsPerPixel, + GLX_PIXMAP_BIT, + screen, + config); + + GLWIN_DEBUG_MSG + ("glxWinDeferredCreateDrawable: DIB bitmap %p created for drawable %p", + draw->hDIB, draw); + } + } + break; + + default: + { + ErrorF + ("glxWinDeferredCreateDrawable: tried to attach unhandled drawable type %d\n", + draw->base.type); + return; + } + } +} + /* ---------------------------------------------------------------------- */ /* * Texture functions @@ -1020,13 +1086,10 @@ glxWinReleaseTexImage(__GLXcontext * baseContext, */ static Bool -glxWinSetPixelFormat(__GLXWinContext * gc, HDC hdc, int bppOverride, - int drawableTypeOverride) +glxWinSetPixelFormat(HDC hdc, int bppOverride, int drawableTypeOverride, + __GLXscreen *screen, __GLXconfig *config) { - __GLXscreen *screen = gc->base.pGlxScreen; glxWinScreen *winScreen = (glxWinScreen *) screen; - - __GLXconfig *config = gc->base.config; GLXWinConfig *winConfig = (GLXWinConfig *) config; GLWIN_DEBUG_MSG("glxWinSetPixelFormat: pixelFormatIndex %d", @@ -1077,7 +1140,7 @@ glxWinSetPixelFormat(__GLXWinContext * gc, HDC hdc, int bppOverride, int pixelFormat; /* convert fbConfig to PFD */ - if (fbConfigToPixelFormat(gc->base.config, &pfd, drawableTypeOverride)) { + if (fbConfigToPixelFormat(config, &pfd, drawableTypeOverride)) { ErrorF("glxWinSetPixelFormat: fbConfigToPixelFormat failed\n"); return FALSE; } @@ -1109,9 +1172,9 @@ glxWinSetPixelFormat(__GLXWinContext * gc, HDC hdc, int bppOverride, } } else { - int pixelFormat = - fbConfigToPixelFormatIndex(hdc, gc->base.config, - drawableTypeOverride, winScreen); + int pixelFormat = fbConfigToPixelFormatIndex(hdc, config, + drawableTypeOverride, + winScreen); if (pixelFormat == 0) { return FALSE; } @@ -1178,7 +1241,7 @@ glxWinMakeDC(__GLXWinContext * gc, __GLXWinDrawable * draw, HDC * hdc, gc->hwnd = *hwnd; /* We must select a pixelformat, but SetPixelFormat can only be called once for a window... */ - if (!glxWinSetPixelFormat(gc, *hdc, 0, GLX_WINDOW_BIT)) { + if (!glxWinSetPixelFormat(*hdc, 0, GLX_WINDOW_BIT, gc->base.pGlxScreen, gc->base.config)) { ErrorF("glxWinSetPixelFormat error: %s\n", glxWinErrorMessage()); ReleaseDC(*hwnd, *hdc); @@ -1264,140 +1327,7 @@ glxWinDeferredCreateContext(__GLXWinContext * gc, __GLXWinDrawable * draw) ("glxWinDeferredCreateContext: attach context %p to drawable %p", gc, draw); - switch (draw->base.type) { - case GLX_DRAWABLE_WINDOW: - { - WindowPtr pWin = (WindowPtr) draw->base.pDraw; - - if (!(gc->base.config->drawableType & GLX_WINDOW_BIT)) { - ErrorF - ("glxWinDeferredCreateContext: tried to attach a context whose fbConfig doesn't have drawableType GLX_WINDOW_BIT to a GLX_DRAWABLE_WINDOW drawable\n"); - } - - if (pWin == NULL) { - GLWIN_DEBUG_MSG("Deferring until X window is created"); - return; - } - - GLWIN_DEBUG_MSG("glxWinDeferredCreateContext: pWin %p", pWin); - - if (winGetWindowInfo(pWin) == NULL) { - GLWIN_DEBUG_MSG("Deferring until native window is created"); - return; - } - } - break; - - case GLX_DRAWABLE_PBUFFER: - { - if (draw->hPbuffer == NULL) { - __GLXscreen *screen; - glxWinScreen *winScreen; - int pixelFormat; - - // XXX: which DC are we supposed to use??? - HDC screenDC = GetDC(NULL); - - if (!(gc->base.config->drawableType & GLX_PBUFFER_BIT)) { - ErrorF - ("glxWinDeferredCreateContext: tried to attach a context whose fbConfig doesn't have drawableType GLX_PBUFFER_BIT to a GLX_DRAWABLE_PBUFFER drawable\n"); - } - - screen = gc->base.pGlxScreen; - winScreen = (glxWinScreen *) screen; - - pixelFormat = - fbConfigToPixelFormatIndex(screenDC, gc->base.config, - GLX_PBUFFER_BIT, winScreen); - if (pixelFormat == 0) { - return; - } - - draw->hPbuffer = - wglCreatePbufferARBWrapper(screenDC, pixelFormat, - draw->base.pDraw->width, - draw->base.pDraw->height, NULL); - ReleaseDC(NULL, screenDC); - - if (draw->hPbuffer == NULL) { - ErrorF("wglCreatePbufferARBWrapper error: %s\n", - glxWinErrorMessage()); - return; - } - - GLWIN_DEBUG_MSG - ("glxWinDeferredCreateContext: pBuffer %p created for drawable %p", - draw->hPbuffer, draw); - } - } - break; - - case GLX_DRAWABLE_PIXMAP: - { - if (draw->dibDC == NULL) { - BITMAPINFOHEADER bmpHeader; - void *pBits; - - memset(&bmpHeader, 0, sizeof(BITMAPINFOHEADER)); - bmpHeader.biSize = sizeof(BITMAPINFOHEADER); - bmpHeader.biWidth = draw->base.pDraw->width; - bmpHeader.biHeight = draw->base.pDraw->height; - bmpHeader.biPlanes = 1; - bmpHeader.biBitCount = draw->base.pDraw->bitsPerPixel; - bmpHeader.biCompression = BI_RGB; - - if (!(gc->base.config->drawableType & GLX_PIXMAP_BIT)) { - ErrorF - ("glxWinDeferredCreateContext: tried to attach a context whose fbConfig doesn't have drawableType GLX_PIXMAP_BIT to a GLX_DRAWABLE_PIXMAP drawable\n"); - } - - draw->dibDC = CreateCompatibleDC(NULL); - if (draw->dibDC == NULL) { - ErrorF("CreateCompatibleDC error: %s\n", glxWinErrorMessage()); - return; - } - - draw->hDIB = - CreateDIBSection(draw->dibDC, (BITMAPINFO *) &bmpHeader, - DIB_RGB_COLORS, &pBits, 0, 0); - if (draw->dibDC == NULL) { - ErrorF("CreateDIBSection error: %s\n", glxWinErrorMessage()); - return; - } - - // XXX: CreateDIBSection insists on allocating the bitmap memory for us, so we're going to - // need some jiggery pokery to point the underlying X Drawable's bitmap at the same set of bits - // so that they can be read with XGetImage as well as glReadPixels, assuming the formats are - // even compatible ... - draw->pOldBits = ((PixmapPtr) draw->base.pDraw)->devPrivate.ptr; - ((PixmapPtr) draw->base.pDraw)->devPrivate.ptr = pBits; - - // Select the DIB into the DC - draw->hOldDIB = SelectObject(draw->dibDC, draw->hDIB); - if (!draw->hOldDIB) { - ErrorF("SelectObject error: %s\n", glxWinErrorMessage()); - } - - // Set the pixel format of the bitmap - glxWinSetPixelFormat(gc, draw->dibDC, - draw->base.pDraw->bitsPerPixel, - GLX_PIXMAP_BIT); - - GLWIN_DEBUG_MSG - ("glxWinDeferredCreateContext: DIB bitmap %p created for drawable %p", - draw->hDIB, draw); - } - } - break; - - default: - { - ErrorF - ("glxWinDeferredCreateContext: tried to attach unhandled drawable type %d\n", - draw->base.type); - return; - } - } + glxWinDeferredCreateDrawable(draw, gc->base.config); dc = glxWinMakeDC(gc, draw, &dc, &hwnd); gc->ctx = wglCreateContext(dc); @@ -1434,6 +1364,7 @@ static int glxWinContextMakeCurrent(__GLXcontext * base) { __GLXWinContext *gc = (__GLXWinContext *) base; + glxWinScreen *scr = (glxWinScreen *)base->pGlxScreen; BOOL ret; HDC drawDC; HDC readDC = NULL; @@ -1466,7 +1397,14 @@ glxWinContextMakeCurrent(__GLXcontext * base) } if ((gc->base.readPriv != NULL) && (gc->base.readPriv != gc->base.drawPriv)) { - // XXX: should only occur with WGL_ARB_make_current_read + /* + * We enable GLX_SGI_make_current_read unconditionally, but the + * renderer might not support it. It's fairly rare to use this + * feature so just error out if it can't work. + */ + if (!scr->has_WGL_ARB_make_current_read) + return False; + /* If there is a separate read drawable, create a separate read DC, and use the wglMakeContextCurrent extension to make the context current drawing @@ -1959,7 +1897,6 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen) c->base.renderType = GLX_RGBA_BIT; } - c->base.xRenderable = GL_TRUE; c->base.fbconfigID = -1; // will be set by __glXScreenInit() /* SGIX_pbuffer / GLX 1.3 */ @@ -2319,7 +2256,6 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen) c->base.renderType = GLX_RGBA_BIT; } - c->base.xRenderable = GL_TRUE; c->base.fbconfigID = -1; // will be set by __glXScreenInit() /* SGIX_pbuffer / GLX 1.3 */ diff --git a/xserver/hw/xwin/glx/indirect.h b/xserver/hw/xwin/glx/indirect.h new file mode 100644 index 000000000..8a66121ac --- /dev/null +++ b/xserver/hw/xwin/glx/indirect.h @@ -0,0 +1,95 @@ +/* + * Copyright © 2014 Jon TURNEY + * + * 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 (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +#ifndef indirect_h +#define indirect_h + +#include +#include +#include + +/* ---------------------------------------------------------------------- */ +/* + * structure definitions + */ + +typedef struct __GLXWinContext __GLXWinContext; +typedef struct __GLXWinDrawable __GLXWinDrawable; +typedef struct __GLXWinScreen glxWinScreen; +typedef struct __GLXWinConfig GLXWinConfig; + +struct __GLXWinContext { + __GLXcontext base; + HGLRC ctx; /* Windows GL Context */ + __GLXWinContext *shareContext; /* Context with which we will share display lists and textures */ + HWND hwnd; /* For detecting when HWND has changed */ +}; + +struct __GLXWinDrawable { + __GLXdrawable base; + __GLXWinContext *drawContext; + __GLXWinContext *readContext; + + /* If this drawable is GLX_DRAWABLE_PBUFFER */ + HPBUFFERARB hPbuffer; + + /* If this drawable is GLX_DRAWABLE_PIXMAP */ + HDC dibDC; + HANDLE hSection; /* file mapping handle */ + HBITMAP hDIB; + HBITMAP hOldDIB; /* original DIB for DC */ + void *pOldBits; /* original pBits for this drawable's pixmap */ +}; + +struct __GLXWinScreen { + __GLXscreen base; + + /* Supported GLX extensions */ + unsigned char glx_enable_bits[__GLX_EXT_BYTES]; + + Bool has_WGL_ARB_multisample; + Bool has_WGL_ARB_pixel_format; + Bool has_WGL_ARB_pbuffer; + Bool has_WGL_ARB_render_texture; + Bool has_WGL_ARB_make_current_read; + + /* wrapped screen functions */ + RealizeWindowProcPtr RealizeWindow; + UnrealizeWindowProcPtr UnrealizeWindow; + CopyWindowProcPtr CopyWindow; +}; + +struct __GLXWinConfig { + __GLXconfig base; + int pixelFormatIndex; +}; + +/* ---------------------------------------------------------------------- */ +/* + * function prototypes + */ + +void +glxWinDeferredCreateDrawable(__GLXWinDrawable *draw, __GLXconfig *config); + +#endif /* indirect_h */ diff --git a/xserver/hw/xwin/glx/winpriv.c b/xserver/hw/xwin/glx/winpriv.c index e6afbff01..c98ad9099 100644 --- a/xserver/hw/xwin/glx/winpriv.c +++ b/xserver/hw/xwin/glx/winpriv.c @@ -119,3 +119,10 @@ winCheckScreenAiglxIsSupported(ScreenPtr pScreen) return FALSE; } + +void +winSetScreenAiglxIsActive(ScreenPtr pScreen) +{ + winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); + pWinScreen->fNativeGlActive = TRUE; +} diff --git a/xserver/hw/xwin/glx/winpriv.h b/xserver/hw/xwin/glx/winpriv.h index dce1edf48..6f695a971 100644 --- a/xserver/hw/xwin/glx/winpriv.h +++ b/xserver/hw/xwin/glx/winpriv.h @@ -9,3 +9,4 @@ HWND winGetWindowInfo(WindowPtr pWin); Bool winCheckScreenAiglxIsSupported(ScreenPtr pScreen); +void winSetScreenAiglxIsActive(ScreenPtr pScreen); diff --git a/xserver/hw/xwin/man/Makefile.in b/xserver/hw/xwin/man/Makefile.in index 5a4747f32..aa16d267d 100644 --- a/xserver/hw/xwin/man/Makefile.in +++ b/xserver/hw/xwin/man/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/xwin/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -313,6 +314,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -343,7 +347,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -438,6 +445,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xwin/man/XWin.man b/xserver/hw/xwin/man/XWin.man index d68ee2a41..2222293e0 100644 --- a/xserver/hw/xwin/man/XWin.man +++ b/xserver/hw/xwin/man/XWin.man @@ -124,7 +124,8 @@ Alternative name for \fB\-resize=scrollbars\fP. .SH OPTIONS CONTROLLING RESIZE BEHAVIOUR .TP 8 .B \-resize[=none|scrollbars|randr] -Select the resize mode of an X screen. The default is randr. +Select the resize mode of an X screen. +The default is \fBnone\fP if \fB\-fullscreen\fP is used, \fBrandr\fP otherwise. .RS .IP \fB\-resize=none\fP 8 @@ -305,10 +306,6 @@ and for \fIlevel\fP=3 detailed log information (including trace and debug output) is produced. Bigger values will yield a still more detailed debug output. .TP 8 -.B \-silent-dup-error -If another instance of \fIXWin\fP with the same display number is found running, -exit silently and don't display any error message. -.TP 8 .B "\-xkblayout \fIlayout\fP" .TP 8 .B "\-xkbmodel \fImodel\fP" @@ -350,9 +347,6 @@ Color map manipulation is not supported, so the PseudoColor visual will not have the correct colors. This option is intended to allow applications which only work with a depth 8 visual to operate in TrueColor modes. -.TP 8 -.B \-internalwm -Run the internal window manager. .SH LOG FILE As it runs \fIXWin\fP writes messages indicating the most relevant events diff --git a/xserver/hw/xwin/win.h b/xserver/hw/xwin/win.h index 5710ea852..103c4b9a9 100644 --- a/xserver/hw/xwin/win.h +++ b/xserver/hw/xwin/win.h @@ -162,7 +162,6 @@ #include "mipointer.h" #include "X11/keysym.h" #include "micoord.h" -#include "dix.h" #include "miline.h" #include "shadow.h" #include "fb.h" @@ -287,25 +286,12 @@ typedef Bool (*winCreateColormapProcPtr) (ColormapPtr pColormap); typedef Bool (*winDestroyColormapProcPtr) (ColormapPtr pColormap); -typedef Bool (*winHotKeyAltTabProcPtr) (ScreenPtr); - typedef Bool (*winCreatePrimarySurfaceProcPtr) (ScreenPtr); typedef Bool (*winReleasePrimarySurfaceProcPtr) (ScreenPtr); -typedef Bool (*winFinishCreateWindowsWindowProcPtr) (WindowPtr pWin); - typedef Bool (*winCreateScreenResourcesProc) (ScreenPtr); -/* - * GC (graphics context) privates - */ - -typedef struct { - HDC hdc; - HDC hdcMem; -} winPrivGCRec, *winPrivGCPtr; - /* * Pixmap privates */ @@ -329,6 +315,7 @@ typedef struct { PALETTEENTRY peColors[WIN_NUM_PALETTE_ENTRIES]; } winPrivCmapRec, *winPrivCmapPtr; + /* * Windows Cursor handling. */ @@ -348,7 +335,8 @@ typedef struct { * Resize modes */ typedef enum { - notAllowed, + resizeDefault = -1, + resizeNotAllowed, resizeWithScrollbars, resizeWithRandr } winResizeMode; @@ -404,8 +392,6 @@ typedef struct { Bool fDecoration; #ifdef XWIN_MULTIWINDOWEXTWM Bool fMWExtWM; - Bool fInternalWM; - Bool fAnotherWMRunning; #endif Bool fRootless; #ifdef XWIN_MULTIWINDOW @@ -524,17 +510,10 @@ typedef struct _winPrivScreenRec { winStoreColorsProcPtr pwinStoreColors; winCreateColormapProcPtr pwinCreateColormap; winDestroyColormapProcPtr pwinDestroyColormap; - winHotKeyAltTabProcPtr pwinHotKeyAltTab; winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface; winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface; - winCreateScreenResourcesProc pwinCreateScreenResources; -#ifdef XWIN_MULTIWINDOW - /* Window Procedures for MultiWindow mode */ - winFinishCreateWindowsWindowProcPtr pwinFinishCreateWindowsWindow; -#endif - /* Window Procedures for Rootless mode */ CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; @@ -554,6 +533,8 @@ typedef struct _winPrivScreenRec { SetShapeProcPtr SetShape; winCursorRec cursor; + + Bool fNativeGlActive; } winPrivScreenRec; #ifdef XWIN_MULTIWINDOWEXTWM @@ -738,8 +719,7 @@ void winSetAuthorization(void); void -winBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadMask); +winBlockHandler(ScreenPtr pScreen, void *pTimeout); #ifdef XWIN_CLIPBOARD /* @@ -923,9 +903,7 @@ Bool */ void - -winWakeupHandler(ScreenPtr pScreen, - unsigned long ulResult, void *pReadmask); +winWakeupHandler(ScreenPtr pScreen, int iResult); /* * winwindow.c @@ -1137,9 +1115,6 @@ winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv, wBOOL CALLBACK winMWExtWMDecorateWindow(HWND hwnd, LPARAM lParam); -Bool - winIsInternalWMRunning(winScreenInfoPtr pScreenInfo); - void winMWExtWMRestackWindows(ScreenPtr pScreen); #endif diff --git a/xserver/hw/xwin/winallpriv.c b/xserver/hw/xwin/winallpriv.c index 816b030ca..e25e6bd11 100644 --- a/xserver/hw/xwin/winallpriv.c +++ b/xserver/hw/xwin/winallpriv.c @@ -79,13 +79,6 @@ winAllocatePrivates(ScreenPtr pScreen) /* Save the screen private pointer */ winSetScreenPriv(pScreen, pScreenPriv); - /* Reserve GC memory for our privates */ - if (!dixRegisterPrivateKey - (g_iGCPrivateKey, PRIVATE_GC, sizeof(winPrivGCRec))) { - ErrorF("winAllocatePrivates - AllocateGCPrivate () failed\n"); - return FALSE; - } - /* Reserve Pixmap memory for our privates */ if (!dixRegisterPrivateKey (g_iPixmapPrivateKey, PRIVATE_PIXMAP, sizeof(winPrivPixmapRec))) { diff --git a/xserver/hw/xwin/winauth.c b/xserver/hw/xwin/winauth.c index 7be7dcae1..e86343952 100644 --- a/xserver/hw/xwin/winauth.c +++ b/xserver/hw/xwin/winauth.c @@ -38,6 +38,16 @@ #include "securitysrv.h" #include "os/osdep.h" +#include + +/* Need to get this from Xlib.h */ +extern void XSetAuthorization( + const char * /* name */, + int /* namelen */, + const char * /* data */, + int /* datalen */ +); + /* * Constants */ @@ -51,6 +61,7 @@ static XID g_authId = 0; static unsigned int g_uiAuthDataLen = 0; static char *g_pAuthData = NULL; +static xcb_auth_info_t auth_info; /* * Code to generate a MIT-MAGIC-COOKIE-1, copied from under XCSECURITY @@ -131,6 +142,11 @@ winGenerateAuthorization(void) g_uiAuthDataLen, g_pAuthData); } + auth_info.name = AUTH_NAME; + auth_info.namelen = strlen(AUTH_NAME); + auth_info.data = g_pAuthData; + auth_info.datalen = g_uiAuthDataLen; + #ifdef XCSECURITY /* Allocate structure for additional auth information */ pAuth = (SecurityAuthorizationPtr) @@ -168,3 +184,12 @@ winSetAuthorization(void) XSetAuthorization(AUTH_NAME, strlen(AUTH_NAME), g_pAuthData, g_uiAuthDataLen); } + +xcb_auth_info_t * +winGetXcbAuthInfo(void) +{ + if (g_pAuthData) + return &auth_info; + + return NULL; +} diff --git a/xserver/hw/xwin/winblock.c b/xserver/hw/xwin/winblock.c index 07e907828..110740d55 100644 --- a/xserver/hw/xwin/winblock.c +++ b/xserver/hw/xwin/winblock.c @@ -36,8 +36,7 @@ /* See Porting Layer Definition - p. 6 */ void -winBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadMask) +winBlockHandler(ScreenPtr pScreen, void *pTimeout) { #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) winScreenPriv(pScreen); @@ -70,7 +69,7 @@ winBlockHandler(ScreenPtr pScreen, if (pScreenPriv != NULL && !pScreenPriv->fServerStarted) { int iReturn; - ErrorF("winBlockHandler - pthread_mutex_unlock()\n"); + winDebug("winBlockHandler - pthread_mutex_unlock()\n"); /* Flag that modules are to be started */ pScreenPriv->fServerStarted = TRUE; diff --git a/xserver/hw/xwin/winclipboard/Makefile.in b/xserver/hw/xwin/winclipboard/Makefile.in index c4c6767dc..fa5a808e6 100644 --- a/xserver/hw/xwin/winclipboard/Makefile.in +++ b/xserver/hw/xwin/winclipboard/Makefile.in @@ -58,9 +58,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = hw/xwin/winclipboard ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -363,6 +364,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -393,7 +397,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -488,6 +495,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/hw/xwin/winclipboard/internal.h b/xserver/hw/xwin/winclipboard/internal.h new file mode 100644 index 000000000..d0d8fbda1 --- /dev/null +++ b/xserver/hw/xwin/winclipboard/internal.h @@ -0,0 +1,125 @@ + +/* + *Copyright (C) 2003-2004 Harold L Hunt II 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 HAROLD L HUNT II 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 Harold L Hunt II + *shall not be used in advertising or otherwise to promote the sale, use + *or other dealings in this Software without prior written authorization + *from Harold L Hunt II. + * + * Authors: Harold L Hunt II + */ + +#ifndef WINCLIPBOARD_INTERNAL_H +#define WINCLIPBOARD_INTERNAL_H + +/* X headers */ +#include + +/* Windows headers */ +#include + +#define WIN_XEVENTS_SUCCESS 0 +#define WIN_XEVENTS_FAILED 1 +#define WIN_XEVENTS_NOTIFY_DATA 3 +#define WIN_XEVENTS_NOTIFY_TARGETS 4 + +#define WM_WM_REINIT (WM_USER + 1) +#define WM_WM_QUIT (WM_USER + 2) + +/* + * References to external symbols + */ + +extern void winDebug(const char *format, ...) _X_ATTRIBUTE_PRINTF(1, 2); +extern void ErrorF(const char *format, ...) _X_ATTRIBUTE_PRINTF(1, 2); + +/* + * winclipboardtextconv.c + */ + +void + winClipboardDOStoUNIX(char *pszData, int iLength); + +void + winClipboardUNIXtoDOS(char **ppszData, int iLength); + +/* + * winclipboardthread.c + */ + + +typedef struct +{ + Atom atomClipboard; + Atom atomLocalProperty; + Atom atomUTF8String; + Atom atomCompoundText; + Atom atomTargets; +} ClipboardAtoms; + +/* Modern clipboard API functions */ +typedef wBOOL WINAPI (*ADDCLIPBOARDFORMATLISTENERPROC)(HWND hwnd); +typedef wBOOL WINAPI (*REMOVECLIPBOARDFORMATLISTENERPROC)(HWND hwnd); + +extern Bool g_fHasModernClipboardApi; +extern ADDCLIPBOARDFORMATLISTENERPROC g_fpAddClipboardFormatListener; +extern REMOVECLIPBOARDFORMATLISTENERPROC g_fpRemoveClipboardFormatListener; + +/* + * winclipboardwndproc.c + */ + +Bool winClipboardFlushWindowsMessageQueue(HWND hwnd); + +LRESULT CALLBACK +winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); + +typedef struct +{ + Display *pClipboardDisplay; + Window iClipboardWindow; + ClipboardAtoms *atoms; +} ClipboardWindowCreationParams; + +/* + * winclipboardxevents.c + */ + +typedef struct +{ + Bool fUseUnicode; + Atom *targetList; +} ClipboardConversionData; + +int +winClipboardFlushXEvents(HWND hwnd, + Window iWindow, Display * pDisplay, ClipboardConversionData *data, ClipboardAtoms *atom); + + +Atom +winClipboardGetLastOwnedSelectionAtom(ClipboardAtoms *atoms); + +void +winClipboardInitMonitoredSelections(void); + +#endif diff --git a/xserver/hw/xwin/winconfig.c b/xserver/hw/xwin/winconfig.c index fb99113d5..31894d2fb 100644 --- a/xserver/hw/xwin/winconfig.c +++ b/xserver/hw/xwin/winconfig.c @@ -264,8 +264,9 @@ winConfigKeyboard(DeviceIntPtr pDevice) break; } g_winInfo.keyboard.rate = (kbd_speed > 0) ? kbd_speed : 1; - winMsgVerb(X_PROBED, 1, "Setting autorepeat to delay=%ld, rate=%ld\n", - g_winInfo.keyboard.delay, g_winInfo.keyboard.rate); + winMsg(X_PROBED, "Setting autorepeat to delay=%ld, rate=%ld\n", + g_winInfo.keyboard.delay, g_winInfo.keyboard.rate); + } } diff --git a/xserver/hw/xwin/wincreatewnd.c b/xserver/hw/xwin/wincreatewnd.c index b2f797c51..e6e587f9f 100644 --- a/xserver/hw/xwin/wincreatewnd.c +++ b/xserver/hw/xwin/wincreatewnd.c @@ -171,7 +171,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) fForceShowWindow = TRUE; } dwWindowStyle |= WS_CAPTION; - if (pScreenInfo->iResizeMode != notAllowed) + if (pScreenInfo->iResizeMode != resizeNotAllowed) dwWindowStyle |= WS_THICKFRAME | WS_MAXIMIZEBOX; } else @@ -226,7 +226,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) ) && (pScreenInfo->iResizeMode == resizeWithScrollbars)) { /* We cannot have scrollbars if we do not have a window border */ - pScreenInfo->iResizeMode = notAllowed; + pScreenInfo->iResizeMode = resizeNotAllowed; } /* Did the user specify a height and width? */ @@ -253,7 +253,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) #endif /* Are we resizable */ - if (pScreenInfo->iResizeMode != notAllowed) { + if (pScreenInfo->iResizeMode != resizeNotAllowed) { #if CYGDEBUG winDebug ("winCreateBoundingWindowWindowed - Window is resizable\n"); diff --git a/xserver/hw/xwin/winengine.c b/xserver/hw/xwin/winengine.c index b8f8da06b..d816851e2 100644 --- a/xserver/hw/xwin/winengine.c +++ b/xserver/hw/xwin/winengine.c @@ -203,7 +203,7 @@ winSetEngine(ScreenPtr pScreen) return TRUE; } - return TRUE; + return FALSE; } /* diff --git a/xserver/hw/xwin/winerror.c b/xserver/hw/xwin/winerror.c index 1318b0f36..b49f9e59d 100644 --- a/xserver/hw/xwin/winerror.c +++ b/xserver/hw/xwin/winerror.c @@ -75,7 +75,7 @@ OsVendorFatalError(const char *f, va_list args) if (!g_fLogInited) { g_fLogInited = TRUE; - g_pszLogFile = LogInit(g_pszLogFile, NULL); + g_pszLogFile = LogInit(g_pszLogFile, ".old"); } LogClose(EXIT_ERR_ABORT); diff --git a/xserver/hw/xwin/winglobals.c b/xserver/hw/xwin/winglobals.c index 1382c8972..66019b4b1 100644 --- a/xserver/hw/xwin/winglobals.c +++ b/xserver/hw/xwin/winglobals.c @@ -76,7 +76,6 @@ DWORD g_dwCurrentThreadID = 0; Bool g_fKeyboardHookLL = FALSE; Bool g_fNoHelpMessageBox = FALSE; Bool g_fSoftwareCursor = FALSE; -Bool g_fSilentDupError = FALSE; Bool g_fNativeGl = TRUE; Bool g_fHostInTitle = TRUE; pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER; diff --git a/xserver/hw/xwin/winglobals.h b/xserver/hw/xwin/winglobals.h index d7b813dbb..d143fb819 100644 --- a/xserver/hw/xwin/winglobals.h +++ b/xserver/hw/xwin/winglobals.h @@ -52,7 +52,6 @@ extern Bool g_fAuthEnabled; extern Bool g_fXdmcpEnabled; extern Bool g_fNoHelpMessageBox; -extern Bool g_fSilentDupError; extern Bool g_fNativeGl; extern Bool g_fHostInTitle; diff --git a/xserver/hw/xwin/winkeybd.c b/xserver/hw/xwin/winkeybd.c index ab53af4ba..00586c25b 100644 --- a/xserver/hw/xwin/winkeybd.c +++ b/xserver/hw/xwin/winkeybd.c @@ -246,7 +246,7 @@ winRestoreModeKeyStates(void) unsigned short internalKeyStates; /* X server is being initialized */ - if (!inputInfo.keyboard) + if (!inputInfo.keyboard || !inputInfo.keyboard->key) return; /* Only process events if the rootwindow is mapped. The keyboard events diff --git a/xserver/hw/xwin/winmsg.c b/xserver/hw/xwin/winmsg.c index 575bc47b2..2ee48ce5a 100644 --- a/xserver/hw/xwin/winmsg.c +++ b/xserver/hw/xwin/winmsg.c @@ -38,17 +38,7 @@ #endif #include -void -winVMsg(int, MessageType, int verb, const char *, va_list) -_X_ATTRIBUTE_PRINTF(4, 0); - -void -winVMsg(int scrnIndex, MessageType type, int verb, const char *format, - va_list ap) -{ - LogVMessageVerb(type, verb, format, ap); -} - +#ifdef XWIN_XF86CONFIG void winDrvMsg(int scrnIndex, MessageType type, const char *format, ...) { @@ -59,16 +49,6 @@ winDrvMsg(int scrnIndex, MessageType type, const char *format, ...) va_end(ap); } -void -winMsg(MessageType type, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, 1, format, ap); - va_end(ap); -} - void winDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, ...) @@ -79,16 +59,7 @@ winDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, LogVMessageVerb(type, verb, format, ap); va_end(ap); } - -void -winMsgVerb(MessageType type, int verb, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, verb, format, ap); - va_end(ap); -} +#endif void winErrorFVerb(int verb, const char *format, ...) diff --git a/xserver/hw/xwin/winmsg.h b/xserver/hw/xwin/winmsg.h index 6c96c4070..02f672f08 100644 --- a/xserver/hw/xwin/winmsg.h +++ b/xserver/hw/xwin/winmsg.h @@ -1,5 +1,3 @@ -#ifndef __WIN_MSG_H__ -#define __WIN_MSG_H__ /* *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. * @@ -30,12 +28,17 @@ * Authors: Alexander Gottwald */ +#ifndef __WIN_MSG_H__ +#define __WIN_MSG_H__ + #include +#include /* * Function prototypes */ +#ifdef XWIN_XF86CONFIG void winDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, ...) @@ -43,12 +46,10 @@ _X_ATTRIBUTE_PRINTF(4, 5); void winDrvMsg(int scrnIndex, MessageType type, const char *format, ...) _X_ATTRIBUTE_PRINTF(3, 4); -void -winMsgVerb(MessageType type, int verb, const char *format, ...) -_X_ATTRIBUTE_PRINTF(3, 4); -void -winMsg(MessageType type, const char *format, ...) -_X_ATTRIBUTE_PRINTF(2, 3); +#endif + +#define winMsg LogMessage + void winDebug(const char *format, ...) _X_ATTRIBUTE_PRINTF(1, 2); diff --git a/xserver/hw/xwin/winmultiwindowicons.c b/xserver/hw/xwin/winmultiwindowicons.c index cc4538709..050795123 100644 --- a/xserver/hw/xwin/winmultiwindowicons.c +++ b/xserver/hw/xwin/winmultiwindowicons.c @@ -36,15 +36,21 @@ #define WINVER 0x0500 #endif +#include +#include + #include #include -#include +#include +#include +#include #include "winresource.h" #include "winprefs.h" #include "winmsg.h" #include "winmultiwindowicons.h" #include "winglobals.h" + /* * global variables */ @@ -57,7 +63,7 @@ extern HINSTANCE g_hInstance; static void winScaleXImageToWindowsIcon(int iconSize, int effBPP, - int stride, XImage * pixmap, unsigned char *image) + int stride, xcb_image_t* pixmap, unsigned char *image) { int row, column, effXBPP, effXDepth; unsigned char *outPtr; @@ -69,15 +75,15 @@ winScaleXImageToWindowsIcon(int iconSize, unsigned int zero; unsigned int color; - effXBPP = pixmap->bits_per_pixel; - if (pixmap->bits_per_pixel == 15) + effXBPP = pixmap->bpp; + if (pixmap->bpp == 15) effXBPP = 16; effXDepth = pixmap->depth; if (pixmap->depth == 15) effXDepth = 16; - xStride = pixmap->bytes_per_line; + xStride = pixmap->stride; if (stride == 0 || xStride == 0) { ErrorF("winScaleXBitmapToWindows - stride or xStride is zero. " "Bailing.\n"); @@ -330,8 +336,8 @@ NetWMToWinIconThreshold(uint32_t * icon) static HICON NetWMToWinIcon(int bpp, uint32_t * icon) { - static Bool hasIconAlphaChannel = FALSE; - static BOOL versionChecked = FALSE; + static bool hasIconAlphaChannel = FALSE; + static bool versionChecked = FALSE; if (!versionChecked) { OSVERSIONINFOEX osvi = { 0 }; @@ -366,8 +372,8 @@ NetWMToWinIcon(int bpp, uint32_t * icon) */ static - HICON -winXIconToHICON(Display * pDisplay, Window id, int iconSize) +HICON +winXIconToHICON(xcb_connection_t *conn, xcb_window_t id, int iconSize) { unsigned char *mask, *image = NULL, *imageMask; unsigned char *dst, *src; @@ -375,16 +381,13 @@ winXIconToHICON(Display * pDisplay, Window id, int iconSize) unsigned int biggest_size = 0; HDC hDC; ICONINFO ii; - XWMHints *hints; + xcb_icccm_wm_hints_t hints; HICON hIcon = NULL; uint32_t *biggest_icon = NULL; - static Atom _XA_NET_WM_ICON; + static xcb_atom_t _XA_NET_WM_ICON; static int generation; uint32_t *icon, *icon_data = NULL; unsigned long int size; - Atom type; - int format; - unsigned long int left; hDC = GetDC(GetDesktopWindow()); planes = GetDeviceCaps(hDC, PLANES); @@ -393,17 +396,31 @@ winXIconToHICON(Display * pDisplay, Window id, int iconSize) /* Always prefer _NET_WM_ICON icons */ if (generation != serverGeneration) { + xcb_intern_atom_reply_t *atom_reply; + xcb_intern_atom_cookie_t atom_cookie; + const char *atomName = "_NET_WM_ICON"; + generation = serverGeneration; - _XA_NET_WM_ICON = XInternAtom(pDisplay, "_NET_WM_ICON", FALSE); + + _XA_NET_WM_ICON = XCB_NONE; + + atom_cookie = xcb_intern_atom(conn, 0, strlen(atomName), atomName); + atom_reply = xcb_intern_atom_reply(conn, atom_cookie, NULL); + if (atom_reply) { + _XA_NET_WM_ICON = atom_reply->atom; + free(atom_reply); + } } - if ((XGetWindowProperty(pDisplay, id, _XA_NET_WM_ICON, - 0, MAXINT, FALSE, - AnyPropertyType, &type, &format, &size, &left, - (unsigned char **) &icon_data) == Success) && - (icon_data != NULL)) { - for (icon = icon_data; icon < &icon_data[size] && *icon; - icon = &icon[icon[0] * icon[1] + 2]) { + { + xcb_get_property_cookie_t cookie = xcb_get_property(conn, FALSE, id, _XA_NET_WM_ICON, XCB_ATOM_CARDINAL, 0L, INT_MAX); + xcb_get_property_reply_t *reply = xcb_get_property_reply(conn, cookie, NULL); + + if (reply && + ((icon_data = xcb_get_property_value(reply)) != NULL)) { + size = xcb_get_property_value_length(reply)/sizeof(uint32_t); + for (icon = icon_data; icon < &icon_data[size] && *icon; + icon = &icon[icon[0] * icon[1] + 2]) { winDebug("winXIconToHICON: %u x %u NetIcon\n", icon[0], icon[1]); /* Icon data size will overflow an int and thus is bigger than the @@ -441,40 +458,46 @@ winXIconToHICON(Display * pDisplay, Window id, int iconSize) hIcon = NetWMToWinIcon(bpp, biggest_icon); } - XFree(icon_data); + free(reply); + } } if (!hIcon) { + xcb_get_property_cookie_t wm_hints_cookie; + winDebug("winXIconToHICON: no suitable NetIcon\n"); - hints = XGetWMHints(pDisplay, id); - if (hints) { + wm_hints_cookie = xcb_icccm_get_wm_hints(conn, id); + if (xcb_icccm_get_wm_hints_reply(conn, wm_hints_cookie, &hints, NULL)) { winDebug("winXIconToHICON: id 0x%x icon_pixmap hint 0x%x\n", (unsigned int)id, - (unsigned int)hints->icon_pixmap); + (unsigned int)hints.icon_pixmap); - if (hints->icon_pixmap) { - Window root; - int x, y; - unsigned int width, height, border_width, depth; - XImage *xImageIcon; - XImage *xImageMask = NULL; + if (hints.icon_pixmap) { + unsigned int width, height; + xcb_image_t *xImageIcon; + xcb_image_t *xImageMask = NULL; - XGetGeometry(pDisplay, hints->icon_pixmap, &root, &x, &y, - &width, &height, &border_width, &depth); + xcb_get_geometry_cookie_t geom_cookie = xcb_get_geometry(conn, hints.icon_pixmap); + xcb_get_geometry_reply_t *geom_reply = xcb_get_geometry_reply(conn, geom_cookie, NULL); - xImageIcon = - XGetImage(pDisplay, hints->icon_pixmap, 0, 0, width, height, - 0xFFFFFFFF, ZPixmap); - winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%p\n", - (unsigned int)id, xImageIcon); + if (geom_reply) { + width = geom_reply->width; + height = geom_reply->height; - if (hints->icon_mask) - xImageMask = - XGetImage(pDisplay, hints->icon_mask, 0, 0, width, - height, 0xFFFFFFFF, ZPixmap); + xImageIcon = xcb_image_get(conn, hints.icon_pixmap, + 0, 0, width, height, + 0xFFFFFF, XCB_IMAGE_FORMAT_Z_PIXMAP); - if (xImageIcon) { + winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%p\n", + (unsigned int)id, xImageIcon); + + if (hints.icon_mask) + xImageMask = xcb_image_get(conn, hints.icon_mask, + 0, 0, width, height, + 0xFFFFFFFF, XCB_IMAGE_FORMAT_Z_PIXMAP); + + if (xImageIcon) { int effBPP, stride, maskStride; /* 15 BPP is really 16BPP as far as we care */ @@ -543,12 +566,12 @@ winXIconToHICON(Display * pDisplay, Window id, int iconSize) free(imageMask); if (xImageMask) - XDestroyImage(xImageMask); + xcb_image_destroy(xImageMask); - XDestroyImage(xImageIcon); + xcb_image_destroy(xImageIcon); + } } } - XFree(hints); } } return hIcon; @@ -560,20 +583,22 @@ winXIconToHICON(Display * pDisplay, Window id, int iconSize) #ifdef XWIN_MULTIWINDOW void -winUpdateIcon(HWND hWnd, Display * pDisplay, Window id, HICON hIconNew) +winUpdateIcon(HWND hWnd, xcb_connection_t *conn, Window id, HICON hIconNew) { HICON hIcon, hIconSmall = NULL, hIconOld; - /* Start with the icon from preferences, if any */ - hIcon = hIconNew; - hIconSmall = hIconNew; - - /* If we still need an icon, try and get the icon from WM_HINTS */ - if (!hIcon) - hIcon = winXIconToHICON(pDisplay, id, GetSystemMetrics(SM_CXICON)); - if (!hIconSmall) - hIconSmall = - winXIconToHICON(pDisplay, id, GetSystemMetrics(SM_CXSMICON)); + if (hIconNew) + { + /* Start with the icon from preferences, if any */ + hIcon = hIconNew; + hIconSmall = hIconNew; + } + else + { + /* If we still need an icon, try and get the icon from WM_HINTS */ + hIcon = winXIconToHICON(conn, id, GetSystemMetrics(SM_CXICON)); + hIconSmall = winXIconToHICON(conn, id, GetSystemMetrics(SM_CXSMICON)); + } /* If we got the small, but not the large one swap them */ if (!hIcon && hIconSmall) { diff --git a/xserver/hw/xwin/winmultiwindowicons.h b/xserver/hw/xwin/winmultiwindowicons.h index bf7f6eda7..87ba8d1cf 100644 --- a/xserver/hw/xwin/winmultiwindowicons.h +++ b/xserver/hw/xwin/winmultiwindowicons.h @@ -27,8 +27,10 @@ #ifndef WINMULTIWINDOWICONS_H #define WINMULTIWINDOWICONS_H +#include + void - winUpdateIcon(HWND hWnd, Display * pDisplay, Window id, HICON hIconNew); + winUpdateIcon(HWND hWnd, xcb_connection_t *conn, Window id, HICON hIconNew); void winInitGlobalIcons(void); diff --git a/xserver/hw/xwin/winmultiwindowwindow.c b/xserver/hw/xwin/winmultiwindowwindow.c index 8b857855f..4ec5634af 100644 --- a/xserver/hw/xwin/winmultiwindowwindow.c +++ b/xserver/hw/xwin/winmultiwindowwindow.c @@ -35,9 +35,11 @@ #ifdef HAVE_XWIN_CONFIG_H #include #endif + #include "win.h" #include "dixevents.h" #include "winmultiwindowclass.h" +#include "winmultiwindowicons.h" /* * Prototypes for local functions @@ -485,7 +487,6 @@ winCreateWindowsWindow(WindowPtr pWin) HWND hFore = NULL; winWindowPriv(pWin); - winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv; WinXSizeHints hints; Window daddyId; DWORD dwStyle, dwExStyle; @@ -606,9 +607,6 @@ winCreateWindowsWindow(WindowPtr pWin) /* Flag that this Windows window handles its own activation */ SetProp(hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0); - - /* Call engine-specific create window procedure */ - (*pScreenPriv->pwinFinishCreateWindowsWindow) (pWin); } Bool winInDestroyWindowsWindow = FALSE; @@ -801,56 +799,6 @@ winReorderWindowsMultiWindow(void) fRestacking = FALSE; } -/* - * winMinimizeWindow - Minimize in response to WM_CHANGE_STATE - */ - -void -winMinimizeWindow(Window id) -{ - WindowPtr pWin; - winPrivWinPtr pWinPriv; - -#ifdef XWIN_MULTIWINDOWEXTWM - win32RootlessWindowPtr pRLWinPriv; -#endif - HWND hWnd; - ScreenPtr pScreen = NULL; - winPrivScreenPtr pScreenPriv = NULL; - -#if CYGWINDOWING_DEBUG - ErrorF("winMinimizeWindow\n"); -#endif - - dixLookupResourceByType((void *) &pWin, id, RT_WINDOW, NullClient, - DixUnknownAccess); - if (!pWin) { - ErrorF("%s: NULL pWin. Leaving\n", __FUNCTION__); - return; - } - - pScreen = pWin->drawable.pScreen; - if (pScreen) - pScreenPriv = winGetScreenPriv(pScreen); - -#ifdef XWIN_MULTIWINDOWEXTWM - if (pScreenPriv && pScreenPriv->pScreenInfo->fInternalWM) { - pRLWinPriv = - (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE); - hWnd = pRLWinPriv->hWnd; - } - else -#else - if (pScreenPriv) -#endif - { - pWinPriv = winGetWindowPriv(pWin); - hWnd = pWinPriv->hWnd; - } - - ShowWindow(hWnd, SW_MINIMIZE); -} - /* * CopyWindow - See Porting Layer Definition - p. 39 */ diff --git a/xserver/hw/xwin/winmultiwindowwm.c b/xserver/hw/xwin/winmultiwindowwm.c index a693274d5..df7e6d3d5 100644 --- a/xserver/hw/xwin/winmultiwindowwm.c +++ b/xserver/hw/xwin/winmultiwindowwm.c @@ -45,16 +45,15 @@ #define HANDLE void * #include #undef HANDLE -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include + #include /* Local headers */ +#include "X11/Xdefs.h" // for Bool type #include "winwindow.h" #include "winprefs.h" #include "window.h" @@ -62,14 +61,11 @@ #include "windowstr.h" #include "winglobals.h" #include "windisplay.h" +#include "winmultiwindowicons.h" -#ifdef XWIN_MULTIWINDOWEXTWM -#include -#else /* We need the native HWND atom for intWM, so for consistency use the - same name as extWM would if we were building with enabled... */ + same name as extWM does */ #define WINDOWSWM_NATIVE_HWND "_WINDOWSWM_NATIVE_HWND" -#endif #ifndef HOST_NAME_MAX #define HOST_NAME_MAX 255 @@ -78,6 +74,7 @@ extern void winDebug(const char *format, ...); extern void winReshapeMultiWindow(WindowPtr pWin); extern void winUpdateRgnMultiWindow(WindowPtr pWin); +extern xcb_auth_info_t *winGetXcbAuthInfo(void); #ifndef CYGDEBUG #define CYGDEBUG NO @@ -92,8 +89,6 @@ extern void winUpdateRgnMultiWindow(WindowPtr pWin); #ifdef HAS_DEVWINDOWS #define WIN_MSG_QUEUE_FNAME "/dev/windows" #endif -#define WIN_JMP_OKAY 0 -#define WIN_JMP_ERROR_IO 2 /* * Local structures @@ -109,17 +104,18 @@ typedef struct _WMMsgQueueRec { struct _WMMsgNodeRec *pTail; pthread_mutex_t pmMutex; pthread_cond_t pcNotEmpty; - int nQueueSize; } WMMsgQueueRec, *WMMsgQueuePtr; typedef struct _WMInfo { - Display *pDisplay; + xcb_connection_t *conn; WMMsgQueueRec wmMsgQueue; - Atom atmWmProtos; - Atom atmWmDelete; - Atom atmWmTakeFocus; - Atom atmPrivMap; - Bool fAllowOtherWM; + xcb_atom_t atmWmProtos; + xcb_atom_t atmWmDelete; + xcb_atom_t atmWmTakeFocus; + xcb_atom_t atmPrivMap; + xcb_atom_t atmUtf8String; + xcb_atom_t atmNetWmName; + xcb_ewmh_connection_t ewmh; } WMInfoRec, *WMInfoPtr; typedef struct _WMProcArgRec { @@ -129,7 +125,7 @@ typedef struct _WMProcArgRec { } WMProcArgRec, *WMProcArgPtr; typedef struct _XMsgProcArgRec { - Display *pDisplay; + xcb_connection_t *conn; DWORD dwScreen; WMInfoPtr pWMInfo; pthread_mutex_t *ppmServerStarted; @@ -149,48 +145,31 @@ static Bool InitQueue(WMMsgQueuePtr pQueue); static void - GetWindowName(Display * pDpy, Window iWin, char **ppWindowName); - -static int - SendXMessage(Display * pDisplay, Window iWin, Atom atmType, long nData); + GetWindowName(WMInfoPtr pWMInfo, xcb_window_t iWin, char **ppWindowName); static void - UpdateName(WMInfoPtr pWMInfo, Window iWindow); + SendXMessage(xcb_connection_t *conn, xcb_window_t iWin, xcb_atom_t atmType, long nData); + +static void + UpdateName(WMInfoPtr pWMInfo, xcb_window_t iWindow); static void *winMultiWindowWMProc(void *pArg); -static int - winMultiWindowWMErrorHandler(Display * pDisplay, XErrorEvent * pErr); - -static int - winMultiWindowWMIOErrorHandler(Display * pDisplay); - static void *winMultiWindowXMsgProc(void *pArg); -static int - winMultiWindowXMsgProcErrorHandler(Display * pDisplay, XErrorEvent * pErr); - -static int - winMultiWindowXMsgProcIOErrorHandler(Display * pDisplay); - -static int - winRedirectErrorHandler(Display * pDisplay, XErrorEvent * pErr); - static void winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg); #if 0 static void - PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction); + PreserveWin32Stack(WMInfoPtr pWMInfo, xcb_window_t iWindow, UINT direction); #endif static Bool - -CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen, - Bool fAllowOtherWM); +CheckAnotherWindowManager(xcb_connection_t *conn, DWORD dwScreen); static void - winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle); + winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle); void winUpdateWindowPosition(HWND hWnd, HWND * zstyle); @@ -199,15 +178,62 @@ void * Local globals */ -static jmp_buf g_jmpWMEntry; -static XIOErrorHandler g_winMultiWindowWMOldIOErrorHandler; -static pthread_t g_winMultiWindowWMThread; -static jmp_buf g_jmpXMsgProcEntry; -static XIOErrorHandler g_winMultiWindowXMsgProcOldIOErrorHandler; -static pthread_t g_winMultiWindowXMsgProcThread; static Bool g_shutdown = FALSE; -static Bool redirectError = FALSE; -static Bool g_fAnotherWMRunning = FALSE; + +/* + * Translate msg id to text, for debug purposes + */ + +static const char * +MessageName(winWMMessagePtr msg) +{ + switch (msg->msg) + { + case WM_WM_MOVE: + return "WM_WM_MOVE"; + break; + case WM_WM_SIZE: + return "WM_WM_SIZE"; + break; + case WM_WM_RAISE: + return "WM_WM_RAISE"; + break; + case WM_WM_LOWER: + return "WM_WM_LOWER"; + break; + case WM_WM_UNMAP: + return "WM_WM_UNMAP"; + break; + case WM_WM_KILL: + return "WM_WM_KILL"; + break; + case WM_WM_ACTIVATE: + return "WM_WM_ACTIVATE"; + break; + case WM_WM_NAME_EVENT: + return "WM_WM_NAME_EVENT"; + break; + case WM_WM_ICON_EVENT: + return "WM_WM_ICON_EVENT"; + break; + case WM_WM_CHANGE_STATE: + return "WM_WM_CHANGE_STATE"; + break; + case WM_WM_MAP2: + return "WM_WM_MAP2"; + break; + case WM_WM_MAP3: + return "WM_WM_MAP3"; + break; + case WM_WM_HINTS_EVENT: + return "WM_WM_HINTS_EVENT"; + break; + default: + return "Unknown Message"; + break; + } +} + /* * PushMessage - Push a message onto the queue @@ -231,47 +257,6 @@ PushMessage(WMMsgQueuePtr pQueue, WMMsgNodePtr pNode) pQueue->pHead = pNode; } -#if 0 - switch (pNode->msg.msg) { - case WM_WM_MOVE: - ErrorF("\tWM_WM_MOVE\n"); - break; - case WM_WM_SIZE: - ErrorF("\tWM_WM_SIZE\n"); - break; - case WM_WM_RAISE: - ErrorF("\tWM_WM_RAISE\n"); - break; - case WM_WM_LOWER: - ErrorF("\tWM_WM_LOWER\n"); - break; - case WM_WM_MAP: - ErrorF("\tWM_WM_MAP\n"); - break; - case WM_WM_MAP2: - ErrorF("\tWM_WM_MAP2\n"); - break; - case WM_WM_MAP3: - ErrorF("\tWM_WM_MAP3\n"); - break; - case WM_WM_UNMAP: - ErrorF("\tWM_WM_UNMAP\n"); - break; - case WM_WM_KILL: - ErrorF("\tWM_WM_KILL\n"); - break; - case WM_WM_ACTIVATE: - ErrorF("\tWM_WM_ACTIVATE\n"); - break; - default: - ErrorF("\tUnknown Message.\n"); - break; - } -#endif - - /* Increase the count of elements in the queue by one */ - ++(pQueue->nQueueSize); - /* Release the queue mutex */ pthread_mutex_unlock(&pQueue->pmMutex); @@ -279,25 +264,6 @@ PushMessage(WMMsgQueuePtr pQueue, WMMsgNodePtr pNode) pthread_cond_signal(&pQueue->pcNotEmpty); } -#if CYGMULTIWINDOW_DEBUG -/* - * QueueSize - Return the size of the queue - */ - -static int -QueueSize(WMMsgQueuePtr pQueue) -{ - WMMsgNodePtr pNode; - int nSize = 0; - - /* Loop through all elements in the queue */ - for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext) - ++nSize; - - return nSize; -} -#endif - /* * PopMessage - Pop a message from the queue */ @@ -324,13 +290,6 @@ PopMessage(WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo) pQueue->pTail = NULL; } - /* Drop the number of elements in the queue by one */ - --(pQueue->nQueueSize); - -#if CYGMULTIWINDOW_DEBUG - ErrorF("Queue Size %d %d\n", pQueue->nQueueSize, QueueSize(pQueue)); -#endif - /* Release the queue mutex */ pthread_mutex_unlock(&pQueue->pmMutex); @@ -343,7 +302,7 @@ PopMessage(WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo) */ static Bool -HaveMessage(WMMsgQueuePtr pQueue, UINT msg, Window iWindow) +HaveMessage(WMMsgQueuePtr pQueue, UINT msg, xcb_window_t iWindow) { WMMsgNodePtr pNode; @@ -374,14 +333,6 @@ InitQueue(WMMsgQueuePtr pQueue) pQueue->pHead = NULL; pQueue->pTail = NULL; - /* There are no elements initially */ - pQueue->nQueueSize = 0; - -#if CYGMULTIWINDOW_DEBUG - winDebug("InitQueue - Queue Size %d %d\n", pQueue->nQueueSize, - QueueSize(pQueue)); -#endif - winDebug("InitQueue - Calling pthread_mutex_init\n"); /* Create synchronization objects */ @@ -399,29 +350,20 @@ InitQueue(WMMsgQueuePtr pQueue) static char * -Xutf8TextPropertyToString(Display * pDisplay, XTextProperty * xtp) +Xutf8TextPropertyToString(WMInfoPtr pWMInfo, xcb_icccm_get_text_property_reply_t *xtp) { - int nNum; - char **ppList; char *pszReturnData; - if (Xutf8TextPropertyToTextList(pDisplay, xtp, &ppList, &nNum) >= Success && - nNum > 0 && *ppList) { - int i; - int iLen = 0; - - for (i = 0; i < nNum; i++) - iLen += strlen(ppList[i]); - pszReturnData = malloc(iLen + 1); - pszReturnData[0] = '\0'; - for (i = 0; i < nNum; i++) - strcat(pszReturnData, ppList[i]); - if (ppList) - XFreeStringList(ppList); + if ((xtp->encoding == XCB_ATOM_STRING) || // Latin1 ISO 8859-1 + (xtp->encoding == pWMInfo->atmUtf8String)) { // UTF-8 ISO 10646 + pszReturnData = strndup(xtp->name, xtp->name_len); } else { - pszReturnData = malloc(1); - pszReturnData[0] = '\0'; + // Converting from COMPOUND_TEXT to UTF-8 properly is complex to + // implement, and not very much use unless you have an old + // application which isn't UTF-8 aware. + ErrorF("Xutf8TextPropertyToString: text encoding %d is not implemented\n", xtp->encoding); + pszReturnData = strdup(""); } return pszReturnData; @@ -432,51 +374,81 @@ Xutf8TextPropertyToString(Display * pDisplay, XTextProperty * xtp) */ static void -GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName) +GetWindowName(WMInfoPtr pWMInfo, xcb_window_t iWin, char **ppWindowName) { - int nResult; - XTextProperty xtpWindowName; - XTextProperty xtpClientMachine; - char *pszWindowName; - char *pszClientMachine; - char hostname[HOST_NAME_MAX + 1]; + xcb_connection_t *conn = pWMInfo->conn; + char *pszWindowName = NULL; #if CYGMULTIWINDOW_DEBUG ErrorF("GetWindowName\n"); #endif - /* Intialize ppWindowName to NULL */ - *ppWindowName = NULL; + /* Try to get window name from _NET_WM_NAME */ + { + xcb_get_property_cookie_t cookie; + xcb_get_property_reply_t *reply; - /* Try to get window name */ - nResult = XGetWMName(pDisplay, iWin, &xtpWindowName); - if (!nResult || !xtpWindowName.value || !xtpWindowName.nitems) { -#if CYGMULTIWINDOW_DEBUG - ErrorF("GetWindowName - XGetWMName failed. No name.\n"); -#endif - return; + cookie = xcb_get_property(pWMInfo->conn, FALSE, iWin, + pWMInfo->atmNetWmName, + XCB_GET_PROPERTY_TYPE_ANY, 0, INT_MAX); + reply = xcb_get_property_reply(pWMInfo->conn, cookie, NULL); + if (reply && (reply->type != XCB_NONE)) { + pszWindowName = strndup(xcb_get_property_value(reply), + xcb_get_property_value_length(reply)); + free(reply); + } } - pszWindowName = Xutf8TextPropertyToString(pDisplay, &xtpWindowName); - XFree(xtpWindowName.value); + /* Otherwise, try to get window name from WM_NAME */ + if (!pszWindowName) + { + xcb_get_property_cookie_t cookie; + xcb_icccm_get_text_property_reply_t reply; + + cookie = xcb_icccm_get_wm_name(conn, iWin); + if (!xcb_icccm_get_wm_name_reply(conn, cookie, &reply, NULL)) { + ErrorF("GetWindowName - xcb_icccm_get_wm_name_reply failed. No name.\n"); + *ppWindowName = NULL; + return; + } + + pszWindowName = Xutf8TextPropertyToString(pWMInfo, &reply); + xcb_icccm_get_text_property_reply_wipe(&reply); + } + + /* return the window name, unless... */ + *ppWindowName = pszWindowName; if (g_fHostInTitle) { + xcb_get_property_cookie_t cookie; + xcb_icccm_get_text_property_reply_t reply; + /* Try to get client machine name */ - nResult = XGetWMClientMachine(pDisplay, iWin, &xtpClientMachine); - if (nResult && xtpClientMachine.value && xtpClientMachine.nitems) { - pszClientMachine = - Xutf8TextPropertyToString(pDisplay, &xtpClientMachine); - XFree(xtpClientMachine.value); + cookie = xcb_icccm_get_wm_client_machine(conn, iWin); + if (xcb_icccm_get_wm_client_machine_reply(conn, cookie, &reply, NULL)) { + char *pszClientMachine; + char *pszClientHostname; + char *dot; + char hostname[HOST_NAME_MAX + 1]; + + pszClientMachine = Xutf8TextPropertyToString(pWMInfo, &reply); + xcb_icccm_get_text_property_reply_wipe(&reply); + + /* If client machine name looks like a FQDN, find the hostname */ + pszClientHostname = strdup(pszClientMachine); + dot = strchr(pszClientHostname, '.'); + if (dot) + *dot = '\0'; /* - If we have a client machine name - and it's not the local host name + If we have a client machine hostname + and it's not the local hostname and it's not already in the window title... */ - if (strlen(pszClientMachine) && + if (strlen(pszClientHostname) && !gethostname(hostname, HOST_NAME_MAX + 1) && - strcmp(hostname, pszClientMachine) && - (strstr(pszWindowName, pszClientMachine) == 0)) { + strcmp(hostname, pszClientHostname) && + (strstr(pszWindowName, pszClientHostname) == 0)) { /* ... add '@' to end of window name */ *ppWindowName = malloc(strlen(pszWindowName) + @@ -486,15 +458,12 @@ GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName) strcat(*ppWindowName, pszClientMachine); free(pszWindowName); - free(pszClientMachine); - - return; } + + free(pszClientMachine); + free(pszClientHostname); } } - - /* otherwise just return the window name */ - *ppWindowName = pszWindowName; } /* @@ -502,17 +471,21 @@ GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName) */ static Bool -IsWmProtocolAvailable(Display * pDisplay, Window iWindow, Atom atmProtocol) +IsWmProtocolAvailable(WMInfoPtr pWMInfo, xcb_window_t iWindow, xcb_atom_t atmProtocol) { - int i, n, found = 0; - Atom *protocols; + int i, found = 0; + xcb_get_property_cookie_t cookie; + xcb_icccm_get_wm_protocols_reply_t reply; + xcb_connection_t *conn = pWMInfo->conn; - if (XGetWMProtocols(pDisplay, iWindow, &protocols, &n)) { - for (i = 0; i < n; ++i) - if (protocols[i] == atmProtocol) - ++found; - - XFree(protocols); + cookie = xcb_icccm_get_wm_protocols(conn, iWindow, pWMInfo->ewmh.WM_PROTOCOLS); + if (xcb_icccm_get_wm_protocols_reply(conn, cookie, &reply, NULL)) { + for (i = 0; i < reply.atoms_len; ++i) + if (reply.atoms[i] == atmProtocol) { + ++found; + break; + } + xcb_icccm_get_wm_protocols_reply_wipe(&reply); } return found > 0; @@ -522,49 +495,46 @@ IsWmProtocolAvailable(Display * pDisplay, Window iWindow, Atom atmProtocol) * Send a message to the X server from the WM thread */ -static int -SendXMessage(Display * pDisplay, Window iWin, Atom atmType, long nData) +static void +SendXMessage(xcb_connection_t *conn, xcb_window_t iWin, xcb_atom_t atmType, long nData) { - XEvent e; + xcb_client_message_event_t e; /* Prepare the X event structure */ - e.type = ClientMessage; - e.xclient.window = iWin; - e.xclient.message_type = atmType; - e.xclient.format = 32; - e.xclient.data.l[0] = nData; - e.xclient.data.l[1] = CurrentTime; + memset(&e, 0, sizeof(e)); + e.response_type = XCB_CLIENT_MESSAGE; + e.window = iWin; + e.type = atmType; + e.format = 32; + e.data.data32[0] = nData; + e.data.data32[1] = XCB_CURRENT_TIME; /* Send the event to X */ - return XSendEvent(pDisplay, iWin, False, NoEventMask, &e); + xcb_send_event(conn, FALSE, iWin, XCB_EVENT_MASK_NO_EVENT, (const char *)&e); } /* * See if we can get the stored HWND for this window... */ static HWND -getHwnd(WMInfoPtr pWMInfo, Window iWindow) +getHwnd(WMInfoPtr pWMInfo, xcb_window_t iWindow) { - Atom atmType; - int fmtRet; - unsigned long items, remain; - HWND *retHwnd, hWnd = NULL; + HWND hWnd = NULL; + xcb_get_property_cookie_t cookie; + xcb_get_property_reply_t *reply; - if (XGetWindowProperty(pWMInfo->pDisplay, - iWindow, - pWMInfo->atmPrivMap, - 0, - sizeof(HWND)/4, - False, - XA_INTEGER, - &atmType, - &fmtRet, - &items, - &remain, (unsigned char **) &retHwnd) == Success) { - if (retHwnd) { - hWnd = *retHwnd; - XFree(retHwnd); + cookie = xcb_get_property(pWMInfo->conn, FALSE, iWindow, pWMInfo->atmPrivMap, + XCB_ATOM_INTEGER, 0L, sizeof(HWND)/4L); + reply = xcb_get_property_reply(pWMInfo->conn, cookie, NULL); + + if (reply) { + int length = xcb_get_property_value_length(reply); + HWND *value = xcb_get_property_value(reply); + + if (value && (length == sizeof(HWND))) { + hWnd = *value; } + free(reply); } /* Some sanity checks */ @@ -576,27 +546,82 @@ getHwnd(WMInfoPtr pWMInfo, Window iWindow) return hWnd; } +/* + * Helper function to check for override-redirect + */ +static Bool +IsOverrideRedirect(xcb_connection_t *conn, xcb_window_t iWin) +{ + Bool result = FALSE; + xcb_get_window_attributes_reply_t *reply; + xcb_get_window_attributes_cookie_t cookie; + + cookie = xcb_get_window_attributes(conn, iWin); + reply = xcb_get_window_attributes_reply(conn, cookie, NULL); + if (reply) { + result = (reply->override_redirect != 0); + free(reply); + } + else { + ErrorF("IsOverrideRedirect: Failed to get window attributes\n"); + } + + return result; +} + +/* + * Helper function to get class and window names +*/ +static void +GetClassNames(WMInfoPtr pWMInfo, xcb_window_t iWindow, char **res_name, + char **res_class, char **window_name) +{ + xcb_get_property_cookie_t cookie1; + xcb_icccm_get_wm_class_reply_t reply1; + xcb_get_property_cookie_t cookie2; + xcb_icccm_get_text_property_reply_t reply2; + + cookie1 = xcb_icccm_get_wm_class(pWMInfo->conn, iWindow); + if (xcb_icccm_get_wm_class_reply(pWMInfo->conn, cookie1, &reply1, + NULL)) { + *res_name = strdup(reply1.instance_name); + *res_class = strdup(reply1.class_name); + xcb_icccm_get_wm_class_reply_wipe(&reply1); + } + else { + *res_name = strdup(""); + *res_class = strdup(""); + } + + cookie2 = xcb_icccm_get_wm_name(pWMInfo->conn, iWindow); + if (xcb_icccm_get_wm_name_reply(pWMInfo->conn, cookie2, &reply2, NULL)) { + *window_name = strndup(reply2.name, reply2.name_len); + xcb_icccm_get_text_property_reply_wipe(&reply2); + } + else { + *window_name = strdup(""); + } +} + /* * Updates the name of a HWND according to its X WM_NAME property */ static void -UpdateName(WMInfoPtr pWMInfo, Window iWindow) +UpdateName(WMInfoPtr pWMInfo, xcb_window_t iWindow) { HWND hWnd; - XWindowAttributes attr; hWnd = getHwnd(pWMInfo, iWindow); if (!hWnd) return; /* If window isn't override-redirect */ - XGetWindowAttributes(pWMInfo->pDisplay, iWindow, &attr); - if (!attr.override_redirect) { + if (!IsOverrideRedirect(pWMInfo->conn, iWindow)) { char *pszWindowName; /* Get the X windows window name */ - GetWindowName(pWMInfo->pDisplay, iWindow, &pszWindowName); + GetWindowName(pWMInfo, iWindow, &pszWindowName); if (pszWindowName) { /* Convert from UTF-8 to wide char */ @@ -621,39 +646,30 @@ UpdateName(WMInfoPtr pWMInfo, Window iWindow) */ static void -UpdateIcon(WMInfoPtr pWMInfo, Window iWindow) +UpdateIcon(WMInfoPtr pWMInfo, xcb_window_t iWindow) { HWND hWnd; HICON hIconNew = NULL; - XWindowAttributes attr; hWnd = getHwnd(pWMInfo, iWindow); if (!hWnd) return; /* If window isn't override-redirect */ - XGetWindowAttributes(pWMInfo->pDisplay, iWindow, &attr); - if (!attr.override_redirect) { - XClassHint class_hint = { 0, 0 }; + if (!IsOverrideRedirect(pWMInfo->conn, iWindow)) { char *window_name = 0; + char *res_name = 0; + char *res_class = 0; - if (XGetClassHint(pWMInfo->pDisplay, iWindow, &class_hint)) { - XFetchName(pWMInfo->pDisplay, iWindow, &window_name); + GetClassNames(pWMInfo, iWindow, &res_name, &res_class, &window_name); - hIconNew = - (HICON) winOverrideIcon(class_hint.res_name, - class_hint.res_class, window_name); + hIconNew = winOverrideIcon(res_name, res_class, window_name); - if (class_hint.res_name) - XFree(class_hint.res_name); - if (class_hint.res_class) - XFree(class_hint.res_class); - if (window_name) - XFree(window_name); - } + free(res_name); + free(res_class); + free(window_name); + winUpdateIcon(hWnd, pWMInfo->conn, iWindow, hIconNew); } - - winUpdateIcon(hWnd, pWMInfo->pDisplay, iWindow, hIconNew); } /* @@ -661,7 +677,7 @@ UpdateIcon(WMInfoPtr pWMInfo, Window iWindow) */ static void -UpdateStyle(WMInfoPtr pWMInfo, Window iWindow) +UpdateStyle(WMInfoPtr pWMInfo, xcb_window_t iWindow) { HWND hWnd; HWND zstyle = HWND_NOTOPMOST; @@ -672,7 +688,7 @@ UpdateStyle(WMInfoPtr pWMInfo, Window iWindow) return; /* Determine the Window style, which determines borders and clipping region... */ - winApplyHints(pWMInfo->pDisplay, iWindow, hWnd, &zstyle); + winApplyHints(pWMInfo, iWindow, hWnd, &zstyle); winUpdateWindowPosition(hWnd, &zstyle); /* Apply the updated window style, without changing it's show or activation state */ @@ -695,17 +711,36 @@ UpdateStyle(WMInfoPtr pWMInfo, Window iWindow) WS_EX_APPWINDOW) ? TRUE : FALSE); } +/* + * Updates the state of a HWND + * (only minimization supported at the moment) + */ + +static void +UpdateState(WMInfoPtr pWMInfo, xcb_window_t iWindow) +{ + HWND hWnd; + + winDebug("UpdateState: iWindow 0x%08x\n", (int)iWindow); + + hWnd = getHwnd(pWMInfo, iWindow); + if (!hWnd) + return; + + ShowWindow(hWnd, SW_MINIMIZE); +} + #if 0 /* * Fix up any differences between the X11 and Win32 window stacks * starting at the window passed in */ static void -PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction) +PreserveWin32Stack(WMInfoPtr pWMInfo, xcb_window_t iWindow, UINT direction) { HWND hWnd; DWORD myWinProcID, winProcID; - Window xWindow; + xcb_window_t xWindow; WINDOWPLACEMENT wndPlace; hWnd = getHwnd(pWMInfo, iWindow); @@ -757,11 +792,6 @@ winMultiWindowWMProc(void *pArg) for (;;) { WMMsgNodePtr pNode; - if (g_fAnotherWMRunning) { /* Another Window manager exists. */ - Sleep(1000); - continue; - } - /* Pop a message off of our queue */ pNode = PopMessage(&pWMInfo->wmMsgQueue, pWMInfo); if (pNode == NULL) { @@ -772,74 +802,58 @@ winMultiWindowWMProc(void *pArg) } #if CYGMULTIWINDOW_DEBUG - ErrorF("winMultiWindowWMProc - MSG: %d ID: %d\n", - (int) pNode->msg.msg, (int) pNode->msg.dwID); + ErrorF("winMultiWindowWMProc - MSG: %s (%d) ID: %d\n", + MessageName(&(pNode->msg)), (int)pNode->msg.msg, (int)pNode->msg.dwID); #endif /* Branch on the message type */ switch (pNode->msg.msg) { #if 0 case WM_WM_MOVE: - ErrorF("\tWM_WM_MOVE\n"); break; case WM_WM_SIZE: - ErrorF("\tWM_WM_SIZE\n"); break; #endif case WM_WM_RAISE: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_RAISE\n"); -#endif /* Raise the window */ - XRaiseWindow(pWMInfo->pDisplay, pNode->msg.iWindow); + { + const static uint32_t values[] = { XCB_STACK_MODE_ABOVE }; + xcb_configure_window(pWMInfo->conn, pNode->msg.iWindow, + XCB_CONFIG_WINDOW_STACK_MODE, values); + } + #if 0 PreserveWin32Stack(pWMInfo, pNode->msg.iWindow, GW_HWNDPREV); #endif break; case WM_WM_LOWER: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_LOWER\n"); -#endif - /* Lower the window */ - XLowerWindow(pWMInfo->pDisplay, pNode->msg.iWindow); - break; - - case WM_WM_MAP: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_MAP\n"); -#endif - /* Put a note as to the HWND associated with this Window */ - XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER, - 32, - PropModeReplace, - (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4); - UpdateName(pWMInfo, pNode->msg.iWindow); - UpdateIcon(pWMInfo, pNode->msg.iWindow); + { + const static uint32_t values[] = { XCB_STACK_MODE_BELOW }; + xcb_configure_window(pWMInfo->conn, pNode->msg.iWindow, + XCB_CONFIG_WINDOW_STACK_MODE, values); + } break; case WM_WM_MAP2: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_MAP2\n"); -#endif - XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER, - 32, - PropModeReplace, - (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4); + /* Put a note as to the HWND associated with this Window */ + xcb_change_property(pWMInfo->conn, XCB_PROP_MODE_REPLACE, + pNode->msg.iWindow, pWMInfo->atmPrivMap, + XCB_ATOM_INTEGER, 32, + sizeof(HWND)/4, &(pNode->msg.hwndWindow)); + break; case WM_WM_MAP3: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_MAP3\n"); -#endif /* Put a note as to the HWND associated with this Window */ - XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER, - 32, - PropModeReplace, - (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4); + xcb_change_property(pWMInfo->conn, XCB_PROP_MODE_REPLACE, + pNode->msg.iWindow, pWMInfo->atmPrivMap, + XCB_ATOM_INTEGER, 32, + sizeof(HWND)/4, &(pNode->msg.hwndWindow)); + UpdateName(pWMInfo, pNode->msg.iWindow); UpdateIcon(pWMInfo, pNode->msg.iWindow); UpdateStyle(pWMInfo, pNode->msg.iWindow); @@ -858,35 +872,26 @@ winMultiWindowWMProc(void *pArg) break; case WM_WM_UNMAP: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_UNMAP\n"); -#endif /* Unmap the window */ - XUnmapWindow(pWMInfo->pDisplay, pNode->msg.iWindow); + xcb_unmap_window(pWMInfo->conn, pNode->msg.iWindow); break; case WM_WM_KILL: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_KILL\n"); -#endif { /* --- */ - if (IsWmProtocolAvailable(pWMInfo->pDisplay, + if (IsWmProtocolAvailable(pWMInfo, pNode->msg.iWindow, pWMInfo->atmWmDelete)) - SendXMessage(pWMInfo->pDisplay, + SendXMessage(pWMInfo->conn, pNode->msg.iWindow, pWMInfo->atmWmProtos, pWMInfo->atmWmDelete); else - XKillClient(pWMInfo->pDisplay, pNode->msg.iWindow); + xcb_kill_client(pWMInfo->conn, pNode->msg.iWindow); } break; case WM_WM_ACTIVATE: -#if CYGMULTIWINDOW_DEBUG - ErrorF("\tWM_WM_ACTIVATE\n"); -#endif /* Set the input focus */ /* @@ -899,23 +904,24 @@ winMultiWindowWMProc(void *pArg) */ { Bool neverFocus = FALSE; - XWMHints *hints = XGetWMHints(pWMInfo->pDisplay, pNode->msg.iWindow); + xcb_get_property_cookie_t cookie; + xcb_icccm_wm_hints_t hints; - if (hints) { - if (hints->flags & InputHint) - neverFocus = !hints->input; - XFree(hints); + cookie = xcb_icccm_get_wm_hints(pWMInfo->conn, pNode->msg.iWindow); + if (xcb_icccm_get_wm_hints_reply(pWMInfo->conn, cookie, &hints, + NULL)) { + if (hints.flags & XCB_ICCCM_WM_HINT_INPUT) + neverFocus = !hints.input; } if (!neverFocus) - XSetInputFocus(pWMInfo->pDisplay, - pNode->msg.iWindow, - RevertToPointerRoot, CurrentTime); + xcb_set_input_focus(pWMInfo->conn, XCB_INPUT_FOCUS_POINTER_ROOT, + pNode->msg.iWindow, XCB_CURRENT_TIME); - if (IsWmProtocolAvailable(pWMInfo->pDisplay, + if (IsWmProtocolAvailable(pWMInfo, pNode->msg.iWindow, pWMInfo->atmWmTakeFocus)) - SendXMessage(pWMInfo->pDisplay, + SendXMessage(pWMInfo->conn, pNode->msg.iWindow, pWMInfo->atmWmProtos, pWMInfo->atmWmTakeFocus); @@ -932,11 +938,8 @@ winMultiWindowWMProc(void *pArg) case WM_WM_HINTS_EVENT: { - XWindowAttributes attr; - /* Don't do anything if this is an override-redirect window */ - XGetWindowAttributes (pWMInfo->pDisplay, pNode->msg.iWindow, &attr); - if (attr.override_redirect) + if (IsOverrideRedirect(pWMInfo->conn, pNode->msg.iWindow)) break; UpdateStyle(pWMInfo, pNode->msg.iWindow); @@ -944,8 +947,7 @@ winMultiWindowWMProc(void *pArg) break; case WM_WM_CHANGE_STATE: - /* Minimize the window in Windows */ - winMinimizeWindow(pNode->msg.iWindow); + UpdateState(pWMInfo, pNode->msg.iWindow); break; default: @@ -958,7 +960,30 @@ winMultiWindowWMProc(void *pArg) free(pNode); /* Flush any pending events on our display */ - XFlush(pWMInfo->pDisplay); + xcb_flush(pWMInfo->conn); + + /* This is just laziness rather than making sure we used _checked everywhere */ + { + xcb_generic_event_t *event = xcb_poll_for_event(pWMInfo->conn); + if (event) { + if ((event->response_type & ~0x80) == 0) { + xcb_generic_error_t *err = (xcb_generic_error_t *)event; + ErrorF("winMultiWindowWMProc - Error code: %i, ID: 0x%08x, " + "Major opcode: %i, Minor opcode: %i\n", + err->error_code, err->resource_id, + err->major_code, err->minor_code); + } + } + } + + /* I/O errors etc. */ + { + int e = xcb_connection_has_error(pWMInfo->conn); + if (e) { + ErrorF("winMultiWindowWMProc - Fatal error %d on xcb connection\n", e); + break; + } + } } /* Free the condition variable */ @@ -976,6 +1001,22 @@ winMultiWindowWMProc(void *pArg) return NULL; } +static xcb_atom_t +intern_atom(xcb_connection_t *conn, const char *atomName) +{ + xcb_intern_atom_reply_t *atom_reply; + xcb_intern_atom_cookie_t atom_cookie; + xcb_atom_t atom = XCB_ATOM_NONE; + + atom_cookie = xcb_intern_atom(conn, 0, strlen(atomName), atomName); + atom_reply = xcb_intern_atom_reply(conn, atom_cookie, NULL); + if (atom_reply) { + atom = atom_reply->atom; + free(atom_reply); + } + return atom; +} + /* * X message procedure */ @@ -987,14 +1028,14 @@ winMultiWindowXMsgProc(void *pArg) XMsgProcArgPtr pProcArg = (XMsgProcArgPtr) pArg; char pszDisplay[512]; int iRetries; - XEvent event; - Atom atmWmName; - Atom atmWmHints; - Atom atmWmChange; - Atom atmNetWmIcon; - Atom atmWindowState, atmMotifWmHints, atmWindowType, atmNormalHints; + xcb_atom_t atmWmName; + xcb_atom_t atmNetWmName; + xcb_atom_t atmWmHints; + xcb_atom_t atmWmChange; + xcb_atom_t atmNetWmIcon; + xcb_atom_t atmWindowState, atmMotifWmHints, atmWindowType, atmNormalHints; int iReturn; - XIconSize *xis; + xcb_auth_info_t *auth_info; winDebug("winMultiWindowXMsgProc - Hello\n"); @@ -1004,7 +1045,7 @@ winMultiWindowXMsgProc(void *pArg) pthread_exit(NULL); } - ErrorF("winMultiWindowXMsgProc - Calling pthread_mutex_lock ()\n"); + winDebug("winMultiWindowXMsgProc - Calling pthread_mutex_lock ()\n"); /* Grab the server started mutex - pause until we get it */ iReturn = pthread_mutex_lock(pProcArg->ppmServerStarted); @@ -1014,44 +1055,12 @@ winMultiWindowXMsgProc(void *pArg) pthread_exit(NULL); } - ErrorF("winMultiWindowXMsgProc - pthread_mutex_lock () returned.\n"); - - /* Allow multiple threads to access Xlib */ - if (XInitThreads() == 0) { - ErrorF("winMultiWindowXMsgProc - XInitThreads () failed. Exiting.\n"); - pthread_exit(NULL); - } - - /* See if X supports the current locale */ - if (XSupportsLocale() == False) { - ErrorF("winMultiWindowXMsgProc - Warning: locale not supported by X\n"); - } + winDebug("winMultiWindowXMsgProc - pthread_mutex_lock () returned.\n"); /* Release the server started mutex */ pthread_mutex_unlock(pProcArg->ppmServerStarted); - ErrorF("winMultiWindowXMsgProc - pthread_mutex_unlock () returned.\n"); - - /* Install our error handler */ - XSetErrorHandler(winMultiWindowXMsgProcErrorHandler); - g_winMultiWindowXMsgProcThread = pthread_self(); - g_winMultiWindowXMsgProcOldIOErrorHandler = - XSetIOErrorHandler(winMultiWindowXMsgProcIOErrorHandler); - - /* Set jump point for IO Error exits */ - iReturn = setjmp(g_jmpXMsgProcEntry); - - /* Check if we should continue operations */ - if (iReturn != WIN_JMP_ERROR_IO && iReturn != WIN_JMP_OKAY) { - /* setjmp returned an unknown value, exit */ - ErrorF("winInitMultiWindowXMsgProc - setjmp returned: %d. Exiting.\n", - iReturn); - pthread_exit(NULL); - } - else if (iReturn == WIN_JMP_ERROR_IO) { - ErrorF("winInitMultiWindowXMsgProc - Caught IO Error. Exiting.\n"); - pthread_exit(NULL); - } + winDebug("winMultiWindowXMsgProc - pthread_mutex_unlock () returned.\n"); /* Setup the display connection string x */ winGetDisplayName(pszDisplay, (int) pProcArg->dwScreen); @@ -1060,7 +1069,7 @@ winMultiWindowXMsgProc(void *pArg) ErrorF("winMultiWindowXMsgProc - DISPLAY=%s\n", pszDisplay); /* Use our generated cookie for authentication */ - winSetAuthorization(); + auth_info = winGetXcbAuthInfo(); /* Initialize retry count */ iRetries = 0; @@ -1068,8 +1077,9 @@ winMultiWindowXMsgProc(void *pArg) /* Open the X display */ do { /* Try to open the display */ - pProcArg->pDisplay = XOpenDisplay(pszDisplay); - if (pProcArg->pDisplay == NULL) { + pProcArg->conn = xcb_connect_to_display_with_auth_info(pszDisplay, + auth_info, NULL); + if (xcb_connection_has_error(pProcArg->conn)) { ErrorF("winMultiWindowXMsgProc - Could not open display, try: %d, " "sleeping: %d\n", iRetries + 1, WIN_CONNECT_DELAY); ++iRetries; @@ -1079,49 +1089,56 @@ winMultiWindowXMsgProc(void *pArg) else break; } - while (pProcArg->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES); + while (xcb_connection_has_error(pProcArg->conn) && iRetries < WIN_CONNECT_RETRIES); /* Make sure that the display opened */ - if (pProcArg->pDisplay == NULL) { + if (xcb_connection_has_error(pProcArg->conn)) { ErrorF("winMultiWindowXMsgProc - Failed opening the display. " "Exiting.\n"); pthread_exit(NULL); } - ErrorF("winMultiWindowXMsgProc - XOpenDisplay () returned and " + ErrorF("winMultiWindowXMsgProc - xcb_connect() returned and " "successfully opened the display.\n"); /* Check if another window manager is already running */ - g_fAnotherWMRunning = - CheckAnotherWindowManager(pProcArg->pDisplay, pProcArg->dwScreen, - pProcArg->pWMInfo->fAllowOtherWM); - - if (g_fAnotherWMRunning && !pProcArg->pWMInfo->fAllowOtherWM) { + if (CheckAnotherWindowManager(pProcArg->conn, pProcArg->dwScreen)) { ErrorF("winMultiWindowXMsgProc - " "another window manager is running. Exiting.\n"); pthread_exit(NULL); } - /* Set up the supported icon sizes */ - xis = XAllocIconSize(); - if (xis) { - xis->min_width = xis->min_height = 16; - xis->max_width = xis->max_height = 48; - xis->width_inc = xis->height_inc = 16; - XSetIconSizes(pProcArg->pDisplay, - RootWindow(pProcArg->pDisplay, pProcArg->dwScreen), - xis, 1); - XFree(xis); + { + /* Get root window id */ + xcb_screen_t *root_screen = xcb_aux_get_screen(pProcArg->conn, pProcArg->dwScreen); + xcb_window_t root_window_id = root_screen->root; + + /* Set WM_ICON_SIZE property indicating desired icon sizes */ + typedef struct { + uint32_t min_width, min_height; + uint32_t max_width, max_height; + int32_t width_inc, height_inc; + } xcb_wm_icon_size_hints_hints_t; + + xcb_wm_icon_size_hints_hints_t xis; + xis.min_width = xis.min_height = 16; + xis.max_width = xis.max_height = 48; + xis.width_inc = xis.height_inc = 16; + + xcb_change_property(pProcArg->conn, XCB_PROP_MODE_REPLACE, root_window_id, + XCB_ATOM_WM_ICON_SIZE, XCB_ATOM_WM_ICON_SIZE, 32, + sizeof(xis)/4, &xis); } - atmWmName = XInternAtom(pProcArg->pDisplay, "WM_NAME", False); - atmWmHints = XInternAtom(pProcArg->pDisplay, "WM_HINTS", False); - atmWmChange = XInternAtom(pProcArg->pDisplay, "WM_CHANGE_STATE", False); - atmNetWmIcon = XInternAtom(pProcArg->pDisplay, "_NET_WM_ICON", False); - atmWindowState = XInternAtom(pProcArg->pDisplay, "_NET_WM_STATE", False); - atmMotifWmHints = XInternAtom(pProcArg->pDisplay, "_MOTIF_WM_HINTS", False); - atmWindowType = XInternAtom(pProcArg->pDisplay, "_NET_WM_WINDOW_TYPE", False); - atmNormalHints = XInternAtom(pProcArg->pDisplay, "WM_NORMAL_HINTS", False); + atmWmName = intern_atom(pProcArg->conn, "WM_NAME"); + atmNetWmName = intern_atom(pProcArg->conn, "_NET_WM_NAME"); + atmWmHints = intern_atom(pProcArg->conn, "WM_HINTS"); + atmWmChange = intern_atom(pProcArg->conn, "WM_CHANGE_STATE"); + atmNetWmIcon = intern_atom(pProcArg->conn, "_NET_WM_ICON"); + atmWindowState = intern_atom(pProcArg->conn, "_NET_WM_STATE"); + atmMotifWmHints = intern_atom(pProcArg->conn, "_MOTIF_WM_HINTS"); + atmWindowType = intern_atom(pProcArg->conn, "_NET_WM_WINDOW_TYPE"); + atmNormalHints = intern_atom(pProcArg->conn, "WM_NORMAL_HINTS"); /* iiimxcf had a bug until 2009-04-27, assuming that the @@ -1131,50 +1148,54 @@ winMultiWindowXMsgProc(void *pArg) Since this is on in the default Solaris 10 install, workaround this by making sure it does exist... */ - XInternAtom(pProcArg->pDisplay, "WM_STATE", 0); + intern_atom(pProcArg->conn, "WM_STATE"); /* Loop until we explicitly break out */ while (1) { + xcb_generic_event_t *event; + uint8_t type; + Bool send_event; + if (g_shutdown) break; - if (pProcArg->pWMInfo->fAllowOtherWM && !XPending(pProcArg->pDisplay)) { - if (CheckAnotherWindowManager - (pProcArg->pDisplay, pProcArg->dwScreen, TRUE)) { - if (!g_fAnotherWMRunning) { - g_fAnotherWMRunning = TRUE; - SendMessage(pProcArg->hwndScreen, WM_UNMANAGE, 0, 0); - } - } - else { - if (g_fAnotherWMRunning) { - g_fAnotherWMRunning = FALSE; - SendMessage(pProcArg->hwndScreen, WM_MANAGE, 0, 0); - } - } - Sleep(500); - continue; + /* Fetch next event */ + event = xcb_wait_for_event(pProcArg->conn); + if (!event) { // returns NULL on I/O error + int e = xcb_connection_has_error(pProcArg->conn); + ErrorF("winMultiWindowXMsgProc - Fatal error %d on xcb connection\n", e); + break; } - /* Fetch next event */ - XNextEvent(pProcArg->pDisplay, &event); + type = event->response_type & ~0x80; + send_event = event->response_type & 0x80; + + winDebug("winMultiWindowXMsgProc - event %d\n", type); /* Branch on event type */ - if (event.type == CreateNotify) { - XWindowAttributes attr; + if (type == 0) { + xcb_generic_error_t *err = (xcb_generic_error_t *)event; + ErrorF("winMultiWindowXMsgProc - Error code: %i, ID: 0x%08x, " + "Major opcode: %i, Minor opcode: %i\n", + err->error_code, err->resource_id, + err->major_code, err->minor_code); + } + else if (type == XCB_CREATE_NOTIFY) { + xcb_create_notify_event_t *notify = (xcb_create_notify_event_t *)event; - XSelectInput(pProcArg->pDisplay, - event.xcreatewindow.window, PropertyChangeMask); + /* Request property change events */ + const static uint32_t mask_value[] = { XCB_EVENT_MASK_PROPERTY_CHANGE }; + xcb_change_window_attributes (pProcArg->conn, notify->window, + XCB_CW_EVENT_MASK, mask_value); - /* Get the window attributes */ - XGetWindowAttributes(pProcArg->pDisplay, - event.xcreatewindow.window, &attr); - - if (!attr.override_redirect) - XSetWindowBorderWidth(pProcArg->pDisplay, - event.xcreatewindow.window, 0); + /* If it's not override-redirect, set the border-width to 0 */ + if (!IsOverrideRedirect(pProcArg->conn, notify->window)) { + const static uint32_t width_value[] = { 0 }; + xcb_configure_window(pProcArg->conn, notify->window, + XCB_CONFIG_WINDOW_BORDER_WIDTH, width_value); + } } - else if (event.type == MapNotify) { + else if (type == XCB_MAP_NOTIFY) { /* Fake a reparentNotify event as SWT/Motif expects a Window Manager to reparent a top-level window when it is mapped and waits until they do. @@ -1190,43 +1211,44 @@ winMultiWindowXMsgProc(void *pArg) See sourceware bugzilla #9848 */ - XWindowAttributes attr; - Window root; - Window parent; - Window *children; - unsigned int nchildren; + xcb_map_notify_event_t *notify = (xcb_map_notify_event_t *)event; - if (XGetWindowAttributes(event.xmap.display, - event.xmap.window, - &attr) && - XQueryTree(event.xmap.display, - event.xmap.window, - &root, &parent, &children, &nchildren)) { - if (children) - XFree(children); + xcb_get_geometry_cookie_t cookie; + xcb_get_geometry_reply_t *reply; + xcb_query_tree_cookie_t cookie_qt; + xcb_query_tree_reply_t *reply_qt; + cookie = xcb_get_geometry(pProcArg->conn, notify->window); + cookie_qt = xcb_query_tree(pProcArg->conn, notify->window); + reply = xcb_get_geometry_reply(pProcArg->conn, cookie, NULL); + reply_qt = xcb_query_tree_reply(pProcArg->conn, cookie_qt, NULL); + + if (reply && reply_qt) { /* It's a top-level window if the parent window is a root window Only non-override_redirect windows can get reparented */ - if ((attr.root == parent) && !event.xmap.override_redirect) { - XEvent event_send; + if ((reply->root == reply_qt->parent) && !notify->override_redirect) { + xcb_reparent_notify_event_t event_send; - event_send.type = ReparentNotify; - event_send.xreparent.event = event.xmap.window; - event_send.xreparent.window = event.xmap.window; - event_send.xreparent.parent = parent; - event_send.xreparent.x = attr.x; - event_send.xreparent.y = attr.y; + event_send.response_type = ReparentNotify; + event_send.event = notify->window; + event_send.window = notify->window; + event_send.parent = reply_qt->parent; + event_send.x = reply->x; + event_send.y = reply->y; - XSendEvent(event.xmap.display, - event.xmap.window, - True, StructureNotifyMask, &event_send); + xcb_send_event (pProcArg->conn, TRUE, notify->window, + XCB_EVENT_MASK_STRUCTURE_NOTIFY, + (const char *)&event_send); + + free(reply_qt); + free(reply); } } } - else if (event.type == ConfigureNotify) { - if (!event.xconfigure.send_event) { + else if (type == XCB_CONFIGURE_NOTIFY) { + if (!send_event) { /* Java applications using AWT on JRE 1.6.0 break with non-reparenting WMs AWT doesn't explicitly know about (See sun bug #6434227) @@ -1238,21 +1260,25 @@ winMultiWindowXMsgProc(void *pArg) Rather than tell all sorts of lies to get XWM to recognize us as one of those, simply send a synthetic ConfigureNotify for every non-synthetic one */ - XEvent event_send = event; + xcb_configure_notify_event_t *notify = (xcb_configure_notify_event_t *)event; + xcb_configure_notify_event_t event_send = *notify; - event_send.xconfigure.send_event = TRUE; - event_send.xconfigure.event = event.xconfigure.window; - XSendEvent(event.xconfigure.display, - event.xconfigure.window, - True, StructureNotifyMask, &event_send); + event_send.event = notify->window; + + xcb_send_event(pProcArg->conn, TRUE, notify->window, + XCB_EVENT_MASK_STRUCTURE_NOTIFY, + (const char *)&event_send); } } - else if (event.type == PropertyNotify) { - if (event.xproperty.atom == atmWmName) { + else if (type == XCB_PROPERTY_NOTIFY) { + xcb_property_notify_event_t *notify = (xcb_property_notify_event_t *)event; + + if ((notify->atom == atmWmName) || + (notify->atom == atmNetWmName)) { memset(&msg, 0, sizeof(msg)); msg.msg = WM_WM_NAME_EVENT; - msg.iWindow = event.xproperty.window; + msg.iWindow = notify->window; /* Other fields ignored */ winSendMessageToWM(pProcArg->pWMInfo, &msg); @@ -1262,46 +1288,52 @@ winMultiWindowXMsgProc(void *pArg) Several properties are considered for WM hints, check if this property change affects any of them... (this list needs to be kept in sync with winApplyHints()) */ - if ((event.xproperty.atom == atmWmHints) || - (event.xproperty.atom == atmWindowState) || - (event.xproperty.atom == atmMotifWmHints) || - (event.xproperty.atom == atmWindowType) || - (event.xproperty.atom == atmNormalHints)) { + if ((notify->atom == atmWmHints) || + (notify->atom == atmWindowState) || + (notify->atom == atmMotifWmHints) || + (notify->atom == atmWindowType) || + (notify->atom == atmNormalHints)) { memset(&msg, 0, sizeof(msg)); msg.msg = WM_WM_HINTS_EVENT; - msg.iWindow = event.xproperty.window; + msg.iWindow = notify->window; /* Other fields ignored */ winSendMessageToWM(pProcArg->pWMInfo, &msg); } /* Not an else as WM_HINTS affects both style and icon */ - if ((event.xproperty.atom == atmWmHints) || - (event.xproperty.atom == atmNetWmIcon)) { + if ((notify->atom == atmWmHints) || + (notify->atom == atmNetWmIcon)) { memset(&msg, 0, sizeof(msg)); msg.msg = WM_WM_ICON_EVENT; - msg.iWindow = event.xproperty.window; + msg.iWindow = notify->window; /* Other fields ignored */ winSendMessageToWM(pProcArg->pWMInfo, &msg); } } } - else if (event.type == ClientMessage - && event.xclient.message_type == atmWmChange - && event.xclient.data.l[0] == IconicState) { - ErrorF("winMultiWindowXMsgProc - WM_CHANGE_STATE - IconicState\n"); + else if (type == XCB_CLIENT_MESSAGE) { + xcb_client_message_event_t *client_msg = (xcb_client_message_event_t *)event; - memset(&msg, 0, sizeof(msg)); + if (client_msg->type == atmWmChange + && client_msg->data.data32[0] == XCB_ICCCM_WM_STATE_ICONIC) { + ErrorF("winMultiWindowXMsgProc - WM_CHANGE_STATE - IconicState\n"); - msg.msg = WM_WM_CHANGE_STATE; - msg.iWindow = event.xclient.window; + memset(&msg, 0, sizeof(msg)); - winSendMessageToWM(pProcArg->pWMInfo, &msg); + msg.msg = WM_WM_CHANGE_STATE; + msg.iWindow = client_msg->window; + + winSendMessageToWM(pProcArg->pWMInfo, &msg); + } } + + /* Free the event */ + free(event); } - XCloseDisplay(pProcArg->pDisplay); + xcb_disconnect(pProcArg->conn); pthread_exit(NULL); return NULL; } @@ -1317,7 +1349,7 @@ winInitWM(void **ppWMInfo, pthread_t * ptWMProc, pthread_t * ptXMsgProc, pthread_mutex_t * ppmServerStarted, - int dwScreen, HWND hwndScreen, BOOL allowOtherWM) + int dwScreen, HWND hwndScreen) { WMProcArgPtr pArg = malloc(sizeof(WMProcArgRec)); WMInfoPtr pWMInfo = malloc(sizeof(WMInfoRec)); @@ -1339,7 +1371,6 @@ winInitWM(void **ppWMInfo, /* Set a return pointer to the Window Manager info structure */ *ppWMInfo = pWMInfo; - pWMInfo->fAllowOtherWM = allowOtherWM; /* Setup the argument structure for the thread function */ pArg->dwScreen = dwScreen; @@ -1387,6 +1418,7 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) int iRetries = 0; char pszDisplay[512]; int iReturn; + xcb_auth_info_t *auth_info; winDebug("winInitMultiWindowWM - Hello\n"); @@ -1396,7 +1428,7 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) pthread_exit(NULL); } - ErrorF("winInitMultiWindowWM - Calling pthread_mutex_lock ()\n"); + winDebug("winInitMultiWindowWM - Calling pthread_mutex_lock ()\n"); /* Grab our garbage mutex to satisfy pthread_cond_wait */ iReturn = pthread_mutex_lock(pProcArg->ppmServerStarted); @@ -1406,44 +1438,12 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) pthread_exit(NULL); } - ErrorF("winInitMultiWindowWM - pthread_mutex_lock () returned.\n"); - - /* Allow multiple threads to access Xlib */ - if (XInitThreads() == 0) { - ErrorF("winInitMultiWindowWM - XInitThreads () failed. Exiting.\n"); - pthread_exit(NULL); - } - - /* See if X supports the current locale */ - if (XSupportsLocale() == False) { - ErrorF("winInitMultiWindowWM - Warning: Locale not supported by X.\n"); - } + winDebug("winInitMultiWindowWM - pthread_mutex_lock () returned.\n"); /* Release the server started mutex */ pthread_mutex_unlock(pProcArg->ppmServerStarted); - ErrorF("winInitMultiWindowWM - pthread_mutex_unlock () returned.\n"); - - /* Install our error handler */ - XSetErrorHandler(winMultiWindowWMErrorHandler); - g_winMultiWindowWMThread = pthread_self(); - g_winMultiWindowWMOldIOErrorHandler = - XSetIOErrorHandler(winMultiWindowWMIOErrorHandler); - - /* Set jump point for IO Error exits */ - iReturn = setjmp(g_jmpWMEntry); - - /* Check if we should continue operations */ - if (iReturn != WIN_JMP_ERROR_IO && iReturn != WIN_JMP_OKAY) { - /* setjmp returned an unknown value, exit */ - ErrorF("winInitMultiWindowWM - setjmp returned: %d. Exiting.\n", - iReturn); - pthread_exit(NULL); - } - else if (iReturn == WIN_JMP_ERROR_IO) { - ErrorF("winInitMultiWindowWM - Caught IO Error. Exiting.\n"); - pthread_exit(NULL); - } + winDebug("winInitMultiWindowWM - pthread_mutex_unlock () returned.\n"); /* Setup the display connection string x */ winGetDisplayName(pszDisplay, (int) pProcArg->dwScreen); @@ -1452,13 +1452,14 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) ErrorF("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay); /* Use our generated cookie for authentication */ - winSetAuthorization(); + auth_info = winGetXcbAuthInfo(); /* Open the X display */ do { /* Try to open the display */ - pWMInfo->pDisplay = XOpenDisplay(pszDisplay); - if (pWMInfo->pDisplay == NULL) { + pWMInfo->conn = xcb_connect_to_display_with_auth_info(pszDisplay, + auth_info, NULL); + if (xcb_connection_has_error(pWMInfo->conn)) { ErrorF("winInitMultiWindowWM - Could not open display, try: %d, " "sleeping: %d\n", iRetries + 1, WIN_CONNECT_DELAY); ++iRetries; @@ -1468,37 +1469,88 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) else break; } - while (pWMInfo->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES); + while (xcb_connection_has_error(pWMInfo->conn) && iRetries < WIN_CONNECT_RETRIES); /* Make sure that the display opened */ - if (pWMInfo->pDisplay == NULL) { + if (xcb_connection_has_error(pWMInfo->conn)) { ErrorF("winInitMultiWindowWM - Failed opening the display. " "Exiting.\n"); pthread_exit(NULL); } - ErrorF("winInitMultiWindowWM - XOpenDisplay () returned and " + ErrorF("winInitMultiWindowWM - xcb_connect () returned and " "successfully opened the display.\n"); /* Create some atoms */ - pWMInfo->atmWmProtos = XInternAtom(pWMInfo->pDisplay, - "WM_PROTOCOLS", False); - pWMInfo->atmWmDelete = XInternAtom(pWMInfo->pDisplay, - "WM_DELETE_WINDOW", False); - pWMInfo->atmWmTakeFocus = XInternAtom(pWMInfo->pDisplay, - "WM_TAKE_FOCUS", False); + pWMInfo->atmWmProtos = intern_atom(pWMInfo->conn, "WM_PROTOCOLS"); + pWMInfo->atmWmDelete = intern_atom(pWMInfo->conn, "WM_DELETE_WINDOW"); + pWMInfo->atmWmTakeFocus = intern_atom(pWMInfo->conn, "WM_TAKE_FOCUS"); + pWMInfo->atmPrivMap = intern_atom(pWMInfo->conn, WINDOWSWM_NATIVE_HWND); + pWMInfo->atmUtf8String = intern_atom(pWMInfo->conn, "UTF8_STRING"); + pWMInfo->atmNetWmName = intern_atom(pWMInfo->conn, "_NET_WM_NAME"); - pWMInfo->atmPrivMap = XInternAtom(pWMInfo->pDisplay, - WINDOWSWM_NATIVE_HWND, False); + /* Initialization for the xcb_ewmh and EWMH atoms */ + { + xcb_intern_atom_cookie_t *atoms_cookie; + atoms_cookie = xcb_ewmh_init_atoms(pWMInfo->conn, &pWMInfo->ewmh); + if (xcb_ewmh_init_atoms_replies(&pWMInfo->ewmh, atoms_cookie, NULL)) { + /* Set the _NET_SUPPORTED atom for this context. - if (1) { - Cursor cursor = XCreateFontCursor(pWMInfo->pDisplay, XC_left_ptr); + TODO: Audit to ensure we implement everything defined as MUSTs + for window managers in the EWMH standard.*/ + xcb_atom_t supported[] = + { + pWMInfo->ewmh.WM_PROTOCOLS, + pWMInfo->ewmh._NET_SUPPORTED, + pWMInfo->ewmh._NET_SUPPORTING_WM_CHECK, + pWMInfo->ewmh._NET_CLOSE_WINDOW, + pWMInfo->ewmh._NET_WM_WINDOW_TYPE, + pWMInfo->ewmh._NET_WM_WINDOW_TYPE_DOCK, + pWMInfo->ewmh._NET_WM_WINDOW_TYPE_SPLASH, + pWMInfo->ewmh._NET_WM_STATE, + pWMInfo->ewmh._NET_WM_STATE_HIDDEN, + pWMInfo->ewmh._NET_WM_STATE_ABOVE, + pWMInfo->ewmh._NET_WM_STATE_BELOW, + pWMInfo->ewmh._NET_WM_STATE_SKIP_TASKBAR, + }; - if (cursor) { - XDefineCursor(pWMInfo->pDisplay, - DefaultRootWindow(pWMInfo->pDisplay), cursor); - XFreeCursor(pWMInfo->pDisplay, cursor); + xcb_ewmh_set_supported(&pWMInfo->ewmh, pProcArg->dwScreen, + sizeof(supported)/sizeof(xcb_atom_t), supported); } + else { + ErrorF("winInitMultiWindowWM - xcb_ewmh_init_atoms() failed\n"); + } + } + + /* + Set the root window cursor to left_ptr (this controls the cursor an + application gets over it's windows when it doesn't set one) + */ + { +#define XC_left_ptr 68 + xcb_cursor_t cursor = xcb_generate_id(pWMInfo->conn); + xcb_font_t font = xcb_generate_id(pWMInfo->conn); + xcb_font_t *mask_font = &font; /* An alias to clarify */ + int shape = XC_left_ptr; + uint32_t mask = XCB_CW_CURSOR; + uint32_t value_list = cursor; + + xcb_screen_t *root_screen = xcb_aux_get_screen(pWMInfo->conn, pProcArg->dwScreen); + xcb_window_t window = root_screen->root; + + static const uint16_t fgred = 0, fggreen = 0, fgblue = 0; + static const uint16_t bgred = 0xFFFF, bggreen = 0xFFFF, bgblue = 0xFFFF; + + xcb_open_font(pWMInfo->conn, font, sizeof("cursor"), "cursor"); + + xcb_create_glyph_cursor(pWMInfo->conn, cursor, font, *mask_font, + shape, shape + 1, + fgred, fggreen, fgblue, bgred, bggreen, bgblue); + + xcb_change_window_attributes(pWMInfo->conn, window, mask, &value_list); + + xcb_free_cursor(pWMInfo->conn, cursor); + xcb_close_font(pWMInfo->conn, font); } } @@ -1512,7 +1564,7 @@ winSendMessageToWM(void *pWMInfo, winWMMessagePtr pMsg) WMMsgNodePtr pNode; #if CYGMULTIWINDOW_DEBUG - ErrorF("winSendMessageToWM ()\n"); + ErrorF("winSendMessageToWM %s\n", MessageName(pMsg)); #endif pNode = malloc(sizeof(WMMsgNodeRec)); @@ -1522,129 +1574,51 @@ winSendMessageToWM(void *pWMInfo, winWMMessagePtr pMsg) } } -/* - * Window manager error handler - */ - -static int -winMultiWindowWMErrorHandler(Display * pDisplay, XErrorEvent * pErr) -{ - char pszErrorMsg[100]; - - if (pErr->request_code == X_ChangeWindowAttributes - && pErr->error_code == BadAccess) { - ErrorF("winMultiWindowWMErrorHandler - ChangeWindowAttributes " - "BadAccess.\n"); - return 0; - } - - XGetErrorText(pDisplay, pErr->error_code, pszErrorMsg, sizeof(pszErrorMsg)); - ErrorF("winMultiWindowWMErrorHandler - ERROR: %s\n", pszErrorMsg); - - return 0; -} - -/* - * Window manager IO error handler - */ - -static int -winMultiWindowWMIOErrorHandler(Display * pDisplay) -{ - ErrorF("winMultiWindowWMIOErrorHandler!\n"); - - if (pthread_equal(pthread_self(), g_winMultiWindowWMThread)) { - if (g_shutdown) - pthread_exit(NULL); - - /* Restart at the main entry point */ - longjmp(g_jmpWMEntry, WIN_JMP_ERROR_IO); - } - - if (g_winMultiWindowWMOldIOErrorHandler) - g_winMultiWindowWMOldIOErrorHandler(pDisplay); - - return 0; -} - -/* - * X message procedure error handler - */ - -static int -winMultiWindowXMsgProcErrorHandler(Display * pDisplay, XErrorEvent * pErr) -{ - char pszErrorMsg[100]; - - XGetErrorText(pDisplay, pErr->error_code, pszErrorMsg, sizeof(pszErrorMsg)); -#if CYGMULTIWINDOW_DEBUG - ErrorF("winMultiWindowXMsgProcErrorHandler - ERROR: %s\n", pszErrorMsg); -#endif - - return 0; -} - -/* - * X message procedure IO error handler - */ - -static int -winMultiWindowXMsgProcIOErrorHandler(Display * pDisplay) -{ - ErrorF("winMultiWindowXMsgProcIOErrorHandler!\n"); - - if (pthread_equal(pthread_self(), g_winMultiWindowXMsgProcThread)) { - /* Restart at the main entry point */ - longjmp(g_jmpXMsgProcEntry, WIN_JMP_ERROR_IO); - } - - if (g_winMultiWindowXMsgProcOldIOErrorHandler) - g_winMultiWindowXMsgProcOldIOErrorHandler(pDisplay); - - return 0; -} - -/* - * Catch RedirectError to detect other window manager running - */ - -static int -winRedirectErrorHandler(Display * pDisplay, XErrorEvent * pErr) -{ - redirectError = TRUE; - return 0; -} - /* * Check if another window manager is running */ static Bool -CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen, - Bool fAllowOtherWM) +CheckAnotherWindowManager(xcb_connection_t *conn, DWORD dwScreen) { + Bool redirectError = FALSE; + + /* Get root window id */ + xcb_screen_t *root_screen = xcb_aux_get_screen(conn, dwScreen); + xcb_window_t root_window_id = root_screen->root; + /* Try to select the events which only one client at a time is allowed to select. If this causes an error, another window manager is already running... */ - redirectError = FALSE; - XSetErrorHandler(winRedirectErrorHandler); - XSelectInput(pDisplay, RootWindow(pDisplay, dwScreen), - ResizeRedirectMask | SubstructureRedirectMask | - ButtonPressMask); - XSync(pDisplay, 0); - XSetErrorHandler(winMultiWindowXMsgProcErrorHandler); + const static uint32_t test_mask[] = { XCB_EVENT_MASK_RESIZE_REDIRECT | + XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | + XCB_EVENT_MASK_BUTTON_PRESS }; + + xcb_void_cookie_t cookie = xcb_change_window_attributes_checked(conn, + root_window_id, + XCB_CW_EVENT_MASK, + test_mask); + xcb_generic_error_t *error; + if ((error = xcb_request_check(conn, cookie))) + { + redirectError = TRUE; + free(error); + } /* Side effect: select the events we are actually interested in... - If other WMs are not allowed, also select one of the events which only one client + Other WMs are not allowed, also select one of the events which only one client at a time is allowed to select, so other window managers won't start... */ - XSelectInput(pDisplay, RootWindow(pDisplay, dwScreen), - SubstructureNotifyMask | (!fAllowOtherWM ? ButtonPressMask : - 0)); - XSync(pDisplay, 0); + { + const uint32_t mask[] = { XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | + XCB_EVENT_MASK_BUTTON_PRESS }; + + xcb_change_window_attributes(conn, root_window_id, XCB_CW_EVENT_MASK, mask); + } + return redirectError; } @@ -1673,18 +1647,18 @@ winDeinitMultiWindowWM(void) #define HINT_MIN (1L<<1) static void -winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) +winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle) { - static Atom windowState, motif_wm_hints, windowType; - static Atom hiddenState, fullscreenState, belowState, aboveState, + + xcb_connection_t *conn = pWMInfo->conn; + static xcb_atom_t windowState, motif_wm_hints; + static xcb_atom_t hiddenState, fullscreenState, belowState, aboveState, skiptaskbarState; - static Atom dockWindow; + static xcb_atom_t splashType; static int generation; - Atom type, *pAtom = NULL; - int format; - unsigned long hint = 0, maxmin = 0, nitems = 0, left = 0; + + unsigned long hint = 0, maxmin = 0; unsigned long style, exStyle; - MwmHints *mwm_hint = NULL; if (!hWnd) return; @@ -1693,25 +1667,23 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) if (generation != serverGeneration) { generation = serverGeneration; - windowState = XInternAtom(pDisplay, "_NET_WM_STATE", False); - motif_wm_hints = XInternAtom(pDisplay, "_MOTIF_WM_HINTS", False); - windowType = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE", False); - hiddenState = XInternAtom(pDisplay, "_NET_WM_STATE_HIDDEN", False); - fullscreenState = - XInternAtom(pDisplay, "_NET_WM_STATE_FULLSCREEN", False); - belowState = XInternAtom(pDisplay, "_NET_WM_STATE_BELOW", False); - aboveState = XInternAtom(pDisplay, "_NET_WM_STATE_ABOVE", False); - dockWindow = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE_DOCK", False); - skiptaskbarState = - XInternAtom(pDisplay, "_NET_WM_STATE_SKIP_TASKBAR", False); + windowState = intern_atom(conn, "_NET_WM_STATE"); + motif_wm_hints = intern_atom(conn, "_MOTIF_WM_HINTS"); + hiddenState = intern_atom(conn, "_NET_WM_STATE_HIDDEN"); + fullscreenState = intern_atom(conn, "_NET_WM_STATE_FULLSCREEN"); + belowState = intern_atom(conn, "_NET_WM_STATE_BELOW"); + aboveState = intern_atom(conn, "_NET_WM_STATE_ABOVE"); + skiptaskbarState = intern_atom(conn, "_NET_WM_STATE_SKIP_TASKBAR"); + splashType = intern_atom(conn, "_NET_WM_WINDOW_TYPE_SPLASHSCREEN"); } - if (XGetWindowProperty(pDisplay, iWindow, windowState, 0L, - MAXINT, False, XA_ATOM, &type, &format, - &nitems, &left, - (unsigned char **) &pAtom) == Success) { - if (pAtom ) { - unsigned long i; + { + xcb_get_property_cookie_t cookie_wm_state = xcb_get_property(conn, FALSE, iWindow, windowState, XCB_ATOM_ATOM, 0L, INT_MAX); + xcb_get_property_reply_t *reply = xcb_get_property_reply(conn, cookie_wm_state, NULL); + if (reply) { + int i; + int nitems = xcb_get_property_value_length(reply)/sizeof(xcb_atom_t); + xcb_atom_t *pAtom = xcb_get_property_value(reply); for (i = 0; i < nitems; i++) { if (pAtom[i] == skiptaskbarState) @@ -1726,16 +1698,17 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) *zstyle = HWND_TOPMOST; } - XFree(pAtom); - } + free(reply); + } } - nitems = left = 0; - if (XGetWindowProperty(pDisplay, iWindow, motif_wm_hints, 0L, - PropMwmHintsElements, False, motif_wm_hints, &type, - &format, &nitems, &left, - (unsigned char **) &mwm_hint) == Success) { - if (mwm_hint && nitems == PropMwmHintsElements && + { + xcb_get_property_cookie_t cookie_mwm_hint = xcb_get_property(conn, FALSE, iWindow, motif_wm_hints, motif_wm_hints, 0L, sizeof(MwmHints)); + xcb_get_property_reply_t *reply = xcb_get_property_reply(conn, cookie_mwm_hint, NULL); + if (reply) { + int nitems = xcb_get_property_value_length(reply)/4; + MwmHints *mwm_hint = xcb_get_property_value(reply); + if (mwm_hint && (nitems >= PropMwmHintsElements) && (mwm_hint->flags & MwmHintsDecorations)) { if (!mwm_hint->decorations) hint |= (HINT_NOFRAME | HINT_NOSYSMENU | HINT_NOMINIMIZE | HINT_NOMAXIMIZE); @@ -1760,48 +1733,54 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) */ } } - if (mwm_hint) - XFree(mwm_hint); - } - - nitems = left = 0; - pAtom = NULL; - if (XGetWindowProperty(pDisplay, iWindow, windowType, 0L, - 1L, False, XA_ATOM, &type, &format, - &nitems, &left, - (unsigned char **) &pAtom) == Success) { - if (pAtom && nitems == 1) { - if (*pAtom == dockWindow) { - hint = (hint & ~HINT_NOFRAME) | HINT_SKIPTASKBAR | HINT_SIZEBOX; - *zstyle = HWND_TOPMOST; - } - } - if (pAtom) - XFree(pAtom); + free(reply); + } } { - XSizeHints *normal_hint = XAllocSizeHints(); - long supplied; + int i; + xcb_ewmh_get_atoms_reply_t type; + xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_window_type(&pWMInfo->ewmh, iWindow); + if (xcb_ewmh_get_wm_window_type_reply(&pWMInfo->ewmh, cookie, &type, NULL)) { + for (i = 0; i < type.atoms_len; i++) { + if (type.atoms[i] == pWMInfo->ewmh._NET_WM_WINDOW_TYPE_DOCK) { + hint = (hint & ~HINT_NOFRAME) | HINT_SKIPTASKBAR | HINT_SIZEBOX; + *zstyle = HWND_TOPMOST; + } + else if ((type.atoms[i] == pWMInfo->ewmh._NET_WM_WINDOW_TYPE_SPLASH) + || (type.atoms[i] == splashType)) { + hint |= (HINT_SKIPTASKBAR | HINT_NOSYSMENU | HINT_NOMINIMIZE | HINT_NOMAXIMIZE); + *zstyle = HWND_TOPMOST; + } + } + } + } - if (normal_hint && - XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied)) { - if (normal_hint->flags & PMaxSize) { - /* Not maximizable if a maximum size is specified */ - hint |= HINT_NOMAXIMIZE; + { + xcb_size_hints_t size_hints; + xcb_get_property_cookie_t cookie; - if (normal_hint->flags & PMinSize) { + cookie = xcb_icccm_get_wm_normal_hints(conn, iWindow); + if (xcb_icccm_get_wm_normal_hints_reply(conn, cookie, &size_hints, NULL)) { + if (size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE) { + + /* Not maximizable if a maximum size is specified, and that size + is smaller (in either dimension) than the screen size */ + if ((size_hints.max_width < GetSystemMetrics(SM_CXVIRTUALSCREEN)) + || (size_hints.max_height < GetSystemMetrics(SM_CYVIRTUALSCREEN))) + hint |= HINT_NOMAXIMIZE; + + if (size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) { /* If both minimum size and maximum size are specified and are the same, don't bother with a resizing frame */ - if ((normal_hint->min_width == normal_hint->max_width) - && (normal_hint->min_height == normal_hint->max_height)) + if ((size_hints.min_width == size_hints.max_width) + && (size_hints.min_height == size_hints.max_height)) hint = (hint & ~HINT_SIZEBOX); } } } - XFree(normal_hint); } /* @@ -1809,41 +1788,32 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) application id for grouping. */ { - XClassHint class_hint = { 0, 0 }; - char *window_name = 0; char *application_id = 0; + char *window_name = 0; + char *res_name = 0; + char *res_class = 0; - if (XGetClassHint(pDisplay, iWindow, &class_hint)) { - XFetchName(pDisplay, iWindow, &window_name); + GetClassNames(pWMInfo, iWindow, &res_name, &res_class, &window_name); - style = - winOverrideStyle(class_hint.res_name, class_hint.res_class, - window_name); + style = STYLE_NONE; + style = winOverrideStyle(res_name, res_class, window_name); #define APPLICATION_ID_FORMAT "%s.xwin.%s" #define APPLICATION_ID_UNKNOWN "unknown" - if (class_hint.res_class) { - asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, - class_hint.res_class); - } - else { - asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, - APPLICATION_ID_UNKNOWN); - } - winSetAppUserModelID(hWnd, application_id); - - if (class_hint.res_name) - XFree(class_hint.res_name); - if (class_hint.res_class) - XFree(class_hint.res_class); - if (application_id) - free(application_id); - if (window_name) - XFree(window_name); + if (res_class) { + asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, + res_class); } else { - style = STYLE_NONE; + asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, + APPLICATION_ID_UNKNOWN); } + winSetAppUserModelID(hWnd, application_id); + + free(application_id); + free(res_name); + free(res_class); + free(window_name); } if (style & STYLE_TOPMOST) diff --git a/xserver/hw/xwin/winmultiwindowwndproc.c b/xserver/hw/xwin/winmultiwindowwndproc.c index 656f6c2da..3f47fec65 100644 --- a/xserver/hw/xwin/winmultiwindowwndproc.c +++ b/xserver/hw/xwin/winmultiwindowwndproc.c @@ -428,7 +428,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* * Any window menu items go through here */ - if (HandleCustomWM_COMMAND(hwnd, LOWORD(wParam))) { + if (HandleCustomWM_COMMAND(hwnd, LOWORD(wParam), s_pScreenPriv)) { /* Don't pass customized menus to DefWindowProc */ return 0; } diff --git a/xserver/hw/xwin/winprefs.c b/xserver/hw/xwin/winprefs.c index 505292714..65115ec5b 100644 --- a/xserver/hw/xwin/winprefs.c +++ b/xserver/hw/xwin/winprefs.c @@ -46,6 +46,7 @@ #include "winprefs.h" #include "windisplay.h" #include "winmultiwindowclass.h" +#include "winmultiwindowicons.h" /* Where will the custom menu commands start counting from? */ #define STARTMENUID WM_USER @@ -205,18 +206,21 @@ ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam) * Set custom icons and menus again. */ static void -ReloadPrefs(void) +ReloadPrefs(winPrivScreenPtr pScreenPriv) { int i; #ifdef XWIN_MULTIWINDOW + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + /* First, iterate over all windows, deleting their icons and custom menus. * This is really only needed because winDestroyIcon() will try to * destroy the old global icons, which will have changed. * It is probably better to set a windows USER_DATA to flag locally defined * icons, and use that to accurately know when to destroy old icons. */ - EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, FALSE); + if (pScreenInfo->fMultiWindow) + EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, FALSE); #endif /* Now, free/clear all info from our prefs structure */ @@ -261,12 +265,12 @@ ReloadPrefs(void) g_hSmallIconX = NULL; #ifdef XWIN_MULTIWINDOW - winInitGlobalIcons(); -#endif + if (pScreenInfo->fMultiWindow) { + winInitGlobalIcons(); -#ifdef XWIN_MULTIWINDOW - /* Rebuild the icons and menus */ - EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, TRUE); + /* Rebuild the icons and menus */ + EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, TRUE); + } #endif /* Whew, done */ @@ -302,7 +306,7 @@ HandleCustomWM_INITMENU(HWND hwnd, HMENU hmenu) * Return TRUE if command is proccessed, FALSE otherwise. */ Bool -HandleCustomWM_COMMAND(HWND hwnd, int command) +HandleCustomWM_COMMAND(HWND hwnd, WORD command, winPrivScreenPtr pScreenPriv) { int i, j; MENUPARSED *m; @@ -382,13 +386,17 @@ HandleCustomWM_COMMAND(HWND hwnd, int command) HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); #if XWIN_MULTIWINDOW - /* Reflect the changed Z order */ - winReorderWindowsMultiWindow(); + { + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + if (pScreenInfo->fMultiWindow) + /* Reflect the changed Z order */ + winReorderWindowsMultiWindow(); + } #endif return TRUE; case CMD_RELOAD: - ReloadPrefs(); + ReloadPrefs(pScreenPriv); return TRUE; default: diff --git a/xserver/hw/xwin/winprefs.h b/xserver/hw/xwin/winprefs.h index 8f4eb0807..936a42f22 100644 --- a/xserver/hw/xwin/winprefs.h +++ b/xserver/hw/xwin/winprefs.h @@ -1,5 +1,3 @@ -#if !defined(WINPREFS_H) -#define WINPREFS_H /* * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. * Copyright (C) Colin Harrison 2005-2008 @@ -32,6 +30,9 @@ * Colin Harrison */ +#if !defined(WINPREFS_H) +#define WINPREFS_H + /* Need Bool */ #include /* Need TRUE */ @@ -42,6 +43,8 @@ /* Xwindows redefines PATH_MAX to at least 1024 */ #include +#include "winwindow.h" + #ifndef NAME_MAX #define NAME_MAX PATH_MAX #endif @@ -159,7 +162,7 @@ void HandleCustomWM_INITMENU(HWND hwnd, HMENU hmenu); Bool - HandleCustomWM_COMMAND(HWND hwnd, int command); + HandleCustomWM_COMMAND(HWND hwnd, WORD command, winPrivScreenPtr pScreenPriv); int winIconIsOverride(HICON hicon); diff --git a/xserver/hw/xwin/winprocarg.c b/xserver/hw/xwin/winprocarg.c index 73aa027d8..35ea8f23a 100644 --- a/xserver/hw/xwin/winprocarg.c +++ b/xserver/hw/xwin/winprocarg.c @@ -130,7 +130,6 @@ winInitializeScreenDefaults(void) defaultScreenInfo.fDecoration = TRUE; #ifdef XWIN_MULTIWINDOWEXTWM defaultScreenInfo.fMWExtWM = FALSE; - defaultScreenInfo.fInternalWM = FALSE; #endif defaultScreenInfo.fRootless = FALSE; #ifdef XWIN_MULTIWINDOW @@ -141,7 +140,7 @@ winInitializeScreenDefaults(void) #endif defaultScreenInfo.fMultipleMonitors = FALSE; defaultScreenInfo.fLessPointer = FALSE; - defaultScreenInfo.iResizeMode = resizeWithRandr; + defaultScreenInfo.iResizeMode = resizeDefault; defaultScreenInfo.fNoTrayIcon = FALSE; defaultScreenInfo.iE3BTimeout = WIN_E3B_DEFAULT; defaultScreenInfo.fUseWinKillKey = WIN_DEFAULT_WIN_KILL; @@ -247,7 +246,7 @@ ddxProcessArgument(int argc, char *argv[], int i) * OsVendorInit () gets called, otherwise we will overwrite * settings changed by parameters such as -fullscreen, etc. */ - winErrorFVerb(2, "ddxProcessArgument - Initializing default " + winErrorFVerb(3, "ddxProcessArgument - Initializing default " "screens\n"); winInitializeScreenDefaults(); } @@ -577,11 +576,8 @@ ddxProcessArgument(int argc, char *argv[], int i) * Look for the '-internalwm' argument */ if (IS_OPTION("-internalwm")) { - if (!screenInfoPtr->fMultiMonitorOverride) - screenInfoPtr->fMultipleMonitors = TRUE; - screenInfoPtr->fMWExtWM = TRUE; - screenInfoPtr->fInternalWM = TRUE; - + ErrorF("Ignoring obsolete -internalwm option\n"); + /* Ignored, but we still accept the arg for backwards compatibility */ /* Indicate that we have processed this argument */ return 1; } @@ -666,7 +662,7 @@ ddxProcessArgument(int argc, char *argv[], int i) if (IS_OPTION("-resize")) mode = resizeWithRandr; else if (IS_OPTION("-noresize")) - mode = notAllowed; + mode = resizeNotAllowed; else if (strncmp(argv[i], "-resize=", strlen("-resize=")) == 0) { char *option = argv[i] + strlen("-resize="); @@ -675,7 +671,7 @@ ddxProcessArgument(int argc, char *argv[], int i) else if (strcmp(option, "scrollbars") == 0) mode = resizeWithScrollbars; else if (strcmp(option, "none") == 0) - mode = notAllowed; + mode = resizeNotAllowed; else { ErrorF("ddxProcessArgument - resize - Invalid resize mode %s\n", option); @@ -1078,11 +1074,6 @@ ddxProcessArgument(int argc, char *argv[], int i) return 1; } - if (IS_OPTION("-silent-dup-error")) { - g_fSilentDupError = TRUE; - return 1; - } - if (IS_OPTION("-wgl")) { g_fNativeGl = TRUE; return 1; diff --git a/xserver/hw/xwin/winscrinit.c b/xserver/hw/xwin/winscrinit.c index 735ce9325..6cbf08da4 100644 --- a/xserver/hw/xwin/winscrinit.c +++ b/xserver/hw/xwin/winscrinit.c @@ -533,9 +533,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv) if (FALSE #ifdef XWIN_MULTIWINDOW || pScreenInfo->fMultiWindow -#endif -#ifdef XWIN_MULTIWINDOWEXTWM - || pScreenInfo->fInternalWM #endif ) { #if CYGDEBUG || YES @@ -547,11 +544,8 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv) &pScreenPriv->ptWMProc, &pScreenPriv->ptXMsgProc, &pScreenPriv->pmServerStarted, - pScreenInfo->dwScreen, (HWND) &pScreenPriv->hwndScreen, -#ifdef XWIN_MULTIWINDOWEXTWM - pScreenInfo->fInternalWM || -#endif - FALSE)) { + pScreenInfo->dwScreen, + (HWND) &pScreenPriv->hwndScreen)) { ErrorF("winFinishScreenInitFB - winInitWM () failed.\n"); return FALSE; } diff --git a/xserver/hw/xwin/winshadddnl.c b/xserver/hw/xwin/winshadddnl.c index d4f940ec1..0ec5246fc 100644 --- a/xserver/hw/xwin/winshadddnl.c +++ b/xserver/hw/xwin/winshadddnl.c @@ -1211,14 +1211,8 @@ winSetEngineFunctionsShadowDDNL(ScreenPtr pScreen) pScreenPriv->pwinStoreColors = winStoreColorsShadowDDNL; pScreenPriv->pwinCreateColormap = winCreateColormapShadowDDNL; pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDDNL; - pScreenPriv->pwinHotKeyAltTab = - (winHotKeyAltTabProcPtr) (void (*)(void)) NoopDDA; pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDDNL; pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDDNL; -#ifdef XWIN_MULTIWINDOW - pScreenPriv->pwinFinishCreateWindowsWindow - = (winFinishCreateWindowsWindowProcPtr) (void (*)(void)) NoopDDA; -#endif return TRUE; } diff --git a/xserver/hw/xwin/winshadgdi.c b/xserver/hw/xwin/winshadgdi.c index bf655174d..22836c518 100644 --- a/xserver/hw/xwin/winshadgdi.c +++ b/xserver/hw/xwin/winshadgdi.c @@ -1143,16 +1143,8 @@ winSetEngineFunctionsShadowGDI(ScreenPtr pScreen) pScreenPriv->pwinStoreColors = winStoreColorsShadowGDI; pScreenPriv->pwinCreateColormap = winCreateColormapShadowGDI; pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowGDI; - pScreenPriv->pwinHotKeyAltTab = - (winHotKeyAltTabProcPtr) (void (*)(void)) NoopDDA; - pScreenPriv->pwinCreatePrimarySurface = - (winCreatePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA; - pScreenPriv->pwinReleasePrimarySurface = - (winReleasePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA; -#ifdef XWIN_MULTIWINDOW - pScreenPriv->pwinFinishCreateWindowsWindow = - (winFinishCreateWindowsWindowProcPtr) (void (*)(void)) NoopDDA; -#endif + pScreenPriv->pwinCreatePrimarySurface = NULL; + pScreenPriv->pwinReleasePrimarySurface = NULL; return TRUE; } diff --git a/xserver/hw/xwin/wintaskbar.c b/xserver/hw/xwin/wintaskbar.c index 7dd4ec30b..401ec175a 100644 --- a/xserver/hw/xwin/wintaskbar.c +++ b/xserver/hw/xwin/wintaskbar.c @@ -66,7 +66,7 @@ DECLARE_INTERFACE_(ITaskbarList, IUnknown) seem to be the case */ -void winShowWindowOnTaskbar(HWND hWnd, BOOL show) +void winShowWindowOnTaskbar(HWND hWnd, Bool show) { ITaskbarList* pTaskbarList = NULL; diff --git a/xserver/hw/xwin/winvalargs.c b/xserver/hw/xwin/winvalargs.c index edfd71f72..f93872419 100644 --- a/xserver/hw/xwin/winvalargs.c +++ b/xserver/hw/xwin/winvalargs.c @@ -127,7 +127,7 @@ winValidateArgs(void) return FALSE; } - /* Check for -multiwindow, -mwextwm, or -rootless and fullscreen */ + /* Check for -multiwindow, -mwextwm, or -rootless and -fullscreen */ if (g_ScreenInfo[i].fFullScreen && (FALSE #ifdef XWIN_MULTIWINDOW || g_ScreenInfo[i].fMultiWindow @@ -142,6 +142,21 @@ winValidateArgs(void) return FALSE; } + /* Check for -multiwindow, -mwextwm, or -rootless and -nodecoration */ + if (!g_ScreenInfo[i].fDecoration && (FALSE +#ifdef XWIN_MULTIWINDOW + || g_ScreenInfo[i].fMultiWindow +#endif +#ifdef XWIN_MULTIWINDOWEXTWM + || g_ScreenInfo[i].fMWExtWM +#endif + || g_ScreenInfo[i].fRootless) + ) { + ErrorF("winValidateArgs - -nodecoration is invalid with " + "-multiwindow, -mwextwm, or -rootless.\n"); + return FALSE; + } + /* Check for !fullscreen and any fullscreen-only parameters */ if (!g_ScreenInfo[i].fFullScreen && (g_ScreenInfo[i].dwRefreshRate != WIN_DEFAULT_REFRESH @@ -153,7 +168,7 @@ winValidateArgs(void) /* Check for fullscreen and any non-fullscreen parameters */ if (g_ScreenInfo[i].fFullScreen - && ((g_ScreenInfo[i].iResizeMode != notAllowed) + && ((g_ScreenInfo[i].iResizeMode != resizeNotAllowed) || !g_ScreenInfo[i].fDecoration || g_ScreenInfo[i].fLessPointer)) { ErrorF("winValidateArgs - -fullscreen is invalid with " diff --git a/xserver/hw/xwin/winwakeup.c b/xserver/hw/xwin/winwakeup.c index ebcb0fad9..f593886ff 100644 --- a/xserver/hw/xwin/winwakeup.c +++ b/xserver/hw/xwin/winwakeup.c @@ -38,8 +38,7 @@ /* See Porting Layer Definition - p. 7 */ void -winWakeupHandler(ScreenPtr pScreen, - unsigned long ulResult, void *pReadmask) +winWakeupHandler(ScreenPtr pScreen, int iResult) { MSG msg; diff --git a/xserver/hw/xwin/winwin32rootless.c b/xserver/hw/xwin/winwin32rootless.c index 660a78f2d..52806887f 100644 --- a/xserver/hw/xwin/winwin32rootless.c +++ b/xserver/hw/xwin/winwin32rootless.c @@ -40,6 +40,7 @@ #define _WINDOWSWM_SERVER_ #include #include "winmultiwindowclass.h" +#include "winmultiwindowicons.h" #include /* @@ -516,12 +517,6 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) win32RootlessWindowPtr pRLNextWinPriv = (win32RootlessWindowPtr) nextWid; winScreenPriv(pRLWinPriv->pFrame->win->drawable.pScreen); - winScreenInfo *pScreenInfo = NULL; - DWORD dwCurrentProcessID = GetCurrentProcessId(); - DWORD dwWindowProcessID = 0; - HWND hWnd; - Bool fFirst = TRUE; - Bool fNeedRestack = TRUE; #if CYGMULTIWINDOW_DEBUG winDebug("winMWExtWMRestackFrame (%p)\n", pRLWinPriv); @@ -530,9 +525,6 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) if (pScreenPriv && pScreenPriv->fRestacking) return; - if (pScreenPriv) - pScreenInfo = pScreenPriv->pScreenInfo; - pRLWinPriv->fRestackingNow = TRUE; /* Show window */ @@ -541,68 +533,12 @@ winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) if (pRLNextWinPriv == NULL) { #if CYGMULTIWINDOW_DEBUG - winDebug("Win %08x is top\n", pRLWinPriv); + winDebug("Win %p is top\n", pRLWinPriv); #endif pScreenPriv->widTop = wid; SetWindowPos(pRLWinPriv->hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } - else if (winIsInternalWMRunning(pScreenInfo)) { - /* using mulwinidow wm */ -#if CYGMULTIWINDOW_DEBUG - winDebug("Win %08x is not top\n", pRLWinPriv); -#endif - for (hWnd = GetNextWindow(pRLWinPriv->hWnd, GW_HWNDPREV); - fNeedRestack && hWnd != NULL; - hWnd = GetNextWindow(hWnd, GW_HWNDPREV)) { - GetWindowThreadProcessId(hWnd, &dwWindowProcessID); - - if ((dwWindowProcessID == dwCurrentProcessID) - && GetProp(hWnd, WIN_WINDOW_PROP)) { - if (hWnd == pRLNextWinPriv->hWnd) { - /* Enable interleave X window and Windows window */ - if (!fFirst) { -#if CYGMULTIWINDOW_DEBUG - winDebug("raise: Insert after Win %08x\n", - pRLNextWinPriv); -#endif - SetWindowPos(pRLWinPriv->hWnd, pRLNextWinPriv->hWnd, - 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - } - else { -#if CYGMULTIWINDOW_DEBUG - winDebug("No change\n"); -#endif - } - fNeedRestack = FALSE; - break; - } - if (fFirst) - fFirst = FALSE; - } - } - - for (hWnd = GetNextWindow(pRLWinPriv->hWnd, GW_HWNDNEXT); - fNeedRestack && hWnd != NULL; - hWnd = GetNextWindow(hWnd, GW_HWNDNEXT)) { - GetWindowThreadProcessId(hWnd, &dwWindowProcessID); - - if ((dwWindowProcessID == dwCurrentProcessID) - && GetProp(hWnd, WIN_WINDOW_PROP)) { - if (hWnd == pRLNextWinPriv->hWnd) { -#if CYGMULTIWINDOW_DEBUG - winDebug("lower: Insert after Win %08x\n", pRLNextWinPriv); -#endif - SetWindowPos(pRLWinPriv->hWnd, pRLNextWinPriv->hWnd, - 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - fNeedRestack = FALSE; - break; - } - } - } - } else { /* using general wm like twm, wmaker etc. Interleave X window and Windows window will cause problem. */ diff --git a/xserver/hw/xwin/winwin32rootlesswindow.c b/xserver/hw/xwin/winwin32rootlesswindow.c index 1faa531df..817cd093e 100644 --- a/xserver/hw/xwin/winwin32rootlesswindow.c +++ b/xserver/hw/xwin/winwin32rootlesswindow.c @@ -194,10 +194,6 @@ winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv, /* Get current window placement */ GetWindowPlacement(pRLWinPriv->hWnd, &wndPlace); - if (winIsInternalWMRunning(pScreenInfo)) { - if (!pRLWinPriv->pFrame->win->overrideRedirect) - fDecorate = TRUE; - } #if 0 if (wndPlace.showCmd == SW_HIDE) return; //showCmd = SWP_HIDEWINDOW; @@ -344,15 +340,6 @@ winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv, } } -/* - * winIsInternalWMRunning (winScreenInfoPtr pScreenInfo) - */ -Bool -winIsInternalWMRunning(winScreenInfoPtr pScreenInfo) -{ - return pScreenInfo->fInternalWM && !pScreenInfo->fAnotherWMRunning; -} - /* * winMWExtWMRestackWindows */ @@ -402,7 +389,7 @@ winMWExtWMRestackWindows(ScreenPtr pScreen) #if CYGMULTIWINDOW_DEBUG winDebug - ("winMWExtWMRestackWindows - DeferWindowPos (%08x, %08x)\n", + ("winMWExtWMRestackWindows - DeferWindowPos (%p, %p)\n", pRLWin->hWnd, pRLWinPrev ? pRLWinPrev->hWnd : HWND_TOP); #endif hWinPosInfo = DeferWindowPos(hWinPosInfo, pRLWin->hWnd, diff --git a/xserver/hw/xwin/winwin32rootlesswndproc.c b/xserver/hw/xwin/winwin32rootlesswndproc.c index 79d959161..5575f4ba8 100644 --- a/xserver/hw/xwin/winwin32rootlesswndproc.c +++ b/xserver/hw/xwin/winwin32rootlesswndproc.c @@ -60,9 +60,9 @@ static UINT_PTR g_uipMousePollingTimerID = 0; * Local function */ -DEFINE_ATOM_HELPER(AtmWindowsWmRaiseOnClick, WINDOWSWM_RAISE_ON_CLICK) - DEFINE_ATOM_HELPER(AtmWindowsWMMouseActivate, WINDOWSWM_MOUSE_ACTIVATE) +DEFINE_ATOM_HELPER(AtmWindowsWMMouseActivate, WINDOWSWM_MOUSE_ACTIVATE) /* DEFINE_ATOM_HELPER(AtmWindowsWMClientWindow, WINDOWSWM_CLIENT_WINDOW) */ + /* * ConstrainSize - Taken from TWM sources - Respects hints for sizing */ @@ -271,55 +271,6 @@ ValidateSizing(HWND hwnd, WindowPtr pWin, WPARAM wParam, LPARAM lParam) return TRUE; } -/* - * IsRaiseOnClick - */ - -static Bool -IsRaiseOnClick(WindowPtr pWin) -{ - - struct _Window *pwin; - struct _Property *prop; - - /* XXX We're getting inputInfo.poniter here, but this might be really wrong. - * Which pointer's current window do we want? */ - WindowPtr pRoot = GetCurrentRootWindow(inputInfo.pointer); - - if (!pWin) { - ErrorF("IsRaiseOnClick - no prop use default value:%d\n", - RAISE_ON_CLICK_DEFAULT); - return RAISE_ON_CLICK_DEFAULT; - } - - pwin = (struct _Window *) pWin; - - if (pwin->optional) - prop = (struct _Property *) pwin->optional->userProps; - else - prop = NULL; - - while (prop) { - if (prop->propertyName == AtmWindowsWmRaiseOnClick() - && prop->type == XA_INTEGER && prop->format == 32) { - return *(int *) prop->data; - } - else - prop = prop->next; - } - - if (pWin != pRoot) { - return IsRaiseOnClick(pRoot); - } - else { -#if CYGMULTIWINDOW_DEBUG - winDebug("IsRaiseOnClick - no prop use default value:%d\n", - RAISE_ON_CLICK_DEFAULT); -#endif - return RAISE_ON_CLICK_DEFAULT; - } -} - /* * IsMouseActive */ @@ -388,8 +339,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) PAINTSTRUCT ps; LPWINDOWPOS pWinPos = NULL; RECT rcClient; - winWMMessageRec wmMsg; - Bool fWMMsgInitialized = FALSE; /* Check if the Windows window property for our X window pointer is valid */ if ((pRLWinPriv = @@ -403,26 +352,16 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (pScreenPriv) hwndScreen = pScreenPriv->hwndScreen; - wmMsg.msg = 0; - wmMsg.hwndWindow = hwnd; - wmMsg.iWindow = (Window) pWin->drawable.id; - - wmMsg.iX = pRLWinPriv->pFrame->x; - wmMsg.iY = pRLWinPriv->pFrame->y; - wmMsg.iWidth = pRLWinPriv->pFrame->width; - wmMsg.iHeight = pRLWinPriv->pFrame->height; - - fWMMsgInitialized = TRUE; #if CYGDEBUG winDebugWin32Message("winMWExtWMWindowProc", hwnd, message, wParam, lParam); - winDebug("\thWnd %08X\n", hwnd); - winDebug("\tpScreenPriv %08X\n", pScreenPriv); - winDebug("\tpScreenInfo %08X\n", pScreenInfo); - winDebug("\thwndScreen %08X\n", hwndScreen); - winDebug("winMWExtWMWindowProc (%08x) %08x %08x %08x\n", - pRLWinPriv, message, wParam, lParam); + winDebug("\thWnd %p\n", hwnd); + winDebug("\tpScreenPriv %p\n", pScreenPriv); + winDebug("\tpScreenInfo %p\n", pScreenInfo); + winDebug("\thwndScreen %p\n", hwndScreen); + winDebug("winMWExtWMWindowProc (%p) %08x %08x %08x\n", + pRLWinPriv, message, (int)wParam, (int)lParam); #endif } /* Branch on message type */ @@ -446,12 +385,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) DestroyWindow(hwnd); } else { - if (winIsInternalWMRunning(pScreenInfo)) { - /* Tell our Window Manager thread to kill the window */ - wmMsg.msg = WM_WM_KILL; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } winWindowsWMSendEvent(WindowsWMControllerNotify, WindowsWMControllerNotifyMask, 1, @@ -680,19 +613,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #if CYGMULTIWINDOW_DEBUG winDebug("winMWExtWMWindowProc - WM_MOUSEACTIVATE\n"); #endif -#if 1 - /* Check if this window needs to be made active when clicked */ - if (winIsInternalWMRunning(pScreenInfo) && pWin->overrideRedirect) { -#if CYGMULTIWINDOW_DEBUG - winDebug("winMWExtWMWindowProc - WM_MOUSEACTIVATE - " - "MA_NOACTIVATE\n"); -#endif - - /* */ - return MA_NOACTIVATE; - } -#endif - if (!winIsInternalWMRunning(pScreenInfo) && !IsMouseActive(pWin)) + if (!IsMouseActive(pWin)) return MA_NOACTIVATE; break; @@ -805,19 +726,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) winDebug("winMWExtWMWindowProc - WM_ACTIVATE\n"); #endif if (LOWORD(wParam) != WA_INACTIVE) { - if (winIsInternalWMRunning(pScreenInfo)) { -#if 0 - /* Raise the window to the top in Z order */ - wmMsg.msg = WM_WM_RAISE; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); -#endif - /* Tell our Window Manager thread to activate the window */ - wmMsg.msg = WM_WM_ACTIVATE; - if (fWMMsgInitialized) - if (!pWin || !pWin->overrideRedirect) /* for OOo menus */ - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } winWindowsWMSendEvent(WindowsWMControllerNotify, WindowsWMControllerNotifyMask, 1, @@ -838,14 +746,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; } - if (winIsInternalWMRunning(pScreenInfo) || IsRaiseOnClick(pWin)) { -#if CYGMULTIWINDOW_DEBUG - winDebug("Win %p has WINDOWSWM_RAISE_ON_CLICK.\n", - pRLWinPriv); -#endif - break; - } - #if CYGMULTIWINDOW_DEBUG winDebug("Win %p forbid to change z order (%p).\n", pRLWinPriv, @@ -889,9 +789,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) (short) HIWORD(lParam)); #endif if (!pRLWinPriv->fMovingOrSizing) { - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); - winMWExtWMMoveXWindow(pWin, (LOWORD(lParam) - wBorderWidth(pWin) - GetSystemMetrics(SM_XVIRTUALSCREEN)), (HIWORD(lParam) - wBorderWidth(pWin) @@ -907,31 +804,8 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (!wParam) return 0; - if (!pScreenInfo->fInternalWM) //XXXX - return 0; - winMWExtWMUpdateWindowDecoration(pRLWinPriv, pScreenInfo); - if (winIsInternalWMRunning(pScreenInfo)) { -#if CYGMULTIWINDOW_DEBUG || TRUE - winDebug("\tMapWindow\n"); -#endif - /* Tell X to map the window */ - MapWindow(pWin, wClient(pWin)); - - if (!pRLWinPriv->pFrame->win->overrideRedirect) - /* Bring the Windows window to the foreground */ - SetForegroundWindow(hwnd); - - /* Setup the Window Manager message */ - wmMsg.msg = WM_WM_MAP; - wmMsg.iWidth = pRLWinPriv->pFrame->width; - wmMsg.iHeight = pRLWinPriv->pFrame->height; - - /* Tell our Window Manager thread to map the window */ - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } break; case WM_SIZING: @@ -967,72 +841,12 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (pWinPos->flags & SWP_HIDEWINDOW) break; - /* Reorder if window z order was changed */ - if ((pScreenPriv != NULL) - && !(pWinPos->flags & SWP_NOZORDER) - && !(pWinPos->flags & SWP_SHOWWINDOW) - && winIsInternalWMRunning(pScreenInfo)) { -#if CYGMULTIWINDOW_DEBUG - winDebug("\twindow z order was changed\n"); -#endif - if (pWinPos->hwndInsertAfter == HWND_TOP - || pWinPos->hwndInsertAfter == HWND_TOPMOST - || pWinPos->hwndInsertAfter == HWND_NOTOPMOST) { -#if CYGMULTIWINDOW_DEBUG - winDebug("\traise to top\n"); -#endif - /* Raise the window to the top in Z order */ - wmMsg.msg = WM_WM_RAISE; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } -#if 1 - else if (pWinPos->hwndInsertAfter == HWND_BOTTOM) { - } - else { - /* Check if this window is top of X windows. */ - HWND hWndAbove = NULL; - DWORD dwCurrentProcessID = GetCurrentProcessId(); - DWORD dwWindowProcessID = 0; - - for (hWndAbove = pWinPos->hwndInsertAfter; - hWndAbove != NULL; - hWndAbove = GetNextWindow(hWndAbove, GW_HWNDPREV)) { - /* Ignore other XWin process's window */ - GetWindowThreadProcessId(hWndAbove, &dwWindowProcessID); - - if ((dwWindowProcessID == dwCurrentProcessID) - && GetProp(hWndAbove, WIN_WINDOW_PROP) - && !IsWindowVisible(hWndAbove) - && !IsIconic(hWndAbove)) /* ignore minimized windows */ - break; - } - /* If this is top of X windows in Windows stack, - raise it in X stack. */ - if (hWndAbove == NULL) { -#if CYGMULTIWINDOW_DEBUG - winDebug("\traise to top\n"); -#endif - /* Raise the window to the top in Z order */ - wmMsg.msg = WM_WM_RAISE; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } - } -#endif - } - if (!(pWinPos->flags & SWP_NOSIZE)) { if (IsIconic(hwnd)) { #if CYGMULTIWINDOW_DEBUG winDebug("\tIconic -> MINIMIZED\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) { - /* Raise the window to the top in Z order */ - wmMsg.msg = WM_WM_LOWER; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } + winWindowsWMSendEvent(WindowsWMControllerNotify, WindowsWMControllerNotifyMask, 1, @@ -1072,8 +886,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #if CYGMULTIWINDOW_DEBUG winDebug("\tmove & resize\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); winMWExtWMMoveResizeXWindow(pWin, rcClient.left - @@ -1095,8 +907,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #if CYGMULTIWINDOW_DEBUG winDebug("\tmove\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); winMWExtWMMoveResizeXWindow(pWin, rcClient.left - @@ -1118,8 +928,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #if CYGMULTIWINDOW_DEBUG winDebug("\tmove\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); winMWExtWMMoveXWindow(pWin, rcClient.left - wBorderWidth(pWin) @@ -1132,8 +940,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #if CYGMULTIWINDOW_DEBUG winDebug("\tresize\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); winMWExtWMResizeXWindow(pWin, rcClient.right - rcClient.left @@ -1168,12 +974,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #if CYGMULTIWINDOW_DEBUG winDebug("\tSIZE_MINIMIZED\n"); #endif - if (winIsInternalWMRunning(pScreenInfo)) { - /* Raise the window to the top in Z order */ - wmMsg.msg = WM_WM_LOWER; - if (fWMMsgInitialized) - winSendMessageToWM(pScreenPriv->pWMInfo, &wmMsg); - } + winWindowsWMSendEvent(WindowsWMControllerNotify, WindowsWMControllerNotifyMask, 1, @@ -1209,9 +1010,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* Perform the resize and notify the X client */ if (!pRLWinPriv->fMovingOrSizing) { - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); - winMWExtWMResizeXWindow(pWin, (short) LOWORD(lParam) - wBorderWidth(pWin) * 2, (short) HIWORD(lParam) @@ -1224,10 +1022,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) winDebug("winMWExtWMWindowProc - WM_ACTIVATEAPP\n"); #endif if (wParam) { - if (winIsInternalWMRunning(pScreenInfo)) { - } - else { - } winWindowsWMSendEvent(WindowsWMActivationNotify, WindowsWMActivationNotifyMask, 1, @@ -1268,9 +1062,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) MapWindowPoints(hwnd, HWND_DESKTOP, (LPPOINT) &rcClient, 2); - if (winIsInternalWMRunning(pScreenInfo)) - winAdjustXWindow(pWin, hwnd); - winMWExtWMMoveResizeXWindow(pWin, rcClient.left - wBorderWidth(pWin) - GetSystemMetrics(SM_XVIRTUALSCREEN), rcClient.top - wBorderWidth(pWin) @@ -1281,14 +1072,6 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) - wBorderWidth(pWin) * 2); break; - case WM_MANAGE: - ErrorF("winMWExtWMWindowProc - WM_MANAGE\n"); - break; - - case WM_UNMANAGE: - ErrorF("winMWExtWMWindowProc - WM_UNMANAGE\n"); - break; - default: break; } diff --git a/xserver/hw/xwin/winwindow.h b/xserver/hw/xwin/winwindow.h index 7e6bd565c..65e4bea0c 100644 --- a/xserver/hw/xwin/winwindow.h +++ b/xserver/hw/xwin/winwindow.h @@ -1,5 +1,3 @@ -#if !defined(_WINWINDOW_H_) -#define _WINWINDOW_H_ /* *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. *Copyright (C) Colin Harrison 2005-2009 @@ -31,6 +29,8 @@ * Authors: Kensuke Matsuzaki * Colin Harrison */ +#if !defined(_WINWINDOW_H_) +#define _WINWINDOW_H_ #ifndef NO #define NO 0 @@ -102,7 +102,6 @@ typedef struct _winWMMessageRec { #define WM_WM_SIZE (WM_USER + 2) #define WM_WM_RAISE (WM_USER + 3) #define WM_WM_LOWER (WM_USER + 4) -#define WM_WM_MAP (WM_USER + 5) #define WM_WM_UNMAP (WM_USER + 6) #define WM_WM_KILL (WM_USER + 7) #define WM_WM_ACTIVATE (WM_USER + 8) @@ -112,8 +111,6 @@ typedef struct _winWMMessageRec { #define WM_WM_MAP2 (WM_USER + 12) #define WM_WM_MAP3 (WM_USER + 13) #define WM_WM_HINTS_EVENT (WM_USER + 14) -#define WM_MANAGE (WM_USER + 100) -#define WM_UNMANAGE (WM_USER + 102) #define MwmHintsDecorations (1L << 1) @@ -125,10 +122,16 @@ typedef struct _winWMMessageRec { #define MwmDecorMinimize (1L << 5) #define MwmDecorMaximize (1L << 6) -/* This structure only contains 3 elements... the Motif 2.0 structure -contains 5... we only need the first 3... so that is all we will define */ +/* + This structure only contains 3 elements. The Motif 2.0 structure contains 5, + but we only need the first 3, so that is all we will define + + This structure represents xcb_get_property()'s view of the property as a + sequence of ints, rather than XGetWindowProperty()'s view of the property as a + sequence of arch-dependent longs. +*/ typedef struct MwmHints { - unsigned long flags, functions, decorations; + unsigned int flags, functions, decorations; } MwmHints; #define PropMwmHintsElements 3 @@ -142,14 +145,11 @@ winInitWM(void **ppWMInfo, pthread_t * ptWMProc, pthread_t * ptXMsgProc, pthread_mutex_t * ppmServerStarted, - int dwScreen, HWND hwndScreen, BOOL allowOtherWM); + int dwScreen, HWND hwndScreen); void winDeinitMultiWindowWM(void); -void - winMinimizeWindow(Window id); - void winPropertyStoreInit(void); @@ -160,7 +160,7 @@ void winSetAppUserModelID(HWND hWnd, const char *AppID); void - winShowWindowOnTaskbar(HWND hWnd, BOOL show); + winShowWindowOnTaskbar(HWND hWnd, Bool show); #endif /* XWIN_MULTIWINDOW */ #endif diff --git a/xserver/hw/xwin/winwindowswm.c b/xserver/hw/xwin/winwindowswm.c index db41d6b60..b9399fae3 100644 --- a/xserver/hw/xwin/winwindowswm.c +++ b/xserver/hw/xwin/winwindowswm.c @@ -312,7 +312,7 @@ ProcWindowsWMFrameGetRect(ClientPtr client) REQUEST(xWindowsWMFrameGetRectReq); #if CYGMULTIWINDOW_DEBUG - ErrorF("ProcWindowsWMFrameGetRect %d %d\n", + ErrorF("ProcWindowsWMFrameGetRect %zu %d\n", (sizeof(xWindowsWMFrameGetRectReq) >> 2), (int) client->req_len); #endif diff --git a/xserver/hw/xwin/winwndproc.c b/xserver/hw/xwin/winwndproc.c index 123b84f31..7236a9520 100644 --- a/xserver/hw/xwin/winwndproc.c +++ b/xserver/hw/xwin/winwndproc.c @@ -162,7 +162,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) * their own mode when they become active. */ if (s_pScreenInfo->fFullScreen - || (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)) { + && (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)) { break; } @@ -290,22 +290,16 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) * the display dimensions change. */ - /* - * NOTE: The non-DirectDraw engines set the ReleasePrimarySurface - * and CreatePrimarySurface function pointers to point - * to the no operation function, NoopDDA. This allows us - * to blindly call these functions, even if they are not - * relevant to the current engine (e.g., Shadow GDI). - */ - winDebug ("winWindowProc - WM_DISPLAYCHANGE - Releasing and recreating primary surface\n"); /* Release the old primary surface */ - (*s_pScreenPriv->pwinReleasePrimarySurface) (s_pScreen); + if (*s_pScreenPriv->pwinReleasePrimarySurface) + (*s_pScreenPriv->pwinReleasePrimarySurface) (s_pScreen); /* Create the new primary surface */ - (*s_pScreenPriv->pwinCreatePrimarySurface) (s_pScreen); + if (*s_pScreenPriv->pwinCreatePrimarySurface) + (*s_pScreenPriv->pwinCreatePrimarySurface) (s_pScreen); } } @@ -322,7 +316,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #endif /* Break if we do not allow resizing */ - if ((s_pScreenInfo->iResizeMode == notAllowed) + if ((s_pScreenInfo->iResizeMode == resizeNotAllowed) || !s_pScreenInfo->fDecoration #ifdef XWIN_MULTIWINDOWEXTWM || s_pScreenInfo->fMWExtWM @@ -1107,14 +1101,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) winFixShiftKeys(iScanCode); return 0; - case WM_HOTKEY: - if (s_pScreenPriv == NULL) - break; - - /* Call the engine-specific hot key handler */ - (*s_pScreenPriv->pwinHotKeyAltTab) (s_pScreen); - return 0; - case WM_ACTIVATE: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; @@ -1192,7 +1178,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #ifdef XWIN_MULTIWINDOWEXTWM if (s_pScreenPriv->fActive) { /* Restack all window unless using built-in wm. */ - if (s_pScreenInfo->fInternalWM && s_pScreenInfo->fAnotherWMRunning) + if (s_pScreenInfo->fMWExtWM) winMWExtWMRestackWindows(s_pScreen); } #endif @@ -1229,7 +1215,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) default: /* It's probably one of the custom menus... */ - if (HandleCustomWM_COMMAND(0, LOWORD(wParam))) + if (HandleCustomWM_COMMAND(0, LOWORD(wParam), s_pScreenPriv)) return 0; } break; @@ -1256,28 +1242,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } break; -#ifdef XWIN_MULTIWINDOWEXTWM - case WM_MANAGE: - ErrorF("winWindowProc - WM_MANAGE\n"); - s_pScreenInfo->fAnotherWMRunning = FALSE; - - if (s_pScreenInfo->fInternalWM) { - EnumThreadWindows(g_dwCurrentThreadID, winMWExtWMDecorateWindow, 0); - //RootlessRepositionWindows (s_pScreen); - } - break; - - case WM_UNMANAGE: - ErrorF("winWindowProc - WM_UNMANAGE\n"); - s_pScreenInfo->fAnotherWMRunning = TRUE; - - if (s_pScreenInfo->fInternalWM) { - EnumThreadWindows(g_dwCurrentThreadID, winMWExtWMDecorateWindow, 0); - winMWExtWMRestackWindows(s_pScreen); - } - break; -#endif - default: if (message == s_uTaskbarRestart) { winInitNotifyIcon(s_pScreenPriv); diff --git a/xserver/include/Makefile.am b/xserver/include/Makefile.am index b9cf584cb..cbc4a7c58 100644 --- a/xserver/include/Makefile.am +++ b/xserver/include/Makefile.am @@ -60,6 +60,7 @@ sdk_HEADERS = \ xkbsrv.h \ xkbstr.h \ xkbrules.h \ + xserver_poll.h \ xserver-properties.h nodist_sdk_HEADERS = xorg-server.h @@ -70,7 +71,7 @@ AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = \ busfault.h dbus-core.h \ dix-config-apple-verbatim.h \ - dixfontstubs.h eventconvert.h eventstr.h inpututils.h \ + eventconvert.h eventstr.h inpututils.h \ probes.h \ protocol-versions.h \ swaprep.h \ diff --git a/xserver/include/Makefile.in b/xserver/include/Makefile.in index 9daafd1bf..c1ef5f054 100644 --- a/xserver/include/Makefile.in +++ b/xserver/include/Makefile.in @@ -59,9 +59,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/xwin-config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -128,7 +129,7 @@ am__sdk_HEADERS_DIST = XIstubs.h Xprintf.h callback.h client.h \ region.h regionstr.h registry.h resource.h rgb.h screenint.h \ scrnintstr.h selection.h servermd.h site.h validate.h \ displaymode.h window.h windowstr.h xkbfile.h xkbsrv.h xkbstr.h \ - xkbrules.h xserver-properties.h + xkbrules.h xserver_poll.h xserver-properties.h HEADERS = $(nodist_sdk_HEADERS) $(sdk_HEADERS) ETAGS = etags CTAGS = ctags @@ -308,6 +309,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -338,7 +342,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -433,6 +440,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -541,6 +549,7 @@ top_srcdir = @top_srcdir@ @XORG_TRUE@ xkbsrv.h \ @XORG_TRUE@ xkbstr.h \ @XORG_TRUE@ xkbrules.h \ +@XORG_TRUE@ xserver_poll.h \ @XORG_TRUE@ xserver-properties.h @XORG_TRUE@nodist_sdk_HEADERS = xorg-server.h @@ -548,7 +557,7 @@ AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = \ busfault.h dbus-core.h \ dix-config-apple-verbatim.h \ - dixfontstubs.h eventconvert.h eventstr.h inpututils.h \ + eventconvert.h eventstr.h inpututils.h \ probes.h \ protocol-versions.h \ swaprep.h \ diff --git a/xserver/include/dix-config.h.in b/xserver/include/dix-config.h.in index 78ac341d3..2d63a0f6b 100644 --- a/xserver/include/dix-config.h.in +++ b/xserver/include/dix-config.h.in @@ -146,6 +146,12 @@ /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP +/* Define to 1 if you have the function pthread_setname_np(const char*) */ +#undef HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID + +/* Define to 1 if you have the function pthread_setname_np(pthread_t, const char*) */ +#undef HAVE_PTHREAD_SETNAME_NP_WITH_TID + /* Define to 1 if you have the header file. */ #undef HAVE_NDBM_H @@ -509,15 +515,6 @@ /* Ask fontsproto to make font path element names const */ #define FONT_PATH_ELEMENT_NAME_CONST 1 -/* Listen on TCP socket */ -#undef LISTEN_TCP - -/* Listen on Unix socket */ -#undef LISTEN_UNIX - -/* Listen on local socket */ -#undef LISTEN_LOCAL - /* Build GLAMOR */ #undef GLAMOR @@ -542,7 +539,19 @@ /* Define if no local socket credentials interface exists */ #undef NO_LOCAL_CLIENT_CRED +/* Have setitimer support */ +#undef HAVE_SETITIMER + /* Have posix_fallocate() */ #undef HAVE_POSIX_FALLOCATE +/* Use input thread */ +#undef INPUTTHREAD + +/* Have poll() */ +#undef HAVE_POLL + +/* Have epoll_create1() */ +#undef HAVE_EPOLL_CREATE1 + #endif /* _DIX_CONFIG_H_ */ diff --git a/xserver/include/dix.h b/xserver/include/dix.h index d49d05569..240018b8d 100644 --- a/xserver/include/dix.h +++ b/xserver/include/dix.h @@ -136,6 +136,12 @@ typedef HWEventQueueType *HWEventQueuePtr; extern _X_EXPORT HWEventQueuePtr checkForInput[2]; +static inline _X_NOTSAN Bool +InputCheckPending(void) +{ + return (*checkForInput[0] != *checkForInput[1]); +} + typedef struct _TimeStamp { CARD32 months; /* really ~49.7 days */ CARD32 milliseconds; @@ -208,28 +214,28 @@ extern _X_EXPORT int AlterSaveSetForClient(ClientPtr /*client */ , extern _X_EXPORT void DeleteWindowFromAnySaveSet(WindowPtr /*pWin */ ); -extern _X_EXPORT void BlockHandler(void *pTimeout, - void *pReadmask); +extern _X_EXPORT void BlockHandler(void *timeout); -extern _X_EXPORT void WakeupHandler(int result, - void *pReadmask); +extern _X_EXPORT void WakeupHandler(int result); void - EnableLimitedSchedulingLatency(void); +EnableLimitedSchedulingLatency(void); void - DisableLimitedSchedulingLatency(void); +DisableLimitedSchedulingLatency(void); -typedef void (*WakeupHandlerProcPtr) (void *blockData, - int result, - void *pReadmask); +typedef void (*ServerBlockHandlerProcPtr) (void *blockData, + void *timeout); -extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, - WakeupHandlerProcPtr wakeupHandler, +typedef void (*ServerWakeupHandlerProcPtr) (void *blockData, + int result); + +extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler, + ServerWakeupHandlerProcPtr wakeupHandler, void *blockData); -extern _X_EXPORT void RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, - WakeupHandlerProcPtr wakeupHandler, +extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler, + ServerWakeupHandlerProcPtr wakeupHandler, void *blockData); extern _X_EXPORT void InitBlockAndWakeupHandlers(void); @@ -594,6 +600,8 @@ typedef struct { DeviceIntPtr device; } DeviceEventInfoRec; +extern _X_EXPORT CallbackListPtr RootWindowFinalizeCallback; + extern int XItoCoreType(int xi_type); extern Bool diff --git a/xserver/include/dixfont.h b/xserver/include/dixfont.h index b44996ffa..3a38d10c5 100644 --- a/xserver/include/dixfont.h +++ b/xserver/include/dixfont.h @@ -29,7 +29,6 @@ SOFTWARE. #include "closure.h" #include #include -#include #define NullDIXFontProp ((DIXFontPropPtr)0) @@ -98,16 +97,11 @@ extern _X_EXPORT void InitFonts(void); extern _X_EXPORT void FreeFonts(void); -extern _X_EXPORT FontPtr find_old_font(XID /*id */ ); - -#define GetGlyphs dixGetGlyphs -extern _X_EXPORT void dixGetGlyphs(FontPtr /*font */ , - unsigned long /*count */ , - unsigned char * /*chars */ , - FontEncoding /*fontEncoding */ , - unsigned long * /*glyphcount */ , - CharInfoPtr * /*glyphs */ ); - -extern _X_EXPORT void register_fpe_functions(void); +extern _X_EXPORT void GetGlyphs(FontPtr /*font */ , + unsigned long /*count */ , + unsigned char * /*chars */ , + FontEncoding /*fontEncoding */ , + unsigned long * /*glyphcount */ , + CharInfoPtr * /*glyphs */ ); #endif /* DIXFONT_H */ diff --git a/xserver/include/dixfontstr.h b/xserver/include/dixfontstr.h index ce878d06a..7deb84ac5 100644 --- a/xserver/include/dixfontstr.h +++ b/xserver/include/dixfontstr.h @@ -27,6 +27,7 @@ SOFTWARE. #include "servermd.h" #include "dixfont.h" #include +#include #include "closure.h" #include /* for xQueryFontReply */ diff --git a/xserver/include/dixfontstubs.h b/xserver/include/dixfontstubs.h deleted file mode 100644 index 535d312e6..000000000 --- a/xserver/include/dixfontstubs.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef DIXFONTSTUBS_H -#define DIXFONTSTUBS_H 1 - -/* - * libXfont stubs replacements - * This header exists solely for the purpose of sdksyms generation; - * source code should #include "dixfonts.h" instead, which pulls in these - * declarations from - */ -extern _X_EXPORT int client_auth_generation(ClientPtr client); - -extern _X_EXPORT void DeleteFontClientID(Font id); - -extern _X_EXPORT int GetDefaultPointSize(void); - -extern _X_EXPORT Font GetNewFontClientID(void); - -extern _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe, - BlockHandlerProcPtr block_handler); - -extern _X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func); - -extern _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe, - BlockHandlerProcPtr blockHandler, - Bool all); - -extern _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id); - -#endif diff --git a/xserver/include/dixstruct.h b/xserver/include/dixstruct.h index 757506623..21a6b8a8d 100644 --- a/xserver/include/dixstruct.h +++ b/xserver/include/dixstruct.h @@ -76,6 +76,8 @@ typedef struct _saveSet { typedef struct _Client { void *requestBuffer; void *osPrivate; /* for OS layer, including scheduler */ + struct xorg_list ready; /* List of clients ready to run */ + struct xorg_list output_pending; /* List of clients with output queued */ Mask clientAsMask; short index; unsigned char majorOp, minorOp; @@ -130,10 +132,53 @@ extern long SmartScheduleTime; extern long SmartScheduleInterval; extern long SmartScheduleSlice; extern long SmartScheduleMaxSlice; -extern Bool SmartScheduleDisable; +#if HAVE_SETITIMER +extern Bool SmartScheduleSignalEnable; +#else +#define SmartScheduleSignalEnable FALSE +#endif extern void SmartScheduleStartTimer(void); extern void SmartScheduleStopTimer(void); +/* Client has requests queued or data on the network */ +void mark_client_ready(ClientPtr client); + +/* + * Client has requests queued or data on the network, but awaits a + * server grab release + */ +void mark_client_saved_ready(ClientPtr client); + +/* Client has no requests queued and no data on network */ +void mark_client_not_ready(ClientPtr client); + +static inline Bool client_is_ready(ClientPtr client) +{ + return !xorg_list_is_empty(&client->ready); +} + +Bool +clients_are_ready(void); + +extern struct xorg_list output_pending_clients; + +static inline void +output_pending_mark(ClientPtr client) +{ + if (!client->clientGone && xorg_list_is_empty(&client->output_pending)) + xorg_list_append(&client->output_pending, &output_pending_clients); +} + +static inline void +output_pending_clear(ClientPtr client) +{ + xorg_list_del(&client->output_pending); +} + +static inline Bool any_output_pending(void) { + return !xorg_list_is_empty(&output_pending_clients); +} + #define SMART_MAX_PRIORITY (20) #define SMART_MIN_PRIORITY (-20) diff --git a/xserver/include/do-not-use-config.h.in b/xserver/include/do-not-use-config.h.in index bbbe5ab2c..be89b5513 100644 --- a/xserver/include/do-not-use-config.h.in +++ b/xserver/include/do-not-use-config.h.in @@ -3,9 +3,6 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD -/* Build AIGLX loader */ -#undef AIGLX - /* Default base font path */ #undef BASE_FONT_PATH @@ -102,15 +99,15 @@ /* Build DRI2 extension */ #undef DRI2 -/* Build DRI2 AIGLX loader */ -#undef DRI2_AIGLX - /* Build DRI3 extension */ #undef DRI3 /* Default DRI driver path */ #undef DRI_DRIVER_PATH +/* Fallback input driver */ +#undef FALLBACK_INPUT_DRIVER + /* Build glamor */ #undef GLAMOR @@ -176,6 +173,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `epoll_create1' function. */ +#undef HAVE_EPOLL_CREATE1 + /* Have execinfo.h */ #undef HAVE_EXECINFO_H @@ -266,9 +266,24 @@ /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H +/* Define to 1 if you have the `poll' function. */ +#undef HAVE_POLL + /* Define to 1 if you have the `posix_fallocate' function. */ #undef HAVE_POSIX_FALLOCATE +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Have PTHREAD_PRIO_INHERIT. */ +#undef HAVE_PTHREAD_PRIO_INHERIT + +/* Have function pthread_setname_np(const char*) */ +#undef HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID + +/* Have function pthread_setname_np(pthread_t, const char*) */ +#undef HAVE_PTHREAD_SETNAME_NP_WITH_TID + /* Define to 1 if you have the `reallocarray' function. */ #undef HAVE_REALLOCARRAY @@ -278,6 +293,9 @@ /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID +/* Define to 1 if you have the `setitimer' function. */ +#undef HAVE_SETITIMER + /* Use CommonCrypto SHA1 functions */ #undef HAVE_SHA1_IN_COMMONCRYPTO @@ -373,6 +391,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSMACROS_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H @@ -410,6 +431,9 @@ /* Have xshmfence support */ #undef HAVE_XSHMFENCE +/* Use a separate input thread */ +#undef INPUTTHREAD + /* Support IPv6 for TCP connections */ #undef IPv6 @@ -519,6 +543,10 @@ /* Overall prefix */ #undef PROJECTROOT +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + /* Support RANDR extension */ #undef RANDR @@ -594,9 +622,6 @@ /* BSD i386 iopl */ #undef USE_I386_IOPL -/* Use SIGIO handlers for input device events by default */ -#undef USE_SIGIO_BY_DEFAULT - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE diff --git a/xserver/include/eventstr.h b/xserver/include/eventstr.h index cce903d04..74469613a 100644 --- a/xserver/include/eventstr.h +++ b/xserver/include/eventstr.h @@ -25,6 +25,7 @@ #ifndef EVENTSTR_H #define EVENTSTR_H +#include "inputstr.h" #include /** * @file events.h @@ -77,6 +78,14 @@ enum EventType { ET_Internal = 0xFF /* First byte */ }; +/** + * How a DeviceEvent was provoked + */ +enum DeviceEventSource { + EVENT_SOURCE_NORMAL = 0, /**< Default: from a user action (e.g. key press) */ + EVENT_SOURCE_FOCUS, /**< Keys or buttons previously down on focus-in */ +}; + /** * Used for ALL input device events internal in the server until * copied into the matching protocol event. @@ -124,6 +133,7 @@ struct _DeviceEvent { int key_repeat; /**< Internally-generated key repeat event */ uint32_t flags; /**< Flags to be copied into the generated event */ uint32_t resource; /**< Touch event resource, only for TOUCH_REPLAYING */ + enum DeviceEventSource source_type; /**< How this event was provoked */ }; /** diff --git a/xserver/include/globals.h b/xserver/include/globals.h index 858c9a375..693bdf4f2 100644 --- a/xserver/include/globals.h +++ b/xserver/include/globals.h @@ -2,8 +2,6 @@ #ifndef _XSERV_GLOBAL_H_ #define _XSERV_GLOBAL_H_ -#include - #include "window.h" /* for WindowPtr */ #include "extinit.h" diff --git a/xserver/include/input.h b/xserver/include/input.h index d8bd9c602..6c9e45df6 100644 --- a/xserver/include/input.h +++ b/xserver/include/input.h @@ -56,6 +56,7 @@ SOFTWARE. #include "xkbrules.h" #include "events.h" #include "list.h" +#include "os.h" #include #define DEVICE_INIT 0 @@ -236,6 +237,8 @@ typedef struct _InputAttributes { #define ATTR_TABLET (1<<3) #define ATTR_TOUCHPAD (1<<4) #define ATTR_TOUCHSCREEN (1<<5) +#define ATTR_KEY (1<<6) +#define ATTR_TABLET_PAD (1<<7) /* Key/Button has been run through all input processing and events sent to clients. */ #define KEY_PROCESSED 1 @@ -632,6 +635,7 @@ extern _X_EXPORT int NewInputDeviceRequest(InputOption *options, InputAttributes * attrs, DeviceIntPtr *dev); extern _X_EXPORT void DeleteInputDeviceRequest(DeviceIntPtr dev); +extern _X_EXPORT void RemoveInputDeviceTraces(const char *config_info); extern _X_EXPORT void DDXRingBell(int volume, int pitch, int duration); @@ -672,12 +676,15 @@ extern _X_EXPORT Bool valuator_mask_fetch(const ValuatorMask *mask, int valnum, int *val); extern _X_EXPORT Bool valuator_mask_fetch_double(const ValuatorMask *mask, int valnum, double *val); - extern _X_EXPORT Bool valuator_mask_has_unaccelerated(const ValuatorMask *mask); extern _X_EXPORT void valuator_mask_set_unaccelerated(ValuatorMask *mask, int valuator, double accel, double unaccel); +extern _X_EXPORT void valuator_mask_set_absolute_unaccelerated(ValuatorMask *mask, + int valuator, + int absolute, + double unaccel); extern _X_EXPORT double valuator_mask_get_accelerated(const ValuatorMask *mask, int valuator); extern _X_EXPORT double valuator_mask_get_unaccelerated(const ValuatorMask *mask, @@ -712,4 +719,21 @@ extern _X_HIDDEN void input_constrain_cursor(DeviceIntPtr pDev, ScreenPtr screen int *out_x, int *out_y, int *nevents, InternalEvent* events); +extern _X_EXPORT void input_lock(void); +extern _X_EXPORT void input_unlock(void); +extern _X_EXPORT void input_force_unlock(void); +extern _X_EXPORT int in_input_thread(void); + +extern void InputThreadPreInit(void); +extern void InputThreadInit(void); +extern void InputThreadFini(void); + +extern int InputThreadRegisterDev(int fd, + NotifyFdProcPtr readInputProc, + void *readInputArgs); + +extern int InputThreadUnregisterDev(int fd); + +extern _X_EXPORT Bool InputThreadEnable; + #endif /* INPUT_H */ diff --git a/xserver/include/inpututils.h b/xserver/include/inpututils.h index 4e9081563..48c95c4c1 100644 --- a/xserver/include/inpututils.h +++ b/xserver/include/inpututils.h @@ -30,6 +30,7 @@ #define INPUTUTILS_H #include "input.h" +#include "eventstr.h" #include extern Mask event_filters[MAXDEVICES][MAXEVENTS]; @@ -43,7 +44,8 @@ struct _ValuatorMask { }; extern void verify_internal_event(const InternalEvent *ev); -extern void init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms); +extern void init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms, + enum DeviceEventSource event_source); extern int event_get_corestate(DeviceIntPtr mouse, DeviceIntPtr kbd); extern void event_set_state(DeviceIntPtr mouse, DeviceIntPtr kbd, DeviceEvent *event); diff --git a/xserver/include/misc.h b/xserver/include/misc.h index 56e138c6b..01747fd38 100644 --- a/xserver/include/misc.h +++ b/xserver/include/misc.h @@ -79,6 +79,7 @@ OF THIS SOFTWARE. #include #include +#include #ifndef MAXSCREENS #define MAXSCREENS 16 @@ -86,7 +87,7 @@ OF THIS SOFTWARE. #ifndef MAXGPUSCREENS #define MAXGPUSCREENS 16 #endif -#define MAXCLIENTS 512 +#define MAXCLIENTS 2048 #define LIMITCLIENTS 256 /* Must be a power of 2 and <= MAXCLIENTS */ #define MAXEXTENSIONS 128 #define MAXFORMATS 8 diff --git a/xserver/include/os.h b/xserver/include/os.h index 84a2713df..eb6192895 100644 --- a/xserver/include/os.h +++ b/xserver/include/os.h @@ -51,6 +51,9 @@ SOFTWARE. #include #include #include +#ifdef MONOTONIC_CLOCK +#include +#endif #define SCREEN_SAVER_ON 0 #define SCREEN_SAVER_OFF 1 @@ -93,8 +96,7 @@ extern _X_EXPORT void (*OsVendorVErrorFProc) (const char *, _X_ATTRIBUTE_PRINTF(1, 0); #endif -extern _X_EXPORT int WaitForSomething(int * /*pClientsReady */ - ); +extern _X_EXPORT Bool WaitForSomething(Bool clients_are_ready); extern _X_EXPORT int ReadRequestFromClient(ClientPtr /*client */ ); @@ -139,20 +141,21 @@ extern _X_EXPORT const char *ClientAuthorized(ClientPtr /*client */ , unsigned int /*string_n */ , char * /*auth_string */ ); -extern _X_EXPORT Bool EstablishNewConnections(ClientPtr clientUnused, - void *closure); - -extern _X_EXPORT void CheckConnections(void); - extern _X_EXPORT void CloseDownConnection(ClientPtr /*client */ ); -extern _X_EXPORT void AddGeneralSocket(int /*fd */ ); +typedef void (*NotifyFdProcPtr)(int fd, int ready, void *data); -extern _X_EXPORT void RemoveGeneralSocket(int /*fd */ ); +#define X_NOTIFY_NONE 0x0 +#define X_NOTIFY_READ 0x1 +#define X_NOTIFY_WRITE 0x2 +#define X_NOTIFY_ERROR 0x4 /* don't need to select for, always reported */ -extern _X_EXPORT void AddEnabledDevice(int /*fd */ ); +extern _X_EXPORT Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data); -extern _X_EXPORT void RemoveEnabledDevice(int /*fd */ ); +static inline void RemoveNotifyFd(int fd) +{ + (void) SetNotifyFd(fd, NULL, X_NOTIFY_NONE, NULL); +} extern _X_EXPORT int OnlyListenToOneClient(ClientPtr /*client */ ); @@ -170,11 +173,14 @@ extern _X_EXPORT void ListenOnOpenFD(int /* fd */ , int /* noxauth */ ); extern _X_EXPORT Bool AddClientOnOpenFD(int /* fd */ ); +#ifdef MONOTONIC_CLOCK +extern void ForceClockId(clockid_t /* forced_clockid */); +#endif + extern _X_EXPORT CARD32 GetTimeInMillis(void); extern _X_EXPORT CARD64 GetTimeInMicros(void); -extern _X_EXPORT void AdjustWaitForDelay(void *waitTime, - unsigned long newdelay); +extern _X_EXPORT void AdjustWaitForDelay(void *waitTime, int newdelay); typedef struct _OsTimerRec *OsTimerPtr; @@ -333,12 +339,6 @@ OsBlockSignals(void); extern _X_EXPORT void OsReleaseSignals(void); -extern _X_EXPORT int -OsBlockSIGIO(void); - -extern _X_EXPORT void -OsReleaseSIGIO(void); - extern void OsResetSignals(void); @@ -714,4 +714,9 @@ xorg_backtrace(void); extern _X_EXPORT int os_move_fd(int fd); +#include + +extern _X_EXPORT int +xthread_sigmask(int how, const sigset_t *set, sigset_t *oldest); + #endif /* OS_H */ diff --git a/xserver/include/pixmap.h b/xserver/include/pixmap.h index c6a773649..86b513d47 100644 --- a/xserver/include/pixmap.h +++ b/xserver/include/pixmap.h @@ -115,6 +115,9 @@ extern _X_EXPORT void FreePixmap(PixmapPtr /*pPixmap */ ); extern _X_EXPORT PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave); +extern _X_EXPORT void +PixmapUnshareSlavePixmap(PixmapPtr slave_pixmap); + #define HAS_DIRTYTRACKING_ROTATION 1 extern _X_EXPORT Bool PixmapStartDirtyTracking(PixmapPtr src, diff --git a/xserver/include/privates.h b/xserver/include/privates.h index 7d1461cdb..a2bb1a43c 100644 --- a/xserver/include/privates.h +++ b/xserver/include/privates.h @@ -252,6 +252,9 @@ dixFreeScreenSpecificPrivates(ScreenPtr pScreen); extern void dixInitScreenSpecificPrivates(ScreenPtr pScreen); +/* is this private created - so hotplug can avoid crashing */ +Bool dixPrivatesCreated(DevPrivateType type); + extern _X_EXPORT void * _dixAllocateScreenObjectWithPrivates(ScreenPtr pScreen, unsigned size, diff --git a/xserver/include/property.h b/xserver/include/property.h index e350513a4..be875e917 100644 --- a/xserver/include/property.h +++ b/xserver/include/property.h @@ -67,15 +67,6 @@ extern _X_EXPORT int dixChangeWindowProperty(ClientPtr pClient, void *value, Bool sendevent); -extern _X_EXPORT int ChangeWindowProperty(WindowPtr pWin, - Atom property, - Atom type, - int format, - int mode, - unsigned long len, - void *value, - Bool sendevent); - extern _X_EXPORT int DeleteProperty(ClientPtr /*client */ , WindowPtr /*pWin */ , Atom /*propName */ ); diff --git a/xserver/include/protocol-versions.h b/xserver/include/protocol-versions.h index be532ff55..b4498927b 100644 --- a/xserver/include/protocol-versions.h +++ b/xserver/include/protocol-versions.h @@ -111,6 +111,11 @@ #define SERVER_SYNC_MAJOR_VERSION 3 #define SERVER_SYNC_MINOR_VERSION 1 +/* Windows DRI */ +#define SERVER_WINDOWSDRI_MAJOR_VERSION 1 +#define SERVER_WINDOWSDRI_MINOR_VERSION 0 +#define SERVER_WINDOWSDRI_PATCH_VERSION 0 + /* Windows WM */ #define SERVER_WINDOWSWM_MAJOR_VERSION 1 #define SERVER_WINDOWSWM_MINOR_VERSION 0 diff --git a/xserver/include/scrnintstr.h b/xserver/include/scrnintstr.h index 2e617c466..f898392fe 100644 --- a/xserver/include/scrnintstr.h +++ b/xserver/include/scrnintstr.h @@ -233,6 +233,18 @@ typedef Bool (*SetCursorPositionProcPtr) (DeviceIntPtr /* pDev */ , int /*y */ , Bool /*generateEvent */ ); +typedef void (*CursorWarpedToProcPtr) (DeviceIntPtr /* pDev */ , + ScreenPtr /*pScreen */ , + ClientPtr /*pClient */ , + WindowPtr /*pWindow */ , + SpritePtr /*pSprite */ , + int /*x */ , + int /*y */ ); + +typedef void (*CurserConfinedToProcPtr) (DeviceIntPtr /* pDev */ , + ScreenPtr /*pScreen */ , + WindowPtr /*pWindow */ ); + typedef Bool (*CreateGCProcPtr) (GCPtr /*pGC */ ); typedef Bool (*CreateColormapProcPtr) (ColormapPtr /*pColormap */ ); @@ -258,12 +270,15 @@ typedef void (*ResolveColorProcPtr) (unsigned short * /*pred */ , typedef RegionPtr (*BitmapToRegionProcPtr) (PixmapPtr /*pPix */ ); typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr pScreen, - void *pTimeout, - void *pReadmask); + void *timeout); +/* result has three possible values: + * < 0 - error + * = 0 - timeout + * > 0 - activity + */ typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr pScreen, - unsigned long result, - void *pReadMask); + int result); typedef Bool (*CreateScreenResourcesProcPtr) (ScreenPtr /*pScreen */ ); @@ -344,13 +359,40 @@ typedef Bool (*SharePixmapBackingProcPtr)(PixmapPtr, ScreenPtr, void **); typedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *); +#define HAS_SYNC_SHARED_PIXMAP 1 +/* The SyncSharedPixmap hook has two purposes: + * + * 1. If the master driver has it, the slave driver can use it to + * synchronize the shared pixmap contents with the screen pixmap. + * 2. If the slave driver has it, the master driver can expect the slave + * driver to call the master screen's SyncSharedPixmap hook, so the master + * driver doesn't have to synchronize the shared pixmap contents itself, + * e.g. from the BlockHandler. + * + * A driver must only set the hook if it handles both cases correctly. + * + * The argument is the slave screen's pixmap_dirty_list entry, the hook is + * responsible for finding the corresponding entry in the master screen's + * pixmap_dirty_list. + */ +typedef void (*SyncSharedPixmapProcPtr)(PixmapDirtyUpdatePtr); + typedef Bool (*StartPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr, int x, int y, int dst_x, int dst_y, Rotation rotation); +typedef Bool (*PresentSharedPixmapProcPtr)(PixmapPtr); + +typedef Bool (*RequestSharedPixmapNotifyDamageProcPtr)(PixmapPtr); + typedef Bool (*StopPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr); +typedef Bool (*StopFlippingPixmapTrackingProcPtr)(PixmapPtr, + PixmapPtr, PixmapPtr); + +typedef Bool (*SharedPixmapNotifyDamageProcPtr)(PixmapPtr); + typedef Bool (*ReplaceScanoutPixmapProcPtr)(DrawablePtr, PixmapPtr, Bool); typedef WindowPtr (*XYToWindowProcPtr)(ScreenPtr pScreen, @@ -524,6 +566,8 @@ typedef struct _Screen { UnrealizeCursorProcPtr UnrealizeCursor; RecolorCursorProcPtr RecolorCursor; SetCursorPositionProcPtr SetCursorPosition; + CursorWarpedToProcPtr CursorWarpedTo; + CurserConfinedToProcPtr CursorConfinedTo; /* GC procedures */ @@ -590,23 +634,28 @@ typedef struct _Screen { Bool isGPU; - struct xorg_list unattached_list; - struct xorg_list unattached_head; - + /* Info on this screen's slaves (if any) */ + struct xorg_list slave_list; + struct xorg_list slave_head; + int output_slaves; + /* Info for when this screen is a slave */ ScreenPtr current_master; - - struct xorg_list output_slave_list; - struct xorg_list output_head; + Bool is_output_slave; + Bool is_offload_slave; SharePixmapBackingProcPtr SharePixmapBacking; SetSharedPixmapBackingProcPtr SetSharedPixmapBacking; StartPixmapTrackingProcPtr StartPixmapTracking; StopPixmapTrackingProcPtr StopPixmapTracking; + SyncSharedPixmapProcPtr SyncSharedPixmap; + + SharedPixmapNotifyDamageProcPtr SharedPixmapNotifyDamage; + RequestSharedPixmapNotifyDamageProcPtr RequestSharedPixmapNotifyDamage; + PresentSharedPixmapProcPtr PresentSharedPixmap; + StopFlippingPixmapTrackingProcPtr StopFlippingPixmapTracking; struct xorg_list pixmap_dirty_list; - struct xorg_list offload_slave_list; - struct xorg_list offload_head; ReplaceScanoutPixmapProcPtr ReplaceScanoutPixmap; XYToWindowProcPtr XYToWindow; diff --git a/xserver/include/xkbsrv.h b/xserver/include/xkbsrv.h index 7e71089f1..6e4ad44d4 100644 --- a/xserver/include/xkbsrv.h +++ b/xserver/include/xkbsrv.h @@ -142,6 +142,10 @@ typedef struct _XkbFilter { struct _XkbFilter *next; } XkbFilterRec, *XkbFilterPtr; +typedef Bool (*XkbSrvCheckRepeatPtr) (DeviceIntPtr dev, + struct _XkbSrvInfo * /* xkbi */ , + unsigned /* keycode */); + typedef struct _XkbSrvInfo { XkbStateRec prev_state; XkbStateRec state; @@ -189,6 +193,8 @@ typedef struct _XkbSrvInfo { int szFilters; XkbFilterPtr filters; + + XkbSrvCheckRepeatPtr checkRepeat; } XkbSrvInfoRec, *XkbSrvInfoPtr; #define XkbSLI_IsDefault (1L<<0) diff --git a/xserver/include/xorg-config.h.in b/xserver/include/xorg-config.h.in index a2198b642..d910f84a0 100644 --- a/xserver/include/xorg-config.h.in +++ b/xserver/include/xorg-config.h.in @@ -124,12 +124,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MKDEV_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSMACROS_H + /* Path to text files containing PCI IDs */ #undef PCI_TXT_IDS_PATH -/* Use SIGIO handlers for input device events by default */ -#undef USE_SIGIO_BY_DEFAULT - /* Build with libdrm support */ #undef WITH_LIBDRM @@ -151,6 +151,9 @@ /* Support APM/ACPI power management in the server */ #undef XF86PM +/* Fallback input driver if the assigned driver fails */ +#undef FALLBACK_INPUT_DRIVER + /* Use X server privilege separation */ #undef X_PRIVSEP diff --git a/xserver/include/xserver_poll.h b/xserver/include/xserver_poll.h new file mode 100644 index 000000000..110d30cc7 --- /dev/null +++ b/xserver/include/xserver_poll.h @@ -0,0 +1,55 @@ +/* + * Copyright © 2016 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _XSERVER_POLL_H_ +#define _XSERVER_POLL_H_ + +#ifndef _DIX_CONFIG_H_ +#error must inclue dix-config.h to use xserver_poll.h +#endif + +#if HAVE_POLL +#include +#define xserver_poll(fds, nfds, timeout) poll(fds, nfds, timeout) +#else + +#define POLLIN 0x01 +#define POLLPRI 0x02 +#define POLLOUT 0x04 +#define POLLERR 0x08 +#define POLLHUP 0x10 +#define POLLNVAL 0x20 + +struct pollfd +{ + int fd; + short events; + short revents; +}; + +typedef unsigned long nfds_t; + +int xserver_poll (struct pollfd *pArray, nfds_t n_fds, int timeout); + +#endif + +#endif /* _XSERVER_POLL_H_ */ diff --git a/xserver/m4/ax_pthread.m4 b/xserver/m4/ax_pthread.m4 new file mode 100644 index 000000000..e77541cea --- /dev/null +++ b/xserver/m4/ax_pthread.m4 @@ -0,0 +1,337 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2011 Daniel Richard G. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 21 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes]) + AC_MSG_RESULT([$ax_pthread_ok]) + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case ${host_os} in + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; + netbsd*) + # use libc stubs, don't link against libpthread, to allow + # dynamic loading + ax_pthread_flags="" + ;; +esac + +# Clang doesn't consider unrecognized options an error unless we specify +# -Werror. We throw in some extra Clang-specific options to ensure that +# this doesn't happen for GCC, which also accepts -Werror. + +AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags]) +save_CFLAGS="$CFLAGS" +ax_pthread_extra_flags="-Werror" +CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])], + [AC_MSG_RESULT([yes])], + [ax_pthread_extra_flags= + AC_MSG_RESULT([no])]) +CFLAGS="$save_CFLAGS" + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT([$ax_pthread_ok]) + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $attr; return attr /* ; */])], + [attr_name=$attr; break], + []) + done + AC_MSG_RESULT([$attr_name]) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name], + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + # TODO: What about Clang on Solaris? + flag="-mt -D_REENTRANT" + fi + ;; + esac + AC_MSG_RESULT([$flag]) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + [ax_cv_PTHREAD_PRIO_INHERIT], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != xyes; then + case $host_os in + aix*) + AS_CASE(["x/$CC"], + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], + [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + +AC_SUBST([PTHREAD_LIBS]) +AC_SUBST([PTHREAD_CFLAGS]) +AC_SUBST([PTHREAD_CC]) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff --git a/xserver/man/Makefile.in b/xserver/man/Makefile.in index ed8f55186..a79d7ec27 100644 --- a/xserver/man/Makefile.in +++ b/xserver/man/Makefile.in @@ -59,9 +59,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -317,6 +318,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -347,7 +351,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -442,6 +449,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/man/Xserver.man b/xserver/man/Xserver.man index d83294d10..506e5bb70 100644 --- a/xserver/man/Xserver.man +++ b/xserver/man/Xserver.man @@ -442,7 +442,7 @@ elapse between autorepeat-generated keystrokes). loads keyboard description in \fIfilename\fP on server startup. .SH "NETWORK CONNECTIONS" The X server supports client connections via a platform-dependent subset of -the following transport types: TCP/IP, Unix Domain sockets, DECnet, +the following transport types: TCP/IP, Unix Domain sockets, and several varieties of SVR4 local connections. See the DISPLAY NAMES section of the \fIX\fP(__miscmansuffix__) manual page to learn how to specify which transport type clients should try to use. diff --git a/xserver/mi/Makefile.in b/xserver/mi/Makefile.in index a9e18b1c6..ee8610d33 100644 --- a/xserver/mi/Makefile.in +++ b/xserver/mi/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -336,6 +337,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -366,7 +370,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -461,6 +468,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/mi/mieq.c b/xserver/mi/mieq.c index 01812bdeb..a6e867df6 100644 --- a/xserver/mi/mieq.c +++ b/xserver/mi/mieq.c @@ -87,27 +87,6 @@ typedef struct _EventQueue { static EventQueueRec miEventQueue; -#ifdef XQUARTZ -#include -static pthread_mutex_t miEventQueueMutex = PTHREAD_MUTEX_INITIALIZER; - -extern BOOL serverRunning; -extern pthread_mutex_t serverRunningMutex; -extern pthread_cond_t serverRunningCond; - -static inline void -wait_for_server_init(void) -{ - /* If the server hasn't finished initializing, wait for it... */ - if (!serverRunning) { - pthread_mutex_lock(&serverRunningMutex); - while (!serverRunning) - pthread_cond_wait(&serverRunningCond, &serverRunningMutex); - pthread_mutex_unlock(&serverRunningMutex); - } -} -#endif - static size_t mieqNumEnqueued(EventQueuePtr eventQueue) { @@ -122,7 +101,7 @@ mieqNumEnqueued(EventQueuePtr eventQueue) return n_enqueued; } -/* Pre-condition: Called with miEventQueueMutex held */ +/* Pre-condition: Called with input_lock held */ static Bool mieqGrowQueue(EventQueuePtr eventQueue, size_t new_nevents) { @@ -145,11 +124,6 @@ mieqGrowQueue(EventQueuePtr eventQueue, size_t new_nevents) n_enqueued = mieqNumEnqueued(eventQueue); - /* We block signals, so an mieqEnqueue triggered by SIGIO does not - * write to our queue as we are modifying it. - */ - OsBlockSignals(); - /* First copy the existing events */ first_hunk = eventQueue->nevents - eventQueue->head; memcpy(new_events, @@ -168,7 +142,6 @@ mieqGrowQueue(EventQueuePtr eventQueue, size_t new_nevents) for (j = 0; j < i; j++) FreeEventList(new_events[j].events, 1); free(new_events); - OsReleaseSignals(); return FALSE; } new_events[i].events = evlist; @@ -181,7 +154,6 @@ mieqGrowQueue(EventQueuePtr eventQueue, size_t new_nevents) free(eventQueue->events); eventQueue->events = new_events; - OsReleaseSignals(); return TRUE; } @@ -191,8 +163,10 @@ mieqInit(void) memset(&miEventQueue, 0, sizeof(miEventQueue)); miEventQueue.lastEventTime = GetTimeInMillis(); + input_lock(); if (!mieqGrowQueue(&miEventQueue, QUEUE_INITIAL_SIZE)) FatalError("Could not allocate event queue.\n"); + input_unlock(); SetInputCheck(&miEventQueue.head, &miEventQueue.tail); return TRUE; @@ -212,32 +186,9 @@ mieqFini(void) free(miEventQueue.events); } -/* This function will determine if the given event is allowed to used the reserved - * queue space. - */ -static Bool -mieqReservedCandidate(InternalEvent *e) -{ - switch (e->any.type) { - case ET_KeyRelease: - case ET_ButtonRelease: -#if XFreeXDGA - case ET_DGAEvent: -#endif - case ET_RawKeyRelease: - case ET_RawButtonRelease: - case ET_XQuartz: - return TRUE; - default: - return FALSE; - } -} - /* * Must be reentrant with ProcessInputEvents. Assumption: mieqEnqueue - * will never be interrupted. If this is called from both signal - * handlers and regular code, make sure the signal is suspended when - * called from regular code. + * will never be interrupted. Must be called with input_lock held */ void @@ -250,11 +201,6 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) Time time; size_t n_enqueued; -#ifdef XQUARTZ - wait_for_server_init(); - pthread_mutex_lock(&miEventQueueMutex); -#endif - verify_internal_event(e); n_enqueued = mieqNumEnqueued(&miEventQueue); @@ -267,39 +213,35 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) oldtail != miEventQueue.head) { oldtail = (oldtail - 1) % miEventQueue.nevents; } - else if ((n_enqueued + 1 == miEventQueue.nevents) || - ((n_enqueued + 1 >= miEventQueue.nevents - QUEUE_RESERVED_SIZE) && - !mieqReservedCandidate(e))) { - /* Toss events which come in late. Usually this means your server's - * stuck in an infinite loop somewhere, but SIGIO is still getting - * handled. - */ - miEventQueue.dropped++; - if (miEventQueue.dropped == 1) { - ErrorFSigSafe("[mi] EQ overflowing. Additional events will be " - "discarded until existing events are processed.\n"); - xorg_backtrace(); - ErrorFSigSafe("[mi] These backtraces from mieqEnqueue may point to " - "a culprit higher up the stack.\n"); - ErrorFSigSafe("[mi] mieq is *NOT* the cause. It is a victim.\n"); - } - else if (miEventQueue.dropped % QUEUE_DROP_BACKTRACE_FREQUENCY == 0 && - miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY <= - QUEUE_DROP_BACKTRACE_MAX) { - ErrorFSigSafe("[mi] EQ overflow continuing. %zu events have been " - "dropped.\n", miEventQueue.dropped); - if (miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY == - QUEUE_DROP_BACKTRACE_MAX) { - ErrorFSigSafe("[mi] No further overflow reports will be " - "reported until the clog is cleared.\n"); + else if (n_enqueued + 1 == miEventQueue.nevents) { + if (!mieqGrowQueue(&miEventQueue, miEventQueue.nevents << 1)) { + /* Toss events which come in late. Usually this means your server's + * stuck in an infinite loop in the main thread. + */ + miEventQueue.dropped++; + if (miEventQueue.dropped == 1) { + ErrorFSigSafe("[mi] EQ overflowing. Additional events will be " + "discarded until existing events are processed.\n"); + xorg_backtrace(); + ErrorFSigSafe("[mi] These backtraces from mieqEnqueue may point to " + "a culprit higher up the stack.\n"); + ErrorFSigSafe("[mi] mieq is *NOT* the cause. It is a victim.\n"); } - xorg_backtrace(); + else if (miEventQueue.dropped % QUEUE_DROP_BACKTRACE_FREQUENCY == 0 && + miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY <= + QUEUE_DROP_BACKTRACE_MAX) { + ErrorFSigSafe("[mi] EQ overflow continuing. %zu events have been " + "dropped.\n", miEventQueue.dropped); + if (miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY == + QUEUE_DROP_BACKTRACE_MAX) { + ErrorFSigSafe("[mi] No further overflow reports will be " + "reported until the clog is cleared.\n"); + } + xorg_backtrace(); + } + return; } - -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif - return; + oldtail = miEventQueue.tail; } evlen = e->any.length; @@ -319,9 +261,6 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) miEventQueue.lastMotion = isMotion; miEventQueue.tail = (oldtail + 1) % miEventQueue.nevents; -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif } /** @@ -342,31 +281,19 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) void mieqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool set_dequeue_screen) { -#ifdef XQUARTZ - pthread_mutex_lock(&miEventQueueMutex); -#endif EnqueueScreen(pDev) = pScreen; if (set_dequeue_screen) DequeueScreen(pDev) = pScreen; -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif } void mieqSetHandler(int event, mieqHandler handler) { -#ifdef XQUARTZ - pthread_mutex_lock(&miEventQueueMutex); -#endif if (handler && miEventQueue.handlers[event]) ErrorF("[mi] mieq: warning: overriding existing handler %p with %p for " "event %d\n", miEventQueue.handlers[event], handler, event); miEventQueue.handlers[event] = handler; -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif } /** @@ -578,12 +505,9 @@ mieqProcessInputEvents(void) ScreenPtr screen; InternalEvent event; DeviceIntPtr dev = NULL, master = NULL; - size_t n_enqueued; static Bool inProcessInputEvents = FALSE; -#ifdef XQUARTZ - pthread_mutex_lock(&miEventQueueMutex); -#endif + input_lock(); /* * report an error if mieqProcessInputEvents() is called recursively; @@ -593,17 +517,6 @@ mieqProcessInputEvents(void) BUG_WARN_MSG(inProcessInputEvents, "[mi] mieqProcessInputEvents() called recursively.\n"); inProcessInputEvents = TRUE; - /* Grow our queue if we are reaching capacity: < 2 * QUEUE_RESERVED_SIZE remaining */ - n_enqueued = mieqNumEnqueued(&miEventQueue); - if (n_enqueued >= (miEventQueue.nevents - (2 * QUEUE_RESERVED_SIZE)) && - miEventQueue.nevents < QUEUE_MAXIMUM_SIZE) { - ErrorF("[mi] Increasing EQ size to %lu to prevent dropped events.\n", - (unsigned long) (miEventQueue.nevents << 1)); - if (!mieqGrowQueue(&miEventQueue, miEventQueue.nevents << 1)) { - ErrorF("[mi] Increasing the size of EQ failed.\n"); - } - } - if (miEventQueue.dropped) { ErrorF("[mi] EQ processing has resumed after %lu dropped events.\n", (unsigned long) miEventQueue.dropped); @@ -621,9 +534,7 @@ mieqProcessInputEvents(void) miEventQueue.head = (miEventQueue.head + 1) % miEventQueue.nevents; -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif + input_unlock(); master = (dev) ? GetMaster(dev, MASTER_ATTACHED) : NULL; @@ -647,14 +558,10 @@ mieqProcessInputEvents(void) event.device_event.flags & TOUCH_POINTER_EMULATED))) miPointerUpdateSprite(dev); -#ifdef XQUARTZ - pthread_mutex_lock(&miEventQueueMutex); -#endif + input_lock(); } inProcessInputEvents = FALSE; -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif + input_unlock(); } diff --git a/xserver/mi/miglblt.c b/xserver/mi/miglblt.c index 46268aee9..68be5b914 100644 --- a/xserver/mi/miglblt.c +++ b/xserver/mi/miglblt.c @@ -53,7 +53,7 @@ SOFTWARE. #include #include "misc.h" #include -#include +#include #include "dixfontstr.h" #include "gcstruct.h" #include "windowstr.h" @@ -186,13 +186,13 @@ miImageGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int ngly void *pglyphBase /* start of array of glyphs */ ) { - ExtentInfoRec info; /* used by QueryGlyphExtents() */ + ExtentInfoRec info; /* used by xfont2_query_glyph_extents() */ ChangeGCVal gcvals[3]; int oldAlu, oldFS; unsigned long oldFG; xRectangle backrect; - QueryGlyphExtents(pGC->font, ppci, (unsigned long) nglyph, &info); + xfont2_query_glyph_extents(pGC->font, ppci, (unsigned long) nglyph, &info); if (info.overallWidth >= 0) { backrect.x = x; diff --git a/xserver/mi/mipointer.c b/xserver/mi/mipointer.c index ada1ab570..75be1aeeb 100644 --- a/xserver/mi/mipointer.c +++ b/xserver/mi/mipointer.c @@ -65,6 +65,18 @@ in this Software without prior written authorization from The Open Group. #include "inpututils.h" #include "eventstr.h" +typedef struct { + ScreenPtr pScreen; /* current screen */ + ScreenPtr pSpriteScreen; /* screen containing current sprite */ + CursorPtr pCursor; /* current cursor */ + CursorPtr pSpriteCursor; /* cursor on screen */ + BoxRec limits; /* current constraints */ + Bool confined; /* pointer can't change screens */ + int x, y; /* hot spot location */ + int devx, devy; /* sprite position */ + Bool generateEvent; /* generate an event during warping? */ +} miPointerRec, *miPointerPtr; + DevPrivateKeyRec miPointerScreenKeyRec; #define GetScreenPrivate(s) ((miPointerScreenPtr) \ @@ -467,6 +479,21 @@ miPointerUpdateSprite(DeviceIntPtr pDev) } } +/** + * Invalidate the current sprite and force it to be reloaded on next cursor setting + * operation + * + * @param pDev The device to invalidate the sprite fore + */ +void +miPointerInvalidateSprite(DeviceIntPtr pDev) +{ + miPointerPtr pPointer; + + pPointer = MIPOINTER(pDev); + pPointer->pSpriteCursor = (CursorPtr) 1; +} + /** * Set the device to the coordinates on the given screen. * @@ -528,8 +555,9 @@ miPointerMoveNoEvent(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) pPointer = MIPOINTER(pDev); /* Hack: We mustn't call into ->MoveCursor for anything but the - * VCP, as this may cause a non-HW rendered cursor to be rendered during - * SIGIO. This again leads to allocs during SIGIO which leads to SIGABRT. + * VCP, as this may cause a non-HW rendered cursor to be rendered while + * not holding the input lock. This would race with building the command + * buffer for other rendering. */ if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer &&!pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen) { @@ -681,12 +709,6 @@ miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y) *y = MIPOINTER(pDev)->y; } -#ifdef XQUARTZ -#include -void darwinEvents_lock(void); -void darwinEvents_unlock(void); -#endif - /** * Move the device's pointer to the x/y coordinates on the given screen. * This function generates and enqueues pointer events. @@ -723,14 +745,8 @@ miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) POINTER_SCREEN | POINTER_ABSOLUTE | POINTER_NORAW, &mask); - OsBlockSignals(); -#ifdef XQUARTZ - darwinEvents_lock(); -#endif + input_lock(); for (i = 0; i < nevents; i++) mieqEnqueue(pDev, &mipointermove_events[i]); -#ifdef XQUARTZ - darwinEvents_unlock(); -#endif - OsReleaseSignals(); + input_unlock(); } diff --git a/xserver/mi/mipointer.h b/xserver/mi/mipointer.h index bdeed1242..7ce6409b3 100644 --- a/xserver/mi/mipointer.h +++ b/xserver/mi/mipointer.h @@ -109,6 +109,12 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y, extern _X_EXPORT void miPointerUpdateSprite(DeviceIntPtr pDev); +/* Invalidate current sprite, forcing reload on next + * sprite setting (window crossing, grab action, etc) + */ +extern _X_EXPORT void +miPointerInvalidateSprite(DeviceIntPtr pDev); + /* Sets whether the sprite should be updated immediately on pointer moves */ extern _X_EXPORT Bool miPointerSetWaitForUpdate(ScreenPtr pScreen, Bool wait); diff --git a/xserver/mi/mipointrst.h b/xserver/mi/mipointrst.h index 104e45cfa..7419ac107 100644 --- a/xserver/mi/mipointrst.h +++ b/xserver/mi/mipointrst.h @@ -34,23 +34,11 @@ in this Software without prior written authorization from The Open Group. #include "mipointer.h" #include "scrnintstr.h" -typedef struct { - ScreenPtr pScreen; /* current screen */ - ScreenPtr pSpriteScreen; /* screen containing current sprite */ - CursorPtr pCursor; /* current cursor */ - CursorPtr pSpriteCursor; /* cursor on screen */ - BoxRec limits; /* current constraints */ - Bool confined; /* pointer can't change screens */ - int x, y; /* hot spot location */ - int devx, devy; /* sprite position */ - Bool generateEvent; /* generate an event during warping? */ -} miPointerRec, *miPointerPtr; - typedef struct { miPointerSpriteFuncPtr spriteFuncs; /* sprite-specific methods */ miPointerScreenFuncPtr screenFuncs; /* screen-specific methods */ CloseScreenProcPtr CloseScreen; - Bool waitForUpdate; /* don't move cursor in SIGIO */ + Bool waitForUpdate; /* don't move cursor from input thread */ Bool showTransparent; /* show empty cursors */ } miPointerScreenRec, *miPointerScreenPtr; #endif /* MIPOINTRST_H */ diff --git a/xserver/mi/misprite.c b/xserver/mi/misprite.c index 68a49be1e..e682b243a 100644 --- a/xserver/mi/misprite.c +++ b/xserver/mi/misprite.c @@ -198,8 +198,7 @@ static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, unsigned int subWindowMode); static void miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); -static void miSpriteBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadMask); +static void miSpriteBlockHandler(ScreenPtr pScreen, void *timeout); static void miSpriteInstallColormap(ColormapPtr pMap); static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef); @@ -512,8 +511,7 @@ miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) } static void -miSpriteBlockHandler(ScreenPtr pScreen, void *pTimeout, - void *pReadmask) +miSpriteBlockHandler(ScreenPtr pScreen, void *timeout) { miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); DeviceIntPtr pDev; @@ -545,7 +543,7 @@ miSpriteBlockHandler(ScreenPtr pScreen, void *pTimeout, } } - (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, timeout); if (WorkToDo) SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler); diff --git a/xserver/miext/Makefile.in b/xserver/miext/Makefile.in index ccc818d50..5f6fc5aaa 100644 --- a/xserver/miext/Makefile.in +++ b/xserver/miext/Makefile.in @@ -53,9 +53,10 @@ subdir = miext DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -304,6 +305,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -334,7 +338,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -429,6 +436,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/miext/damage/Makefile.in b/xserver/miext/damage/Makefile.in index ad66a2f44..73c5a01b5 100644 --- a/xserver/miext/damage/Makefile.in +++ b/xserver/miext/damage/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -329,6 +330,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -359,7 +363,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -454,6 +461,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/miext/damage/damage.c b/xserver/miext/damage/damage.c index 746e7984f..2fae03fc2 100644 --- a/xserver/miext/damage/damage.c +++ b/xserver/miext/damage/damage.c @@ -32,8 +32,9 @@ #include #include "dixfontstr.h" #include -#include +#include #include "mi.h" +#include "mipict.h" #include "regionstr.h" #include "globals.h" #include "gcstruct.h" @@ -499,6 +500,15 @@ damageComposite(CARD8 op, if (BOX_NOT_EMPTY(box)) damageDamageBox(pDst->pDrawable, &box, pDst->subWindowMode); } + /* + * Validating a source picture bound to a window may trigger other + * composite operations. Do it before unwrapping to make sure damage + * is reported correctly. + */ + if (pSrc->pDrawable && WindowDrawable(pSrc->pDrawable->type)) + miCompositeSourceValidate(pSrc); + if (pMask && pMask->pDrawable && WindowDrawable(pMask->pDrawable->type)) + miCompositeSourceValidate(pMask); unwrap(pScrPriv, ps, Composite); (*ps->Composite) (op, pSrc, @@ -1248,7 +1258,7 @@ damageDamageChars(DrawablePtr pDrawable, ExtentInfoRec extents; BoxRec box; - QueryGlyphExtents(font, charinfo, n, &extents); + xfont2_query_glyph_extents(font, charinfo, n, &extents); if (imageblt) { if (extents.overallWidth > extents.overallRight) extents.overallRight = extents.overallWidth; diff --git a/xserver/miext/rootless/Makefile.in b/xserver/miext/rootless/Makefile.in index c256fe8c9..164e7a19f 100644 --- a/xserver/miext/rootless/Makefile.in +++ b/xserver/miext/rootless/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -299,6 +300,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -329,7 +333,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -424,6 +431,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/miext/rootless/rootlessScreen.c b/xserver/miext/rootless/rootlessScreen.c index 471656428..2ec0ae54d 100644 --- a/xserver/miext/rootless/rootlessScreen.c +++ b/xserver/miext/rootless/rootlessScreen.c @@ -603,7 +603,7 @@ RootlessQueueRedisplay(ScreenPtr pScreen) * on select(). */ static void -RootlessBlockHandler(void *pbdata, OSTimePtr pTimeout, void *pReadmask) +RootlessBlockHandler(void *pbdata, void *ptimeout) { ScreenPtr pScreen = pbdata; RootlessScreenRec *screenRec = SCREENREC(pScreen); @@ -616,7 +616,7 @@ RootlessBlockHandler(void *pbdata, OSTimePtr pTimeout, void *pReadmask) } static void -RootlessWakeupHandler(void *data, int i, void *LastSelectMask) +RootlessWakeupHandler(void *data, int result) { // nothing here } diff --git a/xserver/miext/shadow/Makefile.in b/xserver/miext/shadow/Makefile.in index 76196755e..2d923e799 100644 --- a/xserver/miext/shadow/Makefile.in +++ b/xserver/miext/shadow/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -335,6 +336,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -365,7 +369,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -460,6 +467,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/miext/shadow/shadow.c b/xserver/miext/shadow/shadow.c index 0dd3604a7..b8e23dae6 100644 --- a/xserver/miext/shadow/shadow.c +++ b/xserver/miext/shadow/shadow.c @@ -65,16 +65,15 @@ shadowRedisplay(ScreenPtr pScreen) } static void -shadowBlockHandler(void *data, OSTimePtr pTimeout, void *pRead) +shadowBlockHandler(ScreenPtr pScreen, void *timeout) { - ScreenPtr pScreen = (ScreenPtr) data; + shadowBuf(pScreen); shadowRedisplay(pScreen); -} -static void -shadowWakeupHandler(void *data, int i, void *LastSelectMask) -{ + unwrap(pBuf, pScreen, BlockHandler); + pScreen->BlockHandler(pScreen, timeout); + wrap(pBuf, pScreen, BlockHandler); } static void @@ -100,6 +99,7 @@ shadowCloseScreen(ScreenPtr pScreen) unwrap(pBuf, pScreen, GetImage); unwrap(pBuf, pScreen, CloseScreen); + unwrap(pBuf, pScreen, BlockHandler); shadowRemove(pScreen, pBuf->pPixmap); DamageDestroy(pBuf->pDamage); if (pBuf->pPixmap) @@ -132,6 +132,7 @@ shadowSetup(ScreenPtr pScreen) wrap(pBuf, pScreen, CloseScreen); wrap(pBuf, pScreen, GetImage); + wrap(pBuf, pScreen, BlockHandler); pBuf->update = 0; pBuf->window = 0; pBuf->pPixmap = 0; @@ -148,10 +149,6 @@ shadowAdd(ScreenPtr pScreen, PixmapPtr pPixmap, ShadowUpdateProc update, { shadowBuf(pScreen); - if (!RegisterBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, - (void *) pScreen)) - return FALSE; - /* * Map simple rotation values to bitmasks; fortunately, * these are all unique @@ -192,7 +189,4 @@ shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap) pBuf->closure = 0; pBuf->pPixmap = 0; } - - RemoveBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, - (void *) pScreen); } diff --git a/xserver/miext/shadow/shadow.h b/xserver/miext/shadow/shadow.h index 86fa94479..7f22169dc 100644 --- a/xserver/miext/shadow/shadow.h +++ b/xserver/miext/shadow/shadow.h @@ -54,6 +54,7 @@ typedef struct _shadowBuf { /* screen wrappers */ GetImageProcPtr GetImage; CloseScreenProcPtr CloseScreen; + ScreenBlockHandlerProcPtr BlockHandler; } shadowBufRec; /* Match defines from randr extension */ diff --git a/xserver/miext/sync/Makefile.in b/xserver/miext/sync/Makefile.in index 61c71d56d..0dee79952 100644 --- a/xserver/miext/sync/Makefile.in +++ b/xserver/miext/sync/Makefile.in @@ -57,9 +57,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -334,6 +335,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -364,7 +368,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -459,6 +466,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/os/Makefile.am b/xserver/os/Makefile.am index c0f5c6ff8..79d7b01f4 100644 --- a/xserver/os/Makefile.am +++ b/xserver/os/Makefile.am @@ -8,6 +8,8 @@ PRIVSEP_SRCS = privsep.c XORG_SRCS = log.c BUSFAULT_SRCS = busfault.c +XSERVER_POLL_SRCS=xserver_poll.c + libos_la_SOURCES = \ WaitFor.c \ access.c \ @@ -15,11 +17,14 @@ libos_la_SOURCES = \ backtrace.c \ client.c \ connection.c \ + inputthread.c \ io.c \ mitauth.c \ oscolor.c \ osdep.h \ osinit.c \ + ospoll.c \ + ospoll.h \ utils.c \ xdmauth.c \ xsha1.c \ @@ -33,6 +38,11 @@ if SECURE_RPC libos_la_SOURCES += $(SECURERPC_SRCS) endif +if POLL +else +libos_la_SOURCES += $(XSERVER_POLL_SRCS) +endif + if XDMCP libos_la_SOURCES += $(XDMCP_SRCS) endif @@ -54,12 +64,12 @@ EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS) if SPECIAL_DTRACE_OBJECTS # Generate dtrace object code for probes in libos & libdix -dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS) +dtrace.o: $(top_srcdir)/dix/Xserver.d libos.la $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o noinst_PROGRAMS = os.O os_O_SOURCES = -os.O: dtrace.o $(am_libos_la_OBJECTS) +os.O: dtrace.o libos.la $(AM_V_GEN)ld -r -o $@ dtrace.o .libs/*.o endif diff --git a/xserver/os/Makefile.in b/xserver/os/Makefile.in index b149603a5..2589f56c7 100644 --- a/xserver/os/Makefile.in +++ b/xserver/os/Makefile.in @@ -52,11 +52,12 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @SECURE_RPC_TRUE@am__append_1 = $(SECURERPC_SRCS) -@XDMCP_TRUE@am__append_2 = $(XDMCP_SRCS) -@HAVE_LIBUNWIND_TRUE@am__append_3 = $(LIBUNWIND_CFLAGS) -@HAVE_LIBUNWIND_TRUE@am__append_4 = $(LIBUNWIND_LIBS) -@BUSFAULT_TRUE@am__append_5 = $(BUSFAULT_SRCS) -@X_PRIVSEP_TRUE@am__append_6 = $(PRIVSEP_SRCS) +@POLL_FALSE@am__append_2 = $(XSERVER_POLL_SRCS) +@XDMCP_TRUE@am__append_3 = $(XDMCP_SRCS) +@HAVE_LIBUNWIND_TRUE@am__append_4 = $(LIBUNWIND_CFLAGS) +@HAVE_LIBUNWIND_TRUE@am__append_5 = $(LIBUNWIND_LIBS) +@BUSFAULT_TRUE@am__append_6 = $(BUSFAULT_SRCS) +@X_PRIVSEP_TRUE@am__append_7 = $(PRIVSEP_SRCS) @SPECIAL_DTRACE_OBJECTS_TRUE@noinst_PROGRAMS = os.O$(EXEEXT) subdir = os DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ @@ -64,9 +65,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ strlcat.c strlcpy.c strndup.c timingsafe_memcmp.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -86,23 +88,27 @@ am__DEPENDENCIES_1 = libos_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LTLIBOBJS) \ $(am__DEPENDENCIES_2) am__libos_la_SOURCES_DIST = WaitFor.c access.c auth.c backtrace.c \ - client.c connection.c io.c mitauth.c oscolor.c osdep.h \ - osinit.c utils.c xdmauth.c xsha1.c xstrans.c xprintf.c log.c \ - rpcauth.c xdmcp.c busfault.c privsep.c + client.c connection.c inputthread.c io.c mitauth.c oscolor.c \ + osdep.h osinit.c ospoll.c ospoll.h utils.c xdmauth.c xsha1.c \ + xstrans.c xprintf.c log.c rpcauth.c xserver_poll.c xdmcp.c \ + busfault.c privsep.c am__objects_1 = log.lo am__objects_2 = rpcauth.lo @SECURE_RPC_TRUE@am__objects_3 = $(am__objects_2) -am__objects_4 = xdmcp.lo -@XDMCP_TRUE@am__objects_5 = $(am__objects_4) -am__objects_6 = busfault.lo -@BUSFAULT_TRUE@am__objects_7 = $(am__objects_6) -am__objects_8 = privsep.lo -@X_PRIVSEP_TRUE@am__objects_9 = $(am__objects_8) +am__objects_4 = xserver_poll.lo +@POLL_FALSE@am__objects_5 = $(am__objects_4) +am__objects_6 = xdmcp.lo +@XDMCP_TRUE@am__objects_7 = $(am__objects_6) +am__objects_8 = busfault.lo +@BUSFAULT_TRUE@am__objects_9 = $(am__objects_8) +am__objects_10 = privsep.lo +@X_PRIVSEP_TRUE@am__objects_11 = $(am__objects_10) am_libos_la_OBJECTS = WaitFor.lo access.lo auth.lo backtrace.lo \ - client.lo connection.lo io.lo mitauth.lo oscolor.lo osinit.lo \ - utils.lo xdmauth.lo xsha1.lo xstrans.lo xprintf.lo \ - $(am__objects_1) $(am__objects_3) $(am__objects_5) \ - $(am__objects_7) $(am__objects_9) + client.lo connection.lo inputthread.lo io.lo mitauth.lo \ + oscolor.lo osinit.lo ospoll.lo utils.lo xdmauth.lo xsha1.lo \ + xstrans.lo xprintf.lo $(am__objects_1) $(am__objects_3) \ + $(am__objects_5) $(am__objects_7) $(am__objects_9) \ + $(am__objects_11) libos_la_OBJECTS = $(am_libos_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -331,6 +337,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -361,7 +370,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -456,6 +468,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -504,19 +517,20 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libos.la -AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS) $(am__append_3) +AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS) $(am__append_4) SECURERPC_SRCS = rpcauth.c XDMCP_SRCS = xdmcp.c PRIVSEP_SRCS = privsep.c XORG_SRCS = log.c BUSFAULT_SRCS = busfault.c +XSERVER_POLL_SRCS = xserver_poll.c libos_la_SOURCES = WaitFor.c access.c auth.c backtrace.c client.c \ - connection.c io.c mitauth.c oscolor.c osdep.h osinit.c utils.c \ - xdmauth.c xsha1.c xstrans.c xprintf.c $(XORG_SRCS) \ - $(am__append_1) $(am__append_2) $(am__append_5) \ - $(am__append_6) + connection.c inputthread.c io.c mitauth.c oscolor.c osdep.h \ + osinit.c ospoll.c ospoll.h utils.c xdmauth.c xsha1.c xstrans.c \ + xprintf.c $(XORG_SRCS) $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_6) $(am__append_7) libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) $(LTLIBOBJS) \ - $(am__append_4) + $(am__append_5) EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS) @SPECIAL_DTRACE_OBJECTS_TRUE@os_O_SOURCES = all: all-am @@ -599,17 +613,20 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/busfault.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inputthread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mitauth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oscolor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osinit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ospoll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/privsep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcauth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdmauth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdmcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprintf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xserver_poll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsha1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrans.Plo@am__quote@ @@ -859,9 +876,9 @@ uninstall-am: # Generate dtrace object code for probes in libos & libdix -@SPECIAL_DTRACE_OBJECTS_TRUE@dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS) +@SPECIAL_DTRACE_OBJECTS_TRUE@dtrace.o: $(top_srcdir)/dix/Xserver.d libos.la @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o -@SPECIAL_DTRACE_OBJECTS_TRUE@os.O: dtrace.o $(am_libos_la_OBJECTS) +@SPECIAL_DTRACE_OBJECTS_TRUE@os.O: dtrace.o libos.la @SPECIAL_DTRACE_OBJECTS_TRUE@ $(AM_V_GEN)ld -r -o $@ dtrace.o .libs/*.o # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/xserver/os/WaitFor.c b/xserver/os/WaitFor.c index 993c14e52..613608faf 100644 --- a/xserver/os/WaitFor.c +++ b/xserver/os/WaitFor.c @@ -66,7 +66,6 @@ SOFTWARE. #include "misc.h" #include "osdep.h" -#include #include "dixstruct.h" #include "opaque.h" #ifdef DPMSExtension @@ -114,16 +113,55 @@ mffs(fd_mask mask) #endif struct _OsTimerRec { - OsTimerPtr next; + struct xorg_list list; CARD32 expires; CARD32 delta; OsTimerCallback callback; void *arg; }; -static void DoTimer(OsTimerPtr timer, CARD32 now, volatile OsTimerPtr *prev); +static void DoTimer(OsTimerPtr timer, CARD32 now); +static void DoTimers(CARD32 now); static void CheckAllTimers(void); -static volatile OsTimerPtr timers = NULL; +static volatile struct xorg_list timers; + +static inline OsTimerPtr +first_timer(void) +{ + /* inline xorg_list_is_empty which can't handle volatile */ + if (timers.next == &timers) + return NULL; + return xorg_list_first_entry(&timers, struct _OsTimerRec, list); +} + +/* + * Compute timeout until next timer, running + * any expired timers + */ +static int +check_timers(void) +{ + OsTimerPtr timer; + + if ((timer = first_timer()) != NULL) { + CARD32 now = GetTimeInMillis(); + int timeout = timer->expires - now; + + if (timeout <= 0) { + DoTimers(now); + } else { + /* Make sure the timeout is sane */ + if (timeout < timer->delta + 250) + return timeout; + + /* time has rewound. reset the timers. */ + CheckAllTimers(); + } + + return 0; + } + return -1; +} /***************** * WaitForSomething: @@ -142,27 +180,23 @@ static volatile OsTimerPtr timers = NULL; * pClientsReady is an array to store ready client->index values into. *****************/ -int -WaitForSomething(int *pClientsReady) +Bool +WaitForSomething(Bool are_ready) { int i; - struct timeval waittime, *wt; - INT32 timeout = 0; - fd_set clientsReadable; - fd_set clientsWritable; - int curclient; - int selecterr; - static int nready; - fd_set devicesReadable; - CARD32 now = 0; - Bool someReady = FALSE; + int timeout; + int pollerr; + static Bool were_ready; + Bool timer_is_running; - FD_ZERO(&clientsReadable); - FD_ZERO(&clientsWritable); + timer_is_running = were_ready; - if (nready) + if (were_ready && !are_ready) { + timer_is_running = FALSE; SmartScheduleStopTimer(); - nready = 0; + } + + were_ready = FALSE; #ifdef BUSFAULT busfault_check(); @@ -172,218 +206,62 @@ WaitForSomething(int *pClientsReady) crashed connections and the screen saver timeout */ while (1) { /* deal with any blocked jobs */ - if (workQueue) + if (workQueue) { ProcessWorkQueue(); - if (XFD_ANYSET(&ClientsWithInput)) { - if (!SmartScheduleDisable) { - someReady = TRUE; - waittime.tv_sec = 0; - waittime.tv_usec = 0; - wt = &waittime; - } - else { - XFD_COPYSET(&ClientsWithInput, &clientsReadable); - break; - } - } - if (someReady) { - XFD_COPYSET(&AllSockets, &LastSelectMask); - XFD_UNSET(&LastSelectMask, &ClientsWithInput); - } - else { - wt = NULL; - if (timers) { - now = GetTimeInMillis(); - timeout = timers->expires - now; - if (timeout > 0 && timeout > timers->delta + 250) { - /* time has rewound. reset the timers. */ - CheckAllTimers(); - } - - if (timers) { - timeout = timers->expires - now; - if (timeout < 0) - timeout = 0; - waittime.tv_sec = timeout / MILLI_PER_SECOND; - waittime.tv_usec = (timeout % MILLI_PER_SECOND) * - (1000000 / MILLI_PER_SECOND); - wt = &waittime; - } - } - XFD_COPYSET(&AllSockets, &LastSelectMask); + are_ready = clients_are_ready(); } - BlockHandler((void *) &wt, (void *) &LastSelectMask); + if (are_ready) + timeout = 0; + else + timeout = check_timers(); + + BlockHandler(&timeout); if (NewOutputPending) FlushAllOutput(); /* keep this check close to select() call to minimize race */ if (dispatchException) i = -1; - else if (AnyClientsWriteBlocked) { - XFD_COPYSET(&ClientsWriteBlocked, &clientsWritable); - i = Select(MaxClients, &LastSelectMask, &clientsWritable, NULL, wt); - } - else { - i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt); - } - selecterr = GetErrno(); - WakeupHandler(i, (void *) &LastSelectMask); + else + i = ospoll_wait(server_poll, timeout); + pollerr = GetErrno(); + WakeupHandler(i); if (i <= 0) { /* An error or timeout occurred */ if (dispatchException) - return 0; + return FALSE; if (i < 0) { - if (selecterr == EBADF) { /* Some client disconnected */ - CheckConnections(); - if (!XFD_ANYSET(&AllClients)) - return 0; - } - else if (selecterr == EINVAL) { - FatalError("WaitForSomething(): select: %s\n", - strerror(selecterr)); - } - else if (selecterr != EINTR && selecterr != EAGAIN) { - ErrorF("WaitForSomething(): select: %s\n", - strerror(selecterr)); + if (pollerr != EINTR && !ETEST(pollerr)) { + ErrorF("WaitForSomething(): poll: %s\n", + strerror(pollerr)); } } - else if (someReady) { - /* - * If no-one else is home, bail quickly - */ - XFD_COPYSET(&ClientsWithInput, &LastSelectMask); - XFD_COPYSET(&ClientsWithInput, &clientsReadable); - break; - } - if (*checkForInput[0] != *checkForInput[1]) - return 0; + } else + are_ready = clients_are_ready(); - if (timers) { - int expired = 0; + if (InputCheckPending()) + return FALSE; - now = GetTimeInMillis(); - if ((int) (timers->expires - now) <= 0) - expired = 1; - - if (expired) { - OsBlockSignals(); - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); - OsReleaseSignals(); - - return 0; - } - } - } - else { - fd_set tmp_set; - - if (*checkForInput[0] == *checkForInput[1]) { - if (timers) { - int expired = 0; - - now = GetTimeInMillis(); - if ((int) (timers->expires - now) <= 0) - expired = 1; - - if (expired) { - OsBlockSignals(); - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); - OsReleaseSignals(); - - return 0; - } - } - } - if (someReady) - XFD_ORSET(&LastSelectMask, &ClientsWithInput, &LastSelectMask); - if (AnyClientsWriteBlocked && XFD_ANYSET(&clientsWritable)) { - NewOutputPending = TRUE; - XFD_ORSET(&OutputPending, &clientsWritable, &OutputPending); - XFD_UNSET(&ClientsWriteBlocked, &clientsWritable); - if (!XFD_ANYSET(&ClientsWriteBlocked)) - AnyClientsWriteBlocked = FALSE; - } - - XFD_ANDSET(&devicesReadable, &LastSelectMask, &EnabledDevices); - XFD_ANDSET(&clientsReadable, &LastSelectMask, &AllClients); - XFD_ANDSET(&tmp_set, &LastSelectMask, &WellKnownConnections); - if (XFD_ANYSET(&tmp_set)) - QueueWorkProc(EstablishNewConnections, NULL, - (void *) &LastSelectMask); - - if (XFD_ANYSET(&devicesReadable) || XFD_ANYSET(&clientsReadable)) - break; - /* check here for DDXes that queue events during Block/Wakeup */ - if (*checkForInput[0] != *checkForInput[1]) - return 0; + if (are_ready) { + were_ready = TRUE; + if (!timer_is_running) + SmartScheduleStartTimer(); + return TRUE; } } +} - nready = 0; - if (XFD_ANYSET(&clientsReadable)) { -#ifndef WIN32 - for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) { - int highest_priority = 0; +void +AdjustWaitForDelay(void *waitTime, int newdelay) +{ + int *timeoutp = waitTime; + int timeout = *timeoutp; - while (clientsReadable.fds_bits[i]) { - int client_priority, client_index; + if (timeout < 0 || newdelay < timeout) + *timeoutp = newdelay; +} - curclient = mffs(clientsReadable.fds_bits[i]) - 1; - client_index = /* raphael: modified */ - ConnectionTranslation[curclient + - (i * (sizeof(fd_mask) * 8))]; -#else - int highest_priority = 0; - fd_set savedClientsReadable; - - XFD_COPYSET(&clientsReadable, &savedClientsReadable); - for (i = 0; i < XFD_SETCOUNT(&savedClientsReadable); i++) { - int client_priority, client_index; - - curclient = XFD_FD(&savedClientsReadable, i); - client_index = GetConnectionTranslation(curclient); -#endif - /* We implement "strict" priorities. - * Only the highest priority client is returned to - * dix. If multiple clients at the same priority are - * ready, they are all returned. This means that an - * aggressive client could take over the server. - * This was not considered a big problem because - * aggressive clients can hose the server in so many - * other ways :) - */ - client_priority = clients[client_index]->priority; - if (nready == 0 || client_priority > highest_priority) { - /* Either we found the first client, or we found - * a client whose priority is greater than all others - * that have been found so far. Either way, we want - * to initialize the list of clients to contain just - * this client. - */ - pClientsReady[0] = client_index; - highest_priority = client_priority; - nready = 1; - } - /* the following if makes sure that multiple same-priority - * clients get batched together - */ - else if (client_priority == highest_priority) { - pClientsReady[nready++] = client_index; - } -#ifndef WIN32 - clientsReadable.fds_bits[i] &= ~(((fd_mask) 1L) << curclient); - } -#else - FD_CLR(curclient, &clientsReadable); -#endif - } - } - - if (nready) - SmartScheduleStartTimer(); - - return nready; +static inline Bool timer_pending(OsTimerPtr timer) { + return !xorg_list_is_empty(&timer->list); } /* If time has rewound, re-run every affected timer. @@ -394,57 +272,65 @@ CheckAllTimers(void) OsTimerPtr timer; CARD32 now; - OsBlockSignals(); + input_lock(); start: now = GetTimeInMillis(); - for (timer = timers; timer; timer = timer->next) { + xorg_list_for_each_entry(timer, &timers, list) { if (timer->expires - now > timer->delta + 250) { - TimerForce(timer); + DoTimer(timer, now); goto start; } } - OsReleaseSignals(); + input_unlock(); } static void -DoTimer(OsTimerPtr timer, CARD32 now, volatile OsTimerPtr *prev) +DoTimer(OsTimerPtr timer, CARD32 now) { CARD32 newTime; - OsBlockSignals(); - *prev = timer->next; - timer->next = NULL; - OsReleaseSignals(); - + xorg_list_del(&timer->list); newTime = (*timer->callback) (timer, now, timer->arg); if (newTime) TimerSet(timer, 0, newTime, timer->callback, timer->arg); } +static void +DoTimers(CARD32 now) +{ + OsTimerPtr timer; + + input_lock(); + while ((timer = first_timer())) { + if ((int) (timer->expires - now) > 0) + break; + DoTimer(timer, now); + } + input_unlock(); +} + OsTimerPtr TimerSet(OsTimerPtr timer, int flags, CARD32 millis, OsTimerCallback func, void *arg) { - volatile OsTimerPtr *prev; + OsTimerPtr existing, tmp; CARD32 now = GetTimeInMillis(); if (!timer) { - timer = malloc(sizeof(struct _OsTimerRec)); + timer = calloc(1, sizeof(struct _OsTimerRec)); if (!timer) return NULL; + xorg_list_init(&timer->list); } else { - OsBlockSignals(); - for (prev = &timers; *prev; prev = &(*prev)->next) { - if (*prev == timer) { - *prev = timer->next; - if (flags & TimerForceOld) - (void) (*timer->callback) (timer, now, timer->arg); - break; - } + input_lock(); + if (timer_pending(timer)) { + xorg_list_del(&timer->list); + if (flags & TimerForceOld) + (void) (*timer->callback) (timer, now, timer->arg); } - OsReleaseSignals(); + input_unlock(); } if (!millis) return timer; @@ -458,55 +344,44 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis, timer->expires = millis; timer->callback = func; timer->arg = arg; - if ((int) (millis - now) <= 0) { - timer->next = NULL; - millis = (*timer->callback) (timer, now, timer->arg); - if (!millis) - return timer; - } - OsBlockSignals(); - for (prev = &timers; - *prev && (int) ((*prev)->expires - millis) <= 0; - prev = &(*prev)->next); - timer->next = *prev; - *prev = timer; - OsReleaseSignals(); + input_lock(); + + /* Sort into list */ + xorg_list_for_each_entry_safe(existing, tmp, &timers, list) + if ((int) (existing->expires - millis) > 0) + break; + /* This even works at the end of the list -- existing->list will be timers */ + xorg_list_add(&timer->list, existing->list.prev); + + /* Check to see if the timer is ready to run now */ + if ((int) (millis - now) <= 0) + DoTimer(timer, now); + + input_unlock(); return timer; } Bool TimerForce(OsTimerPtr timer) { - int rc = FALSE; - volatile OsTimerPtr *prev; + int pending; - OsBlockSignals(); - for (prev = &timers; *prev; prev = &(*prev)->next) { - if (*prev == timer) { - DoTimer(timer, GetTimeInMillis(), prev); - rc = TRUE; - break; - } - } - OsReleaseSignals(); - return rc; + input_lock(); + pending = timer_pending(timer); + if (pending) + DoTimer(timer, GetTimeInMillis()); + input_unlock(); + return pending; } void TimerCancel(OsTimerPtr timer) { - volatile OsTimerPtr *prev; - if (!timer) return; - OsBlockSignals(); - for (prev = &timers; *prev; prev = &(*prev)->next) { - if (*prev == timer) { - *prev = timer->next; - break; - } - } - OsReleaseSignals(); + input_lock(); + xorg_list_del(&timer->list); + input_unlock(); } void @@ -521,23 +396,22 @@ TimerFree(OsTimerPtr timer) void TimerCheck(void) { - CARD32 now = GetTimeInMillis(); - - if (timers && (int) (timers->expires - now) <= 0) { - OsBlockSignals(); - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); - OsReleaseSignals(); - } + DoTimers(GetTimeInMillis()); } void TimerInit(void) { - OsTimerPtr timer; + static Bool been_here; + OsTimerPtr timer, tmp; - while ((timer = timers)) { - timers = timer->next; + if (!been_here) { + been_here = TRUE; + xorg_list_init((struct xorg_list*) &timers); + } + + xorg_list_for_each_entry_safe(timer, tmp, &timers, list) { + xorg_list_del(&timer->list); free(timer); } } diff --git a/xserver/os/access.c b/xserver/os/access.c index dac6f49a6..8828e0834 100644 --- a/xserver/os/access.c +++ b/xserver/os/access.c @@ -106,13 +106,13 @@ SOFTWARE. #include #endif -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) #include #endif /* TCPCONN || STREAMSCONN */ #ifdef HAVE_GETPEERUCRED #include -#ifdef sun +#ifdef __sun #include #endif #endif @@ -162,7 +162,7 @@ SOFTWARE. * Test for Solaris commented out -- TSI @ UQV 2003.06.13 */ #ifdef SIOCGLIFCONF -/* #if defined(sun) */ +/* #if defined(__sun) */ #define USE_SIOCGLIFCONF /* #endif */ #endif @@ -387,7 +387,7 @@ AccessUsingXdmcp(void) LocalHostEnabled = FALSE; } -#if defined(SVR4) && !defined(sun) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) +#if defined(SVR4) && !defined(__sun) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) /* Deal with different SIOCGIFCONF ioctl semantics on these OSs */ @@ -430,7 +430,7 @@ ifioctl(int fd, int cmd, char *arg) void DefineSelf(int fd) { -#if !defined(TCPCONN) && !defined(STREAMSCONN) && !defined(UNIXCONN) +#if !defined(TCPCONN) && !defined(UNIXCONN) return; #else register int n; @@ -938,11 +938,10 @@ ResetHosts(const char *display) char *ptr; int i, hostlen; -#if (defined(TCPCONN) || defined(STREAMSCONN) ) && \ - (!defined(IPv6) || !defined(AF_INET6)) +#if defined(TCPCONN) && (!defined(IPv6) || !defined(AF_INET6)) union { struct sockaddr sa; -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) struct sockaddr_in in; #endif /* TCPCONN || STREAMSCONN */ } saddr; @@ -988,7 +987,7 @@ ResetHosts(const char *display) NewHost(family, "", 0, FALSE); LocalHostRequested = TRUE; /* Fix for XFree86 bug #156 */ } -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) else if (!strncmp("inet:", lhostname, 5)) { family = FamilyInternet; hostname = ohostname + 5; @@ -1027,7 +1026,7 @@ ResetHosts(const char *display) } else #endif /* SECURE_RPC */ -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) { #if defined(IPv6) && defined(AF_INET6) if ((family == FamilyInternet) || (family == FamilyInternet6) || @@ -1183,7 +1182,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec ** lccp) if (client == NULL) return -1; ci = ((OsCommPtr) client->osPrivate)->trans_conn; -#if !(defined(sun) && defined(HAVE_GETPEERUCRED)) +#if !(defined(__sun) && defined(HAVE_GETPEERUCRED)) /* Most implementations can only determine peer credentials for Unix * domain sockets - Solaris getpeerucred can work with a bit more, so * we just let it tell us if the connection type is supported or not @@ -1479,7 +1478,7 @@ CheckAddr(int family, const void *pAddr, unsigned length) int len; switch (family) { -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) case FamilyInternet: if (length == sizeof(struct in_addr)) len = length; @@ -1562,7 +1561,7 @@ ConvertAddr(register struct sockaddr *saddr, int *len, void **addr) case AF_UNIX: #endif return FamilyLocal; -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) case AF_INET: #ifdef WIN32 if (16777343 == *(long *) &((struct sockaddr_in *) saddr)->sin_addr) diff --git a/xserver/os/auth.c b/xserver/os/auth.c index ff73cada2..c7b333ca2 100644 --- a/xserver/os/auth.c +++ b/xserver/os/auth.c @@ -305,14 +305,14 @@ GenerateAuthorization(unsigned name_length, void GenerateRandomData(int len, char *buf) { -#ifndef HAVE_ARC4RANDOM_BUF +#ifdef HAVE_ARC4RANDOM_BUF + arc4random_buf(buf, len); +#else int fd; fd = open("/dev/urandom", O_RDONLY); read(fd, buf, len); close(fd); -#else - arc4random_buf(buf, len); #endif } diff --git a/xserver/os/backtrace.c b/xserver/os/backtrace.c index fd129ef21..9e3e38edf 100644 --- a/xserver/os/backtrace.c +++ b/xserver/os/backtrace.c @@ -155,7 +155,7 @@ xorg_backtrace(void) #else /* not glibc or glibc < 2.1 */ -#if defined(sun) && defined(__SVR4) +#if defined(__sun) && defined(__SVR4) #define HAVE_PSTACK #endif diff --git a/xserver/os/busfault.c b/xserver/os/busfault.c index d4afa6df3..a2d433a2e 100644 --- a/xserver/os/busfault.c +++ b/xserver/os/busfault.c @@ -98,15 +98,16 @@ static void busfault_sigaction(int sig, siginfo_t *info, void *param) { void *fault = info->si_addr; - struct busfault *busfault = NULL; + struct busfault *iter, *busfault = NULL; void *new_addr; /* Locate the faulting address in our list of shared segments */ - xorg_list_for_each_entry(busfault, &busfaults, list) { - if ((char *) busfault->addr <= (char *) fault && (char *) fault < (char *) busfault->addr + busfault->size) { - break; - } + xorg_list_for_each_entry(iter, &busfaults, list) { + if ((char *) iter->addr <= (char *) fault && (char *) fault < (char *) iter->addr + iter->size) { + busfault = iter; + break; + } } if (!busfault) goto panic; @@ -132,7 +133,7 @@ panic: if (previous_busfault_sigaction) (*previous_busfault_sigaction)(sig, info, param); else - FatalError("bus error"); + FatalError("bus error\n"); } Bool diff --git a/xserver/os/connection.c b/xserver/os/connection.c index e2c765ca4..862f6c622 100644 --- a/xserver/os/connection.c +++ b/xserver/os/connection.c @@ -47,8 +47,8 @@ SOFTWARE. * Stuff to create connections --- OS dependent * * EstablishNewConnections, CreateWellKnownSockets, ResetWellKnownSockets, - * CloseDownConnection, CheckConnections, AddEnabledDevice, - * RemoveEnabledDevice, OnlyListToOneClient, + * CloseDownConnection, + * OnlyListToOneClient, * ListenToAllClients, * * (WaitForSomething is in its own file) @@ -82,7 +82,7 @@ SOFTWARE. #ifndef WIN32 #include -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) #include #include #ifdef apollo @@ -103,7 +103,6 @@ SOFTWARE. #endif /* WIN32 */ #include "misc.h" /* for typedef of pointer */ #include "osdep.h" -#include #include "opaque.h" #include "dixstruct.h" #include "xace.h" @@ -119,19 +118,10 @@ SOFTWARE. #include "probes.h" -static int lastfdesc; /* maximum file descriptor */ +struct ospoll *server_poll; -fd_set WellKnownConnections; /* Listener mask */ -fd_set EnabledDevices; /* mask for input devices that are on */ -fd_set AllSockets; /* select on this */ -fd_set AllClients; /* available clients */ -fd_set LastSelectMask; /* mask returned from last select call */ -fd_set ClientsWithInput; /* clients with FULL requests in buffer */ -fd_set ClientsWriteBlocked; /* clients who cannot receive output */ -fd_set OutputPending; /* clients with reply/event data ready to go */ int MaxClients = 0; Bool NewOutputPending; /* not yet attempted to write some new output */ -Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ Bool NoListenAll; /* Don't establish any listening sockets */ static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ @@ -141,30 +131,28 @@ static char dynamic_display[7]; /* display name */ Bool PartialNetwork; /* continue even if unable to bind all addrs */ static Pid_t ParentProcess; -static Bool debug_conns = FALSE; - -fd_set IgnoredClientsWithInput; -static fd_set GrabImperviousClients; -static fd_set SavedAllClients; -static fd_set SavedAllSockets; -static fd_set SavedClientsWithInput; int GrabInProgress = 0; +static void +QueueNewConnections(int curconn, int ready, void *data); + +static void +set_poll_client(ClientPtr client); + +static void +set_poll_clients(void); + #if !defined(WIN32) int *ConnectionTranslation = NULL; +int ConnectionTranslationSize = 0; #else /* - * On NT fds are not between 0 and MAXSOCKS, they are unrelated, and there is + * On NT fds are not small integers, they are unrelated, and there is * not even a known maximum value, so use something quite arbitrary for now. * Do storage is a hash table of size 256. Collisions are handled in a linked * list. */ -#undef MAXSOCKS -#define MAXSOCKS 512 -#undef MAXSELECT -#define MAXSELECT 512 - struct _ct_node { struct _ct_node *next; int key; @@ -269,47 +257,17 @@ lookup_trans_conn(int fd) void InitConnectionLimits(void) { - lastfdesc = -1; - -#ifndef __CYGWIN__ - -#if !defined(XNO_SYSCONF) && defined(_SC_OPEN_MAX) - lastfdesc = sysconf(_SC_OPEN_MAX) - 1; -#endif - -#ifdef HAVE_GETDTABLESIZE - if (lastfdesc < 0) - lastfdesc = getdtablesize() - 1; -#endif - -#ifdef _NFILE - if (lastfdesc < 0) - lastfdesc = _NFILE - 1; -#endif - -#endif /* __CYGWIN__ */ - - /* This is the fallback */ - if (lastfdesc < 0) - lastfdesc = MAXSOCKS; - - if (lastfdesc > MAXSELECT) - lastfdesc = MAXSELECT; - - if (lastfdesc > MAXCLIENTS) { - lastfdesc = MAXCLIENTS; - if (debug_conns) - ErrorF("REACHED MAXIMUM CLIENTS LIMIT %d\n", LimitClients); - } - MaxClients = lastfdesc; + MaxClients = MAXCLIENTS; #ifdef DEBUG ErrorF("InitConnectionLimits: MaxClients = %d\n", MaxClients); #endif #if !defined(WIN32) - if (!ConnectionTranslation) - ConnectionTranslation = xnfallocarray(lastfdesc + 1, sizeof(int)); + if (!ConnectionTranslation) { + ConnectionTranslation = xnfallocarray(MaxClients, sizeof(int)); + ConnectionTranslationSize = MaxClients; + } #else InitConnectionTranslation(); #endif @@ -394,20 +352,13 @@ CreateWellKnownSockets(void) int i; int partial; - FD_ZERO(&AllSockets); - FD_ZERO(&AllClients); - FD_ZERO(&LastSelectMask); - FD_ZERO(&ClientsWithInput); - #if !defined(WIN32) - for (i = 0; i < MaxClients; i++) + for (i = 0; i < ConnectionTranslationSize; i++) ConnectionTranslation[i] = 0; #else ClearConnectionTranslation(); #endif - FD_ZERO(&WellKnownConnections); - /* display is initialized to "0" by main(). It is then set to the display * number if specified on the command line. */ @@ -445,13 +396,13 @@ CreateWellKnownSockets(void) int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]); ListenTransFds[i] = fd; - FD_SET(fd, &WellKnownConnections); + SetNotifyFd(fd, QueueNewConnections, X_NOTIFY_READ, NULL); if (!_XSERVTransIsLocal(ListenTransConns[i])) DefineSelf (fd); } - if (!XFD_ANYSET(&WellKnownConnections) && !NoListenAll) + if (ListenTransCount == 0 && !NoListenAll) FatalError ("Cannot establish any listening sockets - Make sure an X server isn't already running"); @@ -461,7 +412,6 @@ CreateWellKnownSockets(void) #endif OsSignal(SIGINT, GiveUp); OsSignal(SIGTERM, GiveUp); - XFD_COPYSET(&WellKnownConnections, &AllSockets); ResetHosts(display); InitParentProcess(); @@ -488,7 +438,7 @@ ResetWellKnownSockets(void) * Remove it from out list. */ - FD_CLR(ListenTransFds[i], &WellKnownConnections); + RemoveNotifyFd(ListenTransFds[i]); ListenTransFds[i] = ListenTransFds[ListenTransCount - 1]; ListenTransConns[i] = ListenTransConns[ListenTransCount - 1]; ListenTransCount -= 1; @@ -501,12 +451,12 @@ ResetWellKnownSockets(void) int newfd = _XSERVTransGetConnectionNumber(ListenTransConns[i]); - FD_CLR(ListenTransFds[i], &WellKnownConnections); ListenTransFds[i] = newfd; - FD_SET(newfd, &WellKnownConnections); } } } + for (i = 0; i < ListenTransCount; i++) + SetNotifyFd(ListenTransFds[i], QueueNewConnections, X_NOTIFY_READ, NULL); ResetAuthorization(); ResetHosts(display); @@ -527,6 +477,8 @@ CloseWellKnownConnections(void) if (ListenTransConns[i] != NULL) { _XSERVTransClose(ListenTransConns[i]); ListenTransConns[i] = NULL; + if (ListenTransFds != NULL) + RemoveNotifyFd(ListenTransFds[i]); } } ListenTransCount = 0; @@ -556,7 +508,7 @@ AuthAudit(ClientPtr client, Bool letin, #endif strlcpy(addr, "local host", sizeof(addr)); break; -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) case AF_INET: snprintf(addr, sizeof(addr), "IP %s", inet_ntoa(((struct sockaddr_in *) saddr)->sin_addr)); @@ -754,20 +706,29 @@ ClientAuthorized(ClientPtr client, return ((char *) NULL); } +static void +ClientReady(int fd, int xevents, void *data) +{ + ClientPtr client = data; + + if (xevents & X_NOTIFY_ERROR) { + CloseDownClient(client); + return; + } + if (xevents & X_NOTIFY_READ) + mark_client_ready(client); + if (xevents & X_NOTIFY_WRITE) { + ospoll_mute(server_poll, fd, X_NOTIFY_WRITE); + NewOutputPending = TRUE; + } +} + static ClientPtr AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time) { OsCommPtr oc; ClientPtr client; - if ( -#ifndef WIN32 - fd >= lastfdesc -#else - XFD_SETCOUNT(&AllClients) >= MaxClients -#endif - ) - return NullClient; oc = malloc(sizeof(OsCommRec)); if (!oc) return NullClient; @@ -777,24 +738,26 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time) oc->output = (ConnectionOutputPtr) NULL; oc->auth_id = None; oc->conn_time = conn_time; + oc->flags = 0; if (!(client = NextAvailableClient((void *) oc))) { free(oc); return NullClient; } client->local = ComputeLocalClient(client); #if !defined(WIN32) + if (fd >= ConnectionTranslationSize) { + ConnectionTranslationSize *= 2; + ConnectionTranslation = xnfreallocarray(ConnectionTranslation, ConnectionTranslationSize, sizeof (int)); + } ConnectionTranslation[fd] = client->index; #else SetConnectionTranslation(fd, client->index); #endif - if (GrabInProgress) { - FD_SET(fd, &SavedAllClients); - FD_SET(fd, &SavedAllSockets); - } - else { - FD_SET(fd, &AllClients); - FD_SET(fd, &AllSockets); - } + ospoll_add(server_poll, fd, + ospoll_trigger_edge, + ClientReady, + client); + set_poll_client(client); #ifdef DEBUG ErrorF("AllocNewConnection: client index = %d, socket fd = %d\n", @@ -814,22 +777,19 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time) * and AllSockets. *****************/ - /*ARGSUSED*/ Bool +static Bool EstablishNewConnections(ClientPtr clientUnused, void *closure) { - fd_set readyconnections; /* set of listeners that are ready */ - int curconn; /* fd of listener that's ready */ - register int newconn; /* fd of new client */ + int curconn = (int) (intptr_t) closure; + int newconn; /* fd of new client */ CARD32 connect_time; - register int i; - register ClientPtr client; - register OsCommPtr oc; - fd_set tmask; + int i; + ClientPtr client; + OsCommPtr oc; + XtransConnInfo trans_conn, new_trans_conn; + int status; + int clientid; - XFD_ANDSET(&tmask, (fd_set *) closure, &WellKnownConnections); - XFD_COPYSET(&tmask, &readyconnections); - if (!XFD_ANYSET(&readyconnections)) - return TRUE; connect_time = GetTimeInMillis(); /* kill off stragglers */ for (i = 1; i < currentMaxClients; i++) { @@ -841,58 +801,34 @@ EstablishNewConnections(ClientPtr clientUnused, void *closure) CloseDownClient(client); } } -#ifndef WIN32 - for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) { - while (readyconnections.fds_bits[i]) -#else - for (i = 0; i < XFD_SETCOUNT(&readyconnections); i++) -#endif - { - XtransConnInfo trans_conn, new_trans_conn; - int status; -#ifndef WIN32 - curconn = mffs(readyconnections.fds_bits[i]) - 1; - readyconnections.fds_bits[i] &= ~((fd_mask) 1 << curconn); - curconn += (i * (sizeof(fd_mask) * 8)); -#else - curconn = XFD_FD(&readyconnections, i); -#endif + if ((trans_conn = lookup_trans_conn(curconn)) == NULL) + return TRUE; - if ((trans_conn = lookup_trans_conn(curconn)) == NULL) - continue; + if ((new_trans_conn = _XSERVTransAccept(trans_conn, &status)) == NULL) + return TRUE; - if ((new_trans_conn = _XSERVTransAccept(trans_conn, &status)) == NULL) - continue; + newconn = _XSERVTransGetConnectionNumber(new_trans_conn); - newconn = _XSERVTransGetConnectionNumber(new_trans_conn); + clientid = GetConnectionTranslation(newconn); + if (clientid && (client = clients[clientid])) + CloseDownClient(client); - if (newconn < lastfdesc) { - int clientid; + _XSERVTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1); -#if !defined(WIN32) - clientid = ConnectionTranslation[newconn]; -#else - clientid = GetConnectionTranslation(newconn); -#endif - if (clientid && (client = clients[clientid])) - CloseDownClient(client); - } + if (trans_conn->flags & TRANS_NOXAUTH) + new_trans_conn->flags = new_trans_conn->flags | TRANS_NOXAUTH; - _XSERVTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1); - - if (trans_conn->flags & TRANS_NOXAUTH) - new_trans_conn->flags = new_trans_conn->flags | TRANS_NOXAUTH; - - if (!AllocNewConnection(new_trans_conn, newconn, connect_time)) { - ErrorConnMax(new_trans_conn); - _XSERVTransClose(new_trans_conn); - } + if (!AllocNewConnection(new_trans_conn, newconn, connect_time)) { + ErrorConnMax(new_trans_conn); } -#ifndef WIN32 + return TRUE; } -#endif -return TRUE; + +static void +QueueNewConnections(int fd, int ready, void *data) +{ + QueueWorkProc(EstablishNewConnections, NULL, (void *) (intptr_t) fd); } #define NOROOM "Maximum number of clients reached" @@ -902,37 +838,27 @@ return TRUE; * Fail a connection due to lack of client or file descriptor space ************/ -#define BOTIMEOUT 200 /* in milliseconds */ - static void -ErrorConnMax(XtransConnInfo trans_conn) +ConnMaxNotify(int fd, int events, void *data) { - int fd = _XSERVTransGetConnectionNumber(trans_conn); - xConnSetupPrefix csp; - char pad[3] = { 0, 0, 0 }; - struct iovec iov[3]; + XtransConnInfo trans_conn = data; char order = 0; - int whichbyte = 1; - struct timeval waittime; - fd_set mask; - /* if these seems like a lot of trouble to go to, it probably is */ - waittime.tv_sec = BOTIMEOUT / MILLI_PER_SECOND; - waittime.tv_usec = (BOTIMEOUT % MILLI_PER_SECOND) * - (1000000 / MILLI_PER_SECOND); - FD_ZERO(&mask); - FD_SET(fd, &mask); - (void) Select(fd + 1, &mask, NULL, NULL, &waittime); /* try to read the byte-order of the connection */ (void) _XSERVTransRead(trans_conn, &order, 1); if (order == 'l' || order == 'B' || order == 'r' || order == 'R') { + xConnSetupPrefix csp; + char pad[3] = { 0, 0, 0 }; + int whichbyte = 1; + struct iovec iov[3]; + csp.success = xFalse; csp.lengthReason = sizeof(NOROOM) - 1; csp.length = (sizeof(NOROOM) + 2) >> 2; csp.majorVersion = X_PROTOCOL; csp.minorVersion = X_PROTOCOL_REVISION; - if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) || - (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { + if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) || + (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { swaps(&csp.majorVersion); swaps(&csp.minorVersion); swaps(&csp.length); @@ -945,6 +871,15 @@ ErrorConnMax(XtransConnInfo trans_conn) iov[2].iov_base = pad; (void) _XSERVTransWritev(trans_conn, iov, 3); } + RemoveNotifyFd(trans_conn->fd); + _XSERVTransClose(trans_conn); +} + +static void +ErrorConnMax(XtransConnInfo trans_conn) +{ + if (!SetNotifyFd(trans_conn->fd, ConnMaxNotify, X_NOTIFY_READ, trans_conn)) + _XSERVTransClose(trans_conn); } /************ @@ -966,80 +901,7 @@ CloseDownFileDescriptor(OsCommPtr oc) #else SetConnectionTranslation(connection, 0); #endif - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - FD_CLR(connection, &ClientsWithInput); - FD_CLR(connection, &GrabImperviousClients); - if (GrabInProgress) { - FD_CLR(connection, &SavedAllSockets); - FD_CLR(connection, &SavedAllClients); - FD_CLR(connection, &SavedClientsWithInput); - } - FD_CLR(connection, &ClientsWriteBlocked); - if (!XFD_ANYSET(&ClientsWriteBlocked)) - AnyClientsWriteBlocked = FALSE; - FD_CLR(connection, &OutputPending); -} - -/***************** - * CheckConnections - * Some connection has died, go find which one and shut it down - * The file descriptor has been closed, but is still in AllClients. - * If would truly be wonderful if select() would put the bogus - * file descriptors in the exception mask, but nooooo. So we have - * to check each and every socket individually. - *****************/ - -void -CheckConnections(void) -{ -#ifndef WIN32 - fd_mask mask; -#endif - fd_set tmask; - int curclient, curoff; - int i; - struct timeval notime; - int r; - -#ifdef WIN32 - fd_set savedAllClients; -#endif - - notime.tv_sec = 0; - notime.tv_usec = 0; - -#ifndef WIN32 - for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) { - mask = AllClients.fds_bits[i]; - while (mask) { - curoff = mffs(mask) - 1; - curclient = curoff + (i * (sizeof(fd_mask) * 8)); - FD_ZERO(&tmask); - FD_SET(curclient, &tmask); - do { - r = Select(curclient + 1, &tmask, NULL, NULL, ¬ime); - } while (r < 0 && (errno == EINTR || errno == EAGAIN)); - if (r < 0) - if (ConnectionTranslation[curclient] > 0) - CloseDownClient(clients[ConnectionTranslation[curclient]]); - mask &= ~((fd_mask) 1 << curoff); - } - } -#else - XFD_COPYSET(&AllClients, &savedAllClients); - for (i = 0; i < XFD_SETCOUNT(&savedAllClients); i++) { - curclient = XFD_FD(&savedAllClients, i); - FD_ZERO(&tmask); - FD_SET(curclient, &tmask); - do { - r = Select(curclient + 1, &tmask, NULL, NULL, ¬ime); - } while (r < 0 && (errno == EINTR || errno == EAGAIN)); - if (r < 0) - if (GetConnectionTranslation(curclient) > 0) - CloseDownClient(clients[GetConnectionTranslation(curclient)]); - } -#endif + ospoll_remove(server_poll, connection); } /***************** @@ -1053,7 +915,7 @@ CloseDownConnection(ClientPtr client) OsCommPtr oc = (OsCommPtr) client->osPrivate; if (FlushCallback) - CallCallbacks(&FlushCallback, NULL); + CallCallbacks(&FlushCallback, client); if (oc->output) FlushClient(client, oc, (char *) NULL, 0); @@ -1068,34 +930,67 @@ CloseDownConnection(ClientPtr client) AuditF("client %d disconnected\n", client->index); } -void -AddGeneralSocket(int fd) +struct notify_fd { + int mask; + NotifyFdProcPtr notify; + void *data; +}; + +/***************** + * HandleNotifyFd + * A poll callback to be called when the registered + * file descriptor is ready. + *****************/ + +static void +HandleNotifyFd(int fd, int xevents, void *data) { - FD_SET(fd, &AllSockets); - if (GrabInProgress) - FD_SET(fd, &SavedAllSockets); + struct notify_fd *n = data; + n->notify(fd, xevents, n->data); } -void -AddEnabledDevice(int fd) -{ - FD_SET(fd, &EnabledDevices); - AddGeneralSocket(fd); -} +/***************** + * SetNotifyFd + * Registers a callback to be invoked when the specified + * file descriptor becomes readable. + *****************/ -void -RemoveGeneralSocket(int fd) +Bool +SetNotifyFd(int fd, NotifyFdProcPtr notify, int mask, void *data) { - FD_CLR(fd, &AllSockets); - if (GrabInProgress) - FD_CLR(fd, &SavedAllSockets); -} + struct notify_fd *n; -void -RemoveEnabledDevice(int fd) -{ - FD_CLR(fd, &EnabledDevices); - RemoveGeneralSocket(fd); + n = ospoll_data(server_poll, fd); + if (!n) { + if (mask == 0) + return TRUE; + + n = calloc(1, sizeof (struct notify_fd)); + if (!n) + return FALSE; + ospoll_add(server_poll, fd, + ospoll_trigger_level, + HandleNotifyFd, + n); + } + + if (mask == 0) { + ospoll_remove(server_poll, fd); + free(n); + } else { + int listen = mask & ~n->mask; + int mute = n->mask & ~mask; + + if (listen) + ospoll_listen(server_poll, fd, listen); + if (mute) + ospoll_mute(server_poll, fd, mute); + n->mask = mask; + n->data = data; + n->notify = notify; + } + + return TRUE; } /***************** @@ -1111,30 +1006,17 @@ RemoveEnabledDevice(int fd) int OnlyListenToOneClient(ClientPtr client) { - OsCommPtr oc = (OsCommPtr) client->osPrivate; - int rc, connection = oc->fd; + int rc; rc = XaceHook(XACE_SERVER_ACCESS, client, DixGrabAccess); if (rc != Success) return rc; if (!GrabInProgress) { - XFD_COPYSET(&ClientsWithInput, &SavedClientsWithInput); - XFD_ANDSET(&ClientsWithInput, - &ClientsWithInput, &GrabImperviousClients); - if (FD_ISSET(connection, &SavedClientsWithInput)) { - FD_CLR(connection, &SavedClientsWithInput); - FD_SET(connection, &ClientsWithInput); - } - XFD_UNSET(&SavedClientsWithInput, &GrabImperviousClients); - XFD_COPYSET(&AllSockets, &SavedAllSockets); - XFD_COPYSET(&AllClients, &SavedAllClients); - XFD_UNSET(&AllSockets, &AllClients); - XFD_ANDSET(&AllClients, &AllClients, &GrabImperviousClients); - FD_SET(connection, &AllClients); - XFD_ORSET(&AllSockets, &AllSockets, &AllClients); GrabInProgress = client->index; + set_poll_clients(); } + return rc; } @@ -1147,10 +1029,8 @@ void ListenToAllClients(void) { if (GrabInProgress) { - XFD_ORSET(&AllSockets, &AllSockets, &SavedAllSockets); - XFD_ORSET(&AllClients, &AllClients, &SavedAllClients); - XFD_ORSET(&ClientsWithInput, &ClientsWithInput, &SavedClientsWithInput); GrabInProgress = 0; + set_poll_clients(); } } @@ -1164,32 +1044,16 @@ void IgnoreClient(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; - int connection = oc->fd; client->ignoreCount++; if (client->ignoreCount > 1) return; isItTimeToYield = TRUE; - if (!GrabInProgress || FD_ISSET(connection, &AllClients)) { - if (FD_ISSET(connection, &ClientsWithInput)) - FD_SET(connection, &IgnoredClientsWithInput); - else - FD_CLR(connection, &IgnoredClientsWithInput); - FD_CLR(connection, &ClientsWithInput); - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - FD_CLR(connection, &LastSelectMask); - } - else { - if (FD_ISSET(connection, &SavedClientsWithInput)) - FD_SET(connection, &IgnoredClientsWithInput); - else - FD_CLR(connection, &IgnoredClientsWithInput); - FD_CLR(connection, &SavedClientsWithInput); - FD_CLR(connection, &SavedAllSockets); - FD_CLR(connection, &SavedAllClients); - } + mark_client_not_ready(client); + + oc->flags |= OS_COMM_IGNORED; + set_poll_client(client); } /**************** @@ -1201,25 +1065,18 @@ void AttendClient(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; - int connection = oc->fd; client->ignoreCount--; if (client->ignoreCount) return; - if (!GrabInProgress || GrabInProgress == client->index || - FD_ISSET(connection, &GrabImperviousClients)) { - FD_SET(connection, &AllClients); - FD_SET(connection, &AllSockets); - FD_SET(connection, &LastSelectMask); - if (FD_ISSET(connection, &IgnoredClientsWithInput)) - FD_SET(connection, &ClientsWithInput); - } + oc->flags &= ~OS_COMM_IGNORED; + set_poll_client(client); + if (listen_to_client(client)) + mark_client_ready(client); else { - FD_SET(connection, &SavedAllClients); - FD_SET(connection, &SavedAllSockets); - if (FD_ISSET(connection, &IgnoredClientsWithInput)) - FD_SET(connection, &SavedClientsWithInput); + /* grab active, mark ready when grab goes away */ + mark_client_saved_ready(client); } } @@ -1229,9 +1086,9 @@ void MakeClientGrabImpervious(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; - int connection = oc->fd; - FD_SET(connection, &GrabImperviousClients); + oc->flags |= OS_COMM_GRAB_IMPERVIOUS; + set_poll_client(client); if (ServerGrabCallback) { ServerGrabInfoRec grabinfo; @@ -1248,18 +1105,10 @@ void MakeClientGrabPervious(ClientPtr client) { OsCommPtr oc = (OsCommPtr) client->osPrivate; - int connection = oc->fd; - FD_CLR(connection, &GrabImperviousClients); - if (GrabInProgress && (GrabInProgress != client->index)) { - if (FD_ISSET(connection, &ClientsWithInput)) { - FD_SET(connection, &SavedClientsWithInput); - FD_CLR(connection, &ClientsWithInput); - } - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - isItTimeToYield = TRUE; - } + oc->flags &= ~OS_COMM_GRAB_IMPERVIOUS; + set_poll_client(client); + isItTimeToYield = TRUE; if (ServerGrabCallback) { ServerGrabInfoRec grabinfo; @@ -1310,8 +1159,7 @@ ListenOnOpenFD(int fd, int noxauth) ListenTransConns[ListenTransCount] = ciptr; ListenTransFds[ListenTransCount] = fd; - FD_SET(fd, &WellKnownConnections); - FD_SET(fd, &AllSockets); + SetNotifyFd(fd, QueueNewConnections, X_NOTIFY_READ, NULL); /* Increment the count */ ListenTransCount++; @@ -1337,9 +1185,51 @@ AddClientOnOpenFD(int fd) if (!AllocNewConnection(ciptr, fd, connect_time)) { ErrorConnMax(ciptr); - _XSERVTransClose(ciptr); return FALSE; } return TRUE; } + +Bool +listen_to_client(ClientPtr client) +{ + OsCommPtr oc = (OsCommPtr) client->osPrivate; + + if (oc->flags & OS_COMM_IGNORED) + return FALSE; + + if (!GrabInProgress) + return TRUE; + + if (client->index == GrabInProgress) + return TRUE; + + if (oc->flags & OS_COMM_GRAB_IMPERVIOUS) + return TRUE; + + return FALSE; +} + +static void +set_poll_client(ClientPtr client) +{ + OsCommPtr oc = (OsCommPtr) client->osPrivate; + + if (listen_to_client(client)) + ospoll_listen(server_poll, oc->fd, X_NOTIFY_READ); + else + ospoll_mute(server_poll, oc->fd, X_NOTIFY_READ); +} + +static void +set_poll_clients(void) +{ + int i; + + for (i = 1; i < currentMaxClients; i++) { + ClientPtr client = clients[i]; + if (client && !client->clientGone) + set_poll_client(client); + } +} diff --git a/xserver/os/inputthread.c b/xserver/os/inputthread.c new file mode 100644 index 000000000..721e86312 --- /dev/null +++ b/xserver/os/inputthread.c @@ -0,0 +1,559 @@ +/* inputthread.c -- Threaded generation of input events. + * + * Copyright © 2007-2008 Tiago Vignatti + * Copyright © 2010 Nokia + * + * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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. + * + * Authors: Fernando Carrijo + * Tiago Vignatti + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include "inputstr.h" +#include "opaque.h" +#include "osdep.h" + +#if INPUTTHREAD + +Bool InputThreadEnable = TRUE; + +/** + * An input device as seen by the threaded input facility + */ + +typedef enum _InputDeviceState { + device_state_added, + device_state_running, + device_state_removed +} InputDeviceState; + +typedef struct _InputThreadDevice { + struct xorg_list node; + NotifyFdProcPtr readInputProc; + void *readInputArgs; + int fd; + InputDeviceState state; +} InputThreadDevice; + +/** + * The threaded input facility. + * + * For now, we have one instance for all input devices. + */ +typedef struct { + pthread_t thread; + struct xorg_list devs; + struct ospoll *fds; + int readPipe; + int writePipe; + Bool changed; + Bool running; +} InputThreadInfo; + +static InputThreadInfo *inputThreadInfo; + +static int hotplugPipeRead = -1; +static int hotplugPipeWrite = -1; + +static int input_mutex_count; + +#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +static pthread_mutex_t input_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; +#else +static pthread_mutex_t input_mutex; +static Bool input_mutex_initialized; +#endif + +int +in_input_thread(void) +{ + return inputThreadInfo && + pthread_equal(pthread_self(), inputThreadInfo->thread); +} + +void +input_lock(void) +{ +#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP + if (!input_mutex_initialized) { + pthread_mutexattr_t mutex_attr; + + input_mutex_initialized = TRUE; + pthread_mutexattr_init(&mutex_attr); + pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&input_mutex, &mutex_attr); + } +#endif + pthread_mutex_lock(&input_mutex); + ++input_mutex_count; +} + +void +input_unlock(void) +{ + --input_mutex_count; + pthread_mutex_unlock(&input_mutex); +} + +void +input_force_unlock(void) +{ + if (pthread_mutex_trylock(&input_mutex) == 0) { + input_mutex_count++; + /* unlock +1 times for the trylock */ + while (input_mutex_count > 0) + input_unlock(); + } +} + +/** + * Notify a thread about the availability of new asynchronously enqueued input + * events. + * + * @see WaitForSomething() + */ +static void +InputThreadFillPipe(int writeHead) +{ + int ret; + char byte = 0; + + do { + ret = write(writeHead, &byte, 1); + } while (ret < 0 && ETEST(errno)); +} + +/** + * Consume eventual notifications left by a thread. + * + * @see WaitForSomething() + * @see InputThreadFillPipe() + */ +static int +InputThreadReadPipe(int readHead) +{ + int ret, array[10]; + + ret = read(readHead, &array, sizeof(array)); + if (ret >= 0) + return ret; + + if (errno != EAGAIN) + FatalError("input-thread: draining pipe (%d)", errno); + + return 1; +} + +static void +InputReady(int fd, int xevents, void *data) +{ + InputThreadDevice *dev = data; + + input_lock(); + if (dev->state == device_state_running) + dev->readInputProc(fd, xevents, dev->readInputArgs); + input_unlock(); +} + +/** + * Register an input device in the threaded input facility + * + * @param fd File descriptor which identifies the input device + * @param readInputProc Procedure used to read input from the device + * @param readInputArgs Arguments to be consumed by the above procedure + * + * return 1 if success; 0 otherwise. + */ +int +InputThreadRegisterDev(int fd, + NotifyFdProcPtr readInputProc, + void *readInputArgs) +{ + InputThreadDevice *dev, *old; + + if (!inputThreadInfo) + return SetNotifyFd(fd, readInputProc, X_NOTIFY_READ, readInputArgs); + + input_lock(); + + dev = NULL; + xorg_list_for_each_entry(old, &inputThreadInfo->devs, node) { + if (old->fd == fd && old->state != device_state_removed) { + dev = old; + break; + } + } + + if (dev) { + dev->readInputProc = readInputProc; + dev->readInputArgs = readInputArgs; + } else { + dev = calloc(1, sizeof(InputThreadDevice)); + if (dev == NULL) { + DebugF("input-thread: could not register device\n"); + input_unlock(); + return 0; + } + + dev->fd = fd; + dev->readInputProc = readInputProc; + dev->readInputArgs = readInputArgs; + dev->state = device_state_added; + + /* Do not prepend, so that any dev->state == device_state_removed + * with the same dev->fd get processed first. */ + xorg_list_append(&dev->node, &inputThreadInfo->devs); + } + + inputThreadInfo->changed = TRUE; + + input_unlock(); + + DebugF("input-thread: registered device %d\n", fd); + InputThreadFillPipe(hotplugPipeWrite); + + return 1; +} + +/** + * Unregister a device in the threaded input facility + * + * @param fd File descriptor which identifies the input device + * + * @return 1 if success; 0 otherwise. + */ +int +InputThreadUnregisterDev(int fd) +{ + InputThreadDevice *dev; + Bool found_device = FALSE; + + /* return silently if input thread is already finished (e.g., at + * DisableDevice time, evdev tries to call this function again through + * xf86RemoveEnabledDevice) */ + if (!inputThreadInfo) { + RemoveNotifyFd(fd); + return 1; + } + + input_lock(); + xorg_list_for_each_entry(dev, &inputThreadInfo->devs, node) + if (dev->fd == fd) { + found_device = TRUE; + break; + } + + /* fd didn't match any registered device. */ + if (!found_device) { + input_unlock(); + return 0; + } + + dev->state = device_state_removed; + inputThreadInfo->changed = TRUE; + + input_unlock(); + + InputThreadFillPipe(hotplugPipeWrite); + DebugF("input-thread: unregistered device: %d\n", fd); + + return 1; +} + +static void +InputThreadPipeNotify(int fd, int revents, void *data) +{ + /* Empty pending input, shut down if the pipe has been closed */ + if (InputThreadReadPipe(hotplugPipeRead) == 0) { + inputThreadInfo->running = FALSE; + } +} + +/** + * The workhorse of threaded input event generation. + * + * Or if you prefer: The WaitForSomething for input devices. :) + * + * Runs in parallel with the server main thread, listening to input devices in + * an endless loop. Whenever new input data is made available, calls the + * proper device driver's routines which are ultimately responsible for the + * generation of input events. + * + * @see InputThreadPreInit() + * @see InputThreadInit() + */ + +static void* +InputThreadDoWork(void *arg) +{ + sigset_t set; + + /* Don't handle any signals on this thread */ + sigfillset(&set); + pthread_sigmask(SIG_BLOCK, &set, NULL); + + inputThreadInfo->running = TRUE; + +#if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) + pthread_setname_np (pthread_self(), "InputThread"); +#elif defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) + pthread_setname_np ("InputThread"); +#endif + + ospoll_add(inputThreadInfo->fds, hotplugPipeRead, + ospoll_trigger_level, + InputThreadPipeNotify, + NULL); + ospoll_listen(inputThreadInfo->fds, hotplugPipeRead, X_NOTIFY_READ); + + while (inputThreadInfo->running) + { + DebugF("input-thread: %s waiting for devices\n", __func__); + + /* Check for hotplug changes and modify the ospoll structure to suit */ + if (inputThreadInfo->changed) { + InputThreadDevice *dev, *tmp; + + input_lock(); + inputThreadInfo->changed = FALSE; + xorg_list_for_each_entry_safe(dev, tmp, &inputThreadInfo->devs, node) { + switch (dev->state) { + case device_state_added: + ospoll_add(inputThreadInfo->fds, dev->fd, + ospoll_trigger_level, + InputReady, + dev); + ospoll_listen(inputThreadInfo->fds, dev->fd, X_NOTIFY_READ); + dev->state = device_state_running; + break; + case device_state_running: + break; + case device_state_removed: + ospoll_remove(inputThreadInfo->fds, dev->fd); + xorg_list_del(&dev->node); + free(dev); + break; + } + } + input_unlock(); + } + + if (ospoll_wait(inputThreadInfo->fds, -1) < 0) { + if (errno == EINVAL) + FatalError("input-thread: %s (%s)", __func__, strerror(errno)); + else if (errno != EINTR) + ErrorF("input-thread: %s (%s)\n", __func__, strerror(errno)); + } + + /* Kick main thread to process the generated input events and drain + * events from hotplug pipe */ + InputThreadFillPipe(inputThreadInfo->writePipe); + } + + ospoll_remove(inputThreadInfo->fds, hotplugPipeRead); + + return NULL; +} + +static void +InputThreadNotifyPipe(int fd, int mask, void *data) +{ + InputThreadReadPipe(fd); +} + +/** + * Pre-initialize the facility used for threaded generation of input events + * + */ +void +InputThreadPreInit(void) +{ + int fds[2], hotplugPipe[2]; + int flags; + + if (!InputThreadEnable) + return; + + if (pipe(fds) < 0) + FatalError("input-thread: could not create pipe"); + + if (pipe(hotplugPipe) < 0) + FatalError("input-thread: could not create pipe"); + + inputThreadInfo = malloc(sizeof(InputThreadInfo)); + if (!inputThreadInfo) + FatalError("input-thread: could not allocate memory"); + + inputThreadInfo->thread = 0; + xorg_list_init(&inputThreadInfo->devs); + inputThreadInfo->fds = ospoll_create(); + + /* By making read head non-blocking, we ensure that while the main thread + * is busy servicing client requests, the dedicated input thread can work + * in parallel. + */ + inputThreadInfo->readPipe = fds[0]; + fcntl(inputThreadInfo->readPipe, F_SETFL, O_NONBLOCK); + flags = fcntl(inputThreadInfo->readPipe, F_GETFD); + if (flags != -1) { + flags |= FD_CLOEXEC; + (void)fcntl(inputThreadInfo->readPipe, F_SETFD, &flags); + } + SetNotifyFd(inputThreadInfo->readPipe, InputThreadNotifyPipe, X_NOTIFY_READ, NULL); + + inputThreadInfo->writePipe = fds[1]; + + hotplugPipeRead = hotplugPipe[0]; + fcntl(hotplugPipeRead, F_SETFL, O_NONBLOCK); + flags = fcntl(hotplugPipeRead, F_GETFD); + if (flags != -1) { + flags |= FD_CLOEXEC; + (void)fcntl(hotplugPipeRead, F_SETFD, &flags); + } + hotplugPipeWrite = hotplugPipe[1]; + +#ifndef __linux__ /* Linux does not deal well with renaming the main thread */ +#if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) + pthread_setname_np (pthread_self(), "MainThread"); +#elif defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) + pthread_setname_np ("MainThread"); +#endif +#endif + +} + +/** + * Start the threaded generation of input events. This routine complements what + * was previously done by InputThreadPreInit(), being only responsible for + * creating the dedicated input thread. + * + */ +void +InputThreadInit(void) +{ + pthread_attr_t attr; + + /* If the driver hasn't asked for input thread support by calling + * InputThreadPreInit, then do nothing here + */ + if (!inputThreadInfo) + return; + + pthread_attr_init(&attr); + + /* For OSes that differentiate between processes and threads, the following + * lines have sense. Linux uses the 1:1 thread model. The scheduler handles + * every thread as a normal process. Therefore this probably has no meaning + * if we are under Linux. + */ + if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) != 0) + ErrorF("input-thread: error setting thread scope\n"); + + DebugF("input-thread: creating thread\n"); + pthread_create(&inputThreadInfo->thread, &attr, + &InputThreadDoWork, NULL); + + pthread_attr_destroy (&attr); +} + +/** + * Stop the threaded generation of input events + * + * This function is supposed to be called at server shutdown time only. + */ +void +InputThreadFini(void) +{ + InputThreadDevice *dev, *next; + + if (!inputThreadInfo) + return; + + /* Close the pipe to get the input thread to shut down */ + close(hotplugPipeWrite); + pthread_join(inputThreadInfo->thread, NULL); + + xorg_list_for_each_entry_safe(dev, next, &inputThreadInfo->devs, node) { + ospoll_remove(inputThreadInfo->fds, dev->fd); + free(dev); + } + xorg_list_init(&inputThreadInfo->devs); + ospoll_destroy(inputThreadInfo->fds); + + RemoveNotifyFd(inputThreadInfo->readPipe); + close(inputThreadInfo->readPipe); + close(inputThreadInfo->writePipe); + inputThreadInfo->readPipe = -1; + inputThreadInfo->writePipe = -1; + + close(hotplugPipeRead); + hotplugPipeRead = -1; + hotplugPipeWrite = -1; + + free(inputThreadInfo); + inputThreadInfo = NULL; +} + +int xthread_sigmask(int how, const sigset_t *set, sigset_t *oldset) +{ + return pthread_sigmask(how, set, oldset); +} + +#else /* INPUTTHREAD */ + +Bool InputThreadEnable = FALSE; + +void input_lock(void) {} +void input_unlock(void) {} +void input_force_unlock(void) {} + +void InputThreadPreInit(void) {} +void InputThreadInit(void) {} +void InputThreadFini(void) {} +int in_input_thread(void) { return 0; } + +int InputThreadRegisterDev(int fd, + NotifyFdProcPtr readInputProc, + void *readInputArgs) +{ + return SetNotifyFd(fd, readInputProc, X_NOTIFY_READ, readInputArgs); +} + +extern int InputThreadUnregisterDev(int fd) +{ + RemoveNotifyFd(fd); + return 1; +} + +int xthread_sigmask(int how, const sigset_t *set, sigset_t *oldset) +{ + return sigprocmask(how, set, oldset); +} + +#endif diff --git a/xserver/os/io.c b/xserver/os/io.c index bc26da7e5..70f07f3be 100644 --- a/xserver/os/io.c +++ b/xserver/os/io.c @@ -74,7 +74,6 @@ SOFTWARE. #include #include "os.h" #include "osdep.h" -#include #include "opaque.h" #include "dixstruct.h" #include "misc.h" @@ -102,20 +101,6 @@ typedef struct _connectionOutput { static ConnectionInputPtr AllocateInputBuffer(void); static ConnectionOutputPtr AllocateOutputBuffer(void); -/* If EAGAIN and EWOULDBLOCK are distinct errno values, then we check errno - * for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX - * systems are broken and return EWOULDBLOCK when they should return EAGAIN - */ -#ifndef WIN32 -# if (EAGAIN != EWOULDBLOCK) -# define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK) -# else -# define ETEST(err) (err == EAGAIN) -# endif -#else /* WIN32 The socket errorcodes differ from the normal errors */ -#define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK) -#endif - static Bool CriticalOutputPending; static int timesThisConnection = 0; static ConnectionInputPtr FreeInputs = (ConnectionInputPtr) NULL; @@ -132,8 +117,8 @@ static OsCommPtr AvailableInput = (OsCommPtr) NULL; ((xBigReq *)(req))->length) #define MAX_TIMES_PER 10 -#define BUFSIZE 4096 -#define BUFWATERMARK 8192 +#define BUFSIZE 16384 +#define BUFWATERMARK 32768 /* * A lot of the code in this file manipulates a ConnectionInputPtr: @@ -202,7 +187,7 @@ static void YieldControlNoInput(int fd) { YieldControl(); - FD_CLR(fd, &ClientsWithInput); + ospoll_reset_events(server_poll, fd); } static void @@ -368,7 +353,8 @@ ReadRequestFromClient(ClientPtr client) oci->size - oci->bufcnt); if (result <= 0) { if ((result < 0) && ETEST(errno)) { -#if defined(SVR4) && defined(__i386__) && !defined(sun) + mark_client_not_ready(client); +#if defined(SVR4) && defined(__i386__) && !defined(__sun) if (0) #endif { @@ -452,33 +438,8 @@ ReadRequestFromClient(ClientPtr client) */ gotnow -= needed; - if (gotnow >= sizeof(xReq)) { - request = (xReq *) (oci->bufptr + needed); - if (gotnow >= (result = (get_req_len(request, client) << 2)) - && (result || - (client->big_requests && - (gotnow >= sizeof(xBigReq) && - gotnow >= (get_big_req_len(request, client) << 2)))) - ) - FD_SET(fd, &ClientsWithInput); - else { - if (!SmartScheduleDisable) - FD_CLR(fd, &ClientsWithInput); - else - YieldControlNoInput(fd); - } - } - else { - if (!gotnow) - AvailableInput = oc; - if (!SmartScheduleDisable) - FD_CLR(fd, &ClientsWithInput); - else - YieldControlNoInput(fd); - } - if (SmartScheduleDisable) - if (++timesThisConnection >= MAX_TIMES_PER) - YieldControl(); + if (!gotnow) + AvailableInput = oc; if (move_header) { if (client->req_len < bytes_to_int32(sizeof(xBigReq) - sizeof(xReq))) { YieldControlDeath(); @@ -576,7 +537,7 @@ InsertFakeRequest(ClientPtr client, char *data, int count) gotnow += count; if ((gotnow >= sizeof(xReq)) && (gotnow >= (int) (get_req_len((xReq *) oci->bufptr, client) << 2))) - FD_SET(fd, &ClientsWithInput); + mark_client_ready(client); else YieldControlNoInput(fd); return TRUE; @@ -616,12 +577,8 @@ ResetCurrentRequest(ClientPtr client) } } if (gotnow >= (needed << 2)) { - if (FD_ISSET(fd, &AllClients)) { - FD_SET(fd, &ClientsWithInput); - } - else { - FD_SET(fd, &IgnoredClientsWithInput); - } + if (listen_to_client(client)) + mark_client_ready(client); YieldControl(); } else @@ -642,19 +599,10 @@ ResetCurrentRequest(ClientPtr client) void FlushAllOutput(void) { - register int index, base; - register fd_mask mask; /* raphael */ OsCommPtr oc; - register ClientPtr client; + register ClientPtr client, tmp; Bool newoutput = NewOutputPending; -#if defined(WIN32) - fd_set newOutputPending; -#endif - - if (FlushCallback) - CallCallbacks(&FlushCallback, NULL); - if (!newoutput) return; @@ -666,48 +614,15 @@ FlushAllOutput(void) CriticalOutputPending = FALSE; NewOutputPending = FALSE; -#ifndef WIN32 - for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++) { - mask = OutputPending.fds_bits[base]; - OutputPending.fds_bits[base] = 0; - while (mask) { - index = ffs(mask) - 1; - mask &= ~lowbit(mask); - if ((index = - ConnectionTranslation[(base * (sizeof(fd_mask) * 8)) + - index]) == 0) - continue; - client = clients[index]; - if (client->clientGone) - continue; - oc = (OsCommPtr) client->osPrivate; - if (FD_ISSET(oc->fd, &ClientsWithInput)) { - FD_SET(oc->fd, &OutputPending); /* set the bit again */ - NewOutputPending = TRUE; - } - else - (void) FlushClient(client, oc, (char *) NULL, 0); - } - } -#else /* WIN32 */ - FD_ZERO(&newOutputPending); - for (base = 0; base < XFD_SETCOUNT(&OutputPending); base++) { - index = XFD_FD(&OutputPending, base); - if ((index = GetConnectionTranslation(index)) == 0) - continue; - client = clients[index]; + xorg_list_for_each_entry_safe(client, tmp, &output_pending_clients, output_pending) { if (client->clientGone) continue; - oc = (OsCommPtr) client->osPrivate; - if (FD_ISSET(oc->fd, &ClientsWithInput)) { - FD_SET(oc->fd, &newOutputPending); /* set the bit again */ - NewOutputPending = TRUE; - } - else + if (!client_is_ready(client)) { + oc = (OsCommPtr) client->osPrivate; (void) FlushClient(client, oc, (char *) NULL, 0); + } else + NewOutputPending = TRUE; } - XFD_COPYSET(&newOutputPending, &OutputPending); -#endif /* WIN32 */ } void @@ -723,6 +638,28 @@ SetCriticalOutputPending(void) CriticalOutputPending = TRUE; } +/***************** + * AbortClient: + * When a write error occurs to a client, close + * the connection and clean things up. Mark + * the client as 'ready' so that the server will + * try to read from it again, notice that the fd is + * closed and clean up from there. + *****************/ + +static void +AbortClient(ClientPtr client) +{ + OsCommPtr oc = client->osPrivate; + + if (oc->trans_conn) { + _XSERVTransDisconnect(oc->trans_conn); + _XSERVTransClose(oc->trans_conn); + oc->trans_conn = NULL; + mark_client_ready(client); + } +} + /***************** * WriteToClient * Copies buf into ClientPtr.buf if it fits (with padding), else @@ -742,6 +679,9 @@ WriteToClient(ClientPtr who, int count, const void *__buf) int padBytes; const char *buf = __buf; + BUG_RETURN_VAL_MSG(in_input_thread(), 0, + "******** %s called from input thread *********\n", __func__); + #ifdef DEBUG_COMMUNICATION Bool multicount = FALSE; #endif @@ -795,11 +735,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf) FreeOutputs = oco->next; } else if (!(oco = AllocateOutputBuffer())) { - if (oc->trans_conn) { - _XSERVTransDisconnect(oc->trans_conn); - _XSERVTransClose(oc->trans_conn); - oc->trans_conn = NULL; - } + AbortClient(who); MarkClientException(who); return -1; } @@ -849,20 +785,17 @@ WriteToClient(ClientPtr who, int count, const void *__buf) } #endif if (oco->count == 0 || oco->count + count + padBytes > oco->size) { - FD_CLR(oc->fd, &OutputPending); - if (!XFD_ANYSET(&OutputPending)) { + output_pending_clear(who); + if (!any_output_pending()) { CriticalOutputPending = FALSE; NewOutputPending = FALSE; } - if (FlushCallback) - CallCallbacks(&FlushCallback, NULL); - return FlushClient(who, oc, buf, count); } NewOutputPending = TRUE; - FD_SET(oc->fd, &OutputPending); + output_pending_mark(who); memmove((char *) oco->buf + oco->count, buf, count); oco->count += count; if (padBytes) { @@ -886,7 +819,6 @@ int FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) { ConnectionOutputPtr oco = oc->output; - int connection = oc->fd; XtransConnInfo trans_conn = oc->trans_conn; struct iovec iov[3]; static char padBuffer[3]; @@ -904,6 +836,9 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) if (!notWritten) return 0; + if (FlushCallback) + CallCallbacks(&FlushCallback, who); + todo = notWritten; while (notWritten) { long before = written; /* amount of whole thing written */ @@ -959,8 +894,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) /* If we've arrived here, then the client is stuffed to the gills and not ready to accept more. Make a note of it and buffer the rest. */ - FD_SET(connection, &ClientsWriteBlocked); - AnyClientsWriteBlocked = TRUE; + output_pending_mark(who); if (written < oco->count) { if (written > 0) { @@ -982,9 +916,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) obuf = realloc(oco->buf, notWritten + BUFSIZE); } if (!obuf) { - _XSERVTransDisconnect(oc->trans_conn); - _XSERVTransClose(oc->trans_conn); - oc->trans_conn = NULL; + AbortClient(who); MarkClientException(who); oco->count = 0; return -1; @@ -1000,6 +932,8 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) extraBuf + written, len); oco->count = notWritten; /* this will include the pad */ + ospoll_listen(server_poll, oc->fd, X_NOTIFY_WRITE); + /* return only the amount explicitly requested */ return extraCount; } @@ -1009,11 +943,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) } #endif else { - if (oc->trans_conn) { - _XSERVTransDisconnect(oc->trans_conn); - _XSERVTransClose(oc->trans_conn); - oc->trans_conn = NULL; - } + AbortClient(who); MarkClientException(who); oco->count = 0; return -1; @@ -1022,12 +952,8 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) /* everything was flushed out */ oco->count = 0; - /* check to see if this client was write blocked */ - if (AnyClientsWriteBlocked) { - FD_CLR(oc->fd, &ClientsWriteBlocked); - if (!XFD_ANYSET(&ClientsWriteBlocked)) - AnyClientsWriteBlocked = FALSE; - } + output_pending_clear(who); + if (oco->size > BUFWATERMARK) { free(oco->buf); free(oco); diff --git a/xserver/os/osdep.h b/xserver/os/osdep.h index 1646ce3e0..3cd1216a7 100644 --- a/xserver/os/osdep.h +++ b/xserver/os/osdep.h @@ -63,42 +63,22 @@ SOFTWARE. #undef _POSIX_SOURCE #endif -#ifndef OPEN_MAX -#ifdef SVR4 -#define OPEN_MAX 512 -#else -#include -#ifndef OPEN_MAX -#if defined(NOFILE) && !defined(NOFILES_MAX) -#define OPEN_MAX NOFILE -#else -#if !defined(WIN32) || defined(__CYGWIN__) -#define OPEN_MAX NOFILES_MAX -#else -#define OPEN_MAX 512 -#endif -#endif -#endif -#endif -#endif - -#include - -/* - * MAXSOCKS is used only for initialising MaxClients when no other method - * like sysconf(_SC_OPEN_MAX) is not supported. - */ - -#if OPEN_MAX <= 512 -#define MAXSOCKS (OPEN_MAX - 1) -#else -#define MAXSOCKS 512 -#endif - -/* MAXSELECT is the number of fds that select() can handle */ -#define MAXSELECT (sizeof(fd_set) * NBBY) - #include +#include + +/* If EAGAIN and EWOULDBLOCK are distinct errno values, then we check errno + * for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX + * systems are broken and return EWOULDBLOCK when they should return EAGAIN + */ +#ifndef WIN32 +# if (EAGAIN != EWOULDBLOCK) +# define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK) +# else +# define ETEST(err) (err == EAGAIN) +# endif +#else /* WIN32 The socket errorcodes differ from the normal errors */ +#define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK) +#endif #if defined(XDMCP) || defined(HASXDMAUTH) typedef Bool (*ValidatorFunc) (ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type); @@ -145,8 +125,12 @@ typedef struct _osComm { XID auth_id; /* authorization id */ CARD32 conn_time; /* timestamp if not established, else 0 */ struct _XtransConnInfo *trans_conn; /* transport connection object */ + int flags; } OsCommRec, *OsCommPtr; +#define OS_COMM_GRAB_IMPERVIOUS 1 +#define OS_COMM_IGNORED 2 + extern int FlushClient(ClientPtr /*who */ , OsCommPtr /*oc */ , const void * /*extraBuf */ , @@ -157,19 +141,21 @@ extern void FreeOsBuffers(OsCommPtr /*oc */ ); #include "dix.h" +#include "ospoll.h" -extern fd_set AllSockets; -extern fd_set AllClients; -extern fd_set LastSelectMask; -extern fd_set WellKnownConnections; -extern fd_set EnabledDevices; -extern fd_set ClientsWithInput; -extern fd_set ClientsWriteBlocked; -extern fd_set OutputPending; -extern fd_set IgnoredClientsWithInput; +extern struct ospoll *server_poll; + +Bool +listen_to_client(ClientPtr client); #if !defined(WIN32) || defined(__CYGWIN__) extern int *ConnectionTranslation; +extern int ConnectionTranslationSize; +static inline int GetConnectionTranslation(int conn) { + if (conn >= ConnectionTranslationSize) + return 0; + return ConnectionTranslation[conn]; +} #else extern int GetConnectionTranslation(int conn); extern void SetConnectionTranslation(int conn, int client); @@ -177,7 +163,6 @@ extern void ClearConnectionTranslation(void); #endif extern Bool NewOutputPending; -extern Bool AnyClientsWriteBlocked; extern WorkQueuePtr workQueue; diff --git a/xserver/os/osinit.c b/xserver/os/osinit.c index b7a27210c..684ee040a 100644 --- a/xserver/os/osinit.c +++ b/xserver/os/osinit.c @@ -114,10 +114,14 @@ OsSigHandler(int signo) #endif { #ifdef RTLD_DI_SETSIGNAL - const char *dlerr = dlerror(); +# define SIGNAL_FOR_RTLD_ERROR SIGQUIT + if (signo == SIGNAL_FOR_RTLD_ERROR) { + const char *dlerr = dlerror(); - if (dlerr) { - LogMessageVerbSigSafe(X_ERROR, 1, "Dynamic loader error: %s\n", dlerr); + if (dlerr) { + LogMessageVerbSigSafe(X_ERROR, 1, + "Dynamic loader error: %s\n", dlerr); + } } #endif /* RTLD_DI_SETSIGNAL */ @@ -169,6 +173,7 @@ OsInit(void) int i; int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS, + SIGABRT, SIGSYS, SIGXCPU, SIGXFSZ, @@ -195,6 +200,9 @@ OsInit(void) #ifdef BUSFAULT busfault_init(); #endif + server_poll = ospoll_create(); + if (!server_poll) + FatalError("failed to allocate poll structure"); #ifdef HAVE_BACKTRACE /* @@ -214,24 +222,13 @@ OsInit(void) * after ourselves. */ { - int failure_signal = SIGQUIT; + int failure_signal = SIGNAL_FOR_RTLD_ERROR; dlinfo(RTLD_SELF, RTLD_DI_SETSIGNAL, &failure_signal); } #endif #if !defined(XQUARTZ) /* STDIN is already /dev/null and STDOUT/STDERR is managed by console_redirect.c */ -# if defined(__APPLE__) - int devnullfd = open(devnull, O_RDWR, 0); - assert(devnullfd > 2); - - dup2(devnullfd, STDIN_FILENO); - dup2(devnullfd, STDOUT_FILENO); - close(devnullfd); -# elif !defined(__CYGWIN__) - fclose(stdin); - fclose(stdout); -# endif /* * If a write of zero bytes to stderr returns non-zero, i.e. -1, * then writing to stderr failed, and we'll write somewhere else diff --git a/xserver/os/ospoll.c b/xserver/os/ospoll.c new file mode 100644 index 000000000..51bd02dc7 --- /dev/null +++ b/xserver/os/ospoll.c @@ -0,0 +1,477 @@ +/* + * Copyright © 2016 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include "misc.h" /* for typedef of pointer */ +#include "ospoll.h" +#include "list.h" + +#if !HAVE_OSPOLL && HAVE_EPOLL_CREATE1 +#include +#define EPOLL 1 +#define HAVE_OSPOLL 1 +#endif + +#if !HAVE_OSPOLL +#include "xserver_poll.h" +#define POLL 1 +#define HAVE_OSPOLL 1 +#endif + +#if EPOLL +#include + +/* epoll-based implementation */ +struct ospollfd { + int fd; + int xevents; + enum ospoll_trigger trigger; + void (*callback)(int fd, int xevents, void *data); + void *data; + struct xorg_list deleted; +}; + +struct ospoll { + int epoll_fd; + struct ospollfd **fds; + int num; + int size; + struct xorg_list deleted; +}; + +#endif + +#if POLL + +/* poll-based implementation */ +struct ospollfd { + short revents; + enum ospoll_trigger trigger; + void (*callback)(int fd, int revents, void *data); + void *data; +}; + +struct ospoll { + struct pollfd *fds; + struct ospollfd *osfds; + int num; + int size; + Bool changed; +}; + +#endif + +/* Binary search for the specified file descriptor + * + * Returns position if found + * Returns -position - 1 if not found + */ + +static int +ospoll_find(struct ospoll *ospoll, int fd) +{ + int lo = 0; + int hi = ospoll->num - 1; + + while (lo <= hi) { + int m = (lo + hi) >> 1; +#if EPOLL + int t = ospoll->fds[m]->fd; +#endif +#if POLL + int t = ospoll->fds[m].fd; +#endif + + if (t < fd) + lo = m + 1; + else if (t > fd) + hi = m - 1; + else + return m; + } + return -(lo + 1); +} + +#if EPOLL +static void +ospoll_clean_deleted(struct ospoll *ospoll) +{ + struct ospollfd *osfd, *tmp; + + xorg_list_for_each_entry_safe(osfd, tmp, &ospoll->deleted, deleted) { + xorg_list_del(&osfd->deleted); + free(osfd); + } +} +#endif + +/* Insert an element into an array + * + * base: base address of array + * num: number of elements in the array before the insert + * size: size of each element + * pos: position to insert at + */ +static inline void +array_insert(void *base, size_t num, size_t size, size_t pos) +{ + char *b = base; + + memmove(b + (pos+1) * size, + b + pos * size, + (num - pos) * size); +} + +/* Delete an element from an array + * + * base: base address of array + * num: number of elements in the array before the delete + * size: size of each element + * pos: position to delete from + */ +static inline void +array_delete(void *base, size_t num, size_t size, size_t pos) +{ + char *b = base; + + memmove(b + pos * size, b + (pos + 1) * size, + (num - pos - 1) * size); +} + + +struct ospoll * +ospoll_create(void) +{ +#if EPOLL + struct ospoll *ospoll = calloc(1, sizeof (struct ospoll)); + + ospoll->epoll_fd = epoll_create1(EPOLL_CLOEXEC); + if (ospoll->epoll_fd < 0) { + free (ospoll); + return NULL; + } + xorg_list_init(&ospoll->deleted); + return ospoll; +#endif +#if POLL + return calloc(1, sizeof (struct ospoll)); +#endif +} + +void +ospoll_destroy(struct ospoll *ospoll) +{ +#if EPOLL + if (ospoll) { + assert (ospoll->num == 0); + close(ospoll->epoll_fd); + ospoll_clean_deleted(ospoll); + free(ospoll->fds); + free(ospoll); + } +#endif +#if POLL + if (ospoll) { + assert (ospoll->num == 0); + free (ospoll->fds); + free (ospoll->osfds); + free (ospoll); + } +#endif +} + +Bool +ospoll_add(struct ospoll *ospoll, int fd, + enum ospoll_trigger trigger, + void (*callback)(int fd, int xevents, void *data), + void *data) +{ + int pos = ospoll_find(ospoll, fd); +#if EPOLL + struct ospollfd *osfd; + + if (pos < 0) { + + struct epoll_event ev; + + osfd = calloc(1, sizeof (struct ospollfd)); + if (!osfd) + return FALSE; + + if (ospoll->num >= ospoll->size) { + struct ospollfd **new_fds; + int new_size = ospoll->size ? ospoll->size * 2 : MAXCLIENTS * 2; + + new_fds = reallocarray(ospoll->fds, new_size, sizeof (ospoll->fds[0])); + if (!new_fds) { + free (osfd); + return FALSE; + } + ospoll->fds = new_fds; + ospoll->size = new_size; + } + + ev.events = 0; + ev.data.ptr = osfd; + if (trigger == ospoll_trigger_edge) + ev.events |= EPOLLET; + if (epoll_ctl(ospoll->epoll_fd, EPOLL_CTL_ADD, fd, &ev) == -1) { + free(osfd); + return FALSE; + } + osfd->fd = fd; + osfd->xevents = 0; + + pos = -pos - 1; + array_insert(ospoll->fds, ospoll->num, sizeof (ospoll->fds[0]), pos); + ospoll->fds[pos] = osfd; + ospoll->num++; + } else { + osfd = ospoll->fds[pos]; + } + osfd->data = data; + osfd->callback = callback; + osfd->trigger = trigger; +#endif +#if POLL + if (pos < 0) { + if (ospoll->num == ospoll->size) { + struct pollfd *new_fds; + struct ospollfd *new_osfds; + int new_size = ospoll->size ? ospoll->size * 2 : MAXCLIENTS * 2; + + new_fds = reallocarray(ospoll->fds, new_size, sizeof (ospoll->fds[0])); + if (!new_fds) + return FALSE; + ospoll->fds = new_fds; + new_osfds = reallocarray(ospoll->osfds, new_size, sizeof (ospoll->osfds[0])); + if (!new_osfds) + return FALSE; + ospoll->osfds = new_osfds; + ospoll->size = new_size; + } + pos = -pos - 1; + array_insert(ospoll->fds, ospoll->num, sizeof (ospoll->fds[0]), pos); + array_insert(ospoll->osfds, ospoll->num, sizeof (ospoll->osfds[0]), pos); + ospoll->num++; + ospoll->changed = TRUE; + + ospoll->fds[pos].fd = fd; + ospoll->fds[pos].events = 0; + ospoll->fds[pos].revents = 0; + ospoll->osfds[pos].revents = 0; + } + ospoll->osfds[pos].trigger = trigger; + ospoll->osfds[pos].callback = callback; + ospoll->osfds[pos].data = data; +#endif + return TRUE; +} + +void +ospoll_remove(struct ospoll *ospoll, int fd) +{ + int pos = ospoll_find(ospoll, fd); + + pos = ospoll_find(ospoll, fd); + if (pos >= 0) { +#if EPOLL + struct ospollfd *osfd = ospoll->fds[pos]; + struct epoll_event ev; + ev.events = 0; + ev.data.ptr = osfd; + (void) epoll_ctl(ospoll->epoll_fd, EPOLL_CTL_DEL, fd, &ev); + + array_delete(ospoll->fds, ospoll->num, sizeof (ospoll->fds[0]), pos); + ospoll->num--; + osfd->callback = NULL; + osfd->data = NULL; + xorg_list_add(&osfd->deleted, &ospoll->deleted); +#endif +#if POLL + array_delete(ospoll->fds, ospoll->num, sizeof (ospoll->fds[0]), pos); + array_delete(ospoll->osfds, ospoll->num, sizeof (ospoll->osfds[0]), pos); + ospoll->num--; + ospoll->changed = TRUE; +#endif + } +} + +#if EPOLL +static void +epoll_mod(struct ospoll *ospoll, struct ospollfd *osfd) +{ + struct epoll_event ev; + ev.events = 0; + if (osfd->xevents & X_NOTIFY_READ) + ev.events |= EPOLLIN; + if (osfd->xevents & X_NOTIFY_WRITE) + ev.events |= EPOLLOUT; + if (osfd->trigger == ospoll_trigger_edge) + ev.events |= EPOLLET; + ev.data.ptr = osfd; + (void) epoll_ctl(ospoll->epoll_fd, EPOLL_CTL_MOD, osfd->fd, &ev); +} +#endif + +void +ospoll_listen(struct ospoll *ospoll, int fd, int xevents) +{ + int pos = ospoll_find(ospoll, fd); + + if (pos >= 0) { +#if EPOLL + struct ospollfd *osfd = ospoll->fds[pos]; + osfd->xevents |= xevents; + epoll_mod(ospoll, osfd); +#endif +#if POLL + if (xevents & X_NOTIFY_READ) { + ospoll->fds[pos].events |= POLLIN; + ospoll->osfds[pos].revents &= ~POLLIN; + } + if (xevents & X_NOTIFY_WRITE) { + ospoll->fds[pos].events |= POLLOUT; + ospoll->osfds[pos].revents &= ~POLLOUT; + } +#endif + } +} + +void +ospoll_mute(struct ospoll *ospoll, int fd, int xevents) +{ + int pos = ospoll_find(ospoll, fd); + + if (pos >= 0) { +#if EPOLL + struct ospollfd *osfd = ospoll->fds[pos]; + osfd->xevents &= ~xevents; + epoll_mod(ospoll, osfd); +#endif +#if POLL + if (xevents & X_NOTIFY_READ) + ospoll->fds[pos].events &= ~POLLIN; + if (xevents & X_NOTIFY_WRITE) + ospoll->fds[pos].events &= ~POLLOUT; +#endif + } +} + + +int +ospoll_wait(struct ospoll *ospoll, int timeout) +{ + int nready; +#if EPOLL +#define MAX_EVENTS 256 + struct epoll_event events[MAX_EVENTS]; + int i; + + nready = epoll_wait(ospoll->epoll_fd, events, MAX_EVENTS, timeout); + for (i = 0; i < nready; i++) { + struct epoll_event *ev = &events[i]; + struct ospollfd *osfd = ev->data.ptr; + uint32_t revents = ev->events; + int xevents = 0; + + if (revents & EPOLLIN) + xevents |= X_NOTIFY_READ; + if (revents & EPOLLOUT) + xevents |= X_NOTIFY_WRITE; + if (revents & (~(EPOLLIN|EPOLLOUT))) + xevents |= X_NOTIFY_ERROR; + + if (osfd->callback) + osfd->callback(osfd->fd, xevents, osfd->data); + } + ospoll_clean_deleted(ospoll); +#endif +#if POLL + nready = xserver_poll(ospoll->fds, ospoll->num, timeout); + ospoll->changed = FALSE; + if (nready > 0) { + int f; + for (f = 0; f < ospoll->num; f++) { + short revents = ospoll->fds[f].revents; + short oldevents = ospoll->osfds[f].revents; + + ospoll->osfds[f].revents = (revents & (POLLIN|POLLOUT)); + if (ospoll->osfds[f].trigger == ospoll_trigger_edge) + revents &= ~oldevents; + if (revents) { + int xevents = 0; + if (revents & POLLIN) + xevents |= X_NOTIFY_READ; + if (revents & POLLOUT) + xevents |= X_NOTIFY_WRITE; + if (revents & (~(POLLIN|POLLOUT))) + xevents |= X_NOTIFY_ERROR; + ospoll->osfds[f].callback(ospoll->fds[f].fd, xevents, + ospoll->osfds[f].data); + + /* Check to see if the arrays have changed, and just go back + * around again + */ + if (ospoll->changed) + break; + } + } + } +#endif + return nready; +} + +void +ospoll_reset_events(struct ospoll *ospoll, int fd) +{ +#if POLL + int pos = ospoll_find(ospoll, fd); + + if (pos < 0) + return; + + ospoll->osfds[pos].revents = 0; +#endif +} + +void * +ospoll_data(struct ospoll *ospoll, int fd) +{ + int pos = ospoll_find(ospoll, fd); + + if (pos < 0) + return NULL; +#if EPOLL + return ospoll->fds[pos]->data; +#endif +#if POLL + return ospoll->osfds[pos].data; +#endif +} diff --git a/xserver/os/ospoll.h b/xserver/os/ospoll.h new file mode 100644 index 000000000..cdc45f4d9 --- /dev/null +++ b/xserver/os/ospoll.h @@ -0,0 +1,142 @@ +/* + * Copyright © 2016 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _OSPOLL_H_ +#define _OSPOLL_H_ + +/* Forward declaration */ +struct ospoll; + +/** + * ospoll_wait trigger mode + * + * @ospoll_trigger_edge + * Trigger only when going from no data available + * to data available. + * + * @ospoll_trigger_level + * Trigger whenever there is data available + */ +enum ospoll_trigger { + ospoll_trigger_edge, + ospoll_trigger_level +}; + +/** + * Create a new ospoll structure + */ +struct ospoll * +ospoll_create(void); + +/** + * Destroy an ospoll structure + * + * @param ospoll ospoll to destroy + */ +void +ospoll_destroy(struct ospoll *ospoll); + +/** + * Add a file descriptor to monitor + * + * @param ospoll ospoll to add to + * @param fd File descriptor to monitor + * @param trigger Trigger mode for ospoll_wait + * @param callback Function to call when triggered + * @param data Extra data to pass callback + */ +Bool +ospoll_add(struct ospoll *ospoll, int fd, + enum ospoll_trigger trigger, + void (*callback)(int fd, int xevents, void *data), + void *data); + +/** + * Remove a monitored file descriptor + * + * @param ospoll ospoll to remove from + * @param fd File descriptor to stop monitoring + */ +void +ospoll_remove(struct ospoll *ospoll, int fd); + +/** + * Listen on additional events + * + * @param ospoll ospoll monitoring fd + * @param fd File descriptor to change + * @param events Additional events to trigger on + */ +void +ospoll_listen(struct ospoll *ospoll, int fd, int xevents); + +/** + * Stop listening on events + * + * @param ospoll ospoll monitoring fd + * @param fd File descriptor to change + * @param events events to stop triggering on + */ +void +ospoll_mute(struct ospoll *ospoll, int fd, int xevents); + +/** + * Wait for events + * + * @param ospoll ospoll to wait on + * @param timeout < 0 wait forever + * = 0 check and return + * > 0 timeout in milliseconds + * @return < 0 error + * = 0 timeout + * > 0 number of events delivered + */ +int +ospoll_wait(struct ospoll *ospoll, int timeout); + +/** + * Reset edge trigger status + * + * @param ospoll ospoll monitoring fd + * @param fd file descriptor + * + * ospoll_reset_events resets the state of an edge-triggered + * fd so that ospoll_wait calls will report events again. + * + * Call this after a read/recv operation reports no more data available. + */ +void +ospoll_reset_events(struct ospoll *ospoll, int fd); + +/** + * Fetch the data associated with an fd + * + * @param ospoll ospoll monitoring fd + * @param fd file descriptor + * + * @return data parameter passed to ospoll_add call on + * this file descriptor + */ +void * +ospoll_data(struct ospoll *ospoll, int fd); + +#endif /* _OSPOLL_H_ */ diff --git a/xserver/os/reallocarray.c b/xserver/os/reallocarray.c index bb044b13a..13e29dd65 100644 --- a/xserver/os/reallocarray.c +++ b/xserver/os/reallocarray.c @@ -1,4 +1,4 @@ -/* $OpenBSD: reallocarray.c,v 1.1 2016/05/29 12:02:40 matthieu Exp $ */ +/* $OpenBSD: reallocarray.c,v 1.2 2017/12/08 15:02:02 matthieu Exp $ */ /* * Copyright (c) 2008 Otto Moerbeek * diff --git a/xserver/os/rpcauth.c b/xserver/os/rpcauth.c index 6a591cce7..33260db72 100644 --- a/xserver/os/rpcauth.c +++ b/xserver/os/rpcauth.c @@ -46,7 +46,7 @@ from The Open Group. #include -#ifdef sun +#ifdef __sun /* only includes this if _KERNEL is #defined... */ extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); #endif diff --git a/xserver/os/timingsafe_memcmp.c b/xserver/os/timingsafe_memcmp.c index 36ab362a7..65679c87a 100644 --- a/xserver/os/timingsafe_memcmp.c +++ b/xserver/os/timingsafe_memcmp.c @@ -16,6 +16,9 @@ #include #include +#include +#include +#include "os.h" int timingsafe_memcmp(const void *b1, const void *b2, size_t len) diff --git a/xserver/os/utils.c b/xserver/os/utils.c index d5a6eccc0..05dbeb781 100644 --- a/xserver/os/utils.c +++ b/xserver/os/utils.c @@ -71,7 +71,6 @@ __stdcall unsigned long GetTickCount(void); #if !defined(WIN32) || !defined(__MINGW32__) #include #include -# define SMART_SCHEDULE_POSSIBLE #endif #include "misc.h" #include @@ -81,7 +80,7 @@ __stdcall unsigned long GetTickCount(void); #include #include "input.h" #include "dixfont.h" -#include +#include #include "osdep.h" #include "extension.h" #ifdef X_POSIX_C_SOURCE @@ -109,7 +108,7 @@ __stdcall unsigned long GetTickCount(void); #include /* for malloc() */ -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) #ifndef WIN32 #include #endif @@ -211,6 +210,10 @@ sig_atomic_t inSignalContext = FALSE; #define HAS_SAVED_IDS_AND_SETEUID #endif +#ifdef MONOTONIC_CLOCK +static clockid_t clockid; +#endif + OsSigHandlerPtr OsSignal(int sig, OsSigHandlerPtr handler) { @@ -315,7 +318,7 @@ LockServer(void) } if (lfd < 0) FatalError("Could not create lock file in %s\n", tmp); - snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid()); + snprintf(pid_str, sizeof(pid_str), "%10lu\n", (unsigned long) getpid()); if (write(lfd, pid_str, 11) != 11) FatalError("Could not write pid to lock file in %s\n", tmp); #ifdef __OpenBSD__ @@ -440,6 +443,24 @@ GiveUp(int sig) errno = olderrno; } +#ifdef MONOTONIC_CLOCK +void +ForceClockId(clockid_t forced_clockid) +{ + struct timespec tp; + + BUG_RETURN (clockid); + + clockid = forced_clockid; + + if (clock_gettime(clockid, &tp) != 0) { + FatalError("Forced clock id failed to retrieve current time: %s\n", + strerror(errno)); + return; + } +} +#endif + #if (defined WIN32 && defined __MINGW32__) || defined(__CYGWIN__) CARD32 GetTimeInMillis(void) @@ -459,7 +480,6 @@ GetTimeInMillis(void) #ifdef MONOTONIC_CLOCK struct timespec tp; - static clockid_t clockid; if (!clockid) { #ifdef CLOCK_MONOTONIC_COARSE @@ -488,7 +508,6 @@ GetTimeInMicros(void) struct timeval tv; #ifdef MONOTONIC_CLOCK struct timespec tp; - static clockid_t clockid; if (!clockid) { if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) @@ -505,27 +524,6 @@ GetTimeInMicros(void) } #endif -void -AdjustWaitForDelay(void *waitTime, unsigned long newdelay) -{ - static struct timeval delay_val; - struct timeval **wt = (struct timeval **) waitTime; - unsigned long olddelay; - - if (*wt == NULL) { - delay_val.tv_sec = newdelay / 1000; - delay_val.tv_usec = 1000 * (newdelay % 1000); - *wt = &delay_val; - } - else { - olddelay = (*wt)->tv_sec * 1000 + (*wt)->tv_usec / 1000; - if (newdelay < olddelay) { - (*wt)->tv_sec = newdelay / 1000; - (*wt)->tv_usec = 1000 * (newdelay % 1000); - } - } -} - void UseMsg(void) { @@ -603,7 +601,7 @@ UseMsg(void) ErrorF("-xinerama Disable XINERAMA extension\n"); #endif ErrorF - ("-dumbSched Disable smart scheduling, enable old behavior\n"); + ("-dumbSched Disable smart scheduling and threaded input, enable old behavior\n"); ErrorF("-schedInterval int Set scheduler interval in msec\n"); ErrorF("-sigstop Enable SIGSTOP based startup\n"); ErrorF("+extension name Enable extension\n"); @@ -795,7 +793,7 @@ ProcessCommandLine(int argc, char *argv[]) DPMSDisabledSwitch = TRUE; #endif else if (strcmp(argv[i], "-deferglyphs") == 0) { - if (++i >= argc || !ParseGlyphCachingMode(argv[i])) + if (++i >= argc || !xfont2_parse_glyph_caching_mode(argv[i])) UseMsg(); } else if (strcmp(argv[i], "-f") == 0) { @@ -885,8 +883,10 @@ ProcessCommandLine(int argc, char *argv[]) if (LimitClients != 64 && LimitClients != 128 && LimitClients != 256 && - LimitClients != 512) { - FatalError("maxclients must be one of 64, 128, 256 or 512\n"); + LimitClients != 512 && + LimitClients != 1024 && + LimitClients != 2048) { + FatalError("maxclients must be one of 64, 128, 256, 512, 1024 or 2048\n"); } } else UseMsg(); @@ -1026,9 +1026,11 @@ ProcessCommandLine(int argc, char *argv[]) i = skip - 1; } #endif -#ifdef SMART_SCHEDULE_POSSIBLE else if (strcmp(argv[i], "-dumbSched") == 0) { - SmartScheduleDisable = TRUE; + InputThreadEnable = FALSE; +#if HAVE_SETITIMER + SmartScheduleSignalEnable = FALSE; +#endif } else if (strcmp(argv[i], "-schedInterval") == 0) { if (++i < argc) { @@ -1045,7 +1047,6 @@ ProcessCommandLine(int argc, char *argv[]) else UseMsg(); } -#endif else if (strcmp(argv[i], "-render") == 0) { if (++i < argc) { int policy = PictureParseCmapPolicy(argv[i]); @@ -1091,7 +1092,7 @@ int set_font_authorizations(char **authorizations, int *authlen, void *client) { #define AUTHORIZATION_NAME "hp-hostname-1" -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) static char *result = NULL; static char *p = NULL; @@ -1229,10 +1230,10 @@ XNFstrdup(const char *s) void SmartScheduleStopTimer(void) { -#ifdef SMART_SCHEDULE_POSSIBLE +#if HAVE_SETITIMER struct itimerval timer; - if (SmartScheduleDisable) + if (!SmartScheduleSignalEnable) return; timer.it_interval.tv_sec = 0; timer.it_interval.tv_usec = 0; @@ -1245,10 +1246,10 @@ SmartScheduleStopTimer(void) void SmartScheduleStartTimer(void) { -#ifdef SMART_SCHEDULE_POSSIBLE +#if HAVE_SETITIMER struct itimerval timer; - if (SmartScheduleDisable) + if (!SmartScheduleSignalEnable) return; timer.it_interval.tv_sec = 0; timer.it_interval.tv_usec = SmartScheduleInterval * 1000; @@ -1258,6 +1259,7 @@ SmartScheduleStartTimer(void) #endif } +#if HAVE_SETITIMER static void SmartScheduleTimer(int sig) { @@ -1268,10 +1270,9 @@ static int SmartScheduleEnable(void) { int ret = 0; -#ifdef SMART_SCHEDULE_POSSIBLE struct sigaction act; - if (SmartScheduleDisable) + if (!SmartScheduleSignalEnable) return 0; memset((char *) &act, 0, sizeof(struct sigaction)); @@ -1282,7 +1283,6 @@ SmartScheduleEnable(void) sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGALRM); ret = sigaction(SIGALRM, &act, 0); -#endif return ret; } @@ -1290,10 +1290,9 @@ static int SmartSchedulePause(void) { int ret = 0; -#ifdef SMART_SCHEDULE_POSSIBLE struct sigaction act; - if (SmartScheduleDisable) + if (!SmartScheduleSignalEnable) return 0; memset((char *) &act, 0, sizeof(struct sigaction)); @@ -1301,20 +1300,19 @@ SmartSchedulePause(void) act.sa_handler = SIG_IGN; sigemptyset(&act.sa_mask); ret = sigaction(SIGALRM, &act, 0); -#endif return ret; } +#endif void SmartScheduleInit(void) { - if (SmartScheduleDisable) - return; - +#if HAVE_SETITIMER if (SmartScheduleEnable() < 0) { perror("sigaction for smart scheduler"); - SmartScheduleDisable = TRUE; + SmartScheduleSignalEnable = FALSE; } +#endif } #ifdef SIG_BLOCK @@ -1329,9 +1327,6 @@ OsBlockSignals(void) if (BlockedSignalCount++ == 0) { sigset_t set; -#ifdef SIGIO - OsBlockSIGIO(); -#endif sigemptyset(&set); sigaddset(&set, SIGALRM); sigaddset(&set, SIGVTALRM); @@ -1342,62 +1337,17 @@ OsBlockSignals(void) sigaddset(&set, SIGTTIN); sigaddset(&set, SIGTTOU); sigaddset(&set, SIGCHLD); - sigprocmask(SIG_BLOCK, &set, &PreviousSignalMask); + xthread_sigmask(SIG_BLOCK, &set, &PreviousSignalMask); } #endif } -#ifdef SIG_BLOCK -static sig_atomic_t sigio_blocked; -static sigset_t PreviousSigIOMask; -#endif - -/** - * returns zero if this call caused SIGIO to be blocked now, non-zero if it - * was already blocked by a previous call to this function. - */ -int -OsBlockSIGIO(void) -{ -#ifdef SIGIO -#ifdef SIG_BLOCK - if (sigio_blocked++ == 0) { - sigset_t set; - int ret; - - sigemptyset(&set); - sigaddset(&set, SIGIO); - sigprocmask(SIG_BLOCK, &set, &PreviousSigIOMask); - ret = sigismember(&PreviousSigIOMask, SIGIO); - return ret; - } -#endif -#endif - return 1; -} - -void -OsReleaseSIGIO(void) -{ -#ifdef SIGIO -#ifdef SIG_BLOCK - if (--sigio_blocked == 0) { - sigprocmask(SIG_SETMASK, &PreviousSigIOMask, 0); - } else if (sigio_blocked < 0) { - BUG_WARN(sigio_blocked < 0); - sigio_blocked = 0; - } -#endif -#endif -} - void OsReleaseSignals(void) { #ifdef SIG_BLOCK if (--BlockedSignalCount == 0) { - sigprocmask(SIG_SETMASK, &PreviousSignalMask, 0); - OsReleaseSIGIO(); + xthread_sigmask(SIG_SETMASK, &PreviousSignalMask, 0); } #endif } @@ -1408,10 +1358,7 @@ OsResetSignals(void) #ifdef SIG_BLOCK while (BlockedSignalCount > 0) OsReleaseSignals(); -#ifdef SIGIO - while (sigio_blocked > 0) - OsReleaseSIGIO(); -#endif + input_force_unlock(); #endif } @@ -1425,6 +1372,12 @@ OsAbort(void) { #ifndef __APPLE__ OsBlockSignals(); +#endif +#if !defined(WIN32) || defined(__CYGWIN__) + /* abort() raises SIGABRT, so we have to stop handling that to prevent + * recursion + */ + OsSignal(SIGABRT, SIG_DFL); #endif abort(); } @@ -1450,7 +1403,7 @@ System(const char *command) if (!command) return 1; - csig = signal(SIGCHLD, SIG_DFL); + csig = OsSignal(SIGCHLD, SIG_DFL); if (csig == SIG_ERR) { perror("signal"); return -1; @@ -1475,7 +1428,7 @@ System(const char *command) } - if (signal(SIGCHLD, csig) == SIG_ERR) { + if (OsSignal(SIGCHLD, csig) == SIG_ERR) { perror("signal"); return -1; } @@ -1511,6 +1464,7 @@ Popen(const char *command, const char *type) } /* Ignore the smart scheduler while this is going on */ +#if HAVE_SETITIMER if (SmartSchedulePause() < 0) { close(pdes[0]); close(pdes[1]); @@ -1518,14 +1472,17 @@ Popen(const char *command, const char *type) perror("signal"); return NULL; } +#endif switch (pid = fork()) { case -1: /* error */ close(pdes[0]); close(pdes[1]); free(cur); +#if HAVE_SETITIMER if (SmartScheduleEnable() < 0) perror("signal"); +#endif return NULL; case 0: /* child */ if (setgid(getgid()) == -1) @@ -1699,10 +1656,12 @@ Pclose(void *iop) /* allow EINTR again */ OsReleaseSignals(); +#if HAVE_SETITIMER if (SmartScheduleEnable() < 0) { perror("signal"); return -1; } +#endif return pid == -1 ? -1 : pstat; } diff --git a/xserver/os/xdmauth.c b/xserver/os/xdmauth.c index 94ae81b14..c35cade5b 100644 --- a/xserver/os/xdmauth.c +++ b/xserver/os/xdmauth.c @@ -277,7 +277,7 @@ XdmAuthorizationValidate(unsigned char *plain, int length, if (_XSERVTransGetPeerAddr(((OsCommPtr) xclient->osPrivate)->trans_conn, &family, &addr_len, &addr) == 0 && _XSERVTransConvertAddress(&family, &addr_len, &addr) == 0) { -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) if (family == FamilyInternet && memcmp((char *) addr, client->client, 4) != 0) { free(client); diff --git a/xserver/os/xdmcp.c b/xserver/os/xdmcp.c index 5bdcbe9c9..906c95944 100644 --- a/xserver/os/xdmcp.c +++ b/xserver/os/xdmcp.c @@ -39,19 +39,12 @@ #include #include #include "misc.h" -#include #include "osdep.h" #include "input.h" #include "dixstruct.h" #include "opaque.h" #include "site.h" -#ifdef STREAMSCONN -#include -#include -#include -#endif - #define XSERV_t #define TRANS_SERVER #define TRANS_REOPEN @@ -82,10 +75,10 @@ static struct sockaddr_in req_sockaddr; #endif static int req_socklen; static CARD32 SessionID; -static CARD32 timeOutTime; static int timeOutRtx; static CARD16 DisplayNumber; static xdmcp_states XDM_INIT_STATE = XDM_OFF; +static OsTimerPtr xdmcp_timer; #ifdef HASXDMAUTH static char *xdmAuthCookie; @@ -197,13 +190,9 @@ static void send_packet(void); static void timeout(void); -static void XdmcpBlockHandler(void *data , - struct timeval **wt, - void *LastSelectMask); +static void XdmcpSocketNotify(int fd, int ready, void *data); -static void XdmcpWakeupHandler(void *data, - int i, - void *LastSelectMask); +static CARD32 XdmcpTimerNotify(OsTimerPtr timer, CARD32 time, void *arg); /* * Register the Manufacturer display ID @@ -579,6 +568,21 @@ XdmcpRegisterDisplayClass(const char *name, int length) DisplayClass.data[i] = (CARD8) name[i]; } +static void +xdmcp_start(void) +{ + timeOutRtx = 0; + get_xdmcp_sock(); + if (xdmcpSocket >= 0) + SetNotifyFd(xdmcpSocket, XdmcpSocketNotify, X_NOTIFY_READ, NULL); +#if defined(IPv6) && defined(AF_INET6) + if (xdmcpSocket6 >= 0) + SetNotifyFd(xdmcpSocket6, XdmcpSocketNotify, X_NOTIFY_READ, NULL); +#endif + xdmcp_timer = TimerSet(NULL, 0, 0, XdmcpTimerNotify, NULL); + send_packet(); +} + /* * initialize XDMCP; create the socket, compute the display * number, set up the state machine @@ -597,12 +601,8 @@ XdmcpInit(void) XdmcpRegisterDisplayClass(defaultDisplayClass, strlen(defaultDisplayClass)); AccessUsingXdmcp(); - RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler, - (void *) 0); - timeOutRtx = 0; DisplayNumber = (CARD16) atoi(display); - get_xdmcp_sock(); - send_packet(); + xdmcp_start(); } } @@ -610,12 +610,8 @@ void XdmcpReset(void) { state = XDM_INIT_STATE; - if (state != XDM_OFF) { - RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler, - (void *) 0); - timeOutRtx = 0; - send_packet(); - } + if (state != XDM_OFF) + xdmcp_start(); } /* @@ -630,7 +626,7 @@ XdmcpOpenDisplay(int sock) if (state != XDM_AWAIT_MANAGE_RESPONSE) return; state = XDM_RUN_SESSION; - timeOutTime = GetTimeInMillis() + XDM_DEF_DORMANCY * 1000; + TimerSet(xdmcp_timer, 0, XDM_DEF_DORMANCY * 1000, XdmcpTimerNotify, NULL); sessionSocket = sock; } @@ -648,69 +644,24 @@ XdmcpCloseDisplay(int sock) isItTimeToYield = TRUE; } -/* - * called before going to sleep, this routine - * may modify the timeout value about to be sent - * to select; in this way XDMCP can do appropriate things - * dynamically while starting up - */ - - /*ARGSUSED*/ static void -XdmcpBlockHandler(void *data, /* unused */ - struct timeval **wt, void *pReadmask) +static void +XdmcpSocketNotify(int fd, int ready, void *data) { - fd_set *last_select_mask = (fd_set *) pReadmask; - CARD32 millisToGo; - if (state == XDM_OFF) return; - FD_SET(xdmcpSocket, last_select_mask); -#if defined(IPv6) && defined(AF_INET6) - if (xdmcpSocket6 >= 0) - FD_SET(xdmcpSocket6, last_select_mask); -#endif - if (timeOutTime == 0) - return; - millisToGo = timeOutTime - GetTimeInMillis(); - if ((int) millisToGo < 0) - millisToGo = 0; - AdjustWaitForDelay(wt, millisToGo); + receive_packet(fd); } -/* - * called after select returns; this routine will - * recognise when XDMCP packets await and - * process them appropriately - */ - - /*ARGSUSED*/ static void -XdmcpWakeupHandler(void *data, /* unused */ - int i, void *pReadmask) +static CARD32 +XdmcpTimerNotify(OsTimerPtr timer, CARD32 time, void *arg) { - fd_set *last_select_mask = (fd_set *) pReadmask; - - if (state == XDM_OFF) - return; - if (i > 0) { - if (FD_ISSET(xdmcpSocket, last_select_mask)) { - receive_packet(xdmcpSocket); - FD_CLR(xdmcpSocket, last_select_mask); - } -#if defined(IPv6) && defined(AF_INET6) - if (xdmcpSocket6 >= 0 && FD_ISSET(xdmcpSocket6, last_select_mask)) { - receive_packet(xdmcpSocket6); - FD_CLR(xdmcpSocket6, last_select_mask); - } -#endif - } - else if (timeOutTime && (int) (GetTimeInMillis() - timeOutTime) >= 0) { - if (state == XDM_RUN_SESSION) { - state = XDM_KEEPALIVE; - send_packet(); - } - else - timeout(); + if (state == XDM_RUN_SESSION) { + state = XDM_KEEPALIVE; + send_packet(); } + else + timeout(); + return 0; } /* @@ -832,7 +783,7 @@ send_packet(void) rtx = (XDM_MIN_RTX << timeOutRtx); if (rtx > XDM_MAX_RTX) rtx = XDM_MAX_RTX; - timeOutTime = GetTimeInMillis() + rtx * 1000; + TimerSet(xdmcp_timer, 0, rtx * 1000, XdmcpTimerNotify, NULL); } /* @@ -847,7 +798,7 @@ XdmcpDeadSession(const char *reason) state = XDM_INIT_STATE; isItTimeToYield = TRUE; dispatchException |= DE_RESET; - timeOutTime = 0; + TimerCancel(xdmcp_timer); timeOutRtx = 0; send_packet(); } @@ -954,43 +905,6 @@ XdmcpAddAuthorization(ARRAY8Ptr name, ARRAY8Ptr data) static void get_xdmcp_sock(void) { -#ifdef STREAMSCONN - struct netconfig *nconf; - - if ((xdmcpSocket = t_open("/dev/udp", O_RDWR, 0)) < 0) { - XdmcpWarning("t_open() of /dev/udp failed"); - return; - } - - if (t_bind(xdmcpSocket, NULL, NULL) < 0) { - XdmcpWarning("UDP socket creation failed"); - t_error("t_bind(xdmcpSocket) failed"); - t_close(xdmcpSocket); - return; - } - - /* - * This part of the code looks contrived. It will actually fit in nicely - * when the CLTS part of Xtrans is implemented. - */ - - if ((nconf = getnetconfigent("udp")) == NULL) { - XdmcpWarning("UDP socket creation failed: getnetconfigent()"); - t_unbind(xdmcpSocket); - t_close(xdmcpSocket); - return; - } - - if (netdir_options(nconf, ND_SET_BROADCAST, xdmcpSocket, NULL)) { - XdmcpWarning("UDP set broadcast option failed: netdir_options()"); - freenetconfigent(nconf); - t_unbind(xdmcpSocket); - t_close(xdmcpSocket); - return; - } - - freenetconfigent(nconf); -#else int soopts = 1; #if defined(IPv6) && defined(AF_INET6) @@ -1011,7 +925,6 @@ get_xdmcp_sock(void) xdm_from); } } -#endif /* STREAMSCONN */ } static void @@ -1391,7 +1304,7 @@ recv_alive_msg(unsigned length) XdmcpReadCARD32(&buffer, &AliveSessionID)) { if (SessionRunning && AliveSessionID == SessionID) { state = XDM_RUN_SESSION; - timeOutTime = GetTimeInMillis() + XDM_DEF_DORMANCY * 1000; + TimerSet(xdmcp_timer, 0, XDM_DEF_DORMANCY * 1000, XdmcpTimerNotify, NULL); } else { XdmcpDeadSession("Alive response indicates session dead"); diff --git a/xserver/os/xserver_poll.c b/xserver/os/xserver_poll.c new file mode 100644 index 000000000..d266b89e0 --- /dev/null +++ b/xserver/os/xserver_poll.c @@ -0,0 +1,277 @@ +/*---------------------------------------------------------------------------*\ + $Id: xserver_poll.c,v 1.1 2017/12/08 15:02:02 matthieu Exp $ + + NAME + + poll - select(2)-based poll() emulation function for BSD systems. + + SYNOPSIS + #include "poll.h" + + struct pollfd + { + int fd; + short events; + short revents; + } + + int poll (struct pollfd *pArray, unsigned long n_fds, int timeout) + + DESCRIPTION + + This file, and the accompanying "poll.h", implement the System V + poll(2) system call for BSD systems (which typically do not provide + poll()). Poll() provides a method for multiplexing input and output + on multiple open file descriptors; in traditional BSD systems, that + capability is provided by select(). While the semantics of select() + differ from those of poll(), poll() can be readily emulated in terms + of select() -- which is how this function is implemented. + + REFERENCES + Stevens, W. Richard. Unix Network Programming. Prentice-Hall, 1990. + + NOTES + 1. This software requires an ANSI C compiler. + + LICENSE + + This software is released under the following BSD license, adapted from + http://opensource.org/licenses/bsd-license.php + + Copyright (c) 1995-2011, Brian M. Clapper + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the clapper.org nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\*---------------------------------------------------------------------------*/ + + +/*---------------------------------------------------------------------------*\ + Includes +\*---------------------------------------------------------------------------*/ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include /* standard Unix definitions */ +#include /* system types */ +#include /* time definitions */ +#include /* assertion macros */ +#include /* string functions */ +#include "xserver_poll.h" + +/*---------------------------------------------------------------------------*\ + Macros +\*---------------------------------------------------------------------------*/ + +#ifndef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#endif + +/*---------------------------------------------------------------------------*\ + Private Functions +\*---------------------------------------------------------------------------*/ + +static int map_poll_spec + (struct pollfd *pArray, + nfds_t n_fds, + fd_set *pReadSet, + fd_set *pWriteSet, + fd_set *pExceptSet) +{ + register nfds_t i; /* loop control */ + register struct pollfd *pCur; /* current array element */ + register int max_fd = -1; /* return value */ + + /* + Map the poll() structures into the file descriptor sets required + by select(). + */ + for (i = 0, pCur = pArray; i < n_fds; i++, pCur++) + { + /* Skip any bad FDs in the array. */ + + if (pCur->fd < 0) + continue; + + if (pCur->events & POLLIN) + { + /* "Input Ready" notification desired. */ + FD_SET (pCur->fd, pReadSet); + } + + if (pCur->events & POLLOUT) + { + /* "Output Possible" notification desired. */ + FD_SET (pCur->fd, pWriteSet); + } + + if (pCur->events & POLLPRI) + { + /* + "Exception Occurred" notification desired. (Exceptions + include out of band data. + */ + FD_SET (pCur->fd, pExceptSet); + } + + max_fd = MAX (max_fd, pCur->fd); + } + + return max_fd; +} + +static struct timeval *map_timeout + (int poll_timeout, struct timeval *pSelTimeout) +{ + struct timeval *pResult; + + /* + Map the poll() timeout value into a select() timeout. The possible + values of the poll() timeout value, and their meanings, are: + + VALUE MEANING + + -1 wait indefinitely (until signal occurs) + 0 return immediately, don't block + >0 wait specified number of milliseconds + + select() uses a "struct timeval", which specifies the timeout in + seconds and microseconds, so the milliseconds value has to be mapped + accordingly. + */ + + assert (pSelTimeout != (struct timeval *) NULL); + + switch (poll_timeout) + { + case -1: + /* + A NULL timeout structure tells select() to wait indefinitely. + */ + pResult = (struct timeval *) NULL; + break; + + case 0: + /* + "Return immediately" (test) is specified by all zeros in + a timeval structure. + */ + pSelTimeout->tv_sec = 0; + pSelTimeout->tv_usec = 0; + pResult = pSelTimeout; + break; + + default: + /* Wait the specified number of milliseconds. */ + pSelTimeout->tv_sec = poll_timeout / 1000; /* get seconds */ + poll_timeout %= 1000; /* remove seconds */ + pSelTimeout->tv_usec = poll_timeout * 1000; /* get microseconds */ + pResult = pSelTimeout; + break; + } + + + return pResult; +} + +static void map_select_results + (struct pollfd *pArray, + unsigned long n_fds, + fd_set *pReadSet, + fd_set *pWriteSet, + fd_set *pExceptSet) +{ + register unsigned long i; /* loop control */ + register struct pollfd *pCur; /* current array element */ + + for (i = 0, pCur = pArray; i < n_fds; i++, pCur++) + { + /* Skip any bad FDs in the array. */ + + if (pCur->fd < 0) + continue; + + /* Exception events take priority over input events. */ + + pCur->revents = 0; + if (FD_ISSET (pCur->fd, pExceptSet)) + pCur->revents |= POLLPRI; + + else if (FD_ISSET (pCur->fd, pReadSet)) + pCur->revents |= POLLIN; + + if (FD_ISSET (pCur->fd, pWriteSet)) + pCur->revents |= POLLOUT; + } + + return; +} + +/*---------------------------------------------------------------------------*\ + Public Functions +\*---------------------------------------------------------------------------*/ + +int xserver_poll + (struct pollfd *pArray, unsigned long n_fds, int timeout) +{ + fd_set read_descs; /* input file descs */ + fd_set write_descs; /* output file descs */ + fd_set except_descs; /* exception descs */ + struct timeval stime; /* select() timeout value */ + int ready_descriptors; /* function result */ + int max_fd; /* maximum fd value */ + struct timeval *pTimeout; /* actually passed */ + + FD_ZERO (&read_descs); + FD_ZERO (&write_descs); + FD_ZERO (&except_descs); + + assert (pArray != (struct pollfd *) NULL); + + /* Map the poll() file descriptor list in the select() data structures. */ + + max_fd = map_poll_spec (pArray, n_fds, + &read_descs, &write_descs, &except_descs); + + /* Map the poll() timeout value in the select() timeout structure. */ + + pTimeout = map_timeout (timeout, &stime); + + /* Make the select() call. */ + + ready_descriptors = select (max_fd + 1, &read_descs, &write_descs, + &except_descs, pTimeout); + + if (ready_descriptors >= 0) + { + map_select_results (pArray, n_fds, + &read_descs, &write_descs, &except_descs); + } + + return ready_descriptors; +} diff --git a/xserver/present/Makefile.in b/xserver/present/Makefile.in index 75ad1aad2..bd1838010 100644 --- a/xserver/present/Makefile.in +++ b/xserver/present/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -330,6 +331,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -360,7 +364,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -455,6 +462,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/present/present.c b/xserver/present/present.c index cebd2f786..7d428fca7 100644 --- a/xserver/present/present.c +++ b/xserver/present/present.c @@ -117,6 +117,18 @@ present_flip_pending_pixmap(ScreenPtr screen) return screen_priv->flip_pending->pixmap; } +static Bool +present_check_output_slaves_active(ScreenPtr pScreen) +{ + ScreenPtr pSlave; + + xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { + if (RRHasScanoutPixmap(pSlave)) + return TRUE; + } + return FALSE; +} + static Bool present_check_flip(RRCrtcPtr crtc, WindowPtr window, @@ -145,7 +157,7 @@ present_check_flip(RRCrtcPtr crtc, return FALSE; /* Fail to flip if we have slave outputs */ - if (!xorg_list_is_empty(&screen->output_slave_list)) + if (screen->output_slaves && present_check_output_slaves_active(screen)) return FALSE; /* Make sure the window hasn't been redirected with Composite */ @@ -417,7 +429,7 @@ present_set_tree_pixmap(WindowPtr window, TraverseTree(window, present_set_tree_pixmap_visit, &visit); } -static void +void present_restore_screen_pixmap(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); @@ -439,7 +451,7 @@ present_restore_screen_pixmap(ScreenPtr screen) * Only do this the first time for a particular unflip operation, or * we'll probably scribble over other windows */ - if (screen->GetWindowPixmap(screen->root) == flip_pixmap) + if (screen->root && screen->GetWindowPixmap(screen->root) == flip_pixmap) present_copy_region(&screen_pixmap->drawable, flip_pixmap, NULL, 0, 0); /* Switch back to using the screen pixmap now to avoid @@ -447,17 +459,19 @@ present_restore_screen_pixmap(ScreenPtr screen) */ if (flip_window) present_set_tree_pixmap(flip_window, flip_pixmap, screen_pixmap); - present_set_tree_pixmap(screen->root, NULL, screen_pixmap); + if (screen->root) + present_set_tree_pixmap(screen->root, NULL, screen_pixmap); } -static void +void present_set_abort_flip(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); - present_restore_screen_pixmap(screen); - - screen_priv->flip_pending->abort_flip = TRUE; + if (!screen_priv->flip_pending->abort_flip) { + present_restore_screen_pixmap(screen); + screen_priv->flip_pending->abort_flip = TRUE; + } } static void @@ -529,12 +543,13 @@ present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc) present_execute(vblank, ust, msc); return; } - if (match < 0) - break; } xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) { if (vblank->event_id == event_id) { - present_flip_notify(vblank, ust, msc); + if (vblank->queued) + present_execute(vblank, ust, msc); + else + present_flip_notify(vblank, ust, msc); return; } } @@ -990,8 +1005,6 @@ present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64 vblank->queued = FALSE; return; } - if (match < 0) - break; } xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) { if (vblank->event_id == event_id) { diff --git a/xserver/present/present_event.c b/xserver/present/present_event.c index c586c9a60..c222dd5ff 100644 --- a/xserver/present/present_event.c +++ b/xserver/present/present_event.c @@ -208,14 +208,37 @@ present_send_idle_notify(WindowPtr window, CARD32 serial, PixmapPtr pixmap, stru int present_select_input(ClientPtr client, XID eid, WindowPtr window, CARD32 mask) { - present_window_priv_ptr window_priv = present_get_window_priv(window, mask != 0); + present_window_priv_ptr window_priv; present_event_ptr event; + int ret; + + /* Check to see if we're modifying an existing event selection */ + ret = dixLookupResourceByType((void **) &event, eid, present_event_type, + client, DixWriteAccess); + if (ret == Success) { + /* Match error for the wrong window; also don't modify some other + * client's event selection + */ + if (event->window != window || event->client != client) + return BadMatch; - if (!window_priv) { if (mask) - return BadAlloc; + event->mask = mask; + else + FreeResource(eid, RT_NONE); return Success; } + if (ret != BadValue) + return ret; + + if (mask == 0) + return Success; + + LEGAL_NEW_RESOURCE(eid, client); + + window_priv = present_get_window_priv(window, TRUE); + if (!window_priv) + return BadAlloc; event = calloc (1, sizeof (present_event_rec)); if (!event) diff --git a/xserver/present/present_fake.c b/xserver/present/present_fake.c index 4985c81e3..2350638ea 100644 --- a/xserver/present/present_fake.c +++ b/xserver/present/present_fake.c @@ -64,6 +64,7 @@ present_fake_do_timer(OsTimerPtr timer, present_fake_notify(fake_vblank->screen, fake_vblank->event_id); xorg_list_del(&fake_vblank->list); + TimerFree(fake_vblank->timer); free(fake_vblank); return 0; } @@ -75,7 +76,7 @@ present_fake_abort_vblank(ScreenPtr screen, uint64_t event_id, uint64_t msc) xorg_list_for_each_entry_safe(fake_vblank, tmp, &fake_vblank_queue, list) { if (fake_vblank->event_id == event_id) { - TimerCancel(fake_vblank->timer); + TimerFree(fake_vblank->timer); /* TimerFree will call TimerCancel() */ xorg_list_del(&fake_vblank->list); free (fake_vblank); break; diff --git a/xserver/present/present_priv.h b/xserver/present/present_priv.h index 0d16cfaba..dfb4bdea9 100644 --- a/xserver/present/present_priv.h +++ b/xserver/present/present_priv.h @@ -186,6 +186,12 @@ present_vblank_destroy(present_vblank_ptr vblank); void present_flip_destroy(ScreenPtr screen); +void +present_restore_screen_pixmap(ScreenPtr screen); + +void +present_set_abort_flip(ScreenPtr screen); + void present_check_flip_window(WindowPtr window); diff --git a/xserver/present/present_request.c b/xserver/present/present_request.c index 35320b64e..c7663fcc8 100644 --- a/xserver/present/present_request.c +++ b/xserver/present/present_request.c @@ -184,8 +184,6 @@ proc_present_select_input (ClientPtr client) REQUEST_SIZE_MATCH(xPresentSelectInputReq); - LEGAL_NEW_RESOURCE(stuff->eid, client); - rc = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; diff --git a/xserver/present/present_screen.c b/xserver/present/present_screen.c index 2f91ac7dc..9d03c8aa4 100644 --- a/xserver/present/present_screen.c +++ b/xserver/present/present_screen.c @@ -92,11 +92,13 @@ present_clear_window_flip(WindowPtr window) present_vblank_ptr flip_pending = screen_priv->flip_pending; if (flip_pending && flip_pending->window == window) { - assert (flip_pending->abort_flip); + present_set_abort_flip(screen); flip_pending->window = NULL; } - if (screen_priv->flip_window == window) + if (screen_priv->flip_window == window) { + present_restore_screen_pixmap(screen); screen_priv->flip_window = NULL; + } } /* diff --git a/xserver/pseudoramiX/Makefile.in b/xserver/pseudoramiX/Makefile.in index 1dec5e2da..3f17d6364 100644 --- a/xserver/pseudoramiX/Makefile.in +++ b/xserver/pseudoramiX/Makefile.in @@ -57,9 +57,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -300,6 +301,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -330,7 +334,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -425,6 +432,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/randr/Makefile.in b/xserver/randr/Makefile.in index 87e6d12ef..222ad36c1 100644 --- a/xserver/randr/Makefile.in +++ b/xserver/randr/Makefile.in @@ -57,9 +57,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -340,6 +341,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -370,7 +374,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -465,6 +472,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/randr/randr.c b/xserver/randr/randr.c index ad1dda227..0138dc100 100644 --- a/xserver/randr/randr.c +++ b/xserver/randr/randr.c @@ -483,7 +483,10 @@ TellChanged(WindowPtr pWin, void *value) RRDeliverCrtcEvent(client, pWin, crtc); } - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { + if (!iter->is_output_slave) + continue; + pSlaveScrPriv = rrGetScrPriv(iter); for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) { RRCrtcPtr crtc = pSlaveScrPriv->crtcs[i]; @@ -502,7 +505,10 @@ TellChanged(WindowPtr pWin, void *value) RRDeliverOutputEvent(client, pWin, output); } - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { + if (!iter->is_output_slave) + continue; + pSlaveScrPriv = rrGetScrPriv(iter); for (i = 0; i < pSlaveScrPriv->numOutputs; i++) { RROutputPtr output = pSlaveScrPriv->outputs[i]; @@ -514,17 +520,7 @@ TellChanged(WindowPtr pWin, void *value) } if (pRREvent->mask & RRProviderChangeNotifyMask) { - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - if (pSlaveScrPriv->provider->changed) - RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider); - } - xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - if (pSlaveScrPriv->provider->changed) - RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider); - } - xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { pSlaveScrPriv = rrGetScrPriv(iter); if (pSlaveScrPriv->provider->changed) RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider); @@ -584,6 +580,18 @@ RRTellChanged(ScreenPtr pScreen) mastersp = pScrPriv; } + xorg_list_for_each_entry(iter, &master->slave_list, slave_head) { + pSlaveScrPriv = rrGetScrPriv(iter); + + if (!iter->is_output_slave) + continue; + + if (CompareTimeStamps(mastersp->lastSetTime, + pSlaveScrPriv->lastSetTime) == EARLIER) { + mastersp->lastSetTime = pSlaveScrPriv->lastSetTime; + } + } + if (mastersp->changed) { UpdateCurrentTimeIf(); if (mastersp->configChanged) { @@ -602,21 +610,15 @@ RRTellChanged(ScreenPtr pScreen) for (i = 0; i < pScrPriv->numCrtcs; i++) pScrPriv->crtcs[i]->changed = FALSE; - xorg_list_for_each_entry(iter, &master->output_slave_list, output_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - pSlaveScrPriv->provider->changed = FALSE; - for (i = 0; i < pSlaveScrPriv->numOutputs; i++) - pSlaveScrPriv->outputs[i]->changed = FALSE; - for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) - pSlaveScrPriv->crtcs[i]->changed = FALSE; - } - xorg_list_for_each_entry(iter, &master->offload_slave_list, offload_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - pSlaveScrPriv->provider->changed = FALSE; - } - xorg_list_for_each_entry(iter, &master->unattached_list, unattached_head) { + xorg_list_for_each_entry(iter, &master->slave_list, slave_head) { pSlaveScrPriv = rrGetScrPriv(iter); pSlaveScrPriv->provider->changed = FALSE; + if (iter->is_output_slave) { + for (i = 0; i < pSlaveScrPriv->numOutputs; i++) + pSlaveScrPriv->outputs[i]->changed = FALSE; + for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) + pSlaveScrPriv->crtcs[i]->changed = FALSE; + } } if (mastersp->layoutChanged) { @@ -676,6 +678,7 @@ ProcRRDispatch(ClientPtr client) REQUEST(xReq); if (stuff->data >= RRNumberRequests || !ProcRandrVector[stuff->data]) return BadRequest; + UpdateCurrentTimeIf(); return (*ProcRandrVector[stuff->data]) (client); } @@ -685,5 +688,6 @@ SProcRRDispatch(ClientPtr client) REQUEST(xReq); if (stuff->data >= RRNumberRequests || !SProcRandrVector[stuff->data]) return BadRequest; + UpdateCurrentTimeIf(); return (*SProcRandrVector[stuff->data]) (client); } diff --git a/xserver/randr/randrstr.h b/xserver/randr/randrstr.h index 472721a5a..706e9a7b0 100644 --- a/xserver/randr/randrstr.h +++ b/xserver/randr/randrstr.h @@ -130,6 +130,7 @@ struct _rrCrtc { struct pict_f_transform f_inverse; PixmapPtr scanout_pixmap; + PixmapPtr scanout_pixmap_back; }; struct _rrOutput { @@ -278,6 +279,19 @@ typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen, typedef Bool (*RRCrtcSetScanoutPixmapProcPtr)(RRCrtcPtr crtc, PixmapPtr pixmap); +typedef Bool (*RRStartFlippingPixmapTrackingProcPtr)(RRCrtcPtr, PixmapPtr, + PixmapPtr, PixmapPtr, + int x, int y, + int dst_x, int dst_y, + Rotation rotation); + +typedef Bool (*RREnableSharedPixmapFlippingProcPtr)(RRCrtcPtr, + PixmapPtr front, + PixmapPtr back); + +typedef void (*RRDisableSharedPixmapFlippingProcPtr)(RRCrtcPtr); + + typedef struct _rrScrPriv { /* * 'public' part of the structure; DDXen fill this in @@ -304,6 +318,10 @@ typedef struct _rrScrPriv { /* TODO #if RANDR_15_INTERFACE */ RRCrtcSetScanoutPixmapProcPtr rrCrtcSetScanoutPixmap; + RRStartFlippingPixmapTrackingProcPtr rrStartFlippingPixmapTracking; + RREnableSharedPixmapFlippingProcPtr rrEnableSharedPixmapFlipping; + RRDisableSharedPixmapFlippingProcPtr rrDisableSharedPixmapFlipping; + RRProviderSetOutputSourceProcPtr rrProviderSetOutputSource; RRProviderSetOffloadSinkProcPtr rrProviderSetOffloadSink; RRProviderGetPropertyProcPtr rrProviderGetProperty; @@ -707,6 +725,12 @@ extern _X_EXPORT void extern _X_EXPORT Bool RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable); +/* + * Return if the screen has any scanout_pixmap's attached + */ +extern _X_EXPORT Bool + RRHasScanoutPixmap(ScreenPtr pScreen); + /* * Crtc dispatch */ @@ -917,6 +941,7 @@ extern _X_EXPORT int ProcRRDeleteOutputProperty(ClientPtr client); /* rrprovider.c */ +#define PRIME_SYNC_PROP "PRIME Synchronization" extern _X_EXPORT void RRProviderInitErrorValue(void); diff --git a/xserver/randr/rrcrtc.c b/xserver/randr/rrcrtc.c index 9bc456bdc..401a1c178 100644 --- a/xserver/randr/rrcrtc.c +++ b/xserver/randr/rrcrtc.c @@ -25,6 +25,8 @@ #include "swaprep.h" #include "mipointer.h" +#include + RESTYPE RRCrtcType; /* @@ -279,7 +281,7 @@ crtc_bounds(RRCrtcPtr crtc, int *left, int *right, int *top, int *bottom) *left = crtc->x; *top = crtc->y; - switch (crtc->rotation) { + switch (crtc->rotation & 0xf) { case RR_Rotate_0: case RR_Rotate_180: default: @@ -361,52 +363,160 @@ RRComputeContiguity(ScreenPtr pScreen) pScrPriv->discontiguous = discontiguous; } -void -RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc) -{ +static void +rrDestroySharedPixmap(RRCrtcPtr crtc, PixmapPtr pPixmap) { ScreenPtr master = crtc->pScreen->current_master; - PixmapPtr mscreenpix; - rrScrPriv(crtc->pScreen); - mscreenpix = master->GetScreenPixmap(master); - - pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL); - if (crtc->scanout_pixmap) { - master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap); + if (master && pPixmap->master_pixmap) { /* * Unref the pixmap twice: once for the original reference, and once * for the reference implicitly added by PixmapShareToSlave. */ - master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap); - master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap); - crtc->pScreen->DestroyPixmap(crtc->scanout_pixmap); + PixmapUnshareSlavePixmap(pPixmap); + + master->DestroyPixmap(pPixmap->master_pixmap); + master->DestroyPixmap(pPixmap->master_pixmap); } - crtc->scanout_pixmap = NULL; + + crtc->pScreen->DestroyPixmap(pPixmap); +} + +void +RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc) +{ + rrScrPriv(crtc->pScreen); + + if (crtc->scanout_pixmap) { + ScreenPtr master = crtc->pScreen->current_master; + PixmapPtr mscreenpix = master->GetScreenPixmap(master); + + if (crtc->scanout_pixmap_back) { + pScrPriv->rrDisableSharedPixmapFlipping(crtc); + + master->StopFlippingPixmapTracking(mscreenpix, + crtc->scanout_pixmap, + crtc->scanout_pixmap_back); + + rrDestroySharedPixmap(crtc, crtc->scanout_pixmap_back); + crtc->scanout_pixmap_back = NULL; + } + else { + pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL); + master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap); + } + + rrDestroySharedPixmap(crtc, crtc->scanout_pixmap); + crtc->scanout_pixmap = NULL; + } + RRCrtcChanged(crtc, TRUE); } -static Bool -rrCreateSharedPixmap(RRCrtcPtr crtc, int width, int height, +static PixmapPtr +rrCreateSharedPixmap(RRCrtcPtr crtc, ScreenPtr master, + int width, int height, int depth, int x, int y, Rotation rotation) { PixmapPtr mpix, spix; + + mpix = master->CreatePixmap(master, width, height, depth, + CREATE_PIXMAP_USAGE_SHARED); + if (!mpix) + return NULL; + + spix = PixmapShareToSlave(mpix, crtc->pScreen); + if (spix == NULL) { + master->DestroyPixmap(mpix); + return NULL; + } + + return spix; +} + +static Bool +rrGetPixmapSharingSyncProp(int numOutputs, RROutputPtr * outputs) +{ + /* Determine if the user wants prime syncing */ + int o; + const char *syncStr = PRIME_SYNC_PROP; + Atom syncProp = MakeAtom(syncStr, strlen(syncStr), FALSE); + if (syncProp == None) + return TRUE; + + /* If one output doesn't want sync, no sync */ + for (o = 0; o < numOutputs; o++) { + RRPropertyValuePtr val; + + /* Try pending value first, then current value */ + if ((val = RRGetOutputProperty(outputs[o], syncProp, TRUE)) && + val->data) { + if (!(*(char *) val->data)) + return FALSE; + continue; + } + + if ((val = RRGetOutputProperty(outputs[o], syncProp, FALSE)) && + val->data) { + if (!(*(char *) val->data)) + return FALSE; + continue; + } + } + + return TRUE; +} + +static void +rrSetPixmapSharingSyncProp(char val, int numOutputs, RROutputPtr * outputs) +{ + int o; + const char *syncStr = PRIME_SYNC_PROP; + Atom syncProp = MakeAtom(syncStr, strlen(syncStr), FALSE); + if (syncProp == None) + return; + + for (o = 0; o < numOutputs; o++) { + RRPropertyPtr prop = RRQueryOutputProperty(outputs[o], syncProp); + if (prop) + RRChangeOutputProperty(outputs[o], syncProp, XA_INTEGER, + 8, PropModeReplace, 1, &val, FALSE, TRUE); + } +} + +static Bool +rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height, + int x, int y, Rotation rotation, Bool sync, + int numOutputs, RROutputPtr * outputs) +{ ScreenPtr master = crtc->pScreen->current_master; - Bool ret; + rrScrPrivPtr pMasterScrPriv = rrGetScrPriv(master); + rrScrPrivPtr pSlaveScrPriv = rrGetScrPriv(crtc->pScreen); + int depth; PixmapPtr mscreenpix; - PixmapPtr protopix = master->GetScreenPixmap(master); - rrScrPriv(crtc->pScreen); + PixmapPtr spix_front; - /* create a pixmap on the master screen, - then get a shared handle for it - create a shared pixmap on the slave screen using the handle - set the master screen to do dirty updates to the shared pixmap - from the screen pixmap. - set slave screen to scanout shared linear pixmap + /* Create a pixmap on the master screen, then get a shared handle for it. + Create a shared pixmap on the slave screen using the handle. + + If sync == FALSE -- + Set slave screen to scanout shared linear pixmap. + Set the master screen to do dirty updates to the shared pixmap + from the screen pixmap on its own accord. + + If sync == TRUE -- + If any of the below steps fail, clean up and fall back to sync == FALSE. + Create another shared pixmap on the slave screen using the handle. + Set slave screen to prepare for scanout and flipping between shared + linear pixmaps. + Set the master screen to do dirty updates to the shared pixmaps from the + screen pixmap when prompted to by us or the slave. + Prompt the master to do a dirty update on the first shared pixmap, then + defer to the slave. */ mscreenpix = master->GetScreenPixmap(master); - depth = protopix->drawable.depth; + depth = mscreenpix->drawable.depth; if (crtc->scanout_pixmap) RRCrtcDetachScanoutPixmap(crtc); @@ -415,26 +525,71 @@ rrCreateSharedPixmap(RRCrtcPtr crtc, int width, int height, return TRUE; } - mpix = master->CreatePixmap(master, width, height, depth, - CREATE_PIXMAP_USAGE_SHARED); - if (!mpix) - return FALSE; - - spix = PixmapShareToSlave(mpix, crtc->pScreen); - if (spix == NULL) { - master->DestroyPixmap(mpix); + spix_front = rrCreateSharedPixmap(crtc, master, + width, height, depth, + x, y, rotation); + if (spix_front == NULL) { return FALSE; } - ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, spix); - if (ret == FALSE) { + /* Both source and sink must support required ABI funcs for flipping */ + if (sync && + pSlaveScrPriv->rrEnableSharedPixmapFlipping && + pSlaveScrPriv->rrDisableSharedPixmapFlipping && + pMasterScrPriv->rrStartFlippingPixmapTracking && + master->PresentSharedPixmap && + master->StopFlippingPixmapTracking) { + + PixmapPtr spix_back = rrCreateSharedPixmap(crtc, master, + width, height, depth, + x, y, rotation); + if (spix_back == NULL) + goto fail; + + if (!pSlaveScrPriv->rrEnableSharedPixmapFlipping(crtc, + spix_front, spix_back)) + goto fail; + + crtc->scanout_pixmap = spix_front; + crtc->scanout_pixmap_back = spix_back; + + if (!pMasterScrPriv->rrStartFlippingPixmapTracking(crtc, mscreenpix, + spix_front, + spix_back, + x, y, 0, 0, + rotation)) { + pSlaveScrPriv->rrDisableSharedPixmapFlipping(crtc); + goto fail; + } + + master->PresentSharedPixmap(spix_front); + + return TRUE; + +fail: /* If flipping funcs fail, just fall back to unsynchronized */ + if (spix_back) + rrDestroySharedPixmap(crtc, spix_back); + + crtc->scanout_pixmap = NULL; + crtc->scanout_pixmap_back = NULL; + } + + if (sync) { /* Wanted sync, didn't get it */ + ErrorF("randr: falling back to unsynchronized pixmap sharing\n"); + + /* Set output property to 0 to indicate to user */ + rrSetPixmapSharingSyncProp(0, numOutputs, outputs); + } + + if (!pSlaveScrPriv->rrCrtcSetScanoutPixmap(crtc, spix_front)) { + rrDestroySharedPixmap(crtc, spix_front); ErrorF("randr: failed to set shadow slave pixmap\n"); return FALSE; } + crtc->scanout_pixmap = spix_front; - crtc->scanout_pixmap = spix; + master->StartPixmapTracking(mscreenpix, spix_front, x, y, 0, 0, rotation); - master->StartPixmapTracking(mscreenpix, spix, x, y, 0, 0, rotation); return TRUE; } @@ -499,8 +654,12 @@ rrCheckPixmapBounding(ScreenPtr pScreen, RegionUnion(&total_region, &total_region, &new_crtc_region); } - xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { rrScrPrivPtr slave_priv = rrGetScrPriv(slave); + + if (!slave->is_output_slave) + continue; + for (c = 0; c < slave_priv->numCrtcs; c++) { RRCrtcPtr slave_crtc = slave_priv->crtcs[c]; @@ -527,8 +686,14 @@ rrCheckPixmapBounding(ScreenPtr pScreen, } newsize = RegionExtents(&total_region); - new_width = newsize->x2 - newsize->x1; - new_height = newsize->y2 - newsize->y1; + new_width = newsize->x2; + new_height = newsize->y2; + + if (new_width < screen_pixmap->drawable.width) + new_width = screen_pixmap->drawable.width; + + if (new_height < screen_pixmap->drawable.height) + new_height = screen_pixmap->drawable.height; if (new_width == screen_pixmap->drawable.width && new_height == screen_pixmap->drawable.height) { @@ -592,7 +757,10 @@ RRCrtcSet(RRCrtcPtr crtc, return FALSE; if (pScreen->current_master) { - ret = rrCreateSharedPixmap(crtc, width, height, x, y, rotation); + Bool sync = rrGetPixmapSharingSyncProp(numOutputs, outputs); + ret = rrSetupPixmapSharing(crtc, width, height, + x, y, rotation, sync, + numOutputs, outputs); } } #if RANDR_12_INTERFACE @@ -675,9 +843,8 @@ RRCrtcGetTransform(RRCrtcPtr crtc) Bool RRCrtcPendingTransform(RRCrtcPtr crtc) { - return memcmp(&crtc->client_current_transform.transform, - &crtc->client_pending_transform.transform, - sizeof(PictTransform)) != 0; + return !RRTransformEqual(&crtc->client_current_transform, + &crtc->client_pending_transform); } /* @@ -1673,7 +1840,10 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x, if (ret == TRUE) return; - xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { + if (!slave->is_output_slave) + continue; + ret = check_all_screen_crtcs(slave, x, y); if (ret == TRUE) return; @@ -1684,7 +1854,10 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x, if (ret == TRUE) return; - xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { + if (!slave->is_output_slave) + continue; + ret = constrain_all_screen_crtcs(pDev, slave, x, y); if (ret == TRUE) return; @@ -1714,6 +1887,12 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) if (!crtc->scanout_pixmap && !enable) continue; + /* not supported with double buffering, needs ABI change for 2 ppix */ + if (crtc->scanout_pixmap_back) { + ret = FALSE; + continue; + } + size_fits = (crtc->mode && crtc->x == pDrawable->x && crtc->y == pDrawable->y && @@ -1771,3 +1950,22 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) return ret; } + +Bool +RRHasScanoutPixmap(ScreenPtr pScreen) +{ + rrScrPriv(pScreen); + int i; + + if (!pScreen->is_output_slave) + return FALSE; + + for (i = 0; i < pScrPriv->numCrtcs; i++) { + RRCrtcPtr crtc = pScrPriv->crtcs[i]; + + if (crtc->scanout_pixmap) + return TRUE; + } + + return FALSE; +} diff --git a/xserver/randr/rrmonitor.c b/xserver/randr/rrmonitor.c index ba310eaa4..3f6e03e7d 100644 --- a/xserver/randr/rrmonitor.c +++ b/xserver/randr/rrmonitor.c @@ -202,8 +202,12 @@ RRMonitorInitList(ScreenPtr screen, RRMonitorListPtr mon_list, Bool get_active) /* Count the number of crtcs in this and any slave screens */ numCrtcs = pScrPriv->numCrtcs; - xorg_list_for_each_entry(slave, &screen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &screen->slave_list, slave_head) { rrScrPrivPtr pSlavePriv; + + if (!slave->is_output_slave) + continue; + pSlavePriv = rrGetScrPriv(slave); numCrtcs += pSlavePriv->numCrtcs; } @@ -220,8 +224,12 @@ RRMonitorInitList(ScreenPtr screen, RRMonitorListPtr mon_list, Bool get_active) mon_list->server_crtc[c] = pScrPriv->crtcs[sc]; } - xorg_list_for_each_entry(slave, &screen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &screen->slave_list, slave_head) { rrScrPrivPtr pSlavePriv; + + if (!slave->is_output_slave) + continue; + pSlavePriv = rrGetScrPriv(slave); for (sc = 0; sc < pSlavePriv->numCrtcs; sc++, c++) { if (pSlavePriv->crtcs[sc]->mode != NULL) @@ -471,7 +479,10 @@ RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor) return BadValue; } - xorg_list_for_each_entry(slave, &screen->output_slave_list, output_head) { + xorg_list_for_each_entry(slave, &screen->slave_list, slave_head) { + if (!slave->is_output_slave) + continue; + if (RRMonitorMatchesOutputName(slave, monitor->name)) { client->errorValue = monitor->name; return BadValue; diff --git a/xserver/randr/rroutput.c b/xserver/randr/rroutput.c index 686ae49a6..a8efec409 100644 --- a/xserver/randr/rroutput.c +++ b/xserver/randr/rroutput.c @@ -570,12 +570,10 @@ ProcRRSetOutputPrimary(ClientPtr client) RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output); xorg_list_for_each_entry(slave, - &pWin->drawable.pScreen->output_slave_list, - output_head) { - rrScrPrivPtr pSlavePriv; - pSlavePriv = rrGetScrPriv(slave); - - RRSetPrimaryOutput(slave, pSlavePriv, output); + &pWin->drawable.pScreen->slave_list, + slave_head) { + if (slave->is_output_slave) + RRSetPrimaryOutput(slave, rrGetScrPriv(slave), output); } } diff --git a/xserver/randr/rrprovider.c b/xserver/randr/rrprovider.c index 5329f410b..e4bc2bf6a 100644 --- a/xserver/randr/rrprovider.c +++ b/xserver/randr/rrprovider.c @@ -25,6 +25,8 @@ #include "randrstr.h" #include "swaprep.h" +#include + RESTYPE RRProviderType; /* @@ -72,15 +74,7 @@ ProcRRGetProviders (ClientPtr client) if (pScrPriv->provider) total_providers++; - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { - pScrPriv = rrGetScrPriv(iter); - total_providers += pScrPriv->provider ? 1 : 0; - } - xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) { - pScrPriv = rrGetScrPriv(iter); - total_providers += pScrPriv->provider ? 1 : 0; - } - xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { pScrPriv = rrGetScrPriv(iter); total_providers += pScrPriv->provider ? 1 : 0; } @@ -116,13 +110,7 @@ ProcRRGetProviders (ClientPtr client) providers = (RRProvider *)extra; ADD_PROVIDER(pScreen); - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { - ADD_PROVIDER(iter); - } - xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) { - ADD_PROVIDER(iter); - } - xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { ADD_PROVIDER(iter); } } @@ -182,12 +170,13 @@ ProcRRGetProviderInfo (ClientPtr client) /* count associated providers */ if (provider->offload_sink) rep.nAssociatedProviders++; - if (provider->output_source) - rep.nAssociatedProviders++; - xorg_list_for_each_entry(provscreen, &pScreen->output_slave_list, output_head) - rep.nAssociatedProviders++; - xorg_list_for_each_entry(provscreen, &pScreen->offload_slave_list, offload_head) + if (provider->output_source && + provider->output_source != provider->offload_sink) rep.nAssociatedProviders++; + xorg_list_for_each_entry(provscreen, &pScreen->slave_list, slave_head) { + if (provscreen->is_output_slave || provscreen->is_offload_slave) + rep.nAssociatedProviders++; + } rep.length = (pScrPriv->numCrtcs + pScrPriv->numOutputs + (rep.nAssociatedProviders * 2) + bytes_to_int32(rep.nameLength)); @@ -237,27 +226,22 @@ ProcRRGetProviderInfo (ClientPtr client) swapl(&prov_cap[i]); i++; } - xorg_list_for_each_entry(provscreen, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(provscreen, &pScreen->slave_list, slave_head) { + if (!provscreen->is_output_slave && !provscreen->is_offload_slave) + continue; pScrProvPriv = rrGetScrPriv(provscreen); providers[i] = pScrProvPriv->provider->id; if (client->swapped) swapl(&providers[i]); - prov_cap[i] = RR_Capability_SinkOutput; + prov_cap[i] = 0; + if (provscreen->is_output_slave) + prov_cap[i] |= RR_Capability_SinkOutput; + if (provscreen->is_offload_slave) + prov_cap[i] |= RR_Capability_SourceOffload; if (client->swapped) swapl(&prov_cap[i]); i++; } - xorg_list_for_each_entry(provscreen, &pScreen->offload_slave_list, offload_head) { - pScrProvPriv = rrGetScrPriv(provscreen); - providers[i] = pScrProvPriv->provider->id; - if (client->swapped) - swapl(&providers[i]); - prov_cap[i] = RR_Capability_SourceOffload; - if (client->swapped) - swapl(&prov_cap[i]); - i++; - } - memcpy(name, provider->name, rep.nameLength); if (client->swapped) { @@ -277,6 +261,58 @@ ProcRRGetProviderInfo (ClientPtr client) return Success; } +static void +RRInitPrimeSyncProps(ScreenPtr pScreen) +{ + /* + * TODO: When adding support for different sources for different outputs, + * make sure this sets up the output properties only on outputs associated + * with the correct source provider. + */ + + rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); + + const char *syncStr = PRIME_SYNC_PROP; + Atom syncProp = MakeAtom(syncStr, strlen(syncStr), TRUE); + + int defaultVal = TRUE; + int validVals[2] = {FALSE, TRUE}; + + int i; + for (i = 0; i < pScrPriv->numOutputs; i++) { + if (!RRQueryOutputProperty(pScrPriv->outputs[i], syncProp)) { + RRConfigureOutputProperty(pScrPriv->outputs[i], syncProp, + TRUE, FALSE, FALSE, + 2, &validVals[0]); + RRChangeOutputProperty(pScrPriv->outputs[i], syncProp, XA_INTEGER, + 8, PropModeReplace, 1, &defaultVal, + FALSE, FALSE); + } + } +} + +static void +RRFiniPrimeSyncProps(ScreenPtr pScreen) +{ + /* + * TODO: When adding support for different sources for different outputs, + * make sure this tears down the output properties only on outputs + * associated with the correct source provider. + */ + + rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); + int i; + + const char *syncStr = PRIME_SYNC_PROP; + Atom syncProp = MakeAtom(syncStr, strlen(syncStr), FALSE); + if (syncProp == None) + return; + + for (i = 0; i < pScrPriv->numOutputs; i++) { + RRDeleteOutputProperty(pScrPriv->outputs[i], syncProp); + } +} + int ProcRRSetProviderOutputSource(ClientPtr client) { @@ -302,8 +338,13 @@ ProcRRSetProviderOutputSource(ClientPtr client) pScreen = provider->pScreen; pScrPriv = rrGetScrPriv(pScreen); + if (!pScreen->isGPU) + return BadValue; + pScrPriv->rrProviderSetOutputSource(pScreen, provider, source_provider); + RRInitPrimeSyncProps(pScreen); + provider->changed = TRUE; RRSetChanged(pScreen); @@ -379,6 +420,7 @@ RRProviderCreate(ScreenPtr pScreen, const char *name, void RRProviderDestroy (RRProviderPtr provider) { + RRFiniPrimeSyncProps(provider->pScreen); FreeResource (provider->id, 0); } diff --git a/xserver/randr/rrscreen.c b/xserver/randr/rrscreen.c index d0ca91e0e..d6c499580 100644 --- a/xserver/randr/rrscreen.c +++ b/xserver/randr/rrscreen.c @@ -41,6 +41,9 @@ RREditConnectionInfo(ScreenPtr pScreen) int screen = 0; int d; + if (ConnectionInfo == NULL) + return; + connSetup = (xConnSetup *) ConnectionInfo; vendor = (char *) connSetup + sizeof(xConnSetup); formats = (xPixmapFormat *) ((char *) vendor + @@ -391,7 +394,10 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) update_totals(pScreen, pScrPriv); - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { + if (!iter->is_output_slave) + continue; + pScrPriv = rrGetScrPriv(iter); if (query) @@ -447,7 +453,10 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) } update_arrays(pScreen, pScrPriv, primary_crtc, has_primary); - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { + if (!iter->is_output_slave) + continue; + pScrPriv = rrGetScrPriv(iter); update_arrays(iter, pScrPriv, primary_crtc, has_primary); @@ -500,7 +509,7 @@ rrGetScreenResources(ClientPtr client, Bool query) if (!RRGetInfo(pScreen, query)) return BadAlloc; - if (!xorg_list_is_empty(&pScreen->output_slave_list)) + if (pScreen->output_slaves) return rrGetMultiScreenResources(client, query, pScreen); if (!pScrPriv) { diff --git a/xserver/randr/rrxinerama.c b/xserver/randr/rrxinerama.c index b6e9586d7..8f499dfa9 100644 --- a/xserver/randr/rrxinerama.c +++ b/xserver/randr/rrxinerama.c @@ -260,6 +260,13 @@ RRXineramaWriteMonitor(ClientPtr client, RRMonitorPtr monitor) scratch.width = monitor->geometry.box.x2 - monitor->geometry.box.x1; scratch.height = monitor->geometry.box.y2 - monitor->geometry.box.y1; + if (client->swapped) { + swaps(&scratch.x_org); + swaps(&scratch.y_org); + swaps(&scratch.width); + swaps(&scratch.height); + } + WriteToClient(client, sz_XineramaScreenInfo, &scratch); } diff --git a/xserver/record/Makefile.in b/xserver/record/Makefile.in index 81ddb791d..1e8e8ff9c 100644 --- a/xserver/record/Makefile.in +++ b/xserver/record/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -298,6 +299,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -328,7 +332,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -423,6 +430,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/record/record.c b/xserver/record/record.c index 82bb0607e..600d55f53 100644 --- a/xserver/record/record.c +++ b/xserver/record/record.c @@ -1910,7 +1910,8 @@ ProcRecordUnregisterClients(ClientPtr client) int i; REQUEST_AT_LEAST_SIZE(xRecordUnregisterClientsReq); - if ((client->req_len << 2) - SIZEOF(xRecordUnregisterClientsReq) != + if (INT_MAX / 4 < stuff->nClients || + (client->req_len << 2) - SIZEOF(xRecordUnregisterClientsReq) != 4 * stuff->nClients) return BadLength; VERIFY_CONTEXT(pContext, stuff->context, client); diff --git a/xserver/render/Makefile.in b/xserver/render/Makefile.in index bf025c561..a6aecd6d2 100644 --- a/xserver/render/Makefile.in +++ b/xserver/render/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -331,6 +332,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -361,7 +365,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -456,6 +463,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/render/animcur.c b/xserver/render/animcur.c index 825ae1fe7..52e6b8b79 100644 --- a/xserver/render/animcur.c +++ b/xserver/render/animcur.c @@ -59,15 +59,14 @@ typedef struct _AnimCur { typedef struct _AnimScrPriv { CloseScreenProcPtr CloseScreen; - - ScreenBlockHandlerProcPtr BlockHandler; - CursorLimitsProcPtr CursorLimits; DisplayCursorProcPtr DisplayCursor; SetCursorPositionProcPtr SetCursorPosition; RealizeCursorProcPtr RealizeCursor; UnrealizeCursorProcPtr UnrealizeCursor; RecolorCursorProcPtr RecolorCursor; + OsTimerPtr timer; + Bool timer_set; } AnimCurScreenRec, *AnimCurScreenPtr; static unsigned char empty[4]; @@ -129,28 +128,23 @@ AnimCurCursorLimits(DeviceIntPtr pDev, } /* - * This has to be a screen block handler instead of a generic - * block handler so that it is well ordered with respect to the DRI - * block handler responsible for releasing the hardware to DRI clients + * The cursor animation timer has expired, go display any relevant cursor changes + * and compute a new timeout value */ -static void -AnimCurScreenBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadmask) +static CARD32 +AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) { + ScreenPtr pScreen = arg; AnimCurScreenPtr as = GetAnimCurScreen(pScreen); DeviceIntPtr dev; Bool activeDevice = FALSE; - CARD32 now = 0, soonest = ~0; /* earliest time to wakeup again */ - - Unwrap(as, pScreen, BlockHandler); + CARD32 soonest = ~0; /* earliest time to wakeup again */ for (dev = inputInfo.devices; dev; dev = dev->next) { if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) { - if (!activeDevice) { - now = GetTimeInMillis(); + if (!activeDevice) activeDevice = TRUE; - } if ((INT32) (now - dev->spriteInfo->anim.time) >= 0) { AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor); @@ -180,13 +174,11 @@ AnimCurScreenBlockHandler(ScreenPtr pScreen, } if (activeDevice) - AdjustWaitForDelay(pTimeout, soonest - now); - - (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); - if (activeDevice) - Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); + TimerSet(as->timer, TimerAbsolute, soonest, AnimCurTimerNotify, pScreen); else - as->BlockHandler = NULL; + as->timer_set = FALSE; + + return 0; } static Bool @@ -212,8 +204,11 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) pDev->spriteInfo->anim.pCursor = pCursor; pDev->spriteInfo->anim.pScreen = pScreen; - if (!as->BlockHandler) - Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); + if (!as->timer_set) { + TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time, + AnimCurTimerNotify, pScreen); + as->timer_set = TRUE; + } } } else @@ -239,8 +234,11 @@ AnimCurSetCursorPosition(DeviceIntPtr pDev, if (pDev->spriteInfo->anim.pCursor) { pDev->spriteInfo->anim.pScreen = pScreen; - if (!as->BlockHandler) - Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); + if (!as->timer_set) { + TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time, + AnimCurTimerNotify, pScreen); + as->timer_set = TRUE; + } } ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); Wrap(as, pScreen, SetCursorPosition, AnimCurSetCursorPosition); @@ -316,9 +314,14 @@ AnimCurInit(ScreenPtr pScreen) as = (AnimCurScreenPtr) malloc(sizeof(AnimCurScreenRec)); if (!as) return FALSE; - Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); + as->timer = TimerSet(NULL, TimerAbsolute, 0, AnimCurTimerNotify, pScreen); + if (!as->timer) { + free(as); + return FALSE; + } + as->timer_set = FALSE; - as->BlockHandler = NULL; + Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); Wrap(as, pScreen, CursorLimits, AnimCurCursorLimits); Wrap(as, pScreen, DisplayCursor, AnimCurDisplayCursor); diff --git a/xserver/render/render.c b/xserver/render/render.c index c47019389..3a41e331e 100644 --- a/xserver/render/render.c +++ b/xserver/render/render.c @@ -219,17 +219,6 @@ typedef struct _RenderClient { #define GetRenderClient(pClient) ((RenderClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RenderClientPrivateKey)) -static void -RenderClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - RenderClientPtr pRenderClient = GetRenderClient(pClient); - - pRenderClient->major_version = 0; - pRenderClient->minor_version = 0; -} - #ifdef PANORAMIX RESTYPE XRT_PICTURE; #endif @@ -246,8 +235,6 @@ RenderExtensionInit(void) if (!dixRegisterPrivateKey (&RenderClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(RenderClientRec))) return; - if (!AddCallback(&ClientStateCallback, RenderClientCallback, 0)) - return; extEntry = AddExtension(RENDER_NAME, 0, RenderNumberErrors, ProcRenderDispatch, SProcRenderDispatch, @@ -1924,6 +1911,8 @@ ProcRenderCreateRadialGradient(ClientPtr client) LEGAL_NEW_RESOURCE(stuff->pid, client); len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); + if (stuff->nStops > UINT32_MAX / (sizeof(xFixed) + sizeof(xRenderColor))) + return BadLength; if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; @@ -1962,6 +1951,8 @@ ProcRenderCreateConicalGradient(ClientPtr client) LEGAL_NEW_RESOURCE(stuff->pid, client); len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); + if (stuff->nStops > UINT32_MAX / (sizeof(xFixed) + sizeof(xRenderColor))) + return BadLength; if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) return BadLength; diff --git a/xserver/test-driver b/xserver/test-driver deleted file mode 100644 index 8e575b017..000000000 --- a/xserver/test-driver +++ /dev/null @@ -1,148 +0,0 @@ -#! /bin/sh -# test-driver - basic testsuite driver script. - -scriptversion=2013-07-13.22; # UTC - -# Copyright (C) 2011-2014 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -# Make unconditional expansion of undefined variables an error. This -# helps a lot in preventing typo-related bugs. -set -u - -usage_error () -{ - echo "$0: $*" >&2 - print_usage >&2 - exit 2 -} - -print_usage () -{ - cat <$log_file 2>&1 -estatus=$? - -if test $enable_hard_errors = no && test $estatus -eq 99; then - tweaked_estatus=1 -else - tweaked_estatus=$estatus -fi - -case $tweaked_estatus:$expect_failure in - 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; - 0:*) col=$grn res=PASS recheck=no gcopy=no;; - 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; - 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; - *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; - *:*) col=$red res=FAIL recheck=yes gcopy=yes;; -esac - -# Report the test outcome and exit status in the logs, so that one can -# know whether the test passed or failed simply by looking at the '.log' -# file, without the need of also peaking into the corresponding '.trs' -# file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file - -# Report outcome to console. -echo "${col}${res}${std}: $test_name" - -# Register the test result, and other relevant metadata. -echo ":test-result: $res" > $trs_file -echo ":global-test-result: $res" >> $trs_file -echo ":recheck: $recheck" >> $trs_file -echo ":copy-in-global-log: $gcopy" >> $trs_file - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/xserver/test/Makefile.am b/xserver/test/Makefile.am index 9f13e269d..dc60057f5 100644 --- a/xserver/test/Makefile.am +++ b/xserver/test/Makefile.am @@ -1,19 +1,46 @@ if ENABLE_UNIT_TESTS SUBDIRS= . -noinst_PROGRAMS = list string +TEST_PROGS = list string if XORG # Tests that require at least some DDX functions in order to fully link # For now, requires xf86 ddx, could be adjusted to use another SUBDIRS += xi1 xi2 -noinst_PROGRAMS += xkb input xtest misc fixes xfree86 os signal-logging touch +TEST_PROGS += xkb input xtest misc fixes xfree86 signal-logging touch if RES -noinst_PROGRAMS += hashtabletest +TEST_PROGS += hashtabletest endif endif check_LTLIBRARIES = libxservertest.la -TESTS=$(noinst_PROGRAMS) -TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) +noinst_PROGRAMS = \ + simple-xinit \ + $(TEST_PROGS) \ + $(NULL) + +if XVFB +XVFB_TESTS = scripts/xvfb-piglit.sh +if XEPHYR +if GLAMOR +XEPHYR_GLAMOR_TESTS = scripts/xephyr-glamor-piglit.sh +endif +endif +endif + +SCRIPT_TESTS = \ + $(XVFB_TESTS) \ + $(XEPHYR_GLAMOR_TESTS) \ + $(NULL) + +TESTS = \ + $(TEST_PROGS) \ + $(SCRIPT_TESTS) \ + $(NULL) + +TESTS_ENVIRONMENT = \ + XSERVER_DIR=$(abs_top_srcdir) \ + XSERVER_BUILDDIR=$(abs_top_builddir) \ + $(XORG_MALLOC_DEBUG_ENV) \ + $(NULL) AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ AM_CPPFLAGS = $(XORG_INCS) @@ -39,7 +66,6 @@ xfree86_LDADD=$(TEST_LDADD) touch_LDADD=$(TEST_LDADD) signal_logging_LDADD=$(TEST_LDADD) hashtabletest_LDADD=$(TEST_LDADD) -os_LDADD=$(TEST_LDADD) libxservertest_la_LIBADD = $(XSERVER_LIBS) if XORG @@ -55,7 +81,7 @@ libxservertest_la_LIBADD += \ $(top_builddir)/hw/xfree86/ramdac/libramdac.la \ $(top_builddir)/hw/xfree86/ddc/libddc.la \ $(top_builddir)/hw/xfree86/i2c/libi2c.la \ - $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ + $(top_builddir)/hw/xfree86/xkb/libxorgxkb.la \ $(top_builddir)/Xext/libXvidmode.la \ @XORG_LIBS@ @@ -139,5 +165,11 @@ endif libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD) endif -EXTRA_DIST = ddxstubs.c +EXTRA_DIST = \ + scripts/xvfb-piglit.sh \ + scripts/xephyr-glamor-piglit.sh \ + scripts/xinit-piglit-session.sh \ + scripts/run-piglit.sh \ + ddxstubs.c \ + $(NULL) diff --git a/xserver/test/Makefile.in b/xserver/test/Makefile.in index 2a025fdd7..b78843e0b 100644 --- a/xserver/test/Makefile.in +++ b/xserver/test/Makefile.in @@ -50,14 +50,14 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@ENABLE_UNIT_TESTS_TRUE@noinst_PROGRAMS = list$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@ string$(EXEEXT) $(am__EXEEXT_1) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__EXEEXT_2) # Tests that require at least some DDX functions in order to fully link # For now, requires xf86 ddx, could be adjusted to use another @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_1 = xi1 xi2 -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_2 = xkb input xtest misc fixes xfree86 os signal-logging touch +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_2 = xkb input xtest misc fixes xfree86 signal-logging touch @ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE@am__append_3 = hashtabletest +@ENABLE_UNIT_TESTS_TRUE@noinst_PROGRAMS = simple-xinit$(EXEEXT) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__EXEEXT_3) +@ENABLE_UNIT_TESTS_TRUE@TESTS = $(am__EXEEXT_3) $(am__EXEEXT_4) @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_4 = -I$(top_srcdir)/hw/xfree86/parser \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/ddc \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ @@ -75,7 +75,7 @@ host_triplet = @host@ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/ramdac/libramdac.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/ddc/libddc.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/i2c/libi2c.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/xkb/libxorgxkb.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/Xext/libXvidmode.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ @XORG_LIBS@ @@ -126,9 +126,10 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -152,7 +153,7 @@ am__DEPENDENCIES_1 = @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/ramdac/libramdac.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/ddc/libddc.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/i2c/libi2c.la \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/xkb/libxorgxkb.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/Xext/libXvidmode.la @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@nodist_libxservertest_la_OBJECTS = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ ddxstubs.lo miinitext.lo @@ -170,10 +171,11 @@ am__v_lt_1 = @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ misc$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ fixes$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ xfree86$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ os$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ signal-logging$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ touch$(EXEEXT) @ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE@am__EXEEXT_2 = hashtabletest$(EXEEXT) +@ENABLE_UNIT_TESTS_TRUE@am__EXEEXT_3 = list$(EXEEXT) string$(EXEEXT) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__EXEEXT_1) $(am__EXEEXT_2) PROGRAMS = $(noinst_PROGRAMS) fixes_SOURCES = fixes.c fixes_OBJECTS = fixes.$(OBJEXT) @@ -199,13 +201,13 @@ list_LDADD = $(LDADD) misc_SOURCES = misc.c misc_OBJECTS = misc.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@misc_DEPENDENCIES = $(am__DEPENDENCIES_4) -os_SOURCES = os.c -os_OBJECTS = os.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@os_DEPENDENCIES = $(am__DEPENDENCIES_4) signal_logging_SOURCES = signal-logging.c signal_logging_OBJECTS = signal-logging.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@signal_logging_DEPENDENCIES = \ @ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_4) +simple_xinit_SOURCES = simple-xinit.c +simple_xinit_OBJECTS = simple-xinit.$(OBJEXT) +simple_xinit_LDADD = $(LDADD) string_SOURCES = string.c string_OBJECTS = string.$(OBJEXT) string_LDADD = $(LDADD) @@ -256,10 +258,11 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(nodist_libxservertest_la_SOURCES) fixes.c hashtabletest.c \ - input.c list.c misc.c os.c signal-logging.c string.c touch.c \ - xfree86.c xkb.c xtest.c -DIST_SOURCES = fixes.c hashtabletest.c input.c list.c misc.c os.c \ - signal-logging.c string.c touch.c xfree86.c xkb.c xtest.c + input.c list.c misc.c signal-logging.c simple-xinit.c string.c \ + touch.c xfree86.c xkb.c xtest.c +DIST_SOURCES = fixes.c hashtabletest.c input.c list.c misc.c \ + signal-logging.c simple-xinit.c string.c touch.c xfree86.c \ + xkb.c xtest.c RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ @@ -283,6 +286,8 @@ am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = $(am__tty_colors_dummy) +@ENABLE_UNIT_TESTS_TRUE@am__EXEEXT_4 = $(XVFB_TESTS) \ +@ENABLE_UNIT_TESTS_TRUE@ $(XEPHYR_GLAMOR_TESTS) DIST_SUBDIRS = . xi1 xi2 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ @@ -485,6 +490,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -515,7 +523,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -610,6 +621,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -658,9 +670,22 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @ENABLE_UNIT_TESTS_TRUE@SUBDIRS = . $(am__append_1) +@ENABLE_UNIT_TESTS_TRUE@TEST_PROGS = list string $(am__append_2) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_3) @ENABLE_UNIT_TESTS_TRUE@check_LTLIBRARIES = libxservertest.la -@ENABLE_UNIT_TESTS_TRUE@TESTS = $(noinst_PROGRAMS) -@ENABLE_UNIT_TESTS_TRUE@TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) +@ENABLE_UNIT_TESTS_TRUE@@XVFB_TRUE@XVFB_TESTS = scripts/xvfb-piglit.sh +@ENABLE_UNIT_TESTS_TRUE@@GLAMOR_TRUE@@XEPHYR_TRUE@@XVFB_TRUE@XEPHYR_GLAMOR_TESTS = scripts/xephyr-glamor-piglit.sh +@ENABLE_UNIT_TESTS_TRUE@SCRIPT_TESTS = \ +@ENABLE_UNIT_TESTS_TRUE@ $(XVFB_TESTS) \ +@ENABLE_UNIT_TESTS_TRUE@ $(XEPHYR_GLAMOR_TESTS) \ +@ENABLE_UNIT_TESTS_TRUE@ $(NULL) + +@ENABLE_UNIT_TESTS_TRUE@TESTS_ENVIRONMENT = \ +@ENABLE_UNIT_TESTS_TRUE@ XSERVER_DIR=$(abs_top_srcdir) \ +@ENABLE_UNIT_TESTS_TRUE@ XSERVER_BUILDDIR=$(abs_top_builddir) \ +@ENABLE_UNIT_TESTS_TRUE@ $(XORG_MALLOC_DEBUG_ENV) \ +@ENABLE_UNIT_TESTS_TRUE@ $(NULL) + @ENABLE_UNIT_TESTS_TRUE@AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ @ENABLE_UNIT_TESTS_TRUE@AM_CPPFLAGS = $(XORG_INCS) $(am__append_4) @ENABLE_UNIT_TESTS_TRUE@TEST_LDADD = libxservertest.la \ @@ -676,7 +701,6 @@ top_srcdir = @top_srcdir@ @ENABLE_UNIT_TESTS_TRUE@touch_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@signal_logging_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@hashtabletest_LDADD = $(TEST_LDADD) -@ENABLE_UNIT_TESTS_TRUE@os_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@libxservertest_la_LIBADD = $(XSERVER_LIBS) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_6) $(am__append_7) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_8) $(am__append_9) \ @@ -692,7 +716,14 @@ top_srcdir = @top_srcdir@ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@BUILT_SOURCES = sdksyms.c @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@CLEANFILES = sdksyms.c @ENABLE_UNIT_TESTS_TRUE@libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD) -EXTRA_DIST = ddxstubs.c +EXTRA_DIST = \ + scripts/xvfb-piglit.sh \ + scripts/xephyr-glamor-piglit.sh \ + scripts/xinit-piglit-session.sh \ + scripts/run-piglit.sh \ + ddxstubs.c \ + $(NULL) + all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -765,12 +796,12 @@ list$(EXEEXT): $(list_OBJECTS) $(list_DEPENDENCIES) $(EXTRA_list_DEPENDENCIES) misc$(EXEEXT): $(misc_OBJECTS) $(misc_DEPENDENCIES) $(EXTRA_misc_DEPENDENCIES) @rm -f misc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(misc_OBJECTS) $(misc_LDADD) $(LIBS) -os$(EXEEXT): $(os_OBJECTS) $(os_DEPENDENCIES) $(EXTRA_os_DEPENDENCIES) - @rm -f os$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(os_OBJECTS) $(os_LDADD) $(LIBS) signal-logging$(EXEEXT): $(signal_logging_OBJECTS) $(signal_logging_DEPENDENCIES) $(EXTRA_signal_logging_DEPENDENCIES) @rm -f signal-logging$(EXEEXT) $(AM_V_CCLD)$(LINK) $(signal_logging_OBJECTS) $(signal_logging_LDADD) $(LIBS) +simple-xinit$(EXEEXT): $(simple_xinit_OBJECTS) $(simple_xinit_DEPENDENCIES) $(EXTRA_simple_xinit_DEPENDENCIES) + @rm -f simple-xinit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(simple_xinit_OBJECTS) $(simple_xinit_LDADD) $(LIBS) string$(EXEEXT): $(string_OBJECTS) $(string_DEPENDENCIES) $(EXTRA_string_DEPENDENCIES) @rm -f string$(EXEEXT) $(AM_V_CCLD)$(LINK) $(string_OBJECTS) $(string_LDADD) $(LIBS) @@ -800,9 +831,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miinitext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdksyms.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal-logging.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-xinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/touch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfree86.Po@am__quote@ diff --git a/xserver/test/ddxstubs.c b/xserver/test/ddxstubs.c index 3647dc556..58bc0c428 100644 --- a/xserver/test/ddxstubs.c +++ b/xserver/test/ddxstubs.c @@ -83,26 +83,10 @@ LegalModifier(unsigned int key, DeviceIntPtr pDev) } #ifdef XQUARTZ -#include - -BOOL serverRunning = TRUE; -pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; - int darwinMainScreenX = 0; int darwinMainScreenY = 0; BOOL no_configure_window = FALSE; - -void -darwinEvents_lock(void) -{ -} - -void -darwinEvents_unlock(void) -{ -} #endif #ifdef DDXBEFORERESET diff --git a/xserver/test/os.c b/xserver/test/os.c deleted file mode 100644 index d85dcffbe..000000000 --- a/xserver/test/os.c +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Copyright © 2012 Red Hat, Inc. - * - * 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 (including the next - * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "os.h" - -static int last_signal = 0; -static int expect_signal = 0; - -static void sighandler(int signal) -{ - assert(expect_signal); - expect_signal = 0; - if (!last_signal) - raise(signal); - OsBlockSignals(); - OsReleaseSignals(); - last_signal = 1; - expect_signal = 1; -} - -static int -sig_is_blocked(int sig) -{ - sigset_t current; - - sigemptyset(¤t); - assert(sigprocmask(SIG_BLOCK, NULL, ¤t) == 0); - return sigismember(¤t, sig); -} - -static void block_sigio_test(void) -{ -#ifdef SIG_BLOCK - sigset_t current; - - sigemptyset(¤t); - assert(!sig_is_blocked(SIGIO)); - - /* block once */ - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(!sig_is_blocked(SIGIO)); - - /* block twice, nested */ - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(!sig_is_blocked(SIGIO)); - - /* block all */ - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(!sig_is_blocked(SIGIO)); - - /* block all nested */ - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(!sig_is_blocked(SIGIO)); - - /* mix the two */ - /* ABBA */ - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(!sig_is_blocked(SIGIO)); - - /* ABAB */ - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(!sig_is_blocked(SIGIO)); - - /* BAAB */ - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(!sig_is_blocked(SIGIO)); - - /* BABA */ - OsBlockSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsBlockSignals(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSIGIO(); - assert(sig_is_blocked(SIGIO)); - OsReleaseSignals(); - assert(!sig_is_blocked(SIGIO)); -#endif -} - -static void block_sigio_test_nested(void) -{ -#ifdef SIG_BLOCK - /* Check for bug releasing SIGIO during SIGIO signal handling. - test case: - raise signal - → in signal handler: - raise signal - OsBlockSignals() - OsReleaseSignals() - tail guard - tail guard must be hit. - */ - void (*old_handler)(int); - old_handler = OsSignal(SIGIO, sighandler); - expect_signal = 1; - assert(raise(SIGIO) == 0); - assert(OsSignal(SIGIO, old_handler) == sighandler); -#endif -} - -int -main(int argc, char **argv) -{ - block_sigio_test(); - block_sigio_test_nested(); - return 0; -} diff --git a/xserver/test/scripts/run-piglit.sh b/xserver/test/scripts/run-piglit.sh new file mode 100644 index 000000000..b999c2598 --- /dev/null +++ b/xserver/test/scripts/run-piglit.sh @@ -0,0 +1,80 @@ +#!/bin/sh + +set -e + +if test "x$XTEST_DIR" = "x"; then + echo "XTEST_DIR must be set to the directory of the xtest repository." + # Exit as a "skip" so make check works even without piglit. + exit 77 +fi + +if test "x$PIGLIT_DIR" = "x"; then + echo "PIGLIT_DIR must be set to the directory of the piglit repository." + # Exit as a "skip" so make check works even without piglit. + exit 77 +fi + +if test "x$PIGLIT_RESULTS_DIR" = "x"; then + echo "PIGLIT_RESULTS_DIR must be set to where to output piglit results." + # Exit as a real failure because it should always be set. + exit 1 +fi + +if test "x$XSERVER_DIR" = "x"; then + echo "XSERVER_DIR must be set to the directory of the xserver repository." + # Exit as a real failure because it should always be set. + exit 1 +fi + +if test "x$XSERVER_BUILDDIR" = "x"; then + echo "XSERVER_BUILDDIR must be set to the build directory of the xserver repository." + # Exit as a real failure because it should always be set. + exit 1 +fi + +if test "x$SERVER_COMMAND" = "x"; then + echo "SERVER_COMMAND must be set to the server to be spawned." + # Exit as a real failure because it should always be set. + exit 1 +fi + +$XSERVER_BUILDDIR/test/simple-xinit \ + $XSERVER_DIR/test/scripts/xinit-piglit-session.sh \ + -- \ + $SERVER_COMMAND + +# Write out piglit-summaries. +SHORT_SUMMARY=$PIGLIT_RESULTS_DIR/summary +LONG_SUMMARY=$PIGLIT_RESULTS_DIR/long-summary +$PIGLIT_DIR/piglit-summary.py -s $PIGLIT_RESULTS_DIR > $SHORT_SUMMARY +$PIGLIT_DIR/piglit-summary.py $PIGLIT_RESULTS_DIR > $LONG_SUMMARY + +# Write the short summary to make check's log file. +cat $SHORT_SUMMARY + +# Parse the piglit summary to decide on our exit status. +status=0 +# "pass: 0" would mean no tests actually ran. +if grep "^ *pass: *0$" $SHORT_SUMMARY > /dev/null; then + status=1 +fi +# Fails or crashes should be failures from make check's perspective. +if ! grep "^ *fail: *0$" $SHORT_SUMMARY > /dev/null; then + status=1 +fi +if ! grep "^ *crash: *0$" $SHORT_SUMMARY > /dev/null; then + status=1 +fi + +$PIGLIT_DIR/piglit-summary-html.py \ + --overwrite \ + $PIGLIT_RESULTS_DIR/html \ + $PIGLIT_RESULTS_DIR + +if test $status != 0; then + echo "Some piglit tests failed." + echo "The list of failing tests can be found in $LONG_SUMMARY." +fi +echo "An html page of the test status can be found at $PIGLIT_RESULTS_DIR/html/index.html" + +exit $status diff --git a/xserver/test/scripts/xephyr-glamor-piglit.sh b/xserver/test/scripts/xephyr-glamor-piglit.sh new file mode 100644 index 000000000..51d42c313 --- /dev/null +++ b/xserver/test/scripts/xephyr-glamor-piglit.sh @@ -0,0 +1,16 @@ +# Start a Xephyr server using glamor. Since the test environment is +# headless, we start an Xvfb first to host the Xephyr. +export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xephyr-glamor + +export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/kdrive/ephyr/Xephyr \ + -glamor \ + -glamor-skip-present \ + -noreset \ + -schedMax 2000 \ + -screen 1280x1024" + +$XSERVER_BUILDDIR/test/simple-xinit \ + $XSERVER_DIR/test/scripts/run-piglit.sh \ + -- \ + $XSERVER_BUILDDIR/hw/vfb/Xvfb \ + -screen scrn 1280x1024x24 diff --git a/xserver/test/scripts/xinit-piglit-session.sh b/xserver/test/scripts/xinit-piglit-session.sh new file mode 100644 index 000000000..c26735d49 --- /dev/null +++ b/xserver/test/scripts/xinit-piglit-session.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# .xinitrc replacement to run piglit and exit. +# +# Note that piglit will run many processes against the server, so +# running the server with -noreset is recommended to improve runtime. + +set -e + +if test "x$PIGLIT_DIR" = "x"; then + echo "PIGLIT_DIR must be set to the directory of the piglit repository." + exit 1 +fi + +if test "x$PIGLIT_RESULTS_DIR" = "x"; then + echo "PIGLIT_RESULTS_DIR must be defined" + exit 1 +fi + +if test "x$XTEST_DIR" = "x"; then + echo "XTEST_DIR must be set to the root of the built xtest tree." + exit 1 +fi + +cd $PIGLIT_DIR + +# Write the piglit.conf we'll use for our testing. Don't use the +# default piglit.conf name because that may overwrite a local +# piglit.conf. +PIGLITCONF=piglit-xserver-test.conf +cat < $PIGLITCONF +[xts] +path=$XTEST_DIR +EOF + +# Skip some tests that are failing at the time of importing the script. +# "REPORT: min_bounds, rbearing was 0, expecting 2" +PIGLIT_ARGS="$PIGLIT_ARGS -x xlistfontswithinfo@3" +PIGLIT_ARGS="$PIGLIT_ARGS -x xlistfontswithinfo@4" +PIGLIT_ARGS="$PIGLIT_ARGS -x xloadqueryfont@1" +PIGLIT_ARGS="$PIGLIT_ARGS -x xqueryfont@1" +PIGLIT_ARGS="$PIGLIT_ARGS -x xqueryfont@2" + +exec ./piglit-run.py xts-render -f $PIGLITCONF $PIGLIT_ARGS $PIGLIT_RESULTS_DIR diff --git a/xserver/test/scripts/xvfb-piglit.sh b/xserver/test/scripts/xvfb-piglit.sh new file mode 100644 index 000000000..763599ef4 --- /dev/null +++ b/xserver/test/scripts/xvfb-piglit.sh @@ -0,0 +1,7 @@ +export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/vfb/Xvfb \ + -noreset \ + -screen scrn 1280x1024x24" +export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xvfb + +exec $XSERVER_DIR/test/scripts/run-piglit.sh + diff --git a/xserver/test/signal-logging.c b/xserver/test/signal-logging.c index 3d2d04801..7f2972003 100644 --- a/xserver/test/signal-logging.c +++ b/xserver/test/signal-logging.c @@ -177,7 +177,7 @@ static void logging_format(void) strcpy(&buf[sizeof(buf) - 4], "end"); LogInit(log_file_path, NULL); - assert(f = fopen(log_file_path, "r")); + assert((f = fopen(log_file_path, "r"))); #define read_log_msg(msg) do { \ msg = fgets(read_buf, sizeof(read_buf), f); \ diff --git a/xserver/test/simple-xinit.c b/xserver/test/simple-xinit.c new file mode 100644 index 000000000..89189a609 --- /dev/null +++ b/xserver/test/simple-xinit.c @@ -0,0 +1,229 @@ +/* + * Copyright © 2016 Broadcom + * + * 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 (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +static void +kill_server(int server_pid) +{ + int ret = kill(server_pid, SIGTERM); + int wstatus; + + if (ret) { + fprintf(stderr, "Failed to send kill to the server: %s\n", + strerror(errno)); + exit(1); + } + + ret = waitpid(server_pid, &wstatus, 0); + if (ret < 0) { + fprintf(stderr, "Failed to wait for X to die: %s\n", strerror(errno)); + exit(1); + } +} + +static void +usage(int argc, char **argv) +{ + fprintf(stderr, "%s -- \n", argv[0]); + exit(1); +} + +/* Starts the X server, returning its pid. */ +static int +start_server(char *const *server_args) +{ + int server_pid = fork(); + + if (server_pid == -1) { + fprintf(stderr, "Fork failed: %s\n", strerror(errno)); + exit(1); + } else if (server_pid != 0) { + /* Continue along the main process that will exec the client. */ + return server_pid; + } + + /* Execute the server. This only returns if an error occurred. */ + execvp(server_args[0], server_args); + fprintf(stderr, "Error starting the server: %s\n", strerror(errno)); + exit(1); +} + +/* Reads the display number out of the started server's display socket. */ +static int +get_display(int displayfd) +{ + char display_string[10]; + ssize_t ret; + + ret = read(displayfd, display_string, sizeof(display_string - 1)); + if (ret <= 0) { + fprintf(stderr, "Failed reading displayfd: %s\n", strerror(errno)); + exit(1); + } + + /* We've read in the display number as a string terminated by + * '\n', but not '\0'. Cap it and parse the number. + */ + display_string[ret] = '\0'; + return atoi(display_string); +} + +static int +start_client(char *const *client_args, int display) +{ + char *display_string; + int ret; + int client_pid; + + ret = asprintf(&display_string, ":%d", display); + if (ret < 0) { + fprintf(stderr, "asprintf fail\n"); + exit(1); + } + + ret = setenv("DISPLAY", display_string, true); + if (ret) { + fprintf(stderr, "Failed to set DISPLAY\n"); + exit(1); + } + + client_pid = fork(); + if (client_pid == -1) { + fprintf(stderr, "Fork failed: %s\n", strerror(errno)); + exit(1); + } else if (client_pid) { + int wstatus; + + ret = waitpid(client_pid, &wstatus, 0); + if (ret < 0) { + fprintf(stderr, "Error waiting for client to start: %s\n", + strerror(errno)); + return 1; + } + + return WEXITSTATUS(wstatus); + } else { + execvp(client_args[0], client_args); + /* exec only returns if an error occurred. */ + fprintf(stderr, "Error starting the client: %s\n", strerror(errno)); + exit(1); + } +} + +/* Splits the incoming argc/argv into a pair of NULL-terminated arrays + * of args. + */ +static void +parse_args(int argc, char **argv, + char * const **out_client_args, + char * const **out_server_args, + int displayfd) +{ + /* We're stripping the -- and the program name, inserting two + * NULLs, and also the -displayfd and fd number. + */ + char **args_storage = calloc(argc + 2, sizeof(char *)); + char *const *client_args; + char *const *server_args = NULL; + char **next_arg = args_storage; + bool parsing_client = true; + int i, ret; + char *displayfd_string; + + if (!args_storage) + exit(1); + + client_args = args_storage; + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "--") == 0) { + if (!parsing_client) + usage(argc, argv); + + /* Cap the client list */ + *next_arg = NULL; + next_arg++; + + /* Move to adding into server_args. */ + server_args = next_arg; + parsing_client = false; + continue; + } + + *next_arg = argv[i]; + next_arg++; + } + + if (client_args[0] == NULL || !server_args || server_args[0] == NULL) + usage(argc, argv); + + /* Give the server -displayfd X */ + *next_arg = (char *)"-displayfd"; + next_arg++; + + ret = asprintf(&displayfd_string, "%d", displayfd); + if (ret < 0) { + fprintf(stderr, "asprintf fail\n"); + exit(1); + } + *next_arg = displayfd_string; + next_arg++; + + *out_client_args = client_args; + *out_server_args = server_args; +} + +int +main(int argc, char **argv) +{ + char * const *client_args; + char * const *server_args; + int displayfd_pipe[2]; + int display, server_pid; + int ret; + + ret = pipe(displayfd_pipe); + if (ret) { + fprintf(stderr, "Pipe creation failure: %s", strerror(errno)); + exit(1); + } + + parse_args(argc, argv, &client_args, &server_args, displayfd_pipe[1]); + server_pid = start_server(server_args); + display = get_display(displayfd_pipe[0]); + ret = start_client(client_args, display); + kill_server(server_pid); + + exit(ret); +} diff --git a/xserver/test/touch.c b/xserver/test/touch.c index 981c694b6..19c68784d 100644 --- a/xserver/test/touch.c +++ b/xserver/test/touch.c @@ -58,9 +58,8 @@ touch_grow_queue(void) dev.last.touches[i].client_id = i * 2; } - /* no more space, should've scheduled a workproc */ - assert(TouchBeginDDXTouch(&dev, 1234) == NULL); - ProcessWorkQueue(); + /* no more space, should've reallocated and succeeded */ + assert(TouchBeginDDXTouch(&dev, 1234) != NULL); new_size = size + size / 2 + 1; assert(dev.last.num_touches == new_size); @@ -74,8 +73,12 @@ touch_grow_queue(void) assert(t->client_id == i * 2); } + assert(dev.last.touches[size].active == TRUE); + assert(dev.last.touches[size].ddx_id == 1234); + assert(dev.last.touches[size].client_id == 1); + /* make sure those are zero-initialized */ - for (i = size; i < new_size; i++) { + for (i = size + 1; i < new_size; i++) { DDXTouchPointInfoPtr t = &dev.last.touches[i]; assert(t->active == FALSE); @@ -90,7 +93,7 @@ static void touch_find_ddxid(void) { DeviceIntRec dev; - DDXTouchPointInfoPtr ti; + DDXTouchPointInfoPtr ti, ti2; ValuatorClassRec val; TouchClassRec touch; int size = 5; @@ -136,22 +139,20 @@ touch_find_ddxid(void) for (i = 0; i < size; i++) dev.last.touches[i].active = TRUE; - /* Try to create more, fail */ + /* Try to create more, succeed */ ti = TouchFindByDDXID(&dev, 30, TRUE); - assert(ti == NULL); - ti = TouchFindByDDXID(&dev, 30, TRUE); - assert(ti == NULL); - /* make sure we haven't resized, we're in the signal handler */ - assert(dev.last.num_touches == size); + assert(ti != NULL); + ti2 = TouchFindByDDXID(&dev, 30, TRUE); + assert(ti == ti2); + /* make sure we have resized */ + assert(dev.last.num_touches == 8); /* EQ grows from 5 to 8 */ /* stop one touchpoint, try to create, succeed */ dev.last.touches[2].active = FALSE; - ti = TouchFindByDDXID(&dev, 30, TRUE); + ti = TouchFindByDDXID(&dev, 35, TRUE); assert(ti == &dev.last.touches[2]); - /* but still grow anyway */ - ProcessWorkQueue(); ti = TouchFindByDDXID(&dev, 40, TRUE); - assert(ti == &dev.last.touches[size]); + assert(ti == &dev.last.touches[size+1]); free(dev.name); } diff --git a/xserver/test/xi1/Makefile.in b/xserver/test/xi1/Makefile.in index 4f7123c4e..265571584 100644 --- a/xserver/test/xi1/Makefile.in +++ b/xserver/test/xi1/Makefile.in @@ -57,9 +57,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -323,6 +324,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -353,7 +357,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -448,6 +455,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/test/xi2/Makefile.in b/xserver/test/xi2/Makefile.in index ca60f2575..f8e5d3fbe 100644 --- a/xserver/test/xi2/Makefile.in +++ b/xserver/test/xi2/Makefile.in @@ -67,9 +67,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -453,6 +454,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -483,7 +487,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -578,6 +585,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/test/xi2/protocol-xiquerypointer.c b/xserver/test/xi2/protocol-xiquerypointer.c index c0421f6dd..2bf18fadc 100644 --- a/xserver/test/xi2/protocol-xiquerypointer.c +++ b/xserver/test/xi2/protocol-xiquerypointer.c @@ -140,6 +140,7 @@ request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq * req, int error) client_request.swapped = TRUE; swaps(&req->deviceid); + swapl(&req->win); swaps(&req->length); rc = SProcXIQueryPointer(&client_request); assert(rc == error); diff --git a/xserver/xfixes/Makefile.in b/xserver/xfixes/Makefile.in index 6ae741efa..84aef216d 100644 --- a/xserver/xfixes/Makefile.in +++ b/xserver/xfixes/Makefile.in @@ -55,9 +55,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -299,6 +300,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -329,7 +333,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -424,6 +431,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/xfixes/cursor.c b/xserver/xfixes/cursor.c index f241ffa73..6e84d71f1 100644 --- a/xserver/xfixes/cursor.c +++ b/xserver/xfixes/cursor.c @@ -153,6 +153,7 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) if (pCursor != CursorCurrent[pDev->id]) { CursorEventPtr e; + UpdateCurrentTimeIf(); CursorCurrent[pDev->id] = pCursor; for (e = cursorEvents; e; e = e->next) { if ((e->eventMask & XFixesDisplayCursorNotifyMask)) { diff --git a/xserver/xfixes/select.c b/xserver/xfixes/select.c index e964d588c..87a3ad777 100644 --- a/xserver/xfixes/select.c +++ b/xserver/xfixes/select.c @@ -75,6 +75,7 @@ XFixesSelectionCallback(CallbackListPtr *callbacks, void *data, void *args) default: return; } + UpdateCurrentTimeIf(); for (e = selectionEvents; e; e = e->next) { if (e->selection == selection->selection && (e->eventMask & eventMask)) { xXFixesSelectionNotifyEvent ev = { diff --git a/xserver/xfixes/xfixes.c b/xserver/xfixes/xfixes.c index 1c254e0d2..8b45c5349 100644 --- a/xserver/xfixes/xfixes.c +++ b/xserver/xfixes/xfixes.c @@ -213,23 +213,6 @@ SProcXFixesDispatch(ClientPtr client) return (*SProcXFixesVector[stuff->xfixesReqType]) (client); } -static void -XFixesClientCallback(CallbackListPtr *list, void *closure, void *data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - XFixesClientPtr pXFixesClient = GetXFixesClient(pClient); - - pXFixesClient->major_version = 0; - pXFixesClient->minor_version = 0; -} - - /*ARGSUSED*/ static void -XFixesResetProc(ExtensionEntry * extEntry) -{ - DeleteCallback(&ClientStateCallback, XFixesClientCallback, 0); -} - void XFixesExtensionInit(void) { @@ -238,14 +221,12 @@ XFixesExtensionInit(void) if (!dixRegisterPrivateKey (&XFixesClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XFixesClientRec))) return; - if (!AddCallback(&ClientStateCallback, XFixesClientCallback, 0)) - return; if (XFixesSelectionInit() && XFixesCursorInit() && XFixesRegionInit() && (extEntry = AddExtension(XFIXES_NAME, XFixesNumberEvents, XFixesNumberErrors, ProcXFixesDispatch, SProcXFixesDispatch, - XFixesResetProc, StandardMinorOpcode)) != 0) { + NULL, StandardMinorOpcode)) != 0) { XFixesReqCode = (unsigned char) extEntry->base; XFixesEventBase = extEntry->eventBase; XFixesErrorBase = extEntry->errorBase; diff --git a/xserver/xkb/Makefile.in b/xserver/xkb/Makefile.in index fd2fce6ca..f2405efaa 100644 --- a/xserver/xkb/Makefile.in +++ b/xserver/xkb/Makefile.in @@ -56,9 +56,10 @@ DIST_COMMON = $(dist_xkbcompiled_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -338,6 +339,9 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECTROOT = @PROJECTROOT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON3 = @PYTHON3@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ @@ -368,7 +372,10 @@ UDEV_LIBS = @UDEV_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VERSION = @VERSION@ +WAYLAND_PROTOCOLS_DATADIR = @WAYLAND_PROTOCOLS_DATADIR@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSDRI_CFLAGS = @WINDOWSDRI_CFLAGS@ +WINDOWSDRI_LIBS = @WINDOWSDRI_LIBS@ WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ WINDRES = @WINDRES@ @@ -463,6 +470,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff --git a/xserver/xkb/XKM_file_format.txt b/xserver/xkb/XKM_file_format.txt new file mode 100644 index 000000000..0ba28ee8c --- /dev/null +++ b/xserver/xkb/XKM_file_format.txt @@ -0,0 +1,684 @@ + XKM File Format Description + Version 15 + +1. Introduction + +The XKM file format is the exchange format for XKB keyboard descriptions +between the server and xkbcomp. Usually, the server forks off xkbcomp, +xkbcomp compiles the XKM format from the given parameters. +The resulting XKM file is put into a directory readable by the server and +then parsed. + +The XKM format is little more than a binary dump of various XKB-specific +structures and hence tied to the ABI of the server. + + ❧❧❧❧❧❧❧❧❧❧❧ + +1.1 About this file format description + +This description was produced by analyzing the XKM parsing code. Parts of +the file description present in the original format specification may be +missing. This description thus cannot be a reference document for XKM +implementations. + +No description of the meaning of the various fields is given here. Refer to +the XKB protocol specification for more details. + ❧❧❧❧❧❧❧❧❧❧❧ + +2. Notations used in this document + +Notation for structures: + +┌─── + Name of struct + name of field: type or fixed value of field + name of field: type or fixed value of field +└─── + +Data types are identical to those used in the X Protocol specification +except where noted otherwise. Structs specific to XKM are prefixed with XKM, +defines specific to the XKB protocol specification are prefixed with Xkb and +their value is equivalent to that in the protocol specification. + +Multiple instances of a given type are denoted in the following form: + name of field: LISTofFIELDTYPE + +Length specifiers for such fields are usually prefixed with num_. For +example, a struct containing a num_foo of 8 and a 'foo' field contains 8 +structures of type 'foo'. + +Variable length padding is specified as pad(x), where x is the length of the +data to be padded out to a multiple of 4 bytes. For example, given an x of +10, pad(x) would be the remaining 2 bytes to pad the whole struct to 12 +bytes. + +A special notation is a variable content struct. In this case, the contents +of the struct depend on the value of one or more specific fields. +┌─── + Name of struct + field: type or fixed value of field + field: type or fixed value of field + ─── + field ⇒ value 1 + ⇒ + specific field: type + specific field: type + ─── + field ⇒ value 2 + ⇒ + specific field: type + specific field: type +└─── +This notation denotes that if field is of value 1, this struct contains the +specific fields listed underneath value 1. + + ❧❧❧❧❧❧❧❧❧❧❧ + +3. XKM Format + +The XKM format is a binary format with structs usually being padded to a +multiple of 4 bytes. No provisions for endianess are provided, the parser is +left to guess the endianess of the XKM file. + + ❧❧❧❧❧❧❧❧❧❧❧ +3.1 Common data types + +┌─── + XKMCountedString + count: CARD16 + string: count * CHAR + pad: pad(count + 2) +└─── + +XKMCountedString is used for user-readable identifiers. Prime example are +the level names and the section names ("complete", "evdev(inet)", etc.) + +┌─── + XKMGroupBits: CARD8 + group1 0x1 + group2 0x2 + group3 0x4 + group4 0x8 +└─── + + ❧❧❧❧❧❧❧❧❧❧❧ + +3.2 Header and Table of Contents + +┌─── + XKMHeader + version: CARD8 + identifier1: 'm' + identifier2: 'k' + idenfifier3: 'x' +└─── + +The XKM file format has a 4 byte header identifying the file and the XKM +version. The header is followed by the table of contents indicating the +sections present in this file. + +┌─── + XKMFileInfo + type: CARD8 + min_keycode: CARD8 + max_keycode: CARD8 + num_sectioninfo: CARD8 + present: CARD16 + pad: CARD16 + sectioninfo: LISTofXKMSectionInfo +└─── + +min_keycode and max_keycode specify the keycode range for this keyboard +descriptions. The core protocol requires min_keycode always be equal to or +greater than 8. + +┌─── + XKMSectionInfo + type: CARD16 + XkmTypesIndex 0 + XkmCompatMapIndex 1 + XkmSymbolsIndex 2 + XkmIndicatorsIndex 3 + XkmKeyNamesIndex 4 + XkmGeometryIndex 5 + XkmVirtualModsIndex 6 + format: CARD16 + size: CARD16 + offset: CARD16 +└─── + +Describes the section found in a chunk of a file. This struct is found +_twice_ in the file per section, once as part of the XKMFileInfo, once at +the beginning of the actual section (see offset). +The type specifies the type of the section, the section is to be parsed +according to this type. +Size and offset specify the size in bytes and the offset into the file in +bytes, respectively. + +3.3 Sections + +Each section resides at the offset specified in the XKMFileInfo sectioninfo. + + ❧❧❧❧❧❧❧❧❧❧❧ + +3.3.1 XKMTypes + +An XKMTypes section describes the key types defined in a layout. Roughly +speaking, a key type defines how many levels a given key has and which +modifiers change to a particular level. + +┌─── + XKMTypesSection + section_info: XKMSectionInfo + name: XKMCountedString + num_types: CARD16 + pad: CARD16 + types: LISTofXKMKeyType +└─── + +┌─── + XKMKeyType + real_mods: CARD8 + num_levels: CARD8 + virt_mods: CARD16 + num_map_entries: CARD8 + num_level_names: CARD8 + perserve: CARD8 + pad: CARD8 + map_entries: LISTofXKMKTMapEntry + name: XKMCountedString + mods: LISTofXKMModsDesc + level_names: LISXTofXKMCountedString +└─── + +The num_map_entries specifies the number of structs in both map_entries and mods. mods is only present if preserve is TRUE. + +┌─── + XKMKTMapEntry + level: CARD8 + real_mods: CARD8 + virt_mods: CARD16 +└─── + +┌─── + XKMModsDesc + real_mods: CARD8 + pad: CARD8 + virt_mods: CARD16 +└─── + + ❧❧❧❧❧❧❧❧❧❧❧ +3.3.2 XKMCompatMap + +An XKMCompatMap section describes the actions a keyboard may trigger. This +ranges from the TerminateServer action to simple modifier bits. + +┌─── + XKMCompatMap + section_info: XKMSectionInfo + name: XKMCountedString + num_si: CARD16 + group_mask: XKMGroupBits + pad: CARD8 + si: LISTofXKMSymInterpreterDesc + groups: LISTofXKMModsDesc +└─── + +One XKMModsDesc is present for each bit set in group_mask. + +┌─── + XKMSymInterpretDesc + sym: CARD32 + mods: CARD8 + match: CARD8 + virtual_mod: CARD8 + flags: CARD8 + action_type: CARD8 + action_data: XKMActionData +└─── + +Where the action is 7 bytes of CARD8 whose content is determined by +action_type. + +┌─── + XKMActionData: + pad0: CARD8 + pad1: CARD16 + pad2: CARD32 + ─── + action_type ⇒ XkbSA_SetMods || + action_type ⇒ XkbSA_LatchMods || + action_type ⇒ XkbSA_LockMods + ⇒ + flags: CARD8 + mask: CARD8 + real_mods: CARD8 + vmods1: CARD8 + vmods2: CARD8 + pad: CARD16 + ─── + action_type ⇒ XkbSA_SetGroup || + action_type ⇒ XkbSA_LatchGroup || + action_type ⇒ XkbSA_LockGroup + ⇒ + flags: CARD8 + group_XXX: CARD8 + pad0: CARD8 + pad1: CARD32 + ─── + action_type ⇒ XkbSA_MovePtr + ⇒ + flags: CARD8 + high_XXX: CARD8 + low_XXX: CARD8 + high_YYY: CARD8 + low_YYY: CARD8 + pad: CARD16 + ─── + action_type ⇒ XkbSA_PtrBtn || + action_type ⇒ XkbSA_LockPtrBtn + ⇒ + flags: CARD8 + count: CARD8 + button: CARD8 + pad: CARD32 + ─── + action_type ⇒ XkbSA_DeviceBtn || + action_type ⇒ XkbSA_LockLockPtrBtn + ⇒ + flags: CARD8 + count: CARD8 + button: CARD8 + device: CARD8 + pad0: CARD8 + pad1: CARD16 + ─── + action_type ⇒ XkbSA_SetPtrDflt + ⇒ + flags: CARD8 + affect: CARD8 + valueXXX: CARD8 + pad0: CARD32 + ─── + action_type ⇒ XkbSA_ISOLock + ⇒ + flags: CARD8 + mask: CARD8 + real_mods: CARD8 + group_XXX: CARD8 + affect: CARD8 + vmods1: CARD8 + vmods1: CARD8 + ─── + action_type ⇒ XkbSA_SwitchScreen + ⇒ + flags: CARD8 + screenXXX: CARD8 + pad0: CARD8 + pad1: CARD32 + ─── + action_type ⇒ XkbSA_SetControls || + action_type ⇒ XkbSA_LockControls + ⇒ + flags: CARD8 + ctrls3: CARD8 + ctrls2: CARD8 + ctrls1: CARD8 + ctrls0: CARD8 + pad: CARD16 + ─── + action_type ⇒ XkbSA_RedirectKey + ⇒ + new_key: CARD8 + mods_mask: CARD8 + mods: CARD8 + vmods_mask0: CARD8 + vmods_mask1: CARD8 + vmods0: CARD8 + vmods1: CARD8 + ─── + action_type ⇒ XkbSA_DeviceValuator + ⇒ + device: CARD8 + v1_what: CARD8 + v1_idx: CARD8 + v1_value: CARD8 + v2_what: CARD8 + v2_idx: CARD8 + v2_value: CARD8 + pad: CARD8 + ─── + action_type ⇒ XkbSA_XFree86Private || + action_type ⇒ XkbSA_Terminate + ⇒ + pad0: CARD8 + pad1: CARD16 + pad2: CARD32 + ─── + action_type ⇒ XkbSA_ActionMessage + ⇒ + press_msg: BOOL + release_msg: BOOL + gen_event: BOOL + message: 4 * CHAR +└─── + +Note: XkbSA_ActionMessage is currently unsupported and the contents are +ignored. + + ❧❧❧❧❧❧❧❧❧❧❧ +3.3.3 XkmSymbols + +The symbols in a keymap define the actual keysyms each key may produce. + +┌─── + XKMSymbols + section_info: XKMSectionInfo + name: XKMCountedString + min_keycode: CARD8 + max_keycode: CARD8 + group_names_mask: XKMGroupBits + num_vmod_maps: CARD8 + group_names: LISTofXKMCountedString + keysyms: XKMKeysymMapDesc + vmod_maps: XKMVModMapDesc +└─── +One group_name is present for each bit set in group_names_mask. +The number of keysyms present is max_keycode - min_keycode + 1. + +┌─── + XKMKeysymMapDesc + width: CARD8 + num_groups: CARD8 + modifier_map: CARD8 + flags: CARD8 + names: LISTofXKMCountedString + syms: LISTofCARD32 + behavior: XKMBehaviorDesc +└─── + +Presence of names is conditional on the XkmKeyHasTypes flag. The number of +strings is equal to the number of group bits in group_names_mask in the +preceeding XKMSymbols section. +The number of elements in syms is equal to width * num_groups. +Presence of behavior is conditional on the XkmKeyHasBehavior flag. + +┌─── + XKMKeyBehaviorDesc + type: CARD8 + data: CARD8 + pad: CARD16 +└─── + +┌─── + XKMVModMapDesc + key: CARD8 + pad: CARD8 + vmods: CARD16 +└─── + + ❧❧❧❧❧❧❧❧❧❧❧ + +3.3.4 XKMIndicators + +┌─── + XKMIndicators + section_info: XKMSectionInfo + name: XKMCountedString + num_indicators: CARD8 + pad0: CARD8 + pad1: CARD16 + indicators: LISTofXKMIndicatorMapDesc +└─── + +┌─── + XKMIndicatorMapDesc + name: XKMCountedString + indicator: CARD8 + flags: CARD8 + which_mods: CARD8 + real_mods: CARD8 + vmods: CARD16 + which_groups: CARD8 + groups: CARD8 + ctrls: CARD32 +└─── + ❧❧❧❧❧❧❧❧❧❧❧ + +3.3.5 XKMKeyNames + +┌─── + XKMKeyNames + section_info: XKMSectionInfo + name: XKMCountedString + min_keycode: CARD8 + max_keycode: CARD8 + num_aliases: CARD8 + pad: CARD8 + keynames: LISTofXKMKeyname + aliases: LISTofXKMKeyAlias +└─── + +keynames contains max_keycode - min_keycode + 1 entries. + +┌─── + XkmKeyname + name: 4 * CHAR8 +└─── + +┌─── + XkmKeyAlias + real: XkmKeyname + alias: XkmKeyname +└─── + + ❧❧❧❧❧❧❧❧❧❧❧ + +3.3.5 XKMGeometry + +┌─── + XKMGeometry + section_info: XKMSectionInfo + name: XKMCountedString + width_mm: CARD16 + height_mm: CARD16 + base_color_ndx: CARD8 + label_color_ndx: CARD8 + num_properties: CARD16 + num_colors: CARD16 + num_shapes: CARD16 + num_sections: CARD16 + num_doodads: CARD16 + num_key_aliases: CARD16 + pad: CARD16 + label_font: XKMCountedString + properties: LISTofXKMGeomProperty + colors: LISTofXKMCountedString + shapes: LISTofXKMGeomShape + sections: LISTofXKMGeomSection + doodads: LISTofXKMGeomDoodad + key_aliases: LISTofXKMKeyAlias +└─── + +┌─── + XKMGeomProperty + name: XKMCountedString + value: XKMCountedString + +└─── + +┌─── + XKMGeomShape + name: XKMCountedString + num_outlines: CARD8 + primary_idx: CARD8 + approx_idx: CARD8 + pad: CARD8 + outlines: LISTofXKMOutlineDesc +└─── + +┌─── + XKMOutlineDesc + num_points: CARD8 + corner_radius: CARD8 + pad: CARD16 + points: LISTofXKMPointDesc +└─── + +┌─── + XKMPointDesc + x: INT16 + y: INT16 +└─── + +┌─── + XKMGeomSection + name: XKMCountedString + top: INT16 + left: INT16 + width: CARD16 + height: CARD16 + angle: INT16 + priority: CARD8 + num_rows: CARD8 + num_doodads: CARD8 + num_overlays: CARD8 + pad: CARD16 + rows: LISTofXKMRowDesc + doodads: LISTofXKMGeomDoodad + overlays: LISTofXKMGeomOverlay +└─── + +┌─── + XKMRowDesc + top: INT16 + left: INT16 + num_keys: CARD8 + vertical: BOOL + pad: CARD16 + keys: XKMKeyDesc +└─── + +┌─── + XKMKeyDesc + name: XKMKeyname + gap: INT16 + shape_idx: CARD8 + color_idx: CARD8 +└─── + +┌─── + XKMGeomDoodad + name: XKMCountedString + type: CARD8 + priority: CARD8 + top: INT16 + left: INT16 + pad1: CARD16 + pad2: CARD32 + pad3: CARD32 + ─── + type ⇒ XkbOutlineDoodad || + type ⇒ XkbSolideDoodad + ⇒ + type: CARD8 + priority: CARD8 + top: INT16 + left: INT16 + angle: INT16 + color_idx: CARD8 + shape_idx: CARD8 + pad0: CARD16 + pad1: CARD32 + ─── + type ⇒ XkbTextDoodad + ⇒ + type: CARD8 + priority: CARD8 + top: INT16 + left: INT16 + angle: INT16 + width: CARD16 + height: CARD16 + color_idx: CARD8 + pad0: CARD8 + pad1: CARD16 + text: XKMCountedString + font: XKMCountedString + ─── + type ⇒ XkbIndicatorDoodad + ⇒ + type: CARD8 + priority: CARD8 + top: INT16 + left: INT16 + shape_idx: CARD8 + on_color_idx: CARD8 + off_color_idx: CARD8 + pad0: CARD8 + pad1: CARD16 + pad2: CARD32 + ─── + type ⇒ XkbLogoDoodad + ⇒ + type: CARD8 + priority: CARD8 + top: INT16 + left: INT16 + angle: INT16 + color_idx: CARD8 + shape_idx: CARD8 + pad0: CARD16 + pad1: CARD32 + logo_name: XKMCountedString +└─── + +WARNING: XKMGeomDoodad has variable length depending on the type. +NOTE: The current server implementation does not use all fields of all +structures. + +┌─── + XKMOverlayDesc + name: XKMCountedString + num_rows: CARD8 + pad0: CARD8 + pad1: CARD16 + rows: LISTofXKMOverlayRowDesc +└─── + +┌─── + XKMOverlayRowDesc + name: XKMCountedString + row_under: CARD8 + num_keys: CARD8 + pad: CARD16 + keys: LISTofXKMOverlayKeyDesc +└─── + +┌─── + XKMOverlayKeyDesc + over: XKMKeyname + under: XKMKeyname +└─── + + ❧❧❧❧❧❧❧❧❧❧❧ + +3.3.6 XKMVirtualMods + +┌─── + XKMOverlayRowDesc + section_info: XKMSectionInfo + name: XKMCountedString + bound_mask: SETofVMODBITS + named_mask: SETofVMODBITS + vmods: LISTofCARD8 + pad: pad(vmods) + names: LISTofXKMCountedString +└─── + + VMODBITS: CARD16 + +Number of elements in vmods is equal to the number of bits set in +bound_mask. The padding completes vmods to a multiple of 4 byte units. +Number of elements in names is equal to the number of bits set in +named_mask. diff --git a/xserver/xkb/maprules.c b/xserver/xkb/maprules.c index 8e2277969..a096f2087 100644 --- a/xserver/xkb/maprules.c +++ b/xserver/xkb/maprules.c @@ -578,7 +578,7 @@ static void Apply(const char *src, char **dst) { if (src) { - if (*src == '+' || *src == '!') { + if (*src == '+' || *src == '|') { *dst = _Concat(*dst, src); } else { diff --git a/xserver/xkb/xkbAccessX.c b/xserver/xkb/xkbAccessX.c index 7fd6a48df..f80057747 100644 --- a/xserver/xkb/xkbAccessX.c +++ b/xserver/xkb/xkbAccessX.c @@ -89,6 +89,7 @@ AccessXInit(DeviceIntPtr keybd) xkbi->repeatKeyTimer = NULL; xkbi->krgTimer = NULL; xkbi->beepTimer = NULL; + xkbi->checkRepeat = NULL; ctrls->repeat_delay = XkbDfltRepeatDelay; ctrls->repeat_interval = XkbDfltRepeatInterval; ctrls->debounce_delay = 300; @@ -126,7 +127,7 @@ AccessXKeyboardEvent(DeviceIntPtr keybd, int type, BYTE keyCode, Bool isRepeat) { DeviceEvent event; - init_device_event(&event, keybd, GetTimeInMillis()); + init_device_event(&event, keybd, GetTimeInMillis(), EVENT_SOURCE_NORMAL); event.type = type; event.detail.key = keyCode; event.key_repeat = isRepeat; @@ -317,7 +318,8 @@ AccessXRepeatKeyExpire(OsTimerPtr timer, CARD32 now, void *arg) if (xkbi->repeatKey == 0) return 0; - AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, TRUE); + if (xkbi->checkRepeat == NULL || xkbi->checkRepeat (dev, xkbi, xkbi->repeatKey)) + AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, TRUE); return xkbi->desc->ctrls->repeat_interval; } @@ -618,6 +620,7 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd) if (ctrls->enabled_ctrls & XkbSlowKeysMask) { xkbAccessXNotify ev; unsigned beep_type; + unsigned mask; ev.keycode = key; ev.slowKeysDelay = ctrls->slow_keys_delay; @@ -625,14 +628,16 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd) if (BitIsOn(keybd->key->down, key) || (xkbi->mouseKey == key)) { ev.detail = XkbAXN_SKRelease; beep_type = _BEEP_SLOW_RELEASE; + mask = XkbAX_SKReleaseFBMask; } else { ev.detail = XkbAXN_SKReject; beep_type = _BEEP_SLOW_REJECT; + mask = XkbAX_SKRejectFBMask; ignoreKeyEvent = TRUE; } XkbSendAccessXNotify(keybd, &ev); - if (XkbAX_NeedFeedback(ctrls, XkbAX_SKRejectFBMask)) { + if (XkbAX_NeedFeedback(ctrls, mask)) { XkbDDXAccessXBeep(keybd, beep_type, XkbSlowKeysMask); } if (xkbi->slowKey == key) diff --git a/xserver/xkb/xkbActions.c b/xserver/xkb/xkbActions.c index 1a9878dda..2ffd3fadc 100644 --- a/xserver/xkb/xkbActions.c +++ b/xserver/xkb/xkbActions.c @@ -1199,6 +1199,106 @@ XkbPushLockedStateToSlaves(DeviceIntPtr master, int evtype, int key) } } +static void +XkbActionGetFilter(DeviceIntPtr dev, DeviceEvent *event, KeyCode key, + XkbAction *act, int *sendEvent) +{ + XkbSrvInfoPtr xkbi = dev->key->xkbInfo; + XkbFilterPtr filter; + + /* For focus events, we only want to run actions which update our state to + * (hopefully vaguely kinda) match that of the host server, rather than + * actually execute anything. For example, if we enter our VT with + * Ctrl+Alt+Backspace held down, we don't want to terminate our server + * immediately, but we _do_ want Ctrl+Alt to be latched down, so if + * Backspace is released and then pressed again, the server will terminate. + * + * This is pretty flaky, and we should in fact inherit the complete state + * from the host server. There are some state combinations that we cannot + * express by running the state machine over every key, e.g. if AltGr+Shift + * generates a different state to Shift+AltGr. */ + if (event->source_type == EVENT_SOURCE_FOCUS) { + switch (act->type) { + case XkbSA_SetMods: + case XkbSA_SetGroup: + case XkbSA_LatchMods: + case XkbSA_LatchGroup: + case XkbSA_LockMods: + case XkbSA_LockGroup: + break; + default: + *sendEvent = 1; + return; + } + } + + switch (act->type) { + case XkbSA_SetMods: + case XkbSA_SetGroup: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterSetState(xkbi, filter, key, act); + break; + case XkbSA_LatchMods: + case XkbSA_LatchGroup: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterLatchState(xkbi, filter, key, act); + break; + case XkbSA_LockMods: + case XkbSA_LockGroup: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterLockState(xkbi, filter, key, act); + break; + case XkbSA_ISOLock: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterISOLock(xkbi, filter, key, act); + break; + case XkbSA_MovePtr: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterPointerMove(xkbi, filter, key, act); + break; + case XkbSA_PtrBtn: + case XkbSA_LockPtrBtn: + case XkbSA_SetPtrDflt: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterPointerBtn(xkbi, filter, key, act); + break; + case XkbSA_Terminate: + *sendEvent = XkbDDXTerminateServer(dev, key, act); + break; + case XkbSA_SwitchScreen: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterSwitchScreen(xkbi, filter, key, act); + break; + case XkbSA_SetControls: + case XkbSA_LockControls: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterControls(xkbi, filter, key, act); + break; + case XkbSA_ActionMessage: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterActionMessage(xkbi, filter, key, act); + break; + case XkbSA_RedirectKey: + filter = _XkbNextFreeFilter(xkbi); + /* redirect actions must create a new DeviceEvent. The + * source device id for this event cannot be obtained from + * xkbi, so we pass it here explicitly. The field deviceid + * equals to xkbi->device->id. */ + filter->priv = event->sourceid; + *sendEvent = _XkbFilterRedirectKey(xkbi, filter, key, act); + break; + case XkbSA_DeviceBtn: + case XkbSA_LockDeviceBtn: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterDeviceBtn(xkbi, filter, key, act); + break; + case XkbSA_XFree86Private: + filter = _XkbNextFreeFilter(xkbi); + *sendEvent = _XkbFilterXF86Private(xkbi, filter, key, act); + break; + } +} + void XkbHandleActions(DeviceIntPtr dev, DeviceIntPtr kbd, DeviceEvent *event) { @@ -1208,7 +1308,6 @@ XkbHandleActions(DeviceIntPtr dev, DeviceIntPtr kbd, DeviceEvent *event) int sendEvent; Bool genStateNotify; XkbAction act; - XkbFilterPtr filter; Bool keyEvent; Bool pressEvent; ProcessInputProc backupproc; @@ -1236,74 +1335,10 @@ XkbHandleActions(DeviceIntPtr dev, DeviceIntPtr kbd, DeviceEvent *event) act = XkbGetButtonAction(kbd, dev, key); key |= BTN_ACT_FLAG; } + sendEvent = _XkbApplyFilters(xkbi, key, &act); - if (sendEvent) { - switch (act.type) { - case XkbSA_SetMods: - case XkbSA_SetGroup: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterSetState(xkbi, filter, key, &act); - break; - case XkbSA_LatchMods: - case XkbSA_LatchGroup: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterLatchState(xkbi, filter, key, &act); - break; - case XkbSA_LockMods: - case XkbSA_LockGroup: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterLockState(xkbi, filter, key, &act); - break; - case XkbSA_ISOLock: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterISOLock(xkbi, filter, key, &act); - break; - case XkbSA_MovePtr: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterPointerMove(xkbi, filter, key, &act); - break; - case XkbSA_PtrBtn: - case XkbSA_LockPtrBtn: - case XkbSA_SetPtrDflt: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterPointerBtn(xkbi, filter, key, &act); - break; - case XkbSA_Terminate: - sendEvent = XkbDDXTerminateServer(dev, key, &act); - break; - case XkbSA_SwitchScreen: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterSwitchScreen(xkbi, filter, key, &act); - break; - case XkbSA_SetControls: - case XkbSA_LockControls: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterControls(xkbi, filter, key, &act); - break; - case XkbSA_ActionMessage: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterActionMessage(xkbi, filter, key, &act); - break; - case XkbSA_RedirectKey: - filter = _XkbNextFreeFilter(xkbi); - /* redirect actions must create a new DeviceEvent. The - * source device id for this event cannot be obtained from - * xkbi, so we pass it here explicitly. The field deviceid - * equals to xkbi->device->id. */ - filter->priv = event->sourceid; - sendEvent = _XkbFilterRedirectKey(xkbi, filter, key, &act); - break; - case XkbSA_DeviceBtn: - case XkbSA_LockDeviceBtn: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterDeviceBtn(xkbi, filter, key, &act); - break; - case XkbSA_XFree86Private: - filter = _XkbNextFreeFilter(xkbi); - sendEvent = _XkbFilterXF86Private(xkbi, filter, key, &act); - break; - } - } + if (sendEvent) + XkbActionGetFilter(dev, event, key, &act, &sendEvent); } else { if (!keyEvent) @@ -1492,7 +1527,7 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, return; events = InitEventList(GetMaximumEventsNum() + 1); - OsBlockSignals(); + input_lock(); pScreen = miPointerGetScreen(ptr); saveWait = miPointerSetWaitForUpdate(pScreen, FALSE); nevents = GetPointerEvents(events, ptr, type, button, flags, mask); @@ -1500,13 +1535,12 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, UpdateFromMaster(&events[nevents], lastSlave, DEVCHANGE_POINTER_EVENT, &nevents); miPointerSetWaitForUpdate(pScreen, saveWait); - OsReleaseSignals(); for (i = 0; i < nevents; i++) mieqProcessDeviceEvent(ptr, &events[i], NULL); + input_unlock(); FreeEventList(events, GetMaximumEventsNum()); - } static void diff --git a/xserver/xkb/xkbInit.c b/xserver/xkb/xkbInit.c index 30e10bd15..9c772f549 100644 --- a/xserver/xkb/xkbInit.c +++ b/xserver/xkb/xkbInit.c @@ -60,7 +60,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define LED_NUM 5 #define PHYS_LEDS 0x1f #else -#ifdef sun +#ifdef __sun #define LED_NUM 1 #define LED_SCROLL 2 #define LED_COMPOSE 3