summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2016-05-29 12:02:41 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2016-05-29 12:02:41 +0000
commit4a991716ac65d28a68f9943d54c4b74ad0b58f65 (patch)
treec037c3fe64bb15ea67dbf03a96783a8b04085371
parent549cb8bcb6bdd3a7d44f3b9fdc003df777b2b0d2 (diff)
Update to xserver 1.18.3. Tested by shadchin@ and naddy@.
Note that indirect GLX is now disbled by default.
-rw-r--r--xserver/ChangeLog8336
-rw-r--r--xserver/Makefile.in6
-rw-r--r--xserver/TODO12
-rw-r--r--xserver/Xext/Makefile.am7
-rw-r--r--xserver/Xext/Makefile.in24
-rw-r--r--xserver/Xext/geext.c10
-rw-r--r--xserver/Xext/geint.h5
-rw-r--r--xserver/Xext/hashtable.c4
-rw-r--r--xserver/Xext/panoramiX.c10
-rw-r--r--xserver/Xext/panoramiXprocs.c21
-rw-r--r--xserver/Xext/saver.c2
-rw-r--r--xserver/Xext/security.c24
-rw-r--r--xserver/Xext/shape.c2
-rw-r--r--xserver/Xext/sync.c4
-rw-r--r--xserver/Xext/vidmode.c (renamed from xserver/hw/xfree86/common/xf86vmode.c)1128
-rw-r--r--xserver/Xext/xace.c13
-rw-r--r--xserver/Xext/xcmisc.c2
-rw-r--r--xserver/Xext/xf86bigfont.c4
-rw-r--r--xserver/Xext/xres.c10
-rw-r--r--xserver/Xext/xselinux_hooks.c1
-rw-r--r--xserver/Xext/xselinux_label.c2
-rw-r--r--xserver/Xext/xtest.c2
-rw-r--r--xserver/Xext/xvmain.c95
-rw-r--r--xserver/Xext/xvmc.c17
-rw-r--r--xserver/Xi/Makefile.in6
-rw-r--r--xserver/Xi/exevents.c9
-rw-r--r--xserver/Xi/getprop.c2
-rw-r--r--xserver/Xi/xichangehierarchy.c6
-rw-r--r--xserver/Xi/xiproperty.c8
-rw-r--r--xserver/Xi/xiquerypointer.c4
-rw-r--r--xserver/aclocal.m41
-rw-r--r--xserver/autogen.sh11
-rw-r--r--xserver/composite/Makefile.in6
-rw-r--r--xserver/composite/compinit.c35
-rw-r--r--xserver/composite/compwindow.c2
-rw-r--r--xserver/config/10-evdev.conf40
-rw-r--r--xserver/config/Makefile.am4
-rw-r--r--xserver/config/Makefile.in10
-rw-r--r--xserver/config/config.c3
-rw-r--r--xserver/configure788
-rw-r--r--xserver/configure.ac175
-rw-r--r--xserver/damageext/Makefile.in6
-rw-r--r--xserver/dbe/Makefile.in6
-rw-r--r--xserver/dbe/dbe.c14
-rw-r--r--xserver/dbe/midbe.c2
-rw-r--r--xserver/dix/Makefile.in6
-rw-r--r--xserver/dix/atom.c10
-rw-r--r--xserver/dix/colormap.c434
-rw-r--r--xserver/dix/cursor.c8
-rw-r--r--xserver/dix/devices.c10
-rw-r--r--xserver/dix/dispatch.c15
-rw-r--r--xserver/dix/dixfonts.c30
-rw-r--r--xserver/dix/dixutils.c22
-rw-r--r--xserver/dix/enterleave.c4
-rw-r--r--xserver/dix/enterleave.h2
-rw-r--r--xserver/dix/events.c4
-rw-r--r--xserver/dix/extension.c6
-rw-r--r--xserver/dix/getevents.c71
-rw-r--r--xserver/dix/glyphcurs.c4
-rw-r--r--xserver/dix/grabs.c8
-rw-r--r--xserver/dix/inpututils.c78
-rw-r--r--xserver/dix/main.c4
-rw-r--r--xserver/dix/pixmap.c201
-rw-r--r--xserver/dix/property.c10
-rw-r--r--xserver/dix/protocol.txt3
-rw-r--r--xserver/dix/region.c2
-rw-r--r--xserver/dix/resource.c39
-rw-r--r--xserver/dix/touch.c10
-rw-r--r--xserver/dix/window.c176
-rw-r--r--xserver/doc/Makefile.in6
-rw-r--r--xserver/doc/Xinput.xml24
-rw-r--r--xserver/doc/Xserver-spec.xml9
-rw-r--r--xserver/doc/dtrace/Makefile.in6
-rw-r--r--xserver/doc/smartsched6
-rw-r--r--xserver/dri3/Makefile.in6
-rw-r--r--xserver/dri3/dri3.c3
-rw-r--r--xserver/dri3/dri3_priv.h2
-rw-r--r--xserver/dri3/dri3_request.c4
-rw-r--r--xserver/exa/Makefile.am4
-rw-r--r--xserver/exa/Makefile.in11
-rw-r--r--xserver/exa/exa_accel.c8
-rw-r--r--xserver/exa/exa_glyphs.c4
-rw-r--r--xserver/exa/exa_migration_mixed.c4
-rw-r--r--xserver/fb/Makefile.in6
-rw-r--r--xserver/fb/fbcopy.c2
-rw-r--r--xserver/fb/fbpict.c2
-rw-r--r--xserver/glamor/Makefile.am8
-rw-r--r--xserver/glamor/Makefile.in109
-rw-r--r--xserver/glamor/glamor.c459
-rw-r--r--xserver/glamor/glamor.h218
-rw-r--r--xserver/glamor/glamor_addtraps.c29
-rw-r--r--xserver/glamor/glamor_composite_glyphs.c573
-rw-r--r--xserver/glamor/glamor_compositerects.c6
-rw-r--r--xserver/glamor/glamor_copy.c110
-rw-r--r--xserver/glamor/glamor_core.c66
-rw-r--r--xserver/glamor/glamor_dash.c23
-rw-r--r--xserver/glamor/glamor_egl.c316
-rw-r--r--xserver/glamor/glamor_egl_stubs.c6
-rw-r--r--xserver/glamor/glamor_fbo.c263
-rw-r--r--xserver/glamor/glamor_font.c35
-rw-r--r--xserver/glamor/glamor_font.h2
-rw-r--r--xserver/glamor/glamor_glyphblt.c66
-rw-r--r--xserver/glamor/glamor_glyphs.c1783
-rw-r--r--xserver/glamor/glamor_gradient.c74
-rw-r--r--xserver/glamor/glamor_image.c31
-rw-r--r--xserver/glamor/glamor_largepixmap.c215
-rw-r--r--xserver/glamor/glamor_lines.c29
-rw-r--r--xserver/glamor/glamor_picture.c925
-rw-r--r--xserver/glamor/glamor_pixmap.c1036
-rw-r--r--xserver/glamor/glamor_points.c34
-rw-r--r--xserver/glamor/glamor_prepare.c62
-rw-r--r--xserver/glamor/glamor_priv.h598
-rw-r--r--xserver/glamor/glamor_program.c324
-rw-r--r--xserver/glamor/glamor_program.h66
-rw-r--r--xserver/glamor/glamor_rects.c35
-rw-r--r--xserver/glamor/glamor_render.c949
-rw-r--r--xserver/glamor/glamor_segs.c26
-rw-r--r--xserver/glamor/glamor_spans.c84
-rw-r--r--xserver/glamor/glamor_text.c69
-rw-r--r--xserver/glamor/glamor_transfer.c20
-rw-r--r--xserver/glamor/glamor_transform.c69
-rw-r--r--xserver/glamor/glamor_transform.h21
-rw-r--r--xserver/glamor/glamor_trapezoid.c16
-rw-r--r--xserver/glamor/glamor_triangles.c42
-rw-r--r--xserver/glamor/glamor_utils.c2
-rw-r--r--xserver/glamor/glamor_utils.h352
-rw-r--r--xserver/glamor/glamor_vbo.c26
-rw-r--r--xserver/glamor/glamor_window.c32
-rw-r--r--xserver/glamor/glamor_xv.c273
-rw-r--r--xserver/glx/Makefile.in6
-rw-r--r--xserver/glx/createcontext.c31
-rw-r--r--xserver/glx/extension_string.c3
-rw-r--r--xserver/glx/extension_string.h3
-rw-r--r--xserver/glx/glxcmds.c59
-rw-r--r--xserver/glx/glxdri2.c10
-rw-r--r--xserver/glx/glxdriswrast.c3
-rw-r--r--xserver/glx/rensize.c1
-rw-r--r--xserver/glx/single2.c9
-rw-r--r--xserver/glx/single2swap.c9
-rw-r--r--xserver/hw/Makefile.in6
-rw-r--r--xserver/hw/dmx/Makefile.in6
-rw-r--r--xserver/hw/dmx/config/Makefile.in6
-rw-r--r--xserver/hw/dmx/config/dmxcompat.c2
-rw-r--r--xserver/hw/dmx/config/dmxconfig.c12
-rw-r--r--xserver/hw/dmx/config/dmxparse.h2
-rw-r--r--xserver/hw/dmx/config/dmxtodmx.c1
-rw-r--r--xserver/hw/dmx/config/man/Makefile.in6
-rw-r--r--xserver/hw/dmx/config/parser.y1
-rw-r--r--xserver/hw/dmx/config/scanner.l6
-rw-r--r--xserver/hw/dmx/config/xdmxconfig.c1
-rw-r--r--xserver/hw/dmx/dmx.c10
-rw-r--r--xserver/hw/dmx/dmxcmap.c2
-rw-r--r--xserver/hw/dmx/dmxcursor.c2
-rw-r--r--xserver/hw/dmx/dmxextension.c4
-rw-r--r--xserver/hw/dmx/dmxfont.c6
-rw-r--r--xserver/hw/dmx/dmxgc.c2
-rw-r--r--xserver/hw/dmx/dmxinit.c4
-rw-r--r--xserver/hw/dmx/dmxpict.c10
-rw-r--r--xserver/hw/dmx/dmxprop.c2
-rw-r--r--xserver/hw/dmx/dmxwindow.c4
-rw-r--r--xserver/hw/dmx/doc/Makefile.in6
-rw-r--r--xserver/hw/dmx/doc/dmx.xml2
-rw-r--r--xserver/hw/dmx/doxygen/Makefile.in6
-rw-r--r--xserver/hw/dmx/doxygen/doxygen.conf.in2429
-rw-r--r--xserver/hw/dmx/examples/Makefile.in6
-rw-r--r--xserver/hw/dmx/glxProxy/Makefile.in6
-rw-r--r--xserver/hw/dmx/glxProxy/glxcmds.c39
-rw-r--r--xserver/hw/dmx/glxProxy/glxext.c2
-rw-r--r--xserver/hw/dmx/glxProxy/glxscreens.c9
-rw-r--r--xserver/hw/dmx/glxProxy/glxsingle.c5
-rw-r--r--xserver/hw/dmx/glxProxy/render2swap.c34
-rw-r--r--xserver/hw/dmx/glxProxy/renderpixswap.c3
-rw-r--r--xserver/hw/dmx/input/Makefile.in6
-rw-r--r--xserver/hw/dmx/input/dmxarg.c2
-rw-r--r--xserver/hw/dmx/input/dmxevents.c7
-rw-r--r--xserver/hw/dmx/input/dmxinputinit.c4
-rw-r--r--xserver/hw/dmx/input/dmxmotion.c5
-rw-r--r--xserver/hw/dmx/man/Makefile.in6
-rw-r--r--xserver/hw/kdrive/Makefile.in6
-rw-r--r--xserver/hw/kdrive/ephyr/Makefile.in6
-rw-r--r--xserver/hw/kdrive/ephyr/ephyr.c17
-rw-r--r--xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c124
-rw-r--r--xserver/hw/kdrive/ephyr/ephyrcursor.c4
-rw-r--r--xserver/hw/kdrive/ephyr/ephyrdriext.c8
-rw-r--r--xserver/hw/kdrive/ephyr/ephyrglxext.c2
-rw-r--r--xserver/hw/kdrive/ephyr/ephyrinit.c2
-rw-r--r--xserver/hw/kdrive/ephyr/hostx.c34
-rw-r--r--xserver/hw/kdrive/ephyr/hostx.h2
-rw-r--r--xserver/hw/kdrive/ephyr/man/Makefile.in6
-rw-r--r--xserver/hw/kdrive/fake/Makefile.in6
-rw-r--r--xserver/hw/kdrive/fake/fake.c8
-rw-r--r--xserver/hw/kdrive/fbdev/Makefile.in6
-rw-r--r--xserver/hw/kdrive/fbdev/fbdev.c8
-rw-r--r--xserver/hw/kdrive/linux/Makefile.in6
-rw-r--r--xserver/hw/kdrive/linux/evdev.c11
-rw-r--r--xserver/hw/kdrive/src/Makefile.in6
-rw-r--r--xserver/hw/kdrive/src/kdrive.c4
-rw-r--r--xserver/hw/kdrive/src/kinput.c39
-rw-r--r--xserver/hw/kdrive/src/kshadow.c2
-rw-r--r--xserver/hw/kdrive/src/kxv.c4
-rw-r--r--xserver/hw/vfb/InitOutput.c131
-rw-r--r--xserver/hw/vfb/Makefile.in6
-rw-r--r--xserver/hw/vfb/man/Makefile.in6
-rw-r--r--xserver/hw/xfree86/Makefile.am8
-rw-r--r--xserver/hw/xfree86/Makefile.in18
-rw-r--r--xserver/hw/xfree86/common/Makefile.am6
-rw-r--r--xserver/hw/xfree86/common/Makefile.in38
-rw-r--r--xserver/hw/xfree86/common/compiler.h64
-rw-r--r--xserver/hw/xfree86/common/dgaproc.h62
-rw-r--r--xserver/hw/xfree86/common/vidmodeproc.h84
-rw-r--r--xserver/hw/xfree86/common/xf86.h11
-rw-r--r--xserver/hw/xfree86/common/xf86AutoConfig.c2
-rw-r--r--xserver/hw/xfree86/common/xf86Bus.c23
-rw-r--r--xserver/hw/xfree86/common/xf86Config.c117
-rw-r--r--xserver/hw/xfree86/common/xf86Configure.c6
-rw-r--r--xserver/hw/xfree86/common/xf86DGA.c38
-rw-r--r--xserver/hw/xfree86/common/xf86Events.c4
-rw-r--r--xserver/hw/xfree86/common/xf86Extensions.c3
-rw-r--r--xserver/hw/xfree86/common/xf86Helper.c51
-rw-r--r--xserver/hw/xfree86/common/xf86Init.c1
-rw-r--r--xserver/hw/xfree86/common/xf86Mode.c11
-rw-r--r--xserver/hw/xfree86/common/xf86Module.h4
-rw-r--r--xserver/hw/xfree86/common/xf86Privstr.h10
-rw-r--r--xserver/hw/xfree86/common/xf86VidMode.c582
-rw-r--r--xserver/hw/xfree86/common/xf86Xinput.c55
-rw-r--r--xserver/hw/xfree86/common/xf86Xinput.h13
-rw-r--r--xserver/hw/xfree86/common/xf86cmap.c6
-rw-r--r--xserver/hw/xfree86/common/xf86fbman.c11
-rw-r--r--xserver/hw/xfree86/common/xf86pciBus.c10
-rw-r--r--xserver/hw/xfree86/common/xf86platformBus.c9
-rw-r--r--xserver/hw/xfree86/common/xf86sbusBus.c10
-rw-r--r--xserver/hw/xfree86/common/xf86str.h102
-rw-r--r--xserver/hw/xfree86/common/xf86xv.c10
-rw-r--r--xserver/hw/xfree86/common/xf86xvmc.c2
-rw-r--r--xserver/hw/xfree86/ddc/Makefile.in6
-rw-r--r--xserver/hw/xfree86/ddc/ddc.c2
-rw-r--r--xserver/hw/xfree86/dixmods/Makefile.in6
-rw-r--r--xserver/hw/xfree86/dixmods/xkbPrivate.c2
-rw-r--r--xserver/hw/xfree86/doc/Makefile.in6
-rw-r--r--xserver/hw/xfree86/doc/ddxDesign.xml75
-rw-r--r--xserver/hw/xfree86/dri/Makefile.in6
-rw-r--r--xserver/hw/xfree86/dri/dri.c10
-rw-r--r--xserver/hw/xfree86/dri/xf86dri.c2
-rw-r--r--xserver/hw/xfree86/dri2/Makefile.in6
-rw-r--r--xserver/hw/xfree86/dri2/dri2.c134
-rw-r--r--xserver/hw/xfree86/dri2/pci_ids/Makefile.am1
-rw-r--r--xserver/hw/xfree86/dri2/pci_ids/Makefile.in7
-rw-r--r--xserver/hw/xfree86/dri2/pci_ids/i915_pci_ids.h4
-rw-r--r--xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h56
-rw-r--r--xserver/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h7
-rw-r--r--xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h10
-rw-r--r--xserver/hw/xfree86/dri2/pci_ids/virtio_gpu_pci_ids.h2
-rw-r--r--xserver/hw/xfree86/drivers/Makefile.in6
-rw-r--r--xserver/hw/xfree86/drivers/modesetting/Makefile.in6
-rw-r--r--xserver/hw/xfree86/drivers/modesetting/dri2.c8
-rw-r--r--xserver/hw/xfree86/drivers/modesetting/driver.c291
-rw-r--r--xserver/hw/xfree86/drivers/modesetting/driver.h41
-rw-r--r--xserver/hw/xfree86/drivers/modesetting/drmmode_display.c523
-rw-r--r--xserver/hw/xfree86/drivers/modesetting/drmmode_display.h19
-rw-r--r--xserver/hw/xfree86/drivers/modesetting/modesetting.man18
-rw-r--r--xserver/hw/xfree86/drivers/modesetting/present.c456
-rw-r--r--xserver/hw/xfree86/drivers/modesetting/vblank.c46
-rw-r--r--xserver/hw/xfree86/exa/Makefile.am3
-rw-r--r--xserver/hw/xfree86/exa/Makefile.in9
-rw-r--r--xserver/hw/xfree86/exa/man/Makefile.in6
-rw-r--r--xserver/hw/xfree86/fbdevhw/Makefile.in6
-rw-r--r--xserver/hw/xfree86/fbdevhw/fbdevhw.c53
-rw-r--r--xserver/hw/xfree86/fbdevhw/man/Makefile.in6
-rw-r--r--xserver/hw/xfree86/glamor_egl/Makefile.in6
-rw-r--r--xserver/hw/xfree86/i2c/Makefile.in6
-rw-r--r--xserver/hw/xfree86/i2c/xf86i2c.c2
-rw-r--r--xserver/hw/xfree86/int10/Makefile.in6
-rw-r--r--xserver/hw/xfree86/loader/Makefile.am2
-rw-r--r--xserver/hw/xfree86/loader/Makefile.in8
-rw-r--r--xserver/hw/xfree86/loader/loadmod.c10
-rw-r--r--xserver/hw/xfree86/man/Makefile.in6
-rw-r--r--xserver/hw/xfree86/man/Xorg.man66
-rw-r--r--xserver/hw/xfree86/man/Xorg.wrap.man2
-rw-r--r--xserver/hw/xfree86/man/xorg.conf.man17
-rw-r--r--xserver/hw/xfree86/modes/Makefile.in6
-rw-r--r--xserver/hw/xfree86/modes/xf86Crtc.c223
-rw-r--r--xserver/hw/xfree86/modes/xf86Crtc.h26
-rw-r--r--xserver/hw/xfree86/modes/xf86Cursors.c29
-rw-r--r--xserver/hw/xfree86/modes/xf86DiDGA.c2
-rw-r--r--xserver/hw/xfree86/modes/xf86RandR12.c90
-rw-r--r--xserver/hw/xfree86/modes/xf86Rotate.c8
-rw-r--r--xserver/hw/xfree86/os-support/Makefile.in6
-rw-r--r--xserver/hw/xfree86/os-support/bsd/Makefile.in6
-rw-r--r--xserver/hw/xfree86/os-support/bus/Makefile.in6
-rw-r--r--xserver/hw/xfree86/os-support/bus/Sbus.c2
-rw-r--r--xserver/hw/xfree86/os-support/hurd/Makefile.in6
-rw-r--r--xserver/hw/xfree86/os-support/linux/Makefile.am2
-rw-r--r--xserver/hw/xfree86/os-support/linux/Makefile.in12
-rw-r--r--xserver/hw/xfree86/os-support/linux/linux.h32
-rw-r--r--xserver/hw/xfree86/os-support/linux/lnx_init.c147
-rw-r--r--xserver/hw/xfree86/os-support/linux/systemd-logind.c27
-rw-r--r--xserver/hw/xfree86/os-support/misc/Makefile.in6
-rw-r--r--xserver/hw/xfree86/os-support/solaris/Makefile.am3
-rw-r--r--xserver/hw/xfree86/os-support/solaris/Makefile.in10
-rw-r--r--xserver/hw/xfree86/os-support/solaris/apSolaris.shar806
-rw-r--r--xserver/hw/xfree86/os-support/stub/Makefile.in6
-rw-r--r--xserver/hw/xfree86/os-support/xf86_OSlib.h9
-rw-r--r--xserver/hw/xfree86/parser/Configint.h2
-rw-r--r--xserver/hw/xfree86/parser/InputClass.c152
-rw-r--r--xserver/hw/xfree86/parser/Makefile.am16
-rw-r--r--xserver/hw/xfree86/parser/Makefile.in333
-rw-r--r--xserver/hw/xfree86/parser/OutputClass.c52
-rw-r--r--xserver/hw/xfree86/parser/Screen.c96
-rw-r--r--xserver/hw/xfree86/parser/Vendor.c32
-rw-r--r--xserver/hw/xfree86/parser/configProcs.h9
-rw-r--r--xserver/hw/xfree86/parser/xf86Parser.h5
-rw-r--r--xserver/hw/xfree86/parser/xf86tokens.h1
-rw-r--r--xserver/hw/xfree86/ramdac/Makefile.in6
-rw-r--r--xserver/hw/xfree86/ramdac/TI.c2
-rw-r--r--xserver/hw/xfree86/ramdac/xf86Cursor.c26
-rw-r--r--xserver/hw/xfree86/ramdac/xf86Cursor.h5
-rw-r--r--xserver/hw/xfree86/ramdac/xf86HWCurs.c6
-rw-r--r--xserver/hw/xfree86/sdksyms.sh12
-rw-r--r--xserver/hw/xfree86/shadowfb/Makefile.in6
-rw-r--r--xserver/hw/xfree86/utils/Makefile.in6
-rw-r--r--xserver/hw/xfree86/utils/cvt/Makefile.in6
-rw-r--r--xserver/hw/xfree86/utils/cvt/cvt.c4
-rw-r--r--xserver/hw/xfree86/utils/gtf/Makefile.in6
-rw-r--r--xserver/hw/xfree86/utils/man/Makefile.in6
-rw-r--r--xserver/hw/xfree86/vbe/Makefile.in6
-rw-r--r--xserver/hw/xfree86/vbe/vbe.c4
-rw-r--r--xserver/hw/xfree86/vgahw/Makefile.in6
-rw-r--r--xserver/hw/xfree86/x86emu/Makefile.in6
-rw-r--r--xserver/hw/xfree86/x86emu/ops.c192
-rw-r--r--xserver/hw/xfree86/xorg-wrapper.c15
-rw-r--r--xserver/hw/xnest/Color.c17
-rw-r--r--xserver/hw/xnest/Display.c4
-rw-r--r--xserver/hw/xnest/Events.c2
-rw-r--r--xserver/hw/xnest/GC.c5
-rw-r--r--xserver/hw/xnest/Keyboard.c7
-rw-r--r--xserver/hw/xnest/Makefile.in6
-rw-r--r--xserver/hw/xnest/Screen.c4
-rw-r--r--xserver/hw/xnest/man/Makefile.in6
-rw-r--r--xserver/hw/xquartz/GL/Makefile.in6
-rw-r--r--xserver/hw/xquartz/Makefile.in6
-rw-r--r--xserver/hw/xquartz/bundle/Makefile.in6
-rw-r--r--xserver/hw/xquartz/darwinEvents.c8
-rw-r--r--xserver/hw/xquartz/mach-startup/Makefile.in6
-rw-r--r--xserver/hw/xquartz/man/Makefile.in6
-rw-r--r--xserver/hw/xquartz/pbproxy/Makefile.in6
-rw-r--r--xserver/hw/xquartz/quartz.c9
-rw-r--r--xserver/hw/xquartz/quartz.h2
-rw-r--r--xserver/hw/xquartz/xpr/Makefile.in6
-rw-r--r--xserver/hw/xquartz/xpr/xprCursor.c2
-rw-r--r--xserver/hw/xquartz/xpr/xprScreen.c2
-rw-r--r--xserver/hw/xwayland/Makefile.am9
-rw-r--r--xserver/hw/xwayland/Makefile.in71
-rw-r--r--xserver/hw/xwayland/xwayland-cursor.c1
-rw-r--r--xserver/hw/xwayland/xwayland-cvt.c4
-rw-r--r--xserver/hw/xwayland/xwayland-glamor-xv.c412
-rw-r--r--xserver/hw/xwayland/xwayland-glamor.c37
-rw-r--r--xserver/hw/xwayland/xwayland-input.c356
-rw-r--r--xserver/hw/xwayland/xwayland-output.c158
-rw-r--r--xserver/hw/xwayland/xwayland-shm.c10
-rw-r--r--xserver/hw/xwayland/xwayland-vidmode.c419
-rw-r--r--xserver/hw/xwayland/xwayland.c67
-rw-r--r--xserver/hw/xwayland/xwayland.h25
-rw-r--r--xserver/hw/xwin/InitOutput.c61
-rw-r--r--xserver/hw/xwin/Makefile.am2
-rw-r--r--xserver/hw/xwin/Makefile.in18
-rw-r--r--xserver/hw/xwin/XWin.exe.manifest16
-rw-r--r--xserver/hw/xwin/glx/Makefile.in6
-rw-r--r--xserver/hw/xwin/glx/indirect.c12
-rw-r--r--xserver/hw/xwin/glx/winpriv.c2
-rw-r--r--xserver/hw/xwin/man/Makefile.in6
-rw-r--r--xserver/hw/xwin/man/XWin.man11
-rw-r--r--xserver/hw/xwin/win.h35
-rw-r--r--xserver/hw/xwin/winallpriv.c4
-rw-r--r--xserver/hw/xwin/winauth.c17
-rw-r--r--xserver/hw/xwin/winclipboard/Makefile.in6
-rw-r--r--xserver/hw/xwin/winclipboard/thread.c9
-rw-r--r--xserver/hw/xwin/winclipboard/wndproc.c121
-rw-r--r--xserver/hw/xwin/winclipboard/xevents.c16
-rw-r--r--xserver/hw/xwin/wincmap.c10
-rw-r--r--xserver/hw/xwin/winconfig.c76
-rw-r--r--xserver/hw/xwin/wincreatewnd.c9
-rw-r--r--xserver/hw/xwin/windialogs.c8
-rw-r--r--xserver/hw/xwin/winengine.c26
-rw-r--r--xserver/hw/xwin/winglobals.c2
-rw-r--r--xserver/hw/xwin/winkeybd.c6
-rw-r--r--xserver/hw/xwin/winkeyhook.c2
-rw-r--r--xserver/hw/xwin/winlayouts.h5
-rw-r--r--xserver/hw/xwin/winmsg.c8
-rw-r--r--xserver/hw/xwin/winmultiwindowclass.h28
-rw-r--r--xserver/hw/xwin/winmultiwindowicons.c9
-rw-r--r--xserver/hw/xwin/winmultiwindowwindow.c80
-rw-r--r--xserver/hw/xwin/winmultiwindowwm.c11
-rw-r--r--xserver/hw/xwin/winmultiwindowwndproc.c39
-rw-r--r--xserver/hw/xwin/winos.c72
-rw-r--r--xserver/hw/xwin/winprocarg.c6
-rw-r--r--xserver/hw/xwin/winrandr.c103
-rw-r--r--xserver/hw/xwin/winscrinit.c27
-rw-r--r--xserver/hw/xwin/winshaddd.c1221
-rw-r--r--xserver/hw/xwin/winshadddnl.c15
-rw-r--r--xserver/hw/xwin/winshadgdi.c10
-rw-r--r--xserver/hw/xwin/winwin32rootlesswndproc.c18
-rw-r--r--xserver/hw/xwin/winwndproc.c8
-rw-r--r--xserver/include/Makefile.am7
-rw-r--r--xserver/include/Makefile.in25
-rw-r--r--xserver/include/colormap.h12
-rw-r--r--xserver/include/cursorstr.h2
-rw-r--r--xserver/include/displaymode.h102
-rw-r--r--xserver/include/dix-config.h.in18
-rw-r--r--xserver/include/dix.h8
-rw-r--r--xserver/include/dixfont.h36
-rw-r--r--xserver/include/dixstruct.h23
-rw-r--r--xserver/include/do-not-use-config.h.in17
-rw-r--r--xserver/include/extinit.h5
-rw-r--r--xserver/include/input.h20
-rw-r--r--xserver/include/inpututils.h2
-rw-r--r--xserver/include/kdrive-config.h.in3
-rw-r--r--xserver/include/list.h8
-rw-r--r--xserver/include/misc.h3
-rw-r--r--xserver/include/nonsdk_extinit.h35
-rw-r--r--xserver/include/opaque.h1
-rw-r--r--xserver/include/os.h40
-rw-r--r--xserver/include/pixmap.h14
-rw-r--r--xserver/include/pixmapstr.h5
-rw-r--r--xserver/include/protocol-versions.h2
-rw-r--r--xserver/include/resource.h15
-rw-r--r--xserver/include/scrnintstr.h10
-rw-r--r--xserver/include/swaprep.h320
-rw-r--r--xserver/include/swapreq.h6
-rw-r--r--xserver/include/vidmodestr.h142
-rw-r--r--xserver/include/window.h9
-rw-r--r--xserver/include/windowstr.h4
-rw-r--r--xserver/include/xorg-server.h.in6
-rw-r--r--xserver/m4/xorg-tls.m455
-rw-r--r--xserver/man/Makefile.in6
-rw-r--r--xserver/man/Xserver.man18
-rw-r--r--xserver/mi/Makefile.in6
-rw-r--r--xserver/mi/miarc.c25
-rw-r--r--xserver/mi/mibitblt.c16
-rw-r--r--xserver/mi/micmap.c8
-rw-r--r--xserver/mi/micopy.c4
-rw-r--r--xserver/mi/midispcur.c20
-rw-r--r--xserver/mi/mieq.c14
-rw-r--r--xserver/mi/miexpose.c37
-rw-r--r--xserver/mi/mifillrct.c4
-rw-r--r--xserver/mi/miglblt.c3
-rw-r--r--xserver/mi/miinitext.c7
-rw-r--r--xserver/mi/mioverlay.c13
-rw-r--r--xserver/mi/mipoly.c4
-rw-r--r--xserver/mi/mipolypnt.c2
-rw-r--r--xserver/mi/mipolyrect.c2
-rw-r--r--xserver/mi/miscrinit.c1
-rw-r--r--xserver/mi/miwideline.c42
-rw-r--r--xserver/mi/miwindow.c17
-rw-r--r--xserver/mi/mizerarc.c4
-rw-r--r--xserver/mi/mizerline.c4
-rw-r--r--xserver/miext/Makefile.am9
-rw-r--r--xserver/miext/Makefile.in12
-rw-r--r--xserver/miext/damage/Makefile.in6
-rw-r--r--xserver/miext/damage/damage.c3
-rw-r--r--xserver/miext/rootless/Makefile.in6
-rw-r--r--xserver/miext/rootless/rootlessCommon.h1
-rw-r--r--xserver/miext/rootless/rootlessConfig.h19
-rw-r--r--xserver/miext/rootless/rootlessScreen.c3
-rw-r--r--xserver/miext/rootless/rootlessWindow.c35
-rw-r--r--xserver/miext/rootless/rootlessWindow.h1
-rw-r--r--xserver/miext/shadow/Makefile.in6
-rw-r--r--xserver/miext/shadow/shalloc.c2
-rw-r--r--xserver/miext/sync/Makefile.in6
-rw-r--r--xserver/os/Makefile.in11
-rw-r--r--xserver/os/access.c15
-rw-r--r--xserver/os/connection.c20
-rw-r--r--xserver/os/log.c126
-rw-r--r--xserver/os/osdep.h14
-rw-r--r--xserver/os/osinit.c5
-rw-r--r--xserver/os/reallocarray.c43
-rw-r--r--xserver/os/utils.c41
-rw-r--r--xserver/present/Makefile.in6
-rw-r--r--xserver/present/present.c154
-rw-r--r--xserver/present/present_event.c2
-rw-r--r--xserver/present/present_priv.h4
-rw-r--r--xserver/present/present_request.c4
-rw-r--r--xserver/pseudoramiX/Makefile.in6
-rw-r--r--xserver/pseudoramiX/pseudoramiX.c12
-rw-r--r--xserver/pseudoramiX/pseudoramiX.h2
-rw-r--r--xserver/randr/Makefile.am1
-rw-r--r--xserver/randr/Makefile.in24
-rw-r--r--xserver/randr/randr.c4
-rw-r--r--xserver/randr/randrstr.h63
-rw-r--r--xserver/randr/rrcrtc.c94
-rw-r--r--xserver/randr/rrdispatch.c3
-rw-r--r--xserver/randr/rrinfo.c10
-rw-r--r--xserver/randr/rrmode.c4
-rw-r--r--xserver/randr/rrmonitor.c754
-rw-r--r--xserver/randr/rroutput.c48
-rw-r--r--xserver/randr/rrproperty.c12
-rw-r--r--xserver/randr/rrproviderproperty.c6
-rw-r--r--xserver/randr/rrscreen.c5
-rw-r--r--xserver/randr/rrsdispatch.c38
-rw-r--r--xserver/randr/rrtransform.c10
-rw-r--r--xserver/randr/rrxinerama.c123
-rw-r--r--xserver/record/Makefile.in6
-rw-r--r--xserver/record/record.c36
-rw-r--r--xserver/record/set.c4
-rw-r--r--xserver/render/Makefile.in6
-rw-r--r--xserver/render/filter.c12
-rw-r--r--xserver/render/glyph.c10
-rw-r--r--xserver/render/glyphstr.h36
-rw-r--r--xserver/render/miindex.c2
-rw-r--r--xserver/render/mipict.c20
-rw-r--r--xserver/render/mipict.h36
-rw-r--r--xserver/render/picture.c29
-rw-r--r--xserver/render/picture.h6
-rw-r--r--xserver/render/picturestr.h50
-rw-r--r--xserver/render/render.c6
-rw-r--r--xserver/test/Makefile.am6
-rw-r--r--xserver/test/Makefile.in19
-rw-r--r--xserver/test/README17
-rw-r--r--xserver/test/input.c63
-rw-r--r--xserver/test/xi1/Makefile.in6
-rw-r--r--xserver/test/xi2/Makefile.in6
-rw-r--r--xserver/xfixes/Makefile.am4
-rw-r--r--xserver/xfixes/Makefile.in78
-rw-r--r--xserver/xfixes/cursor.c6
-rw-r--r--xserver/xfixes/region.c2
-rw-r--r--xserver/xfixes/xfixes.h6
-rw-r--r--xserver/xkb/Makefile.in6
-rw-r--r--xserver/xkb/XKBAlloc.c14
-rw-r--r--xserver/xkb/XKBGAlloc.c2
-rw-r--r--xserver/xkb/XKBMAlloc.c47
-rw-r--r--xserver/xkb/maprules.c12
-rw-r--r--xserver/xkb/xkb.c32
-rw-r--r--xserver/xkb/xkbActions.c13
-rw-r--r--xserver/xkb/xkbUtils.c76
-rw-r--r--xserver/xkb/xkmread.c2
534 files changed, 22563 insertions, 15638 deletions
diff --git a/xserver/ChangeLog b/xserver/ChangeLog
index 3db13a96e..a4c2a4df7 100644
--- a/xserver/ChangeLog
+++ b/xserver/ChangeLog
@@ -1,10 +1,2791 @@
-commit 2c7fa2a423ee3d2b9b4c1c63d90ecdfc9eb3b359
+commit 9454cd51da9b38b974cff7c8b7125901f6403848
Author: Adam Jackson <ajax@redhat.com>
-Date: Wed Oct 28 12:30:44 2015 -0400
+Date: Mon Apr 4 14:39:36 2016 -0400
- xserver 1.17.4
+ xserver 1.18.3
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 082d5ea9a8f882c5ab7c30c481e2d9a5c5f11376
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Mon Mar 21 09:53:17 2016 +0100
+
+ xwayland: Pretend we support viewport in vidmode
+
+ Some games (namely openttd) will raise an XError and fail with a
+ BadValue if their request to XF86VidModeSetViewPort fails.
+
+ Support only the default zoom and viewport, fail for everything else.
+
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+ (cherry picked from commit 44e1c97ca6fe992bbb6ef9ecb0b82a113adfa57e)
+
+commit fcb89adb4a6cde585923e63d3c34df465aa78d1b
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Thu Mar 17 14:39:45 2016 +0100
+
+ xwayland: do not include frequency in mode name
+
+ Some applications (e.g. using lwjgl) try to parse the output of the
+ xrandr command and get confused with the mode name returned by Xwayland,
+ because it contains "@[frequency]" (e.g. "1024x640@60.0Hz").
+
+ Remove the @[frequency] part of the mode name to match what is found in
+ usual mode names on regular X servers to please those applications.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94589
+
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ Reviewed-by: Daniel Stone <daniels@collabora.com>
+ (cherry picked from commit 6e3a6e30a6ac66942a0756a5d079993181f02e34)
+
+commit b8f9fd83189bd5593793c1cfcbfedb5150d7c5a5
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Thu Mar 24 17:34:23 2016 +0900
+
+ xfree86/modes: Make sure the HW cursor is hidden when it should be
+
+ When the HW cursor is hidden (e.g. because xf86CursorResetCursor
+ triggers a switch from HW cursor to SW cursor), the driver isn't
+ notified of this for disabled CRTCs. If the HW cursor was shown when the
+ CRTC was disabled, it may still be displayed when the CRTC is enabled
+ again.
+
+ Prevent this by explicitly hiding the HW cursor again after setting a
+ mode if it's currently supposed to be hidden.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94560
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit 418fe365b45a143680d3b4143dc60f7cdc5a3507)
+
+commit 1211d483d4581ee5ccbd50c654d30cf3318fe7c6
+Author: Sonny Jiang <sonny.jiang@amd.com>
+Date: Mon Mar 28 16:36:50 2016 +0900
+
+ DRI2: add Polaris PCI IDs
+
+ Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (Polaris10)
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (Polaris11)
+
+ (Ported from Mesa commit f00c840578a70e479ffb99f6b64c73dc420179fa)
+
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+ (cherry picked from commit 1c90797565385426ad63bd2108085c8466695c0b)
+
+commit 07ad2fde78f07e98caaf3e9b6b67af15359fefe4
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Thu Mar 24 17:42:47 2016 +0900
+
+ present: Only requeue for next MSC after flip failure
+
+ This code was added to deal with the driver present hook failing, in
+ which case we need to wait for the next MSC before executing the
+ presentation.
+
+ However, it could also take effect in cases where the driver incorrectly
+ thinks the current MSC matches the target one (e.g. due to the kernel
+ interface only supporting 32-bit MSC values), in which case it could
+ result in the presentation getting requeued over and over.
+
+ To prevent such issues, check specifically for the target MSC
+ immediately following the current MSC.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94596
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ (cherry picked from commit 3b385105b2d19a1c55e9779ae88d775185eea231)
+
+commit e8f785f82ec8d3a76ae377c7430b1945180cba00
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Mar 23 14:42:08 2016 -0400
+
+ vfb: Re-add LD_EXPORT_SYMBOLS_FLAG to LDFLAGS
+
+ Accidentally removed, breaks Xvfb on cygwin.
+
+ Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit 8ac0e05cc6c6e87b223ba7cb31d8856771c5d41a)
+
+commit fb8ddcf1cb0f47257370c3d6a895a5a41bea8dc0
+Author: Dave Airlie <airlied@redhat.com>
+Date: Wed Mar 16 10:45:54 2016 +1000
+
+ glamor: swizzle RED to 0 for alpha textures
+
+ I'm pretty sure Eric suspected this could cause a problem, and we
+ couldn't find a test. Well loading feedly in firefox seems to trigger
+ badness that this solves.
+
+ bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94554
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Tested-by: Timo Aaltonen <tjaalton@ubuntu.com>
+ (cherry picked from commit a288cf58a0dc0f965a6f964c76bb86bb1989d797)
+
+commit 1bffe77769a9dce623e4a587ed3895ba003c257b
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Mar 13 13:54:01 2016 +0000
+
+ Xext/vidmode: Reduce verbosity of GetModeLine debug messages
+
+ In commit f175cf45aebcdda53f3ae49c0eaf27da1f194e92
+ Author: Olivier Fourdan <ofourdan@redhat.com>
+ Date: Wed Feb 10 09:34:34 2016 +0100
+
+ vidmode: move to a separate library of its own
+
+ the verbosity of some old debug messages (which print the reply to every
+ GetModeLine client request and others) was increased leading to lots of
+ log spam. Downgrade the logging back to DebugF.
+
+ [ajax: Fix a typo so it compiles.]
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ References: https://bugs.freedesktop.org/show_bug.cgi?id=94515
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Cc: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit 75eecf28ae3709181a51571132b0accd9cae316e)
+
+commit 93d4224ccf3dee5a51815a66f76c905450419b50
+Author: Adam Jackson <ajax@redhat.com>
+Date: Fri Mar 11 16:38:52 2016 -0500
+
+ xserver 1.18.2
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit d88f8ffeb7ec0304d793388be5b65a293505bc3b
+Author: Adam Jackson <ajax@redhat.com>
+Date: Fri Mar 11 13:50:32 2016 -0500
+
+ vidmode: Remove stray vidmodeproc.h from EXTRA_DIST
+
+ Was removed from the tree in:
+
+ commit f175cf45aebcdda53f3ae49c0eaf27da1f194e92
+ Author: Olivier Fourdan <ofourdan@redhat.com>
+ Date: Wed Feb 10 09:34:34 2016 +0100
+
+ vidmode: move to a separate library of its own
+
+ but not removed from the Makefile, which broke 'make dist'.
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit 744c292ae49dd1f9d33b860d2b4f0ae27023809b)
+
+commit 643359fb03c51244c9ed5f5efab4c84594259e8c
+Author: Dave Airlie <airlied@gmail.com>
+Date: Tue Feb 9 16:54:22 2016 +1000
+
+ present: fail flipping if we have any slave outputs
+
+ Due to the way present currently works, we don't ever check with the
+ secondary adapters if we can flip at all.
+
+ We shouldn't flip if the secondary adapters are attached to the pixmap
+ currently, however using the current check_flip callback isn't possible
+ as it passes the Window to the driver (something we shouldn't be doing),
+ so the slave driver can never get it's own screen ptr back.
+
+ For now to fix the problem just block flips if we have any slaves
+ configured. We can fix the ABI up later, but this fix can be backported
+ to stable.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ (cherry picked from commit 47bc7fcaa567b0d9e2627b4a21b112e96f81725b)
+
+commit 3e480c6f5168e7da1521bdcc15ed8b5b8762612d
+Author: Adam Jackson <ajax@redhat.com>
+Date: Thu Jan 21 12:47:57 2016 -0500
+
+ glx: Implement GLX_EXT_fbconfig_packed_float
+
+ The tokens for this are already defined by GLX_ARB_fbconfig_float, which
+ we already support, so just add the extension to the list and let the
+ driver provide those configs if it wants.
+
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit ef3005da3d5dc92b3ee5a0ee78164e739a3216dc)
+
+commit b9f7edda0634955711870bb1389095525d4496e3
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon May 18 13:00:02 2015 -0400
+
+ glx: Implement GLX_EXT_stereo_tree
+
+ This is correct as it is, but only because we know no DRI drivers
+ implement stereo.
+
+ v2: Use new ATTRIB macro
+
+ Reviewed-by: James Jones <jajones@nvidia.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit d15cb654b6ba365dac9a62064e277adebde2fdab)
+
+commit 2b3363418a425bf432b55927d8f8dd93c004c791
+Author: Adam Jackson <ajax@redhat.com>
+Date: Thu Mar 3 16:50:02 2016 -0500
+
+ glx: Add GLX_SCREEN to the GetDrawableAttributes response
+
+ libglvnd would like to use this to map from drawable to screen, so it
+ can know which driver to dispatch to. Refer to the spec proposal here:
+
+ https://lists.freedesktop.org/archives/mesa-dev/2016-March/109543.html
+
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit a18238877bbf9aab95843d849a6f434275e9cd6c)
+
+commit 2541d765fdd1006d649063882e3a667438f1d30e
+Author: Adam Jackson <ajax@redhat.com>
+Date: Thu Mar 10 12:29:34 2016 -0500
+
+ glx: Macroize building the attribute list in DoGetDrawableAttributes
+
+ No functional change, just a little easier to read and harder to get
+ wrong.
+
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit 47c1d6b7abcfb1c6b478367bbc2e869c91485bc0)
+
+commit 2a7b6ea1a54a4c8174669c1ca38c4665505c4637
+Author: Eric Anholt <eric@anholt.net>
+Date: Mon Feb 1 13:58:15 2016 -0800
+
+ ephyr: Fix redisplay with glamor on GLES.
+
+ glamor_transfer.c is still totally broken, though.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ (cherry picked from commit c01094c5312fbd84146dd83122e5256a8e57d092)
+
+commit 5af20f15636aa2ede3dac1af9e9afa063564130c
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Wed Mar 9 16:45:18 2016 +0100
+
+ glamor: do not build Xv support when --disable-xv
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit 25ce263fd88684be9370025f93ba3a2bfc72ff1a)
+
+commit 9fc05b85e544638ccc4b811c19e64312b387c799
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Wed Mar 9 16:21:18 2016 +0100
+
+ xwayland: add glamor Xv adaptor
+
+ This adds an Xv adaptor using glamor.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit da7724d3d277c6c8a814881785b716896802629a)
+
+commit 1aa9a2be313c51a78af9bceea865dcf069e9cebe
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Mon Dec 21 17:54:08 2015 +0900
+
+ modesetting: Allow CRTC transforms to actually take effect
+
+ Setting crtc->transformPresent to FALSE was preventing the transform
+ from actually taking effect and putting RandR into a confused state.
+
+ Now that the RandR 1.2 cursor code handles transforms correctly, we can
+ allow them to properly take effect.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ (cherry picked from commit 24042b4e367803dd64f3fcdc1bef7b2bf36c4145)
+
+commit aa8770bf546a58e534ad2d0e0180f7e1013e24e9
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Wed Oct 21 18:33:46 2015 +0900
+
+ xfree86: Re-set current cursor after RandR 1.2 CRTC configuration change
+
+ Add xf86CursorResetCursor, which allows switching between HW and SW
+ cursor depending on the current state.
+
+ Call it from xf86DisableUnusedFunctions, which is called after any CRTC
+ configuration change such as setting a mode or disabling a CRTC. This
+ makes sure that SW cursor is used e.g. while a transform is in use on
+ any CRTC or while there are active PRIME output slaves, and enables HW
+ cursor again once none of those conditions are true anymore.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ (cherry picked from commit b04767c84deafc44993723add4b1c5163fc11711)
+
+commit 870d4e2e6b40f911049a5286d605814d2401741d
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Thu Dec 24 12:56:03 2015 +0900
+
+ xfree86/modes: Check for CRTC transforms in xf86_use_hw_cursor(_argb) (v2)
+
+ We currently don't handle transforms for the HW cursor image, so return
+ FALSE to signal a software cursor must be used if a transform is in use
+ on any CRTC.
+
+ v2: Check crtc->transformPresent instead of crtc->transform_in_use. The
+ latter is TRUE for rotation as well, which we handle correctly.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ (cherry picked from commit a4ffa8721debb34bd36fd4624890d9c26886c618)
+
+commit af87ab62878334ee9d4e75c472fc80178329b4dd
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Thu Dec 24 16:20:49 2015 +0900
+
+ xfree86/modes: Refactor xf86_use_hw_cursor_argb to use xf86_use_hw_cursor (v2)
+
+ This reduces code duplication.
+
+ v2: No functional change this time.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ (cherry picked from commit c3e4e9fc5d84bfc17b3ed63f67488ea25ba150ce)
+
+commit 87c23dc47160d7524b82b60abbc70d285708f7cb
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Tue Feb 23 17:19:03 2016 +0900
+
+ glamor: Source pictures are always depth 32
+
+ We were using the destination pixmap depth to determine the source
+ picture format.
+
+ Fixes incorrect text rendering with some MATE desktop GTK3 themes.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94246
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit a3e681eafa5355b8bb3b099d47983f14f0d5e197)
+
+commit 0220275531552a5400c22b56105257586f390260
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Tue Feb 23 17:19:02 2016 +0900
+
+ glamor: Factor out glamor_set_color_depth from glamor_set_color
+
+ The former takes explicit screen and depth parameters instead of
+ deriving them from a pixmap.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit b05ae79ee3bebef9790c97eedc033d1ffb3ec39a)
+
+commit 79985270f1d63a8b186640b81d0eb142ac532e6e
+Author: Hans de Goede <hdegoede@redhat.com>
+Date: Wed Feb 10 16:40:43 2016 +0100
+
+ glamor: Fix XvPutImage when src_y != 0
+
+ We already take src_y into account when uploading the src data by
+ starting at the top line of the src data when uploading.
+
+ Adjust src_y accordingly when rendering.
+
+ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+ (cherry picked from commit 947e94a341fa153258e9e86060b83af95934672b)
+
+commit ddca8e1647d3b79f803f4080be648e5475055fe8
+Author: Rui Matos <tiagomatos@gmail.com>
+Date: Fri Mar 4 16:24:48 2016 +0100
+
+ build: Enable vidmode independently from Xorg
+
+ This allows building Xwayland without Xorg and still include the
+ vidmode extension.
+
+ v2: Use PKG_CHECK_EXISTS instead of PKG_CHECK_MODULES
+
+ Signed-off-by: Rui Matos <tiagomatos@gmail.com>
+ Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
+ (cherry picked from commit 40a164b8f4e720b0d6ebf228ee175eb397ffeec2)
+
+commit 7680f558e1584a191554658ff7b3b75c75d35e06
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Mar 7 23:20:34 2016 +0100
+
+ xfixes: avoid double free if AddResource fails
+
+ pChc is already freed through CursorFreeHideCount →
+ deleteCursorHideCount.
+
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Signed-off-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit 2be527b1d4ce2b0412c4484539a8c9607645ec6d)
+
+commit b7e1f25005f7b552870fe782fc927c9dc97f5ed0
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Mar 7 23:20:33 2016 +0100
+
+ render: free already allocated formats in PictureInit failure case
+
+ Probably pointless, if this fails you're not likely to get far...
+
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Signed-off-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit 4217db89ecd480fda2ee74fecba06c6713c2a0f0)
+
+commit 518a0c179f99e9ea33e9cd56ce215661d27cabb6
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Mar 7 23:20:32 2016 +0100
+
+ record: don't call RecordDeleteContext when AddResource fails
+
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Signed-off-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit 054f80717812d4781741cd05393623fe6f6c627f)
+
+commit dae9c195a9db4d210855a16efce2037f3af454e1
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Mar 7 23:20:31 2016 +0100
+
+ xwin: no need to free auth data if AddResource fails
+
+ This is taken care of by SecurityDeleteAuthorization
+
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Signed-off-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit d0c1a5bc61a3d151f2234aa3820862f16c0f00c7)
+
+commit 4bbaffc8134a72d4e2dd21d4def1afc9ad29e815
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Mar 7 23:20:30 2016 +0100
+
+ modesetting: avoid double free if AddResource fails
+
+ ms_dri2_frame_event_client_gone or ms_dri2_frame_event_drawable_gone
+ already free the resource.
+
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Signed-off-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit acf263df81ad6813e0233033610fb44521cab1b4)
+
+commit 8616bd95de43aa63c959b0c978f1001ac38c0222
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Mar 7 23:20:29 2016 +0100
+
+ dmx/glxProxy: don't free the glx pixmap twice if AddResource fails
+
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Signed-off-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit 164753f158e78f615f903467bfd234d7c58244ef)
+
+commit dcbf88aea74a00a8e09ffdc4de2b555911eb90fb
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Mar 7 23:20:28 2016 +0100
+
+ glx: don't call pGlxDraw->destroy() if AddResource fails
+
+ AddResource will have called DrawableGone, which takes care of the
+ destruction.
+
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Signed-off-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit 59b9c3d5e4bf05aeaaac2ee4ea12c301a67aae2c)
+
+commit ab197ee9478a0e4e7a276c03645657b4f22ae9c0
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Mar 7 23:20:26 2016 +0100
+
+ xvmc: Fix unchecked AddResource
+
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Signed-off-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit 119d5c0e2f800737c949ef760c5fe25d963200bf)
+
+commit bd022f03143723ac326b39d6e67853650aa1bf1d
+Author: Jonas Ã…dahl <jadahl@gmail.com>
+Date: Tue Mar 8 20:05:33 2016 +0800
+
+ xwayland: Correctly detect whether posix_fallocate exists
+
+ We had HAVE_POSIX_FALLOCATE checks, but no such macros were ever
+ defined anywhere. This commit makes it so that this macro is defined if
+ the posix_fallocate is detected during configure.
+
+ Signed-off-by: Jonas Ã…dahl <jadahl@gmail.com>
+ Reviewed-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit a2c3c34b44b866440a152511e682c98879ee13b7)
+
+commit 23d9b2a566cdaeff71deae9c3a221ebf0cb5f550
+Author: Julien Cristau <jcristau@debian.org>
+Date: Tue Mar 1 21:39:01 2016 +0100
+
+ xv: fix double free in AddResource failure case
+
+ XvdiDestroyVideoNotifyList already frees the list if AddResource fails,
+ so don't do it twice. And set tpn->client to NULL explicitly to avoid
+ confusing uninitialized memory with a valid value.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit 939ce0bae68b682b57675f65c901653c1a094ebb)
+
+commit 90b854b2acc58a9936e9810f58b0bd1973697210
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Mar 1 14:09:30 2016 -0500
+
+ dri1: Fix unchecked AddResource
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ Reviewed-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit 05e1bcf56e1c511a1ef539acfe11e37727e1179e)
+
+commit 0e3cc3d042a2da1ed781f6691dd7aca72d87046b
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Mar 1 14:09:29 2016 -0500
+
+ xv: Fix unchecked AddResource
+
+ Reviewed-by: Julien Cristau <jcristau@debian.org>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit 093f9505c12565cc19bdf6e33b263f31d104c3ef)
+
+commit 3d7bfe02cc3ad0f16403a073f1182d7019c98be3
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Tue Mar 1 17:03:44 2016 +0100
+
+ vidmode: build without xf86vidmodeproto
+
+ git commit f175cf45:
+
+ vidmode: move to a separate library of its own
+
+ introduced a regression where the xserver would not build when
+ xf86vidmodeproto is not installed even if the configure option
+ "--disable-xf86vidmode" is specified.
+
+ Fix build failure when xf86vidmodeproto is not installed.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit ac4d8c7cee13947b688ebb26035f06f7744db201)
+
+commit a49e7b9c2ebeb2e2ccb922265798234a8ce9d242
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Mon Feb 8 17:48:26 2016 +0100
+
+ xwayland: fix a crash on output removal
+
+ On output removal, the CRTC that was added in xwl_output_create()
+ is not removed in xwl_output_destroy() and would cause a segmentation
+ fault later on in ProcRRGetMonitors():
+
+ (EE) Segmentation fault at address 0x100000001
+ (EE)
+ (EE) 10: ? (?+0x29) [0x29]
+ (EE) 9: /usr/bin/Xwayland (_start+0x29) [0x423299]
+ (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7fdd80e7f580]
+ (EE) 7: /usr/bin/Xwayland (dix_main+0x3b3) [0x544ef3]
+ (EE) 6: /usr/bin/Xwayland (Dispatch+0x31e) [0x54109e]
+ (EE) 5: /usr/bin/Xwayland (ProcRRGetMonitors+0x9b) [0x4ca18b]
+ (EE) 4: /usr/bin/Xwayland (RRMonitorMakeList+0x269) [0x4c9ba9]
+ (EE) 3: /usr/bin/Xwayland (RRMonitorSetFromServer+0x118) [0x4c9198]
+ (EE) 2: /usr/bin/Xwayland (MakeAtom+0x30) [0x530710]
+ (EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7fdd80e93b1f]
+ (EE) 0: /usr/bin/Xwayland (OsSigHandler+0x29) [0x5792d9]
+
+ Remove the output CRTC in xwl_output_destroy() to avoid the crash.
+
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ Reviewed-by: Daniel Stone <daniels@collabora.com>
+ (cherry picked from commit 2116f03be04240e961649ca750a7aa5438b8446c)
+
+commit c7735f102aa9daa604f304f2e8a2131fcdd652e8
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Thu Feb 18 17:33:19 2016 +0900
+
+ present: Call present_restore_screen_pixmap from present_set_abort_flip
+
+ After present_set_abort_flip, the screen pixmap will be used for all
+ screen drawing, so we need to restore the current flip pixmap contents
+ to the screen pixmap here as well.
+
+ Improves flashing / stutter e.g. when something like a popup menu appears
+ on top of a flipping fullscreen window or when switching out of
+ fullscreen.
+
+ Note that this means present_set_abort_flip now relies on screen->root
+ being non-NULL, but that's already the case in other present code.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+ (cherry picked from commit 1bee4e254ca0305cb23e574b4c8b250d276ee998)
+
+commit 05d9de4e9ac515176f41f9fd649935ae990d8fb3
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Thu Feb 18 17:20:45 2016 +0900
+
+ present: Factor code for restoring screen pixmap out of present_unflip (v2)
+
+ The following fix will use the refactored function.
+
+ The logic in the refactored function is slightly simplified, exploiting
+ the fact that this function is only ever called with a valid flip
+ pixmap.
+
+ v2: Assert that flip_pixmap is non-NULL instead of testing and bailing
+ on NULL, preserve test for flip_window being non-NULL before calling
+ present_set_tree_pixmap for it (Keith Packard)
+
+ Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ (cherry picked from commit 4611e902c291b8a789f374cff3300f74645bc2b2)
+
+commit 49b2a0fb0e6ae0793171b5dbfe517fe06647c06d
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Thu Feb 18 18:23:47 2016 +0900
+
+ present: Only update screen pixmap from flip pixmap once per unflip
+
+ present_unflip may be called several times from present_check_flip_window
+ during the same unflip. We can only copy to the screen pixmap the first
+ time, otherwise we may scribble over other windows. The flip pixmap
+ contents don't get updated after the first time anyway.
+
+ Fixes at least the following problems, which were introduced by commit
+ 806470b9 ("present: Copy unflip contents back to the Screen Pixmap"):
+
+ On xfwm4 without compositing, run glxgears and put its window into
+ fullscreen mode to start flipping. While in fullscreen, open the xfwm4
+ window menu by pressing Alt-Space. The window menu was invisible most
+ of the time because it was getting scribbled over by a repeated unflip
+ copy.
+
+ When switching a flipping window out of fullscreen, a repeated unflip
+ copy could leave artifacts of the flip pixmap on the desktop.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94325
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+ (cherry picked from commit 72328e5eb98a3f27e1f0a0e17beae6db447bd87c)
+
+commit d5b8bc69e2652d8b9b13065b6528d2e8b8188b57
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Tue Dec 8 12:52:17 2015 +0900
+
+ dri3: Refuse to work for remote clients (v2)
+
+ Prevents clients forwarded via SSH from hanging while waiting for the
+ reply from the DRI3Open request.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261
+
+ v2: Return BadMatch instead of BadRequest (Keith Packard)
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ (cherry picked from commit 43eb5b6047c9b35c337e553ec054f08bdc835abb)
+
+commit 15454c5d26b00931b2099ccc6da356a1e5b6f88c
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Wed Feb 10 09:35:39 2016 +0100
+
+ xwayland: add partial xvidmode extension support
+
+ Older games (mostly those based on SDL 1.x) rely on the XVidMode
+ extension and would refuse to run without.
+
+ Add a simple, limited and read-only xvidmode support that reports the
+ current mode used so that games that rely on xvidmode extension can run
+ on XWayland.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit 6070a749d953951bacbfb149c5c36451293aad35)
+
+commit f2b346f9ba86ba304baac5ed29f8caf3fefbdba0
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri Feb 5 09:48:25 2016 +0100
+
+ vidmode: remove redundant DIX function
+
+ The API signature of the DIX xf86VidModeGetGammaRampSize() is now
+ identical to the xf86cmap's xf86GetGammaRampSize() and all it does is
+ actually call xf86GetGammaRampSize() so we can save one vfunc.
+
+ Remove uneeded xf86VidModeGetGammaRampSize() function.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit b430f53bb753f9b064ab62d014820c1c3c76a841)
+
+commit d381d59e44f675d01ca9ecab5a58c4864ae56c29
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri Feb 5 09:48:24 2016 +0100
+
+ vidmode: remove redundant check
+
+ The DIX already checks for VidModePrivateKey to get the vfunc, so
+ checking for this again in the DDX is redundant.
+
+ Remove the redundant function xf86VidModeAvailable() from the DDX.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit 48fccde2bfb60efdbf45a96fa53bcd9a6570bf89)
+
+commit 349b71a37e4a87e3650b5c0df9651b2ce967293e
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Wed Feb 10 09:34:34 2016 +0100
+
+ vidmode: move to a separate library of its own
+
+ XVidMode extension might be useful to non hardware servers as well (e.g.
+ Xwayand) so that applications that rely on it (e.g. lot of older games)
+ can at least have read access to XVidMode.
+
+ But the implementation is very XFree86 centric, so the idea is to add
+ a bunch of vfunc that other non-XFree86 servers can hook up into to
+ provide a similar functionality.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit f175cf45aebcdda53f3ae49c0eaf27da1f194e92)
+
+commit 860669b1867178fe46df9da98591ea5a47f427f1
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri Feb 5 09:48:22 2016 +0100
+
+ vidmode: rename DDX functions
+
+ To avoid confusion as to what belongs on the DDX and what not.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit 17097e083b2392c8989474f6e0da8cc234329e9c)
+
+commit 64053645cfd950bb0b6c3fda8deb60e1e540ce69
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri Feb 5 09:48:21 2016 +0100
+
+ vidmode: move display mode definitions
+
+ To be able to reuse the VidMode extension in a non-hardware server, the
+ display mode definitions need to be accessible from DIX.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit ddfb8c009ac651209eb0087aaf86b54e1446e8b2)
+
+commit 227b533bf414e03e9a73d0d9e47a761fc597c360
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri Feb 5 09:48:20 2016 +0100
+
+ vidmode: remove mode access from public API
+
+ The mode access functions (namely VidModeCreateMode(),
+ VidModeCopyMode(), VidModeGetModeValue() and VidModeSetModeValue()) are
+ used only in xf86VidMode code and do not need to be available anywhere
+ else.
+
+ Remove these functions from the public VidMode API and move them as
+ static where they are used.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit e29a64de662112b8ebcd3f20c89df0e8c51890ef)
+
+commit 9824faaa58efe55a372d7dd0f6c5cbf84e77af61
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri Feb 5 09:48:19 2016 +0100
+
+ vidmode: use appropriate DisplayModePtr type
+
+ The API uses an untyped pointer (void *) where a DisplayModePtr is
+ expected.
+
+ Clean up the API to use the appropriate type, as DisplayModePtr is
+ really all that will be passed there.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit b7962ade5265a21ac7c60da6cc07ece15ef7e648)
+
+commit 3b52aee6dddc2cd2780f729e9389a1515c544c61
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri Feb 5 09:48:18 2016 +0100
+
+ vidmode: remove VidModeGetMonitor()
+
+ VidModeGetMonitor() is used solely in ProcXF86VidModeGetMonitor() to
+ get a untyped monitor pointer that is passed back straight again to
+ VidModeGetMonitorValue().
+
+ This is actually useless as VidModeGetMonitorValue() could as well get
+ the monitor from the ScreenPtr just like VidModeGetMonitor() does.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit 12f714fd95dc9d912c0bf2524005a73ec6e8ee4f)
+
+commit b241fd6413775f76a5faaea0f685a8294322e2fc
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri Feb 5 09:48:17 2016 +0100
+
+ vidmode: use ScreenPtr instead of screen index
+
+ New code passes ScreenPtr instead of the screen index.
+
+ Change the VidMode functions to take a ScreenPtr.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit f6f7e21133c13c34f306a191137d566e83b40929)
+
+commit 2028b9066ddbbeaf585e154d19c2672cccdda9bb
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri Feb 5 09:48:16 2016 +0100
+
+ vidmode: get rid of the CloseScreen wrapper
+
+ As we rely on dixRegisterPrivateKey() to allocate the memory for us that
+ will be free automatically, we do not need the CloseScreen wrapper
+ anymore.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit 6e898ef080df93e885ead9d6fee8854b34e0216f)
+
+commit cb3a8768db1b7b2f98f62e3075aa0dd2a46edd9d
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri Feb 5 09:48:15 2016 +0100
+
+ vidmode: use appropriate API
+
+ dixRegisterPrivateKey() can allocate memory that will be freed when the
+ screen is teared down.
+
+ No need to calloc() and free the memory ourself using a broken ref
+ counting method.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit 341f3bccafde71754a9ed2303df9908e509c6d31)
+
+commit 45d17e6bb0ee35662913cd6ce378460aa7e461cc
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Fri Feb 12 11:59:53 2016 +0000
+
+ dri2: Allow many blocked clients per-drawable
+
+ This patch was motivated by the need to fix the use-after-free in
+ dri2ClientWake, but in doing so removes an arbitrary restriction that
+ limits DRI2 to only blocking the first client on each drawable. In order
+ to fix the use-after-free, we need to avoid touching our privates in the
+ ClientSleep callback and so we want to only use that external list as
+ our means of controlling sleeps and wakeups. We thus have a list of
+ sleeping clients at our disposal and can manage multiple events and
+ sources.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+ (cherry picked from commit d8882954570aba656d5a7be7d357feaba21cb099)
+
+commit 204e85786f24c1ab734ab9ee015efbb790dee130
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Fri Feb 12 11:59:52 2016 +0000
+
+ dix: Add ClientSignalAll()
+
+ This is a variant of ClientSignal() that signals all clients with an
+ optional matching sleeping client, function and closure.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+ (cherry picked from commit bc3634010c096dffd1935c0c6cf8ba37534ae3d8)
+
+commit c06a4b4a2422e937eda36a4ec10bdafc71001be7
+Author: Jon Turney <jon.turney@dronecode.org.uk>
+Date: Tue Aug 11 15:45:57 2015 +0100
+
+ xwin: Add SKIPTASKBAR hint to _NET_WM_WINDOW_TYPE_DOCK type windows
+
+ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+ (cherry picked from commit f7d1e5acdf5ed4ab4ed5c18727aa6f3d379ef560)
+
+commit 6f099c7bd59039834c7b45289310b003b81cb3e3
+Author: Jon Turney <jon.turney@dronecode.org.uk>
+Date: Thu Jul 2 19:21:11 2015 +0100
+
+ xwin: In multiwindow mode, look up the HWND for the parent window
+
+ Rather than only looking at the foreground window to see if it matches
+ the WM_TRANSIENT_FOR window XID, lookup that XID and fetch the HWND from
+ the window privates.
+
+ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+ (cherry picked from commit e7f87f8f76e5ac9479a71e3daf2cfdefd4b5f684)
+
+commit 41cbb7da4e9337d4136d378f5fa45365f41f02e4
+Author: Jon Turney <jon.turney@dronecode.org.uk>
+Date: Mon Feb 22 17:41:14 2016 +0000
+
+ xwin: Keyboard layout updates
+
+ layout zh_TW doesn't exist (anymore), try something else for that.
+
+ layout it variant mac doesn't seem to exist anymore, try to handle
+ Macintosh keyboards (running under Parallels on Mac) and other oddities
+ in a more generic way, by falling back to matching only on the language
+ identifer part of the input locale identifer.
+
+ v2:
+ Fix typo of 0xa0000 for 0xa000
+
+ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+ (cherry picked from commit 8c2006ddc5abbd4ac374dabf1cfdd3df8fc88779)
+
+commit da7745065ee27d62cc2eba4e860118459917dad9
+Author: Colin Harrison <colin.harrison@virgin.net>
+Date: Wed Nov 19 22:33:39 2014 +0000
+
+ xwin: Add a tentative entry for the Korean keyboard to the list of known keyboard layouts
+
+ Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
+ Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
+ (cherry picked from commit 8c97a0078e7fe22e6159fa53490dfca2f4d267a9)
+
+commit c1eb12f89c2391cd99a834da6b342f104da1eb5c
+Author: Jon Turney <jon.turney@dronecode.org.uk>
+Date: Tue Feb 10 14:36:37 2015 +0000
+
+ xwin: Update to XRANDR 1.2 internal interface to ensure an output is reported by XRANDR
+
+ If using the X server internal XRANDR 1.0 interface, it seems we must
+ register a display size with RRRegisterSize() in order to make
+ RRGetInfo() call RRScanOldConfig() to generate an output and crtc for
+ us.
+
+ Without this, the following GDM bug means that an XDMCP session to GDM
+ cannot be started.
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=736054
+
+ Instead, use the more recent XRANDR 1.2 internal interface to explicitly
+ create the output and crtc, and maintain a single mode which represents
+ the current display size.
+
+ Also don't emit a RRScreenSizeNotify when a RRScreenSizeSize is done
+ which has no effect, this seems to throw the GDM greeter into a loop...
+
+ v2: Maintain reference count for the mode we maintain more correctly, to
+ avoid double free causing a crash on shutdown
+
+ Connect crtc to output, so a subsequent RRSetCrtcConfig request doesn't
+ change anything, so we don't fail due to our lack of rrSetConfig or
+ rrCrtcSet hooks.
+
+ See https://cygwin.com/ml/cygwin-xfree/2015-02/msg00032.html
+
+ v3:
+ Raise limit on X display size from 4Kx4K to 32Kx32K
+
+ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+ (cherry picked from commit a4d8a64c4ba467964476c4a1486da698bd6aed9e)
+
+commit 771a668188793e7261ae2cbf7d7289b8a133316a
+Author: Jon Turney <jon.turney@dronecode.org.uk>
+Date: Sat Oct 18 17:31:57 2014 +0100
+
+ xwin: Use WM_CLIPBOARDUPDATE clipboard API
+
+ Windows Vista and later have a saner clipboard API where the clipboard
+ viewer linked list is no longer maintained by applications. Use it
+ where available.
+
+ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+ (cherry picked from commit 008efebda801b9b80e2ab3f2c95aeef8c82102ee)
+
+commit 00199e8c822fcf6a933637410e44e08ac659f682
+Author: Jon Turney <jon.turney@dronecode.org.uk>
+Date: Wed Jul 9 14:26:54 2014 +0100
+
+ xwin: Check that window position is visible on non-rectangular virtual desktops
+
+ Improve the check that window position is visible to work correctly for
+ non-rectangular virtual desktops
+
+ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+ (cherry picked from commit de7f1fd6f8f10f07b366ae5428a8c65a224bda98)
+
+commit 0fb47bd27919a7f1e47db3bd3f97fd9a07ccc517
+Author: Jon Turney <jon.turney@dronecode.org.uk>
+Date: Thu May 8 11:40:39 2014 +0100
+
+ xwin: Correctly interpret WM_HINTS, WM_NORMAL_HINTS properties on x86_64
+
+ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+ (cherry picked from commit a9e73131b6453e0fa2da5360e84af7a2eae3b205)
+
+commit 1e143cff16835dd69559ca5646f313dad3db75ab
+Author: Jon Turney <jon.turney@dronecode.org.uk>
+Date: Thu Mar 13 18:04:17 2014 +0000
+
+ xwin: Improve handling of no-decoration motif hint
+
+ When motif decoration hint asks for no decoration, don't add sysmenu,
+ mimimize or maximimize controls.
+
+ (This fixes a problem with e.g. fbpanel having a minimize control, but
+ gtk's panel_configure_event() doesn't like the state we put the window
+ into when we minimize it, causing it to spin)
+
+ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+ (cherry picked from commit d7cef6fbe23381b31c163468f349feee2f1b1eba)
+
+commit f0c2a3527797cf2bfbfa4697c294ae087c1e4423
+Author: Jon Turney <jon.turney@dronecode.org.uk>
+Date: Fri Mar 28 16:57:48 2014 +0000
+
+ xwin: XGetWMNormalHints() returns non-zero on success
+
+ XGetWMNormalHints() doesn't actually return a Status value. On success
+ it returns a non-zero value, not Success.
+
+ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+ (cherry picked from commit f75404be3ad94c8da493688397712c65ea66cb90)
+
+commit e457e93e5d33cbec387e40051fbabf6cf76d6af3
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Wed Feb 24 16:52:59 2016 +0900
+
+ present: Only requeue if target MSC is not reached after an unflip
+
+ While present_pixmap decrements target_msc by 1 for present_queue_vblank,
+ it leaves the original vblank->target_msc intact. So incrementing the
+ latter for requeueing resulted in the requeued presentation being
+ executed too late.
+
+ Also, no need to requeue if the target MSC is already reached.
+
+ This further reduces stutter when a popup menu appears on top of a
+ flipping fullscreen window.
+
+ Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit b4ac7b142fa3c536e9b283cfd34b94d82c03aac6)
+
+commit eb5108b87017128f394ae31b5b7cd85dd8819bca
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Wed Feb 24 16:52:58 2016 +0900
+
+ present: Requeue if flip driver hook fails and target MSC not reached
+
+ For flipping, we wait for the MSC before the target MSC and then call
+ the driver flip hook. If the latter fails, we have to wait for the
+ target MSC before falling back to a copy, or else it's executed too
+ early.
+
+ Fixes glxgears running at unbounded framerate (not synchronized to the
+ refresh rate) in fullscreen if the driver flip hook fails.
+
+ Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit e7a35b9e16aa12970908f5d55371bb1b862f8f24)
+
+commit cf30b7cfd6d91da16c762332617fc165d82f17d2
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Wed Feb 24 16:52:57 2016 +0900
+
+ present: Move msc_is_(equal_or_)after to the top of present.c
+
+ To make them usable from any other function in the file. No functional
+ change.
+
+ Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit 1a9f8c4623c4e6b6955cb6d5f44d29c244dfd32a)
+
+commit 8869f45a965a7b12bb7fe03ba226167e1f821c1e
+Author: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
+Date: Mon Feb 22 16:04:12 2016 -0300
+
+ kdrive/evdev: update keyboard LEDs (#22302)
+
+ Implement missing parts in kdrive evdev driver for
+ correct update of evdev keyboard LEDs.
+
+ Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=22302
+
+ [ajax: Fixed deref-before-null-check bug]
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
+ (cherry picked from commit 0461bca0cb2f7918c77ed45d2cbc756cf65021be)
+
+commit 05f3cf659be44caf00e801a5bcd9362a1a87aa46
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Mon Feb 22 16:20:00 2016 +0000
+
+ Fix build on Cygwin by ensuring WIN32 check triggers only on MinGW
+
+ The type of fd_mask was changed in Cygwin 2.4.0 headers from 'long' to
+ 'unsigned long'. This exposes an existing problem with winauth.c, which
+ includes Xwindows.h (which includes windows.h, which defines WIN32),
+ before including osdep.h, which causes the now conflicting definition of
+ fd_mask in osdep.h to be exposed:
+
+ In file included from ../os/osdep.h:198:18: error: conflicting types for
+ ‘fd_mask’ typedef long int fd_mask; /usr/include/sys/select.h:46:23:
+ note: previous declaration of ‘fd_mask’ was here typedef unsigned long
+ fd_mask;
+
+ Adjust the include guards in osdep.h to make sure we only use WIN32
+ guarded code when not compiling for Cygwin (i.e. WIN32 && !__CYGWIN__)
+
+ This isn't a very elegant, but unfortunately appears to be the best
+ solution, since it doesn't seem to be possible to write the test in a
+ positive form.
+
+ Future work: Should also audit of all the other uses of WIN32 in
+ xserver, and make sure they are correct.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
+ (cherry picked from commit 30b7d7995ef70b7473e0fb170eb8ae23b8d1f4a7)
+
+commit 10e46504711427ed5280fdeb974a08b888f47034
+Author: Jonas Ã…dahl <jadahl@gmail.com>
+Date: Fri Feb 19 15:08:12 2016 +0800
+
+ xwayland: Prefix shm tmp file names with xwayland
+
+ Prefix the temporary file names used for allocating pixmaps with
+ "xwayland-" instead of "weston-". This makes it less confusing while
+ looking at the file names of the currently open fds of the Xwayland
+ process.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Jonas Ã…dahl <jadahl@gmail.com>
+ (cherry picked from commit 544b4149268561d3d794aa540172831fa7550a20)
+
+commit de7f91c079d7168c107bb8b8dbe651eebd8e9a12
+Author: Marc-Andre Lureau <marcandre.lureau@gmail.com>
+Date: Fri Feb 12 22:52:07 2016 +0100
+
+ dri2: add virtio-gpu pci ids
+
+ Add virtio-gpu legacy + 1.0 pci ids, allowing them to use
+ modesetting + glamor with dri2.
+
+ Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit 5627708e5f447d0e360bbc9eb8d1c4e58c5046d0)
+
+commit 16573a4c35cb71f204b37ad1c3b3d115e84b2cd8
+Author: Daniel Stone <daniels@collabora.com>
+Date: Fri Feb 12 16:36:59 2016 +0000
+
+ dix: Add hybrid full-size/empty-clip mode to SetRootClip
+
+ 216bdbc735 removed the SetRootClip call in the XWayland output-hotplug
+ handler when running rootless (e.g. as a part of Weston/Mutter), since
+ the root window has no storage, so generating exposures will result in
+ writes to invalid memory.
+
+ Unfortunately, preventing the segfault also breaks sprite confinement.
+ SetRootClip updates winSize and borderSize for the root window, which
+ when combined with RRScreenSizeChanged calling ScreenRestructured,
+ generates a new sprite-confinment area to update it to the whole screen.
+
+ Removing this call results in the window geometry being reported
+ correctly, but winSize/borderSize never changing from their values at
+ startup, i.e. out of sync with the root window geometry / screen
+ information in the connection info / XRandR.
+
+ This patch introduces a hybrid mode, where we update winSize and
+ borderSize for the root window, enabling sprite confinement to work
+ correctly, but keep the clip emptied so exposures are never generated.
+
+ Signed-off-by: Daniel Stone <daniels@collabora.com>
+ Tested-by: Olivier Fourdan <ofourdan@redhat.com>
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit e957a2e5dd288f515f3e93724823542c20333f6a)
+
+commit 29d1c5a8e4127d5fd1a0d41f8e1474e9dfdb9638
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Feb 16 20:03:57 2016 -0800
+
+ randr: Send ConfigNotify when manual monitor list changes
+
+ This lets clients know that the layout of the monitors on the screen
+ has changed so they can adapt appropriately.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit dbe8d03c42f01332b3dc41fe9290aed142f1436f)
+
+commit fc3eef6024355206ea429eb5e2d36001fa47a884
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Feb 10 11:13:04 2016 -0500
+
+ dri2: Use the work queue to manage client sleeps
+
+ In commit e43abdce964f5ed9689cf908af8c305b39a5dd36
+ Author: Chris Wilson <chris@chris-wilson.co.uk>
+ Date: Wed Feb 3 09:54:46 2016 +0000
+
+ dri2: Unblock Clients on Drawable release
+
+ we try to wake up any blocked clients at drawable destruction. But by
+ the time we get there, CloseDownConnection has already torn down state
+ that AttendClient wants to modify.
+
+ Using ClientSleep instead of IgnoreClient puts a wakeup function on a
+ workqueue, and the queue will be cleared for us in CloseDownClient
+ before (non-neverretain) resource teardown.
+
+ Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit eddf848c44349c7ebc7da9957bffb3630f3faaa9)
+
+commit 9db37e05a96d1488b7cb30b7e1ccd4c73b38d915
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Feb 3 09:54:46 2016 +0000
+
+ dri2: Unblock Clients on Drawable release
+
+ If the Window is destroyed by another client, such as the window
+ manager, the original client may be blocked by DRI2 awaiting a vblank
+ event. When this happens, DRI2DrawableGone forgets to unblock that
+ client and so the wait never completes.
+
+ Note Present/xshmfence is also suspectible to this race.
+
+ Testcase: dri2-race/manager
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
+ Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+ (cherry picked from commit e43abdce964f5ed9689cf908af8c305b39a5dd36)
+
+commit 7be0e08cd91ed4be18eefb04018be36dcf0f427e
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Dec 9 09:10:13 2015 -0500
+
+ autogen: Set a default subject prefix for patches
+
+ Per discussion at XDC2015, we want this so we can easily distinguish
+ which module a patch is for. There's no way to set this in the
+ server-side config, so setting a default at autogen time is about the
+ best we can do.
+
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit a722d617a092f08f69086630f5cfb598d4a21cc7)
+
+commit c388b2d52177eb7f66a63a8454cee1990b4813d9
+Author: Jan Burgmeier <jan.burgmeier@unicon-software.com>
+Date: Thu Feb 4 14:06:43 2016 +0100
+
+ Fix XineramaQueryScreens for reverse prime
+
+ Make sure we account for slave CRTCs when building the monitor list,
+ since that's what rrxinerama uses to fake Xinerama geometry.
+
+ [ajax: Slightly more informative commit message.]
+
+ Bugzilla: https://bugs.freedesktop.org/92313
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit 7bb64d8c1de9659f11da7917772919b071e9db82)
+
+commit 18155405875608f3a46db465aa9753d66b099f8e
+Author: Rui Matos <tiagomatos@gmail.com>
+Date: Wed Feb 3 16:14:09 2016 +0100
+
+ xwayland: Clear pending cursor frame callbacks on pointer enter
+
+ The last cursor frame we commited before the pointer left one of our
+ surfaces might not have been shown. In that case we'll have a cursor
+ surface frame callback pending which we need to clear so that we can
+ continue submitting new cursor frames.
+
+ Signed-off-by: Rui Matos <tiagomatos@gmail.com>
+ Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
+ Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
+ Reviewed-by: Daniel Stone <daniels@collabora.com>
+ Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com>
+ (cherry picked from commit 87d5534f701242d7c23aa20545a6292a0779c89c)
+
+commit eac170e469cb66a7e5a47d00c56ddc53c63cca85
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Feb 3 09:54:43 2016 +0000
+
+ dri2: Only invalidate the immediate Window upon SetWindowPixmap
+
+ All callers of SetWindowPixmap will themselves be traversing the Window
+ heirarchy updating the backing Pixmap of each child and so we can forgo
+ doing the identical traversal inside the DRI2SetWindowPixmap handler.
+
+ Reported-by: Loïc Yhuel <loic.yhuel@gmail.com>
+ Link: http://lists.x.org/archives/xorg-devel/2015-February/045638.html
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
+ Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+ (cherry picked from commit b7d392931a309d0fe754869efb456ccd0385f3aa)
+
+commit 2fc1752ac39a9325dbc5f8e700fc566ea6f8240f
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Jan 27 11:26:16 2016 -0800
+
+ glamor: Flip around conditionals in RepeatNone fixups.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 2c3e8768443caa66d78775ea79bb16a5faae3a3c)
+
+commit 4acebf257e37e075a14b3acecce27d050b18bba8
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Jan 27 11:21:05 2016 -0800
+
+ glamor: Cut down a bunch of conditional handling for RepeatFix.
+
+ For hardware that doesn't do actual jumps for conditionals (i915,
+ current vc4 driver), this reduces the number of texture fetches
+ performed (assuming the driver isn't really smart about noticing that
+ the same sampler is used on each side of an if just with different
+ coordinates).
+
+ No performance difference on i965 with x11perf -magpixwin100 (n=40).
+ Improves -magpixwin100 by 12.9174% +/- 0.405272% (n=5) on vc4.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit e82c8c81df80de487aa795d69e874a0811c537ea)
+
+commit d1c0873228a115ee0ebf46afaf335b8b97a5bbdc
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Jan 27 11:15:27 2016 -0800
+
+ glamor: Clarify how the repeat values being passed around work.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 2c3273861cdf874b165ce5a1953102187f71b48e)
+
+commit b0b160aafc151b1fdf1840134bc344e3ce2f3e85
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Jan 27 11:10:14 2016 -0800
+
+ glamor: Clean up formatting of RepeatFix shader code.
+
+ All sorts of weird indentation, and some cuddled conditional
+ statements deep in the if tree.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 990a8ee01324332ee9b4a4bb124ce8f73be24349)
+
+commit 12e4e3ac31b05b501df74c4fa37274830e30662a
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Jan 27 10:24:17 2016 -0800
+
+ glamor: Clarify some logic in RepeatFix handling.
+
+ wh ratios are != 1.0 only when large, so with that we can simplify
+ down how we end up with RepeatFix being used.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 20cb5b2d65ce63ea7934b77f1520387550c778a8)
+
+commit d5c9c541c5d325453ddb9ebcdcf36bc6ef0af4aa
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jan 26 17:29:48 2016 -0800
+
+ glamor: Simplify the pixmap box looping.
+
+ We had a double loop across h and w, and passed the current x and y
+ out to callers who then used w to multiply/add to an index. Instead,
+ just single loop across w * h.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 07f0d90e4a8b05ef968b1ef47acda7c9f4580340)
+
+commit 68bd172432de069aa242d21b3af505867417ae45
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jan 26 15:56:27 2016 -0800
+
+ glamor: Reuse the glamor_program_alpha_* enums for Render.
+
+ This is a step toward using glamor_program.c for Render acceleration.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 0dbce65b08f4812dcaa4b77cd37aebac334c47a2)
+
+commit 6a71251b3985d6dd7c1ab1fa6e13f1edaa33a5c5
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jan 26 15:47:01 2016 -0800
+
+ glamor: Drop extra SHADER_IN type for no mask present.
+
+ We can just hand in a constant mask and the driver will optimize away
+ the multiplication for us.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 9b676786de32f06aedf9d4c9535c10fda247335a)
+
+commit 2db5bf7a1297a84e516ce87b24dd3982e7674bb2
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jan 26 15:19:50 2016 -0800
+
+ glamor: Convert XV to using glamor_program.c.
+
+ One less custom path! By following the common glamor_program.c use
+ pattern, we get the ability to handle large pixmaps as the
+ destination. It's also one less place where glamor_utils.h coordinate
+ transformation happens.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 03f34f85563c81e1655626e10f75fd7e21393c92)
+
+commit 9be8478467fc4827ca8edc035f0a6d1cca78fbe0
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jan 26 14:52:08 2016 -0800
+
+ glamor: Simplify XV vertex setup.
+
+ We were clipping the drawn rectangle to each clip box, then expanding
+ the box to a big triangle to avoid tearing, then drawing each triangle
+ to the destination through a scissor. If we're using a scissor for
+ clipping, though, then we don't need to clip the drawn primitive on
+ the CPU in the first place.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit f368a0ba3aa58e5260d839d11d2f3aef75feaeaf)
+
+commit d23fe3229c17cb0dfb4210041efbdc36fc365dad
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jan 26 14:18:48 2016 -0800
+
+ glamor: Set up XV sampler uniforms once at program build time.
+
+ No sense doing it on every draw.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 294e45b60d99cf7d11c657288bbe2670b56775f3)
+
+commit ef993dbbed24f1fe68fd4c66f0035e6c74cde10d
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jan 26 13:39:18 2016 -0800
+
+ glamor: Drop dead glamor_pict_format_is_compatible().
+
+ This hasn't been used since 2f80c7791bb0b11f261cb1e3e0d89163dcdd0342
+ (GLAMOR_SEPARATE_TEXTURE removal).
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 5d7bef2eedfd965359dd4eebb6ab806cdad5b83f)
+
+commit f031c5edbf36a029800d0f8574aea226a4b5b82f
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jan 26 15:08:17 2016 -0800
+
+ glamor: Drop comment about dead yInverted flag.
+
+ Wait long enough, and you don't need to think about it at all.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 4494a450405cf539743cbcfe6907bf5bdd2d80cb)
+
+commit f1a03379c44c467b92753748165380e33e2e28c8
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jan 26 13:34:00 2016 -0800
+
+ glamor: Rename the *y_inverted helpers to not say "inverted".
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit f7c24e6ac345aab91df5fc959f239a33f37113b1)
+
+commit 83395e6a99c0665490948c92da9bd768954f8c9e
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jan 26 13:31:59 2016 -0800
+
+ glamor: Drop dead *_from_x_coord_y() functions.
+
+ They've been dead since the yInverted removal
+ (e310387f443b6333edf02c8980daa303505382b4).
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 1fcb6f4cbf3d6514716435a0e79c0e6d53c31a3a)
+
+commit 558ea399664b767c3f9c1acc18f4b2d341d6929c
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jan 21 16:01:14 2016 -0800
+
+ glamor: Clarify when Render fallbacks happen due to an unsupported op.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 9ef11f13af7f552dadb4a90c248e525a257e0a2c)
+
+commit 7c63e80e3f9de3d1b8132a40be6f932e772e0d69
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Jan 27 11:35:03 2016 -0800
+
+ glamor: Label programs before linking them.
+
+ i965 does most of its compiling at link time, so our debug output for
+ its shaders didn't have the name on.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit b8229cc5f5298a37a4735dd002b0e0ebfc8bc75a)
+
+commit 14e2b6f9d87921b39c0874e1a74dff2f9e396f78
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Jan 27 16:11:17 2016 -0800
+
+ ephyr: Make sure we have GLX_ARB_create_context before calling it.
+
+ This should fix aborts()s from epoxy on old software stacks.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+ (cherry picked from commit 68f236ebd4b268a9e525d623986999d230feb453)
+
+commit cd9ae6d1a259f3229df4c110903658d1bede8554
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Dec 8 17:41:37 2015 -0500
+
+ xfree86: Build parser for DRI config file subsection unconditionally
+
+ This applies regardless of which DRI you're asking for. Worse, leaving
+ it out means breaking the config file syntax in a pointless way, since
+ non-DRI servers can safely just parse it and ignore it.
+
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit 953b71270cf12c59c8a836c9be403d07fb01fa22)
+
+commit 3da08902dd5961ea6f70431fce813f294d0f8547
+Author: Dave Airlie <airlied@redhat.com>
+Date: Wed Jan 27 16:46:06 2016 -0800
+
+ ephyr: catch X errors if we try to create a core context and fail.
+
+ This stops Xephyr failing on GLXBadFBConfig.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit d8ecbe563991cc689e95a8cb9d510e920eaceea0)
+
+commit 4c6ca0aae5a301140eadc97313be954bd6a5fe18
+Author: Dave Airlie <airlied@redhat.com>
+Date: Tue Jan 19 08:06:25 2016 +1000
+
+ xwayland: add support for use core profile for glamor. (v2)
+
+ This adds support to Xwayland to try and use OpenGL core
+ profile for glamor first.
+
+ v1.1: use version defines.
+ v2: let glamor work out core profile itself.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ (cherry picked from commit 6978c8ee666a9224213173e7680e2d71b1094bab)
+
+commit b0fa782081f933e84f068228ca35fa5c25c9a4b3
+Author: Dave Airlie <airlied@redhat.com>
+Date: Tue Jan 19 07:59:59 2016 +1000
+
+ glamor: add core profile support to EGL glamor. (v2)
+
+ v1.1: use version defines.
+ v2: let glamor work it out itself
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ (cherry picked from commit 79c3925532bc0d098c9a4da6d5117bdada56e0af)
+
+commit 181ea41e71934a0c575322a8be9234f2e64ef8db
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Sep 10 19:05:08 2014 -0700
+
+ ephyr: Create 3.1 core profile context if possible (v3)
+
+ On desktop GL, ask for a 3.1 core profile context if that's available,
+ otherwise create a generic context.
+
+ v2: tell glamor the profile is a core one.
+ v2.1: add/use GL version defines
+ v3: let glamor work out core itself
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ (cherry picked from commit 98c3504dcfcec227b9c7798a0bd287941cec0691)
+
+commit d7f03d57454de989025de2a2ef644d43eead9ddf
+Author: Dave Airlie <airlied@redhat.com>
+Date: Mon Jan 11 14:00:35 2016 +1000
+
+ glamor: add core profile support. (v2)
+
+ Glamor works out from the profile if it is
+ core.
+
+ This flag is used to disable quads for rendering.
+
+ v1.1: split long line + make whitespace conform (Michel)
+ v1.2: add GL 3.1 version defines
+ v2: move to having glamor work out the profile.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ (cherry picked from commit 564d9f0f8c17bb3c13aa3ca36da7825454dc5de3)
+
+commit 0cd5b9525a8f661c6b2545c21ce1ba21577c009e
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Sep 10 19:02:55 2014 -0700
+
+ glamor: Use GL_RED instead of GL_ALPHA if we have texture_swizzle (v3)
+
+ GL_RED is supported by core profiles while GL_ALPHA is not; use GL_RED
+ for one channel objects (depth 1 to 8), and then swizzle them into the
+ alpha channel when used as a mask.
+
+ [airlied: updated to master, add swizzle to composited glyphs and xv paths]
+
+ v2: consolidate setting swizzle into the texture creation code, it
+ should work fine there. Handle swizzle when setting color as well.
+ v3: Fix drawing to a8 with Render (changes by anholt, reviewed by airlied).
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ (cherry picked from commit e6754dcb59ee21abb42421a28f4e467295584f67)
+
+commit 7bd0f79c38cac71d433b1ec7e56a6ff7c2550bcc
+Author: Eric Anholt <eric@anholt.net>
+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 <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit 51984dddfcc7133ed3c1f20d03514aa98c9a7831)
+
+commit ec9b79c8d497522f87697e434f55086f185e65e7
+Author: Eric Anholt <eric@anholt.net>
+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 <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit 6be33fd044949330e0b2b4185882c9664d2f90b4)
+
+commit fba0d8a3c9deff557f8a9735fc907556e4e861aa
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Jan 20 12:33:25 2016 -0800
+
+ glamor: Drop duplicated GLAMOR_DEFAULT_PRECISIONs in render accel.
+
+ We only need it once at the top of the shader, so just put it
+ there.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit 5042b0652b9fe5fed57a233880c3429ba390d86d)
+
+commit 389761e592184d78969469914d1aba5d281824fd
+Author: Dave Airlie <airlied@redhat.com>
+Date: Tue Jan 12 18:13:46 2016 +1000
+
+ glamor: Add support for CA rendering in a single pass.
+
+ It's been on the list to add dual source blending support to avoid the
+ two pass componentAlpha code. Radeon has done this for a while in
+ EXA, so let's add support to bring glamor up to using it.
+
+ This adds dual blend to both render and composite glyphs paths.
+
+ Initial results show close to doubling of speed of x11perf -rgb10text.
+
+ v2: Fix breakage of all of CA acceleration for systems without
+ GL_ARB_blend_func_extended. Add CA support for all the ops we
+ support in non-CA mode when blend_func_extended is present. Clean
+ up some comments and formatting. (changes by anholt)
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ (cherry picked from commit e7308b6c77561df44c04f81509f8ada678705d94)
+
+commit 2e79da2dce15b25534ea83eb453cb9b762a2e29f
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jan 21 12:01:02 2016 -0800
+
+ glamor: Drop the composite_with_copy path entirely.
+
+ I originally inherited this from the EXA code, without determining
+ whether it was really needed. Regular composite should end up doing
+ the same thing, since it's all just shaders anyway. To the extent
+ that it doesn't, we should fix composite.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit cab14a9a08ff06bc4cbef79c7be8f1d07c07ebf9)
+
+commit aad8e4714a2bdeada5c7ae42d2047cf6a4720d19
+Author: Keith Packard <keithp@keithp.com>
+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 <keithp@keithp.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit 49aa5e3ea4eecea0562c05a4e52962985a56e510)
+
+commit 6691f523332a5993d3e90e16d8edff7f3b85c4ae
+Author: Dave Airlie <airlied@redhat.com>
+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 <eric@anholt.net>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit d99204fb5e09ce7be36485d4226f7ad6d6eb24cc)
+
+commit eabe0e0b3685b5ab38c3597f238e92a3e4598441
+Author: Dave Airlie <airlied@redhat.com>
+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 <eric@anholt.net>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit 5582ad1b9b29934498cf3fef305d3a988130cd52)
+
+commit 23e60f917a5af652cd83b8a3a9951c79838721b3
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Feb 8 18:32:57 2016 -0500
+
+ xserver 1.18.1
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit a0d49b1c660f2453d07ce23bf86b0ef717f3d2c8
+Author: Timo Aaltonen <tjaalton@ubuntu.com>
+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 <timo.aaltonen@canonical.com>
+ Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
+ (cherry picked from commit 50ca286d79f6304b972ea74487308e7794a170fb)
+
+commit bc4b234d6f4b7b211f7a9750a97524e9652d0e6e
+Author: Adam Jackson <ajax@redhat.com>
+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 <ajax@redhat.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+ Reviewed-by: Julien Cristau <jcristau@debian.org>
+ (cherry picked from commit bf23db42a4e5943129501223a47b48884cdeb62f)
+
+commit 0b95625cecc7dc2cb6aff61edbc8366e8ffd516f
+Author: Dave Airlie <airlied@redhat.com>
+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 <airlied@redhat.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ (cherry picked from commit 1fd82c764d5b24107e60f2173e30e5d24a2f2667)
+
+commit 71be56c426bd9b66cbc5ab23923f4564e066cd75
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jan 21 11:30:15 2016 -0800
+
+ glamor: Fix copy-like Render operations between 15 and 16 depth.
+
+ Reading and writing to 16-depth pixmaps using PICT_x1r5g5b5 ends up
+ failing, unless you're doing a straight copy at the same bpp where the
+ misinterpretation matches on both sides.
+
+ Fixes rendercheck/blend/over and renderhceck/blend/src in piglit.
+
+ Please cherry-pick this to active stable branches.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit 510c8605641803f1f5b5d2de6d3bb422b148e0e7)
+
+commit 6a4f771c5da99d5f723d61e1a780390a5e6b161b
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Jan 20 15:43:10 2016 -0500
+
+ glx: Fix GLX_EXT_create_context_es2_profile support
+
+ As of v4 of this extension, any GLES version number may be requested (to
+ enable GLES3 and later). To comply with this, simply remove the API
+ version checks and leave it to the DRI driver to validate. This happens
+ to also enable using GLES1 in direct contexts, so if that's the dire
+ situation you find yourself in, your client driver at least stands a
+ chance of working.
+
+ v4 also specifies that both extension strings should be advertised for
+ compatibility with clients written against v1 of the extension spec, so
+ add the es_profile bit to the extension list and enable it whenever we
+ would enable es2_profile.
+
+ Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit bc415fb1e0031ad23bda6e9c3f4664532876a0e5)
+
+commit ff562c9f98bbce91b61b06dfc51aa30c14180cdd
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Fri Jan 15 18:22:21 2016 +0900
+
+ present: Handle wraparound when comparing MSC values
+
+ When a window moves from one CRTC to another, present_window_to_crtc_msc
+ updates window_priv->msc_offset according to the delta between the
+ current MSC values of the old and new CRTC:
+
+ window_priv->msc_offset += new_msc - old_msc;
+
+ window_priv->msc_offset is initially 0, so if new_msc < old_msc,
+ window_priv->msc_offset wraps around and becomes a large number. If the
+ window_msc parameter passed in is small (in particular if it's 0, such as
+ is the case when the client just wants to know the current window MSC
+ value), the returned CRTC MSC value may still be a large number. In that
+ case, the existing MSC comparisons in pixmap_present weren't working as
+ intended, resulting in scheduling a wait far into the future when the
+ target MSC had actually already passed. This would result in the client
+ (e.g. the Chromium browser) hanging when moving its window between CRTCs.
+
+ In order to fix this, introduce msc_is_(equal_or_)after helper functions
+ which take the wraparound into account for comparing two MSC values.
+
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ (cherry picked from commit 25eca80265654cfbf8768024e027426fedeb0918)
+
+commit 9505783c2270b6da13cc5691b94f48ff72d7b625
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Tue Jan 12 15:42:47 2016 +0900
+
+ glamor: Disable debugging messages other than GL API errors
+
+ According to Nicolai Hähnle, the relevant specification says "All
+ messages are initially enabled unless their assigned severity is
+ DEBUG_SEVERITY_LOW", so we need to explicitly disable the messages we
+ don't want to get. Failing that, we were accidentally logging e.g.
+ shader stats intended for shader-db.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93659
+ Tested-by: Laurent Carlier <lordheavym@gmail.com>
+ Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ (cherry picked from commit 1db6de7b6a6ee240eb50a13fe1fa1e135d7cb93b)
+
+commit 9e45b28e998a4e0aacd1224b5d4f479ee453fdb9
+Author: Dave Airlie <airlied@redhat.com>
+Date: Tue Jan 12 14:19:24 2016 +1000
+
+ glamor: store old fonts in double width textures.
+
+ There is a problem with some fonts that the height necessary
+ to store the font is greater than the max texture size, which
+ causes a fallback to occur. We can avoid this by storing two
+ macro columns side-by-side in the texture and adjusting
+ the calculations to suit.
+
+ This fixes
+ xfd -fn -*-*-*-*-*-*-*-*-*-*-*-*-*-*
+ falling back here, when it picks
+ -arabic-newspaper-medium-r-normal--32-246-100-100-p-137-iso10646-1
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit 8116fd8a760b5935645def1b2c3b155c05927850)
+
+commit f673c6cffb033286bf4f31fbb64f0863dfbe77f6
+Author: Dave Airlie <airlied@redhat.com>
+Date: Mon Jan 11 17:02:57 2016 +1000
+
+ glamor: fallback if font is too large for FBO size.
+
+ running xfontsel on haswell here, with a max texture size
+ of 8kx8k, one font wants 9711 height. This fallsback to
+ sw in this case.
+
+ A proper solution probably involves using an array texture.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit 64081d0eacf3e53a029b8e8b63096cc153e98549)
+
+commit f7da9e4cd8237795cea4c0cf82148bdd18ec0f92
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Jan 6 10:03:23 2016 -0500
+
+ os: Failure to remove a non-existent log file is not an error
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ (cherry picked from commit 6dcb73375e0ce389315d55587623eb84e9d13543)
+
+commit 4dfb05aaae9dc7a45294f60ebd3ad454a4707966
+Author: Thomas Klausner <wiz@NetBSD.org>
+Date: Wed Nov 11 13:32:05 2015 +0100
+
+ Fix build when XSERVER_PLATFORM_BUS is not defined.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
+ (cherry picked from commit 862cbf4c870c9ed913206c6ef4988bdb470e1c39)
+
+commit 88f2aa2940b6fb9deea0a1b53d05df02912dc17c
+Author: Thomas Klausner <wiz@NetBSD.org>
+Date: Tue Jan 5 12:51:41 2016 -0500
+
+ Fix uninitialized variable warnings reported by clang
+
+ v2: Move initializing pos into the first clause of the for statement. We
+ have to keep this macro equivalent to a plain for statement from the
+ user's perspective, otherwise callers need to {} things to keep control
+ flow correct. [ajax]
+
+ Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
+ Acked-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit 63f83d1b7f496d05b409352749cdb6674d71cf80)
+
+commit 320b169c225fa05d83928bad438c4b15481cea1f
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Jan 1 18:11:14 2016 -0800
+
+ Use unique logfile names when starting server with -displayfd
+
+ Fixes https://bugs.freedesktop.org/show_bug.cgi?id=93212
+
+ Previously all X servers started with -displayfd would overwrite
+ Xorg.0.log - now a temporary name of Xorg.pid-<pid>.log is used
+ until after -displayfd finds an open display - then it is renamed
+ to the traditional Xorg.<display>.log name.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ (cherry picked from commit edcb6426f20c3be5dd5f50b76a686754aef2f64e)
+
+commit a32b85bf192bd15e9585e4c13a24407634478b05
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Jan 1 18:10:08 2016 -0800
+
+ modesetting should not reference gbm when it's not defined
+
+ Fixes build errors of:
+ present.c: In function 'ms_do_pageflip':
+ present.c:410:17: error: 'drmmode_bo' has no member named 'gbm'
+ new_front_bo.gbm = glamor_gbm_bo_from_pixmap(screen, new_front);
+ ^
+ present.c:412:22: error: 'drmmode_bo' has no member named 'gbm'
+ if (!new_front_bo.gbm) {
+ ^
+ present.c: In function 'ms_present_check_flip':
+ present.c:536:36: error: 'drmmode_bo' has no member named 'gbm'
+ if (drmmode_crtc->rotate_bo.gbm)
+ ^
+ Introduced by commit 13c7d53d
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ (cherry picked from commit fe8562f5316d8c74ca074ad145295c65ddff5fc2)
+
+commit 4457fd45efef85b567d4a0ac085d252ffe49020d
+Author: Siim Põder <siim@p6drad-teel.net>
+Date: Mon Jun 8 22:14:12 2015 +0000
+
+ vfb: add randr support (v2)
+
+ The motivation for getting this is chrome remote desktop that runs under
+ Xvfb and wants to use RANDR to adjust screen size according to the
+ remote desktop client screen size. Apparently there are other use cases
+ as well, the bug mentions gnome-settings-daemon testing.
+
+ [ajax: massaged commit message]
+
+ Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=26391
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Lambros Lambrou <lambroslambrou@google.com>
+ Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+ Signed-off-by: Michal Srb <msrb@suse.com>
+ Signed-off-by: Siim Põder <siim@p6drad-teel.net>
+ (cherry picked from commit 3d68d1f26709ecb5ce22a9baa0d3d8162574ed6a)
+
+commit 5a89a6336d6b70781101e6395c276649956b9d80
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Dec 8 15:56:17 2015 -0500
+
+ glxproxy: Silence shadowed-variable warnings
+
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit b5f04a79df8b5aab8b558461261d14721f0b3e41)
+
+commit c10def69e1d92741ab79eee0b26ae80d143c93fb
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Dec 8 15:53:35 2015 -0500
+
+ glxproxy: Silence set-but-unused-variable warnings
+
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit 18729a211a5fdd4f733e44eded754a0e6210b687)
+
+commit e36834cee865152dee5fbe1e8d480b7010466f75
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Dec 8 16:04:44 2015 -0500
+
+ dmx: Run 'doxygen -u' to upgrade the doxygen config file
+
+ Also change the dot font setting back to the default of Helvetica as
+ doxygen no longer ships FreeSans.
+
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit bc996fa4e3c06f65eafe0a88ef491dbf01f31422)
+
+commit bb9bdb213250dbd28a61f91dba2145d20ef5f569
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Dec 8 16:00:19 2015 -0500
+
+ dmx: Silence unused variable warning in dmxcompat
+
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit a55e0bc56fd8f9da8f066dc344af19535dd092ca)
+
+commit 1f5afbba4513c0e0d2d8827f3bbbbc383fd918f0
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Dec 8 15:37:12 2015 -0500
+
+ dmx: Silence lex/yacc-related config parser warnings
+
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit 2730ccb803c55af74dbdd1bfd982fc23e643554d)
+
+commit b63a8cc4f24012267b0cb88bc358e68ab3ceb427
+Author: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
+Date: Thu Dec 3 08:05:59 2015 -0200
+
+ systemd-logind.c: don't parse VT settings for non-seat0 X servers
+
+ Since non-seat0 X servers no longer touch VTs, I believe these settings
+ are unnecessary.
+
+ Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+ (cherry picked from commit 718223d27452862eedcf1bee6278eae6040d45ea)
+
+commit a8b746948db1871c0b28663b99fa839582693087
+Author: Bob Ham <bob.ham@collabora.com>
+Date: Fri Dec 4 12:30:47 2015 +0000
+
+ xserver: Fix configure.ac check for libsystemd/-daemon
+
+ The configure script looks for the libsystemd-daemon pkg-config
+ module. If the configure script finds it, the script will add
+ libsystemd-daemon to a list of modules which are used to consolidate
+ CFLAGS and LIBS.
+
+ The check for libsystemd-daemon was altered to fallback to libsystemd
+ if libsystemd-daemon was not found (libsystemd-daemon was brought into
+ libsystemd). Unfortunately, the configure script still adds
+ "libsystemd-daemon" to the list of modules to consolidate, instead of
+ "libsystemd". With this patch, we set a variable depending on which
+ pkg-config module is found and add that to the module list instead.
+
+ Changes since v1:
+ - Rearranged logic so that we do a versioned check for libsystemd
+ first, then look for libsystemd-daemon.
+ - Cleaned up the check a bit, only performing the module checks if we
+ don't have --with-systemd-daemon=no, in a similar style to
+ --with-dtrace.
+ - Changed the variable name to LIBSYSTEMD_DAEMON as per feedback.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Bob Ham <bob.ham@collabora.com>
+ (cherry picked from commit 7c0ba32ddd5f1d5c65279365fa307dec3433caf3)
+
+commit b564cc9121bade2fee22eb14edd360036b7ba0b9
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Thu Dec 3 17:04:09 2015 +0900
+
+ prime: Damage full destination rectangle when we start dirty tracking
+
+ This makes sure that the destination pixmap contents will be fully
+ initialized. Without this, a PRIME output starts out with garbage.
+
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+ (cherry picked from commit 530d3e5ca0a02039b04ec6a677bbb4e05b78e5f4)
+
+commit 00f65597c80d01e1c0759527ed1c72bc5af46c29
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Dec 7 17:03:02 2015 -0500
+
+ x86emu: Squash a warning
+
+ Apologies, should have caught this one when applying the previous x86emu
+ patch.
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ (cherry picked from commit 2a52c06e235bd79f91851121f53f7c1808fde321)
+
+commit 4415b0cd6f1ddd75f2dc8b2096a89716baa38405
+Author: Julian Pidancet <julian.pidancet@gmail.com>
+Date: Sun Jul 1 18:49:25 2012 +0100
+
+ x86emu: Correctly handle 0x66 prefix for some instructions
+
+ (Sorry for double posting)
+
+ I repost this patch because I havn't got any replies from maintainers
+ since I posted the initial patch back in March.
+
+ Some instructions are not emulated correctly by x86emu when they
+ are prefixed by the 0x66 opcode.
+ I've identified problems in the emulation of these intructions: ret,
+ enter, leave, iret and some forms of call.
+
+ Most of the time, the problem is that these instructions should push or
+ pop 32-bit values to/from the stack, instead of 16bit, when they are
+ prefixed by the 0x66 special opcode.
+
+ The SeaBIOS project aims to produce a complete legacy BIOS
+ implementation as well as a VGA option ROM, entirely written in C and
+ using the GCC compiler.
+
+ In 16bit code produced by the GCC compiler, the 0x66 prefix is used
+ almost everywhere. This patch is necessary to allow the SeaBIOS VGA
+ option ROM to function with Xorg when using the vesa driver.
+
+ SeaBIOS currently use postprocessing on the ROM assembly output to
+ replace the affected instruction with alternative unaffected instructions.
+ This is obviously not very elegant, and this fix in x86emu would be
+ more appropriate.
+
+ v2: - Decrement BP instead of EBP in accordance with the Intel Manual
+ - Assign EIP instead of IP when poping the return address from the
+ stack in 32-bit operand size mode in ret_far_IMM, ret_far, and iret
+ - When poping EFLAGS from the stack in iret in 32-bit operand size
+ mode, apply some mask to preserve Read-only flags.
+
+ v3: - Rebase
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
+ (cherry picked from commit 59b618227ebd024e57720aaaea17596953f5b80e)
+
+commit cc0cefed4f098ce6e933f2142a4fee93df5f652d
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Feb 8 09:47:42 2015 +0000
+
+ present: Do not replace Pixmaps on redirected Window on unflip
+
+ When unflipping, we may find that our flip window has been redirected.
+ If we replace the redirected Window with the Screen Pixmap we then have
+ mutliple fullscreen Windows believing that their own the Screen Pixmap -
+ multiple fullscreen Windows that are being flipped by Clients, and so
+ continue to flip causing popping between e.g. the compositor and the
+ game.
+
+ [ajax: Fix up present_execute() hunk to account for changes introduced
+ in fe07ec19e212a68076560d243a2a935c54589068]
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit 72f0724cdc65dc9abbbf70b9feb6cce7c2b9f8a0)
+
+commit cfeea6382b5aaac0dcf59d88f7735b0703c9929f
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Feb 8 09:47:41 2015 +0000
+
+ present: When cancelling a pending synchronous flip, requeue it
+
+ The vblank event request for a synchronous flip is scheduled for the
+ vblank before the target flip msc (so that the flip itself appears at
+ the right frame). If we cancel that flip and so wish to schedule a
+ copy instead, that copy needs to be postponed by a frame in order for it
+ be performed at the requested time.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit 180b09912c0d2c4a43b5a08678bcad4b818924c7)
+
+commit 4d48ceb8a15fcf521e8be3dba2756b69e54f20cc
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Feb 8 09:47:40 2015 +0000
+
+ present: Requery pending flips with the right sync_flip mode
+
+ When verifying whether a pending flip is still valid, we need to pass
+ down the orignal sync_flip mode (e.g. if the driver only supports sync
+ flips, verifying a async flip will falsely fail).
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit b2d55338f6b8f43ebcb49994abad123a797248cf)
+
+commit 54c74aa952ac7eecaeeb3f3cba6d2fe8a98cf450
+Author: Dave Airlie <airlied@gmail.com>
+Date: Mon Nov 16 09:05:27 2015 +1000
+
+ modesetting: create entities for pci and old probe. (v2)
+
+ This moves the code from the platform case into
+ a common function, and calls that from the
+ other two.
+
+ v2: Emil convinced me we don't need to lookup pEnt
+ here, so let's not bother.
+
+ Reported-by: Mark Kettenis <mark.kettenis@xs4all.nl>
+ Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit 548a3d5fd69bb059bbaf26ededdc94c212712cd7)
+
+commit d94118fa1b75ea773857b7bbeda96ac181feb994
+Author: Dave Airlie <airlied@gmail.com>
+Date: Mon Nov 16 09:05:26 2015 +1000
+
+ modesetting: drop platform_dev pointer.
+
+ This isn't used anywhere, so no point storing it until we need it.
+
+ Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ (cherry picked from commit 771016f0705909c908917b4ccaeafc950ba93c05)
+
+commit 067c4dd5ce06c2f17d54c3b89e23efbc0822a194
+Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
+Date: Mon Nov 16 11:06:57 2015 +0100
+
+ Xorg.wrap: activate libdrm based detection for KMS drivers
+
+ Xorg.wrap includes code guarded with WITH_LIBDRM for detecting KMS drivers.
+ Unfortunately it is never activated since code missed to include file
+ which defines WITH_LIBDRM.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92894
+ Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+ (cherry picked from commit 19b0249a5e07b9fc008e5d8709d7e489874415de)
+
+commit 8f41c32bb5f3b962d4db105f96d47d8b74f5af79
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Tue Dec 1 17:16:03 2015 +0100
+
+ xwayland: Update screen size on output removal
+
+ When unplugging an output, it's still listed in xrandr and the size
+ of the root window still includes the removed output.
+
+ The RR output should be destroyed when its Wayland counterpart is
+ destroyed and the screen dimensions must be updated in both the done
+ and the destroy handlers.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92914
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
+ (cherry picked from commit ab9837cc6a11f46b9df780f131b69de3822c3dd9)
+
+commit 2b356cb50139601dcd5393646aad30552fa778a1
+Author: Jonas Ã…dahl <jadahl@gmail.com>
+Date: Wed Oct 7 12:01:53 2015 +0800
+
+ xwayland: Always update the wl_pointer cursor on pointer focus
+
+ In Wayland, a client (in this case XWayland) should set the cursor
+ surface when it receives pointer focus. Not doing this will leave the
+ curser at whatever it was previously.
+
+ When running on XWayland, the X server will not be the entity that
+ controls what actual pointer cursor is displayed, and it wont be notified
+ about the pointer cursor changes done by the Wayland compositor. This
+ causes X11 clients running via XWayland to end up with incorrect pointer
+ cursors because the X server believes that, if the cursor was previously
+ set to the cursor C, if we receive Wayland pointer focus over window W
+ which also has the pointer cursor C, we do not need to update it. This
+ will cause us to end up with the wrong cursor if cursor C was not the
+ same one that was already set by the Wayland compositor.
+
+ This patch works around this by, when receiving pointer focus, getting
+ the private mipointer struct changing the "current sprite" pointer to
+ an invalid cursor in order to trigger the update path next time a cursor
+ is displayed by dix.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Jonas Ã…dahl <jadahl@gmail.com>
+ (cherry picked from commit 07941a50a547f2ca094e242588298695f48903ed)
+
+commit 74354c4b0086ea1a952b5591846803719e3e3e91
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Mon Nov 23 08:51:48 2015 +0100
+
+ xwayland: Do not set root clip when rootless
+
+ Otherwise the server may try to draw onto the root window when closing
+ down, but when running rootless the root window has no storage thus
+ causing a memory corruption.
+
+ Thanks to Adam Jackson <ajax@redhat.com> for helping tracking this down!
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93045
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ Tested-by: Marek Chalupa <mchqwerty@gmail.com>
+ (cherry picked from commit 51a4399b94f9adfac5f7718d4cbf73f793dcca56)
+
+commit 0a500c3cc74e39a01be24053e152dd52469dd908
+Author: Marek Chalupa <mchqwerty@gmail.com>
+Date: Fri Nov 27 14:27:46 2015 +0100
+
+ xwayland: check if creating xwl_output succeeded
+
+ check return values of RR.*Create calls
+
+ v2. do not bail out if we don't have any output
+
+ Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
+ Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit 5b2ca3413203210d112a08a4e20d14382abae437)
+
+commit c2e6eddb1bfc5106596729bc3f0a6a381f5be9f4
+Author: Marek Chalupa <mchqwerty@gmail.com>
+Date: Fri Nov 27 14:59:27 2015 +0100
+
+ xwayland: fix memory leaks on error paths in xwl_realize_window
+
+ don't leak memory when realizing window fails
+
+ v2. take care of all memory allocation and return values,
+ not just one leak
+
+ Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
+ Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit 646ebea456b4c5251ae997eab8d9b971f97de836)
+
+commit 68168c764662c0ce4ac8193d293b8befd934f666
+Author: Egbert Eich <eich@suse.de>
+Date: Tue Nov 24 17:37:36 2015 +0100
+
+ kdrive/UnregisterFd: Fix off by one
+
+ The number of FDs has been decremented already, therefore the
+ number contained the index of the top one that is to me moved down.
+
+ This problem was introduced by:
+ commit 1110b71e360195aab040d835b54540ab558638c5
+ Author: Chris Clayton <chris2553@googlemail.com>
+
+ kdrive: fix build error on gcc 4.8 for out-of-bounds array access
+
+ The reason for the warning was likely a confused compiler.
+ Hoping to reduce the confusion by moving the decrement behind the end
+ if the copy loop.
+
+ Signed-off-by: Egbert Eich <eich@suse.de>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ (cherry picked from commit 44d0fd435a4eaf45e252b4f00409152a6d599dfc)
+
+commit 84fbfa8a7d40553c5129a667b532ea3a8b63bfb3
+Author: Adam Jackson <ajax@redhat.com>
+Date: Thu Nov 19 12:21:08 2015 -0500
+
+ xnest: Fix needless build dependency on xcb-util-keysyms
+
+ This was added in:
+
+ commit 43014795087a0a8774dd9687f5967329b15f06a2
+ Author: Olivier Fourdan <ofourdan@redhat.com>
+ Date: Mon Jan 5 16:44:22 2015 +0100
+
+ Synchronize capslock in Xnest and Xephyr
+
+ Which is fine if you're building both, but if you don't happen to have
+ xcb-util-keysyms' headers installed Xnest will configure as enabled but
+ fail to build.
+
+ Fortunately <X11/X.h> has a corresponding #define, so use that instead.
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
+ (cherry picked from commit 4affa75a90d2455c81087b930126ad7adfd019f0)
+
+commit 115913d9ec8f7961e9a5789972aeb33da9cfd1e4
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Mon Nov 23 07:59:24 2015 +1000
+
+ xfree86: fix minor memory leak
+
+ xf86*StrOption returns a strdup
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+ (cherry picked from commit 71ba82690158f46d50a455e69a83ee0d685bb274)
+
+commit c9bd60790c6636a7911ca479e0f9439bc118d74c
+Author: Eric Anholt <eric@anholt.net>
+Date: Sun Oct 18 19:16:20 2015 -0700
+
+ glamor: No need to glFlush before destroying a pixmap.
+
+ I assume this was a workaround for an old, broken, closed driver. The
+ driver doesn't get to throw away rendering just because the rendering
+ context's shared-across-processes render target is getting freed from
+ the local address space. If the rendering isn't to a shared render
+ target, then we *do* want to throw away the rendering to it.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit 98a1993536add730b7ec29a9e37f62b1cd70ad31)
+
+commit 9379c6a3f6109fe2cca3bf2dc45dc92fcf1e302f
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Nov 5 16:35:56 2015 -0800
+
+ glamor: Fix segfault in fallback picture uploading.
+
+ If the source/mask pixmap is a pixmap that doesn't have an FBO
+ attached, and it doesn't match the Render operation's size, then we'll
+ composite it to a CPU temporary (not sure why). We would take the
+ PictFormatShort from the source Picture, make a pixmap of that depth,
+ and try to look up the PictFormat description from the depth and the
+ PictFormatShort. However, the screen's PictFormats are only attached
+ to the screen's visuals' depths. So, with an x2r10g10b10 short format
+ (depth 30), we wouldn't find the screen's PictFormat for it
+ (associated with depth 32).
+
+ Instead of trying to look up from the screen, just use the pFormat
+ that came from our source picture. The only time we need to look up a
+ PictFormat when we're doing non-shader gradients, which we put in
+ a8r8g8b8.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit 9a5972801f7789833062e5711e77483b643eef92)
+
+commit 6bb58ea2a9c1931f4e04075f19ed22bb50b1d709
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Nov 5 16:03:14 2015 -0800
+
+ glamor: Fix assert failures when fallback picture upload alloc fails.
+
+ If the glTexImage (or glTexSubImage) out-of-memories, error out
+ cleanly so that we can fall back to software.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit e7aa4d3c7420d45cca2b7e1e69e22cebc64d5b74)
+
+commit ade2ed4f8bb66127ad46df22b12d201dad318c3d
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Nov 5 15:13:55 2015 -0800
+
+ glamor: Fix rendering when core font texture allocation fails.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit ff8ef975df9cd99ec6f0b8b8047445091bf35ef0)
+
+commit 90fe7266ab67aa3e45a0a68c71987c70c0496504
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Nov 5 15:05:11 2015 -0800
+
+ glamor: Fix crashes when the glyph atlas allocation fails.
+
+ We already have a fallback path, so we just need to jump to it when we
+ hit the failure.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit a6b05d10da2fe476f46e6dc4ad8a603964735905)
+
+commit 701b4347aca1a9b81492b05cf3ae35fe0499325c
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Nov 5 14:47:42 2015 -0800
-commit bbf1893cc039155432a960b61d55978f1b706295
+ glamor: Handle GL_OUT_OF_MEMORY when allocating texture images.
+
+ The spec allows general undefined behavior when GL_OOM is thrown. But
+ if the driver happens to throw the error at this point, it probably
+ means the pixmap was just too big, so we should delete that texture
+ and have this pixmap fall back to software.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ (cherry picked from commit de959ec939b262cb1cb4c0b6146826e3092843f9)
+
+commit 73799de77f551c22308af1e7ef0b2f83ae49b0e0
+Author: Eric Anholt <eric@anholt.net>
+Date: Mon Nov 9 15:47:05 2015 -0800
+
+ glamor: Avoid GL errors from mapping with size == 0.
+
+ GL 4.5 / GLES 3.0 require throwing GL errors at map time, and Mesa
+ before that might throw errors accidentally if a malloc(0) call was
+ made to return the mapping.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Rob Clark <robdclark@gmail.com>
+ (cherry picked from commit 74be466d40080545117628c376cb59b696db33bc)
+
+commit 7727e433459675f80cb38857a6c82ebb29393072
+Author: Michael Stapelberg <stapelberg@google.com>
+Date: Tue Nov 3 03:51:48 2015 -0800
+
+ Also dump passive grabs on XF86LogGrabInfo
+
+ Signed-off-by: Michael Stapelberg <stapelberg@google.com>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ (cherry picked from commit a6cddb8c04ddc3c48aae3f3611ad9f336fecb09d)
+
+commit 43fb888bd01cf9d3d277e77a52a3d0c93ccff8bd
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Nov 9 16:00:26 2015 -0500
+
+ xserver 1.18.0
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 2203735887ab548b3ee004400d1b89149aae412c
+Author: Axel Davy <axel.davy@ens.fr>
+Date: Wed Nov 4 18:42:42 2015 +0100
+
+ present: Fix Async swap logic
+
+ According to the spec, PresentOptionAsync should only
+ trigger a different behaviour when the target msc has been reached.
+
+ In this case if the driver is able to do async swaps, we use
+ them to avoid a screen copy.
+
+ When the target msc hasn't been reached yet, we want to use sync swaps.
+
+ v2: Fix indentation and simplify checks for Async flips
+
+ Signed-off-by: Axel Davy <axel.davy@ens.fr>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+
+commit 3f35909acba117dc8934920d788c7ce612bce444
+Author: Jammy Zhou <Jammy.Zhou@amd.com>
+Date: Wed Oct 28 18:39:10 2015 +0800
+
+ present: Execute right away if target_msc equals current_msc
+
+ It is according to the protocol:
+
+ "If 'options' contains PresentOptionAsync, and the 'target-msc'
+ is less than or equal to the current msc for 'window', then
+ the operation will be performed as soon as possible, not
+ necessarily waiting for the next vertical blank interval."
+
+ Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Axel Davy <axel.davy@ens.fr>
+
+commit 7d1e4783853f9830344d101ceab087feb19995be
+Author: Daniel Martin <consume.noise@gmail.com>
+Date: Thu Oct 29 14:58:11 2015 +0100
+
+ modesetting: Remove XF86_CRTC_VERSION checks
+
+ The ifdef checks for XF86_CRTC_VERSION >= 3/5 are remnants from the
+ out-of-tree driver. Within the tree, we can rely on:
+ xf86Crtc.h:#define XF86_CRTC_VERSION 6
+
+ Signed-off-by: Daniel Martin <consume.noise@gmail.com>
+ Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 45c83a266d18eb515313aa3f1a4d7ff6af53be5d
+Author: Daniel Martin <consume.noise@gmail.com>
+Date: Thu Oct 29 14:58:10 2015 +0100
+
+ modesetting: Free output_ids in drmmode_set_mode_major()
+
+ We calloc() output_ids. Let's free() it, too.
+
+ Signed-off-by: Daniel Martin <consume.noise@gmail.com>
+ Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 2674d424020bd71d4f99b8d8de8b0b21aa490d54
+Author: Daniel Martin <consume.noise@gmail.com>
+Date: Thu Oct 29 14:58:09 2015 +0100
+
+ modesetting: Handle failures in setting a CRTC to a DRM mode properly
+
+ This fixes a bug where running the card out of PPLL's when hotplugging
+ another monitor would result in all of the displays going blank and
+ failing to work properly until X was restarted or the user switched to
+ another VT.
+
+ [Michel Dänzer: Pass errno instead of -ret to strerror()]
+ [Daniel Martin: Add \n to log message]
+
+ Picked from xf86-video-ati
+ 7186a87 Handle failures in setting a CRTC to a DRM mode properly
+
+ Signed-off-by: Daniel Martin <consume.noise@gmail.com>
+ Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 250666586e2b6f3ed1371340452dc2be2d094d40
+Author: Adam Jackson <ajax@redhat.com>
+Date: Thu Oct 29 10:08:17 2015 -0400
+
+ vidmode: Drop the unused event code
+
+ As the code says, this is "far from complete". So far, in fact, that
+ it's been basically untouched for twenty years (XFree86 3.1!). As far
+ as I can tell it was never enabled in any XFree86 build, and certainly
+ has never been enabled since Xorg 7.0.
+
+ Also, K&R.
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
+
+commit 478efe285a440c33b053bdf0bfbfdd482f429f01
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Tue Oct 27 19:44:28 2015 -0700
+
+ Xserver.man: document more transports for -nolisten & -listen options
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 8fc295bde9a736f3c8c047031a6698d140d5266f
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Tue Oct 27 19:44:27 2015 -0700
+
+ Xorg.man: update to reflect -nolisten tcp becoming default
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 75157b7dbf4ed4db0492328a44e4e67dda83f769
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Tue Oct 27 19:44:26 2015 -0700
+
+ Xorg.man: move XLOCAL details to X(7) man page instead
+
+ These settings affect clients, not server, so belong there, next to
+ the information about how to set $DISPLAY.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 50c167164700e8ead9b7ccf9f9eafc7541baac75
Author: Martin Peres <martin.peres@linux.intel.com>
Date: Mon Jul 20 10:37:30 2015 +0300
@@ -51,7 +2832,16 @@ Date: Mon Jul 20 10:37:30 2015 +0300
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-commit 6e3892045e57808b18d053288330306119ca2252
+commit bb78c464f09f515db557182a458b12b63c3b52d7
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Oct 27 13:28:37 2015 -0400
+
+ build: Remove stale miext/cw include paths
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
+
+commit 524844c8c18e226aad30feb371b19ef491d83449
Author: Julien Cristau <jcristau@debian.org>
Date: Tue Oct 27 13:23:13 2015 +0100
@@ -63,9 +2853,8 @@ Date: Tue Oct 27 13:23:13 2015 +0100
Cc: Andrew Eikum <aeikum@codeweavers.com>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
- (cherry picked from commit 524844c8c18e226aad30feb371b19ef491d83449)
-commit bf003230f93b2a537b01ab976b7ced83d053e0eb
+commit ac2f27f1a9fa8cd88c5dbe7ec0f96238eecf2c3e
Author: Michel Dänzer <michel.daenzer@amd.com>
Date: Tue Oct 27 11:51:49 2015 +0900
@@ -76,17 +2865,56 @@ Date: Tue Oct 27 11:51:49 2015 +0900
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
- (cherry picked from commit ac2f27f1a9fa8cd88c5dbe7ec0f96238eecf2c3e)
-commit 780022a8a5d6f8abd02f8b568f522ce5aed99839
+commit d8b7a900cf912cadb5915b3924dd6ce5a74505e7
Author: Adam Jackson <ajax@redhat.com>
-Date: Mon Oct 26 13:03:59 2015 -0400
+Date: Mon Oct 26 13:47:04 2015 -0400
- xserver 1.17.3
+ xserver 1.17.99.902 (1.18 RC2)
Signed-off-by: Adam Jackson <ajax@redhat.com>
-commit d9344ef3ea4f3009d61240e0fefcfca40eaa7dca
+commit 47b00fa4bf3b67736957296492310f7fdd6c0a25
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Oct 21 12:15:34 2015 -0400
+
+ xfree86: Use same inb/outb asm code for i386 amd64 and ia64
+
+ This matches the GCCUSESGAS path from the old monolith build (where that
+ macro was actually set), and fixes the build on modern OSX.
+
+ Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit c99fb550e06207e83ec89463fe32bd6bceca45f8
+Author: Dave Airlie <airlied@gmail.com>
+Date: Sun Sep 13 07:45:15 2015 +1000
+
+ xf86: don't add gpus from udev if autoAddGPU is set
+
+ At startup the server wasn't adding devices, but nothing
+ was blocking hotplug devices by the look of it.
+
+ bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91388
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+
+commit 912f1fe2bb1b640d55fc44fcf636b6ca40d7f40b
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Apr 5 10:32:03 2015 +0100
+
+ Xv: Only stop the adaptors when the Pixmap is finally destroyed
+
+ Pixmaps are reference counted and DestroyPixmap is called for the
+ removal of every reference. However, we only want to stop the adaptors
+ writing into the Pixmap just before the Pixmap is finally destroyed,
+ similar to how Windows are handled.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
+ Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+
+commit 413cb2ff1d754b5f19d77ff19cddf40793989c03
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Feb 16 09:49:18 2015 +0000
@@ -98,9 +2926,27 @@ Date: Mon Feb 16 09:49:18 2015 +0000
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
- (cherry picked from commit 413cb2ff1d754b5f19d77ff19cddf40793989c03)
-commit 88f22fc5dac502c7d57d0b53defda75b44dab985
+commit 702c0a247f5523b43652befaf6be548ddbbe9dee
+Author: Alberto Milone <alberto.milone@canonical.com>
+Date: Thu Dec 12 10:00:09 2013 +0100
+
+ randr: make RROutputChanged change the main protocol screen not the gpu screen
+
+ We only set changes on the main protocol screen as, for example
+ in RRSetChanged() and RRTellChanged(), therefore we should follow
+ the same logic when reporting that an output changed in
+ RROutputChanged().
+
+ This means that RRTellChanged() will then update the relevant
+ timestamps also when events come from gpu screens.
+
+ [ajax: Fix mixed code and decls]
+
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
+
+commit 2092f12a243b9f7682f542b593b77c96d455ec89
Author: Hans de Goede <hdegoede@redhat.com>
Date: Wed Oct 21 11:36:06 2015 +0200
@@ -122,9 +2968,39 @@ Date: Wed Oct 21 11:36:06 2015 +0200
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1269210
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
- (cherry picked from commit 2092f12a243b9f7682f542b593b77c96d455ec89)
-commit 0ca79007c940b09bd81823fc2e2276f08057247c
+commit ee06f674bbcd796324d6daf69bfb5d8856e94008
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Thu Oct 15 22:28:49 2015 -0700
+
+ Xi: Silence some tautological warnings
+
+ xichangehierarchy.c:424:23: warning: comparison of constant 536870911 with expression of type 'uint16_t'
+ (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare,Semantic Issue]
+ if (stuff->length > (INT_MAX >> 2))
+ ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
+ xichangehierarchy.c:438:26: warning: comparison of constant 536870911 with expression of type 'uint16_t'
+ (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare,Semantic Issue]
+ if ((any->length > (INT_MAX >> 2)) || (len < (any->length << 2)))
+ ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
+
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 113c0bb4fd764da8c08d8f30abe350c7650c9fc2
+Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Mon Oct 19 23:15:36 2015 +0200
+
+ hurd: fix xorg-wrapper build
+
+ hurd does not have any PATH_MAX limitation. misc.h provides a default value
+ which is fine here.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+commit f9a04d19aef77bf787b8d322305a6971d24a6ba1
Author: Keith Packard <keithp@keithp.com>
Date: Mon Sep 21 07:16:12 2015 +0100
@@ -154,9 +3030,161 @@ Date: Mon Sep 21 07:16:12 2015 +0100
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
- (cherry picked from commit f9a04d19aef77bf787b8d322305a6971d24a6ba1)
-commit 82000d6d0376bdd5c6bb4e0daefcb85879f7c5c7
+commit 5b582a4a0350c253d729efb31b710851ae9a958e
+Merge: 1d4aa67 27ad212
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Oct 19 12:23:22 2015 -0400
+
+ Merge remote-tracking branch 'jeremyhu/master'
+
+commit 1d4aa672424d8b1629fda11400b88607b5066965
+Author: Julien Cristau <jcristau@debian.org>
+Date: Mon Oct 19 15:42:30 2015 +0200
+
+ xorg-wrapper: when starting the server as root, reset its environment
+
+ When the server is privileged, we shouldn't be passing the user's
+ environment directly.
+
+ Clearing the environment is recommended by the libdbus maintainers, see
+ https://bugs.freedesktop.org/show_bug.cgi?id=52202
+
+ v2: rename envp to empty_envp (Jeremy)
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83849
+ Signed-off-by: Julien Cristau <jcristau@debian.org>
+
+commit 08c4912406b965bbac0a3a52413c374a073c051b
+Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Mon Oct 19 14:47:43 2015 +0200
+
+ xorg-wrapper: fix build without libdrm
+
+ Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+
+commit a4cd8ee5f8e8de776c7f764656770311cdbde0d2
+Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Mon Oct 19 14:47:42 2015 +0200
+
+ hurd: disable detecting drm
+
+ Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+
+commit 27ad21254f257bac6c647315d749ee69f20c24e0
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Sun Oct 18 23:01:53 2015 -0700
+
+ XQuartz: Cleanup formatting of DarwinEQInit that was butchered by automation a few years ago
+
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 3db7e332d374bf8cee581c31b7d50d7ac0509187
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Sun Oct 18 23:03:23 2015 -0700
+
+ XQuartz: Make sure that darwin_all_modifier_mask_additions is 0-terminated
+
+ Found by ASan
+
+ X.Org X Server 1.17.99.901 Build Date: 20151018
+ ================================================================
+ ==40471==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000101fed7a4 at pc 0x000101584030 bp 0x70000029f920 sp 0x70000029f918
+ READ of size 4 at 0x000101fed7a4 thread T7
+ #0 0x10158402f in DarwinEQInit darwinEvents.c:377
+ #1 0x10157f3bc in InitInput darwin.c:566
+ #2 0x101be87ad in dix_main main.c:268
+ #3 0x10159131b in server_thread quartzStartup.c:66
+ #4 0x7fff8a535c12 in _pthread_body (/usr/lib/system/libsystem_pthread.dylib+0x3c12)
+ #5 0x7fff8a535b8f in _pthread_start (/usr/lib/system/libsystem_pthread.dylib+0x3b8f)
+ #6 0x7fff8a533374 in thread_start (/usr/lib/system/libsystem_pthread.dylib+0x1374)
+
+ 0x000101fed7a4 is located 0 bytes to the right of global variable 'darwin_all_modifier_mask_additions' defined in 'darwinEvents.c:181:12'
+ (0x101fed7a0) of size 4
+ SUMMARY: AddressSanitizer: global-buffer-overflow darwinEvents.c:377 DarwinEQInit
+ Shadow bytes around the buggy address:
+ 0x1000203fdaa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 0x1000203fdab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 0x1000203fdac0: f9 f9 f9 f9 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9
+ 0x1000203fdad0: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00
+ 0x1000203fdae0: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 00 f9 f9 f9
+ =>0x1000203fdaf0: f9 f9 f9 f9[04]f9 f9 f9 f9 f9 f9 f9 00 00 00 00
+ 0x1000203fdb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 0x1000203fdb10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 0x1000203fdb20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 0x1000203fdb30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 0x1000203fdb40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ Shadow byte legend (one shadow byte represents 8 application bytes):
+ Addressable: 00
+ Partially addressable: 01 02 03 04 05 06 07
+ Heap left redzone: fa
+ Heap right redzone: fb
+ Freed heap region: fd
+ Stack left redzone: f1
+ Stack mid redzone: f2
+ Stack right redzone: f3
+ Stack partial redzone: f4
+ Stack after return: f5
+ Stack use after scope: f8
+ Global redzone: f9
+ Global init order: f6
+ Poisoned by user: f7
+ Container overflow: fc
+ Array cookie: ac
+ Intra object redzone: bb
+ ASan internal: fe
+ Left alloca redzone: ca
+ Right alloca redzone: cb
+ Thread T7 created by T0 here:
+ #0 0x10242ee99 in wrap_pthread_create
+ (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x37e99)
+ #1 0x101591089 in create_thread quartzStartup.c:78
+ #2 0x101590ed9 in QuartzInitServer quartzStartup.c:95
+ #3 0x1015697eb in X11ApplicationMain X11Application.m:1277
+ #4 0x101575dc0 in X11ControllerMain X11Controller.m:984
+ #5 0x10159171a in server_main quartzStartup.c:127
+ #6 0x101540fc0 in do_start_x11_server bundle-main.c:436
+ #7 0x101544869 in _Xstart_x11_server mach_startupServer.c:189
+ #8 0x101545c96 in mach_startup_server mach_startupServer.c:398
+ #9 0x7fff8d1b70f3 in mach_msg_server (/usr/lib/system/libsystem_kernel.dylib+0x110f3)
+ #10 0x1015416e7 in main bundle-main.c:774
+ #11 0x7fff8bd975ac in start (/usr/lib/system/libdyld.dylib+0x35ac)
+ #12 0x0 (<unknown module>)
+
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit ec6294116cc41ff1c3be081b626952fb7e614244
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date: Sun Oct 18 23:12:52 2015 -0700
+
+ osinit: Silence -Wunused-variable warnings
+
+ osinit.c:161:24: warning: unused variable 'devnull' [-Wunused-variable,Unused Entity Issue]
+ static const char *devnull = "/dev/null";
+ ^
+ osinit.c:162:10: warning: unused variable 'fname' [-Wunused-variable,Unused Entity Issue]
+ char fname[PATH_MAX];
+ ^
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 0a5d54f721de7e3ab3b6f4b080190a92bbe3429b
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date: Sun Oct 18 23:12:51 2015 -0700
+
+ dix: Silence -Wunused-variable warning by moving window.c off of legacy region defines
+
+ window.c:223:15: warning: unused variable 'pScreen' [-Wunused-variable,Unused Entity Issue]
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ ^
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit e09875701b980b8c4578fb310a922c9934c34eef
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Sun Oct 18 23:12:50 2015 -0700
@@ -168,9 +3196,27 @@ Date: Sun Oct 18 23:12:50 2015 -0700
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
- (cherry picked from commit e09875701b980b8c4578fb310a922c9934c34eef)
-commit 2ae94d6e8978faff330e9433eddf1697ba4693f6
+commit 5dc415048e4091b18cd7d123ebeae8f95ed5a4f5
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date: Sun Oct 18 23:12:49 2015 -0700
+
+ randr: Silence -Wshift-negative-value warnings
+
+ rrtransform.c:199:23: warning: shifting a negative signed value is undefined [-Wshift-negative-value,Semantic Issue]
+ rot_cos = F(-1);
+ ^~~~~
+ rrtransform.c:114:14: note: expanded from macro 'F'
+ ^~~~~~~~~~~~~~
+ ../render/picture.h:200:24: note: expanded from macro 'IntToxFixed'
+ ^~~~~~~~~~~~~~~~~~~~~~
+ /opt/X11/include/pixman-1/pixman.h:130:56: note: expanded from macro 'pixman_int_to_fixed'
+ ~~~ ^
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 9a2a05a9a7ba02921fa29844c4cad41243c41326
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Wed Oct 14 15:13:42 2015 -0700
@@ -181,9 +3227,86 @@ Date: Wed Oct 14 15:13:42 2015 -0700
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 9a2a05a9a7ba02921fa29844c4cad41243c41326)
-commit a88460ca82c7aed00177a5bb733b98a7f9b45968
+commit a7a00e4bd8153e0386c7e58d6b30a7a96f15fdb0
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date: Wed Oct 14 15:13:39 2015 -0700
+
+ security: Silence some benign -Wformat warnings
+
+ XID may be either 'unsigned long' or 'unsigned int' depending on:
+
+ typedef unsigned long CARD64;
+ typedef unsigned int CARD32;
+ typedef unsigned long long CARD64;
+ typedef unsigned long CARD32;
+
+ typedef unsigned long XID;
+ typedef CARD32 XID;
+
+ so when building with -Wformat, we get some warnings that are benign. This silences them.
+
+ security.c:215:52: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
+ [-Wformat,Format String Issue]
+ SecurityAudit("revoked authorization ID %d\n", pAuth->id);
+ ~~ ^~~~~~~~~
+ %lu
+ CC dpmsstubs.lo
+ security.c:553:25: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
+ [-Wformat,Format String Issue]
+ client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
+ ^~~~~~~~~
+ security.c:553:55: warning: format specifies type 'int' but the argument has type 'CARD32' (aka 'unsigned long')
+ [-Wformat,Format String Issue]
+ client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
+ ^~~~~~~~~~~~~~
+ security.c:554:10: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
+ [-Wformat,Format String Issue]
+ pAuth->group, eventMask);
+ ^~~~~~~~~~~~
+ security.c:554:24: warning: format specifies type 'int' but the argument has type 'Mask' (aka 'unsigned long')
+ [-Wformat,Format String Issue]
+ pAuth->group, eventMask);
+ ^~~~~~~~~
+ security.c:781:19: warning: format specifies type 'unsigned int' but the argument has type 'Mask' (aka 'unsigned
+ long')
+ [-Wformat,Format String Issue]
+ requested, rec->id, cid,
+ ^~~~~~~~~
+ security.c:781:30: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
+ [-Wformat,Format String Issue]
+ requested, rec->id, cid,
+ ^~~~~~~
+ security.c:863:23: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
+ [-Wformat,Format String Issue]
+ rec->pWin->drawable.id, wClient(rec->pWin)->index,
+ ^~~~~~~~~~~~~~~~~~~~~~
+ security.c:893:31: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
+ [-Wformat,Format String Issue]
+ rec->pWin->drawable.id,
+ ^~~~~~~~~~~~~~~~~~~~~~
+ security.c:915:39: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
+ [-Wformat,Format String Issue]
+ rec->client->index, rec->pWin->drawable.id,
+ ^~~~~~~~~~~~~~~~~~~~~~
+
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit aa73d587fece225753d8e6b8773a9c8b85823bd9
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date: Wed Oct 14 15:13:38 2015 -0700
+
+ xres: Silence -Wunused-function warnings when building !COMPOSITE or !RENDER
+
+ xres.c:422:1: warning: unused function 'ResFindCompositeClientWindowPixmaps' [-Wunused-function,Unused Entity Issue]
+ ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata)
+ ^
+
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 85eb90ea45e89033b97bf71a13c5c70fec8f6871
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Wed Oct 14 15:13:36 2015 -0700
@@ -211,9 +3334,8 @@ Date: Wed Oct 14 15:13:36 2015 -0700
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 85eb90ea45e89033b97bf71a13c5c70fec8f6871)
-commit 0f051cb4c3af6c3b906c2f210e3b6858dd7a5f53
+commit 9f0fcd14b52f8481cbb3b3b9c6e06f64ff003cc8
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Wed Oct 14 15:13:35 2015 -0700
@@ -230,9 +3352,8 @@ Date: Wed Oct 14 15:13:35 2015 -0700
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 9f0fcd14b52f8481cbb3b3b9c6e06f64ff003cc8)
-commit 8a30fd207cd4f560696ffd4463284ef123970e96
+commit 610dd8a58a75bb6a5b7d7abbae476d1cc4be519e
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Wed Oct 14 15:13:34 2015 -0700
@@ -250,9 +3371,90 @@ Date: Wed Oct 14 15:13:34 2015 -0700
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 610dd8a58a75bb6a5b7d7abbae476d1cc4be519e)
-commit 0c5ef339ae36b530745b883347accf11b21b1fd6
+commit 4513f924a7065edbd267cf96837af94ce5a58a6f
+Author: Ken Thomases <ken@codeweavers.com>
+Date: Mon Oct 12 16:45:41 2015 -0700
+
+ XQuartz: Fix how we calculate the height of the OSX menu bar
+
+ +[NSScreen mainScreen] does not mean the primary display. It used to mean the
+ one with the key window. When "Displays have separate spaces" is enabled, it
+ means the active screen, the one whose menu bar is mostly opaque. As such, it
+ may not be the screen whose lower-left corner is located at (0, 0). That's
+ why its max-Y is not necessarily comparable to its height. That only works
+ for the primary display.
+
+ This code could use [[NSScreen screens] firstObject]. This is always the
+ primary display, the one whose lower-left corner is at (0, 0).
+
+ Once that's done, the above change should be reverted. The height of the
+ visible frame would be the full height of the screen minus the menu bar _and
+ the Dock_ if the Dock is along the bottom of the screen.
+
+ Actually, there's a theoretically-simpler approach: use
+ -[NSMenu menuBarHeight]. That replaces a long-deprecated method
+ +[NSMenuView menuBarHeight]. However, there was a bug in Tiger that led to
+ the former not working while the latter still worked. I haven't actually
+ checked recently.
+
+ CrossOver's still-kicking X server code uses this code, which tries all of
+ the above:
+
+ NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0];
+ aquaMenuBarHeight = [[NSApp mainMenu] menuBarHeight];
+ if (!aquaMenuBarHeight) aquaMenuBarHeight = [NSMenuView menuBarHeight];
+ if (!aquaMenuBarHeight) aquaMenuBarHeight =
+ NSHeight([primaryScreen frame]) - NSMaxY([primaryScreen visibleFrame]);
+
+ Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+ Signed-off-by: Ken Thomases <ken@codeweavers.com>
+
+commit 6e6827aac33eddeacfb37ef3d7b0397b1446bf66
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Mon Oct 12 02:06:10 2015 -0700
+
+ XQuartz: Remove InfoPlist.strings
+
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit df80e2649aa47957986554928e6bf41b86c15240
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Mon Oct 12 02:04:11 2015 -0700
+
+ XQuartz: Relax App Transport Security for communicating with the update server
+
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 880d4e78b1823bcc0e66e68270af1a475f097bb5
+Author: Jonas Ã…dahl <jadahl@gmail.com>
+Date: Wed Oct 7 12:02:39 2015 +0800
+
+ xwayland: Set physical screen size to something
+
+ When we have a single output, just set it to the physical size of that
+ output. Otherwise try to approximate it calculating a mean m.m. per
+ dot. Last fallback is to default to 96 DPI.
+
+ Signed-off-by: Jonas Ã…dahl <jadahl@gmail.com>
+ Reviewed-by: Daniel Stone <daniels@collabora.com>
+
+commit 216bdbc7351e2078d94857a3323f6cd8f0d2f191
+Author: Jonas Ã…dahl <jadahl@gmail.com>
+Date: Wed Oct 7 12:02:38 2015 +0800
+
+ xwayland: Update actual screen and root window size on output hot plug
+
+ When a new output is hot-plugged we need to not only update our internal
+ screen dimensions, but also the dix screen dimensions, screenInfo
+ dimensions and the root window dimensions.
+
+ https://bugs.freedesktop.org/show_bug.cgi?id=92273
+
+ Signed-off-by: Jonas Ã…dahl <jadahl@gmail.com>
+ Reviewed-by: Daniel Stone <daniels@collabora.com>
+
+commit 211d4c2d353b5e379716484055a3f58235ea65f4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Dec 14 15:55:22 2011 +0000
@@ -266,9 +3468,147 @@ Date: Wed Dec 14 15:55:22 2011 +0000
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
- (cherry picked from commit 211d4c2d353b5e379716484055a3f58235ea65f4)
-commit 025ae119a7561a911533ca69c8232147273af300
+commit 8a26a4aff570744347a8bed19f693bf631be464e
+Author: Alexandr Shadchin <alexandr.shadchin@gmail.com>
+Date: Sun Nov 27 02:49:02 2011 +0600
+
+ bsd: Remove LINKKIT
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
+
+commit ab3e34bf9ddff90261fbbe0e2604887459cd70ad
+Author: Alexandr Shadchin <alexandr.shadchin@gmail.com>
+Date: Sun Nov 27 02:49:01 2011 +0600
+
+ xfree86: Remove 386BSD
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
+
+commit c877048c8509a03f6aa69e533ab86c1039cfb6df
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Thu Jun 30 15:30:40 2011 +0100
+
+ glx: Synchronize Xserver glx/rensize.c with mesa src/glx/compsize.c
+
+ Noticed while investigating https://bugs.freedesktop.org/show_bug.cgi?id=30102
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+
+commit d08ac3660651c8614a1780750b76c48eeb0870b7
+Author: Jamey Sharp <jamey@minilop.net>
+Date: Thu May 12 15:21:52 2011 -0700
+
+ kdrive: Delete unused TOUCHSCREEN define.
+
+ There's nothing in configure to enable this, and KdTsPhyScreen isn't
+ defined anywhere.
+
+ [ajax: Rebase, also clean up Xfbdev]
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Jamey Sharp <jamey@minilop.net>
+
+commit e31fe8115ee080b58b2e96a5106f38e64944ce5e
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Wed Sep 23 15:35:58 2015 +0200
+
+ xwayland: Adjust screen size with rotation
+
+ bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92076
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ Tested-by: Artem Chudinov <arzeth0@gmail.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit f6ce23fbfc8804204fa103f98b94478387b94040
+Author: Fredrik Höglund <fredrik@kde.org>
+Date: Thu Sep 10 23:33:20 2015 +0200
+
+ present: Don't stash the MSC value when present_get_ust_msc fails
+
+ Otherwise we stash an uninitalized value, and later use it to compute
+ the msc_offset for the window. Also initialize ust and crtc_msc so we
+ never use uninitalized values when present_get_ust_msc fails.
+
+ This fixes clients getting stuck waiting indefinitely for an idle
+ event when a CRTC is turned off.
+
+ Signed-off-by: Fredrik Höglund <fredrik@kde.org>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+
+commit c1f5f9022f31ca4d662cc125fa80cb25386da6d1
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sun Sep 27 18:41:35 2015 -0700
+
+ glamor: Get rid of an extraneous ; at the end of a C source line
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+
+commit 10e9116b3f709bec6d6a50446c1341441a0564e4
+Author: Rui Matos <tiagomatos@gmail.com>
+Date: Tue Jul 15 15:57:20 2014 +0200
+
+ xwayland-input: Always set the xkb group index on modifiers events
+
+ While we have keyboard focus, the server's xkb code is already locking
+ and latching modifiers appropriately while processing keyboard
+ events.
+
+ Since there is no guaranteed order between wl_keyboard key and
+ modifiers events, if we got the modifiers event with a locked or
+ latched modifier and then process the key press event for that
+ modifier we would wrongly unlock/unlatch. To prevent this, we ignore
+ locked and latched modifiers while any of our surfaces has keyboard
+ focus.
+
+ But we always need to set the xkb group index since this might be
+ triggered programatically by the wayland compositor at any time.
+
+ Reviewed-by: Daniel Stone <daniels@collabora.com>
+
+commit f937032ee6526af3c9206a2d8c6eacdeeb490d3b
+Author: Andreas Wettstein <wettstein509@solnet.ch>
+Date: Sat Feb 15 17:37:24 2014 +0100
+
+ xkb: Keyboard mouse button emulation should not suppress other keyboard events
+
+ With this change, when a key mapped to an action to emulate mouse button
+ presses and releases is held down, other keys pressed during that time are
+ still processed normally. This is a prerequisite for proper support of
+ ISOLock.
+
+ Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch>
+ Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit 5447ac45bc090e8f3269979af4db55f619c5f278
+Author: Andreas Wettstein <wettstein509@solnet.ch>
+Date: Sat Feb 15 17:36:51 2014 +0100
+
+ xkb: Suppress autorepeat for Set and Lock of Mods, Groups, and Controls
+
+ The autorepeat for these actions was not correctly implemented, as the key
+ repeat would be mistakenly interpreted as key releases. Rather than fixing
+ this, this change simply disables autorepeat for Set/Lock actions, for two
+ reasons:
+
+ - Autorepeating Set/Lock keys make complicate the interactions of actions.
+
+ - Autorepeating Set/Lock keys have no apparent benefit, but hurt in the real
+ world for layouts such as de(neo): Neo has a Level5 shift on the LSGT key,
+ and a Level5 lock on Level5 of the same key. This is unusable if LSGT
+ autorepeats. However, disabling autorepeat for key LSGT completely is not
+ ideal for users that have a "usual" layout besides Neo, where LSGT carries
+ symbols.
+
+ Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch>
+ Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit fbac451724f7e1b8ce6b6e0505cc33ccd41c5158
Author: Arcady Goldmints-Orlov <arcadyg@nvidia.com>
Date: Thu Oct 4 14:22:13 2012 -0700
@@ -284,9 +3624,127 @@ Date: Thu Oct 4 14:22:13 2012 -0700
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Arcady Goldmints-Orlov <arcadyg@nvidia.com>
Reviewed-by: Søren Sandmann <ssp@redhat.com>
- (cherry picked from commit fbac451724f7e1b8ce6b6e0505cc33ccd41c5158)
-commit 62e2aa02efe45198d6b013530d269815ebd4c9ba
+commit 19a87257f92e7f57a167fc03fba014ee22d8e1ab
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date: Fri Sep 25 14:04:34 2015 +0100
+
+ glamor: move 'dri3_capable' extension checks after eglMakeCurrent
+
+ Otherwise we'll fail and/or crash as no context is bound.
+
+ Fixes: 64e6124f27e (glamor: move GL_OES_EGL_image check next to EGL_EXT_image_dma_buf_import)
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92105
+ Cc: Michel Dänzer <michel@daenzer.net>
+ Cc: Nick Sarnie <commendsarnex@gmail.com>
+ Reported-by: Nick Sarnie <commendsarnex@gmail.com>
+ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Tested-by: Nick Sarnie <commendsarnex@gmail.com>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+
+commit dca5770af9e20bb1148374ebfd60931a81b148a2
+Merge: a31bbc4 21f384b
+Author: Adam Jackson <ajax@redhat.com>
+Date: Fri Sep 25 10:23:28 2015 -0400
+
+ Merge remote-tracking branch 'mchalupa/output-bugs'
+
+commit a31bbc450a08622aadafc264b3efe57e465eaecb
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Tue Sep 22 19:25:43 2015 -0700
+
+ protocol.txt: Add MIT-SHM 1.2 requests
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 424ba5de56e2ddf173bb0d26daa821f12897f18f
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Tue Sep 22 19:25:42 2015 -0700
+
+ protocol.txt: Add DRI3 1.0 requests
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 7e6b7c799455fdeac082cf2a064fe1ba432e92ca
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Tue Sep 22 19:25:41 2015 -0700
+
+ protocol.txt: Add Present 1.0 requests
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit fd653194be731e4e32f95f38446e0dcbf56d04c9
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Tue Sep 22 19:25:40 2015 -0700
+
+ protocol.txt: Add RANDR 1.5 requests
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 1ea8fb96bc6a95d98dd67fc9d4c4e4b858383d34
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Tue Sep 22 19:25:39 2015 -0700
+
+ protocol.txt: Remove extensions that died before Xorg was born
+
+ Adobe-DPS-Extension, DEC-XTRAP, X3D-PEX, XIE
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 21f384b7b8b571151805674c9d384e2ad7f8b7ea
+Author: Marek Chalupa <mchqwerty@gmail.com>
+Date: Thu May 21 15:43:43 2015 +0200
+
+ xwayland: do not add output into output_list multiple times
+
+ output.done event can be sent even on some property change, not only
+ when announcing the output. Therefore we must check if we already have it
+ otherwise we may corrupt the list by adding it multiple times.
+
+ This fixes bug when xwayland looped indefinitely in output.done handler
+ and that can be reproduced following these steps (under X without
+ multi-monitor setup):
+ 1) run weston --output-count=2
+ 2) run xterm, move it so that half is on one output
+ and half on the other
+ 3) close second output, try run weston-terminal
+
+ weston sends updated outputs which trigger this bug.
+
+ v2. factor out common code into function
+ move expecting_events into right branch
+
+ Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
+
+commit 95014ad2a7815282efdecc895bf14742b4b3ccb3
+Author: Dima Ryazanov <dima@gmail.com>
+Date: Tue May 12 10:21:18 2015 -0700
+
+ xwayland: Remove the output from the list after destroying it
+
+ [Marek Chalupa]: rebased to master
+
+ Signed-off-by: Dima Ryazanov <dima@gmail.com>
+
+commit 550984c95ef0bee1886dbb54e35edc0852772e2f
+Author: Dima Ryazanov <dima@gmail.com>
+Date: Fri May 15 22:38:28 2015 -0700
+
+ xwayland: Destroy xwl_output when wl_output gets removed
+
+ This makes Xwayland correctly handle a monitor getting unplugged.
+
+ [Marek]: use xorg_list_for_each_entry_safe
+
+ Signed-off-by: Dima Ryazanov <dima@gmail.com>
+ Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
+
+commit 6ca496b7c3ccfd677c8c1bee88cc509a5e3c9e04
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Mon Sep 21 22:36:41 2015 -0700
@@ -300,9 +3758,21 @@ Date: Mon Sep 21 22:36:41 2015 -0700
Reported-by: jes@posteo.de
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 6ca496b7c3ccfd677c8c1bee88cc509a5e3c9e04)
-commit 616239c15d03f5b527288965f7eee0edebdcf20f
+commit 6c2c6fb5a7b44f50811722eb8621afb272aff2e8
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Sep 21 07:16:14 2015 +0100
+
+ Xext, os: Remove OS-internal usages within XACE and XSELinux
+
+ These extensions were accessing internal OS functions and
+ structures. Expose the necessary functionality to them and remove
+ their use of osdep.h
+
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9af111fe045d82192bacc722940e1d92a8ba4cbd
Author: Keith Packard <keithp@keithp.com>
Date: Mon Sep 21 07:16:13 2015 +0100
@@ -318,9 +3788,103 @@ Date: Mon Sep 21 07:16:13 2015 +0100
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 9af111fe045d82192bacc722940e1d92a8ba4cbd)
-commit 87151fefb06dc96fac79e93a3151300bd8037f3d
+commit 9ee05c8987245350976ebc0df4953c60da6bcc70
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Thu Aug 13 13:11:31 2015 +0100
+
+ debug output format fix in RRMonitorCrtcName()
+
+ xorg/xserver/randr/rrmonitor.c:35:5: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘RRCrtc’ [-Werror=format=]
+
+ RRCrtc is XID is CARD32, which inside the server is unsigned long or int
+ depending on architecture, so a cast is required.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+
+commit fe253296035277f7a3adfad6eb239fee41714d22
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Thu Aug 13 13:11:37 2015 +0100
+
+ debug output format fix in xf86Helper.c
+
+ xserver/hw/xfree86/common/xf86Helper.c:1834:12: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Atom’ [-Werror=format=]
+ xserver/hw/xfree86/common/xf86Helper.c:1834:12: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘Atom’ [-Werror=format=]
+
+ Atom is unfortunately unsigned long or unsigned int depending on the
+ architecture, so a cast is required.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+
+commit dc2998bf060957b1fdd6bd2ea4f76c5154233a1b
+Author: Dima Ryazanov <dima@gmail.com>
+Date: Tue May 12 10:21:19 2015 -0700
+
+ xwayland: Remove a useless out-of-memory check
+
+ snprintf does not allocate memory, so we can never get an out-of-memory
+ error.
+
+ (Also, the error handler would free xwl_output after it was already
+ registered as an event listener.)
+
+ Signed-off-by: Dima Ryazanov <dima@gmail.com>
+ Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
+
+commit b469fc72d2dd0cf60760fa0828ed73771c2a0512
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Feb 25 16:03:13 2015 -0500
+
+ composite: Factor out backing store transition
+
+ No functional change.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 6da3f5d04f6a1cda0c858280f9561f9fbc323275
+Author: Dave Airlie <airlied@redhat.com>
+Date: Wed Sep 23 11:19:00 2015 +1000
+
+ glx: fix regression with copy sub buffer disappearing
+
+ So copy sub buffer isn't a core extensions it's a driver extension
+ which means we are using totally the wrong interface to query for it
+ here, which means bad things happen when you roll out this code,
+ for instance MESA_copy_sub_buffer stops working.
+
+ This is just the hack I'm sticking in Fedora to avoid the regression
+ for now, but hopefully will inspire us.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 5e9457c41c05b65da7e39bd8944ec761479f19dd
+Author: Eric Anholt <eric@anholt.net>
+Date: Mon May 5 11:10:07 2014 -0700
+
+ fbdevhw: Fix a const qualifier warning
+
+ We're passing string literals to these functions.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+
+commit 88355cedfc9b3940b9fe1599fbf6e0272c57f8a9
+Author: Eric Anholt <eric@anholt.net>
+Date: Mon May 5 11:10:08 2014 -0700
+
+ kdrive: Remove dead debug arrays.
+
+ These have never been used in the history of the tree, and were
+ producing string literal const loss warnings.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+
+commit e6f8a0340b72113474ccfbf1ea447558b705995a
Author: Eric Anholt <eric@anholt.net>
Date: Mon May 5 11:10:06 2014 -0700
@@ -328,9 +3892,41 @@ Date: Mon May 5 11:10:06 2014 -0700
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit e6f8a0340b72113474ccfbf1ea447558b705995a)
-commit 20bdec91712957c069c410ed34045f4090821ac7
+commit fca98ce5e7d6424265c35a1219c2240d3342f627
+Author: Egbert Eich <eich@freedesktop.org>
+Date: Fri Feb 7 16:21:48 2014 +0100
+
+ libxf86config: libxf86config_internal -> libxf86config
+
+ Now since the installable libxf86config is gone, rename
+ libxf86config_internal to libxf86config.
+
+ Signed-off-by: Egbert Eich <eich@freedesktop.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit dabf7c3590b427c185089128ecfd967f188f2658
+Author: Egbert Eich <eich@freedesktop.org>
+Date: Fri Feb 7 16:21:47 2014 +0100
+
+ libxf86config: Remove
+
+ The library used by the Xserver to read and parse the configuration file
+ could be built so that it culd be installed as a separate lib and used
+ by external programs.
+
+ Apparently there has not been any interest in this for quite a while as
+ this library has been broken for a long time now in the sense that it
+ was calling functions provided by the Xserver which were not implemented
+ for the external library.
+
+ Since this library is useless as it is anyway when built let's drop
+ support for it.
+
+ Signed-off-by: Egbert Eich <eich@freedesktop.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit c7f84c880bbbb508016ad80390a11961b1c4214d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Jan 27 09:44:48 2014 +0000
@@ -347,9 +3943,8 @@ Date: Mon Jan 27 09:44:48 2014 +0000
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
- (cherry picked from commit c7f84c880bbbb508016ad80390a11961b1c4214d)
-commit 5c0aea5fb3bda98a442b982b4622cc81a700ebd7
+commit 98e170971c6b06d64a5bc7418bf6ae6ae985a3ae
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date: Mon Oct 14 17:07:29 2013 +0300
@@ -359,9 +3954,8 @@ Date: Mon Oct 14 17:07:29 2013 +0300
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
- (cherry picked from commit 98e170971c6b06d64a5bc7418bf6ae6ae985a3ae)
-commit 293d0efe3c742f5010cddf5ad0420d0d1c43959b
+commit 91c7acfc3447a0073dd1db260cf05115d94ce7e8
Author: Michal Srb <msrb@suse.com>
Date: Mon Oct 7 17:57:14 2013 +0300
@@ -374,9 +3968,97 @@ Date: Mon Oct 7 17:57:14 2013 +0300
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
- (cherry picked from commit 91c7acfc3447a0073dd1db260cf05115d94ce7e8)
-commit 833e3e84a077766b16b42d2b24931c14cd00bfb9
+commit 5437949a51fa6d9c9c83336d46ae57398f390ee3
+Author: Egbert Eich <eich@freedesktop.org>
+Date: Sat Oct 5 13:57:13 2013 +0200
+
+ fbdevhw: Disable FBIOBLANK ioctl if not supported
+
+ Some ioctls may not be supported by the kernel however their failure
+ is non-fatal to the driver. Unfortunately we only know once we try
+ to execute the ioctl however the sematics of the fbdev driver API
+ doesn't allow upper layers to disable the call.
+ Instead of changing the fbdevHW driver API just disable the call to
+ this ioctl on the module level when detecting such a case.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Egbert Eich <eich@freedesktop.org>
+
+commit 49fe4ee7b7085b616028d6afe67767a60a8adf82
+Author: Matt Turner <mattst88@gmail.com>
+Date: Thu Feb 7 17:29:00 2013 -0800
+
+ compiler.h: Remove dead STANDALONE_MMIO
+
+ The only drivers I can find that used this are the r128 and radeon DRI
+ drivers. r128 is dead and the radeon driver wasn't including Xorg's
+ compiler.h and still worked.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Matt Turner <mattst88@gmail.com>
+
+commit d2a6962474978437545120ebc1fcfb909d901d55
+Author: Andy Ritger <aritger@nvidia.com>
+Date: Wed Jun 20 11:52:34 2012 -0700
+
+ mi: Log an error if mieqProcessInputEvents() recurses.
+
+ v2:
+
+ Uses BUG_WARN_MSG to also provide a stack trace. (Peter Hutterer)
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Andy Ritger <aritger@nvidia.com>
+
+commit cc57ab4fc8b9dc15531f0dd9f5b352fa99a80cd0
+Author: Andy Ritger <aritger@nvidia.com>
+Date: Wed Jun 20 11:52:33 2012 -0700
+
+ Remove static qualifier on mieqProcessInputEvents()'s 'event'
+
+ This isn't necessary.
+
+ Signed-off-by: Andy Ritger <aritger@nvidia.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 44ea291b78b39ed5fd03f9693ac9525b866e183b
+Author: Tomas Carnecky <tomas.carnecky@gmail.com>
+Date: Mon May 21 19:47:01 2012 +0000
+
+ Remove NO_LIBCWRAPPER define
+
+ I'll just refer to 1faba79 (Death to libcwrapper., 2007-12-03).
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Tomas Carnecky <tomas.carnecky@gmail.com>
+
+commit 1e95a7df5f2e919ce59c5188d2ad1b30c3ac8595
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Thu Mar 15 13:46:56 2012 +1000
+
+ dix: put warning in for scroll increments of 0
+
+ If the increment is 0 but this is a scroll axis, it's definitely a bug.
+ Nonetheless, it has happened, so put a warning in and a return statement
+ that we avoid the infinite loop and hopefully be able to reproduce later.
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 63efa2e7e91349dfecc849d30c5de84b3c911fe9
+Author: Bryce Harrington <bryce@canonical.com>
+Date: Wed Nov 30 12:54:29 2011 -0800
+
+ test: Fix typo and drop documentation references to glib.
+
+ The X server doesn't use glib for the tests any more.
+
+ Signed-off-by: Bryce Harrington <bryce@canonical.com>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 4c7cefe24001279a558dd875949d40ede49ef702
Author: Dave Airlie <airlied@redhat.com>
Date: Thu Oct 20 11:44:28 2011 +0100
@@ -389,9 +4071,19 @@ Date: Thu Oct 20 11:44:28 2011 +0100
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 4c7cefe24001279a558dd875949d40ede49ef702)
-commit 26a5364d507dff012283dc5d6f86b80c5936a807
+commit 668cce3f5a175109442f0ef9b50354db95e66b44
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Fri Sep 23 14:11:17 2011 -0400
+
+ dmx: fix typo in the title
+
+ [ajax: fix typo in the commit message]
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 7ed0c3912e1cbab960df308b9d4ea618be757fd2
Author: Andrea Canciani <ranma42@gmail.com>
Date: Wed Jul 27 10:52:31 2011 +0200
@@ -404,64 +4096,100 @@ Date: Wed Jul 27 10:52:31 2011 +0200
Signed-off-by: Andrea Canciani <ranma42@gmail.com>
Reviewed-by: Soren Sandmann <ssp@redhat.com>
- (cherry picked from commit 7ed0c3912e1cbab960df308b9d4ea618be757fd2)
-commit a22b828dad72091210234a9e671c93015c970ac6
+commit 3d9f578e6f0d13ecada7dc677fe61a4dd3d05e18
Author: Cyril Brulebois <kibi@debian.org>
-Date: Sun Jun 5 23:32:26 2011 +0200
+Date: Mon Jun 6 02:25:11 2011 +0200
- man: Fix case for MIT-unspecified.
+ doc: Convert an \fP pair into appropriate tags.
- include/site.h says that COMPILEDDISPLAYCLASS is MIT-unspecified, rather
- than MIT-Unspecified. Fix the manpage accordingly.
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Cyril Brulebois <kibi@debian.org>
+
+commit d97ffef1ab95546634a74618ed2661cfd6d980b1
+Author: Cyril Brulebois <kibi@debian.org>
+Date: Mon Jun 6 02:25:10 2011 +0200
+
+ doc: Try to avoid repetitions.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Cyril Brulebois <kibi@debian.org>
+
+commit 2cce6ffc350d3840337a4d045d5cf14bb7bf2b32
+Author: Cyril Brulebois <kibi@debian.org>
+Date: Mon Jun 6 02:25:08 2011 +0200
+
+ doc: Fix punctuation.
+
+ [ajax: s/ponct/punct/]
Signed-off-by: Cyril Brulebois <kibi@debian.org>
+ Reviewed-by: Jamey Sharp <jamey@minilop.net>
+
+commit e7e3320098cad585d46f74d8a0c6946a080b0263
+Author: Cyril Brulebois <kibi@debian.org>
+Date: Mon Jun 6 02:25:07 2011 +0200
+
+ doc: Fix extraneous &gt;
+
+ It looks like it serves no special purpose.
+
+ Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 4803f7139131cee7bbf50b32d667d6e60302df09)
+ Signed-off-by: Cyril Brulebois <kibi@debian.org>
-commit 92f6b363972c13f564e1f8f555783fe9cb557db5
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Tue Sep 22 19:25:43 2015 -0700
+commit 9b4f10d7490f6610a65d401958296c95ce891c8b
+Author: Cyril Brulebois <kibi@debian.org>
+Date: Mon Jun 6 02:25:06 2011 +0200
- protocol.txt: Add MIT-SHM 1.2 requests
+ doc: Fix grammar and typos.
- Reviewed-by: Adam Jackson <ajax@redhat.com>
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit a31bbc450a08622aadafc264b3efe57e465eaecb)
+ Reviewed-by: Jamey Sharp <jamey@minilop.net>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Signed-off-by: Cyril Brulebois <kibi@debian.org>
-commit 0b2a9db19bad7567ea30341f3432ae384a21c106
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Tue Sep 22 19:25:42 2015 -0700
+commit 5b92a0a84a067b653cc457d8ec0fe25f36a9d207
+Author: Cyril Brulebois <kibi@debian.org>
+Date: Mon Jun 6 02:25:05 2011 +0200
- protocol.txt: Add DRI3 1.0 requests
+ doc: Fix alignment.
- Reviewed-by: Adam Jackson <ajax@redhat.com>
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 424ba5de56e2ddf173bb0d26daa821f12897f18f)
+ Reviewed-by: Jamey Sharp <jamey@minilop.net>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Signed-off-by: Cyril Brulebois <kibi@debian.org>
-commit d135b4cf6bc427f6f83f57ff70c673b64a6ae6af
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Tue Sep 22 19:25:41 2015 -0700
+commit 0b8fca667b45f00249a3dd9ee79d2a77a4177b24
+Author: Cyril Brulebois <kibi@debian.org>
+Date: Mon Jun 6 02:24:59 2011 +0200
- protocol.txt: Add Present 1.0 requests
+ doc: Fix typo.
+
+ Signed-off-by: Cyril Brulebois <kibi@debian.org>
+ Reviewed-by: Jamey Sharp <jamey@minilop.net>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 1226f7ddd78da5dc8b6f6442600ac2deb3986e8d
+Author: Cyril Brulebois <kibi@debian.org>
+Date: Mon Jun 6 02:25:01 2011 +0200
+
+ doc: Get rid of RCS tags.
Reviewed-by: Adam Jackson <ajax@redhat.com>
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 7e6b7c799455fdeac082cf2a064fe1ba432e92ca)
+ Signed-off-by: Cyril Brulebois <kibi@debian.org>
-commit 32f3432ea65f2eec01a7eed0e9bf93e1bc082241
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Tue Sep 22 19:25:39 2015 -0700
+commit 4803f7139131cee7bbf50b32d667d6e60302df09
+Author: Cyril Brulebois <kibi@debian.org>
+Date: Sun Jun 5 23:32:26 2011 +0200
- protocol.txt: Remove extensions that died before Xorg was born
+ man: Fix case for MIT-unspecified.
- Adobe-DPS-Extension, DEC-XTRAP, X3D-PEX, XIE
+ include/site.h says that COMPILEDDISPLAYCLASS is MIT-unspecified, rather
+ than MIT-Unspecified. Fix the manpage accordingly.
- Reviewed-by: Adam Jackson <ajax@redhat.com>
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 1ea8fb96bc6a95d98dd67fc9d4c4e4b858383d34)
+ Signed-off-by: Cyril Brulebois <kibi@debian.org>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-commit 5c5bc6a9c2050562e9330c0b7b98a5261ee0b113
+commit 593270038d8983b99aa0aaa24509da3cb944be5c
Author: Tiago Vignatti <tiago.vignatti@nokia.com>
Date: Tue Sep 7 15:50:26 2010 +0300
@@ -471,9 +4199,8 @@ Date: Tue Sep 7 15:50:26 2010 +0300
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
- (cherry picked from commit 593270038d8983b99aa0aaa24509da3cb944be5c)
-commit a55bfcc0df09920a5e3ec9f923d5168992a63f29
+commit 3cd56dd2cfbfcce6ba68c22450d51139208993ab
Author: Robert Hooker <sarvatt@ubuntu.com>
Date: Fri Dec 3 23:42:27 2010 -0500
@@ -483,9 +4210,8 @@ Date: Fri Dec 3 23:42:27 2010 -0500
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
- (cherry picked from commit 3cd56dd2cfbfcce6ba68c22450d51139208993ab)
-commit 9cb53672b4b4c847544c37888db6e2ae354697a2
+commit 272ba9f021c6d08ebd6a2d96da3737f5630bcbd5
Author: Robert Hooker <sarvatt@ubuntu.com>
Date: Fri Dec 3 23:39:51 2010 -0500
@@ -493,9 +4219,40 @@ Date: Fri Dec 3 23:39:51 2010 -0500
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
- (cherry picked from commit 272ba9f021c6d08ebd6a2d96da3737f5630bcbd5)
-commit 8810c46a98a107cf53b30696cfad6e388b73024d
+commit 64e6124f27e9900809d0009b95c7c0b5b8788e6b
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date: Tue Sep 22 15:35:40 2015 +0100
+
+ glamor: move GL_OES_EGL_image check next to EGL_EXT_image_dma_buf_import
+
+ We're using the former only as the latter is present. Thus in some cases
+ we might incorrectly error out if it's missing.
+
+ Namely - glamor_glx, glamor_egl without gbm, EGL_KHR_gl_texture_2D_image
+ or EGL_EXT_image_dma_buf_import.
+
+ Fixes 58d54ee82df(glamor: explicitly check for GL_OES_EGL_image)
+ Cc: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Suggested-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+
+commit aa5606be1c0ea72b38de48ca333c7da5436368ef
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri May 15 10:25:46 2015 -0700
+
+ Make configure test for LD_NO_UNDEFINED_FLAG on Solaris work w/autoconf 2.69
+
+ After upgrading from autoconf 2.68 to 2.69, this test started failing with
+ "conftest.c", line 149: undefined symbol: NULL
+ so use a raw 0 pointer to avoid header dependencies in the autoconf
+ generated test case.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
+
+commit fa0bb01899d586e02cf51892c17edd22e462a46c
Author: Adam Jackson <ajax@redhat.com>
Date: Mon Sep 21 15:23:23 2015 -0400
@@ -518,9 +4275,21 @@ Date: Mon Sep 21 15:23:23 2015 -0400
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
- (cherry picked from commit fa0bb01899d586e02cf51892c17edd22e462a46c)
-commit 9a4ea1f5ea7f813d28cf322aca6f2ea8c427bd1a
+commit b25f7d0c165c4d32c73fbdf9080012503d319ba1
+Merge: db1089e 1ba4fde
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Sep 21 17:34:48 2015 -0400
+
+ Merge commit '1ba4fde1015fc6da19dfbfdf0f77f1071416e215'
+
+ This is ofourdan/xwayland, minus:
+
+ xwayland: Always update the wl_pointer cursor on pointer focus
+
+ which was rejected for ABI and design issues.
+
+commit db1089eafc1c5371fa0030202de588d2e2b4f8e5
Author: Keith Packard <keithp@keithp.com>
Date: Mon Sep 21 07:16:17 2015 +0100
@@ -548,9 +4317,8 @@ Date: Mon Sep 21 07:16:17 2015 +0100
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit db1089eafc1c5371fa0030202de588d2e2b4f8e5)
-commit abe44851018d0e5bace2971682e724aa7444e96f
+commit a3a40291330bad10401fe2bcdbc097ce742b026a
Author: Keith Packard <keithp@keithp.com>
Date: Mon Sep 21 07:16:16 2015 +0100
@@ -567,9 +4335,8 @@ Date: Mon Sep 21 07:16:16 2015 +0100
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit a3a40291330bad10401fe2bcdbc097ce742b026a)
-commit c72d4f00277c977faecd697ef3407518f11f909d
+commit 3cd7d33380953f2a315dd79ab74d7340c83fd80a
Author: Egbert Eich <eich@freedesktop.org>
Date: Tue Mar 31 09:06:46 2015 +0200
@@ -581,9 +4348,8 @@ Date: Tue Mar 31 09:06:46 2015 +0200
Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 3cd7d33380953f2a315dd79ab74d7340c83fd80a)
-commit 7a53179425ab5112adcace1489cad6e8072af6b1
+commit 245040f0d0b937efe14d947468a641a95398776a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Oct 6 10:02:22 2014 +0100
@@ -603,9 +4369,8 @@ Date: Mon Oct 6 10:02:22 2014 +0100
Reported-by: Christoph Haag <haagch@frickel.club>
Tested-by: Christoph Haag <haagch@frickel.club>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
- (cherry picked from commit 245040f0d0b937efe14d947468a641a95398776a)
-commit a85808ce3fc26511996d01e7e6ec1192b8c3d216
+commit 9d65a0de95a20632f2a6a04ba596dcdd76d9f5e2
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Sep 18 08:44:07 2015 -0700
@@ -615,9 +4380,8 @@ Date: Fri Sep 18 08:44:07 2015 -0700
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 9d65a0de95a20632f2a6a04ba596dcdd76d9f5e2)
-commit 49d04a43360267fb7cbbeec0ea4985ba224fb59c
+commit 82eb490b0a341729f25d0c42a937fe29d99da521
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Thu Sep 17 16:04:33 2015 -0700
@@ -640,9 +4404,53 @@ Date: Thu Sep 17 16:04:33 2015 -0700
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 82eb490b0a341729f25d0c42a937fe29d99da521)
-commit daf15b551631e8a98960e629039bef1880de8f82
+commit 18a93da9b1f429bc54a8b236fcdd38dab58375cd
+Author: Jasper St. Pierre <jstpierre@mecheye.net>
+Date: Wed Feb 18 12:41:25 2015 -0800
+
+ test/xi1: Update .gitignore
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+
+commit cdd1d58159140759052ec043bc9828d94ba97bc7
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Mon Jul 6 17:15:44 2015 +0100
+
+ mingw: Fix NO_LOCAL_CLIENT_CRED build
+
+ Commit 4b4b9086 "os: support new implicit local user access mode [CVE-2015-3164
+ 2/3]" carefully places the relevant code it adds under !NO_LOCAL_CLIENT_CRED,
+ but unfortunately doesn't notice that NO_LOCAL_CLIENT_CRED is defined as a
+ side-effect in the middle of GetLocalClientCreds(), so many of these checks
+ precede its definition.
+
+ Move the check if NO_LOCAL_CLIENT_CRED should be defined to configure.ac, so it
+ always occurs before it's first use.
+
+ v2:
+ Move check to configure.ac
+
+ v3:
+ Use AC_CACHE_CHECK and name cache varaible appropriately
+
+ [ajax: Massaged commit message]
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Ray Strode <rstrode@redhat.com>
+
+commit f8a2c087c89ed5b638a2e62987f255d3f04f914e
+Author: Javier Jardón <jjardon@gnome.org>
+Date: Sun Mar 22 03:52:03 2015 +0000
+
+ configure.ac: Add support for new versions of systemd
+
+ ... that only provide a unique libsystemd.pc file
+
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Javier Jardón <jjardon@gnome.org>
+
+commit 67dd34fa734085ed67ba7790820fe4743d48b60f
Author: Adam Jackson <ajax@redhat.com>
Date: Wed Jun 10 13:20:59 2015 -0400
@@ -653,9 +4461,8 @@ Date: Wed Jun 10 13:20:59 2015 -0400
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- (cherry picked from commit 67dd34fa734085ed67ba7790820fe4743d48b60f)
-commit 10a944889228acdeaf471766407fc84c8947e931
+commit a579e6ba7763749d51d16e3a54941e06939df07a
Author: Ian Scott <ian.scott@arteris.com>
Date: Thu May 21 16:13:12 2015 -0700
@@ -667,9 +4474,30 @@ Date: Thu May 21 16:13:12 2015 -0700
Signed-off-by: Ian Scott <ian.scott@arteris.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
- (cherry picked from commit a579e6ba7763749d51d16e3a54941e06939df07a)
-commit 0134dc1b56e8c7c19f655e583ff3f3ba0d6cae4e
+commit a6c0564f7f00aa66fd19180f75b6b09904444f06
+Author: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
+Date: Mon Mar 23 10:58:03 2015 -0300
+
+ ephyr: move host_has_extension() implementation to hostx.c
+
+ This is a trivial patch that moves host_has_extension() implementation
+ from ephyr.c to hostx.c so that it can be called by hostx.c internal
+ functions. Also rename function to hostx_has_extension() for consistency.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
+
+commit 9414ba3683231afe9bee0f941c53998dea218615
+Author: Jürg Billeter <j@bitron.ch>
+Date: Sun Feb 8 11:34:18 2015 +0100
+
+ ephyr: fix -no-host-grab argument processing
+
+ Signed-off-by: Jürg Billeter <j@bitron.ch>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 1f915e8b524dd02011158aa038935970684c7630
Author: Daniel Drake <drake@endlessm.com>
Date: Wed May 20 13:16:12 2015 -0600
@@ -686,9 +4514,8 @@ Date: Wed May 20 13:16:12 2015 -0600
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Daniel Drake <drake@endlessm.com>
- (cherry picked from commit 1f915e8b524dd02011158aa038935970684c7630)
-commit f92c0b9f94deaa03f792c3c93efd802fec268e8f
+commit 94ab7455abc213fc96760e29ab2e943ec682fb22
Author: Daniel Drake <drake@endlessm.com>
Date: Tue May 12 16:39:22 2015 -0600
@@ -708,9 +4535,181 @@ Date: Tue May 12 16:39:22 2015 -0600
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Daniel Drake <drake@endlessm.com>
- (cherry picked from commit 94ab7455abc213fc96760e29ab2e943ec682fb22)
-commit d2e4a9d4ac2f479de23e15af5e528cfa2bffb30f
+commit 1ba4fde1015fc6da19dfbfdf0f77f1071416e215
+Author: Boyan Ding <stu_dby@126.com>
+Date: Mon Aug 4 21:16:34 2014 +0800
+
+ xwayland: Activate and enable device on first capability reporting
+
+ Commit 2172714c changed behavior of capability handling, but it only
+ solved part of the problem. If Xwayland is launched without a capability
+ (e.g. no pointer device is connected when Xwayland was spinned up), and
+ later that capability comes, the device added will not be automatically
+ initialized. This patch initializes the device when the capability is
+ reported for the first time, thus avoiding the problem.
+
+ Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=81819
+ Signed-off-by: Boyan Ding <stu_dby@126.com>
+ Reviewed-by: Daniel Stone <daniels@collabora.com>
+
+commit f1995de1c43733a9e586605674c4071357a58e78
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Fri Aug 28 14:28:11 2015 +1000
+
+ xwayland: call through to miPointerWarpCursor on warp_cursor
+
+ This is (eventually) called during
+ InitializeSprite() → *pScreen->SetCursorPosition → miPointerSetCursorPosition
+ when a device is set to floating. We don't do anything special outselves, but
+ we need to pass on to the next layer to make sure the device is initialized
+ properly. Otherwise, pScreen stays NULL and eventually crashes the server when
+ we try to clean up behind us.
+
+ Test case: grab a device → floats it, ungrab again → crash
+
+ Reported-by: Jason Gerecke <killertofu@gmail.com>
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
+
+commit 373599ab008f0ecf8f3fb62455a5474f5ec8f499
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Fri Aug 28 14:28:10 2015 +1000
+
+ xwayland: fix crash on enter/leave for a grabbed slave device
+
+ When grabbed, the slave device is floating, i.e. the master device is NULL.
+ CheckMotion() isn't happy with NULL. Make sure we pass the right device in,
+ either the master device when the device is attached, or the device itself
+ when it is floating.
+
+ Reported-by: Jason Gerecke <killertofu@gmail.com>
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
+
+commit f1ba8858d5baa63cde6361492e6d349ce1b38d21
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Fri Aug 28 14:28:09 2015 +1000
+
+ xwayland: use the device pointer we already have
+
+ No functional changes.
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
+
+commit 44f250a7e8eb86d3f41da5d186d839e7a14648a3
+Author: Carlos Garnacho <carlosg@gnome.org>
+Date: Wed May 27 18:42:00 2015 +0200
+
+ xwayland: Remove related touchpoints when unrealizing windows
+
+ These sequences are forgotten to all purposes.
+
+ Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
+ Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
+
+commit b7cd48f71d269101e28ae6855b895057378715f9
+Author: Carlos Garnacho <carlosg@gnome.org>
+Date: Wed May 27 18:41:59 2015 +0200
+
+ xwayland: Implement the wl_touch interface
+
+ A DeviceIntPtr with touch valuators is also created in order to deliver
+ the translated touch events. The lifetime of xwl_touch structs is tied
+ to the wayland ones, finishing in either wl_touch.up() or wl_touch.cancel()
+
+ Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
+ Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
+
+commit d96eccc057094be31c1ee4e3b3246675934cb19d
+Author: Carlos Garnacho <carlosg@gnome.org>
+Date: Wed May 27 18:41:58 2015 +0200
+
+ xwayland: Add xwl_touch struct
+
+ This struct holds information about each individual, ongoing touchpoint.
+ A list of these is held by the xwl_seat.
+
+ Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
+ Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
+
+commit c1565f3ca663aa4ba4316d7248737ab817116fbd
+Author: Jasper St. Pierre <jstpierre@mecheye.net>
+Date: Sat Feb 21 11:53:59 2015 -0800
+
+ xwayland-input: Remove our XYToWindow handler
+
+ This was built as a hack for simple Wayland compositors like Weston
+ which were lazy and didn't want to configure windows server-side when
+ moved.
+
+ Since comboboxes and menus are separate toplevel O-R windows, this hack
+ breaks input as it needs to be traced normally, not simply sent to the
+ focused window.
+
+ X11 toolkits really do need their windows to be configured correctly
+ for their O-R windows comboboxes or menus other things, so let's fix
+ the lazy compositors and remove this.
+
+ I have tested this patch with both Weston and Mutter and neither of
+ them require any changes, and it fixes comboboxes and menus.
+
+ If somebody then wants to revert 73698d4, that's fine by me, so we
+ reduce the amount of API that DDXen have.
+
+ Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
+ Reviewed-by: Daniel Stone <daniels@collabora.com>
+
+commit 58d54ee82dfae5486bc09d04d2760c922d54d631
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date: Wed Sep 16 22:10:22 2015 +0100
+
+ glamor: explicitly check for GL_OES_EGL_image
+
+ Otherwise we'll fail miserably later on as we try to use
+ glEGLImageTargetTexture2DOES.
+
+ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+
+commit 139e36dd5cbab80a9296129f3d25379dc01442b3
+Author: Ilia Mirkin <imirkin@alum.mit.edu>
+Date: Fri Sep 4 18:56:19 2015 -0400
+
+ modesetting: fix up output naming convention
+
+ A user on a nouveau-driven card ran into a problem where DVI-D-1 and
+ DVI-I-1 were aliasing. The simplest fix is to provide the full connector
+ names. While we're at it, rename the output names to match what is in
+ the kernel, and start counting the connectors from 1 rather than 0. The
+ only deviation is HDMI vs HDMI-A, which kept its original name.
+
+ This will break backwards compatibility with existing xorg.conf's that
+ reference output names, but the alternative is to create a separate
+ counting system, further disconnecting from the kernel names.
+
+ Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit a907ead7864ac5720854fa3333b66fd5187d5eaf
+Author: Marek Chalupa <mchqwerty@gmail.com>
+Date: Thu Aug 20 07:43:51 2015 +0200
+
+ xwayland: implement repeat_info event
+
+ xwayland windows ignored any key repeating settings
+ advertised by a compositor
+
+ v2. don't hardcode version 4 of seat
+ use AutoRepeatModeOn/Off
+
+ v3. use min(version, 4) when binding seat
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
+
+commit e8e3368298c98a1292bb1c727e2f3d56539e2eac
Author: Felix Janda <felix.janda@posteo.de>
Date: Mon Aug 17 20:25:53 2015 +0200
@@ -721,9 +4720,8 @@ Date: Mon Aug 17 20:25:53 2015 +0200
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Felix Janda <felix.janda@posteo.de>
- (cherry picked from commit e8e3368298c98a1292bb1c727e2f3d56539e2eac)
-commit e863ab57eb94f32485a501e547eedc96f9249ad1
+commit dfa8b37cfb2589f2474f6fcc755dde77bfdd6fed
Author: Adam Jackson <ajax@redhat.com>
Date: Wed Jul 29 11:30:15 2015 -0400
@@ -742,9 +4740,26 @@ Date: Wed Jul 29 11:30:15 2015 -0400
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
- (cherry picked from commit dfa8b37cfb2589f2474f6fcc755dde77bfdd6fed)
-commit 1688b7517e91dba84244c01d1a01fa8145b4367a
+commit 75ee874e432d959a70fbc2c9208d20dbfa5cbc5f
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri May 1 17:06:47 2015 +0100
+
+ Build fix for DMX
+
+ ./../dix/.libs/libdix.a(pixmap.o): In function `PixmapStartDirtyTracking':
+ xorg/xserver/dix/pixmap.c:194: undefined reference to `RRTransformCompute'
+
+ I'm not quite sure how 0db457b fixes this
+
+ Move RANDR_LIB to after DIX_LIB, so the reference to RRTransformCompute in
+ DIX_LIB is satisfied.
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Tested-by: Olivier Fourdan <ofourdan@redhat.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 634e357be2ec400f63bd5c42f706b709b6ddabc3
Author: Ingo Schwarze <schwarze@usta.de>
Date: Sun Aug 30 15:26:40 2015 +0200
@@ -759,9 +4774,139 @@ Date: Sun Aug 30 15:26:40 2015 +0200
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 634e357be2ec400f63bd5c42f706b709b6ddabc3)
-commit e9385b42a3f6cb1eadd5080019b9faf9538e5608
+commit c74c074d8e4981eb4509e120e14d15387bdc94ef
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Mon Aug 31 08:18:59 2015 +0200
+
+ dix: export ResourceClientBits()
+
+ ResourceClientBits() might be used by the modules as well, need to
+ mark the symbol as visible to that the linker can resolve it at
+ run time.
+
+ /usr/bin/X: symbol lookup error:
+ /usr/lib64/xorg/modules/extensions/libglx.so: undefined symbol:
+ ResourceClientBits
+
+ bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91763
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit dbfed3a291619c2530f314394bd73d71e2567e78
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Sep 1 19:03:33 2015 -0700
+
+ Bump version to 1.17.99.901 (1.18 RC1)
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit bcb60a49c5e74aa11d0256874659afddea91e53d
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Tue Jul 7 23:11:07 2015 +0100
+
+ debug output format fix in TouchEventHistoryPush()
+
+ xserver/build.x86_64/../dix/touch.c:468:16: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Werror=format=]
+
+ %zu is C99, but is already used in a few places. Perhaps doc/c-extensions needs
+ to mention it.
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 1f96a0d273e56d01cd240e6a4ef8765e0ffe058c
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri May 1 17:40:06 2015 +0100
+
+ debug output format fix in ephyrProcessMouseMotion()
+
+ xorg/xserver/hw/kdrive/ephyr/ephyr.c:979:9: error: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘ScreenPtr’ [-Werror=format=]
+
+ This looks like a genuine bug, and ephyrCursorScreen->myNum was meant here
+ rather than ephyrCursorScreen
+
+ v2:
+ Insert a ":" as well
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 8cc88fbe9e4699cd2570641eb2752977b5505d16
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri May 1 17:33:35 2015 +0100
+
+ debug output format fix in DRISwapContext()
+
+ xorg/xserver/hw/xfree86/dri/dri.c:1695:19: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘DRIContextPrivPtr’ [-Werror=format=] ^
+ xorg/xserver/hw/xfree86/dri/dri.c:1695:19: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘DRIContextPrivPtr’ [-Werror=format=]
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 27cf5840272810ae20fdae550db71ec48cf1b02d
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Tue Jul 7 23:29:51 2015 +0100
+
+ debug output format fix in TI.c
+
+ xserver/hw/xfree86/ramdac/TI.c:118:12: error: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Werror=format=]
+ xserver/hw/xfree86/ramdac/TI.c:118:12: error: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=]
+ xserver/hw/xfree86/ramdac/TI.c:118:12: error: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘long unsigned int’ [-Werror=format=]
+
+ Use %lu for an unsigned long
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 6cc0f3d95d62e33a5d86f865159cc3526d3a9dc5
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Tue Jul 7 23:20:29 2015 +0100
+
+ debug output format fix in xf86Events.c
+
+ xserver/hw/xfree86/common/xf86Events.c:183:5: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘void *’ [-Werror=format=]
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit d206c240c0b85c4da44f073d6e9a692afb6b96d2
+Author: Olivier Fourdan <ofourdan@redhat.com>
+Date: Tue Jul 7 18:19:50 2015 +0200
+
+ configurable maximum number of clients
+
+ Make the maximum number of clients user configurable, either from the command
+ line or from xorg.conf
+
+ This patch works by using the MAXCLIENTS (raised to 512) as the maximum
+ allowed number of clients, but allowing the actual limit to be set by the
+ user to a lower value (keeping the default of 256).
+
+ There is a limit size of 29 bits to be used to store both the client ID and
+ the X resources ID, so by reducing the number of clients allowed to connect to
+ the X server, the user can increase the number of X resources per client or
+ vice-versa.
+
+ Parts of this patch are based on a similar patch from Adam Jackson
+ <ajax@redhat.com>
+
+ This now requires at least xproto 7.0.28
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 7ecdfbf0af3547295b245efa754123db65cabb43
+Merge: bca4f4b a0b4f30
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Aug 17 18:53:25 2015 -0700
+
+ Merge remote-tracking branch 'airlied/modesetting-zaphod'
+
+commit bca4f4b56c7619d17f9df46f7aac392ea01a9429
Author: Keith Packard <keithp@keithp.com>
Date: Mon Aug 17 18:37:10 2015 -0700
@@ -773,9 +4918,21 @@ Date: Mon Aug 17 18:37:10 2015 -0700
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
- (cherry picked from commit bca4f4b56c7619d17f9df46f7aac392ea01a9429)
-commit 00b3f5a2eda7b819057d9e150754dc0a509f6e39
+commit 5daf1295cb4f71510da595721d10f7ea3b74d1b9
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Aug 17 18:35:20 2015 -0700
+
+ dixfont.h: Include fontutil.h before GetGlyphs is #defined
+
+ This eliminates the duplicate declaration of dixGetGlyphs when
+ fontutil.h gets included after dixfont.h has defined GetGlyphs as
+ dixGetGlyphs.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit d4710004367ab8eab794a12385ca7ed3acc9a0e0
Author: Dave Airlie <airlied@redhat.com>
Date: Thu Aug 13 09:25:37 2015 +1000
@@ -807,9 +4964,8 @@ Date: Thu Aug 13 09:25:37 2015 +1000
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit d4710004367ab8eab794a12385ca7ed3acc9a0e0)
-commit 3aacda0aea221f703d469de82a8a6778677b34d0
+commit 7f506b8099d23c2f045ad26cc5cff00109b69d7b
Author: Dave Airlie <airlied@redhat.com>
Date: Thu Aug 13 09:25:36 2015 +1000
@@ -818,9 +4974,66 @@ Date: Thu Aug 13 09:25:36 2015 +1000
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 7f506b8099d23c2f045ad26cc5cff00109b69d7b)
-commit 02c94ccddf4fc9ea08555e929b051201ad5fbc79
+commit b923443816320d0636d6fd40c3c1125b93332907
+Author: Dave Airlie <airlied@redhat.com>
+Date: Thu Aug 13 09:25:35 2015 +1000
+
+ mioverlay.c: remove shadowed pScreen.
+
+ This is already defined at the function entry.
+
+ fixes warning:
+ CC mivaltree.lo
+ mioverlay.c: In function 'miOverlayWindowExposures':
+ mioverlay.c:993:23: warning: declaration of 'pScreen' shadows a previous local [-Wshadow]
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ ^
+ mioverlay.c:986:15: note: shadowed declaration is here
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit a0b4f30b1f584d2957c9c99e430da5740d2d4ab2
+Author: Mario Kleiner <mario.kleiner.de@gmail.com>
+Date: Wed Aug 5 00:08:40 2015 +0200
+
+ modesetting: Add more missing options to man page.
+
+ Descriptions for Options PageFlip and SWCursor.
+
+ Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 19e1dc8f6ea6d7ff5ba4a5caa0e2f40a47879408
+Author: Dave Airlie <airlied@redhat.com>
+Date: Wed Jul 22 03:56:13 2015 +0100
+
+ modesetting: add zaphod support (v3)
+
+ This adds zaphod and ZaphodHeads support
+ to the the in-server modesetting driver.
+
+ this is based on a request from Mario,
+ and on the current radeon driver, along
+ with some patches from Mario to bring things
+ up to the state of the art in Zaphod.
+
+ v2: fixup vblank fd registring.
+ v3: squash Mario's fixes.
+ modesetting: Allow/Fix use of multiple ZaphodHead outputs per x-screen.
+ modesetting: Take shift in crtc positions for ZaphodHeads configs into account.
+ modesetting: Add ZaphodHeads description to man page.
+ small cleanups (airlied).
+
+ Reviewed-and-tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 533fb627398e20f863234d780f4463e37007515b
Author: Adam Jackson <ajax@redhat.com>
Date: Tue Aug 4 13:17:02 2015 -0400
@@ -850,9 +5063,8 @@ Date: Tue Aug 4 13:17:02 2015 -0400
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 533fb627398e20f863234d780f4463e37007515b)
-commit 71e4b536cd16c1880889e5a3a88f550674c12882
+commit 11f4cc47a815c5d6284b1338e748e2605b2dd779
Author: Adam Jackson <ajax@redhat.com>
Date: Tue Aug 4 13:17:01 2015 -0400
@@ -883,9 +5095,8 @@ Date: Tue Aug 4 13:17:01 2015 -0400
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 11f4cc47a815c5d6284b1338e748e2605b2dd779)
-commit 75399d32f686e8aaa11a5afafacf9fdfad3d1bb4
+commit ea03e314f98e5d8ed7bf7a508006a3d84014bde5
Author: Eric Anholt <eric@anholt.net>
Date: Mon Jul 27 13:54:00 2015 -0700
@@ -897,9 +5108,8 @@ Date: Mon Jul 27 13:54:00 2015 -0700
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
- (cherry picked from commit ea03e314f98e5d8ed7bf7a508006a3d84014bde5)
-commit 288b355f48c58cbe458cf92d78246a8abcccd946
+commit 6916d32ab3ec1aa922094abce7fac22884ee4e83
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jul 19 08:24:39 2015 -0700
@@ -908,79 +5118,68 @@ Date: Sun Jul 19 08:24:39 2015 -0700
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit 6916d32ab3ec1aa922094abce7fac22884ee4e83)
-commit abfda3b941281e12cec35e36dd0e9d87e59ce699
-Author: Adam Jackson <ajax@redhat.com>
-Date: Tue May 19 11:31:25 2015 -0400
+commit 0a458a908ec071a4da5d22c760581e0c5ec885ce
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Wed Jul 22 15:37:23 2015 +0900
- glx: Implement GLX_ARB_context_flush_control
-
- This extension allows clients to opt out of the implicit glFlush on
- context release, which is quite nice for performance for clients using
- multiple contexts. The server doesn't really need to be aware of the
- client's decision, at least for direct contexts, but it does need to not
- reject the context attribute out of hand.
+ glamor: Make our EGL context current before calling into GL in glamor_init
- This patch won't do anything unless built against a Mesa that defines
- the __DRI2_FLUSH_CONTROL extension (and a new enough glxext.h, but
- that's been there since 10.3 at least).
+ Without this, the context of another screen may be current, or no context
+ at all if glamor_egl_init failed for another screen.
- Reviewed-by: James Jones <jajones@nvidia.com>
- Signed-off-by: Adam Jackson <ajax@redhat.com>
- (cherry picked from commit 995ff11422eb49160abfe276f471e412b16cab9d)
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
-commit 23d52080a5d9c03dc2707e71f6d878c58d000a55
-Author: Fredrik Höglund <fredrik@kde.org>
-Date: Thu Sep 10 23:33:20 2015 +0200
+commit a8a0f6464a33c12c1de495d74fd478c0d952643e
+Author: Aaron Plattner <aplattner@nvidia.com>
+Date: Thu Jul 16 15:12:52 2015 -0700
- present: Don't stash the MSC value when present_get_ust_msc fails
+ xfree86: Bump video driver ABI version to 20
- Otherwise we stash an uninitalized value, and later use it to compute
- the msc_offset for the window. Also initialize ust and crtc_msc so we
- never use uninitalized values when present_get_ust_msc fails.
+ Commit 90db5edf119187f8b1b9207c8c384d6cd7ef9edc modified the signature of
+ StartPixmapTrackingProcPtr, so drivers implementing that need to use the updated
+ definition.
- This fixes clients getting stuck waiting indefinitely for an idle
- event when a CRTC is turned off.
-
- Signed-off-by: Fredrik Höglund <fredrik@kde.org>
- Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
- (cherry picked from commit f6ce23fbfc8804204fa103f98b94478387b94040)
+ Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
-commit 2a561fac70c8b04305eab6372298a128e6553d3f
-Author: Dave Airlie <airlied@redhat.com>
-Date: Wed Sep 23 11:19:00 2015 +1000
+commit 2fcfa532532fbe4a7f668556808e6245ff4e36bc
+Merge: cb695b0 7b0f940
+Author: Eric Anholt <eric@anholt.net>
+Date: Fri Jul 17 10:15:01 2015 -0700
- glx: fix regression with copy sub buffer disappearing
-
- So copy sub buffer isn't a core extensions it's a driver extension
- which means we are using totally the wrong interface to query for it
- here, which means bad things happen when you roll out this code,
- for instance MESA_copy_sub_buffer stops working.
+ Merge remote-tracking branch 'ajax/xserver-next' into master
+
+commit cb695b0f3b8def4d1ac02458fe630b65f6a5a3e6
+Author: Armin K <krejzi@email.com>
+Date: Thu Jul 16 14:54:48 2015 +0200
+
+ xfree86/os-support/linux: Fix make distcheck
- This is just the hack I'm sticking in Fedora to avoid the regression
- for now, but hopefully will inspire us.
+ Header was added in 1dba5a0b194653b0effb01a918bd7338b0c6bcb9
+ but not in Makefile.am, resulting in missing header in the
+ distribution tarball.
- Reviewed-by: Adam Jackson <ajax@redhat.com>
- Signed-off-by: Dave Airlie <airlied@redhat.com>
- (cherry picked from commit 6da3f5d04f6a1cda0c858280f9561f9fbc323275)
+ Signed-off-by: Eric Anholt <eric@anholt.net>
-commit 92effabee1fe7225709acdca4adb2783b78392d4
-Author: Michel Dänzer <michel.daenzer@amd.com>
-Date: Wed Jul 22 15:37:23 2015 +0900
+commit 29efa905ec1e22d66b517378c6e5ad47a09d6977
+Author: Robert Ancell <robert.ancell@canonical.com>
+Date: Thu Jul 16 12:26:05 2015 +1200
- glamor: Make our EGL context current before calling into GL in glamor_init
+ modesetting: Use correct types for return values of glamor BO exports.
- Without this, the context of another screen may be current, or no context
- at all if glamor_egl_init failed for another screen.
+ glamor_name_from_pixmap and glamor_fd_from_pixmap return CARD16 and
+ CARD32 values via pointers. The current code uses uint16_t and
+ uint32_t which will probably be the same but it's safer to use the
+ datatypes as specified by the function.
- Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ Signed-off-by: Robert Ancell <robert.ancell@canonical.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
- Reviewed-by: Dave Airlie <airlied@redhat.com>
- Reviewed-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit 0a458a908ec071a4da5d22c760581e0c5ec885ce)
-commit a420301a8bc9376a174315bc32d3cd7e89dacd7f
+commit db5337afb248edf81087cf8d74006fc496d70589
Author: Dave Airlie <airlied@redhat.com>
Date: Wed Jul 15 17:56:11 2015 +1000
@@ -998,9 +5197,8 @@ Date: Wed Jul 15 17:56:11 2015 +1000
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit db5337afb248edf81087cf8d74006fc496d70589)
-commit fb17307b1bbb6842a2c76c0a934c4f50aaea69d1
+commit 1a18513a4eb3fa22459dd9f7d8f0e275aff679ec
Author: Michel Dänzer <michel.daenzer@amd.com>
Date: Fri Jul 10 15:28:52 2015 +0900
@@ -1013,234 +5211,297 @@ Date: Fri Jul 10 15:28:52 2015 +0900
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit 1a18513a4eb3fa22459dd9f7d8f0e275aff679ec)
-commit 8415eca0abc00ec96cb94cd656b58edbfa8f09a3
-Author: Michel Dänzer <michel.daenzer@amd.com>
-Date: Mon Jul 6 18:45:51 2015 -0700
+commit fde13565c1b2462ee38f2a446ad3c9157261afa2
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jul 2 13:57:05 2015 -0700
- glamor: Use a single glTexImage2D call for core font atlas texture data v2
+ glamor: Drop unused box translation/bounds code.
- Instead of one glTexSubImage2D call for each glyph.
+ These are dead since the glamor_copy.c replacement.
- This significantly reduces the amount of time it takes for xterm to start
- up on a fresh X server with the radeonsi driver.
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit ab5aa270c79d70f095bc7abadeef227b4062027c
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jul 2 13:52:05 2015 -0700
+
+ glamor: Move cache_format to glamor_fbo.c, where it's used.
- v2: Use GLYPHWIDTHBYTESPADDED instead of hardcoding 4 bytes glyph
- alignment (Keith Packard)
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit 0ca783e8ee5dfb086fbfa64d26173bcca78b4010
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jul 2 13:50:42 2015 -0700
+
+ glamor: Drop another dead function.
- [ajax 1.17: fix up summary as suggested by Michel]
+ This hasn't been used since the format swap/revert stuff for pictures
+ was added back in 2012.
- Reviewed-by: Keith Packard <keithp@keithp.com>
- Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
- Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 732e3b9c08532f40656010eac9d128601cc88c3f)
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
-commit eb9dea1e25388a8fdc31b9b138bd5ece32a3eb54
-Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Sun Oct 18 23:01:53 2015 -0700
+commit c1111710628cc2a9dfaee0d74ea9fceee990095b
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jul 2 13:33:01 2015 -0700
- XQuartz: Cleanup formatting of DarwinEQInit that was butchered by automation a few years ago
+ glamor: Take transforms into account when preparing for a fallback.
- Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
- (cherry picked from commit 27ad21254f257bac6c647315d749ee69f20c24e0)
+ This function takes the start x/y and the destination's width/height,
+ so it only works if there's no transform. We could potentially
+ transform this box and take its bounds with some rounding, but this at
+ least gets us to read out enough data.
+
+ Note that this does the same overshoot on destination pictures with a
+ transform attached, but that seems unlikely to be used anyway.
+
+ v2: Add XXX comment for the commit message note (Suggested by Michel).
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1)
+ Reviewed-by: Dave Airlie <airlied@redhat.com> (v1)
-commit 5e7aaf5e93e51e79548da46381c91d0efc4d9885
-Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Sun Oct 18 23:03:23 2015 -0700
+commit c16e086dace81151f399485e5c686617a43d5b94
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jul 2 13:25:40 2015 -0700
- XQuartz: Make sure that darwin_all_modifier_mask_additions is 0-terminated
+ glamor: Drop dead drm_stride field.
- Found by ASan
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit 8097c887023b72744cb2cb943c2deca7ca0c404a
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jul 2 13:11:20 2015 -0700
+
+ glamor: Drop tracking of the last picture attached to pixmaps.
- X.Org X Server 1.17.99.901 Build Date: 20151018
- ================================================================
- ==40471==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000101fed7a4 at pc 0x000101584030 bp 0x70000029f920 sp 0x70000029f918
- READ of size 4 at 0x000101fed7a4 thread T7
- #0 0x10158402f in DarwinEQInit darwinEvents.c:377
- #1 0x10157f3bc in InitInput darwin.c:566
- #2 0x101be87ad in dix_main main.c:268
- #3 0x10159131b in server_thread quartzStartup.c:66
- #4 0x7fff8a535c12 in _pthread_body (/usr/lib/system/libsystem_pthread.dylib+0x3c12)
- #5 0x7fff8a535b8f in _pthread_start (/usr/lib/system/libsystem_pthread.dylib+0x3b8f)
- #6 0x7fff8a533374 in thread_start (/usr/lib/system/libsystem_pthread.dylib+0x1374)
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Acked-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit 0dbdb83b0d0254ac67fb33da8bf9ebc0ef4e8081
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jul 2 12:55:27 2015 -0700
+
+ glamor: Use the actual picture's format when uploading memory pixmaps.
- 0x000101fed7a4 is located 0 bytes to the right of global variable 'darwin_all_modifier_mask_additions' defined in 'darwinEvents.c:181:12'
- (0x101fed7a0) of size 4
- SUMMARY: AddressSanitizer: global-buffer-overflow darwinEvents.c:377 DarwinEQInit
- Shadow bytes around the buggy address:
- 0x1000203fdaa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 0x1000203fdab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 0x1000203fdac0: f9 f9 f9 f9 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9
- 0x1000203fdad0: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00
- 0x1000203fdae0: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 00 f9 f9 f9
- =>0x1000203fdaf0: f9 f9 f9 f9[04]f9 f9 f9 f9 f9 f9 f9 00 00 00 00
- 0x1000203fdb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 0x1000203fdb10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 0x1000203fdb20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 0x1000203fdb30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 0x1000203fdb40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- Shadow byte legend (one shadow byte represents 8 application bytes):
- Addressable: 00
- Partially addressable: 01 02 03 04 05 06 07
- Heap left redzone: fa
- Heap right redzone: fb
- Freed heap region: fd
- Stack left redzone: f1
- Stack mid redzone: f2
- Stack right redzone: f3
- Stack partial redzone: f4
- Stack after return: f5
- Stack use after scope: f8
- Global redzone: f9
- Global init order: f6
- Poisoned by user: f7
- Container overflow: fc
- Array cookie: ac
- Intra object redzone: bb
- ASan internal: fe
- Left alloca redzone: ca
- Right alloca redzone: cb
- Thread T7 created by T0 here:
- #0 0x10242ee99 in wrap_pthread_create
- (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x37e99)
- #1 0x101591089 in create_thread quartzStartup.c:78
- #2 0x101590ed9 in QuartzInitServer quartzStartup.c:95
- #3 0x1015697eb in X11ApplicationMain X11Application.m:1277
- #4 0x101575dc0 in X11ControllerMain X11Controller.m:984
- #5 0x10159171a in server_main quartzStartup.c:127
- #6 0x101540fc0 in do_start_x11_server bundle-main.c:436
- #7 0x101544869 in _Xstart_x11_server mach_startupServer.c:189
- #8 0x101545c96 in mach_startup_server mach_startupServer.c:398
- #9 0x7fff8d1b70f3 in mach_msg_server (/usr/lib/system/libsystem_kernel.dylib+0x110f3)
- #10 0x1015416e7 in main bundle-main.c:774
- #11 0x7fff8bd975ac in start (/usr/lib/system/libdyld.dylib+0x35ac)
- #12 0x0 (<unknown module>)
+ The pixmap->picture is just the *last* picture attached to the pixmap,
+ so you'd potentially be looking at the wrong one when trying to
+ temporarily upload to avoid a composite fallback.
- Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
- (cherry picked from commit 3db7e332d374bf8cee581c31b7d50d7ac0509187)
+ There's some trickiness in glamor_render.c when we're dealing with the
+ upload of a GLAMOR_MEMORY pixmap as both the source and mask using
+ different formats, where we smash the source's format to a new value
+ so that the mask can use the same uploaded bits. Dropping most of
+ that should be safe, since it will be uploaded as the source first, so
+ the smashed format will still be used.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Acked-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
-commit 52506f60b6680e11fa418f4e59e7159eb5b7ec39
-Author: Ken Thomases <ken@codeweavers.com>
-Date: Mon Oct 12 16:45:41 2015 -0700
+commit 1fd11c46aa086e4b80cb1bafa87c6b19a8014fd1
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jul 2 12:49:36 2015 -0700
- XQuartz: Fix how we calculate the height of the OSX menu bar
+ glamor: Move glamor_render.c pict handling to glamor_picture.c
- +[NSScreen mainScreen] does not mean the primary display. It used to mean the
- one with the key window. When "Displays have separate spaces" is enabled, it
- means the active screen, the one whose menu bar is mostly opaque. As such, it
- may not be the screen whose lower-left corner is located at (0, 0). That's
- why its max-Y is not necessarily comparable to its height. That only works
- for the primary display.
+ These functions aren't used by anything else, and are specific to the
+ temporary-upload-as-a-weird-format path of glamor_render.c, called
+ through glamor_upload_picture_to_texture().
- This code could use [[NSScreen screens] firstObject]. This is always the
- primary display, the one whose lower-left corner is at (0, 0).
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit 53aed06fb45aed4145754cd622508563ad262c4a
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jul 2 12:48:01 2015 -0700
+
+ glamor: Drop dead glamor_upload_bits_to_pixmap_texture() proto.
- Once that's done, the above change should be reverted. The height of the
- visible frame would be the full height of the screen minus the menu bar _and
- the Dock_ if the Dock is along the bottom of the screen.
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit b51e079e1877411fde72372c3953d71e42ac1d6e
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jul 2 12:40:05 2015 -0700
+
+ glamor: Use the new upload/download interface for XV uploads.
- Actually, there's a theoretically-simpler approach: use
- -[NSMenu menuBarHeight]. That replaces a long-deprecated method
- +[NSMenuView menuBarHeight]. However, there was a bug in Tiger that led to
- the former not working while the latter still worked. I haven't actually
- checked recently.
+ We don't need any of its weird handling of picture formats, since our
+ XV pixmaps don't have any pictures attached.
- CrossOver's still-kicking X server code uses this code, which tries all of
- the above:
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit 1bd966d16d87ed908547144c68850f2cdee05469
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Jul 2 12:21:41 2015 -0700
+
+ glamor: Ignore picture formats when choosing color for core rendering.
- NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0];
- aquaMenuBarHeight = [[NSApp mainMenu] menuBarHeight];
- if (!aquaMenuBarHeight) aquaMenuBarHeight = [NSMenuView menuBarHeight];
- if (!aquaMenuBarHeight) aquaMenuBarHeight =
- NSHeight([primaryScreen frame]) - NSMaxY([primaryScreen visibleFrame]);
+ Attaching a picture to a pixmap doesn't change its GL format, so it
+ doesn't change how core rendering should be assigning colors to it.
- Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
- Signed-off-by: Ken Thomases <ken@codeweavers.com>
- (cherry picked from commit 4513f924a7065edbd267cf96837af94ce5a58a6f)
+ (Imagine XCreatePixmap(), optional XCreatePicture(pixmap) with various
+ formats, XFillRectangle, XGetImage(). If the XGetImage results
+ changed, this would be wrong).
+
+ Fixes all failures in "rendercheck -t fill" and, as a result, the
+ remaining failures in "rendercheck -t blend -o src -f
+ a8r8g8b8,x2r10g10b10"
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
-commit 3a7ed42d33d264f7151fa2ed9bef7a55bde1c0e2
-Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Mon Oct 12 02:06:10 2015 -0700
+commit 5a81de8284f851751a8943aa6a905377be315c7b
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Jul 8 12:18:28 2015 -0700
- XQuartz: Remove InfoPlist.strings
+ glamor: Don't try to do rendering with unsupported formats.
- Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
- (cherry picked from commit 6e6827aac33eddeacfb37ef3d7b0397b1446bf66)
+ I'm amazed we've made it as far as we have without these checks: if
+ you made an unusual format picture that wasn't the normal a8r8g8b8 or
+ x8r8g8b8 or a8, we'd go ahead and try to render with it, ignoring that
+ the sampler would fetch totally wrong bits.
+
+ Fixes 260 tests in rendercheck -t blend -o src -f a8r8g8b8,x2r10g10b10
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
-commit d939043594fe75c49f356e717f94195050f6d08c
-Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Mon Oct 12 02:04:11 2015 -0700
+commit 0d7cbd6f5a2b5c9c690979da9c1483e8f6133903
+Author: Hans de Goede <hdegoede@redhat.com>
+Date: Fri Jul 3 20:42:48 2015 +0200
- XQuartz: Relax App Transport Security for communicating with the update server
+ glamor_egl: Properly free resources on init-error and exit
- Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
- (cherry picked from commit df80e2649aa47957986554928e6bf41b86c15240)
+ glamor_egl_init() was not undoing any of the init steps on init error,
+ add an glamor_egl_cleanup() function and use this both on error and on exit
+ to cleanup the various resources.
+
+ Even on a clean exit eglTerminate() was not being called, causing the fd
+ dup()-ed by eglInitialize() to stay open, call eglTerminate() from the new
+ glamor_egl_cleanup() to fix this.
+
+ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
-commit ba00d8fe70cbb16e45e578437defaf3eed6d25f4
-Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Tue Jun 9 23:41:12 2015 -0700
+commit 80b6652c9fb9cdff91e92fa16c07e2cc63b06f44
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jul 7 17:21:55 2015 -0700
- XQuartz: Silence -Wformat-security for NSRunAlertPanel
+ glamor: Drop a bunch of glamor_priv == NULL checks.
- Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
- (cherry picked from commit 9003a3e5c55903ce4e371b2d5cb5030b5f97ae0e)
+ Now that it's always non-null when the pixmap is non-null, we don't
+ need so much of this. glamor_get_pixmap_private() itself still
+ accepts a NULL pixmap and returns NULL, because of glamor_render.c
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
-commit 434890171d5ab4ec61a05596cb33e469a61a870c
-Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Tue Jun 9 23:34:50 2015 -0700
+commit a2a2f6e34bd49e7ae31779274d52e800595660bc
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jun 30 16:20:18 2015 -0700
- XQuartz: Silence -Wunused-function
+ glamor: Ask the server to always allocate our private.
- quartzKeyboard.c:741:1: warning: unused function 'macroman2ucs' [-Wunused-function,Unused Entity Issue]
- macroman2ucs(unsigned char c)
- ^
- 1 warning generated.
+ This avoids a lot of screwing around to attach our privates later. It
+ means that non-glamor pixmaps now gain 120 bytes of glamor privates on
+ 64-bit (which has quite a bit of fixable bloat), and glamor pixmaps
+ take one less pointer of storage (not counting malloc overhead).
- Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
- (cherry picked from commit 3a6fa115759c787ec34483437021ad1e55c52423)
+ Note that privates start out zero-filled, which matches the callocs we
+ were doing when making our own privates, and in the case of an fb
+ pixmap that has a priv where it didn't before, the type ends up being
+ GLAMOR_MEMORY as we would want.
+
+ v2: Clarify that the GLAMOR_MEMORY enum must be 0 (as it was
+ previosuly), so that the new pixmap private behavior is as
+ expected. Suggested by keithp.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1)
+ Reviewed-by: Keith Packard <keithp@keithp.com>
-commit 601e9b5f8c147ef4242b4bda76e9a16e3d635370
-Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Tue Jun 9 23:30:50 2015 -0700
+commit d278c30e68d79e86a3e2207b629d1e461856f907
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jun 30 20:35:59 2015 -0700
- XQuartz: Silence -Wunused-variable
+ glamor: Drop dead glamor_is_large_picture().
- X11Controller.m:939:9: warning: unused variable 'remain' [-Wunused-variable,Unused Entity Issue]
- int remain;
- ^
+ It died as of keithp's new glyphs code.
- Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
- (cherry picked from commit 9fe7f5ccada37e2d2a2fa92064b92a0334a3fcdd)
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
-commit 414fc605a930c5baa7e65cc303b05f3977b86baf
-Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Tue Jun 9 23:29:40 2015 -0700
+commit cd608a516d2c59ebfb95fadfecf68227888c0e4e
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jun 30 20:25:06 2015 -0700
- XQuartz: Silence -Wpointer-bool-conversion
+ glamor: Reuse the glamor_is_memory helper.
- X11Controller.m:417:17: error: address of function 'asl_log_descriptor' will always evaluate to 'true'
- [-Werror,-Wpointer-bool-conversion,Value Conversion Issue]
- if (asl_log_descriptor) {
- ~~ ^~~~~~~~~~~~~~~~~~
- X11Controller.m:417:17: note: prefix with the address-of operator to silence this warning [Semantic Issue]
- if (asl_log_descriptor) {
- ^
- &
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 7b0f940625a0f6eee2ef91dfbfa4a206246940f5
+Author: Adam Jackson <ajax@redhat.com>
+Date: Fri Dec 19 13:46:37 2014 -0500
+
+ atom: make FreeAtom static
- Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
- (cherry picked from commit 0b9c32489131a5723bd78decf5d2557b94207cf4)
+ Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
-commit c15e48bb032514f1123f715719c25eaba7e043a7
-Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Sun Jun 1 04:29:19 2014 -0700
+commit 2d2cf9e322a5ec3ead175edc136cdaeea00ec1b1
+Author: Adam Jackson <ajax@redhat.com>
+Date: Fri Dec 19 12:57:41 2014 -0500
- XQuartz: GLX: Use __glXEnableExtension to build extensions list
+ atom: Bump initial table size
- Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
- (cherry picked from commit 3790001ea29658872aebda00a03170e392b47878)
+ We're always creating ~230 atoms at startup, might as well tune it so we
+ don't hit the realloc path before Dispatch.
+
+ Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 995ff11422eb49160abfe276f471e412b16cab9d
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue May 19 11:31:25 2015 -0400
+
+ glx: Implement GLX_ARB_context_flush_control
+
+ This extension allows clients to opt out of the implicit glFlush on
+ context release, which is quite nice for performance for clients using
+ multiple contexts. The server doesn't really need to be aware of the
+ client's decision, at least for direct contexts, but it does need to not
+ reject the context attribute out of hand.
+
+ This patch won't do anything unless built against a Mesa that defines
+ the __DRI2_FLUSH_CONTROL extension (and a new enough glxext.h, but
+ that's been there since 10.3 at least).
+
+ Reviewed-by: James Jones <jajones@nvidia.com>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
-commit 061ff2621ccc8560d15fb804eff68a3e15c1b5d1
+commit 2d7194334a9f84e417ec90e220b2fe476f704612
Author: Adam Jackson <ajax@redhat.com>
Date: Fri May 15 11:27:31 2015 -0400
@@ -1253,9 +5514,35 @@ Date: Fri May 15 11:27:31 2015 -0400
Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
- (cherry picked from commit 2d7194334a9f84e417ec90e220b2fe476f704612)
-commit 9e744ac376396ef032f44fba69f7e34d78f04abc
+commit cbd3cfbad3f07b20e90ea9498110f255813eb441
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Jun 2 13:58:30 2015 -0400
+
+ dix: Restore PaintWindow screen hook
+
+ Removes the last cpp conditional on ROOTLESS from dix code.
+
+ Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 74d64ceea02bffad1caf3d1a727edbd38d968059
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Jun 2 13:58:30 2015 -0400
+
+ mi: Remove questionable optimization from the rootless path
+
+ This is effectively a revert of 7b506fdc840aebed6b5acb91437a2cb620b5bddc
+ except the coding style reindent broke that. The code makes no sense in
+ any case. drawable can never be null since it's the first member of
+ WindowRec, and we're never called with a null window. Neither can it be
+ an UNDRAWABLE_WINDOW since those are InputOnly windows; the rootless
+ code does not set the root window to either UNDRAWABLE or InputOnly, so.
+
+ Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 315661a425018a546f7bcc18ad3e5f4578473ca6
Author: Adam Jackson <ajax@redhat.com>
Date: Tue Jun 2 13:58:30 2015 -0400
@@ -1263,9 +5550,434 @@ Date: Tue Jun 2 13:58:30 2015 -0400
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
- (cherry picked from commit 315661a425018a546f7bcc18ad3e5f4578473ca6)
-commit b46ff18b247f75b33408fe34118b8a86a0f77e45
+commit 1594fb912996e9776d9e36383bd1d9f5dd2877eb
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Jun 2 13:58:30 2015 -0400
+
+ rootless: Build unconditionally
+
+ It's not a lot of code, and if you're doing things to the core that
+ affect rootless you should be alerted early.
+
+ Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit bdc917a41691250701ccc9a0b087448b50892fa9
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Jun 2 13:58:30 2015 -0400
+
+ rootless: Genericize the config header a bit
+
+ ROOTLESS_RESIZE_GRAVITY is an optimization, so let's default it to off
+ unless the backing window system is known to support it.
+
+ ROOTLESS_PROTECT_ALPHA looks like it has different values for xquartz
+ and win32, but hilariously rootlessGC.c merely checks if it is defined,
+ not what the value is. It's effectively the more conservative path
+ anyway, so let's just turn it on.
+
+ Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 6f3332b9f411fd7ac9cab0085faa56f6c2ff3323
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Jun 2 13:58:30 2015 -0400
+
+ dix: unifdef pWin->rootlessUnhittable
+
+ No reason to vary the dix ABI over this.
+
+ Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 36fac0dd1a9a9cf41b631cf7e1ea015bcf920db7
+Author: Adam Jackson <ajax@redhat.com>
+Date: Fri May 23 13:23:20 2014 -0400
+
+ xfixes: Unexport xfixes.h
+
+ There's nothing a driver could want to use this for.
+
+ Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 4da66d9e0399141feffd5f002e4195a438fe5020
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Jul 8 14:27:02 2014 -0400
+
+ vidmode: Hide implementation details
+
+ Also remove vidmodeproc.h from the SDK since no drivers are using it.
+
+ Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 49d7bae7f4c6a93f92df828440e3478513f930f4
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Jul 8 14:18:07 2014 -0400
+
+ xge: Hide some implementation details
+
+ Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 2377690709de11087edc9d1116c9feaeb8f118ed
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Jul 8 14:03:13 2014 -0400
+
+ dga: Hide a bunch of implementation details
+
+ Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit b5fbe9c6327fac88c09afce598238a7534521b69
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Jul 8 13:37:34 2014 -0400
+
+ xfree86: Hide some pre-randr mode validation details
+
+ Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 70b402be2626d4f4afb02b6f5baa543262548bd7
+Author: Adam Jackson <ajax@redhat.com>
+Date: Fri May 30 16:19:08 2014 -0400
+
+ render: Hide/unexport some implementation details
+
+ Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit a1c80bb7d5871e1c5ee21fc650834858054103bf
+Author: Adam Jackson <ajax@redhat.com>
+Date: Fri May 30 15:49:38 2014 -0400
+
+ randr: Unexport some implementation details
+
+ Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit b51f7f8582ab6c3cc9fa56c8d9721d0f240915e7
+Author: Adam Jackson <ajax@redhat.com>
+Date: Fri May 23 13:37:41 2014 -0400
+
+ dix: Unexport various implementation details
+
+ Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit c4a0d6c9139d2c0107b80420cc2342614bbe95ef
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Oct 22 10:47:03 2014 -0400
+
+ dri3: static cleanup
+
+ Also remove unused window private key.
+
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit a69e9027e167a83281b96e13f3a77100876b72ae
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Oct 22 10:44:36 2014 -0400
+
+ dri3: Remove unbuilt dri3_event.c
+
+ The config notifies live in present, not dri3.
+
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 91f0d71c18254746e1d519f0d19d11f756a9588c
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Oct 22 10:38:11 2014 -0400
+
+ parser: static cleanup
+
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit c732bb2799ad7ff6b0cdd9c65487466e6a9b76e7
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Oct 22 10:31:29 2014 -0400
+
+ present: static cleanup
+
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 0db457b2b5b6e314e912efc62f158f8f0b8d48af
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Jul 8 15:56:55 2015 -0400
+
+ dmx: Fix the build
+
+ Broken since:
+
+ commit 4fd81823fafcd103e8d890f4c0f7c2f90e822336
+ Author: Dave Airlie <airlied@gmail.com>
+ Date: Tue Jun 30 14:54:42 2015 +1000
+
+ prime: add rotation support for offloaded outputs (v2)
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 90db5edf119187f8b1b9207c8c384d6cd7ef9edc
+Author: Dave Airlie <airlied@gmail.com>
+Date: Tue Jun 30 14:54:42 2015 +1000
+
+ prime: add rotation support for offloaded outputs (v2)
+
+ One of the lacking features with output offloading was
+ that screen rotation didn't work at all.
+
+ This patch makes 0/90/180/270 rotation work with USB output
+ and GPU outputs.
+
+ When it allocates the shared pixmap it allocates it rotated,
+ and any updates to the shared pixmap are done using a composite
+ path that does the rotation. The slave GPU then doesn't need
+ to know about the rotation and just displays the pixmap.
+
+ v2:
+ rewrite the sync dirty helper to use the dst pixmap, and
+ avoid any strange hobbits and rotations.
+
+ This breaks ABI in two places.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 991712f1e8deeb6289ee0abd9910e279d6396246
+Merge: 0cd2280 3c85911
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Jul 8 10:43:31 2015 -0700
+
+ Merge remote-tracking branch 'ofourdan/for-keith'
+
+commit 0cd228073ad3b7eb72cef8b61128324895ee6cd4
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Mon Jun 29 15:08:51 2015 +0100
+
+ hw/xwin: printf format fixes for Pixel type
+
+ Pixel is CARD32, so inside the server has type unsigned int (x86_64) or unsigned
+ long (x86)
+
+ Cast to unsigned int and use a %u format
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit e3cfeb949a9c9363beacdb00acdd9723ed54fac2
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri Feb 6 20:22:11 2015 +0000
+
+ hw/xwin: printf format fixes for WPARAM and LPARAM types
+
+ Some Win32 API types are different fundamental types in the 32-bit and 64-bit
+
+ This problem is then further compounded by the fact that whilst both 32-bit
+ Cygwin and 32-bit MinGW use the ILP32 data model, 64-bit MinGW uses the LLP64
+ data model, but 64-bit Cygwin uses the LP64 data model.
+
+ This makes it impossible to write printf format specifiers which are correct for
+ all those targets, so we use some macros to provide the correct specifier for
+ the target.
+
+ LPARAM and WPARAM are integer types which can contain a pointer
+
+ LPARAM is long in ILP32 and long long in LLP64
+ WPARAM is unsigned int in ILP32 and unsigned long long in LLP64
+
+ Generally, these are just used to passs integer parameters, so for simplicity,
+ cast to int and use an int-compatible format
+
+ In the specific case of WM_CHANGECBCHAIN, they are used to pass HWND, so cast to
+ that type and print using an appropriate format.
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 4f8661fac985306c56330cae69ffc19e5dd0af61
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri Feb 6 19:19:41 2015 +0000
+
+ hw/xwin: printf format fixes for LONG type
+
+ Some Win32 API types are different fundamental types in the 32-bit and 64-bit
+ versions.
+
+ This problem is then further compounded by the fact that whilst both 32-bit
+ Cygwin and 32-bit MinGW use the ILP32 data model, 64-bit MinGW uses the LLP64
+ data model, but 64-bit Cygwin uses the LP64 data model.
+
+ This makes it impossible to write printf format specifiers which are correct for
+ all those targets
+
+ In the Win32 API, DWORD is an signed, 32-bit type. It is defined in terms of a
+ long, except in the LP64 data model, where it is an int.
+
+ It should always be safe to cast it to int and use %d.
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit aa83c61f510121da20b56e8f7de700193f7d16b5
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri Feb 6 19:46:45 2015 +0000
+
+ hw/xwin: printf format fixes for DWORD type
+
+ Some Win32 API types are different fundamental types in the 32-bit and 64-bit
+ versions.
+
+ This problem is then further compounded by the fact that whilst both 32-bit
+ Cygwin and 32-bit MinGW use the ILP32 data model, 64-bit MinGW uses the LLP64
+ data model, but 64-bit Cygwin uses the LP64 data model.
+
+ This makes it impossible to write printf format specifiers which are correct for
+ all those targets
+
+ In the Win32 API, DWORD is an unsigned, 32-bit type. It is defined in terms of
+ an unsigned long, except in the LP64 data model, where it is an unsigned int.
+
+ It should always be safe to cast it to unsigned int and use %u or %x.
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 487f2595c9dd9a5c3c600168a108963e87602561
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri Feb 6 20:48:26 2015 +0000
+
+ hw/xwin: printf format fixes in xevents.c
+
+ Window and Atom types derive from XID, which is always unsigned long in client
+ code, so use %ld format specifier
+
+ XTextProperty.nitems is of type unsigned long, so use %lu format specifier
+
+ ulReturnBytesLeft is of type unsigned long, so use %lu format specifier
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 98798fcf0d1dc66c539abb2ecec0acc676d0b574
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri Feb 6 20:42:54 2015 +0000
+
+ hw/xwin: printf format fix in winProcessXEventsTimeout()
+
+ remainingTime is computed as a long int, so use %ld format specifier
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 5b6f511c2fcad4edaccedbeb9842680cf3aeffb1
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri Feb 6 20:40:46 2015 +0000
+
+ hw/xwin: printf format fix in winCreateDefColormap()
+
+ Use %lu for unsigned long
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit eb679671560b21206a47476dfbc23518d8d46588
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri Feb 6 20:38:26 2015 +0000
+
+ hw/xwin: printf format fixes in winAllocatePrivates()
+
+ serverGeneration is of type unsigned long, so use %lu format specifier
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 0d6c499b9976d305e13685eb79b4bb7cd4250f58
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri Feb 6 20:27:11 2015 +0000
+
+ hw/xwin: printf format fixes in winConfigKeyboard()
+
+ struct winInfoRec.keyboard members are of type long, not type int
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit ba468e003e32c406f4885c8cb3deeb1c8175cd45
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Mon Jun 29 14:25:49 2015 +0100
+
+ hw/xwin: printf format fixes for XID type
+
+ XID inside the server has type unsigned int (x86_64) or unsigned long (x86)
+
+ Follow the example of the rest of the server and cast to unsigned int and use
+ a %u or %x format.
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit dcb797b31f0affdc4b08b000dd92ec38fa261953
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Thu Oct 2 14:28:46 2014 +0100
+
+ hw/xwin: printf format fixes for HWND type
+
+ HWND derives from HANDLE, a pointer type, so we should use the %p format
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit f1d14266672c8130e992dd9d0c08fd1cef0f08cb
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Wed Oct 1 22:12:26 2014 +0100
+
+ hw/xwin: Ensure format warnings in winclipboard/
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 38f340b13e693a0d456a9ab22a6474c8f55375fa
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Mon Jun 29 15:30:36 2015 +0100
+
+ hw/xwin: Remove GetTickCount() from various pieces of debugging output
+
+ The use of %d format for the DWORD return value of GetTickCount() isn't
+ portable, but it doesn't seem to be worth fixing it when this information isn't
+ very useful (and is redundant to the timestamping of log messages we now have)
+
+ Instead just remove these uses of GetTickCount()
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 732e3b9c08532f40656010eac9d128601cc88c3f
+Author: Michel Dänzer <michel.daenzer@amd.com>
+Date: Mon Jul 6 18:45:51 2015 -0700
+
+ Instead of one glTexSubImage2D call for each glyph.
+
+ This significantly reduces the amount of time it takes for xterm to start
+ up on a fresh X server with the radeonsi driver.
+
+ v2: Use GLYPHWIDTHBYTESPADDED instead of hardcoding 4 bytes glyph
+ alignment (Keith Packard)
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit ac94cdb9df94dd26688de6d3d9143ac48f7b3c7b
Author: Julien Cristau <jcristau@debian.org>
Date: Thu Jul 2 20:16:21 2015 +0200
@@ -1277,9 +5989,302 @@ Date: Thu Jul 2 20:16:21 2015 +0200
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit ac94cdb9df94dd26688de6d3d9143ac48f7b3c7b)
-commit df4f69d4624b60c9a463712a81cce4e48175e4ae
+commit e3624aa5fde658c44724a7ea21f5df9e3c586923
+Author: Dave Airlie <airlied@gmail.com>
+Date: Wed Jul 1 20:41:15 2015 +1000
+
+ xserver: fix build with glamor disabled.
+
+ This fixes modesetting when glamor is disabled.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+
+commit 3703c88ac18063a35fd8c0fc52fee52d8c669638
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Jul 1 16:23:45 2015 -0700
+
+ glamor: Use GL_ARB_debug_output to log GL errors.
+
+ This should help people debugging when glamor does something stupid on
+ their driver.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+
+commit f4dfd282d311e5f23631d33e0251bad1854b1ab9
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Jul 1 14:46:55 2015 -0700
+
+ glamor: Add an assert to catch the previous bug.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Acked-by: Michel Dänzer <michel.daenzer@amd.com>
+
+commit c268d2fc33318f9ea0019053fa5de18f193e704e
+Author: Keith Packard <keithp@keithp.com>
+Date: Thu Jul 2 17:06:27 2015 -0600
+
+ glamor: Fix bad rendering of glyphs after an a1 glyph upload. (v3)
+
+ Fixes regressions since Eric's "don't make an FBO for the glyph atlas"
+ change. The a1 upload was a fallback, as expected. However, fallback
+ reads use glReadPixels() because there's no glGetTexSubImage2D() to
+ match glTexSubImage2D(). We were just binding the 0 FBO value, so the
+ glReadPixels() would throw a GL error instead of getting any data.
+ After the fallback was done we'd write back the undefined data to the
+ atlas, blowing away the entire rest of the atlas because we didn't
+ specify any bounds on our prepare.
+
+ To fix the fallbacks to actually work, we'd need a prepare path that
+ allocates some memory memory do a full glGetTexImage() into, then
+ memcpy out of that. Instead, just dodge the general fallback by
+ implementing the specific upload we need to do here, which should also
+ be *much* faster at uploading a1 glyphs since it's not
+ readpixels/texsubimaging back and forth.
+
+ v3: Use CopyPlane to a temp pixmap for the upload
+ v4: Rewrite anholt's commit message to be from keithp's perspective
+ (changes by anholt)
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 5c440817f7c128c9a9d78ef9672f22641dbeeaa1
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jun 30 15:01:53 2015 -0700
+
+ glamor: Use ARRAY_SIZE in a couple more places for consistency.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 7b6edb52435f474c43130f6ac4c6b2d2b28814f5
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jun 30 14:59:55 2015 -0700
+
+ glamor: Mark a bunch of single-file data static.
+
+ This gives the compiler a chance to optimize when the data is never
+ changed -- for example, with pict_format_combine_tab, the compiler
+ ends up inlining the 24 bytes of data into just 10 more bytes of code.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 3fe6731b17ae953d49db4c1bf95e0022244513e1
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jun 30 14:50:43 2015 -0700
+
+ glamor: Make a bunch of single-file glamor functions static.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit a8e84e8c3b2047775fe2da9371329290eee23655
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jun 30 14:45:43 2015 -0700
+
+ glamor: Drop dead glamor_es2_pixmap_read_prepare().
+
+ It's been unused since I killed glamor_download_pixmap_to_cpu().
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit cad56dc62dbf2ba097cc0fa61217897ba40d8d66
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jun 30 14:41:27 2015 -0700
+
+ glamor: Restore the hook to glamor_composite_rectangles().
+
+ It was apparently accidentally dropped in keithp's removal of _nf
+ functions in 90d326fcc687e6d6d4b308f6272ededcf8145a17.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 7adb38a0d18de2e8b0762d9dd82b851883ad75fe
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jun 30 14:25:16 2015 -0700
+
+ glamor: Fix up some weird formatting in _glamor_create_fbo_array().
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 835067a4095e5e48703aa6561fea3ee95923e832
+Author: Eric Anholt <eric@anholt.net>
+Date: Tue Jun 30 14:14:50 2015 -0700
+
+ glamor: Drop a redundant check.
+
+ Above, we've already checked for ->fbo && ->fbo->fb and returned.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 47b868492c7ff0909ff71e3ee1aaa79daaade513
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Feb 5 12:34:41 2015 -0800
+
+ glamor: Simplify some temp pixmap extents calculations.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+
+commit bfb6a290afabe492d93ec8024fac6b28f672d7d0
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Feb 5 11:46:32 2015 -0800
+
+ glamor: Drop a dead flag to glamor_create_fbo_array().
+
+ v2: Don't forget to set priv->block_w/block_h like the wrapper used
+ to.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
+
+commit fe3fedf280596c2c2e69dddd30bb9ff17dbe611e
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Feb 5 11:33:54 2015 -0800
+
+ glamor: Drop dead GLAMOR_FBO_DOWNLOADED flag.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+
+commit 447274094147f31025700a2ff6f94e3b0c96fa17
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Feb 5 11:20:50 2015 -0800
+
+ glamor: Move doxygen for private structs into the structs.
+
+ This should hopefully keep the comments more up to date with the
+ structure comments. While I'm here, I've reworded a few of them to be
+ more accurate, and dropped a bunch of stale comments.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+
+commit 33d6384b29db1b28a9d1a035dc7cc82da8f33c99
+Author: Eric Anholt <eric@anholt.net>
+Date: Thu Feb 5 11:18:24 2015 -0800
+
+ glamor: Drop the dead "PBO" field in an FBO cache struct.
+
+ PBOs are only used at the whole pixmap level.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+
+commit 1734aa285663d83070e6313bb976f976aa2bea4c
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Feb 4 18:07:06 2015 -0800
+
+ glamor: Remove dead gl_tex flag in the fbo struct.
+
+ This used to be used in the old copy_area path.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+
+commit 82d23fc7290a2986efbc2982eeaa0de0ad5ad0d1
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Feb 4 18:02:34 2015 -0800
+
+ glamor: Propagate the fact that pbo_valid is never set.
+
+ The code to set it was deleted in keithp's big rewrite.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+
+commit 0e3f1252dacdc3194a99a2d090b5c13f070f8799
+Author: Eric Anholt <eric@anholt.net>
+Date: Fri Jun 19 18:40:47 2015 -0700
+
+ glamor: Avoid using GL_QUADS on VC4.
+
+ Improves text rendering from about 284k glyphs per second to 320k
+ glyphs per second. There's no GL extension for probing this, because
+ of the philosophy of "Don't expose whether things are really in
+ hardware or not."
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit f47e3f539568d19e22d10d7dd4ec09c7d570e716
+Author: Eric Anholt <eric@anholt.net>
+Date: Fri Jun 19 18:36:28 2015 -0700
+
+ glamor: Use proper Bools for some boolean values.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit 4001a7465e6fb27fc82fa20ea5a65283d33a5e2e
+Author: Eric Anholt <eric@anholt.net>
+Date: Fri Jun 19 16:56:35 2015 -0700
+
+ glamor: Provide a fallback path for using an index buffer to do quads.
+
+ Improves x11perf -aa10text performance by 1377.59% +/- 23.8198% (n=93)
+ on Intel with GLES2.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit e8fc929d4a140666420a64d592371f5d3eb10cca
+Author: Eric Anholt <eric@anholt.net>
+Date: Fri Jun 19 17:26:46 2015 -0700
+
+ glamor: Use GL_EXT_map_buffer_range if present.
+
+ We were only looking for the desktop GL version of the extension, so
+ GLES2 missed out.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit 4fc4cde0ce7d1a35bab3b3bbd787d688cd415d78
+Author: Eric Anholt <eric@anholt.net>
+Date: Fri Jun 19 16:34:55 2015 -0700
+
+ glamor: Use the normal GL_QUADS drawing helper in the render code.
+
+ We use this for all of our other performance-sensitive rendering, too.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit c5e6fffbdd88ad714454b9de1ac1c3eb9f6bf196
+Author: Eric Anholt <eric@anholt.net>
+Date: Fri Jun 19 17:05:28 2015 -0700
+
+ glamor: Drop CloseScreen-time GL resource cleanup code.
+
+ These will all be freed when the context is freed.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit 3d6dcad00d67bff407385ad37c7efde7b73ba719
+Author: Eric Anholt <eric@anholt.net>
+Date: Fri Jun 19 19:04:16 2015 -0700
+
+ glamor: Fix text rendering on GLES2.
+
+ The GL_QUADS helper takes a number of quads, not a number of vertices.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit b4061cf5f76241157b2dc81dec053012075311c0
Author: Peter Harris <pharris@opentext.com>
Date: Tue May 12 14:19:15 2015 -0400
@@ -1299,454 +6304,593 @@ Date: Tue May 12 14:19:15 2015 -0400
Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit b4061cf5f76241157b2dc81dec053012075311c0)
-commit d23171754a6c4f7361ac5aed64eaa29222b32df2
-Author: Andrew Eikum <aeikum@codeweavers.com>
-Date: Thu Jun 4 13:24:53 2015 -0500
+commit 8a8d51358cea782147bb9b5b2e0902b1e47fcf4a
+Merge: b22534d 13c7d53
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Jun 29 21:04:53 2015 -0700
- dix: Send KeyPress and KeyRelease events to the XACE_KEY_AVAIL hook
+ Merge remote-tracking branch 'airlied/for-keithp'
+
+commit b22534d8e653575196180970292eaade33c090a8
+Merge: 0a625ad 780a69a
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Jun 29 21:04:11 2015 -0700
+
+ Merge remote-tracking branch 'jwrdecoede/for-keith'
+
+commit 0a625adeec465d6c7dcdb8622c53157b4e932bb0
+Merge: 84128c1 790311c
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Jun 29 21:01:34 2015 -0700
+
+ Merge remote-tracking branch 'anholt/glamor-next'
+
+commit 84128c10bb6d34f78f7a4148b3c640748efe58e1
+Merge: 9003a3e 8c86dd5
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Jun 29 20:59:31 2015 -0700
+
+ Merge remote-tracking branch 'whot/for-keith'
+
+commit 13c7d53df8dac45ea2a685826cd45a39bcb51657
+Author: Kenneth Graunke <kenneth@whitecape.org>
+Date: Mon Jan 26 21:29:23 2015 -0800
+
+ modesetting: Implement page flipping support for Present.
- While it's documented in the XACE spec, the XACE_KEY_AVAIL hook is
- currently never actually invoked by the xserver.
+ Based on code by Keith Packard, Eric Anholt, and Jason Ekstrand.
- This hook was added in 13c6713c82 (25 Aug 2006), but as the keyboard
- processing was moved into XKB, the hook was forgotten and silently
- dropped. The code calling this hook was removed by 7af53799c (4 Jan
- 2009), but it was probably already unused before that.
+ v2:
+ - Fix double free and flip_count underrun (caught by Mario Kleiner).
+ - Don't leak flip_vblank_event on the error_out path (Mario).
+ - Use the updated ms_flush_drm_events API (Mario, Ken).
+
+ v3: Hack around DPMS shenanigans. If all monitors are DPMS off, then
+ there is no active framebuffer; attempting to pageflip will hit the
+ error_undo paths, causing us to drmModeRmFB with no framebuffer,
+ which confuses the kernel into doing full modesets and generally
+ breaks things. To avoid this, make ms_present_check_flip check that
+ some CRTCs are enabled and DPMS on. This is an ugly hack that would
+ get better with atomic modesetting, or some core Present work.
- This patch re-adds support for this hook. The "count" hook parameter is
- unused.
+ v4:
+ - Don't do pageflipping if CRTCs are rotated (caught by Jason Ekstrand).
+ - Make pageflipping optional (Option "PageFlip" in xorg.conf.d), but
+ enabled by default.
- Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
- Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
- Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
- (cherry picked from commit 990cf5b2828f73dc7a07f1e38f608af39acfd81d)
+ v5: Initialize num_crtcs_on to 0 (caught by Michel Dänzer).
+
+ [airlied: took over]
+ v6: merge async flip support from Mario Kleiner
+ free sequence after failed vblank queue
+ handle unflip while DPMS'ed off (Michel)
+ move flip tracking into its own structure, and
+ fix up reference counting issues, and add comments.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Acked-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
-commit 918032905433f64320dc4c222228c008bbd50cd2
-Author: Andrew Eikum <aeikum@codeweavers.com>
-Date: Thu Jun 4 13:23:19 2015 -0500
+commit 4342369e843ca2c6ca0a8c42475893cffb077a54
+Author: Dave Airlie <airlied@redhat.com>
+Date: Fri Jun 26 09:20:13 2015 +1000
- xace: Add XaceHookIsSet helper function
+ modesetting: don't try and load dri2
- Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
- Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
- Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
- (cherry picked from commit 5dc2a9aae46352f1f35d3ba122da04727789a15d)
+ Since we are shipped with the server and the server has it built-in,
+ don't bother trying to load it.
+
+ Don't remove or invert the if statement on purpose as a later
+ patch adds stuff in here.
+
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
-commit 3f26c837262c4d15f18a6974ea15660f24ce94c1
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 22:38:26 2014 -0800
+commit edec6394a47be590f3133f6a90186356afd00829
+Author: Dave Airlie <airlied@redhat.com>
+Date: Fri Jun 26 09:19:37 2015 +1000
- dmx: include header for DMXExtensionInit() in dmx.c
+ modesetting: drop unused struct in vblank.c
- Gets rid of gcc 4.8 warning:
+ this isn't used anywhere here.
- dmx.c:1193:1: warning: no previous prototype for ‘DMXExtensionInit’ [-Wmissing-prototypes]
- DMXExtensionInit(void)
- ^
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit bf262b43007050180d336defd48251de80894801
+Author: Kenneth Graunke <kenneth@whitecape.org>
+Date: Mon Jan 26 21:25:58 2015 -0800
+
+ modesetting: Implement an ms_drm_abort_seq() function.
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
- Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 4a758f59a8a65c313244e06852745c8e180ff247)
+ This is a specialization of ms_drm_abort that matches based on the drm
+ event queue's sequence number.
+
+ Based on code by Keith Packard.
+
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
-commit cb7ee9808a18057f534d6b8025b950f5f7275749
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 22:33:54 2014 -0800
+commit b8ccc5d36b0436bac57f07969ff3eb8d479a8511
+Author: Jason Ekstrand <jason.ekstrand@intel.com>
+Date: Tue Jan 13 17:00:28 2015 -0800
- dmx: constify GCOps & GCFuncs pointers
+ glamor: Add a new glamor_gbm_bo_from_pixmap() function.
- Gets rid of 16 instances of gcc 4.8 warnings:
+ v2: Rebase on commit e0788a03144 (drop "base").
- In file included from dmxgc.c:41:0:
- dmx.h:327:23: warning: assignment discards ‘const’ qualifier from
- pointer target type [enabled by default]
- (_saved)->_entry = (_actual)->_entry; \
- ^
- dmxgc.h:80:5: note: in expansion of macro ‘DMX_WRAP’
- DMX_WRAP(funcs, &dmxGCFuncs, _pGCPriv, (_pGC)); \
- ^
- dmxgc.c:192:5: note: in expansion of macro ‘DMX_GC_FUNC_EPILOGUE’
- DMX_GC_FUNC_EPILOGUE(pGC);
- ^
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit f2171d0a20d3b3858a282c51c1561432de1b29ef
+Author: Kenneth Graunke <kenneth@whitecape.org>
+Date: Tue Jan 6 21:02:44 2015 -0800
+
+ modesetting: Make ms_crtc_on non-static.
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
- Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit a0e44ddfb0c641e7896a55abf26621ae3d17e337)
+ I want to use this in present.c.
+
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
-commit 03dd982d2b28f5959d5dc31ec45bff3ee5a0c82c
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 22:20:24 2014 -0800
+commit f6853baebaec6a68078fa7f90486e9547d59dcbd
+Author: Kenneth Graunke <kenneth@whitecape.org>
+Date: Sun Feb 8 17:21:58 2015 -0800
- dmx: Mark glxIsExtensionSupported as a const char *
+ modesetting: Improve the ms_flush_drm_events() API.
- Gets rid of 9 instances of gcc 4.8 warning:
+ Previously, ms_flush_drm_events() returned a boolean value, and it was
+ very easy to interpret the meaning incorrectly. Now, we return an
+ integer value.
- glxcmds.c: In function ‘CreateContext’:
- glxcmds.c:378:13: warning: passing argument 1 of ‘glxIsExtensionSupported’
- discards ‘const’ qualifier from pointer target type [enabled by default]
- else if (glxIsExtensionSupported("GLX_SGIX_fbconfig")) {
- ^
- In file included from glxserver.h:49:0,
- from glxcmds.c:41:
- glxscreens.h:53:12: note: expected ‘char *’ but argument is of type
- ‘const char *’
- extern int glxIsExtensionSupported(char *ext);
+ The possible outcomes of this call are:
+ - poll() raised an error (formerly TRUE, now -1 - poll's return value)
+ - poll() said there are no events (formerly TRUE, now 0).
+ - drmHandleEvent() raised an error (formerly FALSE, now the negative
+ value returned by drmHandleEvent).
+ - An event was successfully handled (formerly TRUE, now 1).
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
- Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 9682c47e228962e4008855c4da7467748742685e)
+ The nice part is that this allows you to distinguish errors (< 0),
+ nothing to do (= 0), and success (1). We no longer conflate errors
+ with success.
+
+ v2: Change ms_present_queue_vblank to < 0 instead of <= 0, fixing an
+ unintentional behavior change. libdrm may return EBUSY if it's
+ received EINTR for more than a second straight; just keep retrying
+ in that case. Suggested by Jasper St. Pierre.
+
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
-commit 78df8521cfd8a279da15c7d267de5c9fe1108d4a
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 22:16:49 2014 -0800
+commit 7328fb3f2b468048faf4ed4c29db720b5bf00b05
+Author: Dave Airlie <airlied@gmail.com>
+Date: Wed Jun 10 13:41:02 2015 +1000
- dmx: remove redundant redeclarations of variables from other headers
+ modesetting: reverse prime support (v1.1)
- Gets rid of these gcc 4.8 warnings:
+ This adds support for reverse prime to the modesetting driver.
- dmxcb.c:50:12: warning: redundant redeclaration of ‘PanoramiXPixWidth’
- [-Wredundant-decls]
- extern int PanoramiXPixWidth;
- ^
- In file included from dmxcb.c:49:0:
- ../../Xext/panoramiXsrv.h:12:22: note: previous declaration of
- ‘PanoramiXPixWidth’ was here
- extern _X_EXPORT int PanoramiXPixWidth;
- ^
- dmxcb.c:51:12: warning: redundant redeclaration of ‘PanoramiXPixHeight’
- [-Wredundant-decls]
- extern int PanoramiXPixHeight;
- ^
- In file included from dmxcb.c:49:0:
- ../../Xext/panoramiXsrv.h:13:22: note: previous declaration of
- ‘PanoramiXPixHeight’ was here
- extern _X_EXPORT int PanoramiXPixHeight;
- ^
- dmxcb.c:52:12: warning: redundant redeclaration of ‘PanoramiXNumScreens’
- [-Wredundant-decls]
- extern int PanoramiXNumScreens;
- ^
- In file included from dmxcb.c:49:0:
- ../../Xext/panoramiXsrv.h:11:22: note: previous declaration of
- ‘PanoramiXNumScreens’ was here
- extern _X_EXPORT int PanoramiXNumScreens;
- ^
+ Reverse prime is where we have two GPUs in the display chain,
+ but the second GPU can't scanout from the shared pixmap, so needs
+ an extra copy to the on screen pixmap.
- dmxpict.c:60:12: warning: redundant redeclaration of ‘RenderErrBase’
- [-Wredundant-decls]
- extern int RenderErrBase;
- ^
- In file included from ../../render/glyphstr.h:29:0,
- from ../../render/picturestr.h:28,
- from dmx.h:65,
- from dmxpict.c:42:
- ../../render/picture.h:176:22: note: previous declaration of ‘RenderErrBase’
- was here
- extern _X_EXPORT int RenderErrBase;
- ^
+ This allows modesetting to support this scenario while still
+ supporting the USB offload one.
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
- Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 45ec646d77086eeb5f94766b055a93b5c75bdef0)
+ v1.1:
+ fix comment + ret = bits (Eric)
+
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
-commit 3af41608228a796ff51698b9a6b6e74aa7cd67ba
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 22:13:28 2014 -0800
+commit 1f10ee221edb87561900f5d2b1336db1c4a9f05c
+Author: Dave Airlie <airlied@gmail.com>
+Date: Wed Jun 10 13:38:39 2015 +1000
- dmx: remove redundant declaration of dmxFontPrivateIndex from dmxfont.h
+ glamor: egl: add function to back a pixmap with a dma-buf. (v1.1)
- Gets rid of 8 instances of gcc 4.8 warning:
+ Rather than create the pixmap, this uses the file descriptor
+ to change an existing pixmaps backing store.
- In file included from glxcmds.c:38:0:
- ../../../hw/dmx/dmxfont.h:57:12: warning: redundant redeclaration of
- ‘dmxFontPrivateIndex’ [-Wredundant-decls]
- extern int dmxFontPrivateIndex;
- ^
- In file included from glxcmds.c:35:0:
- ../../../hw/dmx/dmx.h:388:12: note: previous declaration of
- ‘dmxFontPrivateIndex’ was here
- extern int dmxFontPrivateIndex; /**< Private index for Fonts */
- ^
+ This is required for reverse prime slaves, where we create
+ the slave pixmap, then set the backing store.
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
- Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 1033b85196e0f25877b4b9081993aff16bf32138)
+ v1.1: use local pScreen (Eric)
+
+ Reviewed-by: Eric Anholt <eric@annholt.net>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
-commit 649f37fa01f7a2d471858609d47f297cdb8615d0
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 22:09:14 2014 -0800
+commit a79fbfd707e1d745b670def08287241c87e11c28
+Author: Dave Airlie <airlied@gmail.com>
+Date: Tue Jun 9 17:15:44 2015 +1000
- dmx: glxproxy prototype cleanup
+ modesetting: add output master support
- Gets rid of 107 -Wmissing-prototypes & -Wredundant-decls warnings
- from gcc 4.8
+ This allows a glamor enabled master device to have
+ slave USB devices attached.
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
- Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit ac64a653fb4935a799baca7545ba6ca401e20fa1)
+ Tested with modesetting on SNB + USB.
+
+ It relies on the previous patch to export linear
+ buffers from glamor.
+
+ Acked-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
-commit 069180bd2a243a13328eeea61ec5f8df5622a5de
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 21:11:17 2014 -0800
+commit ea0e4d752b778c1f2132f8d29542f7dabc296415
+Author: Dave Airlie <airlied@gmail.com>
+Date: Wed Jun 10 14:46:22 2015 +1000
- dmx: more unshadowing of variables
+ glamor: add support for allocating linear buffers (v2)
- Gets rid of gcc 4.8 warnings:
+ We need this for doing USB offload scenarios using glamor
+ and modesetting driver.
- dmxinputinit.c: In function ‘dmxInputScanForExtensions’:
- dmxinputinit.c:877:14: warning: declaration of ‘display’ shadows a global declaration [-Wshadow]
- Display *display;
- ^
- In file included from ../../../include/windowstr.h:60:0,
- from dmxinputinit.c:72:
- ../../../include/opaque.h:52:30: warning: shadowed declaration is here [-Wshadow]
- extern _X_EXPORT const char *display;
- ^
+ unfortunately only gbm in mesa 10.6 has support for the
+ linear API.
- glxcmds.c: In function ‘__glXCreatePbuffer’:
- glxcmds.c:3397:21: warning: declaration of ‘pc’ shadows a parameter [-Wshadow]
- CARD32 *pc = (CARD32 *) (be_req + 1);
- ^
- glxcmds.c:3314:52: warning: shadowed declaration is here [-Wshadow]
- __glXCreatePbuffer(__GLXclientState * cl, GLbyte * pc)
- ^
+ v1.1: fix bad define
+ v2: update the configure.ac test as per amdgpu. (Michel)
+ set linear bos to external to avoid cache. (Eric)
- glxscreens.c: In function ‘CalcServerVersionAndExtensions’:
- glxscreens.c:139:35: warning: declaration of ‘req’ shadows a previous local [-Wshadow]
- xGLXQueryServerStringReq *req;
- ^
- glxscreens.c:68:26: warning: shadowed declaration is here [-Wshadow]
- xGLXQueryVersionReq *req;
- ^
- glxscreens.c:140:36: warning: declaration of ‘reply’ shadows a previous local [-Wshadow]
- xGLXQueryServerStringReply reply;
- ^
- glxscreens.c:69:27: warning: shadowed declaration is here [-Wshadow]
- xGLXQueryVersionReply reply;
- ^
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 5c555605386c76be2f02193d434a4617218b67be
+Author: Dave Airlie <airlied@redhat.com>
+Date: Thu Jun 11 14:29:48 2015 +1000
+
+ xf86: restrict when we auto add devices as gpu devices.
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
- Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit bd563fd48f909094d6660854e97811ad7e676ddf)
+ Michel pointed out I broke Zaphod with the initial auto add
+ gpu devices change,
+
+ Fix this, by only auto adding GPU devices if we are screen 0
+ and there are no other screens in the layout. Anyone who
+ wants to assign GPU devices can specify it in the xorg.conf
+ for this use case.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+ Tested-by: Michel Dänzer <michel.daenzer@amd.com>
-commit 00a962261af856081a7505a95cd871f4af047071
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 21:07:12 2014 -0800
+commit 5064ee276fe0f6cebc33ea08e57f1de91f092d88
+Author: Dave Airlie <airlied@redhat.com>
+Date: Fri Jun 12 15:13:47 2015 +1000
- dmx: attempt to untangle nested loops using same index variable
+ xf86Rotate: remove unused macros.
- This doesn't just make gcc sad, it makes my brain sad.
+ These macros aren't used anywhere.
- Change from:
- for (i = 0; i < dmxNumScreens; i++) {
- int i;
- for (i = 0; i < nconfigs; i++) {
- for (j = 0; j < dmxScreen->beNumVisuals; j++) {
+ v1.1: drop comment (Aaron)
- to the easier to follow:
- for (i = 0; i < dmxNumScreens; i++) {
- for (j = 0; j < nconfigs; j++) {
- for (k = 0; k < dmxScreen->beNumVisuals; k++) {
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 8218dadd30eb0c87efbac6db5d8e3862a236b6a4
+Author: Dave Airlie <airlied@redhat.com>
+Date: Tue Jun 9 15:30:22 2015 +1000
+
+ cursor: drop ARGB_CURSOR
- Gets rid of gcc 4.8 warning:
+ I doubt anyone builds with this turned off or has done for a long
+ time.
- dmxinit.c: In function ‘InitOutput’:
- dmxinit.c:765:17: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
- int i;
- ^
- dmxinit.c:608:9: warning: shadowed declaration is here [-Wshadow]
- int i;
- ^
+ It helps my eyes bleed slightly less when reading the code, I've left
+ the define in place as some drivers use it.
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 3c859112d38860764bcdb205ab461d00db502f45
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Jun 23 15:05:31 2015 +0200
+
+ xwayland: keep temp files out of the client mask
+
+ Xwayland opens anonymous files for its sharing buffers, move these
+ file descriptors out of the range of the client select mask to avoid
+ reaching the maximum number of clients prematurely.
+
+ https://bugs.freedesktop.org/show_bug.cgi?id=91072
+
+ Tested-by: Olivier Fourdan <fourdan@gmail.com>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 8c86dd51606486f4794c503b9c05c6875bdc693a
+Author: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
+Date: Tue Jun 23 08:41:57 2015 -0300
+
+ configure.ac: fix code misplacing for KDRIVE_{KBD, MOUSE, EVDEV} auto-detection
+
+ KDrive input drivers "kbd", "mouse", and "evdev" should be automatically built
+ for linux systems. However, due to a code misplacing in configure.ac, the
+ auto-detection test is being performed AFTER the corresponding AC_DEFINEs' calls,
+ so that the drivers are NOT being built, regardless the test result.
+
+ This bug should be affecting previous xorg-server releases. Please consider
+ backporting this patch to all maintained ones!
+
+ Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 780a69aff0ff57ef813179a2f09556eaf488cdfc
+Author: David Herrmann <dh.herrmann@gmail.com>
+Date: Mon Jun 22 21:13:05 2015 +0200
+
+ systemd-logind: do not rely on directed signals
+
+ Right now, Xorg does not install DBus matches for "PauseDevice" /
+ "ResumeDevice". Therefore, it should usually not receive those DBus
+ signals from logind. It is just a coincidence that systemd-logind sends
+ those signals in a directed manner right now. Therefore, dbus-daemon
+ bypasses the broadcast matches.
+
+ However, this is not ABI and Xorg should not rely on this. systemd-logind
+ is free to send those signals as broadcasts, in which case Xorg will
+ freeze the VT. Fix this by always installing those matches.
+
+ Cc: Hans de Goede <hdegoede@redhat.com>
+ Cc: Keith Packard <keithp@keithp.com>
+ Reported-by: Jan Alexander Steffens <jan.steffens@gmail.com>
+ Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+ Tested-by: Hans de Goede <hdegoede@redhat.com>
+ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+
+commit d3352d098724e96be8fb8538a3640ce271d8f8b9
+Author: Hans de Goede <hdegoede@redhat.com>
+Date: Mon Jun 22 13:51:21 2015 +0200
+
+ Xorg.wrap.man: Fix spelling mistake in Xorg.wrap.1
+
+ This commit fixes a small mistake in Xorg.wrap.1 .
+
+ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 790311cec30ac3d35e580b9f1266236f558033d4
+Author: Eric Anholt <eric@anholt.net>
+Date: Sun May 31 16:08:10 2015 -0700
+
+ glamor: Don't try to disable attrib divisors without the extension.
+
+ Fixes epoxy assertion failures on vc4.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 57e08fae82f733304200a473f55b86e689404c13)
-commit 25292a3bc1032aab8586d7311159e88acca7b689
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 20:53:33 2014 -0800
+commit 9c679d06055cc62aa9209318705e87dc33fba4c8
+Author: Eric Anholt <eric@anholt.net>
+Date: Sun May 31 16:07:01 2015 -0700
- dmx: remove unused variables
+ glamor: Skip actual FBO setup in our glyph atlas.
- Gets rid of gcc 4.8 warnings:
+ VC4 (and many GLES2 renderers) can't render to GL_ALPHA, so our pixmap
+ would end up as GLAMOR_MEMORY and our dereference of the FBO would
+ setfault. Instead, tell the pixmap creation that we don't need an FBO
+ at all. Our glyph upload path was already glTexImage for non-a1, and
+ a more general software fallback for a1 (since the glyph is also in
+ system memory).
- dmxscrinit.c: In function ‘dmxBEScreenInit’:
- dmxscrinit.c:83:15: warning: unused variable ‘gcvals’ [-Wunused-variable]
- XGCValues gcvals;
- ^
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 077bb1bdea0fa9af846c02896df680293cf9e25c
+Author: Eric Anholt <eric@anholt.net>
+Date: Sun May 31 15:46:55 2015 -0700
+
+ glamor: Clean up some declarations in glyph rendering.
- dmxwindow.c: In function ‘dmxResizeWindow’:
- dmxwindow.c:860:19: warning: variable ‘pSibPriv’ set but not used [-Wunused-but-set-variable]
- dmxWinPrivPtr pSibPriv;
- ^
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit bf7a3bcb00d0dce22ff3fe42fe6236beeab4403b
+Author: Eric Anholt <eric@anholt.net>
+Date: Sun May 31 15:28:39 2015 -0700
+
+ glamor: Actually allow glyphs of dimension 65 to 128 in the cache.
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ The cache was trying to allow glyph_max_dim in, but since we were
+ putting over 64x64 into HW memory, it would end up in the
+ single-glyph-per-render bail_one path.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 0fbebad72428abbc9fc3fa9f406f7a7e1b9d95b2)
-commit 43251c13d7cfaa5deb1146219e175b3fcd1cfffd
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 19:09:36 2014 -0800
+commit f4c3cac010cff0980905eeedd8e8d7baf0aff91b
+Author: Alexander Volkov <a.volkov@rusbitech.ru>
+Date: Wed Jun 17 12:41:35 2015 +0300
- dmx: fix printf format argument warnings
+ Xi: call UpdateDeviceState() even when the client is missing
- Gets rid of these gcc 4.8 warnings:
+ The client window can be closed in the middle of a touch sequence,
+ e.g. Qt 4 closes popup windows on MousePress and Qt 5.5 will do it
+ on TouchBegin. In this case the state of mouse buttons will not be
+ updated on TouchEnd because ProcessTouchEvent() calls UpdateDeviceState()
+ only when the event has been sent to the client. It results in a
+ stuck left mouse button.
- dmxinit.c: In function ‘dmxErrorHandler’:
- dmxinit.c:167:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
- but argument 3 has type ‘XID64’ [-Wformat=]
- ev->resourceid);
- ^
- dmxinit.c:171:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
- but argument 3 has type ‘XID64’ [-Wformat=]
- ev->resourceid);
- ^
- dmxinit.c:175:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
- but argument 3 has type ‘XID64’ [-Wformat=]
- ev->resourceid);
- ^
- dmxinit.c:181:12: warning: format ‘%d’ expects argument of type ‘int’,
- but argument 3 has type ‘long unsigned int’ [-Wformat=]
- ev->serial);
- ^
- dmxinit.c:183:12: warning: format ‘%d’ expects argument of type ‘int’,
- but argument 3 has type ‘long unsigned int’ [-Wformat=]
- dpy->request);
- ^
- dmxinit.c: In function ‘InitOutput’:
- dmxinit.c:637:9: warning: format ‘%d’ expects argument of type ‘int’,
- but argument 3 has type ‘long unsigned int’ [-Wformat=]
- dmxLog(dmxInfo, "Generation: %d\n", dmxGeneration);
- ^
+ This patch leads to calling UpdateDeviceState() in case the client
+ can't be found.
- dmxprop.c: In function ‘dmxPropertyCheckOtherWindows’:
- dmxprop.c:223:24: warning: format ‘%lu’ expects argument of type ‘long
- unsigned int’, but argument 4 has type ‘Window’ [-Wformat=]
- dmxScreen->name, win, tp.value);
- ^
- dmxprop.c: In function ‘dmxPropertyWindow’:
- dmxprop.c:364:16: warning: format ‘%lu’ expects argument of type ‘long
- unsigned int’, but argument 5 has type ‘Window’ [-Wformat=]
- other->index, other->name, other->scrnWin);
+ Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9003a3e5c55903ce4e371b2d5cb5030b5f97ae0e
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Tue Jun 9 23:41:12 2015 -0700
+
+ XQuartz: Silence -Wformat-security for NSRunAlertPanel
+
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 3a6fa115759c787ec34483437021ad1e55c52423
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Tue Jun 9 23:34:50 2015 -0700
+
+ XQuartz: Silence -Wunused-function
+
+ quartzKeyboard.c:741:1: warning: unused function 'macroman2ucs' [-Wunused-function,Unused Entity Issue]
+ macroman2ucs(unsigned char c)
+ ^
+ 1 warning generated.
+
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 9fe7f5ccada37e2d2a2fa92064b92a0334a3fcdd
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Tue Jun 9 23:30:50 2015 -0700
+
+ XQuartz: Silence -Wunused-variable
+
+ X11Controller.m:939:9: warning: unused variable 'remain' [-Wunused-variable,Unused Entity Issue]
+ int remain;
+ ^
+
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 0b9c32489131a5723bd78decf5d2557b94207cf4
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Tue Jun 9 23:29:40 2015 -0700
+
+ XQuartz: Silence -Wpointer-bool-conversion
+
+ X11Controller.m:417:17: error: address of function 'asl_log_descriptor' will always evaluate to 'true'
+ [-Werror,-Wpointer-bool-conversion,Value Conversion Issue]
+ if (asl_log_descriptor) {
+ ~~ ^~~~~~~~~~~~~~~~~~
+ X11Controller.m:417:17: note: prefix with the address-of operator to silence this warning [Semantic Issue]
+ if (asl_log_descriptor) {
^
- dmxprop.c:364:16: warning: format ‘%lu’ expects argument of type ‘long
- unsigned int’, but argument 8 has type ‘Window’ [-Wformat=]
+ &
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
- Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit f358f0d50cadaf10f7d97e21da00419a4a37c4e1)
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-commit d4b0ab833253493f0ea98b6faca6c17ed55b1c22
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 18:58:01 2014 -0800
+commit 77611066397747411f348e4a77871da5cff3b71e
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Sun Jun 1 04:29:19 2014 -0700
- dmx: move format strings inline so gcc can check
+ XQuartz: GLX: Use __glXEnableExtension to build extensions list
- Gets rid of gcc 4.8 warnings:
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 990cf5b2828f73dc7a07f1e38f608af39acfd81d
+Author: Andrew Eikum <aeikum@codeweavers.com>
+Date: Thu Jun 4 13:24:53 2015 -0500
+
+ dix: Send KeyPress and KeyRelease events to the XACE_KEY_AVAIL hook
- dmxprint.c: In function ‘dmxConfigPrintPair’:
- dmxprint.c:284:25: warning: format not a string literal,
- argument types not checked [-Wformat-nonliteral]
- p->ysign < 0 ? '-' : '+', p->y);
- ^
- dmxprint.c:289:9: warning: format not a string literal,
- argument types not checked [-Wformat-nonliteral]
- dmxConfigOutput(addSpace, 0, p->comment, format, p->x, p->y);
- ^
+ While it's documented in the XACE spec, the XACE_KEY_AVAIL hook is
+ currently never actually invoked by the xserver.
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
- Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 11af200b004b4810c9267e3e16449c3175c64d4a)
+ This hook was added in 13c6713c82 (25 Aug 2006), but as the keyboard
+ processing was moved into XKB, the hook was forgotten and silently
+ dropped. The code calling this hook was removed by 7af53799c (4 Jan
+ 2009), but it was probably already unused before that.
+
+ This patch re-adds support for this hook. The "count" hook parameter is
+ unused.
+
+ Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-commit 904105166450fbcc76cf18392beb4d6d3238bee0
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Fri Dec 12 18:52:05 2014 -0800
+commit 5dc2a9aae46352f1f35d3ba122da04727789a15d
+Author: Andrew Eikum <aeikum@codeweavers.com>
+Date: Thu Jun 4 13:23:19 2015 -0500
- dmx: Add _X_ATTRIBUTE_PRINTF to dmxConfigLog() & dmxConfigOutput()
+ xace: Add XaceHookIsSet helper function
- Gets rid of gcc 4.8 warnings:
+ Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit c88a325899381d1133e63e6c33c29db079e20a87
+Author: Hans de Goede <hdegoede@redhat.com>
+Date: Wed Jan 21 10:13:20 2015 +0100
+
+ systemd-logind: Only use systemd-logind integration together with keeptty
- dmxparse.c: In function ‘dmxConfigLog’:
- dmxparse.c:61:5: warning: function might be possible candidate for
- ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
- vprintf(format, args); /* RATS: All calls to dmxConfigLog from
- ^
+ systemd-logind integration does not work when starting X on a new tty, as
+ that detaches X from the current session and after hat systemd-logind revokes
+ all rights any already open fds and refuses to open new fds for X.
- dmxprint.c: In function ‘dmxConfigOutput’:
- dmxprint.c:149:9: warning: function might be possible candidate for
- ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
- pos += vfprintf(str, format, args); /* assumes no newlines! */
+ This means that currently e.g. "startx -- vt7" breaks, and breaks badly,
+ requiring ssh access to the system to kill X.
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
- Reviewed-by: Rémi Cardona <remi@gentoo.org>
- Reviewed-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 5e01eac10e915568324aff81b51d3af558757042)
+ The fix for this is easy, we must not use systemd-logind integration when
+ not using KeepTty, or iow we may only use systemd-logind integration together
+ with KeepTty.
+
+ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Tested-by: Aaron Plattner <aplattner@nvidia.com>
-commit 838952c97e0ecb334fe4e84a17373fffde053ebe
-Author: Alan Coopersmith <alan.coopersmith@oracle.com>
-Date: Tue Dec 9 18:27:11 2014 -0800
+commit 81bcada14e339fe2a2fb3f3a040566d94dc20bad
+Author: Hans de Goede <hdegoede@redhat.com>
+Date: Wed May 13 13:17:09 2015 +0200
- Get rid of const warnings in XSERVER_INPUT_EVENT dtrace probe calls
+ linux: Add a may_fail paramter to linux_parse_vt_settings
- Use typedefs to work around dtrace dropping const qualifiers from probe
- arguments when generating Xserver-dtrace.h. Add new probes.h header to
- avoid having to replicate these typedefs in every file with dtrace probes.
+ linux_parse_vt_settings() was split out of xf86OpenConsole so that it can
+ be called earlier during systemd-logind init, but it is possible to run
+ the xserver in such a way that xf86OpenConsole() is never used.
- Gets rid of these warnings from gcc 4.8:
- getevents.c:1096:9:
- warning: passing argument 6 of '__dtrace_Xserver___input__event' discards
- 'const' qualifier from pointer target type [enabled by default]
- getevents.c:1096:9:
- warning: passing argument 7 of '__dtrace_Xserver___input__event' disards
- 'const' qualifier from pointer target type [enabled by default]
- getevents.c:1651:9:
- warning: passing argument 6 of '__dtrace_Xserver___input__event' disards
- 'const' qualifier from pointer target type [enabled by default]
- getevents.c:1651:9:
- warning: passing argument 7 of '__dtrace_Xserver___input__event' disards
- 'const' qualifier from pointer target type [enabled by default]
- getevents.c:1791:9:
- warning: passing argument 6 of '__dtrace_Xserver___input__event' disards
- 'const' qualifier from pointer target type [enabled by default]
- getevents.c:1791:9:
- warning: passing argument 7 of '__dtrace_Xserver___input__event' disards
- 'const' qualifier from pointer target type [enabled by default]
- getevents.c:1921:9:
- warning: passing argument 6 of '__dtrace_Xserver___input__event' disards
- 'const' qualifier from pointer target type [enabled by default]
- getevents.c:1921:9:
- warning: passing argument 7 of '__dtrace_Xserver___input__event' disards
- 'const' qualifier from pointer target type [enabled by default]
+ The FatalError calls in linux_parse_vt_settings() may stop the Xorg xserver
+ from working when e.g. no /dev/tty0 is present in such a setup.
- Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ This commit adds a may_fail parameter to linux_parse_vt_settings() which
+ can be used to make linux_parse_vt_settings() fail silenty with an error
+ return in this case, rather then calling FatalError().
+
+ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
- (cherry picked from commit 9e002dfcd71439fd81563db1f70e8c1964d52fab)
-commit 2123f7682d522619f101b05fb75efa75dabbe371
-Author: Adam Jackson <ajax@redhat.com>
-Date: Tue Jun 16 11:42:47 2015 -0400
+commit 1dba5a0b194653b0effb01a918bd7338b0c6bcb9
+Author: Hans de Goede <hdegoede@redhat.com>
+Date: Wed Jan 21 09:31:39 2015 +0100
- xserver 1.17.2
+ linux: Add linux_parse_vt_settings and linux_get_keeptty helpers
- Signed-off-by: Adam Jackson <ajax@redhat.com>
+ systemd-logind integration does not work when starting X on a new tty, as
+ that detaches X from the current session and after hat systemd-logind revokes
+ all rights on any already open fds and refuses to open new fds for X.
+
+ This means that currently e.g. "startx -- vt7" breaks, and breaks badly,
+ requiring ssh access to the system to kill X.
+
+ The fix for this is easy, we must not use systemd-logind integration when
+ not using KeepTty, or iow we may only use systemd-logind integration together
+ with KeepTty.
+
+ But the final KeepTty value is not known until the code to chose which vtno to
+ run on has been called, which currently happens after intializing
+ systemd-logind.
+
+ This commit is step 1 in fixing the "startx -- vt7" breakage, it factors out
+ the linux xf86OpenConsole bits which set xf86Info.vtno and keepTty so that
+ these can be called earlier. Calling this earlier is safe as this code has
+ no side effects other than setting xf86Info.vtno and keepTty.
+
+ Note this basically only moves a large chunk of xf86OpenConsole() into
+ linux_parse_vt_settings() without changing a single line of it, this is
+ hard to see in the diff because the identation level has changed.
+
+ Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-commit 8a5fb096d43577a061f7769d9257cbedaac998ef
+commit fa12f2c150b2f50de9dac4a2b09265f13af353af
Author: Dave Airlie <airlied@redhat.com>
-Date: Thu May 28 05:30:01 2015 +0000
+Date: Thu May 28 16:21:37 2015 +1000
- glamor: don't do render ops with matching source/dest (v2)
+ glamor: don't do render ops with matching source/dest (v3)
XRender defines this, GL really doesn't like it.
@@ -1756,13 +6900,13 @@ Date: Thu May 28 05:30:01 2015 +0000
v2: bump this up a level, and check it earlier.
(I assume the XXXX was for this case.)
+ v3: add same code to largepixmap paths (Keith)
- [This corresponds to fa12f2c150b2f50de9dac4a2b09265f13af353af in master,
- fixed up for 1.17 branch. - ajax]
-
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-commit ea9e02184399e9979654544dde8926912a8aa2c8
+commit cbb7eb73b5399e31a7afb800363504d539df0ecf
Author: Rui Matos <tiagomatos@gmail.com>
Date: Wed May 27 12:08:45 2015 +0200
@@ -1778,9 +6922,8 @@ Date: Wed May 27 12:08:45 2015 +0200
Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit cbb7eb73b5399e31a7afb800363504d539df0ecf)
-commit 6cc61df989c7764097c9b21d71386e230fa13cd4
+commit 806470b9f623089dc81b985f250f0c3a4e8edbe8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Feb 6 08:25:42 2015 +0000
@@ -1795,9 +6938,8 @@ Date: Fri Feb 6 08:25:42 2015 +0000
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
- (cherry picked from commit 806470b9f623089dc81b985f250f0c3a4e8edbe8)
-commit 8b7e1f362bf6940eb863fd02395bf8155d10604b
+commit baa50f60acd9e9f4293107435645ab072b6110e1
Author: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Date: Mon Jan 12 17:10:02 2015 +0000
@@ -1842,9 +6984,8 @@ Date: Mon Jan 12 17:10:02 2015 +0000
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit baa50f60acd9e9f4293107435645ab072b6110e1)
-commit c424458c93cb36708c6074ecaf6566d6b5818c87
+commit 76636ac12f2d1dbdf7be08222f80e7505d53c451
Author: Ray Strode <rstrode@redhat.com>
Date: Tue May 5 16:43:44 2015 -0400
@@ -1863,9 +7004,8 @@ Date: Tue May 5 16:43:44 2015 -0400
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 76636ac12f2d1dbdf7be08222f80e7505d53c451)
-commit 01b4f5bc89820cf8cbe01777871834411074d683
+commit 4b4b9086d02b80549981d205fb1f495edc373538
Author: Ray Strode <rstrode@redhat.com>
Date: Tue May 5 16:43:43 2015 -0400
@@ -1895,9 +7035,8 @@ Date: Tue May 5 16:43:43 2015 -0400
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 4b4b9086d02b80549981d205fb1f495edc373538)
-commit bebaaa2216026bd6b649a8123e67a7f5172b120f
+commit c4534a38b68aa07fb82318040dc8154fb48a9588
Author: Ray Strode <rstrode@redhat.com>
Date: Tue May 5 16:43:42 2015 -0400
@@ -1914,9 +7053,188 @@ Date: Tue May 5 16:43:42 2015 -0400
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit c4534a38b68aa07fb82318040dc8154fb48a9588)
-commit 761be9cceb6f5a2ca883c940d6e1f277ce529ea8
+commit ad02d0df75318660c3f7cd6063eac409327fe560
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Wed May 6 15:25:28 2015 +1000
+
+ test: add tests for new valuator mask features
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+
+commit da10d0cb4283ad5a9c4290555751f61795d11b49
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue May 5 14:48:41 2015 +1000
+
+ dix: hook up the unaccelerated valuator masks
+
+ If present, access the unaccelerated valuator mask values for DGA and XI2 raw
+ events.
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+
+commit 4c2f2cb4c8ca1ab894a65828fdd39aea9b014f69
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue May 5 14:18:54 2015 +1000
+
+ dix: Add unaccelerated valuators to the ValuatorMask
+
+ Allows a mask to carry both accelerated and unaccelerated motion at the same
+ time.
+
+ This is required for xf86-input-libinput where the pointer acceleration
+ happens in libinput already, but parts of the server, specifically raw events
+ and DGA rely on device-specific unaccelerated data.
+
+ To ease integration add this as a second set to the ValuatorMask rather than
+ extending all APIs to carry a second, possibly NULL set of valuators.
+
+ Note that a valuator mask should only be used in either accel/unaccel or
+ standard mode at any time. Switching requires either a valuator_mask_zero()
+ call or unsetting all valuators one-by-one. Trying to mix the two will produce
+ a warning.
+
+ The server has a shortcut for changing a mask with the
+ valuator_mask_drop_unaccelerated() call. This saves us from having to loop
+ through all valuators on every event, we can just drop the bits we know we
+ don't want.
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+
+commit 3f0d3201f38ef9d1651fcaf94e45c640786edcc0
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Mon Apr 13 13:52:28 2015 -0700
+
+ dix: fix indentation
+
+ from 9ff89a2e469ab0ac5af57d0fc115127feb1c0d99
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit f82dc6bd91a545a844fb688ba3552e4f5df8a0d2
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue Mar 24 09:43:17 2015 +1000
+
+ xfree86: drop if 0 hunk
+
+ Disabled in 2005. bye bye.
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit fc59c8fe8d941b0ec1e98c59bc57b1f97dba149d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue May 5 15:54:20 2015 +1000
+
+ config: remove 10-evdev.conf, let the evdev driver install that file
+
+ Now that we have two likely drivers that fight for control over the input
+ devices (evdev and libinput) let's move the respective driver assignment to
+ each package. So you get what you install.
+
+ https://bugs.freedesktop.org/show_bug.cgi?id=89023
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+
+commit bf6344e1913a5d24c2d68eaca999ea3d71e1b707
+Author: Keith Packard <keithp@keithp.com>
+Date: Thu May 14 14:58:29 2015 -0700
+
+ Revert "glx/dri2: Disable AIGLX if indirect GLX is disabled"
+
+ This reverts commit d61ae18074e53c2cdfb13cc37693b526160d6ca7.
+
+ If the DRI2 provider is disabled, then we don't advertise the correct
+ GLX extensions to clients, and things like GLES fail.
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90442
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+
+commit b0d2e010316d710eb4052963de3a1e2dc7ba356e
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Oct 10 09:25:51 2014 +0200
+
+ glamor: Replace CompositeGlyphs code [v2]
+
+ New composite glyphs code uses the updated glamor program
+ infrastructure to create efficient shaders for drawing render text.
+
+ Glyphs are cached in two atlases (one 8-bit, one 32-bit) in a simple
+ linear fashion. When the atlas fills, it is discarded and a new one
+ constructed.
+
+ v2: Eric Anholt changed the non-GLSL 130 path to use quads instead of
+ two triangles for a significant performance improvement on hardware
+ with quads. Someone can fix the GLES quads emulation if they want to
+ make it faster there.
+
+ v3: Eric found more dead code to delete
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 1b745e0c1ff45e014aa21c3d8edf93227bec99bf
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Oct 13 11:40:06 2014 -0700
+
+ glamor: Adapt glamor_program API to handle render acceleration
+
+ This extends the existing API to support options needed for render
+ accleration, including an additional fragment, 'combine', (which
+ provides a place to perform the source IN mask operation before the
+ final OP dest state) and an additional 'defines' parameter which
+ provides a way to add target-dependent values without using a uniform.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit ff3195aadde95c8e89f77f389a7dfb418dd2426c
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Oct 20 21:31:56 2014 -0700
+
+ glamor: Compute GLSL version from GL_SHADING_LANGUAGE_VERSION (v3)
+
+ Use code from Piglit project to compute GLSL version for either GL or
+ GLES. The Piglit code was originally written by Chad Versace.
+
+ v2: bail if the parse fails (requested by Eric Anholt)
+ v3: Use version 1.20 for GLES until we fix our programs (Eric Anholt)
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit dcb3d74ba8861e7b0a592e92b5b2247b84e843f3
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Oct 13 12:35:40 2014 -0700
+
+ glamor: Remove destination drawable argument from glamor_set_texture
+
+ This argument wasn't used at all.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 2bf34fe8d9b7628d164392c2d11ace78f7cf17b9
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon Oct 13 12:32:27 2014 -0700
+
+ glamor: Pass depth to glamor_pm_is_solid and glamor_set_planemask
+
+ Instead of passing the destination drawable, just pass the depth, as
+ the underlying functions need only that to check whether the planemask
+ is going to work.
+
+ This API change will allow higher level functions to not need the
+ destination pixmap.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 910ddf85219f114744e8996a4ac044c4eafc62ac
Author: Egbert Eich <eich@freedesktop.org>
Date: Tue May 12 09:52:48 2015 -0700
@@ -1935,9 +7253,8 @@ Date: Tue May 12 09:52:48 2015 -0700
Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 910ddf85219f114744e8996a4ac044c4eafc62ac)
-commit f775f247731d368c76d9bda3672fbdda7ba21223
+commit c65eda5e6676d942e80eaf2650a670174c8bd84a
Author: Egbert Eich <eich@freedesktop.org>
Date: Tue Mar 31 09:14:28 2015 +0200
@@ -1948,9 +7265,8 @@ Date: Tue Mar 31 09:14:28 2015 +0200
Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit c65eda5e6676d942e80eaf2650a670174c8bd84a)
-commit 6395873ea9a9ccc4ddb840e295a025a3cb931a62
+commit 66212ca0d2f194fd16db65e863f0a2d613e180ea
Author: Egbert Eich <eich@freedesktop.org>
Date: Tue Mar 31 09:14:27 2015 +0200
@@ -1959,9 +7275,8 @@ Date: Tue Mar 31 09:14:27 2015 +0200
Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 66212ca0d2f194fd16db65e863f0a2d613e180ea)
-commit 70ce5753071a71d8f7c7a11a2d91599251bdb845
+commit b536d56aef21739b6da44693bbf19d0e7541392d
Author: Egbert Eich <eich@freedesktop.org>
Date: Tue Mar 31 09:14:26 2015 +0200
@@ -1970,9 +7285,8 @@ Date: Tue Mar 31 09:14:26 2015 +0200
Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit b536d56aef21739b6da44693bbf19d0e7541392d)
-commit a4882ac7927b3efb0fd352cd0b7f5ceeebc1250a
+commit 5af73f490870da9265eeb9b3ce59a2be026be0c8
Author: Egbert Eich <eich@suse.de>
Date: Tue Mar 31 09:14:25 2015 +0200
@@ -1986,9 +7300,8 @@ Date: Tue Mar 31 09:14:25 2015 +0200
Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 5af73f490870da9265eeb9b3ce59a2be026be0c8)
-commit 0dc9da5ce94ba9fe47a992f99ff137dba4810118
+commit 00f79416b19f0cde68291aced44ab07b9b76f7b8
Author: Jonathan Gray <jsg@jsg.id.au>
Date: Wed Apr 15 21:29:58 2015 +1000
@@ -1997,9 +7310,8 @@ Date: Wed Apr 15 21:29:58 2015 +1000
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 00f79416b19f0cde68291aced44ab07b9b76f7b8)
-commit 828a1e38030bde19ffc98ee655df5d590faf30dc
+commit 7c609c911a3a33b7e4ddad46b8fc42878a073ee7
Author: Jonathan Gray <jsg@jsg.id.au>
Date: Wed Apr 15 21:29:07 2015 +1000
@@ -2013,9 +7325,8 @@ Date: Wed Apr 15 21:29:07 2015 +1000
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 7c609c911a3a33b7e4ddad46b8fc42878a073ee7)
-commit 68eb9afb204790b586c96caa4e840a78f8bda8b6
+commit 145ae03814cb3b700b6fe1fd19f8fb15da84d1c8
Author: Michel Dänzer <michel.daenzer@amd.com>
Date: Tue Mar 17 10:21:13 2015 +0900
@@ -2026,9 +7337,8 @@ Date: Tue Mar 17 10:21:13 2015 +0900
Signed-off-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 145ae03814cb3b700b6fe1fd19f8fb15da84d1c8)
-commit 554cb404a5cf146316bff6757acfa693463d141e
+commit 4962c8c08842d9d3ca66d254b1ce4cacc4fb3756
Author: Michel Dänzer <michel.daenzer@amd.com>
Date: Tue Mar 17 10:21:12 2015 +0900
@@ -2039,9 +7349,41 @@ Date: Tue Mar 17 10:21:12 2015 +0900
Signed-off-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 4962c8c08842d9d3ca66d254b1ce4cacc4fb3756)
-commit ae3aa32688e4818979c7c59e12286365825eab53
+commit 0409b6e6d63e9cfb5dc71bb27de4b1ed0152dd9b
+Merge: c39c3a9 23702dd
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon May 11 16:50:43 2015 -0700
+
+ Merge remote-tracking branch 'evelikov/master'
+
+commit c39c3a97508dc384c0757a0990c07b5d7b2fe97a
+Merge: 6b65e96 7470578
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon May 11 16:34:48 2015 -0700
+
+ Merge remote-tracking branch 'ajax/xserver-next'
+
+commit 6b65e961894b9ed53066d22cfd218b12c3f361ca
+Author: Robert Ancell <robert.ancell@canonical.com>
+Date: Wed May 6 15:07:21 2015 +1200
+
+ xwayland: Fix error strings
+
+ Fix missing newlines from error string and fix grammar.
+
+ Signed-off-by: Robert Ancell <robert.ancell@canonical.com>
+ Reviewed-by: Daniel Stone <daniels@collabora.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit d7091a21d90cf463ae39ec5e8741123218ec5686
+Merge: c3ce9d8 8fb8bbb
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon May 11 15:49:34 2015 -0700
+
+ Merge remote-tracking branch 'airlied/for-keithp'
+
+commit c3ce9d8fd404ca1d4697a104ce4899525dd43c51
Author: Adel Gadllah <adel.gadllah@gmail.com>
Date: Fri May 1 17:43:41 2015 +0200
@@ -2059,9 +7401,8 @@ Date: Fri May 1 17:43:41 2015 +0200
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit c3ce9d8fd404ca1d4697a104ce4899525dd43c51)
-commit d8a39245d6cff6accf5eaeae7a1ac15eb1eb048a
+commit 81a51a6cace6fdb54999ccdf1533dc28a2222bb9
Author: Dima Ryazanov <dima@gmail.com>
Date: Wed Apr 29 22:39:18 2015 -0700
@@ -2073,9 +7414,8 @@ Date: Wed Apr 29 22:39:18 2015 -0700
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 81a51a6cace6fdb54999ccdf1533dc28a2222bb9)
-commit 5b23104d58eeb86e16282cdfb0553c2ffdaad169
+commit 9ff89a2e469ab0ac5af57d0fc115127feb1c0d99
Author: Jason Gerecke <killertofu@gmail.com>
Date: Wed Apr 29 15:08:58 2015 +1000
@@ -2089,9 +7429,8 @@ Date: Wed Apr 29 15:08:58 2015 +1000
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 9ff89a2e469ab0ac5af57d0fc115127feb1c0d99)
-commit 6f7a3366a24a351ee49185500410811099a5eb1c
+commit fa62ca68ef8be7f63cd0b899dfae3366ca9350cf
Author: Rui Matos <tiagomatos@gmail.com>
Date: Sat Apr 25 21:19:25 2015 +0200
@@ -2104,9 +7443,15 @@ Date: Sat Apr 25 21:19:25 2015 +0200
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit fa62ca68ef8be7f63cd0b899dfae3366ca9350cf)
-commit 1a87dbc2ce5e6f8a7d111ef22736360fe803ba0e
+commit 26e50e8b2cbd01d050b5ecc02d47488b53ecc08b
+Merge: 28ff661 c7b49bd
+Author: Keith Packard <keithp@keithp.com>
+Date: Mon May 11 15:36:53 2015 -0700
+
+ Merge remote-tracking branch 'jturney/mingw-build-fixes'
+
+commit 7470578520e90b6402b2509cd0c51fd4fd84849f
Author: Brent Collins <bcollins@trustedcs.com>
Date: Thu May 7 15:10:19 2015 -0400
@@ -2120,9 +7465,8 @@ Date: Thu May 7 15:10:19 2015 -0400
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89748
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Brent Collins <bcollins@trustedcs.com>
- (cherry picked from commit 7470578520e90b6402b2509cd0c51fd4fd84849f)
-commit 4f3df05728dd1ace88013e83347cebb64be99c03
+commit bcec9f867d19e954a46c2654a79782bff6c65fce
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sat Feb 14 10:36:44 2015 +0000
@@ -2134,9 +7478,20 @@ Date: Sat Feb 14 10:36:44 2015 +0000
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
- (cherry picked from commit bcec9f867d19e954a46c2654a79782bff6c65fce)
-commit 40f35e448892e58780ff25f29df808aa68f60be3
+commit d61ae18074e53c2cdfb13cc37693b526160d6ca7
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Mar 4 12:16:29 2015 +0000
+
+ glx/dri2: Disable AIGLX if indirect GLX is disabled
+
+ There is no point in setting up the acceleration for indirect GLX if
+ indirect GLX is itself disabled.
+
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 1af15aaf278edcf6f6de94774350e34a80883c24
Author: Olivier Fourdan <ofourdan@redhat.com>
Date: Fri Apr 10 10:07:38 2015 +0200
@@ -2151,9 +7506,8 @@ Date: Fri Apr 10 10:07:38 2015 +0200
Reported-by: Tim Waugh <twaugh@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
- (cherry picked from commit 1af15aaf278edcf6f6de94774350e34a80883c24)
-commit 5497f56b8790e68c653ea4c7f36fcb4868a84b50
+commit 28159eff6badf6181b255f26d1f444abe81c05b7
Author: Jason Gerecke <killertofu@gmail.com>
Date: Thu Apr 30 18:06:14 2015 -0700
@@ -2165,9 +7519,8 @@ Date: Thu Apr 30 18:06:14 2015 -0700
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
- (cherry picked from commit 28159eff6badf6181b255f26d1f444abe81c05b7)
-commit 9e39ba30f145f61c333ccf9280577d3afedfb5fb
+commit cad831f39861435cb94f4c90a73f7f0b62d1a4a1
Author: Robert Ancell <robert.ancell@canonical.com>
Date: Wed May 6 15:07:21 2015 +1200
@@ -2177,9 +7530,171 @@ Date: Wed May 6 15:07:21 2015 +1200
Signed-off-by: Robert Ancell <robert.ancell@canonical.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
- (cherry picked from commit cad831f39861435cb94f4c90a73f7f0b62d1a4a1)
-commit 953520ef98f98ab0ca2029d9047b0ac81ad8e096
+commit 8fb8bbb3062f1a06621ab7030a9e89d5e8367b35
+Author: Dave Airlie <airlied@redhat.com>
+Date: Mon Mar 23 11:33:23 2015 +1000
+
+ modesetting: add tile property support (v2.1)
+
+ This adds tiling support to the server modesetting driver,
+ it retrieves the tile info from the kernel and translates
+ it into the server format and exposes the property.
+
+ v2.1: fix resetting tile property (Chris)
+
+ Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 9257b1252da9092ddc676fec9aabe2b33dfad272
+Author: Dave Airlie <airlied@redhat.com>
+Date: Wed Jan 28 17:35:21 2015 +1000
+
+ modesetting: add dynamic connector hotplug support (MST) (v3)
+
+ This is ported from the same code in the ati and intel drivers,
+
+ It uses the same option name as nvidia and the other DDXes to
+ disable tearing down outputs as it is hard to avoid racing with clients.
+
+ v2: address two issues with DeleteUnusedDP12 enabled, reported
+ by Daniel Martin,
+ a) check we have a mode_output before destroying it
+ b) only delete *unused* displays (thanks Aaron for clarifying)
+ so we check if the output has a crtc and if it does we don't
+ delete it.
+
+ v3: drop the option to delete unused displays, just encode
+ behaviour into the randr spec.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 33422d160bff3117b413a62d82b168e84f1aa8f6
+Author: Dave Airlie <airlied@redhat.com>
+Date: Wed Jan 28 17:25:00 2015 +1000
+
+ modesetting: stop caching mode resources
+
+ There is no need to cache the mode resources and with dynamic
+ connectors for mst support we don't want to. So first clean that
+ up before adding dynamic connector support.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit a9ac02f6949357619684dd98ff6cf05489e62e55
+Author: Dave Airlie <airlied@redhat.com>
+Date: Wed Apr 1 12:13:51 2015 +1000
+
+ xf86Crtc/monitors: create initial monitors for tiled outputs
+
+ This creates an automatic monitor for a tiled monitor at startup.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit afd18bce6a81106a12fd750d5fa09d05c09d37a8
+Author: Dave Airlie <airlied@redhat.com>
+Date: Wed Apr 1 14:32:00 2015 +1000
+
+ xf86Crtc: setup tiled monitors correctly in right of
+
+ This puts the tiles of the monitor in the right place at
+ X server startup.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit e472dd89420f671685c11b06d376ff146d54c3b8
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Jul 28 11:07:13 2009 -0400
+
+ xf86Crtc: right-of placement by default.
+
+ Change the X server default to do right-of placement
+ at startup. This gives an option to allow drivers to
+ override this placement, which has been used for server
+ drivers where both heads are not in the same physical
+ place.
+
+ Been in Fedora for a few years, but for tiled monitors
+ we really want something along these lines.
+
+ This is an ABI break.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 69e4b8e602ecc7b69c75988a447ec5b509b22402
+Author: Dave Airlie <airlied@redhat.com>
+Date: Tue Mar 31 16:56:42 2015 +1000
+
+ xfree86: attempt to autoconfig gpu slave devices (v3)
+
+ This allows us to skip the screen section, the first
+ Device section will get assigned to the screen,
+ any remaining ones will get assigned to the GPUDevice
+ sections for the screen.
+
+ v2: fix the skipping unsuitable screen logic (Aaron)
+ v3: fix segfault if not conf file (me, 5s after sending v2)
+
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 3b6930c5d02d8fc0d22fe7955e1ef2af61727705
+Author: Dave Airlie <airlied@redhat.com>
+Date: Tue Mar 31 16:42:36 2015 +1000
+
+ xserver: add xorg.conf support for gpu devices. (v2.1)
+
+ This allows gpu devices to be specified in xorg.conf Screen sections.
+
+ Section "Device"
+ Driver "intel"
+ Identifier "intel0"
+ Option "AccelMethod" "uxa"
+ EndSection
+
+ Section "Device"
+ Driver "modesetting"
+ Identifier "usb0"
+ EndSection
+
+ Section "Screen"
+ Identifier "screen"
+ Device "intel0"
+ GPUDevice "usb0"
+ EndSection
+
+ This should allow for easier tweaking of driver options which
+ currently mess up the GPU device discovery process.
+
+ v2: add error handling for more than 4 devices, (Emil)
+ fixup CONF_ defines to consistency
+ add MAX_GPUDEVICES define
+ (yes there is two defines, this is consistent
+ with everywhere else).
+ remove braces around slp (Mark Kettenis)
+ man page fixups (Aaron)
+ v2.1: fixup whitespace (Aaron)
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit c7b49bdbb9321fe9a7dc35f47b91cac85516988f
+Author: Colin Harrison <colin.harrison@virgin.net>
+Date: Fri Mar 20 14:25:17 2015 +0000
+
+ os/utils.c: Fix prototype for Win32TempDir()
+
+ xorg/xserver/os/utils.c: In function ‘Win32TempDir’:
+ xorg/xserver/os/utils.c:1643:1: warning: old-style function definition [-Wold-style-definition]
+
+ Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
+ Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+
+commit a9b4b7b79682dd367ce26c29aa5dc85807201851
Author: Colin Harrison <colin.harrison@virgin.net>
Date: Fri Mar 20 14:25:53 2015 +0000
@@ -2187,9 +7702,8 @@ Date: Fri Mar 20 14:25:53 2015 +0000
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
- (cherry picked from commit a9b4b7b79682dd367ce26c29aa5dc85807201851)
-commit cc88bb64adda0e967c5ea0efa34aca015fa9c346
+commit 2b114d6a516ee584ff89b96b12acf91799b6d677
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Fri Mar 20 14:29:58 2015 +0000
@@ -2200,9 +7714,8 @@ Date: Fri Mar 20 14:29:58 2015 +0000
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
- (cherry picked from commit 2b114d6a516ee584ff89b96b12acf91799b6d677)
-commit 36bba39db1d4b5b47bc7db5724a4370a4bcb1ecd
+commit 5bf3e5c8326fb81655827dbd4c527f1a2ba09511
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Wed Mar 18 13:29:22 2015 +0000
@@ -2212,9 +7725,8 @@ Date: Wed Mar 18 13:29:22 2015 +0000
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
- (cherry picked from commit 5bf3e5c8326fb81655827dbd4c527f1a2ba09511)
-commit 5ea517fd3991e9e7c4925e5fb5660fcc597e1898
+commit 8363ef2764fe9c6877d1cb21d3ce7b6cf869f00d
Author: Colin Harrison <colin.harrison@virgin.net>
Date: Fri Mar 20 14:06:49 2015 +0000
@@ -2227,9 +7739,20 @@ Date: Fri Mar 20 14:06:49 2015 +0000
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
- (cherry picked from commit 8363ef2764fe9c6877d1cb21d3ce7b6cf869f00d)
-commit 2a2f676dcefbc26a9cc0c3323f62c82d92e48679
+commit 28ff661e73f4bdf0a9b7c84e70fa0a08fd30e482
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Apr 3 19:06:21 2015 -0700
+
+ Remove empty stub of $host_cpu case statement in configure.ac
+
+ Left behind when commit 5c12399b6c3a8d moved the xorg_bus_* settings
+ elsewhere.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Thomas Klausner <wiz@NetBSD.org>
+
+commit d4e85afac6578d5babc8bf97e00e85b00746fca9
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Apr 3 19:01:40 2015 -0700
@@ -2240,9 +7763,212 @@ Date: Fri Apr 3 19:01:40 2015 -0700
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Thomas Klausner <wiz@NetBSD.org>
- (cherry picked from commit d4e85afac6578d5babc8bf97e00e85b00746fca9)
-commit 9b9d621f1158dc78bae3cb686c6a79db69f54425
+commit 0018784cdde19444a8f970bc414796fc2a523a51
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 17:59:13 2015 -0700
+
+ Convert hw/dmx to new *allocarray functions
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit dc5acaa28ab9ed091f087e56046400d63f1f192a
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 17:30:05 2015 -0700
+
+ Convert hw/kdrive to new *allocarray functions
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit ae2dc01cf1a371db69d5deb987f4185e7c3ccedd
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 17:23:33 2015 -0700
+
+ Convert hw/xnest & hw/vfb to new *allocarray functions
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit 4cb1034906eeec8c8442d70918bea0f4eb1f6e44
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 17:12:06 2015 -0700
+
+ Convert hw/xfree86 to new *allocarray functions
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit f59236c2865d22c6f0b2d1ba303213afd10cd02e
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 15:05:30 2015 -0700
+
+ Convert glamor & glx to new *allocarray functions
+
+ v2: fixup whitespace
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+
+commit 7ac280287491fe06127d9fefc504217e21c780e6
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 14:58:50 2015 -0700
+
+ Convert mi & miext to new *allocarray functions
+
+ v2: remove now useless parentheses
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit 70f4a0e6bd18055cc9cb6685253bf5e07b125657
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 14:40:39 2015 -0700
+
+ Convert exa & fb to new *allocarray functions
+
+ v2: fixup whitespace
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+ Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
+
+commit 4fe6b03b97ab8dbb32e4908e46be350d7f7d336f
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 14:36:07 2015 -0700
+
+ Convert XKB to new *allocarray functions
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+ Acked-by: Daniel Stone <daniels@collabora.com>
+
+commit 1c56ac63c040280498c4a9d67b48c35b60070821
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 13:42:12 2015 -0700
+
+ Convert top level extensions to new *allocarray functions
+
+ v2: remove now useless parentheses
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit b9e665c8b2f048feb3064ce412e0b3e9eb6797b0
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 10:52:29 2015 -0700
+
+ Convert dix/* to new *allocarray functions
+
+ v2: remove now useless parentheses
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit df4e41fdb47cdeab5155224557ed8ab4ec4dc659
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 10:08:25 2015 -0700
+
+ Convert os/* to new *allocarray functions
+
+ v2: remove now useless parentheses
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit ae75d50395fdd7a6bc382ba73e923c460764c702
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 09:28:07 2015 -0700
+
+ Add no-fail equivalents of allocarray & reallocarray
+
+ v2: Remove extra 's' from comment
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit c213b29d14aaf2f4523d638abc762eaaa873cf83
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 08:58:04 2015 -0700
+
+ Add xallocarray() helper macro
+
+ Uses reallocarray to perform integer overflow detection when allocating
+ an array, using NULL as the previous pointer to force a new allocation.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit 0887c9463fc7d36d7874e7f978df4109542f7307
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 08:42:19 2015 -0700
+
+ Import reallocarray() from OpenBSD
+
+ Wrapper for realloc() that checks for overflow when multiplying
+ arguments together, so we don't have to add overflow checks to
+ every single call. For documentation on usage, see:
+ http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man3/calloc.3
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Acked-by: Matt Turner <mattst88@gmail.com>
+
+commit b96dc999968320ad6322b50c79d847efcfcd02b2
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 15:21:14 2015 -0700
+
+ Add XNFcallocarray() to allow xnfcalloc() to check for overflow
+
+ The xnfcalloc() macro took two arguments but simply multiplied them
+ together without checking for overflow and defeating any overflow
+ checking that calloc() might have done. Let's not do that.
+
+ The original XNFcalloc() function is left for now to preserve driver
+ ABI, but is marked as deprecated so it can be removed in a future round
+ of ABI break/cleanup.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit f3ba909753cd216fc9eca4618a76cc283ccbf51e
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 11:07:24 2015 -0700
+
+ Let calloc handle multiplication
+
+ It's going to multiply anyway, so if we have non-constant values, might
+ as well let it do the multiplication instead of adding another multiply,
+ and good versions of calloc will check for & avoid overflow in the process.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit a28202a148508837911c5932a0d14af4b145bece
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Mar 21 08:19:30 2015 -0700
+
+ Remove remaining doc references to Xalloc, Xrealloc, and Xfree
+
+ Functions were removed in commit cad9b053d52f62432
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit 2a6d253b3f2ec4775412b4ae96a96b0b668ec827
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Feb 28 10:04:09 2015 -0800
+
+ Remove apSolaris.shar (old "aperture" kernel driver for Solaris)
+
+ Modern Solaris releases provide this functionality in the OS via the
+ xsvc driver. Since the move to libpciaccess, nothing in Xorg uses
+ this aperture driver any more.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit b1029716e41e252f149b82124a149da180607c96
Author: Ray Strode <rstrode@redhat.com>
Date: Thu Apr 16 11:28:16 2015 -0400
@@ -2268,9 +7994,8 @@ Date: Thu Apr 16 11:28:16 2015 -0400
Signed-off-by: Ray Strode <rstrode@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit b1029716e41e252f149b82124a149da180607c96)
-commit bb5a8da756b70ea6625a3f7ec6cf9b75a558bfb4
+commit 792e9251670ce94210df5c6d354059bbb97f4478
Author: Ray Strode <rstrode@redhat.com>
Date: Thu Apr 16 11:28:15 2015 -0400
@@ -2289,9 +8014,8 @@ Date: Thu Apr 16 11:28:15 2015 -0400
Signed-off-by: Ray Strode <rstrode@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 792e9251670ce94210df5c6d354059bbb97f4478)
-commit 2c818e7b5db92598962f50e42b8367d7724459fb
+commit 41932dfbc841a1adc6512d41085ea3f8ebecb42c
Author: Keith Packard <keithp@keithp.com>
Date: Wed Apr 8 07:45:28 2015 -0700
@@ -2310,9 +8034,8 @@ Date: Wed Apr 8 07:45:28 2015 -0700
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
- (cherry picked from commit 41932dfbc841a1adc6512d41085ea3f8ebecb42c)
-commit 72b66d508acb1d5f0361b06f426ee6fc0d6ad575
+commit 21e7d2bb5cd810688bb905b6ed092497ca8a2c59
Author: Hans de Goede <hdegoede@redhat.com>
Date: Wed Apr 8 14:07:52 2015 +0200
@@ -2327,9 +8050,17 @@ Date: Wed Apr 8 14:07:52 2015 +0200
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
- (cherry picked from commit 21e7d2bb5cd810688bb905b6ed092497ca8a2c59)
-commit 2ce54b81391d36856641c2691bcae8bd13daba4c
+commit f1da6bf5d94911e78d2e27e6accf0c6e3aefb331
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Mar 31 17:07:43 2015 -0700
+
+ Require randrproto version 1.5.0 or newer
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+
+commit e36236eade412dd3894f75f78a7b3d7c1037e6c3
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Tue Dec 30 09:13:16 2014 -0800
@@ -2346,9 +8077,8 @@ Date: Tue Dec 30 09:13:16 2014 -0800
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
- (cherry picked from commit e36236eade412dd3894f75f78a7b3d7c1037e6c3)
-commit 905126c66c45a150932a532de14a4a10595526dc
+commit 4ecda362594d771f401de467c2d58c0f552227a8
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Tue Dec 30 09:13:15 2014 -0800
@@ -2377,9 +8107,191 @@ Date: Tue Dec 30 09:13:15 2014 -0800
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
- (cherry picked from commit 4ecda362594d771f401de467c2d58c0f552227a8)
-commit d8153d1767ccb60a92693c390d12f1f157e24da9
+commit e608f3521eaaab972a3eea62aa04a65958351c1c
+Merge: d3b9c47 5de1383
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Mar 31 09:06:08 2015 -0700
+
+ Merge remote-tracking branch 'airlied/for-keithp'
+
+commit d3b9c47c849d039493c5e0ca5c3af8affe738746
+Author: Jon Turney <jon.turney@dronecode.org.uk>
+Date: Sun Mar 29 23:18:49 2015 +0100
+
+ Fix XQuartz build
+
+ Fix XQuartz build since commit e036cbfc "Make PseudoramiXExtensionInit()
+ prototype more generally available"
+
+ Add #include "nonsdk_extinit.h" to xprScreen.c
+
+ Add #include "nonsdk_extinit.h" to miinitext.c under INXQUARTZ to provide
+ declarations used under INXQUARTZ
+
+ Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
+ Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+ Tested-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 5de13830709a7f2d4d112d71e062f710ef466ab6
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Dec 16 09:56:50 2014 -0800
+
+ randr: Use Monitor list for Xinerama
+
+ This replaces the CRTC-based Xinerama implementation with one which
+ uses Monitors instead, allowing clients to manipulate the Xinerama
+ configuration through the RandR Monitor list.
+
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 7e1f86d42b54fb7f6492875e47a718eaeca3069b
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Dec 16 01:59:03 2014 -0800
+
+ randr: Add Monitor support (v1.1)
+
+ Store the user-defined monitors in the RandR screen private.
+
+ Generate a list of monitors from both the user-defined ones and from
+ any outputs not mentioned in one of the user-defined monitors. This list
+ covers both the outputs in the main screen as well as any slaves.
+
+ v1.1: airlied: fix up primary skipping bug,
+ fix wrong height initialiser
+ add get_active flag from updated protocol.
+
+ Reviewed-by: Dave Airlie <airlied@redhat.com>
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9c2b4f8e0e2b5d4b5e1102d6eea7bdb4211baa68
+Author: Dave Airlie <airlied@redhat.com>
+Date: Tue Mar 31 11:18:44 2015 +1000
+
+ xf86Crtc: add tile prop setting
+
+ Add support for drivers to set the tiling
+ property. This is used by clients to
+ work out the monitor tiles for DisplayID
+ monitors.
+
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 7088816fee0ca7d609c7bca41ef8c3fc938556f5
+Merge: 95e83ff e977b40
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Mar 27 06:45:56 2015 -0700
+
+ Merge remote-tracking branch 'anholt/glamor-next'
+
+commit e977b404d7d1c6cd2be2168f4fdce0ae31cd1f9f
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Jan 17 07:44:27 2015 +1300
+
+ glamor: * 1/size is faster than / size in VS
+
+ Pass the inverse of the texture size to glamor vertex shaders so that
+ we multiply by that instead of dividing by the size as multiplication
+ is generally faster than division.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+commit 82634d2b69950e7e9a066c8c96bf2624ac26193a
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Mon Feb 9 13:45:44 2015 +0000
+
+ ephyr: Avoid a segfault with 'DISPLAY= Xephyr -glamor'
+
+ ephyr_glamor_connect() returns NULL if we failed, but applying
+ xcb_connection_has_error() to NULL is not permitted.
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Daniel Martin <consume.noise@gmail.com>
+
+commit 391bcf77db96ff227e504c213aa5d5db09b6a050
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Feb 23 11:58:59 2015 -0500
+
+ glamor: Fix up indentation
+
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 0669babf2b5b50cbc185b0f714671b2c2b368778
+Author: Matt Turner <mattst88@gmail.com>
+Date: Wed Mar 4 13:42:48 2015 -0800
+
+ glamor: Perform texture2D() separately from swizzle.
+
+ The texture2D() happens in each branch, so we may as well do it as early
+ as possible and hide some of its latency in the branching instructions.
+ Moving it outside the (uniform) control flow reduces the number of
+ instructions in the fs_source shader from 64 to 46 and in the
+ set_alpha_source shader from 69 to 47 on Haswell.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 9e9fcf578063b4155aab4adab83f8d956bde5d1a
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Feb 4 14:38:15 2015 -0800
+
+ glamor: Add a helper function for the common GL_QUADS fallback pattern.
+
+ We should do better than this with an index buffer, but for now at
+ least make it so that we don't have to copy the same code to new
+ places.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 909a406aa239b8d231d6f63ce05a3e4a2bc3cb07
+Author: Eric Anholt <eric@anholt.net>
+Date: Sun Dec 28 19:39:45 2014 -1000
+
+ glamor: Don't optimize out scissor updates in CopyArea.
+
+ This possibly is a minor hit for immediate mode renderers (no
+ difference on copypixin100 on my hsw, n=12), but it gives important
+ information about drawing bounds to a deferred renderer (3.1x
+ improvement in copypixwin100 on vc4).
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 6ba6cc57e17aefb7db0201a1f3180ab55076eb48
+Author: Eric Anholt <eric@anholt.net>
+Date: Sat Dec 27 09:00:58 2014 -1000
+
+ glamor: Just set the logic op to what we want at the start of all rendering.
+
+ By dropping the unconditional logic op disable at the end of
+ rendering, this fixes GL errors being thrown in GLES2 contexts (which
+ don't have logic ops). On desktop, this also means a little less
+ overhead per draw call from taking one less trip through the
+ glEnable/glDisable switch statement of doom in Mesa.
+
+ The exchange here is that we end up taking a trip through it in the
+ XV, Render, and gradient-generation paths. If the glEnable() is
+ actually costly, we should probably cache our logic op state in our
+ screen, since there's no way the GL could make that switch statement
+ as cheap as the caller caching it would be.
+
+ v2: Don't forget to set the logic op in Xephyr's drawing.
+
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 8102927282d5134493e5009a876a6b01a68d1f97
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Thu Feb 5 12:52:02 2015 +0000
@@ -2388,9 +8300,8 @@ Date: Thu Feb 5 12:52:02 2015 +0000
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit 8102927282d5134493e5009a876a6b01a68d1f97)
-commit e0bb4a1ec7a720207831732230535fc8d86fc409
+commit 4218a1e066cf39bb980ebbc9f69536c85232da5c
Author: Olivier Fourdan <ofourdan@redhat.com>
Date: Thu Feb 5 11:59:22 2015 +0100
@@ -2408,9 +8319,170 @@ Date: Thu Feb 5 11:59:22 2015 +0100
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit 4218a1e066cf39bb980ebbc9f69536c85232da5c)
-commit 9d4c8ff6736e737a98586e29d02c0afadbd35b5f
+commit e0788a03144186522fd0ef0e9c954e2744b40275
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 23:47:23 2014 -0700
+
+ glamor: Eliminate GLAMOR_TEXTURE_LARGE pixmap type
+
+ Initialize full pixmap private for all pixmaps, including block
+ dimensions and counts so that no checks are needed when walking the
+ fbos.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit cc731ce0ca4d6c5c8d9c1130864e652a814644b4
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 23:20:11 2014 -0700
+
+ glamor: Create inline tests for small/large pixmaps
+
+ This will let us eliminate the pixmap types shortly
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 020fcc582837b80b20843a09c1e28fa96096fe6b
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 23:08:57 2014 -0700
+
+ glamor: Eliminate separate 'large' pixmap private structure
+
+ Just embed the large elements in the regular pixmap private and
+ collapse the union to a single struct.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 9ef5cbf8ab8a51941d469bfcaca6cbfb7838d1ef
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 22:54:27 2014 -0700
+
+ glamor: Remove unused glamor_pixmap_private_atlas_t
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit af687396f1875de0a45683aad4fd5a9a2e00f10d
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 22:50:53 2014 -0700
+
+ glamor: Remove screen private and pixmap ptrs from pixmap private and fbo
+
+ There's no reason to waste memory storing redundant copies of the same
+ pointer all over the system; just pass in pointers as necessary to
+ each function.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 1eb954c3830d46c27bf2a61f825b59f12092728c
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 21:31:32 2014 -0700
+
+ glamor: Remove remaining support for FBOs not matching pixmap size
+
+ The core rendering code already requires that FBOs be allocated at
+ exactly the pixmap size so that tiling and stippling work
+ correctly. Remove the allocation support for that, along with the
+ render code.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit adb847faeb51c567933fab97b97e79ee3d184dc8
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 20:49:49 2014 -0700
+
+ glamor: Eliminate GLAMOR_TEXTURE_PACK pixmap type
+
+ This is not used anywhere
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 2f80c7791bb0b11f261cb1e3e0d89163dcdd0342
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 20:48:40 2014 -0700
+
+ glamor: Eliminate GLAMOR_SEPARATE_TEXTURE pixmap type
+
+ This was only used to signal when we couldn't ask the DDX to draw to a
+ pixmap; now that we have no DDX-based fallbacks, we don't need to have
+ this type.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit c6ab13566798c7adff23a609575a7ac2d1ce2df6
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 20:44:31 2014 -0700
+
+ glamor: Remove ddx fallback check functions
+
+ With no DDX-based fallback support, we can remove these functions as
+ they are no longer called.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 90d326fcc687e6d6d4b308f6272ededcf8145a17
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 20:40:21 2014 -0700
+
+ glamor: Remove _nf rendering functions
+
+ These were used by the non-standard glamor implementation in the intel
+ driver.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 697f8581e04a93862a6049cc982d01d25f9a0410
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 20:30:12 2014 -0700
+
+ glamor: Eliminate GLAMOR_USE_SCREEN and GLAMOR_USE_PICTURE_SCREEN
+
+ Remove these defines as we start to remove support for non-standard
+ glamor layering as used by the intel driver.
+
+ v2: Rebase on the blockhandler change and the Xephyr init failure
+ change (by anholt), fix stray NO_DRI3 addition to xwayland.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 28ff815c4b32c88bd9007fd79f2acf3682a4b4db
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Oct 29 20:20:29 2014 -0700
+
+ glamor: Eliminate GLAMOR_CREATE_PIXMAP_MAP and GLAMOR_MEMORY_MAP
+
+ GLAMOR_MEMORY_MAP was only used with GLAMOR_CREATE_PIXMAP_MAP, and
+ GLAMOR_CREATE_PIXMAP_MAP doesn't appear to be used anywhere, so just
+ remove both of them.
+
+ v2: Fix a stray whitespace bug that was introduced (change by anholt).
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+ Signed-off-by: Eric Anholt <eric@anholt.net>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 0e1372e1bd8f79fa295738bc1e983cb3648ba4be
Author: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Date: Mon Jan 19 12:37:55 2015 +0100
@@ -2423,9 +8495,8 @@ Date: Mon Jan 19 12:37:55 2015 +0100
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
- (cherry picked from commit 0e1372e1bd8f79fa295738bc1e983cb3648ba4be)
-commit 3bfeccf88a3e9904bd52aa98e39c35f75320d163
+commit c1f35c3d862f77cbd2fb871be5613fb0ca7e508b
Author: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Date: Mon Jan 12 15:29:34 2015 +0100
@@ -2436,9 +8507,8 @@ Date: Mon Jan 12 15:29:34 2015 +0100
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit c1f35c3d862f77cbd2fb871be5613fb0ca7e508b)
-commit 6a37a33e4cbd0d971c30cda3ada6fc13e8414196
+commit b66501b4fd9c392e0f971ea356b27eb71c9c9e79
Author: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Date: Mon Jan 19 12:36:52 2015 +0100
@@ -2452,9 +8522,8 @@ Date: Mon Jan 19 12:36:52 2015 +0100
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit b66501b4fd9c392e0f971ea356b27eb71c9c9e79)
-commit 1ec335ca157b1ca73306950e90ee85a93a791229
+commit 7c6f483670770e4e534cafd4e70d0b1490f4cca6
Author: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Date: Mon Jan 19 12:32:54 2015 +0100
@@ -2469,9 +8538,8 @@ Date: Mon Jan 19 12:32:54 2015 +0100
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit 7c6f483670770e4e534cafd4e70d0b1490f4cca6)
-commit 5df6982a14442e029948b704f5f6d96913e43aae
+commit 4f534c26c64cc1edd33b04d30e4df818b7ae55d9
Author: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed Jan 28 16:08:26 2015 +0100
@@ -2482,9 +8550,8 @@ Date: Wed Jan 28 16:08:26 2015 +0100
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit 4f534c26c64cc1edd33b04d30e4df818b7ae55d9)
-commit e2bddc36af1b848974b67964b4fe4deaa79b786c
+commit 251a067993658fd02f158fef36476f898c238e3c
Author: Olivier Fourdan <ofourdan@redhat.com>
Date: Mon Feb 2 10:41:06 2015 +0100
@@ -2494,9 +8561,45 @@ Date: Mon Feb 2 10:41:06 2015 +0100
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
- (cherry picked from commit 251a067993658fd02f158fef36476f898c238e3c)
-commit e2c6135179ef0fa1b9db33f2d78e138fae233b56
+commit 23702dd2689e2e1e65be5767ac0303a985bb04a0
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date: Thu Mar 19 12:26:29 2015 +0000
+
+ randr: coding style fixes
+
+ In most of xserver code-base we define new functions at column 0, with
+ their return type provided on the previous line. Two functions did not
+ follow this rule so update them, and get them wrapped up to 80 as an
+ added bonus.
+
+ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 739e8fac0e9d8d4c1653e53a8f3ce2d38b3de320
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date: Thu Mar 19 12:22:18 2015 +0000
+
+ randr: wrap long line
+
+ Also make use of total_name_len variable for consistency.
+
+ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 363cd0e0b499ea8c32b2aa5cf7ea0f0a56b4c3ef
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date: Thu Mar 19 12:19:23 2015 +0000
+
+ randr: use local variables where possible
+
+ This will allow us to make the code more readable, and the lines will
+ fit within 80 columns.
+
+ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+
+commit 93ef0e580e9cdbe739046a0873971d402525ef00
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date: Thu Mar 19 12:40:06 2015 +0000
@@ -2507,9 +8610,8 @@ Date: Thu Mar 19 12:40:06 2015 +0000
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
- (cherry picked from commit 93ef0e580e9cdbe739046a0873971d402525ef00)
-commit 8c3a0a1904386b4630726d6be7e6dc56a50c7aa7
+commit a08ee773983c44ebb893f10a1dcfa443f2734277
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date: Thu Mar 19 12:36:50 2015 +0000
@@ -2521,9 +8623,128 @@ Date: Thu Mar 19 12:36:50 2015 +0000
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
- (cherry picked from commit a08ee773983c44ebb893f10a1dcfa443f2734277)
-commit 660b4469f2947a1511248468d095a327f251795d
+commit a34d29c2edd786f0baa0e7c334f4174eeecb71d2
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date: Sun Mar 8 17:56:58 2015 +0000
+
+ configure.ac: remove remaining TLS references
+
+ No longer used with the removal of the GL dispatch (glapi) from libglx a
+ few releases ago.
+
+ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Reviewed-by: Adam Jackson <ajax@redhat.com>
+ Reviewed-by: Eric Anholt <eric@anholt.net>
+
+commit 95e83ff87ab0149ab01c9299524dfbe37d9b21a2
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Thu Jul 12 02:00:43 2012 +0100
+
+ Don't allow both RandR XINERAMA and pseudoramiX XINERAMA extensions to register
+
+ Prevent RRXinerama from activating if PseudoramiX is, so we don't get XINERAMA
+ listed twice in the list of extensions. I think this is otherwise benign, as
+ the PseudoramiX XINERAMA gets registered first and thus handles all requests.
+
+ Perhaps AddExtension() ought to warn us if the extension name is already
+ registered?
+
+ This appears to be a long-standing bug seen in XQuartz, and now in XWin as well.
+
+ Future work: Perhaps since RRXinerama isn't actually doing anything useful but
+ faking it when we have one screen, it seems that the PseudoramiX code could be
+ also used in that case.
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 234fe391802b114e96d60a6630f717f8e4fb726c
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Fri Nov 7 13:38:20 2014 +0000
+
+ hw/xwin: Report OS version in log
+
+ Report OS version in log
+ Report if WoW64 is in use
+ Manifest for compatbility with Windows versions, so we don't get lied to by GetVersionEx()
+ Also, make the description in the manifest a bit more generic
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 7a22912edbda826778463f8fefa9c8e689858bbe
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Thu Nov 6 15:22:58 2014 +0000
+
+ hw/xwin: Remove Shadow DirectDraw engine
+
+ Maybe a long time ago this made some kind of sense, but now there's no good
+ reason to ever use this, rather than the Shadow DirectDraw NonLocking engine.
+
+ Also remove screen private data members used by other removed engines.
+
+ Also remove no longer needed OS version check in winDetectSupportedEngines()
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 55a84be085e9f479f7907bed5fb68fc66ce81ae8
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Sat Mar 3 20:13:19 2012 +0000
+
+ hw/xwin: Only set native positions if XINERAMA is enabled
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 23e07d71b607c99c3a0a0ea362c70dcae73485c6
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Thu Nov 6 14:28:17 2014 +0000
+
+ hw/xwin: Register native screens with pseudoramiX
+
+ Update man page to document pseudo-xinerama
+
+ v2: Make the use of PseudoramiXExtensionInit() match the prototype
+ v3: Update for nonsdk_extinit.h
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit e036cbfccbe33775524a469082306913843c63df
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Thu Nov 6 13:54:11 2014 +0000
+
+ Make PseudoramiXExtensionInit() prototype more generally available
+
+ Make PseudoramiXExtensionInit() prototype available to hw/xwin
+
+ Rather than avoiding a reference to it being pulled in to Xorg by sdksyms by
+ hiding this prototype behind the INXQUARTZ define, which is only defined when
+ building Xquartz, introduce nonsdk_extinit.h and move it there.
+
+ (The only remaining use of INXQUARTZ is in mi/miiniext.c, in order
+ to do PseudoramiXExtensionInit() at the point apparently needed by Xquartz)
+
+ Also remove duplicate declaration of noPseudoramiXExtension from pseudoramiX.h
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit 3aad9b7556391b0f55e46ba13ced5e58d8fd47f7
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date: Mon Nov 7 20:54:10 2011 +0000
+
+ hw/xwin: Turn on -hostintitle by default
+
+ Turn on -hostintitle by default
+ Provide -nohostintitle to disable if needed
+
+ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+ Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
+
+commit b2aaf69e62f4109ffb8aaf39e9bd2571abb29dfb
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Thu Jun 28 14:22:07 2012 +0100
@@ -2531,9 +8752,8 @@ Date: Thu Jun 28 14:22:07 2012 +0100
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
- (cherry picked from commit b2aaf69e62f4109ffb8aaf39e9bd2571abb29dfb)
-commit c3db722ffebfa20b3cedf1a29201442bc4b8b92f
+commit d02f9611c8d3bafca4be17c65efca3c5527f71e2
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Mon Mar 16 16:29:29 2015 +0000
@@ -2552,9 +8772,8 @@ Date: Mon Mar 16 16:29:29 2015 +0000
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
- (cherry picked from commit d02f9611c8d3bafca4be17c65efca3c5527f71e2)
-commit 6fa7510e6af8a06bf58a5a5195ab42b2d1f4aba0
+commit 5071cb7e0ac5f17c48ed7f3f3b6f242dec802f66
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Mon Mar 16 16:14:10 2015 +0000
@@ -2565,9 +8784,8 @@ Date: Mon Mar 16 16:14:10 2015 +0000
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
- (cherry picked from commit 5071cb7e0ac5f17c48ed7f3f3b6f242dec802f66)
-commit 1de38b588ecbc1a78f41a56e00ddda0e76828f77
+commit d3080d421bf0d91daea2e39bfc391c43d7fdad75
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Thu Feb 5 20:29:48 2015 +0000
@@ -2594,9 +8812,8 @@ Date: Thu Feb 5 20:29:48 2015 +0000
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
- (cherry picked from commit d3080d421bf0d91daea2e39bfc391c43d7fdad75)
-commit 44930264eb200ea5cf43b9827e637b736b236f92
+commit 491cf02e191e70c5ce24c19da880bb79bebfc03c
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Tue Feb 10 14:37:26 2015 +0000
@@ -2610,9 +8827,8 @@ Date: Tue Feb 10 14:37:26 2015 +0000
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
- (cherry picked from commit 491cf02e191e70c5ce24c19da880bb79bebfc03c)
-commit 74ab42c85b783443e67edc510307785de653a81c
+commit f42520c5f151bda25e52ae8b0408a421c3fba7e5
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Wed Feb 4 17:04:45 2015 +0000
@@ -2624,9 +8840,8 @@ Date: Wed Feb 4 17:04:45 2015 +0000
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
- (cherry picked from commit f42520c5f151bda25e52ae8b0408a421c3fba7e5)
-commit dee92c7805e0cc646feb9b7e57451848ce48be37
+commit 0a78b599b34cc8b5fe6fe82f90e90234e8ab7a56
Author: Jürg Billeter <j@bitron.ch>
Date: Sat Feb 7 18:13:21 2015 +0100
@@ -2637,9 +8852,21 @@ Date: Sat Feb 7 18:13:21 2015 +0100
Signed-off-by: Jürg Billeter <j@bitron.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
- (cherry picked from commit 0a78b599b34cc8b5fe6fe82f90e90234e8ab7a56)
-commit 19da4355ee975c714f0f11d31c8b41c3fdabd913
+commit 21b896939c5bb242f3aacc37baf12379e43254b6
+Author: Egbert Eich <eich@freedesktop.org>
+Date: Tue Mar 3 16:27:05 2015 +0100
+
+ symbols: Fix sdksyms.sh to cope with gcc5
+
+ Gcc5 adds additional lines stating line numbers before and
+ after __attribute__() which need to be skipped.
+
+ Signed-off-by: Egbert Eich <eich@freedesktop.org>
+ Tested-by: Daniel Stone <daniels@collabora.com>
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7ea64fb4374504bd3d524fc08c90efdab9f253ea
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Mon Mar 9 09:55:57 2015 -0700
@@ -2657,9 +8884,21 @@ Date: Mon Mar 9 09:55:57 2015 -0700
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
- (cherry picked from commit 7ea64fb4374504bd3d524fc08c90efdab9f253ea)
-commit a4132357c26b2140162f73d42d0b196be60373ef
+commit 6d3cf35a6f0856ac44a7be560e2265461f9bb32b
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date: Mon Mar 9 12:00:52 2015 +0000
+
+ autogen.sh: use quoted string variables
+
+ Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
+ fall-outs, when they contain space.
+
+ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 5c4202ea85aaea2a4dc7eb29776357a2ba13e191
Author: Michal Srb <msrb@suse.com>
Date: Thu Feb 19 14:57:27 2015 +0200
@@ -2669,9 +8908,22 @@ Date: Thu Feb 19 14:57:27 2015 +0200
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
- (cherry picked from commit 5c4202ea85aaea2a4dc7eb29776357a2ba13e191)
-commit 650a1fd274f191e77a2e8b4cb7dac67b6ff596c6
+commit f485a1af64bb00c696ea9f79961786bd791eaec1
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue Dec 16 14:43:29 2014 +1000
+
+ Drop valuator mask argument from GetKeyboardEvents
+
+ Nothing was using it and if anyone had they would've gotten a warning and
+ noticed that it doesn't actually work. Drop this, it has been unused for years.
+
+ Input ABI 22
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit 9d9bd38fe1454590c303dc936ddac913808bf881
Author: Dave Airlie <airlied@redhat.com>
Date: Tue Feb 17 14:40:27 2015 +1000
@@ -2688,31 +8940,403 @@ Date: Tue Feb 17 14:40:27 2015 +1000
Signed-off-by: Dave Airlie <airlied@redhat.com>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
- (cherry picked from commit 9d9bd38fe1454590c303dc936ddac913808bf881)
-commit 7a45d1684f626f3045305328c3aab85eed0673ea
-Author: Egbert Eich <eich@freedesktop.org>
-Date: Tue Mar 3 16:27:05 2015 +0100
+commit 3a06faf3fcdb7451125a46181f9152e8e59e9770
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Feb 10 22:16:49 2015 -0800
- symbols: Fix sdksyms.sh to cope with gcc5
+ Mark development version for 1.18
- Gcc5 adds additional lines stating line numbers before and
- after __attribute__() which need to be skipped.
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 4a758f59a8a65c313244e06852745c8e180ff247
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 22:38:26 2014 -0800
+
+ dmx: include header for DMXExtensionInit() in dmx.c
- Signed-off-by: Egbert Eich <eich@freedesktop.org>
- Tested-by: Daniel Stone <daniels@collabora.com>
- Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
- (cherry picked from commit 21b896939c5bb242f3aacc37baf12379e43254b6)
+ Gets rid of gcc 4.8 warning:
+
+ dmx.c:1193:1: warning: no previous prototype for ‘DMXExtensionInit’ [-Wmissing-prototypes]
+ DMXExtensionInit(void)
+ ^
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
-commit 3b0d1ba2266d2780bfc111bab74885b90458eca4
-Author: Keith Packard <keithp@keithp.com>
-Date: Tue Feb 10 14:43:34 2015 -0800
+commit a0e44ddfb0c641e7896a55abf26621ae3d17e337
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 22:33:54 2014 -0800
- Release 1.17.1
+ dmx: constify GCOps & GCFuncs pointers
- Signed-off-by: Keith Packard <keithp@keithp.com>
+ Gets rid of 16 instances of gcc 4.8 warnings:
+
+ In file included from dmxgc.c:41:0:
+ dmx.h:327:23: warning: assignment discards ‘const’ qualifier from
+ pointer target type [enabled by default]
+ (_saved)->_entry = (_actual)->_entry; \
+ ^
+ dmxgc.h:80:5: note: in expansion of macro ‘DMX_WRAP’
+ DMX_WRAP(funcs, &dmxGCFuncs, _pGCPriv, (_pGC)); \
+ ^
+ dmxgc.c:192:5: note: in expansion of macro ‘DMX_GC_FUNC_EPILOGUE’
+ DMX_GC_FUNC_EPILOGUE(pGC);
+ ^
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 9682c47e228962e4008855c4da7467748742685e
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 22:20:24 2014 -0800
+
+ dmx: Mark glxIsExtensionSupported as a const char *
+
+ Gets rid of 9 instances of gcc 4.8 warning:
+
+ glxcmds.c: In function ‘CreateContext’:
+ glxcmds.c:378:13: warning: passing argument 1 of ‘glxIsExtensionSupported’
+ discards ‘const’ qualifier from pointer target type [enabled by default]
+ else if (glxIsExtensionSupported("GLX_SGIX_fbconfig")) {
+ ^
+ In file included from glxserver.h:49:0,
+ from glxcmds.c:41:
+ glxscreens.h:53:12: note: expected ‘char *’ but argument is of type
+ ‘const char *’
+ extern int glxIsExtensionSupported(char *ext);
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 45ec646d77086eeb5f94766b055a93b5c75bdef0
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 22:16:49 2014 -0800
+
+ dmx: remove redundant redeclarations of variables from other headers
+
+ Gets rid of these gcc 4.8 warnings:
+
+ dmxcb.c:50:12: warning: redundant redeclaration of ‘PanoramiXPixWidth’
+ [-Wredundant-decls]
+ extern int PanoramiXPixWidth;
+ ^
+ In file included from dmxcb.c:49:0:
+ ../../Xext/panoramiXsrv.h:12:22: note: previous declaration of
+ ‘PanoramiXPixWidth’ was here
+ extern _X_EXPORT int PanoramiXPixWidth;
+ ^
+ dmxcb.c:51:12: warning: redundant redeclaration of ‘PanoramiXPixHeight’
+ [-Wredundant-decls]
+ extern int PanoramiXPixHeight;
+ ^
+ In file included from dmxcb.c:49:0:
+ ../../Xext/panoramiXsrv.h:13:22: note: previous declaration of
+ ‘PanoramiXPixHeight’ was here
+ extern _X_EXPORT int PanoramiXPixHeight;
+ ^
+ dmxcb.c:52:12: warning: redundant redeclaration of ‘PanoramiXNumScreens’
+ [-Wredundant-decls]
+ extern int PanoramiXNumScreens;
+ ^
+ In file included from dmxcb.c:49:0:
+ ../../Xext/panoramiXsrv.h:11:22: note: previous declaration of
+ ‘PanoramiXNumScreens’ was here
+ extern _X_EXPORT int PanoramiXNumScreens;
+ ^
+
+ dmxpict.c:60:12: warning: redundant redeclaration of ‘RenderErrBase’
+ [-Wredundant-decls]
+ extern int RenderErrBase;
+ ^
+ In file included from ../../render/glyphstr.h:29:0,
+ from ../../render/picturestr.h:28,
+ from dmx.h:65,
+ from dmxpict.c:42:
+ ../../render/picture.h:176:22: note: previous declaration of ‘RenderErrBase’
+ was here
+ extern _X_EXPORT int RenderErrBase;
+ ^
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 1033b85196e0f25877b4b9081993aff16bf32138
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 22:13:28 2014 -0800
+
+ dmx: remove redundant declaration of dmxFontPrivateIndex from dmxfont.h
+
+ Gets rid of 8 instances of gcc 4.8 warning:
+
+ In file included from glxcmds.c:38:0:
+ ../../../hw/dmx/dmxfont.h:57:12: warning: redundant redeclaration of
+ ‘dmxFontPrivateIndex’ [-Wredundant-decls]
+ extern int dmxFontPrivateIndex;
+ ^
+ In file included from glxcmds.c:35:0:
+ ../../../hw/dmx/dmx.h:388:12: note: previous declaration of
+ ‘dmxFontPrivateIndex’ was here
+ extern int dmxFontPrivateIndex; /**< Private index for Fonts */
+ ^
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit ac64a653fb4935a799baca7545ba6ca401e20fa1
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 22:09:14 2014 -0800
+
+ dmx: glxproxy prototype cleanup
+
+ Gets rid of 107 -Wmissing-prototypes & -Wredundant-decls warnings
+ from gcc 4.8
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit bd563fd48f909094d6660854e97811ad7e676ddf
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 21:11:17 2014 -0800
+
+ dmx: more unshadowing of variables
+
+ Gets rid of gcc 4.8 warnings:
+
+ dmxinputinit.c: In function ‘dmxInputScanForExtensions’:
+ dmxinputinit.c:877:14: warning: declaration of ‘display’ shadows a global declaration [-Wshadow]
+ Display *display;
+ ^
+ In file included from ../../../include/windowstr.h:60:0,
+ from dmxinputinit.c:72:
+ ../../../include/opaque.h:52:30: warning: shadowed declaration is here [-Wshadow]
+ extern _X_EXPORT const char *display;
+ ^
+
+ glxcmds.c: In function ‘__glXCreatePbuffer’:
+ glxcmds.c:3397:21: warning: declaration of ‘pc’ shadows a parameter [-Wshadow]
+ CARD32 *pc = (CARD32 *) (be_req + 1);
+ ^
+ glxcmds.c:3314:52: warning: shadowed declaration is here [-Wshadow]
+ __glXCreatePbuffer(__GLXclientState * cl, GLbyte * pc)
+ ^
+
+ glxscreens.c: In function ‘CalcServerVersionAndExtensions’:
+ glxscreens.c:139:35: warning: declaration of ‘req’ shadows a previous local [-Wshadow]
+ xGLXQueryServerStringReq *req;
+ ^
+ glxscreens.c:68:26: warning: shadowed declaration is here [-Wshadow]
+ xGLXQueryVersionReq *req;
+ ^
+ glxscreens.c:140:36: warning: declaration of ‘reply’ shadows a previous local [-Wshadow]
+ xGLXQueryServerStringReply reply;
+ ^
+ glxscreens.c:69:27: warning: shadowed declaration is here [-Wshadow]
+ xGLXQueryVersionReply reply;
+ ^
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 57e08fae82f733304200a473f55b86e689404c13
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 21:07:12 2014 -0800
+
+ dmx: attempt to untangle nested loops using same index variable
+
+ This doesn't just make gcc sad, it makes my brain sad.
+
+ Change from:
+ for (i = 0; i < dmxNumScreens; i++) {
+ int i;
+ for (i = 0; i < nconfigs; i++) {
+ for (j = 0; j < dmxScreen->beNumVisuals; j++) {
+
+ to the easier to follow:
+ for (i = 0; i < dmxNumScreens; i++) {
+ for (j = 0; j < nconfigs; j++) {
+ for (k = 0; k < dmxScreen->beNumVisuals; k++) {
+
+ Gets rid of gcc 4.8 warning:
+
+ dmxinit.c: In function ‘InitOutput’:
+ dmxinit.c:765:17: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
+ int i;
+ ^
+ dmxinit.c:608:9: warning: shadowed declaration is here [-Wshadow]
+ int i;
+ ^
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 0fbebad72428abbc9fc3fa9f406f7a7e1b9d95b2
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 20:53:33 2014 -0800
+
+ dmx: remove unused variables
+
+ Gets rid of gcc 4.8 warnings:
+
+ dmxscrinit.c: In function ‘dmxBEScreenInit’:
+ dmxscrinit.c:83:15: warning: unused variable ‘gcvals’ [-Wunused-variable]
+ XGCValues gcvals;
+ ^
+
+ dmxwindow.c: In function ‘dmxResizeWindow’:
+ dmxwindow.c:860:19: warning: variable ‘pSibPriv’ set but not used [-Wunused-but-set-variable]
+ dmxWinPrivPtr pSibPriv;
+ ^
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit f358f0d50cadaf10f7d97e21da00419a4a37c4e1
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 19:09:36 2014 -0800
+
+ dmx: fix printf format argument warnings
+
+ Gets rid of these gcc 4.8 warnings:
+
+ dmxinit.c: In function ‘dmxErrorHandler’:
+ dmxinit.c:167:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
+ but argument 3 has type ‘XID64’ [-Wformat=]
+ ev->resourceid);
+ ^
+ dmxinit.c:171:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
+ but argument 3 has type ‘XID64’ [-Wformat=]
+ ev->resourceid);
+ ^
+ dmxinit.c:175:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
+ but argument 3 has type ‘XID64’ [-Wformat=]
+ ev->resourceid);
+ ^
+ dmxinit.c:181:12: warning: format ‘%d’ expects argument of type ‘int’,
+ but argument 3 has type ‘long unsigned int’ [-Wformat=]
+ ev->serial);
+ ^
+ dmxinit.c:183:12: warning: format ‘%d’ expects argument of type ‘int’,
+ but argument 3 has type ‘long unsigned int’ [-Wformat=]
+ dpy->request);
+ ^
+ dmxinit.c: In function ‘InitOutput’:
+ dmxinit.c:637:9: warning: format ‘%d’ expects argument of type ‘int’,
+ but argument 3 has type ‘long unsigned int’ [-Wformat=]
+ dmxLog(dmxInfo, "Generation: %d\n", dmxGeneration);
+ ^
+
+ dmxprop.c: In function ‘dmxPropertyCheckOtherWindows’:
+ dmxprop.c:223:24: warning: format ‘%lu’ expects argument of type ‘long
+ unsigned int’, but argument 4 has type ‘Window’ [-Wformat=]
+ dmxScreen->name, win, tp.value);
+ ^
+ dmxprop.c: In function ‘dmxPropertyWindow’:
+ dmxprop.c:364:16: warning: format ‘%lu’ expects argument of type ‘long
+ unsigned int’, but argument 5 has type ‘Window’ [-Wformat=]
+ other->index, other->name, other->scrnWin);
+ ^
+ dmxprop.c:364:16: warning: format ‘%lu’ expects argument of type ‘long
+ unsigned int’, but argument 8 has type ‘Window’ [-Wformat=]
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 11af200b004b4810c9267e3e16449c3175c64d4a
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 18:58:01 2014 -0800
+
+ dmx: move format strings inline so gcc can check
+
+ Gets rid of gcc 4.8 warnings:
+
+ dmxprint.c: In function ‘dmxConfigPrintPair’:
+ dmxprint.c:284:25: warning: format not a string literal,
+ argument types not checked [-Wformat-nonliteral]
+ p->ysign < 0 ? '-' : '+', p->y);
+ ^
+ dmxprint.c:289:9: warning: format not a string literal,
+ argument types not checked [-Wformat-nonliteral]
+ dmxConfigOutput(addSpace, 0, p->comment, format, p->x, p->y);
+ ^
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 5e01eac10e915568324aff81b51d3af558757042
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Dec 12 18:52:05 2014 -0800
+
+ dmx: Add _X_ATTRIBUTE_PRINTF to dmxConfigLog() & dmxConfigOutput()
+
+ Gets rid of gcc 4.8 warnings:
+
+ dmxparse.c: In function ‘dmxConfigLog’:
+ dmxparse.c:61:5: warning: function might be possible candidate for
+ ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
+ vprintf(format, args); /* RATS: All calls to dmxConfigLog from
+ ^
+
+ dmxprint.c: In function ‘dmxConfigOutput’:
+ dmxprint.c:149:9: warning: function might be possible candidate for
+ ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
+ pos += vfprintf(str, format, args); /* assumes no newlines! */
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Rémi Cardona <remi@gentoo.org>
+ Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit 9e002dfcd71439fd81563db1f70e8c1964d52fab
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Tue Dec 9 18:27:11 2014 -0800
+
+ Get rid of const warnings in XSERVER_INPUT_EVENT dtrace probe calls
+
+ Use typedefs to work around dtrace dropping const qualifiers from probe
+ arguments when generating Xserver-dtrace.h. Add new probes.h header to
+ avoid having to replicate these typedefs in every file with dtrace probes.
+
+ Gets rid of these warnings from gcc 4.8:
+ getevents.c:1096:9:
+ warning: passing argument 6 of '__dtrace_Xserver___input__event' discards
+ 'const' qualifier from pointer target type [enabled by default]
+ getevents.c:1096:9:
+ warning: passing argument 7 of '__dtrace_Xserver___input__event' disards
+ 'const' qualifier from pointer target type [enabled by default]
+ getevents.c:1651:9:
+ warning: passing argument 6 of '__dtrace_Xserver___input__event' disards
+ 'const' qualifier from pointer target type [enabled by default]
+ getevents.c:1651:9:
+ warning: passing argument 7 of '__dtrace_Xserver___input__event' disards
+ 'const' qualifier from pointer target type [enabled by default]
+ getevents.c:1791:9:
+ warning: passing argument 6 of '__dtrace_Xserver___input__event' disards
+ 'const' qualifier from pointer target type [enabled by default]
+ getevents.c:1791:9:
+ warning: passing argument 7 of '__dtrace_Xserver___input__event' disards
+ 'const' qualifier from pointer target type [enabled by default]
+ getevents.c:1921:9:
+ warning: passing argument 6 of '__dtrace_Xserver___input__event' disards
+ 'const' qualifier from pointer target type [enabled by default]
+ getevents.c:1921:9:
+ warning: passing argument 7 of '__dtrace_Xserver___input__event' disards
+ 'const' qualifier from pointer target type [enabled by default]
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-commit f160e722672dbb2b5215870b47bcc51461d96ff1
+commit 20079c36cf7d377938ca5478447d8b9045cb7d43
Author: Olivier Fourdan <ofourdan@redhat.com>
Date: Fri Jan 16 08:44:45 2015 +0100
@@ -2724,9 +9348,8 @@ Date: Fri Jan 16 08:44:45 2015 +0100
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
- (cherry picked from commit 20079c36cf7d377938ca5478447d8b9045cb7d43)
-commit 29be310c303914090298ddda93a5bd5d00a94945
+commit 81c90dc8f0aae3b65730409b1b615b5fa7280ebd
Author: Olivier Fourdan <ofourdan@redhat.com>
Date: Fri Jan 16 20:08:59 2015 +0100
@@ -2748,7 +9371,6 @@ Date: Fri Jan 16 20:08:59 2015 +0100
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
- (cherry picked from commit 81c90dc8f0aae3b65730409b1b615b5fa7280ebd)
commit 28f6427aec1f5a1982e1c01eff45af0d401bf659
Author: Keith Packard <keithp@keithp.com>
diff --git a/xserver/Makefile.in b/xserver/Makefile.in
index 137070734..7ba4b370d 100644
--- a/xserver/Makefile.in
+++ b/xserver/Makefile.in
@@ -60,8 +60,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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 \
@@ -274,7 +273,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -404,8 +402,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/TODO b/xserver/TODO
index 115efc255..43ac1230f 100644
--- a/xserver/TODO
+++ b/xserver/TODO
@@ -65,4 +65,16 @@ 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
diff --git a/xserver/Xext/Makefile.am b/xserver/Xext/Makefile.am
index a9a446820..1ceb9803d 100644
--- a/xserver/Xext/Makefile.am
+++ b/xserver/Xext/Makefile.am
@@ -1,4 +1,4 @@
-noinst_LTLIBRARIES = libXext.la libXextdpmsstubs.la
+noinst_LTLIBRARIES = libXext.la libXextdpmsstubs.la libXvidmode.la
AM_CFLAGS = $(DIX_CFLAGS)
@@ -6,7 +6,7 @@ if XORG
sdk_HEADERS = xvdix.h xvmcext.h geext.h geint.h shmint.h syncsdk.h
endif
-# Sources always included in libXextbuiltin.la & libXext.la
+# Sources always included in libXextbuiltin.la, libXext.la
BUILTIN_SRCS = \
bigreq.c \
geext.c \
@@ -98,6 +98,9 @@ libXext_la_LIBADD = $(BUILTIN_LIBS)
libXextdpmsstubs_la_SOURCES = dpmsstubs.c
+# XVidMode extension
+libXvidmode_la_SOURCES = vidmode.c
+
EXTRA_DIST = \
$(MITSHM_SRCS) \
$(XV_SRCS) \
diff --git a/xserver/Xext/Makefile.in b/xserver/Xext/Makefile.in
index 99278612a..5ef5bea4e 100644
--- a/xserver/Xext/Makefile.in
+++ b/xserver/Xext/Makefile.in
@@ -71,8 +71,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -133,6 +132,9 @@ am__v_lt_1 =
libXextdpmsstubs_la_LIBADD =
am_libXextdpmsstubs_la_OBJECTS = dpmsstubs.lo
libXextdpmsstubs_la_OBJECTS = $(am_libXextdpmsstubs_la_OBJECTS)
+libXvidmode_la_LIBADD =
+am_libXvidmode_la_OBJECTS = vidmode.lo
+libXvidmode_la_OBJECTS = $(am_libXvidmode_la_OBJECTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -167,9 +169,10 @@ 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 = $(libXext_la_SOURCES) $(libXextdpmsstubs_la_SOURCES)
+SOURCES = $(libXext_la_SOURCES) $(libXextdpmsstubs_la_SOURCES) \
+ $(libXvidmode_la_SOURCES)
DIST_SOURCES = $(am__libXext_la_SOURCES_DIST) \
- $(libXextdpmsstubs_la_SOURCES)
+ $(libXextdpmsstubs_la_SOURCES) $(libXvidmode_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -300,7 +303,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -430,8 +432,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -555,12 +555,12 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-noinst_LTLIBRARIES = libXext.la libXextdpmsstubs.la
+noinst_LTLIBRARIES = libXext.la libXextdpmsstubs.la libXvidmode.la
AM_CFLAGS = $(DIX_CFLAGS)
@XORG_TRUE@sdk_HEADERS = xvdix.h xvmcext.h geext.h geint.h shmint.h \
@XORG_TRUE@ syncsdk.h $(am__append_6) $(am__append_8)
-# Sources always included in libXextbuiltin.la & libXext.la
+# Sources always included in libXextbuiltin.la, libXext.la
BUILTIN_SRCS = bigreq.c geext.c shape.c sleepuntil.c sleepuntil.h \
sync.c syncsdk.h syncsrv.h xcmisc.c xtest.c $(am__append_1) \
$(am__append_2) $(am__append_3) $(am__append_4) \
@@ -606,6 +606,9 @@ DPMS_SRCS = dpms.c dpmsproc.h
libXext_la_SOURCES = $(BUILTIN_SRCS)
libXext_la_LIBADD = $(BUILTIN_LIBS)
libXextdpmsstubs_la_SOURCES = dpmsstubs.c
+
+# XVidMode extension
+libXvidmode_la_SOURCES = vidmode.c
EXTRA_DIST = \
$(MITSHM_SRCS) \
$(XV_SRCS) \
@@ -668,6 +671,8 @@ libXext.la: $(libXext_la_OBJECTS) $(libXext_la_DEPENDENCIES) $(EXTRA_libXext_la_
$(AM_V_CCLD)$(LINK) $(libXext_la_OBJECTS) $(libXext_la_LIBADD) $(LIBS)
libXextdpmsstubs.la: $(libXextdpmsstubs_la_OBJECTS) $(libXextdpmsstubs_la_DEPENDENCIES) $(EXTRA_libXextdpmsstubs_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) $(libXextdpmsstubs_la_OBJECTS) $(libXextdpmsstubs_la_LIBADD) $(LIBS)
+libXvidmode.la: $(libXvidmode_la_OBJECTS) $(libXvidmode_la_DEPENDENCIES) $(EXTRA_libXvidmode_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(libXvidmode_la_OBJECTS) $(libXvidmode_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -689,6 +694,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleepuntil.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vidmode.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xace.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcmisc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86bigfont.Plo@am__quote@
diff --git a/xserver/Xext/geext.c b/xserver/Xext/geext.c
index aee68c41d..6285f69f7 100644
--- a/xserver/Xext/geext.c
+++ b/xserver/Xext/geext.c
@@ -90,9 +90,10 @@ ProcGEQueryVersion(ClientPtr client)
return Success;
}
-int (*ProcGEVector[GENumberRequests]) (ClientPtr) = {
+static int (*ProcGEVector[GENumberRequests]) (ClientPtr) = {
/* Version 1.0 */
-ProcGEQueryVersion};
+ ProcGEQueryVersion,
+};
/************************************************************/
/* swapped request handlers */
@@ -109,9 +110,10 @@ SProcGEQueryVersion(ClientPtr client)
return (*ProcGEVector[stuff->ReqType]) (client);
}
-int (*SProcGEVector[GENumberRequests]) (ClientPtr) = {
+static int (*SProcGEVector[GENumberRequests]) (ClientPtr) = {
/* Version 1.0 */
-SProcGEQueryVersion};
+ SProcGEQueryVersion
+};
/************************************************************/
/* callbacks */
diff --git a/xserver/Xext/geint.h b/xserver/Xext/geint.h
index f76d14809..0ee28e471 100644
--- a/xserver/Xext/geint.h
+++ b/xserver/Xext/geint.h
@@ -37,7 +37,7 @@
#include "extnsionst.h"
#include <X11/extensions/geproto.h>
-extern _X_EXPORT DevPrivateKeyRec GEClientPrivateKeyRec;
+extern DevPrivateKeyRec GEClientPrivateKeyRec;
#define GEClientPrivateKey (&GEClientPrivateKeyRec)
@@ -48,7 +48,4 @@ typedef struct _GEClientInfo {
#define GEGetClient(pClient) ((GEClientInfoPtr)(dixLookupPrivate(&((pClient)->devPrivates), GEClientPrivateKey)))
-extern _X_EXPORT int (*ProcGEVector[ /*GENumRequests */ ]) (ClientPtr);
-extern _X_EXPORT int (*SProcGEVector[ /*GENumRequests */ ]) (ClientPtr);
-
#endif /* _GEINT_H_ */
diff --git a/xserver/Xext/hashtable.c b/xserver/Xext/hashtable.c
index 471ecca1c..41b2e0013 100644
--- a/xserver/Xext/hashtable.c
+++ b/xserver/Xext/hashtable.c
@@ -54,7 +54,7 @@ ht_create(int keySize,
ht->elements = 0;
ht->bucketBits = INITHASHSIZE;
numBuckets = 1 << ht->bucketBits;
- ht->buckets = malloc(numBuckets * sizeof(*ht->buckets));
+ ht->buckets = xallocarray(numBuckets, sizeof(*ht->buckets));
ht->cdata = cdata;
if (ht->buckets) {
@@ -92,7 +92,7 @@ double_size(HashTable ht)
int newNumBuckets = 1 << newBucketBits;
int c;
- newBuckets = malloc(newNumBuckets * sizeof(*ht->buckets));
+ newBuckets = xallocarray(newNumBuckets, sizeof(*ht->buckets));
if (newBuckets) {
for (c = 0; c < newNumBuckets; ++c) {
xorg_list_init(&newBuckets[c]);
diff --git a/xserver/Xext/panoramiX.c b/xserver/Xext/panoramiX.c
index 2bbae2f5e..209df292c 100644
--- a/xserver/Xext/panoramiX.c
+++ b/xserver/Xext/panoramiX.c
@@ -747,13 +747,13 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth)
j = PanoramiXNumDepths;
PanoramiXNumDepths++;
- PanoramiXDepths = realloc(PanoramiXDepths,
- PanoramiXNumDepths * sizeof(DepthRec));
+ PanoramiXDepths = reallocarray(PanoramiXDepths,
+ PanoramiXNumDepths, sizeof(DepthRec));
PanoramiXDepths[j].depth = pDepth->depth;
PanoramiXDepths[j].numVids = 0;
/* XXX suboptimal, should grow these dynamically */
if (pDepth->numVids)
- PanoramiXDepths[j].vids = malloc(sizeof(VisualID) * pDepth->numVids);
+ PanoramiXDepths[j].vids = xallocarray(pDepth->numVids, sizeof(VisualID));
else
PanoramiXDepths[j].vids = NULL;
}
@@ -789,8 +789,8 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual)
/* found a matching visual on all screens, add it to the subset list */
j = PanoramiXNumVisuals;
PanoramiXNumVisuals++;
- PanoramiXVisuals = realloc(PanoramiXVisuals,
- PanoramiXNumVisuals * sizeof(VisualRec));
+ PanoramiXVisuals = reallocarray(PanoramiXVisuals,
+ PanoramiXNumVisuals, sizeof(VisualRec));
memcpy(&PanoramiXVisuals[j], pVisual, sizeof(VisualRec));
diff --git a/xserver/Xext/panoramiXprocs.c b/xserver/Xext/panoramiXprocs.c
index 413a66afb..9eb29bd74 100644
--- a/xserver/Xext/panoramiXprocs.c
+++ b/xserver/Xext/panoramiXprocs.c
@@ -1106,7 +1106,7 @@ PanoramiXCopyArea(ClientPtr client)
}
pitch = PixmapBytePad(stuff->width, drawables[0]->depth);
- if (!(data = calloc(1, stuff->height * pitch)))
+ if (!(data = calloc(stuff->height, pitch)))
return BadAlloc;
XineramaGetImageData(drawables, srcx, srcy,
@@ -1341,7 +1341,7 @@ PanoramiXPolyPoint(ClientPtr client)
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq));
if (npoint > 0) {
- origPts = malloc(npoint * sizeof(xPoint));
+ origPts = xallocarray(npoint, sizeof(xPoint));
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
FOR_NSCREENS_FORWARD(j) {
@@ -1406,7 +1406,7 @@ PanoramiXPolyLine(ClientPtr client)
isRoot = IS_ROOT_DRAWABLE(draw);
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
if (npoint > 0) {
- origPts = malloc(npoint * sizeof(xPoint));
+ origPts = xallocarray(npoint, sizeof(xPoint));
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
FOR_NSCREENS_FORWARD(j) {
@@ -1475,7 +1475,7 @@ PanoramiXPolySegment(ClientPtr client)
return BadLength;
nsegs >>= 3;
if (nsegs > 0) {
- origSegs = malloc(nsegs * sizeof(xSegment));
+ origSegs = xallocarray(nsegs, sizeof(xSegment));
memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment));
FOR_NSCREENS_FORWARD(j) {
@@ -1543,7 +1543,7 @@ PanoramiXPolyRectangle(ClientPtr client)
return BadLength;
nrects >>= 3;
if (nrects > 0) {
- origRecs = malloc(nrects * sizeof(xRectangle));
+ origRecs = xallocarray(nrects, sizeof(xRectangle));
memcpy((char *) origRecs, (char *) &stuff[1],
nrects * sizeof(xRectangle));
FOR_NSCREENS_FORWARD(j) {
@@ -1610,7 +1610,7 @@ PanoramiXPolyArc(ClientPtr client)
return BadLength;
narcs /= sizeof(xArc);
if (narcs > 0) {
- origArcs = malloc(narcs * sizeof(xArc));
+ origArcs = xallocarray(narcs, sizeof(xArc));
memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
FOR_NSCREENS_FORWARD(j) {
@@ -1672,7 +1672,7 @@ PanoramiXFillPoly(ClientPtr client)
count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
if (count > 0) {
- locPts = malloc(count * sizeof(DDXPointRec));
+ locPts = xallocarray(count, sizeof(DDXPointRec));
memcpy((char *) locPts, (char *) &stuff[1],
count * sizeof(DDXPointRec));
FOR_NSCREENS_FORWARD(j) {
@@ -1741,7 +1741,7 @@ PanoramiXPolyFillRectangle(ClientPtr client)
return BadLength;
things >>= 3;
if (things > 0) {
- origRects = malloc(things * sizeof(xRectangle));
+ origRects = xallocarray(things, sizeof(xRectangle));
memcpy((char *) origRects, (char *) &stuff[1],
things * sizeof(xRectangle));
FOR_NSCREENS_FORWARD(j) {
@@ -1808,7 +1808,7 @@ PanoramiXPolyFillArc(ClientPtr client)
return BadLength;
narcs /= sizeof(xArc);
if (narcs > 0) {
- origArcs = malloc(narcs * sizeof(xArc));
+ origArcs = xallocarray(narcs, sizeof(xArc));
memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
FOR_NSCREENS_FORWARD(j) {
@@ -1988,8 +1988,7 @@ PanoramiXGetImage(ClientPtr client)
if (linesPerBuf > h)
linesPerBuf = h;
}
- length = linesPerBuf * widthBytesLine;
- if (!(pBuf = malloc(length)))
+ if (!(pBuf = xallocarray(linesPerBuf, widthBytesLine)))
return BadAlloc;
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
diff --git a/xserver/Xext/saver.c b/xserver/Xext/saver.c
index 2c14ea00e..0e20467c9 100644
--- a/xserver/Xext/saver.c
+++ b/xserver/Xext/saver.c
@@ -853,7 +853,7 @@ ScreenSaverSetAttributes(ClientPtr client)
goto bail;
}
/* over allocate for override redirect */
- pAttr->values = values = malloc((len + 1) * sizeof(unsigned long));
+ pAttr->values = values = xallocarray(len + 1, sizeof(unsigned long));
if (!values) {
ret = BadAlloc;
goto bail;
diff --git a/xserver/Xext/security.c b/xserver/Xext/security.c
index cce7c467d..04382ff4d 100644
--- a/xserver/Xext/security.c
+++ b/xserver/Xext/security.c
@@ -212,7 +212,7 @@ SecurityDeleteAuthorization(void *value, XID id)
CloseDownClient(clients[i]);
}
- SecurityAudit("revoked authorization ID %d\n", pAuth->id);
+ SecurityAudit("revoked authorization ID %lu\n", (unsigned long)pAuth->id);
free(pAuth);
return Success;
@@ -549,9 +549,9 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
WriteToClient(client, authdata_len, pAuthdata);
SecurityAudit
- ("client %d generated authorization %d trust %d timeout %d group %d events %d\n",
- client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
- pAuth->group, eventMask);
+ ("client %d generated authorization %lu trust %d timeout %lu group %lu events %lu\n",
+ client->index, (unsigned long)pAuth->id, pAuth->trustLevel, (unsigned long)pAuth->timeout,
+ (unsigned long)pAuth->group, (unsigned long)eventMask);
/* the request succeeded; don't call RemoveAuthorization or free pAuth */
return Success;
@@ -776,9 +776,9 @@ SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata)
return;
}
- SecurityAudit("Security: denied client %d access %x to resource 0x%x "
+ SecurityAudit("Security: denied client %d access %lx to resource 0x%lx "
"of client %d on request %s\n", rec->client->index,
- requested, rec->id, cid,
+ (unsigned long)requested, (unsigned long)rec->id, cid,
SecurityLookupRequestName(rec->client));
rec->status = BadAccess; /* deny access */
}
@@ -858,9 +858,9 @@ SecurityProperty(CallbackListPtr *pcbl, void *unused, void *calldata)
if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
SecurityAudit("Security: denied client %d access to property %s "
- "(atom 0x%x) window 0x%x of client %d on request %s\n",
+ "(atom 0x%x) window 0x%lx of client %d on request %s\n",
rec->client->index, NameForAtom(name), name,
- rec->pWin->drawable.id, wClient(rec->pWin)->index,
+ (unsigned long)rec->pWin->drawable.id, wClient(rec->pWin)->index,
SecurityLookupRequestName(rec->client));
rec->status = BadAccess;
}
@@ -887,10 +887,10 @@ SecuritySend(CallbackListPtr *pcbl, void *unused, void *calldata)
rec->events[i].u.u.type != ClientMessage) {
SecurityAudit("Security: denied client %d from sending event "
- "of type %s to window 0x%x of client %d\n",
+ "of type %s to window 0x%lx of client %d\n",
rec->client->index,
LookupEventName(rec->events[i].u.u.type),
- rec->pWin->drawable.id,
+ (unsigned long)rec->pWin->drawable.id,
wClient(rec->pWin)->index);
rec->status = BadAccess;
return;
@@ -911,8 +911,8 @@ SecurityReceive(CallbackListPtr *pcbl, void *unused, void *calldata)
return;
SecurityAudit("Security: denied client %d from receiving an event "
- "sent to window 0x%x of client %d\n",
- rec->client->index, rec->pWin->drawable.id,
+ "sent to window 0x%lx of client %d\n",
+ rec->client->index, (unsigned long)rec->pWin->drawable.id,
wClient(rec->pWin)->index);
rec->status = BadAccess;
}
diff --git a/xserver/Xext/shape.c b/xserver/Xext/shape.c
index bb479b159..2fc789ec1 100644
--- a/xserver/Xext/shape.c
+++ b/xserver/Xext/shape.c
@@ -996,7 +996,7 @@ ProcShapeGetRectangles(ClientPtr client)
nrects = RegionNumRects(region);
box = RegionRects(region);
- rects = malloc(nrects * sizeof(xRectangle));
+ rects = xallocarray(nrects, sizeof(xRectangle));
if (!rects && nrects)
return BadAlloc;
for (i = 0; i < nrects; i++, box++) {
diff --git a/xserver/Xext/sync.c b/xserver/Xext/sync.c
index ba08cd1bb..41405619c 100644
--- a/xserver/Xext/sync.c
+++ b/xserver/Xext/sync.c
@@ -620,7 +620,7 @@ SyncAwaitTriggerFired(SyncTrigger * pTrigger)
pAwaitUnion = (SyncAwaitUnion *) pAwait->pHeader;
numwaits = pAwaitUnion->header.num_waitconditions;
- ppAwait = malloc(numwaits * sizeof(SyncAwait *));
+ ppAwait = xallocarray(numwaits, sizeof(SyncAwait *));
if (!ppAwait)
goto bail;
@@ -1514,7 +1514,7 @@ SyncAwaitPrologue(ClientPtr client, int items)
/* all the memory for the entire await list is allocated
* here in one chunk
*/
- pAwaitUnion = malloc((items + 1) * sizeof(SyncAwaitUnion));
+ pAwaitUnion = xallocarray(items + 1, sizeof(SyncAwaitUnion));
if (!pAwaitUnion)
return NULL;
diff --git a/xserver/hw/xfree86/common/xf86vmode.c b/xserver/Xext/vidmode.c
index 0ce58e365..499a2a841 100644
--- a/xserver/hw/xfree86/common/xf86vmode.c
+++ b/xserver/Xext/vidmode.c
@@ -1,4 +1,3 @@
-
/*
Copyright 1995 Kaleb S. KEITHLEY
@@ -30,32 +29,34 @@ from Kaleb S. KEITHLEY
*/
/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
#endif
+#ifdef XF86VIDMODE
+
#include <X11/X.h>
#include <X11/Xproto.h>
+#include <X11/extensions/xf86vmproto.h>
#include "misc.h"
#include "dixstruct.h"
#include "extnsionst.h"
-#include "xf86Extensions.h"
#include "scrnintstr.h"
#include "servermd.h"
-#include <X11/extensions/xf86vmproto.h>
#include "swaprep.h"
-#include "xf86.h"
-#include "vidmodeproc.h"
+#include "vidmodestr.h"
#include "globals.h"
#include "protocol-versions.h"
-#define DEFAULT_XF86VIDMODE_VERBOSITY 3
-
static int VidModeErrorBase;
-static DevPrivateKeyRec VidModeClientPrivateKeyRec;
+static int VidModeAllowNonLocal;
+static DevPrivateKeyRec VidModeClientPrivateKeyRec;
#define VidModeClientPrivateKey (&VidModeClientPrivateKeyRec)
+static DevPrivateKeyRec VidModePrivateKeyRec;
+#define VidModePrivateKey (&VidModePrivateKeyRec)
+
/* This holds the client's version information */
typedef struct {
int major;
@@ -67,222 +68,132 @@ typedef struct {
#define VM_SETPRIV(c,p) \
dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p)
-#if 0
-static unsigned char XF86VidModeReqCode = 0;
-#endif
-
-/* The XF86VIDMODE_EVENTS code is far from complete */
-
-#ifdef XF86VIDMODE_EVENTS
-static int XF86VidModeEventBase = 0;
-
-static void SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent * /* from */ , xXF86VidModeNotifyEvent * /* to */
- );
-
-static RESTYPE EventType; /* resource type for event masks */
-
-typedef struct _XF86VidModeEvent *XF86VidModeEventPtr;
-
-typedef struct _XF86VidModeEvent {
- XF86VidModeEventPtr next;
- ClientPtr client;
- ScreenPtr screen;
- XID resource;
- CARD32 mask;
-} XF86VidModeEventRec;
-
-static int XF86VidModeFreeEvents();
-
-typedef struct _XF86VidModeScreenPrivate {
- XF86VidModeEventPtr events;
- Bool hasWindow;
-} XF86VidModeScreenPrivateRec, *XF86VidModeScreenPrivatePtr;
-
-static DevPrivateKeyRec ScreenPrivateKeyRec;
-
-#define ScreenPrivateKey (&ScreenPrivateKeyRec)
-
-#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \
- dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey))
-#define SetScreenPrivate(s,v) \
- dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v)
-#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = GetScreenPrivate(s)
-
-#define New(t) (malloc(sizeof (t)))
-#endif
-
#ifdef DEBUG
-#define DEBUG_P(x) ErrorF(x"\n");
+#define DEBUG_P(x) DebugF(x"\n")
#else
#define DEBUG_P(x) /**/
#endif
- static int
-ClientMajorVersion(ClientPtr client)
-{
- VidModePrivPtr pPriv;
-
- pPriv = VM_GETPRIV(client);
- if (!pPriv)
- return 0;
- else
- return pPriv->major;
-}
-#ifdef XF86VIDMODE_EVENTS
-static void
-CheckScreenPrivate(pScreen)
-ScreenPtr
- pScreen;
+static DisplayModePtr
+VidModeCreateMode(void)
{
- SetupScreen(pScreen);
+ DisplayModePtr mode;
- if (!pPriv)
- return;
- if (!pPriv->events && !pPriv->hasWindow) {
- free(pPriv);
- SetScreenPrivate(pScreen, NULL);
+ mode = malloc(sizeof(DisplayModeRec));
+ if (mode != NULL) {
+ mode->name = "";
+ mode->VScan = 1; /* divides refresh rate. default = 1 */
+ mode->Private = NULL;
+ mode->next = mode;
+ mode->prev = mode;
}
+ return mode;
}
-static XF86VidModeScreenPrivatePtr
-MakeScreenPrivate(pScreen)
-ScreenPtr
- pScreen;
+static void
+VidModeCopyMode(DisplayModePtr modefrom, DisplayModePtr modeto)
{
- SetupScreen(pScreen);
-
- if (pPriv)
- return pPriv;
- pPriv = New(XF86VidModeScreenPrivateRec);
- if (!pPriv)
- return 0;
- pPriv->events = 0;
- pPriv->hasWindow = FALSE;
- SetScreenPrivate(pScreen, pPriv);
- return pPriv;
+ memcpy(modeto, modefrom, sizeof(DisplayModeRec));
}
-static unsigned long
-getEventMask(ScreenPtr pScreen, ClientPtr client)
+static int
+VidModeGetModeValue(DisplayModePtr mode, int valtyp)
{
- SetupScreen(pScreen);
- XF86VidModeEventPtr pEv;
+ int ret = 0;
- if (!pPriv)
- return 0;
- for (pEv = pPriv->events; pEv; pEv = pEv->next)
- if (pEv->client == client)
- return pEv->mask;
- return 0;
+ switch (valtyp) {
+ case VIDMODE_H_DISPLAY:
+ ret = mode->HDisplay;
+ break;
+ case VIDMODE_H_SYNCSTART:
+ ret = mode->HSyncStart;
+ break;
+ case VIDMODE_H_SYNCEND:
+ ret = mode->HSyncEnd;
+ break;
+ case VIDMODE_H_TOTAL:
+ ret = mode->HTotal;
+ break;
+ case VIDMODE_H_SKEW:
+ ret = mode->HSkew;
+ break;
+ case VIDMODE_V_DISPLAY:
+ ret = mode->VDisplay;
+ break;
+ case VIDMODE_V_SYNCSTART:
+ ret = mode->VSyncStart;
+ break;
+ case VIDMODE_V_SYNCEND:
+ ret = mode->VSyncEnd;
+ break;
+ case VIDMODE_V_TOTAL:
+ ret = mode->VTotal;
+ break;
+ case VIDMODE_FLAGS:
+ ret = mode->Flags;
+ break;
+ case VIDMODE_CLOCK:
+ ret = mode->Clock;
+ break;
+ }
+ return ret;
}
-static Bool
-setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask)
+static void
+VidModeSetModeValue(DisplayModePtr mode, int valtyp, int val)
{
- SetupScreen(pScreen);
- XF86VidModeEventPtr pEv, *pPrev;
-
- if (getEventMask(pScreen, client) == mask)
- return TRUE;
- if (!pPriv) {
- pPriv = MakeScreenPrivate(pScreen);
- if (!pPriv)
- return FALSE;
- }
- for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next)
- if (pEv->client == client)
- break;
- if (mask == 0) {
- *pPrev = pEv->next;
- free(pEv);
- CheckScreenPrivate(pScreen);
- }
- else {
- if (!pEv) {
- pEv = New(ScreenSaverEventRec);
- if (!pEv) {
- CheckScreenPrivate(pScreen);
- return FALSE;
- }
- *pPrev = pEv;
- pEv->next = NULL;
- pEv->client = client;
- pEv->screen = pScreen;
- pEv->resource = FakeClientID(client->index);
- }
- pEv->mask = mask;
+ switch (valtyp) {
+ case VIDMODE_H_DISPLAY:
+ mode->HDisplay = val;
+ break;
+ case VIDMODE_H_SYNCSTART:
+ mode->HSyncStart = val;
+ break;
+ case VIDMODE_H_SYNCEND:
+ mode->HSyncEnd = val;
+ break;
+ case VIDMODE_H_TOTAL:
+ mode->HTotal = val;
+ break;
+ case VIDMODE_H_SKEW:
+ mode->HSkew = val;
+ break;
+ case VIDMODE_V_DISPLAY:
+ mode->VDisplay = val;
+ break;
+ case VIDMODE_V_SYNCSTART:
+ mode->VSyncStart = val;
+ break;
+ case VIDMODE_V_SYNCEND:
+ mode->VSyncEnd = val;
+ break;
+ case VIDMODE_V_TOTAL:
+ mode->VTotal = val;
+ break;
+ case VIDMODE_FLAGS:
+ mode->Flags = val;
+ break;
+ case VIDMODE_CLOCK:
+ mode->Clock = val;
+ break;
}
- return TRUE;
+ return;
}
static int
-XF86VidModeFreeEvents(void *value, XID id)
+ClientMajorVersion(ClientPtr client)
{
- XF86VidModeEventPtr pOld = (XF86VidModeEventPtr) value;
- ScreenPtr pScreen = pOld->screen;
-
- SetupScreen(pScreen);
- XF86VidModeEventPtr pEv, *pPrev;
-
- if (!pPriv)
- return TRUE;
- for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next)
- if (pEv == pOld)
- break;
- if (!pEv)
- return TRUE;
- *pPrev = pEv->next;
- free(pEv);
- CheckScreenPrivate(pScreen);
- return TRUE;
-}
+ VidModePrivPtr pPriv;
-static void
-SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
-{
- XF86VidModeScreenPrivatePtr pPriv;
- unsigned long mask;
- xXF86VidModeNotifyEvent ev;
- int kind;
-
- UpdateCurrentTimeIf();
- mask = XF86VidModeNotifyMask;
- pScreen = screenInfo.screens[pScreen->myNum];
- pPriv = GetScreenPrivate(pScreen);
+ pPriv = VM_GETPRIV(client);
if (!pPriv)
- return;
- kind = XF86VidModeModeChange;
- for (pEv = pPriv->events; pEv; pEv = pEv->next) {
- if (pEv->mask & mask) {
- XF86VidModeEventPtr pEv = {
- .type = XF86VidModeNotify + XF86VidModeEventBase,
- .state = state,
- .timestamp = currentTime.milliseconds,
- .root = pScreen->root->drawable.id,
- .kind = kind,
- .forced = forced
- };
- WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
- }
- }
-}
-
-static void
-SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent * from,
- xXF86VidModeNotifyEvent * to)
-{
- to->type = from->type;
- to->state = from->state;
- cpswaps(from->sequenceNumber, to->sequenceNumber);
- cpswapl(from->timestamp, to->timestamp);
- cpswapl(from->root, to->root);
- to->kind = from->kind;
- to->forced = from->forced;
+ return 0;
+ else
+ return pPriv->major;
}
-#endif
static int
-ProcXF86VidModeQueryVersion(ClientPtr client)
+ProcVidModeQueryVersion(ClientPtr client)
{
xXF86VidModeQueryVersionReply rep = {
.type = X_Reply,
@@ -307,14 +218,16 @@ ProcXF86VidModeQueryVersion(ClientPtr client)
}
static int
-ProcXF86VidModeGetModeLine(ClientPtr client)
+ProcVidModeGetModeLine(ClientPtr client)
{
REQUEST(xXF86VidModeGetModeLineReq);
xXF86VidModeGetModeLineReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence
};
- void *mode;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
+ DisplayModePtr mode;
int dotClock;
int ver;
@@ -334,8 +247,12 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
+ if (!pVidMode->GetCurrentModeline(pScreen, &mode, &dotClock))
return BadValue;
rep.dotclock = dotClock;
@@ -350,15 +267,13 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
rep.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL);
rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("GetModeLine - scrn: %d clock: %ld\n",
- stuff->screen, (unsigned long) rep.dotclock);
- ErrorF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
- rep.hdisplay, rep.hsyncstart, rep.hsyncend, rep.htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- rep.vdisplay, rep.vsyncstart, rep.vsyncend,
- rep.vtotal, (unsigned long) rep.flags);
- }
+ DebugF("GetModeLine - scrn: %d clock: %ld\n",
+ stuff->screen, (unsigned long) rep.dotclock);
+ DebugF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ rep.hdisplay, rep.hsyncstart, rep.hsyncend, rep.htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ rep.vdisplay, rep.vsyncstart, rep.vsyncend,
+ rep.vtotal, (unsigned long) rep.flags);
/*
* Older servers sometimes had server privates that the VidMode
@@ -409,11 +324,13 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
}
static int
-ProcXF86VidModeGetAllModeLines(ClientPtr client)
+ProcVidModeGetAllModeLines(ClientPtr client)
{
REQUEST(xXF86VidModeGetAllModeLinesReq);
xXF86VidModeGetAllModeLinesReply rep;
- void *mode;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
+ DisplayModePtr mode;
int modecount, dotClock;
int ver;
@@ -423,14 +340,17 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
-
+ pScreen = screenInfo.screens[stuff->screen];
ver = ClientMajorVersion(client);
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
- modecount = VidModeGetNumOfModes(stuff->screen);
+ modecount = pVidMode->GetNumOfModes(pScreen);
if (modecount < 1)
return VidModeErrorBase + XF86VidModeExtensionDisabled;
- if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
+ if (!pVidMode->GetFirstModeline(pScreen, &mode, &dotClock))
return BadValue;
rep = (xXF86VidModeGetAllModeLinesReply) {
@@ -501,7 +421,7 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
WriteToClient(client, sizeof(xXF86VidModeModeInfo), &mdinf);
}
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
+ } while (pVidMode->GetNextModeline(pScreen, &mode, &dotClock));
return Success;
}
@@ -518,13 +438,15 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
&& VidModeGetModeValue(mode, VIDMODE_FLAGS) == stuff->flags )
static int
-ProcXF86VidModeAddModeLine(ClientPtr client)
+ProcVidModeAddModeLine(ClientPtr client)
{
REQUEST(xXF86VidModeAddModeLineReq);
xXF86OldVidModeAddModeLineReq *oldstuff =
(xXF86OldVidModeAddModeLineReq *) client->requestBuffer;
xXF86VidModeAddModeLineReq newstuff;
- void *mode;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
+ DisplayModePtr mode;
int len;
int dotClock;
int ver;
@@ -561,25 +483,23 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
stuff->after_vtotal = oldstuff->after_vtotal;
stuff->after_flags = oldstuff->after_flags;
}
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("AddModeLine - scrn: %d clock: %ld\n",
- (int) stuff->screen, (unsigned long) stuff->dotclock);
- ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long) stuff->flags);
- ErrorF(" after - scrn: %d clock: %ld\n",
- (int) stuff->screen, (unsigned long) stuff->after_dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->after_hdisplay, stuff->after_hsyncstart,
- stuff->after_hsyncend, stuff->after_htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->after_vdisplay, stuff->after_vsyncstart,
- stuff->after_vsyncend, stuff->after_vtotal,
- (unsigned long) stuff->after_flags);
- }
+ DebugF("AddModeLine - scrn: %d clock: %ld\n",
+ (int) stuff->screen, (unsigned long) stuff->dotclock);
+ DebugF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
+ stuff->vtotal, (unsigned long) stuff->flags);
+ DebugF(" after - scrn: %d clock: %ld\n",
+ (int) stuff->screen, (unsigned long) stuff->after_dotclock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->after_hdisplay, stuff->after_hsyncstart,
+ stuff->after_hsyncend, stuff->after_htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->after_vdisplay, stuff->after_vsyncstart,
+ stuff->after_vsyncend, stuff->after_vtotal,
+ (unsigned long) stuff->after_flags);
if (ver < 2) {
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
@@ -598,6 +518,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
if (stuff->hsyncstart < stuff->hdisplay ||
stuff->hsyncend < stuff->hsyncstart ||
@@ -614,17 +535,21 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
stuff->after_vtotal < stuff->after_vsyncend)
return BadValue;
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
+
if (stuff->after_htotal != 0 || stuff->after_vtotal != 0) {
Bool found = FALSE;
- if (VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) {
+ if (pVidMode->GetFirstModeline(pScreen, &mode, &dotClock)) {
do {
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock)
+ if ((pVidMode->GetDotClock(pScreen, stuff->dotclock)
== dotClock) && MODEMATCH(mode, stuff)) {
found = TRUE;
break;
}
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
+ } while (pVidMode->GetNextModeline(pScreen, &mode, &dotClock));
}
if (!found)
return BadValue;
@@ -647,10 +572,10 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags);
if (stuff->privsize)
- ErrorF("AddModeLine - Privates in request have been ignored\n");
+ DebugF("AddModeLine - Privates in request have been ignored\n");
/* Check that the mode is consistent with the monitor specs */
- switch (VidModeCheckModeForMonitor(stuff->screen, mode)) {
+ switch (pVidMode->CheckModeForMonitor(pScreen, mode)) {
case MODE_OK:
break;
case MODE_HSYNC:
@@ -667,28 +592,30 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
}
/* Check that the driver is happy with the mode */
- if (VidModeCheckModeForDriver(stuff->screen, mode) != MODE_OK) {
+ if (pVidMode->CheckModeForDriver(pScreen, mode) != MODE_OK) {
free(mode);
return VidModeErrorBase + XF86VidModeModeUnsuitable;
}
- VidModeSetCrtcForMode(stuff->screen, mode);
+ pVidMode->SetCrtcForMode(pScreen, mode);
+
+ pVidMode->AddModeline(pScreen, mode);
- VidModeAddModeline(stuff->screen, mode);
+ DebugF("AddModeLine - Succeeded\n");
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
- ErrorF("AddModeLine - Succeeded\n");
return Success;
}
static int
-ProcXF86VidModeDeleteModeLine(ClientPtr client)
+ProcVidModeDeleteModeLine(ClientPtr client)
{
REQUEST(xXF86VidModeDeleteModeLineReq);
xXF86OldVidModeDeleteModeLineReq *oldstuff =
(xXF86OldVidModeDeleteModeLineReq *) client->requestBuffer;
xXF86VidModeDeleteModeLineReq newstuff;
- void *mode;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
+ DisplayModePtr mode;
int len, dotClock;
int ver;
@@ -713,17 +640,14 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
stuff->flags = oldstuff->flags;
stuff->privsize = oldstuff->privsize;
}
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("DeleteModeLine - scrn: %d clock: %ld\n",
- (int) stuff->screen, (unsigned long) stuff->dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF
- (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
- (unsigned long) stuff->flags);
- }
+ DebugF("DeleteModeLine - scrn: %d clock: %ld\n",
+ (int) stuff->screen, (unsigned long) stuff->dotclock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
+ (unsigned long) stuff->flags);
if (ver < 2) {
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
@@ -738,82 +662,82 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
bytes_to_int32(sizeof(xXF86VidModeDeleteModeLineReq));
}
if (len != stuff->privsize) {
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, "
- "len = %d, length = %d\n",
- (unsigned long) client->req_len,
- (int) sizeof(xXF86VidModeDeleteModeLineReq) >> 2,
- (unsigned long) stuff->privsize, len, stuff->length);
- }
+ DebugF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, "
+ "len = %d, length = %d\n",
+ (unsigned long) client->req_len,
+ (int) sizeof(xXF86VidModeDeleteModeLineReq) >> 2,
+ (unsigned long) stuff->privsize, len, stuff->length);
return BadLength;
}
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
+
+ if (!pVidMode->GetCurrentModeline(pScreen, &mode, &dotClock))
return BadValue;
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("Checking against clock: %d (%d)\n",
- VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- ErrorF
- (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
- VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
- VidModeGetModeValue(mode, VIDMODE_FLAGS));
- }
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
+ DebugF("Checking against clock: %d (%d)\n",
+ VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
+ VidModeGetModeValue(mode, VIDMODE_FLAGS));
+
+ if ((pVidMode->GetDotClock(pScreen, stuff->dotclock) == dotClock) &&
MODEMATCH(mode, stuff))
return BadValue;
- if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
+ if (!pVidMode->GetFirstModeline(pScreen, &mode, &dotClock))
return BadValue;
do {
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("Checking against clock: %d (%d)\n",
- VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- ErrorF
- (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
- VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
- VidModeGetModeValue(mode, VIDMODE_FLAGS));
- }
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
+ DebugF("Checking against clock: %d (%d)\n",
+ VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
+ VidModeGetModeValue(mode, VIDMODE_FLAGS));
+
+ if ((pVidMode->GetDotClock(pScreen, stuff->dotclock) == dotClock) &&
MODEMATCH(mode, stuff)) {
- VidModeDeleteModeline(stuff->screen, mode);
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
- ErrorF("DeleteModeLine - Succeeded\n");
+ pVidMode->DeleteModeline(pScreen, mode);
+ DebugF("DeleteModeLine - Succeeded\n");
return Success;
}
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
+ } while (pVidMode->GetNextModeline(pScreen, &mode, &dotClock));
return BadValue;
}
static int
-ProcXF86VidModeModModeLine(ClientPtr client)
+ProcVidModeModModeLine(ClientPtr client)
{
REQUEST(xXF86VidModeModModeLineReq);
xXF86OldVidModeModModeLineReq *oldstuff =
(xXF86OldVidModeModModeLineReq *) client->requestBuffer;
xXF86VidModeModModeLineReq newstuff;
- void *mode, *modetmp;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
+ DisplayModePtr mode, modetmp;
int len, dotClock;
int ver;
@@ -837,14 +761,12 @@ ProcXF86VidModeModModeLine(ClientPtr client)
stuff->flags = oldstuff->flags;
stuff->privsize = oldstuff->privsize;
}
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
- (int) stuff->screen, stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long) stuff->flags);
- }
+ DebugF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ (int) stuff->screen, stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
+ stuff->vtotal, (unsigned long) stuff->flags);
if (ver < 2) {
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
@@ -870,8 +792,13 @@ ProcXF86VidModeModModeLine(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
+
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
+ if (!pVidMode->GetCurrentModeline(pScreen, &mode, &dotClock))
return BadValue;
modetmp = VidModeCreateMode();
@@ -889,10 +816,10 @@ ProcXF86VidModeModModeLine(ClientPtr client)
VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags);
if (stuff->privsize)
- ErrorF("ModModeLine - Privates in request have been ignored\n");
+ DebugF("ModModeLine - Privates in request have been ignored\n");
/* Check that the mode is consistent with the monitor specs */
- switch (VidModeCheckModeForMonitor(stuff->screen, modetmp)) {
+ switch (pVidMode->CheckModeForMonitor(pScreen, modetmp)) {
case MODE_OK:
break;
case MODE_HSYNC:
@@ -909,7 +836,7 @@ ProcXF86VidModeModModeLine(ClientPtr client)
}
/* Check that the driver is happy with the mode */
- if (VidModeCheckModeForDriver(stuff->screen, modetmp) != MODE_OK) {
+ if (pVidMode->CheckModeForDriver(pScreen, modetmp) != MODE_OK) {
free(modetmp);
return VidModeErrorBase + XF86VidModeModeUnsuitable;
}
@@ -926,23 +853,24 @@ ProcXF86VidModeModModeLine(ClientPtr client)
VidModeSetModeValue(mode, VIDMODE_V_TOTAL, stuff->vtotal);
VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags);
- VidModeSetCrtcForMode(stuff->screen, mode);
- VidModeSwitchMode(stuff->screen, mode);
+ pVidMode->SetCrtcForMode(pScreen, mode);
+ pVidMode->SwitchMode(pScreen, mode);
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
- ErrorF("ModModeLine - Succeeded\n");
+ DebugF("ModModeLine - Succeeded\n");
return Success;
}
static int
-ProcXF86VidModeValidateModeLine(ClientPtr client)
+ProcVidModeValidateModeLine(ClientPtr client)
{
REQUEST(xXF86VidModeValidateModeLineReq);
xXF86OldVidModeValidateModeLineReq *oldstuff =
(xXF86OldVidModeValidateModeLineReq *) client->requestBuffer;
xXF86VidModeValidateModeLineReq newstuff;
xXF86VidModeValidateModeLineReply rep;
- void *mode, *modetmp = NULL;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
+ DisplayModePtr mode, modetmp = NULL;
int len, status, dotClock;
int ver;
@@ -967,17 +895,15 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
stuff->flags = oldstuff->flags;
stuff->privsize = oldstuff->privsize;
}
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("ValidateModeLine - scrn: %d clock: %ld\n",
- (int) stuff->screen, (unsigned long) stuff->dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF
- (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
- (unsigned long) stuff->flags);
- }
+
+ DebugF("ValidateModeLine - scrn: %d clock: %ld\n",
+ (int) stuff->screen, (unsigned long) stuff->dotclock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
+ (unsigned long) stuff->flags);
if (ver < 2) {
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
@@ -995,6 +921,7 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
status = MODE_OK;
@@ -1008,7 +935,11 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
goto status_reply;
}
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
+
+ if (!pVidMode->GetCurrentModeline(pScreen, &mode, &dotClock))
return BadValue;
modetmp = VidModeCreateMode();
@@ -1025,15 +956,15 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
VidModeSetModeValue(modetmp, VIDMODE_V_TOTAL, stuff->vtotal);
VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags);
if (stuff->privsize)
- ErrorF("ValidateModeLine - Privates in request have been ignored\n");
+ DebugF("ValidateModeLine - Privates in request have been ignored\n");
/* Check that the mode is consistent with the monitor specs */
if ((status =
- VidModeCheckModeForMonitor(stuff->screen, modetmp)) != MODE_OK)
+ pVidMode->CheckModeForMonitor(pScreen, modetmp)) != MODE_OK)
goto status_reply;
/* Check that the driver is happy with the mode */
- status = VidModeCheckModeForDriver(stuff->screen, modetmp);
+ status = pVidMode->CheckModeForDriver(pScreen, modetmp);
status_reply:
free(modetmp);
@@ -1051,15 +982,17 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
swapl(&rep.status);
}
WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), &rep);
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
- ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status);
+ DebugF("ValidateModeLine - Succeeded (status = %d)\n", status);
+
return Success;
}
static int
-ProcXF86VidModeSwitchMode(ClientPtr client)
+ProcVidModeSwitchMode(ClientPtr client)
{
REQUEST(xXF86VidModeSwitchModeReq);
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
DEBUG_P("XF86VidModeSwitchMode");
@@ -1067,20 +1000,27 @@ ProcXF86VidModeSwitchMode(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
- VidModeZoomViewport(stuff->screen, (short) stuff->zoom);
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
+
+ pVidMode->ZoomViewport(pScreen, (short) stuff->zoom);
return Success;
}
static int
-ProcXF86VidModeSwitchToMode(ClientPtr client)
+ProcVidModeSwitchToMode(ClientPtr client)
{
REQUEST(xXF86VidModeSwitchToModeReq);
xXF86OldVidModeSwitchToModeReq *oldstuff =
(xXF86OldVidModeSwitchToModeReq *) client->requestBuffer;
xXF86VidModeSwitchToModeReq newstuff;
- void *mode;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
+ DisplayModePtr mode;
int len, dotClock;
int ver;
@@ -1105,17 +1045,15 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
stuff->flags = oldstuff->flags;
stuff->privsize = oldstuff->privsize;
}
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("SwitchToMode - scrn: %d clock: %ld\n",
- (int) stuff->screen, (unsigned long) stuff->dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF
- (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
- (unsigned long) stuff->flags);
- }
+
+ DebugF("SwitchToMode - scrn: %d clock: %ld\n",
+ (int) stuff->screen, (unsigned long) stuff->dotclock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
+ (unsigned long) stuff->flags);
if (ver < 2) {
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeSwitchToModeReq);
@@ -1134,53 +1072,57 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
+
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
+ if (!pVidMode->GetCurrentModeline(pScreen, &mode, &dotClock))
return BadValue;
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock)
+ if ((pVidMode->GetDotClock(pScreen, stuff->dotclock) == dotClock)
&& MODEMATCH(mode, stuff))
return Success;
- if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
+ if (!pVidMode->GetFirstModeline(pScreen, &mode, &dotClock))
return BadValue;
do {
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("Checking against clock: %d (%d)\n",
- VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- ErrorF
- (" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
- VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
- VidModeGetModeValue(mode, VIDMODE_FLAGS));
- }
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
+ DebugF("Checking against clock: %d (%d)\n",
+ VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
+ VidModeGetModeValue(mode, VIDMODE_FLAGS));
+
+ if ((pVidMode->GetDotClock(pScreen, stuff->dotclock) == dotClock) &&
MODEMATCH(mode, stuff)) {
- if (!VidModeSwitchMode(stuff->screen, mode))
+ if (!pVidMode->SwitchMode(pScreen, mode))
return BadValue;
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
- ErrorF("SwitchToMode - Succeeded\n");
+ DebugF("SwitchToMode - Succeeded\n");
return Success;
}
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
+ } while (pVidMode->GetNextModeline(pScreen, &mode, &dotClock));
return BadValue;
}
static int
-ProcXF86VidModeLockModeSwitch(ClientPtr client)
+ProcVidModeLockModeSwitch(ClientPtr client)
{
REQUEST(xXF86VidModeLockModeSwitchReq);
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
@@ -1188,15 +1130,20 @@ ProcXF86VidModeLockModeSwitch(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
+
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
- if (!VidModeLockZoom(stuff->screen, (short) stuff->lock))
+ if (!pVidMode->LockZoom(pScreen, (short) stuff->lock))
return VidModeErrorBase + XF86VidModeZoomLocked;
return Success;
}
static int
-ProcXF86VidModeGetMonitor(ClientPtr client)
+ProcVidModeGetMonitor(ClientPtr client)
{
REQUEST(xXF86VidModeGetMonitorReq);
xXF86VidModeGetMonitorReply rep = {
@@ -1204,8 +1151,9 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
.sequenceNumber = client->sequence
};
CARD32 *hsyncdata, *vsyncdata;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
int i, nHsync, nVrefresh;
- void *monitor;
DEBUG_P("XF86VidModeGetMonitor");
@@ -1213,23 +1161,25 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
- if (!VidModeGetMonitor(stuff->screen, &monitor))
- return BadValue;
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
- nHsync = VidModeGetMonitorValue(monitor, VIDMODE_MON_NHSYNC, 0).i;
- nVrefresh = VidModeGetMonitorValue(monitor, VIDMODE_MON_NVREFRESH, 0).i;
+ nHsync = pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_NHSYNC, 0).i;
+ nVrefresh = pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_NVREFRESH, 0).i;
- if ((char *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr)
- rep.vendorLength = strlen((char *) (VidModeGetMonitorValue(monitor,
- VIDMODE_MON_VENDOR,
- 0)).ptr);
+ if ((char *) (pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0)).ptr)
+ rep.vendorLength = strlen((char *) (pVidMode->GetMonitorValue(pScreen,
+ VIDMODE_MON_VENDOR,
+ 0)).ptr);
else
rep.vendorLength = 0;
- if ((char *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr)
- rep.modelLength = strlen((char *) (VidModeGetMonitorValue(monitor,
- VIDMODE_MON_MODEL,
- 0)).ptr);
+ if ((char *) (pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0)).ptr)
+ rep.modelLength = strlen((char *) (pVidMode->GetMonitorValue(pScreen,
+ VIDMODE_MON_MODEL,
+ 0)).ptr);
else
rep.modelLength = 0;
rep.length =
@@ -1240,11 +1190,11 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
pad_to_int32(rep.modelLength));
rep.nhsync = nHsync;
rep.nvsync = nVrefresh;
- hsyncdata = malloc(nHsync * sizeof(CARD32));
+ hsyncdata = xallocarray(nHsync, sizeof(CARD32));
if (!hsyncdata) {
return BadAlloc;
}
- vsyncdata = malloc(nVrefresh * sizeof(CARD32));
+ vsyncdata = xallocarray(nVrefresh, sizeof(CARD32));
if (!vsyncdata) {
free(hsyncdata);
@@ -1252,20 +1202,20 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
}
for (i = 0; i < nHsync; i++) {
- hsyncdata[i] = (unsigned short) (VidModeGetMonitorValue(monitor,
- VIDMODE_MON_HSYNC_LO,
- i)).f |
+ hsyncdata[i] = (unsigned short) (pVidMode->GetMonitorValue(pScreen,
+ VIDMODE_MON_HSYNC_LO,
+ i)).f |
(unsigned
- short) (VidModeGetMonitorValue(monitor, VIDMODE_MON_HSYNC_HI,
- i)).f << 16;
+ short) (pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_HSYNC_HI,
+ i)).f << 16;
}
for (i = 0; i < nVrefresh; i++) {
- vsyncdata[i] = (unsigned short) (VidModeGetMonitorValue(monitor,
- VIDMODE_MON_VREFRESH_LO,
- i)).f |
+ vsyncdata[i] = (unsigned short) (pVidMode->GetMonitorValue(pScreen,
+ VIDMODE_MON_VREFRESH_LO,
+ i)).f |
(unsigned
- short) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VREFRESH_HI,
- i)).f << 16;
+ short) (pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VREFRESH_HI,
+ i)).f << 16;
}
if (client->swapped) {
@@ -1278,10 +1228,10 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
WriteSwappedDataToClient(client, nVrefresh * sizeof(CARD32), vsyncdata);
if (rep.vendorLength)
WriteToClient(client, rep.vendorLength,
- (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr);
+ (pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0)).ptr);
if (rep.modelLength)
WriteToClient(client, rep.modelLength,
- (VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr);
+ (pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0)).ptr);
free(hsyncdata);
free(vsyncdata);
@@ -1290,10 +1240,12 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
}
static int
-ProcXF86VidModeGetViewPort(ClientPtr client)
+ProcVidModeGetViewPort(ClientPtr client)
{
REQUEST(xXF86VidModeGetViewPortReq);
xXF86VidModeGetViewPortReply rep;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
int x, y;
DEBUG_P("XF86VidModeGetViewPort");
@@ -1302,8 +1254,13 @@ ProcXF86VidModeGetViewPort(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
+
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
- VidModeGetViewPort(stuff->screen, &x, &y);
+ pVidMode->GetViewPort(pScreen, &x, &y);
rep = (xXF86VidModeGetViewPortReply) {
.type = X_Reply,
@@ -1324,9 +1281,11 @@ ProcXF86VidModeGetViewPort(ClientPtr client)
}
static int
-ProcXF86VidModeSetViewPort(ClientPtr client)
+ProcVidModeSetViewPort(ClientPtr client)
{
REQUEST(xXF86VidModeSetViewPortReq);
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
DEBUG_P("XF86VidModeSetViewPort");
@@ -1334,18 +1293,25 @@ ProcXF86VidModeSetViewPort(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
+
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
- if (!VidModeSetViewPort(stuff->screen, stuff->x, stuff->y))
+ if (!pVidMode->SetViewPort(pScreen, stuff->x, stuff->y))
return BadValue;
return Success;
}
static int
-ProcXF86VidModeGetDotClocks(ClientPtr client)
+ProcVidModeGetDotClocks(ClientPtr client)
{
REQUEST(xXF86VidModeGetDotClocksReq);
xXF86VidModeGetDotClocksReply rep;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
int n;
int numClocks;
CARD32 dotclock;
@@ -1358,8 +1324,13 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
- numClocks = VidModeGetNumOfClocks(stuff->screen, &ClockProg);
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
+
+ numClocks = pVidMode->GetNumOfClocks(pScreen, &ClockProg);
rep = (xXF86VidModeGetDotClocksReply) {
.type = X_Reply,
@@ -1375,7 +1346,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
Clocks = calloc(numClocks, sizeof(int));
if (!Clocks)
return BadValue;
- if (!VidModeGetClocks(stuff->screen, Clocks)) {
+ if (!pVidMode->GetClocks(pScreen, Clocks)) {
free(Clocks);
return BadValue;
}
@@ -1408,9 +1379,11 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
}
static int
-ProcXF86VidModeSetGamma(ClientPtr client)
+ProcVidModeSetGamma(ClientPtr client)
{
REQUEST(xXF86VidModeSetGammaReq);
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
DEBUG_P("XF86VidModeSetGamma");
@@ -1418,8 +1391,13 @@ ProcXF86VidModeSetGamma(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
+
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
- if (!VidModeSetGamma(stuff->screen, ((float) stuff->red) / 10000.,
+ if (!pVidMode->SetGamma(pScreen, ((float) stuff->red) / 10000.,
((float) stuff->green) / 10000.,
((float) stuff->blue) / 10000.))
return BadValue;
@@ -1428,10 +1406,12 @@ ProcXF86VidModeSetGamma(ClientPtr client)
}
static int
-ProcXF86VidModeGetGamma(ClientPtr client)
+ProcVidModeGetGamma(ClientPtr client)
{
REQUEST(xXF86VidModeGetGammaReq);
xXF86VidModeGetGammaReply rep;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
float red, green, blue;
DEBUG_P("XF86VidModeGetGamma");
@@ -1440,8 +1420,13 @@ ProcXF86VidModeGetGamma(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
+
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
- if (!VidModeGetGamma(stuff->screen, &red, &green, &blue))
+ if (!pVidMode->GetGamma(pScreen, &red, &green, &blue))
return BadValue;
rep = (xXF86VidModeGetGammaReply) {
.type = X_Reply,
@@ -1464,17 +1449,24 @@ ProcXF86VidModeGetGamma(ClientPtr client)
}
static int
-ProcXF86VidModeSetGammaRamp(ClientPtr client)
+ProcVidModeSetGammaRamp(ClientPtr client)
{
CARD16 *r, *g, *b;
int length;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
REQUEST(xXF86VidModeSetGammaRampReq);
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
- if (stuff->size != VidModeGetGammaRampSize(stuff->screen))
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
+
+ if (stuff->size != pVidMode->GetGammaRampSize(pScreen))
return BadValue;
length = (stuff->size + 1) & ~1;
@@ -1485,19 +1477,21 @@ ProcXF86VidModeSetGammaRamp(ClientPtr client)
g = r + length;
b = g + length;
- if (!VidModeSetGammaRamp(stuff->screen, stuff->size, r, g, b))
+ if (!pVidMode->SetGammaRamp(pScreen, stuff->size, r, g, b))
return BadValue;
return Success;
}
static int
-ProcXF86VidModeGetGammaRamp(ClientPtr client)
+ProcVidModeGetGammaRamp(ClientPtr client)
{
CARD16 *ramp = NULL;
int length;
size_t ramplen = 0;
xXF86VidModeGetGammaRampReply rep;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
REQUEST(xXF86VidModeGetGammaRampReq);
@@ -1505,18 +1499,23 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
+
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
- if (stuff->size != VidModeGetGammaRampSize(stuff->screen))
+ if (stuff->size != pVidMode->GetGammaRampSize(pScreen))
return BadValue;
length = (stuff->size + 1) & ~1;
if (stuff->size) {
- ramplen = length * 3 * sizeof(CARD16);
- if (!(ramp = malloc(ramplen)))
+ if (!(ramp = xallocarray(length, 3 * sizeof(CARD16))))
return BadAlloc;
+ ramplen = length * 3 * sizeof(CARD16);
- if (!VidModeGetGammaRamp(stuff->screen, stuff->size,
+ if (!pVidMode->GetGammaRamp(pScreen, stuff->size,
ramp, ramp + length, ramp + (length * 2))) {
free(ramp);
return BadValue;
@@ -1544,10 +1543,13 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client)
return Success;
}
+
static int
-ProcXF86VidModeGetGammaRampSize(ClientPtr client)
+ProcVidModeGetGammaRampSize(ClientPtr client)
{
xXF86VidModeGetGammaRampSizeReply rep;
+ ScreenPtr pScreen;
+ VidModePtr pVidMode;
REQUEST(xXF86VidModeGetGammaRampSizeReq);
@@ -1555,12 +1557,17 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
+ pScreen = screenInfo.screens[stuff->screen];
+
+ pVidMode = VidModeGetPtr(pScreen);
+ if (pVidMode == NULL)
+ return BadImplementation;
rep = (xXF86VidModeGetGammaRampSizeReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
- .size = VidModeGetGammaRampSize(stuff->screen)
+ .size = pVidMode->GetGammaRampSize(pScreen)
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
@@ -1573,7 +1580,7 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client)
}
static int
-ProcXF86VidModeGetPermissions(ClientPtr client)
+ProcVidModeGetPermissions(ClientPtr client)
{
xXF86VidModeGetPermissionsReply rep = {
.type = X_Reply,
@@ -1589,8 +1596,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
- if (xf86GetVidModeEnabled() &&
- (xf86GetVidModeAllowNonLocal() || client->local)) {
+ if (VidModeAllowNonLocal || client->local) {
rep.permissions |= XF86VM_WRITE_PERMISSION;
}
if (client->swapped) {
@@ -1604,7 +1610,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
}
static int
-ProcXF86VidModeSetClientVersion(ClientPtr client)
+ProcVidModeSetClientVersion(ClientPtr client)
{
REQUEST(xXF86VidModeSetClientVersionReq);
@@ -1628,57 +1634,55 @@ ProcXF86VidModeSetClientVersion(ClientPtr client)
}
static int
-ProcXF86VidModeDispatch(ClientPtr client)
+ProcVidModeDispatch(ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
case X_XF86VidModeQueryVersion:
- return ProcXF86VidModeQueryVersion(client);
+ return ProcVidModeQueryVersion(client);
case X_XF86VidModeGetModeLine:
- return ProcXF86VidModeGetModeLine(client);
+ return ProcVidModeGetModeLine(client);
case X_XF86VidModeGetMonitor:
- return ProcXF86VidModeGetMonitor(client);
+ return ProcVidModeGetMonitor(client);
case X_XF86VidModeGetAllModeLines:
- return ProcXF86VidModeGetAllModeLines(client);
+ return ProcVidModeGetAllModeLines(client);
case X_XF86VidModeValidateModeLine:
- return ProcXF86VidModeValidateModeLine(client);
+ return ProcVidModeValidateModeLine(client);
case X_XF86VidModeGetViewPort:
- return ProcXF86VidModeGetViewPort(client);
+ return ProcVidModeGetViewPort(client);
case X_XF86VidModeGetDotClocks:
- return ProcXF86VidModeGetDotClocks(client);
+ return ProcVidModeGetDotClocks(client);
case X_XF86VidModeSetClientVersion:
- return ProcXF86VidModeSetClientVersion(client);
+ return ProcVidModeSetClientVersion(client);
case X_XF86VidModeGetGamma:
- return ProcXF86VidModeGetGamma(client);
+ return ProcVidModeGetGamma(client);
case X_XF86VidModeGetGammaRamp:
- return ProcXF86VidModeGetGammaRamp(client);
+ return ProcVidModeGetGammaRamp(client);
case X_XF86VidModeGetGammaRampSize:
- return ProcXF86VidModeGetGammaRampSize(client);
+ return ProcVidModeGetGammaRampSize(client);
case X_XF86VidModeGetPermissions:
- return ProcXF86VidModeGetPermissions(client);
+ return ProcVidModeGetPermissions(client);
default:
- if (!xf86GetVidModeEnabled())
- return VidModeErrorBase + XF86VidModeExtensionDisabled;
- if (xf86GetVidModeAllowNonLocal() || client->local) {
+ if (VidModeAllowNonLocal || client->local) {
switch (stuff->data) {
case X_XF86VidModeAddModeLine:
- return ProcXF86VidModeAddModeLine(client);
+ return ProcVidModeAddModeLine(client);
case X_XF86VidModeDeleteModeLine:
- return ProcXF86VidModeDeleteModeLine(client);
+ return ProcVidModeDeleteModeLine(client);
case X_XF86VidModeModModeLine:
- return ProcXF86VidModeModModeLine(client);
+ return ProcVidModeModModeLine(client);
case X_XF86VidModeSwitchMode:
- return ProcXF86VidModeSwitchMode(client);
+ return ProcVidModeSwitchMode(client);
case X_XF86VidModeSwitchToMode:
- return ProcXF86VidModeSwitchToMode(client);
+ return ProcVidModeSwitchToMode(client);
case X_XF86VidModeLockModeSwitch:
- return ProcXF86VidModeLockModeSwitch(client);
+ return ProcVidModeLockModeSwitch(client);
case X_XF86VidModeSetViewPort:
- return ProcXF86VidModeSetViewPort(client);
+ return ProcVidModeSetViewPort(client);
case X_XF86VidModeSetGamma:
- return ProcXF86VidModeSetGamma(client);
+ return ProcVidModeSetGamma(client);
case X_XF86VidModeSetGammaRamp:
- return ProcXF86VidModeSetGammaRamp(client);
+ return ProcVidModeSetGammaRamp(client);
default:
return BadRequest;
}
@@ -1689,35 +1693,35 @@ ProcXF86VidModeDispatch(ClientPtr client)
}
static int
-SProcXF86VidModeQueryVersion(ClientPtr client)
+SProcVidModeQueryVersion(ClientPtr client)
{
REQUEST(xXF86VidModeQueryVersionReq);
swaps(&stuff->length);
- return ProcXF86VidModeQueryVersion(client);
+ return ProcVidModeQueryVersion(client);
}
static int
-SProcXF86VidModeGetModeLine(ClientPtr client)
+SProcVidModeGetModeLine(ClientPtr client)
{
REQUEST(xXF86VidModeGetModeLineReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
swaps(&stuff->screen);
- return ProcXF86VidModeGetModeLine(client);
+ return ProcVidModeGetModeLine(client);
}
static int
-SProcXF86VidModeGetAllModeLines(ClientPtr client)
+SProcVidModeGetAllModeLines(ClientPtr client)
{
REQUEST(xXF86VidModeGetAllModeLinesReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
swaps(&stuff->screen);
- return ProcXF86VidModeGetAllModeLines(client);
+ return ProcVidModeGetAllModeLines(client);
}
static int
-SProcXF86VidModeAddModeLine(ClientPtr client)
+SProcVidModeAddModeLine(ClientPtr client)
{
xXF86OldVidModeAddModeLineReq *oldstuff =
(xXF86OldVidModeAddModeLineReq *) client->requestBuffer;
@@ -1758,11 +1762,11 @@ SProcXF86VidModeAddModeLine(ClientPtr client)
swapl(&stuff->privsize);
SwapRestL(stuff);
}
- return ProcXF86VidModeAddModeLine(client);
+ return ProcVidModeAddModeLine(client);
}
static int
-SProcXF86VidModeDeleteModeLine(ClientPtr client)
+SProcVidModeDeleteModeLine(ClientPtr client)
{
xXF86OldVidModeDeleteModeLineReq *oldstuff =
(xXF86OldVidModeDeleteModeLineReq *) client->requestBuffer;
@@ -1803,11 +1807,11 @@ SProcXF86VidModeDeleteModeLine(ClientPtr client)
swapl(&stuff->privsize);
SwapRestL(stuff);
}
- return ProcXF86VidModeDeleteModeLine(client);
+ return ProcVidModeDeleteModeLine(client);
}
static int
-SProcXF86VidModeModModeLine(ClientPtr client)
+SProcVidModeModModeLine(ClientPtr client)
{
xXF86OldVidModeModModeLineReq *oldstuff =
(xXF86OldVidModeModModeLineReq *) client->requestBuffer;
@@ -1848,11 +1852,11 @@ SProcXF86VidModeModModeLine(ClientPtr client)
swapl(&stuff->privsize);
SwapRestL(stuff);
}
- return ProcXF86VidModeModModeLine(client);
+ return ProcVidModeModModeLine(client);
}
static int
-SProcXF86VidModeValidateModeLine(ClientPtr client)
+SProcVidModeValidateModeLine(ClientPtr client)
{
xXF86OldVidModeValidateModeLineReq *oldstuff =
(xXF86OldVidModeValidateModeLineReq *) client->requestBuffer;
@@ -1893,63 +1897,63 @@ SProcXF86VidModeValidateModeLine(ClientPtr client)
swapl(&stuff->privsize);
SwapRestL(stuff);
}
- return ProcXF86VidModeValidateModeLine(client);
+ return ProcVidModeValidateModeLine(client);
}
static int
-SProcXF86VidModeSwitchMode(ClientPtr client)
+SProcVidModeSwitchMode(ClientPtr client)
{
REQUEST(xXF86VidModeSwitchModeReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
swaps(&stuff->screen);
swaps(&stuff->zoom);
- return ProcXF86VidModeSwitchMode(client);
+ return ProcVidModeSwitchMode(client);
}
static int
-SProcXF86VidModeSwitchToMode(ClientPtr client)
+SProcVidModeSwitchToMode(ClientPtr client)
{
REQUEST(xXF86VidModeSwitchToModeReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq);
swapl(&stuff->screen);
- return ProcXF86VidModeSwitchToMode(client);
+ return ProcVidModeSwitchToMode(client);
}
static int
-SProcXF86VidModeLockModeSwitch(ClientPtr client)
+SProcVidModeLockModeSwitch(ClientPtr client)
{
REQUEST(xXF86VidModeLockModeSwitchReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
swaps(&stuff->screen);
swaps(&stuff->lock);
- return ProcXF86VidModeLockModeSwitch(client);
+ return ProcVidModeLockModeSwitch(client);
}
static int
-SProcXF86VidModeGetMonitor(ClientPtr client)
+SProcVidModeGetMonitor(ClientPtr client)
{
REQUEST(xXF86VidModeGetMonitorReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
swaps(&stuff->screen);
- return ProcXF86VidModeGetMonitor(client);
+ return ProcVidModeGetMonitor(client);
}
static int
-SProcXF86VidModeGetViewPort(ClientPtr client)
+SProcVidModeGetViewPort(ClientPtr client)
{
REQUEST(xXF86VidModeGetViewPortReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
swaps(&stuff->screen);
- return ProcXF86VidModeGetViewPort(client);
+ return ProcVidModeGetViewPort(client);
}
static int
-SProcXF86VidModeSetViewPort(ClientPtr client)
+SProcVidModeSetViewPort(ClientPtr client)
{
REQUEST(xXF86VidModeSetViewPortReq);
swaps(&stuff->length);
@@ -1957,32 +1961,32 @@ SProcXF86VidModeSetViewPort(ClientPtr client)
swaps(&stuff->screen);
swapl(&stuff->x);
swapl(&stuff->y);
- return ProcXF86VidModeSetViewPort(client);
+ return ProcVidModeSetViewPort(client);
}
static int
-SProcXF86VidModeGetDotClocks(ClientPtr client)
+SProcVidModeGetDotClocks(ClientPtr client)
{
REQUEST(xXF86VidModeGetDotClocksReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
swaps(&stuff->screen);
- return ProcXF86VidModeGetDotClocks(client);
+ return ProcVidModeGetDotClocks(client);
}
static int
-SProcXF86VidModeSetClientVersion(ClientPtr client)
+SProcVidModeSetClientVersion(ClientPtr client)
{
REQUEST(xXF86VidModeSetClientVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
swaps(&stuff->major);
swaps(&stuff->minor);
- return ProcXF86VidModeSetClientVersion(client);
+ return ProcVidModeSetClientVersion(client);
}
static int
-SProcXF86VidModeSetGamma(ClientPtr client)
+SProcVidModeSetGamma(ClientPtr client)
{
REQUEST(xXF86VidModeSetGammaReq);
swaps(&stuff->length);
@@ -1991,21 +1995,21 @@ SProcXF86VidModeSetGamma(ClientPtr client)
swapl(&stuff->red);
swapl(&stuff->green);
swapl(&stuff->blue);
- return ProcXF86VidModeSetGamma(client);
+ return ProcVidModeSetGamma(client);
}
static int
-SProcXF86VidModeGetGamma(ClientPtr client)
+SProcVidModeGetGamma(ClientPtr client)
{
REQUEST(xXF86VidModeGetGammaReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
swaps(&stuff->screen);
- return ProcXF86VidModeGetGamma(client);
+ return ProcVidModeGetGamma(client);
}
static int
-SProcXF86VidModeSetGammaRamp(ClientPtr client)
+SProcVidModeSetGammaRamp(ClientPtr client)
{
int length;
@@ -2017,92 +2021,90 @@ SProcXF86VidModeSetGammaRamp(ClientPtr client)
length = ((stuff->size + 1) & ~1) * 6;
REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length);
SwapRestS(stuff);
- return ProcXF86VidModeSetGammaRamp(client);
+ return ProcVidModeSetGammaRamp(client);
}
static int
-SProcXF86VidModeGetGammaRamp(ClientPtr client)
+SProcVidModeGetGammaRamp(ClientPtr client)
{
REQUEST(xXF86VidModeGetGammaRampReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
swaps(&stuff->size);
swaps(&stuff->screen);
- return ProcXF86VidModeGetGammaRamp(client);
+ return ProcVidModeGetGammaRamp(client);
}
static int
-SProcXF86VidModeGetGammaRampSize(ClientPtr client)
+SProcVidModeGetGammaRampSize(ClientPtr client)
{
REQUEST(xXF86VidModeGetGammaRampSizeReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
swaps(&stuff->screen);
- return ProcXF86VidModeGetGammaRampSize(client);
+ return ProcVidModeGetGammaRampSize(client);
}
static int
-SProcXF86VidModeGetPermissions(ClientPtr client)
+SProcVidModeGetPermissions(ClientPtr client)
{
REQUEST(xXF86VidModeGetPermissionsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
swaps(&stuff->screen);
- return ProcXF86VidModeGetPermissions(client);
+ return ProcVidModeGetPermissions(client);
}
static int
-SProcXF86VidModeDispatch(ClientPtr client)
+SProcVidModeDispatch(ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
case X_XF86VidModeQueryVersion:
- return SProcXF86VidModeQueryVersion(client);
+ return SProcVidModeQueryVersion(client);
case X_XF86VidModeGetModeLine:
- return SProcXF86VidModeGetModeLine(client);
+ return SProcVidModeGetModeLine(client);
case X_XF86VidModeGetMonitor:
- return SProcXF86VidModeGetMonitor(client);
+ return SProcVidModeGetMonitor(client);
case X_XF86VidModeGetAllModeLines:
- return SProcXF86VidModeGetAllModeLines(client);
+ return SProcVidModeGetAllModeLines(client);
case X_XF86VidModeGetViewPort:
- return SProcXF86VidModeGetViewPort(client);
+ return SProcVidModeGetViewPort(client);
case X_XF86VidModeValidateModeLine:
- return SProcXF86VidModeValidateModeLine(client);
+ return SProcVidModeValidateModeLine(client);
case X_XF86VidModeGetDotClocks:
- return SProcXF86VidModeGetDotClocks(client);
+ return SProcVidModeGetDotClocks(client);
case X_XF86VidModeSetClientVersion:
- return SProcXF86VidModeSetClientVersion(client);
+ return SProcVidModeSetClientVersion(client);
case X_XF86VidModeGetGamma:
- return SProcXF86VidModeGetGamma(client);
+ return SProcVidModeGetGamma(client);
case X_XF86VidModeGetGammaRamp:
- return SProcXF86VidModeGetGammaRamp(client);
+ return SProcVidModeGetGammaRamp(client);
case X_XF86VidModeGetGammaRampSize:
- return SProcXF86VidModeGetGammaRampSize(client);
+ return SProcVidModeGetGammaRampSize(client);
case X_XF86VidModeGetPermissions:
- return SProcXF86VidModeGetPermissions(client);
+ return SProcVidModeGetPermissions(client);
default:
- if (!xf86GetVidModeEnabled())
- return VidModeErrorBase + XF86VidModeExtensionDisabled;
- if (xf86GetVidModeAllowNonLocal() || client->local) {
+ if (VidModeAllowNonLocal || client->local) {
switch (stuff->data) {
case X_XF86VidModeAddModeLine:
- return SProcXF86VidModeAddModeLine(client);
+ return SProcVidModeAddModeLine(client);
case X_XF86VidModeDeleteModeLine:
- return SProcXF86VidModeDeleteModeLine(client);
+ return SProcVidModeDeleteModeLine(client);
case X_XF86VidModeModModeLine:
- return SProcXF86VidModeModModeLine(client);
+ return SProcVidModeModModeLine(client);
case X_XF86VidModeSwitchMode:
- return SProcXF86VidModeSwitchMode(client);
+ return SProcVidModeSwitchMode(client);
case X_XF86VidModeSwitchToMode:
- return SProcXF86VidModeSwitchToMode(client);
+ return SProcVidModeSwitchToMode(client);
case X_XF86VidModeLockModeSwitch:
- return SProcXF86VidModeLockModeSwitch(client);
+ return SProcVidModeLockModeSwitch(client);
case X_XF86VidModeSetViewPort:
- return SProcXF86VidModeSetViewPort(client);
+ return SProcVidModeSetViewPort(client);
case X_XF86VidModeSetGamma:
- return SProcXF86VidModeSetGamma(client);
+ return SProcVidModeSetGamma(client);
case X_XF86VidModeSetGammaRamp:
- return SProcXF86VidModeSetGammaRamp(client);
+ return SProcVidModeSetGammaRamp(client);
default:
return BadRequest;
}
@@ -2113,53 +2115,37 @@ SProcXF86VidModeDispatch(ClientPtr client)
}
void
-XFree86VidModeExtensionInit(void)
+VidModeAddExtension(Bool allow_non_local)
{
ExtensionEntry *extEntry;
- ScreenPtr pScreen;
- int i;
- Bool enabled = FALSE;
- DEBUG_P("XFree86VidModeExtensionInit");
+ DEBUG_P("VidModeAddExtension");
- if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0))
- return;
-#ifdef XF86VIDMODE_EVENTS
- if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
- return;
-#endif
-
-#ifdef XF86VIDMODE_EVENTS
- EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
-#endif
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- pScreen = screenInfo.screens[i];
- if (VidModeExtensionInit(pScreen))
- enabled = TRUE;
- }
- /* This means that the DDX doesn't want the vidmode extension enabled */
- if (!enabled)
+ if (!dixRegisterPrivateKey(VidModeClientPrivateKey, PRIVATE_CLIENT, 0))
return;
- if (
-#ifdef XF86VIDMODE_EVENTS
- EventType &&
-#endif
- (extEntry = AddExtension(XF86VIDMODENAME,
- XF86VidModeNumberEvents,
- XF86VidModeNumberErrors,
- ProcXF86VidModeDispatch,
- SProcXF86VidModeDispatch,
- NULL, StandardMinorOpcode))) {
-#if 0
- XF86VidModeReqCode = (unsigned char) extEntry->base;
-#endif
+ if ((extEntry = AddExtension(XF86VIDMODENAME,
+ XF86VidModeNumberEvents,
+ XF86VidModeNumberErrors,
+ ProcVidModeDispatch,
+ SProcVidModeDispatch,
+ NULL, StandardMinorOpcode))) {
VidModeErrorBase = extEntry->errorBase;
-#ifdef XF86VIDMODE_EVENTS
- XF86VidModeEventBase = extEntry->eventBase;
- EventSwapVector[XF86VidModeEventBase] =
- (EventSwapPtr) SXF86VidModeNotifyEvent;
-#endif
+ VidModeAllowNonLocal = allow_non_local;
}
}
+
+VidModePtr VidModeGetPtr(ScreenPtr pScreen)
+{
+ return (VidModePtr) (dixLookupPrivate(&pScreen->devPrivates, VidModePrivateKey));
+}
+
+VidModePtr VidModeInit(ScreenPtr pScreen)
+{
+ if (!dixRegisterPrivateKey(VidModePrivateKey, PRIVATE_SCREEN, sizeof(VidModeRec)))
+ return NULL;
+
+ return VidModeGetPtr(pScreen);
+}
+
+#endif /* XF86VIDMODE */
diff --git a/xserver/Xext/xace.c b/xserver/Xext/xace.c
index b3c67f632..fcb38db8c 100644
--- a/xserver/Xext/xace.c
+++ b/xserver/Xext/xace.c
@@ -29,11 +29,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "gcstruct.h"
#include "xacestr.h"
-#define XSERV_t
-#define TRANS_SERVER
-#include <X11/Xtrans/Xtrans.h>
-#include "../os/osdep.h"
-
_X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = { 0 };
/* Special-cased hook functions. Called by Xserver.
@@ -342,15 +337,11 @@ XaceCensorImage(ClientPtr client,
int
XaceGetConnectionNumber(ClientPtr client)
{
- XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn;
-
- return _XSERVTransGetConnectionNumber(ci);
+ return GetClientFd(client);
}
int
XaceIsLocal(ClientPtr client)
{
- XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn;
-
- return _XSERVTransIsLocal(ci);
+ return ClientIsLocal(client);
}
diff --git a/xserver/Xext/xcmisc.c b/xserver/Xext/xcmisc.c
index 1e9101059..ed25650cd 100644
--- a/xserver/Xext/xcmisc.c
+++ b/xserver/Xext/xcmisc.c
@@ -101,7 +101,7 @@ ProcXCMiscGetXIDList(ClientPtr client)
if (stuff->count > UINT32_MAX / sizeof(XID))
return BadAlloc;
- pids = (XID *) malloc(stuff->count * sizeof(XID));
+ pids = xallocarray(stuff->count, sizeof(XID));
if (!pids) {
return BadAlloc;
}
diff --git a/xserver/Xext/xf86bigfont.c b/xserver/Xext/xf86bigfont.c
index 46b3242d1..95b537170 100644
--- a/xserver/Xext/xf86bigfont.c
+++ b/xserver/Xext/xf86bigfont.c
@@ -401,7 +401,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
}
else {
#endif
- pCI = malloc(nCharInfos * sizeof(xCharInfo));
+ pCI = xallocarray(nCharInfos, sizeof(xCharInfo));
if (!pCI)
return BadAlloc;
#ifdef HAS_SHM
@@ -463,7 +463,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
if (hashModulus > nCharInfos + 1)
hashModulus = nCharInfos + 1;
- tmp = malloc((4 * nCharInfos + 1) * sizeof(CARD16));
+ tmp = xallocarray(4 * nCharInfos + 1, sizeof(CARD16));
if (!tmp) {
if (!pDesc)
free(pCI);
diff --git a/xserver/Xext/xres.c b/xserver/Xext/xres.c
index 273793806..83cc6913a 100644
--- a/xserver/Xext/xres.c
+++ b/xserver/Xext/xres.c
@@ -223,7 +223,7 @@ ProcXResQueryClients(ClientPtr client)
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
- current_clients = malloc(currentMaxClients * sizeof(int));
+ current_clients = xallocarray(currentMaxClients, sizeof(int));
num_clients = 0;
for (i = 0; i < currentMaxClients; i++) {
@@ -410,21 +410,21 @@ ResFindGCPixmaps(void *value, XID id, void *cdata)
*bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap);
}
+#ifdef RENDER
static void
ResFindPicturePixmaps(void *value, XID id, void *cdata)
{
-#ifdef RENDER
ResFindResourcePixmaps(value, id, PictureType, cdata);
-#endif
}
+#endif
+#ifdef COMPOSITE
static void
ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata)
{
-#ifdef COMPOSITE
ResFindResourcePixmaps(value, id, CompositeClientWindowType, cdata);
-#endif
}
+#endif
static int
ProcXResQueryClientPixmapBytes(ClientPtr client)
diff --git a/xserver/Xext/xselinux_hooks.c b/xserver/Xext/xselinux_hooks.c
index e69bfe7ae..d9f2f681b 100644
--- a/xserver/Xext/xselinux_hooks.c
+++ b/xserver/Xext/xselinux_hooks.c
@@ -41,7 +41,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "extnsionst.h"
#include "xacestr.h"
#include "client.h"
-#include "../os/osdep.h"
#define _XSELINUX_NEED_FLASK_MAP
#include "xselinuxint.h"
diff --git a/xserver/Xext/xselinux_label.c b/xserver/Xext/xselinux_label.c
index 2c33d1cbf..8559385b9 100644
--- a/xserver/Xext/xselinux_label.c
+++ b/xserver/Xext/xselinux_label.c
@@ -64,7 +64,7 @@ SELinuxArraySet(SELinuxArrayRec * rec, unsigned key, void *val)
{
if (key >= rec->size) {
/* Need to increase size of array */
- rec->array = realloc(rec->array, (key + 1) * sizeof(val));
+ rec->array = reallocarray(rec->array, key + 1, sizeof(val));
if (!rec->array)
return FALSE;
memset(rec->array + rec->size, 0, (key - rec->size + 1) * sizeof(val));
diff --git a/xserver/Xext/xtest.c b/xserver/Xext/xtest.c
index 88df4433b..2371a69e1 100644
--- a/xserver/Xext/xtest.c
+++ b/xserver/Xext/xtest.c
@@ -421,7 +421,7 @@ ProcXTestFakeInput(ClientPtr client)
case KeyPress:
case KeyRelease:
nevents =
- GetKeyboardEvents(xtest_evlist, dev, type, ev->u.u.detail, NULL);
+ GetKeyboardEvents(xtest_evlist, dev, type, ev->u.u.detail);
break;
}
diff --git a/xserver/Xext/xvmain.c b/xserver/Xext/xvmain.c
index 0abf190dc..c9b11d4bb 100644
--- a/xserver/Xext/xvmain.c
+++ b/xserver/Xext/xvmain.c
@@ -327,36 +327,24 @@ XvGetRTPort(void)
return XvRTPort;
}
-static Bool
-XvDestroyPixmap(PixmapPtr pPix)
+static void
+XvStopAdaptors(DrawablePtr pDrawable)
{
- Bool status;
- ScreenPtr pScreen;
- XvScreenPtr pxvs;
- XvAdaptorPtr pa;
- int na;
- XvPortPtr pp;
- int np;
-
- pScreen = pPix->drawable.pScreen;
-
- SCREEN_PROLOGUE(pScreen, DestroyPixmap);
-
- pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
+ ScreenPtr pScreen = pDrawable->pScreen;
+ XvScreenPtr pxvs = dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
+ XvAdaptorPtr pa = pxvs->pAdaptors;
+ int na = pxvs->nAdaptors;
/* CHECK TO SEE IF THIS PORT IS IN USE */
-
- pa = pxvs->pAdaptors;
- na = pxvs->nAdaptors;
while (na--) {
- np = pa->nPorts;
- pp = pa->pPorts;
+ XvPortPtr pp = pa->pPorts;
+ int np = pa->nPorts;
while (np--) {
- if (pp->pDraw == (DrawablePtr) pPix) {
- XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
+ if (pp->pDraw == pDrawable) {
+ XvdiSendVideoNotify(pp, pDrawable, XvPreempted);
- (void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw);
+ (void) (*pp->pAdaptor->ddStopVideo) (pp, pDrawable);
pp->pDraw = NULL;
pp->client = NULL;
@@ -366,9 +354,19 @@ XvDestroyPixmap(PixmapPtr pPix)
}
pa++;
}
+}
- status = (*pScreen->DestroyPixmap) (pPix);
+static Bool
+XvDestroyPixmap(PixmapPtr pPix)
+{
+ ScreenPtr pScreen = pPix->drawable.pScreen;
+ Bool status;
+ if (pPix->refcnt == 1)
+ XvStopAdaptors(&pPix->drawable);
+
+ SCREEN_PROLOGUE(pScreen, DestroyPixmap);
+ status = (*pScreen->DestroyPixmap) (pPix);
SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
return status;
@@ -378,45 +376,13 @@ XvDestroyPixmap(PixmapPtr pPix)
static Bool
XvDestroyWindow(WindowPtr pWin)
{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
Bool status;
- ScreenPtr pScreen;
- XvScreenPtr pxvs;
- XvAdaptorPtr pa;
- int na;
- XvPortPtr pp;
- int np;
- pScreen = pWin->drawable.pScreen;
+ XvStopAdaptors(&pWin->drawable);
SCREEN_PROLOGUE(pScreen, DestroyWindow);
-
- pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
-
- /* CHECK TO SEE IF THIS PORT IS IN USE */
-
- pa = pxvs->pAdaptors;
- na = pxvs->nAdaptors;
- while (na--) {
- np = pa->nPorts;
- pp = pa->pPorts;
-
- while (np--) {
- if (pp->pDraw == (DrawablePtr) pWin) {
- XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
-
- (void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw);
-
- pp->pDraw = NULL;
- pp->client = NULL;
- pp->time = currentTime;
- }
- pp++;
- }
- pa++;
- }
-
status = (*pScreen->DestroyWindow) (pWin);
-
SCREEN_EPILOGUE(pScreen, DestroyWindow, XvDestroyWindow);
return status;
@@ -834,10 +800,9 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
if (!(tpn = malloc(sizeof(XvVideoNotifyRec))))
return BadAlloc;
tpn->next = NULL;
- if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn)) {
- free(tpn);
+ tpn->client = NULL;
+ if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn))
return BadAlloc;
- }
}
else {
/* LOOK TO SEE IF ENTRY ALREADY EXISTS */
@@ -878,7 +843,8 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
tpn->client = NULL;
tpn->id = FakeClientID(client->index);
- AddResource(tpn->id, XvRTVideoNotify, tpn);
+ if (!AddResource(tpn->id, XvRTVideoNotify, tpn))
+ return BadAlloc;
tpn->client = client;
return Success;
@@ -927,7 +893,8 @@ XvdiSelectPortNotify(ClientPtr client, XvPortPtr pPort, BOOL onoff)
tpn->client = client;
tpn->id = FakeClientID(client->index);
- AddResource(tpn->id, XvRTPortNotify, tpn);
+ if (!AddResource(tpn->id, XvRTPortNotify, tpn))
+ return BadAlloc;
return Success;
@@ -1102,7 +1069,7 @@ XvFillColorKey(DrawablePtr pDraw, CARD32 key, RegionPtr region)
(void) ChangeGC(NullClient, gc, GCForeground | GCSubwindowMode, pval);
ValidateGC(pDraw, gc);
- rects = malloc(nbox * sizeof(xRectangle));
+ rects = xallocarray(nbox, sizeof(xRectangle));
if (rects) {
for (i = 0; i < nbox; i++, pbox++) {
rects[i].x = pbox->x1 - pDraw->x;
diff --git a/xserver/Xext/xvmc.c b/xserver/Xext/xvmc.c
index 64eda922b..7565c173d 100644
--- a/xserver/Xext/xvmc.c
+++ b/xserver/Xext/xvmc.c
@@ -253,6 +253,10 @@ ProcXvMCCreateContext(ClientPtr client)
free(pContext);
return result;
}
+ if (!AddResource(pContext->context_id, XvMCRTContext, pContext)) {
+ free(data);
+ return BadAlloc;
+ }
rep = (xvmcCreateContextReply) {
.type = X_Reply,
@@ -266,7 +270,6 @@ ProcXvMCCreateContext(ClientPtr client)
WriteToClient(client, sizeof(xvmcCreateContextReply), &rep);
if (dwords)
WriteToClient(client, dwords << 2, data);
- AddResource(pContext->context_id, XvMCRTContext, pContext);
free(data);
@@ -329,6 +332,11 @@ ProcXvMCCreateSurface(ClientPtr client)
free(pSurface);
return result;
}
+ if (!AddResource(pSurface->surface_id, XvMCRTSurface, pSurface)) {
+ free(data);
+ return BadAlloc;
+ }
+
rep = (xvmcCreateSurfaceReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
@@ -338,7 +346,6 @@ ProcXvMCCreateSurface(ClientPtr client)
WriteToClient(client, sizeof(xvmcCreateSurfaceReply), &rep);
if (dwords)
WriteToClient(client, dwords << 2, data);
- AddResource(pSurface->surface_id, XvMCRTSurface, pSurface);
free(data);
@@ -445,6 +452,11 @@ ProcXvMCCreateSubpicture(ClientPtr client)
free(pSubpicture);
return result;
}
+ if (!AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture)) {
+ free(data);
+ return BadAlloc;
+ }
+
rep = (xvmcCreateSubpictureReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
@@ -462,7 +474,6 @@ ProcXvMCCreateSubpicture(ClientPtr client)
WriteToClient(client, sizeof(xvmcCreateSubpictureReply), &rep);
if (dwords)
WriteToClient(client, dwords << 2, data);
- AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture);
free(data);
diff --git a/xserver/Xi/Makefile.in b/xserver/Xi/Makefile.in
index 21e4d9d46..4c3b2e38d 100644
--- a/xserver/Xi/Makefile.in
+++ b/xserver/Xi/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -229,7 +228,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -359,8 +357,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/Xi/exevents.c b/xserver/Xi/exevents.c
index 21fb69696..e728310f8 100644
--- a/xserver/Xi/exevents.c
+++ b/xserver/Xi/exevents.c
@@ -471,9 +471,9 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to)
oldTrace = to->focus->trace;
memcpy(to->focus, from->focus, sizeof(FocusClassRec));
- to->focus->trace = realloc(oldTrace,
- to->focus->traceSize *
- sizeof(WindowPtr));
+ to->focus->trace = reallocarray(oldTrace,
+ to->focus->traceSize,
+ sizeof(WindowPtr));
if (!to->focus->trace && to->focus->traceSize)
FatalError("[Xi] no memory for trace.\n");
memcpy(to->focus->trace, from->focus->trace,
@@ -1590,7 +1590,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
if (!ti) {
DebugF("[Xi] %s: Failed to get event %d for touchpoint %d\n",
dev->name, type, touchid);
- return;
+ goto out;
}
/* if emulate_pointer is set, emulate the motion event right
@@ -1624,6 +1624,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
if (ev->any.type == ET_TouchEnd)
TouchEndTouch(dev, ti);
+ out:
if (emulate_pointer)
UpdateDeviceState(dev, &ev->device_event);
}
diff --git a/xserver/Xi/getprop.c b/xserver/Xi/getprop.c
index 4d6ce6338..19f18af21 100644
--- a/xserver/Xi/getprop.c
+++ b/xserver/Xi/getprop.c
@@ -118,7 +118,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
ClassFromMask(NULL, others->dontPropagateMask[i], i, &count, COUNT);
if (count) {
rep.count = count;
- buf = (XEventClass *) malloc(rep.count * sizeof(XEventClass));
+ buf = xallocarray(rep.count, sizeof(XEventClass));
rep.length = bytes_to_int32(rep.count * sizeof(XEventClass));
tbuf = buf;
diff --git a/xserver/Xi/xichangehierarchy.c b/xserver/Xi/xichangehierarchy.c
index 27324452d..8d5b577b6 100644
--- a/xserver/Xi/xichangehierarchy.c
+++ b/xserver/Xi/xichangehierarchy.c
@@ -421,9 +421,7 @@ ProcXIChangeHierarchy(ClientPtr client)
if (!stuff->num_changes)
return rc;
- if (stuff->length > (INT_MAX >> 2))
- return BadAlloc;
- len = (stuff->length << 2) - sizeof(xXIAnyHierarchyChangeInfo);
+ len = ((size_t)stuff->length << 2) - sizeof(xXIAnyHierarchyChangeInfo);
any = (xXIAnyHierarchyChangeInfo *) &stuff[1];
while (stuff->num_changes--) {
@@ -435,7 +433,7 @@ ProcXIChangeHierarchy(ClientPtr client)
SWAPIF(swaps(&any->type));
SWAPIF(swaps(&any->length));
- if ((any->length > (INT_MAX >> 2)) || (len < (any->length << 2)))
+ if (len < ((size_t)any->length << 2))
return BadLength;
#define CHANGE_SIZE_MATCH(type) \
diff --git a/xserver/Xi/xiproperty.c b/xserver/Xi/xiproperty.c
index 8e8e4b061..e3b8f5abe 100644
--- a/xserver/Xi/xiproperty.c
+++ b/xserver/Xi/xiproperty.c
@@ -221,7 +221,7 @@ list_atoms(DeviceIntPtr dev, int *natoms, Atom **atoms_return)
if (nprops) {
Atom *a;
- atoms = malloc(nprops * sizeof(Atom));
+ atoms = xallocarray(nprops, sizeof(Atom));
if (!atoms)
return BadAlloc;
a = atoms;
@@ -687,7 +687,6 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type,
{
XIPropertyPtr prop;
int size_in_bytes;
- int total_size;
unsigned long total_len;
XIPropertyValuePtr prop_value;
XIPropertyValueRec new_value;
@@ -725,9 +724,8 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type,
if (mode == PropModeReplace || len > 0) {
void *new_data = NULL, *old_data = NULL;
- total_size = total_len * size_in_bytes;
- new_value.data = (void *) malloc(total_size);
- if (!new_value.data && total_size) {
+ new_value.data = xallocarray(total_len, size_in_bytes);
+ if (!new_value.data && total_len && size_in_bytes) {
if (add)
XIDestroyDeviceProperty(prop);
return BadAlloc;
diff --git a/xserver/Xi/xiquerypointer.c b/xserver/Xi/xiquerypointer.c
index 7ec0c851d..b9e295815 100644
--- a/xserver/Xi/xiquerypointer.c
+++ b/xserver/Xi/xiquerypointer.c
@@ -152,10 +152,10 @@ ProcXIQueryPointer(ClientPtr client)
rep.buttons_len =
bytes_to_int32(bits_to_bytes(pDev->button->numButtons));
rep.length += rep.buttons_len;
- buttons_size = rep.buttons_len * 4;
- buttons = calloc(1, buttons_size);
+ buttons = calloc(rep.buttons_len, 4);
if (!buttons)
return BadAlloc;
+ buttons_size = rep.buttons_len * 4;
for (i = 1; i < pDev->button->numButtons; i++)
if (BitIsOn(pDev->button->down, i))
diff --git a/xserver/aclocal.m4 b/xserver/aclocal.m4
index 340baff19..2b069f316 100644
--- a/xserver/aclocal.m4
+++ b/xserver/aclocal.m4
@@ -1228,7 +1228,6 @@ m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])
-m4_include([m4/xorg-tls.m4])
dnl fontutil.m4. Generated from fontutil.m4.in by configure.
dnl
dnl This file comes from X.Org's font-util 1.3.1
diff --git a/xserver/autogen.sh b/xserver/autogen.sh
index dd0731ad9..4de97bf8e 100644
--- a/xserver/autogen.sh
+++ b/xserver/autogen.sh
@@ -1,14 +1,17 @@
#! /bin/sh
-srcdir=`dirname $0`
+srcdir=`dirname "$0"`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
-cd $srcdir
+cd "$srcdir"
autoreconf --force -v --install || exit 1
-cd $ORIGDIR || exit $?
+cd "$ORIGDIR" || exit $?
+
+git config --local --get format.subjectPrefix ||
+ git config --local format.subjectPrefix "PATCH xserver"
if test -z "$NOCONFIGURE"; then
- exec $srcdir/configure "$@"
+ exec "$srcdir"/configure "$@"
fi
diff --git a/xserver/composite/Makefile.in b/xserver/composite/Makefile.in
index 748bcad49..ac2f9f84b 100644
--- a/xserver/composite/Makefile.in
+++ b/xserver/composite/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -247,7 +246,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -377,8 +375,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/composite/compinit.c b/xserver/composite/compinit.c
index 3ac075a46..791fec922 100644
--- a/xserver/composite/compinit.c
+++ b/xserver/composite/compinit.c
@@ -105,6 +105,20 @@ compInstallColormap(ColormapPtr pColormap)
pScreen->InstallColormap = compInstallColormap;
}
+static void
+compCheckBackingStore(WindowPtr pWin)
+{
+ if (pWin->backingStore != NotUseful && !pWin->backStorage) {
+ compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
+ pWin->backStorage = TRUE;
+ }
+ else if (pWin->backingStore == NotUseful && pWin->backStorage) {
+ compUnredirectWindow(serverClient, pWin,
+ CompositeRedirectAutomatic);
+ pWin->backStorage = FALSE;
+ }
+}
+
/* Fake backing store via automatic redirection */
static Bool
compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
@@ -117,17 +131,8 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
ret = pScreen->ChangeWindowAttributes(pWin, mask);
if (ret && (mask & CWBackingStore) &&
- pScreen->backingStoreSupport != NotUseful) {
- if (pWin->backingStore != NotUseful && !pWin->backStorage) {
- compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
- pWin->backStorage = TRUE;
- }
- else if (pWin->backingStore == NotUseful && pWin->backStorage) {
- compUnredirectWindow(serverClient, pWin,
- CompositeRedirectAutomatic);
- pWin->backStorage = FALSE;
- }
- }
+ pScreen->backingStoreSupport != NotUseful)
+ compCheckBackingStore(pWin);
pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
@@ -223,8 +228,8 @@ compRegisterAlternateVisuals(CompScreenPtr cs, VisualID * vids, int nVisuals)
{
VisualID *p;
- p = realloc(cs->alternateVisuals,
- sizeof(VisualID) * (cs->numAlternateVisuals + nVisuals));
+ p = reallocarray(cs->alternateVisuals,
+ cs->numAlternateVisuals + nVisuals, sizeof(VisualID));
if (p == NULL)
return FALSE;
@@ -253,8 +258,8 @@ CompositeRegisterImplicitRedirectionException(ScreenPtr pScreen,
CompScreenPtr cs = GetCompScreen(pScreen);
CompImplicitRedirectException *p;
- p = realloc(cs->implicitRedirectExceptions,
- sizeof(p[0]) * (cs->numImplicitRedirectExceptions + 1));
+ p = reallocarray(cs->implicitRedirectExceptions,
+ cs->numImplicitRedirectExceptions + 1, sizeof(p[0]));
if (p == NULL)
return FALSE;
diff --git a/xserver/composite/compwindow.c b/xserver/composite/compwindow.c
index 77bdfa23c..344138ad7 100644
--- a/xserver/composite/compwindow.c
+++ b/xserver/composite/compwindow.c
@@ -104,7 +104,7 @@ compRepaintBorder(ClientPtr pClient, void *closure)
RegionNull(&exposed);
RegionSubtract(&exposed, &pWindow->borderClip, &pWindow->winSize);
- miPaintWindow(pWindow, &exposed, PW_BORDER);
+ pWindow->drawable.pScreen->PaintWindow(pWindow, &exposed, PW_BORDER);
RegionUninit(&exposed);
}
return TRUE;
diff --git a/xserver/config/10-evdev.conf b/xserver/config/10-evdev.conf
deleted file mode 100644
index cc83ab232..000000000
--- a/xserver/config/10-evdev.conf
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Catch-all evdev loader for udev-based systems
-# We don't simply match on any device since that also adds accelerometers
-# and other devices that we don't really want to use. The list below
-# matches everything but joysticks.
-
-Section "InputClass"
- Identifier "evdev pointer catchall"
- MatchIsPointer "on"
- MatchDevicePath "/dev/input/event*"
- Driver "evdev"
-EndSection
-
-Section "InputClass"
- Identifier "evdev keyboard catchall"
- MatchIsKeyboard "on"
- MatchDevicePath "/dev/input/event*"
- Driver "evdev"
-EndSection
-
-Section "InputClass"
- Identifier "evdev touchpad catchall"
- MatchIsTouchpad "on"
- MatchDevicePath "/dev/input/event*"
- Driver "evdev"
-EndSection
-
-Section "InputClass"
- Identifier "evdev tablet catchall"
- MatchIsTablet "on"
- MatchDevicePath "/dev/input/event*"
- Driver "evdev"
-EndSection
-
-Section "InputClass"
- Identifier "evdev touchscreen catchall"
- MatchIsTouchscreen "on"
- MatchDevicePath "/dev/input/event*"
- Driver "evdev"
-EndSection
diff --git a/xserver/config/Makefile.am b/xserver/config/Makefile.am
index 0e20e8b3d..51aae473e 100644
--- a/xserver/config/Makefile.am
+++ b/xserver/config/Makefile.am
@@ -18,7 +18,7 @@ libconfig_la_LIBADD += $(UDEV_LIBS)
if XORG
xorgconfddir = $(datadir)/X11/$(XF86CONFIGDIR)
-xorgconfd_DATA = 10-evdev.conf 10-quirks.conf
+xorgconfd_DATA = 10-quirks.conf
endif
else
@@ -38,4 +38,4 @@ endif # !CONFIG_HAL
endif # !CONFIG_UDEV
-EXTRA_DIST = x11-input.fdi 10-evdev.conf fdi2iclass.py 10-quirks.conf
+EXTRA_DIST = x11-input.fdi fdi2iclass.py 10-quirks.conf
diff --git a/xserver/config/Makefile.in b/xserver/config/Makefile.in
index 140548f1f..c75934511 100644
--- a/xserver/config/Makefile.in
+++ b/xserver/config/Makefile.in
@@ -68,8 +68,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -268,7 +267,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -398,8 +396,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -530,8 +526,8 @@ libconfig_la_SOURCES = config.c config-backends.h $(am__append_2) \
$(am__append_5) $(am__append_8) $(am__append_10)
libconfig_la_LIBADD = $(am__append_3) $(am__append_6) $(am__append_9)
@CONFIG_UDEV_TRUE@@XORG_TRUE@xorgconfddir = $(datadir)/X11/$(XF86CONFIGDIR)
-@CONFIG_UDEV_TRUE@@XORG_TRUE@xorgconfd_DATA = 10-evdev.conf 10-quirks.conf
-EXTRA_DIST = x11-input.fdi 10-evdev.conf fdi2iclass.py 10-quirks.conf
+@CONFIG_UDEV_TRUE@@XORG_TRUE@xorgconfd_DATA = 10-quirks.conf
+EXTRA_DIST = x11-input.fdi fdi2iclass.py 10-quirks.conf
all: all-am
.SUFFIXES:
diff --git a/xserver/config/config.c b/xserver/config/config.c
index b5d634b87..de45cc350 100644
--- a/xserver/config/config.c
+++ b/xserver/config/config.c
@@ -130,7 +130,8 @@ device_is_duplicate(const char *config_info)
struct OdevAttributes *
config_odev_allocate_attributes(void)
{
- struct OdevAttributes *attribs = XNFcalloc(sizeof (struct OdevAttributes));
+ struct OdevAttributes *attribs =
+ xnfcalloc(1, sizeof (struct OdevAttributes));
attribs->fd = -1;
return attribs;
}
diff --git a/xserver/configure b/xserver/configure
index d3dae3e43..c47fc38cd 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.17.4.
+# Generated by GNU Autoconf 2.69 for xorg-server 1.18.3.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@@ -651,8 +651,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='xorg-server'
PACKAGE_TARNAME='xorg-server'
-PACKAGE_VERSION='1.17.4'
-PACKAGE_STRING='xorg-server 1.17.4'
+PACKAGE_VERSION='1.18.3'
+PACKAGE_STRING='xorg-server 1.18.3'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
PACKAGE_URL=''
@@ -822,8 +822,6 @@ XORG_DRIVER_MODESETTING_FALSE
XORG_DRIVER_MODESETTING_TRUE
XORG_BUS_PLATFORM_FALSE
XORG_BUS_PLATFORM_TRUE
-XF86VIDMODE_FALSE
-XF86VIDMODE_TRUE
DGA_FALSE
DGA_TRUE
SOLARIS_VT_FALSE
@@ -869,8 +867,6 @@ XORG_SYS_LIBS
XORG_LIBS
XORG_MODULES_LIBS
XORG_MODULES_CFLAGS
-XF86VIDMODE_LIBS
-XF86VIDMODE_CFLAGS
DGA_LIBS
DGA_CFLAGS
SOLARIS_INOUT_ARCH
@@ -922,6 +918,8 @@ DRI_DRIVER_PATH
BASE_FONT_PATH
SERVER_MISC_CONFIG_PATH
COMPILEDDEFAULTFONTPATH
+XF86VIDMODE_FALSE
+XF86VIDMODE_TRUE
XDMAUTH_FALSE
XDMAUTH_TRUE
XDMCP_FALSE
@@ -975,6 +973,8 @@ XLIB_LIBS
XLIB_CFLAGS
DRI2_AIGLX_FALSE
DRI2_AIGLX_TRUE
+LIBDRM_LIBS
+LIBDRM_CFLAGS
DRI3_FALSE
DRI3_TRUE
XSHMFENCE_FALSE
@@ -1014,8 +1014,6 @@ NEED_DBUS_TRUE
SUID_WRAPPER_FALSE
SUID_WRAPPER_TRUE
SUID_WRAPPER_DIR
-LIBDRM_LIBS
-LIBDRM_CFLAGS
SYSTEMD_LOGIND_FALSE
SYSTEMD_LOGIND_TRUE
CONFIG_HAL_FALSE
@@ -1039,8 +1037,6 @@ SYSTEMD_DAEMON_CFLAGS
SDK_REQUIRED_MODULES
PIXMAN_LIBS
PIXMAN_CFLAGS
-INSTALL_LIBXF86CONFIG_FALSE
-INSTALL_LIBXF86CONFIG_TRUE
INT10_STUB_FALSE
INT10_STUB_TRUE
INT10_X86EMU_FALSE
@@ -1053,7 +1049,6 @@ INSTALL_SETUID_FALSE
INSTALL_SETUID_TRUE
X_PRIVSEP_FALSE
X_PRIVSEP_TRUE
-GLX_TLS
XQUARTZ_SPARKLE
BUNDLE_ID_PREFIX
APPLE_APPLICATION_NAME
@@ -1341,10 +1336,8 @@ with_apple_application_name
with_launchd_id_prefix
with_bundle_id_prefix
enable_sparkle
-enable_install_libxf86config
enable_visibility
enable_aiglx
-enable_glx_tls
with_khronos_spec_dir
enable_privsep
enable_composite
@@ -1449,14 +1442,14 @@ DBUS_CFLAGS
DBUS_LIBS
HAL_CFLAGS
HAL_LIBS
-LIBDRM_CFLAGS
-LIBDRM_LIBS
DRI2PROTO_CFLAGS
DRI2PROTO_LIBS
DRI3PROTO_CFLAGS
DRI3PROTO_LIBS
XSHMFENCE_CFLAGS
XSHMFENCE_LIBS
+LIBDRM_CFLAGS
+LIBDRM_LIBS
XLIB_CFLAGS
XLIB_LIBS
GL_CFLAGS
@@ -1481,8 +1474,6 @@ PCIACCESS_CFLAGS
PCIACCESS_LIBS
DGA_CFLAGS
DGA_LIBS
-XF86VIDMODE_CFLAGS
-XF86VIDMODE_LIBS
XORG_MODULES_CFLAGS
XORG_MODULES_LIBS
GLAMOR_CFLAGS
@@ -2059,7 +2050,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.17.4 to adapt to many kinds of systems.
+\`configure' configures xorg-server 1.18.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -2129,7 +2120,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xorg-server 1.17.4:";;
+ short | recursive ) echo "Configuration of xorg-server 1.18.3:";;
esac
cat <<\_ACEOF
@@ -2169,11 +2160,8 @@ Optional Features:
--disable-listen-local Listen on local by default (default:enabled)
--enable-sparkle Enable updating of X11.app using the Sparkle
Framework (default: disabled)
- --enable-install-libxf86config
- Install libxf86config (default: disabled)
--enable-visibility Enable symbol visibility (default: auto)
--enable-aiglx Build accelerated indirect GLX (default: enabled)
- --enable-glx-tls Build GLX with TLS support (default: auto)
--enable-privsep Build support for X server privilege separation
(default is NO)
--disable-composite Build Composite extension (default: enabled)
@@ -2383,9 +2371,6 @@ Some influential environment variables:
DBUS_LIBS linker flags for DBUS, overriding pkg-config
HAL_CFLAGS C compiler flags for HAL, overriding pkg-config
HAL_LIBS linker flags for HAL, overriding pkg-config
- LIBDRM_CFLAGS
- C compiler flags for LIBDRM, overriding pkg-config
- LIBDRM_LIBS linker flags for LIBDRM, overriding pkg-config
DRI2PROTO_CFLAGS
C compiler flags for DRI2PROTO, overriding pkg-config
DRI2PROTO_LIBS
@@ -2398,6 +2383,9 @@ Some influential environment variables:
C compiler flags for XSHMFENCE, overriding pkg-config
XSHMFENCE_LIBS
linker flags for XSHMFENCE, overriding pkg-config
+ LIBDRM_CFLAGS
+ C compiler flags for LIBDRM, overriding pkg-config
+ LIBDRM_LIBS linker flags for LIBDRM, overriding pkg-config
XLIB_CFLAGS C compiler flags for XLIB, overriding pkg-config
XLIB_LIBS linker flags for XLIB, overriding pkg-config
GL_CFLAGS C compiler flags for GL, overriding pkg-config
@@ -2439,10 +2427,6 @@ Some influential environment variables:
linker flags for PCIACCESS, overriding pkg-config
DGA_CFLAGS C compiler flags for DGA, overriding pkg-config
DGA_LIBS linker flags for DGA, overriding pkg-config
- XF86VIDMODE_CFLAGS
- C compiler flags for XF86VIDMODE, overriding pkg-config
- XF86VIDMODE_LIBS
- linker flags for XF86VIDMODE, overriding pkg-config
XORG_MODULES_CFLAGS
C compiler flags for XORG_MODULES, overriding pkg-config
XORG_MODULES_LIBS
@@ -2578,7 +2562,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-xorg-server configure 1.17.4
+xorg-server configure 1.18.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -3287,7 +3271,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.17.4, which was
+It was created by xorg-server $as_me 1.18.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3635,8 +3619,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-RELEASE_DATE="2015-10-28"
-RELEASE_NAME="Cider Donut"
+RELEASE_DATE="2016-04-04"
+RELEASE_NAME="Halloumi"
am__api_version='1.12'
@@ -4115,7 +4099,7 @@ fi
# Define the identity of the package.
PACKAGE='xorg-server'
- VERSION='1.17.4'
+ VERSION='1.18.3'
cat >>confdefs.h <<_ACEOF
@@ -21998,7 +21982,8 @@ fi
for ac_func in backtrace ffs geteuid getuid issetugid getresuid \
getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
- mmap seteuid shmctl64 strncasecmp vasprintf vsnprintf walkcontext
+ mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
+ walkcontext
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"
@@ -22010,6 +21995,19 @@ _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
+
+else
+ case " $LIBOBJS " in
+ *" reallocarray.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS reallocarray.$ac_objext"
+ ;;
+esac
+
+fi
+
ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
if test "x$ac_cv_func_strcasecmp" = xyes; then :
$as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h
@@ -22090,6 +22088,39 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SO_PEERCRED in sys/socket.h" >&5
+$as_echo_n "checking for SO_PEERCRED in sys/socket.h... " >&6; }
+if ${xorg_cv_sys_have_so_peercred+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#ifdef SO_PEERCRED
+yes_have_so_peercred
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes_have_so_peercred" >/dev/null 2>&1; then :
+ xorg_cv_sys_have_so_peercred=yes
+else
+ xorg_cv_sys_have_so_peercred=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_sys_have_so_peercred" >&5
+$as_echo "$xorg_cv_sys_have_so_peercred" >&6; }
+
+if test "x$ac_cv_func_getpeereid" = xno && test "x$ac_cv_func_getpeerucred" = xno && test "x$xorg_cv_sys_have_so_peercred" = xno ; then
+
+$as_echo "#define NO_LOCAL_CLIENT_CRED 1" >>confdefs.h
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
$as_echo_n "checking for sqrt in -lm... " >&6; }
if ${ac_cv_lib_m_sqrt+:} false; then :
@@ -22605,7 +22636,7 @@ $as_echo "#define CSRG_BASED 1" >>confdefs.h
;;
cygwin*|mingw*)
- CFLAGS="$CFLAGS -DFD_SETSIZE=256"
+ CFLAGS="$CFLAGS -DFD_SETSIZE=512"
;;
esac
@@ -22991,13 +23022,6 @@ else
fi
-# Check whether --enable-install-libxf86config was given.
-if test "${enable_install_libxf86config+set}" = set; then :
- enableval=$enable_install_libxf86config; INSTALL_LIBXF86CONFIG=$enableval
-else
- INSTALL_LIBXF86CONFIG=no
-fi
-
# Check whether --enable-visibility was given.
if test "${enable_visibility+set}" = set; then :
enableval=$enable_visibility; SYMBOL_VISIBILITY=$enableval
@@ -23015,99 +23039,6 @@ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread local storage (TLS) support" >&5
-$as_echo_n "checking for thread local storage (TLS) support... " >&6; }
- if ${ac_cv_tls+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- ac_cv_tls=none
- keywords="__thread __declspec(thread)"
- for kw in $keywords ; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int $kw test;
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_tls=$kw ; break ;
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5
-$as_echo "$ac_cv_tls" >&6; }
-
- if test "$ac_cv_tls" != "none"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tls_model attribute support" >&5
-$as_echo_n "checking for tls_model attribute support... " >&6; }
- if ${ac_cv_tls_model+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $STRICT_CFLAGS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int $ac_cv_tls __attribute__((tls_model("initial-exec"))) test;
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_tls_model=yes
-else
- ac_cv_tls_model=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
-
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls_model" >&5
-$as_echo "$ac_cv_tls_model" >&6; }
-
- if test "x$ac_cv_tls_model" = "xyes" ; then
- xorg_tls=$ac_cv_tls' __attribute__((tls_model("initial-exec")))'
- else
- xorg_tls=$ac_cv_tls
- fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define TLS $xorg_tls
-_ACEOF
-
- fi
-
-# Check whether --enable-glx-tls was given.
-if test "${enable_glx_tls+set}" = set; then :
- enableval=$enable_glx_tls; GLX_USE_TLS=$enableval
- if test "x$GLX_USE_TLS" = "xyes" && test "${ac_cv_tls}" = "none" ; then
- as_fn_error $? "GLX with TLS support requested, but the compiler does not support it." "$LINENO" 5
- fi
-else
- GLX_USE_TLS=no
- if test "${ac_cv_tls}" != "none" ; then
- GLX_USE_TLS=yes
- fi
-fi
-
-GLX_TLS=${GLX_USE_TLS}
-
-
# Check whether --with-khronos-spec-dir was given.
if test "${with_khronos_spec_dir+set}" = set; then :
withval=$with_khronos_spec_dir; KHRONOS_SPEC_DIR="${withval}"
@@ -24039,15 +23970,6 @@ else
fi
- if test "x$INSTALL_LIBXF86CONFIG" = xyes; then
- INSTALL_LIBXF86CONFIG_TRUE=
- INSTALL_LIBXF86CONFIG_FALSE='#'
-else
- INSTALL_LIBXF86CONFIG_TRUE='#'
- INSTALL_LIBXF86CONFIG_FALSE=
-fi
-
-
case $host_os in
cygwin* | mingw*)
CONFIG_HAL=no
@@ -24128,6 +24050,11 @@ fi
XF86VIDMODE=no
fi
;;
+ gnu*)
+ DRM=no
+ DRI2=no
+ DRI3=no
+ ;;
*) XQUARTZ=no ;;
esac
@@ -24152,8 +24079,8 @@ WINDOWSWMPROTO="windowswmproto"
APPLEWMPROTO="applewmproto >= 1.4"
LIBXSHMFENCE="xshmfence >= 1.1"
-XPROTO="xproto >= 7.0.26"
-RANDRPROTO="randrproto >= 1.4.0"
+XPROTO="xproto >= 7.0.28"
+RANDRPROTO="randrproto >= 1.5.0"
RENDERPROTO="renderproto >= 0.11"
XEXTPROTO="xextproto >= 7.2.99.901"
INPUTPROTO="inputproto >= 2.3"
@@ -24282,6 +24209,7 @@ SDK_REQUIRED_MODULES="$XPROTO $RANDRPROTO $RENDERPROTO $XEXTPROTO $INPUTPROTO $K
REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $SDK_REQUIRED_MODULES"
+LIBSYSTEMD="libsystemd >= 209"
# Check whether --with-systemd-daemon was given.
if test "${with_systemd_daemon+set}" = set; then :
@@ -24290,6 +24218,66 @@ else
WITH_SYSTEMD_DAEMON=auto
fi
+if test "x$WITH_SYSTEMD_DAEMON" = "xyes" -o "x$WITH_SYSTEMD_DAEMON" = "xauto" ; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_DAEMON" >&5
+$as_echo_n "checking for SYSTEMD_DAEMON... " >&6; }
+
+if test -n "$SYSTEMD_DAEMON_CFLAGS"; then
+ pkg_cv_SYSTEMD_DAEMON_CFLAGS="$SYSTEMD_DAEMON_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBSYSTEMD\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$LIBSYSTEMD") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_DAEMON_CFLAGS=`$PKG_CONFIG --cflags "$LIBSYSTEMD" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$SYSTEMD_DAEMON_LIBS"; then
+ pkg_cv_SYSTEMD_DAEMON_LIBS="$SYSTEMD_DAEMON_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBSYSTEMD\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$LIBSYSTEMD") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_DAEMON_LIBS=`$PKG_CONFIG --libs "$LIBSYSTEMD" 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
+ SYSTEMD_DAEMON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBSYSTEMD" 2>&1`
+ else
+ SYSTEMD_DAEMON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBSYSTEMD" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$SYSTEMD_DAEMON_PKG_ERRORS" >&5
+
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_DAEMON" >&5
@@ -24359,19 +24347,100 @@ else
SYSTEMD_DAEMON_LIBS=$pkg_cv_SYSTEMD_DAEMON_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- HAVE_SYSTEMD_DAEMON=yes
+ HAVE_SYSTEMD_DAEMON=yes;
+ LIBSYSTEMD_DAEMON=libsystemd-daemon
+fi
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_DAEMON" >&5
+$as_echo_n "checking for SYSTEMD_DAEMON... " >&6; }
+
+if test -n "$SYSTEMD_DAEMON_CFLAGS"; then
+ pkg_cv_SYSTEMD_DAEMON_CFLAGS="$SYSTEMD_DAEMON_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-daemon\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsystemd-daemon") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_DAEMON_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-daemon" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
fi
-if test "x$WITH_SYSTEMD_DAEMON" = xauto; then
- WITH_SYSTEMD_DAEMON="$HAVE_SYSTEMD_DAEMON"
+ else
+ pkg_failed=untried
fi
-if test "x$WITH_SYSTEMD_DAEMON" = xyes; then
- if test "x$HAVE_SYSTEMD_DAEMON" = xno; then
- as_fn_error $? "systemd support requested but no library has been found" "$LINENO" 5
- fi
+if test -n "$SYSTEMD_DAEMON_LIBS"; then
+ pkg_cv_SYSTEMD_DAEMON_LIBS="$SYSTEMD_DAEMON_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-daemon\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsystemd-daemon") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_DAEMON_LIBS=`$PKG_CONFIG --libs "libsystemd-daemon" 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
+ SYSTEMD_DAEMON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-daemon" 2>&1`
+ else
+ SYSTEMD_DAEMON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-daemon" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$SYSTEMD_DAEMON_PKG_ERRORS" >&5
+
+ HAVE_SYSTEMD_DAEMON=no
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ HAVE_SYSTEMD_DAEMON=no
+else
+ SYSTEMD_DAEMON_CFLAGS=$pkg_cv_SYSTEMD_DAEMON_CFLAGS
+ SYSTEMD_DAEMON_LIBS=$pkg_cv_SYSTEMD_DAEMON_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ HAVE_SYSTEMD_DAEMON=yes;
+ LIBSYSTEMD_DAEMON=libsystemd-daemon
+fi
+else
+ SYSTEMD_DAEMON_CFLAGS=$pkg_cv_SYSTEMD_DAEMON_CFLAGS
+ SYSTEMD_DAEMON_LIBS=$pkg_cv_SYSTEMD_DAEMON_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ HAVE_SYSTEMD_DAEMON=yes;
+ LIBSYSTEMD_DAEMON="$LIBSYSTEMD"
+fi
+ if test "x$HAVE_SYSTEMD_DAEMON" = xyes; then
$as_echo "#define HAVE_SYSTEMD_DAEMON 1" >>confdefs.h
- REQUIRED_LIBS="$REQUIRED_LIBS libsystemd-daemon"
+ REQUIRED_LIBS="$REQUIRED_LIBS $LIBSYSTEMD_DAEMON"
+ elif test "x$WITH_SYSTEMD_DAEMON" = xyes; then
+ as_fn_error $? "systemd support requested but no library has been found" "$LINENO" 5
+ fi
fi
if test "x$HAVE_SYSTEMD_DAEMON" = "xyes"; then
HAVE_SYSTEMD_DAEMON_TRUE=
@@ -24734,97 +24803,6 @@ fi
if test "x$SUID_WRAPPER" = xyes; then
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBDRM" >&5
-$as_echo_n "checking for LIBDRM... " >&6; }
-
-if test -n "$LIBDRM_CFLAGS"; then
- pkg_cv_LIBDRM_CFLAGS="$LIBDRM_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- 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
- pkg_cv_LIBDRM_CFLAGS=`$PKG_CONFIG --cflags "$LIBDRM" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$LIBDRM_LIBS"; then
- pkg_cv_LIBDRM_LIBS="$LIBDRM_LIBS"
- elif test -n "$PKG_CONFIG"; then
- 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
- pkg_cv_LIBDRM_LIBS=`$PKG_CONFIG --libs "$LIBDRM" 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
- LIBDRM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBDRM" 2>&1`
- else
- LIBDRM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBDRM" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$LIBDRM_PKG_ERRORS" >&5
-
- as_fn_error $? "Package requirements ($LIBDRM) were not met:
-
-$LIBDRM_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 LIBDRM_CFLAGS
-and LIBDRM_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 LIBDRM_CFLAGS
-and LIBDRM_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
- LIBDRM_CFLAGS=$pkg_cv_LIBDRM_CFLAGS
- LIBDRM_LIBS=$pkg_cv_LIBDRM_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-fi
-
prefix_NONE=
exec_prefix_NONE=
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
@@ -26023,10 +26001,6 @@ else
fi
-if test "x$GLX_USE_TLS" = xyes ; then
- GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS"
- GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread"
-fi
@@ -26673,6 +26647,32 @@ $as_echo "#define HASXDMAUTH 1" >>confdefs.h
fi
fi
+if test "x$XF86VIDMODE" = xauto; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$VIDMODEPROTO\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$VIDMODEPROTO") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ XF86VIDMODE=yes
+else
+ XF86VIDMODE=no
+fi
+fi
+if test "x$XF86VIDMODE" = xyes; then
+
+$as_echo "#define XF86VIDMODE 1" >>confdefs.h
+
+fi
+ if test "x$XF86VIDMODE" = xyes; then
+ XF86VIDMODE_TRUE=
+ XF86VIDMODE_FALSE='#'
+else
+ XF86VIDMODE_TRUE='#'
+ XF86VIDMODE_FALSE=
+fi
+
+
prefix_NONE=
exec_prefix_NONE=
@@ -26810,10 +26810,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-
-$as_echo "#define NO_LIBCWRAPPER 1" >>confdefs.h
-
-
if test "x$DEBUGGING" = xyes; then
$as_echo "#define DEBUG 1" >>confdefs.h
@@ -27651,7 +27647,7 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
extern int main(int argc, char **argv);
- int call_main(void) { return main(0, NULL); }
+ int call_main(void) { return main(0, (void *)0); }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
xorg_cv_linker_flags__Wl__z_parent_conftest_parent__G=yes
@@ -28386,175 +28382,8 @@ $as_echo "#define XFreeXDGA 1" >>confdefs.h
fi
- if test "x$XF86VIDMODE" = xauto; then
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XF86VIDMODE" >&5
-$as_echo_n "checking for XF86VIDMODE... " >&6; }
-
-if test -n "$XF86VIDMODE_CFLAGS"; then
- pkg_cv_XF86VIDMODE_CFLAGS="$XF86VIDMODE_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$VIDMODEPROTO\""; } >&5
- ($PKG_CONFIG --exists --print-errors "$VIDMODEPROTO") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_XF86VIDMODE_CFLAGS=`$PKG_CONFIG --cflags "$VIDMODEPROTO" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$XF86VIDMODE_LIBS"; then
- pkg_cv_XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$VIDMODEPROTO\""; } >&5
- ($PKG_CONFIG --exists --print-errors "$VIDMODEPROTO") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_XF86VIDMODE_LIBS=`$PKG_CONFIG --libs "$VIDMODEPROTO" 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
- XF86VIDMODE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$VIDMODEPROTO" 2>&1`
- else
- XF86VIDMODE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$VIDMODEPROTO" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$XF86VIDMODE_PKG_ERRORS" >&5
-
- XF86VIDMODE=no
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- XF86VIDMODE=no
-else
- XF86VIDMODE_CFLAGS=$pkg_cv_XF86VIDMODE_CFLAGS
- XF86VIDMODE_LIBS=$pkg_cv_XF86VIDMODE_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- XF86VIDMODE=yes
-fi
- fi
if test "x$XF86VIDMODE" = xyes; then
XORG_MODULES="$XORG_MODULES $VIDMODEPROTO"
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XF86VIDMODE" >&5
-$as_echo_n "checking for XF86VIDMODE... " >&6; }
-
-if test -n "$XF86VIDMODE_CFLAGS"; then
- pkg_cv_XF86VIDMODE_CFLAGS="$XF86VIDMODE_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$VIDMODEPROTO\""; } >&5
- ($PKG_CONFIG --exists --print-errors "$VIDMODEPROTO") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_XF86VIDMODE_CFLAGS=`$PKG_CONFIG --cflags "$VIDMODEPROTO" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$XF86VIDMODE_LIBS"; then
- pkg_cv_XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$VIDMODEPROTO\""; } >&5
- ($PKG_CONFIG --exists --print-errors "$VIDMODEPROTO") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_XF86VIDMODE_LIBS=`$PKG_CONFIG --libs "$VIDMODEPROTO" 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
- XF86VIDMODE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$VIDMODEPROTO" 2>&1`
- else
- XF86VIDMODE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$VIDMODEPROTO" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$XF86VIDMODE_PKG_ERRORS" >&5
-
- as_fn_error $? "Package requirements ($VIDMODEPROTO) were not met:
-
-$XF86VIDMODE_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 XF86VIDMODE_CFLAGS
-and XF86VIDMODE_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 XF86VIDMODE_CFLAGS
-and XF86VIDMODE_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
- XF86VIDMODE_CFLAGS=$pkg_cv_XF86VIDMODE_CFLAGS
- XF86VIDMODE_LIBS=$pkg_cv_XF86VIDMODE_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-fi
-
-$as_echo "#define XF86VIDMODE 1" >>confdefs.h
-
fi
if test -n "$XORG_MODULES"; then
@@ -28660,9 +28489,10 @@ fi
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- :
+ XORG_DRIVER_MODESETTING=yes
+else
+ XORG_DRIVER_MODESETTING=no
fi
- XORG_DRIVER_MODESETTING=yes
fi
@@ -28961,14 +28791,6 @@ else
DGA_FALSE=
fi
- if test "x$XF86VIDMODE" = xyes; then
- XF86VIDMODE_TRUE=
- XF86VIDMODE_FALSE='#'
-else
- XF86VIDMODE_TRUE='#'
- XF86VIDMODE_FALSE=
-fi
-
if test "x$CONFIG_UDEV_KMS" = xyes; then
XORG_BUS_PLATFORM_TRUE=
XORG_BUS_PLATFORM_FALSE='#'
@@ -29165,6 +28987,15 @@ fi
$as_echo "#define GLAMOR_HAS_GBM 1" >>confdefs.h
+ ac_fn_c_check_decl "$LINENO" "GBM_BO_USE_LINEAR" "ac_cv_have_decl_GBM_BO_USE_LINEAR" "#include <stdlib.h>
+ #include <gbm.h>
+"
+if test "x$ac_cv_have_decl_GBM_BO_USE_LINEAR" = xyes; then :
+
+$as_echo "#define GLAMOR_HAS_GBM_LINEAR 1" >>confdefs.h
+
+fi
+
fi
fi
@@ -30260,7 +30091,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 $CONFIG_LIB $OS_LIB $FIXES_LIB"
+ 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_SYS_LIBS="$DMXMODULES_LIBS"
@@ -31031,6 +30862,33 @@ $as_echo "#define TSLIB 1" >>confdefs.h
fi
fi
+ case $host_os in
+ *linux*)
+ KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la'
+ KDRIVELINUX=yes
+ if test "x$KDRIVE_EVDEV" = xauto; then
+ KDRIVE_EVDEV=yes
+ fi
+ if test "x$KDRIVE_KBD" = xauto; then
+ KDRIVE_KBD=yes
+ fi
+ if test "x$KDRIVE_MOUSE" = xauto; then
+ KDRIVE_MOUSE=yes
+ fi
+ ;;
+ *)
+ if test "x$KDRIVE_EVDEV" = xauto; then
+ KDRIVE_EVDEV=no
+ fi
+ if test "x$KDRIVE_KBD" = xauto; then
+ KDRIVE_KBD=no
+ fi
+ if test "x$KDRIVE_MOUSE" = xauto; then
+ KDRIVE_MOUSE=no
+ fi
+ ;;
+ esac
+
if test "x$KDRIVE_KBD" = xyes; then
$as_echo "#define KDRIVE_KBD 1" >>confdefs.h
@@ -31282,32 +31140,6 @@ fi
KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_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 $OS_LIB"
KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la'
- case $host_os in
- *linux*)
- KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la'
- KDRIVELINUX=yes
- if test "x$KDRIVE_EVDEV" = xauto; then
- KDRIVE_EVDEV=yes
- fi
- if test "x$KDRIVE_KBD" = xauto; then
- KDRIVE_KBD=yes
- fi
- if test "x$KDRIVE_MOUSE" = xauto; then
- KDRIVE_MOUSE=yes
- fi
- ;;
- *)
- if test "x$KDRIVE_EVDEV" = xauto; then
- KDRIVE_EVDEV=no
- fi
- if test "x$KDRIVE_KBD" = xauto; then
- KDRIVE_KBD=no
- fi
- if test "x$KDRIVE_MOUSE" = xauto; then
- KDRIVE_MOUSE=no
- fi
- ;;
- esac
KDRIVE_MAIN_LIB="$MAIN_LIB"
KDRIVE_LOCAL_LIBS="$DIX_LIB $KDRIVE_LIB"
KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS"
@@ -31398,6 +31230,10 @@ fi
+XWAYLANDMODULES="wayland-client >= 1.3.0 libdrm epoxy"
+if test "x$XF86VIDMODE" = xyes; then
+ XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO"
+fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XWAYLANDMODULES" >&5
@@ -31407,12 +31243,12 @@ if test -n "$XWAYLANDMODULES_CFLAGS"; then
pkg_cv_XWAYLANDMODULES_CFLAGS="$XWAYLANDMODULES_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.3.0 libdrm epoxy\""; } >&5
- ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.3.0 libdrm epoxy") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$XWAYLANDMODULES\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$XWAYLANDMODULES") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_XWAYLANDMODULES_CFLAGS=`$PKG_CONFIG --cflags "wayland-client >= 1.3.0 libdrm epoxy" 2>/dev/null`
+ pkg_cv_XWAYLANDMODULES_CFLAGS=`$PKG_CONFIG --cflags "$XWAYLANDMODULES" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -31424,12 +31260,12 @@ if test -n "$XWAYLANDMODULES_LIBS"; then
pkg_cv_XWAYLANDMODULES_LIBS="$XWAYLANDMODULES_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.3.0 libdrm epoxy\""; } >&5
- ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.3.0 libdrm epoxy") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$XWAYLANDMODULES\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$XWAYLANDMODULES") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_XWAYLANDMODULES_LIBS=`$PKG_CONFIG --libs "wayland-client >= 1.3.0 libdrm epoxy" 2>/dev/null`
+ pkg_cv_XWAYLANDMODULES_LIBS=`$PKG_CONFIG --libs "$XWAYLANDMODULES" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -31450,9 +31286,9 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- XWAYLANDMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client >= 1.3.0 libdrm epoxy" 2>&1`
+ XWAYLANDMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$XWAYLANDMODULES" 2>&1`
else
- XWAYLANDMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client >= 1.3.0 libdrm epoxy" 2>&1`
+ XWAYLANDMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$XWAYLANDMODULES" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$XWAYLANDMODULES_PKG_ERRORS" >&5
@@ -31900,10 +31736,6 @@ if test -z "${INT10_STUB_TRUE}" && test -z "${INT10_STUB_FALSE}"; then
as_fn_error $? "conditional \"INT10_STUB\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${INSTALL_LIBXF86CONFIG_TRUE}" && test -z "${INSTALL_LIBXF86CONFIG_FALSE}"; then
- as_fn_error $? "conditional \"INSTALL_LIBXF86CONFIG\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${HAVE_SYSTEMD_DAEMON_TRUE}" && test -z "${HAVE_SYSTEMD_DAEMON_FALSE}"; then
as_fn_error $? "conditional \"HAVE_SYSTEMD_DAEMON\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -32060,6 +31892,10 @@ if test -z "${XDMAUTH_TRUE}" && test -z "${XDMAUTH_FALSE}"; then
as_fn_error $? "conditional \"XDMAUTH\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${XF86VIDMODE_TRUE}" && test -z "${XF86VIDMODE_FALSE}"; then
+ as_fn_error $? "conditional \"XF86VIDMODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then
as_fn_error $? "conditional \"DEBUG\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -32120,10 +31956,6 @@ if test -z "${DGA_TRUE}" && test -z "${DGA_FALSE}"; then
as_fn_error $? "conditional \"DGA\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${XF86VIDMODE_TRUE}" && test -z "${XF86VIDMODE_FALSE}"; then
- as_fn_error $? "conditional \"XF86VIDMODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${XORG_BUS_PLATFORM_TRUE}" && test -z "${XORG_BUS_PLATFORM_FALSE}"; then
as_fn_error $? "conditional \"XORG_BUS_PLATFORM\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -32641,7 +32473,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.17.4, which was
+This file was extended by xorg-server $as_me 1.18.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -32707,7 +32539,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.17.4
+xorg-server config.status 1.18.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/xserver/configure.ac b/xserver/configure.ac
index fbe573cfc..8ee818580 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.17.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2015-10-28"
-RELEASE_NAME="Cider Donut"
+AC_INIT([xorg-server], 1.18.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2016-04-04"
+RELEASE_NAME="Halloumi"
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -218,11 +218,30 @@ AC_SUBST(DLOPEN_LIBS)
dnl Checks for library functions.
AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \
getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
- mmap seteuid shmctl64 strncasecmp vasprintf vsnprintf walkcontext])
-AC_REPLACE_FUNCS([strcasecmp strcasestr strlcat strlcpy strndup])
+ mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
+ walkcontext])
+AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup])
AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include <errno.h>]])
+dnl Check for SO_PEERCRED #define
+AC_CACHE_CHECK([for SO_PEERCRED in sys/socket.h],
+ [xorg_cv_sys_have_so_peercred],
+ [AC_EGREP_CPP(yes_have_so_peercred,[
+#include <sys/types.h>
+#include <sys/socket.h>
+#ifdef SO_PEERCRED
+yes_have_so_peercred
+#endif
+],
+ [xorg_cv_sys_have_so_peercred=yes],
+ [xorg_cv_sys_have_so_peercred=no])])
+
+dnl define NO_LOCAL_CLIENT_CRED if no getpeereid, getpeerucred or SO_PEERCRED
+if test "x$ac_cv_func_getpeereid" = xno && test "x$ac_cv_func_getpeerucred" = xno && test "x$xorg_cv_sys_have_so_peercred" = xno ; then
+ AC_DEFINE([NO_LOCAL_CLIENT_CRED], 1, [Define to 1 if no local socket credentials interface exists])
+fi
+
dnl Find the math libary, then check for cbrt function in it.
AC_CHECK_LIB(m, sqrt)
AC_CHECK_FUNCS([cbrt])
@@ -426,7 +445,7 @@ case $host_os in
AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
;;
cygwin*|mingw*)
- CFLAGS="$CFLAGS -DFD_SETSIZE=256"
+ CFLAGS="$CFLAGS -DFD_SETSIZE=512"
;;
esac
@@ -573,11 +592,6 @@ AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11
[ XQUARTZ_SPARKLE="${enableval}" ],
[ XQUARTZ_SPARKLE="no" ])
AC_SUBST([XQUARTZ_SPARKLE])
-AC_ARG_ENABLE(install-libxf86config,
- AS_HELP_STRING([--enable-install-libxf86config],
- [Install libxf86config (default: disabled)]),
- [INSTALL_LIBXF86CONFIG=$enableval],
- [INSTALL_LIBXF86CONFIG=no])
AC_ARG_ENABLE(visibility, AS_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]),
[SYMBOL_VISIBILITY=$enableval],
[SYMBOL_VISIBILITY=auto])
@@ -586,17 +600,7 @@ dnl GLX build options
AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]),
[AIGLX=$enableval],
[AIGLX=yes])
-XORG_TLS
-AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]),
- [GLX_USE_TLS=$enableval
- if test "x$GLX_USE_TLS" = "xyes" && test "${ac_cv_tls}" = "none" ; then
- AC_MSG_ERROR([GLX with TLS support requested, but the compiler does not support it.])
- fi],
- [GLX_USE_TLS=no
- if test "${ac_cv_tls}" != "none" ; then
- GLX_USE_TLS=yes
- fi])
-AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
+
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])
@@ -723,9 +727,6 @@ AM_CONDITIONAL(INT10_VM86, [test "x$INT10" = xvm86])
AM_CONDITIONAL(INT10_X86EMU, [test "x$INT10" = xx86emu])
AM_CONDITIONAL(INT10_STUB, [test "x$INT10" = xstub])
-dnl Handle installing libxf86config
-AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes])
-
dnl DDX Detection... Yes, it's ugly to have it here... but we need to
dnl handle this early on so that we don't require unsupported extensions
case $host_os in
@@ -788,6 +789,11 @@ case $host_os in
XF86VIDMODE=no
fi
;;
+ gnu*)
+ DRM=no
+ DRI2=no
+ DRI3=no
+ ;;
*) XQUARTZ=no ;;
esac
@@ -817,8 +823,8 @@ APPLEWMPROTO="applewmproto >= 1.4"
LIBXSHMFENCE="xshmfence >= 1.1"
dnl Required modules
-XPROTO="xproto >= 7.0.26"
-RANDRPROTO="randrproto >= 1.4.0"
+XPROTO="xproto >= 7.0.28"
+RANDRPROTO="randrproto >= 1.5.0"
RENDERPROTO="renderproto >= 0.11"
XEXTPROTO="xextproto >= 7.2.99.901"
INPUTPROTO="inputproto >= 2.3"
@@ -863,21 +869,26 @@ REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $S
dnl systemd socket activation
dnl activate the code in libxtrans that grabs systemd's socket fds
+dnl libsystemd-daemon was moved into libsystemd in version 209
+LIBSYSTEMD="libsystemd >= 209"
AC_ARG_WITH([systemd-daemon],
AS_HELP_STRING([--with-systemd-daemon],
[support systemd socket activation (default: auto)]),
[WITH_SYSTEMD_DAEMON=$withval], [WITH_SYSTEMD_DAEMON=auto])
-PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
- [HAVE_SYSTEMD_DAEMON=yes], [HAVE_SYSTEMD_DAEMON=no])
-if test "x$WITH_SYSTEMD_DAEMON" = xauto; then
- WITH_SYSTEMD_DAEMON="$HAVE_SYSTEMD_DAEMON"
-fi
-if test "x$WITH_SYSTEMD_DAEMON" = xyes; then
- if test "x$HAVE_SYSTEMD_DAEMON" = xno; then
+if test "x$WITH_SYSTEMD_DAEMON" = "xyes" -o "x$WITH_SYSTEMD_DAEMON" = "xauto" ; then
+ PKG_CHECK_MODULES([SYSTEMD_DAEMON], [$LIBSYSTEMD],
+ [HAVE_SYSTEMD_DAEMON=yes;
+ LIBSYSTEMD_DAEMON="$LIBSYSTEMD"],
+ [PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
+ [HAVE_SYSTEMD_DAEMON=yes;
+ LIBSYSTEMD_DAEMON=libsystemd-daemon],
+ [HAVE_SYSTEMD_DAEMON=no])])
+ if test "x$HAVE_SYSTEMD_DAEMON" = xyes; then
+ AC_DEFINE(HAVE_SYSTEMD_DAEMON, 1, [Define to 1 if libsystemd-daemon is available])
+ REQUIRED_LIBS="$REQUIRED_LIBS $LIBSYSTEMD_DAEMON"
+ elif test "x$WITH_SYSTEMD_DAEMON" = xyes; then
AC_MSG_ERROR([systemd support requested but no library has been found])
fi
- AC_DEFINE(HAVE_SYSTEMD_DAEMON, 1, [Define to 1 if libsystemd-daemon is available])
- REQUIRED_LIBS="$REQUIRED_LIBS libsystemd-daemon"
fi
AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = "xyes"])
@@ -955,8 +966,6 @@ fi
AM_CONDITIONAL(SYSTEMD_LOGIND, [test "x$SYSTEMD_LOGIND" = xyes])
if test "x$SUID_WRAPPER" = xyes; then
- dnl The wrapper uses libdrm headers, so ensure they are available
- PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
dnl This is a define so that if some platforms want to put the wrapper
dnl somewhere else this can be easily changed
AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install the Xorg binary and Xorg.wrap])
@@ -1360,10 +1369,6 @@ if test "x$AIGLX" = xyes -a \( "x$DRI2" = xyes \); then
fi
AM_CONDITIONAL(AIGLX_DRI_LOADER, { test "x$DRI2" = xyes; } && test "x$AIGLX" = xyes)
-if test "x$GLX_USE_TLS" = xyes ; then
- GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS"
- GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread"
-fi
AC_SUBST([GLX_DEFINES])
AC_SUBST([GLX_SYS_LIBS])
@@ -1550,6 +1555,14 @@ if test "x$XDMAUTH" = xyes; then
fi
fi
+if test "x$XF86VIDMODE" = xauto; then
+ PKG_CHECK_EXISTS($VIDMODEPROTO, [XF86VIDMODE=yes], [XF86VIDMODE=no])
+fi
+if test "x$XF86VIDMODE" = xyes; then
+ AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension])
+fi
+AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
+
AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path])
AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path])
@@ -1575,8 +1588,6 @@ AC_DEFINE_UNQUOTED(VENDOR_NAME_SHORT, ["$VENDOR_NAME_SHORT"], [Vendor name])
AC_DEFINE_UNQUOTED(VENDOR_RELEASE, [$VENDOR_RELEASE], [Vendor release])
AC_DEFINE_UNQUOTED(VENDOR_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
-AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper])
-
if test "x$DEBUGGING" = xyes; then
AC_DEFINE(DEBUG, 1, [Enable debugging code])
fi
@@ -1811,7 +1822,7 @@ case "$host_os" in
# XORG_DRIVER_LIBS="-Wl,-z,defs -Wl,-z,parent=${bindir}/Xorg"
],[],
[AC_LANG_SOURCE([extern int main(int argc, char **argv);
- int call_main(void) { return main(0, NULL); }])])
+ int call_main(void) { return main(0, (void *)0); }])])
rm -f conftest.parent
])
;;
@@ -2080,13 +2091,8 @@ if test "x$XORG" = xyes; then
AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
fi
- if test "x$XF86VIDMODE" = xauto; then
- PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO, [XF86VIDMODE=yes], [XF86VIDMODE=no])
- fi
if test "x$XF86VIDMODE" = xyes; then
XORG_MODULES="$XORG_MODULES $VIDMODEPROTO"
- PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO)
- AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension])
fi
if test -n "$XORG_MODULES"; then
@@ -2097,8 +2103,7 @@ if test "x$XORG" = xyes; then
if test "x$DRM" = xyes; then
dnl 2.4.46 is required for cursor hotspot support.
- PKG_CHECK_EXISTS(libdrm >= 2.4.46)
- XORG_DRIVER_MODESETTING=yes
+ PKG_CHECK_EXISTS(libdrm >= 2.4.46, XORG_DRIVER_MODESETTING=yes, XORG_DRIVER_MODESETTING=no)
fi
AC_SUBST([XORG_LIBS])
@@ -2169,7 +2174,6 @@ AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
AM_CONDITIONAL([LNXAPM], [test "x$linux_apm" = xyes])
AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes])
AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
-AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
AM_CONDITIONAL([XORG_BUS_PLATFORM], [test "x$CONFIG_UDEV_KMS" = xyes])
AM_CONDITIONAL([XORG_DRIVER_MODESETTING], [test "x$XORG_DRIVER_MODESETTING" = xyes])
@@ -2183,6 +2187,10 @@ if test "x$GLAMOR" = xyes; then
if test "x$GBM" = xyes; then
AC_DEFINE(GLAMOR_HAS_GBM, 1,
[Build glamor with GBM-based EGL support])
+ AC_CHECK_DECL(GBM_BO_USE_LINEAR,
+ [AC_DEFINE(GLAMOR_HAS_GBM_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], [],
+ [#include <stdlib.h>
+ #include <gbm.h>])
fi
fi
@@ -2342,7 +2350,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 $CONFIG_LIB $OS_LIB $FIXES_LIB"
+ 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_SYS_LIBS="$DMXMODULES_LIBS"
AC_SUBST([XDMX_CFLAGS])
AC_SUBST([XDMX_LIBS])
@@ -2415,6 +2423,33 @@ if test "$KDRIVE" = yes; then
fi
fi
+ case $host_os in
+ *linux*)
+ KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la'
+ KDRIVELINUX=yes
+ if test "x$KDRIVE_EVDEV" = xauto; then
+ KDRIVE_EVDEV=yes
+ fi
+ if test "x$KDRIVE_KBD" = xauto; then
+ KDRIVE_KBD=yes
+ fi
+ if test "x$KDRIVE_MOUSE" = xauto; then
+ KDRIVE_MOUSE=yes
+ fi
+ ;;
+ *)
+ if test "x$KDRIVE_EVDEV" = xauto; then
+ KDRIVE_EVDEV=no
+ fi
+ if test "x$KDRIVE_KBD" = xauto; then
+ KDRIVE_KBD=no
+ fi
+ if test "x$KDRIVE_MOUSE" = xauto; then
+ KDRIVE_MOUSE=no
+ fi
+ ;;
+ esac
+
if test "x$KDRIVE_KBD" = xyes; then
AC_DEFINE(KDRIVE_KBD, 1, [Enable KDrive kbd driver])
fi
@@ -2456,32 +2491,6 @@ if test "$KDRIVE" = yes; then
KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_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 $OS_LIB"
KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la'
- case $host_os in
- *linux*)
- KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la'
- KDRIVELINUX=yes
- if test "x$KDRIVE_EVDEV" = xauto; then
- KDRIVE_EVDEV=yes
- fi
- if test "x$KDRIVE_KBD" = xauto; then
- KDRIVE_KBD=yes
- fi
- if test "x$KDRIVE_MOUSE" = xauto; then
- KDRIVE_MOUSE=yes
- fi
- ;;
- *)
- if test "x$KDRIVE_EVDEV" = xauto; then
- KDRIVE_EVDEV=no
- fi
- if test "x$KDRIVE_KBD" = xauto; then
- KDRIVE_KBD=no
- fi
- if test "x$KDRIVE_MOUSE" = xauto; then
- KDRIVE_MOUSE=no
- fi
- ;;
- esac
KDRIVE_MAIN_LIB="$MAIN_LIB"
KDRIVE_LOCAL_LIBS="$DIX_LIB $KDRIVE_LIB"
KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS"
@@ -2510,7 +2519,11 @@ AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
dnl Xwayland DDX
-PKG_CHECK_MODULES(XWAYLANDMODULES, [wayland-client >= 1.3.0 libdrm epoxy], [have_xwayland=yes], [have_xwayland=no])
+XWAYLANDMODULES="wayland-client >= 1.3.0 libdrm epoxy"
+if test "x$XF86VIDMODE" = xyes; then
+ XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO"
+fi
+PKG_CHECK_MODULES(XWAYLANDMODULES, [$XWAYLANDMODULES], [have_xwayland=yes], [have_xwayland=no])
AC_MSG_CHECKING([whether to build Xwayland DDX])
if test "x$XWAYLAND" = xauto; then
XWAYLAND="$have_xwayland"
diff --git a/xserver/damageext/Makefile.in b/xserver/damageext/Makefile.in
index 37a79fc38..4dd6cdbd1 100644
--- a/xserver/damageext/Makefile.in
+++ b/xserver/damageext/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -215,7 +214,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -345,8 +343,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/dbe/Makefile.in b/xserver/dbe/Makefile.in
index 6d6461f8e..e8357684d 100644
--- a/xserver/dbe/Makefile.in
+++ b/xserver/dbe/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -246,7 +245,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -376,8 +374,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/dbe/dbe.c b/xserver/dbe/dbe.c
index e5d928d7b..23f7e164d 100644
--- a/xserver/dbe/dbe.c
+++ b/xserver/dbe/dbe.c
@@ -287,11 +287,10 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
}
/* malloc/realloc a new array and initialize all elements to 0. */
- pDbeWindowPriv->IDs = (XID *) realloc(pIDs,
- (pDbeWindowPriv->
- maxAvailableIDs +
- DBE_INCR_MAX_IDS) *
- sizeof(XID));
+ pDbeWindowPriv->IDs =
+ reallocarray(pIDs,
+ pDbeWindowPriv->maxAvailableIDs + DBE_INCR_MAX_IDS,
+ sizeof(XID));
if (!pDbeWindowPriv->IDs) {
return BadAlloc;
}
@@ -470,7 +469,7 @@ ProcDbeSwapBuffers(ClientPtr client)
dbeSwapInfo = (xDbeSwapInfo *) &stuff[1];
/* Allocate array to record swap information. */
- swapInfo = (DbeSwapInfoPtr) malloc(nStuff * sizeof(DbeSwapInfoRec));
+ swapInfo = xallocarray(nStuff, sizeof(DbeSwapInfoRec));
if (swapInfo == NULL) {
return BadAlloc;
}
@@ -580,8 +579,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
return BadAlloc;
/* Make sure any specified drawables are valid. */
if (stuff->n != 0) {
- if (!(pDrawables = (DrawablePtr *) malloc(stuff->n *
- sizeof(DrawablePtr)))) {
+ if (!(pDrawables = xallocarray(stuff->n, sizeof(DrawablePtr)))) {
return BadAlloc;
}
diff --git a/xserver/dbe/midbe.c b/xserver/dbe/midbe.c
index 8f759107a..9684d45bd 100644
--- a/xserver/dbe/midbe.c
+++ b/xserver/dbe/midbe.c
@@ -87,7 +87,7 @@ miDbeGetVisualInfo(ScreenPtr pScreen, XdbeScreenVisualInfo * pScrVisInfo)
}
/* Allocate an array of XdbeVisualInfo items. */
- if (!(visInfo = (XdbeVisualInfo *) malloc(count * sizeof(XdbeVisualInfo)))) {
+ if (!(visInfo = xallocarray(count, sizeof(XdbeVisualInfo)))) {
return FALSE; /* memory alloc failure */
}
diff --git a/xserver/dix/Makefile.in b/xserver/dix/Makefile.in
index 9ec551430..efe0937eb 100644
--- a/xserver/dix/Makefile.in
+++ b/xserver/dix/Makefile.in
@@ -60,8 +60,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -261,7 +260,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -391,8 +389,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/dix/atom.c b/xserver/dix/atom.c
index 22cd0dc0e..da0adfe78 100644
--- a/xserver/dix/atom.c
+++ b/xserver/dix/atom.c
@@ -56,7 +56,7 @@ SOFTWARE.
#include "resource.h"
#include "dix.h"
-#define InitialTableSize 100
+#define InitialTableSize 256
typedef struct _Node {
struct _Node *left, *right;
@@ -70,8 +70,6 @@ static NodePtr atomRoot = NULL;
static unsigned long tableLength;
static NodePtr *nodeTable;
-void FreeAtom(NodePtr patom);
-
Atom
MakeAtom(const char *string, unsigned len, Bool makeit)
{
@@ -119,7 +117,7 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
if ((lastAtom + 1) >= tableLength) {
NodePtr *table;
- table = realloc(nodeTable, tableLength * (2 * sizeof(NodePtr)));
+ table = reallocarray(nodeTable, tableLength, 2 * sizeof(NodePtr));
if (!table) {
if (nd->string != string) {
/* nd->string has been strdup'ed */
@@ -166,7 +164,7 @@ AtomError(void)
FatalError("initializing atoms");
}
-void
+static void
FreeAtom(NodePtr patom)
{
if (patom->left)
@@ -200,7 +198,7 @@ InitAtoms(void)
{
FreeAllAtoms();
tableLength = InitialTableSize;
- nodeTable = malloc(InitialTableSize * sizeof(NodePtr));
+ nodeTable = xallocarray(InitialTableSize, sizeof(NodePtr));
if (!nodeTable)
AtomError();
nodeTable[None] = NULL;
diff --git a/xserver/dix/colormap.c b/xserver/dix/colormap.c
index 4d408d5d2..12a85b256 100644
--- a/xserver/dix/colormap.c
+++ b/xserver/dix/colormap.c
@@ -64,6 +64,9 @@ SOFTWARE.
#include "privates.h"
#include "xace.h"
+typedef int (*ColorCompareProcPtr) (EntryPtr /*pent */ ,
+ xrgb * /*prgb */ );
+
static Pixel FindBestPixel(EntryPtr /*pentFirst */ ,
int /*size */ ,
xrgb * /*prgb */ ,
@@ -249,7 +252,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
size = pVisual->ColormapEntries;
sizebytes = (size * sizeof(Entry)) +
- (MAXCLIENTS * sizeof(Pixel *)) + (MAXCLIENTS * sizeof(int));
+ (LimitClients * sizeof(Pixel *)) + (LimitClients * sizeof(int));
if ((class | DynamicClass) == DirectColor)
sizebytes *= 3;
sizebytes += sizeof(ColormapRec);
@@ -274,7 +277,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
sizebytes = size * sizeof(Entry);
pmap->clientPixelsRed = (Pixel **) ((char *) pmap->red + sizebytes);
pmap->numPixelsRed = (int *) ((char *) pmap->clientPixelsRed +
- (MAXCLIENTS * sizeof(Pixel *)));
+ (LimitClients * sizeof(Pixel *)));
pmap->mid = mid;
pmap->flags = 0; /* start out with all flags clear */
if (mid == pScreen->defColormap)
@@ -286,8 +289,8 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
size = NUMRED(pVisual);
pmap->freeRed = size;
memset((char *) pmap->red, 0, (int) sizebytes);
- memset((char *) pmap->numPixelsRed, 0, MAXCLIENTS * sizeof(int));
- for (pptr = &pmap->clientPixelsRed[MAXCLIENTS];
+ memset((char *) pmap->numPixelsRed, 0, LimitClients * sizeof(int));
+ for (pptr = &pmap->clientPixelsRed[LimitClients];
--pptr >= pmap->clientPixelsRed;)
*pptr = (Pixel *) NULL;
if (alloc == AllocAll) {
@@ -296,7 +299,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
for (pent = &pmap->red[size - 1]; pent >= pmap->red; pent--)
pent->refcnt = AllocPrivate;
pmap->freeRed = 0;
- ppix = malloc(size * sizeof(Pixel));
+ ppix = xallocarray(size, sizeof(Pixel));
if (!ppix) {
free(pmap);
return BadAlloc;
@@ -310,26 +313,26 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
if ((class | DynamicClass) == DirectColor) {
pmap->freeGreen = NUMGREEN(pVisual);
pmap->green = (EntryPtr) ((char *) pmap->numPixelsRed +
- (MAXCLIENTS * sizeof(int)));
+ (LimitClients * sizeof(int)));
pmap->clientPixelsGreen = (Pixel **) ((char *) pmap->green + sizebytes);
pmap->numPixelsGreen = (int *) ((char *) pmap->clientPixelsGreen +
- (MAXCLIENTS * sizeof(Pixel *)));
+ (LimitClients * sizeof(Pixel *)));
pmap->freeBlue = NUMBLUE(pVisual);
pmap->blue = (EntryPtr) ((char *) pmap->numPixelsGreen +
- (MAXCLIENTS * sizeof(int)));
+ (LimitClients * sizeof(int)));
pmap->clientPixelsBlue = (Pixel **) ((char *) pmap->blue + sizebytes);
pmap->numPixelsBlue = (int *) ((char *) pmap->clientPixelsBlue +
- (MAXCLIENTS * sizeof(Pixel *)));
+ (LimitClients * sizeof(Pixel *)));
memset((char *) pmap->green, 0, (int) sizebytes);
memset((char *) pmap->blue, 0, (int) sizebytes);
memmove((char *) pmap->clientPixelsGreen,
- (char *) pmap->clientPixelsRed, MAXCLIENTS * sizeof(Pixel *));
+ (char *) pmap->clientPixelsRed, LimitClients * sizeof(Pixel *));
memmove((char *) pmap->clientPixelsBlue,
- (char *) pmap->clientPixelsRed, MAXCLIENTS * sizeof(Pixel *));
- memset((char *) pmap->numPixelsGreen, 0, MAXCLIENTS * sizeof(int));
- memset((char *) pmap->numPixelsBlue, 0, MAXCLIENTS * sizeof(int));
+ (char *) pmap->clientPixelsRed, LimitClients * sizeof(Pixel *));
+ memset((char *) pmap->numPixelsGreen, 0, LimitClients * sizeof(int));
+ memset((char *) pmap->numPixelsBlue, 0, LimitClients * sizeof(int));
/* If every cell is allocated, mark its refcnt */
if (alloc == AllocAll) {
@@ -337,7 +340,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
for (pent = &pmap->green[size - 1]; pent >= pmap->green; pent--)
pent->refcnt = AllocPrivate;
pmap->freeGreen = 0;
- ppix = malloc(size * sizeof(Pixel));
+ ppix = xallocarray(size, sizeof(Pixel));
if (!ppix) {
free(pmap->clientPixelsRed[client]);
free(pmap);
@@ -352,7 +355,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
for (pent = &pmap->blue[size - 1]; pent >= pmap->blue; pent--)
pent->refcnt = AllocPrivate;
pmap->freeBlue = 0;
- ppix = malloc(size * sizeof(Pixel));
+ ppix = xallocarray(size, sizeof(Pixel));
if (!ppix) {
free(pmap->clientPixelsGreen[client]);
free(pmap->clientPixelsRed[client]);
@@ -413,7 +416,7 @@ FreeColormap(void *value, XID mid)
(*pmap->pScreen->DestroyColormap) (pmap);
if (pmap->clientPixelsRed) {
- for (i = 0; i < MAXCLIENTS; i++)
+ for (i = 0; i < LimitClients; i++)
free(pmap->clientPixelsRed[i]);
}
@@ -431,7 +434,7 @@ FreeColormap(void *value, XID mid)
}
}
if ((pmap->class | DynamicClass) == DirectColor) {
- for (i = 0; i < MAXCLIENTS; i++) {
+ for (i = 0; i < LimitClients; i++) {
free(pmap->clientPixelsGreen[i]);
free(pmap->clientPixelsBlue[i]);
}
@@ -702,7 +705,7 @@ UpdateColors(ColormapPtr pmap)
pVisual = pmap->pVisual;
size = pVisual->ColormapEntries;
- defs = malloc(size * sizeof(xColorItem));
+ defs = xallocarray(size, sizeof(xColorItem));
if (!defs)
return;
n = 0;
@@ -748,6 +751,173 @@ UpdateColors(ColormapPtr pmap)
free(defs);
}
+/* Tries to find a color in pmap that exactly matches the one requested in prgb
+ * if it can't it allocates one.
+ * Starts looking at pentFirst + *pPixel, so if you want a specific pixel,
+ * load *pPixel with that value, otherwise set it to 0
+ */
+static int
+FindColor(ColormapPtr pmap, EntryPtr pentFirst, int size, xrgb * prgb,
+ Pixel * pPixel, int channel, int client, ColorCompareProcPtr comp)
+{
+ EntryPtr pent;
+ Bool foundFree;
+ Pixel pixel, Free = 0;
+ int npix, count, *nump = NULL;
+ Pixel **pixp = NULL, *ppix;
+ xColorItem def;
+
+ foundFree = FALSE;
+
+ if ((pixel = *pPixel) >= size)
+ pixel = 0;
+ /* see if there is a match, and also look for a free entry */
+ for (pent = pentFirst + pixel, count = size; --count >= 0;) {
+ if (pent->refcnt > 0) {
+ if ((*comp) (pent, prgb)) {
+ if (client >= 0)
+ pent->refcnt++;
+ *pPixel = pixel;
+ switch (channel) {
+ case REDMAP:
+ *pPixel <<= pmap->pVisual->offsetRed;
+ case PSEUDOMAP:
+ break;
+ case GREENMAP:
+ *pPixel <<= pmap->pVisual->offsetGreen;
+ break;
+ case BLUEMAP:
+ *pPixel <<= pmap->pVisual->offsetBlue;
+ break;
+ }
+ goto gotit;
+ }
+ }
+ else if (!foundFree && pent->refcnt == 0) {
+ Free = pixel;
+ foundFree = TRUE;
+ /* If we're initializing the colormap, then we are looking for
+ * the first free cell we can find, not to minimize the number
+ * of entries we use. So don't look any further. */
+ if (pmap->flags & BeingCreated)
+ break;
+ }
+ pixel++;
+ if (pixel >= size) {
+ pent = pentFirst;
+ pixel = 0;
+ }
+ else
+ pent++;
+ }
+
+ /* If we got here, we didn't find a match. If we also didn't find
+ * a free entry, we're out of luck. Otherwise, we'll usurp a free
+ * entry and fill it in */
+ if (!foundFree)
+ return BadAlloc;
+ pent = pentFirst + Free;
+ pent->fShared = FALSE;
+ pent->refcnt = (client >= 0) ? 1 : AllocTemporary;
+
+ switch (channel) {
+ case PSEUDOMAP:
+ pent->co.local.red = prgb->red;
+ pent->co.local.green = prgb->green;
+ pent->co.local.blue = prgb->blue;
+ def.red = prgb->red;
+ def.green = prgb->green;
+ def.blue = prgb->blue;
+ def.flags = (DoRed | DoGreen | DoBlue);
+ if (client >= 0)
+ pmap->freeRed--;
+ def.pixel = Free;
+ break;
+
+ case REDMAP:
+ pent->co.local.red = prgb->red;
+ def.red = prgb->red;
+ def.green = pmap->green[0].co.local.green;
+ def.blue = pmap->blue[0].co.local.blue;
+ def.flags = DoRed;
+ if (client >= 0)
+ pmap->freeRed--;
+ def.pixel = Free << pmap->pVisual->offsetRed;
+ break;
+
+ case GREENMAP:
+ pent->co.local.green = prgb->green;
+ def.red = pmap->red[0].co.local.red;
+ def.green = prgb->green;
+ def.blue = pmap->blue[0].co.local.blue;
+ def.flags = DoGreen;
+ if (client >= 0)
+ pmap->freeGreen--;
+ def.pixel = Free << pmap->pVisual->offsetGreen;
+ break;
+
+ case BLUEMAP:
+ pent->co.local.blue = prgb->blue;
+ def.red = pmap->red[0].co.local.red;
+ def.green = pmap->green[0].co.local.green;
+ def.blue = prgb->blue;
+ def.flags = DoBlue;
+ if (client >= 0)
+ pmap->freeBlue--;
+ def.pixel = Free << pmap->pVisual->offsetBlue;
+ break;
+ }
+ (*pmap->pScreen->StoreColors) (pmap, 1, &def);
+ pixel = Free;
+ *pPixel = def.pixel;
+
+ gotit:
+ if (pmap->flags & BeingCreated || client == -1)
+ return Success;
+ /* Now remember the pixel, for freeing later */
+ switch (channel) {
+ case PSEUDOMAP:
+ case REDMAP:
+ nump = pmap->numPixelsRed;
+ pixp = pmap->clientPixelsRed;
+ break;
+
+ case GREENMAP:
+ nump = pmap->numPixelsGreen;
+ pixp = pmap->clientPixelsGreen;
+ break;
+
+ case BLUEMAP:
+ nump = pmap->numPixelsBlue;
+ pixp = pmap->clientPixelsBlue;
+ break;
+ }
+ npix = nump[client];
+ ppix = reallocarray(pixp[client], npix + 1, sizeof(Pixel));
+ if (!ppix) {
+ pent->refcnt--;
+ if (!pent->fShared)
+ switch (channel) {
+ case PSEUDOMAP:
+ case REDMAP:
+ pmap->freeRed++;
+ break;
+ case GREENMAP:
+ pmap->freeGreen++;
+ break;
+ case BLUEMAP:
+ pmap->freeBlue++;
+ break;
+ }
+ return BadAlloc;
+ }
+ ppix[npix] = pixel;
+ pixp[client] = ppix;
+ nump[client]++;
+
+ return Success;
+}
+
/* Get a read-only color from a ColorMap (probably slow for large maps)
* Returns by changing the value in pred, pgreen, pblue and pPix
*/
@@ -792,8 +962,8 @@ AllocColor(ColormapPtr pmap,
*pgreen = pmap->red[pixR].co.local.green;
*pblue = pmap->red[pixR].co.local.blue;
npix = pmap->numPixelsRed[client];
- ppix = (Pixel *) realloc(pmap->clientPixelsRed[client],
- (npix + 1) * sizeof(Pixel));
+ ppix = reallocarray(pmap->clientPixelsRed[client],
+ npix + 1, sizeof(Pixel));
if (!ppix)
return BadAlloc;
ppix[npix] = pixR;
@@ -814,22 +984,22 @@ AllocColor(ColormapPtr pmap,
*pgreen = pmap->green[pixG].co.local.green;
*pblue = pmap->blue[pixB].co.local.blue;
npix = pmap->numPixelsRed[client];
- ppix = (Pixel *) realloc(pmap->clientPixelsRed[client],
- (npix + 1) * sizeof(Pixel));
+ ppix = reallocarray(pmap->clientPixelsRed[client],
+ npix + 1, sizeof(Pixel));
if (!ppix)
return BadAlloc;
ppix[npix] = pixR;
pmap->clientPixelsRed[client] = ppix;
npix = pmap->numPixelsGreen[client];
- ppix = (Pixel *) realloc(pmap->clientPixelsGreen[client],
- (npix + 1) * sizeof(Pixel));
+ ppix = reallocarray(pmap->clientPixelsGreen[client],
+ npix + 1, sizeof(Pixel));
if (!ppix)
return BadAlloc;
ppix[npix] = pixG;
pmap->clientPixelsGreen[client] = ppix;
npix = pmap->numPixelsBlue[client];
- ppix = (Pixel *) realloc(pmap->clientPixelsBlue[client],
- (npix + 1) * sizeof(Pixel));
+ ppix = reallocarray(pmap->clientPixelsBlue[client],
+ npix + 1, sizeof(Pixel));
if (!ppix)
return BadAlloc;
ppix[npix] = pixB;
@@ -1137,173 +1307,6 @@ FindColorInRootCmap(ColormapPtr pmap, EntryPtr pentFirst, int size,
}
}
-/* Tries to find a color in pmap that exactly matches the one requested in prgb
- * if it can't it allocates one.
- * Starts looking at pentFirst + *pPixel, so if you want a specific pixel,
- * load *pPixel with that value, otherwise set it to 0
- */
-int
-FindColor(ColormapPtr pmap, EntryPtr pentFirst, int size, xrgb * prgb,
- Pixel * pPixel, int channel, int client, ColorCompareProcPtr comp)
-{
- EntryPtr pent;
- Bool foundFree;
- Pixel pixel, Free = 0;
- int npix, count, *nump = NULL;
- Pixel **pixp = NULL, *ppix;
- xColorItem def;
-
- foundFree = FALSE;
-
- if ((pixel = *pPixel) >= size)
- pixel = 0;
- /* see if there is a match, and also look for a free entry */
- for (pent = pentFirst + pixel, count = size; --count >= 0;) {
- if (pent->refcnt > 0) {
- if ((*comp) (pent, prgb)) {
- if (client >= 0)
- pent->refcnt++;
- *pPixel = pixel;
- switch (channel) {
- case REDMAP:
- *pPixel <<= pmap->pVisual->offsetRed;
- case PSEUDOMAP:
- break;
- case GREENMAP:
- *pPixel <<= pmap->pVisual->offsetGreen;
- break;
- case BLUEMAP:
- *pPixel <<= pmap->pVisual->offsetBlue;
- break;
- }
- goto gotit;
- }
- }
- else if (!foundFree && pent->refcnt == 0) {
- Free = pixel;
- foundFree = TRUE;
- /* If we're initializing the colormap, then we are looking for
- * the first free cell we can find, not to minimize the number
- * of entries we use. So don't look any further. */
- if (pmap->flags & BeingCreated)
- break;
- }
- pixel++;
- if (pixel >= size) {
- pent = pentFirst;
- pixel = 0;
- }
- else
- pent++;
- }
-
- /* If we got here, we didn't find a match. If we also didn't find
- * a free entry, we're out of luck. Otherwise, we'll usurp a free
- * entry and fill it in */
- if (!foundFree)
- return BadAlloc;
- pent = pentFirst + Free;
- pent->fShared = FALSE;
- pent->refcnt = (client >= 0) ? 1 : AllocTemporary;
-
- switch (channel) {
- case PSEUDOMAP:
- pent->co.local.red = prgb->red;
- pent->co.local.green = prgb->green;
- pent->co.local.blue = prgb->blue;
- def.red = prgb->red;
- def.green = prgb->green;
- def.blue = prgb->blue;
- def.flags = (DoRed | DoGreen | DoBlue);
- if (client >= 0)
- pmap->freeRed--;
- def.pixel = Free;
- break;
-
- case REDMAP:
- pent->co.local.red = prgb->red;
- def.red = prgb->red;
- def.green = pmap->green[0].co.local.green;
- def.blue = pmap->blue[0].co.local.blue;
- def.flags = DoRed;
- if (client >= 0)
- pmap->freeRed--;
- def.pixel = Free << pmap->pVisual->offsetRed;
- break;
-
- case GREENMAP:
- pent->co.local.green = prgb->green;
- def.red = pmap->red[0].co.local.red;
- def.green = prgb->green;
- def.blue = pmap->blue[0].co.local.blue;
- def.flags = DoGreen;
- if (client >= 0)
- pmap->freeGreen--;
- def.pixel = Free << pmap->pVisual->offsetGreen;
- break;
-
- case BLUEMAP:
- pent->co.local.blue = prgb->blue;
- def.red = pmap->red[0].co.local.red;
- def.green = pmap->green[0].co.local.green;
- def.blue = prgb->blue;
- def.flags = DoBlue;
- if (client >= 0)
- pmap->freeBlue--;
- def.pixel = Free << pmap->pVisual->offsetBlue;
- break;
- }
- (*pmap->pScreen->StoreColors) (pmap, 1, &def);
- pixel = Free;
- *pPixel = def.pixel;
-
- gotit:
- if (pmap->flags & BeingCreated || client == -1)
- return Success;
- /* Now remember the pixel, for freeing later */
- switch (channel) {
- case PSEUDOMAP:
- case REDMAP:
- nump = pmap->numPixelsRed;
- pixp = pmap->clientPixelsRed;
- break;
-
- case GREENMAP:
- nump = pmap->numPixelsGreen;
- pixp = pmap->clientPixelsGreen;
- break;
-
- case BLUEMAP:
- nump = pmap->numPixelsBlue;
- pixp = pmap->clientPixelsBlue;
- break;
- }
- npix = nump[client];
- ppix = (Pixel *) realloc(pixp[client], (npix + 1) * sizeof(Pixel));
- if (!ppix) {
- pent->refcnt--;
- if (!pent->fShared)
- switch (channel) {
- case PSEUDOMAP:
- case REDMAP:
- pmap->freeRed++;
- break;
- case GREENMAP:
- pmap->freeGreen++;
- break;
- case BLUEMAP:
- pmap->freeBlue++;
- break;
- }
- return BadAlloc;
- }
- ppix[npix] = pixel;
- pixp[client] = ppix;
- nump[client]++;
-
- return Success;
-}
-
/* Comparison functions -- passed to FindColor to determine if an
* entry is already the color we're looking for or not */
static int
@@ -1647,9 +1650,9 @@ AllocDirect(int client, ColormapPtr pmap, int c, int r, int g, int b,
for (p = pixels; p < pixels + c; p++)
*p = 0;
- ppixRed = malloc(npixR * sizeof(Pixel));
- ppixGreen = malloc(npixG * sizeof(Pixel));
- ppixBlue = malloc(npixB * sizeof(Pixel));
+ ppixRed = xallocarray(npixR, sizeof(Pixel));
+ ppixGreen = xallocarray(npixG, sizeof(Pixel));
+ ppixBlue = xallocarray(npixB, sizeof(Pixel));
if (!ppixRed || !ppixGreen || !ppixBlue) {
free(ppixBlue);
free(ppixGreen);
@@ -1662,19 +1665,19 @@ AllocDirect(int client, ColormapPtr pmap, int c, int r, int g, int b,
okB = AllocCP(pmap, pmap->blue, c, b, contig, ppixBlue, pbmask);
if (okR && okG && okB) {
- rpix = (Pixel *) realloc(pmap->clientPixelsRed[client],
- (pmap->numPixelsRed[client] + (c << r)) *
- sizeof(Pixel));
+ rpix = reallocarray(pmap->clientPixelsRed[client],
+ pmap->numPixelsRed[client] + (c << r),
+ sizeof(Pixel));
if (rpix)
pmap->clientPixelsRed[client] = rpix;
- gpix = (Pixel *) realloc(pmap->clientPixelsGreen[client],
- (pmap->numPixelsGreen[client] + (c << g)) *
- sizeof(Pixel));
+ gpix = reallocarray(pmap->clientPixelsGreen[client],
+ pmap->numPixelsGreen[client] + (c << g),
+ sizeof(Pixel));
if (gpix)
pmap->clientPixelsGreen[client] = gpix;
- bpix = (Pixel *) realloc(pmap->clientPixelsBlue[client],
- (pmap->numPixelsBlue[client] + (c << b)) *
- sizeof(Pixel));
+ bpix = reallocarray(pmap->clientPixelsBlue[client],
+ pmap->numPixelsBlue[client] + (c << b),
+ sizeof(Pixel));
if (bpix)
pmap->clientPixelsBlue[client] = bpix;
}
@@ -1747,7 +1750,7 @@ AllocPseudo(int client, ColormapPtr pmap, int c, int r, Bool contig,
npix = c << r;
if ((r >= 32) || (npix > pmap->freeRed) || (npix < c))
return BadAlloc;
- if (!(ppixTemp = malloc(npix * sizeof(Pixel))))
+ if (!(ppixTemp = xallocarray(npix, sizeof(Pixel))))
return BadAlloc;
ok = AllocCP(pmap, pmap->red, c, r, contig, ppixTemp, pmask);
@@ -1755,9 +1758,8 @@ AllocPseudo(int client, ColormapPtr pmap, int c, int r, Bool contig,
/* all the allocated pixels are added to the client pixel list,
* but only the unique ones are returned to the client */
- ppix = (Pixel *) realloc(pmap->clientPixelsRed[client],
- (pmap->numPixelsRed[client] +
- npix) * sizeof(Pixel));
+ ppix = reallocarray(pmap->clientPixelsRed[client],
+ pmap->numPixelsRed[client] + npix, sizeof(Pixel));
if (!ppix) {
for (p = ppixTemp; p < ppixTemp + npix; p++)
pmap->red[*p].refcnt = 0;
@@ -1960,7 +1962,7 @@ AllocShared(ColormapPtr pmap, Pixel * ppix, int c, int r, int g, int b,
npixClientNew = c << (r + g + b);
npixShared = (c << r) + (c << g) + (c << b);
- psharedList = malloc(npixShared * sizeof(SHAREDCOLOR *));
+ psharedList = xallocarray(npixShared, sizeof(SHAREDCOLOR *));
if (!psharedList)
return FALSE;
ppshared = psharedList;
@@ -2204,7 +2206,7 @@ FreeCo(ColormapPtr pmap, int client, int color, int npixIn, Pixel * ppixIn,
npix++;
}
}
- pptr = (Pixel *) realloc(ppixClient, npixNew * sizeof(Pixel));
+ pptr = reallocarray(ppixClient, npixNew, sizeof(Pixel));
if (pptr)
ppixClient = pptr;
npixClient = npixNew;
@@ -2469,8 +2471,8 @@ IsMapInstalled(Colormap map, WindowPtr pWin)
Colormap *pmaps;
int imap, nummaps, found;
- pmaps =
- malloc(pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap));
+ pmaps = xallocarray(pWin->drawable.pScreen->maxInstalledCmaps,
+ sizeof(Colormap));
if (!pmaps)
return FALSE;
nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps)
@@ -2521,8 +2523,8 @@ ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth)
first_new_vid = depth->numVids;
first_new_visual = pScreen->numVisuals;
- vids =
- realloc(depth->vids, (depth->numVids + new_visual_count) * sizeof(XID));
+ vids = reallocarray(depth->vids, depth->numVids + new_visual_count,
+ sizeof(XID));
if (!vids)
return FALSE;
@@ -2530,7 +2532,7 @@ ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth)
depth->vids = vids;
numVisuals = pScreen->numVisuals + new_visual_count;
- visuals = realloc(pScreen->visuals, numVisuals * sizeof(VisualRec));
+ visuals = reallocarray(pScreen->visuals, numVisuals, sizeof(VisualRec));
if (!visuals) {
return FALSE;
}
diff --git a/xserver/dix/cursor.c b/xserver/dix/cursor.c
index 1525857e3..e45945619 100644
--- a/xserver/dix/cursor.c
+++ b/xserver/dix/cursor.c
@@ -80,9 +80,7 @@ FreeCursorBits(CursorBitsPtr bits)
return;
free(bits->source);
free(bits->mask);
-#ifdef ARGB_CURSOR
free(bits->argb);
-#endif
dixFiniPrivates(bits, PRIVATE_CURSOR_BITS);
if (bits->refcnt == 0) {
GlyphSharePtr *prev, this;
@@ -165,7 +163,6 @@ CheckForEmptyMask(CursorBitsPtr bits)
while (n--)
if (*(msk++) != 0)
return;
-#ifdef ARGB_CURSOR
if (bits->argb) {
CARD32 *argb = bits->argb;
@@ -174,7 +171,6 @@ CheckForEmptyMask(CursorBitsPtr bits)
if (*argb++ & 0xff000000)
return;
}
-#endif
bits->emptyMask = TRUE;
}
@@ -259,9 +255,7 @@ AllocARGBCursor(unsigned char *psrcbits, unsigned char *pmaskbits,
dixInitPrivates(bits, bits + 1, PRIVATE_CURSOR_BITS)
bits->source = psrcbits;
bits->mask = pmaskbits;
-#ifdef ARGB_CURSOR
bits->argb = argb;
-#endif
bits->width = cm->width;
bits->height = cm->height;
bits->xhot = cm->xhot;
@@ -400,9 +394,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
dixInitPrivates(bits, bits + 1, PRIVATE_CURSOR_BITS);
bits->source = srcbits;
bits->mask = mskbits;
-#ifdef ARGB_CURSOR
bits->argb = 0;
-#endif
bits->width = cm.width;
bits->height = cm.height;
bits->xhot = cm.xhot;
diff --git a/xserver/dix/devices.c b/xserver/dix/devices.c
index 03290e486..9b0c7d296 100644
--- a/xserver/dix/devices.c
+++ b/xserver/dix/devices.c
@@ -177,8 +177,8 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
if (!isfinite(f[i]))
return BadValue;
- if (!dev->valuator)
- return BadMatch;
+ if (!dev->valuator)
+ return BadMatch;
if (!checkonly)
DeviceSetTransform(dev, f);
@@ -1472,8 +1472,8 @@ InitStringFeedbackClassDeviceStruct(DeviceIntPtr dev,
feedc->ctrl.num_symbols_displayed = 0;
feedc->ctrl.max_symbols = max_symbols;
feedc->ctrl.symbols_supported =
- malloc(sizeof(KeySym) * num_symbols_supported);
- feedc->ctrl.symbols_displayed = malloc(sizeof(KeySym) * max_symbols);
+ xallocarray(num_symbols_supported, sizeof(KeySym));
+ feedc->ctrl.symbols_displayed = xallocarray(max_symbols, sizeof(KeySym));
if (!feedc->ctrl.symbols_supported || !feedc->ctrl.symbols_displayed) {
free(feedc->ctrl.symbols_supported);
free(feedc->ctrl.symbols_displayed);
@@ -2521,7 +2521,7 @@ ReleaseButtonsAndKeys(DeviceIntPtr dev)
/* Release all keys */
for (i = 0; k && i < MAP_LENGTH; i++) {
if (BitIsOn(k->down, i)) {
- nevents = GetKeyboardEvents(eventlist, dev, KeyRelease, i, NULL);
+ nevents = GetKeyboardEvents(eventlist, dev, KeyRelease, i);
for (j = 0; j < nevents; j++)
mieqProcessDeviceEvent(dev, &eventlist[j], NULL);
}
diff --git a/xserver/dix/dispatch.c b/xserver/dix/dispatch.c
index 17fa75e19..2c201245a 100644
--- a/xserver/dix/dispatch.c
+++ b/xserver/dix/dispatch.c
@@ -108,6 +108,7 @@ int ProcInitialConnection();
#include "windowstr.h"
#include <X11/fonts/fontstruct.h>
+#include <X11/fonts/fontutil.h>
#include "dixfontstr.h"
#include "gcstruct.h"
#include "selection.h"
@@ -344,7 +345,7 @@ Dispatch(void)
nextFreeClientID = 1;
nClients = 0;
- clientReady = malloc(sizeof(int) * MaxClients);
+ clientReady = xallocarray(MaxClients, sizeof(int));
if (!clientReady)
return;
@@ -963,7 +964,7 @@ ProcQueryTree(ClientPtr client)
if (numChildren) {
int curChild = 0;
- childIDs = malloc(numChildren * sizeof(Window));
+ childIDs = xallocarray(numChildren, sizeof(Window));
if (!childIDs)
return BadAlloc;
for (pChild = pWin->lastChild; pChild != pHead;
@@ -2786,7 +2787,7 @@ ProcQueryColors(ClientPtr client)
count =
bytes_to_int32((client->req_len << 2) - sizeof(xQueryColorsReq));
- prgbs = calloc(1, count * sizeof(xrgb));
+ prgbs = calloc(count, sizeof(xrgb));
if (!prgbs && count)
return BadAlloc;
if ((rc =
@@ -2908,10 +2909,10 @@ ProcCreateCursor(ClientPtr client)
if (stuff->x > width || stuff->y > height)
return BadMatch;
- n = BitmapBytePad(width) * height;
- srcbits = calloc(1, n);
+ srcbits = calloc(BitmapBytePad(width), height);
if (!srcbits)
return BadAlloc;
+ n = BitmapBytePad(width) * height;
mskbits = malloc(n);
if (!mskbits) {
free(srcbits);
@@ -3483,7 +3484,7 @@ NextAvailableClient(void *ospriv)
xReq data;
i = nextFreeClientID;
- if (i == MAXCLIENTS)
+ if (i == LimitClients)
return (ClientPtr) NULL;
clients[i] = client =
dixAllocateObjectWithPrivates(ClientRec, PRIVATE_CLIENT);
@@ -3503,7 +3504,7 @@ NextAvailableClient(void *ospriv)
}
if (i == currentMaxClients)
currentMaxClients++;
- while ((nextFreeClientID < MAXCLIENTS) && clients[nextFreeClientID])
+ while ((nextFreeClientID < LimitClients) && clients[nextFreeClientID])
nextFreeClientID++;
/* Enable client ID tracking. This must be done before
diff --git a/xserver/dix/dixfonts.c b/xserver/dix/dixfonts.c
index ddcb18bc1..300bf043a 100644
--- a/xserver/dix/dixfonts.c
+++ b/xserver/dix/dixfonts.c
@@ -156,7 +156,7 @@ SetDefaultFont(const char *defaultfontname)
* init_fpe() and free_fpe(), there shouldn't be any problem in using
* freed data.
*/
-void
+static void
QueueFontWakeup(FontPathElementPtr fpe)
{
int i;
@@ -168,9 +168,8 @@ QueueFontWakeup(FontPathElementPtr fpe)
}
}
if (num_slept_fpes == size_slept_fpes) {
- new = (FontPathElementPtr *)
- realloc(slept_fpes,
- sizeof(FontPathElementPtr) * (size_slept_fpes + 4));
+ new = reallocarray(slept_fpes, size_slept_fpes + 4,
+ sizeof(FontPathElementPtr));
if (!new)
return;
slept_fpes = new;
@@ -180,7 +179,7 @@ QueueFontWakeup(FontPathElementPtr fpe)
num_slept_fpes++;
}
-void
+static void
RemoveFontWakeup(FontPathElementPtr fpe)
{
int i, j;
@@ -196,7 +195,7 @@ RemoveFontWakeup(FontPathElementPtr fpe)
}
}
-void
+static void
FontWakeup(void *data, int count, void *LastSelectMask)
{
int i;
@@ -421,7 +420,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname,
* copy the current FPE list, so that if it gets changed by another client
* while we're blocking, the request still appears atomic
*/
- c->fpe_list = malloc(sizeof(FontPathElementPtr) * num_fpes);
+ c->fpe_list = xallocarray(num_fpes, sizeof(FontPathElementPtr));
if (!c->fpe_list) {
free((void *) c->fontname);
free(c);
@@ -811,7 +810,7 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length,
if (!(c = malloc(sizeof *c)))
return BadAlloc;
- c->fpe_list = malloc(sizeof(FontPathElementPtr) * num_fpes);
+ c->fpe_list = xallocarray(num_fpes, sizeof(FontPathElementPtr));
if (!c->fpe_list) {
free(c);
return BadAlloc;
@@ -840,7 +839,7 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length,
return Success;
}
-int
+static int
doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
{
FontPathElementPtr fpe;
@@ -1057,7 +1056,7 @@ StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern,
if (!(c = malloc(sizeof *c)))
goto badAlloc;
- c->fpe_list = malloc(sizeof(FontPathElementPtr) * num_fpes);
+ c->fpe_list = xallocarray(num_fpes, sizeof(FontPathElementPtr));
if (!c->fpe_list) {
free(c);
goto badAlloc;
@@ -1091,7 +1090,7 @@ static ChangeGCVal clearGC[] = { {.ptr = NullPixmap} };
#define clearGCmask (GCClipMask)
-int
+static int
doPolyText(ClientPtr client, PTclosurePtr c)
{
FontPtr pFont = c->pGC->font, oldpFont;
@@ -1372,7 +1371,7 @@ PolyText(ClientPtr client, DrawablePtr pDraw, GC * pGC, unsigned char *pElt,
#undef TextEltHeader
#undef FontShiftSize
-int
+static int
doImageText(ClientPtr client, ITclosurePtr c)
{
int err = Success, lgerr; /* err is in X error, not font error, space */
@@ -1423,7 +1422,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
*new_closure = *c;
c = new_closure;
- data = malloc(c->nChars * itemSize);
+ data = xallocarray(c->nChars, itemSize);
if (!data) {
free(c);
c = old_closure;
@@ -1576,7 +1575,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
unsigned char *cp = paths;
FontPathElementPtr fpe = NULL, *fplist;
- fplist = malloc(sizeof(FontPathElementPtr) * npaths);
+ fplist = xallocarray(npaths, sizeof(FontPathElementPtr));
if (!fplist) {
*bad = 0;
return BadAlloc;
@@ -1873,8 +1872,7 @@ RegisterFPEFunctions(NameCheckFunc name_func,
FPEFunctions *new;
/* grow the list */
- new = (FPEFunctions *) realloc(fpe_functions,
- (num_fpe_types + 1) * sizeof(FPEFunctions));
+ new = reallocarray(fpe_functions, num_fpe_types + 1, sizeof(FPEFunctions));
if (!new)
return -1;
fpe_functions = new;
diff --git a/xserver/dix/dixutils.c b/xserver/dix/dixutils.c
index 205550eb4..b6b002385 100644
--- a/xserver/dix/dixutils.c
+++ b/xserver/dix/dixutils.c
@@ -620,6 +620,28 @@ ClientSignal(ClientPtr client)
return FALSE;
}
+int
+ClientSignalAll(ClientPtr client, ClientSleepProcPtr function, void *closure)
+{
+ SleepQueuePtr q;
+ int count = 0;
+
+ for (q = sleepQueue; q; q = q->next) {
+ if (!(client == CLIENT_SIGNAL_ANY || q->client == client))
+ continue;
+
+ if (!(function == CLIENT_SIGNAL_ANY || q->function == function))
+ continue;
+
+ if (!(closure == CLIENT_SIGNAL_ANY || q->closure == closure))
+ continue;
+
+ count += QueueWorkProc(q->function, q->client, q->closure);
+ }
+
+ return count;
+}
+
void
ClientWakeup(ClientPtr client)
{
diff --git a/xserver/dix/enterleave.c b/xserver/dix/enterleave.c
index 54f4b8554..f0b1572fb 100644
--- a/xserver/dix/enterleave.c
+++ b/xserver/dix/enterleave.c
@@ -212,7 +212,7 @@ SetFocusOut(DeviceIntPtr dev)
* @return The window that is the first ancestor of both 'a' and 'b', or the
* NullWindow if they do not have a common ancestor.
*/
-WindowPtr
+static WindowPtr
CommonAncestor(WindowPtr a, WindowPtr b)
{
for (b = b->parent; b; b = b->parent)
@@ -714,7 +714,7 @@ DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win)
}
}
- sev = ev = (deviceStateNotify *) malloc(evcount * sizeof(xEvent));
+ sev = ev = xallocarray(evcount, sizeof(xEvent));
FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first);
if (b != NULL) {
diff --git a/xserver/dix/enterleave.h b/xserver/dix/enterleave.h
index a59d05799..4b833d8a3 100644
--- a/xserver/dix/enterleave.h
+++ b/xserver/dix/enterleave.h
@@ -41,8 +41,6 @@ extern void EnterLeaveEvent(DeviceIntPtr mouse,
int type,
int mode, int detail, WindowPtr pWin, Window child);
-extern WindowPtr CommonAncestor(WindowPtr a, WindowPtr b);
-
extern void CoreEnterLeaveEvent(DeviceIntPtr mouse,
int type,
int mode,
diff --git a/xserver/dix/events.c b/xserver/dix/events.c
index 150620f59..efaf91d2b 100644
--- a/xserver/dix/events.c
+++ b/xserver/dix/events.c
@@ -4786,8 +4786,8 @@ SetInputFocus(ClientPtr client,
depth++;
if (depth > focus->traceSize) {
focus->traceSize = depth + 1;
- focus->trace = realloc(focus->trace,
- focus->traceSize * sizeof(WindowPtr));
+ focus->trace = reallocarray(focus->trace, focus->traceSize,
+ sizeof(WindowPtr));
}
focus->traceGood = depth;
for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--)
diff --git a/xserver/dix/extension.c b/xserver/dix/extension.c
index 56e3abc14..e81f673b2 100644
--- a/xserver/dix/extension.c
+++ b/xserver/dix/extension.c
@@ -103,8 +103,7 @@ AddExtension(const char *name, int NumEvents, int NumErrors,
return ((ExtensionEntry *) NULL);
}
i = NumExtensions;
- newexts = (ExtensionEntry **) realloc(extensions,
- (i + 1) * sizeof(ExtensionEntry *));
+ newexts = reallocarray(extensions, i + 1, sizeof(ExtensionEntry *));
if (!newexts) {
free((void *) ext->name);
dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION);
@@ -153,8 +152,7 @@ AddExtensionAlias(const char *alias, ExtensionEntry * ext)
if (!ext)
return FALSE;
- aliases = realloc(ext->aliases,
- (ext->num_aliases + 1) * sizeof(char *));
+ aliases = reallocarray(ext->aliases, ext->num_aliases + 1, sizeof(char *));
if (!aliases)
return FALSE;
ext->aliases = aliases;
diff --git a/xserver/dix/getevents.c b/xserver/dix/getevents.c
index bc7ffa63b..7ebddc419 100644
--- a/xserver/dix/getevents.c
+++ b/xserver/dix/getevents.c
@@ -208,14 +208,25 @@ init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int type, int detail)
}
static void
-set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask, double *data)
+set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask,
+ BOOL use_unaccel, double *data)
{
int i;
+ use_unaccel = use_unaccel && valuator_mask_has_unaccelerated(mask);
+
for (i = 0; i < valuator_mask_size(mask); i++) {
if (valuator_mask_isset(mask, i)) {
+ double v;
+
SetBit(event->valuators.mask, i);
- data[i] = valuator_mask_get_double(mask, i);
+
+ if (use_unaccel)
+ v = valuator_mask_get_unaccelerated(mask, i);
+ else
+ v = valuator_mask_get_double(mask, i);
+
+ data[i] = v;
}
}
}
@@ -1049,21 +1060,18 @@ event_set_root_coordinates(DeviceEvent *event, double x, double y)
*
* This function is not reentrant. Disable signals before calling.
*
- * FIXME: flags for relative/abs motion?
- *
* @param device The device to generate the event for
* @param type Event type, one of KeyPress or KeyRelease
* @param keycode Key code of the pressed/released key
- * @param mask Valuator mask for valuators present for this event.
*
*/
void
QueueKeyboardEvents(DeviceIntPtr device, int type,
- int keycode, const ValuatorMask *mask)
+ int keycode)
{
int nevents;
- nevents = GetKeyboardEvents(InputEventList, device, type, keycode, mask);
+ nevents = GetKeyboardEvents(InputEventList, device, type, keycode);
queueEventList(device, InputEventList, nevents);
}
@@ -1078,20 +1086,17 @@ QueueKeyboardEvents(DeviceIntPtr device, int type,
*/
int
GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
- int key_code, const ValuatorMask *mask_in)
+ int key_code)
{
int num_events = 0;
CARD32 ms = 0;
DeviceEvent *event;
RawDeviceEvent *raw;
- ValuatorMask mask;
#if XSERVER_DTRACE
if (XSERVER_INPUT_EVENT_ENABLED()) {
- XSERVER_INPUT_EVENT(pDev->id, type, key_code, 0,
- mask_in ? mask_in->last_bit + 1 : 0,
- mask_in ? mask_in->mask : NULL,
- mask_in ? mask_in->valuators : NULL);
+ XSERVER_INPUT_EVENT(pDev->id, type, key_code, 0, 0,
+ NULL, NULL);
}
#endif
@@ -1104,11 +1109,6 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
(key_code < 8 || key_code > 255))
return 0;
- if (mask_in && valuator_mask_size(mask_in) > 1) {
- ErrorF("[dix] the server does not handle valuator masks with "
- "keyboard events. This is a bug. You may fix it.\n");
- }
-
num_events = 1;
events =
@@ -1130,14 +1130,7 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
events++;
num_events++;
- valuator_mask_copy(&mask, mask_in);
-
init_raw(pDev, raw, ms, type, key_code);
- set_raw_valuators(raw, &mask, raw->valuators.data_raw);
-
- clipValuators(pDev, &mask);
-
- set_raw_valuators(raw, &mask, raw->valuators.data);
event = &events->device_event;
init_device_event(event, pDev, ms);
@@ -1152,18 +1145,6 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
set_key_up(pDev, key_code, KEY_POSTED);
}
- clipValuators(pDev, &mask);
-
- set_valuators(pDev, event, &mask);
-
- if (!IsFloating(pDev)) {
- DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER);
-
- event_set_root_coordinates(event,
- master->last.valuators[0],
- master->last.valuators[1]);
- }
-
return num_events;
}
@@ -1418,9 +1399,11 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
num_events++;
init_raw(pDev, raw, ms, type, buttons);
- set_raw_valuators(raw, &mask, raw->valuators.data_raw);
+ set_raw_valuators(raw, &mask, TRUE, raw->valuators.data_raw);
}
+ valuator_mask_drop_unaccelerated(&mask);
+
/* valuators are in driver-native format (rel or abs) */
if (flags & POINTER_ABSOLUTE) {
@@ -1433,7 +1416,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
transformAbsolute(pDev, &mask);
clipAbsolute(pDev, &mask);
if ((flags & POINTER_NORAW) == 0 && raw)
- set_raw_valuators(raw, &mask, raw->valuators.data);
+ set_raw_valuators(raw, &mask, FALSE, raw->valuators.data);
}
else {
transformRelative(pDev, &mask);
@@ -1441,7 +1424,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
if (flags & POINTER_ACCELERATE)
accelPointer(pDev, &mask, ms);
if ((flags & POINTER_NORAW) == 0 && raw)
- set_raw_valuators(raw, &mask, raw->valuators.data);
+ set_raw_valuators(raw, &mask, FALSE, raw->valuators.data);
moveRelative(pDev, flags, &mask);
}
@@ -1557,6 +1540,10 @@ emulate_scroll_button_events(InternalEvent *events,
ax = &dev->valuator->axes[axis];
incr = ax->scroll.increment;
+ BUG_WARN_MSG(incr == 0, "for device %s\n", dev->name);
+ if (incr == 0)
+ return 0;
+
if (type != ButtonPress && type != ButtonRelease)
flags |= POINTER_EMULATED;
@@ -1946,7 +1933,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
events++;
num_events++;
init_raw(dev, raw, ms, type, client_id);
- set_raw_valuators(raw, &mask, raw->valuators.data_raw);
+ set_raw_valuators(raw, &mask, TRUE, raw->valuators.data_raw);
}
event = &events->device_event;
@@ -2008,7 +1995,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
screeny = dev->spriteInfo->sprite->hotPhys.y;
}
if (need_rawevent)
- set_raw_valuators(raw, &mask, raw->valuators.data);
+ set_raw_valuators(raw, &mask, FALSE, raw->valuators.data);
/* Indirect device touch coordinates are not used for cursor positioning.
* They are merely informational, and are provided in device coordinates.
diff --git a/xserver/dix/glyphcurs.c b/xserver/dix/glyphcurs.c
index eca6a4cb8..3ff6ae83e 100644
--- a/xserver/dix/glyphcurs.c
+++ b/xserver/dix/glyphcurs.c
@@ -78,7 +78,6 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm,
GCPtr pGC;
xRectangle rect;
PixmapPtr ppix;
- long nby;
char *pbits;
ChangeGCVal gcval[3];
unsigned char char2b[2];
@@ -88,8 +87,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm,
char2b[1] = (unsigned char) (ch & 0xff);
pScreen = screenInfo.screens[0];
- nby = BitmapBytePad(cm->width) * (long) cm->height;
- pbits = calloc(1, nby);
+ pbits = calloc(BitmapBytePad(cm->width), cm->height);
if (!pbits)
return BadAlloc;
diff --git a/xserver/dix/grabs.c b/xserver/dix/grabs.c
index b92f1e7ce..2a307a2b9 100644
--- a/xserver/dix/grabs.c
+++ b/xserver/dix/grabs.c
@@ -594,10 +594,10 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
i++;
if (!i)
return TRUE;
- deletes = malloc(i * sizeof(GrabPtr));
- adds = malloc(i * sizeof(GrabPtr));
- updates = malloc(i * sizeof(Mask **));
- details = malloc(i * sizeof(Mask *));
+ deletes = xallocarray(i, sizeof(GrabPtr));
+ adds = xallocarray(i, sizeof(GrabPtr));
+ updates = xallocarray(i, sizeof(Mask **));
+ details = xallocarray(i, sizeof(Mask *));
if (!deletes || !adds || !updates || !details) {
free(details);
free(updates);
diff --git a/xserver/dix/inpututils.c b/xserver/dix/inpututils.c
index 5c2a32d1c..136398842 100644
--- a/xserver/dix/inpututils.c
+++ b/xserver/dix/inpututils.c
@@ -505,15 +505,23 @@ valuator_mask_isset(const ValuatorMask *mask, int valuator)
return mask->last_bit >= valuator && BitIsOn(mask->mask, valuator);
}
+static inline void
+_valuator_mask_set_double(ValuatorMask *mask, int valuator, double data)
+{
+ mask->last_bit = max(valuator, mask->last_bit);
+ SetBit(mask->mask, valuator);
+ mask->valuators[valuator] = data;
+}
+
/**
* Set the valuator to the given floating-point data.
*/
void
valuator_mask_set_double(ValuatorMask *mask, int valuator, double data)
{
- mask->last_bit = max(valuator, mask->last_bit);
- SetBit(mask->mask, valuator);
- mask->valuators[valuator] = data;
+ BUG_WARN_MSG(mask->has_unaccelerated,
+ "Do not mix valuator types, zero mask first\n");
+ _valuator_mask_set_double(mask, valuator, data);
}
/**
@@ -594,11 +602,15 @@ valuator_mask_unset(ValuatorMask *mask, int valuator)
ClearBit(mask->mask, valuator);
mask->valuators[valuator] = 0.0;
+ mask->unaccelerated[valuator] = 0.0;
for (i = 0; i <= mask->last_bit; i++)
if (valuator_mask_isset(mask, i))
lastbit = max(lastbit, i);
mask->last_bit = lastbit;
+
+ if (mask->last_bit == -1)
+ mask->has_unaccelerated = FALSE;
}
}
@@ -611,6 +623,66 @@ valuator_mask_copy(ValuatorMask *dest, const ValuatorMask *src)
valuator_mask_zero(dest);
}
+Bool
+valuator_mask_has_unaccelerated(const ValuatorMask *mask)
+{
+ return mask->has_unaccelerated;
+}
+
+void
+valuator_mask_drop_unaccelerated(ValuatorMask *mask)
+{
+ memset(mask->unaccelerated, 0, sizeof(mask->unaccelerated));
+ mask->has_unaccelerated = FALSE;
+}
+
+/**
+ * Set both accelerated and unaccelerated value for this mask.
+ */
+void
+valuator_mask_set_unaccelerated(ValuatorMask *mask,
+ int valuator,
+ double accel,
+ 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, accel);
+ mask->has_unaccelerated = TRUE;
+ mask->unaccelerated[valuator] = unaccel;
+}
+
+double
+valuator_mask_get_accelerated(const ValuatorMask *mask,
+ int valuator)
+{
+ return valuator_mask_get_double(mask, valuator);
+}
+
+double
+valuator_mask_get_unaccelerated(const ValuatorMask *mask,
+ int valuator)
+{
+ return mask->unaccelerated[valuator];
+}
+
+Bool
+valuator_mask_fetch_unaccelerated(const ValuatorMask *mask,
+ int valuator,
+ double *accel,
+ double *unaccel)
+{
+ if (valuator_mask_isset(mask, valuator)) {
+ if (accel)
+ *accel = valuator_mask_get_accelerated(mask, valuator);
+ if (unaccel)
+ *unaccel = valuator_mask_get_unaccelerated(mask, valuator);
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
int
CountBits(const uint8_t * mask, int len)
{
diff --git a/xserver/dix/main.c b/xserver/dix/main.c
index 7c6ac943f..549567660 100644
--- a/xserver/dix/main.c
+++ b/xserver/dix/main.c
@@ -95,6 +95,8 @@ Equipment Corporation.
#include "cursorstr.h"
#include "selection.h"
#include <X11/fonts/font.h>
+#include <X11/fonts/fontstruct.h>
+#include <X11/fonts/fontutil.h>
#include "opaque.h"
#include "servermd.h"
#include "hotplug.h"
@@ -163,7 +165,7 @@ dix_main(int argc, char *argv[], char *envp[])
OsInit();
if (serverGeneration == 1) {
CreateWellKnownSockets();
- for (i = 1; i < MAXCLIENTS; i++)
+ for (i = 1; i < LimitClients; i++)
clients[i] = NullClient;
serverClient = calloc(sizeof(ClientRec), 1);
if (!serverClient)
diff --git a/xserver/dix/pixmap.c b/xserver/dix/pixmap.c
index 00e298f5c..11d83fe00 100644
--- a/xserver/dix/pixmap.c
+++ b/xserver/dix/pixmap.c
@@ -40,7 +40,9 @@ from The Open Group.
#include "gcstruct.h"
#include "servermd.h"
#include "site.h"
-
+#include "X11/extensions/render.h"
+#include "picturestr.h"
+#include "randrstr.h"
/*
* Scratch pixmap management and device independent pixmap allocation
* function.
@@ -164,12 +166,16 @@ PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave)
}
Bool
-PixmapStartDirtyTracking2(PixmapPtr src,
- PixmapPtr slave_dst,
- int x, int y, int dst_x, int dst_y)
+PixmapStartDirtyTracking(PixmapPtr src,
+ PixmapPtr slave_dst,
+ int x, int y, int dst_x, int dst_y,
+ Rotation rotation)
{
ScreenPtr screen = src->drawable.pScreen;
PixmapDirtyUpdatePtr dirty_update;
+ RegionPtr damageregion;
+ RegionRec dstregion;
+ BoxRec box;
dirty_update = calloc(1, sizeof(PixmapDirtyUpdateRec));
if (!dirty_update)
@@ -181,30 +187,51 @@ PixmapStartDirtyTracking2(PixmapPtr src,
dirty_update->y = y;
dirty_update->dst_x = dst_x;
dirty_update->dst_y = dst_y;
-
+ dirty_update->rotation = rotation;
dirty_update->damage = DamageCreate(NULL, NULL,
DamageReportNone,
TRUE, src->drawable.pScreen,
src->drawable.pScreen);
+
+ if (rotation != RR_Rotate_0) {
+ RRTransformCompute(x, y,
+ slave_dst->drawable.width,
+ slave_dst->drawable.height,
+ rotation,
+ NULL,
+ &dirty_update->transform,
+ &dirty_update->f_transform,
+ &dirty_update->f_inverse);
+ }
if (!dirty_update->damage) {
free(dirty_update);
return FALSE;
}
+ /* Damage destination rectangle so that the destination pixmap contents
+ * will get fully initialized
+ */
+ box.x1 = dirty_update->x;
+ box.y1 = dirty_update->y;
+ if (dirty_update->rotation == RR_Rotate_90 ||
+ dirty_update->rotation == RR_Rotate_270) {
+ box.x2 = dirty_update->x + slave_dst->drawable.height;
+ box.y2 = dirty_update->y + slave_dst->drawable.width;
+ } else {
+ box.x2 = dirty_update->x + slave_dst->drawable.width;
+ box.y2 = dirty_update->y + slave_dst->drawable.height;
+ }
+ RegionInit(&dstregion, &box, 1);
+ damageregion = DamageRegion(dirty_update->damage);
+ RegionUnion(damageregion, damageregion, &dstregion);
+ RegionUninit(&dstregion);
+
DamageRegister(&src->drawable, dirty_update->damage);
xorg_list_add(&dirty_update->ent, &screen->pixmap_dirty_list);
return TRUE;
}
Bool
-PixmapStartDirtyTracking(PixmapPtr src,
- PixmapPtr slave_dst,
- int x, int y)
-{
- return PixmapStartDirtyTracking2(src, slave_dst, x, y, 0, 0);
-}
-
-Bool
PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst)
{
ScreenPtr screen = src->drawable.pScreen;
@@ -220,42 +247,16 @@ PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst)
return TRUE;
}
-/*
- * this function can possibly be improved and optimised, by clipping
- * instead of iterating
- */
-Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region)
+static void
+PixmapDirtyCopyArea(PixmapPtr dst,
+ PixmapDirtyUpdatePtr dirty,
+ RegionPtr dirty_region)
{
ScreenPtr pScreen = dirty->src->drawable.pScreen;
int n;
BoxPtr b;
- RegionPtr region = DamageRegion(dirty->damage);
GCPtr pGC;
- PixmapPtr dst;
- SourceValidateProcPtr SourceValidate;
- /*
- * SourceValidate is used by the software cursor code
- * to pull the cursor off of the screen when reading
- * bits from the frame buffer. Bypassing this function
- * leaves the software cursor in place
- */
- SourceValidate = pScreen->SourceValidate;
- pScreen->SourceValidate = NULL;
-
- RegionTranslate(dirty_region, dirty->x, dirty->y);
- RegionIntersect(dirty_region, dirty_region, region);
-
- if (RegionNil(dirty_region)) {
- RegionUninit(dirty_region);
- return FALSE;
- }
-
- dst = dirty->slave_dst->master_pixmap;
- if (!dst)
- dst = dirty->slave_dst;
-
- RegionTranslate(dirty_region, -dirty->x, -dirty->y);
n = RegionNumRects(dirty_region);
b = RegionRects(dirty_region);
@@ -271,11 +272,123 @@ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region)
h = dst_box.y2 - dst_box.y1;
pGC->ops->CopyArea(&dirty->src->drawable, &dst->drawable, pGC,
- dirty->x + dst_box.x1, dirty->y + dst_box.y1, w, h, dirty->dst_x + dst_box.x1, dirty->dst_y + dst_box.y1);
+ dirty->x + dst_box.x1, dirty->y + dst_box.y1, w, h,
+ dirty->dst_x + dst_box.x1,
+ dirty->dst_y + dst_box.y1);
b++;
}
FreeScratchGC(pGC);
+}
+
+static void
+PixmapDirtyCompositeRotate(PixmapPtr dst_pixmap,
+ PixmapDirtyUpdatePtr dirty,
+ RegionPtr dirty_region)
+{
+ ScreenPtr pScreen = dirty->src->drawable.pScreen;
+ PictFormatPtr format = PictureWindowFormat(pScreen->root);
+ PicturePtr src, dst;
+ XID include_inferiors = IncludeInferiors;
+ int n = RegionNumRects(dirty_region);
+ BoxPtr b = RegionRects(dirty_region);
+ int error;
+
+ src = CreatePicture(None,
+ &dirty->src->drawable,
+ format,
+ CPSubwindowMode,
+ &include_inferiors, serverClient, &error);
+ if (!src)
+ return;
+
+ dst = CreatePicture(None,
+ &dst_pixmap->drawable,
+ format, 0L, NULL, serverClient, &error);
+ if (!dst)
+ return;
+
+ error = SetPictureTransform(src, &dirty->transform);
+ if (error)
+ return;
+ while (n--) {
+ BoxRec dst_box;
+ dst_box = *b;
+ dst_box.x1 += dirty->x;
+ dst_box.x2 += dirty->x;
+ dst_box.y1 += dirty->y;
+ dst_box.y2 += dirty->y;
+ pixman_f_transform_bounds(&dirty->f_inverse, &dst_box);
+
+ CompositePicture(PictOpSrc,
+ src, NULL, dst,
+ dst_box.x1,
+ dst_box.y1,
+ 0, 0,
+ dst_box.x1,
+ dst_box.y1,
+ dst_box.x2 - dst_box.x1,
+ dst_box.y2 - dst_box.y1);
+ b++;
+ }
+
+ FreePicture(src, None);
+ FreePicture(dst, None);
+}
+
+/*
+ * this function can possibly be improved and optimised, by clipping
+ * instead of iterating
+ * Drivers are free to implement their own version of this.
+ */
+Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty)
+{
+ ScreenPtr pScreen = dirty->src->drawable.pScreen;
+ RegionPtr region = DamageRegion(dirty->damage);
+ PixmapPtr dst;
+ SourceValidateProcPtr SourceValidate;
+ RegionRec pixregion;
+ BoxRec box;
+
+ dst = dirty->slave_dst->master_pixmap;
+ if (!dst)
+ dst = dirty->slave_dst;
+
+ box.x1 = 0;
+ box.y1 = 0;
+ if (dirty->rotation == RR_Rotate_90 ||
+ dirty->rotation == RR_Rotate_270) {
+ box.x2 = dst->drawable.height;
+ box.y2 = dst->drawable.width;
+ } else {
+ box.x2 = dst->drawable.width;
+ box.y2 = dst->drawable.height;
+ }
+ RegionInit(&pixregion, &box, 1);
+
+ /*
+ * SourceValidate is used by the software cursor code
+ * to pull the cursor off of the screen when reading
+ * bits from the frame buffer. Bypassing this function
+ * leaves the software cursor in place
+ */
+ SourceValidate = pScreen->SourceValidate;
+ pScreen->SourceValidate = NULL;
+
+ RegionTranslate(&pixregion, dirty->x, dirty->y);
+ RegionIntersect(&pixregion, &pixregion, region);
+
+ if (RegionNil(&pixregion)) {
+ RegionUninit(&pixregion);
+ return FALSE;
+ }
+
+ RegionTranslate(&pixregion, -dirty->x, -dirty->y);
+
+ if (!pScreen->root || dirty->rotation == RR_Rotate_0)
+ PixmapDirtyCopyArea(dst, dirty, &pixregion);
+ else
+ PixmapDirtyCompositeRotate(dst, dirty, &pixregion);
pScreen->SourceValidate = SourceValidate;
return TRUE;
}
diff --git a/xserver/dix/property.c b/xserver/dix/property.c
index ff7f31aa9..99608af72 100644
--- a/xserver/dix/property.c
+++ b/xserver/dix/property.c
@@ -136,8 +136,8 @@ ProcRotateProperties(ClientPtr client)
return rc;
atoms = (Atom *) &stuff[1];
- props = malloc(stuff->nAtoms * sizeof(PropertyPtr));
- saved = malloc(stuff->nAtoms * sizeof(PropertyRec));
+ props = xallocarray(stuff->nAtoms, sizeof(PropertyPtr));
+ saved = xallocarray(stuff->nAtoms, sizeof(PropertyRec));
if (!props || !saved) {
rc = BadAlloc;
goto out;
@@ -313,7 +313,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
/* do nothing */
}
else if (mode == PropModeAppend) {
- data = malloc((pProp->size + len) * sizeInBytes);
+ data = xallocarray(pProp->size + len, sizeInBytes);
if (!data)
return BadAlloc;
memcpy(data, pProp->data, pProp->size * sizeInBytes);
@@ -322,7 +322,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
pProp->size += len;
}
else if (mode == PropModePrepend) {
- data = malloc(sizeInBytes * (len + pProp->size));
+ data = xallocarray(len + pProp->size, sizeInBytes);
if (!data)
return BadAlloc;
memcpy(data + totalSize, pProp->data, pProp->size * sizeInBytes);
@@ -581,7 +581,7 @@ ProcListProperties(ClientPtr client)
for (pProp = wUserProps(pWin); pProp; pProp = pProp->next)
numProps++;
- if (numProps && !(pAtoms = malloc(numProps * sizeof(Atom))))
+ if (numProps && !(pAtoms = xallocarray(numProps, sizeof(Atom))))
return BadAlloc;
numProps = 0;
diff --git a/xserver/dix/protocol.txt b/xserver/dix/protocol.txt
index 731844c15..244556a08 100644
--- a/xserver/dix/protocol.txt
+++ b/xserver/dix/protocol.txt
@@ -290,6 +290,9 @@ R038 RANDR:RRConfigureProviderProperty
R039 RANDR:RRChangeProviderProperty
R040 RANDR:RRDeleteProviderProperty
R041 RANDR:RRGetProviderProperty
+R042 RANDR:GetMonitors
+R043 RANDR:SetMonitor
+R044 RANDR:DeleteMonitor
V000 RANDR:ScreenChangeNotify
V001 RANDR:Notify
E000 RANDR:BadRROutput
diff --git a/xserver/dix/region.c b/xserver/dix/region.c
index 04e590170..fd7313990 100644
--- a/xserver/dix/region.c
+++ b/xserver/dix/region.c
@@ -1247,7 +1247,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap)
if (sizeRI == numRI) {
/* Oops, allocate space for new region information */
sizeRI <<= 1;
- rit = (RegionInfo *) realloc(ri, sizeRI * sizeof(RegionInfo));
+ rit = (RegionInfo *) reallocarray(ri, sizeRI, sizeof(RegionInfo));
if (!rit)
goto bail;
ri = rit;
diff --git a/xserver/dix/resource.c b/xserver/dix/resource.c
index 964f0b306..ad71b2437 100644
--- a/xserver/dix/resource.c
+++ b/xserver/dix/resource.c
@@ -510,7 +510,7 @@ CreateNewResourceType(DeleteType deleteFunc, const char *name)
if (next & lastResourceClass)
return 0;
- types = realloc(resourceTypes, (next + 1) * sizeof(*resourceTypes));
+ types = reallocarray(resourceTypes, next + 1, sizeof(*resourceTypes));
if (!types)
return 0;
@@ -600,6 +600,29 @@ CreateNewResourceClass(void)
static ClientResourceRec clientTable[MAXCLIENTS];
+static unsigned int
+ilog2(int val)
+{
+ int bits;
+
+ if (val <= 0)
+ return 0;
+ for (bits = 0; val != 0; bits++)
+ val >>= 1;
+ return bits - 1;
+}
+
+/*****************
+ * ResourceClientBits
+ * Returns the client bit offset in the client + resources ID field
+ *****************/
+
+unsigned int
+ResourceClientBits(void)
+{
+ return (ilog2(LimitClients));
+}
+
/*****************
* InitClientResources
* When a new client is created, call this to allocate space
@@ -834,10 +857,10 @@ RebuildTable(int client)
*/
j = 2 * clientTable[client].buckets;
- tails = malloc(j * sizeof(ResourcePtr *));
+ tails = xallocarray(j, sizeof(ResourcePtr *));
if (!tails)
return;
- resources = malloc(j * sizeof(ResourcePtr));
+ resources = xallocarray(j, sizeof(ResourcePtr));
if (!resources) {
free(tails);
return;
@@ -883,7 +906,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
int *eltptr;
int elements;
- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) {
+ if (((cid = CLIENT_ID(id)) < LimitClients) && clientTable[cid].buckets) {
head = &clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)];
eltptr = &clientTable[cid].elements;
@@ -917,7 +940,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
ResourcePtr res;
ResourcePtr *prev, *head;
- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) {
+ if (((cid = CLIENT_ID(id)) < LimitClients) && clientTable[cid].buckets) {
head = &clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)];
prev = head;
@@ -952,7 +975,7 @@ ChangeResourceValue(XID id, RESTYPE rtype, void *value)
int cid;
ResourcePtr res;
- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) {
+ if (((cid = CLIENT_ID(id)) < LimitClients) && clientTable[cid].buckets) {
res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)];
for (; res; res = res->next)
@@ -1190,7 +1213,7 @@ dixLookupResourceByType(void **result, XID id, RESTYPE rtype,
if ((rtype & TypeMask) > lastResourceType)
return BadImplementation;
- if ((cid < MAXCLIENTS) && clientTable[cid].buckets) {
+ if ((cid < LimitClients) && clientTable[cid].buckets) {
res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)];
for (; res; res = res->next)
@@ -1223,7 +1246,7 @@ dixLookupResourceByClass(void **result, XID id, RESTYPE rclass,
*result = NULL;
- if ((cid < MAXCLIENTS) && clientTable[cid].buckets) {
+ if ((cid < LimitClients) && clientTable[cid].buckets) {
res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)];
for (; res; res = res->next)
diff --git a/xserver/dix/touch.c b/xserver/dix/touch.c
index 1eeed78bd..54da13247 100644
--- a/xserver/dix/touch.c
+++ b/xserver/dix/touch.c
@@ -101,7 +101,7 @@ TouchResizeQueue(ClientPtr client, void *closure)
* don't need to do it often */
size = dev->last.num_touches + dev->last.num_touches / 2 + 1;
- tmp = realloc(dev->last.touches, size * sizeof(*dev->last.touches));
+ tmp = reallocarray(dev->last.touches, size, sizeof(*dev->last.touches));
if (tmp) {
int j;
@@ -350,7 +350,7 @@ TouchBeginTouch(DeviceIntPtr dev, int sourceid, uint32_t touchid,
/* If we get here, then we've run out of touches: enlarge dev->touch and
* try again. */
- tmp = realloc(t->touches, (t->num_touches + 1) * sizeof(*ti));
+ tmp = reallocarray(t->touches, t->num_touches + 1, sizeof(*ti));
if (tmp) {
t->touches = tmp;
t->num_touches++;
@@ -464,7 +464,7 @@ TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev)
/* FIXME: proper overflow fixes */
if (ti->history_elements > ti->history_size - 1) {
ti->history_elements = ti->history_size - 1;
- DebugF("source device %d: history size %d overflowing for touch %u\n",
+ DebugF("source device %d: history size %zu overflowing for touch %u\n",
ti->sourceid, ti->history_size, ti->client_id);
}
}
@@ -547,8 +547,8 @@ TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite)
return FALSE;
if (srcsprite->spriteTraceGood > sprite->spriteTraceSize) {
- trace = realloc(sprite->spriteTrace,
- srcsprite->spriteTraceSize * sizeof(*trace));
+ trace = reallocarray(sprite->spriteTrace,
+ srcsprite->spriteTraceSize, sizeof(*trace));
if (!trace) {
sprite->spriteTraceGood = 0;
return FALSE;
diff --git a/xserver/dix/window.c b/xserver/dix/window.c
index d49276c98..ead4dc27f 100644
--- a/xserver/dix/window.c
+++ b/xserver/dix/window.c
@@ -127,6 +127,7 @@ Equipment Corporation.
#include "compint.h"
#endif
#include "selection.h"
+#include "inpututils.h"
#include "privates.h"
#include "xace.h"
@@ -220,7 +221,6 @@ log_window_info(WindowPtr pWin, int depth)
int i;
const char *win_name, *visibility;
BoxPtr rects;
- ScreenPtr pScreen = pWin->drawable.pScreen;
for (i = 0; i < (depth << 2); i++)
ErrorF(" ");
@@ -240,7 +240,7 @@ log_window_info(WindowPtr pWin, int depth)
ErrorF(" (%s compositing: pixmap %x)",
(pWin->redirectDraw == RedirectDrawAutomatic) ?
"automatic" : "manual",
- (unsigned) pScreen->GetWindowPixmap(pWin)->drawable.id);
+ (unsigned) pWin->drawable.pScreen->GetWindowPixmap(pWin)->drawable.id);
#endif
switch (pWin->visibility) {
@@ -259,10 +259,10 @@ log_window_info(WindowPtr pWin, int depth)
}
ErrorF(", %s", visibility);
- if (REGION_NOTEMPTY(pScreen, &pWin->clipList)) {
+ if (RegionNotEmpty(&pWin->clipList)) {
ErrorF(", clip list:");
- rects = REGION_RECTS(&pWin->clipList);
- for (i = 0; i < REGION_NUM_RECTS(&pWin->clipList); i++)
+ rects = RegionRects(&pWin->clipList);
+ for (i = 0; i < RegionNumRects(&pWin->clipList); i++)
ErrorF(" [(%d, %d) to (%d, %d)]",
rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2);
ErrorF("; extents [(%d, %d) to (%d, %d)]",
@@ -273,6 +273,131 @@ log_window_info(WindowPtr pWin, int depth)
ErrorF("\n");
}
+static const char*
+grab_grabtype_to_text(GrabPtr pGrab)
+{
+ switch (pGrab->grabtype) {
+ case XI2:
+ return "xi2";
+ case CORE:
+ return "core";
+ default:
+ return "xi1";
+ }
+}
+
+static const char*
+grab_type_to_text(GrabPtr pGrab)
+{
+ switch (pGrab->type) {
+ case ButtonPress:
+ return "ButtonPress";
+ case KeyPress:
+ return "KeyPress";
+ case XI_Enter:
+ return "XI_Enter";
+ case XI_FocusIn:
+ return "XI_FocusIn";
+ default:
+ return "unknown?!";
+ }
+}
+
+static void
+log_grab_info(void *value, XID id, void *cdata)
+{
+ int i, j;
+ GrabPtr pGrab = (GrabPtr)value;
+
+ ErrorF(" grab 0x%lx (%s), type '%s' on window 0x%lx\n",
+ (unsigned long) pGrab->resource,
+ grab_grabtype_to_text(pGrab),
+ grab_type_to_text(pGrab),
+ (unsigned long) pGrab->window->drawable.id);
+ ErrorF(" detail %d (mask %lu), modifiersDetail %d (mask %lu)\n",
+ pGrab->detail.exact,
+ pGrab->detail.pMask ? (unsigned long) *(pGrab->detail.pMask) : 0,
+ pGrab->modifiersDetail.exact,
+ pGrab->modifiersDetail.pMask ?
+ (unsigned long) *(pGrab->modifiersDetail.pMask) :
+ (unsigned long) 0);
+ ErrorF(" device '%s' (%d), modifierDevice '%s' (%d)\n",
+ pGrab->device->name, pGrab->device->id,
+ pGrab->modifierDevice->name, pGrab->modifierDevice->id);
+ if (pGrab->grabtype == CORE) {
+ ErrorF(" core event mask 0x%lx\n",
+ (unsigned long) pGrab->eventMask);
+ }
+ else if (pGrab->grabtype == XI) {
+ ErrorF(" xi1 event mask 0x%lx\n",
+ (unsigned long) pGrab->eventMask);
+ }
+ else if (pGrab->grabtype == XI2) {
+ for (i = 0; i < xi2mask_num_masks(pGrab->xi2mask); i++) {
+ const unsigned char *mask;
+ int print;
+
+ print = 0;
+ for (j = 0; j < XI2MASKSIZE; j++) {
+ mask = xi2mask_get_one_mask(pGrab->xi2mask, i);
+ if (mask[j]) {
+ print = 1;
+ break;
+ }
+ }
+ if (!print)
+ continue;
+ ErrorF(" xi2 event mask 0x");
+ for (j = 0; j < xi2mask_mask_size(pGrab->xi2mask); j++)
+ ErrorF("%x ", mask[j]);
+ ErrorF("\n");
+ }
+ }
+ ErrorF(" owner-events %s, kb %d ptr %d, confine 0x%lx, cursor 0x%lx\n",
+ pGrab->ownerEvents ? "true" : "false",
+ pGrab->keyboardMode, pGrab->pointerMode,
+ pGrab->confineTo ? (unsigned long) pGrab->confineTo->drawable.id : 0,
+ pGrab->cursor ? (unsigned long) pGrab->cursor->id : 0);
+}
+
+void
+PrintPassiveGrabs(void)
+{
+ int i;
+ LocalClientCredRec *lcc;
+ pid_t clientpid;
+ const char *cmdname;
+ const char *cmdargs;
+
+ ErrorF("Printing all currently registered grabs\n");
+
+ for (i = 1; i < currentMaxClients; i++) {
+ if (!clients[i] || clients[i]->clientState != ClientStateRunning)
+ continue;
+
+ clientpid = GetClientPid(clients[i]);
+ cmdname = GetClientCmdName(clients[i]);
+ cmdargs = GetClientCmdArgs(clients[i]);
+ if ((clientpid > 0) && (cmdname != NULL)) {
+ ErrorF(" Printing all registered grabs of client pid %ld %s %s\n",
+ (long) clientpid, cmdname, cmdargs ? cmdargs : "");
+ } else {
+ if (GetLocalClientCreds(clients[i], &lcc) == -1) {
+ ErrorF(" GetLocalClientCreds() failed\n");
+ continue;
+ }
+ ErrorF(" Printing all registered grabs of client pid %ld uid %ld gid %ld\n",
+ (lcc->fieldsSet & LCC_PID_SET) ? (long) lcc->pid : 0,
+ (lcc->fieldsSet & LCC_UID_SET) ? (long) lcc->euid : 0,
+ (lcc->fieldsSet & LCC_GID_SET) ? (long) lcc->egid : 0);
+ FreeLocalClientCreds(lcc);
+ }
+
+ FindClientResourcesByType(clients[i], RT_PASSIVEGRAB, log_grab_info, NULL);
+ }
+ ErrorF("End list of registered passive grabs\n");
+}
+
void
PrintWindowTree(void)
{
@@ -380,10 +505,7 @@ SetWindowToDefaults(WindowPtr pWin)
pWin->forcedBS = FALSE;
pWin->redirectDraw = RedirectDrawNone;
pWin->forcedBG = FALSE;
-
-#ifdef ROOTLESS
- pWin->rootlessUnhittable = FALSE;
-#endif
+ pWin->unhittable = FALSE;
#ifdef COMPOSITE
pWin->damagedDescendants = FALSE;
@@ -1470,7 +1592,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
RegionNull(&exposed);
RegionSubtract(&exposed, &pWin->borderClip, &pWin->winSize);
- miPaintWindow(pWin, &exposed, PW_BORDER);
+ pWin->drawable.pScreen->PaintWindow(pWin, &exposed, PW_BORDER);
RegionUninit(&exposed);
}
return error;
@@ -3037,7 +3159,7 @@ dixSaveScreens(ClientPtr client, int on, int mode)
/* make it look like screen saver is off, so that
* NotClippedByChildren will compute a clip list
- * for the root window, so miPaintWindow works
+ * for the root window, so PaintWindow works
*/
screenIsSaved = SCREEN_SAVER_OFF;
(*pWin->drawable.pScreen->MoveWindow) (pWin,
@@ -3525,7 +3647,7 @@ WindowParentHasDeviceCursor(WindowPtr pWin,
* all of the windows
*/
void
-SetRootClip(ScreenPtr pScreen, Bool enable)
+SetRootClip(ScreenPtr pScreen, int enable)
{
WindowPtr pWin = pScreen->root;
WindowPtr pChild;
@@ -3533,6 +3655,7 @@ SetRootClip(ScreenPtr pScreen, Bool enable)
Bool anyMarked = FALSE;
WindowPtr pLayerWin;
BoxRec box;
+ enum RootClipMode mode = enable;
if (!pWin)
return;
@@ -3557,23 +3680,32 @@ SetRootClip(ScreenPtr pScreen, Bool enable)
}
}
- /*
- * Use REGION_BREAK to avoid optimizations in ValidateTree
- * that assume the root borderClip can't change well, normally
- * it doesn't...)
- */
- if (enable) {
+ if (mode != ROOT_CLIP_NONE) {
+ pWin->drawable.width = pScreen->width;
+ pWin->drawable.height = pScreen->height;
+
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
+
RegionInit(&pWin->winSize, &box, 1);
RegionInit(&pWin->borderSize, &box, 1);
- if (WasViewable)
- RegionReset(&pWin->borderClip, &box);
- pWin->drawable.width = pScreen->width;
- pWin->drawable.height = pScreen->height;
+
+ /*
+ * Use REGION_BREAK to avoid optimizations in ValidateTree
+ * that assume the root borderClip can't change well, normally
+ * it doesn't...)
+ */
RegionBreak(&pWin->clipList);
+
+ /* For INPUT_ONLY, empty the borderClip so no rendering will ever
+ * be attempted to the screen pixmap (only redirected windows),
+ * but we keep borderSize as full regardless. */
+ if (WasViewable && mode == ROOT_CLIP_FULL)
+ RegionReset(&pWin->borderClip, &box);
+ else
+ RegionEmpty(&pWin->borderClip);
}
else {
RegionEmpty(&pWin->borderClip);
diff --git a/xserver/doc/Makefile.in b/xserver/doc/Makefile.in
index 4d358b6fa..b2844e15b 100644
--- a/xserver/doc/Makefile.in
+++ b/xserver/doc/Makefile.in
@@ -76,8 +76,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -244,7 +243,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -374,8 +372,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/doc/Xinput.xml b/xserver/doc/Xinput.xml
index 7f576a135..083b10908 100644
--- a/xserver/doc/Xinput.xml
+++ b/xserver/doc/Xinput.xml
@@ -61,7 +61,7 @@ The functionality is implemented by
routines that typically reside in the server source tree directory
extensions/server/xinput.
This extension includes functions to enable and disable input extension devices,
-select input, grab and focus those device, query and change key
+select input, grab and focus those devices, query and change key
and button mappings, and others. The only input extension requirements
for the device-dependent part of X are that the input devices be
correctly initialized and input events from those devices be correctly
@@ -362,7 +362,7 @@ server to begin checking for available input from this device.
</para>
<para>
<!-- .LP -->
-&gt;From InitAndStartDevices, EnableDevice is called for all devices that have
+From InitAndStartDevices, EnableDevice is called for all devices that have
the "inited" and "startup" fields in the DeviceIntRec set to TRUE. The
"inited" field is set by InitAndStartDevices to the value returned by
the deviceproc when called with a mode value of DEVICE_INIT. The "startup"
@@ -420,7 +420,7 @@ FocusClass - the device can be focused.
</listitem>
<listitem>
<para>
-FeedbackClass - the device supports some kind of feedback
+FeedbackClass - the device supports some kind of feedback.
<!-- .in -5n -->
<!-- .RE -->
</para>
@@ -446,7 +446,7 @@ This function is provided to allocate and initialize a KeyClassRec, and
should be called for extension devices that have keys. It is passed a pointer
to the device, and pointers to arrays of keysyms and modifiers reported by
the device. It returns FALSE if the KeyClassRec could not be allocated,
-or if the maps for the keysyms and and modifiers could not be allocated.
+or if the maps for the keysyms and modifiers could not be allocated.
Its parameters are:
</para>
<para>
@@ -702,7 +702,7 @@ InitStringFeedbackClassDeviceStruct(dev, controlProc, max_symbols,
num_symbols_supported, symbols)
DeviceIntPtr dev;
void (*controlProc)();
- int max_symbols:
+ int max_symbols;
int num_symbols_supported;
KeySym *symbols;
</literallayout>
@@ -905,7 +905,7 @@ such a device.
<para>
<!-- .LP -->
The default implementation is to always return a BadMatch error. If the
-implementation does not support any input devices that are allow their
+implementation does not support any input devices that allow their
valuators to be set, the default implementation may be left unchanged.
</para>
</sect2>
@@ -1003,7 +1003,7 @@ initialized.
</para>
<para>
<!-- .LP -->
-The data structures that define these
+The data structures that describe these
events are defined in the file <function>extensions/include/XIproto.h</function>. Other
input extension constants needed by DDX are defined in the file
<function>extensions/include/XI.h</function>.
@@ -1035,7 +1035,7 @@ deviceid - the identifier of the device that generated the event.
</listitem>
<listitem>
<para>
-device_state - the state of any modifiers on the device that generated the event
+device_state - the state of any modifiers on the device that generated the event.
</para>
</listitem>
<listitem>
@@ -1060,7 +1060,7 @@ valuator0 through valuator5 - the values of the valuators.
<!-- .LP -->
In order to pass this information to the input extension library, two 32-byte
wire events must be generated by DDX. The first has an event type of
-<function>DeviceKeyPress</function>, and the second has an event type of \fPDeviceValuator\fP.
+<function>DeviceKeyPress</function>, and the second has an event type of <function>DeviceValuator</function>.
</para>
<para>
<!-- .LP -->
@@ -1078,7 +1078,7 @@ The following code fragment shows how the two wire events could be initialized:
deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *) xE;
deviceValuator *xv;
- xev-&gt;type = DeviceKeyPress; /* defined by input extension */
+ xev-&gt;type = DeviceKeyPress; /* defined by input extension */
xev-&gt;detail = keycode; /* key pressed on this device */
xev-&gt;time = timestamp; /* same as for core events */
xev-&gt;rootX = pointerx; /* x location of core pointer */
@@ -1093,7 +1093,7 @@ The following code fragment shows how the two wire events could be initialized:
/* */
/******************************************************************/
- xev-&gt;deviceid = dev-&gt;id | MORE_EVENTS; /* sending more than 1*/
+ xev-&gt;deviceid = dev-&gt;id | MORE_EVENTS; /* sending more than 1 */
/******************************************************************/
/* Fields in the second 32-byte wire event: */
@@ -1152,7 +1152,7 @@ The following code fragment shows how the two wire events could be initialized:
/* */
/******************************************************************/
- xev-&gt;deviceid = dev-&gt;id | MORE_EVENTS; /* sending more than 1*/
+ xev-&gt;deviceid = dev-&gt;id | MORE_EVENTS; /* sending more than 1 */
/******************************************************************/
/* Fields in the second 32-byte wire event: */
diff --git a/xserver/doc/Xserver-spec.xml b/xserver/doc/Xserver-spec.xml
index 4c344194d..72a544b55 100644
--- a/xserver/doc/Xserver-spec.xml
+++ b/xserver/doc/Xserver-spec.xml
@@ -1992,7 +1992,7 @@ regions, these blocks may need to be reallocated by your region
software. For instance, in the sample server, a RegionRec has some
header information and a pointer to a dynamically allocated rectangle
list. Periodically, the rectangle list needs to be expanded with
-Xrealloc(), whereupon the new pointer is remembered in the RegionRec.</para>
+realloc(), whereupon the new pointer is remembered in the RegionRec.</para>
<para>
Most of the region operations come in two forms: a function pointer in
the Screen structure, and a macro. The server can be compiled so that
@@ -2598,7 +2598,7 @@ VisualRec data structure along with other display characteristics like the
depth and other numbers.</para>
<para>
The allowable DepthRec's and VisualRec's are pointed to by fields in the ScreenRec.
-These are set up when InitOutput() is called; you should Xalloc() appropriate blocks
+These are set up when InitOutput() is called; you should malloc() appropriate blocks
or use static variables initialized to the correct values.</para>
</section>
<section>
@@ -3897,7 +3897,7 @@ for CT_NONE, etc. are in Xserver/include/gc.h.) This routine is
responsible for incrementing any necessary reference counts (e.g. for
a pixmap clip mask) for the new clipmask and freeing anything that
used to be in the GC's clipMask field. The lists of rectangles passed
-in can be freed with Xfree(), the regions can be destroyed with the
+in can be freed with free(), the regions can be destroyed with the
RegionDestroy field in the screen, and pixmaps can be destroyed by
calling the screen's DestroyPixmap function. DIX and MI code expect
what they pass in to this to be freed or otherwise inaccessible, and
@@ -5104,9 +5104,6 @@ mi and fb implementations.</para>
<row><entry><function>WaitForSomething</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>WindowExposures</function></entry><entry><literal>mi</literal></entry><entry><para>Window</para></entry></row>
<row><entry><function>WriteToClient</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
-<row><entry><function>Xalloc</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
-<row><entry><function>Xfree</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
-<row><entry><function>Xrealloc</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
</tbody>
</tgroup>
</table>
diff --git a/xserver/doc/dtrace/Makefile.in b/xserver/doc/dtrace/Makefile.in
index 715f7f0ae..b20db22d3 100644
--- a/xserver/doc/dtrace/Makefile.in
+++ b/xserver/doc/dtrace/Makefile.in
@@ -79,8 +79,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -235,7 +234,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -365,8 +363,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/doc/smartsched b/xserver/doc/smartsched
index 057a759fd..bd7627410 100644
--- a/xserver/doc/smartsched
+++ b/xserver/doc/smartsched
@@ -196,9 +196,3 @@ updated in three ways:
The effect of these changes is to both improve interactive application
response and benchmark numbers at the same time.
-
-
-
-
-
-$XFree86: $
diff --git a/xserver/dri3/Makefile.in b/xserver/dri3/Makefile.in
index d3a635279..13baad2db 100644
--- a/xserver/dri3/Makefile.in
+++ b/xserver/dri3/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -245,7 +244,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -375,8 +373,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/dri3/dri3.c b/xserver/dri3/dri3.c
index 385862a3b..d042b8b7d 100644
--- a/xserver/dri3/dri3.c
+++ b/xserver/dri3/dri3.c
@@ -26,9 +26,8 @@
#include "dri3_priv.h"
-int dri3_request;
+static int dri3_request;
DevPrivateKeyRec dri3_screen_private_key;
-DevPrivateKeyRec dri3_window_private_key;
static int dri3_screen_generation;
diff --git a/xserver/dri3/dri3_priv.h b/xserver/dri3/dri3_priv.h
index e2fed839b..e61ef226c 100644
--- a/xserver/dri3/dri3_priv.h
+++ b/xserver/dri3/dri3_priv.h
@@ -32,8 +32,6 @@
#include <randrstr.h>
#include "dri3.h"
-extern int dri3_request;
-
extern DevPrivateKeyRec dri3_screen_private_key;
typedef struct dri3_screen_priv {
diff --git a/xserver/dri3/dri3_request.c b/xserver/dri3/dri3_request.c
index 2d7558863..2b3622148 100644
--- a/xserver/dri3/dri3_request.c
+++ b/xserver/dri3/dri3_request.c
@@ -312,6 +312,8 @@ int
proc_dri3_dispatch(ClientPtr client)
{
REQUEST(xReq);
+ if (!client->local)
+ return BadMatch;
if (stuff->data >= DRI3NumberRequests || !proc_dri3_vector[stuff->data])
return BadRequest;
return (*proc_dri3_vector[stuff->data]) (client);
@@ -405,6 +407,8 @@ int
sproc_dri3_dispatch(ClientPtr client)
{
REQUEST(xReq);
+ if (!client->local)
+ return BadMatch;
if (stuff->data >= DRI3NumberRequests || !sproc_dri3_vector[stuff->data])
return BadRequest;
return (*sproc_dri3_vector[stuff->data]) (client);
diff --git a/xserver/exa/Makefile.am b/xserver/exa/Makefile.am
index 6a09966f8..00b28b1e4 100644
--- a/xserver/exa/Makefile.am
+++ b/xserver/exa/Makefile.am
@@ -4,9 +4,7 @@ if XORG
sdk_HEADERS = exa.h
endif
-AM_CPPFLAGS = \
- $(XORG_INCS) \
- -I$(srcdir)/../miext/cw
+AM_CPPFLAGS = $(XORG_INCS)
AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS)
diff --git a/xserver/exa/Makefile.in b/xserver/exa/Makefile.in
index 1729314ba..8c062f4ce 100644
--- a/xserver/exa/Makefile.in
+++ b/xserver/exa/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -248,7 +247,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -378,8 +376,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -505,10 +501,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = libexa.la
@XORG_TRUE@sdk_HEADERS = exa.h
-AM_CPPFLAGS = \
- $(XORG_INCS) \
- -I$(srcdir)/../miext/cw
-
+AM_CPPFLAGS = $(XORG_INCS)
AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS)
libexa_la_SOURCES = \
exa.c \
diff --git a/xserver/exa/exa_accel.c b/xserver/exa/exa_accel.c
index 5aa7d1078..b26d5c804 100644
--- a/xserver/exa/exa_accel.c
+++ b/xserver/exa/exa_accel.c
@@ -386,7 +386,7 @@ exaHWCopyNtoN(DrawablePtr pSrcDrawable,
exaGetDrawableDeltas(pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y);
exaGetDrawableDeltas(pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y);
- rects = malloc(nbox * sizeof(xRectangle));
+ rects = xallocarray(nbox, sizeof(xRectangle));
if (rects) {
int i;
@@ -626,7 +626,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
return;
}
- prect = malloc(sizeof(xRectangle) * npt);
+ prect = xallocarray(npt, sizeof(xRectangle));
for (i = 0; i < npt; i++) {
prect[i].x = ppt[i].x;
prect[i].y = ppt[i].y;
@@ -667,7 +667,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
return;
}
- prect = malloc(sizeof(xRectangle) * (npt - 1));
+ prect = xallocarray(npt - 1, sizeof(xRectangle));
x1 = ppt[0].x;
y1 = ppt[0].y;
/* If we have any non-horizontal/vertical, fall back. */
@@ -738,7 +738,7 @@ exaPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg)
}
}
- prect = malloc(sizeof(xRectangle) * nseg);
+ prect = xallocarray(nseg, sizeof(xRectangle));
for (i = 0; i < nseg; i++) {
if (pSeg[i].x1 < pSeg[i].x2) {
prect[i].x = pSeg[i].x1;
diff --git a/xserver/exa/exa_glyphs.c b/xserver/exa/exa_glyphs.c
index 41f3694f2..cf21ea914 100644
--- a/xserver/exa/exa_glyphs.c
+++ b/xserver/exa/exa_glyphs.c
@@ -211,8 +211,8 @@ exaRealizeGlyphCaches(ScreenPtr pScreen, unsigned int format)
cache->picture = pPicture;
cache->picture->refcnt++;
- cache->hashEntries = malloc(sizeof(int) * cache->hashSize);
- cache->glyphs = malloc(sizeof(ExaCachedGlyphRec) * cache->size);
+ cache->hashEntries = xallocarray(cache->hashSize, sizeof(int));
+ cache->glyphs = xallocarray(cache->size, sizeof(ExaCachedGlyphRec));
cache->glyphCount = 0;
if (!cache->hashEntries || !cache->glyphs)
diff --git a/xserver/exa/exa_migration_mixed.c b/xserver/exa/exa_migration_mixed.c
index cf66327b3..7d3fca7c0 100644
--- a/xserver/exa/exa_migration_mixed.c
+++ b/xserver/exa/exa_migration_mixed.c
@@ -205,8 +205,8 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
/* Do we need to allocate our system buffer? */
if (!pExaPixmap->sys_ptr) {
- pExaPixmap->sys_ptr = malloc(pExaPixmap->sys_pitch *
- pPixmap->drawable.height);
+ pExaPixmap->sys_ptr = xallocarray(pExaPixmap->sys_pitch,
+ pPixmap->drawable.height);
if (!pExaPixmap->sys_ptr)
FatalError("EXA: malloc failed for size %d bytes\n",
pExaPixmap->sys_pitch * pPixmap->drawable.height);
diff --git a/xserver/fb/Makefile.in b/xserver/fb/Makefile.in
index fcc7e4c29..430f9b9ae 100644
--- a/xserver/fb/Makefile.in
+++ b/xserver/fb/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -277,7 +276,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -407,8 +405,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/fb/fbcopy.c b/xserver/fb/fbcopy.c
index 5bbabc39f..6af10ccf7 100644
--- a/xserver/fb/fbcopy.c
+++ b/xserver/fb/fbcopy.c
@@ -194,7 +194,7 @@ fbCopyNto1(DrawablePtr pSrcDrawable,
height = pbox->y2 - pbox->y1;
tmpStride = ((width + FB_STIP_MASK) >> FB_STIP_SHIFT);
- tmp = malloc(tmpStride * height * sizeof(FbStip));
+ tmp = xallocarray(tmpStride * height, sizeof(FbStip));
if (!tmp)
return;
diff --git a/xserver/fb/fbpict.c b/xserver/fb/fbpict.c
index 5f6c88ec8..7ea0b668f 100644
--- a/xserver/fb/fbpict.c
+++ b/xserver/fb/fbpict.c
@@ -124,7 +124,7 @@ fbGlyphs(CARD8 op,
pixman_glyph_cache_freeze (glyphCache);
if (n_glyphs > N_STACK_GLYPHS) {
- if (!(pglyphs = malloc (n_glyphs * sizeof (pixman_glyph_t))))
+ if (!(pglyphs = xallocarray(n_glyphs, sizeof(pixman_glyph_t))))
goto out;
}
diff --git a/xserver/glamor/Makefile.am b/xserver/glamor/Makefile.am
index db72cb11c..c631c530b 100644
--- a/xserver/glamor/Makefile.am
+++ b/xserver/glamor/Makefile.am
@@ -14,7 +14,7 @@ libglamor_la_SOURCES = \
glamor_font.c \
glamor_font.h \
glamor_glx.c \
- glamor_glyphs.c \
+ glamor_composite_glyphs.c \
glamor_image.c \
glamor_lines.c \
glamor_segs.c \
@@ -46,10 +46,14 @@ libglamor_la_SOURCES = \
glamor_compositerects.c\
glamor_utils.c\
glamor_utils.h\
- glamor_xv.c \
glamor_sync.c \
glamor.h
+if XV
+libglamor_la_SOURCES += \
+ glamor_xv.c
+endif
+
libglamor_egl_stubs_la_SOURCES = glamor_egl_stubs.c
sdk_HEADERS = glamor.h
diff --git a/xserver/glamor/Makefile.in b/xserver/glamor/Makefile.in
index 53a28429e..c277ec5ee 100644
--- a/xserver/glamor/Makefile.in
+++ b/xserver/glamor/Makefile.in
@@ -51,6 +51,9 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
+@XV_TRUE@am__append_1 = \
+@XV_TRUE@ glamor_xv.c
+
subdir = glamor
DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
@@ -58,8 +61,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -76,17 +78,33 @@ CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
am__DEPENDENCIES_1 =
libglamor_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am__libglamor_la_SOURCES_DIST = glamor.c glamor_context.h \
+ glamor_copy.c glamor_core.c glamor_dash.c glamor_debug.h \
+ glamor_font.c glamor_font.h glamor_glx.c \
+ glamor_composite_glyphs.c glamor_image.c glamor_lines.c \
+ glamor_segs.c glamor_render.c glamor_gradient.c \
+ glamor_prepare.c glamor_prepare.h glamor_program.c \
+ glamor_program.h glamor_rects.c glamor_spans.c glamor_text.c \
+ glamor_transfer.c glamor_transfer.h glamor_transform.c \
+ glamor_transform.h glamor_trapezoid.c glamor_triangles.c \
+ glamor_addtraps.c glamor_glyphblt.c glamor_points.c \
+ glamor_priv.h glamor_pixmap.c glamor_largepixmap.c \
+ glamor_picture.c glamor_vbo.c glamor_window.c glamor_fbo.c \
+ glamor_compositerects.c glamor_utils.c glamor_utils.h \
+ glamor_sync.c glamor.h glamor_xv.c
+@XV_TRUE@am__objects_1 = glamor_xv.lo
am_libglamor_la_OBJECTS = glamor.lo glamor_copy.lo glamor_core.lo \
- glamor_dash.lo glamor_font.lo glamor_glx.lo glamor_glyphs.lo \
- glamor_image.lo glamor_lines.lo glamor_segs.lo \
- glamor_render.lo glamor_gradient.lo glamor_prepare.lo \
- glamor_program.lo glamor_rects.lo glamor_spans.lo \
- glamor_text.lo glamor_transfer.lo glamor_transform.lo \
- glamor_trapezoid.lo glamor_triangles.lo glamor_addtraps.lo \
- glamor_glyphblt.lo glamor_points.lo glamor_pixmap.lo \
- glamor_largepixmap.lo glamor_picture.lo glamor_vbo.lo \
- glamor_window.lo glamor_fbo.lo glamor_compositerects.lo \
- glamor_utils.lo glamor_xv.lo glamor_sync.lo
+ glamor_dash.lo glamor_font.lo glamor_glx.lo \
+ glamor_composite_glyphs.lo glamor_image.lo glamor_lines.lo \
+ glamor_segs.lo glamor_render.lo glamor_gradient.lo \
+ glamor_prepare.lo glamor_program.lo glamor_rects.lo \
+ glamor_spans.lo glamor_text.lo glamor_transfer.lo \
+ glamor_transform.lo glamor_trapezoid.lo glamor_triangles.lo \
+ glamor_addtraps.lo glamor_glyphblt.lo glamor_points.lo \
+ glamor_pixmap.lo glamor_largepixmap.lo glamor_picture.lo \
+ glamor_vbo.lo glamor_window.lo glamor_fbo.lo \
+ glamor_compositerects.lo glamor_utils.lo glamor_sync.lo \
+ $(am__objects_1)
libglamor_la_OBJECTS = $(am_libglamor_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -130,7 +148,7 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libglamor_la_SOURCES) $(libglamor_egl_stubs_la_SOURCES)
-DIST_SOURCES = $(libglamor_la_SOURCES) \
+DIST_SOURCES = $(am__libglamor_la_SOURCES_DIST) \
$(libglamor_egl_stubs_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
@@ -260,7 +278,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -390,8 +407,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -518,52 +533,20 @@ top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = libglamor.la libglamor_egl_stubs.la
libglamor_la_LIBADD = $(GLAMOR_LIBS)
AM_CFLAGS = $(CWARNFLAGS) $(DIX_CFLAGS) $(GLAMOR_CFLAGS)
-libglamor_la_SOURCES = \
- glamor.c \
- glamor_context.h \
- glamor_copy.c \
- glamor_core.c \
- glamor_dash.c \
- glamor_debug.h \
- glamor_font.c \
- glamor_font.h \
- glamor_glx.c \
- glamor_glyphs.c \
- glamor_image.c \
- glamor_lines.c \
- glamor_segs.c \
- glamor_render.c \
- glamor_gradient.c \
- glamor_prepare.c \
- glamor_prepare.h \
- glamor_program.c \
- glamor_program.h \
- glamor_rects.c \
- glamor_spans.c \
- glamor_text.c \
- glamor_transfer.c \
- glamor_transfer.h \
- glamor_transform.c \
- glamor_transform.h \
- glamor_trapezoid.c \
- glamor_triangles.c\
- glamor_addtraps.c\
- glamor_glyphblt.c\
- glamor_points.c\
- glamor_priv.h\
- glamor_pixmap.c\
- glamor_largepixmap.c\
- glamor_picture.c\
- glamor_vbo.c \
- glamor_window.c\
- glamor_fbo.c\
- glamor_compositerects.c\
- glamor_utils.c\
- glamor_utils.h\
- glamor_xv.c \
- glamor_sync.c \
- glamor.h
-
+libglamor_la_SOURCES = glamor.c glamor_context.h glamor_copy.c \
+ glamor_core.c glamor_dash.c glamor_debug.h glamor_font.c \
+ glamor_font.h glamor_glx.c glamor_composite_glyphs.c \
+ glamor_image.c glamor_lines.c glamor_segs.c glamor_render.c \
+ glamor_gradient.c glamor_prepare.c glamor_prepare.h \
+ glamor_program.c glamor_program.h glamor_rects.c \
+ glamor_spans.c glamor_text.c glamor_transfer.c \
+ glamor_transfer.h glamor_transform.c glamor_transform.h \
+ glamor_trapezoid.c glamor_triangles.c glamor_addtraps.c \
+ glamor_glyphblt.c glamor_points.c glamor_priv.h \
+ glamor_pixmap.c glamor_largepixmap.c glamor_picture.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
sdk_HEADERS = glamor.h
all: all-am
@@ -624,6 +607,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_addtraps.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_composite_glyphs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_compositerects.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_copy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_core.Plo@am__quote@
@@ -633,7 +617,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_font.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_glx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_glyphblt.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_glyphs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_gradient.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_image.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_largepixmap.Plo@am__quote@
diff --git a/xserver/glamor/glamor.c b/xserver/glamor/glamor.c
index 50317b481..8b5eb5493 100644
--- a/xserver/glamor/glamor.c
+++ b/xserver/glamor/glamor.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2008 Intel Corporation
+ * Copyright © 2008,2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -23,7 +23,7 @@
* Authors:
* Eric Anholt <eric@anholt.net>
* Zhigang Gong <zhigang.gong@linux.intel.com>
- *
+ * Chad Versace <chad.versace@linux.intel.com>
*/
/** @file glamor.c
@@ -34,6 +34,7 @@
#include <stdlib.h>
#include "glamor_priv.h"
+#include "mipict.h"
DevPrivateKeyRec glamor_screen_private_key;
DevPrivateKeyRec glamor_pixmap_private_key;
@@ -59,26 +60,29 @@ glamor_get_drawable_pixmap(DrawablePtr drawable)
return (PixmapPtr) drawable;
}
+static void
+glamor_init_pixmap_private_small(PixmapPtr pixmap, glamor_pixmap_private *pixmap_priv)
+{
+ pixmap_priv->box.x1 = 0;
+ pixmap_priv->box.x2 = pixmap->drawable.width;
+ pixmap_priv->box.y1 = 0;
+ pixmap_priv->box.y2 = pixmap->drawable.height;
+ pixmap_priv->block_w = pixmap->drawable.width;
+ pixmap_priv->block_h = pixmap->drawable.height;
+ pixmap_priv->block_hcnt = 1;
+ pixmap_priv->block_wcnt = 1;
+ pixmap_priv->box_array = &pixmap_priv->box;
+ pixmap_priv->fbo_array = &pixmap_priv->fbo;
+}
+
_X_EXPORT void
glamor_set_pixmap_type(PixmapPtr pixmap, glamor_pixmap_type_t type)
{
glamor_pixmap_private *pixmap_priv;
- glamor_screen_private *glamor_priv =
- glamor_get_screen_private(pixmap->drawable.pScreen);
- pixmap_priv = dixLookupPrivate(&pixmap->devPrivates,
- &glamor_pixmap_private_key);
- if (pixmap_priv == NULL) {
- pixmap_priv = calloc(sizeof(*pixmap_priv), 1);
- glamor_set_pixmap_private(pixmap, pixmap_priv);
- pixmap_priv->base.pixmap = pixmap;
- pixmap_priv->base.glamor_priv = glamor_priv;
- }
+ pixmap_priv = glamor_get_pixmap_private(pixmap);
pixmap_priv->type = type;
- pixmap_priv->base.box.x1 = 0;
- pixmap_priv->base.box.x2 = pixmap->drawable.width;
- pixmap_priv->base.box.y1 = 0;
- pixmap_priv->base.box.y2 = pixmap->drawable.height;
+ glamor_init_pixmap_private_small(pixmap, pixmap_priv);
}
_X_EXPORT void
@@ -93,9 +97,9 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex)
glamor_priv = glamor_get_screen_private(screen);
pixmap_priv = glamor_get_pixmap_private(pixmap);
- if (pixmap_priv->base.fbo) {
+ if (pixmap_priv->fbo) {
fbo = glamor_pixmap_detach_fbo(pixmap_priv);
- glamor_destroy_fbo(fbo);
+ glamor_destroy_fbo(glamor_priv, fbo);
}
format = gl_iformat_for_pixmap(pixmap);
@@ -119,10 +123,10 @@ glamor_set_screen_pixmap(PixmapPtr screen_pixmap, PixmapPtr *back_pixmap)
glamor_priv = glamor_get_screen_private(screen_pixmap->drawable.pScreen);
pixmap_priv = glamor_get_pixmap_private(screen_pixmap);
- glamor_priv->screen_fbo = pixmap_priv->base.fbo->fb;
+ glamor_priv->screen_fbo = pixmap_priv->fbo->fb;
- pixmap_priv->base.fbo->width = screen_pixmap->drawable.width;
- pixmap_priv->base.fbo->height = screen_pixmap->drawable.height;
+ pixmap_priv->fbo->width = screen_pixmap->drawable.width;
+ pixmap_priv->fbo->height = screen_pixmap->drawable.height;
}
uint32_t
@@ -133,7 +137,7 @@ glamor_get_pixmap_texture(PixmapPtr pixmap)
if (pixmap_priv->type != GLAMOR_TEXTURE_ONLY)
return 0;
- return pixmap_priv->base.fbo->tex;
+ return pixmap_priv->fbo->tex;
}
PixmapPtr
@@ -141,7 +145,6 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
unsigned int usage)
{
PixmapPtr pixmap;
- glamor_pixmap_type_t type = GLAMOR_TEXTURE_ONLY;
glamor_pixmap_private *pixmap_priv;
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
glamor_pixmap_fbo *fbo = NULL;
@@ -152,7 +155,9 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
return NullPixmap;
if ((usage == GLAMOR_CREATE_PIXMAP_CPU
- || (usage == CREATE_PIXMAP_USAGE_GLYPH_PICTURE && w <= 64 && h <= 64)
+ || (usage == CREATE_PIXMAP_USAGE_GLYPH_PICTURE &&
+ w <= glamor_priv->glyph_max_dim &&
+ h <= glamor_priv->glyph_max_dim)
|| (w == 0 && h == 0)
|| !glamor_check_pixmap_fbo_depth(depth))
|| (!GLAMOR_TEXTURED_LARGE_PIXMAP &&
@@ -161,46 +166,28 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
else
pixmap = fbCreatePixmap(screen, 0, 0, depth, usage);
- pixmap_priv = calloc(1, sizeof(*pixmap_priv));
-
- if (!pixmap_priv) {
- fbDestroyPixmap(pixmap);
- return fbCreatePixmap(screen, w, h, depth, usage);
- }
- glamor_set_pixmap_private(pixmap, pixmap_priv);
-
- if (usage == GLAMOR_CREATE_PIXMAP_MAP)
- type = GLAMOR_MEMORY_MAP;
-
- pixmap_priv->base.pixmap = pixmap;
- pixmap_priv->base.glamor_priv = glamor_priv;
+ pixmap_priv = glamor_get_pixmap_private(pixmap);
format = gl_iformat_for_pixmap(pixmap);
pitch = (((w * pixmap->drawable.bitsPerPixel + 7) / 8) + 3) & ~3;
screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, pitch, NULL);
+ pixmap_priv->type = GLAMOR_TEXTURE_ONLY;
+
if (usage == GLAMOR_CREATE_PIXMAP_NO_TEXTURE) {
- pixmap_priv->type = GLAMOR_TEXTURE_ONLY;
- pixmap_priv->base.box.x1 = 0;
- pixmap_priv->base.box.y1 = 0;
- pixmap_priv->base.box.x2 = w;
- pixmap_priv->base.box.y2 = h;
+ glamor_init_pixmap_private_small(pixmap, pixmap_priv);
return pixmap;
}
- else if (type == GLAMOR_MEMORY_MAP || usage == GLAMOR_CREATE_NO_LARGE ||
+ else if (usage == GLAMOR_CREATE_NO_LARGE ||
glamor_check_fbo_size(glamor_priv, w, h))
{
- pixmap_priv->type = type;
- pixmap_priv->base.box.x1 = 0;
- pixmap_priv->base.box.y1 = 0;
- pixmap_priv->base.box.x2 = w;
- pixmap_priv->base.box.y2 = h;
+ glamor_init_pixmap_private_small(pixmap, pixmap_priv);
fbo = glamor_create_fbo(glamor_priv, w, h, format, usage);
} else {
int tile_size = glamor_priv->max_fbo_size;
- DEBUGF("Create LARGE pixmap %p width %d height %d, tile size %d\n", pixmap, w, h, tile_size);
- pixmap_priv->type = GLAMOR_TEXTURE_LARGE;
+ DEBUGF("Create LARGE pixmap %p width %d height %d, tile size %d\n",
+ pixmap, w, h, tile_size);
fbo = glamor_create_fbo_array(glamor_priv, w, h, format, usage,
tile_size, tile_size, pixmap_priv);
}
@@ -219,13 +206,10 @@ void
glamor_destroy_textured_pixmap(PixmapPtr pixmap)
{
if (pixmap->refcnt == 1) {
- glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
- if (pixmap_priv != NULL) {
#if GLAMOR_HAS_GBM
- glamor_egl_destroy_pixmap_image(pixmap);
+ glamor_egl_destroy_pixmap_image(pixmap);
#endif
- glamor_set_pixmap_private(pixmap, NULL);
- }
+ glamor_pixmap_destroy_fbo(pixmap);
}
}
@@ -275,6 +259,68 @@ glamor_set_debug_level(int *debug_level)
int glamor_debug_level;
+void
+glamor_gldrawarrays_quads_using_indices(glamor_screen_private *glamor_priv,
+ unsigned count)
+{
+ unsigned i;
+
+ /* For a single quad, don't bother with an index buffer. */
+ if (count == 1)
+ goto fallback;
+
+ if (glamor_priv->ib_size < count) {
+ /* Basic GLES2 doesn't have any way to map buffer objects for
+ * writing, but it's long past time for drivers to have
+ * MapBufferRange.
+ */
+ if (!glamor_priv->has_map_buffer_range)
+ goto fallback;
+
+ /* Lazy create the buffer name, and only bind it once since
+ * none of the glamor code binds it to anything else.
+ */
+ if (!glamor_priv->ib) {
+ glGenBuffers(1, &glamor_priv->ib);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, glamor_priv->ib);
+ }
+
+ /* For now, only support GL_UNSIGNED_SHORTs. */
+ if (count > ((1 << 16) - 1) / 4) {
+ goto fallback;
+ } else {
+ uint16_t *data;
+ size_t size = count * 6 * sizeof(GLushort);
+
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, size, NULL, GL_STATIC_DRAW);
+ data = glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER,
+ 0, size,
+ GL_MAP_WRITE_BIT |
+ GL_MAP_INVALIDATE_BUFFER_BIT);
+ for (i = 0; i < count; i++) {
+ data[i * 6 + 0] = i * 4 + 0;
+ data[i * 6 + 1] = i * 4 + 1;
+ data[i * 6 + 2] = i * 4 + 2;
+ data[i * 6 + 3] = i * 4 + 0;
+ data[i * 6 + 4] = i * 4 + 2;
+ data[i * 6 + 5] = i * 4 + 3;
+ }
+ glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
+
+ glamor_priv->ib_size = count;
+ glamor_priv->ib_type = GL_UNSIGNED_SHORT;
+ }
+ }
+
+ glDrawElements(GL_TRIANGLES, count * 6, glamor_priv->ib_type, NULL);
+ return;
+
+fallback:
+ for (i = 0; i < count; i++)
+ glDrawArrays(GL_TRIANGLE_FAN, i * 4, 4);
+}
+
+
/**
* Creates any pixmaps used internally by glamor, since those can't be
* allocated at ScreenInit time.
@@ -291,16 +337,6 @@ glamor_create_screen_resources(ScreenPtr screen)
ret = screen->CreateScreenResources(screen);
screen->CreateScreenResources = glamor_create_screen_resources;
- if (!glamor_glyphs_init(screen)) {
- ErrorF("Failed to initialize glyphs\n");
- ret = FALSE;
- }
-
- if (!glamor_realize_glyph_caches(screen)) {
- ErrorF("Failed to initialize glyph cache\n");
- ret = FALSE;
- }
-
return ret;
}
@@ -333,17 +369,68 @@ glamor_check_instruction_count(int gl_version)
return TRUE;
}
+static void GLAPIENTRY
+glamor_debug_output_callback(GLenum source,
+ GLenum type,
+ GLuint id,
+ GLenum severity,
+ GLsizei length,
+ const GLchar *message,
+ const void *userParam)
+{
+ ScreenPtr screen = (void *)userParam;
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+
+ if (glamor_priv->suppress_gl_out_of_memory_logging &&
+ source == GL_DEBUG_SOURCE_API && type == GL_DEBUG_TYPE_ERROR) {
+ return;
+ }
+
+ LogMessageVerb(X_ERROR, 0, "glamor%d: GL error: %*s\n",
+ screen->myNum, length, message);
+}
+
+/**
+ * Configures GL_ARB_debug_output to give us immediate callbacks when
+ * GL errors occur, so that we can log them.
+ */
+static void
+glamor_setup_debug_output(ScreenPtr screen)
+{
+ if (!epoxy_has_gl_extension("GL_ARB_debug_output"))
+ return;
+
+ glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
+ /* Disable debugging messages other than GL API errors */
+ glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL,
+ GL_FALSE);
+ glDebugMessageControl(GL_DEBUG_SOURCE_API,
+ GL_DEBUG_TYPE_ERROR,
+ GL_DONT_CARE,
+ 0, NULL, GL_TRUE);
+ glDebugMessageCallback(glamor_debug_output_callback,
+ screen);
+
+ /* If KHR_debug is present, all debug output is disabled by
+ * default on non-debug contexts.
+ */
+ if (epoxy_has_gl_extension("GL_KHR_debug"))
+ glEnable(GL_DEBUG_OUTPUT);
+}
+
/** Set up glamor for an already-configured GL context. */
Bool
glamor_init(ScreenPtr screen, unsigned int flags)
{
glamor_screen_private *glamor_priv;
int gl_version;
+ int glsl_major, glsl_minor;
int max_viewport_size[2];
+ const char *shading_version_string;
+ int shading_version_offset;
-#ifdef RENDER
PictureScreenPtr ps = GetPictureScreenIfSet(screen);
-#endif
+
if (flags & ~GLAMOR_VALID_FLAGS) {
ErrorF("glamor_init: Invalid flags %x\n", flags);
return FALSE;
@@ -363,7 +450,8 @@ glamor_init(ScreenPtr screen, unsigned int flags)
glamor_set_screen_private(screen, glamor_priv);
- if (!dixRegisterPrivateKey(&glamor_pixmap_private_key, PRIVATE_PIXMAP, 0)) {
+ if (!dixRegisterPrivateKey(&glamor_pixmap_private_key, PRIVATE_PIXMAP,
+ sizeof(struct glamor_pixmap_private))) {
LogMessage(X_WARNING,
"glamor%d: Failed to allocate pixmap private\n",
screen->myNum);
@@ -399,14 +487,40 @@ glamor_init(ScreenPtr screen, unsigned int flags)
gl_version = epoxy_gl_version();
- /* Would be nice to have a cleaner test for GLSL 1.30 support,
- * but for now this should suffice
- */
- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && gl_version >= 30)
- glamor_priv->glsl_version = 130;
- else
- glamor_priv->glsl_version = 120;
+ shading_version_string = (char *) glGetString(GL_SHADING_LANGUAGE_VERSION);
+
+ if (!shading_version_string) {
+ LogMessage(X_WARNING,
+ "glamor%d: Failed to get GLSL version\n",
+ screen->myNum);
+ goto fail;
+ }
+ shading_version_offset = 0;
+ if (strncmp("OpenGL ES GLSL ES ", shading_version_string, 18) == 0)
+ shading_version_offset = 18;
+
+ if (sscanf(shading_version_string + shading_version_offset,
+ "%i.%i",
+ &glsl_major,
+ &glsl_minor) != 2) {
+ LogMessage(X_WARNING,
+ "glamor%d: Failed to parse GLSL version string %s\n",
+ screen->myNum, shading_version_string);
+ goto fail;
+ }
+ glamor_priv->glsl_version = glsl_major * 100 + glsl_minor;
+
+ if (glamor_priv->gl_flavor == GLAMOR_GL_ES2) {
+ /* Force us back to the base version of our programs on an ES
+ * context, anyway. Basically glamor only uses desktop 1.20
+ * or 1.30 currently. 1.30's new features are also present in
+ * ES 3.0, but our glamor_program.c constructions use a lot of
+ * compatibility features (to reduce the diff between 1.20 and
+ * 1.30 programs).
+ */
+ glamor_priv->glsl_version = 120;
+ }
/* We'd like to require GL_ARB_map_buffer_range or
* GL_OES_map_buffer_range, since it offers more information to
@@ -451,7 +565,8 @@ glamor_init(ScreenPtr screen, unsigned int flags)
glamor_priv->has_fbo_blit =
epoxy_has_gl_extension("GL_EXT_framebuffer_blit");
glamor_priv->has_map_buffer_range =
- epoxy_has_gl_extension("GL_ARB_map_buffer_range");
+ epoxy_has_gl_extension("GL_ARB_map_buffer_range") ||
+ epoxy_has_gl_extension("GL_EXT_map_buffer_range");
glamor_priv->has_buffer_storage =
epoxy_has_gl_extension("GL_ARB_buffer_storage");
glamor_priv->has_nv_texture_barrier =
@@ -464,6 +579,27 @@ glamor_init(ScreenPtr screen, unsigned int flags)
glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP ||
epoxy_gl_version() >= 30 ||
epoxy_has_gl_extension("GL_NV_pack_subimage");
+ glamor_priv->has_vertex_array_object =
+ epoxy_has_gl_extension("GL_ARB_vertex_array_object");
+ 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_setup_debug_output(screen);
+
+ glamor_priv->use_quads = (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) &&
+ !glamor_priv->is_core_profile;
+
+ /* Driver-specific hack: Avoid using GL_QUADS on VC4, where
+ * they'll be emulated more expensively than we can with our
+ * cached IB.
+ */
+ if (strstr((char *)glGetString(GL_VENDOR), "Broadcom") &&
+ strstr((char *)glGetString(GL_RENDERER), "VC4"))
+ glamor_priv->use_quads = FALSE;
glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &glamor_priv->max_fbo_size);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &glamor_priv->max_fbo_size);
@@ -474,6 +610,10 @@ glamor_init(ScreenPtr screen, unsigned int flags)
glamor_priv->max_fbo_size = MAX_FBO_SIZE;
#endif
+ glamor_priv->one_channel_format = GL_ALPHA;
+ if (epoxy_has_gl_extension("GL_ARB_texture_rg") && epoxy_has_gl_extension("GL_ARB_texture_swizzle"))
+ glamor_priv->one_channel_format = GL_RED;
+
glamor_set_debug_level(&glamor_debug_level);
glamor_priv->saved_procs.create_screen_resources =
@@ -483,74 +623,61 @@ glamor_init(ScreenPtr screen, unsigned int flags)
if (!glamor_font_init(screen))
goto fail;
- if (flags & GLAMOR_USE_SCREEN) {
+ glamor_priv->saved_procs.block_handler = screen->BlockHandler;
+ screen->BlockHandler = _glamor_block_handler;
- glamor_priv->saved_procs.block_handler = screen->BlockHandler;
- screen->BlockHandler = _glamor_block_handler;
+ if (!glamor_composite_glyphs_init(screen)) {
+ ErrorF("Failed to initialize composite masks\n");
+ goto fail;
+ }
- glamor_priv->saved_procs.create_gc = screen->CreateGC;
- screen->CreateGC = glamor_create_gc;
+ glamor_priv->saved_procs.create_gc = screen->CreateGC;
+ screen->CreateGC = glamor_create_gc;
- glamor_priv->saved_procs.create_pixmap = screen->CreatePixmap;
- screen->CreatePixmap = glamor_create_pixmap;
+ 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.destroy_pixmap = screen->DestroyPixmap;
+ screen->DestroyPixmap = glamor_destroy_pixmap;
- glamor_priv->saved_procs.get_spans = screen->GetSpans;
- screen->GetSpans = glamor_get_spans;
+ glamor_priv->saved_procs.get_spans = screen->GetSpans;
+ screen->GetSpans = glamor_get_spans;
- glamor_priv->saved_procs.get_image = screen->GetImage;
- screen->GetImage = glamor_get_image;
+ glamor_priv->saved_procs.get_image = screen->GetImage;
+ screen->GetImage = glamor_get_image;
- glamor_priv->saved_procs.change_window_attributes =
- screen->ChangeWindowAttributes;
- screen->ChangeWindowAttributes = glamor_change_window_attributes;
+ glamor_priv->saved_procs.change_window_attributes =
+ screen->ChangeWindowAttributes;
+ screen->ChangeWindowAttributes = glamor_change_window_attributes;
- glamor_priv->saved_procs.copy_window = screen->CopyWindow;
- screen->CopyWindow = glamor_copy_window;
+ glamor_priv->saved_procs.copy_window = screen->CopyWindow;
+ screen->CopyWindow = glamor_copy_window;
- glamor_priv->saved_procs.bitmap_to_region = screen->BitmapToRegion;
- screen->BitmapToRegion = glamor_bitmap_to_region;
- }
-#ifdef RENDER
- if (flags & GLAMOR_USE_PICTURE_SCREEN) {
- glamor_priv->saved_procs.composite = ps->Composite;
- ps->Composite = glamor_composite;
+ glamor_priv->saved_procs.bitmap_to_region = screen->BitmapToRegion;
+ screen->BitmapToRegion = glamor_bitmap_to_region;
- glamor_priv->saved_procs.trapezoids = ps->Trapezoids;
- ps->Trapezoids = glamor_trapezoids;
+ glamor_priv->saved_procs.composite = ps->Composite;
+ ps->Composite = glamor_composite;
- glamor_priv->saved_procs.triangles = ps->Triangles;
- ps->Triangles = glamor_triangles;
+ glamor_priv->saved_procs.trapezoids = ps->Trapezoids;
+ ps->Trapezoids = glamor_trapezoids;
- glamor_priv->saved_procs.addtraps = ps->AddTraps;
- ps->AddTraps = glamor_add_traps;
+ glamor_priv->saved_procs.triangles = ps->Triangles;
+ ps->Triangles = glamor_triangles;
- }
+ glamor_priv->saved_procs.addtraps = ps->AddTraps;
+ ps->AddTraps = glamor_add_traps;
glamor_priv->saved_procs.composite_rects = ps->CompositeRects;
ps->CompositeRects = glamor_composite_rectangles;
glamor_priv->saved_procs.glyphs = ps->Glyphs;
- ps->Glyphs = glamor_glyphs;
-
- glamor_priv->saved_procs.unrealize_glyph = ps->UnrealizeGlyph;
- ps->UnrealizeGlyph = glamor_glyph_unrealize;
-
- glamor_priv->saved_procs.create_picture = ps->CreatePicture;
- ps->CreatePicture = glamor_create_picture;
-
- glamor_priv->saved_procs.destroy_picture = ps->DestroyPicture;
- ps->DestroyPicture = glamor_destroy_picture;
- glamor_init_composite_shaders(screen);
-#endif
- glamor_priv->saved_procs.set_window_pixmap = screen->SetWindowPixmap;
- screen->SetWindowPixmap = glamor_set_window_pixmap;
+ 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);
#endif
@@ -573,86 +700,46 @@ glamor_release_screen_priv(ScreenPtr screen)
glamor_screen_private *glamor_priv;
glamor_priv = glamor_get_screen_private(screen);
-#ifdef RENDER
- glamor_fini_composite_shaders(screen);
-#endif
glamor_fini_vbo(screen);
glamor_fini_pixmap_fbo(screen);
- glamor_fini_finish_access_shaders(screen);
-#ifdef GLAMOR_GRADIENT_SHADER
- glamor_fini_gradient_shader(screen);
-#endif
glamor_pixmap_fini(screen);
free(glamor_priv);
glamor_set_screen_private(screen, NULL);
}
-_X_EXPORT void
-glamor_set_pixmap_private(PixmapPtr pixmap, glamor_pixmap_private *priv)
-{
- glamor_pixmap_private *old_priv;
-
- old_priv = dixGetPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key);
-
- if (priv) {
- assert(old_priv == NULL);
- }
- else {
- if (old_priv == NULL)
- return;
-
- glamor_pixmap_destroy_fbo(old_priv);
- free(old_priv);
- }
-
- dixSetPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key, priv);
-}
-
Bool
glamor_close_screen(ScreenPtr screen)
{
glamor_screen_private *glamor_priv;
PixmapPtr screen_pixmap;
- int flags;
-
-#ifdef RENDER
PictureScreenPtr ps = GetPictureScreenIfSet(screen);
-#endif
+
glamor_priv = glamor_get_screen_private(screen);
- flags = glamor_priv->flags;
glamor_sync_close(screen);
- glamor_glyphs_fini(screen);
+ glamor_composite_glyphs_fini(screen);
screen->CloseScreen = glamor_priv->saved_procs.close_screen;
screen->CreateScreenResources =
glamor_priv->saved_procs.create_screen_resources;
- if (flags & GLAMOR_USE_SCREEN) {
-
- screen->CreateGC = glamor_priv->saved_procs.create_gc;
- screen->CreatePixmap = glamor_priv->saved_procs.create_pixmap;
- screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap;
- screen->GetSpans = glamor_priv->saved_procs.get_spans;
- screen->ChangeWindowAttributes =
- glamor_priv->saved_procs.change_window_attributes;
- screen->CopyWindow = glamor_priv->saved_procs.copy_window;
- screen->BitmapToRegion = glamor_priv->saved_procs.bitmap_to_region;
- screen->BlockHandler = glamor_priv->saved_procs.block_handler;
- }
-#ifdef RENDER
- if (ps && (flags & GLAMOR_USE_PICTURE_SCREEN)) {
- ps->Composite = glamor_priv->saved_procs.composite;
- ps->Trapezoids = glamor_priv->saved_procs.trapezoids;
- ps->Triangles = glamor_priv->saved_procs.triangles;
- ps->CreatePicture = glamor_priv->saved_procs.create_picture;
- }
+ screen->CreateGC = glamor_priv->saved_procs.create_gc;
+ screen->CreatePixmap = glamor_priv->saved_procs.create_pixmap;
+ screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap;
+ screen->GetSpans = glamor_priv->saved_procs.get_spans;
+ screen->ChangeWindowAttributes =
+ glamor_priv->saved_procs.change_window_attributes;
+ screen->CopyWindow = glamor_priv->saved_procs.copy_window;
+ screen->BitmapToRegion = glamor_priv->saved_procs.bitmap_to_region;
+ screen->BlockHandler = glamor_priv->saved_procs.block_handler;
+
+ ps->Composite = glamor_priv->saved_procs.composite;
+ ps->Trapezoids = glamor_priv->saved_procs.trapezoids;
+ ps->Triangles = glamor_priv->saved_procs.triangles;
ps->CompositeRects = glamor_priv->saved_procs.composite_rects;
ps->Glyphs = glamor_priv->saved_procs.glyphs;
- ps->UnrealizeGlyph = glamor_priv->saved_procs.unrealize_glyph;
- screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap;
-#endif
+
screen_pixmap = screen->GetScreenPixmap(screen);
- glamor_set_pixmap_private(screen_pixmap, NULL);
+ glamor_pixmap_destroy_fbo(screen_pixmap);
glamor_release_screen_priv(screen);
@@ -685,12 +772,11 @@ _X_EXPORT int
glamor_fd_from_pixmap(ScreenPtr screen,
PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
{
- glamor_pixmap_private *pixmap_priv;
+ glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
glamor_screen_private *glamor_priv =
glamor_get_screen_private(pixmap->drawable.pScreen);
- pixmap_priv = glamor_get_pixmap_private(pixmap);
- if (pixmap_priv == NULL || !glamor_priv->dri3_enabled)
+ if (!glamor_priv->dri3_enabled)
return -1;
switch (pixmap_priv->type) {
case GLAMOR_TEXTURE_DRM:
@@ -699,7 +785,7 @@ glamor_fd_from_pixmap(ScreenPtr screen,
return -1;
return glamor_egl_dri3_fd_name_from_tex(screen,
pixmap,
- pixmap_priv->base.fbo->tex,
+ pixmap_priv->fbo->tex,
FALSE, stride, size);
default:
break;
@@ -710,13 +796,10 @@ glamor_fd_from_pixmap(ScreenPtr screen,
int
glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
{
- glamor_pixmap_private *pixmap_priv;
+ glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
glamor_screen_private *glamor_priv =
glamor_get_screen_private(pixmap->drawable.pScreen);
- pixmap_priv = glamor_get_pixmap_private(pixmap);
- if (pixmap_priv == NULL)
- return -1;
switch (pixmap_priv->type) {
case GLAMOR_TEXTURE_DRM:
case GLAMOR_TEXTURE_ONLY:
@@ -724,7 +807,7 @@ glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
return -1;
return glamor_egl_dri3_fd_name_from_tex(pixmap->drawable.pScreen,
pixmap,
- pixmap_priv->base.fbo->tex,
+ pixmap_priv->fbo->tex,
TRUE, stride, size);
default:
break;
diff --git a/xserver/glamor/glamor.h b/xserver/glamor/glamor.h
index 206158c02..0aa6d5604 100644
--- a/xserver/glamor/glamor.h
+++ b/xserver/glamor/glamor.h
@@ -52,50 +52,34 @@ struct glamor_context;
* @TEXTURE_ONLY: pixmap is in an internal texture.
*/
typedef enum glamor_pixmap_type {
- GLAMOR_MEMORY,
- GLAMOR_MEMORY_MAP,
+ GLAMOR_MEMORY = 0, /* Newly calloc()ed pixmaps are memory. */
GLAMOR_TEXTURE_DRM,
- GLAMOR_SEPARATE_TEXTURE,
GLAMOR_DRM_ONLY,
GLAMOR_TEXTURE_ONLY,
- GLAMOR_TEXTURE_LARGE,
- GLAMOR_TEXTURE_PACK
} glamor_pixmap_type_t;
#define GLAMOR_EGL_EXTERNAL_BUFFER 3
-#define GLAMOR_INVERTED_Y_AXIS 1 /* compat stub */
-#define GLAMOR_USE_SCREEN (1 << 1)
-#define GLAMOR_USE_PICTURE_SCREEN (1 << 2)
-#define GLAMOR_USE_EGL_SCREEN (1 << 3)
-#define GLAMOR_NO_DRI3 (1 << 4)
-#define GLAMOR_VALID_FLAGS (GLAMOR_INVERTED_Y_AXIS \
- | GLAMOR_USE_SCREEN \
- | GLAMOR_USE_PICTURE_SCREEN \
- | GLAMOR_USE_EGL_SCREEN \
+#define GLAMOR_USE_EGL_SCREEN (1 << 0)
+#define GLAMOR_NO_DRI3 (1 << 1)
+#define GLAMOR_VALID_FLAGS (GLAMOR_USE_EGL_SCREEN \
| GLAMOR_NO_DRI3)
+/* until we need geometry shaders GL3.1 should suffice. */
+#define GLAMOR_GL_CORE_VER_MAJOR 3
+#define GLAMOR_GL_CORE_VER_MINOR 1
+
/* @glamor_init: Initialize glamor internal data structure.
*
* @screen: Current screen pointer.
* @flags: Please refer the flags description above.
*
- * @GLAMOR_USE_SCREEN:
- * If running in an pre-existing X environment, and the
- * gl context is GLX, then you should set this bit and
- * let the glamor to handle all the screen related
- * functions such as GC ops and CreatePixmap/DestroyPixmap.
- *
- * @GLAMOR_USE_PICTURE_SCREEN:
- * If don't use any other underlying DDX driver to handle
- * the picture related rendering functions, please set this
- * bit on. Otherwise, clear this bit. And then it is the DDX
- * driver's responsibility to determine how/when to jump to
- * glamor's picture compositing path.
- *
* @GLAMOR_USE_EGL_SCREEN:
* If you are using EGL layer, then please set this bit
* on, otherwise, clear it.
*
+ * @GLAMOR_NO_DRI3
+ * Disable the built-in DRI3 support
+ *
* This function initializes necessary internal data structure
* for glamor. And before calling into this function, the OpenGL
* environment should be ready. Should be called before any real
@@ -125,8 +109,6 @@ extern _X_EXPORT void glamor_set_screen_pixmap(PixmapPtr screen_pixmap,
extern _X_EXPORT uint32_t glamor_get_pixmap_texture(PixmapPtr pixmap);
-extern _X_EXPORT Bool glamor_glyphs_init(ScreenPtr pScreen);
-
extern _X_EXPORT void glamor_set_pixmap_texture(PixmapPtr pixmap,
unsigned int tex);
@@ -142,7 +124,6 @@ extern _X_EXPORT Bool glamor_destroy_pixmap(PixmapPtr pixmap);
#define GLAMOR_CREATE_PIXMAP_CPU 0x100
#define GLAMOR_CREATE_PIXMAP_FIXUP 0x101
#define GLAMOR_CREATE_FBO_NO_FBO 0x103
-#define GLAMOR_CREATE_PIXMAP_MAP 0x104
#define GLAMOR_CREATE_NO_LARGE 0x105
#define GLAMOR_CREATE_PIXMAP_NO_TEXTURE 0x106
@@ -165,7 +146,8 @@ 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);
+ int h,
+ Bool linear);
extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr,
unsigned int, Bool,
CARD16 *, CARD32 *);
@@ -220,6 +202,21 @@ extern _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen,
extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap,
CARD16 *stride, CARD32 *size);
+/* @glamor_gbm_bo_from_pixmap: Get a GBM bo 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 pixmap and the buffer represented by the gbm_bo will share the same
+ * content.
+ *
+ * Returns the gbm_bo on success, NULL on error.
+ * */
+extern _X_EXPORT void *glamor_gbm_bo_from_pixmap(ScreenPtr screen,
+ PixmapPtr pixmap);
+
/* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd.
*
* @screen: Current screen pointer.
@@ -240,6 +237,25 @@ extern _X_EXPORT PixmapPtr glamor_pixmap_from_fd(ScreenPtr screen,
CARD8 depth,
CARD8 bpp);
+/* @glamor_back_pixmap_from_fd: Backs an existing pixmap with a dma-buf fd.
+ *
+ * @pixmap: Pixmap to change backing for
+ * @fd: The dma-buf fd to import.
+ * @width: The width of the buffer.
+ * @height: The height of the buffer.
+ * @stride: The stride of the buffer.
+ * @depth: The depth of the buffer.
+ * @bpp: The number of bpp of the buffer.
+ *
+ * Returns TRUE if successful, FALSE on failure.
+ * */
+extern _X_EXPORT Bool glamor_back_pixmap_from_fd(PixmapPtr pixmap,
+ int fd,
+ CARD16 width,
+ CARD16 height,
+ CARD16 stride,
+ CARD8 depth,
+ CARD8 bpp);
#ifdef GLAMOR_FOR_XORG
#define GLAMOR_EGL_MODULE_NAME "glamoregl"
@@ -326,146 +342,6 @@ extern _X_EXPORT void glamor_destroy_gc(GCPtr gc);
extern Bool _X_EXPORT glamor_change_window_attributes(WindowPtr pWin, unsigned long mask);
extern void _X_EXPORT glamor_copy_window(WindowPtr window, DDXPointRec old_origin, RegionPtr src_region);
-/* Glamor rendering/drawing functions with XXX_nf.
- * nf means no fallback within glamor internal if possible. If glamor
- * fail to accelerate the operation, glamor will return a false, and the
- * caller need to implement fallback method. Return a true means the
- * rendering request get done successfully. */
-extern _X_EXPORT Bool glamor_fill_spans_nf(DrawablePtr drawable,
- GCPtr gc,
- int n, DDXPointPtr points,
- int *widths, int sorted);
-
-extern _X_EXPORT Bool glamor_poly_fill_rect_nf(DrawablePtr drawable,
- GCPtr gc,
- int nrect, xRectangle *prect);
-
-extern _X_EXPORT Bool glamor_put_image_nf(DrawablePtr drawable,
- GCPtr gc, int depth, int x, int y,
- int w, int h, int left_pad,
- int image_format, char *bits);
-
-extern _X_EXPORT Bool glamor_copy_n_to_n_nf(DrawablePtr src,
- DrawablePtr dst,
- GCPtr gc,
- BoxPtr box,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown, Pixel bitplane,
- void *closure);
-
-extern _X_EXPORT Bool glamor_copy_nf(DrawablePtr src,
- DrawablePtr dst,
- GCPtr gc,
- BoxPtr box,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown, Pixel bitplane,
- void *closure);
-
-extern _X_EXPORT Bool glamor_composite_nf(CARD8 op,
- PicturePtr source,
- PicturePtr mask,
- PicturePtr dest,
- INT16 x_source,
- INT16 y_source,
- INT16 x_mask,
- INT16 y_mask,
- INT16 x_dest, INT16 y_dest,
- CARD16 width, CARD16 height);
-
-extern _X_EXPORT Bool glamor_trapezoids_nf(CARD8 op,
- PicturePtr src, PicturePtr dst,
- PictFormatPtr mask_format,
- INT16 x_src, INT16 y_src,
- int ntrap, xTrapezoid *traps);
-
-extern _X_EXPORT Bool glamor_glyphs_nf(CARD8 op,
- PicturePtr src,
- PicturePtr dst,
- PictFormatPtr mask_format,
- INT16 x_src,
- INT16 y_src, int nlist,
- GlyphListPtr list, GlyphPtr *glyphs);
-
-extern _X_EXPORT Bool glamor_triangles_nf(CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc,
- int ntris, xTriangle *tris);
-
-extern _X_EXPORT void glamor_glyph_unrealize(ScreenPtr screen, GlyphPtr glyph);
-
-extern _X_EXPORT Bool glamor_set_spans_nf(DrawablePtr drawable, GCPtr gc,
- char *src, DDXPointPtr points,
- int *widths, int n, int sorted);
-
-extern _X_EXPORT Bool glamor_get_spans_nf(DrawablePtr drawable, int wmax,
- DDXPointPtr points, int *widths,
- int count, char *dst);
-
-extern _X_EXPORT Bool glamor_composite_rects_nf(CARD8 op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect, xRectangle *rects);
-
-extern _X_EXPORT Bool glamor_get_image_nf(DrawablePtr pDrawable, int x, int y,
- int w, int h, unsigned int format,
- unsigned long planeMask, char *d);
-
-extern _X_EXPORT Bool glamor_add_traps_nf(PicturePtr pPicture,
- INT16 x_off,
- INT16 y_off, int ntrap,
- xTrap *traps);
-
-extern _X_EXPORT Bool glamor_copy_plane_nf(DrawablePtr pSrc, DrawablePtr pDst,
- GCPtr pGC, int srcx, int srcy, int w,
- int h, int dstx, int dsty,
- unsigned long bitPlane,
- RegionPtr *pRegion);
-
-extern _X_EXPORT Bool glamor_image_glyph_blt_nf(DrawablePtr pDrawable,
- GCPtr pGC, int x, int y,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- void *pglyphBase);
-
-extern _X_EXPORT Bool glamor_poly_glyph_blt_nf(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- void *pglyphBase);
-
-extern _X_EXPORT Bool glamor_push_pixels_nf(GCPtr pGC, PixmapPtr pBitmap,
- DrawablePtr pDrawable, int w, int h,
- int x, int y);
-
-extern _X_EXPORT Bool glamor_poly_point_nf(DrawablePtr pDrawable, GCPtr pGC,
- int mode, int npt, DDXPointPtr ppt);
-
-extern _X_EXPORT Bool glamor_poly_segment_nf(DrawablePtr pDrawable, GCPtr pGC,
- int nseg, xSegment *pSeg);
-
-extern _X_EXPORT Bool glamor_poly_lines_nf(DrawablePtr drawable, GCPtr gc,
- int mode, int n, DDXPointPtr points);
-
-extern _X_EXPORT Bool glamor_poly_text8_nf(DrawablePtr drawable, GCPtr gc,
- int x, int y, int count, char *chars, int *final_pos);
-
-extern _X_EXPORT Bool glamor_poly_text16_nf(DrawablePtr drawable, GCPtr gc,
- int x, int y, int count, unsigned short *chars, int *final_pos);
-
-extern _X_EXPORT Bool glamor_image_text8_nf(DrawablePtr drawable, GCPtr gc,
- int x, int y, int count, char *chars);
-
-extern _X_EXPORT Bool glamor_image_text16_nf(DrawablePtr drawable, GCPtr gc,
- int x, int y, int count, unsigned short *chars);
-
#define HAS_GLAMOR_TEXT 1
#ifdef GLAMOR_FOR_XORG
diff --git a/xserver/glamor/glamor_addtraps.c b/xserver/glamor/glamor_addtraps.c
index fdc0f4232..7ad9f3000 100644
--- a/xserver/glamor/glamor_addtraps.c
+++ b/xserver/glamor/glamor_addtraps.c
@@ -28,34 +28,13 @@
#include "glamor_priv.h"
-static Bool
-_glamor_add_traps(PicturePtr pPicture,
- INT16 x_off,
- INT16 y_off, int ntrap, xTrap *traps, Bool fallback)
+void
+glamor_add_traps(PicturePtr pPicture,
+ INT16 x_off,
+ INT16 y_off, int ntrap, xTrap *traps)
{
- if (!fallback
- && (!pPicture->pDrawable
- || glamor_ddx_fallback_check_pixmap(pPicture->pDrawable)))
- return FALSE;
-
if (glamor_prepare_access_picture(pPicture, GLAMOR_ACCESS_RW)) {
fbAddTraps(pPicture, x_off, y_off, ntrap, traps);
}
glamor_finish_access_picture(pPicture);
-
- return TRUE;
-}
-
-void
-glamor_add_traps(PicturePtr pPicture,
- INT16 x_off, INT16 y_off, int ntrap, xTrap *traps)
-{
- _glamor_add_traps(pPicture, x_off, y_off, ntrap, traps, TRUE);
-}
-
-Bool
-glamor_add_traps_nf(PicturePtr pPicture,
- INT16 x_off, INT16 y_off, int ntrap, xTrap *traps)
-{
- return _glamor_add_traps(pPicture, x_off, y_off, ntrap, traps, FALSE);
}
diff --git a/xserver/glamor/glamor_composite_glyphs.c b/xserver/glamor/glamor_composite_glyphs.c
new file mode 100644
index 000000000..f51ff6dad
--- /dev/null
+++ b/xserver/glamor/glamor_composite_glyphs.c
@@ -0,0 +1,573 @@
+/*
+ * Copyright © 2014 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.
+ */
+#include <stdlib.h>
+#include "Xprintf.h"
+
+#include "glamor_priv.h"
+#include "glamor_transform.h"
+#include "glamor_transfer.h"
+
+#include <mipict.h>
+
+#define DEFAULT_ATLAS_DIM 1024
+
+static DevPrivateKeyRec glamor_glyph_private_key;
+
+struct glamor_glyph_private {
+ int16_t x;
+ int16_t y;
+ uint32_t serial;
+};
+
+struct glamor_glyph_atlas {
+ PixmapPtr atlas;
+ PictFormatPtr format;
+ int x, y;
+ int row_height;
+ int nglyph;
+ uint32_t serial;
+};
+
+static inline struct glamor_glyph_private *glamor_get_glyph_private(PixmapPtr pixmap) {
+ return dixLookupPrivate(&pixmap->devPrivates, &glamor_glyph_private_key);
+}
+
+static inline void
+glamor_copy_glyph(PixmapPtr glyph_pixmap,
+ DrawablePtr atlas_draw,
+ int16_t x,
+ int16_t y)
+{
+ DrawablePtr glyph_draw = &glyph_pixmap->drawable;
+ BoxRec box = {
+ .x1 = 0,
+ .y1 = 0,
+ .x2 = glyph_draw->width,
+ .y2 = glyph_draw->height,
+ };
+ PixmapPtr upload_pixmap = glyph_pixmap;
+
+ if (glyph_pixmap->drawable.bitsPerPixel != atlas_draw->bitsPerPixel) {
+
+ /* If we're dealing with 1-bit glyphs, we copy them to a
+ * temporary 8-bit pixmap and upload them from there, since
+ * that's what GL can handle.
+ */
+ ScreenPtr screen = atlas_draw->pScreen;
+ GCPtr scratch_gc;
+ ChangeGCVal changes[2];
+
+ upload_pixmap = glamor_create_pixmap(screen,
+ glyph_draw->width,
+ glyph_draw->height,
+ atlas_draw->depth,
+ GLAMOR_CREATE_PIXMAP_CPU);
+ if (!upload_pixmap)
+ return;
+
+ scratch_gc = GetScratchGC(upload_pixmap->drawable.depth, screen);
+ if (!scratch_gc) {
+ glamor_destroy_pixmap(upload_pixmap);
+ return;
+ }
+ changes[0].val = 0xff;
+ changes[1].val = 0x00;
+ if (ChangeGC(NullClient, scratch_gc,
+ GCForeground|GCBackground, changes) != Success) {
+ glamor_destroy_pixmap(upload_pixmap);
+ FreeScratchGC(scratch_gc);
+ return;
+ }
+ ValidateGC(&upload_pixmap->drawable, scratch_gc);
+
+ (*scratch_gc->ops->CopyPlane)(glyph_draw,
+ &upload_pixmap->drawable,
+ scratch_gc,
+ 0, 0,
+ glyph_draw->width,
+ glyph_draw->height,
+ 0, 0, 0x1);
+ }
+ glamor_upload_boxes((PixmapPtr) atlas_draw,
+ &box, 1,
+ 0, 0,
+ x, y,
+ upload_pixmap->devPrivate.ptr,
+ upload_pixmap->devKind);
+
+ if (upload_pixmap != glyph_pixmap)
+ glamor_destroy_pixmap(upload_pixmap);
+}
+
+static Bool
+glamor_glyph_atlas_init(ScreenPtr screen, struct glamor_glyph_atlas *atlas)
+{
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+ PictFormatPtr format = atlas->format;
+
+ atlas->atlas = glamor_create_pixmap(screen, glamor_priv->glyph_atlas_dim,
+ glamor_priv->glyph_atlas_dim, format->depth,
+ GLAMOR_CREATE_FBO_NO_FBO);
+ if (!glamor_pixmap_has_fbo(atlas->atlas)) {
+ glamor_destroy_pixmap(atlas->atlas);
+ atlas->atlas = NULL;
+ }
+ atlas->x = 0;
+ atlas->y = 0;
+ atlas->row_height = 0;
+ atlas->serial++;
+ atlas->nglyph = 0;
+ return TRUE;
+}
+
+static Bool
+glamor_glyph_can_add(struct glamor_glyph_atlas *atlas, int dim, DrawablePtr glyph_draw)
+{
+ /* Step down */
+ if (atlas->x + glyph_draw->width > dim) {
+ atlas->x = 0;
+ atlas->y += atlas->row_height;
+ atlas->row_height = 0;
+ }
+
+ /* Check for overfull */
+ if (atlas->y + glyph_draw->height > dim)
+ return FALSE;
+
+ return TRUE;
+}
+
+static Bool
+glamor_glyph_add(struct glamor_glyph_atlas *atlas, DrawablePtr glyph_draw)
+{
+ PixmapPtr glyph_pixmap = (PixmapPtr) glyph_draw;
+ struct glamor_glyph_private *glyph_priv = glamor_get_glyph_private(glyph_pixmap);
+
+ glamor_copy_glyph(glyph_pixmap, &atlas->atlas->drawable, atlas->x, atlas->y);
+
+ glyph_priv->x = atlas->x;
+ glyph_priv->y = atlas->y;
+ glyph_priv->serial = atlas->serial;
+
+ atlas->x += glyph_draw->width;
+ if (atlas->row_height < glyph_draw->height)
+ atlas->row_height = glyph_draw->height;
+
+ atlas->nglyph++;
+
+ return TRUE;
+}
+
+static const glamor_facet glamor_facet_composite_glyphs_130 = {
+ .name = "composite_glyphs",
+ .version = 130,
+ .vs_vars = ("attribute vec4 primitive;\n"
+ "attribute vec2 source;\n"
+ "varying vec2 glyph_pos;\n"),
+ .vs_exec = (" vec2 pos = primitive.zw * vec2(gl_VertexID&1, (gl_VertexID&2)>>1);\n"
+ GLAMOR_POS(gl_Position, (primitive.xy + pos))
+ " glyph_pos = (source + pos) * ATLAS_DIM_INV;\n"),
+ .fs_vars = ("varying vec2 glyph_pos;\n"
+ "out vec4 color0;\n"
+ "out vec4 color1;\n"),
+ .fs_exec = (" vec4 mask = texture2D(atlas, glyph_pos);\n"),
+ .source_name = "source",
+ .locations = glamor_program_location_atlas,
+};
+
+static const glamor_facet glamor_facet_composite_glyphs_120 = {
+ .name = "composite_glyphs",
+ .vs_vars = ("attribute vec2 primitive;\n"
+ "attribute vec2 source;\n"
+ "varying vec2 glyph_pos;\n"),
+ .vs_exec = (GLAMOR_POS(gl_Position, primitive)
+ " glyph_pos = source.xy * ATLAS_DIM_INV;\n"),
+ .fs_vars = ("varying vec2 glyph_pos;\n"),
+ .fs_exec = (" vec4 mask = texture2D(atlas, glyph_pos);\n"),
+ .source_name = "source",
+ .locations = glamor_program_location_atlas,
+};
+
+static inline Bool
+glamor_glyph_use_130(glamor_screen_private *glamor_priv) {
+ return glamor_priv->glsl_version >= 130;
+}
+
+static Bool
+glamor_glyphs_init_facet(ScreenPtr screen)
+{
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+
+ return asprintf(&glamor_priv->glyph_defines, "#define ATLAS_DIM_INV %20.18f\n", 1.0/glamor_priv->glyph_atlas_dim) > 0;
+}
+
+static void
+glamor_glyphs_fini_facet(ScreenPtr screen)
+{
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+
+ free(glamor_priv->glyph_defines);
+}
+
+static void
+glamor_glyphs_flush(CARD8 op, PicturePtr src, PicturePtr dst,
+ glamor_program *prog,
+ struct glamor_glyph_atlas *atlas, int nglyph)
+{
+ DrawablePtr drawable = dst->pDrawable;
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(drawable->pScreen);
+ PixmapPtr atlas_pixmap = atlas->atlas;
+ glamor_pixmap_private *atlas_priv = glamor_get_pixmap_private(atlas_pixmap);
+ glamor_pixmap_fbo *atlas_fbo = glamor_pixmap_fbo_at(atlas_priv, 0);
+ PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
+ glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
+ int box_index;
+ int off_x, off_y;
+
+ glamor_put_vbo_space(drawable->pScreen);
+
+ glEnable(GL_SCISSOR_TEST);
+ glActiveTexture(GL_TEXTURE1);
+ glBindTexture(GL_TEXTURE_2D, atlas_fbo->tex);
+
+ for (;;) {
+ if (!glamor_use_program_render(prog, op, src, dst))
+ break;
+
+ glUniform1i(prog->atlas_uniform, 1);
+
+ glamor_pixmap_loop(pixmap_priv, box_index) {
+ BoxPtr box = RegionRects(dst->pCompositeClip);
+ int nbox = RegionNumRects(dst->pCompositeClip);
+
+ glamor_set_destination_drawable(drawable, box_index, TRUE, FALSE,
+ prog->matrix_uniform,
+ &off_x, &off_y);
+
+ /* Run over the clip list, drawing the glyphs
+ * in each box
+ */
+
+ while (nbox--) {
+ glScissor(box->x1 + off_x,
+ box->y1 + off_y,
+ box->x2 - box->x1,
+ box->y2 - box->y1);
+ box++;
+
+ if (glamor_glyph_use_130(glamor_priv))
+ glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, nglyph);
+ else
+ glamor_glDrawArrays_GL_QUADS(glamor_priv, nglyph);
+ }
+ }
+ if (prog->alpha != glamor_program_alpha_ca_first)
+ break;
+ prog++;
+ }
+
+ glDisable(GL_SCISSOR_TEST);
+
+ if (glamor_glyph_use_130(glamor_priv)) {
+ glVertexAttribDivisor(GLAMOR_VERTEX_SOURCE, 0);
+ glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0);
+ }
+ glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
+ glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
+ glDisable(GL_BLEND);
+}
+
+static GLshort *
+glamor_glyph_start(ScreenPtr screen, int count)
+{
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+ GLshort *v;
+ char *vbo_offset;
+
+ /* Set up the vertex buffers for the font and destination */
+
+ if (glamor_glyph_use_130(glamor_priv)) {
+ v = glamor_get_vbo_space(screen, count * (6 * sizeof (GLshort)), &vbo_offset);
+
+ glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
+ glVertexAttribDivisor(GLAMOR_VERTEX_POS, 1);
+ glVertexAttribPointer(GLAMOR_VERTEX_POS, 4, GL_SHORT, GL_FALSE,
+ 6 * sizeof (GLshort), vbo_offset);
+
+ glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
+ glVertexAttribDivisor(GLAMOR_VERTEX_SOURCE, 1);
+ glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_SHORT, GL_FALSE,
+ 6 * sizeof (GLshort), vbo_offset + 4 * sizeof (GLshort));
+ } else {
+ v = glamor_get_vbo_space(screen, count * (16 * sizeof (GLshort)), &vbo_offset);
+
+ glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
+ glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE,
+ 4 * sizeof (GLshort), vbo_offset);
+
+ glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
+ glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_SHORT, GL_FALSE,
+ 4 * sizeof (GLshort), vbo_offset + 2 * sizeof (GLshort));
+ }
+ return v;
+}
+
+static inline struct glamor_glyph_atlas *
+glamor_atlas_for_glyph(glamor_screen_private *glamor_priv, DrawablePtr drawable)
+{
+ if (drawable->depth == 32)
+ return glamor_priv->glyph_atlas_argb;
+ else
+ return glamor_priv->glyph_atlas_a;
+}
+
+void
+glamor_composite_glyphs(CARD8 op,
+ PicturePtr src,
+ PicturePtr dst,
+ PictFormatPtr glyph_format,
+ INT16 x_src,
+ INT16 y_src, int nlist, GlyphListPtr list,
+ GlyphPtr *glyphs)
+{
+ int glyphs_queued;
+ GLshort *v = NULL;
+ DrawablePtr drawable = dst->pDrawable;
+ ScreenPtr screen = drawable->pScreen;
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+ glamor_program *prog = NULL;
+ glamor_program_render *glyphs_program = &glamor_priv->glyphs_program;
+ struct glamor_glyph_atlas *glyph_atlas = NULL;
+ int x = 0, y = 0;
+ int n;
+ int glyph_atlas_dim = glamor_priv->glyph_atlas_dim;
+ int glyph_max_dim = glamor_priv->glyph_max_dim;
+ int nglyph = 0;
+ int screen_num = screen->myNum;
+
+ for (n = 0; n < nlist; n++)
+ nglyph += list[n].len;
+
+ glamor_make_current(glamor_priv);
+
+ glyphs_queued = 0;
+
+ while (nlist--) {
+ x += list->xOff;
+ y += list->yOff;
+ n = list->len;
+ list++;
+ while (n--) {
+ GlyphPtr glyph = *glyphs++;
+
+ /* Glyph not empty?
+ */
+ if (glyph->info.width && glyph->info.height) {
+ PicturePtr glyph_pict = GlyphPicture(glyph)[screen_num];
+ DrawablePtr glyph_draw = glyph_pict->pDrawable;
+
+ /* Need to draw with slow path?
+ */
+ if (_X_UNLIKELY(glyph_draw->width > glyph_max_dim ||
+ glyph_draw->height > glyph_max_dim ||
+ !glamor_pixmap_is_memory((PixmapPtr)glyph_draw)))
+ {
+ if (glyphs_queued) {
+ glamor_glyphs_flush(op, src, dst, prog, glyph_atlas, glyphs_queued);
+ glyphs_queued = 0;
+ }
+ bail_one:
+ glamor_composite(op, src, glyph_pict, dst,
+ x_src + (x - glyph->info.x), (y - glyph->info.y),
+ 0, 0,
+ x - glyph->info.x, y - glyph->info.y,
+ glyph_draw->width, glyph_draw->height);
+ } else {
+ struct glamor_glyph_private *glyph_priv = glamor_get_glyph_private((PixmapPtr)(glyph_draw));
+ struct glamor_glyph_atlas *next_atlas = glamor_atlas_for_glyph(glamor_priv, glyph_draw);
+
+ /* Switching source glyph format?
+ */
+ if (_X_UNLIKELY(next_atlas != glyph_atlas)) {
+ if (glyphs_queued) {
+ glamor_glyphs_flush(op, src, dst, prog, glyph_atlas, glyphs_queued);
+ glyphs_queued = 0;
+ }
+ glyph_atlas = next_atlas;
+ }
+
+ /* Glyph not cached in current atlas?
+ */
+ if (_X_UNLIKELY(glyph_priv->serial != glyph_atlas->serial)) {
+ if (!glamor_glyph_can_add(glyph_atlas, glyph_atlas_dim, glyph_draw)) {
+ if (glyphs_queued) {
+ glamor_glyphs_flush(op, src, dst, prog, glyph_atlas, glyphs_queued);
+ glyphs_queued = 0;
+ }
+ if (glyph_atlas->atlas) {
+ (*screen->DestroyPixmap)(glyph_atlas->atlas);
+ glyph_atlas->atlas = NULL;
+ }
+ }
+ if (!glyph_atlas->atlas) {
+ glamor_glyph_atlas_init(screen, glyph_atlas);
+ if (!glyph_atlas->atlas)
+ goto bail_one;
+ }
+ glamor_glyph_add(glyph_atlas, glyph_draw);
+ }
+
+ /* First glyph in the current atlas?
+ */
+ if (_X_UNLIKELY(glyphs_queued == 0)) {
+ if (glamor_glyph_use_130(glamor_priv))
+ prog = glamor_setup_program_render(op, src, glyph_pict, dst,
+ glyphs_program,
+ &glamor_facet_composite_glyphs_130,
+ glamor_priv->glyph_defines);
+ else
+ prog = glamor_setup_program_render(op, src, glyph_pict, dst,
+ glyphs_program,
+ &glamor_facet_composite_glyphs_120,
+ glamor_priv->glyph_defines);
+ if (!prog)
+ goto bail_one;
+ v = glamor_glyph_start(screen, nglyph);
+ }
+
+ /* Add the glyph
+ */
+
+ glyphs_queued++;
+ if (_X_LIKELY(glamor_glyph_use_130(glamor_priv))) {
+ v[0] = x - glyph->info.x;
+ v[1] = y - glyph->info.y;
+ v[2] = glyph_draw->width;
+ v[3] = glyph_draw->height;
+ v[4] = glyph_priv->x;
+ v[5] = glyph_priv->y;
+ v += 6;
+ } else {
+ v[0] = x - glyph->info.x;
+ v[1] = y - glyph->info.y;
+ v[2] = glyph_priv->x;
+ v[3] = glyph_priv->y;
+ v += 4;
+
+ v[0] = x - glyph->info.x + glyph_draw->width;
+ v[1] = y - glyph->info.y;
+ v[2] = glyph_priv->x + glyph_draw->width;
+ v[3] = glyph_priv->y;
+ v += 4;
+
+ v[0] = x - glyph->info.x + glyph_draw->width;
+ v[1] = y - glyph->info.y + glyph_draw->height;
+ v[2] = glyph_priv->x + glyph_draw->width;
+ v[3] = glyph_priv->y + glyph_draw->height;
+ v += 4;
+
+ v[0] = x - glyph->info.x;
+ v[1] = y - glyph->info.y + glyph_draw->height;
+ v[2] = glyph_priv->x;
+ v[3] = glyph_priv->y + glyph_draw->height;
+ v += 4;
+ }
+ }
+ }
+ x += glyph->info.xOff;
+ y += glyph->info.yOff;
+ nglyph--;
+ }
+ }
+
+ if (glyphs_queued)
+ glamor_glyphs_flush(op, src, dst, prog, glyph_atlas, glyphs_queued);
+
+ return;
+}
+
+static struct glamor_glyph_atlas *
+glamor_alloc_glyph_atlas(ScreenPtr screen, int depth, CARD32 f)
+{
+ PictFormatPtr format;
+ struct glamor_glyph_atlas *glyph_atlas;
+
+ format = PictureMatchFormat(screen, depth, f);
+ if (!format)
+ return NULL;
+ glyph_atlas = calloc (1, sizeof (struct glamor_glyph_atlas));
+ if (!glyph_atlas)
+ return NULL;
+ glyph_atlas->format = format;
+ glyph_atlas->serial = 1;
+
+ return glyph_atlas;
+}
+
+Bool
+glamor_composite_glyphs_init(ScreenPtr screen)
+{
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+
+ if (!dixRegisterPrivateKey(&glamor_glyph_private_key, PRIVATE_PIXMAP, sizeof (struct glamor_glyph_private)))
+ return FALSE;
+
+ /* Make glyph atlases of a reasonable size, but no larger than the maximum
+ * supported by the hardware
+ */
+ glamor_priv->glyph_atlas_dim = MIN(DEFAULT_ATLAS_DIM, glamor_priv->max_fbo_size);
+
+ /* Don't stick huge glyphs in the atlases */
+ glamor_priv->glyph_max_dim = glamor_priv->glyph_atlas_dim / 8;
+
+ glamor_priv->glyph_atlas_a = glamor_alloc_glyph_atlas(screen, 8, PICT_a8);
+ if (!glamor_priv->glyph_atlas_a)
+ return FALSE;
+ glamor_priv->glyph_atlas_argb = glamor_alloc_glyph_atlas(screen, 32, PICT_a8r8g8b8);
+ if (!glamor_priv->glyph_atlas_argb) {
+ free (glamor_priv->glyph_atlas_a);
+ return FALSE;
+ }
+ if (!glamor_glyphs_init_facet(screen))
+ return FALSE;
+ return TRUE;
+}
+
+static void
+glamor_free_glyph_atlas(struct glamor_glyph_atlas *atlas)
+{
+ if (!atlas)
+ return;
+ if (atlas->atlas)
+ FreePicture(atlas->atlas, 0);
+ free (atlas);
+}
+
+void
+glamor_composite_glyphs_fini(ScreenPtr screen)
+{
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+
+ glamor_glyphs_fini_facet(screen);
+ glamor_free_glyph_atlas(glamor_priv->glyph_atlas_a);
+ glamor_free_glyph_atlas(glamor_priv->glyph_atlas_argb);
+}
diff --git a/xserver/glamor/glamor_compositerects.c b/xserver/glamor/glamor_compositerects.c
index 3b6b2ed07..885a6c065 100644
--- a/xserver/glamor/glamor_compositerects.c
+++ b/xserver/glamor/glamor_compositerects.c
@@ -57,7 +57,7 @@ _pixman_region_init_clipped_rectangles(pixman_region16_t * region,
unsigned int i, j;
if (num_rects > ARRAY_SIZE(stack_boxes)) {
- boxes = malloc(sizeof(pixman_box16_t) * num_rects);
+ boxes = xallocarray(num_rects, sizeof(pixman_box16_t));
if (boxes == NULL)
return FALSE;
}
@@ -246,7 +246,7 @@ glamor_composite_rectangles(CARD8 op,
goto done;
}
else {
- if (_X_LIKELY(priv->type != GLAMOR_TEXTURE_LARGE)) {
+ if (_X_LIKELY(glamor_pixmap_priv_is_small(priv))) {
int error;
source = CreateSolidPicture(0, color, &error);
@@ -254,7 +254,7 @@ glamor_composite_rectangles(CARD8 op,
goto done;
if (glamor_composite_clipped_region(op, source,
NULL, dst,
- NULL, NULL, priv,
+ NULL, NULL, pixmap,
&region, 0, 0, 0, 0, 0, 0))
goto done;
}
diff --git a/xserver/glamor/glamor_copy.c b/xserver/glamor/glamor_copy.c
index 3320935f0..5fed89f0c 100644
--- a/xserver/glamor/glamor_copy.c
+++ b/xserver/glamor/glamor_copy.c
@@ -42,7 +42,7 @@ use_copyarea(PixmapPtr dst, GCPtr gc, glamor_program *prog, void *arg)
glBindTexture(GL_TEXTURE_2D, src->tex);
glUniform2f(prog->fill_offset_uniform, args->dx, args->dy);
- glUniform2f(prog->fill_size_uniform, src->width, src->height);
+ glUniform2f(prog->fill_size_inv_uniform, 1.0f/src->width, 1.0f/src->height);
return TRUE;
}
@@ -51,9 +51,9 @@ static const glamor_facet glamor_facet_copyarea = {
"copy_area",
.vs_vars = "attribute vec2 primitive;\n",
.vs_exec = (GLAMOR_POS(gl_Position, primitive.xy)
- " fill_pos = (fill_offset + primitive.xy) / fill_size;\n"),
+ " fill_pos = (fill_offset + primitive.xy) * fill_size_inv;\n"),
.fs_exec = " gl_FragColor = texture2D(sampler, fill_pos);\n",
- .locations = glamor_program_location_fill,
+ .locations = glamor_program_location_fillsamp | glamor_program_location_fillpos,
.use = use_copyarea,
};
@@ -71,7 +71,7 @@ use_copyplane(PixmapPtr dst, GCPtr gc, glamor_program *prog, void *arg)
glBindTexture(GL_TEXTURE_2D, src->tex);
glUniform2f(prog->fill_offset_uniform, args->dx, args->dy);
- glUniform2f(prog->fill_size_uniform, src->width, src->height);
+ glUniform2f(prog->fill_size_inv_uniform, 1.0f/src->width, 1.0f/src->height);
glamor_set_color(dst, gc->fgPixel, prog->fg_uniform);
glamor_set_color(dst, gc->bgPixel, prog->bg_uniform);
@@ -134,13 +134,13 @@ static const glamor_facet glamor_facet_copyplane = {
.version = 130,
.vs_vars = "attribute vec2 primitive;\n",
.vs_exec = (GLAMOR_POS(gl_Position, (primitive.xy))
- " fill_pos = (fill_offset + primitive.xy) / fill_size;\n"),
+ " fill_pos = (fill_offset + primitive.xy) * fill_size_inv;\n"),
.fs_exec = (" uvec4 bits = uvec4(round(texture2D(sampler, fill_pos) * bitmul));\n"
" if ((bits & bitplane) != uvec4(0,0,0,0))\n"
" gl_FragColor = fg;\n"
" else\n"
" gl_FragColor = bg;\n"),
- .locations = glamor_program_location_fill|glamor_program_location_fg|glamor_program_location_bg|glamor_program_location_bitplane,
+ .locations = glamor_program_location_fillsamp|glamor_program_location_fillpos|glamor_program_location_fg|glamor_program_location_bg|glamor_program_location_bitplane,
.use = use_copyplane,
};
@@ -212,7 +212,7 @@ glamor_copy_cpu_fbo(DrawablePtr src,
if (gc && gc->alu != GXcopy)
goto bail;
- if (gc && !glamor_pm_is_solid(dst, gc->planemask))
+ if (gc && !glamor_pm_is_solid(gc->depth, gc->planemask))
goto bail;
glamor_make_current(glamor_priv);
@@ -262,7 +262,7 @@ glamor_copy_fbo_cpu(DrawablePtr src,
if (gc && gc->alu != GXcopy)
goto bail;
- if (gc && !glamor_pm_is_solid(dst, gc->planemask))
+ if (gc && !glamor_pm_is_solid(gc->depth, gc->planemask))
goto bail;
glamor_make_current(glamor_priv);
@@ -307,7 +307,7 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst);
glamor_pixmap_private *src_priv = glamor_get_pixmap_private(src_pixmap);
glamor_pixmap_private *dst_priv = glamor_get_pixmap_private(dst_pixmap);
- int src_box_x, src_box_y, dst_box_x, dst_box_y;
+ int src_box_index, dst_box_index;
int dst_off_x, dst_off_y;
int src_off_x, src_off_y;
GLshort *v;
@@ -315,12 +315,11 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
struct copy_args args;
glamor_program *prog;
const glamor_facet *copy_facet;
- Bool set_scissor;
int n;
glamor_make_current(glamor_priv);
- if (gc && !glamor_set_planemask(dst_pixmap, gc->planemask))
+ if (gc && !glamor_set_planemask(gc->depth, gc->planemask))
goto bail_ctx;
if (!glamor_set_alu(screen, gc ? gc->alu : GXcopy))
@@ -339,7 +338,7 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
if (!prog->prog) {
if (!glamor_build_program(screen, prog,
- copy_facet, NULL))
+ copy_facet, NULL, NULL, NULL))
goto bail_ctx;
}
@@ -367,48 +366,37 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
glamor_get_drawable_deltas(src, src_pixmap, &src_off_x, &src_off_y);
- set_scissor = src_priv->type == GLAMOR_TEXTURE_LARGE;
- if (set_scissor)
- glEnable(GL_SCISSOR_TEST);
+ glEnable(GL_SCISSOR_TEST);
- glamor_pixmap_loop(src_priv, src_box_x, src_box_y) {
- BoxPtr src_box = glamor_pixmap_box_at(src_priv, src_box_x, src_box_y);
+ glamor_pixmap_loop(src_priv, src_box_index) {
+ BoxPtr src_box = glamor_pixmap_box_at(src_priv, src_box_index);
args.dx = dx + src_off_x - src_box->x1;
args.dy = dy + src_off_y - src_box->y1;
- args.src = glamor_pixmap_fbo_at(src_priv, src_box_x, src_box_y);
+ args.src = glamor_pixmap_fbo_at(src_priv, src_box_index);
if (!glamor_use_program(dst_pixmap, gc, prog, &args))
goto bail_ctx;
- glamor_pixmap_loop(dst_priv, dst_box_x, dst_box_y) {
- glamor_set_destination_drawable(dst, dst_box_x, dst_box_y, FALSE, FALSE,
- prog->matrix_uniform, &dst_off_x, &dst_off_y);
-
- if (set_scissor)
- glScissor(dst_off_x - args.dx,
- dst_off_y - args.dy,
- src_box->x2 - src_box->x1,
- src_box->y2 - src_box->y1);
-
- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP)
- glDrawArrays(GL_QUADS, 0, nbox * 4);
- else {
- int i;
- for (i = 0; i < nbox; i++)
- glDrawArrays(GL_TRIANGLE_FAN, i*4, 4);
- }
+ 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);
+
+ glScissor(dst_off_x - args.dx,
+ dst_off_y - args.dy,
+ src_box->x2 - src_box->x1,
+ src_box->y2 - src_box->y1);
+
+ glamor_glDrawArrays_GL_QUADS(glamor_priv, nbox);
}
}
- if (set_scissor)
- glDisable(GL_SCISSOR_TEST);
+ glDisable(GL_SCISSOR_TEST);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
- glDisable(GL_COLOR_LOGIC_OP);
return TRUE;
bail_ctx:
- glDisable(GL_COLOR_LOGIC_OP);
return FALSE;
}
@@ -432,7 +420,6 @@ glamor_copy_fbo_fbo_temp(DrawablePtr src,
{
ScreenPtr screen = dst->pScreen;
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
- PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst);
PixmapPtr tmp_pixmap;
BoxRec bounds;
int n;
@@ -447,12 +434,11 @@ glamor_copy_fbo_fbo_temp(DrawablePtr src,
*/
glamor_make_current(glamor_priv);
- if (gc && !glamor_set_planemask(dst_pixmap, gc->planemask))
+ if (gc && !glamor_set_planemask(gc->depth, gc->planemask))
goto bail_ctx;
if (!glamor_set_alu(screen, gc ? gc->alu : GXcopy))
goto bail_ctx;
- glDisable(GL_COLOR_LOGIC_OP);
/* Find the size of the area to copy
*/
@@ -521,7 +507,6 @@ bail:
return FALSE;
bail_ctx:
- glDisable(GL_COLOR_LOGIC_OP);
return FALSE;
}
@@ -656,6 +641,9 @@ glamor_copy(DrawablePtr src,
Pixel bitplane,
void *closure)
{
+ if (nbox == 0)
+ return;
+
if (glamor_copy_gl(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure))
return;
glamor_copy_bail(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure);
@@ -709,39 +697,3 @@ glamor_copy_window(WindowPtr window, DDXPointRec old_origin, RegionPtr src_regio
RegionUninit(&dst_region);
}
-
-Bool
-glamor_copy_n_to_n_nf(DrawablePtr src,
- DrawablePtr dst,
- GCPtr gc,
- BoxPtr box,
- int nbox,
- int dx,
- int dy,
- Bool reverse,
- Bool upsidedown, Pixel bitplane,
- void *closure)
-{
- if (glamor_copy_gl(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure))
- return TRUE;
- if (glamor_ddx_fallback_check_pixmap(src) && glamor_ddx_fallback_check_pixmap(dst))
- return FALSE;
- glamor_copy_bail(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure);
- return TRUE;
-}
-
-Bool
-glamor_copy_plane_nf(DrawablePtr src, DrawablePtr dst, GCPtr gc,
- int srcx, int srcy, int w, int h, int dstx, int dsty,
- unsigned long bitplane, RegionPtr *region)
-{
- if (glamor_ddx_fallback_check_pixmap(src) &&
- glamor_ddx_fallback_check_pixmap(dst) &&
- glamor_ddx_fallback_check_gc(gc))
- return FALSE;
-
- *region = glamor_copy_plane(src, dst, gc,
- srcx, srcy, w, h, dstx, dsty,
- bitplane);
- return TRUE;
-}
diff --git a/xserver/glamor/glamor_core.c b/xserver/glamor/glamor_core.c
index 235a4baed..b9948b569 100644
--- a/xserver/glamor/glamor_core.c
+++ b/xserver/glamor/glamor_core.c
@@ -42,10 +42,9 @@ glamor_get_drawable_location(const DrawablePtr drawable)
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
glamor_screen_private *glamor_priv =
glamor_get_screen_private(drawable->pScreen);
- if (pixmap_priv == NULL ||
- pixmap_priv->base.gl_fbo == GLAMOR_FBO_UNATTACHED)
+ if (pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED)
return 'm';
- if (pixmap_priv->base.fbo->fb == glamor_priv->screen_fbo)
+ if (pixmap_priv->fbo->fb == glamor_priv->screen_fbo)
return 's';
else
return 'f';
@@ -88,6 +87,17 @@ glamor_link_glsl_prog(ScreenPtr screen, GLint prog, const char *format, ...)
GLint ok;
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+ if (glamor_priv->has_khr_debug) {
+ char *label;
+ va_list va;
+
+ va_start(va, format);
+ XNFvasprintf(&label, format, va);
+ glObjectLabel(GL_PROGRAM, prog, -1, label);
+ free(label);
+ va_end(va);
+ }
+
glLinkProgram(prog);
glGetProgramiv(prog, GL_LINK_STATUS, &ok);
if (!ok) {
@@ -101,17 +111,6 @@ glamor_link_glsl_prog(ScreenPtr screen, GLint prog, const char *format, ...)
ErrorF("Failed to link: %s\n", info);
FatalError("GLSL link failure\n");
}
-
- if (glamor_priv->has_khr_debug) {
- char *label;
- va_list va;
-
- va_start(va, format);
- XNFvasprintf(&label, format, va);
- glObjectLabel(GL_PROGRAM, prog, -1, label);
- free(label);
- va_end(va);
- }
}
/*
@@ -173,46 +172,48 @@ glamor_init_finish_access_shaders(ScreenPtr screen)
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 = texture2D(sampler, source_texture).bgra;\n"
+ " gl_FragColor = color.bgra;\n"
" else \n"
- " gl_FragColor = texture2D(sampler, source_texture).rgba;\n"
+ " gl_FragColor = color.rgba;\n"
" } \n"
" else \n"
" { \n"
" if (swap_rb == SWAP_DOWNLOADING) \n"
- " gl_FragColor = texture2D(sampler, source_texture).argb;\n"
+ " gl_FragColor = color.argb;\n"
" else if (swap_rb == SWAP_NONE_DOWNLOADING)\n"
- " gl_FragColor = texture2D(sampler, source_texture).abgr;\n"
+ " gl_FragColor = color.abgr;\n"
" else if (swap_rb == SWAP_UPLOADING)\n"
- " gl_FragColor = texture2D(sampler, source_texture).gbar;\n"
+ " gl_FragColor = color.gbar;\n"
" else if (swap_rb == SWAP_NONE_UPLOADING)\n"
- " gl_FragColor = texture2D(sampler, source_texture).abgr;\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(texture2D(sampler, source_texture).bgr, 1);\n"
+ " gl_FragColor = vec4(color.bgr, 1);\n"
" else \n"
- " gl_FragColor = vec4(texture2D(sampler, source_texture).rgb, 1);\n"
+ " gl_FragColor = vec4(color.rgb, 1);\n"
" } \n"
" else \n"
" { \n"
" if (swap_rb == SWAP_DOWNLOADING) \n"
- " gl_FragColor = vec4(1, texture2D(sampler, source_texture).rgb);\n"
+ " gl_FragColor = vec4(1, color.rgb);\n"
" else if (swap_rb == SWAP_NONE_DOWNLOADING)\n"
- " gl_FragColor = vec4(1, texture2D(sampler, source_texture).bgr);\n"
+ " gl_FragColor = vec4(1, color.bgr);\n"
" else if (swap_rb == SWAP_UPLOADING)\n"
- " gl_FragColor = vec4(texture2D(sampler, source_texture).gba, 1);\n"
+ " gl_FragColor = vec4(color.gba, 1);\n"
" else if (swap_rb == SWAP_NONE_UPLOADING)\n"
- " gl_FragColor = vec4(texture2D(sampler, source_texture).abg, 1);\n"
+ " gl_FragColor = vec4(color.abg, 1);\n"
" } \n"
"}\n";
GLint fs_prog, vs_prog, avs_prog, set_alpha_prog;
@@ -281,18 +282,7 @@ glamor_init_finish_access_shaders(ScreenPtr screen)
glUniform1i(glamor_priv->finish_access_swap_rb[1], 0);
}
-void
-glamor_fini_finish_access_shaders(ScreenPtr screen)
-{
- glamor_screen_private *glamor_priv;
-
- glamor_priv = glamor_get_screen_private(screen);
- glamor_make_current(glamor_priv);
- glDeleteProgram(glamor_priv->finish_access_prog[0]);
- glDeleteProgram(glamor_priv->finish_access_prog[1]);
-}
-
-GCOps glamor_gc_ops = {
+static GCOps glamor_gc_ops = {
.FillSpans = glamor_fill_spans,
.SetSpans = glamor_set_spans,
.PutImage = glamor_put_image,
diff --git a/xserver/glamor/glamor_dash.c b/xserver/glamor/glamor_dash.c
index e8f60fa10..a6a11c1a2 100644
--- a/xserver/glamor/glamor_dash.c
+++ b/xserver/glamor/glamor_dash.c
@@ -159,44 +159,42 @@ glamor_dash_setup(DrawablePtr drawable, GCPtr gc)
&glamor_priv->on_off_dash_line_progs,
&glamor_facet_on_off_dash_lines);
if (!prog)
- goto bail_ctx;
+ goto bail;
break;
case LineDoubleDash:
if (gc->fillStyle != FillSolid)
- goto bail_ctx;
+ goto bail;
prog = &glamor_priv->double_dash_line_prog;
if (!prog->prog) {
if (!glamor_build_program(screen, prog,
&glamor_facet_double_dash_lines,
- NULL))
- goto bail_ctx;
+ NULL, NULL, NULL))
+ goto bail;
}
if (!glamor_use_program(pixmap, gc, prog, NULL))
- goto bail_ctx;
+ goto bail;
glamor_set_color(pixmap, gc->fgPixel, prog->fg_uniform);
glamor_set_color(pixmap, gc->bgPixel, prog->bg_uniform);
break;
default:
- goto bail_ctx;
+ goto bail;
}
/* Set the dash pattern as texture 1 */
glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, dash_priv->base.fbo->tex);
+ glBindTexture(GL_TEXTURE_2D, dash_priv->fbo->tex);
glUniform1i(prog->dash_uniform, 1);
glUniform1f(prog->dash_length_uniform, dash_pixmap->drawable.width);
return prog;
-bail_ctx:
- glDisable(GL_COLOR_LOGIC_OP);
bail:
return NULL;
}
@@ -207,16 +205,16 @@ glamor_dash_loop(DrawablePtr drawable, GCPtr gc, glamor_program *prog,
{
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
- int box_x, box_y;
+ int box_index;
int off_x, off_y;
glEnable(GL_SCISSOR_TEST);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+ glamor_pixmap_loop(pixmap_priv, box_index) {
int nbox = RegionNumRects(gc->pCompositeClip);
BoxPtr box = RegionRects(gc->pCompositeClip);
- glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, TRUE,
+ glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE,
prog->matrix_uniform, &off_x, &off_y);
while (nbox--) {
@@ -230,7 +228,6 @@ glamor_dash_loop(DrawablePtr drawable, GCPtr gc, glamor_program *prog,
}
glDisable(GL_SCISSOR_TEST);
- glDisable(GL_COLOR_LOGIC_OP);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
}
diff --git a/xserver/glamor/glamor_egl.c b/xserver/glamor/glamor_egl.c
index 6160032f0..80a97f7a1 100644
--- a/xserver/glamor/glamor_egl.c
+++ b/xserver/glamor/glamor_egl.c
@@ -187,7 +187,7 @@ glamor_egl_get_gbm_device(ScreenPtr screen)
}
unsigned int
-glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h)
+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;
@@ -200,6 +200,9 @@ glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h)
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;
@@ -239,7 +242,6 @@ glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride)
"Failed to create textured screen.");
return FALSE;
}
-
glamor_set_screen_pixmap(screen_pixmap, NULL);
return TRUE;
}
@@ -272,7 +274,7 @@ glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image)
glamor_get_pixmap_private(pixmap);
EGLImageKHR old;
- old = pixmap_priv->base.image;
+ old = pixmap_priv->image;
if (old) {
ScreenPtr screen = pixmap->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
@@ -280,7 +282,7 @@ glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image)
eglDestroyImageKHR(glamor_egl->display, old);
}
- pixmap_priv->base.image = image;
+ pixmap_priv->image = image;
}
Bool
@@ -393,48 +395,108 @@ glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name)
}
#endif
-int
-glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen,
- PixmapPtr pixmap,
- unsigned int tex,
- Bool want_name, CARD16 *stride, CARD32 *size)
+static Bool
+glamor_make_pixmap_exportable(PixmapPtr pixmap)
{
#ifdef GLAMOR_HAS_GBM
+ ScreenPtr screen = pixmap->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ struct glamor_egl_screen_private *glamor_egl =
+ glamor_egl_get_screen_private(scrn);
struct glamor_pixmap_private *pixmap_priv =
glamor_get_pixmap_private(pixmap);
- struct glamor_screen_private *glamor_priv =
- glamor_get_screen_private(screen);
- struct glamor_egl_screen_private *glamor_egl;
- EGLImageKHR image;
+ unsigned width = pixmap->drawable.width;
+ unsigned height = pixmap->drawable.height;
struct gbm_bo *bo;
- int fd = -1;
+ PixmapPtr exported;
+ GCPtr scratch_gc;
- EGLint attribs[] = {
- EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
- EGL_GL_TEXTURE_LEVEL_KHR, 0,
- EGL_NONE
- };
+ if (pixmap_priv->image)
+ return TRUE;
- glamor_egl = glamor_egl_get_screen_private(scrn);
+ if (pixmap->drawable.bitsPerPixel != 32) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Failed to make %dbpp pixmap exportable\n",
+ pixmap->drawable.bitsPerPixel);
+ return FALSE;
+ }
- glamor_make_current(glamor_priv);
+ bo = gbm_bo_create(glamor_egl->gbm, width, height,
+ GBM_FORMAT_ARGB8888,
+#ifdef GLAMOR_HAS_GBM_LINEAR
+ (pixmap->usage_hint == CREATE_PIXMAP_USAGE_SHARED ?
+ GBM_BO_USE_LINEAR : 0) |
+#endif
+ GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT);
+ if (!bo) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Failed to make %dx%dx%dbpp GBM bo\n",
+ width, height, pixmap->drawable.bitsPerPixel);
+ return FALSE;
+ }
- image = pixmap_priv->base.image;
- if (!image) {
- image = eglCreateImageKHR(glamor_egl->display,
- glamor_egl->context,
- EGL_GL_TEXTURE_2D_KHR,
- (EGLClientBuffer) (uintptr_t)
- tex, attribs);
- if (image == EGL_NO_IMAGE_KHR)
- goto failure;
-
- glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM);
- glamor_egl_set_pixmap_image(pixmap, image);
+ exported = screen->CreatePixmap(screen, 0, 0, pixmap->drawable.depth, 0);
+ screen->ModifyPixmapHeader(exported, width, height, 0, 0,
+ gbm_bo_get_stride(bo), NULL);
+ if (!glamor_egl_create_textured_pixmap_from_gbm_bo(exported, bo)) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Failed to make %dx%dx%dbpp pixmap from GBM bo\n",
+ width, height, pixmap->drawable.bitsPerPixel);
+ screen->DestroyPixmap(exported);
+ gbm_bo_destroy(bo);
+ return FALSE;
}
+ gbm_bo_destroy(bo);
+
+ scratch_gc = GetScratchGC(pixmap->drawable.depth, screen);
+ ValidateGC(&pixmap->drawable, scratch_gc);
+ scratch_gc->ops->CopyArea(&pixmap->drawable, &exported->drawable,
+ scratch_gc,
+ 0, 0, width, height, 0, 0);
+ FreeScratchGC(scratch_gc);
+
+ /* Now, swap the tex/gbm/EGLImage/etc. of the exported pixmap into
+ * the original pixmap struct.
+ */
+ glamor_egl_exchange_buffers(pixmap, exported);
+
+ screen->DestroyPixmap(exported);
+
+ return TRUE;
+#else
+ return FALSE;
+#endif
+}
+
+void *
+glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap)
+{
+ struct glamor_egl_screen_private *glamor_egl =
+ glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
+ struct glamor_pixmap_private *pixmap_priv =
+ glamor_get_pixmap_private(pixmap);
+
+ if (!glamor_make_pixmap_exportable(pixmap))
+ return NULL;
+
+ return gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_EGL_IMAGE,
+ pixmap_priv->image, 0);
+}
- bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_EGL_IMAGE, image, 0);
+int
+glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen,
+ PixmapPtr pixmap,
+ unsigned int tex,
+ Bool want_name, CARD16 *stride, CARD32 *size)
+{
+#ifdef GLAMOR_HAS_GBM
+ struct glamor_egl_screen_private *glamor_egl;
+ struct gbm_bo *bo;
+ int fd = -1;
+
+ glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
+
+ bo = glamor_gbm_bo_from_pixmap(screen, pixmap);
if (!bo)
goto failure;
@@ -459,72 +521,67 @@ glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen,
#endif
}
-_X_EXPORT PixmapPtr
-glamor_pixmap_from_fd(ScreenPtr screen,
- int fd,
- CARD16 width,
- CARD16 height,
- CARD16 stride, CARD8 depth, CARD8 bpp)
+_X_EXPORT Bool
+glamor_back_pixmap_from_fd(PixmapPtr pixmap,
+ int fd,
+ CARD16 width,
+ CARD16 height,
+ CARD16 stride, CARD8 depth, CARD8 bpp)
{
#ifdef GLAMOR_HAS_GBM
+ ScreenPtr screen = pixmap->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
struct glamor_egl_screen_private *glamor_egl;
struct gbm_bo *bo;
- EGLImageKHR image;
- PixmapPtr pixmap;
- Bool ret = FALSE;
-
- EGLint attribs[] = {
- EGL_WIDTH, 0,
- EGL_HEIGHT, 0,
- EGL_LINUX_DRM_FOURCC_EXT, DRM_FORMAT_ARGB8888,
- EGL_DMA_BUF_PLANE0_FD_EXT, 0,
- EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0,
- EGL_DMA_BUF_PLANE0_PITCH_EXT, 0,
- EGL_NONE
- };
+ struct gbm_import_fd_data import_data = { 0 };
+ Bool ret;
glamor_egl = glamor_egl_get_screen_private(scrn);
if (!glamor_egl->dri3_capable)
- return NULL;
+ return FALSE;
if (bpp != 32 || !(depth == 24 || depth == 32) || width == 0 || height == 0)
- return NULL;
-
- attribs[1] = width;
- attribs[3] = height;
- attribs[7] = fd;
- attribs[11] = stride;
- image = eglCreateImageKHR(glamor_egl->display,
- EGL_NO_CONTEXT,
- EGL_LINUX_DMA_BUF_EXT,
- NULL, attribs);
-
- if (image == EGL_NO_IMAGE_KHR)
- return NULL;
-
- /* EGL_EXT_image_dma_buf_import can impose restrictions on the
- * usage of the image. Use gbm_bo to bypass the limitations. */
-
- bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_EGL_IMAGE, image, 0);
- eglDestroyImageKHR(glamor_egl->display, image);
+ return FALSE;
+ import_data.fd = fd;
+ import_data.width = width;
+ import_data.height = height;
+ import_data.stride = stride;
+ import_data.format = GBM_FORMAT_ARGB8888;
+ bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_FD, &import_data, 0);
if (!bo)
- return NULL;
+ return FALSE;
- pixmap = screen->CreatePixmap(screen, 0, 0, depth, 0);
screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, stride, NULL);
ret = glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo);
gbm_bo_destroy(bo);
+ return ret;
+#else
+ return FALSE;
+#endif
+}
- if (ret)
- return pixmap;
- else {
+_X_EXPORT PixmapPtr
+glamor_pixmap_from_fd(ScreenPtr screen,
+ int fd,
+ CARD16 width,
+ CARD16 height,
+ CARD16 stride, CARD8 depth, CARD8 bpp)
+{
+#ifdef GLAMOR_HAS_GBM
+ PixmapPtr pixmap;
+ Bool ret;
+
+ pixmap = screen->CreatePixmap(screen, 0, 0, depth, 0);
+ ret = glamor_back_pixmap_from_fd(pixmap, fd, width, height,
+ stride, depth, bpp);
+ if (ret == FALSE) {
screen->DestroyPixmap(pixmap);
return NULL;
}
+ return pixmap;
#else
return NULL;
#endif
@@ -536,17 +593,13 @@ glamor_egl_destroy_pixmap_image(PixmapPtr pixmap)
struct glamor_pixmap_private *pixmap_priv =
glamor_get_pixmap_private(pixmap);
- if (pixmap_priv && pixmap_priv->base.image) {
+ if (pixmap_priv->image) {
ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
struct glamor_egl_screen_private *glamor_egl =
glamor_egl_get_screen_private(scrn);
- /* Before destroy an image which was attached to
- * a texture. we must call glFlush to make sure the
- * operation on that texture has been done.*/
- glamor_block_handler(pixmap->drawable.pScreen);
- eglDestroyImageKHR(glamor_egl->display, pixmap_priv->base.image);
- pixmap_priv->base.image = NULL;
+ eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image);
+ pixmap_priv->image = NULL;
}
}
@@ -561,13 +614,12 @@ glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back)
glamor_pixmap_exchange_fbos(front, back);
- temp = back_priv->base.image;
- back_priv->base.image = front_priv->base.image;
- front_priv->base.image = temp;
+ temp = back_priv->image;
+ back_priv->image = front_priv->image;
+ front_priv->image = temp;
glamor_set_pixmap_type(front, GLAMOR_TEXTURE_DRM);
glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM);
-
}
void
@@ -589,8 +641,8 @@ glamor_egl_close_screen(ScreenPtr screen)
screen_pixmap = screen->GetScreenPixmap(screen);
pixmap_priv = glamor_get_pixmap_private(screen_pixmap);
- eglDestroyImageKHR(glamor_egl->display, pixmap_priv->base.image);
- pixmap_priv->base.image = NULL;
+ eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image);
+ pixmap_priv->image = NULL;
screen->CloseScreen = glamor_egl->saved_close_screen;
@@ -699,6 +751,21 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
#endif
}
+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);
+ eglTerminate(glamor_egl->display);
+ }
+#ifdef GLAMOR_HAS_GBM
+ if (glamor_egl->gbm)
+ gbm_device_destroy(glamor_egl->gbm);
+#endif
+ free(glamor_egl->device_path);
+ free(glamor_egl);
+}
+
static void
glamor_egl_free_screen(ScrnInfoPtr scrn)
{
@@ -706,17 +773,8 @@ glamor_egl_free_screen(ScrnInfoPtr scrn)
glamor_egl = glamor_egl_get_screen_private(scrn);
if (glamor_egl != NULL) {
-
- eglMakeCurrent(glamor_egl->display,
- EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-#ifdef GLAMOR_HAS_GBM
- if (glamor_egl->gbm)
- gbm_device_destroy(glamor_egl->gbm);
-#endif
- free(glamor_egl->device_path);
-
scrn->FreeScreen = glamor_egl->saved_free_screen;
- free(glamor_egl);
+ glamor_egl_cleanup(glamor_egl);
scrn->FreeScreen(scrn);
}
}
@@ -733,6 +791,15 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
#endif
EGL_NONE
};
+ static const EGLint config_attribs_core[] = {
+ EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR,
+ EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR,
+ EGL_CONTEXT_MAJOR_VERSION_KHR,
+ GLAMOR_GL_CORE_VER_MAJOR,
+ EGL_CONTEXT_MINOR_VERSION_KHR,
+ GLAMOR_GL_CORE_VER_MINOR,
+ EGL_NONE
+ };
glamor_identify(0);
glamor_egl = calloc(sizeof(*glamor_egl), 1);
@@ -747,7 +814,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
glamor_egl->gbm = gbm_create_device(glamor_egl->fd);
if (glamor_egl->gbm == NULL) {
ErrorF("couldn't get display device\n");
- return FALSE;
+ goto error;
}
glamor_egl->display = eglGetDisplay(glamor_egl->gbm);
#else
@@ -764,7 +831,8 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
if (!eglInitialize
(glamor_egl->display, &glamor_egl->major, &glamor_egl->minor)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglInitialize() failed\n");
- return FALSE;
+ glamor_egl->display = EGL_NO_DISPLAY;
+ goto error;
}
version = eglQueryString(glamor_egl->display, EGL_VERSION);
@@ -773,14 +841,14 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
#define GLAMOR_CHECK_EGL_EXTENSION(EXT) \
if (!epoxy_has_egl_extension(glamor_egl->display, "EGL_" #EXT)) { \
ErrorF("EGL_" #EXT " required.\n"); \
- return FALSE; \
+ goto error; \
}
#define GLAMOR_CHECK_EGL_EXTENSIONS(EXT1, EXT2) \
if (!epoxy_has_egl_extension(glamor_egl->display, "EGL_" #EXT1) && \
!epoxy_has_egl_extension(glamor_egl->display, "EGL_" #EXT2)) { \
ErrorF("EGL_" #EXT1 " or EGL_" #EXT2 " required.\n"); \
- return FALSE; \
+ goto error; \
}
GLAMOR_CHECK_EGL_EXTENSION(MESA_drm_image);
@@ -792,28 +860,36 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
KHR_surfaceless_opengl);
#endif
-#ifdef GLAMOR_HAS_GBM
- if (epoxy_has_egl_extension(glamor_egl->display,
- "EGL_KHR_gl_texture_2D_image") &&
- epoxy_has_egl_extension(glamor_egl->display,
- "EGL_EXT_image_dma_buf_import"))
- glamor_egl->dri3_capable = TRUE;
-#endif
-
+#ifndef GLAMOR_GLES2
glamor_egl->context = eglCreateContext(glamor_egl->display,
NULL, EGL_NO_CONTEXT,
- config_attribs);
- if (glamor_egl->context == EGL_NO_CONTEXT) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to create EGL context\n");
- return FALSE;
+ config_attribs_core);
+#else
+ glamor_egl->context = NULL;
+#endif
+ if (!glamor_egl->context) {
+ glamor_egl->context = eglCreateContext(glamor_egl->display,
+ NULL, EGL_NO_CONTEXT,
+ config_attribs);
+ if (glamor_egl->context == EGL_NO_CONTEXT) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to create EGL context\n");
+ goto error;
+ }
}
if (!eglMakeCurrent(glamor_egl->display,
EGL_NO_SURFACE, EGL_NO_SURFACE, glamor_egl->context)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to make EGL context current\n");
- return FALSE;
+ goto error;
}
+#ifdef GLAMOR_HAS_GBM
+ if (epoxy_has_egl_extension(glamor_egl->display,
+ "EGL_KHR_gl_texture_2D_image") &&
+ epoxy_has_gl_extension("GL_OES_EGL_image"))
+ glamor_egl->dri3_capable = TRUE;
+#endif
+
glamor_egl->saved_free_screen = scrn->FreeScreen;
scrn->FreeScreen = glamor_egl_free_screen;
#ifdef GLAMOR_GLES2
@@ -823,6 +899,10 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
"Indirect GLX may not work correctly.\n");
#endif
return TRUE;
+
+error:
+ glamor_egl_cleanup(glamor_egl);
+ return FALSE;
}
/** Stub to retain compatibility with pre-server-1.16 ABI. */
diff --git a/xserver/glamor/glamor_egl_stubs.c b/xserver/glamor/glamor_egl_stubs.c
index a93f62dcb..5dbbfe4b2 100644
--- a/xserver/glamor/glamor_egl_stubs.c
+++ b/xserver/glamor/glamor_egl_stubs.c
@@ -48,9 +48,3 @@ glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen,
{
return 0;
}
-
-unsigned int
-glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h)
-{
- return 0;
-}
diff --git a/xserver/glamor/glamor_fbo.c b/xserver/glamor/glamor_fbo.c
index 802d665a9..c6ba095c0 100644
--- a/xserver/glamor/glamor_fbo.c
+++ b/xserver/glamor/glamor_fbo.c
@@ -70,9 +70,26 @@ cache_hbucket(int size)
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, int flag)
+ int w, int h, GLenum format)
{
struct xorg_list *cache;
glamor_pixmap_fbo *fbo_entry, *ret_fbo = NULL;
@@ -87,33 +104,18 @@ glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv,
cache = &glamor_priv->fbo_cache[n_format]
[cache_wbucket(w)]
[cache_hbucket(h)];
- if (!(flag & GLAMOR_CACHE_EXACT_SIZE)) {
- 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);
- xorg_list_del(&fbo_entry->list);
- ret_fbo = fbo_entry;
- break;
- }
- }
- }
- else {
- 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;
- }
+
+ 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;
}
}
@@ -127,22 +129,22 @@ glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv,
}
static void
-glamor_purge_fbo(glamor_pixmap_fbo *fbo)
+glamor_purge_fbo(glamor_screen_private *glamor_priv,
+ glamor_pixmap_fbo *fbo)
{
- glamor_make_current(fbo->glamor_priv);
+ glamor_make_current(glamor_priv);
if (fbo->fb)
glDeleteFramebuffers(1, &fbo->fb);
if (fbo->tex)
glDeleteTextures(1, &fbo->tex);
- if (fbo->pbo)
- glDeleteBuffers(1, &fbo->pbo);
free(fbo);
}
static void
-glamor_pixmap_fbo_cache_put(glamor_pixmap_fbo *fbo)
+glamor_pixmap_fbo_cache_put(glamor_screen_private *glamor_priv,
+ glamor_pixmap_fbo *fbo)
{
struct xorg_list *cache;
int n_format;
@@ -154,32 +156,33 @@ glamor_pixmap_fbo_cache_put(glamor_pixmap_fbo *fbo)
n_format = cache_format(fbo->format);
if (fbo->fb == 0 || fbo->external || n_format == -1
- || fbo->glamor_priv->fbo_cache_watermark >= FBO_CACHE_THRESHOLD) {
- fbo->glamor_priv->tick += GLAMOR_CACHE_EXPIRE_MAX;
- glamor_fbo_expire(fbo->glamor_priv);
- glamor_purge_fbo(fbo);
+ || 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 = &fbo->glamor_priv->fbo_cache[n_format]
+ 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);
- fbo->glamor_priv->fbo_cache_watermark += fbo->width * fbo->height;
+ glamor_priv->fbo_cache_watermark += fbo->width * fbo->height;
xorg_list_add(&fbo->list, cache);
- fbo->expire = fbo->glamor_priv->tick + GLAMOR_CACHE_EXPIRE_MAX;
+ fbo->expire = glamor_priv->tick + GLAMOR_CACHE_EXPIRE_MAX;
#endif
}
static int
-glamor_pixmap_ensure_fb(glamor_pixmap_fbo *fbo)
+glamor_pixmap_ensure_fb(glamor_screen_private *glamor_priv,
+ glamor_pixmap_fbo *fbo)
{
int status, err = 0;
- glamor_make_current(fbo->glamor_priv);
+ glamor_make_current(glamor_priv);
if (fbo->fb == 0)
glGenFramebuffers(1, &fbo->fb);
@@ -239,22 +242,17 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv,
fbo->height = h;
fbo->external = FALSE;
fbo->format = format;
- fbo->glamor_priv = glamor_priv;
- if (flag == GLAMOR_CREATE_PIXMAP_MAP) {
- glamor_make_current(glamor_priv);
- glGenBuffers(1, &fbo->pbo);
- goto done;
- }
+ if (flag == CREATE_PIXMAP_USAGE_SHARED)
+ fbo->external = TRUE;
if (flag != GLAMOR_CREATE_FBO_NO_FBO) {
- if (glamor_pixmap_ensure_fb(fbo) != 0) {
- glamor_purge_fbo(fbo);
+ if (glamor_pixmap_ensure_fb(glamor_priv, fbo) != 0) {
+ glamor_purge_fbo(glamor_priv, fbo);
fbo = NULL;
}
}
- done:
return fbo;
}
@@ -280,7 +278,7 @@ glamor_fbo_expire(glamor_screen_private *glamor_priv)
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(fbo_entry);
+ glamor_purge_fbo(glamor_priv, fbo_entry);
}
}
@@ -317,16 +315,17 @@ glamor_fini_pixmap_fbo(ScreenPtr screen)
xorg_list_for_each_entry_safe_reverse(fbo_entry, tmp, cache,
list) {
xorg_list_del(&fbo_entry->list);
- glamor_purge_fbo(fbo_entry);
+ glamor_purge_fbo(glamor_priv, fbo_entry);
}
}
}
void
-glamor_destroy_fbo(glamor_pixmap_fbo *fbo)
+glamor_destroy_fbo(glamor_screen_private *glamor_priv,
+ glamor_pixmap_fbo *fbo)
{
xorg_list_del(&fbo->list);
- glamor_pixmap_fbo_cache_put(fbo);
+ glamor_pixmap_fbo_cache_put(glamor_priv, fbo);
}
@@ -334,25 +333,34 @@ static int
_glamor_create_tex(glamor_screen_private *glamor_priv,
int w, int h, GLenum format)
{
- unsigned int tex = 0;
-
- /* With dri3, we want to allocate ARGB8888 pixmaps only.
- * Depending on the implementation, GL_RGBA might not
- * give us ARGB8888. We ask glamor_egl to use get
- * an ARGB8888 based texture for us. */
- if (format == GL_RGBA) {
- tex = glamor_egl_create_argb8888_based_texture(glamor_priv->screen,
- w, h);
+ unsigned int tex;
+
+ glamor_make_current(glamor_priv);
+ glGenTextures(1, &tex);
+ 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);
+ if (format == glamor_priv->one_channel_format && format == GL_RED) {
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_ZERO);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_RED);
}
- if (!tex) {
- glamor_make_current(glamor_priv);
- glGenTextures(1, &tex);
- 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);
- glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0,
- format, GL_UNSIGNED_BYTE, NULL);
+ glamor_priv->suppress_gl_out_of_memory_logging = true;
+ glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0,
+ format, GL_UNSIGNED_BYTE, NULL);
+ glamor_priv->suppress_gl_out_of_memory_logging = false;
+
+ if (glGetError() == GL_OUT_OF_MEMORY) {
+ if (!glamor_priv->logged_any_fbo_allocation_failure) {
+ LogMessageVerb(X_WARNING, 0, "glamor: Failed to allocate %dx%d "
+ "FBO due to GL_OUT_OF_MEMORY.\n", w, h);
+ LogMessageVerb(X_WARNING, 0,
+ "glamor: Expect reduced performance.\n");
+ glamor_priv->logged_any_fbo_allocation_failure = true;
+ }
+ glDeleteTextures(1, &tex);
+ return 0;
}
+
return tex;
}
@@ -362,45 +370,40 @@ glamor_create_fbo(glamor_screen_private *glamor_priv,
{
glamor_pixmap_fbo *fbo;
GLint tex = 0;
- int cache_flag;
- if (flag == GLAMOR_CREATE_FBO_NO_FBO)
+ if (flag == GLAMOR_CREATE_FBO_NO_FBO || flag == CREATE_PIXMAP_USAGE_SHARED)
goto new_fbo;
- if (flag == GLAMOR_CREATE_PIXMAP_MAP)
- goto no_tex;
-
- /* Tiling from textures requires exact pixmap sizes. As we don't
- * know which pixmaps will be used as tiles, just allocate
- * everything at the requested size
- */
- cache_flag = GLAMOR_CACHE_EXACT_SIZE;
-
- fbo = glamor_pixmap_fbo_cache_get(glamor_priv, w, h, format, cache_flag);
+ 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);
- no_tex:
+ if (!tex)
+ return NULL;
fbo = glamor_create_fbo_from_tex(glamor_priv, w, h, format, tex, flag);
return fbo;
}
-static glamor_pixmap_fbo *
-_glamor_create_fbo_array(glamor_screen_private *glamor_priv,
+/**
+ * Create storage for the w * h region, using FBOs of the GL's maximum
+ * supported size.
+ */
+glamor_pixmap_fbo *
+glamor_create_fbo_array(glamor_screen_private *glamor_priv,
int w, int h, GLenum format, int flag,
int block_w, int block_h,
- glamor_pixmap_private *pixmap_priv, int has_fbo)
+ glamor_pixmap_private *priv)
{
int block_wcnt;
int block_hcnt;
glamor_pixmap_fbo **fbo_array;
BoxPtr box_array;
int i, j;
- glamor_pixmap_private_large_t *priv;
- priv = &pixmap_priv->large;
+ priv->block_w = block_w;
+ priv->block_h = block_h;
block_wcnt = (w + block_w - 1) / block_w;
block_hcnt = (h + block_h - 1) / block_h;
@@ -431,13 +434,10 @@ _glamor_create_fbo_array(glamor_screen_private *glamor_priv,
fbo_w =
box_array[i * block_wcnt + j].x2 - box_array[i * block_wcnt +
j].x1;
- if (!has_fbo)
- fbo_array[i * block_wcnt + j] = glamor_create_fbo(glamor_priv,
- fbo_w, fbo_h,
- format,
- GLAMOR_CREATE_PIXMAP_FIXUP);
- else
- fbo_array[i * block_wcnt + j] = priv->base.fbo;
+ fbo_array[i * block_wcnt + j] = glamor_create_fbo(glamor_priv,
+ fbo_w, fbo_h,
+ format,
+ GLAMOR_CREATE_PIXMAP_FIXUP);
if (fbo_array[i * block_wcnt + j] == NULL)
goto cleanup;
}
@@ -452,27 +452,13 @@ _glamor_create_fbo_array(glamor_screen_private *glamor_priv,
cleanup:
for (i = 0; i < block_wcnt * block_hcnt; i++)
- if ((fbo_array)[i])
- glamor_destroy_fbo((fbo_array)[i]);
+ if (fbo_array[i])
+ glamor_destroy_fbo(glamor_priv, fbo_array[i]);
free(box_array);
free(fbo_array);
return NULL;
}
-/* Create a fbo array to cover the w*h region, by using block_w*block_h
- * block.*/
-glamor_pixmap_fbo *
-glamor_create_fbo_array(glamor_screen_private *glamor_priv,
- int w, int h, GLenum format, int flag,
- int block_w, int block_h,
- glamor_pixmap_private *pixmap_priv)
-{
- pixmap_priv->large.block_w = block_w;
- pixmap_priv->large.block_h = block_h;
- return _glamor_create_fbo_array(glamor_priv, w, h, format, flag,
- block_w, block_h, pixmap_priv, 0);
-}
-
glamor_pixmap_fbo *
glamor_pixmap_detach_fbo(glamor_pixmap_private *pixmap_priv)
{
@@ -481,11 +467,11 @@ glamor_pixmap_detach_fbo(glamor_pixmap_private *pixmap_priv)
if (pixmap_priv == NULL)
return NULL;
- fbo = pixmap_priv->base.fbo;
+ fbo = pixmap_priv->fbo;
if (fbo == NULL)
return NULL;
- pixmap_priv->base.fbo = NULL;
+ pixmap_priv->fbo = NULL;
return fbo;
}
@@ -497,47 +483,40 @@ glamor_pixmap_attach_fbo(PixmapPtr pixmap, glamor_pixmap_fbo *fbo)
pixmap_priv = glamor_get_pixmap_private(pixmap);
- if (pixmap_priv->base.fbo)
+ if (pixmap_priv->fbo)
return;
- pixmap_priv->base.fbo = fbo;
+ pixmap_priv->fbo = fbo;
switch (pixmap_priv->type) {
- case GLAMOR_TEXTURE_LARGE:
case GLAMOR_TEXTURE_ONLY:
case GLAMOR_TEXTURE_DRM:
- pixmap_priv->base.gl_fbo = GLAMOR_FBO_NORMAL;
- if (fbo->tex != 0)
- pixmap_priv->base.gl_tex = 1;
- else {
- /* XXX For the Xephyr only, may be broken now. */
- pixmap_priv->base.gl_tex = 0;
- }
- case GLAMOR_MEMORY_MAP:
+ pixmap_priv->gl_fbo = GLAMOR_FBO_NORMAL;
pixmap->devPrivate.ptr = NULL;
- break;
default:
break;
}
}
void
-glamor_pixmap_destroy_fbo(glamor_pixmap_private *priv)
+glamor_pixmap_destroy_fbo(PixmapPtr pixmap)
{
+ ScreenPtr screen = pixmap->drawable.pScreen;
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+ glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
glamor_pixmap_fbo *fbo;
- if (priv->type == GLAMOR_TEXTURE_LARGE) {
+ if (glamor_pixmap_priv_is_large(priv)) {
int i;
- glamor_pixmap_private_large_t *large = &priv->large;
- for (i = 0; i < large->block_wcnt * large->block_hcnt; i++)
- glamor_destroy_fbo(large->fbo_array[i]);
- free(large->fbo_array);
+ for (i = 0; i < priv->block_wcnt * priv->block_hcnt; i++)
+ glamor_destroy_fbo(glamor_priv, priv->fbo_array[i]);
+ free(priv->fbo_array);
}
else {
fbo = glamor_pixmap_detach_fbo(priv);
if (fbo)
- glamor_destroy_fbo(fbo);
+ glamor_destroy_fbo(glamor_priv, fbo);
}
}
@@ -550,7 +529,7 @@ glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag)
glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen);
pixmap_priv = glamor_get_pixmap_private(pixmap);
- if (pixmap_priv->base.fbo == NULL) {
+ if (pixmap_priv->fbo == NULL) {
fbo = glamor_create_fbo(glamor_priv, pixmap->drawable.width,
pixmap->drawable.height, format, flag);
@@ -561,13 +540,13 @@ glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag)
}
else {
/* We do have a fbo, but it may lack of fb or tex. */
- if (!pixmap_priv->base.fbo->tex)
- pixmap_priv->base.fbo->tex =
+ if (!pixmap_priv->fbo->tex)
+ pixmap_priv->fbo->tex =
_glamor_create_tex(glamor_priv, pixmap->drawable.width,
pixmap->drawable.height, format);
- if (flag != GLAMOR_CREATE_FBO_NO_FBO && pixmap_priv->base.fbo->fb == 0)
- if (glamor_pixmap_ensure_fb(pixmap_priv->base.fbo) != 0)
+ if (flag != GLAMOR_CREATE_FBO_NO_FBO && pixmap_priv->fbo->fb == 0)
+ if (glamor_pixmap_ensure_fb(glamor_priv, pixmap_priv->fbo) != 0)
return FALSE;
}
@@ -582,7 +561,7 @@ glamor_pixmap_exchange_fbos(PixmapPtr front, PixmapPtr back)
front_priv = glamor_get_pixmap_private(front);
back_priv = glamor_get_pixmap_private(back);
- temp_fbo = front_priv->base.fbo;
- front_priv->base.fbo = back_priv->base.fbo;
- back_priv->base.fbo = temp_fbo;
+ temp_fbo = front_priv->fbo;
+ front_priv->fbo = back_priv->fbo;
+ back_priv->fbo = temp_fbo;
}
diff --git a/xserver/glamor/glamor_font.c b/xserver/glamor/glamor_font.c
index 6b3a16abc..637e0dce1 100644
--- a/xserver/glamor/glamor_font.c
+++ b/xserver/glamor/glamor_font.c
@@ -77,9 +77,25 @@ glamor_font_get(ScreenPtr screen, FontPtr font)
glamor_font->glyph_width_bytes = glyph_width_bytes;
glamor_font->glyph_height = glyph_height;
- overall_width = glyph_width_bytes * num_cols;
- overall_height = glyph_height * num_rows;
+ /*
+ * Layout the font two blocks of columns wide.
+ * This avoids a problem with some fonts that are too high to fit.
+ */
+ glamor_font->row_width = glyph_width_bytes * num_cols;
+
+ if (num_rows > 1) {
+ overall_width = glamor_font->row_width * 2;
+ overall_height = glyph_height * ((num_rows + 1) / 2);
+ } else {
+ overall_width = glamor_font->row_width;
+ overall_height = glyph_height;
+ }
+ if (overall_width > glamor_priv->max_fbo_size ||
+ overall_height > glamor_priv->max_fbo_size) {
+ /* fallback if we don't fit inside a texture */
+ return NULL;
+ }
bits = malloc(overall_width * overall_height);
if (!bits)
return NULL;
@@ -112,11 +128,17 @@ glamor_font_get(ScreenPtr screen, FontPtr font)
(*font->get_glyphs)(font, 1, c, TwoD16Bit, &count, &glyph);
if (count) {
- char *dst = bits + row * glyph_height * overall_width +
- col * glyph_width_bytes;
+ char *dst;
char *src = glyph->bits;
unsigned y;
+ dst = bits;
+ /* get offset of start of first row */
+ dst += (row / 2) * glyph_height * overall_width;
+ /* add offset into second row */
+ dst += (row & 1) ? glamor_font->row_width : 0;
+
+ dst += col * glyph_width_bytes;
for (y = 0; y < GLYPHHEIGHTPIXELS(glyph); y++) {
memcpy(dst, src, GLYPHWIDTHBYTES(glyph));
dst += overall_width;
@@ -127,8 +149,13 @@ glamor_font_get(ScreenPtr screen, FontPtr font)
}
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ glamor_priv->suppress_gl_out_of_memory_logging = true;
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8UI, overall_width, overall_height,
0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, bits);
+ glamor_priv->suppress_gl_out_of_memory_logging = false;
+ if (glGetError() == GL_OUT_OF_MEMORY)
+ return NULL;
free(bits);
diff --git a/xserver/glamor/glamor_font.h b/xserver/glamor/glamor_font.h
index 36d20624d..4d41e0196 100644
--- a/xserver/glamor/glamor_font.h
+++ b/xserver/glamor/glamor_font.h
@@ -30,7 +30,7 @@ typedef struct {
CARD8 default_col;
GLuint texture_id;
-
+ GLuint row_width;
CARD16 glyph_width_bytes;
CARD16 glyph_width_pixels;
CARD16 glyph_height;
diff --git a/xserver/glamor/glamor_glyphblt.c b/xserver/glamor/glamor_glyphblt.c
index 73b1df51e..b21aa068e 100644
--- a/xserver/glamor/glamor_glyphblt.c
+++ b/xserver/glamor/glamor_glyphblt.c
@@ -48,7 +48,7 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc,
glamor_pixmap_private *pixmap_priv;
glamor_program *prog;
RegionPtr clip = gc->pCompositeClip;
- int box_x, box_y;
+ int box_index;
pixmap_priv = glamor_get_pixmap_private(pixmap);
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
@@ -60,14 +60,14 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc,
&glamor_priv->poly_glyph_blt_progs,
&glamor_facet_poly_glyph_blt);
if (!prog)
- goto bail_ctx;
+ goto bail;
glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
start_x += drawable->x;
y += drawable->y;
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+ glamor_pixmap_loop(pixmap_priv, box_index) {
int x;
int n;
int num_points, max_points;
@@ -75,7 +75,7 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc,
int off_x, off_y;
char *vbo_offset;
- glamor_set_destination_drawable(drawable, box_x, box_y, FALSE, TRUE,
+ glamor_set_destination_drawable(drawable, box_index, FALSE, TRUE,
prog->matrix_uniform, &off_x, &off_y);
max_points = 500;
@@ -138,12 +138,9 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc,
}
}
- glDisable(GL_COLOR_LOGIC_OP);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
return TRUE;
-bail_ctx:
- glDisable(GL_COLOR_LOGIC_OP);
bail:
return FALSE;
}
@@ -160,32 +157,6 @@ glamor_poly_glyph_blt(DrawablePtr drawable, GCPtr gc,
ppci, pglyph_base);
}
-Bool
-glamor_poly_glyph_blt_nf(DrawablePtr drawable, GCPtr gc,
- int start_x, int y, unsigned int nglyph,
- CharInfoPtr *ppci, void *pglyph_base)
-{
- if (glamor_poly_glyph_blt_gl(drawable, gc, start_x, y, nglyph, ppci,
- pglyph_base))
- return TRUE;
- if (glamor_ddx_fallback_check_pixmap(drawable) &&
- glamor_ddx_fallback_check_gc(gc)) {
- return FALSE;
- }
- miPolyGlyphBlt(drawable, gc, start_x, y, nglyph,
- ppci, pglyph_base);
- return TRUE;
-}
-
-Bool
-glamor_image_glyph_blt_nf(DrawablePtr drawable, GCPtr gc,
- int start_x, int y, unsigned int nglyph,
- CharInfoPtr *ppci, void *pglyph_base)
-{
- miImageGlyphBlt(drawable, gc, start_x, y, nglyph, ppci, pglyph_base);
- return TRUE;
-}
-
static Bool
glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap,
DrawablePtr drawable, int w, int h, int x, int y)
@@ -198,7 +169,7 @@ glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap,
int bitmap_stride = bitmap->devKind;
glamor_program *prog;
RegionPtr clip = gc->pCompositeClip;
- int box_x, box_y;
+ int box_index;
int yy, xx;
int num_points;
INT16 *points = NULL;
@@ -217,7 +188,7 @@ glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap,
&glamor_priv->poly_glyph_blt_progs,
&glamor_facet_poly_glyph_blt);
if (!prog)
- goto bail_ctx;
+ goto bail;
glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
@@ -249,19 +220,16 @@ glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap,
glamor_put_vbo_space(screen);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
- glamor_set_destination_drawable(drawable, box_x, box_y, FALSE, TRUE,
+ glamor_pixmap_loop(pixmap_priv, box_index) {
+ glamor_set_destination_drawable(drawable, box_index, FALSE, TRUE,
prog->matrix_uniform, NULL, NULL);
glDrawArrays(GL_POINTS, 0, num_points);
}
- glDisable(GL_COLOR_LOGIC_OP);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
return TRUE;
-bail_ctx:
- glDisable(GL_COLOR_LOGIC_OP);
bail:
return FALSE;
}
@@ -275,21 +243,3 @@ glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
miPushPixels(pGC, pBitmap, pDrawable, w, h, x, y);
}
-
-Bool
-glamor_push_pixels_nf(GCPtr gc, PixmapPtr bitmap,
- DrawablePtr drawable, int w, int h, int x, int y)
-{
- if (glamor_push_pixels_gl(gc, bitmap, drawable, w, h, x, y))
- return TRUE;
-
- if (glamor_ddx_fallback_check_pixmap(drawable) &&
- glamor_ddx_fallback_check_pixmap(&bitmap->drawable) &&
- glamor_ddx_fallback_check_gc(gc))
- {
- return FALSE;
- }
-
- miPushPixels(gc, bitmap, drawable, w, h, x, y);
- return TRUE;
-}
diff --git a/xserver/glamor/glamor_glyphs.c b/xserver/glamor/glamor_glyphs.c
deleted file mode 100644
index 1f1362487..000000000
--- a/xserver/glamor/glamor_glyphs.c
+++ /dev/null
@@ -1,1783 +0,0 @@
-/*
- * Copyright © 2008 Red Hat, Inc.
- * Partly based on code Copyright © 2000 SuSE, Inc.
- *
- * 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 Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * Red Hat DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL Red Hat
- * 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.
- *
- * 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 SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * 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.
- *
- * Author: Owen Taylor <otaylor@fishsoup.net>
- * Based on code by: Keith Packard
- */
-
-#include <stdlib.h>
-
-#include "glamor_priv.h"
-
-#include <mipict.h>
-
-#if DEBUG_GLYPH_CACHE
-#define DBG_GLYPH_CACHE(a) ErrorF a
-#else
-#define DBG_GLYPH_CACHE(a)
-#endif
-
-/* Width of the pixmaps we use for the caches; this should be less than
- * max texture size of the driver; this may need to actually come from
- * the driver.
- */
-
-/* Maximum number of glyphs we buffer on the stack before flushing
- * rendering to the mask or destination surface.
- */
-#define GLYPH_BUFFER_SIZE 1024
-
-typedef struct {
- PicturePtr source;
- glamor_composite_rect_t rects[GLYPH_BUFFER_SIZE + 4];
- int count;
-} glamor_glyph_buffer_t;
-
-struct glamor_glyph {
- glamor_glyph_cache_t *cache;
- uint16_t x, y;
- uint16_t size, pos;
- unsigned long long left_x1_map, left_x2_map;
- unsigned long long right_x1_map, right_x2_map; /* Use to check real intersect or not. */
- Bool has_edge_map;
- Bool cached;
-};
-
-typedef enum {
- GLAMOR_GLYPH_SUCCESS, /* Glyph added to render buffer */
- GLAMOR_GLYPH_FAIL, /* out of memory, etc */
- GLAMOR_GLYPH_NEED_FLUSH, /* would evict a glyph already in the buffer */
-} glamor_glyph_cache_result_t;
-
-#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
-static DevPrivateKeyRec glamor_glyph_key;
-
-static inline struct glamor_glyph *
-glamor_glyph_get_private(ScreenPtr screen, GlyphPtr glyph)
-{
- struct glamor_glyph *privates = (struct glamor_glyph*)glyph->devPrivates;
-
- return &privates[screen->myNum];
-}
-
-/*
- * Mask cache is located at the corresponding cache picture's last row.
- * and is deadicated for the mask picture when do the glyphs_via_mask.
- *
- * As we split the glyphs list according to its overlapped or non-overlapped,
- * we can reduce the length of glyphs to do the glyphs_via_mask to 2 or 3
- * glyphs one time for most cases. Thus it give us a case to allocate a
- * small portion of the corresponding cache directly as the mask picture.
- * Then we can rendering the glyphs to this mask picture, and latter we
- * can accumulate the second steps, composite the mask to the dest with
- * the other non-overlapped glyphs's rendering process.
- * Another major benefit is we now only need to clear a relatively small mask
- * region then before. It also make us implement a bunch mask picture clearing
- * algorithm to avoid too frequently small region clearing.
- *
- * If there is no any overlapping, this method will not get performance gain.
- * If there is some overlapping, then this algorithm can get about 15% performance
- * gain.
- */
-
-static void
-clear_mask_cache_bitmap(glamor_glyph_mask_cache_t *maskcache,
- unsigned int clear_mask_bits)
-{
- unsigned int i = 0;
- BoxRec box[MASK_CACHE_WIDTH];
- int box_cnt = 0;
-
- assert((clear_mask_bits & ~MASK_CACHE_MASK) == 0);
- for (i = 0; i < MASK_CACHE_WIDTH; i++) {
- if (clear_mask_bits & (1 << i)) {
- box[box_cnt].x1 = maskcache->mcache[i].x;
- box[box_cnt].x2 = maskcache->mcache[i].x + MASK_CACHE_MAX_SIZE;
- box[box_cnt].y1 = maskcache->mcache[i].y;
- box[box_cnt].y2 = maskcache->mcache[i].y + MASK_CACHE_MAX_SIZE;
- box_cnt++;
- }
- }
- glamor_solid_boxes(maskcache->pixmap, box, box_cnt, 0);
- maskcache->cleared_bitmap |= clear_mask_bits;
-}
-
-static void
-clear_mask_cache(glamor_glyph_mask_cache_t *maskcache)
-{
- int x = 0;
- int cnt = MASK_CACHE_WIDTH;
- unsigned int i = 0;
- struct glamor_glyph_mask_cache_entry *mce;
-
- glamor_solid(maskcache->pixmap, 0, CACHE_PICTURE_SIZE, CACHE_PICTURE_SIZE,
- MASK_CACHE_MAX_SIZE, 0);
- mce = &maskcache->mcache[0];
- while (cnt--) {
- mce->width = 0;
- mce->height = 0;
- mce->x = x;
- mce->y = CACHE_PICTURE_SIZE;
- mce->idx = i++;
- x += MASK_CACHE_MAX_SIZE;
- mce++;
- }
- maskcache->free_bitmap = MASK_CACHE_MASK;
- maskcache->cleared_bitmap = MASK_CACHE_MASK;
-}
-
-static int
-find_continuous_bits(unsigned int bits, int bits_cnt, unsigned int *pbits_mask)
-{
- int idx = 0;
- unsigned int bits_mask;
-
- bits_mask = ((1LL << bits_cnt) - 1);
-
- if (_X_UNLIKELY(bits_cnt > 56)) {
- while (bits) {
- if ((bits & bits_mask) == bits_mask) {
- *pbits_mask = bits_mask << idx;
- return idx;
- }
- bits >>= 1;
- idx++;
- }
- }
- else {
- idx = __fls(bits);
- while (bits) {
- unsigned int temp_bits;
-
- temp_bits = bits_mask << (idx - bits_cnt + 1);
- if ((bits & temp_bits) == temp_bits) {
- *pbits_mask = temp_bits;
- return (idx - bits_cnt + 1);
- }
- /* Find first zero. And clear the tested bit. */
- bits &= ~(1LL << idx);
- idx = __fls(~bits);
- bits &= ~((1LL << idx) - 1);
- idx--;
- }
- }
- return -1;
-}
-
-static struct glamor_glyph_mask_cache_entry *
-get_mask_cache(glamor_glyph_mask_cache_t *maskcache, int blocks)
-{
- int free_cleared_bit, idx = -1;
- int retry_cnt = 0;
- unsigned int bits_mask = 0;
-
- if (maskcache->free_bitmap == 0)
- return NULL;
- retry:
- free_cleared_bit = maskcache->free_bitmap & maskcache->cleared_bitmap;
- if (free_cleared_bit && blocks == 1) {
- idx = __fls(free_cleared_bit);
- bits_mask = 1 << idx;
- }
- else if (free_cleared_bit && blocks > 1) {
- idx = find_continuous_bits(free_cleared_bit, blocks, &bits_mask);
- }
-
- if (idx < 0) {
- clear_mask_cache_bitmap(maskcache, maskcache->free_bitmap);
- if (retry_cnt++ > 2)
- return NULL;
- goto retry;
- }
-
- maskcache->cleared_bitmap &= ~bits_mask;
- maskcache->free_bitmap &= ~bits_mask;
- DEBUGF("get idx %d free %x clear %x \n",
- idx, maskcache->free_bitmap, maskcache->cleared_bitmap);
- return &maskcache->mcache[idx];
-}
-
-static void
-put_mask_cache_bitmap(glamor_glyph_mask_cache_t *maskcache,
- unsigned int bitmap)
-{
- maskcache->free_bitmap |= bitmap;
- DEBUGF("put bitmap %x free %x clear %x \n",
- bitmap, maskcache->free_bitmap, maskcache->cleared_bitmap);
-}
-
-static void
-glamor_unrealize_glyph_caches(ScreenPtr pScreen)
-{
- glamor_screen_private *glamor = glamor_get_screen_private(pScreen);
- int i;
-
- if (!glamor->glyph_caches_realized)
- return;
-
- for (i = 0; i < GLAMOR_NUM_GLYPH_CACHE_FORMATS; i++) {
- glamor_glyph_cache_t *cache = &glamor->glyphCaches[i];
-
- if (cache->picture)
- FreePicture(cache->picture, 0);
-
- if (cache->glyphs)
- free(cache->glyphs);
-
- if (glamor->mask_cache[i])
- free(glamor->mask_cache[i]);
- }
- glamor->glyph_caches_realized = FALSE;
-}
-
-void
-glamor_glyphs_fini(ScreenPtr pScreen)
-{
- glamor_unrealize_glyph_caches(pScreen);
-}
-
-/* All caches for a single format share a single pixmap for glyph storage,
- * allowing mixing glyphs of different sizes without paying a penalty
- * for switching between source pixmaps. (Note that for a size of font
- * right at the border between two sizes, we might be switching for almost
- * every glyph.)
- *
- * This function allocates the storage pixmap, and then fills in the
- * rest of the allocated structures for all caches with the given format.
- */
-
-Bool
-glamor_realize_glyph_caches(ScreenPtr pScreen)
-{
- glamor_screen_private *glamor = glamor_get_screen_private(pScreen);
-
- unsigned int formats[] = {
- PIXMAN_a8,
- PIXMAN_a8r8g8b8,
- };
- int i;
-
- if (glamor->glyph_caches_realized)
- return TRUE;
-
- memset(glamor->glyphCaches, 0, sizeof(glamor->glyphCaches));
-
- for (i = 0; i < sizeof(formats) / sizeof(formats[0]); i++) {
- glamor_glyph_cache_t *cache = &glamor->glyphCaches[i];
- PixmapPtr pixmap;
- PicturePtr picture;
- XID component_alpha;
- int depth = PIXMAN_FORMAT_DEPTH(formats[i]);
- int error;
- PictFormatPtr pPictFormat =
- PictureMatchFormat(pScreen, depth, formats[i]);
- if (!pPictFormat)
- goto bail;
-
- /* Now allocate the pixmap and picture */
- pixmap = pScreen->CreatePixmap(pScreen,
- CACHE_PICTURE_SIZE,
- CACHE_PICTURE_SIZE + MASK_CACHE_MAX_SIZE,
- depth, GLAMOR_CREATE_NO_LARGE);
- if (!pixmap)
- goto bail;
-
- component_alpha = NeedsComponent(pPictFormat->format);
- picture = CreatePicture(0, &pixmap->drawable, pPictFormat,
- CPComponentAlpha, &component_alpha,
- serverClient, &error);
-
- pScreen->DestroyPixmap(pixmap);
- if (!picture)
- goto bail;
-
- ValidatePicture(picture);
-
- cache->picture = picture;
- cache->glyphs = calloc(sizeof(GlyphPtr), GLYPH_CACHE_SIZE);
- if (!cache->glyphs)
- goto bail;
-
- cache->evict = rand() % GLYPH_CACHE_SIZE;
- glamor->mask_cache[i] = calloc(1, sizeof(*glamor->mask_cache[i]));
- glamor->mask_cache[i]->pixmap = pixmap;
- clear_mask_cache(glamor->mask_cache[i]);
- }
- assert(i == GLAMOR_NUM_GLYPH_CACHE_FORMATS);
-
- glamor->glyph_caches_realized = TRUE;
- return TRUE;
-
- bail:
- glamor_unrealize_glyph_caches(pScreen);
- return FALSE;
-}
-
-/**
- * Called by glamor_create_screen_resources() to set up the glyph cache.
- *
- * This was previously required to be called by the drivers, but not
- * as of the xserver 1.16 ABI.
- */
-Bool
-glamor_glyphs_init(ScreenPtr pScreen)
-{
- if (!dixRegisterPrivateKey(&glamor_glyph_key,
- PRIVATE_GLYPH,
- screenInfo.numScreens * sizeof(struct glamor_glyph)))
- return FALSE;
-
- return TRUE;
-}
-
-/* The most efficient thing to way to upload the glyph to the screen
- * is to use CopyArea; glamor pixmaps are always offscreen.
- */
-static void
-glamor_glyph_cache_upload_glyph(ScreenPtr screen,
- glamor_glyph_cache_t *cache,
- GlyphPtr glyph, int x, int y)
-{
- PicturePtr pGlyphPicture = GlyphPicture(glyph)[screen->myNum];
- PixmapPtr pGlyphPixmap = (PixmapPtr) pGlyphPicture->pDrawable;
- PixmapPtr pCachePixmap = (PixmapPtr) cache->picture->pDrawable;
- PixmapPtr scratch;
- BoxRec box;
- GCPtr gc;
-
- gc = GetScratchGC(pCachePixmap->drawable.depth, screen);
- if (!gc)
- return;
-
- ValidateGC(&pCachePixmap->drawable, gc);
-
- scratch = pGlyphPixmap;
- if (pGlyphPixmap->drawable.depth != pCachePixmap->drawable.depth) {
-
- scratch = glamor_create_pixmap(screen,
- glyph->info.width,
- glyph->info.height,
- pCachePixmap->drawable.depth, 0);
- if (scratch) {
- PicturePtr picture;
- int error;
-
- picture =
- CreatePicture(0,
- &scratch->drawable,
- PictureMatchFormat
- (screen,
- pCachePixmap->drawable.depth,
- cache->picture->format),
- 0, NULL, serverClient, &error);
- if (picture) {
- ValidatePicture(picture);
- glamor_composite(PictOpSrc,
- pGlyphPicture,
- NULL, picture,
- 0, 0, 0, 0, 0,
- 0, glyph->info.width, glyph->info.height);
- FreePicture(picture, 0);
- }
- }
- else {
- scratch = pGlyphPixmap;
- }
- }
-
- box.x1 = x;
- box.y1 = y;
- box.x2 = x + glyph->info.width;
- box.y2 = y + glyph->info.height;
- glamor_copy(&scratch->drawable,
- &pCachePixmap->drawable, NULL,
- &box, 1, -x, -y, FALSE, FALSE, 0, NULL);
- if (scratch != pGlyphPixmap)
- screen->DestroyPixmap(scratch);
-
- FreeScratchGC(gc);
-}
-
-void
-glamor_glyph_unrealize(ScreenPtr screen, GlyphPtr glyph)
-{
- struct glamor_glyph *priv;
-
- /* Use Lookup in case we have not attached to this glyph. */
- priv = glamor_glyph_get_private(screen, glyph);
-
- if (priv->cached)
- priv->cache->glyphs[priv->pos] = NULL;
-}
-
-/* Cut and paste from render/glyph.c - probably should export it instead */
-static void
-glamor_glyph_extents(int nlist,
- GlyphListPtr list, GlyphPtr *glyphs, BoxPtr extents)
-{
- int x1, x2, y1, y2;
- int x, y, n;
-
- x1 = y1 = MAXSHORT;
- x2 = y2 = MINSHORT;
- x = y = 0;
- while (nlist--) {
- x += list->xOff;
- y += list->yOff;
- n = list->len;
- list++;
- while (n--) {
- GlyphPtr glyph = *glyphs++;
- int v;
-
- v = x - glyph->info.x;
- if (v < x1)
- x1 = v;
- v += glyph->info.width;
- if (v > x2)
- x2 = v;
-
- v = y - glyph->info.y;
- if (v < y1)
- y1 = v;
- v += glyph->info.height;
- if (v > y2)
- y2 = v;
-
- x += glyph->info.xOff;
- y += glyph->info.yOff;
- }
- }
-
- extents->x1 = x1 < MINSHORT ? MINSHORT : x1;
- extents->x2 = x2 > MAXSHORT ? MAXSHORT : x2;
- extents->y1 = y1 < MINSHORT ? MINSHORT : y1;
- extents->y2 = y2 > MAXSHORT ? MAXSHORT : y2;
-}
-
-static void
-glamor_glyph_priv_get_edge_map(GlyphPtr glyph, struct glamor_glyph *priv,
- PicturePtr glyph_picture)
-{
- PixmapPtr glyph_pixmap = (PixmapPtr) glyph_picture->pDrawable;
- int j;
- unsigned long long left_x1_map = 0, left_x2_map = 0;
- unsigned long long right_x1_map = 0, right_x2_map = 0;
- int bitsPerPixel;
- int stride;
- void *bits;
- int width;
- unsigned int left_x1_data = 0, left_x2_data = 0;
- unsigned int right_x1_data = 0, right_x2_data = 0;
-
- bitsPerPixel = glyph_pixmap->drawable.bitsPerPixel;
- stride = glyph_pixmap->devKind;
- bits = glyph_pixmap->devPrivate.ptr;
- width = glyph->info.width;
-
- if (glyph_pixmap->drawable.width < 2
- || !(glyph_pixmap->drawable.depth == 8
- || glyph_pixmap->drawable.depth == 1
- || glyph_pixmap->drawable.depth == 32)) {
- priv->has_edge_map = FALSE;
- return;
- }
-
- left_x1_map = left_x2_map = 0;
- right_x1_map = right_x2_map = 0;
-
- for (j = 0; j < glyph_pixmap->drawable.height; j++) {
- if (bitsPerPixel == 8) {
- unsigned char *data;
-
- data = (unsigned char *) ((unsigned char *) bits + stride * j);
- left_x1_data = *data++;
- left_x2_data = *data;
- data =
- (unsigned char *) ((unsigned char *) bits + stride * j + width -
- 2);
- right_x1_data = *data++;
- right_x2_data = *data;
- }
- else if (bitsPerPixel == 32) {
- left_x1_data = *((unsigned int *) bits + stride / 4 * j);
- left_x2_data = *((unsigned int *) bits + stride / 4 * j + 1);
- right_x1_data =
- *((unsigned int *) bits + stride / 4 * j + width - 2);
- right_x2_data =
- *((unsigned int *) bits + stride / 4 * j + width - 1);
- }
- else if (bitsPerPixel == 1) {
- unsigned char temp;
-
- temp = *((unsigned char *) glyph_pixmap->devPrivate.ptr
- + glyph_pixmap->devKind * j) & 0x3;
- left_x1_data = temp & 0x1;
- left_x2_data = temp & 0x2;
-
- temp = *((unsigned char *) glyph_pixmap->devPrivate.ptr
- + glyph_pixmap->devKind * j
- + (glyph_pixmap->drawable.width - 2) / 8);
- right_x1_data = temp
- & (1 << ((glyph_pixmap->drawable.width - 2) % 8));
- temp = *((unsigned char *) glyph_pixmap->devPrivate.ptr
- + glyph_pixmap->devKind * j
- + (glyph_pixmap->drawable.width - 1) / 8);
- right_x2_data = temp
- & (1 << ((glyph_pixmap->drawable.width - 1) % 8));
- }
- left_x1_map |= (left_x1_data != 0) << j;
- left_x2_map |= (left_x2_data != 0) << j;
- right_x1_map |= (right_x1_data != 0) << j;
- right_x2_map |= (right_x2_data != 0) << j;
- }
-
- priv->left_x1_map = left_x1_map;
- priv->left_x2_map = left_x2_map;
- priv->right_x1_map = right_x1_map;
- priv->right_x2_map = right_x2_map;
- priv->has_edge_map = TRUE;
- return;
-}
-
-/**
- * Returns TRUE if the glyphs in the lists intersect. Only checks based on
- * bounding box, which appears to be good enough to catch most cases at least.
- */
-
-#define INTERSECTED_TYPE_MASK 1
-#define NON_INTERSECTED 0
-#define INTERSECTED 1
-
-struct glamor_glyph_list {
- int nlist;
- GlyphListPtr list;
- GlyphPtr *glyphs;
- int type;
-};
-
-static Bool
-glyph_new_fixed_list(struct glamor_glyph_list *fixed_list,
- GlyphPtr *cur_glyphs,
- GlyphPtr ** head_glyphs,
- GlyphListPtr cur_list,
- int cur_pos, int cur_x, int cur_y,
- int x1, int y1, int x2, int y2,
- GlyphListPtr *head_list,
- int *head_pos,
- int *head_x,
- int *head_y, int *fixed_cnt, int type, BoxPtr prev_extents)
-{
- int x_off = 0;
- int y_off = 0;
- int n_off = 0;
- int list_cnt;
-
- if (type == NON_INTERSECTED) {
- if (x1 < prev_extents->x2 && x2 > prev_extents->x1
- && y1 < prev_extents->y2 && y2 > prev_extents->y1)
- return FALSE;
- x_off = (*(cur_glyphs - 1))->info.xOff;
- y_off = (*(cur_glyphs - 1))->info.yOff;
- n_off = 1;
- }
-
- list_cnt = cur_list - *head_list + 1;
- if (cur_pos <= n_off) {
- DEBUGF("break at %d n_off %d\n", cur_pos, n_off);
- list_cnt--;
- if (cur_pos < n_off) {
- /* we overlap with previous list's last glyph. */
- x_off += cur_list->xOff;
- y_off += cur_list->yOff;
- cur_list--;
- cur_pos = cur_list->len;
- if (cur_pos <= n_off) {
- list_cnt--;
- }
- }
- }
- DEBUGF("got %d lists\n", list_cnt);
- if (list_cnt != 0) {
- fixed_list->list = malloc(list_cnt * sizeof(*cur_list));
- memcpy(fixed_list->list, *head_list, list_cnt * sizeof(*cur_list));
- fixed_list->list[0].xOff = *head_x;
- fixed_list->list[0].yOff = *head_y;
- fixed_list->glyphs = *head_glyphs;
- fixed_list->type = type & INTERSECTED_TYPE_MASK;
- fixed_list->nlist = list_cnt;
- if (cur_list != *head_list) {
- fixed_list->list[0].len = (*head_list)->len - *head_pos;
- if (cur_pos != n_off)
- fixed_list->list[list_cnt - 1].len = cur_pos - n_off;
- }
- else
- fixed_list->list[0].len = cur_pos - *head_pos - n_off;
- (*fixed_cnt)++;
- }
-
- if (type <= INTERSECTED) {
- *head_list = cur_list;
- *head_pos = cur_pos - n_off;
- *head_x = cur_x - x_off;
- *head_y = cur_y - y_off;
- *head_glyphs = cur_glyphs - n_off;
- }
- return TRUE;
-}
-
-/*
- * This function detects glyph lists's overlapping.
- *
- * If check_fake_overlap is set, then it will check the glyph's left
- * and right small boxes's real overlapping pixels. And if there is
- * no real pixel overlapping, then it will not be treated as overlapped
- * case. And we also can configured it to ignore less than 2 pixels
- * overlappig.
- *
- * This function analyzes all the lists and split the list to multiple
- * lists which are pure overlapped glyph lists or pure non-overlapped
- * list if the overlapping only ocurr on the two adjacent glyphs.
- * Otherwise, it return -1.
- *
- **/
-
-static int
-glamor_glyphs_intersect(int nlist, GlyphListPtr list, GlyphPtr *glyphs,
- PictFormatShort mask_format,
- ScreenPtr screen, Bool check_fake_overlap,
- struct glamor_glyph_list *fixed_list, int fixed_size)
-{
- int x1, x2, y1, y2;
- int n;
- int x, y;
- BoxPtr extents;
- BoxRec prev_extents;
- Bool first = TRUE, first_list = TRUE;
- Bool need_free_list_region = FALSE;
- Bool need_free_fixed_list = FALSE;
- struct glamor_glyph *priv = NULL;
- Bool in_non_intersected_list = -1;
- GlyphListPtr head_list;
- int head_x, head_y, head_pos;
- int fixed_cnt = 0;
- GlyphPtr *head_glyphs;
- GlyphListPtr cur_list = list;
- RegionRec list_region;
- RegionRec current_region;
- BoxRec current_box;
-
- if (nlist > 1) {
- pixman_region_init(&list_region);
- need_free_list_region = TRUE;
- }
-
- pixman_region_init(&current_region);
-
- extents = pixman_region_extents(&current_region);
-
- x = 0;
- y = 0;
- x1 = x2 = y1 = y2 = 0;
- n = 0;
- extents->x1 = 0;
- extents->y1 = 0;
- extents->x2 = 0;
- extents->y2 = 0;
-
- head_list = list;
- DEBUGF("has %d lists.\n", nlist);
- while (nlist--) {
- BoxRec left_box, right_box = { 0 };
- Bool has_left_edge_box = FALSE, has_right_edge_box = FALSE;
- Bool left_to_right;
- struct glamor_glyph *left_priv = NULL, *right_priv = NULL;
-
- x += list->xOff;
- y += list->yOff;
- n = list->len;
- left_to_right = TRUE;
- cur_list = list++;
-
- if (_X_UNLIKELY(!first_list)) {
- pixman_region_init_with_extents(&current_region, extents);
- pixman_region_union(&list_region, &list_region, &current_region);
- first = TRUE;
- }
- else {
- head_list = cur_list;
- head_pos = cur_list->len - n;
- head_x = x;
- head_y = y;
- head_glyphs = glyphs;
- }
-
- DEBUGF("current list %p has %d glyphs\n", cur_list, n);
- while (n--) {
- GlyphPtr glyph = *glyphs++;
-
- DEBUGF("the %dth glyph\n", cur_list->len - n - 1);
- if (glyph->info.width == 0 || glyph->info.height == 0) {
- x += glyph->info.xOff;
- y += glyph->info.yOff;
- continue;
- }
- if (mask_format
- && mask_format != GlyphPicture(glyph)[screen->myNum]->format) {
- need_free_fixed_list = TRUE;
- goto done;
- }
-
- x1 = x - glyph->info.x;
- if (x1 < MINSHORT)
- x1 = MINSHORT;
- y1 = y - glyph->info.y;
- if (y1 < MINSHORT)
- y1 = MINSHORT;
- if (check_fake_overlap)
- priv = glamor_glyph_get_private(screen, glyph);
-
- x2 = x1 + glyph->info.width;
- y2 = y1 + glyph->info.height;
-
- if (x2 > MAXSHORT)
- x2 = MAXSHORT;
- if (y2 > MAXSHORT)
- y2 = MAXSHORT;
-
- if (first) {
- extents->x1 = x1;
- extents->y1 = y1;
- extents->x2 = x2;
- extents->y2 = y2;
-
- prev_extents = *extents;
-
- first = FALSE;
- if (check_fake_overlap && priv
- && priv->has_edge_map && glyph->info.yOff == 0) {
- left_box.x1 = x1;
- left_box.x2 = x1 + 1;
- left_box.y1 = y1;
-
- right_box.x1 = x2 - 2;
- right_box.x2 = x2 - 1;
- right_box.y1 = y1;
- left_priv = right_priv = priv;
- has_left_edge_box = TRUE;
- has_right_edge_box = TRUE;
- }
- }
- else {
- if (_X_UNLIKELY(!first_list)) {
- current_box.x1 = x1;
- current_box.y1 = y1;
- current_box.x2 = x2;
- current_box.y2 = y2;
- if (pixman_region_contains_rectangle
- (&list_region, &current_box) != PIXMAN_REGION_OUT) {
- need_free_fixed_list = TRUE;
- goto done;
- }
- }
-
- if (x1 < extents->x2 && x2 > extents->x1
- && y1 < extents->y2 && y2 > extents->y1) {
-
- if (check_fake_overlap &&
- (has_left_edge_box || has_right_edge_box)
- && priv->has_edge_map && glyph->info.yOff == 0) {
- int left_dx, right_dx;
- unsigned long long intersected;
-
- left_dx = has_left_edge_box ? 1 : 0;
- right_dx = has_right_edge_box ? 1 : 0;
- if (x1 + 1 < extents->x2 - right_dx &&
- x2 - 1 > extents->x1 + left_dx)
- goto real_intersected;
-
- if (left_to_right && has_right_edge_box) {
- if (x1 == right_box.x1) {
- intersected =
- ((priv->left_x1_map & right_priv->
- right_x1_map)
- | (priv->left_x2_map & right_priv->
- right_x2_map));
- if (intersected)
- goto real_intersected;
- }
- else if (x1 == right_box.x2) {
- intersected =
- (priv->left_x1_map & right_priv->
- right_x2_map);
- if (intersected) {
-#ifdef GLYPHS_EDEGE_OVERLAP_LOOSE_CHECK
- /* tolerate with two pixels overlap. */
- intersected &= ~(1 << __fls(intersected));
- if ((intersected & (intersected - 1)))
-#endif
- goto real_intersected;
- }
- }
- }
- else if (!left_to_right && has_left_edge_box) {
- if (x2 - 1 == left_box.x1) {
- intersected =
- (priv->right_x2_map & left_priv->
- left_x1_map);
- if (intersected) {
-#ifdef GLYPHS_EDEGE_OVERLAP_LOOSE_CHECK
- /* tolerate with two pixels overlap. */
- intersected &= ~(1 << __fls(intersected));
- if ((intersected & (intersected - 1)))
-#endif
- goto real_intersected;
- }
- }
- else if (x2 - 1 == right_box.x2) {
- if ((priv->right_x1_map & left_priv->
- left_x1_map)
- || (priv->right_x2_map & left_priv->
- left_x2_map))
- goto real_intersected;
- }
- }
- else {
- if (x1 < extents->x2 && x1 + 2 > extents->x1)
- goto real_intersected;
- }
- goto non_intersected;
- }
- else {
- real_intersected:
- DEBUGF("overlap with previous glyph.\n");
- if (in_non_intersected_list == 1) {
- if (fixed_cnt >= fixed_size) {
- need_free_fixed_list = TRUE;
- goto done;
- }
- if (!glyph_new_fixed_list(&fixed_list[fixed_cnt],
- glyphs - 1,
- &head_glyphs,
- cur_list,
- cur_list->len - (n + 1),
- x, y, x1, y1, x2, y2,
- &head_list, &head_pos,
- &head_x, &head_y,
- &fixed_cnt,
- NON_INTERSECTED,
- &prev_extents)) {
- need_free_fixed_list = TRUE;
- goto done;
- }
- }
-
- in_non_intersected_list = 0;
-
- }
- }
- else {
- non_intersected:
- DEBUGF("doesn't overlap with previous glyph.\n");
- if (in_non_intersected_list == 0) {
- if (fixed_cnt >= fixed_size) {
- need_free_fixed_list = TRUE;
- goto done;
- }
- if (!glyph_new_fixed_list(&fixed_list[fixed_cnt],
- glyphs - 1,
- &head_glyphs,
- cur_list,
- cur_list->len - (n + 1), x, y,
- x1, y1, x2, y2,
- &head_list,
- &head_pos,
- &head_x,
- &head_y, &fixed_cnt,
- INTERSECTED, &prev_extents)) {
- need_free_fixed_list = TRUE;
- goto done;
- }
- }
- in_non_intersected_list = 1;
- }
- prev_extents = *extents;
- }
-
- if (check_fake_overlap && priv
- && priv->has_edge_map && glyph->info.yOff == 0) {
- if (!has_left_edge_box || x1 < extents->x1) {
- left_box.x1 = x1;
- left_box.x2 = x1 + 1;
- left_box.y1 = y1;
- has_left_edge_box = TRUE;
- left_priv = priv;
- }
-
- if (!has_right_edge_box || x2 > extents->x2) {
- right_box.x1 = x2 - 2;
- right_box.x2 = x2 - 1;
- right_box.y1 = y1;
- has_right_edge_box = TRUE;
- right_priv = priv;
- }
- }
-
- if (x1 < extents->x1)
- extents->x1 = x1;
- if (x2 > extents->x2)
- extents->x2 = x2;
-
- if (y1 < extents->y1)
- extents->y1 = y1;
- if (y2 > extents->y2)
- extents->y2 = y2;
-
- x += glyph->info.xOff;
- y += glyph->info.yOff;
- }
- first_list = FALSE;
- }
-
- if (in_non_intersected_list == 0 && fixed_cnt == 0) {
- fixed_cnt = -1;
- goto done;
- }
-
- if ((in_non_intersected_list != -1 || head_pos != n) && (fixed_cnt > 0)) {
- if (fixed_cnt >= fixed_size) {
- need_free_fixed_list = TRUE;
- goto done;
- }
- if (!glyph_new_fixed_list(&fixed_list[fixed_cnt],
- glyphs - 1,
- &head_glyphs,
- cur_list,
- cur_list->len - (n + 1), x, y,
- x1, y1, x2, y2,
- &head_list,
- &head_pos,
- &head_x,
- &head_y, &fixed_cnt,
- (!in_non_intersected_list) | 0x80,
- &prev_extents)) {
- need_free_fixed_list = TRUE;
- goto done;
- }
- }
-
- done:
- if (need_free_list_region)
- pixman_region_fini(&list_region);
- pixman_region_fini(&current_region);
-
- if (need_free_fixed_list && fixed_cnt >= 0) {
- while (fixed_cnt--) {
- free(fixed_list[fixed_cnt].list);
- }
- }
-
- DEBUGF("Got %d fixed list \n", fixed_cnt);
- return fixed_cnt;
-}
-
-static inline unsigned int
-glamor_glyph_size_to_count(int size)
-{
- size /= GLYPH_MIN_SIZE;
- return size * size;
-}
-
-static inline unsigned int
-glamor_glyph_count_to_mask(int count)
-{
- return ~(count - 1);
-}
-
-static inline unsigned int
-glamor_glyph_size_to_mask(int size)
-{
- return glamor_glyph_count_to_mask(glamor_glyph_size_to_count(size));
-}
-
-static PicturePtr
-glamor_glyph_cache(glamor_screen_private *glamor, GlyphPtr glyph, int *out_x,
- int *out_y)
-{
- ScreenPtr screen = glamor->screen;
- PicturePtr glyph_picture = GlyphPicture(glyph)[screen->myNum];
- glamor_glyph_cache_t *cache =
- &glamor->glyphCaches[PICT_FORMAT_RGB(glyph_picture->format) != 0];
- struct glamor_glyph *priv = NULL, *evicted_priv = NULL;
- int size, mask, pos, s;
-
- if (glyph->info.width > GLYPH_MAX_SIZE
- || glyph->info.height > GLYPH_MAX_SIZE)
- return NULL;
-
- for (size = GLYPH_MIN_SIZE; size <= GLYPH_MAX_SIZE; size *= 2)
- if (glyph->info.width <= size && glyph->info.height <= size)
- break;
-
- s = glamor_glyph_size_to_count(size);
- mask = glamor_glyph_count_to_mask(s);
- pos = (cache->count + s - 1) & mask;
-
- priv = glamor_glyph_get_private(screen, glyph);
- if (pos < GLYPH_CACHE_SIZE) {
- cache->count = pos + s;
- }
- else {
- for (s = size; s <= GLYPH_MAX_SIZE; s *= 2) {
- int i = cache->evict & glamor_glyph_size_to_mask(s);
- GlyphPtr evicted = cache->glyphs[i];
-
- if (evicted == NULL)
- continue;
-
- evicted_priv = glamor_glyph_get_private(screen, evicted);
- assert(evicted_priv->pos == i);
- if (evicted_priv->size >= s) {
- cache->glyphs[i] = NULL;
- evicted_priv->cached = FALSE;
- pos = cache->evict & glamor_glyph_size_to_mask(size);
- }
- else
- evicted_priv = NULL;
- break;
- }
- if (evicted_priv == NULL) {
- int count = glamor_glyph_size_to_count(size);
-
- mask = glamor_glyph_count_to_mask(count);
- pos = cache->evict & mask;
- for (s = 0; s < count; s++) {
- GlyphPtr evicted = cache->glyphs[pos + s];
-
- if (evicted != NULL) {
-
- evicted_priv = glamor_glyph_get_private(screen, evicted);
-
- assert(evicted_priv->pos == pos + s);
- evicted_priv->cached = FALSE;
- cache->glyphs[pos + s] = NULL;
- }
- }
-
- }
- /* And pick a new eviction position */
- cache->evict = rand() % GLYPH_CACHE_SIZE;
- }
-
- cache->glyphs[pos] = glyph;
-
- priv->cache = cache;
- priv->size = size;
- priv->pos = pos;
- s = pos / ((GLYPH_MAX_SIZE / GLYPH_MIN_SIZE) *
- (GLYPH_MAX_SIZE / GLYPH_MIN_SIZE));
- priv->x = s % (CACHE_PICTURE_SIZE / GLYPH_MAX_SIZE) * GLYPH_MAX_SIZE;
- priv->y = (s / (CACHE_PICTURE_SIZE / GLYPH_MAX_SIZE)) * GLYPH_MAX_SIZE;
- for (s = GLYPH_MIN_SIZE; s < GLYPH_MAX_SIZE; s *= 2) {
- if (pos & 1)
- priv->x += s;
- if (pos & 2)
- priv->y += s;
- pos >>= 2;
- }
-
- glamor_glyph_cache_upload_glyph(screen, cache, glyph, priv->x, priv->y);
-#ifndef GLYPHS_NO_EDEGEMAP_OVERLAP_CHECK
- if (priv->has_edge_map == FALSE && glyph->info.width >= 2)
- glamor_glyph_priv_get_edge_map(glyph, priv, glyph_picture);
-#endif
- priv->cached = TRUE;
-
- *out_x = priv->x;
- *out_y = priv->y;
- return cache->picture;
-}
-
-typedef void (*glyphs_flush_func) (void *arg);
-struct glyphs_flush_dst_arg {
- CARD8 op;
- PicturePtr src;
- PicturePtr dst;
- glamor_glyph_buffer_t *buffer;
- int x_src, y_src;
- int x_dst, y_dst;
-};
-
-static struct glyphs_flush_dst_arg dst_arg;
-static struct glyphs_flush_mask_arg mask_arg;
-static glamor_glyph_buffer_t dst_buffer;
-static glamor_glyph_buffer_t mask_buffer;
-unsigned long long mask_glyphs_cnt = 0;
-unsigned long long dst_glyphs_cnt = 0;
-
-#define GLYPHS_DST_MODE_VIA_MASK 0
-#define GLYPHS_DST_MODE_VIA_MASK_CACHE 1
-#define GLYPHS_DST_MODE_TO_DST 2
-#define GLYPHS_DST_MODE_MASK_TO_DST 3
-
-struct glyphs_flush_mask_arg {
- PicturePtr mask;
- glamor_glyph_buffer_t *buffer;
- glamor_glyph_mask_cache_t *maskcache;
- unsigned int used_bitmap;
-};
-
-static void
-glamor_glyphs_flush_mask(struct glyphs_flush_mask_arg *arg)
-{
- if (arg->buffer->count > 0) {
-#ifdef RENDER
- glamor_composite_glyph_rects(PictOpAdd, arg->buffer->source,
- NULL, arg->mask,
- arg->buffer->count, arg->buffer->rects);
-#endif
- }
- arg->buffer->count = 0;
- arg->buffer->source = NULL;
-
-}
-
-static void
-glamor_glyphs_flush_dst(struct glyphs_flush_dst_arg *arg)
-{
- if (!arg->buffer)
- return;
-
- if (mask_buffer.count > 0) {
- glamor_glyphs_flush_mask(&mask_arg);
- }
- if (mask_arg.used_bitmap) {
- put_mask_cache_bitmap(mask_arg.maskcache, mask_arg.used_bitmap);
- mask_arg.used_bitmap = 0;
- }
-
- if (arg->buffer->count > 0) {
- glamor_composite_glyph_rects(arg->op, arg->src,
- arg->buffer->source, arg->dst,
- arg->buffer->count,
- &arg->buffer->rects[0]);
- arg->buffer->count = 0;
- arg->buffer->source = NULL;
- }
-}
-
-static glamor_glyph_cache_result_t
-glamor_buffer_glyph(glamor_screen_private *glamor_priv,
- glamor_glyph_buffer_t *buffer,
- PictFormatShort format,
- GlyphPtr glyph, struct glamor_glyph *priv,
- int x_glyph, int y_glyph,
- int dx, int dy, int w, int h,
- int glyphs_dst_mode,
- glyphs_flush_func glyphs_flush, void *flush_arg)
-{
- ScreenPtr screen = glamor_priv->screen;
- glamor_composite_rect_t *rect;
- PicturePtr source;
- int x, y;
- glamor_glyph_cache_t *cache;
-
- if (glyphs_dst_mode != GLYPHS_DST_MODE_MASK_TO_DST)
- priv = glamor_glyph_get_private(screen, glyph);
-
- if (PICT_FORMAT_BPP(format) == 1)
- format = PICT_a8;
-
- cache = &glamor_priv->glyphCaches[PICT_FORMAT_RGB(format) != 0];
-
- if (buffer->source && buffer->source != cache->picture && glyphs_flush) {
- (*glyphs_flush) (flush_arg);
- glyphs_flush = NULL;
- }
-
- if (buffer->count == GLYPH_BUFFER_SIZE && glyphs_flush) {
- (*glyphs_flush) (flush_arg);
- glyphs_flush = NULL;
- }
-
- if (priv && priv->cached) {
- rect = &buffer->rects[buffer->count++];
- rect->x_src = priv->x + dx;
- rect->y_src = priv->y + dy;
- if (buffer->source == NULL)
- buffer->source = priv->cache->picture;
- if (glyphs_dst_mode <= GLYPHS_DST_MODE_VIA_MASK_CACHE)
- assert(priv->cache->glyphs[priv->pos] == glyph);
- }
- else {
- assert(glyphs_dst_mode != GLYPHS_DST_MODE_MASK_TO_DST);
- if (glyphs_flush)
- (*glyphs_flush) (flush_arg);
- source = glamor_glyph_cache(glamor_priv, glyph, &x, &y);
-
- if (source != NULL) {
- rect = &buffer->rects[buffer->count++];
- rect->x_src = x + dx;
- rect->y_src = y + dy;
- if (buffer->source == NULL)
- buffer->source = source;
- if (glyphs_dst_mode == GLYPHS_DST_MODE_VIA_MASK_CACHE) {
- /* mode 1 means we are using global mask cache,
- * thus we have to composite from the cache picture
- * to the cache picture, we need a flush here to make
- * sure latter we get the corret glyphs data.*/
- glamor_make_current(glamor_priv);
- glFlush();
- }
- }
- else {
- /* Couldn't find the glyph in the cache, use the glyph picture directly */
- source = GlyphPicture(glyph)[screen->myNum];
- if (buffer->source && buffer->source != source && glyphs_flush)
- (*glyphs_flush) (flush_arg);
- buffer->source = source;
-
- rect = &buffer->rects[buffer->count++];
- rect->x_src = 0 + dx;
- rect->y_src = 0 + dy;
- }
- priv = glamor_glyph_get_private(screen, glyph);
- }
-
- rect->x_dst = x_glyph;
- rect->y_dst = y_glyph;
- if (glyphs_dst_mode != GLYPHS_DST_MODE_MASK_TO_DST) {
- rect->x_dst -= glyph->info.x;
- rect->y_dst -= glyph->info.y;
- }
- rect->width = w;
- rect->height = h;
- if (glyphs_dst_mode > GLYPHS_DST_MODE_VIA_MASK_CACHE) {
- rect->x_mask = rect->x_src;
- rect->y_mask = rect->y_src;
- rect->x_src = dst_arg.x_src + rect->x_dst - dst_arg.x_dst;
- rect->y_src = dst_arg.y_src + rect->y_dst - dst_arg.y_dst;
- }
-
- return GLAMOR_GLYPH_SUCCESS;
-}
-
-static void
-glamor_buffer_glyph_clip(glamor_screen_private *glamor_priv,
- BoxPtr rects,
- int nrect, PictFormatShort format,
- GlyphPtr glyph, struct glamor_glyph *priv,
- int glyph_x, int glyph_y,
- int glyph_dx, int glyph_dy,
- int width, int height,
- int glyphs_mode,
- glyphs_flush_func flush_func, void *arg)
-{
- int i;
-
- for (i = 0; i < nrect; i++) {
- int dst_x, dst_y;
- int dx, dy;
- int x2, y2;
-
- dst_x = glyph_x - glyph_dx;
- dst_y = glyph_y - glyph_dy;
- x2 = dst_x + width;
- y2 = dst_y + height;
- dx = dy = 0;
- if (rects[i].y1 >= y2)
- break;
-
- if (dst_x < rects[i].x1)
- dx = rects[i].x1 - dst_x, dst_x = rects[i].x1;
- if (x2 > rects[i].x2)
- x2 = rects[i].x2;
- if (dst_y < rects[i].y1)
- dy = rects[i].y1 - dst_y, dst_y = rects[i].y1;
- if (y2 > rects[i].y2)
- y2 = rects[i].y2;
- if (dst_x < x2 && dst_y < y2) {
-
- glamor_buffer_glyph(glamor_priv,
- &dst_buffer,
- format,
- glyph, priv,
- dst_x + glyph_dx,
- dst_y + glyph_dy,
- dx, dy,
- x2 - dst_x, y2 - dst_y,
- glyphs_mode, flush_func, arg);
- }
- }
-}
-
-static void
-glamor_glyphs_via_mask(CARD8 op,
- PicturePtr src,
- PicturePtr dst,
- PictFormatPtr mask_format,
- INT16 x_src,
- INT16 y_src,
- int nlist, GlyphListPtr list, GlyphPtr *glyphs,
- Bool use_mask_cache)
-{
- PixmapPtr mask_pixmap = 0;
- PicturePtr mask;
- ScreenPtr screen = dst->pDrawable->pScreen;
- int width = 0, height = 0;
- int x, y;
- int x_dst = list->xOff, y_dst = list->yOff;
- int n;
- GlyphPtr glyph;
- int error;
- BoxRec extents = { 0, 0, 0, 0 };
- XID component_alpha;
- glamor_screen_private *glamor_priv;
- int need_free_mask = FALSE;
- glamor_glyph_buffer_t buffer;
- struct glyphs_flush_mask_arg arg;
- glamor_glyph_buffer_t *pmask_buffer;
- struct glyphs_flush_mask_arg *pmask_arg;
- struct glamor_glyph_mask_cache_entry *mce = NULL;
- glamor_glyph_mask_cache_t *maskcache;
- glamor_glyph_cache_t *cache;
- int glyphs_dst_mode;
-
- glamor_glyph_extents(nlist, list, glyphs, &extents);
-
- if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1)
- return;
- glamor_priv = glamor_get_screen_private(screen);
- width = extents.x2 - extents.x1;
- height = extents.y2 - extents.y1;
-
- if (mask_format->depth == 1) {
- PictFormatPtr a8Format = PictureMatchFormat(screen, 8, PICT_a8);
-
- if (a8Format)
- mask_format = a8Format;
- }
-
- cache = &glamor_priv->glyphCaches
- [PICT_FORMAT_RGB(mask_format->format) != 0];
- maskcache = glamor_priv->mask_cache[PICT_FORMAT_RGB(mask_format->format) != 0];
-
- x = -extents.x1;
- y = -extents.y1;
- if (!use_mask_cache || width > (CACHE_PICTURE_SIZE / 4)
- || height > MASK_CACHE_MAX_SIZE) {
- new_mask_pixmap:
- mask_pixmap = glamor_create_pixmap(screen, width, height,
- mask_format->depth,
- CREATE_PIXMAP_USAGE_SCRATCH);
- if (!mask_pixmap) {
- glamor_destroy_pixmap(mask_pixmap);
- return;
- }
- glamor_solid(mask_pixmap, 0, 0, width, height, 0);
- component_alpha = NeedsComponent(mask_format->format);
- mask = CreatePicture(0, &mask_pixmap->drawable,
- mask_format, CPComponentAlpha,
- &component_alpha, serverClient, &error);
- if (!mask)
- return;
- need_free_mask = TRUE;
- pmask_arg = &arg;
- pmask_buffer = &buffer;
- pmask_buffer->count = 0;
- pmask_buffer->source = NULL;
- pmask_arg->used_bitmap = 0;
- glyphs_dst_mode = GLYPHS_DST_MODE_VIA_MASK;
- }
- else {
- int retry_cnt = 0;
-
- retry:
- mce = get_mask_cache(maskcache,
- (width + MASK_CACHE_MAX_SIZE -
- 1) / MASK_CACHE_MAX_SIZE);
-
- if (mce == NULL) {
- glamor_glyphs_flush_dst(&dst_arg);
- retry_cnt++;
- if (retry_cnt > 2) {
- assert(0);
- goto new_mask_pixmap;
- }
- goto retry;
- }
-
- mask = cache->picture;
- x += mce->x;
- y += mce->y;
- mce->width = (width + MASK_CACHE_MAX_SIZE - 1) / MASK_CACHE_MAX_SIZE;
- mce->height = 1;
- if (mask_arg.mask && mask_arg.mask != mask && mask_buffer.count != 0)
- glamor_glyphs_flush_dst(&dst_arg);
- pmask_arg = &mask_arg;
- pmask_buffer = &mask_buffer;
- pmask_arg->maskcache = maskcache;
- glyphs_dst_mode = GLYPHS_DST_MODE_VIA_MASK_CACHE;
- }
- pmask_arg->mask = mask;
- pmask_arg->buffer = pmask_buffer;
- while (nlist--) {
- x += list->xOff;
- y += list->yOff;
- n = list->len;
- mask_glyphs_cnt += n;
- while (n--) {
- glyph = *glyphs++;
- if (glyph->info.width > 0 && glyph->info.height > 0) {
- glyphs_flush_func flush_func;
- void *temp_arg;
-
- if (need_free_mask) {
- if (pmask_buffer->count)
- flush_func =
- (glyphs_flush_func) glamor_glyphs_flush_mask;
- else
- flush_func = NULL;
- temp_arg = pmask_arg;
- }
- else {
- /* If we are using global mask cache, then we need to
- * flush dst instead of mask. As some dst depends on the
- * previous mask result. Just flush mask can't get all previous's
- * overlapped glyphs.*/
- if (dst_buffer.count || mask_buffer.count)
- flush_func =
- (glyphs_flush_func) glamor_glyphs_flush_dst;
- else
- flush_func = NULL;
- temp_arg = &dst_arg;
- }
- glamor_buffer_glyph(glamor_priv, pmask_buffer,
- mask_format->format,
- glyph, NULL, x, y,
- 0, 0,
- glyph->info.width, glyph->info.height,
- glyphs_dst_mode,
- flush_func, (void *) temp_arg);
- }
- x += glyph->info.xOff;
- y += glyph->info.yOff;
- }
- list++;
- }
-
- x = extents.x1;
- y = extents.y1;
- if (need_free_mask) {
- glamor_glyphs_flush_mask(pmask_arg);
- CompositePicture(op,
- src,
- mask,
- dst,
- x_src + x - x_dst,
- y_src + y - y_dst, 0, 0, x, y, width, height);
- FreePicture(mask, 0);
- glamor_destroy_pixmap(mask_pixmap);
- }
- else {
- struct glamor_glyph priv;
- glyphs_flush_func flush_func;
- BoxPtr rects;
- int nrect;
-
- priv.cache = cache;
- priv.x = mce->x;
- priv.y = mce->y;
- priv.cached = TRUE;
- rects = REGION_RECTS(dst->pCompositeClip);
- nrect = REGION_NUM_RECTS(dst->pCompositeClip);
-
- pmask_arg->used_bitmap |= ((1 << mce->width) - 1) << mce->idx;
- dst_arg.op = op;
- dst_arg.src = src;
- dst_arg.dst = dst;
- dst_arg.buffer = &dst_buffer;
- dst_arg.x_src = x_src;
- dst_arg.y_src = y_src;
- dst_arg.x_dst = x_dst;
- dst_arg.y_dst = y_dst;
-
- if (dst_buffer.source == NULL) {
- dst_buffer.source = cache->picture;
- }
- else if (dst_buffer.source != cache->picture) {
- glamor_glyphs_flush_dst(&dst_arg);
- dst_buffer.source = cache->picture;
- }
-
- x += dst->pDrawable->x;
- y += dst->pDrawable->y;
-
- if (dst_buffer.count || mask_buffer.count)
- flush_func = (glyphs_flush_func) glamor_glyphs_flush_dst;
- else
- flush_func = NULL;
-
- glamor_buffer_glyph_clip(glamor_priv,
- rects, nrect,
- mask_format->format,
- NULL, &priv,
- x, y,
- 0, 0,
- width, height,
- GLYPHS_DST_MODE_MASK_TO_DST,
- flush_func, (void *) &dst_arg);
- }
-}
-
-static void
-glamor_glyphs_to_dst(CARD8 op,
- PicturePtr src,
- PicturePtr dst,
- INT16 x_src,
- INT16 y_src,
- int nlist, GlyphListPtr list, GlyphPtr *glyphs)
-{
- ScreenPtr screen = dst->pDrawable->pScreen;
- int x = 0, y = 0;
- int x_dst = list->xOff, y_dst = list->yOff;
- int n;
- GlyphPtr glyph;
- BoxPtr rects;
- int nrect;
- glamor_screen_private *glamor_priv;
-
- rects = REGION_RECTS(dst->pCompositeClip);
- nrect = REGION_NUM_RECTS(dst->pCompositeClip);
-
- glamor_priv = glamor_get_screen_private(screen);
-
- dst_arg.op = op;
- dst_arg.src = src;
- dst_arg.dst = dst;
- dst_arg.buffer = &dst_buffer;
- dst_arg.x_src = x_src;
- dst_arg.y_src = y_src;
- dst_arg.x_dst = x_dst;
- dst_arg.y_dst = y_dst;
-
- x = dst->pDrawable->x;
- y = dst->pDrawable->y;
-
- while (nlist--) {
- x += list->xOff;
- y += list->yOff;
- n = list->len;
- dst_glyphs_cnt += n;
- while (n--) {
- glyph = *glyphs++;
-
- if (glyph->info.width > 0 && glyph->info.height > 0) {
- glyphs_flush_func flush_func;
-
- if (dst_buffer.count || mask_buffer.count)
- flush_func = (glyphs_flush_func) glamor_glyphs_flush_dst;
- else
- flush_func = NULL;
- glamor_buffer_glyph_clip(glamor_priv,
- rects, nrect,
- (GlyphPicture(glyph)[screen->myNum])->
- format, glyph, NULL, x, y,
- glyph->info.x, glyph->info.y,
- glyph->info.width, glyph->info.height,
- GLYPHS_DST_MODE_TO_DST, flush_func,
- (void *) &dst_arg);
- }
-
- x += glyph->info.xOff;
- y += glyph->info.yOff;
- }
- list++;
- }
-}
-
-#define MAX_FIXED_SIZE
-static void
-glamor_glyphs_reset_buffer(glamor_glyph_buffer_t *buffer)
-{
- buffer->count = 0;
- buffer->source = NULL;
-}
-
-static Bool
-_glamor_glyphs(CARD8 op,
- PicturePtr src,
- PicturePtr dst,
- PictFormatPtr mask_format,
- INT16 x_src,
- INT16 y_src, int nlist, GlyphListPtr list,
- GlyphPtr *glyphs, Bool fallback)
-{
- PictFormatShort format;
- int fixed_size, fixed_cnt = 0;
- struct glamor_glyph_list *fixed_list = NULL;
- Bool need_free_list = FALSE;
-
-#ifndef GLYPHS_NO_EDEGEMAP_OVERLAP_CHECK
- Bool check_fake_overlap = TRUE;
-
- if (!(op == PictOpOver || op == PictOpAdd || op == PictOpXor)) {
- /* C = (0,0,0,0) D = glyphs , SRC = A, DEST = B (faked overlapped glyphs, overlapped with (0,0,0,0)).
- * For those op, (A IN (C ADD D)) OP B != (A IN D) OP ((A IN C) OP B)
- * or (A IN (D ADD C)) OP B != (A IN C) OP ((A IN D) OP B)
- * We need to split the faked regions to three or two, and composite the disoverlapped small
- * boxes one by one. For other Ops, it's safe to composite the whole box. */
- check_fake_overlap = FALSE;
- }
-#else
- Bool check_fake_overlap = FALSE;
-#endif
- if (mask_format)
- format = mask_format->depth << 24 | mask_format->format;
- else
- format = 0;
-
- fixed_size = 32;
- glamor_glyphs_reset_buffer(&dst_buffer);
-
- if (!mask_format || (((nlist == 1 && list->len == 1) || op == PictOpAdd)
- && (dst->format ==
- ((mask_format->depth << 24) | mask_format->
- format)))) {
- glamor_glyphs_to_dst(op, src, dst, x_src, y_src, nlist, list, glyphs);
- goto last_flush;
- }
-
- glamor_glyphs_reset_buffer(&mask_buffer);
-
- /* We have mask_format. Need to check the real overlap or not. */
- format = mask_format->depth << 24 | mask_format->format;
-
- fixed_list = calloc(fixed_size, sizeof(*fixed_list));
- if (_X_UNLIKELY(fixed_list == NULL))
- fixed_size = 0;
- fixed_cnt = glamor_glyphs_intersect(nlist, list, glyphs,
- format, dst->pDrawable->pScreen,
- check_fake_overlap,
- fixed_list, fixed_size);
- if (fixed_cnt == 0)
- mask_format = NULL;
- need_free_list = TRUE;
-
- if (fixed_cnt <= 0) {
- if (mask_format == NULL) {
- glamor_glyphs_to_dst(op, src, dst, x_src, y_src, nlist,
- list, glyphs);
- goto last_flush;
- }
- else {
- glamor_glyphs_via_mask(op, src, dst, mask_format,
- x_src, y_src, nlist, list, glyphs, FALSE);
- goto free_fixed_list;
- }
- }
- else {
-
- /* We have splitted the original list to serval list, some are overlapped
- * and some are non-overlapped. For the non-overlapped, we render it to
- * dst directly. For the overlapped, we render it to mask picture firstly,
- * then render the mask to dst. If we can use mask cache which is in the
- * glyphs cache's last row, we can accumulate the rendering of mask to dst
- * with the other dst_buffer's rendering operations thus can reduce the call
- * of glDrawElements.
- *
- * */
- struct glamor_glyph_list *saved_list;
-
- saved_list = fixed_list;
- mask_arg.used_bitmap = 0;
- while (fixed_cnt--) {
- if (fixed_list->type == NON_INTERSECTED) {
- glamor_glyphs_to_dst(op, src, dst,
- x_src, y_src,
- fixed_list->nlist,
- fixed_list->list, fixed_list->glyphs);
- }
- else
- glamor_glyphs_via_mask(op, src, dst,
- mask_format, x_src, y_src,
- fixed_list->nlist,
- fixed_list->list,
- fixed_list->glyphs, TRUE);
-
- free(fixed_list->list);
- fixed_list++;
- }
- free(saved_list);
- need_free_list = FALSE;
- }
-
- last_flush:
- if (dst_buffer.count || mask_buffer.count)
- glamor_glyphs_flush_dst(&dst_arg);
- free_fixed_list:
- if (need_free_list) {
- assert(fixed_cnt <= 0);
- free(fixed_list);
- }
- return TRUE;
-}
-
-void
-glamor_glyphs(CARD8 op,
- PicturePtr src,
- PicturePtr dst,
- PictFormatPtr mask_format,
- INT16 x_src,
- INT16 y_src, int nlist, GlyphListPtr list, GlyphPtr *glyphs)
-{
- _glamor_glyphs(op, src, dst, mask_format, x_src,
- y_src, nlist, list, glyphs, TRUE);
-}
-
-Bool
-glamor_glyphs_nf(CARD8 op,
- PicturePtr src,
- PicturePtr dst,
- PictFormatPtr mask_format,
- INT16 x_src,
- INT16 y_src, int nlist, GlyphListPtr list, GlyphPtr *glyphs)
-{
- return _glamor_glyphs(op, src, dst, mask_format, x_src,
- y_src, nlist, list, glyphs, FALSE);
-}
diff --git a/xserver/glamor/glamor_gradient.c b/xserver/glamor/glamor_gradient.c
index 4ded89dcd..c50542a32 100644
--- a/xserver/glamor/glamor_gradient.c
+++ b/xserver/glamor/glamor_gradient.c
@@ -32,8 +32,6 @@
#include "glamor_priv.h"
-#ifdef RENDER
-
#define LINEAR_SMALL_STOPS (6 + 2)
#define LINEAR_LARGE_STOPS (16 + 2)
@@ -584,27 +582,6 @@ glamor_init_gradient_shader(ScreenPtr screen)
_glamor_create_radial_gradient_program(screen, RADIAL_LARGE_STOPS, 0);
}
-void
-glamor_fini_gradient_shader(ScreenPtr screen)
-{
- glamor_screen_private *glamor_priv;
- int i = 0;
-
- glamor_priv = glamor_get_screen_private(screen);
- glamor_make_current(glamor_priv);
-
- for (i = 0; i < 3; i++) {
- /* Linear Gradient */
- if (glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][i])
- glDeleteProgram(glamor_priv->gradient_prog
- [SHADER_GRADIENT_LINEAR][i]);
-
- if (glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][i])
- glDeleteProgram(glamor_priv->gradient_prog
- [SHADER_GRADIENT_RADIAL][i]);
- }
-}
-
static void
_glamor_gradient_convert_trans_matrix(PictTransform *from, float to[3][3],
int width, int height, int normalize)
@@ -670,12 +647,12 @@ _glamor_gradient_set_pixmap_destination(ScreenPtr screen,
PicturePtr dst_picture,
GLfloat *xscale, GLfloat *yscale,
int x_source, int y_source,
- float vertices[8],
- float tex_vertices[8],
int tex_normalize)
{
glamor_pixmap_private *pixmap_priv;
PixmapPtr pixmap = NULL;
+ GLfloat *v;
+ char *vbo_offset;
pixmap = glamor_get_drawable_pixmap(dst_picture->pDrawable);
pixmap_priv = glamor_get_pixmap_private(pixmap);
@@ -684,22 +661,24 @@ _glamor_gradient_set_pixmap_destination(ScreenPtr screen,
return 0;
}
- glamor_set_destination_pixmap_priv_nc(pixmap_priv);
+ glamor_set_destination_pixmap_priv_nc(glamor_priv, pixmap, pixmap_priv);
- pixmap_priv_get_dest_scale(pixmap_priv, xscale, yscale);
+ pixmap_priv_get_dest_scale(pixmap, pixmap_priv, xscale, yscale);
DEBUGF("xscale = %f, yscale = %f,"
" x_source = %d, y_source = %d, width = %d, height = %d\n",
*xscale, *yscale, x_source, y_source,
dst_picture->pDrawable->width, dst_picture->pDrawable->height);
+ v = glamor_get_vbo_space(screen, 16 * sizeof(GLfloat), &vbo_offset);
+
glamor_set_normalize_vcoords_tri_strip(*xscale, *yscale,
0, 0,
(INT16) (dst_picture->pDrawable->
width),
(INT16) (dst_picture->pDrawable->
height),
- vertices);
+ v);
if (tex_normalize) {
glamor_set_normalize_tcoords_tri_stripe(*xscale, *yscale,
@@ -710,7 +689,7 @@ _glamor_gradient_set_pixmap_destination(ScreenPtr screen,
(INT16) (dst_picture->
pDrawable->height +
y_source),
- tex_vertices);
+ &v[8]);
}
else {
glamor_set_tcoords_tri_strip(x_source, y_source,
@@ -718,28 +697,29 @@ _glamor_gradient_set_pixmap_destination(ScreenPtr screen,
x_source,
(INT16) (dst_picture->pDrawable->height) +
y_source,
- tex_vertices);
+ &v[8]);
}
DEBUGF("vertices --> leftup : %f X %f, rightup: %f X %f,"
"rightbottom: %f X %f, leftbottom : %f X %f\n",
- vertices[0], vertices[1], vertices[2], vertices[3],
- vertices[4], vertices[5], vertices[6], vertices[7]);
+ v[0], v[1], v[2], v[3],
+ v[4], v[5], v[6], v[7]);
DEBUGF("tex_vertices --> leftup : %f X %f, rightup: %f X %f,"
"rightbottom: %f X %f, leftbottom : %f X %f\n",
- tex_vertices[0], tex_vertices[1], tex_vertices[2], tex_vertices[3],
- tex_vertices[4], tex_vertices[5], tex_vertices[6], tex_vertices[7]);
+ v[8], v[9], v[10], v[11],
+ v[12], v[13], v[14], v[15]);
glamor_make_current(glamor_priv);
glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT,
- GL_FALSE, 0, vertices);
+ GL_FALSE, 0, vbo_offset);
glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT,
- GL_FALSE, 0, tex_vertices);
+ GL_FALSE, 0, vbo_offset + 8 * sizeof(GLfloat));
glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
+ glamor_put_vbo_space(screen);
return 1;
}
@@ -835,13 +815,11 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen,
PixmapPtr pixmap = NULL;
GLint gradient_prog = 0;
int error;
- float tex_vertices[8];
int stops_count = 0;
int count = 0;
GLfloat *stop_colors = NULL;
GLfloat *n_stops = NULL;
GLfloat xscale, yscale;
- float vertices[8];
float transform_mat[3][3];
static const float identity_mat[3][3] = { {1.0, 0.0, 0.0},
{0.0, 1.0, 0.0},
@@ -992,18 +970,20 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen,
if (!_glamor_gradient_set_pixmap_destination
(screen, glamor_priv, dst_picture, &xscale, &yscale, x_source, y_source,
- vertices, tex_vertices, 0))
+ 0))
goto GRADIENT_FAIL;
+ glamor_set_alu(screen, GXcopy);
+
/* Set all the stops and colors to shader. */
if (stops_count > RADIAL_SMALL_STOPS) {
- stop_colors = malloc(4 * stops_count * sizeof(float));
+ stop_colors = xallocarray(stops_count, 4 * sizeof(float));
if (stop_colors == NULL) {
ErrorF("Failed to allocate stop_colors memory.\n");
goto GRADIENT_FAIL;
}
- n_stops = malloc(stops_count * sizeof(float));
+ n_stops = xallocarray(stops_count, sizeof(float));
if (n_stops == NULL) {
ErrorF("Failed to allocate n_stops memory.\n");
goto GRADIENT_FAIL;
@@ -1144,7 +1124,6 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen,
float pt_distance;
float p1_distance;
GLfloat cos_val;
- float tex_vertices[8];
int stops_count = 0;
GLfloat *stop_colors = NULL;
GLfloat *n_stops = NULL;
@@ -1152,7 +1131,6 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen,
float slope;
GLfloat xscale, yscale;
GLfloat pt1[2], pt2[2];
- float vertices[8];
float transform_mat[3][3];
static const float identity_mat[3][3] = { {1.0, 0.0, 0.0},
{0.0, 1.0, 0.0},
@@ -1308,9 +1286,11 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen,
if (!_glamor_gradient_set_pixmap_destination
(screen, glamor_priv, dst_picture, &xscale, &yscale, x_source, y_source,
- vertices, tex_vertices, 1))
+ 1))
goto GRADIENT_FAIL;
+ glamor_set_alu(screen, GXcopy);
+
/* Normalize the PTs. */
glamor_set_normalize_pt(xscale, yscale,
pixman_fixed_to_double(src_picture->pSourcePict->
@@ -1336,13 +1316,13 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen,
/* Set all the stops and colors to shader. */
if (stops_count > LINEAR_SMALL_STOPS) {
- stop_colors = malloc(4 * stops_count * sizeof(float));
+ stop_colors = xallocarray(stops_count, 4 * sizeof(float));
if (stop_colors == NULL) {
ErrorF("Failed to allocate stop_colors memory.\n");
goto GRADIENT_FAIL;
}
- n_stops = malloc(stops_count * sizeof(float));
+ n_stops = xallocarray(stops_count, sizeof(float));
if (n_stops == NULL) {
ErrorF("Failed to allocate n_stops memory.\n");
goto GRADIENT_FAIL;
@@ -1473,5 +1453,3 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen,
}
#endif /* End of GLAMOR_GRADIENT_SHADER */
-
-#endif /* End of RENDER */
diff --git a/xserver/glamor/glamor_image.c b/xserver/glamor/glamor_image.c
index 90fda4079..315874995 100644
--- a/xserver/glamor/glamor_image.c
+++ b/xserver/glamor/glamor_image.c
@@ -49,7 +49,7 @@ glamor_put_image_gl(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
if (gc->alu != GXcopy)
goto bail;
- if (!glamor_pm_is_solid(&pixmap->drawable, gc->planemask))
+ if (!glamor_pm_is_solid(gc->depth, gc->planemask))
goto bail;
if (format == XYPixmap && drawable->depth == 1 && leftPad == 0)
@@ -102,19 +102,6 @@ glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
glamor_put_image_bail(drawable, gc, depth, x, y, w, h, leftPad, format, bits);
}
-Bool
-glamor_put_image_nf(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
- int w, int h, int leftPad, int format, char *bits)
-{
- if (glamor_put_image_gl(drawable, gc, depth, x, y, w, h, leftPad, format, bits))
- return TRUE;
- if (glamor_ddx_fallback_check_pixmap(drawable) &&
- glamor_ddx_fallback_check_gc(gc))
- return FALSE;
- glamor_put_image_bail(drawable, gc, depth, x, y, w, h, leftPad, format, bits);
- return TRUE;
-}
-
static Bool
glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h,
unsigned int format, unsigned long plane_mask, char *d)
@@ -129,7 +116,7 @@ glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h,
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
goto bail;
- if (format != ZPixmap || !glamor_pm_is_solid(drawable, plane_mask))
+ if (format != ZPixmap || !glamor_pm_is_solid(drawable->depth, plane_mask))
goto bail;
glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y);
@@ -163,17 +150,3 @@ glamor_get_image(DrawablePtr drawable, int x, int y, int w, int h,
return;
glamor_get_image_bail(drawable, x, y, w, h, format, plane_mask, d);
}
-
-Bool
-glamor_get_image_nf(DrawablePtr drawable, int x, int y, int w, int h,
- unsigned int format, unsigned long plane_mask, char *d)
-{
- if (glamor_get_image_gl(drawable, x, y, w, h, format, plane_mask, d))
- return TRUE;
-
- if (glamor_ddx_fallback_check_pixmap(drawable))
- return FALSE;
-
- glamor_get_image_bail(drawable, x, y, w, h, format, plane_mask, d);
- return TRUE;
-}
diff --git a/xserver/glamor/glamor_largepixmap.c b/xserver/glamor/glamor_largepixmap.c
index b9c3b9af1..9a6c95ee9 100644
--- a/xserver/glamor/glamor_largepixmap.c
+++ b/xserver/glamor/glamor_largepixmap.c
@@ -2,10 +2,14 @@
#include "glamor_priv.h"
-static inline glamor_pixmap_private_large_t *
+static void
+glamor_get_transform_extent_from_box(struct pixman_box32 *box,
+ struct pixman_transform *transform);
+
+static inline glamor_pixmap_private *
__glamor_large(glamor_pixmap_private *pixmap_priv) {
- assert(pixmap_priv->type == GLAMOR_TEXTURE_LARGE);
- return &pixmap_priv->large;
+ assert(glamor_pixmap_priv_is_large(pixmap_priv));
+ return pixmap_priv;
}
/**
@@ -150,12 +154,13 @@ __glamor_compute_clipped_regions(int block_w,
*/
glamor_pixmap_clipped_regions *
-glamor_compute_clipped_regions_ext(glamor_pixmap_private *pixmap_priv,
+glamor_compute_clipped_regions_ext(PixmapPtr pixmap,
RegionPtr region,
int *n_region,
int inner_block_w, int inner_block_h,
int reverse, int upsidedown)
{
+ glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
glamor_pixmap_clipped_regions *clipped_regions, *inner_regions,
*result_regions;
int i, j, x, y, k, inner_n_regions;
@@ -166,7 +171,7 @@ glamor_compute_clipped_regions_ext(glamor_pixmap_private *pixmap_priv,
DEBUGF("ext called \n");
- if (pixmap_priv->type != GLAMOR_TEXTURE_LARGE) {
+ if (glamor_pixmap_priv_is_small(pixmap_priv)) {
clipped_regions = calloc(1, sizeof(*clipped_regions));
if (clipped_regions == NULL) {
*n_region = 0;
@@ -176,24 +181,22 @@ glamor_compute_clipped_regions_ext(glamor_pixmap_private *pixmap_priv,
clipped_regions[0].block_idx = 0;
RegionCopy(clipped_regions[0].region, region);
*n_region = 1;
- block_w = pixmap_priv->base.pixmap->drawable.width;
- block_h = pixmap_priv->base.pixmap->drawable.height;
+ block_w = pixmap->drawable.width;
+ block_h = pixmap->drawable.height;
box_array = &small_box;
small_box.x1 = small_box.y1 = 0;
small_box.x2 = block_w;
small_box.y2 = block_h;
}
else {
- glamor_pixmap_private_large_t *priv = __glamor_large(pixmap_priv);
+ glamor_pixmap_private *priv = __glamor_large(pixmap_priv);
clipped_regions = __glamor_compute_clipped_regions(priv->block_w,
priv->block_h,
priv->block_wcnt,
0, 0,
- priv->base.pixmap->
- drawable.width,
- priv->base.pixmap->
- drawable.height,
+ pixmap->drawable.width,
+ pixmap->drawable.height,
region, n_region,
reverse, upsidedown);
@@ -336,7 +339,8 @@ _glamor_largepixmap_reflect_fixup(short *xy1, short *xy2, int wh)
*
*/
static glamor_pixmap_clipped_regions *
-_glamor_compute_clipped_regions(glamor_pixmap_private *pixmap_priv,
+_glamor_compute_clipped_regions(PixmapPtr pixmap,
+ glamor_pixmap_private *pixmap_priv,
RegionPtr region, int *n_region,
int repeat_type, int is_transform,
int reverse, int upsidedown)
@@ -352,10 +356,10 @@ _glamor_compute_clipped_regions(glamor_pixmap_private *pixmap_priv,
int right_shift = 0;
int down_shift = 0;
int x_center_shift = 0, y_center_shift = 0;
- glamor_pixmap_private_large_t *priv;
+ glamor_pixmap_private *priv;
DEBUGRegionPrint(region);
- if (pixmap_priv->type != GLAMOR_TEXTURE_LARGE) {
+ if (glamor_pixmap_priv_is_small(pixmap_priv)) {
clipped_regions = calloc(1, sizeof(*clipped_regions));
clipped_regions[0].region = RegionCreate(NULL, 1);
clipped_regions[0].block_idx = 0;
@@ -366,8 +370,8 @@ _glamor_compute_clipped_regions(glamor_pixmap_private *pixmap_priv,
priv = __glamor_large(pixmap_priv);
- pixmap_width = priv->base.pixmap->drawable.width;
- pixmap_height = priv->base.pixmap->drawable.height;
+ pixmap_width = pixmap->drawable.width;
+ pixmap_height = pixmap->drawable.height;
if (repeat_type == 0 || repeat_type == RepeatPad) {
RegionPtr saved_region = NULL;
@@ -385,10 +389,8 @@ _glamor_compute_clipped_regions(glamor_pixmap_private *pixmap_priv,
priv->block_h,
priv->block_wcnt,
0, 0,
- priv->base.pixmap->
- drawable.width,
- priv->base.pixmap->
- drawable.height,
+ pixmap->drawable.width,
+ pixmap->drawable.height,
region, n_region,
reverse, upsidedown);
if (saved_region)
@@ -670,24 +672,27 @@ _glamor_compute_clipped_regions(glamor_pixmap_private *pixmap_priv,
}
glamor_pixmap_clipped_regions *
-glamor_compute_clipped_regions(glamor_pixmap_private *priv, RegionPtr region,
+glamor_compute_clipped_regions(PixmapPtr pixmap,
+ RegionPtr region,
int *n_region, int repeat_type,
int reverse, int upsidedown)
{
- return _glamor_compute_clipped_regions(priv, region, n_region, repeat_type,
+ glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
+ return _glamor_compute_clipped_regions(pixmap, priv, region, n_region, repeat_type,
0, reverse, upsidedown);
}
/* XXX overflow still exist. maybe we need to change to use region32.
* by default. Or just use region32 for repeat cases?
**/
-glamor_pixmap_clipped_regions *
-glamor_compute_transform_clipped_regions(glamor_pixmap_private *priv,
+static glamor_pixmap_clipped_regions *
+glamor_compute_transform_clipped_regions(PixmapPtr pixmap,
struct pixman_transform *transform,
RegionPtr region, int *n_region,
int dx, int dy, int repeat_type,
int reverse, int upsidedown)
{
+ glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
BoxPtr temp_extent;
struct pixman_box32 temp_box;
struct pixman_box16 short_box;
@@ -714,8 +719,8 @@ glamor_compute_transform_clipped_regions(glamor_pixmap_private *priv,
temp_box.x1 = 0;
if (temp_box.y1 < 0)
temp_box.y1 = 0;
- temp_box.x2 = MIN(temp_box.x2, priv->base.pixmap->drawable.width);
- temp_box.y2 = MIN(temp_box.y2, priv->base.pixmap->drawable.height);
+ 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;
@@ -725,7 +730,8 @@ glamor_compute_transform_clipped_regions(glamor_pixmap_private *priv,
RegionInitBoxes(temp_region, &short_box, 1);
DEBUGF("copy to temp source region \n");
DEBUGRegionPrint(temp_region);
- ret = _glamor_compute_clipped_regions(priv,
+ ret = _glamor_compute_clipped_regions(pixmap,
+ priv,
temp_region,
n_region,
repeat_type, 1, reverse, upsidedown);
@@ -747,12 +753,12 @@ glamor_compute_transform_clipped_regions(glamor_pixmap_private *priv,
* if the clipped result cross the region boundary.
*/
static void
-glamor_merge_clipped_regions(glamor_pixmap_private *pixmap_priv,
+glamor_merge_clipped_regions(PixmapPtr pixmap,
+ glamor_pixmap_private *pixmap_priv,
int repeat_type,
glamor_pixmap_clipped_regions *clipped_regions,
int *n_regions, int *need_clean_fbo)
{
- BoxPtr temp_extent;
BoxRec temp_box, copy_box;
RegionPtr temp_region;
glamor_pixmap_private *temp_priv;
@@ -760,11 +766,11 @@ glamor_merge_clipped_regions(glamor_pixmap_private *pixmap_priv,
int overlap;
int i;
int pixmap_width, pixmap_height;
- glamor_pixmap_private_large_t *priv;
+ glamor_pixmap_private *priv;
priv = __glamor_large(pixmap_priv);
- pixmap_width = priv->base.pixmap->drawable.width;
- pixmap_height = priv->base.pixmap->drawable.height;
+ pixmap_width = pixmap->drawable.width;
+ pixmap_height =pixmap->drawable.height;
temp_region = RegionCreate(NULL, 4);
for (i = 0; i < *n_regions; i++) {
@@ -776,18 +782,17 @@ glamor_merge_clipped_regions(glamor_pixmap_private *pixmap_priv,
RegionValidate(temp_region, &overlap);
DEBUGF("temp region: \n");
DEBUGRegionPrint(temp_region);
- temp_extent = RegionExtents(temp_region);
- temp_box = *temp_extent;
+ temp_box = *RegionExtents(temp_region);
DEBUGF("need copy region: \n");
DEBUGF("%d %d %d %d \n", temp_box.x1, temp_box.y1, temp_box.x2,
temp_box.y2);
temp_pixmap =
- glamor_create_pixmap(priv->base.pixmap->drawable.pScreen,
+ glamor_create_pixmap(pixmap->drawable.pScreen,
temp_box.x2 - temp_box.x1,
temp_box.y2 - temp_box.y1,
- priv->base.pixmap->drawable.depth,
+ pixmap->drawable.depth,
GLAMOR_CREATE_PIXMAP_FIXUP);
if (temp_pixmap == NULL) {
assert(0);
@@ -795,20 +800,20 @@ glamor_merge_clipped_regions(glamor_pixmap_private *pixmap_priv,
}
temp_priv = glamor_get_pixmap_private(temp_pixmap);
- assert(temp_priv->type != GLAMOR_TEXTURE_LARGE);
+ assert(glamor_pixmap_priv_is_small(temp_priv));
priv->box = temp_box;
- if (temp_extent->x1 >= 0 && temp_extent->x2 <= pixmap_width
- && temp_extent->y1 >= 0 && temp_extent->y2 <= pixmap_height) {
+ if (temp_box.x1 >= 0 && temp_box.x2 <= pixmap_width
+ && temp_box.y1 >= 0 && temp_box.y2 <= pixmap_height) {
int dx, dy;
copy_box.x1 = 0;
copy_box.y1 = 0;
- copy_box.x2 = temp_extent->x2 - temp_extent->x1;
- copy_box.y2 = temp_extent->y2 - temp_extent->y1;
- dx = temp_extent->x1;
- dy = temp_extent->y1;
- glamor_copy(&priv->base.pixmap->drawable,
+ copy_box.x2 = temp_box.x2 - temp_box.x1;
+ copy_box.y2 = temp_box.y2 - temp_box.y1;
+ dx = temp_box.x1;
+ dy = temp_box.y1;
+ glamor_copy(&pixmap->drawable,
&temp_pixmap->drawable,
NULL, &copy_box, 1, dx, dy, 0, 0, 0, NULL);
// glamor_solid(temp_pixmap, 0, 0, temp_pixmap->drawable.width,
@@ -840,7 +845,7 @@ glamor_merge_clipped_regions(glamor_pixmap_private *pixmap_priv,
copy_box.x1, copy_box.y1, copy_box.x2,
copy_box.y2, dx, dy);
- glamor_copy(&priv->base.pixmap->drawable,
+ glamor_copy(&pixmap->drawable,
&temp_pixmap->drawable,
NULL, &copy_box, 1, dx, dy, 0, 0, 0, NULL);
@@ -855,7 +860,7 @@ glamor_merge_clipped_regions(glamor_pixmap_private *pixmap_priv,
RegionDestroy(clipped_regions[i].region);
RegionDestroy(temp_region);
priv->box = temp_box;
- priv->base.fbo = glamor_pixmap_detach_fbo(temp_priv);
+ priv->fbo = glamor_pixmap_detach_fbo(temp_priv);
DEBUGF("priv box x1 %d y1 %d x2 %d y2 %d \n",
priv->box.x1, priv->box.y1, priv->box.x2, priv->box.y2);
glamor_destroy_pixmap(temp_pixmap);
@@ -875,7 +880,7 @@ glamor_merge_clipped_regions(glamor_pixmap_private *pixmap_priv,
* boundary and can avoid some overhead.
*
**/
-Bool
+static Bool
glamor_get_transform_block_size(struct pixman_transform *transform,
int block_w, int block_h,
int *transformed_block_w,
@@ -920,11 +925,11 @@ glamor_get_transform_block_size(struct pixman_transform *transform,
return TRUE;
}
-#define VECTOR_FROM_POINT(p, x, y) \
+#define VECTOR_FROM_POINT(p, x, y) do {\
p.v[0] = x; \
p.v[1] = y; \
- p.v[2] = 1.0;
-void
+ p.v[2] = 1.0; } while (0)
+static void
glamor_get_transform_extent_from_box(struct pixman_box32 *box,
struct pixman_transform *transform)
{
@@ -933,12 +938,12 @@ glamor_get_transform_extent_from_box(struct pixman_box32 *box,
struct pixman_f_transform ftransform;
- VECTOR_FROM_POINT(p0, box->x1, box->y1)
- VECTOR_FROM_POINT(p1, box->x2, box->y1)
- VECTOR_FROM_POINT(p2, box->x2, box->y2)
- VECTOR_FROM_POINT(p3, box->x1, box->y2)
+ VECTOR_FROM_POINT(p0, box->x1, box->y1);
+ VECTOR_FROM_POINT(p1, box->x2, box->y1);
+ VECTOR_FROM_POINT(p2, box->x2, box->y2);
+ VECTOR_FROM_POINT(p3, box->x1, box->y2);
- pixman_f_transform_from_pixman_transform(&ftransform, transform);
+ pixman_f_transform_from_pixman_transform(&ftransform, transform);
pixman_f_transform_point(&ftransform, &p0);
pixman_f_transform_point(&ftransform, &p1);
pixman_f_transform_point(&ftransform, &p2);
@@ -966,7 +971,8 @@ glamor_get_transform_extent_from_box(struct pixman_box32 *box,
}
static void
-_glamor_process_transformed_clipped_region(glamor_pixmap_private *priv,
+_glamor_process_transformed_clipped_region(PixmapPtr pixmap,
+ glamor_pixmap_private *priv,
int repeat_type,
glamor_pixmap_clipped_regions *
clipped_regions, int *n_regions,
@@ -976,7 +982,7 @@ _glamor_process_transformed_clipped_region(glamor_pixmap_private *priv,
if (*n_regions != 1) {
/* Merge all source regions into one region. */
- glamor_merge_clipped_regions(priv, repeat_type,
+ glamor_merge_clipped_regions(pixmap, priv, repeat_type,
clipped_regions, n_regions,
need_clean_fbo);
}
@@ -990,22 +996,22 @@ _glamor_process_transformed_clipped_region(glamor_pixmap_private *priv,
int rem;
temp_box = RegionExtents(clipped_regions[0].region);
- modulus(temp_box->x1, priv->base.pixmap->drawable.width, rem);
- shift_x = (temp_box->x1 - rem) / priv->base.pixmap->drawable.width;
- modulus(temp_box->y1, priv->base.pixmap->drawable.height, rem);
- shift_y = (temp_box->y1 - rem) / priv->base.pixmap->drawable.height;
+ modulus(temp_box->x1, pixmap->drawable.width, rem);
+ shift_x = (temp_box->x1 - rem) / pixmap->drawable.width;
+ modulus(temp_box->y1, pixmap->drawable.height, rem);
+ shift_y = (temp_box->y1 - rem) / pixmap->drawable.height;
if (shift_x != 0) {
__glamor_large(priv)->box.x1 +=
- shift_x * priv->base.pixmap->drawable.width;
+ shift_x * pixmap->drawable.width;
__glamor_large(priv)->box.x2 +=
- shift_x * priv->base.pixmap->drawable.width;
+ shift_x * pixmap->drawable.width;
}
if (shift_y != 0) {
__glamor_large(priv)->box.y1 +=
- shift_y * priv->base.pixmap->drawable.height;
+ shift_y * pixmap->drawable.height;
__glamor_large(priv)->box.y2 +=
- shift_y * priv->base.pixmap->drawable.height;
+ shift_y * pixmap->drawable.height;
}
}
}
@@ -1016,9 +1022,9 @@ glamor_composite_largepixmap_region(CARD8 op,
PicturePtr source,
PicturePtr mask,
PicturePtr dest,
- glamor_pixmap_private *source_pixmap_priv,
- glamor_pixmap_private *mask_pixmap_priv,
- glamor_pixmap_private *dest_pixmap_priv,
+ PixmapPtr source_pixmap,
+ PixmapPtr mask_pixmap,
+ PixmapPtr dest_pixmap,
RegionPtr region, Bool force_clip,
INT16 x_source,
INT16 y_source,
@@ -1027,6 +1033,11 @@ glamor_composite_largepixmap_region(CARD8 op,
INT16 x_dest, INT16 y_dest,
CARD16 width, CARD16 height)
{
+ ScreenPtr screen = dest_pixmap->drawable.pScreen;
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+ glamor_pixmap_private *source_pixmap_priv = glamor_get_pixmap_private(source_pixmap);
+ glamor_pixmap_private *mask_pixmap_priv = glamor_get_pixmap_private(mask_pixmap);
+ glamor_pixmap_private *dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
glamor_pixmap_clipped_regions *clipped_dest_regions;
glamor_pixmap_clipped_regions *clipped_source_regions;
glamor_pixmap_clipped_regions *clipped_mask_regions;
@@ -1046,11 +1057,11 @@ glamor_composite_largepixmap_region(CARD8 op,
int source_repeat_type = 0, mask_repeat_type = 0;
int ok = TRUE;
- if (source_pixmap_priv == dest_pixmap_priv) {
+ if (source_pixmap == dest_pixmap) {
glamor_fallback("source and dest pixmaps are the same\n");
return FALSE;
}
- if (mask_pixmap_priv == dest_pixmap_priv) {
+ if (mask_pixmap == dest_pixmap) {
glamor_fallback("mask and dest pixmaps are the same\n");
return FALSE;
}
@@ -1065,12 +1076,12 @@ glamor_composite_largepixmap_region(CARD8 op,
else
mask_repeat_type = RepeatNone;
- if (dest_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) {
+ if (glamor_pixmap_priv_is_large(dest_pixmap_priv)) {
dest_block_width = __glamor_large(dest_pixmap_priv)->block_w;
dest_block_height = __glamor_large(dest_pixmap_priv)->block_h;
} else {
- dest_block_width = dest_pixmap_priv->base.pixmap->drawable.width;
- dest_block_height = dest_pixmap_priv->base.pixmap->drawable.height;
+ dest_block_width = dest_pixmap->drawable.width;
+ dest_block_height = dest_pixmap->drawable.height;
}
fixed_block_width = dest_block_width;
fixed_block_height = dest_block_height;
@@ -1096,7 +1107,7 @@ glamor_composite_largepixmap_region(CARD8 op,
*/
if (source_pixmap_priv
&& source->transform
- && source_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) {
+ && glamor_pixmap_priv_is_large(source_pixmap_priv)) {
int source_transformed_block_width, source_transformed_block_height;
if (!glamor_get_transform_block_size(source->transform,
@@ -1118,7 +1129,7 @@ glamor_composite_largepixmap_region(CARD8 op,
}
if (mask_pixmap_priv
- && mask->transform && mask_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) {
+ && mask->transform && glamor_pixmap_priv_is_large(mask_pixmap_priv)) {
int mask_transformed_block_width, mask_transformed_block_height;
if (!glamor_get_transform_block_size(mask->transform,
@@ -1143,12 +1154,12 @@ glamor_composite_largepixmap_region(CARD8 op,
if (force_clip || fixed_block_width < dest_block_width
|| fixed_block_height < dest_block_height)
clipped_dest_regions =
- glamor_compute_clipped_regions_ext(dest_pixmap_priv, region,
+ glamor_compute_clipped_regions_ext(dest_pixmap, region,
&n_dest_regions,
fixed_block_width,
fixed_block_height, 0, 0);
else
- clipped_dest_regions = glamor_compute_clipped_regions(dest_pixmap_priv,
+ clipped_dest_regions = glamor_compute_clipped_regions(dest_pixmap,
region,
&n_dest_regions,
0, 0, 0);
@@ -1156,7 +1167,7 @@ glamor_composite_largepixmap_region(CARD8 op,
if (source_pixmap_priv
&& (source_pixmap_priv == dest_pixmap_priv ||
source_pixmap_priv == mask_pixmap_priv)
- && source_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) {
+ && glamor_pixmap_priv_is_large(source_pixmap_priv)) {
/* XXX self-copy... */
need_free_source_pixmap_priv = source_pixmap_priv;
source_pixmap_priv = malloc(sizeof(*source_pixmap_priv));
@@ -1172,12 +1183,12 @@ glamor_composite_largepixmap_region(CARD8 op,
glamor_set_pixmap_fbo_current(dest_pixmap_priv,
clipped_dest_regions[i].block_idx);
if (source_pixmap_priv &&
- source_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) {
+ glamor_pixmap_priv_is_large(source_pixmap_priv)) {
if (!source->transform && source_repeat_type != RepeatPad) {
RegionTranslate(clipped_dest_regions[i].region,
x_source - x_dest, y_source - y_dest);
clipped_source_regions =
- glamor_compute_clipped_regions(source_pixmap_priv,
+ glamor_compute_clipped_regions(source_pixmap,
clipped_dest_regions[i].
region, &n_source_regions,
source_repeat_type, 0, 0);
@@ -1185,7 +1196,7 @@ glamor_composite_largepixmap_region(CARD8 op,
}
else {
clipped_source_regions =
- glamor_compute_transform_clipped_regions(source_pixmap_priv,
+ glamor_compute_transform_clipped_regions(source_pixmap,
source->transform,
clipped_dest_regions
[i].region,
@@ -1202,7 +1213,7 @@ glamor_composite_largepixmap_region(CARD8 op,
}
else
_glamor_process_transformed_clipped_region
- (source_pixmap_priv, source_repeat_type,
+ (source_pixmap, source_pixmap_priv, source_repeat_type,
clipped_source_regions, &n_source_regions,
&need_clean_source_fbo);
}
@@ -1213,7 +1224,7 @@ glamor_composite_largepixmap_region(CARD8 op,
clipped_source_regions[j].block_idx);
if (mask_pixmap_priv &&
- mask_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) {
+ glamor_pixmap_priv_is_large(mask_pixmap_priv)) {
if (is_normal_mask_fbo && is_normal_source_fbo) {
/* both mask and source are normal fbo box without transform or repeatpad.
* The region is clipped against source and then we clip it against mask here.*/
@@ -1223,7 +1234,7 @@ glamor_composite_largepixmap_region(CARD8 op,
RegionTranslate(clipped_source_regions[j].region,
-x_source + x_mask, -y_source + y_mask);
clipped_mask_regions =
- glamor_compute_clipped_regions(mask_pixmap_priv,
+ glamor_compute_clipped_regions(mask_pixmap,
clipped_source_regions
[j].region,
&n_mask_regions,
@@ -1239,7 +1250,7 @@ glamor_composite_largepixmap_region(CARD8 op,
RegionTranslate(clipped_dest_regions[i].region,
-x_dest + x_mask, -y_dest + y_mask);
clipped_mask_regions =
- glamor_compute_clipped_regions(mask_pixmap_priv,
+ glamor_compute_clipped_regions(mask_pixmap,
clipped_dest_regions
[i].region,
&n_mask_regions,
@@ -1253,14 +1264,14 @@ glamor_composite_largepixmap_region(CARD8 op,
if (!is_normal_source_fbo)
clipped_mask_regions =
glamor_compute_transform_clipped_regions
- (mask_pixmap_priv, mask->transform,
+ (mask_pixmap, mask->transform,
clipped_dest_regions[i].region,
&n_mask_regions, x_mask - x_dest,
y_mask - y_dest, mask_repeat_type, 0, 0);
else
clipped_mask_regions =
glamor_compute_transform_clipped_regions
- (mask_pixmap_priv, mask->transform,
+ (mask_pixmap, mask->transform,
clipped_source_regions[j].region,
&n_mask_regions, x_mask - x_source,
y_mask - y_source, mask_repeat_type, 0, 0);
@@ -1272,7 +1283,7 @@ glamor_composite_largepixmap_region(CARD8 op,
}
else
_glamor_process_transformed_clipped_region
- (mask_pixmap_priv, mask_repeat_type,
+ (mask_pixmap, mask_pixmap_priv, mask_repeat_type,
clipped_mask_regions, &n_mask_regions,
&need_clean_mask_fbo);
}
@@ -1282,9 +1293,9 @@ glamor_composite_largepixmap_region(CARD8 op,
if (!glamor_composite_clipped_region(op, \
null_source ? NULL : source, \
null_mask ? NULL : mask, dest, \
- null_source ? NULL : source_pixmap_priv, \
- null_mask ? NULL : mask_pixmap_priv, \
- dest_pixmap_priv, region, \
+ null_source ? NULL : source_pixmap, \
+ null_mask ? NULL : mask_pixmap, \
+ dest_pixmap, region, \
x_source, y_source, x_mask, y_mask, \
x_dest, y_dest)) { \
assert(0); \
@@ -1335,8 +1346,8 @@ glamor_composite_largepixmap_region(CARD8 op,
null_mask = 0;
if (need_clean_mask_fbo) {
assert(is_normal_mask_fbo == 0);
- glamor_destroy_fbo(mask_pixmap_priv->base.fbo);
- mask_pixmap_priv->base.fbo = NULL;
+ glamor_destroy_fbo(glamor_priv, mask_pixmap_priv->fbo);
+ mask_pixmap_priv->fbo = NULL;
need_clean_mask_fbo = 0;
}
}
@@ -1364,19 +1375,19 @@ glamor_composite_largepixmap_region(CARD8 op,
null_source = 0;
if (need_clean_source_fbo) {
assert(is_normal_source_fbo == 0);
- glamor_destroy_fbo(source_pixmap_priv->base.fbo);
- source_pixmap_priv->base.fbo = NULL;
+ glamor_destroy_fbo(glamor_priv, source_pixmap_priv->fbo);
+ source_pixmap_priv->fbo = NULL;
need_clean_source_fbo = 0;
}
}
else {
if (mask_pixmap_priv &&
- mask_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) {
+ glamor_pixmap_priv_is_large(mask_pixmap_priv)) {
if (!mask->transform && mask_repeat_type != RepeatPad) {
RegionTranslate(clipped_dest_regions[i].region,
x_mask - x_dest, y_mask - y_dest);
clipped_mask_regions =
- glamor_compute_clipped_regions(mask_pixmap_priv,
+ glamor_compute_clipped_regions(mask_pixmap,
clipped_dest_regions[i].
region, &n_mask_regions,
mask_repeat_type, 0, 0);
@@ -1385,7 +1396,7 @@ glamor_composite_largepixmap_region(CARD8 op,
else {
clipped_mask_regions =
glamor_compute_transform_clipped_regions
- (mask_pixmap_priv, mask->transform,
+ (mask_pixmap, mask->transform,
clipped_dest_regions[i].region, &n_mask_regions,
x_mask - x_dest, y_mask - y_dest, mask_repeat_type, 0,
0);
@@ -1397,7 +1408,7 @@ glamor_composite_largepixmap_region(CARD8 op,
}
else
_glamor_process_transformed_clipped_region
- (mask_pixmap_priv, mask_repeat_type,
+ (mask_pixmap, mask_pixmap_priv, mask_repeat_type,
clipped_mask_regions, &n_mask_regions,
&need_clean_mask_fbo);
}
@@ -1426,8 +1437,8 @@ glamor_composite_largepixmap_region(CARD8 op,
if (null_mask)
null_mask = 0;
if (need_clean_mask_fbo) {
- glamor_destroy_fbo(mask_pixmap_priv->base.fbo);
- mask_pixmap_priv->base.fbo = NULL;
+ glamor_destroy_fbo(glamor_priv, mask_pixmap_priv->fbo);
+ mask_pixmap_priv->fbo = NULL;
need_clean_mask_fbo = 0;
}
}
diff --git a/xserver/glamor/glamor_lines.c b/xserver/glamor/glamor_lines.c
index e9a619505..a2c9b1fcc 100644
--- a/xserver/glamor/glamor_lines.c
+++ b/xserver/glamor/glamor_lines.c
@@ -44,7 +44,7 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc,
int off_x, off_y;
DDXPointPtr v;
char *vbo_offset;
- int box_x, box_y;
+ int box_index;
int add_last;
pixmap_priv = glamor_get_pixmap_private(pixmap);
@@ -65,7 +65,7 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc,
&glamor_facet_poly_lines);
if (!prog)
- goto bail_ctx;
+ goto bail;
/* Set up the vertex buffers for the points */
@@ -99,11 +99,11 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc,
glEnable(GL_SCISSOR_TEST);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+ glamor_pixmap_loop(pixmap_priv, box_index) {
int nbox = RegionNumRects(gc->pCompositeClip);
BoxPtr box = RegionRects(gc->pCompositeClip);
- glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, TRUE,
+ glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE,
prog->matrix_uniform, &off_x, &off_y);
while (nbox--) {
@@ -117,12 +117,9 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc,
}
glDisable(GL_SCISSOR_TEST);
- glDisable(GL_COLOR_LOGIC_OP);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
return TRUE;
-bail_ctx:
- glDisable(GL_COLOR_LOGIC_OP);
bail:
return FALSE;
}
@@ -167,21 +164,3 @@ glamor_poly_lines(DrawablePtr drawable, GCPtr gc,
return;
glamor_poly_lines_bail(drawable, gc, mode, n, points);
}
-
-Bool
-glamor_poly_lines_nf(DrawablePtr drawable, GCPtr gc,
- int mode, int n, DDXPointPtr points)
-{
- if (glamor_poly_lines_gl(drawable, gc, mode, n, points))
- return TRUE;
-
- if (glamor_ddx_fallback_check_pixmap(drawable) &&
- glamor_ddx_fallback_check_gc(gc))
- {
- return FALSE;
- }
-
- glamor_poly_lines_bail(drawable, gc, mode, n, points);
- return TRUE;
-}
-
diff --git a/xserver/glamor/glamor_picture.c b/xserver/glamor/glamor_picture.c
index bc658f801..b069ce56b 100644
--- a/xserver/glamor/glamor_picture.c
+++ b/xserver/glamor/glamor_picture.c
@@ -31,83 +31,904 @@
#include "glamor_priv.h"
#include "mipict.h"
-/* 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)
+/*
+ * 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.
+ *
+ * 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)
{
- PixmapPtr pixmap;
+ 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;
+ 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;
+ break;
+ case PICT_b8g8r8x8:
+ *no_alpha = 1;
+ case PICT_b8g8r8a8:
+ *tex_format = GL_BGRA;
+ *tex_type = GL_UNSIGNED_INT_8_8_8_8;
+ break;
- assert(picture->pDrawable);
- pixmap = glamor_get_drawable_pixmap(picture->pDrawable);
+ case PICT_x8r8g8b8:
+ *no_alpha = 1;
+ case PICT_a8r8g8b8:
+ *tex_format = GL_BGRA;
+ *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ break;
+ case PICT_x8b8g8r8:
+ *no_alpha = 1;
+ case PICT_a8b8g8r8:
+ *tex_format = GL_RGBA;
+ *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ break;
+ case PICT_x2r10g10b10:
+ *no_alpha = 1;
+ case PICT_a2r10g10b10:
+ *tex_format = GL_BGRA;
+ *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV;
+ break;
+ case PICT_x2b10g10r10:
+ *no_alpha = 1;
+ case PICT_a2b10g10r10:
+ *tex_format = GL_RGBA;
+ *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV;
+ break;
+
+ case PICT_r5g6b5:
+ *tex_format = GL_RGB;
+ *tex_type = GL_UNSIGNED_SHORT_5_6_5;
+ 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;
+ }
+ 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;
+ }
+ 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;
+ }
+ 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;
+ 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;
+ break;
+
+ default:
+ LogMessageVerb(X_INFO, 0,
+ "fail to get matched format for %x \n", format);
+ return -1;
+ }
- return glamor_upload_pixmap_to_texture(pixmap);
+ 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;
+}
+
+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)
+{
+ 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);
+ if (dst_image == NULL) {
+ return NULL;
+ }
+
+ src_image = pixman_image_create_bits(src_format,
+ w, h, src_bits, src_stride);
+
+ if (src_image == NULL) {
+ pixman_image_unref(dst_image);
+ return NULL;
+ }
+
+ pixman_image_composite(PictOpSrc, src_image, NULL, dst_image,
+ 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;
}
/*
- * We should already have drawable attached to it, if it has one.
- * Then set the attached pixmap to is_picture format, and set
- * the pict format.
- * */
-int
-glamor_create_picture(PicturePtr picture)
+ * 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)
{
- PixmapPtr pixmap;
+ 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;
+}
+
+/**
+ * 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)
+{
+ glamor_screen_private *glamor_priv =
+ glamor_get_screen_private(pixmap->drawable.pScreen);
+ int non_sub = 0;
+ unsigned int iformat = 0;
+
+ 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;
+ }
+ 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;
+ }
+
+ ready_to_upload:
+
+ /* 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;
+
+ 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);
+ 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);
+ }
+
+ 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 (!picture || !picture->pDrawable)
+ if (pixmap_priv->gl_fbo != GLAMOR_FBO_UNATTACHED)
return 0;
- pixmap = glamor_get_drawable_pixmap(picture->pDrawable);
- pixmap_priv = glamor_get_pixmap_private(pixmap);
- if (!pixmap_priv) {
- /* We must create a pixmap priv to track the picture format even
- * if the pixmap is a pure in memory pixmap. The reason is that
- * we may need to upload this pixmap to a texture on the fly. During
- * the uploading, we need to know the picture format. */
- glamor_set_pixmap_type(pixmap, GLAMOR_MEMORY);
- pixmap_priv = glamor_get_pixmap_private(pixmap);
+ 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);
}
- else {
- if (GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) {
- /* If the picture format is not compatible with glamor fbo format,
- * we have to mark this pixmap as a separated texture, and don't
- * fallback to DDX layer. */
- if (pixmap_priv->type == GLAMOR_TEXTURE_DRM
- && !glamor_pict_format_is_compatible(picture))
- glamor_set_pixmap_type(pixmap, GLAMOR_SEPARATE_TEXTURE);
- }
+
+ 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;
}
- pixmap_priv->base.is_picture = 1;
- pixmap_priv->base.picture = picture;
+ 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;
- return miCreatePicture(picture);
+ return 0;
}
-void
-glamor_destroy_picture(PicturePtr picture)
+/*
+ * 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)
{
- PixmapPtr pixmap;
+ int j;
+ int byte_per_pixel;
+
+ byte_per_pixel = bpp / 8;
+ src_bits += y * src_stride + (x * byte_per_pixel);
+
+ for (j = y; j < y + h; j++) {
+ memcpy(dst_bits, src_bits, w * byte_per_pixel);
+ src_bits += src_stride;
+ dst_bits += dst_stride;
+ }
+}
+
+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 (!picture || !picture->pDrawable)
- return;
+ 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;
+ }
+ if (glamor_pixmap_upload_prepare(pixmap, format, no_alpha, revert, swap_rb))
+ return FALSE;
- pixmap = glamor_get_drawable_pixmap(picture->pDrawable);
pixmap_priv = glamor_get_pixmap_private(pixmap);
+ force_clip = glamor_priv->gl_flavor != GLAMOR_GL_DESKTOP
+ && !glamor_check_fbo_size(glamor_priv, w, h);
+
+ 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(&region, &box, 1);
+ if (!force_clip)
+ clipped_regions =
+ glamor_compute_clipped_regions(pixmap, &region, &n_region,
+ 0, 0, 0);
+ else
+ clipped_regions =
+ glamor_compute_clipped_regions_ext(pixmap, &region,
+ &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 (pixmap_priv) {
- pixmap_priv->base.is_picture = 0;
- pixmap_priv->base.picture = NULL;
+ 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(&region);
+ free(sub_bits);
+ assert(0);
+ return FALSE;
+ }
+ }
+ RegionDestroy(clipped_regions[i].region);
+ }
+ free(sub_bits);
+ free(clipped_regions);
+ RegionUninit(&region);
+ return TRUE;
}
- miDestroyPicture(picture);
+ else
+ return _glamor_upload_bits_to_pixmap_texture(pixmap, format, type,
+ no_alpha, revert, swap_rb,
+ x, y, w, h, stride, bits,
+ pbo);
}
-void
-glamor_picture_format_fixup(PicturePtr picture,
- glamor_pixmap_private *pixmap_priv)
+/* 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)
{
- pixmap_priv->base.picture = 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;
}
diff --git a/xserver/glamor/glamor_pixmap.c b/xserver/glamor/glamor_pixmap.c
index 0d92710cf..166bde509 100644
--- a/xserver/glamor/glamor_pixmap.c
+++ b/xserver/glamor/glamor_pixmap.c
@@ -63,31 +63,36 @@ glamor_pixmap_fini(ScreenPtr screen)
}
void
-glamor_set_destination_pixmap_fbo(glamor_pixmap_fbo *fbo, int x0, int y0,
+glamor_set_destination_pixmap_fbo(glamor_screen_private *glamor_priv,
+ glamor_pixmap_fbo *fbo, int x0, int y0,
int width, int height)
{
- glamor_make_current(fbo->glamor_priv);
+ glamor_make_current(glamor_priv);
glBindFramebuffer(GL_FRAMEBUFFER, fbo->fb);
glViewport(x0, y0, width, height);
}
void
-glamor_set_destination_pixmap_priv_nc(glamor_pixmap_private *pixmap_priv)
+glamor_set_destination_pixmap_priv_nc(glamor_screen_private *glamor_priv,
+ PixmapPtr pixmap,
+ glamor_pixmap_private *pixmap_priv)
{
int w, h;
- PIXMAP_PRIV_GET_ACTUAL_SIZE(pixmap_priv, w, h);
- glamor_set_destination_pixmap_fbo(pixmap_priv->base.fbo, 0, 0, w, h);
+ PIXMAP_PRIV_GET_ACTUAL_SIZE(pixmap, pixmap_priv, w, h);
+ glamor_set_destination_pixmap_fbo(glamor_priv, pixmap_priv->fbo, 0, 0, w, h);
}
int
-glamor_set_destination_pixmap_priv(glamor_pixmap_private *pixmap_priv)
+glamor_set_destination_pixmap_priv(glamor_screen_private *glamor_priv,
+ PixmapPtr pixmap,
+ glamor_pixmap_private *pixmap_priv)
{
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
return -1;
- glamor_set_destination_pixmap_priv_nc(pixmap_priv);
+ glamor_set_destination_pixmap_priv_nc(glamor_priv, pixmap, pixmap_priv);
return 0;
}
@@ -96,15 +101,17 @@ glamor_set_destination_pixmap(PixmapPtr pixmap)
{
int err;
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
+ ScreenPtr screen = pixmap->drawable.pScreen;
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
- err = glamor_set_destination_pixmap_priv(pixmap_priv);
+ err = glamor_set_destination_pixmap_priv(glamor_priv, pixmap, pixmap_priv);
return err;
}
Bool
-glamor_set_planemask(PixmapPtr pixmap, unsigned long planemask)
+glamor_set_planemask(int depth, unsigned long planemask)
{
- if (glamor_pm_is_solid(&pixmap->drawable, planemask)) {
+ if (glamor_pm_is_solid(depth, planemask)) {
return GL_TRUE;
}
@@ -182,1012 +189,3 @@ glamor_set_alu(ScreenPtr screen, unsigned char alu)
return TRUE;
}
-
-/*
- * 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.
- *
- * 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(PictFormatShort format,
- GLenum *tex_format,
- GLenum *tex_type,
- int *no_alpha,
- int *revert,
- int *swap_rb, int is_upload)
-{
- *no_alpha = 0;
- *revert = REVERT_NONE;
- *swap_rb = is_upload ? SWAP_NONE_UPLOADING : SWAP_NONE_DOWNLOADING;
- switch (format) {
- case PICT_a1:
- *tex_format = GL_ALPHA;
- *tex_type = GL_UNSIGNED_BYTE;
- *revert = is_upload ? REVERT_UPLOADING_A1 : REVERT_DOWNLOADING_A1;
- break;
- case PICT_b8g8r8x8:
- *no_alpha = 1;
- case PICT_b8g8r8a8:
- *tex_format = GL_BGRA;
- *tex_type = GL_UNSIGNED_INT_8_8_8_8;
- break;
-
- case PICT_x8r8g8b8:
- *no_alpha = 1;
- case PICT_a8r8g8b8:
- *tex_format = GL_BGRA;
- *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- break;
- case PICT_x8b8g8r8:
- *no_alpha = 1;
- case PICT_a8b8g8r8:
- *tex_format = GL_RGBA;
- *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- break;
- case PICT_x2r10g10b10:
- *no_alpha = 1;
- case PICT_a2r10g10b10:
- *tex_format = GL_BGRA;
- *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV;
- break;
- case PICT_x2b10g10r10:
- *no_alpha = 1;
- case PICT_a2b10g10r10:
- *tex_format = GL_RGBA;
- *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV;
- break;
-
- case PICT_r5g6b5:
- *tex_format = GL_RGB;
- *tex_type = GL_UNSIGNED_SHORT_5_6_5;
- 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 = GL_ALPHA;
- *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(PictFormatShort format,
- GLenum *tex_format,
- GLenum *tex_type,
- int *no_alpha,
- int *revert,
- int *swap_rb, int is_upload)
-{
- 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;
- }
- 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;
- }
- 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;
- }
- else
- *revert = REVERT_NONE;
- need_swap_rb = 1;
- break;
-
- case PICT_a1:
- *tex_format = GL_ALPHA;
- *tex_type = GL_UNSIGNED_BYTE;
- *revert = is_upload ? REVERT_UPLOADING_A1 : REVERT_DOWNLOADING_A1;
- break;
-
- case PICT_a8:
- *tex_format = GL_ALPHA;
- *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;
- 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;
- break;
-
- default:
- LogMessageVerb(X_INFO, 0,
- "fail to get matched format for %x \n", format);
- return -1;
- }
-
- 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;
-}
-
-static int
-glamor_get_tex_format_type_from_pixmap(PixmapPtr pixmap,
- GLenum *format,
- GLenum *type,
- int *no_alpha,
- int *revert, int *swap_rb, int is_upload)
-{
- glamor_pixmap_private *pixmap_priv;
- PictFormatShort pict_format;
- glamor_screen_private *glamor_priv =
- glamor_get_screen_private(pixmap->drawable.pScreen);
-
- pixmap_priv = glamor_get_pixmap_private(pixmap);
- if (GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv))
- pict_format = pixmap_priv->base.picture->format;
- else
- pict_format = format_for_depth(pixmap->drawable.depth);
-
- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) {
- return glamor_get_tex_format_type_from_pictformat_gl(pict_format,
- format, type,
- no_alpha,
- revert,
- swap_rb,
- is_upload);
- } else {
- return glamor_get_tex_format_type_from_pictformat_gles2(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);
- if (dst_image == NULL) {
- return NULL;
- }
-
- src_image = pixman_image_create_bits(src_format,
- w, h, src_bits, src_stride);
-
- if (src_image == NULL) {
- pixman_image_unref(dst_image);
- return NULL;
- }
-
- pixman_image_composite(PictOpSrc, src_image, NULL, dst_image,
- 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;
-}
-
-/**
- * Upload pixmap to a specified texture.
- * This texture may not be the one attached to it.
- **/
-static void
-__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)
-{
- glamor_screen_private *glamor_priv =
- glamor_get_screen_private(pixmap->drawable.pScreen);
- int non_sub = 0;
- unsigned int iformat = 0;
-
- 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);
- }
- 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);
-
- if (bits == NULL)
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
-}
-
-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)
-{
- glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
- glamor_screen_private *glamor_priv =
- glamor_get_screen_private(pixmap->drawable.pScreen);
- static float vertices[8];
-
- static float texcoords_inv[8] = { 0, 0,
- 1, 0,
- 1, 1,
- 0, 1
- };
- float *ptexcoords;
- 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 = malloc(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;
- }
-
- ready_to_upload:
-
- /* 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
- && pixmap_priv->type != GLAMOR_TEXTURE_LARGE
-#endif
- ) {
- int fbo_x_off, fbo_y_off;
-
- assert(pixmap_priv->base.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->base.fbo->width);
- assert(y + fbo_y_off + h <= pixmap_priv->base.fbo->height);
- __glamor_upload_pixmap_to_texture(pixmap, &pixmap_priv->base.fbo->tex,
- format, type,
- x + fbo_x_off, y + fbo_y_off, w, h,
- bits, pbo);
- } else {
- ptexcoords = texcoords_inv;
-
- pixmap_priv_get_dest_scale(pixmap_priv, &dst_xscale, &dst_yscale);
- glamor_set_normalize_vcoords(pixmap_priv, dst_xscale,
- dst_yscale,
- x, y,
- x + w, y + h,
- vertices);
- /* Slow path, we need to flip y or wire alpha to 1. */
- glamor_make_current(glamor_priv);
- glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT,
- GL_FALSE, 2 * sizeof(float), vertices);
- glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
- glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT,
- GL_FALSE, 2 * sizeof(float), ptexcoords);
- glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
-
- glamor_set_destination_pixmap_priv_nc(pixmap_priv);
- __glamor_upload_pixmap_to_texture(pixmap, &tex,
- format, type, 0, 0, w, h, bits, pbo);
- 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);
- }
-
- 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->base.gl_fbo != GLAMOR_FBO_UNATTACHED)
- return 0;
-
- if (pixmap_priv->base.fbo
- && (pixmap_priv->base.fbo->width < pixmap->drawable.width
- || pixmap_priv->base.fbo->height < pixmap->drawable.height)) {
- fbo = glamor_pixmap_detach_fbo(pixmap_priv);
- glamor_destroy_fbo(fbo);
- }
-
- if (pixmap_priv->base.fbo && pixmap_priv->base.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->base.fbo && pixmap_priv->base.fbo->tex)
- || (flag == 0 && pixmap_priv->base.fbo && pixmap_priv->base.fbo->fb))
- 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;
-
- return 0;
-}
-
-/*
- * 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;
-
- byte_per_pixel = bpp / 8;
- src_bits += y * src_stride + (x * byte_per_pixel);
-
- for (j = y; j < y + h; j++) {
- memcpy(dst_bits, src_bits, w * byte_per_pixel);
- src_bits += src_stride;
- dst_bits += dst_stride;
- }
-}
-
-Bool
-glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w,
- int h, int stride, void *bits, int pbo)
-{
- 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,
- &format,
- &type,
- &no_alpha,
- &revert, &swap_rb, 1)) {
- glamor_fallback("Unknown pixmap depth %d.\n", pixmap->drawable.depth);
- return FALSE;
- }
- if (glamor_pixmap_upload_prepare(pixmap, format, no_alpha, revert, swap_rb))
- return FALSE;
-
- pixmap_priv = glamor_get_pixmap_private(pixmap);
- force_clip = pixmap_priv->base.glamor_priv->gl_flavor != GLAMOR_GL_DESKTOP
- && !glamor_check_fbo_size(pixmap_priv->base.glamor_priv, w, h);
-
- if (pixmap_priv->type == GLAMOR_TEXTURE_LARGE || force_clip) {
- RegionRec region;
- BoxRec box;
- int n_region;
- glamor_pixmap_clipped_regions *clipped_regions;
- void *sub_bits;
- int i, j;
-
- sub_bits = malloc(h * stride);
- if (sub_bits == NULL)
- return FALSE;
- box.x1 = x;
- box.y1 = y;
- box.x2 = x + w;
- box.y2 = y + h;
- RegionInitBoxes(&region, &box, 1);
- if (!force_clip)
- clipped_regions =
- glamor_compute_clipped_regions(pixmap_priv, &region, &n_region,
- 0, 0, 0);
- else
- clipped_regions =
- glamor_compute_clipped_regions_ext(pixmap_priv, &region,
- &n_region,
- pixmap_priv->large.block_w,
- pixmap_priv->large.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(&region);
- free(sub_bits);
- assert(0);
- return FALSE;
- }
- }
- RegionDestroy(clipped_regions[i].region);
- }
- free(sub_bits);
- free(clipped_regions);
- RegionUninit(&region);
- 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);
-}
-
-enum glamor_pixmap_status
-glamor_upload_pixmap_to_texture(PixmapPtr pixmap)
-{
- glamor_pixmap_private *pixmap_priv;
- void *data;
- int pbo;
- int ret;
-
- pixmap_priv = glamor_get_pixmap_private(pixmap);
-
- if ((pixmap_priv->base.fbo)
- && (pixmap_priv->base.fbo->pbo_valid)) {
- data = NULL;
- pbo = pixmap_priv->base.fbo->pbo;
- }
- else {
- data = pixmap->devPrivate.ptr;
- pbo = 0;
- }
-
- if (glamor_upload_sub_pixmap_to_texture(pixmap, 0, 0,
- pixmap->drawable.width,
- pixmap->drawable.height,
- pixmap->devKind, data, pbo))
- ret = GLAMOR_UPLOAD_DONE;
- else
- ret = GLAMOR_UPLOAD_FAILED;
-
- return ret;
-}
-
-/*
- * as gles2 only support a very small set of color format and
- * type when do glReadPixel,
- * Before we use glReadPixels to get back a textured pixmap,
- * Use shader to convert it to a supported format and thus
- * get a new temporary pixmap returned.
- * */
-
-glamor_pixmap_fbo *
-glamor_es2_pixmap_read_prepare(PixmapPtr source, int x, int y, int w, int h,
- GLenum format, GLenum type, int no_alpha,
- int revert, int swap_rb)
-{
- glamor_pixmap_private *source_priv;
- glamor_screen_private *glamor_priv;
- ScreenPtr screen;
- glamor_pixmap_fbo *temp_fbo;
- float temp_xscale, temp_yscale, source_xscale, source_yscale;
- static float vertices[8];
- static float texcoords[8];
-
- screen = source->drawable.pScreen;
-
- glamor_priv = glamor_get_screen_private(screen);
- source_priv = glamor_get_pixmap_private(source);
- temp_fbo = glamor_create_fbo(glamor_priv, w, h, format, 0);
- if (temp_fbo == NULL)
- return NULL;
-
- glamor_make_current(glamor_priv);
- temp_xscale = 1.0 / w;
- temp_yscale = 1.0 / h;
-
- glamor_set_normalize_vcoords((struct glamor_pixmap_private *) NULL,
- temp_xscale, temp_yscale, 0, 0, w, h,
- vertices);
-
- glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE,
- 2 * sizeof(float), vertices);
- glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
-
- pixmap_priv_get_scale(source_priv, &source_xscale, &source_yscale);
- glamor_set_normalize_tcoords(source_priv, source_xscale,
- source_yscale,
- x, y,
- x + w, y + h,
- texcoords);
-
- glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, GL_FALSE,
- 2 * sizeof(float), texcoords);
- glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
-
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, source_priv->base.fbo->tex);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-
- glamor_set_destination_pixmap_fbo(temp_fbo, 0, 0, w, h);
- 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);
- return temp_fbo;
-}
-
-/* fixup a fbo to the exact size as the pixmap. */
-/* XXX LARGE pixmap? */
-Bool
-glamor_fixup_pixmap_priv(ScreenPtr screen, glamor_pixmap_private *pixmap_priv)
-{
- glamor_pixmap_fbo *old_fbo;
- glamor_pixmap_fbo *new_fbo = NULL;
- PixmapPtr scratch = NULL;
- glamor_pixmap_private *scratch_priv;
- DrawablePtr drawable;
- GCPtr gc = NULL;
- int ret = FALSE;
-
- drawable = &pixmap_priv->base.pixmap->drawable;
-
- if (!GLAMOR_PIXMAP_FBO_NOT_EXACT_SIZE(pixmap_priv))
- return TRUE;
-
- old_fbo = pixmap_priv->base.fbo;
-
- if (!old_fbo)
- return FALSE;
-
- gc = GetScratchGC(drawable->depth, screen);
- if (!gc)
- goto fail;
-
- scratch = glamor_create_pixmap(screen, drawable->width, drawable->height,
- drawable->depth, GLAMOR_CREATE_PIXMAP_FIXUP);
-
- scratch_priv = glamor_get_pixmap_private(scratch);
-
- if (!scratch_priv->base.fbo)
- goto fail;
-
- ValidateGC(&scratch->drawable, gc);
- glamor_copy_area(drawable,
- &scratch->drawable,
- gc, 0, 0, drawable->width, drawable->height, 0, 0);
- old_fbo = glamor_pixmap_detach_fbo(pixmap_priv);
- new_fbo = glamor_pixmap_detach_fbo(scratch_priv);
- glamor_pixmap_attach_fbo(pixmap_priv->base.pixmap, new_fbo);
- glamor_pixmap_attach_fbo(scratch, old_fbo);
-
- DEBUGF("old %dx%d type %d\n",
- drawable->width, drawable->height, pixmap_priv->type);
- DEBUGF("copy tex %d %dx%d to tex %d %dx%d \n",
- old_fbo->tex, old_fbo->width, old_fbo->height, new_fbo->tex,
- new_fbo->width, new_fbo->height);
- ret = TRUE;
- fail:
- if (gc)
- FreeScratchGC(gc);
- if (scratch)
- glamor_destroy_pixmap(scratch);
-
- return ret;
-}
diff --git a/xserver/glamor/glamor_points.c b/xserver/glamor/glamor_points.c
index 84383d254..facfe8240 100644
--- a/xserver/glamor/glamor_points.c
+++ b/xserver/glamor/glamor_points.c
@@ -46,7 +46,7 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint
int off_x, off_y;
GLshort *vbo_ppt;
char *vbo_offset;
- int box_x, box_y;
+ int box_index;
pixmap_priv = glamor_get_pixmap_private(pixmap);
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
@@ -55,17 +55,18 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint
glamor_make_current(glamor_priv);
if (prog->failed)
- goto bail_ctx;
+ goto bail;
if (!prog->prog) {
if (!glamor_build_program(screen, prog,
&glamor_facet_point,
- &glamor_fill_solid))
- goto bail_ctx;
+ &glamor_fill_solid,
+ NULL, NULL))
+ goto bail;
}
if (!glamor_use_program(pixmap, gc, prog, NULL))
- goto bail_ctx;
+ goto bail;
vbo_ppt = glamor_get_vbo_space(screen, npt * (2 * sizeof (INT16)), &vbo_offset);
glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
@@ -85,11 +86,12 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint
glEnable(GL_SCISSOR_TEST);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+ glamor_pixmap_loop(pixmap_priv, box_index) {
int nbox = RegionNumRects(gc->pCompositeClip);
BoxPtr box = RegionRects(gc->pCompositeClip);
- glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, TRUE, prog->matrix_uniform, &off_x, &off_y);
+ glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE,
+ prog->matrix_uniform, &off_x, &off_y);
while (nbox--) {
glScissor(box->x1 + off_x,
@@ -102,13 +104,10 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint
}
glDisable(GL_SCISSOR_TEST);
- glDisable(GL_COLOR_LOGIC_OP);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
return TRUE;
-bail_ctx:
- glDisable(GL_COLOR_LOGIC_OP);
bail:
return FALSE;
}
@@ -121,18 +120,3 @@ glamor_poly_point(DrawablePtr drawable, GCPtr gc, int mode, int npt,
return;
miPolyPoint(drawable, gc, mode, npt, ppt);
}
-
-Bool
-glamor_poly_point_nf(DrawablePtr drawable, GCPtr gc, int mode, int npt,
- DDXPointPtr ppt)
-{
- if (glamor_poly_point_gl(drawable, gc, mode, npt, ppt))
- return TRUE;
-
- if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc))
- return FALSE;
-
- miPolyPoint(drawable, gc, mode, npt, ppt);
- return TRUE;
-}
-
diff --git a/xserver/glamor/glamor_prepare.c b/xserver/glamor/glamor_prepare.c
index 40b7b4feb..5a73e6c7d 100644
--- a/xserver/glamor/glamor_prepare.c
+++ b/xserver/glamor/glamor_prepare.c
@@ -56,7 +56,7 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
* we'll assume that it's directly mapped
* by a lower level driver
*/
- if (!priv->base.prepared)
+ if (!priv->prepared)
return TRUE;
/* In X, multiple Drawables can be stored in the same Pixmap (such as
@@ -67,38 +67,38 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
* As a result, when doing a series of mappings for a fallback, we may
* need to add more boxes to the set of data we've downloaded, as we go.
*/
- RegionSubtract(&region, &region, &priv->base.prepare_region);
+ RegionSubtract(&region, &region, &priv->prepare_region);
if (!RegionNotEmpty(&region))
return TRUE;
if (access == GLAMOR_ACCESS_RW)
FatalError("attempt to remap buffer as writable");
- if (priv->base.pbo) {
- glBindBuffer(GL_PIXEL_PACK_BUFFER, priv->base.pbo);
+ if (priv->pbo) {
+ glBindBuffer(GL_PIXEL_PACK_BUFFER, priv->pbo);
glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
pixmap->devPrivate.ptr = NULL;
}
} else {
- RegionInit(&priv->base.prepare_region, box, 1);
+ RegionInit(&priv->prepare_region, box, 1);
if (glamor_priv->has_rw_pbo) {
- if (priv->base.pbo == 0)
- glGenBuffers(1, &priv->base.pbo);
+ if (priv->pbo == 0)
+ glGenBuffers(1, &priv->pbo);
gl_usage = GL_STREAM_READ;
- glBindBuffer(GL_PIXEL_PACK_BUFFER, priv->base.pbo);
+ glBindBuffer(GL_PIXEL_PACK_BUFFER, priv->pbo);
glBufferData(GL_PIXEL_PACK_BUFFER,
pixmap->devKind * pixmap->drawable.height, NULL,
gl_usage);
} else {
- pixmap->devPrivate.ptr = malloc(pixmap->devKind *
- pixmap->drawable.height);
+ pixmap->devPrivate.ptr = xallocarray(pixmap->devKind,
+ pixmap->drawable.height);
if (!pixmap->devPrivate.ptr)
return FALSE;
}
- priv->base.map_access = access;
+ priv->map_access = access;
}
glamor_download_boxes(pixmap, RegionRects(&region), RegionNumRects(&region),
@@ -107,7 +107,7 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
RegionUninit(&region);
if (glamor_priv->has_rw_pbo) {
- if (priv->base.map_access == GLAMOR_ACCESS_RW)
+ if (priv->map_access == GLAMOR_ACCESS_RW)
gl_access = GL_READ_WRITE;
else
gl_access = GL_READ_ONLY;
@@ -116,7 +116,7 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
}
- priv->base.prepared = TRUE;
+ priv->prepared = TRUE;
return TRUE;
}
@@ -135,34 +135,34 @@ glamor_fini_pixmap(PixmapPtr pixmap)
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv))
return;
- if (!priv->base.prepared)
+ if (!priv->prepared)
return;
if (glamor_priv->has_rw_pbo) {
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER, priv->base.pbo);
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER, priv->pbo);
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
pixmap->devPrivate.ptr = NULL;
}
- if (priv->base.map_access == GLAMOR_ACCESS_RW) {
+ if (priv->map_access == GLAMOR_ACCESS_RW) {
glamor_upload_boxes(pixmap,
- RegionRects(&priv->base.prepare_region),
- RegionNumRects(&priv->base.prepare_region),
+ RegionRects(&priv->prepare_region),
+ RegionNumRects(&priv->prepare_region),
0, 0, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind);
}
- RegionUninit(&priv->base.prepare_region);
+ RegionUninit(&priv->prepare_region);
if (glamor_priv->has_rw_pbo) {
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
- glDeleteBuffers(1, &priv->base.pbo);
- priv->base.pbo = 0;
+ glDeleteBuffers(1, &priv->pbo);
+ priv->pbo = 0;
} else {
free(pixmap->devPrivate.ptr);
pixmap->devPrivate.ptr = NULL;
}
- priv->base.prepared = FALSE;
+ priv->prepared = FALSE;
}
Bool
@@ -222,8 +222,22 @@ glamor_prepare_access_picture_box(PicturePtr picture, glamor_access_t access,
{
if (!picture || !picture->pDrawable)
return TRUE;
- return glamor_prepare_access_box(picture->pDrawable, access,
- x, y, w, h);
+
+ /* If a transform is set, we don't know what the bounds is on the
+ * source, so just prepare the whole pixmap. XXX: We could
+ * potentially work out where in the source would be sampled based
+ * on the transform, and we don't need do do this for destination
+ * pixmaps at all.
+ */
+ if (picture->transform) {
+ return glamor_prepare_access_box(picture->pDrawable, access,
+ 0, 0,
+ picture->pDrawable->width,
+ picture->pDrawable->height);
+ } else {
+ return glamor_prepare_access_box(picture->pDrawable, access,
+ x, y, w, h);
+ }
}
void
diff --git a/xserver/glamor/glamor_priv.h b/xserver/glamor/glamor_priv.h
index 612701a19..a70f10eb4 100644
--- a/xserver/glamor/glamor_priv.h
+++ b/xserver/glamor/glamor_priv.h
@@ -48,9 +48,7 @@
"precision mediump float;\n" \
"#endif\n"
-#ifdef RENDER
#include "glyphstr.h"
-#endif
#include "glamor_debug.h"
#include "glamor_context.h"
@@ -74,7 +72,7 @@ typedef struct glamor_composite_shader {
union {
float source_solid_color[4];
struct {
- struct glamor_pixmap_private *source_priv;
+ PixmapPtr source_pixmap;
PicturePtr source;
};
};
@@ -82,12 +80,18 @@ typedef struct glamor_composite_shader {
union {
float mask_solid_color[4];
struct {
- struct glamor_pixmap_private *mask_priv;
+ PixmapPtr mask_pixmap;
PicturePtr mask;
};
};
} glamor_composite_shader;
+enum ca_state {
+ CA_NONE,
+ CA_TWO_PASS,
+ CA_DUAL_BLEND,
+};
+
enum shader_source {
SHADER_SOURCE_SOLID,
SHADER_SOURCE_TEXTURE,
@@ -103,18 +107,17 @@ enum shader_mask {
SHADER_MASK_COUNT,
};
-enum shader_in {
- SHADER_IN_SOURCE_ONLY,
- SHADER_IN_NORMAL,
- SHADER_IN_CA_SOURCE,
- SHADER_IN_CA_ALPHA,
- SHADER_IN_COUNT,
+enum shader_dest_swizzle {
+ SHADER_DEST_SWIZZLE_DEFAULT,
+ SHADER_DEST_SWIZZLE_ALPHA_TO_RED,
+ SHADER_DEST_SWIZZLE_COUNT,
};
struct shader_key {
enum shader_source source;
enum shader_mask mask;
- enum shader_in in;
+ glamor_program_alpha in;
+ enum shader_dest_swizzle dest_swizzle;
};
struct blendinfo {
@@ -156,41 +159,8 @@ enum glamor_gl_flavor {
GLAMOR_GL_ES2 // OPENGL ES2.0 API
};
-#define GLAMOR_NUM_GLYPH_CACHE_FORMATS 2
-
#define GLAMOR_COMPOSITE_VBO_VERT_CNT (64*1024)
-typedef struct {
- PicturePtr picture; /* Where the glyphs of the cache are stored */
- GlyphPtr *glyphs;
- uint16_t count;
- uint16_t evict;
-} glamor_glyph_cache_t;
-
-#define CACHE_PICTURE_SIZE 1024
-#define GLYPH_MIN_SIZE 8
-#define GLYPH_MAX_SIZE 64
-#define GLYPH_CACHE_SIZE ((CACHE_PICTURE_SIZE) * CACHE_PICTURE_SIZE / (GLYPH_MIN_SIZE * GLYPH_MIN_SIZE))
-
-#define MASK_CACHE_MAX_SIZE 32
-#define MASK_CACHE_WIDTH (CACHE_PICTURE_SIZE / MASK_CACHE_MAX_SIZE)
-#define MASK_CACHE_MASK ((1LL << (MASK_CACHE_WIDTH)) - 1)
-
-struct glamor_glyph_mask_cache_entry {
- int idx;
- int width;
- int height;
- int x;
- int y;
-};
-
-typedef struct {
- PixmapPtr pixmap;
- struct glamor_glyph_mask_cache_entry mcache[MASK_CACHE_WIDTH];
- unsigned int free_bitmap;
- unsigned int cleared_bitmap;
-} glamor_glyph_mask_cache_t;
-
struct glamor_saved_procs {
CloseScreenProcPtr close_screen;
CreateScreenResourcesProcPtr create_screen_resources;
@@ -208,10 +178,6 @@ struct glamor_saved_procs {
BitmapToRegionProcPtr bitmap_to_region;
TrianglesProcPtr triangles;
AddTrapsProcPtr addtraps;
- CreatePictureProcPtr create_picture;
- DestroyPictureProcPtr destroy_picture;
- UnrealizeGlyphProcPtr unrealize_glyph;
- SetWindowPixmapProcPtr set_window_pixmap;
#if XSYNC
SyncScreenFuncsRec sync_screen_funcs;
#endif
@@ -230,16 +196,22 @@ typedef struct glamor_screen_private {
unsigned int tick;
enum glamor_gl_flavor gl_flavor;
int glsl_version;
- int has_pack_invert;
- int has_fbo_blit;
- int has_map_buffer_range;
- int has_buffer_storage;
- int has_khr_debug;
- int has_nv_texture_barrier;
- int has_pack_subimage;
- int has_unpack_subimage;
+ Bool has_pack_invert;
+ Bool has_fbo_blit;
+ Bool has_map_buffer_range;
+ Bool has_buffer_storage;
+ Bool has_khr_debug;
+ Bool has_nv_texture_barrier;
+ Bool has_pack_subimage;
+ Bool has_unpack_subimage;
+ Bool has_rw_pbo;
+ Bool use_quads;
+ Bool has_vertex_array_object;
+ Bool has_dual_blend;
+ Bool is_core_profile;
int max_fbo_size;
- int has_rw_pbo;
+
+ GLuint one_channel_format;
struct xorg_list
fbo_cache[CACHE_FORMAT_COUNT][CACHE_BUCKET_WCOUNT][CACHE_BUCKET_HCOUNT];
@@ -276,11 +248,21 @@ typedef struct glamor_screen_private {
glamor_program_fill on_off_dash_line_progs;
glamor_program double_dash_line_prog;
- /* vertext/elment_index buffer object for render */
- GLuint vbo, ebo;
+ /* glamor composite_glyphs shaders */
+ glamor_program_render glyphs_program;
+ struct glamor_glyph_atlas *glyph_atlas_a;
+ struct glamor_glyph_atlas *glyph_atlas_argb;
+ int glyph_atlas_dim;
+ int glyph_max_dim;
+ char *glyph_defines;
+
+ /** Vertex buffer for all GPU rendering. */
+ GLuint vao;
+ GLuint vbo;
/** Next offset within the VBO that glamor_get_vbo_space() will use. */
int vbo_offset;
int vbo_size;
+ Bool vbo_mapped;
/**
* Pointer to glamor_get_vbo_space()'s current VBO mapping.
*
@@ -289,14 +271,20 @@ typedef struct glamor_screen_private {
*/
char *vb;
int vb_stride;
+
+ /** Cached index buffer for translating GL_QUADS to triangles. */
+ GLuint ib;
+ /** Index buffer type: GL_UNSIGNED_SHORT or GL_UNSIGNED_INT */
+ GLenum ib_type;
+ /** Number of quads the index buffer has indices for. */
+ unsigned ib_size;
+
Bool has_source_coords, has_mask_coords;
- int render_nr_verts;
+ int render_nr_quads;
glamor_composite_shader composite_shader[SHADER_SOURCE_COUNT]
[SHADER_MASK_COUNT]
- [SHADER_IN_COUNT];
- glamor_glyph_cache_t glyphCaches[GLAMOR_NUM_GLYPH_CACHE_FORMATS];
- glamor_glyph_mask_cache_t *mask_cache[GLAMOR_NUM_GLYPH_CACHE_FORMATS];
- Bool glyph_caches_realized;
+ [glamor_program_alpha_count]
+ [SHADER_DEST_SWIZZLE_COUNT];
/* shaders to restore a texture to another texture. */
GLint finish_access_prog[2];
@@ -317,8 +305,11 @@ typedef struct glamor_screen_private {
ScreenPtr screen;
int dri3_enabled;
+ Bool suppress_gl_out_of_memory_logging;
+ Bool logged_any_fbo_allocation_failure;
+
/* xv */
- GLint xv_prog;
+ glamor_program xv_prog;
struct glamor_context ctx;
} glamor_screen_private;
@@ -336,110 +327,34 @@ enum glamor_fbo_state {
* point at anything.
*/
GLAMOR_FBO_NORMAL,
- /**
- * The FBO is present and can be accessed as a linear memory
- * mapping through devPrivate.ptr.
- */
- GLAMOR_FBO_DOWNLOADED,
};
-/* glamor_pixmap_fbo:
- * @list: to be used to link to the cache pool list.
- * @expire: when push to cache pool list, set a expire count.
- * will be freed when glamor_priv->tick is equal or
- * larger than this expire count in block handler.
- * @pbo_valid: The pbo has a valid copy of the pixmap's data.
- * @tex: attached texture.
- * @fb: attached fbo.
- * @pbo: attached pbo.
- * @width: width of this fbo.
- * @height: height of this fbo.
- * @external set when the texture was not created by glamor
- * @format: internal format of this fbo's texture.
- * @type: internal type of this fbo's texture.
- * @glamor_priv: point to glamor private data.
- */
typedef struct glamor_pixmap_fbo {
- struct xorg_list list;
+ 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;
- unsigned char pbo_valid;
- GLuint tex;
- GLuint fb;
- GLuint pbo;
- int width;
- int height;
+ 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;
- GLenum type;
- glamor_screen_private *glamor_priv;
+ GLenum format; /**< GL format used to create the texture. */
+ GLenum type; /**< GL type used to create the texture. */
} glamor_pixmap_fbo;
-/*
- * glamor_pixmap_private - glamor pixmap's private structure.
- * @gl_tex: The pixmap is in a gl texture originally.
- * @is_picture: The drawable is attached to a picture.
- * @pict_format: the corresponding picture's format.
- * @pixmap: The corresponding pixmap's pointer.
- *
- * For GLAMOR_TEXTURE_LARGE, nbox should larger than 1.
- * And the box and fbo will both have nbox elements.
- * and box[i] store the relatively coords in this pixmap
- * of the fbo[i]. The reason why use boxes not region to
- * represent this structure is we may need to use overlapped
- * boxes for one pixmap for some special reason.
- *
- * pixmap
- * ******************
- * * fbo0 * fbo1 *
- * * * *
- * ******************
- * * fbo2 * fbo3 *
- * * * *
- * ******************
- *
- * Let's assume the texture has size of 1024x1024
- * box[0] = {0,0,1024,1024}
- * box[1] = {1024,0,2048,2048}
- * ...
- *
- * For GLAMOR_TEXTURE_ATLAS nbox should be 1. And box
- * and fbo both has one elements, and the box store
- * the relatively coords in the fbo of this pixmap:
- *
- * fbo
- * ******************
- * * pixmap *
- * * ********* *
- * * * * *
- * * ********* *
- * * *
- * ******************
- *
- * Assume the pixmap is at the (100,100) relatively to
- * the fbo's origin.
- * box[0]={100, 100, 1124, 1124};
- *
- * Considering large pixmap is not a normal case, to keep
- * it simple, I designe it as the following way.
- * When deal with a large pixmap, it split the working
- * rectangle into serval boxes, and each box fit into a
- * corresponding fbo. And then the rendering function will
- * loop from the left-top box to the right-bottom box,
- * each time, we will set current box and current fbo
- * to the box and fbo elements. Thus the inner routines
- * can handle it as normal, only the coords calculation need
- * to aware of it's large pixmap.
- *
- * Currently, we haven't implemented the atlas pixmap.
- *
- **/
-
typedef struct glamor_pixmap_clipped_regions {
int block_idx;
RegionPtr region;
} glamor_pixmap_clipped_regions;
-typedef struct glamor_pixmap_private_base {
+typedef struct glamor_pixmap_private {
glamor_pixmap_type_t type;
enum glamor_fbo_state gl_fbo;
/**
@@ -448,137 +363,170 @@ typedef struct glamor_pixmap_private_base {
* that data on glamor_finish_access().
*/
glamor_access_t map_access;
- unsigned char is_picture:1;
- unsigned char gl_tex:1;
glamor_pixmap_fbo *fbo;
- PixmapPtr pixmap;
+ /** current fbo's coords in the whole pixmap. */
BoxRec box;
- int drm_stride;
- glamor_screen_private *glamor_priv;
- PicturePtr picture;
GLuint pbo;
RegionRec prepare_region;
Bool prepared;
#if GLAMOR_HAS_GBM
EGLImageKHR image;
#endif
-} glamor_pixmap_private_base_t;
-
-/*
- * @base.fbo: current fbo.
- * @box: current fbo's coords in the whole pixmap.
- * @block_w: block width of this large pixmap.
- * @block_h: block height of this large pixmap.
- * @block_wcnt: block count in one block row.
- * @block_hcnt: block count in one block column.
- * @nbox: total block count.
- * @box_array: contains each block's corresponding box.
- * @fbo_array: contains each block's fbo pointer.
- *
- **/
-typedef struct glamor_pixmap_private_large {
- union {
- glamor_pixmap_type_t type;
- glamor_pixmap_private_base_t base;
- };
- BoxRec box;
+ /** block width of this large pixmap. */
int block_w;
+ /** block height of this large pixmap. */
int block_h;
+
+ /** block_wcnt: block count in one block row. */
int block_wcnt;
+ /** block_hcnt: block count in one block column. */
int block_hcnt;
- int nbox;
+
+ /**
+ * The list of boxes for the bounds of the FBOs making up the
+ * pixmap.
+ *
+ * For a 2048x2048 pixmap with GL FBO size limits of 1024x1024:
+ *
+ * ******************
+ * * fbo0 * fbo1 *
+ * * * *
+ * ******************
+ * * fbo2 * fbo3 *
+ * * * *
+ * ******************
+ *
+ * box[0] = {0,0,1024,1024}
+ * box[1] = {1024,0,2048,2048}
+ * ...
+ */
BoxPtr box_array;
+
+ /**
+ * Array of fbo structs containing the actual GL texture/fbo
+ * names.
+ */
glamor_pixmap_fbo **fbo_array;
-} glamor_pixmap_private_large_t;
+} glamor_pixmap_private;
+
+extern DevPrivateKeyRec glamor_pixmap_private_key;
+
+static inline glamor_pixmap_private *
+glamor_get_pixmap_private(PixmapPtr pixmap)
+{
+ if (pixmap == NULL)
+ return NULL;
+
+ return dixLookupPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key);
+}
/*
- * @box: the relative coords in the corresponding fbo.
+ * Returns TRUE if pixmap has no image object
*/
-typedef struct glamor_pixmap_private_atlas {
- union {
- glamor_pixmap_type_t type;
- glamor_pixmap_private_base_t base;
- };
- BoxRec box;
-} glamor_pixmap_private_atlas_t;
+static inline Bool
+glamor_pixmap_drm_only(PixmapPtr pixmap)
+{
+ glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
-typedef struct glamor_pixmap_private {
- union {
- glamor_pixmap_type_t type;
- glamor_pixmap_private_base_t base;
- glamor_pixmap_private_large_t large;
- glamor_pixmap_private_atlas_t atlas;
- };
-} glamor_pixmap_private;
+ return priv->type == GLAMOR_DRM_ONLY;
+}
+
+/*
+ * Returns TRUE if pixmap is plain memory (not a GL object at all)
+ */
+static inline Bool
+glamor_pixmap_is_memory(PixmapPtr pixmap)
+{
+ glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
+
+ return priv->type == GLAMOR_MEMORY;
+}
+
+/*
+ * Returns TRUE if pixmap requires multiple textures to hold it
+ */
+static inline Bool
+glamor_pixmap_priv_is_large(glamor_pixmap_private *priv)
+{
+ return priv->block_wcnt > 1 || priv->block_hcnt > 1;
+}
+
+static inline Bool
+glamor_pixmap_priv_is_small(glamor_pixmap_private *priv)
+{
+ return priv->block_wcnt <= 1 && priv->block_hcnt <= 1;
+}
+
+static inline Bool
+glamor_pixmap_is_large(PixmapPtr pixmap)
+{
+ glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
+
+ return glamor_pixmap_priv_is_large(priv);
+}
+/*
+ * Returns TRUE if pixmap has an FBO
+ */
+static inline Bool
+glamor_pixmap_has_fbo(PixmapPtr pixmap)
+{
+ glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
+
+ return priv->gl_fbo == GLAMOR_FBO_NORMAL;
+}
static inline void
glamor_set_pixmap_fbo_current(glamor_pixmap_private *priv, int idx)
{
- if (priv->type == GLAMOR_TEXTURE_LARGE) {
- priv->large.base.fbo = priv->large.fbo_array[idx];
- priv->large.box = priv->large.box_array[idx];
+ if (glamor_pixmap_priv_is_large(priv)) {
+ priv->fbo = priv->fbo_array[idx];
+ priv->box = priv->box_array[idx];
}
}
static inline glamor_pixmap_fbo *
-glamor_pixmap_fbo_at(glamor_pixmap_private *priv, int x, int y)
+glamor_pixmap_fbo_at(glamor_pixmap_private *priv, int box)
{
- if (priv->type == GLAMOR_TEXTURE_LARGE) {
- assert(x < priv->large.block_wcnt);
- assert(y < priv->large.block_hcnt);
- return priv->large.fbo_array[y * priv->large.block_wcnt + x];
- }
- assert (x == 0);
- assert (y == 0);
- return priv->base.fbo;
+ assert(box < priv->block_wcnt * priv->block_hcnt);
+ return priv->fbo_array[box];
}
static inline BoxPtr
-glamor_pixmap_box_at(glamor_pixmap_private *priv, int x, int y)
+glamor_pixmap_box_at(glamor_pixmap_private *priv, int box)
{
- if (priv->type == GLAMOR_TEXTURE_LARGE) {
- assert(x < priv->large.block_wcnt);
- assert(y < priv->large.block_hcnt);
- return &priv->large.box_array[y * priv->large.block_wcnt + x];
- }
- assert (x == 0);
- assert (y == 0);
- return &priv->base.box;
+ assert(box < priv->block_wcnt * priv->block_hcnt);
+ return &priv->box_array[box];
}
static inline int
glamor_pixmap_wcnt(glamor_pixmap_private *priv)
{
- if (priv->type == GLAMOR_TEXTURE_LARGE)
- return priv->large.block_wcnt;
- return 1;
+ return priv->block_wcnt;
}
static inline int
glamor_pixmap_hcnt(glamor_pixmap_private *priv)
{
- if (priv->type == GLAMOR_TEXTURE_LARGE)
- return priv->large.block_hcnt;
- return 1;
+ return priv->block_hcnt;
}
-#define glamor_pixmap_loop(priv, x, y) \
- for (y = 0; y < glamor_pixmap_hcnt(priv); y++) \
- for (x = 0; x < glamor_pixmap_wcnt(priv); x++)
+#define glamor_pixmap_loop(priv, box_index) \
+ for (box_index = 0; box_index < glamor_pixmap_hcnt(priv) * \
+ glamor_pixmap_wcnt(priv); box_index++) \
-/*
- * Pixmap dynamic status, used by dynamic upload feature.
- *
- * GLAMOR_NONE: initial status, don't need to do anything.
- * GLAMOR_UPLOAD_PENDING: marked as need to be uploaded to gl texture.
- * GLAMOR_UPLOAD_DONE: the pixmap has been uploaded successfully.
- * GLAMOR_UPLOAD_FAILED: fail to upload the pixmap.
- *
- * */
+/**
+ * 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;
@@ -592,7 +540,6 @@ typedef struct {
extern DevPrivateKeyRec glamor_gc_private_key;
extern DevPrivateKeyRec glamor_screen_private_key;
-extern DevPrivateKeyRec glamor_pixmap_private_key;
static inline glamor_screen_private *
glamor_get_screen_private(ScreenPtr screen)
@@ -607,22 +554,6 @@ glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv)
dixSetPrivate(&screen->devPrivates, &glamor_screen_private_key, priv);
}
-static inline glamor_pixmap_private *
-glamor_get_pixmap_private(PixmapPtr pixmap)
-{
- glamor_pixmap_private *priv;
-
- priv = dixLookupPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key);
- if (!priv) {
- glamor_set_pixmap_type(pixmap, GLAMOR_MEMORY);
- priv = dixLookupPrivate(&pixmap->devPrivates,
- &glamor_pixmap_private_key);
- }
- return priv;
-}
-
-void glamor_set_pixmap_private(PixmapPtr pixmap, glamor_pixmap_private *priv);
-
static inline glamor_gc_private *
glamor_get_gc_private(GCPtr gc)
{
@@ -634,10 +565,10 @@ glamor_get_gc_private(GCPtr gc)
* pixel values for pDrawable.
*/
static inline Bool
-glamor_pm_is_solid(DrawablePtr drawable, unsigned long planemask)
+glamor_pm_is_solid(int depth, unsigned long planemask)
{
- return (planemask & FbFullMask(drawable->depth)) ==
- FbFullMask(drawable->depth);
+ return (planemask & FbFullMask(depth)) ==
+ FbFullMask(depth);
}
extern int glamor_debug_level;
@@ -654,9 +585,9 @@ glamor_pixmap_fbo *glamor_create_fbo_from_tex(glamor_screen_private *
int flag);
glamor_pixmap_fbo *glamor_create_fbo(glamor_screen_private *glamor_priv, int w,
int h, GLenum format, int flag);
-void glamor_destroy_fbo(glamor_pixmap_fbo *fbo);
-void glamor_pixmap_destroy_fbo(glamor_pixmap_private *priv);
-
+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);
@@ -667,9 +598,11 @@ glamor_pixmap_fbo *glamor_create_fbo_array(glamor_screen_private *glamor_priv,
int flag, int block_w, int block_h,
glamor_pixmap_private *);
+void glamor_gldrawarrays_quads_using_indices(glamor_screen_private *glamor_priv,
+ unsigned count);
+
/* glamor_core.c */
void glamor_init_finish_access_shaders(ScreenPtr screen);
-void glamor_fini_finish_access_shaders(ScreenPtr screen);
Bool glamor_get_drawable_location(const DrawablePtr drawable);
void glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap,
@@ -681,45 +614,29 @@ void glamor_get_color_4f_from_pixel(PixmapPtr pixmap,
unsigned long fg_pixel, GLfloat *color);
int glamor_set_destination_pixmap(PixmapPtr pixmap);
-int glamor_set_destination_pixmap_priv(glamor_pixmap_private *pixmap_priv);
-void glamor_set_destination_pixmap_fbo(glamor_pixmap_fbo *, int, int, int, int);
+int glamor_set_destination_pixmap_priv(glamor_screen_private *glamor_priv, PixmapPtr pixmap, glamor_pixmap_private *pixmap_priv);
+void glamor_set_destination_pixmap_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *, int, int, int, int);
/* nc means no check. caller must ensure this pixmap has valid fbo.
* usually use the GLAMOR_PIXMAP_PRIV_HAS_FBO firstly.
* */
-void glamor_set_destination_pixmap_priv_nc(glamor_pixmap_private *pixmap_priv);
-
-glamor_pixmap_fbo *glamor_es2_pixmap_read_prepare(PixmapPtr source, int x,
- int y, int w, int h,
- GLenum format, GLenum type,
- int no_alpha, int revert,
- int swap_rb);
+void glamor_set_destination_pixmap_priv_nc(glamor_screen_private *glamor_priv, PixmapPtr pixmap, glamor_pixmap_private *pixmap_priv);
Bool glamor_set_alu(ScreenPtr screen, unsigned char alu);
-Bool glamor_set_planemask(PixmapPtr pixmap, unsigned long planemask);
+Bool glamor_set_planemask(int depth, unsigned long planemask);
RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap);
void
glamor_track_stipple(GCPtr gc);
-/* glamor_glyphs.c */
-Bool glamor_realize_glyph_caches(ScreenPtr screen);
-void glamor_glyphs_fini(ScreenPtr screen);
-void glamor_glyphs(CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr *glyphs);
-
/* glamor_render.c */
Bool glamor_composite_clipped_region(CARD8 op,
PicturePtr source,
PicturePtr mask,
PicturePtr dest,
- glamor_pixmap_private *soruce_pixmap_priv,
- glamor_pixmap_private *mask_pixmap_priv,
- glamor_pixmap_private *dest_pixmap_priv,
+ PixmapPtr source_pixmap,
+ PixmapPtr mask_pixmap,
+ PixmapPtr dest_pixmap,
RegionPtr region,
int x_source,
int y_source,
@@ -736,38 +653,9 @@ void glamor_composite(CARD8 op,
INT16 yMask,
INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
-void glamor_init_composite_shaders(ScreenPtr screen);
-void glamor_fini_composite_shaders(ScreenPtr screen);
-void glamor_composite_glyph_rects(CARD8 op,
- PicturePtr src, PicturePtr mask,
- PicturePtr dst, int nrect,
- glamor_composite_rect_t *rects);
void glamor_composite_rects(CARD8 op,
PicturePtr pDst,
xRenderColor *color, int nRect, xRectangle *rects);
-PicturePtr glamor_convert_gradient_picture(ScreenPtr screen,
- PicturePtr source,
- int x_source,
- int y_source, int width, int height);
-
-Bool glamor_composite_choose_shader(CARD8 op,
- PicturePtr source,
- PicturePtr mask,
- PicturePtr dest,
- glamor_pixmap_private *source_pixmap_priv,
- glamor_pixmap_private *mask_pixmap_priv,
- glamor_pixmap_private *dest_pixmap_priv,
- struct shader_key *s_key,
- glamor_composite_shader ** shader,
- struct blendinfo *op_info,
- PictFormatShort *psaved_source_format);
-
-void glamor_composite_set_shader_blend(glamor_pixmap_private *dest_priv,
- struct shader_key *key,
- glamor_composite_shader *shader,
- struct blendinfo *op_info);
-
-void *glamor_setup_composite_vbo(ScreenPtr screen, int n_verts);
/* glamor_trapezoid.c */
void glamor_trapezoids(CARD8 op,
@@ -777,7 +665,6 @@ void glamor_trapezoids(CARD8 op,
/* glamor_gradient.c */
void glamor_init_gradient_shader(ScreenPtr screen);
-void glamor_fini_gradient_shader(ScreenPtr screen);
PicturePtr glamor_generate_linear_gradient_picture(ScreenPtr screen,
PicturePtr src_picture,
int x_source, int y_source,
@@ -821,44 +708,25 @@ glamor_put_vbo_space(ScreenPtr screen);
*/
Bool glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag);
-/**
- * Upload a pixmap to gl texture. Used by dynamic pixmap
- * uploading feature. The pixmap must be a software pixmap.
- * This function will change current FBO and current shaders.
- */
-enum glamor_pixmap_status glamor_upload_pixmap_to_texture(PixmapPtr pixmap);
-
-Bool glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w,
- int h, int stride, void *bits,
- int pbo);
-
glamor_pixmap_clipped_regions *
-glamor_compute_clipped_regions(glamor_pixmap_private *priv,
+glamor_compute_clipped_regions(PixmapPtr pixmap,
RegionPtr region, int *clipped_nbox,
int repeat_type, int reverse,
int upsidedown);
glamor_pixmap_clipped_regions *
-glamor_compute_clipped_regions_ext(glamor_pixmap_private *pixmap_priv,
+glamor_compute_clipped_regions_ext(PixmapPtr pixmap,
RegionPtr region, int *n_region,
int inner_block_w, int inner_block_h,
int reverse, int upsidedown);
-glamor_pixmap_clipped_regions *
-glamor_compute_transform_clipped_regions(glamor_pixmap_private *priv,
- struct pixman_transform *transform,
- RegionPtr region,
- int *n_region, int dx, int dy,
- int repeat_type, int reverse,
- int upsidedown);
-
Bool glamor_composite_largepixmap_region(CARD8 op,
PicturePtr source,
PicturePtr mask,
PicturePtr dest,
- glamor_pixmap_private *source_pixmap_priv,
- glamor_pixmap_private *mask_pixmap_priv,
- glamor_pixmap_private *dest_pixmap_priv,
+ PixmapPtr source_pixmap,
+ PixmapPtr mask_pixmap,
+ PixmapPtr dest_pixmap,
RegionPtr region, Bool force_clip,
INT16 x_source,
INT16 y_source,
@@ -867,42 +735,12 @@ Bool glamor_composite_largepixmap_region(CARD8 op,
INT16 x_dest, INT16 y_dest,
CARD16 width, CARD16 height);
-Bool glamor_get_transform_block_size(struct pixman_transform *transform,
- int block_w, int block_h,
- int *transformed_block_w,
- int *transformed_block_h);
-
-void glamor_get_transform_extent_from_box(struct pixman_box32 *temp_box,
- struct pixman_transform *transform);
-
/**
* 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);
-/**
- * Upload bits to a pixmap's texture. This function will
- * convert the bits to the specified format/type format
- * if the conversion is unavoidable.
- **/
-Bool glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format,
- GLenum type, int no_alpha, int revert,
- int swap_rb, void *bits);
-
-int glamor_create_picture(PicturePtr picture);
-
-void glamor_set_window_pixmap(WindowPtr pWindow, PixmapPtr pPixmap);
-
-void glamor_destroy_picture(PicturePtr picture);
-
-/* fixup a fbo to the exact size as the pixmap. */
-Bool glamor_fixup_pixmap_priv(ScreenPtr screen,
- glamor_pixmap_private *pixmap_priv);
-
-void glamor_picture_format_fixup(PicturePtr picture,
- glamor_pixmap_private *pixmap_priv);
-
void glamor_add_traps(PicturePtr pPicture,
INT16 x_off, INT16 y_off, int ntrap, xTrap *traps);
@@ -1009,6 +847,22 @@ void glamor_composite_rectangles(CARD8 op,
xRenderColor *color,
int num_rects, xRectangle *rects);
+/* glamor_composite_glyphs.c */
+Bool
+glamor_composite_glyphs_init(ScreenPtr pScreen);
+
+void
+glamor_composite_glyphs_fini(ScreenPtr pScreen);
+
+void
+glamor_composite_glyphs(CARD8 op,
+ PicturePtr src,
+ PicturePtr dst,
+ PictFormatPtr mask_format,
+ INT16 x_src,
+ INT16 y_src, int nlist,
+ GlyphListPtr list, GlyphPtr *glyphs);
+
/* glamor_sync.c */
Bool
glamor_sync_init(ScreenPtr screen);
@@ -1092,8 +946,6 @@ void glamor_xv_render(glamor_port_private *port_priv);
#if 0
#define MAX_FBO_SIZE 32 /* For test purpose only. */
#endif
-//#define GLYPHS_NO_EDEGEMAP_OVERLAP_CHECK
-#define GLYPHS_EDEGE_OVERLAP_LOOSE_CHECK
#include "glamor_font.h"
diff --git a/xserver/glamor/glamor_program.c b/xserver/glamor/glamor_program.c
index 3207aaf15..0a94de62f 100644
--- a/xserver/glamor/glamor_program.c
+++ b/xserver/glamor/glamor_program.c
@@ -40,14 +40,14 @@ const glamor_facet glamor_fill_solid = {
static Bool
use_tile(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg)
{
- return glamor_set_tiled(pixmap, gc, prog->fill_offset_uniform, prog->fill_size_uniform);
+ return glamor_set_tiled(pixmap, gc, prog->fill_offset_uniform, prog->fill_size_inv_uniform);
}
static const glamor_facet glamor_fill_tile = {
.name = "tile",
- .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) / fill_size;\n",
+ .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv;\n",
.fs_exec = " gl_FragColor = texture2D(sampler, fill_pos);\n",
- .locations = glamor_program_location_fill,
+ .locations = glamor_program_location_fillsamp | glamor_program_location_fillpos,
.use = use_tile,
};
@@ -56,17 +56,17 @@ use_stipple(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg)
{
return glamor_set_stippled(pixmap, gc, prog->fg_uniform,
prog->fill_offset_uniform,
- prog->fill_size_uniform);
+ prog->fill_size_inv_uniform);
}
static const glamor_facet glamor_fill_stipple = {
.name = "stipple",
- .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) / fill_size;\n",
+ .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv;\n",
.fs_exec = (" float a = texture2D(sampler, fill_pos).w;\n"
" if (a == 0.0)\n"
" discard;\n"
" gl_FragColor = fg;\n"),
- .locations = glamor_program_location_fg | glamor_program_location_fill,
+ .locations = glamor_program_location_fg | glamor_program_location_fillsamp | glamor_program_location_fillpos,
.use = use_stipple,
};
@@ -81,13 +81,13 @@ use_opaque_stipple(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg)
static const glamor_facet glamor_fill_opaque_stipple = {
.name = "opaque_stipple",
- .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) / fill_size;\n",
+ .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv;\n",
.fs_exec = (" float a = texture2D(sampler, fill_pos).w;\n"
" if (a == 0.0)\n"
" gl_FragColor = bg;\n"
" else\n"
" gl_FragColor = fg;\n"),
- .locations = glamor_program_location_fg | glamor_program_location_bg | glamor_program_location_fill,
+ .locations = glamor_program_location_fg | glamor_program_location_bg | glamor_program_location_fillsamp | glamor_program_location_fillpos,
.use = use_opaque_stipple
};
@@ -114,12 +114,15 @@ static glamor_location_var location_vars[] = {
.fs_vars = "uniform vec4 bg;\n"
},
{
- .location = glamor_program_location_fill,
+ .location = glamor_program_location_fillsamp,
+ .fs_vars = "uniform sampler2D sampler;\n"
+ },
+ {
+ .location = glamor_program_location_fillpos,
.vs_vars = ("uniform vec2 fill_offset;\n"
- "uniform vec2 fill_size;\n"
+ "uniform vec2 fill_size_inv;\n"
"varying vec2 fill_pos;\n"),
- .fs_vars = ("uniform sampler2D sampler;\n"
- "uniform vec2 fill_size;\n"
+ .fs_vars = ("uniform vec2 fill_size_inv;\n"
"varying vec2 fill_pos;\n")
},
{
@@ -136,10 +139,12 @@ static glamor_location_var location_vars[] = {
.vs_vars = "uniform float dash_length;\n",
.fs_vars = "uniform sampler2D dash;\n",
},
+ {
+ .location = glamor_program_location_atlas,
+ .fs_vars = "uniform sampler2D atlas;\n",
+ },
};
-#define NUM_LOCATION_VARS (sizeof location_vars / sizeof location_vars[0])
-
static char *
add_var(char *cur, const char *add)
{
@@ -163,7 +168,7 @@ vs_location_vars(glamor_program_location locations)
int l;
char *vars = strdup("");
- for (l = 0; vars && l < NUM_LOCATION_VARS; l++)
+ for (l = 0; vars && l < ARRAY_SIZE(location_vars); l++)
if (locations & location_vars[l].location)
vars = add_var(vars, location_vars[l].vs_vars);
return vars;
@@ -175,7 +180,7 @@ fs_location_vars(glamor_program_location locations)
int l;
char *vars = strdup("");
- for (l = 0; vars && l < NUM_LOCATION_VARS; l++)
+ for (l = 0; vars && l < ARRAY_SIZE(location_vars); l++)
if (locations & location_vars[l].location)
vars = add_var(vars, location_vars[l].fs_vars);
return vars;
@@ -183,6 +188,7 @@ fs_location_vars(glamor_program_location locations)
static const char vs_template[] =
"%s" /* version */
+ "%s" /* defines */
"%s" /* prim vs_vars */
"%s" /* fill vs_vars */
"%s" /* location vs_vars */
@@ -195,12 +201,14 @@ static const char vs_template[] =
static const char fs_template[] =
"%s" /* version */
GLAMOR_DEFAULT_PRECISION
+ "%s" /* defines */
"%s" /* prim fs_vars */
"%s" /* fill fs_vars */
"%s" /* location fs_vars */
"void main() {\n"
"%s" /* prim fs_exec */
"%s" /* fill fs_exec */
+ "%s" /* combine */
"}\n";
static const char *
@@ -236,7 +244,9 @@ Bool
glamor_build_program(ScreenPtr screen,
glamor_program *prog,
const glamor_facet *prim,
- const glamor_facet *fill)
+ const glamor_facet *fill,
+ const char *combine,
+ const char *defines)
{
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
@@ -282,6 +292,7 @@ glamor_build_program(ScreenPtr screen,
if (asprintf(&vs_prog_string,
vs_template,
str(version_string),
+ str(defines),
str(prim->vs_vars),
str(fill->vs_vars),
vs_vars,
@@ -292,26 +303,30 @@ glamor_build_program(ScreenPtr screen,
if (asprintf(&fs_prog_string,
fs_template,
str(version_string),
+ str(defines),
str(prim->fs_vars),
str(fill->fs_vars),
fs_vars,
str(prim->fs_exec),
- str(fill->fs_exec)) < 0)
+ str(fill->fs_exec),
+ str(combine)) < 0)
fs_prog_string = NULL;
if (!vs_prog_string || !fs_prog_string)
goto fail;
+ prog->prog = glCreateProgram();
#if DBG
- ErrorF("\nPrograms for %s %s\nVertex shader:\n\n%s\n\nFragment Shader:\n\n%s",
- prim->name, fill->name, vs_prog_string, fs_prog_string);
+ ErrorF("\n\tProgram %d for %s %s\n\tVertex shader:\n\n\t================\n%s\n\n\tFragment Shader:\n\n%s\t================\n",
+ prog->prog, prim->name, fill->name, vs_prog_string, fs_prog_string);
#endif
- prog->prog = glCreateProgram();
prog->flags = flags;
prog->locations = locations;
prog->prim_use = prim->use;
+ prog->prim_use_render = prim->use_render;
prog->fill_use = fill->use;
+ prog->fill_use_render = fill->use_render;
vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, vs_prog_string);
fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, fs_prog_string);
@@ -329,19 +344,24 @@ glamor_build_program(ScreenPtr screen,
#endif
glBindAttribLocation(prog->prog, GLAMOR_VERTEX_SOURCE, prim->source_name);
}
+ if (prog->alpha == glamor_program_alpha_dual_blend) {
+ glBindFragDataLocationIndexed(prog->prog, 0, 0, "color0");
+ glBindFragDataLocationIndexed(prog->prog, 0, 1, "color1");
+ }
glamor_link_glsl_prog(screen, prog->prog, "%s_%s", prim->name, fill->name);
prog->matrix_uniform = glamor_get_uniform(prog, glamor_program_location_none, "v_matrix");
prog->fg_uniform = glamor_get_uniform(prog, glamor_program_location_fg, "fg");
prog->bg_uniform = glamor_get_uniform(prog, glamor_program_location_bg, "bg");
- prog->fill_offset_uniform = glamor_get_uniform(prog, glamor_program_location_fill, "fill_offset");
- prog->fill_size_uniform = glamor_get_uniform(prog, glamor_program_location_fill, "fill_size");
+ prog->fill_offset_uniform = glamor_get_uniform(prog, glamor_program_location_fillpos, "fill_offset");
+ prog->fill_size_inv_uniform = glamor_get_uniform(prog, glamor_program_location_fillpos, "fill_size_inv");
prog->font_uniform = glamor_get_uniform(prog, glamor_program_location_font, "font");
prog->bitplane_uniform = glamor_get_uniform(prog, glamor_program_location_bitplane, "bitplane");
prog->bitmul_uniform = glamor_get_uniform(prog, glamor_program_location_bitplane, "bitmul");
prog->dash_uniform = glamor_get_uniform(prog, glamor_program_location_dash, "dash");
prog->dash_length_uniform = glamor_get_uniform(prog, glamor_program_location_dash, "dash_length");
+ prog->atlas_uniform = glamor_get_uniform(prog, glamor_program_location_atlas, "atlas");
free(version_string);
free(fs_vars);
@@ -396,7 +416,7 @@ glamor_use_program_fill(PixmapPtr pixmap,
if (!fill)
return NULL;
- if (!glamor_build_program(screen, prog, prim, fill))
+ if (!glamor_build_program(screen, prog, prim, fill, NULL, NULL))
return NULL;
}
@@ -405,3 +425,259 @@ glamor_use_program_fill(PixmapPtr pixmap,
return prog;
}
+
+static struct blendinfo composite_op_info[] = {
+ [PictOpClear] = {0, 0, GL_ZERO, GL_ZERO},
+ [PictOpSrc] = {0, 0, GL_ONE, GL_ZERO},
+ [PictOpDst] = {0, 0, GL_ZERO, GL_ONE},
+ [PictOpOver] = {0, 1, GL_ONE, GL_ONE_MINUS_SRC_ALPHA},
+ [PictOpOverReverse] = {1, 0, GL_ONE_MINUS_DST_ALPHA, GL_ONE},
+ [PictOpIn] = {1, 0, GL_DST_ALPHA, GL_ZERO},
+ [PictOpInReverse] = {0, 1, GL_ZERO, GL_SRC_ALPHA},
+ [PictOpOut] = {1, 0, GL_ONE_MINUS_DST_ALPHA, GL_ZERO},
+ [PictOpOutReverse] = {0, 1, GL_ZERO, GL_ONE_MINUS_SRC_ALPHA},
+ [PictOpAtop] = {1, 1, GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA},
+ [PictOpAtopReverse] = {1, 1, GL_ONE_MINUS_DST_ALPHA, GL_SRC_ALPHA},
+ [PictOpXor] = {1, 1, GL_ONE_MINUS_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA},
+ [PictOpAdd] = {0, 0, GL_ONE, GL_ONE},
+};
+
+static void
+glamor_set_blend(CARD8 op, glamor_program_alpha alpha, PicturePtr dst)
+{
+ GLenum src_blend, dst_blend;
+ struct blendinfo *op_info;
+
+ switch (alpha) {
+ case glamor_program_alpha_ca_first:
+ op = PictOpOutReverse;
+ break;
+ case glamor_program_alpha_ca_second:
+ op = PictOpAdd;
+ break;
+ default:
+ break;
+ }
+
+ if (op == PictOpSrc)
+ return;
+
+ op_info = &composite_op_info[op];
+
+ src_blend = op_info->source_blend;
+ dst_blend = op_info->dest_blend;
+
+ /* If there's no dst alpha channel, adjust the blend op so that we'll treat
+ * it as always 1.
+ */
+ if (PICT_FORMAT_A(dst->format) == 0 && op_info->dest_alpha) {
+ if (src_blend == GL_DST_ALPHA)
+ src_blend = GL_ONE;
+ else if (src_blend == GL_ONE_MINUS_DST_ALPHA)
+ src_blend = GL_ZERO;
+ }
+
+ /* Set up the source alpha value for blending in component alpha mode. */
+ if (alpha == glamor_program_alpha_dual_blend) {
+ switch (dst_blend) {
+ case GL_SRC_ALPHA:
+ dst_blend = GL_SRC1_COLOR;
+ break;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ dst_blend = GL_ONE_MINUS_SRC1_COLOR;
+ break;
+ }
+ } else if (alpha != glamor_program_alpha_normal) {
+ switch (dst_blend) {
+ case GL_SRC_ALPHA:
+ dst_blend = GL_SRC_COLOR;
+ break;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ dst_blend = GL_ONE_MINUS_SRC_COLOR;
+ break;
+ }
+ }
+
+ glEnable(GL_BLEND);
+ glBlendFunc(src_blend, dst_blend);
+}
+
+static Bool
+use_source_solid(CARD8 op, PicturePtr src, PicturePtr dst, glamor_program *prog)
+{
+
+ glamor_set_blend(op, prog->alpha, dst);
+
+ glamor_set_color_depth(dst->pDrawable->pScreen, 32,
+ src->pSourcePict->solidFill.color,
+ prog->fg_uniform);
+ return TRUE;
+}
+
+static const glamor_facet glamor_source_solid = {
+ .name = "render_solid",
+ .fs_exec = " vec4 source = fg;\n",
+ .locations = glamor_program_location_fg,
+ .use_render = use_source_solid,
+};
+
+static Bool
+use_source_picture(CARD8 op, PicturePtr src, PicturePtr dst, glamor_program *prog)
+{
+ glamor_set_blend(op, prog->alpha, dst);
+
+ return glamor_set_texture((PixmapPtr) src->pDrawable,
+ 0, 0,
+ prog->fill_offset_uniform,
+ prog->fill_size_inv_uniform);
+}
+
+static const glamor_facet glamor_source_picture = {
+ .name = "render_picture",
+ .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv;\n",
+ .fs_exec = " vec4 source = texture2D(sampler, fill_pos);\n",
+ .locations = glamor_program_location_fillsamp | glamor_program_location_fillpos,
+ .use_render = use_source_picture,
+};
+
+static Bool
+use_source_1x1_picture(CARD8 op, PicturePtr src, PicturePtr dst, glamor_program *prog)
+{
+ glamor_set_blend(op, prog->alpha, dst);
+
+ return glamor_set_texture_pixmap((PixmapPtr) src->pDrawable);
+}
+
+static const glamor_facet glamor_source_1x1_picture = {
+ .name = "render_picture",
+ .fs_exec = " vec4 source = texture2D(sampler, vec2(0.5));\n",
+ .locations = glamor_program_location_fillsamp,
+ .use_render = use_source_1x1_picture,
+};
+
+static const glamor_facet *glamor_facet_source[glamor_program_source_count] = {
+ [glamor_program_source_solid] = &glamor_source_solid,
+ [glamor_program_source_picture] = &glamor_source_picture,
+ [glamor_program_source_1x1_picture] = &glamor_source_1x1_picture,
+};
+
+static const char *glamor_combine[] = {
+ [glamor_program_alpha_normal] = " gl_FragColor = source * mask.a;\n",
+ [glamor_program_alpha_ca_first] = " gl_FragColor = source.a * mask;\n",
+ [glamor_program_alpha_ca_second] = " gl_FragColor = source * mask;\n",
+ [glamor_program_alpha_dual_blend] = " color0 = source * mask;\n"
+ " color1 = source.a * mask;\n"
+};
+
+static Bool
+glamor_setup_one_program_render(ScreenPtr screen,
+ glamor_program *prog,
+ glamor_program_source source_type,
+ glamor_program_alpha alpha,
+ const glamor_facet *prim,
+ const char *defines)
+{
+ if (prog->failed)
+ return FALSE;
+
+ if (!prog->prog) {
+ const glamor_facet *fill = glamor_facet_source[source_type];
+
+ if (!fill)
+ return FALSE;
+
+ prog->alpha = alpha;
+ if (!glamor_build_program(screen, prog, prim, fill, glamor_combine[alpha], defines))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+glamor_program *
+glamor_setup_program_render(CARD8 op,
+ PicturePtr src,
+ PicturePtr mask,
+ PicturePtr dst,
+ glamor_program_render *program_render,
+ const glamor_facet *prim,
+ const char *defines)
+{
+ ScreenPtr screen = dst->pDrawable->pScreen;
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+ glamor_program_alpha alpha;
+ glamor_program_source source_type;
+ glamor_program *prog;
+
+ if (op > ARRAY_SIZE(composite_op_info))
+ return NULL;
+
+ if (glamor_is_component_alpha(mask)) {
+ if (glamor_priv->has_dual_blend) {
+ alpha = glamor_program_alpha_dual_blend;
+ } else {
+ /* This only works for PictOpOver */
+ if (op != PictOpOver)
+ return NULL;
+
+ alpha = glamor_program_alpha_ca_first;
+ }
+ } else
+ alpha = glamor_program_alpha_normal;
+
+ if (src->pDrawable) {
+
+ /* Can't do transforms, alphamaps or sourcing from non-pixmaps yet */
+ if (src->transform || src->alphaMap || src->pDrawable->type != DRAWABLE_PIXMAP)
+ return NULL;
+
+ if (src->pDrawable->width == 1 && src->pDrawable->height == 1 && src->repeat)
+ source_type = glamor_program_source_1x1_picture;
+ else
+ source_type = glamor_program_source_picture;
+ } else {
+ SourcePictPtr sp = src->pSourcePict;
+ if (!sp)
+ return NULL;
+ switch (sp->type) {
+ case SourcePictTypeSolidFill:
+ source_type = glamor_program_source_solid;
+ break;
+ default:
+ return NULL;
+ }
+ }
+
+ prog = &program_render->progs[source_type][alpha];
+ if (!glamor_setup_one_program_render(screen, prog, source_type, alpha, prim, defines))
+ return NULL;
+
+ if (alpha == glamor_program_alpha_ca_first) {
+
+ /* Make sure we can also build the second program before
+ * deciding to use this path.
+ */
+ if (!glamor_setup_one_program_render(screen,
+ &program_render->progs[source_type][glamor_program_alpha_ca_second],
+ source_type, glamor_program_alpha_ca_second, prim,
+ defines))
+ return NULL;
+ }
+ return prog;
+}
+
+Bool
+glamor_use_program_render(glamor_program *prog,
+ CARD8 op,
+ PicturePtr src,
+ PicturePtr dst)
+{
+ glUseProgram(prog->prog);
+
+ if (prog->prim_use_render && !prog->prim_use_render(op, src, dst, prog))
+ return FALSE;
+
+ if (prog->fill_use_render && !prog->fill_use_render(op, src, dst, prog))
+ return FALSE;
+ return TRUE;
+}
diff --git a/xserver/glamor/glamor_program.h b/xserver/glamor/glamor_program.h
index 56ba03aa8..ab6e46f7b 100644
--- a/xserver/glamor/glamor_program.h
+++ b/xserver/glamor/glamor_program.h
@@ -27,23 +27,37 @@ typedef enum {
glamor_program_location_none = 0,
glamor_program_location_fg = 1,
glamor_program_location_bg = 2,
- glamor_program_location_fill = 4,
- glamor_program_location_font = 8,
- glamor_program_location_bitplane = 16,
- glamor_program_location_dash = 32,
+ glamor_program_location_fillsamp = 4,
+ glamor_program_location_fillpos = 8,
+ glamor_program_location_font = 16,
+ glamor_program_location_bitplane = 32,
+ glamor_program_location_dash = 64,
+ glamor_program_location_atlas = 128,
} glamor_program_location;
typedef enum {
glamor_program_flag_none = 0,
} glamor_program_flag;
+typedef enum {
+ glamor_program_alpha_normal,
+ glamor_program_alpha_ca_first,
+ glamor_program_alpha_ca_second,
+ glamor_program_alpha_dual_blend,
+ glamor_program_alpha_count
+} glamor_program_alpha;
+
typedef struct _glamor_program glamor_program;
typedef Bool (*glamor_use) (PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg);
+typedef Bool (*glamor_use_render) (CARD8 op, PicturePtr src, PicturePtr dst, glamor_program *prog);
+
typedef struct {
const char *name;
const int version;
+ char *vs_defines;
+ char *fs_defines;
const char *vs_vars;
const char *vs_exec;
const char *fs_vars;
@@ -52,6 +66,7 @@ typedef struct {
const glamor_program_flag flags;
const char *source_name;
glamor_use use;
+ glamor_use_render use_render;
} glamor_facet;
struct _glamor_program {
@@ -60,17 +75,21 @@ struct _glamor_program {
GLint matrix_uniform;
GLint fg_uniform;
GLint bg_uniform;
- GLint fill_size_uniform;
+ GLint fill_size_inv_uniform;
GLint fill_offset_uniform;
GLint font_uniform;
GLint bitplane_uniform;
GLint bitmul_uniform;
GLint dash_uniform;
GLint dash_length_uniform;
+ GLint atlas_uniform;
glamor_program_location locations;
glamor_program_flag flags;
glamor_use prim_use;
glamor_use fill_use;
+ glamor_program_alpha alpha;
+ glamor_use_render prim_use_render;
+ glamor_use_render fill_use_render;
};
typedef struct {
@@ -83,7 +102,9 @@ Bool
glamor_build_program(ScreenPtr screen,
glamor_program *prog,
const glamor_facet *prim,
- const glamor_facet *fill);
+ const glamor_facet *fill,
+ const char *combine,
+ const char *defines);
Bool
glamor_use_program(PixmapPtr pixmap,
@@ -97,4 +118,37 @@ glamor_use_program_fill(PixmapPtr pixmap,
glamor_program_fill *program_fill,
const glamor_facet *prim);
+typedef enum {
+ glamor_program_source_solid,
+ glamor_program_source_picture,
+ glamor_program_source_1x1_picture,
+ glamor_program_source_count,
+} glamor_program_source;
+
+typedef struct {
+ glamor_program progs[glamor_program_source_count][glamor_program_alpha_count];
+} glamor_program_render;
+
+static inline Bool
+glamor_is_component_alpha(PicturePtr mask) {
+ if (mask && mask->componentAlpha && PICT_FORMAT_RGB(mask->format))
+ return TRUE;
+ return FALSE;
+}
+
+glamor_program *
+glamor_setup_program_render(CARD8 op,
+ PicturePtr src,
+ PicturePtr mask,
+ PicturePtr dst,
+ glamor_program_render *program_render,
+ const glamor_facet *prim,
+ const char *defines);
+
+Bool
+glamor_use_program_render(glamor_program *prog,
+ CARD8 op,
+ PicturePtr src,
+ PicturePtr dst);
+
#endif /* _GLAMOR_PROGRAM_H_ */
diff --git a/xserver/glamor/glamor_rects.c b/xserver/glamor/glamor_rects.c
index 3a5c3f3f9..e4473209d 100644
--- a/xserver/glamor/glamor_rects.c
+++ b/xserver/glamor/glamor_rects.c
@@ -51,7 +51,7 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable,
int off_x, off_y;
GLshort *v;
char *vbo_offset;
- int box_x, box_y;
+ int box_index;
pixmap_priv = glamor_get_pixmap_private(pixmap);
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
@@ -65,7 +65,7 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable,
&glamor_facet_polyfillrect_130);
if (!prog)
- goto bail_ctx;
+ goto bail;
/* Set up the vertex buffers for the points */
@@ -87,7 +87,7 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable,
&glamor_facet_polyfillrect_120);
if (!prog)
- goto bail_ctx;
+ goto bail;
/* Set up the vertex buffers for the points */
@@ -111,11 +111,12 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable,
glEnable(GL_SCISSOR_TEST);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+ glamor_pixmap_loop(pixmap_priv, box_index) {
int nbox = RegionNumRects(gc->pCompositeClip);
BoxPtr box = RegionRects(gc->pCompositeClip);
- glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, FALSE, prog->matrix_uniform, &off_x, &off_y);
+ glamor_set_destination_drawable(drawable, box_index, TRUE, FALSE,
+ prog->matrix_uniform, &off_x, &off_y);
while (nbox--) {
glScissor(box->x1 + off_x,
@@ -126,27 +127,17 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable,
if (glamor_priv->glsl_version >= 130)
glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, nrect);
else {
- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) {
- glDrawArrays(GL_QUADS, 0, nrect * 4);
- } else {
- int i;
- for (i = 0; i < nrect; i++) {
- glDrawArrays(GL_TRIANGLE_FAN, i * 4, 4);
- }
- }
+ glamor_glDrawArrays_GL_QUADS(glamor_priv, nrect);
}
}
}
glDisable(GL_SCISSOR_TEST);
- glDisable(GL_COLOR_LOGIC_OP);
if (glamor_priv->glsl_version >= 130)
glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
return TRUE;
-bail_ctx:
- glDisable(GL_COLOR_LOGIC_OP);
bail:
return FALSE;
}
@@ -173,15 +164,3 @@ glamor_poly_fill_rect(DrawablePtr drawable,
return;
glamor_poly_fill_rect_bail(drawable, gc, nrect, prect);
}
-
-Bool
-glamor_poly_fill_rect_nf(DrawablePtr drawable,
- GCPtr gc, int nrect, xRectangle *prect)
-{
- if (glamor_poly_fill_rect_gl(drawable, gc, nrect, prect))
- return TRUE;
- if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc))
- return FALSE;
- glamor_poly_fill_rect_bail(drawable, gc, nrect, prect);
- return TRUE;
-}
diff --git a/xserver/glamor/glamor_render.c b/xserver/glamor/glamor_render.c
index d9b16ea05..73ac831ee 100644
--- a/xserver/glamor/glamor_render.c
+++ b/xserver/glamor/glamor_render.c
@@ -34,7 +34,6 @@
#include "glamor_priv.h"
-#ifdef RENDER
#include "mipict.h"
#include "fbpict.h"
#if 0
@@ -73,146 +72,153 @@ glamor_create_composite_fs(struct shader_key *key)
"uniform int source_repeat_mode;\n"
"uniform int mask_repeat_mode;\n";
const char *relocate_texture =
- GLAMOR_DEFAULT_PRECISION
"vec2 rel_tex_coord(vec2 texture, vec4 wh, int repeat) \n"
"{\n"
- " vec2 rel_tex; \n"
- " rel_tex = texture * wh.xy; \n"
- " if (repeat == RepeatNone)\n"
+ " vec2 rel_tex; \n"
+ " rel_tex = texture * wh.xy; \n"
+ " if (repeat == RepeatFix + RepeatNone)\n"
" return rel_tex; \n"
- " else if (repeat == RepeatNormal) \n"
- " rel_tex = floor(rel_tex) + (fract(rel_tex) / wh.xy); \n"
- " else if(repeat == RepeatPad) { \n"
- " if (rel_tex.x >= 1.0) rel_tex.x = 1.0 - wh.z * wh.x / 2.; \n"
- " else if(rel_tex.x < 0.0) rel_tex.x = 0.0; \n"
- " if (rel_tex.y >= 1.0) rel_tex.y = 1.0 - wh.w * wh.y / 2.; \n"
- " else if(rel_tex.y < 0.0) rel_tex.y = 0.0; \n"
- " rel_tex = rel_tex / wh.xy; \n"
- " } \n"
- " else if(repeat == RepeatReflect) {\n"
+ " else if (repeat == RepeatFix + RepeatNormal) \n"
+ " rel_tex = floor(rel_tex) + (fract(rel_tex) / wh.xy); \n"
+ " else if (repeat == RepeatFix + RepeatPad) { \n"
+ " if (rel_tex.x >= 1.0) \n"
+ " rel_tex.x = 1.0 - wh.z * wh.x / 2.; \n"
+ " else if (rel_tex.x < 0.0) \n"
+ " rel_tex.x = 0.0; \n"
+ " if (rel_tex.y >= 1.0) \n"
+ " rel_tex.y = 1.0 - wh.w * wh.y / 2.; \n"
+ " else if (rel_tex.y < 0.0) \n"
+ " rel_tex.y = 0.0; \n"
+ " rel_tex = rel_tex / wh.xy; \n"
+ " } else if (repeat == RepeatFix + RepeatReflect) {\n"
" if ((1.0 - mod(abs(floor(rel_tex.x)), 2.0)) < 0.001)\n"
- " rel_tex.x = 2.0 - (1.0 - fract(rel_tex.x))/wh.x;\n"
+ " rel_tex.x = 2.0 - (1.0 - fract(rel_tex.x)) / wh.x;\n"
" else \n"
- " rel_tex.x = fract(rel_tex.x)/wh.x;\n"
+ " rel_tex.x = fract(rel_tex.x) / wh.x;\n"
" if ((1.0 - mod(abs(floor(rel_tex.y)), 2.0)) < 0.001)\n"
- " rel_tex.y = 2.0 - (1.0 - fract(rel_tex.y))/wh.y;\n"
+ " rel_tex.y = 2.0 - (1.0 - fract(rel_tex.y)) / wh.y;\n"
" else \n"
- " rel_tex.y = fract(rel_tex.y)/wh.y;\n"
- " } \n"
- " return rel_tex; \n"
+ " rel_tex.y = fract(rel_tex.y) / wh.y;\n"
+ " } \n"
+ " return rel_tex; \n"
"}\n";
/* The texture and the pixmap size is not match eaxctly, so can't sample it directly.
* rel_sampler will recalculate the texture coords.*/
const char *rel_sampler =
- " vec4 rel_sampler(sampler2D tex_image, vec2 tex, vec4 wh, int repeat, int set_alpha)\n"
+ " vec4 rel_sampler(sampler2D tex_image, vec2 tex, vec4 wh, int repeat)\n"
"{\n"
- " tex = rel_tex_coord(tex, wh, repeat - RepeatFix);\n"
- " if (repeat == RepeatFix) {\n"
- " if (!(tex.x >= 0.0 && tex.x < 1.0 \n"
- " && tex.y >= 0.0 && tex.y < 1.0))\n"
- " return vec4(0.0, 0.0, 0.0, set_alpha);\n"
- " tex = (fract(tex) / wh.xy);\n"
+ " if (repeat >= RepeatFix) {\n"
+ " tex = rel_tex_coord(tex, wh, repeat);\n"
+ " if (repeat == RepeatFix + RepeatNone) {\n"
+ " if (tex.x < 0.0 || tex.x >= 1.0 || \n"
+ " tex.y < 0.0 || tex.y >= 1.0)\n"
+ " return vec4(0.0, 0.0, 0.0, 0.0);\n"
+ " tex = (fract(tex) / wh.xy);\n"
+ " }\n"
" }\n"
- " if (set_alpha != 1)\n"
- " return texture2D(tex_image, tex);\n"
- " else\n"
- " return vec4(texture2D(tex_image, tex).rgb, 1.0);\n"
+ " return texture2D(tex_image, tex);\n"
"}\n";
const char *source_solid_fetch =
- GLAMOR_DEFAULT_PRECISION
"uniform vec4 source;\n"
"vec4 get_source()\n"
"{\n"
" return source;\n"
"}\n";
const char *source_alpha_pixmap_fetch =
- GLAMOR_DEFAULT_PRECISION
"varying vec2 source_texture;\n"
"uniform sampler2D source_sampler;\n"
"uniform vec4 source_wh;"
"vec4 get_source()\n"
"{\n"
- " if (source_repeat_mode < RepeatFix)\n"
- " return texture2D(source_sampler, source_texture);\n"
- " else \n"
- " return rel_sampler(source_sampler, source_texture,\n"
- " source_wh, source_repeat_mode, 0);\n"
+ " return rel_sampler(source_sampler, source_texture,\n"
+ " source_wh, source_repeat_mode);\n"
"}\n";
const char *source_pixmap_fetch =
- GLAMOR_DEFAULT_PRECISION
"varying vec2 source_texture;\n"
"uniform sampler2D source_sampler;\n"
"uniform vec4 source_wh;\n"
"vec4 get_source()\n"
"{\n"
- " if (source_repeat_mode < RepeatFix) \n"
- " return vec4(texture2D(source_sampler, source_texture).rgb, 1);\n"
- " else \n"
- " return rel_sampler(source_sampler, source_texture,\n"
- " source_wh, source_repeat_mode, 1);\n"
+ " return vec4(rel_sampler(source_sampler, source_texture,\n"
+ " source_wh, source_repeat_mode).rgb,\n"
+ " 1.0);\n"
+ "}\n";
+ const char *mask_none =
+ "vec4 get_mask()\n"
+ "{\n"
+ " return vec4(0.0, 0.0, 0.0, 1.0);\n"
"}\n";
const char *mask_solid_fetch =
- GLAMOR_DEFAULT_PRECISION
"uniform vec4 mask;\n"
"vec4 get_mask()\n"
"{\n"
" return mask;\n"
"}\n";
const char *mask_alpha_pixmap_fetch =
- GLAMOR_DEFAULT_PRECISION
"varying vec2 mask_texture;\n"
"uniform sampler2D mask_sampler;\n"
"uniform vec4 mask_wh;\n"
"vec4 get_mask()\n"
"{\n"
- " if (mask_repeat_mode < RepeatFix) \n"
- " return texture2D(mask_sampler, mask_texture);\n"
- " else \n"
- " return rel_sampler(mask_sampler, mask_texture,\n"
- " mask_wh, mask_repeat_mode, 0);\n"
+ " return rel_sampler(mask_sampler, mask_texture,\n"
+ " mask_wh, mask_repeat_mode);\n"
"}\n";
const char *mask_pixmap_fetch =
- GLAMOR_DEFAULT_PRECISION
"varying vec2 mask_texture;\n"
"uniform sampler2D mask_sampler;\n"
"uniform vec4 mask_wh;\n"
"vec4 get_mask()\n"
"{\n"
- " if (mask_repeat_mode < RepeatFix) \n"
- " return vec4(texture2D(mask_sampler, mask_texture).rgb, 1);\n"
- " else \n"
- " return rel_sampler(mask_sampler, mask_texture,\n"
- " mask_wh, mask_repeat_mode, 1);\n"
- "}\n";
- const char *in_source_only =
- GLAMOR_DEFAULT_PRECISION
- "void main()\n"
- "{\n"
- " gl_FragColor = get_source();\n"
+ " return vec4(rel_sampler(mask_sampler, mask_texture,\n"
+ " mask_wh, mask_repeat_mode).rgb, 1.0);\n"
"}\n";
+
+ const char *dest_swizzle_default =
+ "vec4 dest_swizzle(vec4 color)\n"
+ "{"
+ " return color;"
+ "}";
+ const char *dest_swizzle_alpha_to_red =
+ "vec4 dest_swizzle(vec4 color)\n"
+ "{"
+ " float undef;\n"
+ " return vec4(color.a, undef, undef, undef);"
+ "}";
+
const char *in_normal =
- GLAMOR_DEFAULT_PRECISION
"void main()\n"
"{\n"
- " gl_FragColor = get_source() * get_mask().a;\n"
+ " gl_FragColor = dest_swizzle(get_source() * get_mask().a);\n"
"}\n";
const char *in_ca_source =
- GLAMOR_DEFAULT_PRECISION
"void main()\n"
"{\n"
- " gl_FragColor = get_source() * get_mask();\n"
+ " gl_FragColor = dest_swizzle(get_source() * get_mask());\n"
"}\n";
const char *in_ca_alpha =
- GLAMOR_DEFAULT_PRECISION
"void main()\n"
"{\n"
- " gl_FragColor = get_source().a * get_mask();\n"
+ " gl_FragColor = dest_swizzle(get_source().a * get_mask());\n"
"}\n";
+ const char *in_ca_dual_blend =
+ "out vec4 color0;\n"
+ "out vec4 color1;\n"
+ "void main()\n"
+ "{\n"
+ " color0 = dest_swizzle(get_source() * get_mask());\n"
+ " color1 = dest_swizzle(get_source().a * get_mask());\n"
+ "}\n";
+ const char *header_ca_dual_blend =
+ "#version 130\n";
+
char *source;
const char *source_fetch;
const char *mask_fetch = "";
const char *in;
+ const char *header;
+ const char *header_norm = "";
+ const char *dest_swizzle;
GLuint prog;
switch (key->source) {
@@ -231,6 +237,7 @@ glamor_create_composite_fs(struct shader_key *key)
switch (key->mask) {
case SHADER_MASK_NONE:
+ mask_fetch = mask_none;
break;
case SHADER_MASK_SOLID:
mask_fetch = mask_solid_fetch;
@@ -245,25 +252,45 @@ glamor_create_composite_fs(struct shader_key *key)
FatalError("Bad composite shader mask");
}
- switch (key->in) {
- case SHADER_IN_SOURCE_ONLY:
- in = in_source_only;
+ /* If we're storing to an a8 texture but our texture format is
+ * GL_RED because of a core context, then we need to make sure to
+ * put the alpha into the red channel.
+ */
+ switch (key->dest_swizzle) {
+ case SHADER_DEST_SWIZZLE_DEFAULT:
+ dest_swizzle = dest_swizzle_default;
+ break;
+ case SHADER_DEST_SWIZZLE_ALPHA_TO_RED:
+ dest_swizzle = dest_swizzle_alpha_to_red;
break;
- case SHADER_IN_NORMAL:
+ default:
+ FatalError("Bad composite shader dest swizzle");
+ }
+
+ header = header_norm;
+ switch (key->in) {
+ case glamor_program_alpha_normal:
in = in_normal;
break;
- case SHADER_IN_CA_SOURCE:
+ case glamor_program_alpha_ca_first:
in = in_ca_source;
break;
- case SHADER_IN_CA_ALPHA:
+ case glamor_program_alpha_ca_second:
in = in_ca_alpha;
break;
+ case glamor_program_alpha_dual_blend:
+ in = in_ca_dual_blend;
+ header = header_ca_dual_blend;
+ break;
default:
FatalError("Bad composite IN type");
}
- XNFasprintf(&source, "%s%s%s%s%s%s", repeat_define, relocate_texture,
- rel_sampler, source_fetch, mask_fetch, in);
+ XNFasprintf(&source,
+ "%s"
+ GLAMOR_DEFAULT_PRECISION
+ "%s%s%s%s%s%s%s", header, repeat_define, relocate_texture,
+ rel_sampler, source_fetch, mask_fetch, dest_swizzle, in);
prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, source);
free(source);
@@ -332,6 +359,10 @@ glamor_create_composite_shader(ScreenPtr screen, struct shader_key *key,
glBindAttribLocation(prog, GLAMOR_VERTEX_SOURCE, "v_texcoord0");
glBindAttribLocation(prog, GLAMOR_VERTEX_MASK, "v_texcoord1");
+ if (key->in == glamor_program_alpha_dual_blend) {
+ glBindFragDataLocationIndexed(prog, 0, 0, "color0");
+ glBindFragDataLocationIndexed(prog, 0, 1, "color1");
+ }
glamor_link_glsl_prog(screen, prog, "composite");
shader->prog = prog;
@@ -373,73 +404,36 @@ glamor_lookup_composite_shader(ScreenPtr screen, struct
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
glamor_composite_shader *shader;
- shader = &glamor_priv->composite_shader[key->source][key->mask][key->in];
+ shader = &glamor_priv->composite_shader[key->source][key->mask][key->in][key->dest_swizzle];
if (shader->prog == 0)
glamor_create_composite_shader(screen, key, shader);
return shader;
}
-static void
-glamor_init_eb(unsigned short *eb, int vert_cnt)
+static GLenum
+glamor_translate_blend_alpha_to_red(GLenum blend)
{
- int i, j;
-
- for (i = 0, j = 0; j < vert_cnt; i += 6, j += 4) {
- eb[i] = j;
- eb[i + 1] = j + 1;
- eb[i + 2] = j + 2;
- eb[i + 3] = j;
- eb[i + 4] = j + 2;
- eb[i + 5] = j + 3;
+ switch (blend) {
+ case GL_SRC_ALPHA:
+ return GL_SRC_COLOR;
+ case GL_DST_ALPHA:
+ return GL_DST_COLOR;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ return GL_ONE_MINUS_SRC_COLOR;
+ case GL_ONE_MINUS_DST_ALPHA:
+ return GL_ONE_MINUS_DST_COLOR;
+ default:
+ return blend;
}
}
-void
-glamor_init_composite_shaders(ScreenPtr screen)
-{
- glamor_screen_private *glamor_priv;
- unsigned short *eb;
- int eb_size;
-
- glamor_priv = glamor_get_screen_private(screen);
- glamor_make_current(glamor_priv);
- glGenBuffers(1, &glamor_priv->ebo);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, glamor_priv->ebo);
-
- eb_size = GLAMOR_COMPOSITE_VBO_VERT_CNT * sizeof(short) * 2;
-
- eb = XNFalloc(eb_size);
- glamor_init_eb(eb, GLAMOR_COMPOSITE_VBO_VERT_CNT);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, eb_size, eb, GL_STATIC_DRAW);
- free(eb);
-}
-
-void
-glamor_fini_composite_shaders(ScreenPtr screen)
-{
- glamor_screen_private *glamor_priv;
- glamor_composite_shader *shader;
- int i, j, k;
-
- glamor_priv = glamor_get_screen_private(screen);
- glamor_make_current(glamor_priv);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- glDeleteBuffers(1, &glamor_priv->ebo);
-
- for (i = 0; i < SHADER_SOURCE_COUNT; i++)
- for (j = 0; j < SHADER_MASK_COUNT; j++)
- for (k = 0; k < SHADER_IN_COUNT; k++) {
- shader = &glamor_priv->composite_shader[i][j][k];
- if (shader->prog)
- glDeleteProgram(shader->prog);
- }
-}
-
static Bool
glamor_set_composite_op(ScreenPtr screen,
CARD8 op, struct blendinfo *op_info_result,
- PicturePtr dest, PicturePtr mask)
+ PicturePtr dest, PicturePtr mask,
+ enum ca_state ca_state,
+ struct shader_key *key)
{
GLenum source_blend, dest_blend;
struct blendinfo *op_info;
@@ -448,6 +442,7 @@ glamor_set_composite_op(ScreenPtr screen,
glamor_fallback("unsupported render op %d \n", op);
return GL_FALSE;
}
+
op_info = &composite_op_info[op];
source_blend = op_info->source_blend;
@@ -464,12 +459,33 @@ glamor_set_composite_op(ScreenPtr screen,
}
/* Set up the source alpha value for blending in component alpha mode. */
- if (mask && mask->componentAlpha
- && PICT_FORMAT_RGB(mask->format) != 0 && op_info->source_alpha) {
- if (dest_blend == GL_SRC_ALPHA)
+ if (ca_state == CA_DUAL_BLEND) {
+ switch (dest_blend) {
+ case GL_SRC_ALPHA:
+ dest_blend = GL_SRC1_COLOR;
+ break;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ dest_blend = GL_ONE_MINUS_SRC1_COLOR;
+ break;
+ }
+ } else if (mask && mask->componentAlpha
+ && PICT_FORMAT_RGB(mask->format) != 0 && op_info->source_alpha) {
+ switch (dest_blend) {
+ case GL_SRC_ALPHA:
dest_blend = GL_SRC_COLOR;
- else if (dest_blend == GL_ONE_MINUS_SRC_ALPHA)
+ break;
+ case GL_ONE_MINUS_SRC_ALPHA:
dest_blend = GL_ONE_MINUS_SRC_COLOR;
+ break;
+ }
+ }
+
+ /* If we're outputting our alpha to the red channel, then any
+ * reads of alpha for blending need to come from the red channel.
+ */
+ if (key->dest_swizzle == SHADER_DEST_SWIZZLE_ALPHA_TO_RED) {
+ source_blend = glamor_translate_blend_alpha_to_red(source_blend);
+ dest_blend = glamor_translate_blend_alpha_to_red(dest_blend);
}
op_info_result->source_blend = source_blend;
@@ -483,15 +499,16 @@ glamor_set_composite_op(ScreenPtr screen,
static void
glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit,
PicturePtr picture,
- glamor_pixmap_private *pixmap_priv,
+ PixmapPtr pixmap,
GLuint wh_location, GLuint repeat_location)
{
+ glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
float wh[4];
int repeat_type;
glamor_make_current(glamor_priv);
glActiveTexture(GL_TEXTURE0 + unit);
- glBindTexture(GL_TEXTURE_2D, pixmap_priv->base.fbo->tex);
+ glBindTexture(GL_TEXTURE_2D, pixmap_priv->fbo->tex);
repeat_type = picture->repeatType;
switch (picture->repeatType) {
case RepeatNone:
@@ -539,23 +556,15 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit,
* GLES2 doesn't support RepeatNone. We need to fix it anyway.
*
**/
- if (repeat_type != RepeatNone)
+ if (glamor_pixmap_priv_is_large(pixmap_priv) ||
+ (glamor_priv->gl_flavor == GLAMOR_GL_ES2 && repeat_type == RepeatNone &&
+ picture->transform)) {
+ glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap, pixmap_priv);
+ glUniform4fv(wh_location, 1, wh);
+
repeat_type += RepeatFix;
- else if (glamor_priv->gl_flavor == GLAMOR_GL_ES2
- || pixmap_priv->type == GLAMOR_TEXTURE_LARGE) {
- if (picture->transform
- || (GLAMOR_PIXMAP_FBO_NOT_EXACT_SIZE(pixmap_priv)))
- repeat_type += RepeatFix;
- }
- if (repeat_type >= RepeatFix) {
- glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap_priv);
- if ((wh[0] != 1.0 || wh[1] != 1.0)
- || (glamor_priv->gl_flavor == GLAMOR_GL_ES2
- && repeat_type == RepeatFix))
- glUniform4fv(wh_location, 1, wh);
- else
- repeat_type -= RepeatFix;
}
+
glUniform1i(repeat_location, repeat_type);
}
@@ -565,33 +574,6 @@ glamor_set_composite_solid(float *color, GLint uniform_location)
glUniform4fv(uniform_location, 1, color);
}
-static int
-compatible_formats(CARD8 op, PicturePtr dst, PicturePtr src)
-{
- if (op == PictOpSrc) {
- if (src->format == dst->format)
- return 1;
-
- if (src->format == PICT_a8r8g8b8 && dst->format == PICT_x8r8g8b8)
- return 1;
-
- if (src->format == PICT_a8b8g8r8 && dst->format == PICT_x8b8g8r8)
- return 1;
- }
- else if (op == PictOpOver) {
- if (src->alphaMap || dst->alphaMap)
- return 0;
-
- if (src->format != dst->format)
- return 0;
-
- if (src->format == PICT_x8r8g8b8 || src->format == PICT_x8b8g8r8)
- return 1;
- }
-
- return 0;
-}
-
static char
glamor_get_picture_location(PicturePtr picture)
{
@@ -613,55 +595,7 @@ glamor_get_picture_location(PicturePtr picture)
return glamor_get_drawable_location(picture->pDrawable);
}
-static Bool
-glamor_composite_with_copy(CARD8 op,
- PicturePtr source,
- PicturePtr dest,
- INT16 x_source,
- INT16 y_source,
- INT16 x_dest, INT16 y_dest, RegionPtr region)
-{
- int ret = FALSE;
-
- if (!source->pDrawable)
- return FALSE;
-
- if (!compatible_formats(op, dest, source))
- return FALSE;
-
- if (source->repeat || source->transform) {
- return FALSE;
- }
-
- x_dest += dest->pDrawable->x;
- y_dest += dest->pDrawable->y;
- x_source += source->pDrawable->x;
- y_source += source->pDrawable->y;
- if (PICT_FORMAT_A(source->format) == 0) {
- /* Fallback if we sample outside the source so that we
- * swizzle the correct clear color for out-of-bounds texels.
- */
- if (region->extents.x1 + x_source - x_dest < 0)
- goto cleanup_region;
- if (region->extents.x2 + x_source - x_dest > source->pDrawable->width)
- goto cleanup_region;
-
- if (region->extents.y1 + y_source - y_dest < 0)
- goto cleanup_region;
- if (region->extents.y2 + y_source - y_dest > source->pDrawable->height)
- goto cleanup_region;
- }
- glamor_copy(source->pDrawable,
- dest->pDrawable, NULL,
- RegionRects(region), RegionNumRects(region),
- x_source - x_dest, y_source - y_dest,
- FALSE, FALSE, 0, NULL);
- ret = TRUE;
- cleanup_region:
- return ret;
-}
-
-void *
+static void *
glamor_setup_composite_vbo(ScreenPtr screen, int n_verts)
{
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
@@ -669,7 +603,7 @@ glamor_setup_composite_vbo(ScreenPtr screen, int n_verts)
char *vbo_offset;
float *vb;
- glamor_priv->render_nr_verts = 0;
+ glamor_priv->render_nr_quads = 0;
glamor_priv->vb_stride = 2 * sizeof(float);
if (glamor_priv->has_source_coords)
glamor_priv->vb_stride += 2 * sizeof(float);
@@ -711,27 +645,20 @@ glamor_flush_composite_rects(ScreenPtr screen)
glamor_make_current(glamor_priv);
- if (!glamor_priv->render_nr_verts)
+ if (!glamor_priv->render_nr_quads)
return;
- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) {
- glDrawRangeElements(GL_TRIANGLES, 0, glamor_priv->render_nr_verts,
- (glamor_priv->render_nr_verts * 3) / 2,
- GL_UNSIGNED_SHORT, NULL);
- } else {
- glDrawElements(GL_TRIANGLES, (glamor_priv->render_nr_verts * 3) / 2,
- GL_UNSIGNED_SHORT, NULL);
- }
+ glamor_glDrawArrays_GL_QUADS(glamor_priv, glamor_priv->render_nr_quads);
}
-int pict_format_combine_tab[][3] = {
+static const int pict_format_combine_tab[][3] = {
{PICT_TYPE_ARGB, PICT_TYPE_A, PICT_TYPE_ARGB},
{PICT_TYPE_ABGR, PICT_TYPE_A, PICT_TYPE_ABGR},
};
static Bool
combine_pict_format(PictFormatShort * des, const PictFormatShort src,
- const PictFormatShort mask, enum shader_in in_ca)
+ const PictFormatShort mask, glamor_program_alpha in_ca)
{
PictFormatShort new_vis;
int src_type, mask_type, src_bpp;
@@ -748,20 +675,22 @@ combine_pict_format(PictFormatShort * des, const PictFormatShort src,
new_vis = PICT_FORMAT_VIS(src) | PICT_FORMAT_VIS(mask);
switch (in_ca) {
- case SHADER_IN_SOURCE_ONLY:
- return TRUE;
- case SHADER_IN_NORMAL:
+ case glamor_program_alpha_normal:
src_type = PICT_FORMAT_TYPE(src);
mask_type = PICT_TYPE_A;
break;
- case SHADER_IN_CA_SOURCE:
+ case glamor_program_alpha_ca_first:
src_type = PICT_FORMAT_TYPE(src);
mask_type = PICT_FORMAT_TYPE(mask);
break;
- case SHADER_IN_CA_ALPHA:
+ case glamor_program_alpha_ca_second:
src_type = PICT_TYPE_A;
mask_type = PICT_FORMAT_TYPE(mask);
break;
+ case glamor_program_alpha_dual_blend:
+ src_type = PICT_FORMAT_TYPE(src);
+ mask_type = PICT_FORMAT_TYPE(mask);
+ break;
default:
return FALSE;
}
@@ -771,10 +700,7 @@ combine_pict_format(PictFormatShort * des, const PictFormatShort src,
return TRUE;
}
- for (i = 0;
- i <
- sizeof(pict_format_combine_tab) /
- sizeof(pict_format_combine_tab[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(pict_format_combine_tab); i++) {
if ((src_type == pict_format_combine_tab[i][0]
&& mask_type == pict_format_combine_tab[i][1])
|| (src_type == pict_format_combine_tab[i][1]
@@ -788,7 +714,8 @@ combine_pict_format(PictFormatShort * des, const PictFormatShort src,
}
static void
-glamor_set_normalize_tcoords_generic(glamor_pixmap_private *priv,
+glamor_set_normalize_tcoords_generic(PixmapPtr pixmap,
+ glamor_pixmap_private *priv,
int repeat_type,
float *matrix,
float xscale, float yscale,
@@ -806,36 +733,61 @@ glamor_set_normalize_tcoords_generic(glamor_pixmap_private *priv,
x2, y2,
texcoords, stride);
else if (!matrix && repeat_type != RepeatNone)
- glamor_set_repeat_normalize_tcoords_ext(priv, repeat_type,
+ glamor_set_repeat_normalize_tcoords_ext(pixmap, priv, repeat_type,
xscale, yscale,
x1, y1,
x2, y2,
texcoords, stride);
else if (matrix && repeat_type != RepeatNone)
- glamor_set_repeat_transformed_normalize_tcoords_ext(priv, repeat_type,
+ glamor_set_repeat_transformed_normalize_tcoords_ext(pixmap, priv, repeat_type,
matrix, xscale,
yscale, x1, y1, x2,
y2,
texcoords, stride);
}
-Bool
+/**
+ * Returns whether the general composite path supports this picture
+ * format for a pixmap that is permanently stored in an FBO (as
+ * opposed to the GLAMOR_PIXMAP_DYNAMIC_UPLOAD path).
+ *
+ * We could support many more formats by using GL_ARB_texture_view to
+ * parse the same bits as different formats. For now, we only support
+ * tweaking whether we sample the alpha bits of an a8r8g8b8, or just
+ * force them to 1.
+ */
+static Bool
+glamor_render_format_is_supported(PictFormatShort format)
+{
+ switch (format) {
+ case PICT_a8r8g8b8:
+ case PICT_x8r8g8b8:
+ case PICT_a8:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+static Bool
glamor_composite_choose_shader(CARD8 op,
PicturePtr source,
PicturePtr mask,
PicturePtr dest,
+ PixmapPtr source_pixmap,
+ PixmapPtr mask_pixmap,
+ PixmapPtr dest_pixmap,
glamor_pixmap_private *source_pixmap_priv,
glamor_pixmap_private *mask_pixmap_priv,
glamor_pixmap_private *dest_pixmap_priv,
struct shader_key *s_key,
glamor_composite_shader ** shader,
struct blendinfo *op_info,
- PictFormatShort *psaved_source_format)
+ PictFormatShort *psaved_source_format,
+ enum ca_state ca_state)
{
ScreenPtr screen = dest->pDrawable->pScreen;
- PixmapPtr dest_pixmap = dest_pixmap_priv->base.pixmap;
- PixmapPtr source_pixmap = NULL;
- PixmapPtr mask_pixmap = NULL;
+ 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;
PictFormatShort saved_source_format = 0;
@@ -849,6 +801,11 @@ glamor_composite_choose_shader(CARD8 op,
goto fail;
}
+ if (!glamor_render_format_is_supported(dest->format)) {
+ glamor_fallback("Unsupported dest picture format.\n");
+ goto fail;
+ }
+
memset(&key, 0, sizeof(key));
if (!source) {
key.source = SHADER_SOURCE_SOLID;
@@ -894,17 +851,19 @@ glamor_composite_choose_shader(CARD8 op,
}
if (!mask->componentAlpha) {
- key.in = SHADER_IN_NORMAL;
+ key.in = glamor_program_alpha_normal;
}
else {
if (op == PictOpClear)
key.mask = SHADER_MASK_NONE;
+ else if (glamor_priv->has_dual_blend)
+ key.in = glamor_program_alpha_dual_blend;
else if (op == PictOpSrc || op == PictOpAdd
|| op == PictOpIn || op == PictOpOut
|| op == PictOpOverReverse)
- key.in = SHADER_IN_CA_SOURCE;
+ key.in = glamor_program_alpha_ca_second;
else if (op == PictOpOutReverse || op == PictOpInReverse) {
- key.in = SHADER_IN_CA_ALPHA;
+ key.in = glamor_program_alpha_ca_first;
}
else {
glamor_fallback("Unsupported component alpha op: %d\n", op);
@@ -914,7 +873,13 @@ glamor_composite_choose_shader(CARD8 op,
}
else {
key.mask = SHADER_MASK_NONE;
- key.in = SHADER_IN_SOURCE_ONLY;
+ }
+
+ if (dest_pixmap->drawable.bitsPerPixel <= 8 &&
+ glamor_priv->one_channel_format == GL_RED) {
+ key.dest_swizzle = SHADER_DEST_SWIZZLE_ALPHA_TO_RED;
+ } else {
+ key.dest_swizzle = SHADER_DEST_SWIZZLE_DEFAULT;
}
if (source && source->alphaMap) {
@@ -928,13 +893,12 @@ glamor_composite_choose_shader(CARD8 op,
if (key.source == SHADER_SOURCE_TEXTURE ||
key.source == SHADER_SOURCE_TEXTURE_ALPHA) {
- source_pixmap = source_pixmap_priv->base.pixmap;
if (source_pixmap == dest_pixmap) {
/* XXX source and the dest share the same texture.
* Does it need special handle? */
glamor_fallback("source == dest\n");
}
- if (source_pixmap_priv->base.gl_fbo == GLAMOR_FBO_UNATTACHED) {
+ if (source_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) {
#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
source_status = GLAMOR_UPLOAD_PENDING;
#else
@@ -946,12 +910,11 @@ glamor_composite_choose_shader(CARD8 op,
if (key.mask == SHADER_MASK_TEXTURE ||
key.mask == SHADER_MASK_TEXTURE_ALPHA) {
- mask_pixmap = mask_pixmap_priv->base.pixmap;
if (mask_pixmap == dest_pixmap) {
glamor_fallback("mask == dest\n");
goto fail;
}
- if (mask_pixmap_priv->base.gl_fbo == GLAMOR_FBO_UNATTACHED) {
+ if (mask_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) {
#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
mask_status = GLAMOR_UPLOAD_PENDING;
#else
@@ -976,9 +939,6 @@ glamor_composite_choose_shader(CARD8 op,
goto fail;
}
- if (source->format != saved_source_format) {
- glamor_picture_format_fixup(source, source_pixmap_priv);
- }
/* XXX
* By default, glamor_upload_picture_to_texture will wire alpha to 1
* if one picture doesn't have alpha. So we don't do that again in
@@ -1019,6 +979,11 @@ glamor_composite_choose_shader(CARD8 op,
glamor_fallback("Failed to upload source texture.\n");
goto fail;
}
+ } else {
+ if (!glamor_render_format_is_supported(source->format)) {
+ glamor_fallback("Unsupported source picture format.\n");
+ goto fail;
+ }
}
if (mask_status == GLAMOR_UPLOAD_PENDING) {
@@ -1027,6 +992,11 @@ glamor_composite_choose_shader(CARD8 op,
glamor_fallback("Failed to upload mask texture.\n");
goto fail;
}
+ } else if (mask) {
+ if (!glamor_render_format_is_supported(mask->format)) {
+ glamor_fallback("Unsupported mask picture format.\n");
+ goto fail;
+ }
}
}
#endif
@@ -1041,25 +1011,10 @@ glamor_composite_choose_shader(CARD8 op,
goto fail;
}
- /*Before enter the rendering stage, we need to fixup
- * transformed source and mask, if the transform is not int translate. */
- if (key.source != SHADER_SOURCE_SOLID
- && source->transform
- && !pixman_transform_is_int_translate(source->transform)
- && source_pixmap_priv->type != GLAMOR_TEXTURE_LARGE) {
- if (!glamor_fixup_pixmap_priv(screen, source_pixmap_priv))
- goto fail;
- }
- if (key.mask != SHADER_MASK_NONE && key.mask != SHADER_MASK_SOLID
- && mask->transform
- && !pixman_transform_is_int_translate(mask->transform)
- && mask_pixmap_priv->type != GLAMOR_TEXTURE_LARGE) {
- if (!glamor_fixup_pixmap_priv(screen, mask_pixmap_priv))
- goto fail;
- }
-
- if (!glamor_set_composite_op(screen, op, op_info, dest, mask))
+ if (!glamor_set_composite_op(screen, op, op_info, dest, mask, ca_state,
+ &key)) {
goto fail;
+ }
*shader = glamor_lookup_composite_shader(screen, &key);
if ((*shader)->prog == 0) {
@@ -1071,7 +1026,7 @@ glamor_composite_choose_shader(CARD8 op,
memcpy(&(*shader)->source_solid_color[0],
source_solid_color, 4 * sizeof(float));
else {
- (*shader)->source_priv = source_pixmap_priv;
+ (*shader)->source_pixmap = source_pixmap;
(*shader)->source = source;
}
@@ -1079,7 +1034,7 @@ glamor_composite_choose_shader(CARD8 op,
memcpy(&(*shader)->mask_solid_color[0],
mask_solid_color, 4 * sizeof(float));
else {
- (*shader)->mask_priv = mask_pixmap_priv;
+ (*shader)->mask_pixmap = mask_pixmap;
(*shader)->mask = mask;
}
@@ -1095,16 +1050,13 @@ glamor_composite_choose_shader(CARD8 op,
return ret;
}
-void
-glamor_composite_set_shader_blend(glamor_pixmap_private *dest_priv,
+static void
+glamor_composite_set_shader_blend(glamor_screen_private *glamor_priv,
+ glamor_pixmap_private *dest_priv,
struct shader_key *key,
glamor_composite_shader *shader,
struct blendinfo *op_info)
{
- glamor_screen_private *glamor_priv;
-
- glamor_priv = dest_priv->base.glamor_priv;
-
glamor_make_current(glamor_priv);
glUseProgram(shader->prog);
@@ -1115,7 +1067,7 @@ glamor_composite_set_shader_blend(glamor_pixmap_private *dest_priv,
else {
glamor_set_composite_texture(glamor_priv, 0,
shader->source,
- shader->source_priv, shader->source_wh,
+ shader->source_pixmap, shader->source_wh,
shader->source_repeat_mode);
}
@@ -1127,7 +1079,7 @@ glamor_composite_set_shader_blend(glamor_pixmap_private *dest_priv,
else {
glamor_set_composite_texture(glamor_priv, 1,
shader->mask,
- shader->mask_priv, shader->mask_wh,
+ shader->mask_pixmap, shader->mask_wh,
shader->mask_repeat_mode);
}
}
@@ -1146,17 +1098,17 @@ glamor_composite_with_shader(CARD8 op,
PicturePtr source,
PicturePtr mask,
PicturePtr dest,
+ PixmapPtr source_pixmap,
+ PixmapPtr mask_pixmap,
+ PixmapPtr dest_pixmap,
glamor_pixmap_private *source_pixmap_priv,
glamor_pixmap_private *mask_pixmap_priv,
glamor_pixmap_private *dest_pixmap_priv,
int nrect, glamor_composite_rect_t *rects,
- Bool two_pass_ca)
+ enum ca_state ca_state)
{
ScreenPtr screen = dest->pDrawable->pScreen;
- glamor_screen_private *glamor_priv = dest_pixmap_priv->base.glamor_priv;
- PixmapPtr dest_pixmap = dest_pixmap_priv->base.pixmap;
- PixmapPtr source_pixmap = NULL;
- PixmapPtr mask_pixmap = NULL;
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
GLfloat dst_xscale, dst_yscale;
GLfloat mask_xscale = 1, mask_yscale = 1, src_xscale = 1, src_yscale = 1;
struct shader_key key, key_ca;
@@ -1172,26 +1124,29 @@ glamor_composite_with_shader(CARD8 op,
struct blendinfo op_info, op_info_ca;
if (!glamor_composite_choose_shader(op, source, mask, dest,
+ source_pixmap, mask_pixmap, dest_pixmap,
source_pixmap_priv, mask_pixmap_priv,
dest_pixmap_priv,
&key, &shader, &op_info,
- &saved_source_format)) {
+ &saved_source_format, ca_state)) {
glamor_fallback("glamor_composite_choose_shader failed\n");
return ret;
}
- if (two_pass_ca) {
+ if (ca_state == CA_TWO_PASS) {
if (!glamor_composite_choose_shader(PictOpAdd, source, mask, dest,
+ source_pixmap, mask_pixmap, dest_pixmap,
source_pixmap_priv,
mask_pixmap_priv, dest_pixmap_priv,
&key_ca, &shader_ca, &op_info_ca,
- &saved_source_format)) {
+ &saved_source_format, ca_state)) {
glamor_fallback("glamor_composite_choose_shader failed\n");
return ret;
}
}
- glamor_set_destination_pixmap_priv_nc(dest_pixmap_priv);
- glamor_composite_set_shader_blend(dest_pixmap_priv, &key, shader, &op_info);
+ glamor_set_destination_pixmap_priv_nc(glamor_priv, dest_pixmap, dest_pixmap_priv);
+ glamor_composite_set_shader_blend(glamor_priv, dest_pixmap_priv, &key, shader, &op_info);
+ glamor_set_alu(screen, GXcopy);
glamor_make_current(glamor_priv);
@@ -1203,10 +1158,9 @@ glamor_composite_with_shader(CARD8 op,
dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
glamor_get_drawable_deltas(dest->pDrawable, dest_pixmap,
&dest_x_off, &dest_y_off);
- pixmap_priv_get_dest_scale(dest_pixmap_priv, &dst_xscale, &dst_yscale);
+ pixmap_priv_get_dest_scale(dest_pixmap, dest_pixmap_priv, &dst_xscale, &dst_yscale);
if (glamor_priv->has_source_coords) {
- source_pixmap = source_pixmap_priv->base.pixmap;
glamor_get_drawable_deltas(source->pDrawable,
source_pixmap, &source_x_off, &source_y_off);
pixmap_priv_get_scale(source_pixmap_priv, &src_xscale, &src_yscale);
@@ -1217,7 +1171,6 @@ glamor_composite_with_shader(CARD8 op,
}
if (glamor_priv->has_mask_coords) {
- mask_pixmap = mask_pixmap_priv->base.pixmap;
glamor_get_drawable_deltas(mask->pDrawable, mask_pixmap,
&mask_x_off, &mask_y_off);
pixmap_priv_get_scale(mask_pixmap_priv, &mask_xscale, &mask_yscale);
@@ -1269,7 +1222,8 @@ glamor_composite_with_shader(CARD8 op,
vb_stride);
vertices += 2;
if (key.source != SHADER_SOURCE_SOLID) {
- glamor_set_normalize_tcoords_generic(source_pixmap_priv,
+ glamor_set_normalize_tcoords_generic(source_pixmap,
+ source_pixmap_priv,
source->repeatType,
psrc_matrix, src_xscale,
src_yscale, x_source,
@@ -1280,7 +1234,8 @@ glamor_composite_with_shader(CARD8 op,
}
if (key.mask != SHADER_MASK_NONE && key.mask != SHADER_MASK_SOLID) {
- glamor_set_normalize_tcoords_generic(mask_pixmap_priv,
+ glamor_set_normalize_tcoords_generic(mask_pixmap,
+ mask_pixmap_priv,
mask->repeatType,
pmask_matrix, mask_xscale,
mask_yscale, x_mask,
@@ -1289,7 +1244,7 @@ glamor_composite_with_shader(CARD8 op,
vertices, vb_stride);
vertices += 2;
}
- glamor_priv->render_nr_verts += 4;
+ glamor_priv->render_nr_quads++;
rects++;
/* We've incremented by one of our 4 verts, now do the other 3. */
@@ -1298,12 +1253,12 @@ glamor_composite_with_shader(CARD8 op,
glamor_put_vbo_space(screen);
glamor_flush_composite_rects(screen);
nrect -= rect_processed;
- if (two_pass_ca) {
- glamor_composite_set_shader_blend(dest_pixmap_priv,
+ if (ca_state == CA_TWO_PASS) {
+ glamor_composite_set_shader_blend(glamor_priv, dest_pixmap_priv,
&key_ca, shader_ca, &op_info_ca);
glamor_flush_composite_rects(screen);
if (nrect)
- glamor_composite_set_shader_blend(dest_pixmap_priv,
+ glamor_composite_set_shader_blend(glamor_priv, dest_pixmap_priv,
&key, shader, &op_info);
}
}
@@ -1320,7 +1275,7 @@ glamor_composite_with_shader(CARD8 op,
return ret;
}
-PicturePtr
+static PicturePtr
glamor_convert_gradient_picture(ScreenPtr screen,
PicturePtr source,
int x_source,
@@ -1329,12 +1284,17 @@ glamor_convert_gradient_picture(ScreenPtr screen,
PixmapPtr pixmap;
PicturePtr dst = NULL;
int error;
+ PictFormatPtr pFormat;
PictFormatShort format;
- if (!source->pDrawable)
+ if (source->pDrawable) {
+ pFormat = source->pFormat;
+ format = pFormat->format;
+ } else {
format = PICT_a8r8g8b8;
- else
- format = source->format;
+ pFormat = PictureMatchFormat(screen, 32, format);
+ }
+
#ifdef GLAMOR_GRADIENT_SHADER
if (!source->pDrawable) {
if (source->pSourcePict->type == SourcePictTypeLinear) {
@@ -1370,10 +1330,7 @@ glamor_convert_gradient_picture(ScreenPtr screen,
return NULL;
dst = CreatePicture(0,
- &pixmap->drawable,
- PictureMatchFormat(screen,
- PIXMAN_FORMAT_DEPTH(format),
- format), 0, 0, serverClient, &error);
+ &pixmap->drawable, pFormat, 0, 0, serverClient, &error);
glamor_destroy_pixmap(pixmap);
if (!dst)
return NULL;
@@ -1390,18 +1347,22 @@ glamor_composite_clipped_region(CARD8 op,
PicturePtr source,
PicturePtr mask,
PicturePtr dest,
- glamor_pixmap_private *source_pixmap_priv,
- glamor_pixmap_private *mask_pixmap_priv,
- glamor_pixmap_private *dest_pixmap_priv,
+ PixmapPtr source_pixmap,
+ PixmapPtr mask_pixmap,
+ PixmapPtr dest_pixmap,
RegionPtr region,
int x_source,
int y_source,
int x_mask, int y_mask, int x_dest, int y_dest)
{
+ glamor_pixmap_private *source_pixmap_priv = glamor_get_pixmap_private(source_pixmap);
+ glamor_pixmap_private *mask_pixmap_priv = glamor_get_pixmap_private(mask_pixmap);
+ glamor_pixmap_private *dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(dest_pixmap->drawable.pScreen);
ScreenPtr screen = dest->pDrawable->pScreen;
- PixmapPtr source_pixmap = NULL, mask_pixmap = NULL;
- PixmapPtr dest_pixmap = glamor_get_drawable_pixmap(dest->pDrawable);
PicturePtr temp_src = source, temp_mask = mask;
+ PixmapPtr temp_src_pixmap = source_pixmap;
+ PixmapPtr temp_mask_pixmap = mask_pixmap;
glamor_pixmap_private *temp_src_priv = source_pixmap_priv;
glamor_pixmap_private *temp_mask_priv = mask_pixmap_priv;
int x_temp_src, y_temp_src, x_temp_mask, y_temp_mask;
@@ -1415,7 +1376,7 @@ glamor_composite_clipped_region(CARD8 op,
int height;
BoxPtr box;
int nbox;
- Bool two_pass_ca = FALSE;
+ enum ca_state ca_state = CA_NONE;
extent = RegionExtents(region);
box = RegionRects(region);
@@ -1431,12 +1392,6 @@ glamor_composite_clipped_region(CARD8 op,
DEBUGF("clipped (%d %d) (%d %d) (%d %d) width %d height %d \n",
x_source, y_source, x_mask, y_mask, x_dest, y_dest, width, height);
- if (source_pixmap_priv)
- source_pixmap = source_pixmap_priv->base.pixmap;
-
- if (mask_pixmap_priv)
- mask_pixmap = mask_pixmap_priv->base.pixmap;
-
/* XXX is it possible source mask have non-zero drawable.x/y? */
if (source
&& ((!source->pDrawable
@@ -1454,8 +1409,8 @@ glamor_composite_clipped_region(CARD8 op,
temp_src = source;
goto out;
}
- temp_src_priv =
- glamor_get_pixmap_private((PixmapPtr) (temp_src->pDrawable));
+ temp_src_pixmap = (PixmapPtr) (temp_src->pDrawable);
+ temp_src_priv = glamor_get_pixmap_private(temp_src_pixmap);
x_temp_src = -extent->x1 + x_dest + dest->pDrawable->x;
y_temp_src = -extent->y1 + y_dest + dest->pDrawable->y;
}
@@ -1478,36 +1433,28 @@ glamor_composite_clipped_region(CARD8 op,
temp_mask = mask;
goto out;
}
- temp_mask_priv =
- glamor_get_pixmap_private((PixmapPtr) (temp_mask->pDrawable));
+ temp_mask_pixmap = (PixmapPtr) (temp_mask->pDrawable);
+ temp_mask_priv = glamor_get_pixmap_private(temp_mask_pixmap);
x_temp_mask = -extent->x1 + x_dest + dest->pDrawable->x;
y_temp_mask = -extent->y1 + y_dest + dest->pDrawable->y;
}
- /* Do two-pass PictOpOver componentAlpha, until we enable
- * dual source color blending.
- */
if (mask && mask->componentAlpha) {
- if (op == PictOpOver) {
- two_pass_ca = TRUE;
- op = PictOpOutReverse;
- }
- }
-
- if (!mask && temp_src) {
- if (glamor_composite_with_copy(op, temp_src, dest,
- x_temp_src, y_temp_src,
- x_dest, y_dest, region)) {
- ok = TRUE;
- goto out;
+ if (glamor_priv->has_dual_blend) {
+ ca_state = CA_DUAL_BLEND;
+ } else {
+ if (op == PictOpOver) {
+ ca_state = CA_TWO_PASS;
+ op = PictOpOutReverse;
+ }
}
}
- if (source_pixmap == dest_pixmap) {
+ if (temp_src_pixmap == dest_pixmap) {
glamor_fallback("source and dest pixmaps are the same\n");
goto out;
}
- if (mask_pixmap == dest_pixmap) {
+ if (temp_mask_pixmap == dest_pixmap) {
glamor_fallback("mask and dest pixmaps are the same\n");
goto out;
}
@@ -1548,9 +1495,10 @@ glamor_composite_clipped_region(CARD8 op,
DEBUGF("dest %d %d \n", prect[i].x_dst, prect[i].y_dst);
}
ok = glamor_composite_with_shader(op, temp_src, temp_mask, dest,
+ temp_src_pixmap, temp_mask_pixmap, dest_pixmap,
temp_src_priv, temp_mask_priv,
dest_pixmap_priv,
- box_cnt, prect, two_pass_ca);
+ box_cnt, prect, ca_state);
if (!ok)
break;
nbox -= box_cnt;
@@ -1568,43 +1516,35 @@ glamor_composite_clipped_region(CARD8 op,
return ok;
}
-static Bool
-_glamor_composite(CARD8 op,
- PicturePtr source,
- PicturePtr mask,
- PicturePtr dest,
- INT16 x_source,
- INT16 y_source,
- INT16 x_mask,
- INT16 y_mask,
- INT16 x_dest, INT16 y_dest,
- CARD16 width, CARD16 height, Bool fallback)
+void
+glamor_composite(CARD8 op,
+ PicturePtr source,
+ PicturePtr mask,
+ PicturePtr dest,
+ INT16 x_source,
+ INT16 y_source,
+ INT16 x_mask,
+ INT16 y_mask,
+ INT16 x_dest, INT16 y_dest, CARD16 width, CARD16 height)
{
ScreenPtr screen = dest->pDrawable->pScreen;
- glamor_pixmap_private *dest_pixmap_priv;
- glamor_pixmap_private *source_pixmap_priv = NULL, *mask_pixmap_priv = NULL;
PixmapPtr dest_pixmap = glamor_get_drawable_pixmap(dest->pDrawable);
PixmapPtr source_pixmap = NULL, mask_pixmap = NULL;
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
- Bool ret = TRUE;
RegionRec region;
BoxPtr extent;
int nbox, ok = FALSE;
int force_clip = 0;
- dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
-
if (source->pDrawable) {
source_pixmap = glamor_get_drawable_pixmap(source->pDrawable);
- source_pixmap_priv = glamor_get_pixmap_private(source_pixmap);
- if (source_pixmap_priv && source_pixmap_priv->type == GLAMOR_DRM_ONLY)
+ if (glamor_pixmap_drm_only(source_pixmap))
goto fail;
}
if (mask && mask->pDrawable) {
mask_pixmap = glamor_get_drawable_pixmap(mask->pDrawable);
- mask_pixmap_priv = glamor_get_pixmap_private(mask_pixmap);
- if (mask_pixmap_priv && mask_pixmap_priv->type == GLAMOR_DRM_ONLY)
+ if (glamor_pixmap_drm_only(mask_pixmap))
goto fail;
}
@@ -1613,14 +1553,15 @@ _glamor_composite(CARD8 op,
source_pixmap, x_source, y_source, x_mask, y_mask, x_dest, y_dest,
width, height);
- if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dest_pixmap_priv)) {
+ if (!glamor_pixmap_has_fbo(dest_pixmap))
goto fail;
- }
- if (op >= ARRAY_SIZE(composite_op_info))
+ if (op >= ARRAY_SIZE(composite_op_info)) {
+ glamor_fallback("Unsupported composite op %x\n", op);
goto fail;
+ }
- if (mask && mask->componentAlpha) {
+ if (mask && mask->componentAlpha && !glamor_priv->has_dual_blend) {
if (op == PictOpAtop
|| op == PictOpAtopReverse
|| op == PictOpXor || op >= PictOpSaturate) {
@@ -1647,18 +1588,16 @@ _glamor_composite(CARD8 op,
(mask_pixmap ? mask->pDrawable->y : 0),
x_dest + dest->pDrawable->x,
y_dest + dest->pDrawable->y, width, height)) {
- ret = TRUE;
- goto done;
+ return;
}
nbox = REGION_NUM_RECTS(&region);
DEBUGF("first clipped when compositing.\n");
DEBUGRegionPrint(&region);
extent = RegionExtents(&region);
- if (nbox == 0) {
- ret = TRUE;
- goto done;
- }
+ if (nbox == 0)
+ return;
+
/* If destination is not a large pixmap, but the region is larger
* than texture size limitation, and source or mask is memory pixmap,
* then there may be need to load a large memory pixmap to a
@@ -1667,28 +1606,28 @@ _glamor_composite(CARD8 op,
* pixmap. */
if (!glamor_check_fbo_size(glamor_priv,
extent->x2 - extent->x1, extent->y2 - extent->y1)
- && (dest_pixmap_priv->type != GLAMOR_TEXTURE_LARGE)
- && ((source_pixmap_priv
- && (source_pixmap_priv->type == GLAMOR_MEMORY ||
+ && glamor_pixmap_is_large(dest_pixmap)
+ && ((source_pixmap
+ && (glamor_pixmap_is_memory(source_pixmap) ||
source->repeatType == RepeatPad))
- || (mask_pixmap_priv &&
- (mask_pixmap_priv->type == GLAMOR_MEMORY ||
+ || (mask_pixmap &&
+ (glamor_pixmap_is_memory(mask_pixmap) ||
mask->repeatType == RepeatPad))
- || (!source_pixmap_priv &&
+ || (!source_pixmap &&
(source->pSourcePict->type != SourcePictTypeSolidFill))
- || (!mask_pixmap_priv && mask &&
+ || (!mask_pixmap && mask &&
mask->pSourcePict->type != SourcePictTypeSolidFill)))
force_clip = 1;
- if (force_clip || dest_pixmap_priv->type == GLAMOR_TEXTURE_LARGE
- || (source_pixmap_priv
- && source_pixmap_priv->type == GLAMOR_TEXTURE_LARGE)
- || (mask_pixmap_priv && mask_pixmap_priv->type == GLAMOR_TEXTURE_LARGE))
+ if (force_clip || glamor_pixmap_is_large(dest_pixmap)
+ || (source_pixmap
+ && glamor_pixmap_is_large(source_pixmap))
+ || (mask_pixmap && glamor_pixmap_is_large(mask_pixmap)))
ok = glamor_composite_largepixmap_region(op,
source, mask, dest,
- source_pixmap_priv,
- mask_pixmap_priv,
- dest_pixmap_priv,
+ source_pixmap,
+ mask_pixmap,
+ dest_pixmap,
&region, force_clip,
x_source, y_source,
x_mask, y_mask,
@@ -1696,9 +1635,9 @@ _glamor_composite(CARD8 op,
else
ok = glamor_composite_clipped_region(op, source,
mask, dest,
- source_pixmap_priv,
- mask_pixmap_priv,
- dest_pixmap_priv,
+ source_pixmap,
+ mask_pixmap,
+ dest_pixmap,
&region,
x_source, y_source,
x_mask, y_mask, x_dest, y_dest);
@@ -1706,17 +1645,9 @@ _glamor_composite(CARD8 op,
REGION_UNINIT(dest->pDrawable->pScreen, &region);
if (ok)
- goto done;
- fail:
+ return;
- if (!fallback && glamor_ddx_fallback_check_pixmap(&dest_pixmap->drawable)
- && (!source_pixmap
- || glamor_ddx_fallback_check_pixmap(&source_pixmap->drawable))
- && (!mask_pixmap
- || glamor_ddx_fallback_check_pixmap(&mask_pixmap->drawable))) {
- ret = FALSE;
- goto done;
- }
+ fail:
glamor_fallback
("from picts %p:%p %dx%d / %p:%p %d x %d (%c,%c) to pict %p:%p %dx%d (%c)\n",
@@ -1747,192 +1678,4 @@ _glamor_composite(CARD8 op,
glamor_finish_access_picture(mask);
glamor_finish_access_picture(source);
glamor_finish_access_picture(dest);
-
- done:
- return ret;
}
-
-void
-glamor_composite(CARD8 op,
- PicturePtr source,
- PicturePtr mask,
- PicturePtr dest,
- INT16 x_source,
- INT16 y_source,
- INT16 x_mask,
- INT16 y_mask,
- INT16 x_dest, INT16 y_dest, CARD16 width, CARD16 height)
-{
- _glamor_composite(op, source, mask, dest, x_source, y_source,
- x_mask, y_mask, x_dest, y_dest, width, height, TRUE);
-}
-
-Bool
-glamor_composite_nf(CARD8 op,
- PicturePtr source,
- PicturePtr mask,
- PicturePtr dest,
- INT16 x_source,
- INT16 y_source,
- INT16 x_mask,
- INT16 y_mask,
- INT16 x_dest, INT16 y_dest, CARD16 width, CARD16 height)
-{
- return _glamor_composite(op, source, mask, dest, x_source, y_source,
- x_mask, y_mask, x_dest, y_dest, width, height,
- FALSE);
-}
-
-static void
-glamor_get_src_rect_extent(int nrect,
- glamor_composite_rect_t *rects, BoxPtr extent)
-{
- extent->x1 = MAXSHORT;
- extent->y1 = MAXSHORT;
- extent->x2 = MINSHORT;
- extent->y2 = MINSHORT;
-
- while (nrect--) {
- if (extent->x1 > rects->x_src)
- extent->x1 = rects->x_src;
- if (extent->y1 > rects->y_src)
- extent->y1 = rects->y_src;
- if (extent->x2 < rects->x_src + rects->width)
- extent->x2 = rects->x_src + rects->width;
- if (extent->y2 < rects->y_src + rects->height)
- extent->y2 = rects->y_src + rects->height;
- rects++;
- }
-}
-
-static void
-glamor_composite_src_rect_translate(int nrect,
- glamor_composite_rect_t *rects,
- int x, int y)
-{
- while (nrect--) {
- rects->x_src += x;
- rects->y_src += y;
- rects++;
- }
-}
-
-void
-glamor_composite_glyph_rects(CARD8 op,
- PicturePtr src, PicturePtr mask, PicturePtr dst,
- int nrect, glamor_composite_rect_t *rects)
-{
- int n;
- PicturePtr temp_src = NULL;
- glamor_composite_rect_t *r;
-
- ValidatePicture(src);
- ValidatePicture(dst);
- if (!(glamor_is_large_picture(src)
- || (mask && glamor_is_large_picture(mask))
- || glamor_is_large_picture(dst))) {
- glamor_pixmap_private *src_pixmap_priv = NULL;
- glamor_pixmap_private *mask_pixmap_priv = NULL;
- glamor_pixmap_private *dst_pixmap_priv;
- glamor_pixmap_private *temp_src_priv = NULL;
- BoxRec src_extent;
-
- dst_pixmap_priv = glamor_get_pixmap_private
- (glamor_get_drawable_pixmap(dst->pDrawable));
-
- if (mask && mask->pDrawable)
- mask_pixmap_priv = glamor_get_pixmap_private
- (glamor_get_drawable_pixmap(mask->pDrawable));
- if (src->pDrawable)
- src_pixmap_priv = glamor_get_pixmap_private
- (glamor_get_drawable_pixmap(src->pDrawable));
-
- if (!src->pDrawable
- && (src->pSourcePict->type != SourcePictTypeSolidFill)) {
- glamor_get_src_rect_extent(nrect, rects, &src_extent);
- temp_src = glamor_convert_gradient_picture(dst->pDrawable->pScreen,
- src,
- src_extent.x1,
- src_extent.y1,
- src_extent.x2 -
- src_extent.x1,
- src_extent.y2 -
- src_extent.y1);
- if (!temp_src)
- goto fallback;
-
- temp_src_priv = glamor_get_pixmap_private
- ((PixmapPtr) (temp_src->pDrawable));
- glamor_composite_src_rect_translate(nrect, rects,
- -src_extent.x1, -src_extent.y1);
- }
- else {
- temp_src = src;
- temp_src_priv = src_pixmap_priv;
- }
-
- if (mask && mask->componentAlpha) {
- if (op == PictOpOver) {
- if (glamor_composite_with_shader(PictOpOutReverse,
- temp_src, mask, dst,
- temp_src_priv,
- mask_pixmap_priv,
- dst_pixmap_priv, nrect, rects,
- TRUE))
- goto done;
- }
- }
- else {
- if (glamor_composite_with_shader
- (op, temp_src, mask, dst, temp_src_priv, mask_pixmap_priv,
- dst_pixmap_priv, nrect, rects, FALSE))
- goto done;
- }
- }
- fallback:
- n = nrect;
- r = rects;
-
- while (n--) {
- CompositePicture(op,
- temp_src ? temp_src : src,
- mask,
- dst,
- r->x_src, r->y_src,
- r->x_mask, r->y_mask,
- r->x_dst, r->y_dst, r->width, r->height);
- r++;
- }
-
- done:
- if (temp_src && temp_src != src)
- FreePicture(temp_src, 0);
-}
-
-static Bool
-_glamor_composite_rects(CARD8 op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect, xRectangle *rects, Bool fallback)
-{
- miCompositeRects(op, pDst, color, nRect, rects);
- return TRUE;
-}
-
-void
-glamor_composite_rects(CARD8 op,
- PicturePtr pDst,
- xRenderColor *color, int nRect, xRectangle *rects)
-{
- _glamor_composite_rects(op, pDst, color, nRect, rects, TRUE);
-}
-
-Bool
-glamor_composite_rects_nf(CARD8 op,
- PicturePtr pDst,
- xRenderColor *color, int nRect, xRectangle *rects)
-{
- return _glamor_composite_rects(op, pDst, color, nRect, rects, FALSE);
-}
-
-#endif /* RENDER */
diff --git a/xserver/glamor/glamor_segs.c b/xserver/glamor/glamor_segs.c
index ff0daef10..5fffa3b0f 100644
--- a/xserver/glamor/glamor_segs.c
+++ b/xserver/glamor/glamor_segs.c
@@ -44,7 +44,7 @@ glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc,
int off_x, off_y;
xSegment *v;
char *vbo_offset;
- int box_x, box_y;
+ int box_index;
int add_last;
pixmap_priv = glamor_get_pixmap_private(pixmap);
@@ -91,11 +91,11 @@ glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc,
glEnable(GL_SCISSOR_TEST);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+ glamor_pixmap_loop(pixmap_priv, box_index) {
int nbox = RegionNumRects(gc->pCompositeClip);
BoxPtr box = RegionRects(gc->pCompositeClip);
- glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, TRUE,
+ glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE,
prog->matrix_uniform, &off_x, &off_y);
while (nbox--) {
@@ -109,12 +109,10 @@ glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc,
}
glDisable(GL_SCISSOR_TEST);
- glDisable(GL_COLOR_LOGIC_OP);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
return TRUE;
bail_ctx:
- glDisable(GL_COLOR_LOGIC_OP);
bail:
return FALSE;
}
@@ -168,21 +166,3 @@ glamor_poly_segment(DrawablePtr drawable, GCPtr gc,
glamor_poly_segment_bail(drawable, gc, nseg, segs);
}
-
-Bool
-glamor_poly_segment_nf(DrawablePtr drawable, GCPtr gc,
- int nseg, xSegment *segs)
-{
- if (glamor_poly_segment_gl(drawable, gc, nseg, segs))
- return TRUE;
-
- if (glamor_ddx_fallback_check_pixmap(drawable) &&
- glamor_ddx_fallback_check_gc(gc))
- {
- return FALSE;
- }
-
- glamor_poly_segment_bail(drawable, gc, nseg, segs);
- return TRUE;
-}
-
diff --git a/xserver/glamor/glamor_spans.c b/xserver/glamor/glamor_spans.c
index 6ebb12e18..89a9c5102 100644
--- a/xserver/glamor/glamor_spans.c
+++ b/xserver/glamor/glamor_spans.c
@@ -55,7 +55,7 @@ glamor_fill_spans_gl(DrawablePtr drawable,
GLshort *v;
char *vbo_offset;
int c;
- int box_x, box_y;
+ int box_index;
pixmap_priv = glamor_get_pixmap_private(pixmap);
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
@@ -68,7 +68,7 @@ glamor_fill_spans_gl(DrawablePtr drawable,
&glamor_facet_fillspans_130);
if (!prog)
- goto bail_ctx;
+ goto bail;
/* Set up the vertex buffers for the points */
@@ -93,7 +93,7 @@ glamor_fill_spans_gl(DrawablePtr drawable,
&glamor_facet_fillspans_120);
if (!prog)
- goto bail_ctx;
+ goto bail;
/* Set up the vertex buffers for the points */
@@ -119,11 +119,12 @@ glamor_fill_spans_gl(DrawablePtr drawable,
glEnable(GL_SCISSOR_TEST);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+ glamor_pixmap_loop(pixmap_priv, box_index) {
int nbox = RegionNumRects(gc->pCompositeClip);
BoxPtr box = RegionRects(gc->pCompositeClip);
- glamor_set_destination_drawable(drawable, box_x, box_y, FALSE, FALSE, prog->matrix_uniform, &off_x, &off_y);
+ glamor_set_destination_drawable(drawable, box_index, FALSE, FALSE,
+ prog->matrix_uniform, &off_x, &off_y);
while (nbox--) {
glScissor(box->x1 + off_x,
@@ -134,27 +135,17 @@ glamor_fill_spans_gl(DrawablePtr drawable,
if (glamor_priv->glsl_version >= 130)
glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, n);
else {
- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) {
- glDrawArrays(GL_QUADS, 0, 4 * n);
- } else {
- int i;
- for (i = 0; i < n; i++) {
- glDrawArrays(GL_TRIANGLE_FAN, i * 4, 4);
- }
- }
+ glamor_glDrawArrays_GL_QUADS(glamor_priv, nbox);
}
}
}
glDisable(GL_SCISSOR_TEST);
- glDisable(GL_COLOR_LOGIC_OP);
if (glamor_priv->glsl_version >= 130)
glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
return TRUE;
-bail_ctx:
- glDisable(GL_COLOR_LOGIC_OP);
bail:
return FALSE;
}
@@ -182,21 +173,6 @@ glamor_fill_spans(DrawablePtr drawable,
glamor_fill_spans_bail(drawable, gc, n, points, widths, sorted);
}
-Bool
-glamor_fill_spans_nf(DrawablePtr drawable,
- GCPtr gc,
- int n, DDXPointPtr points, int *widths, int sorted)
-{
- if (glamor_fill_spans_gl(drawable, gc, n, points, widths, sorted))
- return TRUE;
-
- if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc))
- return FALSE;
-
- glamor_fill_spans_bail(drawable, gc, n, points, widths, sorted);
- return TRUE;
-}
-
static Bool
glamor_get_spans_gl(DrawablePtr drawable, int wmax,
DDXPointPtr points, int *widths, int count, char *dst)
@@ -205,7 +181,7 @@ glamor_get_spans_gl(DrawablePtr drawable, int wmax,
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
glamor_pixmap_private *pixmap_priv;
- int box_x, box_y;
+ int box_index;
int n;
char *d;
GLenum type;
@@ -222,9 +198,9 @@ glamor_get_spans_gl(DrawablePtr drawable, int wmax,
glamor_make_current(glamor_priv);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
- BoxPtr box = glamor_pixmap_box_at(pixmap_priv, box_x, box_y);
- glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(pixmap_priv, box_x, box_y);
+ glamor_pixmap_loop(pixmap_priv, box_index) {
+ BoxPtr box = glamor_pixmap_box_at(pixmap_priv, box_index);
+ glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(pixmap_priv, box_index);
glBindFramebuffer(GL_FRAMEBUFFER, fbo->fb);
glPixelStorei(GL_PACK_ALIGNMENT, 4);
@@ -282,20 +258,6 @@ glamor_get_spans(DrawablePtr drawable, int wmax,
glamor_get_spans_bail(drawable, wmax, points, widths, count, dst);
}
-Bool
-glamor_get_spans_nf(DrawablePtr drawable, int wmax,
- DDXPointPtr points, int *widths, int count, char *dst)
-{
- if (glamor_get_spans_gl(drawable, wmax, points, widths, count, dst))
- return TRUE;
-
- if (glamor_ddx_fallback_check_pixmap(drawable))
- return FALSE;
-
- glamor_get_spans_bail(drawable, wmax, points, widths, count, dst);
- return TRUE;
-}
-
static Bool
glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src,
DDXPointPtr points, int *widths, int numPoints, int sorted)
@@ -304,7 +266,7 @@ glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src,
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
glamor_pixmap_private *pixmap_priv;
- int box_x, box_y;
+ int box_index;
int n;
char *s;
GLenum type;
@@ -318,7 +280,7 @@ glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src,
if (gc->alu != GXcopy)
goto bail;
- if (!glamor_pm_is_solid(&pixmap->drawable, gc->planemask))
+ if (!glamor_pm_is_solid(gc->depth, gc->planemask))
goto bail;
glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y);
@@ -328,9 +290,9 @@ glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src,
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
- BoxPtr box = glamor_pixmap_box_at(pixmap_priv, box_x, box_y);
- glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(pixmap_priv, box_x, box_y);
+ glamor_pixmap_loop(pixmap_priv, box_index) {
+ BoxPtr box = glamor_pixmap_box_at(pixmap_priv, box_index);
+ glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(pixmap_priv, box_index);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, fbo->tex);
@@ -415,17 +377,3 @@ glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
return;
glamor_set_spans_bail(drawable, gc, src, points, widths, numPoints, sorted);
}
-
-Bool
-glamor_set_spans_nf(DrawablePtr drawable, GCPtr gc, char *src,
- DDXPointPtr points, int *widths, int numPoints, int sorted)
-{
- if (glamor_set_spans_gl(drawable, gc, src, points, widths, numPoints, sorted))
- return TRUE;
-
- if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc))
- return FALSE;
-
- glamor_set_spans_bail(drawable, gc, src, points, widths, numPoints, sorted);
- return TRUE;
-}
diff --git a/xserver/glamor/glamor_text.c b/xserver/glamor/glamor_text.c
index 59cd0fdc8..c305305f4 100644
--- a/xserver/glamor/glamor_text.c
+++ b/xserver/glamor/glamor_text.c
@@ -107,7 +107,7 @@ glamor_text(DrawablePtr drawable, GCPtr gc,
int firstCol = font->info.firstCol;
int glyph_spacing_x = glamor_font->glyph_width_bytes * 8;
int glyph_spacing_y = glamor_font->glyph_height;
- int box_x, box_y;
+ int box_index;
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
@@ -142,7 +142,7 @@ glamor_text(DrawablePtr drawable, GCPtr gc,
int height = GLYPHHEIGHTPIXELS(ci);
int tx, ty = 0;
int row = 0, col;
-
+ int second_row = 0;
x += ci->metrics.characterWidth;
if (sixteen) {
@@ -153,8 +153,10 @@ glamor_text(DrawablePtr drawable, GCPtr gc,
row = chars[0];
col = chars[1];
}
- if (FONTLASTROW(font) != 0)
- ty = (row - firstRow) * glyph_spacing_y;
+ if (FONTLASTROW(font) != 0) {
+ ty = ((row - firstRow) / 2) * glyph_spacing_y;
+ second_row = (row - firstRow) & 1;
+ }
else
col += row << 8;
} else {
@@ -165,6 +167,8 @@ glamor_text(DrawablePtr drawable, GCPtr gc,
}
tx = (col - firstCol) * glyph_spacing_x;
+ /* adjust for second row layout */
+ tx += second_row * glamor_font->row_width * 8;
v[ 0] = x1;
v[ 1] = y1;
@@ -184,11 +188,13 @@ glamor_text(DrawablePtr drawable, GCPtr gc,
glEnable(GL_SCISSOR_TEST);
- glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+ glamor_pixmap_loop(pixmap_priv, box_index) {
BoxPtr box = RegionRects(gc->pCompositeClip);
int nbox = RegionNumRects(gc->pCompositeClip);
- glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, FALSE, prog->matrix_uniform, &off_x, &off_y);
+ glamor_set_destination_drawable(drawable, box_index, TRUE, FALSE,
+ prog->matrix_uniform,
+ &off_x, &off_y);
/* Run over the clip list, drawing the glyphs
* in each box
@@ -210,7 +216,6 @@ glamor_text(DrawablePtr drawable, GCPtr gc,
glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
- glDisable(GL_COLOR_LOGIC_OP);
return x;
}
@@ -286,34 +291,18 @@ glamor_poly_text(DrawablePtr drawable, GCPtr gc,
prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_text_progs, &glamor_facet_poly_text);
if (!prog)
- goto bail_ctx;
+ goto bail;
x = glamor_text(drawable, gc, glamor_font, prog,
x, y, count, chars, charinfo, sixteen);
- glDisable(GL_COLOR_LOGIC_OP);
-
*final_pos = x;
return TRUE;
-bail_ctx:
- glDisable(GL_COLOR_LOGIC_OP);
bail:
return FALSE;
}
-Bool
-glamor_poly_text8_nf(DrawablePtr drawable, GCPtr gc,
- int x, int y, int count, char *chars, int *final_pos)
-{
- if (glamor_poly_text(drawable, gc, x, y, count, chars, FALSE, final_pos))
- return TRUE;
- if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc))
- return FALSE;
- *final_pos = miPolyText8(drawable, gc, x, y, count, chars);
- return TRUE;
-}
-
int
glamor_poly_text8(DrawablePtr drawable, GCPtr gc,
int x, int y, int count, char *chars)
@@ -325,19 +314,6 @@ glamor_poly_text8(DrawablePtr drawable, GCPtr gc,
return miPolyText8(drawable, gc, x, y, count, chars);
}
-Bool
-glamor_poly_text16_nf(DrawablePtr drawable, GCPtr gc,
- int x, int y, int count, unsigned short *chars, int *final_pos)
-{
- if (glamor_poly_text(drawable, gc, x, y, count, (char *) chars, TRUE, final_pos))
- return TRUE;
-
- if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc))
- return FALSE;
- *final_pos = miPolyText16(drawable, gc, x, y, count, chars);
- return TRUE;
-}
-
int
glamor_poly_text16(DrawablePtr drawable, GCPtr gc,
int x, int y, int count, unsigned short *chars)
@@ -447,7 +423,7 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc,
fill_facet = &glamor_facet_image_fill;
}
- if (!glamor_build_program(screen, prog, prim_facet, fill_facet))
+ if (!glamor_build_program(screen, prog, prim_facet, fill_facet, NULL, NULL))
goto bail;
}
@@ -461,7 +437,7 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc,
/* Check planemask before drawing background to
* bail early if it's not OK
*/
- if (!glamor_set_planemask(pixmap, gc->planemask))
+ if (!glamor_set_planemask(gc->depth, gc->planemask))
goto bail;
for (c = 0; c < count; c++)
if (charinfo[c])
@@ -493,17 +469,9 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc,
return TRUE;
bail:
- glDisable(GL_COLOR_LOGIC_OP);
return FALSE;
}
-Bool
-glamor_image_text8_nf(DrawablePtr drawable, GCPtr gc,
- int x, int y, int count, char *chars)
-{
- return glamor_image_text(drawable, gc, x, y, count, chars, FALSE);
-}
-
void
glamor_image_text8(DrawablePtr drawable, GCPtr gc,
int x, int y, int count, char *chars)
@@ -512,13 +480,6 @@ glamor_image_text8(DrawablePtr drawable, GCPtr gc,
miImageText8(drawable, gc, x, y, count, chars);
}
-Bool
-glamor_image_text16_nf(DrawablePtr drawable, GCPtr gc,
- int x, int y, int count, unsigned short *chars)
-{
- return glamor_image_text(drawable, gc, x, y, count, (char *) chars, TRUE);
-}
-
void
glamor_image_text16(DrawablePtr drawable, GCPtr gc,
int x, int y, int count, unsigned short *chars)
diff --git a/xserver/glamor/glamor_transfer.c b/xserver/glamor/glamor_transfer.c
index aa5e8616e..ed81195b6 100644
--- a/xserver/glamor/glamor_transfer.c
+++ b/xserver/glamor/glamor_transfer.c
@@ -42,7 +42,7 @@ glamor_format_for_pixmap(PixmapPtr pixmap, GLenum *format, GLenum *type)
*type = GL_UNSIGNED_SHORT_1_5_5_5_REV;
break;
case 8:
- *format = GL_ALPHA;
+ *format = glamor_get_screen_private(pixmap->drawable.pScreen)->one_channel_format;
*type = GL_UNSIGNED_BYTE;
break;
default:
@@ -63,7 +63,7 @@ glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox,
ScreenPtr screen = pixmap->drawable.pScreen;
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
- int box_x, box_y;
+ int box_index;
int bytes_per_pixel = pixmap->drawable.bitsPerPixel >> 3;
GLenum type;
GLenum format;
@@ -77,9 +77,9 @@ glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox,
if (glamor_priv->has_unpack_subimage)
glPixelStorei(GL_UNPACK_ROW_LENGTH, byte_stride / bytes_per_pixel);
- glamor_pixmap_loop(priv, box_x, box_y) {
- BoxPtr box = glamor_pixmap_box_at(priv, box_x, box_y);
- glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(priv, box_x, box_y);
+ glamor_pixmap_loop(priv, box_index) {
+ BoxPtr box = glamor_pixmap_box_at(priv, box_index);
+ glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(priv, box_index);
BoxPtr boxes = in_boxes;
int nbox = in_nbox;
@@ -167,7 +167,7 @@ glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox,
ScreenPtr screen = pixmap->drawable.pScreen;
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
- int box_x, box_y;
+ int box_index;
int bytes_per_pixel = pixmap->drawable.bitsPerPixel >> 3;
GLenum type;
GLenum format;
@@ -180,12 +180,14 @@ glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox,
if (glamor_priv->has_pack_subimage)
glPixelStorei(GL_PACK_ROW_LENGTH, byte_stride / bytes_per_pixel);
- glamor_pixmap_loop(priv, box_x, box_y) {
- BoxPtr box = glamor_pixmap_box_at(priv, box_x, box_y);
- glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(priv, box_x, box_y);
+ glamor_pixmap_loop(priv, box_index) {
+ BoxPtr box = glamor_pixmap_box_at(priv, box_index);
+ glamor_pixmap_fbo *fbo = glamor_pixmap_fbo_at(priv, box_index);
BoxPtr boxes = in_boxes;
int nbox = in_nbox;
+ /* This should not be called on GLAMOR_FBO_NO_FBO-allocated pixmaps. */
+ assert(fbo->fb);
glBindFramebuffer(GL_FRAMEBUFFER, fbo->fb);
while (nbox--) {
diff --git a/xserver/glamor/glamor_transform.c b/xserver/glamor/glamor_transform.c
index c1df56018..fc96fd670 100644
--- a/xserver/glamor/glamor_transform.c
+++ b/xserver/glamor/glamor_transform.c
@@ -35,18 +35,19 @@
void
glamor_set_destination_drawable(DrawablePtr drawable,
- int box_x,
- int box_y,
+ int box_index,
Bool do_drawable_translate,
Bool center_offset,
GLint matrix_uniform_location,
int *p_off_x,
int *p_off_y)
{
+ ScreenPtr screen = drawable->pScreen;
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
int off_x, off_y;
- BoxPtr box = glamor_pixmap_box_at(pixmap_priv, box_x, box_y);
+ BoxPtr box = glamor_pixmap_box_at(pixmap_priv, box_index);
int w = box->x2 - box->x1;
int h = box->y2 - box->y1;
float scale_x = 2.0f / (float) w;
@@ -75,8 +76,6 @@ glamor_set_destination_drawable(DrawablePtr drawable,
* gl_x = (render_x + drawable->x + off_x) * 2 / width - 1
*
* gl_x = (render_x) * 2 / width + (drawable->x + off_x) * 2 / width - 1
- *
- * I'll think about yInverted later, when I have some way to test
*/
if (do_drawable_translate) {
@@ -95,7 +94,7 @@ 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_pixmap_fbo_at(pixmap_priv, box_x, box_y),
+ glamor_set_destination_pixmap_fbo(glamor_priv, glamor_pixmap_fbo_at(pixmap_priv, box_index),
0, 0, w, h);
}
@@ -105,15 +104,21 @@ glamor_set_destination_drawable(DrawablePtr drawable,
*/
void
-glamor_set_color(PixmapPtr pixmap,
- CARD32 pixel,
- GLint uniform)
+glamor_set_color_depth(ScreenPtr pScreen,
+ int depth,
+ CARD32 pixel,
+ GLint uniform)
{
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(pScreen);
float color[4];
glamor_get_rgba_from_pixel(pixel,
&color[0], &color[1], &color[2], &color[3],
- format_for_pixmap(pixmap));
+ format_for_depth(depth));
+
+ if ((depth == 1 || depth == 8) &&
+ glamor_priv->one_channel_format == GL_RED)
+ color[0] = color[3];
glUniform4fv(uniform, 1, color);
}
@@ -127,7 +132,7 @@ glamor_set_solid(PixmapPtr pixmap,
CARD32 pixel;
int alu = use_alu ? gc->alu : GXcopy;
- if (!glamor_set_planemask(pixmap, gc->planemask))
+ if (!glamor_set_planemask(gc->depth, gc->planemask))
return FALSE;
pixel = gc->fgPixel;
@@ -153,12 +158,7 @@ glamor_set_solid(PixmapPtr pixmap,
}
Bool
-glamor_set_texture(PixmapPtr pixmap,
- PixmapPtr texture,
- int off_x,
- int off_y,
- GLint offset_uniform,
- GLint size_uniform)
+glamor_set_texture_pixmap(PixmapPtr texture)
{
glamor_pixmap_private *texture_priv;
@@ -167,14 +167,31 @@ glamor_set_texture(PixmapPtr pixmap,
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(texture_priv))
return FALSE;
- if (texture_priv->type == GLAMOR_TEXTURE_LARGE)
+ if (glamor_pixmap_priv_is_large(texture_priv))
return FALSE;
glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, texture_priv->base.fbo->tex);
+ glBindTexture(GL_TEXTURE_2D, texture_priv->fbo->tex);
+
+ /* we're not setting the sampler uniform here as we always use
+ * GL_TEXTURE0, and the default value for uniforms is zero. So,
+ * save a bit of CPU time by taking advantage of that.
+ */
+ return TRUE;
+}
+
+Bool
+glamor_set_texture(PixmapPtr texture,
+ int off_x,
+ int off_y,
+ GLint offset_uniform,
+ GLint size_inv_uniform)
+{
+ if (!glamor_set_texture_pixmap(texture))
+ return FALSE;
glUniform2f(offset_uniform, off_x, off_y);
- glUniform2f(size_uniform, texture->drawable.width, texture->drawable.height);
+ glUniform2f(size_inv_uniform, 1.0f/texture->drawable.width, 1.0f/texture->drawable.height);
return TRUE;
}
@@ -182,20 +199,19 @@ Bool
glamor_set_tiled(PixmapPtr pixmap,
GCPtr gc,
GLint offset_uniform,
- GLint size_uniform)
+ GLint size_inv_uniform)
{
if (!glamor_set_alu(pixmap->drawable.pScreen, gc->alu))
return FALSE;
- if (!glamor_set_planemask(pixmap, gc->planemask))
+ if (!glamor_set_planemask(gc->depth, gc->planemask))
return FALSE;
- return glamor_set_texture(pixmap,
- gc->tile.pixmap,
+ return glamor_set_texture(gc->tile.pixmap,
-gc->patOrg.x,
-gc->patOrg.y,
offset_uniform,
- size_uniform);
+ size_inv_uniform);
}
static PixmapPtr
@@ -272,8 +288,7 @@ glamor_set_stippled(PixmapPtr pixmap,
if (!glamor_set_solid(pixmap, gc, TRUE, fg_uniform))
return FALSE;
- return glamor_set_texture(pixmap,
- stipple,
+ return glamor_set_texture(stipple,
-gc->patOrg.x,
-gc->patOrg.y,
offset_uniform,
diff --git a/xserver/glamor/glamor_transform.h b/xserver/glamor/glamor_transform.h
index 36b789af8..5a520ebb0 100644
--- a/xserver/glamor/glamor_transform.h
+++ b/xserver/glamor/glamor_transform.h
@@ -25,8 +25,7 @@
void
glamor_set_destination_drawable(DrawablePtr drawable,
- int box_x,
- int box_y,
+ int box_index,
Bool do_drawable_translate,
Bool center_offset,
GLint matrix_uniform_location,
@@ -34,13 +33,25 @@ glamor_set_destination_drawable(DrawablePtr drawable,
int *p_off_y);
void
+glamor_set_color_depth(ScreenPtr pScreen,
+ int depth,
+ CARD32 pixel,
+ GLint uniform);
+
+static inline void
glamor_set_color(PixmapPtr pixmap,
CARD32 pixel,
- GLint uniform);
+ GLint uniform)
+{
+ glamor_set_color_depth(pixmap->drawable.pScreen,
+ pixmap->drawable.depth, pixel, uniform);
+}
+
+Bool
+glamor_set_texture_pixmap(PixmapPtr texture);
Bool
-glamor_set_texture(PixmapPtr pixmap,
- PixmapPtr texture,
+glamor_set_texture(PixmapPtr texture,
int off_x,
int off_y,
GLint offset_uniform,
diff --git a/xserver/glamor/glamor_trapezoid.c b/xserver/glamor/glamor_trapezoid.c
index f8bf6c97f..a448a6b3e 100644
--- a/xserver/glamor/glamor_trapezoid.c
+++ b/xserver/glamor/glamor_trapezoid.c
@@ -32,7 +32,6 @@
#include "glamor_priv.h"
-#ifdef RENDER
#include "mipict.h"
#include "fbpict.h"
@@ -155,18 +154,3 @@ glamor_trapezoids(CARD8 op,
FreePicture(picture, 0);
}
-
-Bool
-glamor_trapezoids_nf(CARD8 op,
- PicturePtr src, PicturePtr dst,
- PictFormatPtr mask_format, INT16 x_src, INT16 y_src,
- int ntrap, xTrapezoid *traps)
-{
- DEBUGF("x_src = %d, y_src = %d, ntrap = %d\n", x_src, y_src, ntrap);
-
- glamor_trapezoids(op, src, dst, mask_format, x_src,
- y_src, ntrap, traps);
- return TRUE;
-}
-
-#endif /* RENDER */
diff --git a/xserver/glamor/glamor_triangles.c b/xserver/glamor/glamor_triangles.c
index b89cb2de7..88a46c11f 100644
--- a/xserver/glamor/glamor_triangles.c
+++ b/xserver/glamor/glamor_triangles.c
@@ -28,29 +28,6 @@
#include "glamor_priv.h"
-static Bool
-_glamor_triangles(CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris,
- Bool fallback)
-{
- if (!fallback && glamor_ddx_fallback_check_pixmap(pDst->pDrawable)
- && (!pSrc->pDrawable
- || glamor_ddx_fallback_check_pixmap(pSrc->pDrawable)))
- return FALSE;
-
- if (glamor_prepare_access_picture(pDst, GLAMOR_ACCESS_RW) &&
- glamor_prepare_access_picture(pSrc, GLAMOR_ACCESS_RO)) {
- fbTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntris, tris);
- }
- glamor_finish_access_picture(pSrc);
- glamor_finish_access_picture(pDst);
-
- return TRUE;
-}
-
void
glamor_triangles(CARD8 op,
PicturePtr pSrc,
@@ -58,17 +35,10 @@ glamor_triangles(CARD8 op,
PictFormatPtr maskFormat,
INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris)
{
- _glamor_triangles(op, pSrc, pDst, maskFormat,
- xSrc, ySrc, ntris, tris, TRUE);
-}
-
-Bool
-glamor_triangles_nf(CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris)
-{
- return _glamor_triangles(op, pSrc, pDst, maskFormat,
- xSrc, ySrc, ntris, tris, FALSE);
+ if (glamor_prepare_access_picture(pDst, GLAMOR_ACCESS_RW) &&
+ glamor_prepare_access_picture(pSrc, GLAMOR_ACCESS_RO)) {
+ fbTriangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntris, tris);
+ }
+ glamor_finish_access_picture(pSrc);
+ glamor_finish_access_picture(pDst);
}
diff --git a/xserver/glamor/glamor_utils.c b/xserver/glamor/glamor_utils.c
index f06896096..d3e6fd3ff 100644
--- a/xserver/glamor/glamor_utils.c
+++ b/xserver/glamor/glamor_utils.c
@@ -31,7 +31,7 @@ glamor_solid_boxes(PixmapPtr pixmap,
xRectangle *rect;
int n;
- rect = malloc(nbox * sizeof (xRectangle));
+ rect = xallocarray(nbox, sizeof(xRectangle));
if (!rect)
return;
for (n = 0; n < nbox; n++) {
diff --git a/xserver/glamor/glamor_utils.h b/xserver/glamor/glamor_utils.h
index c15d17ca3..5128a33d8 100644
--- a/xserver/glamor/glamor_utils.h
+++ b/xserver/glamor/glamor_utils.h
@@ -33,58 +33,53 @@
#define __GLAMOR_UTILS_H__
#include "glamor_prepare.h"
+#include "mipict.h"
#define v_from_x_coord_x(_xscale_, _x_) ( 2 * (_x_) * (_xscale_) - 1.0)
-#define v_from_x_coord_y(_yscale_, _y_) (-2 * (_y_) * (_yscale_) + 1.0)
-#define v_from_x_coord_y_inverted(_yscale_, _y_) (2 * (_y_) * (_yscale_) - 1.0)
+#define v_from_x_coord_y(_yscale_, _y_) (2 * (_y_) * (_yscale_) - 1.0)
#define t_from_x_coord_x(_xscale_, _x_) ((_x_) * (_xscale_))
-#define t_from_x_coord_y(_yscale_, _y_) (1.0 - (_y_) * (_yscale_))
-#define t_from_x_coord_y_inverted(_yscale_, _y_) ((_y_) * (_yscale_))
+#define t_from_x_coord_y(_yscale_, _y_) ((_y_) * (_yscale_))
-#define pixmap_priv_get_dest_scale(_pixmap_priv_, _pxscale_, _pyscale_) \
+#define pixmap_priv_get_dest_scale(pixmap, _pixmap_priv_, _pxscale_, _pyscale_) \
do { \
int _w_,_h_; \
- PIXMAP_PRIV_GET_ACTUAL_SIZE(_pixmap_priv_, _w_, _h_); \
+ PIXMAP_PRIV_GET_ACTUAL_SIZE(pixmap, _pixmap_priv_, _w_, _h_); \
*(_pxscale_) = 1.0 / _w_; \
*(_pyscale_) = 1.0 / _h_; \
} while(0)
#define pixmap_priv_get_scale(_pixmap_priv_, _pxscale_, _pyscale_) \
do { \
- *(_pxscale_) = 1.0 / (_pixmap_priv_)->base.fbo->width; \
- *(_pyscale_) = 1.0 / (_pixmap_priv_)->base.fbo->height; \
+ *(_pxscale_) = 1.0 / (_pixmap_priv_)->fbo->width; \
+ *(_pyscale_) = 1.0 / (_pixmap_priv_)->fbo->height; \
} while(0)
-#define GLAMOR_PIXMAP_FBO_NOT_EXACT_SIZE(priv) \
- (priv->base.fbo->width != priv->base.pixmap->drawable.width \
- || priv->base.fbo->height != priv->base.pixmap->drawable.height) \
-
-#define PIXMAP_PRIV_GET_ACTUAL_SIZE(priv, w, h) \
+#define PIXMAP_PRIV_GET_ACTUAL_SIZE(pixmap, priv, w, h) \
do { \
- if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \
- w = priv->large.box.x2 - priv->large.box.x1; \
- h = priv->large.box.y2 - priv->large.box.y1; \
+ if (_X_UNLIKELY(glamor_pixmap_priv_is_large(priv))) { \
+ w = priv->box.x2 - priv->box.x1; \
+ h = priv->box.y2 - priv->box.y1; \
} else { \
- w = priv->base.pixmap->drawable.width; \
- h = priv->base.pixmap->drawable.height; \
+ w = (pixmap)->drawable.width; \
+ h = (pixmap)->drawable.height; \
} \
} while(0)
-#define glamor_pixmap_fbo_fix_wh_ratio(wh, priv) \
+#define glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap, priv) \
do { \
int actual_w, actual_h; \
- PIXMAP_PRIV_GET_ACTUAL_SIZE(priv, actual_w, actual_h); \
- wh[0] = (float)priv->base.fbo->width / actual_w; \
- wh[1] = (float)priv->base.fbo->height / actual_h; \
- wh[2] = 1.0 / priv->base.fbo->width; \
- wh[3] = 1.0 / priv->base.fbo->height; \
+ PIXMAP_PRIV_GET_ACTUAL_SIZE(pixmap, priv, actual_w, actual_h); \
+ wh[0] = (float)priv->fbo->width / actual_w; \
+ wh[1] = (float)priv->fbo->height / actual_h; \
+ wh[2] = 1.0 / priv->fbo->width; \
+ wh[3] = 1.0 / priv->fbo->height; \
} while(0)
#define pixmap_priv_get_fbo_off(_priv_, _xoff_, _yoff_) \
do { \
- if (_X_UNLIKELY(_priv_ && (_priv_)->type == GLAMOR_TEXTURE_LARGE)) { \
- *(_xoff_) = - (_priv_)->large.box.x1; \
- *(_yoff_) = - (_priv_)->large.box.y1; \
+ if (_X_UNLIKELY(_priv_ && glamor_pixmap_priv_is_large(_priv_))) { \
+ *(_xoff_) = - (_priv_)->box.x1; \
+ *(_yoff_) = - (_priv_)->box.y1; \
} else { \
*(_xoff_) = 0; \
*(_yoff_) = 0; \
@@ -193,33 +188,33 @@
txy = xy - bxy1; \
} while(0)
-#define _glamor_get_reflect_transform_coords(priv, repeat_type, \
+#define _glamor_get_reflect_transform_coords(pixmap, priv, repeat_type, \
tx1, ty1, \
_x1_, _y1_) \
do { \
int odd_x, odd_y; \
float c, d; \
fodd_repeat_mod(_x1_,priv->box.x2, \
- priv->base.pixmap->drawable.width, \
+ (pixmap)->drawable.width, \
odd_x, c); \
fodd_repeat_mod(_y1_, priv->box.y2, \
- priv->base.pixmap->drawable.height, \
+ (pixmap)->drawable.height, \
odd_y, d); \
DEBUGF("c %f d %f oddx %d oddy %d \n", \
c, d, odd_x, odd_y); \
DEBUGF("x2 %d x1 %d fbo->width %d \n", priv->box.x2, \
- priv->box.x1, priv->base.fbo->width); \
+ priv->box.x1, priv->fbo->width); \
DEBUGF("y2 %d y1 %d fbo->height %d \n", priv->box.y2, \
- priv->box.y1, priv->base.fbo->height); \
+ priv->box.y1, priv->fbo->height); \
_glamor_repeat_reflect_fixup(tx1, _x1_, c, odd_x, \
- priv->base.pixmap->drawable.width, \
+ (pixmap)->drawable.width, \
priv->box.x1, priv->box.x2); \
_glamor_repeat_reflect_fixup(ty1, _y1_, d, odd_y, \
- priv->base.pixmap->drawable.height, \
+ (pixmap)->drawable.height, \
priv->box.y1, priv->box.y2); \
} while(0)
-#define _glamor_get_repeat_coords(priv, repeat_type, tx1, \
+#define _glamor_get_repeat_coords(pixmap, priv, repeat_type, tx1, \
ty1, tx2, ty2, \
_x1_, _y1_, _x2_, \
_y2_, c, d, odd_x, odd_y) \
@@ -228,10 +223,10 @@
DEBUGF("x1 y1 %d %d\n", \
_x1_, _y1_ ); \
DEBUGF("width %d box.x1 %d \n", \
- (priv)->base.pixmap->drawable.width, \
+ (pixmap)->drawable.width, \
priv->box.x1); \
if (odd_x) { \
- c = (priv)->base.pixmap->drawable.width \
+ c = (pixmap)->drawable.width \
- c; \
tx1 = c - priv->box.x1; \
tx2 = tx1 - ((_x2_) - (_x1_)); \
@@ -240,7 +235,7 @@
tx2 = tx1 + ((_x2_) - (_x1_)); \
} \
if (odd_y){ \
- d = (priv)->base.pixmap->drawable.height\
+ d = (pixmap)->drawable.height\
- d; \
ty1 = d - priv->box.y1; \
ty2 = ty1 - ((_y2_) - (_y1_)); \
@@ -257,11 +252,11 @@
} while(0)
/* _x1_ ... _y2_ may has fractional. */
-#define glamor_get_repeat_transform_coords(priv, repeat_type, tx1, \
+#define glamor_get_repeat_transform_coords(pixmap, priv, repeat_type, tx1, \
ty1, _x1_, _y1_) \
do { \
DEBUGF("width %d box.x1 %d x2 %d y1 %d y2 %d\n", \
- (priv)->base.pixmap->drawable.width, \
+ (pixmap)->drawable.width, \
priv->box.x1, priv->box.x2, priv->box.y1, \
priv->box.y2); \
DEBUGF("x1 %f y1 %f \n", _x1_, _y1_); \
@@ -269,33 +264,33 @@
tx1 = _x1_ - priv->box.x1; \
ty1 = _y1_ - priv->box.y1; \
} else \
- _glamor_get_reflect_transform_coords(priv, repeat_type, \
+ _glamor_get_reflect_transform_coords(pixmap, priv, repeat_type, \
tx1, ty1, \
_x1_, _y1_); \
DEBUGF("tx1 %f ty1 %f \n", tx1, ty1); \
} while(0)
/* _x1_ ... _y2_ must be integer. */
-#define glamor_get_repeat_coords(priv, repeat_type, tx1, \
+#define glamor_get_repeat_coords(pixmap, priv, repeat_type, tx1, \
ty1, tx2, ty2, _x1_, _y1_, _x2_, \
_y2_) \
do { \
int c, d; \
int odd_x = 0, odd_y = 0; \
DEBUGF("width %d box.x1 %d x2 %d y1 %d y2 %d\n", \
- (priv)->base.pixmap->drawable.width, \
+ (pixmap)->drawable.width, \
priv->box.x1, priv->box.x2, \
priv->box.y1, priv->box.y2); \
- modulus((_x1_), (priv)->base.pixmap->drawable.width, c); \
- modulus((_y1_), (priv)->base.pixmap->drawable.height, d); \
+ modulus((_x1_), (pixmap)->drawable.width, c); \
+ modulus((_y1_), (pixmap)->drawable.height, d); \
DEBUGF("c %d d %d \n", c, d); \
if (repeat_type == RepeatReflect) { \
odd_x = abs((_x1_ - c) \
- / (priv->base.pixmap->drawable.width)) & 1; \
+ / ((pixmap)->drawable.width)) & 1; \
odd_y = abs((_y1_ - d) \
- / (priv->base.pixmap->drawable.height)) & 1; \
+ / ((pixmap)->drawable.height)) & 1; \
} \
- _glamor_get_repeat_coords(priv, repeat_type, tx1, ty1, tx2, ty2,\
+ _glamor_get_repeat_coords(pixmap, priv, repeat_type, tx1, ty1, tx2, ty2, \
_x1_, _y1_, _x2_, _y2_, c, d, \
odd_x, odd_y); \
} while(0)
@@ -316,12 +311,12 @@
texcoord) \
do { \
(texcoord)[0] = t_from_x_coord_x(xscale, _tx_); \
- (texcoord)[1] = t_from_x_coord_y_inverted(yscale, _ty_); \
+ (texcoord)[1] = t_from_x_coord_y(yscale, _ty_); \
DEBUGF("normalized point tx %f ty %f \n", (texcoord)[0], \
(texcoord)[1]); \
} while(0)
-#define glamor_set_transformed_point(priv, matrix, xscale, \
+#define glamor_set_transformed_point(priv, matrix, xscale, \
yscale, texcoord, \
x, y) \
do { \
@@ -335,7 +330,7 @@
tx += fbo_x_off; \
ty += fbo_y_off; \
(texcoord)[0] = t_from_x_coord_x(xscale, tx); \
- (texcoord)[1] = t_from_x_coord_y_inverted(yscale, ty); \
+ (texcoord)[1] = t_from_x_coord_y(yscale, ty); \
DEBUGF("normalized tx %f ty %f \n", (texcoord)[0], (texcoord)[1]); \
} while(0)
@@ -404,7 +399,7 @@
texcoords+4); \
} while (0)
-#define glamor_set_repeat_transformed_normalize_tcoords_ext( priv, \
+#define glamor_set_repeat_transformed_normalize_tcoords_ext(pixmap, priv, \
repeat_type, \
matrix, \
xscale, \
@@ -414,7 +409,7 @@
texcoords, \
stride) \
do { \
- if (_X_LIKELY(priv->type != GLAMOR_TEXTURE_LARGE)) { \
+ if (_X_LIKELY(glamor_pixmap_priv_is_small(priv))) { \
glamor_set_transformed_normalize_tcoords_ext(priv, matrix, xscale, \
yscale, _x1_, _y1_, \
_x2_, _y2_, \
@@ -429,16 +424,16 @@
glamor_transform_point(matrix, tx4, ty4, _x1_, _y2_); \
DEBUGF("transformed %f %f %f %f %f %f %f %f\n", \
tx1, ty1, tx2, ty2, tx3, ty3, tx4, ty4); \
- glamor_get_repeat_transform_coords((&priv->large), repeat_type, \
+ glamor_get_repeat_transform_coords(pixmap, priv, repeat_type, \
ttx1, tty1, \
tx1, ty1); \
- glamor_get_repeat_transform_coords((&priv->large), repeat_type, \
+ glamor_get_repeat_transform_coords(pixmap, priv, repeat_type, \
ttx2, tty2, \
tx2, ty2); \
- glamor_get_repeat_transform_coords((&priv->large), repeat_type, \
+ glamor_get_repeat_transform_coords(pixmap, priv, repeat_type, \
ttx3, tty3, \
tx3, ty3); \
- glamor_get_repeat_transform_coords((&priv->large), repeat_type, \
+ glamor_get_repeat_transform_coords(pixmap, priv, repeat_type, \
ttx4, tty4, \
tx4, ty4); \
DEBUGF("repeat transformed %f %f %f %f %f %f %f %f\n", ttx1, tty1, \
@@ -454,7 +449,8 @@
} \
} while (0)
-#define glamor_set_repeat_transformed_normalize_tcoords( priv, \
+#define glamor_set_repeat_transformed_normalize_tcoords( pixmap, \
+ priv, \
repeat_type, \
matrix, \
xscale, \
@@ -463,7 +459,8 @@
_x2_, _y2_, \
texcoords) \
do { \
- glamor_set_repeat_transformed_normalize_tcoords_ext( priv, \
+ glamor_set_repeat_transformed_normalize_tcoords_ext( pixmap, \
+ priv, \
repeat_type, \
matrix, \
xscale, \
@@ -485,8 +482,8 @@
(vertices)[1 * stride] = _t2_ = t_from_x_coord_x(xscale, tx2); \
(vertices)[2 * stride] = _t2_; \
(vertices)[3 * stride] = _t0_; \
- (vertices)[1] = _t1_ = t_from_x_coord_y_inverted(yscale, ty1); \
- (vertices)[2 * stride + 1] = _t5_ = t_from_x_coord_y_inverted(yscale, ty2); \
+ (vertices)[1] = _t1_ = t_from_x_coord_y(yscale, ty1); \
+ (vertices)[2 * stride + 1] = _t5_ = t_from_x_coord_y(yscale, ty2); \
(vertices)[1 * stride + 1] = _t1_; \
(vertices)[3 * stride + 1] = _t5_; \
} while(0)
@@ -495,7 +492,7 @@
x1, y1, x2, y2, \
vertices, stride) \
do { \
- if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \
+ if (_X_UNLIKELY(glamor_pixmap_priv_is_large(priv))) { \
float tx1, tx2, ty1, ty2; \
int fbo_x_off, fbo_y_off; \
pixmap_priv_get_fbo_off(priv, &fbo_x_off, &fbo_y_off); \
@@ -520,20 +517,20 @@
vertices, 2); \
} while(0)
-#define glamor_set_repeat_normalize_tcoords_ext(priv, repeat_type, \
+#define glamor_set_repeat_normalize_tcoords_ext(pixmap, priv, repeat_type, \
xscale, yscale, \
_x1_, _y1_, _x2_, _y2_, \
vertices, stride) \
do { \
- if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \
+ if (_X_UNLIKELY(glamor_pixmap_priv_is_large(priv))) { \
float tx1, tx2, ty1, ty2; \
if (repeat_type == RepeatPad) { \
- tx1 = _x1_ - priv->large.box.x1; \
- ty1 = _y1_ - priv->large.box.y1; \
+ tx1 = _x1_ - priv->box.x1; \
+ ty1 = _y1_ - priv->box.y1; \
tx2 = tx1 + ((_x2_) - (_x1_)); \
ty2 = ty1 + ((_y2_) - (_y1_)); \
} else { \
- glamor_get_repeat_coords((&priv->large), repeat_type, \
+ glamor_get_repeat_coords(pixmap, priv, repeat_type, \
tx1, ty1, tx2, ty2, \
_x1_, _y1_, _x2_, _y2_); \
} \
@@ -565,8 +562,8 @@
(vertices)[2] = t_from_x_coord_x(xscale, x2); \
(vertices)[6] = (vertices)[2]; \
(vertices)[4] = (vertices)[0]; \
- (vertices)[1] = t_from_x_coord_y_inverted(yscale, y1); \
- (vertices)[7] = t_from_x_coord_y_inverted(yscale, y2); \
+ (vertices)[1] = t_from_x_coord_y(yscale, y1); \
+ (vertices)[7] = t_from_x_coord_y(yscale, y2); \
(vertices)[3] = (vertices)[1]; \
(vertices)[5] = (vertices)[7]; \
} while(0)
@@ -599,7 +596,7 @@
vertices) \
do { \
(vertices)[0] = v_from_x_coord_x(xscale, x); \
- (vertices)[1] = v_from_x_coord_y_inverted(yscale, y); \
+ (vertices)[1] = v_from_x_coord_y(yscale, y); \
} while(0)
#define glamor_set_normalize_tri_vcoords(xscale, yscale, vtx, \
@@ -642,11 +639,9 @@
x2 + fbo_x_off); \
(vertices)[2 * stride] = _t2_; \
(vertices)[3 * stride] = _t0_; \
- (vertices)[1] = _t1_ = v_from_x_coord_y_inverted(yscale, \
- y1 + fbo_y_off); \
+ (vertices)[1] = _t1_ = v_from_x_coord_y(yscale, y1 + fbo_y_off); \
(vertices)[2 * stride + 1] = _t5_ = \
- v_from_x_coord_y_inverted(yscale, \
- y2 + fbo_y_off); \
+ v_from_x_coord_y(yscale, y2 + fbo_y_off); \
(vertices)[1 * stride + 1] = _t1_; \
(vertices)[3 * stride + 1] = _t5_; \
} while(0)
@@ -678,8 +673,8 @@
(vertices)[2] = v_from_x_coord_x(xscale, x2); \
(vertices)[6] = (vertices)[2]; \
(vertices)[4] = (vertices)[0]; \
- (vertices)[1] = v_from_x_coord_y_inverted(yscale, y1); \
- (vertices)[7] = v_from_x_coord_y_inverted(yscale, y2); \
+ (vertices)[1] = v_from_x_coord_y(yscale, y1); \
+ (vertices)[7] = v_from_x_coord_y(yscale, y2); \
(vertices)[3] = (vertices)[1]; \
(vertices)[5] = (vertices)[7]; \
} while(0)
@@ -688,7 +683,7 @@
pt) \
do { \
(pt)[0] = t_from_x_coord_x(xscale, x); \
- (pt)[1] = t_from_x_coord_y_inverted(yscale, y); \
+ (pt)[1] = t_from_x_coord_y(yscale, y); \
} while(0)
#define glamor_set_circle_centre(width, height, x, y, \
@@ -698,45 +693,6 @@
(c)[1] = (float)y; \
} while(0)
-inline static void
-glamor_calculate_boxes_bound(BoxPtr bound, BoxPtr boxes, int nbox)
-{
- int x_min, y_min;
- int x_max, y_max;
- int i;
-
- x_min = y_min = MAXSHORT;
- x_max = y_max = MINSHORT;
- for (i = 0; i < nbox; i++) {
- if (x_min > boxes[i].x1)
- x_min = boxes[i].x1;
- if (y_min > boxes[i].y1)
- y_min = boxes[i].y1;
-
- if (x_max < boxes[i].x2)
- x_max = boxes[i].x2;
- if (y_max < boxes[i].y2)
- y_max = boxes[i].y2;
- }
- bound->x1 = x_min;
- bound->y1 = y_min;
- bound->x2 = x_max;
- bound->y2 = y_max;
-}
-
-inline static void
-glamor_translate_boxes(BoxPtr boxes, int nbox, int dx, int dy)
-{
- int i;
-
- for (i = 0; i < nbox; i++) {
- boxes[i].x1 += dx;
- boxes[i].y1 += dy;
- boxes[i].x2 += dx;
- boxes[i].y2 += dy;
- }
-}
-
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#endif
@@ -758,9 +714,7 @@ glamor_translate_boxes(BoxPtr boxes, int nbox, int dx, int dy)
|| _depth_ == 30 \
|| _depth_ == 32)
-#define GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) (pixmap_priv && pixmap_priv->base.is_picture == 1)
-#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) (pixmap_priv && pixmap_priv->base.gl_fbo == GLAMOR_FBO_NORMAL)
-#define GLAMOR_PIXMAP_PRIV_HAS_FBO_DOWNLOADED(pixmap_priv) (pixmap_priv && (pixmap_priv->base.gl_fbo == GLAMOR_FBO_DOWNLOADED))
+#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) (pixmap_priv->gl_fbo == GLAMOR_FBO_NORMAL)
/**
* Borrow from uxa.
@@ -795,11 +749,11 @@ static inline GLenum
gl_iformat_for_pixmap(PixmapPtr pixmap)
{
glamor_screen_private *glamor_priv =
- glamor_get_screen_private(pixmap->drawable.pScreen);
+ glamor_get_screen_private((pixmap)->drawable.pScreen);
if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP &&
- (pixmap->drawable.depth == 1 || pixmap->drawable.depth == 8)) {
- return GL_ALPHA;
+ ((pixmap)->drawable.depth == 1 || (pixmap)->drawable.depth == 8)) {
+ return glamor_priv->one_channel_format;
} else {
return GL_RGBA;
}
@@ -808,16 +762,7 @@ gl_iformat_for_pixmap(PixmapPtr pixmap)
static inline CARD32
format_for_pixmap(PixmapPtr pixmap)
{
- glamor_pixmap_private *pixmap_priv;
- PictFormatShort pict_format;
-
- pixmap_priv = glamor_get_pixmap_private(pixmap);
- if (GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv))
- pict_format = pixmap_priv->base.picture->format;
- else
- pict_format = format_for_depth(pixmap->drawable.depth);
-
- return pict_format;
+ return format_for_depth((pixmap)->drawable.depth);
}
#define REVERT_NONE 0
@@ -836,21 +781,6 @@ format_for_pixmap(PixmapPtr pixmap)
#define SWAP_UPLOADING 2
#define SWAP_NONE_UPLOADING 3
-inline static int
-cache_format(GLenum format)
-{
- switch (format) {
- case GL_ALPHA:
- return 2;
- case GL_RGB:
- return 1;
- case GL_RGBA:
- return 0;
- default:
- return -1;
- }
-}
-
/* borrowed from uxa */
static inline Bool
glamor_get_rgba_from_pixel(CARD32 pixel,
@@ -922,91 +852,20 @@ glamor_get_rgba_from_pixel(CARD32 pixel,
}
inline static Bool
-glamor_pict_format_is_compatible(PicturePtr picture)
-{
- GLenum iformat;
- PixmapPtr pixmap = glamor_get_drawable_pixmap(picture->pDrawable);
-
- iformat = gl_iformat_for_pixmap(pixmap);
- switch (iformat) {
- case GL_RGBA:
- return (picture->format == PICT_a8r8g8b8 ||
- picture->format == PICT_x8r8g8b8);
- case GL_ALPHA:
- return (picture->format == PICT_a8);
- default:
- return FALSE;
- }
-}
-
-/* return TRUE if we can access this pixmap at DDX driver. */
-inline static Bool
-glamor_ddx_fallback_check_pixmap(DrawablePtr drawable)
-{
- PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
- glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
-
- return (!pixmap_priv
- || (pixmap_priv->type == GLAMOR_TEXTURE_DRM
- || pixmap_priv->type == GLAMOR_MEMORY
- || pixmap_priv->type == GLAMOR_DRM_ONLY));
-}
-
-inline static Bool
-glamor_ddx_fallback_check_gc(GCPtr gc)
-{
- PixmapPtr pixmap;
-
- if (!gc)
- return TRUE;
- switch (gc->fillStyle) {
- case FillStippled:
- case FillOpaqueStippled:
- pixmap = gc->stipple;
- break;
- case FillTiled:
- pixmap = gc->tile.pixmap;
- break;
- default:
- pixmap = NULL;
- }
- return (!pixmap || glamor_ddx_fallback_check_pixmap(&pixmap->drawable));
-}
-
-inline static Bool
glamor_is_large_pixmap(PixmapPtr pixmap)
{
glamor_pixmap_private *priv;
priv = glamor_get_pixmap_private(pixmap);
- return (priv->type == GLAMOR_TEXTURE_LARGE);
-}
-
-inline static Bool
-glamor_is_large_picture(PicturePtr picture)
-{
- PixmapPtr pixmap;
-
- if (picture->pDrawable) {
- pixmap = glamor_get_drawable_pixmap(picture->pDrawable);
- return glamor_is_large_pixmap(pixmap);
- }
- return FALSE;
-}
-
-inline static Bool
-glamor_tex_format_is_readable(GLenum format)
-{
- return ((format == GL_RGBA || format == GL_RGB || format == GL_ALPHA));
-
+ 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;
+ unsigned char *p = (pixmap)->devPrivate.ptr;
+ int stride = (pixmap)->devKind;
p = p + y * stride + x;
@@ -1023,8 +882,8 @@ 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;
+ unsigned char *p = (pixmap)->devPrivate.ptr;
+ int stride = (pixmap)->devKind;
p = p + y * stride + x;
@@ -1041,8 +900,8 @@ 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;
+ unsigned short *p = (pixmap)->devPrivate.ptr;
+ int stride = (pixmap)->devKind / 2;
p = p + y * stride + x;
@@ -1059,8 +918,8 @@ 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;
+ unsigned int *p = (pixmap)->devPrivate.ptr;
+ int stride = (pixmap)->devKind / 4;
p = p + y * stride + x;
@@ -1076,11 +935,11 @@ _glamor_dump_pixmap_word(PixmapPtr pixmap, int x, int y, int w, int h)
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;
+ 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) {
+ glamor_prepare_access(&(pixmap)->drawable, GLAMOR_ACCESS_RO);
+ switch ((pixmap)->drawable.depth) {
case 8:
_glamor_dump_pixmap_byte(pixmap, x, y, w, h);
break;
@@ -1097,9 +956,9 @@ glamor_dump_pixmap(PixmapPtr pixmap, int x, int y, int w, int h)
_glamor_dump_pixmap_bits(pixmap, x, y, w, h);
break;
default:
- ErrorF("dump depth %d, not implemented.\n", pixmap->drawable.depth);
+ ErrorF("dump depth %d, not implemented.\n", (pixmap)->drawable.depth);
}
- glamor_finish_access(&pixmap->drawable);
+ glamor_finish_access(&(pixmap)->drawable);
}
static inline void
@@ -1297,7 +1156,7 @@ glamor_compare_pictures(ScreenPtr screen,
GLAMOR_CREATE_PIXMAP_CPU);
pixman_pic = CreatePicture(0,
- &pixmap->drawable,
+ &(pixmap)->drawable,
PictureMatchFormat(screen,
PIXMAN_FORMAT_DEPTH
(format), format), 0, 0,
@@ -1325,7 +1184,7 @@ glamor_compare_pictures(ScreenPtr screen,
GLAMOR_CREATE_PIXMAP_CPU);
pixman_pic = CreatePicture(0,
- &pixmap->drawable,
+ &(pixmap)->drawable,
PictureMatchFormat(screen,
PIXMAN_FORMAT_DEPTH
(format), format), 0, 0,
@@ -1345,9 +1204,9 @@ glamor_compare_pictures(ScreenPtr screen,
if (fst_pixmap->drawable.depth != snd_pixmap->drawable.depth) {
if (fst_generated)
- glamor_destroy_picture(fst_picture);
+ miDestroyPicture(fst_picture);
if (snd_generated)
- glamor_destroy_picture(snd_picture);
+ miDestroyPicture(snd_picture);
ErrorF("Different pixmap depth can not compare!\n");
return;
@@ -1373,9 +1232,9 @@ glamor_compare_pictures(ScreenPtr screen,
glamor_finish_access(&snd_pixmap->drawable);
if (fst_generated)
- glamor_destroy_picture(fst_picture);
+ miDestroyPicture(fst_picture);
if (snd_generated)
- glamor_destroy_picture(snd_picture);
+ miDestroyPicture(snd_picture);
return;
}
@@ -1429,4 +1288,19 @@ glamor_make_current(glamor_screen_private *glamor_priv)
}
}
+/**
+ * Helper function for implementing draws with GL_QUADS on GLES2,
+ * where we don't have them.
+ */
+static inline void
+glamor_glDrawArrays_GL_QUADS(glamor_screen_private *glamor_priv, unsigned count)
+{
+ if (glamor_priv->use_quads) {
+ glDrawArrays(GL_QUADS, 0, count * 4);
+ } else {
+ glamor_gldrawarrays_quads_using_indices(glamor_priv, count);
+ }
+}
+
+
#endif
diff --git a/xserver/glamor/glamor_vbo.c b/xserver/glamor/glamor_vbo.c
index e90610102..b8db0092b 100644
--- a/xserver/glamor/glamor_vbo.c
+++ b/xserver/glamor/glamor_vbo.c
@@ -96,6 +96,15 @@ glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset)
data = glamor_priv->vb + glamor_priv->vbo_offset;
glamor_priv->vbo_offset += size;
} else if (glamor_priv->has_map_buffer_range) {
+ /* Avoid GL errors on GL 4.5 / ES 3.0 with mapping size == 0,
+ * which callers may sometimes pass us (for example, if
+ * clipping leads to zero rectangles left). Prior to that
+ * version, Mesa would sometimes throw errors on unmapping a
+ * zero-size mapping.
+ */
+ if (size == 0)
+ return NULL;
+
if (glamor_priv->vbo_size < glamor_priv->vbo_offset + size) {
glamor_priv->vbo_size = MAX(GLAMOR_VBO_SIZE, size);
glamor_priv->vbo_offset = 0;
@@ -109,9 +118,9 @@ glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset)
GL_MAP_WRITE_BIT |
GL_MAP_UNSYNCHRONIZED_BIT |
GL_MAP_INVALIDATE_RANGE_BIT);
- assert(data != NULL);
*vbo_offset = (char *)(uintptr_t)glamor_priv->vbo_offset;
glamor_priv->vbo_offset += size;
+ glamor_priv->vbo_mapped = TRUE;
} else {
/* Return a pointer to the statically allocated non-VBO
* memory. We'll upload it through glBufferData() later.
@@ -145,7 +154,10 @@ glamor_put_vbo_space(ScreenPtr screen)
* reach the end of the buffer.
*/
} else if (glamor_priv->has_map_buffer_range) {
- glUnmapBuffer(GL_ARRAY_BUFFER);
+ if (glamor_priv->vbo_mapped) {
+ glUnmapBuffer(GL_ARRAY_BUFFER);
+ glamor_priv->vbo_mapped = FALSE;
+ }
} else {
glBufferData(GL_ARRAY_BUFFER, glamor_priv->vbo_offset,
glamor_priv->vb, GL_DYNAMIC_DRAW);
@@ -162,6 +174,11 @@ glamor_init_vbo(ScreenPtr screen)
glamor_make_current(glamor_priv);
glGenBuffers(1, &glamor_priv->vbo);
+ if (glamor_priv->has_vertex_array_object) {
+ glGenVertexArrays(1, &glamor_priv->vao);
+ glBindVertexArray(glamor_priv->vao);
+ } else
+ glamor_priv->vao = 0;
}
void
@@ -171,7 +188,10 @@ glamor_fini_vbo(ScreenPtr screen)
glamor_make_current(glamor_priv);
- glDeleteBuffers(1, &glamor_priv->vbo);
+ if (glamor_priv->vao != 0) {
+ glDeleteVertexArrays(1, &glamor_priv->vao);
+ glamor_priv->vao = 0;
+ }
if (!glamor_priv->has_map_buffer_range)
free(glamor_priv->vb);
}
diff --git a/xserver/glamor/glamor_window.c b/xserver/glamor/glamor_window.c
index 60647bf80..5fd463b43 100644
--- a/xserver/glamor/glamor_window.c
+++ b/xserver/glamor/glamor_window.c
@@ -65,35 +65,3 @@ glamor_change_window_attributes(WindowPtr pWin, unsigned long mask)
}
return TRUE;
}
-
-void
-glamor_set_window_pixmap(WindowPtr win, PixmapPtr pPixmap)
-{
- ScreenPtr screen = win->drawable.pScreen;
- glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
- PixmapPtr old = screen->GetWindowPixmap(win);
-
- if (pPixmap != old) {
- glamor_pixmap_private *pixmap_priv;
- PicturePtr pic = NULL;
-
- pixmap_priv = glamor_get_pixmap_private(old);
- if (GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) &&
- pixmap_priv->base.picture->pDrawable == (DrawablePtr) win) {
- pic = pixmap_priv->base.picture;
- pixmap_priv->base.is_picture = 0;
- pixmap_priv->base.picture = NULL;
- }
-
- pixmap_priv = glamor_get_pixmap_private(pPixmap);
- if (pixmap_priv) {
- pixmap_priv->base.is_picture = ! !pic;
- pixmap_priv->base.picture = pic;
- }
- }
-
- screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap;
- (screen->SetWindowPixmap) (win, pPixmap);
- glamor_priv->saved_procs.set_window_pixmap = screen->SetWindowPixmap;
- screen->SetWindowPixmap = glamor_set_window_pixmap;
-}
diff --git a/xserver/glamor/glamor_xv.c b/xserver/glamor/glamor_xv.c
index 83e24adb2..3bcf909b0 100644
--- a/xserver/glamor/glamor_xv.c
+++ b/xserver/glamor/glamor_xv.c
@@ -37,6 +37,8 @@
#endif
#include "glamor_priv.h"
+#include "glamor_transform.h"
+#include "glamor_transfer.h"
#include <X11/extensions/Xv.h>
#include "../hw/xfree86/common/fourcc.h"
@@ -57,36 +59,36 @@ typedef struct tagREF_TRANSFORM {
#define RTFContrast(a) (1.0 + ((a)*1.0)/1000.0)
#define RTFHue(a) (((a)*3.1416)/1000.0)
-static const char *xv_vs = "attribute vec4 v_position;\n"
- "attribute vec4 v_texcoord0;\n"
- "varying vec2 tcs;\n"
- "void main()\n"
- "{\n"
- " gl_Position = v_position;\n"
- "tcs = v_texcoord0.xy;\n"
- "}\n";
-
-static const char *xv_ps = GLAMOR_DEFAULT_PRECISION
- "uniform sampler2D y_sampler;\n"
- "uniform sampler2D u_sampler;\n"
- "uniform sampler2D v_sampler;\n"
- "uniform vec4 offsetyco;\n"
- "uniform vec4 ucogamma;\n"
- "uniform vec4 vco;\n"
- "varying vec2 tcs;\n"
- "float sample;\n"
- "vec4 temp1;\n"
- "void main()\n"
- "{\n"
- "sample = texture2D(y_sampler, tcs).w;\n"
- "temp1.xyz = offsetyco.www * vec3(sample) + offsetyco.xyz;\n"
- "sample = texture2D(u_sampler, tcs).w;\n"
- "temp1.xyz = ucogamma.xyz * vec3(sample) + temp1.xyz;\n"
- "sample = texture2D(v_sampler, tcs).w;\n"
- "temp1.xyz = clamp(vco.xyz * vec3(sample) + temp1.xyz, 0.0, 1.0);\n"
- "temp1.w = 1.0;\n"
- "gl_FragColor = temp1;\n"
- "}\n";
+static const glamor_facet glamor_facet_xv_planar = {
+ .name = "xv_planar",
+
+ .source_name = "v_texcoord0",
+ .vs_vars = ("attribute vec2 position;\n"
+ "attribute vec2 v_texcoord0;\n"
+ "varying vec2 tcs;\n"),
+ .vs_exec = (GLAMOR_POS(gl_Position, position)
+ " tcs = v_texcoord0;\n"),
+
+ .fs_vars = ("uniform sampler2D y_sampler;\n"
+ "uniform sampler2D u_sampler;\n"
+ "uniform sampler2D v_sampler;\n"
+ "uniform vec4 offsetyco;\n"
+ "uniform vec4 ucogamma;\n"
+ "uniform vec4 vco;\n"
+ "varying vec2 tcs;\n"),
+ .fs_exec = (
+ " float sample;\n"
+ " vec4 temp1;\n"
+ " sample = texture2D(y_sampler, tcs).w;\n"
+ " temp1.xyz = offsetyco.www * vec3(sample) + offsetyco.xyz;\n"
+ " sample = texture2D(u_sampler, tcs).w;\n"
+ " temp1.xyz = ucogamma.xyz * vec3(sample) + temp1.xyz;\n"
+ " sample = texture2D(v_sampler, tcs).w;\n"
+ " temp1.xyz = clamp(vco.xyz * vec3(sample) + temp1.xyz, 0.0, 1.0);\n"
+ " temp1.w = 1.0;\n"
+ " gl_FragColor = temp1;\n"
+ ),
+};
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
@@ -112,23 +114,21 @@ int glamor_xv_num_images = ARRAY_SIZE(glamor_xv_images);
static void
glamor_init_xv_shader(ScreenPtr screen)
{
- glamor_screen_private *glamor_priv;
- GLint fs_prog, vs_prog;
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+ GLint sampler_loc;
+
+ glamor_build_program(screen,
+ &glamor_priv->xv_prog,
+ &glamor_facet_xv_planar, NULL, NULL, NULL);
+
+ glUseProgram(glamor_priv->xv_prog.prog);
+ sampler_loc = glGetUniformLocation(glamor_priv->xv_prog.prog, "y_sampler");
+ glUniform1i(sampler_loc, 0);
+ sampler_loc = glGetUniformLocation(glamor_priv->xv_prog.prog, "u_sampler");
+ glUniform1i(sampler_loc, 1);
+ sampler_loc = glGetUniformLocation(glamor_priv->xv_prog.prog, "v_sampler");
+ glUniform1i(sampler_loc, 2);
- glamor_priv = glamor_get_screen_private(screen);
- glamor_make_current(glamor_priv);
- glamor_priv->xv_prog = glCreateProgram();
-
- vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, xv_vs);
- fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, xv_ps);
- glAttachShader(glamor_priv->xv_prog, vs_prog);
- glAttachShader(glamor_priv->xv_prog, fs_prog);
-
- glBindAttribLocation(glamor_priv->xv_prog,
- GLAMOR_VERTEX_POS, "v_position");
- glBindAttribLocation(glamor_priv->xv_prog,
- GLAMOR_VERTEX_SOURCE, "v_texcoord0");
- glamor_link_glsl_prog(screen, glamor_priv->xv_prog, "xv");
}
#define ClipValue(v,min,max) ((v) < (min) ? (min) : (v) > (max) ? (max) : (v))
@@ -241,14 +241,11 @@ glamor_xv_render(glamor_port_private *port_priv)
{
ScreenPtr screen = port_priv->pPixmap->drawable.pScreen;
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
- glamor_pixmap_private *pixmap_priv =
- glamor_get_pixmap_private(port_priv->pPixmap);
+ PixmapPtr pixmap = port_priv->pPixmap;
+ glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
glamor_pixmap_private *src_pixmap_priv[3];
- float vertices[32], texcoords[8];
BoxPtr box = REGION_RECTS(&port_priv->clip);
int nBox = REGION_NUM_RECTS(&port_priv->clip);
- int dst_x_off, dst_y_off;
- GLfloat dst_xscale, dst_yscale;
GLfloat src_xscale[3], src_yscale[3];
int i;
const float Loff = -0.0627;
@@ -258,9 +255,12 @@ glamor_xv_render(glamor_port_private *port_priv)
float uco[3], vco[3], off[3];
float bright, cont, gamma;
int ref = port_priv->transform_index;
- GLint uloc, sampler_loc;
+ GLint uloc;
+ GLfloat *v;
+ char *vbo_offset;
+ int dst_box_index;
- if (!glamor_priv->xv_prog)
+ if (!glamor_priv->xv_prog.prog)
glamor_init_xv_shader(screen);
cont = RTFContrast(port_priv->contrast);
@@ -282,10 +282,7 @@ glamor_xv_render(glamor_port_private *port_priv)
off[2] = Loff * yco + Coff * (uco[2] + vco[2]) + bright;
gamma = 1.0;
- pixmap_priv_get_dest_scale(pixmap_priv, &dst_xscale, &dst_yscale);
- glamor_get_drawable_deltas(port_priv->pDraw, port_priv->pPixmap, &dst_x_off,
- &dst_y_off);
- glamor_set_destination_pixmap_priv_nc(pixmap_priv);
+ glamor_set_alu(screen, GXcopy);
for (i = 0; i < 3; i++) {
if (port_priv->src_pix[i]) {
@@ -296,90 +293,101 @@ glamor_xv_render(glamor_port_private *port_priv)
}
}
glamor_make_current(glamor_priv);
- glUseProgram(glamor_priv->xv_prog);
+ glUseProgram(glamor_priv->xv_prog.prog);
- uloc = glGetUniformLocation(glamor_priv->xv_prog, "offsetyco");
+ uloc = glGetUniformLocation(glamor_priv->xv_prog.prog, "offsetyco");
glUniform4f(uloc, off[0], off[1], off[2], yco);
- uloc = glGetUniformLocation(glamor_priv->xv_prog, "ucogamma");
+ uloc = glGetUniformLocation(glamor_priv->xv_prog.prog, "ucogamma");
glUniform4f(uloc, uco[0], uco[1], uco[2], gamma);
- uloc = glGetUniformLocation(glamor_priv->xv_prog, "vco");
+ uloc = glGetUniformLocation(glamor_priv->xv_prog.prog, "vco");
glUniform4f(uloc, vco[0], vco[1], vco[2], 0);
glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, src_pixmap_priv[0]->base.fbo->tex);
+ glBindTexture(GL_TEXTURE_2D, src_pixmap_priv[0]->fbo->tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, src_pixmap_priv[1]->base.fbo->tex);
+ glBindTexture(GL_TEXTURE_2D, src_pixmap_priv[1]->fbo->tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glActiveTexture(GL_TEXTURE2);
- glBindTexture(GL_TEXTURE_2D, src_pixmap_priv[2]->base.fbo->tex);
+ glBindTexture(GL_TEXTURE_2D, src_pixmap_priv[2]->fbo->tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- sampler_loc = glGetUniformLocation(glamor_priv->xv_prog, "y_sampler");
- glUniform1i(sampler_loc, 0);
- sampler_loc = glGetUniformLocation(glamor_priv->xv_prog, "u_sampler");
- glUniform1i(sampler_loc, 1);
- sampler_loc = glGetUniformLocation(glamor_priv->xv_prog, "v_sampler");
- glUniform1i(sampler_loc, 2);
+ glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
+ glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
+
+ glEnable(GL_SCISSOR_TEST);
+
+ v = glamor_get_vbo_space(screen, 3 * 4 * sizeof(GLfloat), &vbo_offset);
+
+ /* Set up a single primitive covering the area being drawn. We'll
+ * clip it to port_priv->clip using GL scissors instead of just
+ * emitting a GL_QUAD per box, because this way we hopefully avoid
+ * diagonal tearing between the two trangles used to rasterize a
+ * GL_QUAD.
+ */
+ i = 0;
+ v[i++] = port_priv->drw_x;
+ v[i++] = port_priv->drw_y;
+
+ v[i++] = port_priv->drw_x + port_priv->dst_w * 2;
+ v[i++] = port_priv->drw_y;
+
+ v[i++] = port_priv->drw_x;
+ v[i++] = port_priv->drw_y + port_priv->dst_h * 2;
+
+ v[i++] = t_from_x_coord_x(src_xscale[0], port_priv->src_x);
+ v[i++] = t_from_x_coord_y(src_yscale[0], port_priv->src_y);
+
+ v[i++] = t_from_x_coord_x(src_xscale[0], port_priv->src_x +
+ port_priv->src_w * 2);
+ v[i++] = t_from_x_coord_y(src_yscale[0], port_priv->src_y);
+
+ v[i++] = t_from_x_coord_x(src_xscale[0], port_priv->src_x);
+ v[i++] = t_from_x_coord_y(src_yscale[0], port_priv->src_y +
+ port_priv->src_h * 2);
+
+ glVertexAttribPointer(GLAMOR_VERTEX_POS, 2,
+ GL_FLOAT, GL_FALSE,
+ 2 * sizeof(float), vbo_offset);
glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2,
GL_FLOAT, GL_FALSE,
- 2 * sizeof(float), texcoords);
- glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
+ 2 * sizeof(float), vbo_offset + 6 * sizeof(GLfloat));
- glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT,
- GL_FALSE, 2 * sizeof(float), vertices);
+ glamor_put_vbo_space(screen);
- glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
- glEnable(GL_SCISSOR_TEST);
- for (i = 0; i < nBox; i++) {
- float off_x = box[i].x1 - port_priv->drw_x;
- float off_y = box[i].y1 - port_priv->drw_y;
- float diff_x = (float) port_priv->src_w / (float) port_priv->dst_w;
- float diff_y = (float) port_priv->src_h / (float) port_priv->dst_h;
- float srcx, srcy, srcw, srch;
- int dstx, dsty, dstw, dsth;
-
- dstx = box[i].x1 + dst_x_off;
- dsty = box[i].y1 + dst_y_off;
- dstw = box[i].x2 - box[i].x1;
- dsth = box[i].y2 - box[i].y1;
-
- srcx = port_priv->src_x + off_x * diff_x;
- srcy = port_priv->src_y + off_y * diff_y;
- srcw = (port_priv->src_w * dstw) / (float) port_priv->dst_w;
- srch = (port_priv->src_h * dsth) / (float) port_priv->dst_h;
-
- glamor_set_normalize_vcoords(pixmap_priv,
- dst_xscale, dst_yscale,
- dstx - dstw,
- dsty,
- dstx + dstw,
- dsty + dsth * 2,
- vertices);
-
- glamor_set_normalize_tcoords(src_pixmap_priv[0],
- src_xscale[0],
- src_yscale[0],
- srcx - srcw,
- srcy,
- srcx + srcw,
- srcy + srch * 2,
- texcoords);
-
- glScissor(dstx, dsty, dstw, dsth);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 3);
+ /* Now draw our big triangle, clipped to each of the clip boxes. */
+ glamor_pixmap_loop(pixmap_priv, dst_box_index) {
+ int dst_off_x, dst_off_y;
+
+ glamor_set_destination_drawable(port_priv->pDraw,
+ dst_box_index,
+ FALSE, FALSE,
+ glamor_priv->xv_prog.matrix_uniform,
+ &dst_off_x, &dst_off_y);
+
+ for (i = 0; i < nBox; i++) {
+ int dstx, dsty, dstw, dsth;
+
+ dstx = box[i].x1 + dst_off_x;
+ dsty = box[i].y1 + dst_off_y;
+ dstw = box[i].x2 - box[i].x1;
+ dsth = box[i].y2 - box[i].y1;
+
+ glScissor(dstx, dsty, dstw, dsth);
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 3);
+ }
}
glDisable(GL_SCISSOR_TEST);
@@ -409,6 +417,7 @@ glamor_xv_put_image(glamor_port_private *port_priv,
int srcPitch, srcPitch2;
int top, nlines;
int s2offset, s3offset, tmp;
+ BoxRec full_box, half_box;
s2offset = s3offset = srcPitch2 = 0;
@@ -451,20 +460,28 @@ glamor_xv_put_image(glamor_port_private *port_priv,
s2offset = s3offset;
s3offset = tmp;
}
- glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[0],
- 0, 0, width, nlines,
- srcPitch,
- buf + (top * srcPitch), 0);
-
- glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[1],
- 0, 0, width >> 1, (nlines + 1) >> 1,
- srcPitch2,
- buf + s2offset, 0);
-
- glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[2],
- 0, 0, width >> 1, (nlines + 1) >> 1,
- srcPitch2,
- buf + s3offset, 0);
+
+ full_box.x1 = 0;
+ full_box.y1 = 0;
+ full_box.x2 = width;
+ full_box.y2 = nlines;
+
+ half_box.x1 = 0;
+ half_box.y1 = 0;
+ half_box.x2 = width >> 1;
+ half_box.y2 = (nlines + 1) >> 1;
+
+ glamor_upload_boxes(port_priv->src_pix[0], &full_box, 1,
+ 0, 0, 0, 0,
+ buf + (top * srcPitch), srcPitch);
+
+ glamor_upload_boxes(port_priv->src_pix[1], &half_box, 1,
+ 0, 0, 0, 0,
+ buf + s2offset, srcPitch2);
+
+ glamor_upload_boxes(port_priv->src_pix[2], &half_box, 1,
+ 0, 0, 0, 0,
+ buf + s3offset, srcPitch2);
break;
default:
return BadMatch;
@@ -478,7 +495,7 @@ glamor_xv_put_image(glamor_port_private *port_priv,
RegionCopy(&port_priv->clip, clipBoxes);
port_priv->src_x = src_x;
- port_priv->src_y = src_y;
+ port_priv->src_y = src_y - top;
port_priv->src_w = src_w;
port_priv->src_h = src_h;
port_priv->dst_w = drw_w;
diff --git a/xserver/glx/Makefile.in b/xserver/glx/Makefile.in
index ab5fcd453..d2759ef04 100644
--- a/xserver/glx/Makefile.in
+++ b/xserver/glx/Makefile.in
@@ -59,8 +59,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -232,7 +231,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -362,8 +360,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/glx/createcontext.c b/xserver/glx/createcontext.c
index d06bc1f7f..9157e2fb8 100644
--- a/xserver/glx/createcontext.c
+++ b/xserver/glx/createcontext.c
@@ -254,36 +254,17 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
* GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; has more than one of
* these bits set; or if the implementation does not support the
* requested profile, then GLXBadProfileARB is generated."
+ *
+ * The GLX_EXT_create_context_es2_profile spec doesn't exactly say what
+ * is supposed to happen if an invalid version is set, but it doesn't
+ * much matter as support for GLES contexts is only defined for direct
+ * contexts (at the moment anyway) so we can leave it up to the driver
+ * to validate.
*/
switch (profile) {
case GLX_CONTEXT_CORE_PROFILE_BIT_ARB:
case GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB:
- break;
case GLX_CONTEXT_ES2_PROFILE_BIT_EXT:
- /* The GLX_EXT_create_context_es2_profile spec says:
- *
- * "... If the version requested is 2.0, and the
- * GLX_CONTEXT_ES2_PROFILE_BIT_EXT bit is set in the
- * GLX_CONTEXT_PROFILE_MASK_ARB attribute (see below), then the
- * context returned will implement OpenGL ES 2.0."
- *
- * It also says:
- *
- * "* If attribute GLX_CONTEXT_PROFILE_MASK_ARB has no bits set;
- * has any bits set other than
- * GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
- * GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, or
- * GLX_CONTEXT_ES2_PROFILE_BIT_EXT; has more than one of these
- * bits set; or if the implementation does not supported the
- * requested profile, then GLXBadProfileARB is generated."
- *
- * It does not specifically say what is supposed to happen if
- * GLX_CONTEXT_ES2_PROFILE_BIT_EXT is set but the version requested is
- * not 2.0. We choose to generate GLXBadProfileARB as this matches
- * NVIDIA's behavior.
- */
- if (major_version != 2 || minor_version != 0)
- return __glXError(GLXBadProfileARB);
break;
default:
return __glXError(GLXBadProfileARB);
diff --git a/xserver/glx/extension_string.c b/xserver/glx/extension_string.c
index e881d2109..616c7932e 100644
--- a/xserver/glx/extension_string.c
+++ b/xserver/glx/extension_string.c
@@ -80,9 +80,12 @@ static const struct extension_info known_glx_extensions[] = {
{ GLX(ARB_framebuffer_sRGB), VER(0,0), N, },
{ GLX(ARB_multisample), VER(1,4), Y, },
+ { GLX(EXT_create_context_es_profile), VER(0,0), N, },
{ GLX(EXT_create_context_es2_profile), VER(0,0), N, },
+ { 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_stereo_tree), VER(0,0), N, },
{ GLX(EXT_texture_from_pixmap), VER(0,0), Y, },
{ GLX(EXT_visual_info), VER(0,0), Y, },
{ GLX(EXT_visual_rating), VER(0,0), Y, },
diff --git a/xserver/glx/extension_string.h b/xserver/glx/extension_string.h
index bac7b0624..425a8058b 100644
--- a/xserver/glx/extension_string.h
+++ b/xserver/glx/extension_string.h
@@ -43,8 +43,11 @@ enum {
ARB_fbconfig_float_bit,
ARB_framebuffer_sRGB_bit,
ARB_multisample_bit,
+ EXT_create_context_es_profile_bit,
EXT_create_context_es2_profile_bit,
+ EXT_fbconfig_packed_float_bit,
EXT_import_context_bit,
+ EXT_stereo_tree_bit,
EXT_texture_from_pixmap_bit,
EXT_visual_info_bit,
EXT_visual_rating_bit,
diff --git a/xserver/glx/glxcmds.c b/xserver/glx/glxcmds.c
index 0416dac09..561faebb4 100644
--- a/xserver/glx/glxcmds.c
+++ b/xserver/glx/glxcmds.c
@@ -544,7 +544,6 @@ __glXGetDrawable(__GLXcontext * glxc, GLXDrawable drawId, ClientPtr client,
/* since we are creating the drawablePrivate, drawId should be new */
if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) {
- pGlxDraw->destroy(pGlxDraw);
*error = BadAlloc;
return NULL;
}
@@ -1239,20 +1238,16 @@ DoCreateGLXDrawable(ClientPtr client, __GLXscreen * pGlxScreen,
if (pGlxDraw == NULL)
return BadAlloc;
- if (!AddResource(glxDrawableId, __glXDrawableRes, pGlxDraw)) {
- pGlxDraw->destroy(pGlxDraw);
+ if (!AddResource(glxDrawableId, __glXDrawableRes, pGlxDraw))
return BadAlloc;
- }
/*
* Windows aren't refcounted, so track both the X and the GLX window
* so we get called regardless of destruction order.
*/
if (drawableId != glxDrawableId && type == GLX_DRAWABLE_WINDOW &&
- !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw)) {
- pGlxDraw->destroy(pGlxDraw);
+ !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw))
return BadAlloc;
- }
return Success;
}
@@ -1926,6 +1921,11 @@ __glXDisp_CopySubBufferMESA(__GLXclientState * cl, GLbyte * pc)
return Success;
}
+/* hack for old glxext.h */
+#ifndef GLX_STEREO_TREE_EXT
+#define GLX_STEREO_TREE_EXT 0x20F5
+#endif
+
/*
** Get drawable attributes
*/
@@ -1936,7 +1936,7 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
xGLXGetDrawableAttributesReply reply;
__GLXdrawable *pGlxDraw = NULL;
DrawablePtr pDraw;
- CARD32 attributes[14];
+ CARD32 attributes[18];
int num = 0, error;
if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
@@ -1950,33 +1950,30 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
if (pGlxDraw)
pDraw = pGlxDraw->pDraw;
- attributes[2*num] = GLX_Y_INVERTED_EXT;
- attributes[2*num+1] = GL_FALSE;
- num++;
- attributes[2*num] = GLX_WIDTH;
- attributes[2*num+1] = pDraw->width;
- num++;
- attributes[2*num] = GLX_HEIGHT;
- attributes[2*num+1] = pDraw->height;
- num++;
+#define ATTRIB(a, v) do { \
+ attributes[2*num] = (a); \
+ attributes[2*num+1] = (v); \
+ num++; \
+ } while (0)
+
+ ATTRIB(GLX_Y_INVERTED_EXT, GL_FALSE);
+ ATTRIB(GLX_WIDTH, pDraw->width);
+ ATTRIB(GLX_HEIGHT, pDraw->height);
+ ATTRIB(GLX_SCREEN, pDraw->pScreen->myNum);
if (pGlxDraw) {
- attributes[2*num] = GLX_TEXTURE_TARGET_EXT;
- attributes[2*num+1] = pGlxDraw->target == GL_TEXTURE_2D ?
- GLX_TEXTURE_2D_EXT :
- GLX_TEXTURE_RECTANGLE_EXT;
- num++;
- attributes[2*num] = GLX_EVENT_MASK;
- attributes[2*num+1] = pGlxDraw->eventMask;
- num++;
- attributes[2*num] = GLX_FBCONFIG_ID;
- attributes[2*num+1] = pGlxDraw->config->fbconfigID;
- num++;
+ ATTRIB(GLX_TEXTURE_TARGET_EXT,
+ pGlxDraw->target == GL_TEXTURE_2D ?
+ GLX_TEXTURE_2D_EXT : GLX_TEXTURE_RECTANGLE_EXT);
+ ATTRIB(GLX_EVENT_MASK, pGlxDraw->eventMask);
+ ATTRIB(GLX_FBCONFIG_ID, pGlxDraw->config->fbconfigID);
if (pGlxDraw->type == GLX_DRAWABLE_PBUFFER) {
- attributes[2*num] = GLX_PRESERVED_CONTENTS;
- attributes[2*num+1] = GL_TRUE;
- num++;
+ ATTRIB(GLX_PRESERVED_CONTENTS, GL_TRUE);
+ }
+ if (pGlxDraw->type == GLX_DRAWABLE_WINDOW) {
+ ATTRIB(GLX_STEREO_TREE_EXT, 0);
}
}
+#undef ATTRIB
reply = (xGLXGetDrawableAttributesReply) {
.type = X_Reply,
diff --git a/xserver/glx/glxdri2.c b/xserver/glx/glxdri2.c
index 6fb3d9278..58e60b976 100644
--- a/xserver/glx/glxdri2.c
+++ b/xserver/glx/glxdri2.c
@@ -864,11 +864,13 @@ initializeExtensions(__GLXDRIscreen * screen)
__glXEnableExtension(screen->glx_enable_bits,
"GLX_ARB_create_context_profile");
__glXEnableExtension(screen->glx_enable_bits,
+ "GLX_EXT_create_context_es_profile");
+ __glXEnableExtension(screen->glx_enable_bits,
"GLX_EXT_create_context_es2_profile");
LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context\n");
LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context_profile\n");
LogMessage(X_INFO,
- "AIGLX: enabled GLX_EXT_create_context_es2_profile\n");
+ "AIGLX: enabled GLX_EXT_create_context_es{,2}_profile\n");
}
if (DRI2HasSwapControl(pScreen)) {
@@ -893,6 +895,12 @@ initializeExtensions(__GLXDRIscreen * screen)
LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_fbconfig_float\n");
}
+ /* enable EXT_fbconfig_packed_float (even if there are no packed float fbconfigs) */
+ {
+ __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_fbconfig_packed_float");
+ LogMessage(X_INFO, "AIGLX: enabled GLX_EXT_fbconfig_packed_float\n");
+ }
+
for (i = 0; extensions[i]; i++) {
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
__glXEnableExtension(screen->glx_enable_bits,
diff --git a/xserver/glx/glxdriswrast.c b/xserver/glx/glxdriswrast.c
index e8e53bfdb..924067c79 100644
--- a/xserver/glx/glxdriswrast.c
+++ b/xserver/glx/glxdriswrast.c
@@ -405,12 +405,15 @@ initializeExtensions(__GLXDRIscreen * screen)
__glXEnableExtension(screen->glx_enable_bits,
"GLX_ARB_create_context_profile");
__glXEnableExtension(screen->glx_enable_bits,
+ "GLX_EXT_create_context_es_profile");
+ __glXEnableExtension(screen->glx_enable_bits,
"GLX_EXT_create_context_es2_profile");
}
/* these are harmless to enable unconditionally */
__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");
extensions = screen->core->getExtensions(screen->driScreen);
diff --git a/xserver/glx/rensize.c b/xserver/glx/rensize.c
index 6bfe99b2a..55ad4a2af 100644
--- a/xserver/glx/rensize.c
+++ b/xserver/glx/rensize.c
@@ -240,6 +240,7 @@ __glXImageSize(GLenum format, GLenum type, GLenum target,
case GL_422_REV_AVERAGE_EXT:
case GL_DEPTH_STENCIL_NV:
case GL_DEPTH_STENCIL_MESA:
+ case GL_YCBCR_422_APPLE:
case GL_YCBCR_MESA:
case GL_LUMINANCE_ALPHA:
case GL_LUMINANCE_ALPHA_INTEGER_EXT:
diff --git a/xserver/glx/single2.c b/xserver/glx/single2.c
index a6ea614fd..acc66ac07 100644
--- a/xserver/glx/single2.c
+++ b/xserver/glx/single2.c
@@ -62,9 +62,8 @@ __glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
size = *(GLsizei *) (pc + 0);
type = *(GLenum *) (pc + 4);
if (cx->feedbackBufSize < size) {
- cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf,
- (size_t) size
- * __GLX_SIZE_FLOAT32);
+ cx->feedbackBuf = reallocarray(cx->feedbackBuf,
+ (size_t) size, __GLX_SIZE_FLOAT32);
if (!cx->feedbackBuf) {
cl->client->errorValue = size;
return BadAlloc;
@@ -94,8 +93,8 @@ __glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
pc += __GLX_SINGLE_HDR_SIZE;
size = *(GLsizei *) (pc + 0);
if (cx->selectBufSize < size) {
- cx->selectBuf = (GLuint *) realloc(cx->selectBuf,
- (size_t) size * __GLX_SIZE_CARD32);
+ cx->selectBuf = reallocarray(cx->selectBuf,
+ (size_t) size, __GLX_SIZE_CARD32);
if (!cx->selectBuf) {
cl->client->errorValue = size;
return BadAlloc;
diff --git a/xserver/glx/single2swap.c b/xserver/glx/single2swap.c
index 53490694b..d5bb1c03c 100644
--- a/xserver/glx/single2swap.c
+++ b/xserver/glx/single2swap.c
@@ -63,9 +63,8 @@ __glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
size = *(GLsizei *) (pc + 0);
type = *(GLenum *) (pc + 4);
if (cx->feedbackBufSize < size) {
- cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf,
- (size_t) size
- * __GLX_SIZE_FLOAT32);
+ cx->feedbackBuf = reallocarray(cx->feedbackBuf,
+ (size_t) size, __GLX_SIZE_FLOAT32);
if (!cx->feedbackBuf) {
cl->client->errorValue = size;
return BadAlloc;
@@ -99,8 +98,8 @@ __glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
__GLX_SWAP_INT(pc + 0);
size = *(GLsizei *) (pc + 0);
if (cx->selectBufSize < size) {
- cx->selectBuf = (GLuint *) realloc(cx->selectBuf,
- (size_t) size * __GLX_SIZE_CARD32);
+ cx->selectBuf = reallocarray(cx->selectBuf,
+ (size_t) size, __GLX_SIZE_CARD32);
if (!cx->selectBuf) {
cl->client->errorValue = size;
return BadAlloc;
diff --git a/xserver/hw/Makefile.in b/xserver/hw/Makefile.in
index 05af07f58..6ef53dd6e 100644
--- a/xserver/hw/Makefile.in
+++ b/xserver/hw/Makefile.in
@@ -55,8 +55,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -220,7 +219,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -350,8 +348,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/dmx/Makefile.in b/xserver/hw/dmx/Makefile.in
index 2f69afbd7..9437e59a7 100644
--- a/xserver/hw/dmx/Makefile.in
+++ b/xserver/hw/dmx/Makefile.in
@@ -59,8 +59,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -280,7 +279,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -419,8 +417,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/dmx/config/Makefile.in b/xserver/hw/dmx/config/Makefile.in
index 8b4f03391..e6792b3f4 100644
--- a/xserver/hw/dmx/config/Makefile.in
+++ b/xserver/hw/dmx/config/Makefile.in
@@ -60,8 +60,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -295,7 +294,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -425,8 +423,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/dmx/config/dmxcompat.c b/xserver/hw/dmx/config/dmxcompat.c
index 107991a96..6d31b5300 100644
--- a/xserver/hw/dmx/config/dmxcompat.c
+++ b/xserver/hw/dmx/config/dmxcompat.c
@@ -123,7 +123,6 @@ dmxVDLRead(const char *filename)
DMXConfigSubPtr sub = NULL;
DMXConfigDisplayPtr display = NULL;
DMXConfigFullDimPtr fdim = NULL;
- int vcount = 0;
int dcount = 0;
int icount = 0;
int x, y, xoff, yoff, xorig, yorig;
@@ -167,7 +166,6 @@ dmxVDLRead(const char *filename)
state = virtualCount;
break;
case virtualCount:
- vcount = dmxVDLCount(buf);
state = virtualEntry;
break;
case virtualEntry:
diff --git a/xserver/hw/dmx/config/dmxconfig.c b/xserver/hw/dmx/config/dmxconfig.c
index 2cc9ab396..c1a9e1cf3 100644
--- a/xserver/hw/dmx/config/dmxconfig.c
+++ b/xserver/hw/dmx/config/dmxconfig.c
@@ -48,7 +48,7 @@
#include "dmxstat.h"
#include "parser.h"
-extern int yyparse(void);
+extern int yydebug;
extern FILE *yyin;
static char *dmxXkbRules;
@@ -204,8 +204,8 @@ dmxConfigAddDisplay(const char *name,
{
DMXScreenInfo *dmxScreen;
- if (!(dmxScreens = realloc(dmxScreens,
- (dmxNumScreens + 1) * sizeof(*dmxScreens))))
+ if (!(dmxScreens = reallocarray(dmxScreens, dmxNumScreens + 1,
+ sizeof(*dmxScreens))))
dmxLog(dmxFatal,
"dmxConfigAddDisplay: realloc failed for screen %d (%s)\n",
dmxNumScreens, name);
@@ -234,8 +234,8 @@ dmxConfigAddInput(const char *name, int core)
{
DMXInputInfo *dmxInput;
- if (!(dmxInputs = realloc(dmxInputs,
- (dmxNumInputs + 1) * sizeof(*dmxInputs))))
+ if (!(dmxInputs = reallocarray(dmxInputs, dmxNumInputs + 1,
+ sizeof(*dmxInputs))))
dmxLog(dmxFatal,
"dmxConfigAddInput: realloc failed for input %d (%s)\n",
dmxNumInputs, name);
@@ -341,7 +341,7 @@ dmxConfigCopyFromOption(DMXConfigOptionPtr o)
for (pt = o->option; pt; pt = pt->next) {
if (pt->string) {
++argc;
- argv = realloc(argv, (argc + 1) * sizeof(*argv));
+ argv = reallocarray(argv, argc + 1, sizeof(*argv));
argv[argc] = (char *) pt->string;
}
}
diff --git a/xserver/hw/dmx/config/dmxparse.h b/xserver/hw/dmx/config/dmxparse.h
index cc2f0eb71..a64b36f70 100644
--- a/xserver/hw/dmx/config/dmxparse.h
+++ b/xserver/hw/dmx/config/dmxparse.h
@@ -200,8 +200,6 @@ typedef struct _DMXConfigEntry {
extern DMXConfigEntryPtr dmxConfigEntry;
-extern int yylex(void);
-extern int yydebug;
extern void yyerror(const char *message);
extern void dmxConfigLog(const char *format, ...) _X_ATTRIBUTE_PRINTF(1,0);
diff --git a/xserver/hw/dmx/config/dmxtodmx.c b/xserver/hw/dmx/config/dmxtodmx.c
index 66342091e..5a1a0b4b1 100644
--- a/xserver/hw/dmx/config/dmxtodmx.c
+++ b/xserver/hw/dmx/config/dmxtodmx.c
@@ -38,6 +38,7 @@
#include "dmxcompat.h"
extern int yyparse(void);
+extern int yydebug;
extern FILE *yyin;
int
diff --git a/xserver/hw/dmx/config/man/Makefile.in b/xserver/hw/dmx/config/man/Makefile.in
index 98146644b..90c4e53ce 100644
--- a/xserver/hw/dmx/config/man/Makefile.in
+++ b/xserver/hw/dmx/config/man/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -213,7 +212,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -360,8 +358,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/dmx/config/parser.y b/xserver/hw/dmx/config/parser.y
index ac2441017..fa041a1c9 100644
--- a/xserver/hw/dmx/config/parser.y
+++ b/xserver/hw/dmx/config/parser.y
@@ -44,6 +44,7 @@
#define YYERROR_VERBOSE
#define YY_USE_PROTOS
+extern int yylex(void);
DMXConfigEntryPtr dmxConfigEntry = NULL;
#define APPEND(type, h, t) \
{ \
diff --git a/xserver/hw/dmx/config/scanner.l b/xserver/hw/dmx/config/scanner.l
index e527d6df5..3688fd71d 100644
--- a/xserver/hw/dmx/config/scanner.l
+++ b/xserver/hw/dmx/config/scanner.l
@@ -84,10 +84,12 @@ param return gettoken(T_PARAM, yytext, yyleng);
%%
int yywrap(void)
{
+ (void) &yyunput;
+ (void) &input;
return 1;
}
-void yyerror(const char *message)
+_X_NORETURN void yyerror(const char *message)
{
const char *pt, *end;
struct _entry {
@@ -109,7 +111,7 @@ void yyerror(const char *message)
};
fprintf(stderr, "parse error on line %d at token \"%*.*s\"\n",
- lineno, yyleng, yyleng, yytext);
+ lineno, (int)yyleng, (int)yyleng, yytext);
end = message + strlen(message);
for (pt = message; *pt; pt++) {
if (pt[0] == 'T' && pt[1] == '_') {
diff --git a/xserver/hw/dmx/config/xdmxconfig.c b/xserver/hw/dmx/config/xdmxconfig.c
index 0540d0173..49e4b5459 100644
--- a/xserver/hw/dmx/config/xdmxconfig.c
+++ b/xserver/hw/dmx/config/xdmxconfig.c
@@ -53,6 +53,7 @@
#include "dmxlog.h"
extern int yyparse(void);
+extern int yydebug;
extern FILE *yyin;
#define DMX_INFO "xdmxconfig v0.9\nCopyright 2002 Red Hat Inc.\n"
diff --git a/xserver/hw/dmx/dmx.c b/xserver/hw/dmx/dmx.c
index 2988df33a..9729963da 100644
--- a/xserver/hw/dmx/dmx.c
+++ b/xserver/hw/dmx/dmx.c
@@ -427,7 +427,7 @@ ProcDMXChangeScreensAttributes(ClientPtr client)
if (!_DMXXineramaActive())
goto noxinerama;
- if (!(attribs = malloc(stuff->screenCount * sizeof(*attribs))))
+ if (!(attribs = xallocarray(stuff->screenCount, sizeof(*attribs))))
return BadAlloc;
for (i = 0; i < stuff->screenCount; i++) {
@@ -624,18 +624,18 @@ ProcDMXGetWindowAttributes(ClientPtr client)
REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
- if (!(screens = malloc(count * sizeof(*screens))))
+ if (!(screens = xallocarray(count, sizeof(*screens))))
return BadAlloc;
- if (!(windows = malloc(count * sizeof(*windows)))) {
+ if (!(windows = xallocarray(count, sizeof(*windows)))) {
free(screens);
return BadAlloc;
}
- if (!(pos = malloc(count * sizeof(*pos)))) {
+ if (!(pos = xallocarray(count, sizeof(*pos)))) {
free(windows);
free(screens);
return BadAlloc;
}
- if (!(vis = malloc(count * sizeof(*vis)))) {
+ if (!(vis = xallocarray(count, sizeof(*vis)))) {
free(pos);
free(windows);
free(screens);
diff --git a/xserver/hw/dmx/dmxcmap.c b/xserver/hw/dmx/dmxcmap.c
index 450627b40..7a87a9864 100644
--- a/xserver/hw/dmx/dmxcmap.c
+++ b/xserver/hw/dmx/dmxcmap.c
@@ -177,7 +177,7 @@ dmxStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef)
dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap);
if (dmxScreen->beDisplay && (pColormap->pVisual->class & DynamicClass)) {
- XColor *color = malloc(sizeof(*color) * ndef);
+ XColor *color = xallocarray(ndef, sizeof(*color));
int i;
if (color) {
diff --git a/xserver/hw/dmx/dmxcursor.c b/xserver/hw/dmx/dmxcursor.c
index 70f2bc4b4..0ef800e39 100644
--- a/xserver/hw/dmx/dmxcursor.c
+++ b/xserver/hw/dmx/dmxcursor.c
@@ -203,7 +203,7 @@ miPointerScreenFuncRec dmxPointerCursorFuncs = {
static int *
dmxSLCreate(void)
{
- int *list = malloc(dmxNumScreens * sizeof(*list));
+ int *list = xallocarray(dmxNumScreens, sizeof(*list));
int i;
for (i = 0; i < dmxNumScreens; i++)
diff --git a/xserver/hw/dmx/dmxextension.c b/xserver/hw/dmx/dmxextension.c
index fcc97e3df..75d7166f3 100644
--- a/xserver/hw/dmx/dmxextension.c
+++ b/xserver/hw/dmx/dmxextension.c
@@ -1188,8 +1188,8 @@ dmxBERestoreRenderGlyph(void *value, XID id, void *n)
/* Now allocate the memory we need */
images = calloc(len_images, sizeof(char));
- gids = malloc(glyphSet->hash.tableEntries * sizeof(Glyph));
- glyphs = malloc(glyphSet->hash.tableEntries * sizeof(XGlyphInfo));
+ gids = xallocarray(glyphSet->hash.tableEntries, sizeof(Glyph));
+ glyphs = xallocarray(glyphSet->hash.tableEntries, sizeof(XGlyphInfo));
pos = images;
ctr = 0;
diff --git a/xserver/hw/dmx/dmxfont.c b/xserver/hw/dmx/dmxfont.c
index 115422d41..25a04a6f0 100644
--- a/xserver/hw/dmx/dmxfont.c
+++ b/xserver/hw/dmx/dmxfont.c
@@ -72,7 +72,7 @@ dmxGetFontPath(int *npaths)
newfp = malloc(*npaths + len);
c = (unsigned char *) newfp;
- fp = malloc(*npaths * sizeof(*fp));
+ fp = xallocarray(*npaths, sizeof(*fp));
memmove(newfp, paths + 1, *npaths + len - 1);
l = *paths;
@@ -306,7 +306,7 @@ dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont)
if (!dmxFontPath)
dmxLog(dmxWarning, "No default font path is set.\n");
- goodfps = malloc(npaths * sizeof(*goodfps));
+ goodfps = xallocarray(npaths, sizeof(*goodfps));
dmxLog(dmxError,
"The DMX server failed to set the following font paths on "
@@ -354,7 +354,7 @@ dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont)
return FALSE;
}
- newfp = malloc(len * sizeof(*newfp));
+ newfp = xallocarray(len, sizeof(*newfp));
for (i = 0; i < npaths; i++) {
if (goodfps[i]) {
int n = strlen(fp[i]);
diff --git a/xserver/hw/dmx/dmxgc.c b/xserver/hw/dmx/dmxgc.c
index ec15d27aa..c4789a607 100644
--- a/xserver/hw/dmx/dmxgc.c
+++ b/xserver/hw/dmx/dmxgc.c
@@ -397,7 +397,7 @@ dmxChangeClip(GCPtr pGC, int type, void *pvalue, int nrects)
} else {
if (dmxScreen->beDisplay) {
nRects = RegionNumRects((RegionPtr) pGC->clientClip);
- pRects = malloc(nRects * sizeof(*pRects));
+ pRects = xallocarray(nRects, sizeof(*pRects));
pBox = RegionRects((RegionPtr) pGC->clientClip);
for (i = 0; i < nRects; i++) {
diff --git a/xserver/hw/dmx/dmxinit.c b/xserver/hw/dmx/dmxinit.c
index 025dc8637..3d394c52b 100644
--- a/xserver/hw/dmx/dmxinit.c
+++ b/xserver/hw/dmx/dmxinit.c
@@ -438,7 +438,7 @@ dmxGetColormaps(DMXScreenInfo * dmxScreen)
int i;
dmxScreen->beNumDefColormaps = dmxScreen->beNumVisuals;
- dmxScreen->beDefColormaps = malloc(dmxScreen->beNumDefColormaps *
+ dmxScreen->beDefColormaps = xallocarray(dmxScreen->beNumDefColormaps,
sizeof(*dmxScreen->beDefColormaps));
for (i = 0; i < dmxScreen->beNumDefColormaps; i++)
@@ -793,7 +793,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
nconfigs = dmxScreen->numGlxVisuals;
}
- configprivs = malloc(nconfigs * sizeof(dmxGlxVisualPrivate *));
+ configprivs = xallocarray(nconfigs, sizeof(dmxGlxVisualPrivate *));
if (configs != NULL && configprivs != NULL) {
int j;
diff --git a/xserver/hw/dmx/dmxpict.c b/xserver/hw/dmx/dmxpict.c
index aaca178b9..1f1022ee6 100644
--- a/xserver/hw/dmx/dmxpict.c
+++ b/xserver/hw/dmx/dmxpict.c
@@ -390,7 +390,7 @@ dmxProcRenderAddGlyphs(ClientPtr client)
sizeof(xRenderAddGlyphsReq) -
(sizeof(CARD32) + sizeof(xGlyphInfo)) * nglyphs);
- gidsCopy = malloc(sizeof(*gidsCopy) * nglyphs);
+ gidsCopy = xallocarray(nglyphs, sizeof(*gidsCopy));
for (i = 0; i < nglyphs; i++)
gidsCopy[i] = gids[i];
@@ -434,7 +434,7 @@ dmxProcRenderFreeGlyphs(ClientPtr client)
nglyphs = ((client->req_len << 2) - sizeof(xRenderFreeGlyphsReq)) >> 2;
if (nglyphs) {
- gids = malloc(sizeof(*gids) * nglyphs);
+ gids = xallocarray(nglyphs, sizeof(*gids));
for (i = 0; i < nglyphs; i++)
gids[i] = ((CARD32 *) (stuff + 1))[i];
@@ -569,11 +569,11 @@ dmxProcRenderCompositeGlyphs(ClientPtr client)
/* The following only works for Render version > 0.2 */
/* All of the XGlyphElt* structure sizes are identical */
- elts = malloc(nelt * sizeof(XGlyphElt8));
+ elts = xallocarray(nelt, sizeof(XGlyphElt8));
if (!elts)
return BadAlloc;
- glyphs = malloc(nglyph * size);
+ glyphs = xallocarray(nglyph, size);
if (!glyphs) {
free(elts);
return BadAlloc;
@@ -925,7 +925,7 @@ dmxChangePictureClip(PicturePtr pPicture, int clipType, void *value, int n)
int nRects;
nRects = nBox;
- pRects = pRect = malloc(nRects * sizeof(*pRect));
+ pRects = pRect = xallocarray(nRects, sizeof(*pRect));
while (nBox--) {
pRect->x = pBox->x1;
diff --git a/xserver/hw/dmx/dmxprop.c b/xserver/hw/dmx/dmxprop.c
index 5e306d286..4c85268b7 100644
--- a/xserver/hw/dmx/dmxprop.c
+++ b/xserver/hw/dmx/dmxprop.c
@@ -171,7 +171,7 @@ dmxPropertyCheckOtherServers(DMXScreenInfo * dmxScreen, Atom atom)
dmxLogOutputWarning(dmxScreen,
"%s also running on %s\n",
tp.value, dmxScreen->name);
- list = realloc(list, ++count * sizeof(*list));
+ list = reallocarray(list, ++count, sizeof(*list));
list[count - 1] = malloc(tp.nitems + 2);
strncpy(list[count - 1], (char *) tp.value, tp.nitems + 1);
}
diff --git a/xserver/hw/dmx/dmxwindow.c b/xserver/hw/dmx/dmxwindow.c
index c157e1099..dcdb9ac60 100644
--- a/xserver/hw/dmx/dmxwindow.c
+++ b/xserver/hw/dmx/dmxwindow.c
@@ -969,7 +969,7 @@ dmxDoSetShape(WindowPtr pWindow)
if (wBoundingShape(pWindow)) {
pBox = RegionRects(wBoundingShape(pWindow));
nRect = nBox = RegionNumRects(wBoundingShape(pWindow));
- pRectFirst = pRect = malloc(nRect * sizeof(*pRect));
+ pRectFirst = pRect = xallocarray(nRect, sizeof(*pRect));
while (nBox--) {
pRect->x = pBox->x1;
pRect->y = pBox->y1;
@@ -992,7 +992,7 @@ dmxDoSetShape(WindowPtr pWindow)
if (wClipShape(pWindow)) {
pBox = RegionRects(wClipShape(pWindow));
nRect = nBox = RegionNumRects(wClipShape(pWindow));
- pRectFirst = pRect = malloc(nRect * sizeof(*pRect));
+ pRectFirst = pRect = xallocarray(nRect, sizeof(*pRect));
while (nBox--) {
pRect->x = pBox->x1;
pRect->y = pBox->y1;
diff --git a/xserver/hw/dmx/doc/Makefile.in b/xserver/hw/dmx/doc/Makefile.in
index f2120855e..273a5bce2 100644
--- a/xserver/hw/dmx/doc/Makefile.in
+++ b/xserver/hw/dmx/doc/Makefile.in
@@ -97,8 +97,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -225,7 +224,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -355,8 +353,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/dmx/doc/dmx.xml b/xserver/hw/dmx/doc/dmx.xml
index 6d7df4133..40b9e421c 100644
--- a/xserver/hw/dmx/doc/dmx.xml
+++ b/xserver/hw/dmx/doc/dmx.xml
@@ -8,7 +8,7 @@
<articleinfo>
<!-- Title information -->
- <title>Distributed Multihead X design</title>
+ <title>Distributed Multihead X Design</title>
<authorgroup>
<author><firstname>Kevin E.</firstname><surname>Martin</surname></author>
<author><firstname>David H.</firstname><surname>Dawes</surname></author>
diff --git a/xserver/hw/dmx/doxygen/Makefile.in b/xserver/hw/dmx/doxygen/Makefile.in
index 8b7c73849..d80219c17 100644
--- a/xserver/hw/dmx/doxygen/Makefile.in
+++ b/xserver/hw/dmx/doxygen/Makefile.in
@@ -78,8 +78,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -206,7 +205,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -336,8 +334,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/dmx/doxygen/doxygen.conf.in b/xserver/hw/dmx/doxygen/doxygen.conf.in
index 3dbb27ec0..d709c9bd1 100644
--- a/xserver/hw/dmx/doxygen/doxygen.conf.in
+++ b/xserver/hw/dmx/doxygen/doxygen.conf.in
@@ -1,96 +1,129 @@
-# Doxyfile 1.6.2
+# Doxyfile 1.8.10
# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
+# doxygen (www.doxygen.org) for a project.
#
-# All text after a hash (#) is considered a comment and will be ignored
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
PROJECT_NAME = "Distributed Multihead X"
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
PROJECT_NUMBER = "@PACKAGE_VERSION@"
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
OUTPUT_DIRECTORY =
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
CREATE_SUBDIRS = NO
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
OUTPUT_LANGUAGE = English
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
BRIEF_MEMBER_DESC = YES
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
+# The default value is: YES.
REPEAT_BRIEF = YES
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
+# doxygen will generate a detailed section even if there is only a brief
# description.
+# The default value is: NO.
ALWAYS_DETAILED_SEC = YES
@@ -98,528 +131,699 @@ ALWAYS_DETAILED_SEC = YES
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
+# The default value is: NO.
INLINE_INHERITED_MEMB = NO
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
FULL_PATH_NAMES = NO
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
STRIP_FROM_INC_PATH =
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
SHORT_NAMES = NO
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
JAVADOC_AUTOBRIEF = NO
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
QT_AUTOBRIEF = NO
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
INHERIT_DOCS = YES
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 8
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
ALIASES =
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = YES
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
-# Doxygen selects the parser to use depending on the extension of the files it parses.
-# With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this tag.
-# The format is ext=language, where ext is a file extension, and language is one of
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
+# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
+# Fortran. In the later case the parser tries to guess whether the code is fixed
+# or free formatted code, this is the default for Fortran type files), VHDL. For
+# instance to make doxygen treat .inc files as Fortran files (default is PHP),
+# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
EXTENSION_MAPPING =
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
+# The default value is: NO.
CPP_CLI_SUPPORT = NO
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
SIP_SUPPORT = NO
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
+# tag is set to YES then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
+# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
SUBGROUPING = YES
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
EXTRACT_ALL = YES
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
EXTRACT_PRIVATE = NO
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
EXTRACT_STATIC = YES
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
EXTRACT_LOCAL_CLASSES = YES
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_MEMBERS = YES
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO, these declarations will be
+# included in the documentation.
+# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
INTERNAL_DOCS = NO
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES, upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
CASE_SENSE_NAMES = YES
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
HIDE_SCOPE_NAMES = NO
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
SHOW_INCLUDE_FILES = YES
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
FORCE_LOCAL_INCLUDES = NO
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
INLINE_INFO = YES
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
SORT_MEMBER_DOCS = YES
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
SORT_BRIEF_DOCS = NO
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
SORT_MEMBERS_CTORS_1ST = NO
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
SORT_GROUP_NAMES = NO
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
SORT_BY_SCOPE_NAME = NO
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
GENERATE_TODOLIST = YES
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
GENERATE_TESTLIST = YES
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
GENERATE_BUGLIST = YES
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
GENERATE_DEPRECATEDLIST= YES
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
ENABLED_SECTIONS =
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 30
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
SHOW_USED_FILES = YES
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
SHOW_FILES = YES
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
FILE_VERSION_FILTER =
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
LAYOUT_FILE =
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES =
+
#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
+# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
WARNINGS = YES
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
WARN_IF_DOC_ERROR = YES
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation.
+# The default value is: NO.
WARN_NO_PARAMDOC = NO
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
WARN_LOGFILE =
#---------------------------------------------------------------------------
-# configuration options related to the input files
+# Configuration options related to the input files
#---------------------------------------------------------------------------
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# Note: If this tag is empty the current directory is searched.
INPUT = @srcdir@/.. \
@srcdir@/../input \
@srcdir@/../config
# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
+# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd,
+# *.vhdl, *.ucf, *.qsf, *.as and *.js.
FILE_PATTERNS =
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
RECURSIVE = NO
-# The EXCLUDE tag can be used to specify files and/or directories that should
+# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
EXCLUDE = @srcdir@/../config/parser.c \
@srcdir@/../config/parser.h \
@srcdir@/../config/scanner.c
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
+# The default value is: NO.
EXCLUDE_SYMLINKS = YES
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = atKeynames.h \
Canvas*.*
@@ -629,624 +833,1122 @@ EXCLUDE_PATTERNS = atKeynames.h \
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
EXAMPLE_RECURSIVE = NO
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
FILTER_SOURCE_FILES = NO
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
#---------------------------------------------------------------------------
-# configuration options related to source browsing
+# Configuration options related to source browsing
#---------------------------------------------------------------------------
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
SOURCE_BROWSER = NO
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
INLINE_SOURCES = NO
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
STRIP_CODE_COMMENTS = YES
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
REFERENCED_BY_RELATION = YES
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
REFERENCES_RELATION = YES
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
+# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
ALPHABETICAL_INDEX = YES
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 5
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
-# configuration options related to the HTML output
+# Configuration options related to the HTML output
#---------------------------------------------------------------------------
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
GENERATE_HTML = YES
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = html
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER =
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER = @srcdir@/footer.html
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = NO
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = NO
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the master .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = NO
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE =
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = org.doxygen.Project
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = doc
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
-# For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-# will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears.
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_ECLIPSEHELP = NO
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
ECLIPSE_DOC_ID = org.doxygen.Project
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = YES
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list.
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
-USE_INLINE_TREES = NO
+ENUM_VALUES_PER_LINE = 4
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 250
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
SEARCHENGINE = NO
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index
-# file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup
-# and does not have live searching capabilities.
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
+
#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
+# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
GENERATE_LATEX = NO
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4wide
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES =
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = NO
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
+# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES, to get a
# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = NO
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = NO
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE = plain
+
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_TIMESTAMP = NO
+
#---------------------------------------------------------------------------
-# configuration options related to the RTF output
+# Configuration options related to the RTF output
#---------------------------------------------------------------------------
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
GENERATE_RTF = NO
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_SOURCE_CODE = NO
+
#---------------------------------------------------------------------------
-# configuration options related to the man page output
+# Configuration options related to the man page output
#---------------------------------------------------------------------------
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
GENERATE_MAN = NO
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
-# configuration options related to the XML output
+# Configuration options related to the XML output
#---------------------------------------------------------------------------
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
GENERATE_XML = NO
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
-XML_SCHEMA =
+XML_PROGRAMLISTING = YES
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
-XML_DTD =
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
+GENERATE_DOCBOOK = NO
-XML_PROGRAMLISTING = YES
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
+# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sf.net) file that captures the
+# structure of the code including all documentation. Note that this feature is
+# still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
+# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_PERLMOD = NO
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
@@ -1254,113 +1956,132 @@ PERLMOD_MAKEVAR_PREFIX =
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
ENABLE_PREPROCESSING = YES
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = NO
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = NO
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = SHAPE \
RENDER \
XKB \
XINPUT
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
-# Configuration::additions related to external references
+# Configuration options related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
-#
# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
TAGFILES =
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE =
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
ALLEXTERNALS = NO
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
EXTERNAL_GROUPS = YES
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH = /usr/bin/perl
@@ -1368,192 +2089,312 @@ PERL_PATH = /usr/bin/perl
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
+# The default value is: YES.
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
HAVE_DOT = NO
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS = 0
-DOT_FONTNAME = FreeSans
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = YES
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# http://www.graphviz.org/)).
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = gif
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = YES
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
diff --git a/xserver/hw/dmx/examples/Makefile.in b/xserver/hw/dmx/examples/Makefile.in
index 216d23f4f..6a8ede934 100644
--- a/xserver/hw/dmx/examples/Makefile.in
+++ b/xserver/hw/dmx/examples/Makefile.in
@@ -62,8 +62,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -320,7 +319,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -450,8 +448,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/dmx/glxProxy/Makefile.in b/xserver/hw/dmx/glxProxy/Makefile.in
index bb5f33b78..9c0b3e1ae 100644
--- a/xserver/hw/dmx/glxProxy/Makefile.in
+++ b/xserver/hw/dmx/glxProxy/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -226,7 +225,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -356,8 +354,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/dmx/glxProxy/glxcmds.c b/xserver/hw/dmx/glxProxy/glxcmds.c
index 4c500c93d..a77d556db 100644
--- a/xserver/hw/dmx/glxProxy/glxcmds.c
+++ b/xserver/hw/dmx/glxProxy/glxcmds.c
@@ -284,11 +284,11 @@ CreateContext(__GLXclientState * cl,
* allocate memory for back-end servers info
*/
num_be_screens = to_screen - from_screen + 1;
- glxc->real_ids = (XID *) malloc(sizeof(XID) * num_be_screens);
+ glxc->real_ids = xallocarray(num_be_screens, sizeof(XID));
if (!glxc->real_ids) {
return BadAlloc;
}
- glxc->real_vids = (XID *) malloc(sizeof(XID) * num_be_screens);
+ glxc->real_vids = xallocarray(num_be_screens, sizeof(XID));
if (!glxc->real_vids) {
return BadAlloc;
}
@@ -685,22 +685,16 @@ AddCurrentContext(__GLXclientState * cl, __GLXcontext * glxc, DrawablePtr pDraw)
if (!num) {
table = (__GLXcontext **) malloc(sizeof(__GLXcontext *));
cl->currentDrawables = (DrawablePtr *) malloc(sizeof(DrawablePtr));
- cl->be_currentCTag =
- (GLXContextTag *) malloc(screenInfo.numScreens *
- sizeof(GLXContextTag));
+ cl->be_currentCTag = xallocarray(screenInfo.numScreens,
+ sizeof(GLXContextTag));
}
else {
- table = (__GLXcontext **) realloc(table,
- (num + 1) * sizeof(__GLXcontext *));
- cl->currentDrawables = (DrawablePtr *) realloc(cl->currentDrawables,
- (num +
- 1) *
- sizeof(DrawablePtr));
- cl->be_currentCTag =
- (GLXContextTag *) realloc(cl->be_currentCTag,
- (num +
- 1) * screenInfo.numScreens *
- sizeof(GLXContextTag));
+ table = reallocarray(table, num + 1, sizeof(__GLXcontext *));
+ cl->currentDrawables = reallocarray(cl->currentDrawables, num + 1,
+ sizeof(DrawablePtr));
+ cl->be_currentCTag = reallocarray(cl->be_currentCTag,
+ (num + 1) * screenInfo.numScreens,
+ sizeof(GLXContextTag));
}
table[num] = glxc;
cl->currentDrawables[num] = pDraw;
@@ -1896,7 +1890,7 @@ CreateGLXPixmap(__GLXclientState * cl,
if (!pGlxPixmap) {
return BadAlloc;
}
- pGlxPixmap->be_xids = (XID *) malloc(sizeof(XID) * screenInfo.numScreens);
+ pGlxPixmap->be_xids = xallocarray(screenInfo.numScreens, sizeof(XID));
if (!pGlxPixmap->be_xids) {
free(pGlxPixmap);
return BadAlloc;
@@ -2016,11 +2010,8 @@ CreateGLXPixmap(__GLXclientState * cl,
XFlush(dpy);
}
- if (!(AddResource(glxpixmapId, __glXPixmapRes, pGlxPixmap))) {
- free(pGlxPixmap->be_xids);
- free(pGlxPixmap);
+ if (!(AddResource(glxpixmapId, __glXPixmapRes, pGlxPixmap)))
return BadAlloc;
- }
return Success;
}
@@ -3356,7 +3347,7 @@ __glXCreatePbuffer(__GLXclientState * cl, GLbyte * pc)
return BadAlloc;
}
- pGlxPbuffer->be_xids = (XID *) malloc(sizeof(XID) * screenInfo.numScreens);
+ pGlxPbuffer->be_xids = xallocarray(screenInfo.numScreens, sizeof(XID));
if (!pGlxPbuffer->be_xids) {
free(pGlxPbuffer);
return BadAlloc;
@@ -3617,13 +3608,13 @@ __glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc)
}
if (reply.numAttribs) {
- attribs_size = 2 * reply.numAttribs * __GLX_SIZE_CARD32;
- attribs = (CARD32 *) malloc(attribs_size);
+ attribs = xallocarray(reply.numAttribs, 2 * __GLX_SIZE_CARD32);
if (attribs == NULL) {
UnlockDisplay(dpy);
SyncHandle();
return BadAlloc;
}
+ attribs_size = 2 * reply.numAttribs * __GLX_SIZE_CARD32;
_XRead(dpy, (char *) attribs, attribs_size);
}
diff --git a/xserver/hw/dmx/glxProxy/glxext.c b/xserver/hw/dmx/glxProxy/glxext.c
index 3c5a14bc7..c85827284 100644
--- a/xserver/hw/dmx/glxProxy/glxext.c
+++ b/xserver/hw/dmx/glxProxy/glxext.c
@@ -347,7 +347,7 @@ GlxExtensionInit(void)
/*
** Initialize table of client state. There is never a client 0.
*/
- for (i = 1; i <= MAXCLIENTS; i++) {
+ for (i = 1; i <= LimitClients; i++) {
__glXClients[i] = 0;
}
diff --git a/xserver/hw/dmx/glxProxy/glxscreens.c b/xserver/hw/dmx/glxProxy/glxscreens.c
index 15bb1e862..508e67ed4 100644
--- a/xserver/hw/dmx/glxProxy/glxscreens.c
+++ b/xserver/hw/dmx/glxProxy/glxscreens.c
@@ -129,7 +129,7 @@ CalcServerVersionAndExtensions(void)
/*
* read extensions strings of all back-end servers
*/
- be_extensions = (char **) malloc(__glXNumActiveScreens * sizeof(char *));
+ be_extensions = xallocarray(__glXNumActiveScreens, sizeof(char *));
if (!be_extensions)
return;
@@ -237,10 +237,9 @@ __glXScreenInit(GLint numscreens)
// find the set of FBConfigs that are present on all back-end
// servers - only those configs will be supported
*/
- __glXFBConfigs = (__GLXFBConfig **) malloc(dmxScreen0->numFBConfigs *
- (numscreens +
- 1) *
- sizeof(__GLXFBConfig *));
+ __glXFBConfigs =
+ xallocarray(dmxScreen0->numFBConfigs * (numscreens + 1),
+ sizeof(__GLXFBConfig *));
__glXNumFBConfigs = 0;
for (c = 0; c < dmxScreen0->numFBConfigs; c++) {
diff --git a/xserver/hw/dmx/glxProxy/glxsingle.c b/xserver/hw/dmx/glxProxy/glxsingle.c
index 79d426bbf..e254936a9 100644
--- a/xserver/hw/dmx/glxProxy/glxsingle.c
+++ b/xserver/hw/dmx/glxProxy/glxsingle.c
@@ -804,9 +804,8 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
int win_y1, win_y2;
int ebits, rowsize;
- __GLX_DECLARE_SWAP_VARIABLES;
-
if (client->swapped) {
+ __GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&req->contextTag);
}
@@ -834,6 +833,7 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
lsbFirst = *(GLboolean *) (pc + 25);
if (client->swapped) {
+ __GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&x);
__GLX_SWAP_INT(&y);
__GLX_SWAP_INT(&width);
@@ -1017,6 +1017,7 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
};
if (client->swapped) {
+ __GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
}
diff --git a/xserver/hw/dmx/glxProxy/render2swap.c b/xserver/hw/dmx/glxProxy/render2swap.c
index 166ec8882..146476c15 100644
--- a/xserver/hw/dmx/glxProxy/render2swap.c
+++ b/xserver/hw/dmx/glxProxy/render2swap.c
@@ -67,7 +67,7 @@ void
__glXDispSwap_Map1f(GLbyte * pc)
{
GLint order, k;
- GLfloat u1, u2, *points;
+ GLfloat *points;
GLenum target;
GLint compsize;
@@ -81,8 +81,6 @@ __glXDispSwap_Map1f(GLbyte * pc)
target = *(GLenum *) (pc + 0);
order = *(GLint *) (pc + 12);
- u1 = *(GLfloat *) (pc + 4);
- u2 = *(GLfloat *) (pc + 8);
points = (GLfloat *) (pc + 16);
k = __glEvalComputeK(target);
@@ -100,8 +98,8 @@ __glXDispSwap_Map1f(GLbyte * pc)
void
__glXDispSwap_Map2f(GLbyte * pc)
{
- GLint uorder, vorder, ustride, vstride, k;
- GLfloat u1, u2, v1, v2, *points;
+ GLint uorder, vorder, k;
+ GLfloat *points;
GLenum target;
GLint compsize;
@@ -119,15 +117,9 @@ __glXDispSwap_Map2f(GLbyte * pc)
target = *(GLenum *) (pc + 0);
uorder = *(GLint *) (pc + 12);
vorder = *(GLint *) (pc + 24);
- u1 = *(GLfloat *) (pc + 4);
- u2 = *(GLfloat *) (pc + 8);
- v1 = *(GLfloat *) (pc + 16);
- v2 = *(GLfloat *) (pc + 20);
points = (GLfloat *) (pc + 28);
k = __glEvalComputeK(target);
- ustride = vorder * k;
- vstride = k;
if (vorder <= 0 || uorder <= 0 || k < 0) {
/* Erroneous command. */
@@ -145,7 +137,7 @@ __glXDispSwap_Map1d(GLbyte * pc)
{
GLint order, k, compsize;
GLenum target;
- GLdouble u1, u2, *points;
+ GLdouble u1, u2;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
@@ -177,21 +169,15 @@ __glXDispSwap_Map1d(GLbyte * pc)
** the data in the process
*/
__GLX_MEM_COPY(pc - 4, pc, compsize * 8);
- points = (GLdouble *) (pc - 4);
}
- else {
- points = (GLdouble *) pc;
- }
-#else
- points = (GLdouble *) pc;
#endif
}
void
__glXDispSwap_Map2d(GLbyte * pc)
{
- GLdouble u1, u2, v1, v2, *points;
- GLint uorder, vorder, ustride, vstride, k, compsize;
+ GLdouble u1, u2, v1, v2;
+ GLint uorder, vorder, k, compsize;
GLenum target;
__GLX_DECLARE_SWAP_VARIABLES;
@@ -222,8 +208,6 @@ __glXDispSwap_Map2d(GLbyte * pc)
__GLX_GET_DOUBLE(v2, pc + 24);
__GLX_SWAP_DOUBLE_ARRAY(pc + 44, compsize);
pc += 44;
- ustride = vorder * k;
- vstride = k;
#ifdef __GLX_ALIGN64
if (((unsigned long) pc) & 7) {
@@ -232,13 +216,7 @@ __glXDispSwap_Map2d(GLbyte * pc)
** the data in the process
*/
__GLX_MEM_COPY(pc - 4, pc, compsize * 8);
- points = (GLdouble *) (pc - 4);
- }
- else {
- points = (GLdouble *) pc;
}
-#else
- points = (GLdouble *) pc;
#endif
}
diff --git a/xserver/hw/dmx/glxProxy/renderpixswap.c b/xserver/hw/dmx/glxProxy/renderpixswap.c
index 32df0d5a8..6557a8fc7 100644
--- a/xserver/hw/dmx/glxProxy/renderpixswap.c
+++ b/xserver/hw/dmx/glxProxy/renderpixswap.c
@@ -380,12 +380,9 @@ __glXDispSwap_SeparableFilter2D(GLbyte * pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
(__GLXdispatchConvolutionFilterHeader *) pc;
- GLint hdrlen;
__GLX_DECLARE_SWAP_VARIABLES;
- hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE);
-
__GLX_SWAP_INT((GLbyte *) &hdr->rowLength);
__GLX_SWAP_INT((GLbyte *) &hdr->skipRows);
__GLX_SWAP_INT((GLbyte *) &hdr->skipPixels);
diff --git a/xserver/hw/dmx/input/Makefile.in b/xserver/hw/dmx/input/Makefile.in
index cdd60560a..74ac3c365 100644
--- a/xserver/hw/dmx/input/Makefile.in
+++ b/xserver/hw/dmx/input/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -241,7 +240,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -371,8 +369,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/dmx/input/dmxarg.c b/xserver/hw/dmx/input/dmxarg.c
index 4a74b4c9e..6c21ae959 100644
--- a/xserver/hw/dmx/input/dmxarg.c
+++ b/xserver/hw/dmx/input/dmxarg.c
@@ -86,7 +86,7 @@ void
dmxArgAdd(dmxArg a, const char *string)
{
if (a->argm <= a->argc + 2)
- a->argv = realloc(a->argv, sizeof(*a->argv) * (a->argm *= 2));
+ a->argv = reallocarray(a->argv, (a->argm *= 2), sizeof(*a->argv));
a->argv[a->argc++] = strdup(string);
a->argv[a->argc] = NULL;
}
diff --git a/xserver/hw/dmx/input/dmxevents.c b/xserver/hw/dmx/input/dmxevents.c
index 14ac05f5c..2b579ee87 100644
--- a/xserver/hw/dmx/input/dmxevents.c
+++ b/xserver/hw/dmx/input/dmxevents.c
@@ -488,12 +488,9 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
switch (type) {
case XI_DeviceKeyPress:
case XI_DeviceKeyRelease:
- EXTRACT_VALUATORS(ke, valuators);
- valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count,
- valuators);
if (block)
OsBlockSIGIO();
- QueueKeyboardEvents(pDevice, event, ke->keycode, &mask);
+ QueueKeyboardEvents(pDevice, event, ke->keycode);
if (block)
OsReleaseSIGIO();
break;
@@ -718,7 +715,7 @@ dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
detail = dmxFixup(pDev, detail, keySym);
/*ErrorF("KEY %d sym %d\n", detail, (int) keySym); */
- QueueKeyboardEvents(p, type, detail, NULL);
+ QueueKeyboardEvents(p, type, detail);
return;
case ButtonPress:
diff --git a/xserver/hw/dmx/input/dmxinputinit.c b/xserver/hw/dmx/input/dmxinputinit.c
index 56a39df8c..cdefd9ae0 100644
--- a/xserver/hw/dmx/input/dmxinputinit.c
+++ b/xserver/hw/dmx/input/dmxinputinit.c
@@ -814,8 +814,8 @@ dmxInputCopyLocal(DMXInputInfo * dmxInput, DMXLocalInputInfoPtr s)
dmxLocal->deviceId = -1;
++dmxInput->numDevs;
- dmxInput->devs = realloc(dmxInput->devs,
- dmxInput->numDevs * sizeof(*dmxInput->devs));
+ dmxInput->devs = reallocarray(dmxInput->devs,
+ dmxInput->numDevs, sizeof(*dmxInput->devs));
dmxInput->devs[dmxInput->numDevs - 1] = dmxLocal;
return dmxLocal;
diff --git a/xserver/hw/dmx/input/dmxmotion.c b/xserver/hw/dmx/input/dmxmotion.c
index 1642894a2..7f2cb8ed9 100644
--- a/xserver/hw/dmx/input/dmxmotion.c
+++ b/xserver/hw/dmx/input/dmxmotion.c
@@ -113,9 +113,8 @@ dmxPointerPutMotionEvent(DeviceIntPtr pDevice,
int i;
if (!dmxLocal->history) {
- dmxLocal->history = malloc(sizeof(*dmxLocal->history)
- * (numAxes + 1)
- * DMX_MOTION_SIZE);
+ dmxLocal->history = xallocarray(numAxes + 1,
+ sizeof(*dmxLocal->history) * DMX_MOTION_SIZE);
dmxLocal->head = 0;
dmxLocal->tail = 0;
dmxLocal->valuators = calloc(sizeof(*dmxLocal->valuators), numAxes);
diff --git a/xserver/hw/dmx/man/Makefile.in b/xserver/hw/dmx/man/Makefile.in
index 290e41513..d1e7f7f51 100644
--- a/xserver/hw/dmx/man/Makefile.in
+++ b/xserver/hw/dmx/man/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -213,7 +212,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -360,8 +358,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/kdrive/Makefile.in b/xserver/hw/kdrive/Makefile.in
index 5d72a30c5..eb485aee8 100644
--- a/xserver/hw/kdrive/Makefile.in
+++ b/xserver/hw/kdrive/Makefile.in
@@ -55,8 +55,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -220,7 +219,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -350,8 +348,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/kdrive/ephyr/Makefile.in b/xserver/hw/kdrive/ephyr/Makefile.in
index a299e9739..4f33efe4b 100644
--- a/xserver/hw/kdrive/ephyr/Makefile.in
+++ b/xserver/hw/kdrive/ephyr/Makefile.in
@@ -80,8 +80,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -294,7 +293,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -424,8 +422,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/kdrive/ephyr/ephyr.c b/xserver/hw/kdrive/ephyr/ephyr.c
index 164ebdcba..cb1c16e4e 100644
--- a/xserver/hw/kdrive/ephyr/ephyr.c
+++ b/xserver/hw/kdrive/ephyr/ephyr.c
@@ -50,7 +50,6 @@
#include "xkbsrv.h"
-extern int KdTsPhyScreen;
extern Bool ephyr_glamor;
KdKeyboardInfo *ephyrKbd;
@@ -71,16 +70,6 @@ Bool EphyrWantResize = 0;
Bool EphyrWantNoHostGrab = 0;
Bool
-host_has_extension(xcb_extension_t *extension)
-{
- const xcb_query_extension_reply_t *rep;
-
- rep = xcb_get_extension_data(hostx_get_xcbconn(), extension);
-
- return rep && rep->present;
-}
-
-Bool
ephyrInitialize(KdCardInfo * card, EphyrPriv * priv)
{
OsSignal(SIGUSR1, hostx_handle_signal);
@@ -670,7 +659,7 @@ ephyrInitScreen(ScreenPtr pScreen)
}
#endif /*XV*/
#ifdef XF86DRI
- if (!ephyrNoDRI && !host_has_extension(&xcb_xf86dri_id)) {
+ if (!ephyrNoDRI && !hostx_has_extension(&xcb_xf86dri_id)) {
EPHYR_LOG("host x does not support DRI. Disabling DRI forwarding\n");
ephyrNoDRI = TRUE;
}
@@ -977,8 +966,8 @@ ephyrProcessMouseMotion(xcb_generic_event_t *xev)
if (ephyrCursorScreen != screen->pScreen) {
EPHYR_LOG("warping mouse cursor. "
- "cur_screen%d, motion_screen:%d\n",
- ephyrCursorScreen, screen->pScreen->myNum);
+ "cur_screen:%d, motion_screen:%d\n",
+ ephyrCursorScreen->myNum, screen->pScreen->myNum);
ephyrWarpCursor(inputInfo.pointer, screen->pScreen,
motion->event_x, motion->event_y);
}
diff --git a/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c b/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c
index 8fe751693..2f219141e 100644
--- a/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c
+++ b/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c
@@ -41,6 +41,10 @@
#include "os.h"
#include <X11/Xproto.h>
+/* until we need geometry shaders GL3.1 should suffice. */
+/* Xephyr has it's own copy of this for build reasons */
+#define GLAMOR_GL_CORE_VER_MAJOR 3
+#define GLAMOR_GL_CORE_VER_MINOR 1
/** @{
*
* global state for Xephyr with glamor.
@@ -71,6 +75,8 @@ struct ephyr_glamor {
/* Size of the window that we're rendering to. */
unsigned width, height;
+
+ GLuint vao, vbo;
};
static GLint
@@ -189,45 +195,55 @@ ephyr_glamor_set_texture(struct ephyr_glamor *glamor, uint32_t tex)
glamor->tex = tex;
}
+static void
+ephyr_glamor_set_vertices(struct ephyr_glamor *glamor)
+{
+ glVertexAttribPointer(glamor->texture_shader_position_loc,
+ 2, GL_FLOAT, FALSE, 0, (void *) 0);
+ glVertexAttribPointer(glamor->texture_shader_texcoord_loc,
+ 2, GL_FLOAT, FALSE, 0, (void *) (sizeof (float) * 8));
+
+ glEnableVertexAttribArray(glamor->texture_shader_position_loc);
+ glEnableVertexAttribArray(glamor->texture_shader_texcoord_loc);
+}
+
+static void
+ephyr_glamor_clear_vertices(struct ephyr_glamor *glamor)
+{
+ glDisableVertexAttribArray(glamor->texture_shader_position_loc);
+ glDisableVertexAttribArray(glamor->texture_shader_texcoord_loc);
+}
+
void
ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor,
struct pixman_region16 *damage)
{
- /* Redraw the whole screen, since glXSwapBuffers leaves the back
- * buffer undefined.
- */
- static const float position[] = {
- -1, -1,
- 1, -1,
- 1, 1,
- -1, 1,
- };
- static const float texcoords[] = {
- 0, 1,
- 1, 1,
- 1, 0,
- 0, 0,
- };
+ GLint old_vao;
glXMakeCurrent(dpy, glamor->glx_win, glamor->ctx);
+ if (glamor->vao) {
+ glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &old_vao);
+ glBindVertexArray(glamor->vao);
+ } else {
+ glBindBuffer(GL_ARRAY_BUFFER, glamor->vbo);
+ ephyr_glamor_set_vertices(glamor);
+ }
+
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glUseProgram(glamor->texture_shader);
glViewport(0, 0, glamor->width, glamor->height);
-
- glVertexAttribPointer(glamor->texture_shader_position_loc,
- 2, GL_FLOAT, FALSE, 0, position);
- glVertexAttribPointer(glamor->texture_shader_texcoord_loc,
- 2, GL_FLOAT, FALSE, 0, texcoords);
- glEnableVertexAttribArray(glamor->texture_shader_position_loc);
- glEnableVertexAttribArray(glamor->texture_shader_texcoord_loc);
+ if (!ephyr_glamor_gles2)
+ glDisable(GL_COLOR_LOGIC_OP);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, glamor->tex);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- glDisableVertexAttribArray(glamor->texture_shader_position_loc);
- glDisableVertexAttribArray(glamor->texture_shader_texcoord_loc);
+ if (glamor->vao)
+ glBindVertexArray(old_vao);
+ else
+ ephyr_glamor_clear_vertices(glamor);
glXSwapBuffers(dpy, glamor->glx_win);
}
@@ -266,9 +282,28 @@ ephyr_glamor_process_event(xcb_generic_event_t *xev)
XUnlockDisplay(dpy);
}
+static int
+ephyr_glx_error_handler(Display * _dpy, XErrorEvent * ev)
+{
+ return 0;
+}
+
struct ephyr_glamor *
ephyr_glamor_glx_screen_init(xcb_window_t win)
{
+ int (*oldErrorHandler) (Display *, XErrorEvent *);
+ static const float position[] = {
+ -1, -1,
+ 1, -1,
+ 1, 1,
+ -1, 1,
+ 0, 1,
+ 1, 1,
+ 1, 0,
+ 0, 0,
+ };
+ GLint old_vao;
+
GLXContext ctx;
struct ephyr_glamor *glamor;
GLXWindow glx_win;
@@ -297,7 +332,28 @@ ephyr_glamor_glx_screen_init(xcb_window_t win)
"GLX_EXT_create_context_es2_profile\n");
}
} else {
- ctx = glXCreateContext(dpy, visual_info, NULL, True);
+ if (epoxy_has_glx_extension(dpy, DefaultScreen(dpy),
+ "GLX_ARB_create_context")) {
+ static const int context_attribs[] = {
+ GLX_CONTEXT_PROFILE_MASK_ARB,
+ GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
+ GLX_CONTEXT_MAJOR_VERSION_ARB,
+ GLAMOR_GL_CORE_VER_MAJOR,
+ GLX_CONTEXT_MINOR_VERSION_ARB,
+ GLAMOR_GL_CORE_VER_MINOR,
+ 0,
+ };
+ oldErrorHandler = XSetErrorHandler(ephyr_glx_error_handler);
+ ctx = glXCreateContextAttribsARB(dpy, fb_config, NULL, True,
+ context_attribs);
+ XSync(dpy, False);
+ XSetErrorHandler(oldErrorHandler);
+ } else {
+ ctx = NULL;
+ }
+
+ if (!ctx)
+ ctx = glXCreateContext(dpy, visual_info, NULL, True);
}
if (ctx == NULL)
FatalError("glXCreateContext failed\n");
@@ -310,6 +366,24 @@ ephyr_glamor_glx_screen_init(xcb_window_t win)
glamor->glx_win = glx_win;
ephyr_glamor_setup_texturing_shader(glamor);
+ if (epoxy_has_gl_extension("GL_ARB_vertex_array_object")) {
+ glGenVertexArrays(1, &glamor->vao);
+ glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &old_vao);
+ glBindVertexArray(glamor->vao);
+ } else
+ glamor->vao = 0;
+
+ glGenBuffers(1, &glamor->vbo);
+
+ glBindBuffer(GL_ARRAY_BUFFER, glamor->vbo);
+ glBufferData(GL_ARRAY_BUFFER, sizeof (position), position, GL_STATIC_DRAW);
+
+ if (glamor->vao) {
+ ephyr_glamor_set_vertices(glamor);
+ glBindVertexArray(old_vao);
+ } else
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+
return glamor;
}
diff --git a/xserver/hw/kdrive/ephyr/ephyrcursor.c b/xserver/hw/kdrive/ephyr/ephyrcursor.c
index 852be33e0..808b3c72c 100644
--- a/xserver/hw/kdrive/ephyr/ephyrcursor.c
+++ b/xserver/hw/kdrive/ephyr/ephyrcursor.c
@@ -100,7 +100,6 @@ ephyrRealizeCoreCursor(EphyrScrPriv *scr, CursorPtr cursor)
xcb_free_pixmap(conn, mask);
}
-#ifdef ARGB_CURSOR
static xcb_render_pictformat_t
get_argb_format(void)
{
@@ -170,7 +169,6 @@ can_argb_cursor(void)
return v->major_version == 0 && v->minor_version >= 5;
}
-#endif
static Bool
ephyrRealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor)
@@ -179,11 +177,9 @@ ephyrRealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor)
KdScreenInfo *kscr = pScreenPriv->screen;
EphyrScrPriv *scr = kscr->driver;
-#ifdef ARGB_CURSOR
if (cursor->bits->argb && can_argb_cursor())
ephyrRealizeARGBCursor(scr, cursor);
else
-#endif
{
ephyrRealizeCoreCursor(scr, cursor);
}
diff --git a/xserver/hw/kdrive/ephyr/ephyrdriext.c b/xserver/hw/kdrive/ephyr/ephyrdriext.c
index 3d5cf7721..3703adf8c 100644
--- a/xserver/hw/kdrive/ephyr/ephyrdriext.c
+++ b/xserver/hw/kdrive/ephyr/ephyrdriext.c
@@ -431,8 +431,8 @@ EphyrDuplicateVisual(unsigned int a_screen,
* extend the list of visual IDs in that entry,
* so to add a_new_id in there.
*/
- vids = realloc(cur_depth->vids,
- (cur_depth->numVids + 1) * sizeof(VisualID));
+ vids = reallocarray(cur_depth->vids,
+ cur_depth->numVids + 1, sizeof(VisualID));
if (!vids) {
EPHYR_LOG_ERROR("failed to realloc numids\n");
goto out;
@@ -1321,12 +1321,12 @@ ephyrDRIExtensionInit(ScreenPtr a_screen)
EphyrDRIScreenPrivPtr screen_priv = NULL;
EPHYR_LOG("enter\n");
- if (!host_has_extension(&xcb_xf86dri_id)) {
+ 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 (!host_has_extension(&xcb_shape_id)) {
+ if (!hostx_has_extension(&xcb_shape_id)) {
EPHYR_LOG("host does not have XShape extension\n");
goto out;
}
diff --git a/xserver/hw/kdrive/ephyr/ephyrglxext.c b/xserver/hw/kdrive/ephyr/ephyrglxext.c
index 248689e6f..c6d156900 100644
--- a/xserver/hw/kdrive/ephyr/ephyrglxext.c
+++ b/xserver/hw/kdrive/ephyr/ephyrglxext.c
@@ -84,7 +84,7 @@ ephyrHijackGLXExtension(void)
{
const void *(*dispatch_functions)[2];
- if (!host_has_extension(&xcb_glx_id)) {
+ if (!hostx_has_extension(&xcb_glx_id)) {
EPHYR_LOG("host X does not have GLX\n");
return FALSE;
}
diff --git a/xserver/hw/kdrive/ephyr/ephyrinit.c b/xserver/hw/kdrive/ephyr/ephyrinit.c
index 8fbaf1d44..d86baf295 100644
--- a/xserver/hw/kdrive/ephyr/ephyrinit.c
+++ b/xserver/hw/kdrive/ephyr/ephyrinit.c
@@ -367,7 +367,7 @@ ddxProcessArgument(int argc, char **argv, int i)
/* end Xnest compat */
else if (!strcmp(argv[i], "-no-host-grab")) {
EphyrWantNoHostGrab = 1;
- return 2;
+ return 1;
}
return KdProcessArgument(argc, argv, i);
diff --git a/xserver/hw/kdrive/ephyr/hostx.c b/xserver/hw/kdrive/ephyr/hostx.c
index e19f57b2c..3991c51dc 100644
--- a/xserver/hw/kdrive/ephyr/hostx.c
+++ b/xserver/hw/kdrive/ephyr/hostx.c
@@ -99,6 +99,16 @@ int ephyrResNameFromCmd = 0;
char *ephyrTitle = NULL;
Bool ephyr_glamor = FALSE;
+Bool
+hostx_has_extension(xcb_extension_t *extension)
+{
+ const xcb_query_extension_reply_t *rep;
+
+ rep = xcb_get_extension_data(HostX.conn, extension);
+
+ return rep && rep->present;
+}
+
static void
hostx_set_fullscreen_hint(void);
@@ -129,8 +139,8 @@ hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num, Boo
int index = HostX.n_screens;
HostX.n_screens += 1;
- HostX.screens = realloc(HostX.screens,
- HostX.n_screens * sizeof(HostX.screens[0]));
+ HostX.screens = reallocarray(HostX.screens,
+ HostX.n_screens, sizeof(HostX.screens[0]));
HostX.screens[index] = screen;
scrpriv->screen = screen;
@@ -240,7 +250,7 @@ hostx_get_output_geometry(const char *output,
xcb_randr_get_crtc_info_reply_t *crtc_info_r;
/* First of all, check for extension */
- if (!xcb_get_extension_data(HostX.conn, &xcb_randr_id)->present)
+ if (!hostx_has_extension(&xcb_randr_id))
{
fprintf(stderr, "\nHost X server does not support RANDR extension (or it's disabled).\n");
exit(1);
@@ -422,7 +432,6 @@ hostx_init(void)
char *tmpstr;
char *class_hint;
size_t class_len;
- const xcb_query_extension_reply_t *shm_rep;
xcb_screen_t *xscreen;
xcb_rectangle_t rect = { 0, 0, 1, 1 };
@@ -632,8 +641,7 @@ hostx_init(void)
}
/* Try to get share memory ximages for a little bit more speed */
- shm_rep = xcb_get_extension_data(HostX.conn, &xcb_shm_id);
- if (!shm_rep || !shm_rep->present || getenv("XEPHYR_NO_SHM")) {
+ if (!hostx_has_extension(&xcb_shm_id) || getenv("XEPHYR_NO_SHM")) {
fprintf(stderr, "\nXephyr unable to use SHM XImages\n");
HostX.have_shm = FALSE;
}
@@ -872,7 +880,7 @@ hostx_screen_init(KdScreenInfo *screen,
scrpriv->ximg->byte_order = IMAGE_BYTE_ORDER;
scrpriv->ximg->data =
- malloc(scrpriv->ximg->stride * buffer_height);
+ xallocarray(scrpriv->ximg->stride, buffer_height);
}
{
@@ -938,7 +946,7 @@ hostx_screen_init(KdScreenInfo *screen,
*bits_per_pixel = scrpriv->server_depth;
EPHYR_DBG("server bpp %i", bytes_per_pixel);
- scrpriv->fb_data = malloc (stride * buffer_height);
+ scrpriv->fb_data = xallocarray (stride, buffer_height);
return scrpriv->fb_data;
}
}
@@ -1158,9 +1166,9 @@ hostx_get_visuals_info(EphyrHostVisualInfo ** a_visuals, int *a_num_entries)
for (; depths.rem; xcb_depth_next(&depths)) {
xcb_visualtype_t *visuals = xcb_depth_visuals(depths.data);
EphyrHostVisualInfo *tmp_visuals =
- realloc(host_visuals,
- (nb_items + depths.data->visuals_len)
- * sizeof(EphyrHostVisualInfo));
+ reallocarray(host_visuals,
+ nb_items + depths.data->visuals_len,
+ sizeof(EphyrHostVisualInfo));
if (!tmp_visuals) {
goto out;
}
@@ -1417,9 +1425,7 @@ ephyr_glamor_init(ScreenPtr screen)
ephyr_glamor_set_window_size(scrpriv->glamor,
scrpriv->win_width, scrpriv->win_height);
- if (!glamor_init(screen,
- GLAMOR_USE_SCREEN |
- GLAMOR_USE_PICTURE_SCREEN)) {
+ if (!glamor_init(screen, 0)) {
FatalError("Failed to initialize glamor\n");
return FALSE;
}
diff --git a/xserver/hw/kdrive/ephyr/hostx.h b/xserver/hw/kdrive/ephyr/hostx.h
index 93aaa509c..9299e8dd4 100644
--- a/xserver/hw/kdrive/ephyr/hostx.h
+++ b/xserver/hw/kdrive/ephyr/hostx.h
@@ -182,7 +182,7 @@ int hostx_set_window_geometry(int a_win, EphyrBox * a_geo);
int hostx_set_window_bounding_rectangles(int a_window,
EphyrRect * a_rects, int a_num_rects);
-int host_has_extension(xcb_extension_t *extension);
+int hostx_has_extension(xcb_extension_t *extension);
#ifdef XF86DRI
int hostx_lookup_peer_window(void *a_local_window,
diff --git a/xserver/hw/kdrive/ephyr/man/Makefile.in b/xserver/hw/kdrive/ephyr/man/Makefile.in
index 9d49b9c7b..931ed4fd8 100644
--- a/xserver/hw/kdrive/ephyr/man/Makefile.in
+++ b/xserver/hw/kdrive/ephyr/man/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -213,7 +212,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -360,8 +358,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/kdrive/fake/Makefile.in b/xserver/hw/kdrive/fake/Makefile.in
index 28197670e..46d6f530f 100644
--- a/xserver/hw/kdrive/fake/Makefile.in
+++ b/xserver/hw/kdrive/fake/Makefile.in
@@ -59,8 +59,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -224,7 +223,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -354,8 +352,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/kdrive/fake/fake.c b/xserver/hw/kdrive/fake/fake.c
index 90e3ec9a6..7205df401 100644
--- a/xserver/hw/kdrive/fake/fake.c
+++ b/xserver/hw/kdrive/fake/fake.c
@@ -25,8 +25,6 @@
#endif
#include "fake.h"
-extern int KdTsPhyScreen;
-
Bool
fakeInitialize(KdCardInfo * card, FakePriv * priv)
{
@@ -158,7 +156,7 @@ fakeMapFramebuffer(KdScreenInfo * screen)
priv->bytes_per_line =
((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2;
free(priv->base);
- priv->base = malloc(priv->bytes_per_line * screen->height);
+ priv->base = xallocarray(priv->bytes_per_line, screen->height);
if (scrpriv->shadow) {
if (!KdShadowFbAlloc
@@ -364,10 +362,6 @@ fakeCreateColormap(ColormapPtr pmap)
Bool
fakeInitScreen(ScreenPtr pScreen)
{
-#ifdef TOUCHSCREEN
- KdTsPhyScreen = pScreen->myNum;
-#endif
-
pScreen->CreateColormap = fakeCreateColormap;
return TRUE;
}
diff --git a/xserver/hw/kdrive/fbdev/Makefile.in b/xserver/hw/kdrive/fbdev/Makefile.in
index 37be5f1e2..0f23fb2bb 100644
--- a/xserver/hw/kdrive/fbdev/Makefile.in
+++ b/xserver/hw/kdrive/fbdev/Makefile.in
@@ -59,8 +59,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -225,7 +224,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -355,8 +353,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/kdrive/fbdev/fbdev.c b/xserver/hw/kdrive/fbdev/fbdev.c
index 95f64cbef..9b69edf95 100644
--- a/xserver/hw/kdrive/fbdev/fbdev.c
+++ b/xserver/hw/kdrive/fbdev/fbdev.c
@@ -28,8 +28,6 @@
#include <errno.h>
-extern int KdTsPhyScreen;
-
const char *fbdevDevicePath = NULL;
static Bool
@@ -677,7 +675,7 @@ fbdevCreateColormap(ColormapPtr pmap)
case FB_VISUAL_STATIC_PSEUDOCOLOR:
pVisual = pmap->pVisual;
nent = pVisual->ColormapEntries;
- pdefs = malloc(nent * sizeof(xColorItem));
+ pdefs = xallocarray(nent, sizeof(xColorItem));
if (!pdefs)
return FALSE;
for (i = 0; i < nent; i++)
@@ -698,10 +696,6 @@ fbdevCreateColormap(ColormapPtr pmap)
Bool
fbdevInitScreen(ScreenPtr pScreen)
{
-#ifdef TOUCHSCREEN
- KdTsPhyScreen = pScreen->myNum;
-#endif
-
pScreen->CreateColormap = fbdevCreateColormap;
return TRUE;
}
diff --git a/xserver/hw/kdrive/linux/Makefile.in b/xserver/hw/kdrive/linux/Makefile.in
index fd01608f6..2b93bdf60 100644
--- a/xserver/hw/kdrive/linux/Makefile.in
+++ b/xserver/hw/kdrive/linux/Makefile.in
@@ -61,8 +61,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -226,7 +225,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -356,8 +354,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/kdrive/linux/evdev.c b/xserver/hw/kdrive/linux/evdev.c
index 63e840996..752489489 100644
--- a/xserver/hw/kdrive/linux/evdev.c
+++ b/xserver/hw/kdrive/linux/evdev.c
@@ -440,10 +440,16 @@ EvdevKbdEnable(KdKeyboardInfo * ki)
static void
EvdevKbdLeds(KdKeyboardInfo * ki, int leds)
{
-/* struct input_event event;
+ struct input_event event;
Kevdev *ke;
- ki->driverPrivate = ke;
+ if (!ki)
+ return;
+
+ ke = ki->driverPrivate;
+
+ if (!ke)
+ return;
memset(&event, 0, sizeof(event));
@@ -466,7 +472,6 @@ EvdevKbdLeds(KdKeyboardInfo * ki, int leds)
event.code = LED_COMPOSE;
event.value = leds & (1 << 3) ? 1 : 0;
write(ke->fd, (char *) &event, sizeof(event));
-*/
}
static void
diff --git a/xserver/hw/kdrive/src/Makefile.in b/xserver/hw/kdrive/src/Makefile.in
index b5bd50984..6c94b33e5 100644
--- a/xserver/hw/kdrive/src/Makefile.in
+++ b/xserver/hw/kdrive/src/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -220,7 +219,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -350,8 +348,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/kdrive/src/kdrive.c b/xserver/hw/kdrive/src/kdrive.c
index dddbe6e96..582ff66d2 100644
--- a/xserver/hw/kdrive/src/kdrive.c
+++ b/xserver/hw/kdrive/src/kdrive.c
@@ -99,7 +99,7 @@ KdDisableScreen(ScreenPtr pScreen)
if (!pScreenPriv->enabled)
return;
if (!pScreenPriv->closed)
- SetRootClip(pScreen, FALSE);
+ SetRootClip(pScreen, ROOT_CLIP_NONE);
KdDisableColormap(pScreen);
if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->disableAccel)
(*pScreenPriv->card->cfuncs->disableAccel) (pScreen);
@@ -182,7 +182,7 @@ KdEnableScreen(ScreenPtr pScreen)
if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->enableAccel)
(*pScreenPriv->card->cfuncs->enableAccel) (pScreen);
KdEnableColormap(pScreen);
- SetRootClip(pScreen, TRUE);
+ SetRootClip(pScreen, ROOT_CLIP_FULL);
if (pScreenPriv->card->cfuncs->dpms)
(*pScreenPriv->card->cfuncs->dpms) (pScreen, pScreenPriv->dpmsState);
return TRUE;
diff --git a/xserver/hw/kdrive/src/kinput.c b/xserver/hw/kdrive/src/kinput.c
index a539ca513..d5741f100 100644
--- a/xserver/hw/kdrive/src/kinput.c
+++ b/xserver/hw/kdrive/src/kinput.c
@@ -220,9 +220,9 @@ KdUnregisterFd(void *closure, int fd, Bool do_close)
KdRemoveFd(kdInputFds[i].fd);
if (do_close)
close(kdInputFds[i].fd);
- kdNumInputFds--;
for (j = i; j < (kdNumInputFds - 1); j++)
kdInputFds[j] = kdInputFds[j + 1];
+ kdNumInputFds--;
break;
}
}
@@ -1641,41 +1641,6 @@ KdClassifyInput(KdPointerInfo * pi, int type, int x, int y, int z, int b)
return keyboard;
}
-#ifdef DEBUG
-char *kdStateNames[] = {
- "start",
- "button_1_pend",
- "button_1_down",
- "button_2_down",
- "button_3_pend",
- "button_3_down",
- "synth_2_down_13",
- "synth_2_down_3",
- "synthetic_2_down_1",
- "num_input_states"
-};
-
-char *kdClassNames[] = {
- "down_1", "up_1",
- "down_2", "up_2",
- "down_3", "up_3",
- "motion", "ouside_box",
- "keyboard", "timeout",
- "num_input_class"
-};
-
-char *kdActionNames[] = {
- "noop",
- "hold",
- "setto",
- "deliver",
- "release",
- "clearto",
- "gen_down_2",
- "gen_up_2",
-};
-#endif /* DEBUG */
-
/* We return true if we're stealing the event. */
static Bool
KdRunMouseMachine(KdPointerInfo * pi, KdInputClass c, int type, int x, int y,
@@ -1831,7 +1796,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo * ki,
else
type = KeyPress;
- QueueKeyboardEvents(ki->dixdev, type, key_code, NULL);
+ QueueKeyboardEvents(ki->dixdev, type, key_code);
}
else {
ErrorF("driver %s wanted to post scancode %d outside of [%d, %d]!\n",
diff --git a/xserver/hw/kdrive/src/kshadow.c b/xserver/hw/kdrive/src/kshadow.c
index 828ea19a6..7f1e2ee19 100644
--- a/xserver/hw/kdrive/src/kshadow.c
+++ b/xserver/hw/kdrive/src/kshadow.c
@@ -36,7 +36,7 @@ KdShadowFbAlloc(KdScreenInfo * screen, Bool rotate)
/* use fb computation for width */
paddedWidth = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
- buf = malloc(paddedWidth * height);
+ buf = xallocarray(paddedWidth, height);
if (!buf)
return FALSE;
if (screen->fb.shadow)
diff --git a/xserver/hw/kdrive/src/kxv.c b/xserver/hw/kdrive/src/kxv.c
index 369db3332..844deca0d 100644
--- a/xserver/hw/kdrive/src/kxv.c
+++ b/xserver/hw/kdrive/src/kxv.c
@@ -327,8 +327,8 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr infoPtr, int number)
void *moreSpace;
totFormat *= 2;
- moreSpace = realloc(pFormat,
- totFormat * sizeof(XvFormatRec));
+ moreSpace = reallocarray(pFormat, totFormat,
+ sizeof(XvFormatRec));
if (!moreSpace)
break;
pFormat = moreSpace;
diff --git a/xserver/hw/vfb/InitOutput.c b/xserver/hw/vfb/InitOutput.c
index bcaaa85e4..01bb63128 100644
--- a/xserver/hw/vfb/InitOutput.c
+++ b/xserver/hw/vfb/InitOutput.c
@@ -66,6 +66,7 @@ from The Open Group.
#include "dix.h"
#include "miline.h"
#include "glx_extinit.h"
+#include "randrstr.h"
#define VFB_DEFAULT_WIDTH 1280
#define VFB_DEFAULT_HEIGHT 1024
@@ -292,7 +293,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
if (vfbNumScreens <= screenNum) {
vfbScreens =
- realloc(vfbScreens, sizeof(*vfbScreens) * (screenNum + 1));
+ reallocarray(vfbScreens, screenNum + 1, sizeof(*vfbScreens));
if (!vfbScreens)
FatalError("Not enough memory for screen %d\n", screenNum);
for (; vfbNumScreens <= screenNum; ++vfbNumScreens)
@@ -407,9 +408,9 @@ vfbInstallColormap(ColormapPtr pmap)
swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue);
swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries);
- ppix = (Pixel *) malloc(entries * sizeof(Pixel));
- prgb = (xrgb *) malloc(entries * sizeof(xrgb));
- defs = (xColorItem *) malloc(entries * sizeof(xColorItem));
+ ppix = xallocarray(entries, sizeof(Pixel));
+ prgb = xallocarray(entries, sizeof(xrgb));
+ defs = xallocarray(entries, sizeof(xColorItem));
for (i = 0; i < entries; i++)
ppix[i] = i;
@@ -739,6 +740,125 @@ vfbCloseScreen(ScreenPtr pScreen)
}
static Bool
+vfbRROutputValidateMode(ScreenPtr pScreen,
+ RROutputPtr output,
+ RRModePtr mode)
+{
+ rrScrPriv(pScreen);
+
+ if (pScrPriv->minWidth <= mode->mode.width &&
+ pScrPriv->maxWidth >= mode->mode.width &&
+ pScrPriv->minHeight <= mode->mode.height &&
+ pScrPriv->maxHeight >= mode->mode.height)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+static Bool
+vfbRRScreenSetSize(ScreenPtr pScreen,
+ CARD16 width,
+ CARD16 height,
+ CARD32 mmWidth,
+ CARD32 mmHeight)
+{
+ // Prevent screen updates while we change things around
+ SetRootClip(pScreen, ROOT_CLIP_NONE);
+
+ pScreen->width = width;
+ pScreen->height = height;
+ pScreen->mmWidth = mmWidth;
+ pScreen->mmHeight = mmHeight;
+
+ // Restore the ability to update screen, now with new dimensions
+ SetRootClip(pScreen, ROOT_CLIP_FULL);
+
+ RRScreenSizeNotify (pScreen);
+ RRTellChanged(pScreen);
+
+ return TRUE;
+}
+
+static Bool
+vfbRRCrtcSet(ScreenPtr pScreen,
+ RRCrtcPtr crtc,
+ RRModePtr mode,
+ int x,
+ int y,
+ Rotation rotation,
+ int numOutput,
+ RROutputPtr *outputs)
+{
+ return RRCrtcNotify(crtc, mode, x, y, rotation, NULL, numOutput, outputs);
+}
+
+static Bool
+vfbRRGetInfo(ScreenPtr pScreen, Rotation *rotations)
+{
+ return TRUE;
+}
+
+static Bool
+vfbRandRInit(ScreenPtr pScreen)
+{
+ rrScrPrivPtr pScrPriv;
+#if RANDR_12_INTERFACE
+ RRModePtr mode;
+ RRCrtcPtr crtc;
+ RROutputPtr output;
+ xRRModeInfo modeInfo;
+ char name[64];
+#endif
+
+ if (!RRScreenInit (pScreen))
+ return FALSE;
+ pScrPriv = rrGetScrPriv(pScreen);
+ pScrPriv->rrGetInfo = vfbRRGetInfo;
+#if RANDR_12_INTERFACE
+ pScrPriv->rrCrtcSet = vfbRRCrtcSet;
+ pScrPriv->rrScreenSetSize = vfbRRScreenSetSize;
+ pScrPriv->rrOutputSetProperty = NULL;
+#if RANDR_13_INTERFACE
+ pScrPriv->rrOutputGetProperty = NULL;
+#endif
+ pScrPriv->rrOutputValidateMode = vfbRROutputValidateMode;
+ pScrPriv->rrModeDestroy = NULL;
+
+ RRScreenSetSizeRange (pScreen,
+ 1, 1,
+ pScreen->width, pScreen->height);
+
+ sprintf (name, "%dx%d", pScreen->width, pScreen->height);
+ memset (&modeInfo, '\0', sizeof (modeInfo));
+ modeInfo.width = pScreen->width;
+ modeInfo.height = pScreen->height;
+ modeInfo.nameLength = strlen (name);
+
+ mode = RRModeGet (&modeInfo, name);
+ if (!mode)
+ return FALSE;
+
+ crtc = RRCrtcCreate (pScreen, NULL);
+ if (!crtc)
+ return FALSE;
+
+ output = RROutputCreate (pScreen, "screen", 6, NULL);
+ if (!output)
+ return FALSE;
+ if (!RROutputSetClones (output, NULL, 0))
+ return FALSE;
+ if (!RROutputSetModes (output, &mode, 1, 0))
+ return FALSE;
+ if (!RROutputSetCrtcs (output, &crtc, 1))
+ return FALSE;
+ if (!RROutputSetConnection (output, RR_Connected))
+ return FALSE;
+ RRCrtcNotify (crtc, mode, 0, 0, RR_Rotate_0, NULL, 1, &output);
+#endif
+ return TRUE;
+}
+
+static Bool
vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
{
vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
@@ -811,6 +931,9 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
if (!ret)
return FALSE;
+ if (!vfbRandRInit(pScreen))
+ return FALSE;
+
pScreen->InstallColormap = vfbInstallColormap;
pScreen->SaveScreen = vfbSaveScreen;
diff --git a/xserver/hw/vfb/Makefile.in b/xserver/hw/vfb/Makefile.in
index 50855df78..5be673a45 100644
--- a/xserver/hw/vfb/Makefile.in
+++ b/xserver/hw/vfb/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -263,7 +262,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -393,8 +391,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/vfb/man/Makefile.in b/xserver/hw/vfb/man/Makefile.in
index 143b72b30..4d8be794b 100644
--- a/xserver/hw/vfb/man/Makefile.in
+++ b/xserver/hw/vfb/man/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -213,7 +212,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -360,8 +358,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/Makefile.am b/xserver/hw/xfree86/Makefile.am
index 27f2cc6cb..85bd0bed0 100644
--- a/xserver/hw/xfree86/Makefile.am
+++ b/xserver/hw/xfree86/Makefile.am
@@ -49,7 +49,7 @@ bin_PROGRAMS = Xorg
nodist_Xorg_SOURCES = sdksyms.c
AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
+AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/parser \
-I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \
-I$(srcdir)/dri -I$(srcdir)/dri2 -I$(top_srcdir)/dri3
@@ -59,7 +59,7 @@ LOCAL_LIBS = \
loader/libloader.la \
common/libcommon.la \
os-support/libxorgos.la \
- parser/libxf86config_internal.la \
+ parser/libxf86config.la \
dixmods/libdixmods.la \
modes/libxf86modes.la \
ramdac/libramdac.la \
@@ -72,7 +72,9 @@ LOCAL_LIBS = \
$(DRI3_LIB) \
$(top_builddir)/miext/sync/libsync.la \
$(top_builddir)/mi/libmi.la \
- $(top_builddir)/os/libos.la
+ $(top_builddir)/os/libos.la \
+ $(top_builddir)/Xext/libXvidmode.la
+
Xorg_LDADD = \
$(LOCAL_LIBS) \
$(XORG_SYS_LIBS) \
diff --git a/xserver/hw/xfree86/Makefile.in b/xserver/hw/xfree86/Makefile.in
index d390ae34f..082f0f90b 100644
--- a/xserver/hw/xfree86/Makefile.in
+++ b/xserver/hw/xfree86/Makefile.in
@@ -59,8 +59,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -81,12 +80,13 @@ Xorg_OBJECTS = $(nodist_Xorg_OBJECTS)
am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
loader/libloader.la common/libcommon.la \
- os-support/libxorgos.la parser/libxf86config_internal.la \
+ 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 \
- $(top_builddir)/mi/libmi.la $(top_builddir)/os/libos.la
+ $(top_builddir)/mi/libmi.la $(top_builddir)/os/libos.la \
+ $(top_builddir)/Xext/libXvidmode.la
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
@@ -270,7 +270,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -400,8 +399,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -549,7 +546,7 @@ DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
nodist_Xorg_SOURCES = sdksyms.c
AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
+AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/parser \
-I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \
-I$(srcdir)/dri -I$(srcdir)/dri2 -I$(top_srcdir)/dri3
@@ -559,7 +556,7 @@ LOCAL_LIBS = \
loader/libloader.la \
common/libcommon.la \
os-support/libxorgos.la \
- parser/libxf86config_internal.la \
+ parser/libxf86config.la \
dixmods/libdixmods.la \
modes/libxf86modes.la \
ramdac/libramdac.la \
@@ -572,7 +569,8 @@ LOCAL_LIBS = \
$(DRI3_LIB) \
$(top_builddir)/miext/sync/libsync.la \
$(top_builddir)/mi/libmi.la \
- $(top_builddir)/os/libos.la
+ $(top_builddir)/os/libos.la \
+ $(top_builddir)/Xext/libXvidmode.la
Xorg_LDADD = \
$(LOCAL_LIBS) \
diff --git a/xserver/hw/xfree86/common/Makefile.am b/xserver/hw/xfree86/common/Makefile.am
index 54e7f4d0a..caae7fd97 100644
--- a/xserver/hw/xfree86/common/Makefile.am
+++ b/xserver/hw/xfree86/common/Makefile.am
@@ -14,11 +14,6 @@ XVSOURCES = xf86xv.c xf86xvmc.c
XVSDKINCS = xf86xv.h xf86xvmc.h xf86xvpriv.h
endif
-if XF86VIDMODE
-XF86VMODESOURCES = xf86vmode.c
-XF86VMODE_SDK = vidmodeproc.h
-endif
-
if DGA
DGASOURCES = xf86DGA.c
DGA_SDK = dgaproc.h
@@ -72,7 +67,6 @@ CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = \
compiler.h \
fourcc.h \
- vidmodeproc.h \
xf86.h \
xf86Bus.h \
xf86Config.h \
diff --git a/xserver/hw/xfree86/common/Makefile.in b/xserver/hw/xfree86/common/Makefile.in
index b30bd2bd8..3e018db98 100644
--- a/xserver/hw/xfree86/common/Makefile.in
+++ b/xserver/hw/xfree86/common/Makefile.in
@@ -61,8 +61,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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,26 +82,25 @@ am__libcommon_la_SOURCES_DIST = xf86Configure.c xf86Bus.c xf86Config.c \
xf86AutoConfig.c xf86Option.c xf86Init.c xf86VidMode.c \
xf86fbman.c xf86cmap.c xf86Helper.c xf86PM.c xf86Xinput.c \
xisb.c xf86Mode.c xorgHelper.c xf86Extensions.h \
- xf86Extensions.c xf86vmode.c xf86xv.c xf86xvmc.c xf86fbBus.c \
- xf86noBus.c xf86pciBus.c xf86VGAarbiter.c xf86VGAarbiter.h \
+ xf86Extensions.c xf86xv.c xf86xvmc.c xf86fbBus.c xf86noBus.c \
+ xf86pciBus.c xf86VGAarbiter.c xf86VGAarbiter.h \
xf86VGAarbiterPriv.h xf86sbusBus.c xf86platformBus.c \
xf86RandR.c
@DGA_TRUE@am__objects_1 = xf86DGA.lo
-@XF86VIDMODE_TRUE@am__objects_2 = xf86vmode.lo
-@XV_TRUE@am__objects_3 = xf86xv.lo xf86xvmc.lo
-@XORG_BUS_PCI_TRUE@am__objects_4 = xf86pciBus.lo xf86VGAarbiter.lo
-@XORG_BUS_SPARC_TRUE@am__objects_5 = xf86sbusBus.lo
-@XORG_BUS_PLATFORM_TRUE@am__objects_6 = xf86platformBus.lo
-am__objects_7 = xf86fbBus.lo xf86noBus.lo $(am__objects_4) \
- $(am__objects_5) $(am__objects_6)
-am__objects_8 = xf86RandR.lo
+@XV_TRUE@am__objects_2 = xf86xv.lo xf86xvmc.lo
+@XORG_BUS_PCI_TRUE@am__objects_3 = xf86pciBus.lo xf86VGAarbiter.lo
+@XORG_BUS_SPARC_TRUE@am__objects_4 = xf86sbusBus.lo
+@XORG_BUS_PLATFORM_TRUE@am__objects_5 = xf86platformBus.lo
+am__objects_6 = xf86fbBus.lo xf86noBus.lo $(am__objects_3) \
+ $(am__objects_4) $(am__objects_5)
+am__objects_7 = xf86RandR.lo
am_libcommon_la_OBJECTS = xf86Configure.lo xf86Bus.lo xf86Config.lo \
xf86Cursor.lo $(am__objects_1) xf86DPMS.lo xf86Events.lo \
xf86Globals.lo xf86AutoConfig.lo xf86Option.lo xf86Init.lo \
xf86VidMode.lo xf86fbman.lo xf86cmap.lo xf86Helper.lo \
xf86PM.lo xf86Xinput.lo xisb.lo xf86Mode.lo xorgHelper.lo \
- xf86Extensions.lo $(am__objects_2) $(am__objects_3) \
- $(am__objects_7) $(am__objects_8)
+ xf86Extensions.lo $(am__objects_2) $(am__objects_6) \
+ $(am__objects_7)
nodist_libcommon_la_OBJECTS = xf86DefModeSet.lo
libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS) \
$(nodist_libcommon_la_OBJECTS)
@@ -154,9 +152,8 @@ am__can_run_installinfo = \
am__sdk_HEADERS_DIST = compiler.h fourcc.h xf86.h xf86Module.h \
xf86Opt.h xf86PciInfo.h xf86Priv.h xf86Privstr.h xf86cmap.h \
xf86fbman.h xf86str.h xf86Xinput.h xisb.h xf86xv.h xf86xvmc.h \
- xf86xvpriv.h vidmodeproc.h dgaproc.h xorgVersion.h \
- xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h \
- xf86platformBus.h xaarop.h
+ xf86xvpriv.h dgaproc.h xorgVersion.h xf86sbusBus.h \
+ xf86VGAarbiter.h xf86Optionstr.h xf86platformBus.h xaarop.h
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -280,7 +277,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -410,8 +406,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -542,8 +536,6 @@ noinst_LTLIBRARIES = libcommon.la
@XORG_BUS_SPARC_TRUE@SBUS_SOURCES = xf86sbusBus.c
@XV_TRUE@XVSOURCES = xf86xv.c xf86xvmc.c
@XV_TRUE@XVSDKINCS = xf86xv.h xf86xvmc.h xf86xvpriv.h
-@XF86VIDMODE_TRUE@XF86VMODESOURCES = xf86vmode.c
-@XF86VIDMODE_TRUE@XF86VMODE_SDK = vidmodeproc.h
@DGA_TRUE@DGASOURCES = xf86DGA.c
@DGA_TRUE@DGA_SDK = dgaproc.h
@XORG_BUS_PLATFORM_TRUE@PLATSOURCES = xf86platformBus.c
@@ -582,7 +574,6 @@ CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = \
compiler.h \
fourcc.h \
- vidmodeproc.h \
xf86.h \
xf86Bus.h \
xf86Config.h \
@@ -694,7 +685,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86pciBus.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86platformBus.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86sbusBus.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86vmode.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86xv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86xvmc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xisb.Plo@am__quote@
diff --git a/xserver/hw/xfree86/common/compiler.h b/xserver/hw/xfree86/common/compiler.h
index e355926b5..4e50a935d 100644
--- a/xserver/hw/xfree86/common/compiler.h
+++ b/xserver/hw/xfree86/common/compiler.h
@@ -286,7 +286,7 @@ extern _X_EXPORT unsigned int inl(unsigned int port);
#include <machine/pio.h>
#endif /* __NetBSD__ */
-#elif defined(__amd64__)
+#elif defined(__amd64__) || defined(__i386__) || defined(__ia64__)
#include <inttypes.h>
@@ -967,53 +967,6 @@ inl(unsigned PORT_SIZE port)
#endif /* NDS32_MMIO_SWAP */
-#elif defined(__i386__) || defined(__ia64__)
-
-static __inline__ void
-outb(unsigned short port, unsigned char val)
-{
- __asm__ __volatile__("out%B0 (%1)"::"a"(val), "d"(port));
-}
-
-static __inline__ void
-outw(unsigned short port, unsigned short val)
-{
- __asm__ __volatile__("out%W0 (%1)"::"a"(val), "d"(port));
-}
-
-static __inline__ void
-outl(unsigned short port, unsigned int val)
-{
- __asm__ __volatile__("out%L0 (%1)"::"a"(val), "d"(port));
-}
-
-static __inline__ unsigned int
-inb(unsigned short port)
-{
- unsigned char ret;
- __asm__ __volatile__("in%B0 (%1)":"=a"(ret):"d"(port));
-
- return ret;
-}
-
-static __inline__ unsigned int
-inw(unsigned short port)
-{
- unsigned short ret;
- __asm__ __volatile__("in%W0 (%1)":"=a"(ret):"d"(port));
-
- return ret;
-}
-
-static __inline__ unsigned int
-inl(unsigned short port)
-{
- unsigned int ret;
- __asm__ __volatile__("in%L0 (%1)":"=a"(ret):"d"(port));
-
- return ret;
-}
-
#endif /* arch madness */
#else /* !GNUC */
@@ -1036,18 +989,7 @@ inl(unsigned short port)
/* entry points for Mmio memory access routines */
extern _X_EXPORT int (*xf86ReadMmio8) (void *, unsigned long);
extern _X_EXPORT int (*xf86ReadMmio16) (void *, unsigned long);
-
-#ifndef STANDALONE_MMIO
extern _X_EXPORT int (*xf86ReadMmio32) (void *, unsigned long);
-#else
-/* Some DRI 3D drivers need MMIO_IN32. */
-static __inline__ int
-xf86ReadMmio32(void *Base, unsigned long Offset)
-{
- mem_barrier();
- return *(volatile unsigned int *) ((unsigned long) Base + (Offset));
-}
-#endif
extern _X_EXPORT void (*xf86WriteMmio8) (int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmio16) (int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmio32) (int, void *, unsigned long);
@@ -1059,11 +1001,7 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
/* Changed to kill noise generated by gcc's -Wcast-align */
#define MMIO_IN8(base, offset) (*xf86ReadMmio8)(base, offset)
#define MMIO_IN16(base, offset) (*xf86ReadMmio16)(base, offset)
-#ifndef STANDALONE_MMIO
#define MMIO_IN32(base, offset) (*xf86ReadMmio32)(base, offset)
-#else
-#define MMIO_IN32(base, offset) xf86ReadMmio32(base, offset)
-#endif
#define MMIO_OUT32(base, offset, val) \
do { \
diff --git a/xserver/hw/xfree86/common/dgaproc.h b/xserver/hw/xfree86/common/dgaproc.h
index 87e923f26..7925bd483 100644
--- a/xserver/hw/xfree86/common/dgaproc.h
+++ b/xserver/hw/xfree86/common/dgaproc.h
@@ -54,57 +54,15 @@ typedef struct {
/* DDX interface */
-extern _X_EXPORT int
- DGASetMode(int Index, int num, XDGAModePtr mode, PixmapPtr *pPix);
-
-extern _X_EXPORT void
- DGASetInputMode(int Index, Bool keyboard, Bool mouse);
-
-extern _X_EXPORT void
- DGASelectInput(int Index, ClientPtr client, long mask);
-
-extern _X_EXPORT Bool DGAAvailable(int Index);
-extern _X_EXPORT Bool DGAScreenAvailable(ScreenPtr pScreen);
-extern _X_EXPORT Bool DGAActive(int Index);
-extern _X_EXPORT void DGAShutdown(void);
-extern _X_EXPORT void DGAInstallCmap(ColormapPtr cmap);
-extern _X_EXPORT int DGAGetViewportStatus(int Index);
-extern _X_EXPORT int DGASync(int Index);
-
-extern _X_EXPORT int
- DGAFillRect(int Index, int x, int y, int w, int h, unsigned long color);
-
-extern _X_EXPORT int
- DGABlitRect(int Index, int srcx, int srcy, int w, int h, int dstx, int dsty);
-
-extern _X_EXPORT int
-
-DGABlitTransRect(int Index,
- int srcx, int srcy,
- int w, int h, int dstx, int dsty, unsigned long color);
-
-extern _X_EXPORT int
- DGASetViewport(int Index, int x, int y, int mode);
-
-extern _X_EXPORT int DGAGetModes(int Index);
-extern _X_EXPORT int DGAGetOldDGAMode(int Index);
-
-extern _X_EXPORT int DGAGetModeInfo(int Index, XDGAModePtr mode, int num);
-
-extern _X_EXPORT Bool DGAVTSwitch(void);
-extern _X_EXPORT Bool DGAStealButtonEvent(DeviceIntPtr dev, int Index,
- int button, int is_down);
-extern _X_EXPORT Bool DGAStealMotionEvent(DeviceIntPtr dev, int Index, int dx,
- int dy);
-extern _X_EXPORT Bool DGAStealKeyEvent(DeviceIntPtr dev, int Index,
- int key_code, int is_down);
-
-extern _X_EXPORT Bool DGAOpenFramebuffer(int Index, char **name,
- unsigned char **mem, int *size,
- int *offset, int *flags);
-extern _X_EXPORT void DGACloseFramebuffer(int Index);
-extern _X_EXPORT Bool DGAChangePixmapMode(int Index, int *x, int *y, int mode);
-extern _X_EXPORT int DGACreateColormap(int Index, ClientPtr client, int id,
- int mode, int alloc);
+extern Bool DGAScreenAvailable(ScreenPtr pScreen);
+extern Bool DGAActive(int Index);
+extern void DGAShutdown(void);
+
+extern Bool DGAVTSwitch(void);
+extern Bool DGAStealButtonEvent(DeviceIntPtr dev, int Index,
+ int button, int is_down);
+extern Bool DGAStealMotionEvent(DeviceIntPtr dev, int Index, int dx, int dy);
+extern Bool DGAStealKeyEvent(DeviceIntPtr dev, int Index,
+ int key_code, int is_down);
#endif /* __DGAPROC_H */
diff --git a/xserver/hw/xfree86/common/vidmodeproc.h b/xserver/hw/xfree86/common/vidmodeproc.h
deleted file mode 100644
index cff340c47..000000000
--- a/xserver/hw/xfree86/common/vidmodeproc.h
+++ /dev/null
@@ -1,84 +0,0 @@
-
-/* Prototypes for DGA functions that the DDX must provide */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef _VIDMODEPROC_H_
-#define _VIDMODEPROC_H_
-
-typedef enum {
- VIDMODE_H_DISPLAY,
- VIDMODE_H_SYNCSTART,
- VIDMODE_H_SYNCEND,
- VIDMODE_H_TOTAL,
- VIDMODE_H_SKEW,
- VIDMODE_V_DISPLAY,
- VIDMODE_V_SYNCSTART,
- VIDMODE_V_SYNCEND,
- VIDMODE_V_TOTAL,
- VIDMODE_FLAGS,
- VIDMODE_CLOCK
-} VidModeSelectMode;
-
-typedef enum {
- VIDMODE_MON_VENDOR,
- VIDMODE_MON_MODEL,
- VIDMODE_MON_NHSYNC,
- VIDMODE_MON_NVREFRESH,
- VIDMODE_MON_HSYNC_LO,
- VIDMODE_MON_HSYNC_HI,
- VIDMODE_MON_VREFRESH_LO,
- VIDMODE_MON_VREFRESH_HI
-} VidModeSelectMonitor;
-
-typedef union {
- const void *ptr;
- int i;
- float f;
-} vidMonitorValue;
-
-extern Bool VidModeExtensionInit(ScreenPtr pScreen);
-
-extern _X_EXPORT Bool VidModeAvailable(int scrnIndex);
-extern _X_EXPORT Bool VidModeGetCurrentModeline(int scrnIndex, void **mode,
- int *dotClock);
-extern _X_EXPORT Bool VidModeGetFirstModeline(int scrnIndex, void **mode,
- int *dotClock);
-extern _X_EXPORT Bool VidModeGetNextModeline(int scrnIndex, void **mode,
- int *dotClock);
-extern _X_EXPORT Bool VidModeDeleteModeline(int scrnIndex, void *mode);
-extern _X_EXPORT Bool VidModeZoomViewport(int scrnIndex, int zoom);
-extern _X_EXPORT Bool VidModeGetViewPort(int scrnIndex, int *x, int *y);
-extern _X_EXPORT Bool VidModeSetViewPort(int scrnIndex, int x, int y);
-extern _X_EXPORT Bool VidModeSwitchMode(int scrnIndex, void *mode);
-extern _X_EXPORT Bool VidModeLockZoom(int scrnIndex, Bool lock);
-extern _X_EXPORT Bool VidModeGetMonitor(int scrnIndex, void **monitor);
-extern _X_EXPORT int VidModeGetNumOfClocks(int scrnIndex, Bool *progClock);
-extern _X_EXPORT Bool VidModeGetClocks(int scrnIndex, int *Clocks);
-extern _X_EXPORT ModeStatus VidModeCheckModeForMonitor(int scrnIndex,
- void *mode);
-extern _X_EXPORT ModeStatus VidModeCheckModeForDriver(int scrnIndex,
- void *mode);
-extern _X_EXPORT void VidModeSetCrtcForMode(int scrnIndex, void *mode);
-extern _X_EXPORT Bool VidModeAddModeline(int scrnIndex, void *mode);
-extern _X_EXPORT int VidModeGetDotClock(int scrnIndex, int Clock);
-extern _X_EXPORT int VidModeGetNumOfModes(int scrnIndex);
-extern _X_EXPORT Bool VidModeSetGamma(int scrnIndex, float red, float green,
- float blue);
-extern _X_EXPORT Bool VidModeGetGamma(int scrnIndex, float *red, float *green,
- float *blue);
-extern _X_EXPORT void *VidModeCreateMode(void);
-extern _X_EXPORT void VidModeCopyMode(void *modefrom, void *modeto);
-extern _X_EXPORT int VidModeGetModeValue(void *mode, int valtyp);
-extern _X_EXPORT void VidModeSetModeValue(void *mode, int valtyp, int val);
-extern _X_EXPORT vidMonitorValue VidModeGetMonitorValue(void *monitor,
- int valtyp, int indx);
-extern _X_EXPORT Bool VidModeSetGammaRamp(int, int, CARD16 *, CARD16 *,
- CARD16 *);
-extern _X_EXPORT Bool VidModeGetGammaRamp(int, int, CARD16 *, CARD16 *,
- CARD16 *);
-extern _X_EXPORT int VidModeGetGammaRampSize(int scrnIndex);
-
-#endif
diff --git a/xserver/hw/xfree86/common/xf86.h b/xserver/hw/xfree86/common/xf86.h
index 49ff35b86..1cde47873 100644
--- a/xserver/hw/xfree86/common/xf86.h
+++ b/xserver/hw/xfree86/common/xf86.h
@@ -368,22 +368,11 @@ xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
/* xf86Mode.c */
-extern _X_EXPORT int
-xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
- int DivFactor, int MulFactor, int *divider);
extern _X_EXPORT const char *
xf86ModeStatusToString(ModeStatus status);
extern _X_EXPORT ModeStatus
-xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
- ClockRangePtr clockRanges, LookupModeFlags strategy);
-extern _X_EXPORT ModeStatus
xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
extern _X_EXPORT ModeStatus
-xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
- ClockRangePtr clockRanges,
- LookupModeFlags strategy,
- int maxPitch, int virtualX, int virtualY);
-extern _X_EXPORT ModeStatus
xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags);
extern _X_EXPORT int
xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
diff --git a/xserver/hw/xfree86/common/xf86AutoConfig.c b/xserver/hw/xfree86/common/xf86AutoConfig.c
index b0e036058..117e5d7ab 100644
--- a/xserver/hw/xfree86/common/xf86AutoConfig.c
+++ b/xserver/hw/xfree86/common/xf86AutoConfig.c
@@ -105,7 +105,7 @@ AppendToList(const char *s, const char ***list, int *lines)
str = xnfstrdup(s);
for (p = strtok(str, "\n"); p; p = strtok(NULL, "\n")) {
(*lines)++;
- *list = xnfrealloc(*list, (*lines + 1) * sizeof(**list));
+ *list = xnfreallocarray(*list, *lines + 1, sizeof(**list));
newstr = xnfalloc(strlen(p) + 2);
strcpy(newstr, p);
strcat(newstr, "\n");
diff --git a/xserver/hw/xfree86/common/xf86Bus.c b/xserver/hw/xfree86/common/xf86Bus.c
index ad255aeed..2b412fa2f 100644
--- a/xserver/hw/xfree86/common/xf86Bus.c
+++ b/xserver/hw/xfree86/common/xf86Bus.c
@@ -256,11 +256,11 @@ int
xf86AllocateEntity(void)
{
xf86NumEntities++;
- xf86Entities = xnfrealloc(xf86Entities,
- sizeof(EntityPtr) * xf86NumEntities);
+ xf86Entities = xnfreallocarray(xf86Entities,
+ xf86NumEntities, sizeof(EntityPtr));
xf86Entities[xf86NumEntities - 1] = xnfcalloc(1, sizeof(EntityRec));
xf86Entities[xf86NumEntities - 1]->entityPrivates =
- xnfcalloc(sizeof(DevUnion) * xf86EntityPrivateCount, 1);
+ xnfcalloc(xf86EntityPrivateCount, sizeof(DevUnion));
return xf86NumEntities - 1;
}
@@ -326,12 +326,13 @@ xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex)
}
pScrn->numEntities++;
- pScrn->entityList = xnfrealloc(pScrn->entityList,
- pScrn->numEntities * sizeof(int));
+ pScrn->entityList = xnfreallocarray(pScrn->entityList,
+ pScrn->numEntities, sizeof(int));
pScrn->entityList[pScrn->numEntities - 1] = entityIndex;
xf86Entities[entityIndex]->inUse = TRUE;
- pScrn->entityInstanceList = xnfrealloc(pScrn->entityInstanceList,
- pScrn->numEntities * sizeof(int));
+ pScrn->entityInstanceList = xnfreallocarray(pScrn->entityInstanceList,
+ pScrn->numEntities,
+ sizeof(int));
pScrn->entityInstanceList[pScrn->numEntities - 1] = 0;
}
@@ -427,8 +428,8 @@ xf86AddDevToEntity(int entityIndex, GDevPtr dev)
pEnt = xf86Entities[entityIndex];
pEnt->numInstances++;
- pEnt->devices = xnfrealloc(pEnt->devices,
- pEnt->numInstances * sizeof(GDevPtr));
+ pEnt->devices = xnfreallocarray(pEnt->devices,
+ pEnt->numInstances, sizeof(GDevPtr));
pEnt->devices[pEnt->numInstances - 1] = dev;
dev->claimed = TRUE;
}
@@ -670,8 +671,8 @@ xf86AllocateEntityPrivateIndex(void)
idx = xf86EntityPrivateCount++;
for (i = 0; i < xf86NumEntities; i++) {
pEnt = xf86Entities[i];
- nprivs = xnfrealloc(pEnt->entityPrivates,
- xf86EntityPrivateCount * sizeof(DevUnion));
+ nprivs = xnfreallocarray(pEnt->entityPrivates,
+ xf86EntityPrivateCount, sizeof(DevUnion));
/* Zero the new private */
memset(&nprivs[idx], 0, sizeof(DevUnion));
pEnt->entityPrivates = nprivs;
diff --git a/xserver/hw/xfree86/common/xf86Config.c b/xserver/hw/xfree86/common/xf86Config.c
index e6ac49a48..8e6b2edb1 100644
--- a/xserver/hw/xfree86/common/xf86Config.c
+++ b/xserver/hw/xfree86/common/xf86Config.c
@@ -46,10 +46,8 @@
#include <xorg-config.h>
#endif
-#ifdef XF86DRI
#include <sys/types.h>
#include <grp.h>
-#endif
#include "xf86.h"
#include "xf86Modes.h"
@@ -123,18 +121,16 @@ static ModuleDefault ModuleDefaults[] = {
/* Forward declarations */
static Bool configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen,
- int scrnum, MessageType from);
+ int scrnum, MessageType from, Bool auto_gpu_device);
static Bool configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor);
static Bool configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device,
- Bool active);
+ Bool active, Bool gpu);
static Bool configInput(InputInfoPtr pInfo, XF86ConfInputPtr conf_input,
MessageType from);
static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display);
static Bool addDefaultModes(MonPtr monitorp);
-#ifdef XF86DRI
static void configDRI(XF86ConfDRIPtr drip);
-#endif
static void configExtensions(XF86ConfExtensionsPtr conf_ext);
/*
@@ -363,8 +359,8 @@ xf86ModulelistFromConfig(void ***optlist)
/*
* allocate the memory and walk the list again to fill in the pointers
*/
- modulearray = xnfalloc((count + 1) * sizeof(char *));
- optarray = xnfalloc((count + 1) * sizeof(void *));
+ modulearray = xnfallocarray(count + 1, sizeof(char *));
+ optarray = xnfallocarray(count + 1, sizeof(void *));
count = 0;
if (xf86configptr->conf_modules) {
modp = xf86configptr->conf_modules->mod_load_lst;
@@ -390,7 +386,7 @@ const char **
xf86DriverlistFromConfig(void)
{
int count = 0;
- int j;
+ int j, k;
const char **modulearray;
screenLayoutPtr slp;
@@ -411,8 +407,10 @@ xf86DriverlistFromConfig(void)
*/
if (xf86ConfigLayout.screens) {
slp = xf86ConfigLayout.screens;
- while ((slp++)->screen) {
+ while (slp->screen) {
count++;
+ count += slp->screen->num_gpu_devices;
+ slp++;
}
}
@@ -429,12 +427,16 @@ xf86DriverlistFromConfig(void)
/*
* allocate the memory and walk the list again to fill in the pointers
*/
- modulearray = xnfalloc((count + 1) * sizeof(char *));
+ modulearray = xnfallocarray(count + 1, sizeof(char *));
count = 0;
slp = xf86ConfigLayout.screens;
while (slp->screen) {
modulearray[count] = slp->screen->device->driver;
count++;
+ for (k = 0; k < slp->screen->num_gpu_devices; k++) {
+ modulearray[count] = slp->screen->gpu_devices[k]->driver;
+ count++;
+ }
slp++;
}
@@ -493,7 +495,7 @@ xf86InputDriverlistFromConfig(void)
/*
* allocate the memory and walk the list again to fill in the pointers
*/
- modulearray = xnfalloc((count + 1) * sizeof(char *));
+ modulearray = xnfallocarray(count + 1, sizeof(char *));
count = 0;
idp = xf86ConfigLayout.inputs;
while (idp && *idp) {
@@ -696,6 +698,7 @@ typedef enum {
FLAG_DRI2,
FLAG_USE_SIGIO,
FLAG_AUTO_ADD_GPU,
+ FLAG_MAX_CLIENTS,
} FlagValues;
/**
@@ -755,6 +758,8 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE},
{FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN,
{0}, FALSE},
+ {FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER,
+ {0}, FALSE },
{-1, NULL, OPTV_NONE,
{0}, FALSE},
};
@@ -1045,6 +1050,19 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
xf86Info.dri2From = X_CONFIG;
}
#endif
+
+ from = X_DEFAULT;
+ if (LimitClients != LIMITCLIENTS)
+ from = X_CMDLINE;
+ i = -1;
+ if (xf86GetOptValInteger(FlagOptions, FLAG_MAX_CLIENTS, &i)) {
+ if (i != 64 && i != 128 && i != 256 && i != 512)
+ ErrorF("MaxClients must be one of 64, 128, 256 or 512\n");
+ from = X_CONFIG;
+ LimitClients = i;
+ }
+ xf86Msg(from, "Max clients allowed: %i, resource mask: 0x%x\n",
+ LimitClients, RESOURCE_ID_MASK);
}
Bool
@@ -1085,7 +1103,7 @@ addDevice(InputInfoPtr * list, InputInfoPtr pInfo)
for (devs = list; devs && *devs; devs++)
count++;
- list = xnfrealloc(list, (count + 1) * sizeof(InputInfoPtr));
+ list = xnfreallocarray(list, count + 1, sizeof(InputInfoPtr));
list[count] = NULL;
list[count - 1] = pInfo;
@@ -1501,7 +1519,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
if (!count) /* alloc enough storage even if no screen is specified */
count = 1;
- slp = xnfcalloc(1, (count + 1) * sizeof(screenLayoutRec));
+ slp = xnfcalloc((count + 1), sizeof(screenLayoutRec));
slp[count].screen = NULL;
/*
* now that we have storage, loop over the list again and fill in our
@@ -1517,7 +1535,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
else
scrnum = adjp->adj_scrnum;
if (!configScreen(slp[count].screen, adjp->adj_screen, scrnum,
- X_CONFIG)) {
+ X_CONFIG, (scrnum == 0 && !adjp->list.next))) {
do {
free(slp[count].screen);
} while (count--);
@@ -1567,7 +1585,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
FIND_SUITABLE (XF86ConfScreenPtr, xf86configptr->conf_screen_lst, screen);
slp[0].screen = xnfcalloc(1, sizeof(confScreenRec));
if (!configScreen(slp[0].screen, screen,
- 0, X_CONFIG)) {
+ 0, X_CONFIG, TRUE)) {
free(slp[0].screen);
free(slp);
return FALSE;
@@ -1625,12 +1643,12 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
}
DebugF("Found %d inactive devices in the layout section %s\n",
count, conf_layout->lay_identifier);
- gdp = xnfalloc((count + 1) * sizeof(GDevRec));
+ gdp = xnfallocarray(count + 1, sizeof(GDevRec));
gdp[count].identifier = NULL;
idp = conf_layout->lay_inactive_lst;
count = 0;
while (idp) {
- if (!configDevice(&gdp[count], idp->inactive_device, FALSE))
+ if (!configDevice(&gdp[count], idp->inactive_device, FALSE, FALSE))
goto bail;
count++;
idp = (XF86ConfInactivePtr) idp->list.next;
@@ -1696,7 +1714,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen,
slp = xnfcalloc(1, 2 * sizeof(screenLayoutRec));
slp[0].screen = xnfcalloc(1, sizeof(confScreenRec));
slp[1].screen = NULL;
- if (!configScreen(slp[0].screen, conf_screen, 0, from)) {
+ if (!configScreen(slp[0].screen, conf_screen, 0, from, TRUE)) {
free(slp);
return FALSE;
}
@@ -1745,7 +1763,7 @@ configXvAdaptor(confXvAdaptorPtr adaptor, XF86ConfVideoAdaptorPtr conf_adaptor)
count++;
conf_port = (XF86ConfVideoPortPtr) conf_port->list.next;
}
- adaptor->ports = xnfalloc((count) * sizeof(confXvPortRec));
+ adaptor->ports = xnfallocarray(count, sizeof(confXvPortRec));
adaptor->numports = count;
count = 0;
conf_port = conf_adaptor->va_port_lst;
@@ -1761,13 +1779,14 @@ configXvAdaptor(confXvAdaptorPtr adaptor, XF86ConfVideoAdaptorPtr conf_adaptor)
static Bool
configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
- MessageType from)
+ MessageType from, Bool auto_gpu_device)
{
int count = 0;
XF86ConfDisplayPtr dispptr;
XF86ConfAdaptorLinkPtr conf_adaptor;
Bool defaultMonitor = FALSE;
XF86ConfScreenRec local_conf_screen;
+ int i;
if (!conf_screen) {
memset(&local_conf_screen, 0, sizeof(local_conf_screen));
@@ -1810,12 +1829,42 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
xf86Msg(X_DEFAULT, "No device specified for screen \"%s\".\n"
"\tUsing the first device section listed.\n", screenp->id);
}
- if (configDevice(screenp->device, conf_screen->scrn_device, TRUE)) {
+ if (configDevice(screenp->device, conf_screen->scrn_device, TRUE, FALSE)) {
screenp->device->myScreenSection = screenp;
}
else {
screenp->device = NULL;
}
+
+ if (auto_gpu_device && conf_screen->num_gpu_devices == 0 &&
+ xf86configptr->conf_device_lst) {
+ XF86ConfDevicePtr sdevice = xf86configptr->conf_device_lst->list.next;
+
+ for (i = 0; i < MAX_GPUDEVICES; i++) {
+ if (!sdevice)
+ break;
+
+ FIND_SUITABLE (XF86ConfDevicePtr, sdevice, conf_screen->scrn_gpu_devices[i]);
+ if (!conf_screen->scrn_gpu_devices[i])
+ break;
+ screenp->gpu_devices[i] = xnfcalloc(1, sizeof(GDevRec));
+ if (configDevice(screenp->gpu_devices[i], conf_screen->scrn_gpu_devices[i], TRUE, TRUE)) {
+ screenp->gpu_devices[i]->myScreenSection = screenp;
+ }
+ sdevice = conf_screen->scrn_gpu_devices[i]->list.next;
+ }
+ screenp->num_gpu_devices = i;
+
+ } else {
+ for (i = 0; i < conf_screen->num_gpu_devices; i++) {
+ screenp->gpu_devices[i] = xnfcalloc(1, sizeof(GDevRec));
+ if (configDevice(screenp->gpu_devices[i], conf_screen->scrn_gpu_devices[i], TRUE, TRUE)) {
+ screenp->gpu_devices[i]->myScreenSection = screenp;
+ }
+ }
+ screenp->num_gpu_devices = conf_screen->num_gpu_devices;
+ }
+
screenp->options = conf_screen->scrn_option_lst;
/*
@@ -1826,7 +1875,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
count++;
dispptr = (XF86ConfDisplayPtr) dispptr->list.next;
}
- screenp->displays = xnfalloc((count) * sizeof(DispRec));
+ screenp->displays = xnfallocarray(count, sizeof(DispRec));
screenp->numdisplays = count;
/* Fill in the default Virtual size, if any */
@@ -1856,7 +1905,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
count++;
conf_adaptor = (XF86ConfAdaptorLinkPtr) conf_adaptor->list.next;
}
- screenp->xvadaptors = xnfalloc((count) * sizeof(confXvAdaptorRec));
+ screenp->xvadaptors = xnfallocarray(count, sizeof(confXvAdaptorRec));
screenp->numxvadaptors = 0;
conf_adaptor = conf_screen->scrn_adaptor_lst;
while (conf_adaptor) {
@@ -2095,7 +2144,7 @@ configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display)
count++;
modep = (XF86ModePtr) modep->list.next;
}
- displayp->modes = xnfalloc((count + 1) * sizeof(char *));
+ displayp->modes = xnfallocarray(count + 1, sizeof(char *));
modep = conf_display->disp_mode_lst;
count = 0;
while (modep) {
@@ -2109,7 +2158,7 @@ configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display)
}
static Bool
-configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active)
+configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active, Bool gpu)
{
int i;
@@ -2117,10 +2166,14 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active)
return FALSE;
}
- if (active)
- xf86Msg(X_CONFIG, "| |-->Device \"%s\"\n",
- conf_device->dev_identifier);
- else
+ if (active) {
+ if (gpu)
+ xf86Msg(X_CONFIG, "| |-->GPUDevice \"%s\"\n",
+ conf_device->dev_identifier);
+ else
+ xf86Msg(X_CONFIG, "| |-->Device \"%s\"\n",
+ conf_device->dev_identifier);
+ } else
xf86Msg(X_CONFIG, "|-->Inactive Device \"%s\"\n",
conf_device->dev_identifier);
@@ -2160,7 +2213,6 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active)
return TRUE;
}
-#ifdef XF86DRI
static void
configDRI(XF86ConfDRIPtr drip)
{
@@ -2181,7 +2233,6 @@ configDRI(XF86ConfDRIPtr drip)
xf86ConfigDRI.mode = drip->dri_mode;
}
}
-#endif
static void
configExtensions(XF86ConfExtensionsPtr conf_ext)
@@ -2474,9 +2525,7 @@ xf86HandleConfigFile(Bool autoconfig)
configServerFlags(xf86configptr->conf_flags, xf86ConfigLayout.options);
configFiles(xf86configptr->conf_files);
configExtensions(xf86configptr->conf_extensions);
-#ifdef XF86DRI
configDRI(xf86configptr->conf_dri);
-#endif
checkInput(&xf86ConfigLayout, implicit_layout);
diff --git a/xserver/hw/xfree86/common/xf86Configure.c b/xserver/hw/xfree86/common/xf86Configure.c
index f37f22445..44758bcc7 100644
--- a/xserver/hw/xfree86/common/xf86Configure.c
+++ b/xserver/hw/xfree86/common/xf86Configure.c
@@ -109,7 +109,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData,
/* Allocate new structure occurrence */
i = nDevToConfig++;
DevToConfig =
- xnfrealloc(DevToConfig, nDevToConfig * sizeof(DevToConfigRec));
+ xnfreallocarray(DevToConfig, nDevToConfig, sizeof(DevToConfigRec));
memset(DevToConfig + i, 0, sizeof(DevToConfigRec));
DevToConfig[i].GDev.chipID =
@@ -645,10 +645,10 @@ DoConfigure(void)
xf86DoConfigurePass1 = FALSE;
- dev2screen = xnfcalloc(1, xf86NumDrivers * sizeof(int));
+ dev2screen = xnfcalloc(xf86NumDrivers, sizeof(int));
{
- Bool *driverProbed = xnfcalloc(1, xf86NumDrivers * sizeof(Bool));
+ Bool *driverProbed = xnfcalloc(xf86NumDrivers, sizeof(Bool));
for (screennum = 0; screennum < nDevToConfig; screennum++) {
int k, l, n, oldNumScreens;
diff --git a/xserver/hw/xfree86/common/xf86DGA.c b/xserver/hw/xfree86/common/xf86DGA.c
index b9e1e3f88..c689dcb73 100644
--- a/xserver/hw/xfree86/common/xf86DGA.c
+++ b/xserver/hw/xfree86/common/xf86DGA.c
@@ -471,7 +471,7 @@ xf86SetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet)
/*********** exported ones ***************/
-void
+static void
DGASetInputMode(int index, Bool keyboard, Bool mouse)
{
ScreenPtr pScreen = screenInfo.screens[index];
@@ -488,7 +488,7 @@ DGASetInputMode(int index, Bool keyboard, Bool mouse)
}
}
-Bool
+static Bool
DGAChangePixmapMode(int index, int *x, int *y, int mode)
{
DGAScreenPtr pScreenPriv;
@@ -560,7 +560,7 @@ DGAScreenAvailable(ScreenPtr pScreen)
return FALSE;
}
-Bool
+static Bool
DGAAvailable(int index)
{
ScreenPtr pScreen;
@@ -606,7 +606,7 @@ DGAShutdown(void)
/* Called by the extension to initialize a mode */
-int
+static int
DGASetMode(int index, int num, XDGAModePtr mode, PixmapPtr *pPix)
{
ScrnInfoPtr pScrn = xf86Screens[index];
@@ -626,7 +626,7 @@ DGASetMode(int index, int num, XDGAModePtr mode, PixmapPtr *pPix)
/* Called from the extension to let the DDX know which events are requested */
-void
+static void
DGASelectInput(int index, ClientPtr client, long mask)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
@@ -636,7 +636,7 @@ DGASelectInput(int index, ClientPtr client, long mask)
pScreenPriv->input = mask;
}
-int
+static int
DGAGetViewportStatus(int index)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
@@ -649,7 +649,7 @@ DGAGetViewportStatus(int index)
return (*pScreenPriv->funcs->GetViewport) (pScreenPriv->pScrn);
}
-int
+static int
DGASetViewport(int index, int x, int y, int mode)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
@@ -675,7 +675,7 @@ BitsClear(CARD32 data)
return bits;
}
-int
+static int
DGACreateColormap(int index, ClientPtr client, int id, int mode, int alloc)
{
ScreenPtr pScreen = screenInfo.screens[index];
@@ -744,7 +744,7 @@ DGACreateColormap(int index, ClientPtr client, int id, int mode, int alloc)
/* Called by the extension to install a colormap on DGA active screens */
-void
+static void
DGAInstallCmap(ColormapPtr cmap)
{
ScreenPtr pScreen = cmap->pScreen;
@@ -760,7 +760,7 @@ DGAInstallCmap(ColormapPtr cmap)
(*pScreen->InstallColormap) (cmap);
}
-int
+static int
DGASync(int index)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
@@ -773,7 +773,7 @@ DGASync(int index)
return Success;
}
-int
+static int
DGAFillRect(int index, int x, int y, int w, int h, unsigned long color)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
@@ -789,7 +789,7 @@ DGAFillRect(int index, int x, int y, int w, int h, unsigned long color)
return BadMatch;
}
-int
+static int
DGABlitRect(int index, int srcx, int srcy, int w, int h, int dstx, int dsty)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
@@ -806,7 +806,7 @@ DGABlitRect(int index, int srcx, int srcy, int w, int h, int dstx, int dsty)
return BadMatch;
}
-int
+static int
DGABlitTransRect(int index,
int srcx, int srcy,
int w, int h, int dstx, int dsty, unsigned long color)
@@ -826,7 +826,7 @@ DGABlitTransRect(int index,
return BadMatch;
}
-int
+static int
DGAGetModes(int index)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
@@ -836,7 +836,7 @@ DGAGetModes(int index)
return pScreenPriv->numModes;
}
-int
+static int
DGAGetModeInfo(int index, XDGAModePtr mode, int num)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
@@ -1126,7 +1126,7 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
}
}
-Bool
+static Bool
DGAOpenFramebuffer(int index,
char **name,
unsigned char **mem, int *size, int *offset, int *flags)
@@ -1140,7 +1140,7 @@ DGAOpenFramebuffer(int index,
flags);
}
-void
+static void
DGACloseFramebuffer(int index)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
@@ -1152,7 +1152,7 @@ DGACloseFramebuffer(int index)
/* For DGA 1.0 backwards compatibility only */
-int
+static int
DGAGetOldDGAMode(int index)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
@@ -1349,7 +1349,7 @@ ProcXDGAQueryModes(ClientPtr client)
return Success;
}
- if (!(mode = (XDGAModePtr) malloc(num * sizeof(XDGAModeRec))))
+ if (!(mode = xallocarray(num, sizeof(XDGAModeRec))))
return BadAlloc;
for (i = 0; i < num; i++)
diff --git a/xserver/hw/xfree86/common/xf86Events.c b/xserver/hw/xfree86/common/xf86Events.c
index 2b84d8669..6570f0be9 100644
--- a/xserver/hw/xfree86/common/xf86Events.c
+++ b/xserver/hw/xfree86/common/xf86Events.c
@@ -180,7 +180,7 @@ ProcessInputEvents(void)
void
xf86ProcessActionEvent(ActionEvent action, void *arg)
{
- DebugF("ProcessActionEvent(%d,%x)\n", (int) action, arg);
+ DebugF("ProcessActionEvent(%d,%p)\n", (int) action, arg);
switch (action) {
case ACTION_TERMINATE:
if (!xf86Info.dontZap) {
@@ -403,7 +403,7 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
i < keyc->xkbInfo->desc->max_key_code; i++) {
if (key_is_down(pDev, i, KEY_POSTED)) {
OsBlockSIGIO();
- QueueKeyboardEvents(pDev, KeyRelease, i, NULL);
+ QueueKeyboardEvents(pDev, KeyRelease, i);
OsReleaseSIGIO();
}
}
diff --git a/xserver/hw/xfree86/common/xf86Extensions.c b/xserver/hw/xfree86/common/xf86Extensions.c
index 25b2bc3d0..1b8b78505 100644
--- a/xserver/hw/xfree86/common/xf86Extensions.c
+++ b/xserver/hw/xfree86/common/xf86Extensions.c
@@ -28,6 +28,7 @@
#endif
#include "extension.h"
+#include "extinit.h"
#include "globals.h"
#include "xf86.h"
@@ -47,7 +48,7 @@
#ifdef XF86VIDMODE
#include <X11/extensions/xf86vmproto.h>
-#include "vidmodeproc.h"
+#include "vidmodestr.h"
#endif
/*
diff --git a/xserver/hw/xfree86/common/xf86Helper.c b/xserver/hw/xfree86/common/xf86Helper.c
index e2b32a074..3b01a49b5 100644
--- a/xserver/hw/xfree86/common/xf86Helper.c
+++ b/xserver/hw/xfree86/common/xf86Helper.c
@@ -77,8 +77,8 @@ xf86AddDriver(DriverPtr driver, void *module, int flags)
xf86NumDrivers = 0;
xf86NumDrivers++;
- xf86DriverList = xnfrealloc(xf86DriverList,
- xf86NumDrivers * sizeof(DriverPtr));
+ xf86DriverList = xnfreallocarray(xf86DriverList,
+ xf86NumDrivers, sizeof(DriverPtr));
xf86DriverList[xf86NumDrivers - 1] = xnfalloc(sizeof(DriverRec));
if (flags & HaveDriverFuncs)
*xf86DriverList[xf86NumDrivers - 1] = *driver;
@@ -117,9 +117,9 @@ xf86AddInputDriver(InputDriverPtr driver, void *module, int flags)
xf86NumInputDrivers = 0;
xf86NumInputDrivers++;
- xf86InputDriverList = xnfrealloc(xf86InputDriverList,
- xf86NumInputDrivers *
- sizeof(InputDriverPtr));
+ xf86InputDriverList = xnfreallocarray(xf86InputDriverList,
+ xf86NumInputDrivers,
+ sizeof(InputDriverPtr));
xf86InputDriverList[xf86NumInputDrivers - 1] =
xnfalloc(sizeof(InputDriverRec));
*xf86InputDriverList[xf86NumInputDrivers - 1] = *driver;
@@ -173,7 +173,8 @@ xf86AllocateScreen(DriverPtr drv, int flags)
if (xf86GPUScreens == NULL)
xf86NumGPUScreens = 0;
i = xf86NumGPUScreens++;
- xf86GPUScreens = xnfrealloc(xf86GPUScreens, xf86NumGPUScreens * sizeof(ScrnInfoPtr));
+ xf86GPUScreens = xnfreallocarray(xf86GPUScreens, xf86NumGPUScreens,
+ sizeof(ScrnInfoPtr));
xf86GPUScreens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1);
pScrn = xf86GPUScreens[i];
pScrn->scrnIndex = i + GPU_SCREEN_OFFSET; /* Changes when a screen is removed */
@@ -183,7 +184,8 @@ xf86AllocateScreen(DriverPtr drv, int flags)
xf86NumScreens = 0;
i = xf86NumScreens++;
- xf86Screens = xnfrealloc(xf86Screens, xf86NumScreens * sizeof(ScrnInfoPtr));
+ xf86Screens = xnfreallocarray(xf86Screens, xf86NumScreens,
+ sizeof(ScrnInfoPtr));
xf86Screens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1);
pScrn = xf86Screens[i];
@@ -293,16 +295,16 @@ xf86AllocateScrnInfoPrivateIndex(void)
idx = xf86ScrnInfoPrivateCount++;
for (i = 0; i < xf86NumScreens; i++) {
pScr = xf86Screens[i];
- nprivs = xnfrealloc(pScr->privates,
- xf86ScrnInfoPrivateCount * sizeof(DevUnion));
+ nprivs = xnfreallocarray(pScr->privates,
+ xf86ScrnInfoPrivateCount, sizeof(DevUnion));
/* Zero the new private */
memset(&nprivs[idx], 0, sizeof(DevUnion));
pScr->privates = nprivs;
}
for (i = 0; i < xf86NumGPUScreens; i++) {
pScr = xf86GPUScreens[i];
- nprivs = xnfrealloc(pScr->privates,
- xf86ScrnInfoPrivateCount * sizeof(DevUnion));
+ nprivs = xnfreallocarray(pScr->privates,
+ xf86ScrnInfoPrivateCount, sizeof(DevUnion));
/* Zero the new private */
memset(&nprivs[idx], 0, sizeof(DevUnion));
pScr->privates = nprivs;
@@ -636,8 +638,8 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
if (i == scrp->confScreen->numdisplays) {
scrp->confScreen->numdisplays++;
scrp->confScreen->displays =
- xnfrealloc(scrp->confScreen->displays,
- scrp->confScreen->numdisplays * sizeof(DispRec));
+ xnfreallocarray(scrp->confScreen->displays,
+ scrp->confScreen->numdisplays, sizeof(DispRec));
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Creating default Display subsection in Screen section\n"
"\t\"%s\" for depth/fbbpp %d/%d\n",
@@ -1074,14 +1076,14 @@ xf86EnableDisableFBAccess(ScrnInfoPtr pScrnInfo, Bool enable)
* Restore all of the clip lists on the screen
*/
if (!xf86Resetting)
- SetRootClip(pScreen, TRUE);
+ SetRootClip(pScreen, ROOT_CLIP_FULL);
}
else {
/*
* Empty all of the clip lists on the screen
*/
- SetRootClip(pScreen, FALSE);
+ SetRootClip(pScreen, ROOT_CLIP_NONE);
}
}
@@ -1367,7 +1369,7 @@ xf86MatchDevice(const char *drivername, GDevPtr ** sectlist)
{
GDevPtr gdp, *pgdp = NULL;
confScreenPtr screensecptr;
- int i, j;
+ int i, j, k;
if (sectlist)
*sectlist = NULL;
@@ -1408,9 +1410,20 @@ xf86MatchDevice(const char *drivername, GDevPtr ** sectlist)
/*
* we have a matching driver that wasn't claimed, yet
*/
- pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr));
+ pgdp = xnfreallocarray(pgdp, i + 2, sizeof(GDevPtr));
pgdp[i++] = screensecptr->device;
}
+ for (k = 0; k < screensecptr->num_gpu_devices; k++) {
+ if ((screensecptr->gpu_devices[k]->driver != NULL)
+ && (xf86NameCmp(screensecptr->gpu_devices[k]->driver, drivername) == 0)
+ && (!screensecptr->gpu_devices[k]->claimed)) {
+ /*
+ * we have a matching driver that wasn't claimed, yet
+ */
+ pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr));
+ pgdp[i++] = screensecptr->gpu_devices[k];
+ }
+ }
}
/* Then handle the inactive devices */
@@ -1420,7 +1433,7 @@ xf86MatchDevice(const char *drivername, GDevPtr ** sectlist)
if (gdp->driver && !gdp->claimed &&
!xf86NameCmp(gdp->driver, drivername)) {
/* we have a matching driver that wasn't claimed yet */
- pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr));
+ pgdp = xnfreallocarray(pgdp, i + 2, sizeof(GDevPtr));
pgdp[i++] = gdp;
}
j++;
@@ -1818,7 +1831,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
Bool existing = FALSE;
DebugF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n",
- ScrnIndex, property, type, format, len, value);
+ ScrnIndex, (long)property, (long)type, format, len, value);
if (ScrnIndex < 0 || ScrnIndex >= xf86NumScreens) {
return BadMatch;
diff --git a/xserver/hw/xfree86/common/xf86Init.c b/xserver/hw/xfree86/common/xf86Init.c
index 1c37b9e85..8785ef307 100644
--- a/xserver/hw/xfree86/common/xf86Init.c
+++ b/xserver/hw/xfree86/common/xf86Init.c
@@ -72,6 +72,7 @@
#include "mipointer.h"
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
+#include "xf86Extensions.h"
#include "xf86DDC.h"
#include "xf86Xinput.h"
#include "xf86InPriv.h"
diff --git a/xserver/hw/xfree86/common/xf86Mode.c b/xserver/hw/xfree86/common/xf86Mode.c
index 9a5550faf..3f446ae3b 100644
--- a/xserver/hw/xfree86/common/xf86Mode.c
+++ b/xserver/hw/xfree86/common/xf86Mode.c
@@ -112,11 +112,10 @@ printModeRejectMessage(int index, DisplayModePtr p, int status)
}
/*
- * xf86GetNearestClock --
- * Find closest clock to given frequency (in kHz). This assumes the
- * number of clocks is greater than zero.
+ * Find closest clock to given frequency (in kHz). This assumes the
+ * number of clocks is greater than zero.
*/
-int
+static int
xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
int DivFactor, int MulFactor, int *divider)
{
@@ -451,7 +450,7 @@ xf86HandleBuiltinMode(ScrnInfoPtr scrp,
* reason.
*/
-ModeStatus
+static ModeStatus
xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
ClockRangePtr clockRanges, LookupModeFlags strategy)
{
@@ -845,7 +844,7 @@ xf86CheckModeSize(ScrnInfoPtr scrp, int w, int x, int y)
* maxVValue maximum vertical timing value
*/
-ModeStatus
+static ModeStatus
xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
ClockRangePtr clockRanges,
LookupModeFlags strategy,
diff --git a/xserver/hw/xfree86/common/xf86Module.h b/xserver/hw/xfree86/common/xf86Module.h
index e68fe9cba..9e5dc6dad 100644
--- a/xserver/hw/xfree86/common/xf86Module.h
+++ b/xserver/hw/xfree86/common/xf86Module.h
@@ -80,8 +80,8 @@ typedef enum {
* mask is 0xFFFF0000.
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
-#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(19, 0)
-#define ABI_XINPUT_VERSION SET_ABI_VERSION(21, 0)
+#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)
diff --git a/xserver/hw/xfree86/common/xf86Privstr.h b/xserver/hw/xfree86/common/xf86Privstr.h
index cffa14d01..58d5a0f13 100644
--- a/xserver/hw/xfree86/common/xf86Privstr.h
+++ b/xserver/hw/xfree86/common/xf86Privstr.h
@@ -115,16 +115,6 @@ typedef struct {
} DPMSRec, *DPMSPtr;
#endif
-#ifdef XF86VIDMODE
-/* Private info for Video Mode Extentsion */
-typedef struct {
- DisplayModePtr First;
- DisplayModePtr Next;
- int Flags;
- CloseScreenProcPtr CloseScreen;
-} VidModeRec, *VidModePtr;
-#endif
-
/* Information for root window properties. */
typedef struct _RootWinProp {
struct _RootWinProp *next;
diff --git a/xserver/hw/xfree86/common/xf86VidMode.c b/xserver/hw/xfree86/common/xf86VidMode.c
index e708b2792..7e12ea2cc 100644
--- a/xserver/hw/xfree86/common/xf86VidMode.c
+++ b/xserver/hw/xfree86/common/xf86VidMode.c
@@ -42,113 +42,62 @@
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
+#include "extinit.h"
#ifdef XF86VIDMODE
-#include "vidmodeproc.h"
+#include "vidmodestr.h"
+#include "xf86Privstr.h"
+#include "xf86Extensions.h"
#include "xf86cmap.h"
-static DevPrivateKeyRec VidModeKeyRec;
-static DevPrivateKey VidModeKey;
-static int VidModeCount = 0;
-static Bool VidModeClose(ScreenPtr pScreen);
-
-#define VMPTR(p) ((VidModePtr)dixLookupPrivate(&(p)->devPrivates, VidModeKey))
-
-#endif
-
-Bool
-VidModeExtensionInit(ScreenPtr pScreen)
-{
-#ifdef XF86VIDMODE
- VidModePtr pVidMode;
-
- if (!xf86GetVidModeEnabled()) {
- DebugF("!xf86GetVidModeEnabled()\n");
- return FALSE;
- }
-
- VidModeKey = &VidModeKeyRec;
-
- if (!dixRegisterPrivateKey(&VidModeKeyRec, PRIVATE_SCREEN, 0))
- return FALSE;
-
- pVidMode = calloc(sizeof(VidModeRec), 1);
- if (!pVidMode)
- return FALSE;
-
- dixSetPrivate(&pScreen->devPrivates, VidModeKey, pVidMode);
-
- pVidMode->Flags = 0;
- pVidMode->Next = NULL;
- pVidMode->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = VidModeClose;
- VidModeCount++;
- return TRUE;
-#else
- DebugF("no vidmode extension\n");
- return FALSE;
-#endif
-}
-
-#ifdef XF86VIDMODE
-
-static Bool
-VidModeClose(ScreenPtr pScreen)
-{
- VidModePtr pVidMode = VMPTR(pScreen);
-
- /* This shouldn't happen */
- if (!pVidMode)
- return FALSE;
-
- pScreen->CloseScreen = pVidMode->CloseScreen;
-
- if (--VidModeCount == 0) {
- free(dixLookupPrivate(&pScreen->devPrivates, VidModeKey));
- dixSetPrivate(&pScreen->devPrivates, VidModeKey, NULL);
- VidModeKey = NULL;
- }
- return pScreen->CloseScreen(pScreen);
-}
-
-Bool
-VidModeAvailable(int scrnIndex)
+static vidMonitorValue
+xf86VidModeGetMonitorValue(ScreenPtr pScreen, int valtyp, int indx)
{
+ vidMonitorValue ret = { NULL, };
+ MonPtr monitor;
ScrnInfoPtr pScrn;
- VidModePtr pVidMode;
- if (VidModeKey == NULL) {
- DebugF("VidModeKey == NULL\n");
- return FALSE;
- }
+ pScrn = xf86ScreenToScrn(pScreen);
+ monitor = pScrn->monitor;
- pScrn = xf86Screens[scrnIndex];
- if (pScrn == NULL) {
- DebugF("pScrn == NULL\n");
- return FALSE;
- }
-
- pVidMode = VMPTR(pScrn->pScreen);
- if (pVidMode)
- return TRUE;
- else {
- DebugF("pVidMode == NULL\n");
- return FALSE;
+ switch (valtyp) {
+ case VIDMODE_MON_VENDOR:
+ ret.ptr = monitor->vendor;
+ break;
+ case VIDMODE_MON_MODEL:
+ ret.ptr = monitor->model;
+ break;
+ case VIDMODE_MON_NHSYNC:
+ ret.i = monitor->nHsync;
+ break;
+ case VIDMODE_MON_NVREFRESH:
+ ret.i = monitor->nVrefresh;
+ break;
+ case VIDMODE_MON_HSYNC_LO:
+ ret.f = (100.0 * monitor->hsync[indx].lo);
+ break;
+ case VIDMODE_MON_HSYNC_HI:
+ ret.f = (100.0 * monitor->hsync[indx].hi);
+ break;
+ case VIDMODE_MON_VREFRESH_LO:
+ ret.f = (100.0 * monitor->vrefresh[indx].lo);
+ break;
+ case VIDMODE_MON_VREFRESH_HI:
+ ret.f = (100.0 * monitor->vrefresh[indx].hi);
+ break;
}
+ return ret;
}
-Bool
-VidModeGetCurrentModeline(int scrnIndex, void **mode, int *dotClock)
+static Bool
+xf86VidModeGetCurrentModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock)
{
ScrnInfoPtr pScrn;
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
if (pScrn->currentMode) {
- *mode = (void *) (pScrn->currentMode);
+ *mode = pScrn->currentMode;
*dotClock = pScrn->currentMode->Clock;
return TRUE;
@@ -156,30 +105,24 @@ VidModeGetCurrentModeline(int scrnIndex, void **mode, int *dotClock)
return FALSE;
}
-int
-VidModeGetDotClock(int scrnIndex, int Clock)
+static int
+xf86VidModeGetDotClock(ScreenPtr pScreen, int Clock)
{
ScrnInfoPtr pScrn;
- if (!VidModeAvailable(scrnIndex))
- return 0;
-
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
if ((pScrn->progClock) || (Clock >= MAXCLOCKS))
return Clock;
else
return pScrn->clock[Clock];
}
-int
-VidModeGetNumOfClocks(int scrnIndex, Bool *progClock)
+static int
+xf86VidModeGetNumOfClocks(ScreenPtr pScreen, Bool *progClock)
{
ScrnInfoPtr pScrn;
- if (!VidModeAvailable(scrnIndex))
- return 0;
-
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
if (pScrn->progClock) {
*progClock = TRUE;
return 0;
@@ -190,16 +133,13 @@ VidModeGetNumOfClocks(int scrnIndex, Bool *progClock)
}
}
-Bool
-VidModeGetClocks(int scrnIndex, int *Clocks)
+static Bool
+xf86VidModeGetClocks(ScreenPtr pScreen, int *Clocks)
{
ScrnInfoPtr pScrn;
int i;
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
if (pScrn->progClock)
return FALSE;
@@ -210,92 +150,75 @@ VidModeGetClocks(int scrnIndex, int *Clocks)
return TRUE;
}
-Bool
-VidModeGetFirstModeline(int scrnIndex, void **mode, int *dotClock)
+static Bool
+xf86VidModeGetNextModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock)
{
- ScrnInfoPtr pScrn;
VidModePtr pVidMode;
+ DisplayModePtr p;
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- if (pScrn->modes == NULL)
- return FALSE;
-
- pVidMode = VMPTR(pScrn->pScreen);
- pVidMode->First = pScrn->modes;
- pVidMode->Next = pVidMode->First->next;
+ pVidMode = VidModeGetPtr(pScreen);
- if (pVidMode->First->status == MODE_OK) {
- *mode = (void *) (pVidMode->First);
- *dotClock = VidModeGetDotClock(scrnIndex, pVidMode->First->Clock);
- return TRUE;
+ for (p = pVidMode->Next; p != NULL && p != pVidMode->First; p = p->next) {
+ if (p->status == MODE_OK) {
+ pVidMode->Next = p->next;
+ *mode = p;
+ *dotClock = xf86VidModeGetDotClock(pScreen, p->Clock);
+ return TRUE;
+ }
}
- return VidModeGetNextModeline(scrnIndex, mode, dotClock);
+ return FALSE;
}
-Bool
-VidModeGetNextModeline(int scrnIndex, void **mode, int *dotClock)
+static Bool
+xf86VidModeGetFirstModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock)
{
ScrnInfoPtr pScrn;
VidModePtr pVidMode;
- DisplayModePtr p;
- if (!VidModeAvailable(scrnIndex))
+ pScrn = xf86ScreenToScrn(pScreen);
+ if (pScrn->modes == NULL)
return FALSE;
- pScrn = xf86Screens[scrnIndex];
- pVidMode = VMPTR(pScrn->pScreen);
+ pVidMode = VidModeGetPtr(pScreen);
+ pVidMode->First = pScrn->modes;
+ pVidMode->Next = pVidMode->First->next;
- for (p = pVidMode->Next; p != NULL && p != pVidMode->First; p = p->next) {
- if (p->status == MODE_OK) {
- pVidMode->Next = p->next;
- *mode = (void *) p;
- *dotClock = VidModeGetDotClock(scrnIndex, p->Clock);
- return TRUE;
- }
+ if (pVidMode->First->status == MODE_OK) {
+ *mode = pVidMode->First;
+ *dotClock = xf86VidModeGetDotClock(pScreen, pVidMode->First->Clock);
+ return TRUE;
}
- return FALSE;
+ return xf86VidModeGetNextModeline(pScreen, mode, dotClock);
}
-Bool
-VidModeDeleteModeline(int scrnIndex, void *mode)
+static Bool
+xf86VidModeDeleteModeline(ScreenPtr pScreen, DisplayModePtr mode)
{
ScrnInfoPtr pScrn;
- if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
+ if (mode == NULL)
return FALSE;
- pScrn = xf86Screens[scrnIndex];
- xf86DeleteMode(&(pScrn->modes), (DisplayModePtr) mode);
+ pScrn = xf86ScreenToScrn(pScreen);
+ xf86DeleteMode(&(pScrn->modes), mode);
return TRUE;
}
-Bool
-VidModeZoomViewport(int scrnIndex, int zoom)
+static Bool
+xf86VidModeZoomViewport(ScreenPtr pScreen, int zoom)
{
- ScrnInfoPtr pScrn;
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- xf86ZoomViewport(pScrn->pScreen, zoom);
+ xf86ZoomViewport(pScreen, zoom);
return TRUE;
}
-Bool
-VidModeSetViewPort(int scrnIndex, int x, int y)
+static Bool
+xf86VidModeSetViewPort(ScreenPtr pScreen, int x, int y)
{
ScrnInfoPtr pScrn;
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
pScrn->frameX0 = min(max(x, 0),
pScrn->virtualX - pScrn->currentMode->HDisplay);
pScrn->frameX1 = pScrn->frameX0 + pScrn->currentMode->HDisplay - 1;
@@ -308,31 +231,25 @@ VidModeSetViewPort(int scrnIndex, int x, int y)
return TRUE;
}
-Bool
-VidModeGetViewPort(int scrnIndex, int *x, int *y)
+static Bool
+xf86VidModeGetViewPort(ScreenPtr pScreen, int *x, int *y)
{
ScrnInfoPtr pScrn;
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
*x = pScrn->frameX0;
*y = pScrn->frameY0;
return TRUE;
}
-Bool
-VidModeSwitchMode(int scrnIndex, void *mode)
+static Bool
+xf86VidModeSwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
{
ScrnInfoPtr pScrn;
DisplayModePtr pTmpMode;
Bool retval;
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
/* save in case we fail */
pTmpMode = pScrn->currentMode;
/* Force a mode switch */
@@ -344,326 +261,203 @@ VidModeSwitchMode(int scrnIndex, void *mode)
return retval;
}
-Bool
-VidModeLockZoom(int scrnIndex, Bool lock)
+static Bool
+xf86VidModeLockZoom(ScreenPtr pScreen, Bool lock)
{
- ScrnInfoPtr pScrn;
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
-
if (xf86Info.dontZoom)
return FALSE;
- xf86LockZoom(pScrn->pScreen, lock);
+ xf86LockZoom(pScreen, lock);
return TRUE;
}
-Bool
-VidModeGetMonitor(int scrnIndex, void **monitor)
+static ModeStatus
+xf86VidModeCheckModeForMonitor(ScreenPtr pScreen, DisplayModePtr mode)
{
ScrnInfoPtr pScrn;
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- *monitor = (void *) (pScrn->monitor);
-
- return TRUE;
-}
-
-ModeStatus
-VidModeCheckModeForMonitor(int scrnIndex, void *mode)
-{
- ScrnInfoPtr pScrn;
-
- if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
+ if (mode == NULL)
return MODE_ERROR;
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
- return xf86CheckModeForMonitor((DisplayModePtr) mode, pScrn->monitor);
+ return xf86CheckModeForMonitor(mode, pScrn->monitor);
}
-ModeStatus
-VidModeCheckModeForDriver(int scrnIndex, void *mode)
+static ModeStatus
+xf86VidModeCheckModeForDriver(ScreenPtr pScreen, DisplayModePtr mode)
{
ScrnInfoPtr pScrn;
- if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
+ if (mode == NULL)
return MODE_ERROR;
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
- return xf86CheckModeForDriver(pScrn, (DisplayModePtr) mode, 0);
+ return xf86CheckModeForDriver(pScrn, mode, 0);
}
-void
-VidModeSetCrtcForMode(int scrnIndex, void *mode)
+static void
+xf86VidModeSetCrtcForMode(ScreenPtr pScreen, DisplayModePtr mode)
{
ScrnInfoPtr pScrn;
DisplayModePtr ScreenModes;
- if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
+ if (mode == NULL)
return;
/* Ugly hack so that the xf86Mode.c function can be used without change */
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
ScreenModes = pScrn->modes;
- pScrn->modes = (DisplayModePtr) mode;
+ pScrn->modes = mode;
xf86SetCrtcForModes(pScrn, pScrn->adjustFlags);
pScrn->modes = ScreenModes;
return;
}
-Bool
-VidModeAddModeline(int scrnIndex, void *mode)
+static Bool
+xf86VidModeAddModeline(ScreenPtr pScreen, DisplayModePtr mode)
{
ScrnInfoPtr pScrn;
- if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
+ if (mode == NULL)
return FALSE;
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
- ((DisplayModePtr) mode)->name = strdup(""); /* freed by deletemode */
- ((DisplayModePtr) mode)->status = MODE_OK;
- ((DisplayModePtr) mode)->next = pScrn->modes->next;
- ((DisplayModePtr) mode)->prev = pScrn->modes;
- pScrn->modes->next = (DisplayModePtr) mode;
- if (((DisplayModePtr) mode)->next != NULL)
- ((DisplayModePtr) mode)->next->prev = (DisplayModePtr) mode;
+ mode->name = strdup(""); /* freed by deletemode */
+ mode->status = MODE_OK;
+ mode->next = pScrn->modes->next;
+ mode->prev = pScrn->modes;
+ pScrn->modes->next = mode;
+ if (mode->next != NULL)
+ mode->next->prev = mode;
return TRUE;
}
-int
-VidModeGetNumOfModes(int scrnIndex)
+static int
+xf86VidModeGetNumOfModes(ScreenPtr pScreen)
{
- void *mode = NULL;
+ DisplayModePtr mode = NULL;
int dotClock = 0, nummodes = 0;
- if (!VidModeGetFirstModeline(scrnIndex, &mode, &dotClock))
+ if (!xf86VidModeGetFirstModeline(pScreen, &mode, &dotClock))
return nummodes;
do {
nummodes++;
- if (!VidModeGetNextModeline(scrnIndex, &mode, &dotClock))
+ if (!xf86VidModeGetNextModeline(pScreen, &mode, &dotClock))
return nummodes;
} while (TRUE);
}
-Bool
-VidModeSetGamma(int scrnIndex, float red, float green, float blue)
+static Bool
+xf86VidModeSetGamma(ScreenPtr pScreen, float red, float green, float blue)
{
- ScrnInfoPtr pScrn;
Gamma gamma;
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
gamma.red = red;
gamma.green = green;
gamma.blue = blue;
- if (xf86ChangeGamma(pScrn->pScreen, gamma) != Success)
+ if (xf86ChangeGamma(pScreen, gamma) != Success)
return FALSE;
else
return TRUE;
}
-Bool
-VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue)
+static Bool
+xf86VidModeGetGamma(ScreenPtr pScreen, float *red, float *green, float *blue)
{
ScrnInfoPtr pScrn;
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
+ pScrn = xf86ScreenToScrn(pScreen);
*red = pScrn->gamma.red;
*green = pScrn->gamma.green;
*blue = pScrn->gamma.blue;
return TRUE;
}
-Bool
-VidModeSetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b)
+static Bool
+xf86VidModeSetGammaRamp(ScreenPtr pScreen, int size, CARD16 *r, CARD16 *g, CARD16 *b)
{
- ScrnInfoPtr pScrn;
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- xf86ChangeGammaRamp(pScrn->pScreen, size, r, g, b);
+ xf86ChangeGammaRamp(pScreen, size, r, g, b);
return TRUE;
}
-Bool
-VidModeGetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b)
+static Bool
+xf86VidModeGetGammaRamp(ScreenPtr pScreen, int size, CARD16 *r, CARD16 *g, CARD16 *b)
{
- ScrnInfoPtr pScrn;
-
- if (!VidModeAvailable(scrnIndex))
- return FALSE;
-
- pScrn = xf86Screens[scrnIndex];
- xf86GetGammaRamp(pScrn->pScreen, size, r, g, b);
+ xf86GetGammaRamp(pScreen, size, r, g, b);
return TRUE;
}
-int
-VidModeGetGammaRampSize(int scrnIndex)
+static Bool
+xf86VidModeInit(ScreenPtr pScreen)
{
- if (!VidModeAvailable(scrnIndex))
- return 0;
-
- return xf86GetGammaRampSize(xf86Screens[scrnIndex]->pScreen);
-}
+ VidModePtr pVidMode;
-void *
-VidModeCreateMode(void)
-{
- DisplayModePtr mode;
-
- mode = malloc(sizeof(DisplayModeRec));
- if (mode != NULL) {
- mode->name = "";
- mode->VScan = 1; /* divides refresh rate. default = 1 */
- mode->Private = NULL;
- mode->next = mode;
- mode->prev = mode;
+ if (!xf86GetVidModeEnabled()) {
+ DebugF("!xf86GetVidModeEnabled()\n");
+ return FALSE;
}
- return mode;
-}
-void
-VidModeCopyMode(void *modefrom, void *modeto)
-{
- memcpy(modeto, modefrom, sizeof(DisplayModeRec));
-}
+ pVidMode = VidModeInit(pScreen);
+ if (!pVidMode)
+ return FALSE;
-int
-VidModeGetModeValue(void *mode, int valtyp)
-{
- int ret = 0;
+ pVidMode->Flags = 0;
+ pVidMode->Next = NULL;
- switch (valtyp) {
- case VIDMODE_H_DISPLAY:
- ret = ((DisplayModePtr) mode)->HDisplay;
- break;
- case VIDMODE_H_SYNCSTART:
- ret = ((DisplayModePtr) mode)->HSyncStart;
- break;
- case VIDMODE_H_SYNCEND:
- ret = ((DisplayModePtr) mode)->HSyncEnd;
- break;
- case VIDMODE_H_TOTAL:
- ret = ((DisplayModePtr) mode)->HTotal;
- break;
- case VIDMODE_H_SKEW:
- ret = ((DisplayModePtr) mode)->HSkew;
- break;
- case VIDMODE_V_DISPLAY:
- ret = ((DisplayModePtr) mode)->VDisplay;
- break;
- case VIDMODE_V_SYNCSTART:
- ret = ((DisplayModePtr) mode)->VSyncStart;
- break;
- case VIDMODE_V_SYNCEND:
- ret = ((DisplayModePtr) mode)->VSyncEnd;
- break;
- case VIDMODE_V_TOTAL:
- ret = ((DisplayModePtr) mode)->VTotal;
- break;
- case VIDMODE_FLAGS:
- ret = ((DisplayModePtr) mode)->Flags;
- break;
- case VIDMODE_CLOCK:
- ret = ((DisplayModePtr) mode)->Clock;
- break;
- }
- return ret;
+ pVidMode->GetMonitorValue = xf86VidModeGetMonitorValue;
+ pVidMode->GetCurrentModeline = xf86VidModeGetCurrentModeline;
+ pVidMode->GetFirstModeline = xf86VidModeGetFirstModeline;
+ pVidMode->GetNextModeline = xf86VidModeGetNextModeline;
+ pVidMode->DeleteModeline = xf86VidModeDeleteModeline;
+ pVidMode->ZoomViewport = xf86VidModeZoomViewport;
+ pVidMode->GetViewPort = xf86VidModeGetViewPort;
+ pVidMode->SetViewPort = xf86VidModeSetViewPort;
+ pVidMode->SwitchMode = xf86VidModeSwitchMode;
+ pVidMode->LockZoom = xf86VidModeLockZoom;
+ pVidMode->GetNumOfClocks = xf86VidModeGetNumOfClocks;
+ pVidMode->GetClocks = xf86VidModeGetClocks;
+ pVidMode->CheckModeForMonitor = xf86VidModeCheckModeForMonitor;
+ pVidMode->CheckModeForDriver = xf86VidModeCheckModeForDriver;
+ pVidMode->SetCrtcForMode = xf86VidModeSetCrtcForMode;
+ pVidMode->AddModeline = xf86VidModeAddModeline;
+ pVidMode->GetDotClock = xf86VidModeGetDotClock;
+ pVidMode->GetNumOfModes = xf86VidModeGetNumOfModes;
+ pVidMode->SetGamma = xf86VidModeSetGamma;
+ pVidMode->GetGamma = xf86VidModeGetGamma;
+ pVidMode->SetGammaRamp = xf86VidModeSetGammaRamp;
+ pVidMode->GetGammaRamp = xf86VidModeGetGammaRamp;
+ pVidMode->GetGammaRampSize = xf86GetGammaRampSize; /* use xf86cmap API directly */
+
+ return TRUE;
}
void
-VidModeSetModeValue(void *mode, int valtyp, int val)
+XFree86VidModeExtensionInit(void)
{
- switch (valtyp) {
- case VIDMODE_H_DISPLAY:
- ((DisplayModePtr) mode)->HDisplay = val;
- break;
- case VIDMODE_H_SYNCSTART:
- ((DisplayModePtr) mode)->HSyncStart = val;
- break;
- case VIDMODE_H_SYNCEND:
- ((DisplayModePtr) mode)->HSyncEnd = val;
- break;
- case VIDMODE_H_TOTAL:
- ((DisplayModePtr) mode)->HTotal = val;
- break;
- case VIDMODE_H_SKEW:
- ((DisplayModePtr) mode)->HSkew = val;
- break;
- case VIDMODE_V_DISPLAY:
- ((DisplayModePtr) mode)->VDisplay = val;
- break;
- case VIDMODE_V_SYNCSTART:
- ((DisplayModePtr) mode)->VSyncStart = val;
- break;
- case VIDMODE_V_SYNCEND:
- ((DisplayModePtr) mode)->VSyncEnd = val;
- break;
- case VIDMODE_V_TOTAL:
- ((DisplayModePtr) mode)->VTotal = val;
- break;
- case VIDMODE_FLAGS:
- ((DisplayModePtr) mode)->Flags = val;
- break;
- case VIDMODE_CLOCK:
- ((DisplayModePtr) mode)->Clock = val;
- break;
- }
- return;
-}
+ int i;
+ Bool enabled = FALSE;
-vidMonitorValue
-VidModeGetMonitorValue(void *monitor, int valtyp, int indx)
-{
- vidMonitorValue ret = { NULL, };
+ DebugF("XFree86VidModeExtensionInit");
- switch (valtyp) {
- case VIDMODE_MON_VENDOR:
- ret.ptr = (((MonPtr) monitor)->vendor);
- break;
- case VIDMODE_MON_MODEL:
- ret.ptr = (((MonPtr) monitor)->model);
- break;
- case VIDMODE_MON_NHSYNC:
- ret.i = ((MonPtr) monitor)->nHsync;
- break;
- case VIDMODE_MON_NVREFRESH:
- ret.i = ((MonPtr) monitor)->nVrefresh;
- break;
- case VIDMODE_MON_HSYNC_LO:
- ret.f = (100.0 * ((MonPtr) monitor)->hsync[indx].lo);
- break;
- case VIDMODE_MON_HSYNC_HI:
- ret.f = (100.0 * ((MonPtr) monitor)->hsync[indx].hi);
- break;
- case VIDMODE_MON_VREFRESH_LO:
- ret.f = (100.0 * ((MonPtr) monitor)->vrefresh[indx].lo);
- break;
- case VIDMODE_MON_VREFRESH_HI:
- ret.f = (100.0 * ((MonPtr) monitor)->vrefresh[indx].hi);
- break;
+ /* This means that the DDX doesn't want the vidmode extension enabled */
+ if (!xf86GetVidModeEnabled())
+ return;
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ if (xf86VidModeInit (screenInfo.screens[i]))
+ enabled = TRUE;
}
- return ret;
+ /* This means that the DDX doesn't want the vidmode extension enabled */
+ if (!enabled)
+ return;
+
+ VidModeAddExtension(xf86GetVidModeAllowNonLocal());
}
#endif /* XF86VIDMODE */
diff --git a/xserver/hw/xfree86/common/xf86Xinput.c b/xserver/hw/xfree86/common/xf86Xinput.c
index 1fb5b1635..c56a2b9a3 100644
--- a/xserver/hw/xfree86/common/xf86Xinput.c
+++ b/xserver/hw/xfree86/common/xf86Xinput.c
@@ -843,7 +843,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
DeviceIntPtr dev = NULL;
Bool paused;
int rval;
- const char *path;
+ char *path = NULL;
/* Memory leak for every attached device if we don't
* test if the module is already loaded first */
@@ -867,11 +867,13 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
if (fd != -1) {
if (paused) {
/* Put on new_input_devices list for delayed probe */
- new_input_devices = xnfrealloc(new_input_devices,
- sizeof(pInfo) * (new_input_devices_count + 1));
+ 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++;
systemd_logind_release_fd(pInfo->major, pInfo->minor, fd);
+ free(path);
return BadMatch;
}
pInfo->fd = fd;
@@ -880,6 +882,8 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
}
}
+ free(path);
+
xf86Msg(X_INFO, "Using input driver '%s' for '%s'\n", drv->driverName,
pInfo->name);
@@ -1137,12 +1141,16 @@ xf86CheckMotionEvent4DGA(DeviceIntPtr device, int is_absolute,
dx = valuator_mask_get(mask, 0);
if (is_absolute)
dx -= device->last.valuators[0];
+ else if (valuator_mask_has_unaccelerated(mask))
+ dx = valuator_mask_get_unaccelerated(mask, 0);
}
if (valuator_mask_isset(mask, 1)) {
dy = valuator_mask_get(mask, 1);
if (is_absolute)
dy -= device->last.valuators[1];
+ else if (valuator_mask_has_unaccelerated(mask))
+ dy = valuator_mask_get_unaccelerated(mask, 1);
}
if (DGAStealMotionEvent(device, idx, dx, dy))
@@ -1326,47 +1334,21 @@ xf86PostButtonEventM(DeviceIntPtr device,
}
void
-xf86PostKeyEvent(DeviceIntPtr device,
- unsigned int key_code,
- int is_down,
- int is_absolute, int first_valuator, int num_valuators, ...)
+xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down)
{
- va_list var;
- int i = 0;
- ValuatorMask mask;
-
- XI_VERIFY_VALUATORS(num_valuators);
-
- valuator_mask_zero(&mask);
-
- va_start(var, num_valuators);
- for (i = 0; i < num_valuators; i++)
- valuator_mask_set(&mask, first_valuator + i, va_arg(var, int));
-
- va_end(var);
-
- xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask);
+ xf86PostKeyEventM(device, key_code, is_down);
}
void
xf86PostKeyEventP(DeviceIntPtr device,
unsigned int key_code,
- int is_down,
- int is_absolute,
- int first_valuator, int num_valuators, const int *valuators)
+ int is_down)
{
- ValuatorMask mask;
-
- XI_VERIFY_VALUATORS(num_valuators);
-
- valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators);
- xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask);
+ xf86PostKeyEventM(device, key_code, is_down);
}
void
-xf86PostKeyEventM(DeviceIntPtr device,
- unsigned int key_code,
- int is_down, int is_absolute, const ValuatorMask *mask)
+xf86PostKeyEventM(DeviceIntPtr device, unsigned int key_code, int is_down)
{
#if XFreeXDGA
DeviceIntPtr pointer;
@@ -1382,8 +1364,7 @@ xf86PostKeyEventM(DeviceIntPtr device,
}
#endif
- QueueKeyboardEvents(device,
- is_down ? KeyPress : KeyRelease, key_code, mask);
+ QueueKeyboardEvents(device, is_down ? KeyPress : KeyRelease, key_code);
}
void
@@ -1392,7 +1373,7 @@ xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code, int is_down)
ValuatorMask mask;
valuator_mask_zero(&mask);
- xf86PostKeyEventM(device, key_code, is_down, 0, &mask);
+ xf86PostKeyEventM(device, key_code, is_down);
}
InputInfoPtr
diff --git a/xserver/hw/xfree86/common/xf86Xinput.h b/xserver/hw/xfree86/common/xf86Xinput.h
index 42d66d22e..0024053c7 100644
--- a/xserver/hw/xfree86/common/xf86Xinput.h
+++ b/xserver/hw/xfree86/common/xf86Xinput.h
@@ -148,18 +148,11 @@ extern _X_EXPORT void xf86PostButtonEventM(DeviceIntPtr device, int is_absolute,
int button, int is_down,
const ValuatorMask *mask);
extern _X_EXPORT void xf86PostKeyEvent(DeviceIntPtr device,
- unsigned int key_code, int is_down,
- int is_absolute, int first_valuator,
- int num_valuators, ...);
+ unsigned int key_code, int is_down);
extern _X_EXPORT void xf86PostKeyEventM(DeviceIntPtr device,
- unsigned int key_code, int is_down,
- int is_absolute,
- const ValuatorMask *mask);
+ unsigned int key_code, int is_down);
extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device,
- unsigned int key_code, int is_down,
- int is_absolute, int first_valuator,
- int num_valuators,
- const int *valuators);
+ unsigned int key_code, int is_down);
extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device,
unsigned int key_code, int is_down);
extern _X_EXPORT void xf86PostTouchEvent(DeviceIntPtr dev, uint32_t touchid,
diff --git a/xserver/hw/xfree86/common/xf86cmap.c b/xserver/hw/xfree86/common/xf86cmap.c
index ab51f9603..704e35358 100644
--- a/xserver/hw/xfree86/common/xf86cmap.c
+++ b/xserver/hw/xfree86/common/xf86cmap.c
@@ -166,10 +166,10 @@ xf86HandleColormaps(ScreenPtr pScreen,
elements = 1 << sigRGBbits;
- if (!(gamma = malloc(elements * sizeof(LOCO))))
+ if (!(gamma = xallocarray(elements, sizeof(LOCO))))
return FALSE;
- if (!(indices = malloc(maxColors * sizeof(int)))) {
+ if (!(indices = xallocarray(maxColors, sizeof(int)))) {
free(gamma);
return FALSE;
}
@@ -270,7 +270,7 @@ CMapAllocateColormapPrivate(ColormapPtr pmap)
else
numColors = 1 << pmap->pVisual->nplanes;
- if (!(colors = malloc(numColors * sizeof(LOCO))))
+ if (!(colors = xallocarray(numColors, sizeof(LOCO))))
return FALSE;
if (!(pColPriv = malloc(sizeof(CMapColormapRec)))) {
diff --git a/xserver/hw/xfree86/common/xf86fbman.c b/xserver/hw/xfree86/common/xf86fbman.c
index 1b2cb5704..91ddedc29 100644
--- a/xserver/hw/xfree86/common/xf86fbman.c
+++ b/xserver/hw/xfree86/common/xf86fbman.c
@@ -317,16 +317,17 @@ localRegisterFreeBoxCallback(ScreenPtr pScreen,
offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates,
xf86FBScreenKey);
- newCallbacks = realloc(offman->FreeBoxesUpdateCallback,
- sizeof(FreeBoxCallbackProcPtr) *
- (offman->NumCallbacks + 1));
+ newCallbacks = reallocarray(offman->FreeBoxesUpdateCallback,
+ offman->NumCallbacks + 1,
+ sizeof(FreeBoxCallbackProcPtr));
if (!newCallbacks)
return FALSE;
else
offman->FreeBoxesUpdateCallback = newCallbacks;
- newPrivates = realloc(offman->devPrivates,
- sizeof(DevUnion) * (offman->NumCallbacks + 1));
+ newPrivates = reallocarray(offman->devPrivates,
+ offman->NumCallbacks + 1,
+ sizeof(DevUnion));
if (!newPrivates)
return FALSE;
else
diff --git a/xserver/hw/xfree86/common/xf86pciBus.c b/xserver/hw/xfree86/common/xf86pciBus.c
index 9cbf7fb21..c0fda4a7a 100644
--- a/xserver/hw/xfree86/common/xf86pciBus.c
+++ b/xserver/hw/xfree86/common/xf86pciBus.c
@@ -103,9 +103,9 @@ xf86PciProbe(void)
while ((info = pci_device_next(iter)) != NULL) {
if (PCIINFOCLASSES(info->device_class)) {
num++;
- xf86PciVideoInfo = xnfrealloc(xf86PciVideoInfo,
- (sizeof(struct pci_device *)
- * (num + 1)));
+ xf86PciVideoInfo = xnfreallocarray(xf86PciVideoInfo,
+ num + 1,
+ sizeof(struct pci_device *));
xf86PciVideoInfo[num] = NULL;
xf86PciVideoInfo[num - 1] = info;
@@ -679,7 +679,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
}
pci_iterator_destroy(iter);
- instances = xnfalloc(max_entries * sizeof(struct Inst));
+ instances = xnfallocarray(max_entries, sizeof(struct Inst));
}
iter = pci_slot_match_iterator_create(NULL);
@@ -976,7 +976,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
/* Allocate an entry in the lists to be returned */
numFound++;
- retEntities = xnfrealloc(retEntities, numFound * sizeof(int));
+ retEntities = xnfreallocarray(retEntities, numFound, sizeof(int));
retEntities[numFound - 1] = xf86ClaimPciSlot(pPci, drvp,
instances[i].chip,
instances[i].dev,
diff --git a/xserver/hw/xfree86/common/xf86platformBus.c b/xserver/hw/xfree86/common/xf86platformBus.c
index c1aaba41a..96895a6e1 100644
--- a/xserver/hw/xfree86/common/xf86platformBus.c
+++ b/xserver/hw/xfree86/common/xf86platformBus.c
@@ -59,9 +59,9 @@ struct xf86_platform_device *xf86_platform_devices;
int
xf86_add_platform_device(struct OdevAttributes *attribs, Bool unowned)
{
- xf86_platform_devices = xnfrealloc(xf86_platform_devices,
- (sizeof(struct xf86_platform_device)
- * (xf86_num_platform_devices + 1)));
+ xf86_platform_devices = xnfreallocarray(xf86_platform_devices,
+ xf86_num_platform_devices + 1,
+ sizeof(struct xf86_platform_device));
xf86_platform_devices[xf86_num_platform_devices].attribs = attribs;
xf86_platform_devices[xf86_num_platform_devices].pdev = NULL;
@@ -477,6 +477,9 @@ xf86platformAddDevice(int index)
screenLayoutPtr layout;
static const char *hotplug_driver_name = "modesetting";
+ if (!xf86Info.autoAddGPU)
+ return -1;
+
/* force load the driver for now */
xf86LoadOneModule(hotplug_driver_name, NULL);
diff --git a/xserver/hw/xfree86/common/xf86sbusBus.c b/xserver/hw/xfree86/common/xf86sbusBus.c
index 07eb71ed8..119211dc5 100644
--- a/xserver/hw/xfree86/common/xf86sbusBus.c
+++ b/xserver/hw/xfree86/common/xf86sbusBus.c
@@ -68,7 +68,7 @@ CheckSbusDevice(const char *device, int fbNum)
if (!sbusDeviceTable[i].devId)
return;
xf86SbusInfo =
- xnfrealloc(xf86SbusInfo, sizeof(psdp) * (++xf86nSbusInfo + 1));
+ xnfreallocarray(xf86SbusInfo, ++xf86nSbusInfo + 1, sizeof(psdp));
xf86SbusInfo[xf86nSbusInfo] = NULL;
xf86SbusInfo[xf86nSbusInfo - 1] = psdp = xnfcalloc(sizeof(sbusDevice), 1);
psdp->devId = sbusDeviceTable[i].devId;
@@ -406,8 +406,8 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
if (psdp->fd == -2)
continue;
++allocatedInstances;
- instances = xnfrealloc(instances,
- allocatedInstances * sizeof(struct Inst));
+ instances = xnfreallocarray(instances,
+ allocatedInstances, sizeof(struct Inst));
instances[allocatedInstances - 1].sbus = psdp;
instances[allocatedInstances - 1].dev = NULL;
instances[allocatedInstances - 1].claimed = FALSE;
@@ -532,7 +532,7 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
/* Allocate an entry in the lists to be returned */
numFound++;
- retEntities = xnfrealloc(retEntities, numFound * sizeof(int));
+ retEntities = xnfreallocarray(retEntities, numFound, sizeof(int));
retEntities[numFound - 1]
= xf86ClaimSbusSlot(psdp, drvp, instances[i].dev,
instances[i].dev->active ? TRUE : FALSE);
@@ -648,7 +648,7 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
return;
fbcmap.count = 0;
fbcmap.index = indices[0];
- fbcmap.red = data = malloc(numColors * 3);
+ fbcmap.red = data = xallocarray(numColors, 3);
if (!data)
return;
fbcmap.green = data + numColors;
diff --git a/xserver/hw/xfree86/common/xf86str.h b/xserver/hw/xfree86/common/xf86str.h
index 643a65db1..5e6e97778 100644
--- a/xserver/hw/xfree86/common/xf86str.h
+++ b/xserver/hw/xfree86/common/xf86str.h
@@ -41,6 +41,7 @@
#include "colormapst.h"
#include "xf86Module.h"
#include "xf86Opt.h"
+#include "displaymode.h"
/**
* Integer type that is of the size of the addressable memory (machine size).
@@ -84,48 +85,6 @@ typedef enum {
MODECHECK_FINAL = 1
} ModeCheckFlags;
-/* These are possible return values for xf86CheckMode() and ValidMode() */
-typedef enum {
- MODE_OK = 0, /* Mode OK */
- MODE_HSYNC, /* hsync out of range */
- MODE_VSYNC, /* vsync out of range */
- MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
- MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
- MODE_BAD_WIDTH, /* requires an unsupported linepitch */
- MODE_NOMODE, /* no mode with a maching name */
- MODE_NO_INTERLACE, /* interlaced mode not supported */
- MODE_NO_DBLESCAN, /* doublescan mode not supported */
- MODE_NO_VSCAN, /* multiscan mode not supported */
- MODE_MEM, /* insufficient video memory */
- MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
- MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
- MODE_MEM_VIRT, /* insufficient video memory given virtual size */
- MODE_NOCLOCK, /* no fixed clock available */
- MODE_CLOCK_HIGH, /* clock required is too high */
- MODE_CLOCK_LOW, /* clock required is too low */
- MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
- MODE_BAD_HVALUE, /* horizontal timing was out of range */
- MODE_BAD_VVALUE, /* vertical timing was out of range */
- MODE_BAD_VSCAN, /* VScan value out of range */
- MODE_HSYNC_NARROW, /* horizontal sync too narrow */
- MODE_HSYNC_WIDE, /* horizontal sync too wide */
- MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
- MODE_HBLANK_WIDE, /* horizontal blanking too wide */
- MODE_VSYNC_NARROW, /* vertical sync too narrow */
- MODE_VSYNC_WIDE, /* vertical sync too wide */
- MODE_VBLANK_NARROW, /* vertical blanking too narrow */
- MODE_VBLANK_WIDE, /* vertical blanking too wide */
- MODE_PANEL, /* exceeds panel dimensions */
- MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
- MODE_ONE_WIDTH, /* only one width is supported */
- MODE_ONE_HEIGHT, /* only one height is supported */
- MODE_ONE_SIZE, /* only one resolution is supported */
- MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */
- MODE_BANDWIDTH, /* mode requires too much memory bandwidth */
- MODE_BAD = -2, /* unspecified reason */
- MODE_ERROR = -1 /* error condition */
-} ModeStatus;
-
/*
* The mode sets are, from best to worst: USERDEF, DRIVER, and DEFAULT/BUILTIN.
* Preferred will bubble a mode to the top within a set.
@@ -141,54 +100,6 @@ typedef enum {
#define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */
#define M_T_USERPREF 0x80 /* mode preferred by the user config */
-/* Video mode */
-typedef struct _DisplayModeRec {
- struct _DisplayModeRec *prev;
- struct _DisplayModeRec *next;
- const char *name; /* identifier for the mode */
- ModeStatus status;
- int type;
-
- /* These are the values that the user sees/provides */
- int Clock; /* pixel clock freq (kHz) */
- int HDisplay; /* horizontal timing */
- int HSyncStart;
- int HSyncEnd;
- int HTotal;
- int HSkew;
- int VDisplay; /* vertical timing */
- int VSyncStart;
- int VSyncEnd;
- int VTotal;
- int VScan;
- int Flags;
-
- /* These are the values the hardware uses */
- int ClockIndex;
- int SynthClock; /* Actual clock freq to
- * be programmed (kHz) */
- int CrtcHDisplay;
- int CrtcHBlankStart;
- int CrtcHSyncStart;
- int CrtcHSyncEnd;
- int CrtcHBlankEnd;
- int CrtcHTotal;
- int CrtcHSkew;
- int CrtcVDisplay;
- int CrtcVBlankStart;
- int CrtcVSyncStart;
- int CrtcVSyncEnd;
- int CrtcVBlankEnd;
- int CrtcVTotal;
- Bool CrtcHAdjusted;
- Bool CrtcVAdjusted;
- int PrivSize;
- INT32 *Private;
- int PrivFlags;
-
- float HSync, VRefresh;
-} DisplayModeRec, *DisplayModePtr;
-
/* The monitor description */
#define MAX_HSYNC 8
@@ -377,7 +288,6 @@ typedef struct _bus {
} id;
} BusRec, *BusPtr;
-#define MAXCLOCKS 128
typedef enum {
DAC_BPP8 = 0,
DAC_BPP16,
@@ -440,6 +350,7 @@ typedef struct _confxvadaptrec {
void *options;
} confXvAdaptorRec, *confXvAdaptorPtr;
+#define MAX_GPUDEVICES 4
typedef struct _confscreenrec {
const char *id;
int screennum;
@@ -453,6 +364,9 @@ typedef struct _confscreenrec {
int numxvadaptors;
confXvAdaptorPtr xvadaptors;
void *options;
+
+ int num_gpu_devices;
+ GDevPtr gpu_devices[MAX_GPUDEVICES];
} confScreenRec, *confScreenPtr;
typedef enum {
@@ -512,6 +426,9 @@ typedef struct _confdrirec {
#define NUM_RESERVED_POINTERS 14
#define NUM_RESERVED_FUNCS 10
+/* let clients know they can use this */
+#define XF86_SCRN_HAS_PREFER_CLONE 1
+
typedef void *(*funcPointer) (void);
/* flags for depth 24 pixmap options */
@@ -768,6 +685,9 @@ typedef struct _ScrnInfoRec {
ClockRangePtr clockRanges;
int adjustFlags;
+ /* initial rightof support disable */
+ int preferClone;
+
/*
* These can be used when the minor ABI version is incremented.
* The NUM_* parameters must be reduced appropriately to keep the
diff --git a/xserver/hw/xfree86/common/xf86xv.c b/xserver/hw/xfree86/common/xf86xv.c
index b974cd212..d613d712c 100644
--- a/xserver/hw/xfree86/common/xf86xv.c
+++ b/xserver/hw/xfree86/common/xf86xv.c
@@ -131,8 +131,8 @@ xf86XVRegisterGenericAdaptorDriver(xf86XVInitGenericAdaptorPtr InitFunc)
{
xf86XVInitGenericAdaptorPtr *newdrivers;
- newdrivers = realloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) *
- (1 + NumGenDrivers));
+ newdrivers = reallocarray(GenDrivers, 1 + NumGenDrivers,
+ sizeof(xf86XVInitGenericAdaptorPtr));
if (!newdrivers)
return 0;
GenDrivers = newdrivers;
@@ -159,7 +159,7 @@ xf86XVListGenericAdaptors(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr ** adaptors)
n = (*GenDrivers[i]) (pScrn, &DrivAdap);
if (0 == n)
continue;
- new = realloc(*adaptors, sizeof(XF86VideoAdaptorPtr) * (num + n));
+ new = reallocarray(*adaptors, num + n, sizeof(XF86VideoAdaptorPtr));
if (NULL == new)
continue;
*adaptors = new;
@@ -436,8 +436,8 @@ xf86XVInitAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr * infoPtr, int number)
void *moreSpace;
totFormat *= 2;
- moreSpace = realloc(pFormat,
- totFormat * sizeof(XvFormatRec));
+ moreSpace = reallocarray(pFormat, totFormat,
+ sizeof(XvFormatRec));
if (!moreSpace)
break;
pFormat = moreSpace;
diff --git a/xserver/hw/xfree86/common/xf86xvmc.c b/xserver/hw/xfree86/common/xf86xvmc.c
index 3169c054c..a0a94c74b 100644
--- a/xserver/hw/xfree86/common/xf86xvmc.c
+++ b/xserver/hw/xfree86/common/xf86xvmc.c
@@ -155,7 +155,7 @@ xf86XvMCScreenInit(ScreenPtr pScreen,
if (noXvExtension)
return FALSE;
- if (!(pAdapt = malloc(sizeof(XvMCAdaptorRec) * num_adaptors)))
+ if (!(pAdapt = xallocarray(num_adaptors, sizeof(XvMCAdaptorRec))))
return FALSE;
if (!dixRegisterPrivateKey(&XF86XvMCScreenKeyRec, PRIVATE_SCREEN, 0)) {
diff --git a/xserver/hw/xfree86/ddc/Makefile.in b/xserver/hw/xfree86/ddc/Makefile.in
index cd361df1f..1c3c8df61 100644
--- a/xserver/hw/xfree86/ddc/Makefile.in
+++ b/xserver/hw/xfree86/ddc/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -246,7 +245,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -376,8 +374,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/ddc/ddc.c b/xserver/hw/xfree86/ddc/ddc.c
index 29185ad8b..ee533db1c 100644
--- a/xserver/hw/xfree86/ddc/ddc.c
+++ b/xserver/hw/xfree86/ddc/ddc.c
@@ -437,7 +437,7 @@ xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool complete)
int i, n = EDID_block[0x7e];
if (complete && n) {
- EDID_block = realloc(EDID_block, EDID1_LEN * (1 + n));
+ EDID_block = reallocarray(EDID_block, 1 + n, EDID1_LEN);
for (i = 0; i < n; i++)
DDC2Read(dev, i + 1, EDID_block + (EDID1_LEN * (1 + i)));
diff --git a/xserver/hw/xfree86/dixmods/Makefile.in b/xserver/hw/xfree86/dixmods/Makefile.in
index 2c3d2dc42..a08e7f3d9 100644
--- a/xserver/hw/xfree86/dixmods/Makefile.in
+++ b/xserver/hw/xfree86/dixmods/Makefile.in
@@ -60,8 +60,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -288,7 +287,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -418,8 +416,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/dixmods/xkbPrivate.c b/xserver/hw/xfree86/dixmods/xkbPrivate.c
index 574590f28..4b9ef3397 100644
--- a/xserver/hw/xfree86/dixmods/xkbPrivate.c
+++ b/xserver/hw/xfree86/dixmods/xkbPrivate.c
@@ -38,6 +38,8 @@ XkbDDXPrivate(DeviceIntPtr dev, KeyCode key, XkbAction *act)
if (tmp->deviceGrab.grab)
PrintDeviceGrabInfo(tmp);
xf86Msg(X_INFO, "End list of active device grabs\n");
+
+ PrintPassiveGrabs();
}
else if (strcasecmp(msgbuf, "ungrab") == 0)
UngrabAllDevices(FALSE);
diff --git a/xserver/hw/xfree86/doc/Makefile.in b/xserver/hw/xfree86/doc/Makefile.in
index 20b69b5b5..5ad97b3d5 100644
--- a/xserver/hw/xfree86/doc/Makefile.in
+++ b/xserver/hw/xfree86/doc/Makefile.in
@@ -76,8 +76,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -204,7 +203,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -334,8 +332,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/doc/ddxDesign.xml b/xserver/hw/xfree86/doc/ddxDesign.xml
index 6a9de9e7f..aed77a9f0 100644
--- a/xserver/hw/xfree86/doc/ddxDesign.xml
+++ b/xserver/hw/xfree86/doc/ddxDesign.xml
@@ -6957,28 +6957,6 @@ use of some of these secondary mode helper functions.
<blockquote><para>
<programlisting>
- int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
- int *divider);
- </programlisting>
- <blockquote><para>
- This function returns the index of the closest clock to the
- frequency <parameter>freq</parameter> given (in kHz). It assumes that
- the number of clocks is greater than zero. It requires that the
- <structfield>numClocks</structfield> and <structfield>clock</structfield> fields of the
- <structname>ScrnInfoRec</structname> are initialised. The
- <structfield>allowDiv2</structfield> field determines if the clocks can be
- halved. The <parameter>*divider</parameter> return value indicates
- whether clock division is used when determining the clock returned.
- </para>
-
- <para>
- This function is only for non-programmable clocks.
- </para>
-
- </blockquote></para></blockquote>
-
- <blockquote><para>
- <programlisting>
const char *xf86ModeStatusToString(ModeStatus status);
</programlisting>
<blockquote><para>
@@ -6990,59 +6968,6 @@ use of some of these secondary mode helper functions.
<blockquote><para>
<programlisting>
- ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
- ClockRangePtr clockRanges, LookupModeFlags strategy);
- </programlisting>
- <blockquote><para>
- This function takes a pointer to a mode with the name filled in,
- and looks for a mode in the <structfield>modePool</structfield> list which
- matches. The parameters of the matching mode are filled in to
- <parameter>*modep</parameter>. The <parameter>clockRanges</parameter> and
- <parameter>strategy</parameter> parameters are as for the
- <function>xf86ValidateModes()</function> function above.
- </para>
-
- <para>
- This function requires the <structfield>modePool</structfield>,
- <structfield>clock[]</structfield>, <structfield>numClocks</structfield> and
- <structfield>progClock</structfield> fields of the <structname>ScrnInfoRec</structname>
- to be initialised before being called.
- </para>
-
- <para>
- The return value is <constant>MODE_OK</constant> if a mode was found.
- Otherwise it indicates why a matching mode could not be found.
- </para>
-
- </blockquote></para></blockquote>
-
- <blockquote><para>
- <programlisting>
- ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp,
- DisplayModePtr mode, ClockRangePtr clockRanges,
- LookupModeFlags strategy, int maxPitch,
- int virtualX, int virtualY);
- </programlisting>
- <blockquote><para>
- This function checks the passed mode against some basic driver
- constraints. Apart from the ones passed explicitly, the
- <structfield>maxHValue</structfield> and <structfield>maxVValue</structfield> fields of
- the <structname>ScrnInfoRec</structname> are also used. If the
- <structfield>ValidMode</structfield> field of the <structname>ScrnInfoRec</structname>
- is set, that function is also called to check the mode. Next, the
- mode is checked against the monitor's constraints.
- </para>
-
- <para>
- If the mode is consistent with all constraints, the return value
- is <constant>MODE_OK</constant>. Otherwise the return value indicates
- which constraint wasn't met.
- </para>
-
- </blockquote></para></blockquote>
-
- <blockquote><para>
- <programlisting>
void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode);
</programlisting>
<blockquote><para>
diff --git a/xserver/hw/xfree86/dri/Makefile.in b/xserver/hw/xfree86/dri/Makefile.in
index 402367e76..ff4c9d1fb 100644
--- a/xserver/hw/xfree86/dri/Makefile.in
+++ b/xserver/hw/xfree86/dri/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -245,7 +244,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -375,8 +373,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/dri/dri.c b/xserver/hw/xfree86/dri/dri.c
index 95d8e7dea..161d96fd0 100644
--- a/xserver/hw/xfree86/dri/dri.c
+++ b/xserver/hw/xfree86/dri/dri.c
@@ -1007,7 +1007,8 @@ DRICreateContext(ScreenPtr pScreen, VisualPtr visual,
}
/* track this in case the client dies before cleanup */
- AddResource(context, DRIContextPrivResType, (void *) pDRIContextPriv);
+ if (!AddResource(context, DRIContextPrivResType, (void *) pDRIContextPriv))
+ return FALSE;
return TRUE;
}
@@ -1238,8 +1239,9 @@ DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable,
}
/* track this in case the client dies */
- AddResource(FakeClientID(client->index), DRIDrawablePrivResType,
- (void *) (intptr_t) pDrawable->id);
+ if (!AddResource(FakeClientID(client->index), DRIDrawablePrivResType,
+ (void *) (intptr_t) pDrawable->id))
+ return FALSE;
if (pDRIDrawablePriv->hwDrawable) {
drmUpdateDrawableInfo(pDRIPriv->drmFD,
@@ -1666,7 +1668,7 @@ DRISwapContext(int drmFD, void *oldctx, void *newctx)
if (!newContext) {
DRIDrvMsg(pScreen->myNum, X_ERROR,
- "[DRI] Context Switch Error: oldContext=%x, newContext=%x\n",
+ "[DRI] Context Switch Error: oldContext=%p, newContext=%p\n",
oldContext, newContext);
return;
}
diff --git a/xserver/hw/xfree86/dri/xf86dri.c b/xserver/hw/xfree86/dri/xf86dri.c
index 086e833ed..68f8b7e72 100644
--- a/xserver/hw/xfree86/dri/xf86dri.c
+++ b/xserver/hw/xfree86/dri/xf86dri.c
@@ -422,7 +422,7 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client)
if (rep.numClipRects) {
/* Clip cliprects to screen dimensions (redirected windows) */
- pClippedRects = malloc(rep.numClipRects * sizeof(drm_clip_rect_t));
+ pClippedRects = xallocarray(rep.numClipRects, sizeof(drm_clip_rect_t));
if (pClippedRects) {
ScreenPtr pScreen = screenInfo.screens[stuff->screen];
diff --git a/xserver/hw/xfree86/dri2/Makefile.in b/xserver/hw/xfree86/dri2/Makefile.in
index 5b335b9f7..c2899092a 100644
--- a/xserver/hw/xfree86/dri2/Makefile.in
+++ b/xserver/hw/xfree86/dri2/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -283,7 +282,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -413,8 +411,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/dri2/dri2.c b/xserver/hw/xfree86/dri2/dri2.c
index 0c038b3d1..d55be1913 100644
--- a/xserver/hw/xfree86/dri2/dri2.c
+++ b/xserver/hw/xfree86/dri2/dri2.c
@@ -90,8 +90,6 @@ typedef struct _DRI2Drawable {
DRI2BufferPtr *buffers;
int bufferCount;
unsigned int swapsPending;
- ClientPtr blockedClient;
- Bool blockedOnMsc;
int swap_interval;
CARD64 swap_count;
int64_t target_sbc; /* -1 means no SBC wait outstanding */
@@ -99,6 +97,7 @@ typedef struct _DRI2Drawable {
CARD64 last_swap_msc; /* msc at completion of most recent swap */
CARD64 last_swap_ust; /* ust at completion of most recent swap */
int swap_limit; /* for N-buffering */
+ unsigned blocked[3];
Bool needInvalidate;
int prime_id;
PixmapPtr prime_slave_pixmap;
@@ -139,6 +138,44 @@ typedef struct _DRI2Screen {
static void
destroy_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, int prime_id);
+enum DRI2WakeType {
+ WAKE_SBC,
+ WAKE_MSC,
+ WAKE_SWAP,
+};
+
+#define Wake(c, t) (void *)((uintptr_t)(c) | (t))
+
+static Bool
+dri2WakeClient(ClientPtr client, void *closure)
+{
+ ClientWakeup(client);
+ return TRUE;
+}
+
+static Bool
+dri2WakeAll(ClientPtr client, DRI2DrawablePtr pPriv, enum DRI2WakeType t)
+{
+ int count;
+
+ if (!pPriv->blocked[t])
+ return FALSE;
+
+ count = ClientSignalAll(client, dri2WakeClient, Wake(pPriv, t));
+ pPriv->blocked[t] -= count;
+ return count;
+}
+
+static Bool
+dri2Sleep(ClientPtr client, DRI2DrawablePtr pPriv, enum DRI2WakeType t)
+{
+ if (ClientSleep(client, dri2WakeClient, Wake(pPriv, t))) {
+ pPriv->blocked[t]++;
+ return TRUE;
+ }
+ return FALSE;
+}
+
static DRI2ScreenPtr
DRI2GetScreen(ScreenPtr pScreen)
{
@@ -210,8 +247,6 @@ DRI2AllocateDrawable(DrawablePtr pDraw)
pPriv->buffers = NULL;
pPriv->bufferCount = 0;
pPriv->swapsPending = 0;
- pPriv->blockedClient = NULL;
- pPriv->blockedOnMsc = FALSE;
pPriv->swap_count = 0;
pPriv->target_sbc = -1;
pPriv->swap_interval = 1;
@@ -219,6 +254,7 @@ DRI2AllocateDrawable(DrawablePtr pDraw)
if (!ds->GetMSC || !(*ds->GetMSC) (pDraw, &ust, &pPriv->last_swap_target))
pPriv->last_swap_target = 0;
+ memset(pPriv->blocked, 0, sizeof(pPriv->blocked));
pPriv->swap_limit = 1; /* default to double buffering */
pPriv->last_swap_msc = 0;
pPriv->last_swap_ust = 0;
@@ -258,13 +294,7 @@ DRI2SwapLimit(DrawablePtr pDraw, int swap_limit)
if (pPriv->swapsPending >= pPriv->swap_limit)
return TRUE;
- if (pPriv->target_sbc == -1 && !pPriv->blockedOnMsc) {
- if (pPriv->blockedClient) {
- AttendClient(pPriv->blockedClient);
- pPriv->blockedClient = NULL;
- }
- }
-
+ dri2WakeAll(CLIENT_SIGNAL_ANY, pPriv, WAKE_SWAP);
return TRUE;
}
@@ -413,6 +443,10 @@ DRI2DrawableGone(void *p, XID id)
(*pDraw->pScreen->DestroyPixmap)(pPriv->redirectpixmap);
}
+ dri2WakeAll(CLIENT_SIGNAL_ANY, pPriv, WAKE_SWAP);
+ dri2WakeAll(CLIENT_SIGNAL_ANY, pPriv, WAKE_MSC);
+ dri2WakeAll(CLIENT_SIGNAL_ANY, pPriv, WAKE_SBC);
+
free(pPriv);
return Success;
@@ -704,26 +738,17 @@ DRI2ThrottleClient(ClientPtr client, DrawablePtr pDraw)
return FALSE;
/* Throttle to swap limit */
- if ((pPriv->swapsPending >= pPriv->swap_limit) && !pPriv->blockedClient) {
- ResetCurrentRequest(client);
- client->sequence--;
- IgnoreClient(client);
- pPriv->blockedClient = client;
- return TRUE;
+ if (pPriv->swapsPending >= pPriv->swap_limit) {
+ if (dri2Sleep(client, pPriv, WAKE_SWAP)) {
+ ResetCurrentRequest(client);
+ client->sequence--;
+ return TRUE;
+ }
}
return FALSE;
}
-static void
-__DRI2BlockClient(ClientPtr client, DRI2DrawablePtr pPriv)
-{
- if (pPriv->blockedClient == NULL) {
- IgnoreClient(client);
- pPriv->blockedClient = client;
- }
-}
-
void
DRI2BlockClient(ClientPtr client, DrawablePtr pDraw)
{
@@ -733,8 +758,7 @@ DRI2BlockClient(ClientPtr client, DrawablePtr pDraw)
if (pPriv == NULL)
return;
- __DRI2BlockClient(client, pPriv);
- pPriv->blockedOnMsc = TRUE;
+ dri2Sleep(client, pPriv, WAKE_MSC);
}
static inline PixmapPtr GetDrawablePixmap(DrawablePtr drawable)
@@ -967,11 +991,7 @@ DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw, int frame,
ProcDRI2WaitMSCReply(client, ((CARD64) tv_sec * 1000000) + tv_usec,
frame, pPriv->swap_count);
- if (pPriv->blockedClient)
- AttendClient(pPriv->blockedClient);
-
- pPriv->blockedClient = NULL;
- pPriv->blockedOnMsc = FALSE;
+ dri2WakeAll(client, pPriv, WAKE_MSC);
}
static void
@@ -997,19 +1017,14 @@ DRI2WakeClient(ClientPtr client, DrawablePtr pDraw, int frame,
* - is not blocked due to an MSC wait
*/
if (pPriv->target_sbc != -1 && pPriv->target_sbc <= pPriv->swap_count) {
- ProcDRI2WaitMSCReply(client, ((CARD64) tv_sec * 1000000) + tv_usec,
- frame, pPriv->swap_count);
- pPriv->target_sbc = -1;
-
- AttendClient(pPriv->blockedClient);
- pPriv->blockedClient = NULL;
- }
- else if (pPriv->target_sbc == -1 && !pPriv->blockedOnMsc) {
- if (pPriv->blockedClient) {
- AttendClient(pPriv->blockedClient);
- pPriv->blockedClient = NULL;
+ if (dri2WakeAll(client, pPriv, WAKE_SBC)) {
+ ProcDRI2WaitMSCReply(client, ((CARD64) tv_sec * 1000000) + tv_usec,
+ frame, pPriv->swap_count);
+ pPriv->target_sbc = -1;
}
}
+
+ dri2WakeAll(CLIENT_SIGNAL_ANY, pPriv, WAKE_SWAP);
}
void
@@ -1057,13 +1072,13 @@ DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable)
DRI2DrawablePtr pPriv = DRI2GetDrawable(pDrawable);
/* If we're currently waiting for a swap on this drawable, reset
- * the request and suspend the client. We only support one
- * blocked client per drawable. */
- if (pPriv && pPriv->swapsPending && pPriv->blockedClient == NULL) {
- ResetCurrentRequest(client);
- client->sequence--;
- __DRI2BlockClient(client, pPriv);
- return TRUE;
+ * the request and suspend the client. */
+ if (pPriv && pPriv->swapsPending) {
+ if (dri2Sleep(client, pPriv, WAKE_SWAP)) {
+ ResetCurrentRequest(client);
+ client->sequence--;
+ return TRUE;
+ }
}
return FALSE;
@@ -1264,6 +1279,9 @@ DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, CARD64 target_sbc)
if (pPriv == NULL)
return BadDrawable;
+ if (pPriv->target_sbc != -1) /* already in use */
+ return BadDrawable;
+
/* target_sbc == 0 means to block until all pending swaps are
* finished. Recalculate target_sbc to get that behaviour.
*/
@@ -1280,9 +1298,10 @@ DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, CARD64 target_sbc)
return Success;
}
- pPriv->target_sbc = target_sbc;
- __DRI2BlockClient(client, pPriv);
+ if (!dri2Sleep(client, pPriv, WAKE_SBC))
+ return BadAlloc;
+ pPriv->target_sbc = target_sbc;
return Success;
}
@@ -1385,8 +1404,7 @@ DRI2ConfigNotify(WindowPtr pWin, int x, int y, int w, int h, int bw,
static void
DRI2SetWindowPixmap(WindowPtr pWin, PixmapPtr pPix)
{
- DrawablePtr pDraw = (DrawablePtr) pWin;
- ScreenPtr pScreen = pDraw->pScreen;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
pScreen->SetWindowPixmap = ds->SetWindowPixmap;
@@ -1394,7 +1412,7 @@ DRI2SetWindowPixmap(WindowPtr pWin, PixmapPtr pPix)
ds->SetWindowPixmap = pScreen->SetWindowPixmap;
pScreen->SetWindowPixmap = DRI2SetWindowPixmap;
- DRI2InvalidateDrawableAll(pDraw);
+ DRI2InvalidateDrawable(&pWin->drawable);
}
#define MAX_PRIME DRI2DriverPrimeMask
@@ -1577,7 +1595,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
if (info->version == 3 || info->numDrivers == 0) {
/* Driver too old: use the old-style driverName field */
ds->numDrivers = info->driverName ? 1 : 2;
- ds->driverNames = malloc(ds->numDrivers * sizeof(*ds->driverNames));
+ ds->driverNames = xallocarray(ds->numDrivers, sizeof(*ds->driverNames));
if (!ds->driverNames)
goto err_out;
@@ -1591,7 +1609,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
}
else {
ds->numDrivers = info->numDrivers;
- ds->driverNames = malloc(info->numDrivers * sizeof(*ds->driverNames));
+ ds->driverNames = xallocarray(info->numDrivers, sizeof(*ds->driverNames));
if (!ds->driverNames)
goto err_out;
memcpy(ds->driverNames, info->driverNames,
diff --git a/xserver/hw/xfree86/dri2/pci_ids/Makefile.am b/xserver/hw/xfree86/dri2/pci_ids/Makefile.am
index c5111082b..69fe8c40d 100644
--- a/xserver/hw/xfree86/dri2/pci_ids/Makefile.am
+++ b/xserver/hw/xfree86/dri2/pci_ids/Makefile.am
@@ -8,4 +8,5 @@ EXTRA_DIST = \
r600_pci_ids.h \
radeon_pci_ids.h \
radeonsi_pci_ids.h \
+ virtio_gpu_pci_ids.h \
vmwgfx_pci_ids.h
diff --git a/xserver/hw/xfree86/dri2/pci_ids/Makefile.in b/xserver/hw/xfree86/dri2/pci_ids/Makefile.in
index 8f2016d67..b39d20017 100644
--- a/xserver/hw/xfree86/dri2/pci_ids/Makefile.in
+++ b/xserver/hw/xfree86/dri2/pci_ids/Makefile.in
@@ -55,8 +55,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -181,7 +180,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -311,8 +309,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -446,6 +442,7 @@ EXTRA_DIST = \
r600_pci_ids.h \
radeon_pci_ids.h \
radeonsi_pci_ids.h \
+ virtio_gpu_pci_ids.h \
vmwgfx_pci_ids.h
all: all-am
diff --git a/xserver/hw/xfree86/dri2/pci_ids/i915_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/i915_pci_ids.h
index 7d51975c3..1c43c8ec7 100644
--- a/xserver/hw/xfree86/dri2/pci_ids/i915_pci_ids.h
+++ b/xserver/hw/xfree86/dri2/pci_ids/i915_pci_ids.h
@@ -11,5 +11,5 @@ CHIPSET(0x27AE, I945_GME, "Intel(R) 945GME")
CHIPSET(0x29B2, Q35_G, "Intel(R) Q35")
CHIPSET(0x29C2, G33_G, "Intel(R) G33")
CHIPSET(0x29D2, Q33_G, "Intel(R) Q33")
-CHIPSET(0xA011, IGD_GM, "Intel(R) IGD")
-CHIPSET(0xA001, IGD_G, "Intel(R) IGD")
+CHIPSET(0xA011, PNV_GM, "Intel(R) Pineview M")
+CHIPSET(0xA001, PNV_G, "Intel(R) Pineview")
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 2e04301fb..5139e279b 100644
--- a/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h
+++ b/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h
@@ -109,7 +109,55 @@ 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) Cherryview")
-CHIPSET(0x22B1, chv, "Intel(R) Cherryview")
-CHIPSET(0x22B2, chv, "Intel(R) Cherryview")
-CHIPSET(0x22B3, chv, "Intel(R) 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(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")
+CHIPSET(0x1915, skl_gt2, "Intel(R) Skylake GT2f")
+CHIPSET(0x1916, skl_gt2, "Intel(R) HD Graphics 520 (Skylake GT2)")
+CHIPSET(0x1917, skl_gt2, "Intel(R) Skylake GT2f")
+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(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(0x590A, 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(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(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)")
diff --git a/xserver/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h b/xserver/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h
index 8a97c6f31..da7ea1c1e 100644
--- a/xserver/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h
+++ b/xserver/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h
@@ -51,6 +51,12 @@ static const int radeonsi_chip_ids[] = {
#undef CHIPSET
};
+static const int virtio_gpu_chip_ids[] = {
+#define CHIPSET(chip, name, family) chip,
+#include "pci_ids/virtio_gpu_pci_ids.h"
+#undef CHIPSET
+};
+
static const int vmwgfx_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/vmwgfx_pci_ids.h"
@@ -73,6 +79,7 @@ static const struct {
{ 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
{ 0x1002, "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) },
{ 0x10de, "nouveau", NULL, -1 },
+ { 0x1af4, "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) },
{ 0x15ad, "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) },
{ 0x0000, NULL, NULL, 0 },
};
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 bcf15a186..4df8e9d83 100644
--- a/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h
+++ b/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h
@@ -182,4 +182,14 @@ CHIPSET(0x9877, CARRIZO_, CARRIZO)
CHIPSET(0x7300, FIJI_, FIJI)
+CHIPSET(0x67E0, POLARIS11_, POLARIS11)
+CHIPSET(0x67E1, POLARIS11_, POLARIS11)
+CHIPSET(0x67E8, POLARIS11_, POLARIS11)
+CHIPSET(0x67E9, POLARIS11_, POLARIS11)
+CHIPSET(0x67EB, POLARIS11_, POLARIS11)
+CHIPSET(0x67FF, POLARIS11_, POLARIS11)
+
+CHIPSET(0x67C0, POLARIS10_, POLARIS10)
+CHIPSET(0x67DF, POLARIS10_, POLARIS10)
+
CHIPSET(0x98E4, STONEY_, STONEY)
diff --git a/xserver/hw/xfree86/dri2/pci_ids/virtio_gpu_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/virtio_gpu_pci_ids.h
new file mode 100644
index 000000000..9232cd288
--- /dev/null
+++ b/xserver/hw/xfree86/dri2/pci_ids/virtio_gpu_pci_ids.h
@@ -0,0 +1,2 @@
+CHIPSET(0x0010, VIRTGL, VIRTGL)
+CHIPSET(0x1050, VIRTGL, VIRTGL)
diff --git a/xserver/hw/xfree86/drivers/Makefile.in b/xserver/hw/xfree86/drivers/Makefile.in
index da20f87e9..d7e036582 100644
--- a/xserver/hw/xfree86/drivers/Makefile.in
+++ b/xserver/hw/xfree86/drivers/Makefile.in
@@ -56,8 +56,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -222,7 +221,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -352,8 +350,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/drivers/modesetting/Makefile.in b/xserver/hw/xfree86/drivers/modesetting/Makefile.in
index ee6dc889c..ae15af2cb 100644
--- a/xserver/hw/xfree86/drivers/modesetting/Makefile.in
+++ b/xserver/hw/xfree86/drivers/modesetting/Makefile.in
@@ -84,8 +84,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -278,7 +277,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -408,8 +406,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/drivers/modesetting/dri2.c b/xserver/hw/xfree86/drivers/modesetting/dri2.c
index 63cb0659d..83cb3e0e7 100644
--- a/xserver/hw/xfree86/drivers/modesetting/dri2.c
+++ b/xserver/hw/xfree86/drivers/modesetting/dri2.c
@@ -97,10 +97,8 @@ ms_get_resource(XID id, RESTYPE type)
if (resource == NULL)
return NULL;
- if (!AddResource(id, type, resource)) {
- free(resource);
+ if (!AddResource(id, type, resource))
return NULL;
- }
resource->id = id;
resource->type = type;
@@ -138,8 +136,8 @@ ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment,
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
DRI2Buffer2Ptr buffer;
PixmapPtr pixmap;
- uint32_t size;
- uint16_t pitch;
+ CARD32 size;
+ CARD16 pitch;
ms_dri2_buffer_private_ptr private;
buffer = calloc(1, sizeof *buffer);
diff --git a/xserver/hw/xfree86/drivers/modesetting/driver.c b/xserver/hw/xfree86/drivers/modesetting/driver.c
index 5cb160aae..327bb96d2 100644
--- a/xserver/hw/xfree86/drivers/modesetting/driver.c
+++ b/xserver/hw/xfree86/drivers/modesetting/driver.c
@@ -96,6 +96,10 @@ static const struct pci_id_match ms_device_match[] = {
};
#endif
+#ifndef XSERVER_PLATFORM_BUS
+struct xf86_platform_device;
+#endif
+
#ifdef XSERVER_PLATFORM_BUS
static Bool ms_platform_probe(DriverPtr driver,
int entity_num, int flags,
@@ -124,22 +128,17 @@ static SymTabRec Chipsets[] = {
{-1, NULL}
};
-typedef enum {
- OPTION_SW_CURSOR,
- OPTION_DEVICE_PATH,
- OPTION_SHADOW_FB,
- OPTION_ACCEL_METHOD,
-} modesettingOpts;
-
static const OptionInfoRec Options[] = {
{OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_DEVICE_PATH, "kmsdev", OPTV_STRING, {0}, FALSE},
{OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_ACCEL_METHOD, "AccelMethod", OPTV_STRING, {0}, FALSE},
+ {OPTION_PAGEFLIP, "PageFlip", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE},
{-1, NULL, OPTV_NONE, {0}, FALSE}
};
-int modesettingEntityIndex = -1;
+int ms_entity_index = -1;
static MODULESETUPPROTO(Setup);
@@ -191,6 +190,15 @@ Identify(int flags)
Chipsets);
}
+modesettingEntPtr ms_ent_priv(ScrnInfoPtr scrn)
+{
+ DevUnion *pPriv;
+ modesettingPtr ms = modesettingPTR(scrn);
+ pPriv = xf86GetEntityPrivate(ms->pEnt->index,
+ ms_entity_index);
+ return pPriv->ptr;
+}
+
static int
open_hw(const char *dev)
{
@@ -332,6 +340,25 @@ ms_setup_scrn_hooks(ScrnInfoPtr scrn)
scrn->ValidMode = ValidMode;
}
+static void
+ms_setup_entity(ScrnInfoPtr scrn, int entity_num)
+{
+ DevUnion *pPriv;
+
+ xf86SetEntitySharable(entity_num);
+
+ if (ms_entity_index == -1)
+ ms_entity_index = xf86AllocateEntityPrivateIndex();
+
+ pPriv = xf86GetEntityPrivate(entity_num,
+ ms_entity_index);
+
+ xf86SetEntityInstanceForScreen(scrn, entity_num, xf86GetNumEntityInstances(entity_num) - 1);
+
+ if (!pPriv->ptr)
+ pPriv->ptr = xnfcalloc(sizeof(modesettingEntRec), 1);
+}
+
#if XSERVER_LIBPCIACCESS
static Bool
ms_pci_probe(DriverPtr driver,
@@ -355,6 +382,8 @@ ms_pci_probe(DriverPtr driver,
dev->bus, dev->domain, dev->dev, dev->func);
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"using %s\n", devpath ? devpath : "default device");
+
+ ms_setup_entity(scrn, entity_num);
}
else
scrn = NULL;
@@ -378,12 +407,16 @@ ms_platform_probe(DriverPtr driver,
if (probe_hw(path, dev)) {
scrn = xf86AllocateScreen(driver, scr_flags);
+ if (xf86IsEntitySharable(entity_num))
+ xf86SetEntityShared(entity_num);
xf86AddEntityToScreen(scrn, entity_num);
ms_setup_scrn_hooks(scrn);
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"using drv %s\n", path ? path : "default device");
+
+ ms_setup_entity(scrn, entity_num);
}
return scrn != NULL;
@@ -412,13 +445,12 @@ Probe(DriverPtr drv, int flags)
}
for (i = 0; i < numDevSections; i++) {
-
+ int entity_num;
dev = xf86FindOptionValue(devSections[i]->options, "kmsdev");
if (probe_hw(dev, NULL)) {
- int entity;
- entity = xf86ClaimFbSlot(drv, 0, devSections[i], TRUE);
- scrn = xf86ConfigFbEntity(scrn, 0, entity, NULL, NULL, NULL, NULL);
+ entity_num = xf86ClaimFbSlot(drv, 0, devSections[i], TRUE);
+ scrn = xf86ConfigFbEntity(scrn, 0, entity_num, NULL, NULL, NULL, NULL);
}
if (scrn) {
@@ -428,6 +460,7 @@ Probe(DriverPtr drv, int flags)
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"using %s\n", dev ? dev : "default device");
+ ms_setup_entity(scrn, entity_num);
}
}
@@ -457,7 +490,7 @@ dispatch_dirty_region(ScrnInfoPtr scrn,
int ret = 0;
if (num_cliprects) {
- drmModeClip *clip = malloc(num_cliprects * sizeof(drmModeClip));
+ drmModeClip *clip = xallocarray(num_cliprects, sizeof(drmModeClip));
BoxPtr rect = REGION_RECTS(dirty);
int i;
@@ -538,6 +571,38 @@ dispatch_slave_dirty(ScreenPtr pScreen)
}
static void
+redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
+{
+
+ RegionRec pixregion;
+
+ PixmapRegionInit(&pixregion, dirty->slave_dst);
+ DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
+ PixmapSyncDirtyHelper(dirty);
+
+ DamageRegionProcessPending(&dirty->slave_dst->drawable);
+ RegionUninit(&pixregion);
+}
+
+static void
+ms_dirty_update(ScreenPtr screen)
+{
+ RegionPtr region;
+ PixmapDirtyUpdatePtr ent;
+
+ 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)) {
+ redisplay_dirty(screen, ent);
+ DamageEmpty(ent->damage);
+ }
+ }
+}
+
+static void
msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask)
{
modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen));
@@ -546,10 +611,12 @@ msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask)
pScreen->BlockHandler(pScreen, pTimeout, pReadmask);
ms->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = msBlockHandler;
- if (pScreen->isGPU)
+ if (pScreen->isGPU && !ms->drmmode.reverse_prime_offload_mode)
dispatch_slave_dirty(pScreen);
else if (ms->dirty_enabled)
dispatch_dirty(pScreen);
+
+ ms_dirty_update(pScreen);
}
static void
@@ -566,19 +633,25 @@ FreeRec(ScrnInfoPtr pScrn)
pScrn->driverPrivate = NULL;
if (ms->fd > 0) {
+ modesettingEntPtr ms_ent;
int ret;
- if (ms->pEnt->location.type == BUS_PCI)
- ret = drmClose(ms->fd);
- else
+ ms_ent = ms_ent_priv(pScrn);
+ ms_ent->fd_ref--;
+ if (!ms_ent->fd_ref) {
+ if (ms->pEnt->location.type == BUS_PCI)
+ ret = drmClose(ms->fd);
+ else
#ifdef XF86_PDEV_SERVER_FD
- if (!(ms->pEnt->location.type == BUS_PLATFORM &&
- (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)))
+ if (!(ms->pEnt->location.type == BUS_PLATFORM &&
+ (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)))
#endif
- ret = close(ms->fd);
- (void) ret;
+ ret = close(ms->fd);
+ (void) ret;
+ ms_ent->fd = 0;
+ }
}
- free(ms->Options);
+ free(ms->drmmode.Options);
free(ms);
}
@@ -587,7 +660,7 @@ static void
try_enable_glamor(ScrnInfoPtr pScrn)
{
modesettingPtr ms = modesettingPTR(pScrn);
- const char *accel_method_str = xf86GetOptValString(ms->Options,
+ const char *accel_method_str = xf86GetOptValString(ms->drmmode.Options,
OPTION_ACCEL_METHOD);
Bool do_glamor = (!accel_method_str ||
strcmp(accel_method_str, "glamor") == 0);
@@ -629,60 +702,26 @@ try_enable_glamor(ScrnInfoPtr pScrn)
#endif
static Bool
-PreInit(ScrnInfoPtr pScrn, int flags)
+ms_get_drm_master_fd(ScrnInfoPtr pScrn)
{
- modesettingPtr ms;
- rgb defaultWeight = { 0, 0, 0 };
EntityInfoPtr pEnt;
- EntPtr msEnt = NULL;
+ modesettingPtr ms;
+ modesettingEntPtr ms_ent;
char *BusID = NULL;
- const char *devicename;
- uint64_t value = 0;
- int ret;
- int bppflags;
- int defaultdepth, defaultbpp;
-
- if (pScrn->numEntities != 1)
- return FALSE;
-
- pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
-
- if (flags & PROBE_DETECT) {
- return FALSE;
- }
-
- /* Allocate driverPrivate */
- if (!GetRec(pScrn))
- return FALSE;
ms = modesettingPTR(pScrn);
- ms->SaveGeneration = -1;
- ms->pEnt = pEnt;
+ ms_ent = ms_ent_priv(pScrn);
- pScrn->displayWidth = 640; /* default it */
+ pEnt = ms->pEnt;
- /* Allocate an entity private if necessary */
- if (xf86IsEntityShared(pScrn->entityList[0])) {
- msEnt = xf86GetEntityPrivate(pScrn->entityList[0],
- modesettingEntityIndex)->ptr;
- ms->entityPrivate = msEnt;
- }
- else
- ms->entityPrivate = NULL;
-
- if (xf86IsEntityShared(pScrn->entityList[0])) {
- if (xf86IsPrimInitDone(pScrn->entityList[0])) {
- /* do something */
- }
- else {
- xf86SetPrimInitDone(pScrn->entityList[0]);
- }
+ if (ms_ent->fd) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ " reusing fd for second head\n");
+ ms->fd = ms_ent->fd;
+ ms_ent->fd_ref++;
+ return TRUE;
}
- pScrn->monitor = pScrn->confScreen->monitor;
- pScrn->progClock = TRUE;
- pScrn->rgbBits = 8;
-
#if XSERVER_PLATFORM_BUS
if (pEnt->location.type == BUS_PLATFORM) {
#ifdef XF86_PDEV_SERVER_FD
@@ -719,12 +758,61 @@ PreInit(ScrnInfoPtr pScrn, int flags)
ms->fd = drmOpen(NULL, BusID);
}
else {
+ const char *devicename;
devicename = xf86FindOptionValue(ms->pEnt->device->options, "kmsdev");
ms->fd = open_hw(devicename);
}
if (ms->fd < 0)
return FALSE;
+ ms_ent->fd = ms->fd;
+ ms_ent->fd_ref = 1;
+ return TRUE;
+}
+
+static Bool
+PreInit(ScrnInfoPtr pScrn, int flags)
+{
+ modesettingPtr ms;
+ rgb defaultWeight = { 0, 0, 0 };
+ EntityInfoPtr pEnt;
+ uint64_t value = 0;
+ int ret;
+ int bppflags;
+ int defaultdepth, defaultbpp;
+
+ if (pScrn->numEntities != 1)
+ return FALSE;
+
+ pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
+
+ if (flags & PROBE_DETECT) {
+ return FALSE;
+ }
+
+ /* Allocate driverPrivate */
+ if (!GetRec(pScrn))
+ return FALSE;
+
+ ms = modesettingPTR(pScrn);
+ ms->SaveGeneration = -1;
+ ms->pEnt = pEnt;
+ ms->drmmode.is_secondary = FALSE;
+ pScrn->displayWidth = 640; /* default it */
+
+ if (xf86IsEntityShared(pScrn->entityList[0])) {
+ if (xf86IsPrimInitDone(pScrn->entityList[0]))
+ ms->drmmode.is_secondary = TRUE;
+ else
+ xf86SetPrimInitDone(pScrn->entityList[0]);
+ }
+
+ pScrn->monitor = pScrn->confScreen->monitor;
+ pScrn->progClock = TRUE;
+ pScrn->rgbBits = 8;
+
+ if (!ms_get_drm_master_fd(pScrn))
+ return FALSE;
ms->drmmode.fd = ms->fd;
pScrn->capabilities = 0;
@@ -733,6 +821,10 @@ PreInit(ScrnInfoPtr pScrn, int flags)
if (ret == 0) {
if (value & DRM_PRIME_CAP_IMPORT)
pScrn->capabilities |= RR_Capability_SinkOutput;
+#if GLAMOR_HAS_GBM_LINEAR
+ if (value & DRM_PRIME_CAP_EXPORT)
+ pScrn->capabilities |= RR_Capability_SourceOutput;
+#endif
}
#endif
drmmode_get_default_bpp(pScrn, &ms->drmmode, &defaultdepth, &defaultbpp);
@@ -760,17 +852,17 @@ PreInit(ScrnInfoPtr pScrn, int flags)
/* Process the options */
xf86CollectOptions(pScrn, NULL);
- if (!(ms->Options = malloc(sizeof(Options))))
+ if (!(ms->drmmode.Options = malloc(sizeof(Options))))
return FALSE;
- memcpy(ms->Options, Options, sizeof(Options));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options);
+ memcpy(ms->drmmode.Options, Options, sizeof(Options));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->drmmode.Options);
if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight))
return FALSE;
if (!xf86SetDefaultVisual(pScrn, -1))
return FALSE;
- if (xf86ReturnOptValBool(ms->Options, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(ms->drmmode.Options, OPTION_SW_CURSOR, FALSE)) {
ms->drmmode.sw_cursor = TRUE;
}
@@ -788,7 +880,8 @@ PreInit(ScrnInfoPtr pScrn, int flags)
try_enable_glamor(pScrn);
if (ms->drmmode.glamor) {
- xf86LoadSubModule(pScrn, "dri2");
+ ms->drmmode.pageflip =
+ xf86ReturnOptValBool(ms->drmmode.Options, OPTION_PAGEFLIP, TRUE);
} else {
Bool prefer_shadow = TRUE;
@@ -797,7 +890,7 @@ PreInit(ScrnInfoPtr pScrn, int flags)
prefer_shadow = !!value;
}
- ms->drmmode.shadow_enable = xf86ReturnOptValBool(ms->Options,
+ ms->drmmode.shadow_enable = xf86ReturnOptValBool(ms->drmmode.Options,
OPTION_SHADOW_FB,
prefer_shadow);
@@ -805,6 +898,8 @@ PreInit(ScrnInfoPtr pScrn, int flags)
"ShadowFB: preferred %s, enabled %s\n",
prefer_shadow ? "YES" : "NO",
ms->drmmode.shadow_enable ? "YES" : "NO");
+
+ ms->drmmode.pageflip = FALSE;
}
if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) {
@@ -944,20 +1039,49 @@ msShadowInit(ScreenPtr pScreen)
}
static Bool
+msSharePixmapBacking(PixmapPtr ppix, ScreenPtr screen, void **handle)
+{
+#ifdef GLAMOR_HAS_GBM
+ int ret;
+ CARD16 stride;
+ CARD32 size;
+ ret = glamor_fd_from_pixmap(ppix->drawable.pScreen, ppix, &stride, &size);
+ if (ret == -1)
+ return FALSE;
+
+ *handle = (void *)(long)(ret);
+ return TRUE;
+#endif
+ return FALSE;
+}
+
+static Bool
msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle)
{
+#ifdef GLAMOR
ScreenPtr screen = ppix->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
modesettingPtr ms = modesettingPTR(scrn);
Bool ret;
- int size = ppix->devKind * ppix->drawable.height;
int ihandle = (int) (long) fd_handle;
- ret = drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, ppix->devKind, size);
+ if (ms->drmmode.reverse_prime_offload_mode) {
+ ret = glamor_back_pixmap_from_fd(ppix, ihandle,
+ ppix->drawable.width,
+ ppix->drawable.height,
+ ppix->devKind, ppix->drawable.depth,
+ ppix->drawable.bitsPerPixel);
+ } else {
+ int size = ppix->devKind * ppix->drawable.height;
+ ret = drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, ppix->devKind, size);
+ }
if (ret == FALSE)
return ret;
return TRUE;
+#else
+ return FALSE;
+#endif
}
static Bool
@@ -1055,10 +1179,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
#ifdef GLAMOR
if (ms->drmmode.glamor) {
- if (!glamor_init(pScreen,
- GLAMOR_USE_EGL_SCREEN |
- GLAMOR_USE_SCREEN |
- GLAMOR_USE_PICTURE_SCREEN)) {
+ if (!glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to initialize glamor at ScreenInit() time.\n");
return FALSE;
@@ -1098,7 +1219,10 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
ms->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = msBlockHandler;
+ pScreen->SharePixmapBacking = msSharePixmapBacking;
pScreen->SetSharedPixmapBacking = msSetSharedPixmapBacking;
+ pScreen->StartPixmapTracking = PixmapStartDirtyTracking;
+ pScreen->StopPixmapTracking = PixmapStopDirtyTracking;
if (!xf86CrtcScreenInit(pScreen))
return FALSE;
@@ -1141,6 +1265,9 @@ 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)
+ ms->drmmode.reverse_prime_offload_mode = TRUE;
}
#endif
@@ -1208,6 +1335,10 @@ CloseScreen(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
modesettingPtr ms = modesettingPTR(pScrn);
+ modesettingEntPtr ms_ent = ms_ent_priv(pScrn);
+
+ /* Clear mask of assigned crtc's in this generation */
+ ms_ent->assigned_crtcs = 0;
#ifdef GLAMOR
if (ms->drmmode.glamor) {
diff --git a/xserver/hw/xfree86/drivers/modesetting/driver.h b/xserver/hw/xfree86/drivers/modesetting/driver.h
index 3decc3eea..5e1c5d988 100644
--- a/xserver/hw/xfree86/drivers/modesetting/driver.h
+++ b/xserver/hw/xfree86/drivers/modesetting/driver.h
@@ -43,13 +43,25 @@
#include "drmmode_display.h"
#define DRV_ERROR(msg) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg);
-
-typedef struct {
- int lastInstance;
- int refCount;
- ScrnInfoPtr pScrn_1;
- ScrnInfoPtr pScrn_2;
-} EntRec, *EntPtr;
+#define MS_LOGLEVEL_DEBUG 4
+
+typedef enum {
+ OPTION_SW_CURSOR,
+ OPTION_DEVICE_PATH,
+ OPTION_SHADOW_FB,
+ OPTION_ACCEL_METHOD,
+ OPTION_PAGEFLIP,
+ OPTION_ZAPHOD_HEADS,
+} modesettingOpts;
+
+typedef struct
+{
+ int fd;
+ int fd_ref;
+ unsigned long fd_wakeup_registered; /* server generation for which fd has been registered for wakeup handling */
+ int fd_wakeup_ref;
+ unsigned int assigned_crtcs;
+} modesettingEntRec, *modesettingEntPtr;
typedef void (*ms_drm_handler_proc)(uint64_t frame,
uint64_t usec,
@@ -74,8 +86,6 @@ struct ms_drm_queue {
typedef struct _modesettingRec {
int fd;
- EntPtr entityPrivate;
-
int Chipset;
EntityInfoPtr pEnt;
#if XSERVER_LIBPCIACCESS
@@ -88,9 +98,6 @@ typedef struct _modesettingRec {
Bool noAccel;
CloseScreenProcPtr CloseScreen;
- /* Broken-out options. */
- OptionInfoPtr Options;
-
unsigned int SaveGeneration;
CreateScreenResourcesProcPtr createScreenResources;
@@ -101,6 +108,12 @@ typedef struct _modesettingRec {
drmEventContext event_context;
+ /**
+ * Page flipping stuff.
+ * @{
+ */
+ /** @} */
+
DamagePtr damage;
Bool dirty_enabled;
@@ -108,6 +121,7 @@ typedef struct _modesettingRec {
} modesettingRec, *modesettingPtr;
#define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate))
+modesettingEntPtr ms_ent_priv(ScrnInfoPtr scrn);
uint32_t ms_drm_queue_alloc(xf86CrtcPtr crtc,
void *data,
@@ -117,6 +131,9 @@ uint32_t ms_drm_queue_alloc(xf86CrtcPtr crtc,
void ms_drm_abort(ScrnInfoPtr scrn,
Bool (*match)(void *data, void *match_data),
void *match_data);
+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,
diff --git a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c
index a8de5f9e7..bb5f56ed5 100644
--- a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -50,7 +50,42 @@
#include "driver.h"
-static int
+static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height);
+
+static Bool
+drmmode_zaphod_string_matches(ScrnInfoPtr scrn, const char *s, char *output_name)
+{
+ int i = 0;
+ char s1[20];
+
+ do {
+ switch(*s) {
+ case ',':
+ s1[i] = '\0';
+ i = 0;
+ if (strcmp(s1, output_name) == 0)
+ return TRUE;
+ break;
+ case ' ':
+ case '\t':
+ case '\n':
+ case '\r':
+ break;
+ default:
+ s1[i] = *s;
+ i++;
+ break;
+ }
+ } while(*s++);
+
+ s1[i] = '\0';
+ if (strcmp(s1, output_name) == 0)
+ return TRUE;
+
+ return FALSE;
+}
+
+int
drmmode_bo_destroy(drmmode_ptr drmmode, drmmode_bo *bo)
{
int ret;
@@ -71,7 +106,7 @@ drmmode_bo_destroy(drmmode_ptr drmmode, drmmode_bo *bo)
return 0;
}
-static uint32_t
+uint32_t
drmmode_bo_get_pitch(drmmode_bo *bo)
{
#ifdef GLAMOR_HAS_GBM
@@ -142,6 +177,36 @@ drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo,
}
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)
{
@@ -275,7 +340,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
int saved_x, saved_y;
Rotation saved_rotation;
DisplayModeRec saved_mode;
- uint32_t *output_ids;
+ uint32_t *output_ids = NULL;
int output_count = 0;
Bool ret = TRUE;
int i;
@@ -308,7 +373,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
crtc->x = x;
crtc->y = y;
crtc->rotation = rotation;
- crtc->transformPresent = FALSE;
}
output_ids = calloc(sizeof(uint32_t), xf86_config->num_output);
@@ -326,6 +390,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
continue;
drmmode_output = output->driver_private;
+ if (drmmode_output->output_id == -1)
+ continue;
output_ids[output_count] =
drmmode_output->mode_output->connector_id;
output_count++;
@@ -341,35 +407,45 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
fb_id = drmmode->fb_id;
if (crtc->randr_crtc->scanout_pixmap) {
- msPixmapPrivPtr ppriv =
- msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap);
- fb_id = ppriv->fb_id;
- x = y = 0;
+ if (!drmmode->reverse_prime_offload_mode) {
+ msPixmapPrivPtr ppriv =
+ msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap);
+ fb_id = ppriv->fb_id;
+ x = 0;
+ } else
+ x = drmmode_crtc->prime_pixmap_x;
+ y = 0;
}
else if (drmmode_crtc->rotate_fb_id) {
fb_id = drmmode_crtc->rotate_fb_id;
x = y = 0;
}
- ret = drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
- fb_id, x, y, output_ids, output_count, &kmode);
- if (ret)
+ if (drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
+ fb_id, x, y, output_ids, output_count, &kmode)) {
xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
- "failed to set mode: %s", strerror(-ret));
- else
+ "failed to set mode: %s\n", strerror(errno));
+ ret = FALSE;
+ goto done;
+ } else
ret = TRUE;
if (crtc->scrn->pScreen)
xf86CrtcSetScreenSubpixelOrder(crtc->scrn->pScreen);
+ drmmode_crtc->need_modeset = FALSE;
crtc->funcs->dpms(crtc, DPMSModeOn);
/* 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];
+ drmmode_output_private_ptr drmmode_output;
if (output->crtc != crtc)
continue;
+ drmmode_output = output->driver_private;
+ if (drmmode_output->output_id == -1)
+ continue;
output->funcs->dpms(output, DPMSModeOn);
}
}
@@ -385,11 +461,10 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
crtc->y = saved_y;
crtc->rotation = saved_rotation;
crtc->mode = saved_mode;
- }
-#if defined(XF86_CRTC_VERSION) && XF86_CRTC_VERSION >= 3
- else
+ } else
crtc->active = TRUE;
-#endif
+
+ free(output_ids);
return ret;
}
@@ -496,7 +571,54 @@ drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t * red, uint16_t * green,
}
static Bool
-drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
+drmmode_set_scanout_pixmap_gpu(xf86CrtcPtr crtc, PixmapPtr ppix)
+{
+ ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
+ PixmapPtr screenpix = screen->GetScreenPixmap(screen);
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ 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);
+ drmmode_crtc->prime_pixmap_x = 0;
+ 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];
+ if (!iter->enabled && iter != crtc)
+ continue;
+ if (iter == crtc) {
+ this_x = total_width;
+ total_width += ppix->drawable.width;
+ if (max_height < ppix->drawable.height)
+ max_height = ppix->drawable.height;
+ } else {
+ total_width += iter->mode.HDisplay;
+ if (max_height < iter->mode.VDisplay)
+ max_height = iter->mode.VDisplay;
+ }
+ }
+
+ if (total_width != screenpix->drawable.width ||
+ max_height != screenpix->drawable.height) {
+
+ if (!drmmode_xf86crtc_resize(crtc->scrn, total_width, max_height))
+ return FALSE;
+
+ screenpix = screen->GetScreenPixmap(screen);
+ screen->width = screenpix->drawable.width = total_width;
+ screen->height = screenpix->drawable.height = max_height;
+ }
+ drmmode_crtc->prime_pixmap_x = this_x;
+ PixmapStartDirtyTracking(ppix, screenpix, 0, 0, this_x, 0, RR_Rotate_0);
+ return TRUE;
+}
+
+static Bool
+drmmode_set_scanout_pixmap_cpu(xf86CrtcPtr crtc, PixmapPtr ppix)
{
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
@@ -537,6 +659,18 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
return TRUE;
}
+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);
+}
+
static void *
drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
{
@@ -686,22 +820,30 @@ drmmode_crtc_vblank_pipe(int crtc_id)
return 0;
}
-static void
-drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
+static unsigned int
+drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res, int num)
{
xf86CrtcPtr crtc;
drmmode_crtc_private_ptr drmmode_crtc;
+ modesettingEntPtr ms_ent = ms_ent_priv(pScrn);
crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs);
if (crtc == NULL)
- return;
+ return 0;
drmmode_crtc = xnfcalloc(sizeof(drmmode_crtc_private_rec), 1);
drmmode_crtc->mode_crtc =
- drmModeGetCrtc(drmmode->fd, drmmode->mode_res->crtcs[num]);
+ drmModeGetCrtc(drmmode->fd, mode_res->crtcs[num]);
drmmode_crtc->drmmode = drmmode;
drmmode_crtc->vblank_pipe = drmmode_crtc_vblank_pipe(num);
crtc->driver_private = drmmode_crtc;
+
+ /* Mark num'th crtc as in use on this device. */
+ ms_ent->assigned_crtcs |= (1 << num);
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, MS_LOGLEVEL_DEBUG,
+ "Allocated crtc nr. %d to this screen.\n", num);
+
+ return 1;
}
static xf86OutputStatus
@@ -712,6 +854,9 @@ drmmode_output_detect(xf86OutputPtr output)
drmmode_ptr drmmode = drmmode_output->drmmode;
xf86OutputStatus status;
+ if (drmmode_output->output_id == -1)
+ return XF86OutputStatusDisconnected;
+
drmModeFreeConnector(drmmode_output->mode_output);
drmmode_output->mode_output =
@@ -740,6 +885,46 @@ drmmode_output_mode_valid(xf86OutputPtr output, DisplayModePtr pModes)
return MODE_OK;
}
+static void
+drmmode_output_attach_tile(xf86OutputPtr output)
+{
+ drmmode_output_private_ptr drmmode_output = output->driver_private;
+ drmModeConnectorPtr koutput = drmmode_output->mode_output;
+ drmmode_ptr drmmode = drmmode_output->drmmode;
+ int i;
+ struct xf86CrtcTileInfo tile_info, *set = NULL;
+
+ if (!koutput) {
+ xf86OutputSetTile(output, NULL);
+ return;
+ }
+
+ /* look for a TILE property */
+ for (i = 0; i < koutput->count_props; i++) {
+ drmModePropertyPtr props;
+ props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
+ if (!props)
+ continue;
+
+ if (!(props->flags & DRM_MODE_PROP_BLOB)) {
+ drmModeFreeProperty(props);
+ continue;
+ }
+
+ if (!strcmp(props->name, "TILE")) {
+ drmModeFreePropertyBlob(drmmode_output->tile_blob);
+ drmmode_output->tile_blob =
+ drmModeGetPropertyBlob(drmmode->fd, koutput->prop_values[i]);
+ }
+ drmModeFreeProperty(props);
+ }
+ if (drmmode_output->tile_blob) {
+ if (xf86OutputParseKMSTile(drmmode_output->tile_blob->data, drmmode_output->tile_blob->length, &tile_info) == TRUE)
+ set = &tile_info;
+ }
+ xf86OutputSetTile(output, set);
+}
+
static Bool
has_panel_fitter(xf86OutputPtr output)
{
@@ -848,6 +1033,8 @@ drmmode_output_get_modes(xf86OutputPtr output)
}
xf86OutputSetEDID(output, mon);
+ drmmode_output_attach_tile(output);
+
/* modes should already be available */
for (i = 0; i < koutput->count_modes; i++) {
Mode = xnfalloc(sizeof(DisplayModeRec));
@@ -873,11 +1060,13 @@ drmmode_output_destroy(xf86OutputPtr output)
free(drmmode_output->props[i].atoms);
}
free(drmmode_output->props);
- for (i = 0; i < drmmode_output->mode_output->count_encoders; i++) {
- drmModeFreeEncoder(drmmode_output->mode_encoders[i]);
+ if (drmmode_output->mode_output) {
+ for (i = 0; i < drmmode_output->mode_output->count_encoders; i++) {
+ drmModeFreeEncoder(drmmode_output->mode_encoders[i]);
+ }
+ drmModeFreeConnector(drmmode_output->mode_output);
}
free(drmmode_output->mode_encoders);
- drmModeFreeConnector(drmmode_output->mode_output);
free(drmmode_output);
output->driver_private = NULL;
}
@@ -886,6 +1075,7 @@ static void
drmmode_output_dpms(xf86OutputPtr output, int mode)
{
drmmode_output_private_ptr drmmode_output = output->driver_private;
+ xf86CrtcPtr crtc = output->crtc;
drmModeConnectorPtr koutput = drmmode_output->mode_output;
drmmode_ptr drmmode = drmmode_output->drmmode;
@@ -894,6 +1084,13 @@ drmmode_output_dpms(xf86OutputPtr output, int mode)
drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id,
drmmode_output->dpms_enum_id, mode);
+
+ if (mode == DPMSModeOn && 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);
+ }
return;
}
@@ -1094,38 +1291,150 @@ static int subpixel_conv_table[7] = {
static const char *const output_names[] = {
"None",
"VGA",
- "DVI",
- "DVI",
- "DVI",
+ "DVI-I",
+ "DVI-D",
+ "DVI-A",
"Composite",
- "S-video",
+ "SVIDEO",
"LVDS",
- "CTV",
+ "Component",
"DIN",
- "DisplayPort",
- "HDMI",
+ "DP",
"HDMI",
+ "HDMI-B",
"TV",
"eDP",
"Virtual",
"DSI",
};
+static xf86OutputPtr find_output(ScrnInfoPtr pScrn, int id)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int i;
+ for (i = 0; i < xf86_config->num_output; i++) {
+ xf86OutputPtr output = xf86_config->output[i];
+ drmmode_output_private_ptr drmmode_output;
+
+ drmmode_output = output->driver_private;
+ if (drmmode_output->output_id == id)
+ return output;
+ }
+ return NULL;
+}
+
+static int parse_path_blob(drmModePropertyBlobPtr path_blob, int *conn_base_id, char **path)
+{
+ char *conn;
+ char conn_id[5];
+ int id, len;
+ char *blob_data;
+
+ if (!path_blob)
+ return -1;
+
+ blob_data = path_blob->data;
+ /* we only handle MST paths for now */
+ if (strncmp(blob_data, "mst:", 4))
+ return -1;
+
+ conn = strchr(blob_data + 4, '-');
+ if (!conn)
+ return -1;
+ len = conn - (blob_data + 4);
+ if (len + 1> 5)
+ return -1;
+ memcpy(conn_id, blob_data + 4, len);
+ conn_id[len + 1] = '\0';
+ id = strtoul(conn_id, NULL, 10);
+
+ *conn_base_id = id;
+
+ *path = conn + 1;
+ return 0;
+}
+
static void
-drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
+drmmode_create_name(ScrnInfoPtr pScrn, drmModeConnectorPtr koutput, char *name,
+ drmModePropertyBlobPtr path_blob)
+{
+ int ret;
+ char *extra_path;
+ int conn_id;
+ xf86OutputPtr output;
+
+ ret = parse_path_blob(path_blob, &conn_id, &extra_path);
+ if (ret == -1)
+ goto fallback;
+
+ output = find_output(pScrn, conn_id);
+ if (!output)
+ goto fallback;
+
+ snprintf(name, 32, "%s-%s", output->name, extra_path);
+ return;
+
+ 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);
+}
+
+static unsigned int
+drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res, int num, Bool dynamic, int crtcshift)
{
xf86OutputPtr output;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
drmModeConnectorPtr koutput;
drmModeEncoderPtr *kencoders = NULL;
drmmode_output_private_ptr drmmode_output;
drmModePropertyPtr props;
char name[32];
int i;
-
+ drmModePropertyBlobPtr path_blob = NULL;
+ const char *s;
koutput =
- drmModeGetConnector(drmmode->fd, drmmode->mode_res->connectors[num]);
+ drmModeGetConnector(drmmode->fd, mode_res->connectors[num]);
if (!koutput)
- return;
+ return 0;
+
+ for (i = 0; i < koutput->count_props; i++) {
+ props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
+ if (props && (props->flags & DRM_MODE_PROP_BLOB)) {
+ if (!strcmp(props->name, "PATH")) {
+ path_blob = drmModeGetPropertyBlob(drmmode->fd, koutput->prop_values[i]);
+ drmModeFreeProperty(props);
+ break;
+ }
+ drmModeFreeProperty(props);
+ }
+ }
+
+ drmmode_create_name(pScrn, koutput, name, path_blob);
+
+ if (path_blob)
+ drmModeFreePropertyBlob(path_blob);
+
+ if (path_blob && dynamic) {
+ /* see if we have an output with this name already
+ and hook stuff up */
+ for (i = 0; i < xf86_config->num_output; i++) {
+ output = xf86_config->output[i];
+
+ if (strncmp(output->name, name, 32))
+ continue;
+
+ drmmode_output = output->driver_private;
+ drmmode_output->output_id = mode_res->connectors[num];
+ drmmode_output->mode_output = koutput;
+ return 1;
+ }
+ }
kencoders = calloc(sizeof(drmModeEncoderPtr), koutput->count_encoders);
if (!kencoders) {
@@ -1139,16 +1448,17 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
}
}
- /* need to do smart conversion here for compat with non-kms ATI driver */
- if (koutput->connector_type >= MS_ARRAY_SIZE(output_names))
- snprintf(name, 32, "Unknown-%d", koutput->connector_type_id - 1);
- 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 - 1);
- else
- snprintf(name, 32, "%s-%d", output_names[koutput->connector_type],
- koutput->connector_type_id - 1);
+ if (xf86IsEntityShared(pScrn->entityList[0])) {
+ if ((s = xf86GetOptValString(drmmode->Options, OPTION_ZAPHOD_HEADS))) {
+ if (!drmmode_zaphod_string_matches(pScrn, s, name))
+ goto out_free_encoders;
+ } else {
+ if (!drmmode->is_secondary && (num != 0))
+ goto out_free_encoders;
+ else if (drmmode->is_secondary && (num != 1))
+ goto out_free_encoders;
+ }
+ }
output = xf86OutputCreate(pScrn, &drmmode_output_funcs, name);
if (!output) {
@@ -1161,7 +1471,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
goto out_free_encoders;
}
- drmmode_output->output_id = drmmode->mode_res->connectors[num];
+ drmmode_output->output_id = mode_res->connectors[num];
drmmode_output->mode_output = koutput;
drmmode_output->mode_encoders = kencoders;
drmmode_output->drmmode = drmmode;
@@ -1175,7 +1485,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
output->possible_crtcs = 0x7f;
for (i = 0; i < koutput->count_encoders; i++) {
- output->possible_crtcs &= kencoders[i]->possible_crtcs;
+ output->possible_crtcs &= kencoders[i]->possible_crtcs >> crtcshift;
}
/* work out the possible clones later */
output->possible_clones = 0;
@@ -1192,7 +1502,10 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
}
}
- return;
+ if (dynamic)
+ output->randr_output = RROutputCreate(xf86ScrnToScreen(pScrn), output->name, strlen(output->name), output);
+ return 1;
+
out_free_encoders:
if (kencoders) {
for (i = 0; i < koutput->count_encoders; i++)
@@ -1201,6 +1514,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
}
drmModeFreeConnector(koutput);
+ return 0;
}
static uint32_t
@@ -1231,7 +1545,7 @@ find_clones(ScrnInfoPtr scrn, xf86OutputPtr output)
}
static void
-drmmode_clones_init(ScrnInfoPtr scrn, drmmode_ptr drmmode)
+drmmode_clones_init(ScrnInfoPtr scrn, drmmode_ptr drmmode, drmModeResPtr mode_res)
{
int i, j;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -1246,8 +1560,8 @@ drmmode_clones_init(ScrnInfoPtr scrn, drmmode_ptr drmmode)
for (j = 0; j < drmmode_output->mode_output->count_encoders; j++) {
int k;
- for (k = 0; k < drmmode->mode_res->count_encoders; k++) {
- if (drmmode->mode_res->encoders[k] ==
+ for (k = 0; k < mode_res->count_encoders; k++) {
+ if (mode_res->encoders[k] ==
drmmode_output->mode_encoders[j]->encoder_id)
drmmode_output->enc_mask |= (1 << k);
}
@@ -1422,9 +1736,13 @@ static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
Bool
drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
{
+ modesettingEntPtr ms_ent = ms_ent_priv(pScrn);
int i;
int ret;
uint64_t value = 0;
+ unsigned int crtcs_needed = 0;
+ drmModeResPtr mode_res;
+ int crtcshift;
/* check for dumb capability */
ret = drmGetCap(drmmode->fd, DRM_CAP_DUMB_BUFFER, &value);
@@ -1438,26 +1756,36 @@ drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
drmmode->scrn = pScrn;
drmmode->cpp = cpp;
- drmmode->mode_res = drmModeGetResources(drmmode->fd);
- if (!drmmode->mode_res)
+ mode_res = drmModeGetResources(drmmode->fd);
+ if (!mode_res)
return FALSE;
- xf86CrtcSetSizeRange(pScrn, 320, 200, drmmode->mode_res->max_width,
- drmmode->mode_res->max_height);
- for (i = 0; i < drmmode->mode_res->count_crtcs; i++)
+ crtcshift = ffs(ms_ent->assigned_crtcs ^ 0xffffffff) - 1;
+ for (i = 0; i < mode_res->count_connectors; i++)
+ crtcs_needed += drmmode_output_init(pScrn, drmmode, mode_res, i, FALSE,
+ crtcshift);
+
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, MS_LOGLEVEL_DEBUG,
+ "Up to %d crtcs needed for screen.\n", crtcs_needed);
+
+ xf86CrtcSetSizeRange(pScrn, 320, 200, mode_res->max_width,
+ mode_res->max_height);
+ for (i = 0; i < mode_res->count_crtcs; i++)
if (!xf86IsEntityShared(pScrn->entityList[0]) ||
- pScrn->confScreen->device->screen == i)
- drmmode_crtc_init(pScrn, drmmode, i);
+ (crtcs_needed && !(ms_ent->assigned_crtcs & (1 << i))))
+ crtcs_needed -= drmmode_crtc_init(pScrn, drmmode, mode_res, i);
- for (i = 0; i < drmmode->mode_res->count_connectors; i++)
- drmmode_output_init(pScrn, drmmode, i);
+ /* All ZaphodHeads outputs provided with matching crtcs? */
+ if (xf86IsEntityShared(pScrn->entityList[0]) && (crtcs_needed > 0))
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "%d ZaphodHeads crtcs unavailable. Some outputs will stay off.\n",
+ crtcs_needed);
/* workout clones */
- drmmode_clones_init(pScrn, drmmode);
+ drmmode_clones_init(pScrn, drmmode, mode_res);
-#if XF86_CRTC_VERSION >= 5
+ drmModeFreeResources(mode_res);
xf86ProviderSetup(pScrn, NULL, "modesetting");
-#endif
xf86InitialConfiguration(pScrn, TRUE);
@@ -1618,11 +1946,78 @@ drmmode_handle_uevents(int fd, void *closure)
drmmode_ptr drmmode = closure;
ScrnInfoPtr scrn = drmmode->scrn;
struct udev_device *dev;
+ drmModeResPtr mode_res;
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int i, j;
+ Bool found;
+ Bool changed = FALSE;
dev = udev_monitor_receive_device(drmmode->uevent_monitor);
if (!dev)
return;
+ mode_res = drmModeGetResources(drmmode->fd);
+ if (!mode_res)
+ goto out;
+
+ if (mode_res->count_crtcs != config->num_crtc) {
+ ErrorF("number of CRTCs changed - failed to handle, %d vs %d\n", mode_res->count_crtcs, config->num_crtc);
+ goto out_free_res;
+ }
+
+ /* figure out if we have gotten rid of any connectors
+ traverse old output list looking for outputs */
+ for (i = 0; i < config->num_output; i++) {
+ xf86OutputPtr output = config->output[i];
+ drmmode_output_private_ptr drmmode_output;
+
+ drmmode_output = output->driver_private;
+ found = FALSE;
+ for (j = 0; j < mode_res->count_connectors; j++) {
+ if (mode_res->connectors[j] == drmmode_output->output_id) {
+ found = TRUE;
+ break;
+ }
+ }
+ if (found)
+ continue;
+
+ drmModeFreeConnector(drmmode_output->mode_output);
+ drmmode_output->mode_output = NULL;
+ drmmode_output->output_id = -1;
+
+ changed = TRUE;
+ }
+
+ /* find new output ids we don't have outputs for */
+ for (i = 0; i < mode_res->count_connectors; i++) {
+ found = FALSE;
+
+ for (j = 0; j < config->num_output; j++) {
+ xf86OutputPtr output = config->output[j];
+ drmmode_output_private_ptr drmmode_output;
+
+ drmmode_output = output->driver_private;
+ if (mode_res->connectors[i] == drmmode_output->output_id) {
+ found = TRUE;
+ break;
+ }
+ }
+ if (found)
+ continue;
+
+ changed = TRUE;
+ drmmode_output_init(scrn, drmmode, mode_res, i, TRUE, 0);
+ }
+
+ if (changed) {
+ RRSetChanged(xf86ScrnToScreen(scrn));
+ RRTellChanged(xf86ScrnToScreen(scrn));
+ }
+
+out_free_res:
+ drmModeFreeResources(mode_res);
+out:
RRGetInfo(xf86ScrnToScreen(scrn), TRUE);
udev_device_unref(dev);
}
diff --git a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h
index 3a8959ac3..fca68a6fe 100644
--- a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h
+++ b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h
@@ -46,8 +46,6 @@ typedef struct {
typedef struct {
int fd;
unsigned fb_id;
- unsigned old_fb_id;
- drmModeResPtr mode_res;
drmModeFBPtr mode_fb;
int cpp;
ScrnInfoPtr scrn;
@@ -62,8 +60,13 @@ typedef struct {
drmmode_bo front_bo;
Bool sw_cursor;
+ /* Broken-out options. */
+ OptionInfoPtr Options;
+
Bool glamor;
Bool shadow_enable;
+ /** Is Option "PageFlip" enabled? */
+ Bool pageflip;
void *shadow_fb;
/**
@@ -80,6 +83,10 @@ typedef struct {
uint32_t triple_buffer_name;
DevPrivateKeyRec pixmapPrivateKeyRec;
+
+ Bool reverse_prime_offload_mode;
+
+ Bool is_secondary;
} drmmode_rec, *drmmode_ptr;
typedef struct {
@@ -94,7 +101,7 @@ typedef struct {
drmmode_bo rotate_bo;
unsigned rotate_fb_id;
-
+ unsigned prime_pixmap_x;
/**
* @{ MSC (vblank count) handling for the PRESENT extension.
*
@@ -106,6 +113,8 @@ typedef struct {
uint32_t msc_prev;
uint64_t msc_high;
/** @} */
+
+ Bool need_modeset;
} drmmode_crtc_private_rec, *drmmode_crtc_private_ptr;
typedef struct {
@@ -121,6 +130,7 @@ typedef struct {
drmModeConnectorPtr mode_output;
drmModeEncoderPtr *mode_encoders;
drmModePropertyBlobPtr edid_blob;
+ drmModePropertyBlobPtr tile_blob;
int dpms_enum_id;
int num_props;
drmmode_prop_ptr props;
@@ -139,6 +149,9 @@ 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);
Bool drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode);
void *drmmode_map_slave_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv);
diff --git a/xserver/hw/xfree86/drivers/modesetting/modesetting.man b/xserver/hw/xfree86/drivers/modesetting/modesetting.man
index 9cb27d728..a42da1c1f 100644
--- a/xserver/hw/xfree86/drivers/modesetting/modesetting.man
+++ b/xserver/hw/xfree86/drivers/modesetting/modesetting.man
@@ -41,6 +41,10 @@ The following driver
.B Options
are supported:
.TP
+.BI "Option \*qSWcursor\*q \*q" boolean \*q
+Selects software cursor. The default is
+.B off.
+.TP
.BI "Option \*qkmsdev\*q \*q" string \*q
The framebuffer device to use. Default: /dev/dri/card0.
.TP
@@ -50,6 +54,20 @@ Enable or disable use of the shadow framebuffer layer. Default: on.
.BI "Option \*qAccelMethod\*q \*q" string \*q
One of \*qglamor\*q or \*qnone\*q. Default: glamor
.TP
+.BI "Option \*qPageFlip\*q \*q" boolean \*q
+Enable DRI3 page flipping. The default is
+.B on.
+.TP
+.BI "Option \*qZaphodHeads\*q \*q" string \*q
+Specify the RandR output(s) to use with zaphod mode for a particular driver
+instance. If you use this option you must use this option for all instances
+of the driver.
+.br
+For example:
+.B
+Option \*qZaphodHeads\*q \*qLVDS,VGA-0\*q
+will assign xrandr outputs LVDS and VGA-0 to this instance of the driver.
+.TP
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__),
X(__miscmansuffix__)
diff --git a/xserver/hw/xfree86/drivers/modesetting/present.c b/xserver/hw/xfree86/drivers/modesetting/present.c
index 359e11316..d65c8c845 100644
--- a/xserver/hw/xfree86/drivers/modesetting/present.c
+++ b/xserver/hw/xfree86/drivers/modesetting/present.c
@@ -44,6 +44,7 @@
#include <present.h>
#include "driver.h"
+#include "drmmode_display.h"
#if 0
#define DebugPresent(x) ErrorF x
@@ -72,8 +73,11 @@ ms_present_get_ust_msc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *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 Bool
+static int
ms_flush_drm_events(ScreenPtr screen)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
@@ -86,10 +90,19 @@ ms_flush_drm_events(ScreenPtr screen)
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 TRUE;
+ 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;
- return drmHandleEvent(ms->fd, &ms->event_context) >= 0;
+ /* Otherwise return 1 to indicate that we handled an event. */
+ return 1;
}
/*
@@ -159,8 +172,13 @@ ms_present_queue_vblank(RRCrtcPtr crtc,
ret = drmWaitVBlank(ms->fd, &vbl);
if (!ret)
break;
- if (errno != EBUSY || !ms_flush_drm_events(screen))
+ /* If we hit EBUSY, then try to flush events. If we can't, then
+ * this is an error.
+ */
+ if (errno != EBUSY || ms_flush_drm_events(screen) < 0) {
+ ms_drm_abort_seq(scrn, seq);
return BadAlloc;
+ }
}
DebugPresent(("\t\tmq %lld seq %u msc %llu (hw msc %u)\n",
(long long) event_id, seq, (long long) msc,
@@ -206,6 +224,419 @@ ms_present_flush(WindowPtr window)
#endif
}
+#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.
+ *
+ * Drops the reference count on the flipdata.
+ */
+static void
+ms_present_flip_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_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,
+ (long long) msc, (long long) ust));
+
+ if (flip->on_reference_crtc) {
+ flipdata->fe_msc = msc;
+ flipdata->fe_usec = ust;
+ }
+
+ 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);
+}
+
+/*
+ * Callback for the DRM queue abort code. A flip has been aborted.
+ */
+static void
+ms_present_flip_abort(void *data)
+{
+ struct ms_crtc_pageflip *flip = data;
+ struct ms_flipdata *flipdata = flip->flipdata;
+
+ DebugPresent(("\t\tms:fa %lld c %d\n", (long long) flipdata->event->event_id, flipdata->flip_count));
+
+ 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 */
+}
+
+/*
+ * Test to see if page flipping is possible on the target crtc
+ */
+static Bool
+ms_present_check_flip(RRCrtcPtr crtc,
+ WindowPtr window,
+ PixmapPtr pixmap,
+ Bool sync_flip)
+{
+ ScreenPtr screen = window->drawable.pScreen;
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ modesettingPtr ms = modesettingPTR(scrn);
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int num_crtcs_on = 0;
+ int i;
+
+ if (!ms->drmmode.pageflip)
+ return FALSE;
+
+ if (!scrn->vtSema)
+ return FALSE;
+
+ 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;
+
+ /* Check stride, can't change that on flip */
+ if (pixmap->devKind != drmmode_bo_get_pitch(&ms->drmmode.front_bo))
+ return FALSE;
+
+ /* Make sure there's a bo we can get to */
+ /* XXX: actually do this. also...is it sufficient?
+ * if (!glamor_get_pixmap_private(pixmap))
+ * return FALSE;
+ */
+
+ return TRUE;
+}
+
+/*
+ * Queue a flip on 'crtc' to 'pixmap' at 'target_msc'. If 'sync_flip' is true,
+ * then wait for vblank. Otherwise, flip immediately
+ */
+static Bool
+ms_present_flip(RRCrtcPtr crtc,
+ uint64_t event_id,
+ uint64_t target_msc,
+ PixmapPtr pixmap,
+ Bool sync_flip)
+{
+ ScreenPtr screen = crtc->pScreen;
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ xf86CrtcPtr xf86_crtc = crtc->devPrivate;
+ drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
+ Bool ret;
+ struct ms_present_vblank_event *event;
+
+ if (!ms_present_check_flip(crtc, screen->root, pixmap, sync_flip))
+ return FALSE;
+
+ event = calloc(1, sizeof(struct ms_present_vblank_event));
+ if (!event)
+ return FALSE;
+
+ event->event_id = event_id;
+ ret = ms_do_pageflip(screen, pixmap, event, drmmode_crtc->vblank_pipe, !sync_flip);
+ if (!ret)
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR, "present flip failed\n");
+
+ return ret;
+}
+
+/*
+ * Queue a flip back to the normal frame buffer
+ */
+static void
+ms_present_unflip(ScreenPtr screen, uint64_t event_id)
+{
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ PixmapPtr pixmap = screen->GetScreenPixmap(screen);
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int i;
+ struct ms_present_vblank_event *event;
+
+ event = calloc(1, sizeof(struct ms_present_vblank_event));
+ if (!event)
+ return;
+
+ event->event_id = event_id;
+
+ if (ms_present_check_flip(NULL, screen->root, pixmap, TRUE) &&
+ ms_do_pageflip(screen, pixmap, event, -1, FALSE)) {
+ return;
+ }
+
+ for (i = 0; i < config->num_crtc; i++) {
+ xf86CrtcPtr crtc = config->crtc[i];
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+
+ if (!crtc->enabled)
+ continue;
+
+ if (drmmode_crtc->dpms_mode == DPMSModeOn)
+ crtc->funcs->set_mode_major(crtc, &crtc->mode, crtc->rotation,
+ crtc->x, crtc->y);
+ else
+ drmmode_crtc->need_modeset = TRUE;
+ }
+
+ present_event_notify(event_id, 0, 0);
+}
+#endif
+
static present_screen_info_rec ms_present_screen_info = {
.version = PRESENT_SCREEN_INFO_VERSION,
@@ -216,13 +647,24 @@ static present_screen_info_rec ms_present_screen_info = {
.flush = ms_present_flush,
.capabilities = PresentCapabilityNone,
- .check_flip = 0,
- .flip = 0,
- .unflip = 0,
+#ifdef GLAMOR
+ .check_flip = ms_present_check_flip,
+ .flip = ms_present_flip,
+ .unflip = ms_present_unflip,
+#endif
};
Bool
ms_present_screen_init(ScreenPtr screen)
{
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ modesettingPtr ms = modesettingPTR(scrn);
+ uint64_t value;
+ int ret;
+
+ ret = drmGetCap(ms->fd, DRM_CAP_ASYNC_PAGE_FLIP, &value);
+ if (ret == 0 && value == 1)
+ ms_present_screen_info.capabilities |= PresentCapabilityAsync;
+
return present_screen_init(screen, &ms_present_screen_info);
}
diff --git a/xserver/hw/xfree86/drivers/modesetting/vblank.c b/xserver/hw/xfree86/drivers/modesetting/vblank.c
index a342662a7..77e0848e7 100644
--- a/xserver/hw/xfree86/drivers/modesetting/vblank.c
+++ b/xserver/hw/xfree86/drivers/modesetting/vblank.c
@@ -50,11 +50,6 @@
static struct xorg_list ms_drm_queue;
static uint32_t ms_drm_seq;
-struct ms_pageflip {
- ScreenPtr screen;
- Bool crtc_for_msc_ust;
-};
-
static void ms_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
{
dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1;
@@ -88,7 +83,7 @@ static int ms_box_area(BoxPtr box)
return (int)(box->x2 - box->x1) * (int)(box->y2 - box->y1);
}
-static Bool
+Bool
ms_crtc_on(xf86CrtcPtr crtc)
{
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
@@ -323,6 +318,22 @@ ms_drm_abort_scrn(ScrnInfoPtr scrn)
}
}
+/**
+ * Abort by drm queue sequence number.
+ */
+void
+ms_drm_abort_seq(ScrnInfoPtr scrn, uint32_t seq)
+{
+ struct ms_drm_queue *q, *tmp;
+
+ xorg_list_for_each_entry_safe(q, tmp, &ms_drm_queue, list) {
+ if (q->seq == seq) {
+ ms_drm_abort_one(q);
+ break;
+ }
+ }
+}
+
/*
* Externally usable abort function that uses a callback to match a single
* queued entry to abort
@@ -370,7 +381,7 @@ ms_vblank_screen_init(ScreenPtr screen)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
modesettingPtr ms = modesettingPTR(scrn);
-
+ modesettingEntPtr ms_ent = ms_ent_priv(scrn);
xorg_list_init(&ms_drm_queue);
ms->event_context.version = DRM_EVENT_CONTEXT_VERSION;
@@ -381,9 +392,14 @@ ms_vblank_screen_init(ScreenPtr screen)
* feedback on every server generation, so perform the
* registration within ScreenInit and not PreInit.
*/
- AddGeneralSocket(ms->fd);
- RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
- ms_drm_wakeup_handler, screen);
+ if (ms_ent->fd_wakeup_registered != serverGeneration) {
+ AddGeneralSocket(ms->fd);
+ RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
+ ms_drm_wakeup_handler, screen);
+ ms_ent->fd_wakeup_registered = serverGeneration;
+ ms_ent->fd_wakeup_ref = 1;
+ } else
+ ms_ent->fd_wakeup_ref++;
return TRUE;
}
@@ -393,10 +409,14 @@ ms_vblank_close_screen(ScreenPtr screen)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
modesettingPtr ms = modesettingPTR(scrn);
+ modesettingEntPtr ms_ent = ms_ent_priv(scrn);
ms_drm_abort_scrn(scrn);
- RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
- ms_drm_wakeup_handler, screen);
- RemoveGeneralSocket(ms->fd);
+ if (ms_ent->fd_wakeup_registered == serverGeneration &&
+ !--ms_ent->fd_wakeup_ref) {
+ RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
+ ms_drm_wakeup_handler, screen);
+ RemoveGeneralSocket(ms->fd);
+ }
}
diff --git a/xserver/hw/xfree86/exa/Makefile.am b/xserver/hw/xfree86/exa/Makefile.am
index 1e42cdacd..ccbb305d3 100644
--- a/xserver/hw/xfree86/exa/Makefile.am
+++ b/xserver/hw/xfree86/exa/Makefile.am
@@ -6,8 +6,7 @@ libexa_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
AM_CPPFLAGS = \
$(XORG_INCS) \
- -I$(srcdir)/../../../exa \
- -I$(srcdir)/../../../miext/cw
+ -I$(srcdir)/../../../exa
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
diff --git a/xserver/hw/xfree86/exa/Makefile.in b/xserver/hw/xfree86/exa/Makefile.in
index dbf95d4b3..04ae18677 100644
--- a/xserver/hw/xfree86/exa/Makefile.in
+++ b/xserver/hw/xfree86/exa/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -285,7 +284,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -415,8 +413,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -545,8 +541,7 @@ module_LTLIBRARIES = libexa.la
libexa_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
AM_CPPFLAGS = \
$(XORG_INCS) \
- -I$(srcdir)/../../../exa \
- -I$(srcdir)/../../../miext/cw
+ -I$(srcdir)/../../../exa
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
libexa_la_SOURCES = \
diff --git a/xserver/hw/xfree86/exa/man/Makefile.in b/xserver/hw/xfree86/exa/man/Makefile.in
index f968b0087..b12b3d910 100644
--- a/xserver/hw/xfree86/exa/man/Makefile.in
+++ b/xserver/hw/xfree86/exa/man/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -213,7 +212,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -360,8 +358,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/fbdevhw/Makefile.in b/xserver/hw/xfree86/fbdevhw/Makefile.in
index ac9818698..7bb200df5 100644
--- a/xserver/hw/xfree86/fbdevhw/Makefile.in
+++ b/xserver/hw/xfree86/fbdevhw/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -288,7 +287,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -418,8 +416,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/fbdevhw/fbdevhw.c b/xserver/hw/xfree86/fbdevhw/fbdevhw.c
index 8cd207961..b50ae5ed2 100644
--- a/xserver/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/xserver/hw/xfree86/fbdevhw/fbdevhw.c
@@ -76,8 +76,14 @@ typedef struct {
/* buildin video mode */
DisplayModeRec buildin;
+ /* disable non-fatal unsupported ioctls */
+ CARD32 unsupported_ioctls;
} fbdevHWRec, *fbdevHWPtr;
+enum {
+ FBIOBLANK_UNSUPPORTED = 0,
+};
+
Bool
fbdevHWGetRec(ScrnInfoPtr pScrn)
{
@@ -116,7 +122,7 @@ fbdevHWGetFD(ScrnInfoPtr pScrn)
#if DEBUG
static void
-print_fbdev_mode(char *txt, struct fb_var_screeninfo *var)
+print_fbdev_mode(const char *txt, struct fb_var_screeninfo *var)
{
ErrorF("fbdev %s mode:\t%d %d %d %d %d %d %d %d %d %d %d:%d:%d\n",
txt, var->pixclock,
@@ -127,7 +133,7 @@ print_fbdev_mode(char *txt, struct fb_var_screeninfo *var)
}
static void
-print_xfree_mode(char *txt, DisplayModePtr mode)
+print_xfree_mode(const char *txt, DisplayModePtr mode)
{
ErrorF("xfree %s mode:\t%d %d %d %d %d %d %d %d %d\n",
txt, mode->Clock,
@@ -831,6 +837,9 @@ fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags)
if (!pScrn->vtSema)
return;
+ if (fPtr->unsupported_ioctls & (1 << FBIOBLANK_UNSUPPORTED))
+ return;
+
switch (mode) {
case DPMSModeOn:
fbmode = 0;
@@ -848,9 +857,23 @@ fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags)
return;
}
- if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *) fbmode))
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOBLANK: %s\n", strerror(errno));
+RETRY:
+ if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *) fbmode)) {
+ switch (errno) {
+ case EAGAIN:
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "FBIOBLANK: %s\n", strerror(errno));
+ break;
+ case EINTR:
+ case ERESTART:
+ goto RETRY;
+ default:
+ fPtr->unsupported_ioctls |= (1 << FBIOBLANK_UNSUPPORTED);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "FBIOBLANK: %s (Screen blanking not supported "
+ "by kernel - disabling)\n", strerror(errno));
+ }
+ }
}
Bool
@@ -863,11 +886,27 @@ fbdevHWSaveScreen(ScreenPtr pScreen, int mode)
if (!pScrn->vtSema)
return TRUE;
+ if (fPtr->unsupported_ioctls & (1 << FBIOBLANK_UNSUPPORTED))
+ return FALSE;
+
unblank = xf86IsUnblank(mode);
+RETRY:
if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *) (1 - unblank))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOBLANK: %s\n", strerror(errno));
+ switch (errno) {
+ case EAGAIN:
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "FBIOBLANK: %s\n", strerror(errno));
+ break;
+ case EINTR:
+ case ERESTART:
+ goto RETRY;
+ default:
+ fPtr->unsupported_ioctls |= (1 << FBIOBLANK_UNSUPPORTED);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "FBIOBLANK: %s (Screen blanking not supported "
+ "by kernel - disabling)\n", strerror(errno));
+ }
return FALSE;
}
diff --git a/xserver/hw/xfree86/fbdevhw/man/Makefile.in b/xserver/hw/xfree86/fbdevhw/man/Makefile.in
index 174ffd4ed..7d47eed11 100644
--- a/xserver/hw/xfree86/fbdevhw/man/Makefile.in
+++ b/xserver/hw/xfree86/fbdevhw/man/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -213,7 +212,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -360,8 +358,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/glamor_egl/Makefile.in b/xserver/hw/xfree86/glamor_egl/Makefile.in
index 46fa1d1ec..69ba6498d 100644
--- a/xserver/hw/xfree86/glamor_egl/Makefile.in
+++ b/xserver/hw/xfree86/glamor_egl/Makefile.in
@@ -78,8 +78,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -269,7 +268,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -399,8 +397,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/i2c/Makefile.in b/xserver/hw/xfree86/i2c/Makefile.in
index 90a901f0d..c7cb2d42f 100644
--- a/xserver/hw/xfree86/i2c/Makefile.in
+++ b/xserver/hw/xfree86/i2c/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -245,7 +244,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -375,8 +373,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/i2c/xf86i2c.c b/xserver/hw/xfree86/i2c/xf86i2c.c
index cf2cd0971..2a8b8df22 100644
--- a/xserver/hw/xfree86/i2c/xf86i2c.c
+++ b/xserver/hw/xfree86/i2c/xf86i2c.c
@@ -872,7 +872,7 @@ xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr ** pppI2CBus)
if (!pppI2CBus)
continue;
- *pppI2CBus = xnfrealloc(*pppI2CBus, n * sizeof(I2CBusPtr));
+ *pppI2CBus = xnfreallocarray(*pppI2CBus, n, sizeof(I2CBusPtr));
(*pppI2CBus)[n - 1] = pI2CBus;
}
diff --git a/xserver/hw/xfree86/int10/Makefile.in b/xserver/hw/xfree86/int10/Makefile.in
index dc3afb49e..3a43e119b 100644
--- a/xserver/hw/xfree86/int10/Makefile.in
+++ b/xserver/hw/xfree86/int10/Makefile.in
@@ -59,8 +59,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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,7 +263,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -394,8 +392,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/loader/Makefile.am b/xserver/hw/xfree86/loader/Makefile.am
index a658ca50f..9218cab83 100644
--- a/xserver/hw/xfree86/loader/Makefile.am
+++ b/xserver/hw/xfree86/loader/Makefile.am
@@ -1,6 +1,6 @@
noinst_LTLIBRARIES = libloader.la
-AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../parser -I$(top_srcdir)/miext/cw \
+AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../parser \
-I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \
-I$(srcdir)/../ramdac -I$(srcdir)/../dri -I$(srcdir)/../dri2
diff --git a/xserver/hw/xfree86/loader/Makefile.in b/xserver/hw/xfree86/loader/Makefile.in
index 47c105d97..bc09506d0 100644
--- a/xserver/hw/xfree86/loader/Makefile.in
+++ b/xserver/hw/xfree86/loader/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -216,7 +215,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -346,8 +344,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -472,7 +468,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = libloader.la
-AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../parser -I$(top_srcdir)/miext/cw \
+AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../parser \
-I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \
-I$(srcdir)/../ramdac -I$(srcdir)/../dri -I$(srcdir)/../dri2
diff --git a/xserver/hw/xfree86/loader/loadmod.c b/xserver/hw/xfree86/loader/loadmod.c
index fdf5bd8c9..73dc1b8dc 100644
--- a/xserver/hw/xfree86/loader/loadmod.c
+++ b/xserver/hw/xfree86/loader/loadmod.c
@@ -142,7 +142,7 @@ InitPathList(const char *path)
if (addslash)
len++;
save = list;
- list = realloc(list, (n + 2) * sizeof(char *));
+ list = reallocarray(list, n + 2, sizeof(char *));
if (!list) {
if (save) {
save[n] = NULL;
@@ -244,7 +244,7 @@ InitPatterns(const char **patternlist)
for (i = 0, s = patternlist; *s; i++, s++)
if (*s == DEFAULT_LIST)
i += sizeof(stdPatterns) / sizeof(stdPatterns[0]) - 1 - 1;
- patterns = malloc((i + 1) * sizeof(PatternRec));
+ patterns = xallocarray(i + 1, sizeof(PatternRec));
if (!patterns) {
return NULL;
}
@@ -323,7 +323,7 @@ InitSubdirs(const char **subdirlist)
}
}
}
- subdirs = malloc((i * 2 + 1) * sizeof(char *));
+ subdirs = xallocarray(i * 2 + 1, sizeof(char *));
if (!subdirs) {
free(tmp_subdirlist);
return NULL;
@@ -530,8 +530,8 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
match[1].rm_so != -1) {
len = match[1].rm_eo - match[1].rm_so;
save = listing;
- listing = realloc(listing,
- (n + 2) * sizeof(char *));
+ listing = reallocarray(listing, n + 2,
+ sizeof(char *));
if (!listing) {
if (save) {
save[n] = NULL;
diff --git a/xserver/hw/xfree86/man/Makefile.in b/xserver/hw/xfree86/man/Makefile.in
index 2816ca943..028613db8 100644
--- a/xserver/hw/xfree86/man/Makefile.in
+++ b/xserver/hw/xfree86/man/Makefile.in
@@ -60,8 +60,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -216,7 +215,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -363,8 +361,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/man/Xorg.man b/xserver/hw/xfree86/man/Xorg.man
index 08fb3651e..ddb6af8c7 100644
--- a/xserver/hw/xfree86/man/Xorg.man
+++ b/xserver/hw/xfree86/man/Xorg.man
@@ -44,7 +44,8 @@ byte-streams:
.I "Local"
On most platforms, the "Local" connection type is a UNIX-domain socket.
On some System V platforms, the "local" connection types also include
-STREAMS pipes, named pipes, and some other mechanisms.
+STREAMS pipes, named pipes, and some other mechanisms. See the
+"LOCAL CONNECTIONS" section of X(__miscmansuffix__) for details.
.TP 4
.I TCP/IP
.B Xorg
@@ -52,61 +53,10 @@ listens on port
.RI 6000+ n ,
where
.I n
-is the display number. This connection type can be disabled with the
-.B \-nolisten
+is the display number. This connection type is usually disabled by default,
+but may be enabled with the
+.B \-listen
option (see the Xserver(1) man page for details).
-.SH "ENVIRONMENT VARIABLES"
-For operating systems that support local connections other than Unix
-Domain sockets (SVR3 and SVR4), there is a compiled-in list specifying
-the order in which local connections should be attempted. This list
-can be overridden by the
-.I XLOCAL
-environment variable described below. If the display name indicates a
-best-choice connection should be made (e.g.
-.BR :0.0 ),
-each connection mechanism is tried until a connection succeeds or no
-more mechanisms are available. Note: for these OSs, the Unix Domain
-socket connection is treated differently from the other local connection
-types. To use it the connection must be made to
-.BR unix:0.0 .
-.PP
-The
-.I XLOCAL
-environment variable should contain a list of one more
-more of the following:
-.PP
-.RS 8
-.nf
-NAMED
-PTS
-SCO
-ISC
-.fi
-.RE
-.PP
-which represent SVR4 Named Streams pipe, Old-style USL Streams pipe,
-SCO XSight Streams pipe, and ISC Streams pipe, respectively. You can
-select a single mechanism (e.g.
-.IR XLOCAL=NAMED ),
-or an ordered list (e.g. \fIXLOCAL="NAMED:PTS:SCO"\fP).
-his variable overrides the compiled-in defaults. For SVR4 it is
-recommended that
-.I NAMED
-be the first preference connection. The default setting is
-.IR PTS:NAMED:ISC:SCO .
-.PP
-To globally override the compiled-in defaults, you should define (and
-export if using
-.B sh
-or
-.BR ksh )
-.I XLOCAL
-globally. If you use startx(1) or xinit(1), the definition should be
-at the top of your
-.I .xinitrc
-file. If you use xdm(1), the definitions should be early on in the
-.I __projectroot__/lib/X11/xdm/Xsession
-script.
.SH OPTIONS
.B Xorg
supports several mechanisms for supplying/obtaining configuration and
@@ -269,9 +219,9 @@ initialisations that require super-user privileges. Only root can use
this option.
.TP 8
.B \-keeptty
-Prevent the server from detaching its initial controlling terminal.
-This option is only useful when debugging the server. Not all platforms
-support (or can use) this option.
+Prevent the server from detaching its initial controlling terminal. If you
+want to use systemd-logind integration you must specify this option.
+Not all platforms support (or can use) this option.
.TP 8
.BI \-keyboard " keyboard-name"
Use the xorg.conf(__filemansuffix__) file
diff --git a/xserver/hw/xfree86/man/Xorg.wrap.man b/xserver/hw/xfree86/man/Xorg.wrap.man
index 11090f1f4..f3f30a6c4 100644
--- a/xserver/hw/xfree86/man/Xorg.wrap.man
+++ b/xserver/hw/xfree86/man/Xorg.wrap.man
@@ -55,7 +55,7 @@ The default is \fIconsole\fP.
\fBneeds_root_rights\fP = \fIyes\fP|\fIno\fP|\fIauto\fP
Configure if the wrapper should drop its elevated (root) rights before starting
the X server. Use \fIyes\fP to force execution as root, \fIno\fP to force
-execution with all suid rights dropped, and \fIauto\fP to letter the wrapper
+execution with all suid rights dropped, and \fIauto\fP to let the wrapper
auto-detect. The default is \fIauto\fP.
.PP
When auto-detecting the wrapper will drop rights if kms graphics are available
diff --git a/xserver/hw/xfree86/man/xorg.conf.man b/xserver/hw/xfree86/man/xorg.conf.man
index d26c3cc4d..08eb7a93a 100644
--- a/xserver/hw/xfree86/man/xorg.conf.man
+++ b/xserver/hw/xfree86/man/xorg.conf.man
@@ -621,6 +621,10 @@ It is only enabled for screens that have the
.B \*qDPMS\*q
option set (see the MONITOR section below).
.TP 7
+.BI "Option \*qMaxClients\*q \*q" integer \*q
+Set the maximum number of clients allowed to connect to the X server.
+Acceptable values are 64, 128, 256 or 512.
+.TP 7
.BI "Option \*qPixmap\*q \*q" bpp \*q
This sets the pixmap format to use for depth 24.
Allowed values for
@@ -1906,6 +1910,7 @@ sections have the following format:
.B "Section \*qScreen\*q"
.BI " Identifier \*q" name \*q
.BI " Device \*q" devid \*q
+.BI " GPUDevice \*q" devid \*q
.BI " Monitor \*q" monid \*q
.I " entries"
.I " ..."
@@ -1949,6 +1954,18 @@ of a
.B Device
section in the config file.
.TP 7
+.BI "GPUDevice \*q" device\-id \*q
+This entry specifies the
+.B Device
+section to be used as a secondary GPU device for this screen. When multiple graphics cards are
+present, this is what ties a specific secondary card to a screen. The
+.I device\-id
+must match the
+.B Identifier
+of a
+.B Device
+section in the config file. This can be specified up to 4 times for a single screen.
+.TP 7
.BI "Monitor \*q" monitor\-id \*q
specifies which monitor description is to be used for this screen.
If a
diff --git a/xserver/hw/xfree86/modes/Makefile.in b/xserver/hw/xfree86/modes/Makefile.in
index 42ea6d2ee..c02b859eb 100644
--- a/xserver/hw/xfree86/modes/Makefile.in
+++ b/xserver/hw/xfree86/modes/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -251,7 +250,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -381,8 +379,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/modes/xf86Crtc.c b/xserver/hw/xfree86/modes/xf86Crtc.c
index 9d592a7eb..6091b5e5b 100644
--- a/xserver/hw/xfree86/modes/xf86Crtc.c
+++ b/xserver/hw/xfree86/modes/xf86Crtc.c
@@ -118,7 +118,7 @@ xf86CrtcCreate(ScrnInfoPtr scrn, const xf86CrtcFuncsRec * funcs)
/* Preallocate gamma at a sensible size. */
crtc->gamma_size = 256;
- crtc->gamma_red = malloc(3 * crtc->gamma_size * sizeof(CARD16));
+ crtc->gamma_red = xallocarray(crtc->gamma_size, 3 * sizeof(CARD16));
if (!crtc->gamma_red) {
free(crtc);
return NULL;
@@ -127,10 +127,10 @@ xf86CrtcCreate(ScrnInfoPtr scrn, const xf86CrtcFuncsRec * funcs)
crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size;
if (xf86_config->crtc)
- crtcs = realloc(xf86_config->crtc,
- (xf86_config->num_crtc + 1) * sizeof(xf86CrtcPtr));
+ crtcs = reallocarray(xf86_config->crtc,
+ xf86_config->num_crtc + 1, sizeof(xf86CrtcPtr));
else
- crtcs = malloc((xf86_config->num_crtc + 1) * sizeof(xf86CrtcPtr));
+ crtcs = xallocarray(xf86_config->num_crtc + 1, sizeof(xf86CrtcPtr));
if (!crtcs) {
free(crtc->gamma_red);
free(crtc);
@@ -368,6 +368,12 @@ xf86CrtcSetModeTransform(xf86CrtcPtr crtc, DisplayModePtr mode,
xf86CrtcSetScreenSubpixelOrder(scrn->pScreen);
if (scrn->ModeSet)
scrn->ModeSet(scrn);
+
+ /* Make sure the HW cursor is hidden if it's supposed to be, in case
+ * it was hidden while the CRTC was disabled
+ */
+ if (!xf86_config->cursor_on)
+ xf86_hide_cursors(scrn);
}
else {
crtc->x = saved_x;
@@ -620,11 +626,12 @@ xf86OutputCreate(ScrnInfoPtr scrn,
}
if (xf86_config->output)
- outputs = realloc(xf86_config->output,
- (xf86_config->num_output +
- 1) * sizeof(xf86OutputPtr));
+ outputs = reallocarray(xf86_config->output,
+ xf86_config->num_output + 1,
+ sizeof(xf86OutputPtr));
else
- outputs = malloc((xf86_config->num_output + 1) * sizeof(xf86OutputPtr));
+ outputs = xallocarray(xf86_config->num_output + 1,
+ sizeof(xf86OutputPtr));
if (!outputs) {
free(output);
return NULL;
@@ -942,7 +949,7 @@ xf86PickCrtcs(ScrnInfoPtr scrn,
if (modes[n] == NULL)
return best_score;
- crtcs = malloc(config->num_output * sizeof(xf86CrtcPtr));
+ crtcs = xallocarray(config->num_output, sizeof(xf86CrtcPtr));
if (!crtcs)
return best_score;
@@ -1123,6 +1130,15 @@ xf86InitialOutputPositions(ScrnInfoPtr scrn, DisplayModePtr * modes)
int o;
int min_x, min_y;
+ /* check for initial right-of heuristic */
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ if (output->initial_x || output->initial_y)
+ return TRUE;
+ }
+
for (o = 0; o < config->num_output; o++) {
xf86OutputPtr output = config->output[o];
@@ -2102,6 +2118,118 @@ bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
return match;
}
+static int
+numEnabledOutputs(xf86CrtcConfigPtr config, Bool *enabled)
+{
+ int i = 0, p;
+
+ for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ;
+
+ return i;
+}
+
+static Bool
+xf86TargetRightOf(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+ DisplayModePtr *modes, Bool *enabled,
+ int width, int height)
+{
+ int o;
+ int w = 0;
+ Bool has_tile = FALSE;
+ uint32_t configured_outputs;
+
+ if (scrn->preferClone)
+ return FALSE;
+
+ if (numEnabledOutputs(config, enabled) < 2)
+ return FALSE;
+
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ DisplayModePtr mode =
+ xf86OutputHasPreferredMode(config->output[o], width, height);
+
+ if (!mode)
+ return FALSE;
+
+ w += mode->HDisplay;
+ }
+
+ if (w > width)
+ return FALSE;
+
+ w = 0;
+ configured_outputs = 0;
+
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ DisplayModePtr mode =
+ xf86OutputHasPreferredMode(config->output[o], width, height);
+
+ if (configured_outputs & (1 << o))
+ continue;
+
+ if (config->output[o]->tile_info.group_id) {
+ has_tile = TRUE;
+ continue;
+ }
+
+ config->output[o]->initial_x = w;
+ w += mode->HDisplay;
+
+ configured_outputs |= (1 << o);
+ modes[o] = mode;
+ }
+
+ if (has_tile) {
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ int ht, vt, ot;
+ int add_x, cur_x = w;
+ struct xf86CrtcTileInfo *tile_info = &config->output[o]->tile_info, *this_tile;
+ if (configured_outputs & (1 << o))
+ continue;
+ if (!tile_info->group_id)
+ continue;
+
+ if (tile_info->tile_h_loc != 0 && tile_info->tile_v_loc != 0)
+ continue;
+
+ for (ht = 0; ht < tile_info->num_h_tile; ht++) {
+ int cur_y = 0;
+ add_x = 0;
+ for (vt = 0; vt < tile_info->num_v_tile; vt++) {
+
+ for (ot = -1; nextEnabledOutput(config, enabled, &ot); ) {
+
+ DisplayModePtr mode =
+ xf86OutputHasPreferredMode(config->output[ot], width, height);
+ if (!config->output[ot]->tile_info.group_id)
+ continue;
+
+ this_tile = &config->output[ot]->tile_info;
+ if (this_tile->group_id != tile_info->group_id)
+ continue;
+
+ if (this_tile->tile_h_loc != ht ||
+ this_tile->tile_v_loc != vt)
+ continue;
+
+ config->output[ot]->initial_x = cur_x;
+ config->output[ot]->initial_y = cur_y;
+
+ if (vt == 0)
+ add_x = this_tile->tile_h_size;
+ cur_y += this_tile->tile_v_size;
+ configured_outputs |= (1 << ot);
+ modes[ot] = mode;
+ }
+ }
+ cur_x += add_x;
+ }
+ w = cur_x;
+ }
+ }
+ return TRUE;
+}
+
static Bool
xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
DisplayModePtr * modes, Bool *enabled,
@@ -2178,14 +2306,10 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
*/
if (!ret)
do {
- int i = 0;
float aspect = 0.0;
DisplayModePtr a = NULL, b = NULL;
- /* count the number of enabled outputs */
- for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++);
-
- if (i != 1)
+ if (numEnabledOutputs(config, enabled) != 1)
break;
p = -1;
@@ -2334,7 +2458,7 @@ xf86CrtcSetInitialGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green,
int i, size = 256;
CARD16 *red, *green, *blue;
- red = malloc(3 * size * sizeof(CARD16));
+ red = xallocarray(size, 3 * sizeof(CARD16));
green = red + size;
blue = green + size;
@@ -2491,6 +2615,8 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
else {
if (xf86TargetUserpref(scrn, config, modes, enabled, width, height))
xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n");
+ else if (xf86TargetRightOf(scrn, config, modes, enabled, width, height))
+ xf86DrvMsg(i, X_INFO, "Using spanning desktop for initial modes\n");
else if (xf86TargetPreferred
(scrn, config, modes, enabled, width, height))
xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n");
@@ -2510,9 +2636,11 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
"Output %s enabled but has no modes\n",
config->output[o]->name);
else
- xf86DrvMsg(scrn->scrnIndex, X_INFO,
- "Output %s using initial mode %s\n",
- config->output[o]->name, modes[o]->name);
+ xf86DrvMsg (scrn->scrnIndex, X_INFO,
+ "Output %s using initial mode %s +%d+%d\n",
+ config->output[o]->name, modes[o]->name,
+ config->output[o]->initial_x,
+ config->output[o]->initial_y);
}
/*
@@ -2999,6 +3127,12 @@ xf86DisableUnusedFunctions(ScrnInfoPtr pScrn)
xf86_crtc_notify(pScrn->pScreen);
if (pScrn->ModeSet)
pScrn->ModeSet(pScrn);
+ if (pScrn->pScreen) {
+ if (pScrn->pScreen->isGPU)
+ xf86CursorResetCursor(pScrn->pScreen->current_master);
+ else
+ xf86CursorResetCursor(pScrn->pScreen);
+ }
}
#ifdef RANDR_12_INTERFACE
@@ -3026,6 +3160,27 @@ xf86OutputSetEDIDProperty(xf86OutputPtr output, void *data, int data_len)
}
}
+#define TILE_ATOM_NAME "TILE"
+/* changing this in the future could be tricky as people may hardcode 8 */
+#define TILE_PROP_NUM_ITEMS 8
+static void
+xf86OutputSetTileProperty(xf86OutputPtr output)
+{
+ Atom tile_atom = MakeAtom(TILE_ATOM_NAME, sizeof(TILE_ATOM_NAME) - 1, TRUE);
+
+ /* This may get called before the RandR resources have been created */
+ if (output->randr_output == NULL)
+ return;
+
+ if (output->tile_info.group_id != 0) {
+ RRChangeOutputProperty(output->randr_output, tile_atom, XA_INTEGER, 32,
+ PropModeReplace, TILE_PROP_NUM_ITEMS, (uint32_t *)&output->tile_info, FALSE, TRUE);
+ }
+ else {
+ RRDeleteOutputProperty(output->randr_output, tile_atom);
+ }
+}
+
#endif
/* Pull out a phyiscal size from a detailed timing if available. */
@@ -3071,6 +3226,38 @@ handle_detailed_physical_size(struct detailed_monitor_section
}
}
+Bool
+xf86OutputParseKMSTile(const char *tile_data, int tile_length,
+ struct xf86CrtcTileInfo *tile_info)
+{
+ int ret;
+
+ ret = sscanf(tile_data, "%d:%d:%d:%d:%d:%d:%d:%d",
+ &tile_info->group_id,
+ &tile_info->flags,
+ &tile_info->num_h_tile,
+ &tile_info->num_v_tile,
+ &tile_info->tile_h_loc,
+ &tile_info->tile_v_loc,
+ &tile_info->tile_h_size,
+ &tile_info->tile_v_size);
+ if (ret != 8)
+ return FALSE;
+ return TRUE;
+}
+
+void
+xf86OutputSetTile(xf86OutputPtr output, struct xf86CrtcTileInfo *tile_info)
+{
+ if (tile_info)
+ output->tile_info = *tile_info;
+ else
+ memset(&output->tile_info, 0, sizeof(output->tile_info));
+#ifdef RANDR_12_INTERFACE
+ xf86OutputSetTileProperty(output);
+#endif
+}
+
/**
* Set the EDID information for the specified output
*/
diff --git a/xserver/hw/xfree86/modes/xf86Crtc.h b/xserver/hw/xfree86/modes/xf86Crtc.h
index 54b6e5cd7..8b0160845 100644
--- a/xserver/hw/xfree86/modes/xf86Crtc.h
+++ b/xserver/hw/xfree86/modes/xf86Crtc.h
@@ -70,6 +70,17 @@ typedef enum _xf86OutputStatus {
XF86OutputStatusUnknown
} xf86OutputStatus;
+struct xf86CrtcTileInfo {
+ uint32_t group_id;
+ uint32_t flags;
+ uint32_t num_h_tile;
+ uint32_t num_v_tile;
+ uint32_t tile_h_loc;
+ uint32_t tile_v_loc;
+ uint32_t tile_h_size;
+ uint32_t tile_v_size;
+};
+
typedef struct _xf86CrtcFuncs {
/**
* Turns the crtc on/off, or sets intermediate power levels if available.
@@ -226,7 +237,7 @@ typedef struct _xf86CrtcFuncs {
} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
-#define XF86_CRTC_VERSION 5
+#define XF86_CRTC_VERSION 6
struct _xf86Crtc {
/**
@@ -500,7 +511,7 @@ typedef struct _xf86OutputFuncs {
(*destroy) (xf86OutputPtr output);
} xf86OutputFuncsRec, *xf86OutputFuncsPtr;
-#define XF86_OUTPUT_VERSION 2
+#define XF86_OUTPUT_VERSION 3
struct _xf86Output {
/**
@@ -615,6 +626,8 @@ struct _xf86Output {
BoxRec initialTotalArea;
BoxRec initialTrackingArea;
INT16 initialBorder[4];
+
+ struct xf86CrtcTileInfo tile_info;
};
typedef struct _xf86ProviderFuncs {
@@ -883,6 +896,15 @@ extern _X_EXPORT void
xf86OutputSetEDID(xf86OutputPtr output, xf86MonPtr edid_mon);
/**
+ * Set the TILE information for the specified output
+ */
+extern _X_EXPORT void
+xf86OutputSetTile(xf86OutputPtr output, struct xf86CrtcTileInfo *tile_info);
+
+extern _X_EXPORT Bool
+xf86OutputParseKMSTile(const char *tile_data, int tile_length, struct xf86CrtcTileInfo *tile_info);
+
+/**
* Return the list of modes supported by the EDID information
* stored in 'output'
*/
diff --git a/xserver/hw/xfree86/modes/xf86Cursors.c b/xserver/hw/xfree86/modes/xf86Cursors.c
index 379a27a76..5df1ab73a 100644
--- a/xserver/hw/xfree86/modes/xf86Cursors.c
+++ b/xserver/hw/xfree86/modes/xf86Cursors.c
@@ -258,9 +258,7 @@ xf86_crtc_convert_cursor_to_argb(xf86CrtcPtr crtc, unsigned char *src)
CARD32 bits;
const Rotation rotation = xf86_crtc_cursor_rotation(crtc);
-#ifdef ARGB_CURSOR
crtc->cursor_argb = FALSE;
-#endif
for (y = 0; y < cursor_info->MaxHeight; y++)
for (x = 0; x < cursor_info->MaxWidth; x++) {
@@ -458,9 +456,7 @@ xf86_crtc_load_cursor_image(xf86CrtcPtr crtc, CARD8 *src)
CARD8 *cursor_image;
const Rotation rotation = xf86_crtc_cursor_rotation(crtc);
-#ifdef ARGB_CURSOR
crtc->cursor_argb = FALSE;
-#endif
if (rotation == RR_Rotate_0)
cursor_image = src;
@@ -519,6 +515,7 @@ xf86_use_hw_cursor(ScreenPtr screen, CursorPtr cursor)
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
+ int c;
cursor = RefCursor(cursor);
if (xf86_config->cursor)
@@ -529,6 +526,16 @@ xf86_use_hw_cursor(ScreenPtr screen, CursorPtr cursor)
cursor->bits->height > cursor_info->MaxHeight)
return FALSE;
+ for (c = 0; c < xf86_config->num_crtc; c++) {
+ xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+ if (!crtc->enabled)
+ continue;
+
+ if (crtc->transformPresent)
+ return FALSE;
+ }
+
return TRUE;
}
@@ -539,19 +546,13 @@ xf86_use_hw_cursor_argb(ScreenPtr screen, CursorPtr cursor)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
- cursor = RefCursor(cursor);
- if (xf86_config->cursor)
- FreeCursor(xf86_config->cursor, None);
- xf86_config->cursor = cursor;
+ if (!xf86_use_hw_cursor(screen, cursor))
+ return FALSE;
/* Make sure ARGB support is available */
if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0)
return FALSE;
- if (cursor->bits->width > cursor_info->MaxWidth ||
- cursor->bits->height > cursor_info->MaxHeight)
- return FALSE;
-
return TRUE;
}
@@ -632,12 +633,10 @@ xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags)
cursor_info->HideCursor = xf86_hide_cursors;
cursor_info->ShowCursor = xf86_show_cursors;
cursor_info->UseHWCursor = xf86_use_hw_cursor;
-#ifdef ARGB_CURSOR
if (flags & HARDWARE_CURSOR_ARGB) {
cursor_info->UseHWCursorARGB = xf86_use_hw_cursor_argb;
cursor_info->LoadCursorARGBCheck = xf86_load_cursor_argb;
}
-#endif
xf86_config->cursor = NULL;
xf86_hide_cursors(scrn);
@@ -691,11 +690,9 @@ xf86_reload_cursors(ScreenPtr screen)
void *src =
dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey,
screen);
-#ifdef ARGB_CURSOR
if (cursor->bits->argb && xf86DriverHasLoadCursorARGB(cursor_info))
xf86DriverLoadCursorARGB(cursor_info, cursor);
else if (src)
-#endif
xf86DriverLoadCursorImage(cursor_info, src);
x += scrn->frameX0 + cursor_screen_priv->HotX;
diff --git a/xserver/hw/xfree86/modes/xf86DiDGA.c b/xserver/hw/xfree86/modes/xf86DiDGA.c
index 3f1a3309f..645727441 100644
--- a/xserver/hw/xfree86/modes/xf86DiDGA.c
+++ b/xserver/hw/xfree86/modes/xf86DiDGA.c
@@ -60,7 +60,7 @@ xf86_dga_get_modes(ScreenPtr pScreen)
if (!num)
return FALSE;
- modes = malloc(num * sizeof(DGAModeRec));
+ modes = xallocarray(num, sizeof(DGAModeRec));
if (!modes)
return FALSE;
diff --git a/xserver/hw/xfree86/modes/xf86RandR12.c b/xserver/hw/xfree86/modes/xf86RandR12.c
index 81b679dda..622f4cde4 100644
--- a/xserver/hw/xfree86/modes/xf86RandR12.c
+++ b/xserver/hw/xfree86/modes/xf86RandR12.c
@@ -1054,7 +1054,7 @@ xf86RandR12CrtcNotify(RRCrtcPtr randr_crtc)
DisplayModePtr mode = &crtc->mode;
Bool ret;
- randr_outputs = malloc(config->num_output * sizeof(RROutputPtr));
+ randr_outputs = xallocarray(config->num_output, sizeof(RROutputPtr));
if (!randr_outputs)
return FALSE;
x = crtc->x;
@@ -1146,7 +1146,7 @@ xf86RandR12CrtcSet(ScreenPtr pScreen,
if (!crtc->scrn->vtSema)
return FALSE;
- save_crtcs = malloc(config->num_output * sizeof(xf86CrtcPtr));
+ save_crtcs = xallocarray(config->num_output, sizeof(xf86CrtcPtr));
if ((randr_mode != NULL) != crtc->enabled)
changed = TRUE;
else if (randr_mode && !xf86RandRModeMatches(randr_mode, &crtc->mode))
@@ -1251,9 +1251,8 @@ xf86RandR12CrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc)
if (randr_crtc->gammaSize != crtc->gamma_size) {
CARD16 *tmp_ptr;
- tmp_ptr =
- realloc(crtc->gamma_red,
- 3 * randr_crtc->gammaSize * sizeof(CARD16));
+ tmp_ptr = reallocarray(crtc->gamma_red,
+ randr_crtc->gammaSize, 3 * sizeof(CARD16));
if (!tmp_ptr)
return FALSE;
crtc->gamma_red = tmp_ptr;
@@ -1294,9 +1293,8 @@ xf86RandR12CrtcGetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc)
if (randr_crtc->gammaSize != crtc->gamma_size) {
CARD16 *tmp_ptr;
- tmp_ptr =
- realloc(randr_crtc->gammaRed,
- 3 * crtc->gamma_size * sizeof(CARD16));
+ tmp_ptr = reallocarray(randr_crtc->gammaRed,
+ crtc->gamma_size, 3 * sizeof(CARD16));
if (!tmp_ptr)
return FALSE;
randr_crtc->gammaRed = tmp_ptr;
@@ -1390,7 +1388,7 @@ xf86RROutputSetModes(RROutputPtr randr_output, DisplayModePtr modes)
nmode++;
if (nmode) {
- rrmodes = malloc(nmode * sizeof(RRModePtr));
+ rrmodes = xallocarray(nmode, sizeof(RRModePtr));
if (!rrmodes)
return FALSE;
@@ -1445,8 +1443,8 @@ xf86RandR12SetInfo12(ScreenPtr pScreen)
int o, c, l;
int nclone;
- clones = malloc(config->num_output * sizeof(RROutputPtr));
- crtcs = malloc(config->num_crtc * sizeof(RRCrtcPtr));
+ clones = xallocarray(config->num_output, sizeof(RROutputPtr));
+ crtcs = xallocarray(config->num_crtc, sizeof(RRCrtcPtr));
for (o = 0; o < config->num_output; o++) {
xf86OutputPtr output = config->output[o];
@@ -1560,6 +1558,70 @@ xf86RandR12CreateObjects12(ScreenPtr pScreen)
return TRUE;
}
+static void
+xf86RandR12CreateMonitors(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int o, ot;
+ int ht, vt;
+ int ret;
+ char buf[25];
+
+ for (o = 0; o < config->num_output; o++) {
+ xf86OutputPtr output = config->output[o];
+ struct xf86CrtcTileInfo *tile_info = &output->tile_info, *this_tile;
+ RRMonitorPtr monitor;
+ int output_num, num_outputs;
+ if (!tile_info->group_id)
+ continue;
+
+ if (tile_info->tile_h_loc ||
+ tile_info->tile_v_loc)
+ continue;
+
+ num_outputs = tile_info->num_h_tile * tile_info->num_v_tile;
+
+ monitor = RRMonitorAlloc(num_outputs);
+ if (!monitor)
+ return;
+ monitor->pScreen = pScreen;
+ snprintf(buf, 25, "Auto-Monitor-%d", tile_info->group_id);
+ monitor->name = MakeAtom(buf, strlen(buf), TRUE);
+ monitor->primary = 0;
+ monitor->automatic = TRUE;
+ memset(&monitor->geometry.box, 0, sizeof(monitor->geometry.box));
+
+ output_num = 0;
+ for (ht = 0; ht < tile_info->num_h_tile; ht++) {
+ for (vt = 0; vt < tile_info->num_v_tile; vt++) {
+
+ for (ot = 0; ot < config->num_output; ot++) {
+ this_tile = &config->output[ot]->tile_info;
+
+ if (this_tile->group_id != tile_info->group_id)
+ continue;
+
+ if (this_tile->tile_h_loc != ht ||
+ this_tile->tile_v_loc != vt)
+ continue;
+
+ monitor->outputs[output_num] = config->output[ot]->randr_output->id;
+ output_num++;
+
+ }
+
+ }
+ }
+
+ ret = RRMonitorAdd(serverClient, pScreen, monitor);
+ if (ret) {
+ RRMonitorFree(monitor);
+ return;
+ }
+ }
+}
+
static Bool
xf86RandR12CreateScreenResources12(ScreenPtr pScreen)
{
@@ -1575,6 +1637,8 @@ xf86RandR12CreateScreenResources12(ScreenPtr pScreen)
RRScreenSetSizeRange(pScreen, config->minWidth, config->minHeight,
config->maxWidth, config->maxHeight);
+
+ xf86RandR12CreateMonitors(pScreen);
return TRUE;
}
@@ -1785,13 +1849,13 @@ xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen,
if (provider->output_source == source_provider)
return TRUE;
- SetRootClip(source_provider->pScreen, FALSE);
+ SetRootClip(source_provider->pScreen, ROOT_CLIP_NONE);
DetachUnboundGPU(pScreen);
AttachOutputGPU(source_provider->pScreen, pScreen);
provider->output_source = source_provider;
- SetRootClip(source_provider->pScreen, TRUE);
+ SetRootClip(source_provider->pScreen, ROOT_CLIP_FULL);
return TRUE;
}
diff --git a/xserver/hw/xfree86/modes/xf86Rotate.c b/xserver/hw/xfree86/modes/xf86Rotate.c
index 9c00a443f..4aa8f8d82 100644
--- a/xserver/hw/xfree86/modes/xf86Rotate.c
+++ b/xserver/hw/xfree86/modes/xf86Rotate.c
@@ -43,12 +43,6 @@
#include "X11/extensions/dpmsconst.h"
#include "X11/Xatom.h"
-/* borrowed from composite extension, move to Render and publish? */
-
-#define F(x) IntToxFixed(x)
-
-#define toF(x) ((float) (x) / 65536.0f)
-
static void
xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, RegionPtr region)
{
@@ -366,6 +360,8 @@ xf86CrtcRotate(xf86CrtcPtr crtc)
RRTransformPtr transform = NULL;
Bool damage = FALSE;
+ if (pScreen->isGPU)
+ return TRUE;
if (crtc->transformPresent)
transform = &crtc->transform;
diff --git a/xserver/hw/xfree86/os-support/Makefile.in b/xserver/hw/xfree86/os-support/Makefile.in
index 1841c625c..c5d670217 100644
--- a/xserver/hw/xfree86/os-support/Makefile.in
+++ b/xserver/hw/xfree86/os-support/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -280,7 +279,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -410,8 +408,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/os-support/bsd/Makefile.in b/xserver/hw/xfree86/os-support/bsd/Makefile.in
index 10279dd04..222ce4763 100644
--- a/xserver/hw/xfree86/os-support/bsd/Makefile.in
+++ b/xserver/hw/xfree86/os-support/bsd/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -248,7 +247,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -378,8 +376,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/os-support/bus/Makefile.in b/xserver/hw/xfree86/os-support/bus/Makefile.in
index d5911cc93..711552816 100644
--- a/xserver/hw/xfree86/os-support/bus/Makefile.in
+++ b/xserver/hw/xfree86/os-support/bus/Makefile.in
@@ -61,8 +61,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -254,7 +253,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -384,8 +382,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/os-support/bus/Sbus.c b/xserver/hw/xfree86/os-support/bus/Sbus.c
index 16ce5b58a..86b4d685a 100644
--- a/xserver/hw/xfree86/os-support/bus/Sbus.c
+++ b/xserver/hw/xfree86/os-support/bus/Sbus.c
@@ -440,7 +440,7 @@ sparcPromAssignNodes(void)
for (i = 0, j = 0; i < 32; i++)
if (devicePtrs[i] && devicePtrs[i]->fbNum == -1)
j++;
- xf86SbusInfo = xnfrealloc(xf86SbusInfo, sizeof(psdp) * (n + j + 1));
+ xf86SbusInfo = xnfreallocarray(xf86SbusInfo, n + j + 1, sizeof(psdp));
for (i = 0, psdpp = xf86SbusInfo; i < 32; i++)
if (devicePtrs[i]) {
if (devicePtrs[i]->fbNum == -1) {
diff --git a/xserver/hw/xfree86/os-support/hurd/Makefile.in b/xserver/hw/xfree86/os-support/hurd/Makefile.in
index 5de2e0646..ba1b4075a 100644
--- a/xserver/hw/xfree86/os-support/hurd/Makefile.in
+++ b/xserver/hw/xfree86/os-support/hurd/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -217,7 +216,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -347,8 +345,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/os-support/linux/Makefile.am b/xserver/hw/xfree86/os-support/linux/Makefile.am
index 50fcd1f28..d8cb17777 100644
--- a/xserver/hw/xfree86/os-support/linux/Makefile.am
+++ b/xserver/hw/xfree86/os-support/linux/Makefile.am
@@ -23,7 +23,7 @@ LOGIND_SRCS = systemd-logind.c
XORG_CFLAGS += $(DBUS_CFLAGS)
endif
-liblinux_la_SOURCES = lnx_init.c lnx_video.c \
+liblinux_la_SOURCES = linux.h lnx_init.c lnx_video.c \
lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \
$(srcdir)/../shared/VTsw_usl.c \
$(srcdir)/../shared/posix_tty.c \
diff --git a/xserver/hw/xfree86/os-support/linux/Makefile.in b/xserver/hw/xfree86/os-support/linux/Makefile.in
index 3a33c7ea0..aa39ad6e8 100644
--- a/xserver/hw/xfree86/os-support/linux/Makefile.in
+++ b/xserver/hw/xfree86/os-support/linux/Makefile.in
@@ -61,8 +61,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -78,8 +77,8 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
@LINUX_ALPHA_TRUE@liblinux_la_DEPENDENCIES = liblinuxev56.la
-am__liblinux_la_SOURCES_DIST = lnx_init.c lnx_video.c lnx_agp.c \
- lnx_kmod.c lnx_bell.c lnx_platform.c \
+am__liblinux_la_SOURCES_DIST = linux.h lnx_init.c lnx_video.c \
+ lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \
$(srcdir)/../shared/VTsw_usl.c $(srcdir)/../shared/posix_tty.c \
$(srcdir)/../shared/vidmem.c $(srcdir)/../shared/sigio.c \
lnx_acpi.c lnx_apm.c systemd-logind.c
@@ -241,7 +240,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -371,8 +369,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -503,7 +499,7 @@ noinst_LTLIBRARIES = liblinux.la $(am__append_1)
@LNXACPI_TRUE@ACPI_SRCS = lnx_acpi.c lnx_apm.c
@LNXAPM_TRUE@APM_SRCS = lnx_apm.c
@SYSTEMD_LOGIND_TRUE@LOGIND_SRCS = systemd-logind.c
-liblinux_la_SOURCES = lnx_init.c lnx_video.c \
+liblinux_la_SOURCES = linux.h lnx_init.c lnx_video.c \
lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \
$(srcdir)/../shared/VTsw_usl.c \
$(srcdir)/../shared/posix_tty.c \
diff --git a/xserver/hw/xfree86/os-support/linux/linux.h b/xserver/hw/xfree86/os-support/linux/linux.h
new file mode 100644
index 000000000..83506fd38
--- /dev/null
+++ b/xserver/hw/xfree86/os-support/linux/linux.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 2015 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.
+ *
+ * Author: Hans de Goede <hdegoede@redhat.com>
+ */
+
+#ifndef XF86_LINUX_H
+#define XF86_LINUX_H
+
+int linux_parse_vt_settings(int may_fail);
+int linux_get_keeptty(void);
+
+#endif
diff --git a/xserver/hw/xfree86/os-support/linux/lnx_init.c b/xserver/hw/xfree86/os-support/linux/lnx_init.c
index 4acaf33d1..1ed213c00 100644
--- a/xserver/hw/xfree86/os-support/linux/lnx_init.c
+++ b/xserver/hw/xfree86/os-support/linux/lnx_init.c
@@ -31,6 +31,7 @@
#include <X11/Xmd.h>
#include "compiler.h"
+#include "linux.h"
#include "xf86.h"
#include "xf86Priv.h"
@@ -85,72 +86,108 @@ switch_to(int vt, const char *from)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
-void
-xf86OpenConsole(void)
+int
+linux_parse_vt_settings(int may_fail)
{
int i, fd = -1, ret, current_vt = -1;
- struct vt_mode VT;
struct vt_stat vts;
struct stat st;
MessageType from = X_PROBED;
const char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
- const char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
- if (serverGeneration == 1) {
- /*
- * setup the virtual terminal manager
- */
- if (xf86Info.vtno != -1) {
- from = X_CMDLINE;
- }
- else {
+ /* Only do this once */
+ static int vt_settings_parsed = 0;
- i = 0;
- while (tty0[i] != NULL) {
- if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0)
- break;
- i++;
- }
+ if (vt_settings_parsed)
+ return 1;
- if (fd < 0)
- FatalError("xf86OpenConsole: Cannot open /dev/tty0 (%s)\n",
- strerror(errno));
+ /*
+ * setup the virtual terminal manager
+ */
+ if (xf86Info.vtno != -1) {
+ from = X_CMDLINE;
+ }
+ else {
- if (xf86Info.ShareVTs) {
- SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts));
- if (ret < 0)
- FatalError("xf86OpenConsole: Cannot find the current"
- " VT (%s)\n", strerror(errno));
- xf86Info.vtno = vts.v_active;
- }
- else {
- SYSCALL(ret = ioctl(fd, VT_OPENQRY, &xf86Info.vtno));
- if (ret < 0)
- FatalError("xf86OpenConsole: Cannot find a free VT: "
- "%s\n", strerror(errno));
- if (xf86Info.vtno == -1)
- FatalError("xf86OpenConsole: Cannot find a free VT\n");
- }
- close(fd);
+ i = 0;
+ while (tty0[i] != NULL) {
+ if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0)
+ break;
+ i++;
}
- xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
+ if (fd < 0) {
+ if (may_fail)
+ return 0;
+ FatalError("parse_vt_settings: Cannot open /dev/tty0 (%s)\n",
+ strerror(errno));
+ }
- /* Some of stdin / stdout / stderr maybe redirected to a file */
- for (i = STDIN_FILENO; i <= STDERR_FILENO; i++) {
- ret = fstat(i, &st);
- if (ret == 0 && S_ISCHR(st.st_mode) && major(st.st_rdev) == 4) {
- current_vt = minor(st.st_rdev);
- break;
+ if (xf86Info.ShareVTs) {
+ SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts));
+ if (ret < 0) {
+ if (may_fail)
+ return 0;
+ FatalError("parse_vt_settings: Cannot find the current"
+ " VT (%s)\n", strerror(errno));
+ }
+ xf86Info.vtno = vts.v_active;
+ }
+ else {
+ SYSCALL(ret = ioctl(fd, VT_OPENQRY, &xf86Info.vtno));
+ if (ret < 0) {
+ if (may_fail)
+ return 0;
+ FatalError("parse_vt_settings: Cannot find a free VT: "
+ "%s\n", strerror(errno));
+ }
+ if (xf86Info.vtno == -1) {
+ if (may_fail)
+ return 0;
+ FatalError("parse_vt_settings: Cannot find a free VT\n");
}
}
+ close(fd);
+ }
+
+ xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
- if (!KeepTty && current_vt == xf86Info.vtno) {
- xf86Msg(X_PROBED,
- "controlling tty is VT number %d, auto-enabling KeepTty\n",
- current_vt);
- KeepTty = TRUE;
+ /* Some of stdin / stdout / stderr maybe redirected to a file */
+ for (i = STDIN_FILENO; i <= STDERR_FILENO; i++) {
+ ret = fstat(i, &st);
+ if (ret == 0 && S_ISCHR(st.st_mode) && major(st.st_rdev) == 4) {
+ current_vt = minor(st.st_rdev);
+ break;
}
+ }
+
+ if (!KeepTty && current_vt == xf86Info.vtno) {
+ xf86Msg(X_PROBED,
+ "controlling tty is VT number %d, auto-enabling KeepTty\n",
+ current_vt);
+ KeepTty = TRUE;
+ }
+
+ vt_settings_parsed = 1;
+ return 1;
+}
+
+int
+linux_get_keeptty(void)
+{
+ return KeepTty;
+}
+
+void
+xf86OpenConsole(void)
+{
+ int i, ret;
+ struct vt_stat vts;
+ struct vt_mode VT;
+ const char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
+
+ if (serverGeneration == 1) {
+ linux_parse_vt_settings(FALSE);
if (!KeepTty) {
pid_t ppid = getppid();
@@ -196,18 +233,6 @@ xf86OpenConsole(void)
else
activeVT = vts.v_active;
-#if 0
- if (!KeepTty) {
- /*
- * Detach from the controlling tty to avoid char loss
- */
- if ((i = open("/dev/tty", O_RDWR)) >= 0) {
- SYSCALL(ioctl(i, TIOCNOTTY, 0));
- close(i);
- }
- }
-#endif
-
if (!xf86Info.ShareVTs) {
struct termios nTty;
diff --git a/xserver/hw/xfree86/os-support/linux/systemd-logind.c b/xserver/hw/xfree86/os-support/linux/systemd-logind.c
index 4ad41a374..13784d15c 100644
--- a/xserver/hw/xfree86/os-support/linux/systemd-logind.c
+++ b/xserver/hw/xfree86/os-support/linux/systemd-logind.c
@@ -34,9 +34,11 @@
#include "os.h"
#include "dbus-core.h"
+#include "linux.h"
#include "xf86.h"
#include "xf86platformBus.h"
#include "xf86Xinput.h"
+#include "globals.h"
#include "systemd-logind.h"
@@ -506,6 +508,24 @@ connect_hook(DBusConnection *connection, void *data)
goto cleanup;
}
+ dbus_bus_add_match(connection,
+ "type='signal',sender='org.freedesktop.login1',interface='org.freedesktop.login1.Session',member='PauseDevice'",
+ &error);
+ if (dbus_error_is_set(&error)) {
+ LogMessage(X_ERROR, "systemd-logind: could not add match: %s\n",
+ error.message);
+ goto cleanup;
+ }
+
+ dbus_bus_add_match(connection,
+ "type='signal',sender='org.freedesktop.login1',interface='org.freedesktop.login1.Session',member='ResumeDevice'",
+ &error);
+ if (dbus_error_is_set(&error)) {
+ LogMessage(X_ERROR, "systemd-logind: could not add match: %s\n",
+ error.message);
+ goto cleanup;
+ }
+
/*
* HdG: This is not useful with systemd <= 208 since the signal only
* contains invalidated property names there, rather than property, val
@@ -596,6 +616,13 @@ static struct dbus_core_hook core_hook = {
int
systemd_logind_init(void)
{
+ if (!ServerIsNotSeat0() && linux_parse_vt_settings(TRUE) && !linux_get_keeptty()) {
+ LogMessage(X_INFO,
+ "systemd-logind: logind integration requires -keeptty and "
+ "-keeptty was not provided, disabling logind integration\n");
+ return 1;
+ }
+
return dbus_core_add_hook(&core_hook);
}
diff --git a/xserver/hw/xfree86/os-support/misc/Makefile.in b/xserver/hw/xfree86/os-support/misc/Makefile.in
index f03e31016..2b6a35d89 100644
--- a/xserver/hw/xfree86/os-support/misc/Makefile.in
+++ b/xserver/hw/xfree86/os-support/misc/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -215,7 +214,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -345,8 +343,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/os-support/solaris/Makefile.am b/xserver/hw/xfree86/os-support/solaris/Makefile.am
index 6cda4b361..e534bc8dc 100644
--- a/xserver/hw/xfree86/os-support/solaris/Makefile.am
+++ b/xserver/hw/xfree86/os-support/solaris/Makefile.am
@@ -33,5 +33,4 @@ AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS)
AM_CPPFLAGS = $(XORG_INCS)
-EXTRA_DIST = solaris-amd64.S solaris-ia32.S solaris-sparcv8plus.S \
- apSolaris.shar sun_inout.s
+EXTRA_DIST = solaris-amd64.S solaris-ia32.S solaris-sparcv8plus.S sun_inout.s
diff --git a/xserver/hw/xfree86/os-support/solaris/Makefile.in b/xserver/hw/xfree86/os-support/solaris/Makefile.in
index 350aff275..01d09f12d 100644
--- a/xserver/hw/xfree86/os-support/solaris/Makefile.in
+++ b/xserver/hw/xfree86/os-support/solaris/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -270,7 +269,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -400,8 +398,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -545,9 +541,7 @@ sdk_HEADERS =
nodist_sdk_HEADERS = solaris-@SOLARIS_INOUT_ARCH@.il
AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS)
AM_CPPFLAGS = $(XORG_INCS)
-EXTRA_DIST = solaris-amd64.S solaris-ia32.S solaris-sparcv8plus.S \
- apSolaris.shar sun_inout.s
-
+EXTRA_DIST = solaris-amd64.S solaris-ia32.S solaris-sparcv8plus.S sun_inout.s
all: all-am
.SUFFIXES:
diff --git a/xserver/hw/xfree86/os-support/solaris/apSolaris.shar b/xserver/hw/xfree86/os-support/solaris/apSolaris.shar
deleted file mode 100644
index a3548f7b4..000000000
--- a/xserver/hw/xfree86/os-support/solaris/apSolaris.shar
+++ /dev/null
@@ -1,806 +0,0 @@
-#!/bin/sh
-#
-# This is a shell archive. Save it in a file, remove anything before
-# this line, and then unpack it by entering "sh file". Note, it may
-# create directories; files and directories will be owned by you and
-# have default permissions.
-# Made on Sun Jun 25 20:24:59 CEST 2006 by Martin Bochnig at martux.org
-#
-# This archive contains:
-#
-# ./aperture
-#
-# ./aperture/Makefile
-# ./aperture/Makefile.amd64
-# ./aperture/Makefile.sparcv9
-# ./aperture/README
-# ./aperture/aperture.c
-# ./aperture/aperture.conf
-# ./aperture/devlink.tab
-#
-echo c - ./aperture
-mkdir -p ./aperture > /dev/null 2>&1
-#
-echo x - ./aperture/Makefile
-sed 's/^X//' >./aperture/Makefile << 'END-of-./aperture/Makefile'
-X#
-X# File: makefile for aperture Framebuffer Driver
-X# Author: Doug Anson (danson@lgc.com)
-X# Date: 2/15/94
-X# Modified: David Holland (davidh@use.com)
-X# Date: 2/23/94
-X# - Changed name, and debugging structure
-X# Modified: Marc Aurele La France (tsi@xfree86.org)
-X# Date: 2001.06.08
-X# - SPARC support, cleanup and turf aptest.
-X#
-X# >>NOTE<< Have a look at Makefile.sparcv9 for specifics.
-X#
-X# Modified: Martin Bochnig (martin@martux.org)
-X# Date: 2006.06.24
-X# - Slightly modified to also build on Solaris 10 and 11.
-X# - amd64 64 bit kernel support
-X# - cosmetical changes to also support sun4v, not only sun4u
-X#
-X# >>NOTE<< Have a look at Makefile.amd64 for amd64 specifics.
-X#
-X# GNU gcc compiler
-XCC=gcc
-XCFLGS=-fno-builtin -Wall -O3
-X
-X#
-X# SUNWspro compiler
-X#CC=/opt/SUNWspro/bin/cc
-X#CFLGS=-Xa -xnolib -xO3
-X
-X#
-X# Debug error reporting
-X#DEBUG_FLG=
-X#DEBUG_FLG=-DAPERTURE_DEBUG
-X
-X#
-X# Files and object declarations
-XKERNEL_FLGS=-D_KERNEL -DSUNDDI
-XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
-XCFILES= aperture.c
-XOBJS= aperture.o
-XDRIVER= aperture
-X
-X#
-X# Make rules
-Xall: $(DRIVER)
-X
-X$(DRIVER): $(OBJS)
-X @if [ -f "Makefile.`isainfo -k`" ]; then \
-X make -f Makefile.`isainfo -k` $(DRIVER); \
-X else \
-X rm -f $(DRIVER); \
-X ld -r -o $(DRIVER) $(OBJS); \
-X fi
-X
-Xinstall: $(DRIVER)
-X @if [ -f "Makefile.`isainfo -k`" ]; then \
-X make -f Makefile.`isainfo -k` install; \
-X else \
-X cp aperture.conf /kernel/drv; \
-X cp $(DRIVER) /kernel/drv; \
-X fi
-X
-Xadd_drv:
-X @if [ -f "Makefile.`isainfo -k`" ]; then \
-X make -f Makefile.`isainfo -k` add_drv; \
-X else \
-X add_drv aperture; \
-X fi
-X
-Xclean:
-X rm -f *% *.BAK $(OBJS) $(DRIVER) core
-X
-X.SUFFIXES: .i
-X
-X.c.i:
-X $(CC) -E $(CFLAGS) $*.c > $@
-X
-X.c.o:
-X @if [ -f "Makefile.`isainfo -k`" ]; then \
-X make -f Makefile.`isainfo -k` $@; \
-X else \
-X rm -f $@; \
-X $(CC) -c $(CFLAGS) $*.c -o $@; \
-X fi
-END-of-./aperture/Makefile
-echo x - ./aperture/Makefile.amd64
-sed 's/^X//' >./aperture/Makefile.amd64 << 'END-of-./aperture/Makefile.amd64'
-X#
-X# File: Makefile for aperture Framebuffer Driver
-X# Author: Doug Anson (danson@lgc.com)
-X# Date: 2/15/94
-X# Modified: David Holland (davidh@use.com)
-X# Date: 2/23/94
-X# - Changed name, and debugging structure
-X# Modified: Marc Aurele La France (tsi@xfree86.org)
-X# Date: 2001.06.08
-X# - SPARC support, cleanup and turf aptest.
-X# Modified: Martin Bochnig (martin@martux.org)
-X# - amd64 64 bit kernel support, cosmetics and also
-X# supporting sun4v (and arbitrary sparcv9) platforms
-X# as well as SunOS 5.10 or higher now
-X# - Changed name
-X#
-X
-X#
-X# GNU gcc compiler, version 3.2 or later
-X#
-XCC=gcc
-XCFLGS=-fno-builtin -Wall -O3 -m64 -mcmodel=kernel
-X
-X#
-X# SUNWspro compiler (untested, might not properly work for amd64 here)
-X#CC=/opt/SUNWspro/bin/cc
-X#CFLGS=-Xa -xarch=v9 -xnolib -xO3
-X
-X#
-X# Debug error reporting
-X#DEBUG_FLG=
-X#DEBUG_FLG=-DAPERTURE_DEBUG
-X
-X#
-X# Files and object declarations
-XKERNEL_FLGS=-D_KERNEL -DSUNDDI
-XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
-XCFILES= aperture.c
-XOBJS= aperture.o
-XDRIVER= aperture
-X
-X#
-X# Make rules
-Xall: $(DRIVER)
-X
-X$(DRIVER): $(OBJS)
-X rm -f $(DRIVER)
-X ld -r -o $(DRIVER) $(OBJS)
-X
-Xinstall: $(DRIVER)
-X cp aperture.conf /kernel/drv
-X cp $(DRIVER) /kernel/drv/amd64
-X
-Xadd_drv:
-X add_drv aperture
-X
-Xclean:
-X rm -f *% *.BAK $(OBJS) $(DRIVER) core
-X
-X.SUFFIXES: .i
-X
-X.c.i:
-X $(CC) -E $(CFLAGS) $*.c > $@
-END-of-./aperture/Makefile.amd64
-echo x - ./aperture/Makefile.sparcv9
-sed 's/^X//' >./aperture/Makefile.sparcv9 << 'END-of-./aperture/Makefile.sparcv9'
-X#
-X# File: makefile for aperture Framebuffer Driver
-X# Author: Doug Anson (danson@lgc.com)
-X# Date: 2/15/94
-X# Modified: David Holland (davidh@use.com)
-X# Date: 2/23/94
-X# - Changed name, and debugging structure
-X# Modified: Marc Aurele La France (tsi@xfree86.org)
-X# Date: 2001.06.08
-X# - SPARC support, cleanup and turf aptest.
-X# Modified: Martin Bochnig (martin@martux.org)
-X# Date: 2006.06.24
-X# - Changed name for generic sparcv9 support
-X# - updated to better work with Solaris 10 and 11
-X#
-X
-X#
-X# GNU gcc compiler, version 3.2 or later
-X#
-XCC=gcc
-XCFLGS=-fno-builtin -Wall -O3 -m64
-X
-X#
-X# SUNWspro compiler
-X#CC=/opt/SUNWspro/bin/cc
-X#CFLGS=-Xa -xarch=v9 -xnolib -xO3
-X
-X#
-X# Debug error reporting
-X#DEBUG_FLG=
-X#DEBUG_FLG=-DAPERTURE_DEBUG
-X
-X#
-X# Files and object declarations
-XKERNEL_FLGS=-D_KERNEL -DSUNDDI
-XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
-XCFILES= aperture.c
-XOBJS= aperture.o
-XDRIVER= aperture
-X
-X#
-X# Make rules
-Xall: $(DRIVER)
-X
-X$(DRIVER): $(OBJS)
-X rm -f $(DRIVER)
-X ld -r -o $(DRIVER) $(OBJS)
-X
-Xinstall: $(DRIVER)
-X cp aperture.conf /kernel/drv
-X cp $(DRIVER) /kernel/drv/sparcv9
-X
-Xadd_drv:
-X add_drv aperture
-X
-Xclean:
-X rm -f *% *.BAK $(OBJS) $(DRIVER) core
-X
-X.SUFFIXES: .i
-X
-X.c.i:
-X $(CC) -E $(CFLAGS) $*.c > $@
-END-of-./aperture/Makefile.sparcv9
-echo x - ./aperture/README
-sed 's/^X//' >./aperture/README << 'END-of-./aperture/README'
-XFramebuffer aperture driver.
-X
-XThis driver was written to provide a device that, unlike /dev/mem, allows
-Xmmap()'ing of ranges beyond installed memory.
-X
-XThe original x86-based version of this driver was the collaborative work of
-XDoug Anson (danson@lgc.com), and David Holland (davidh@use.com). It has since
-Xbeen rewritten to also work on sparc machines and - later on - also on sparcv9
-Xand recently amd64 64 bit kernels.
-XIt flawlessly compiles and installs on Solaris 10 and 11 now.
-X
-X
-XInstallation instructions:
-X
-X1) Check the Makefile, for appropriate CC, and CFLAGS definitions. Compiling
-X with APERTURE_DEBUG defined means the driver will generate reams of
-X debugging output. You'll probably want to leave this off...
-X
-X2) Type 'make' (or 'gmake'). Both the driver and test program should compile
-X without any problems. No warning messages should be generated.
-X
-X3) Become 'root'.
-X
-X4) Type 'make install' and 'make add_drv'. The screen should look something
-X like this:
-X
-X # make install
-X cp aperture aperture.conf /kernel/drv
-X # make add_drv
-X add_drv aperture
-X
-X On a sparcv9 machine this will mention the /kernel/drv/sparcv9 directory
-X instead of /kernel/drv. Similarily /kernel/drv/amd64 should be used on amd64.
-X
-X This installs the driver to the system.
-X
-X5) While as root modify the file /etc/devlink.tab, adding these lines:
-X
-X# The following entry is for the framebuffer driver
-Xtype=ddi_pseudo;name=aperture fbs/\M0
-X
-X Add that line exactly as shown. You may also simply add the
-X contents of the devlink.tab file supplied to /etc/devlink.tab.
-X It contains the lines as well. (Yes, that is a tab between
-X aperture and fbs, not spaces - very important)
-X
-X6) Perform a reconfiguration boot of the system.
-X
-X # touch /reconfigure
-X # init 6
-X
-XBug reports, questions, suggestions, etc can be sent to xfree86@xfree86.org.
-END-of-./aperture/README
-echo x - ./aperture/aperture.c
-sed 's/^X//' >./aperture/aperture.c << 'END-of-./aperture/aperture.c'
-X/*
-X * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved.
-X *
-X * Permission is hereby granted, free of charge, to any person obtaining a copy
-X * of this software and associated documentation files (the "Software"), to
-X * deal in the Software without restriction, including without limitation the
-X * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-X * sell copies of the Software, and to permit persons to whom the Software is
-X * furnished to do so, subject to the following conditions:
-X *
-X * The above copyright notice and this permission notice shall be included in
-X * all copies or substantial portions of the Software.
-X *
-X * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-X * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-X * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-X * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-X * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-X *
-X * Except as contained in this notice, the name of the XFree86 Project shall
-X * not be used in advertising or otherwise to promote the sale, use or other
-X * dealings in this Software without prior written authorization from the
-X * XFree86 Project.
-X */
-X
-X/*
-X * Aperture driver for Solaris.
-X */
-X
-X/*
-X * Modified: Martin Bochnig (martin@martux.org)
-X * Log: Commented out obsolete kernel interfaces DDI_IDENTIFIED and DDI_NOT_IDENTIFIED
-X * not supported by SunOS 5.10 or higher anymore,
-X * see http://docs.sun.com/app/docs/doc/819-2255/6n4ibnffr?a=view
-X */
-X
-X#include <sys/conf.h>
-X#include <sys/ddi.h>
-X#include <sys/modctl.h>
-X#include <sys/open.h>
-X#include <sys/stat.h>
-X#include <sys/sunddi.h>
-X
-X#define DEV_IDENT "aperture"
-X#define DEV_BANNER "XFree86 aperture driver"
-X
-X#ifndef D_64BIT
-X#define D_64BIT 0
-X#endif
-X
-X#ifndef NULL
-X#define NULL ((void *)0)
-X#endif
-X
-X/*
-X * open(9E)
-X */
-X/*ARGSUSED*/
-Xstatic int
-Xaperture_open
-X(
-X#ifdef __STDC__
-X dev_t *devp,
-X int flag,
-X int typ,
-X struct cred *cred
-X#endif
-X)
-X#ifndef __STDC__
-X dev_t *devp;
-X int flag;
-X int typ;
-X struct cred *cred;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering open()\n");
-X
-X#endif
-X
-X if ((typ != OTYP_CHR) || (getminor(*devp)))
-X error = EINVAL;
-X else
-X error = 0;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving open() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * mmap(9E)
-X */
-X/*ARGSUSED*/
-Xstatic int
-Xaperture_mmap
-X(
-X#ifdef __STDC__
-X dev_t dev,
-X off_t off,
-X int prot
-X#endif
-X)
-X#ifndef __STDC__
-X dev_t dev;
-X off_t off;
-X int prot;
-X#endif
-X{
-X pfn_t pf;
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering mmap(0x%016lx)\n", off);
-X
-X#endif
-X
-X pf = btop((unsigned long)off);
-X
-X /* Deal with mmap(9E) interface limits */
-X error = (int)pf;
-X if ((error < 0) || (pf != (pfn_t)error))
-X error = -1;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving mmap() = 0x%08lx", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-Xstatic struct cb_ops aperture_cb_ops =
-X{
-X aperture_open, /* open */
-X nulldev, /* close */
-X nodev, /* strategy */
-X nodev, /* print */
-X nodev, /* dump */
-X nodev, /* read */
-X nodev, /* write */
-X nodev, /* ioctl */
-X nodev, /* devmap */
-X aperture_mmap, /* mmap */
-X ddi_segmap, /* segmap */
-X nochpoll, /* poll */
-X ddi_prop_op, /* cb_prop_op */
-X 0, /* streamtab */
-X D_NEW | D_MP | D_64BIT /* Driver compatibility flag */
-X};
-X
-X
-Xstatic dev_info_t *aperture_dip; /* private copy of devinfo pointer */
-X
-X/*
-X * getinfo(9E)
-X */
-X/*ARGSUSED*/
-Xstatic int
-Xaperture_getinfo
-X(
-X#ifdef __STDC__
-X dev_info_t *dip,
-X ddi_info_cmd_t infocmd,
-X void *arg,
-X void **result
-X#endif
-X)
-X#ifndef __STDC__
-X dev_info_t *dip;
-X ddi_info_cmd_t infocmd;
-X void *arg;
-X void **result;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering getinfo()\n");
-X
-X#endif
-X
-X switch (infocmd) {
-X case DDI_INFO_DEVT2DEVINFO:
-X *result = aperture_dip;
-X error = DDI_SUCCESS;
-X break;
-X case DDI_INFO_DEVT2INSTANCE:
-X *result = NULL;
-X error = DDI_SUCCESS;
-X break;
-X default:
-X error = DDI_FAILURE;
-X }
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving getinfo() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * identify(9E)
-X */
-X/*ARGSUSED*/
-Xstatic int
-Xaperture_identify
-X(
-X#ifdef __STDC__
-X dev_info_t *dip
-X#endif
-X)
-X#ifndef __STDC__
-X dev_info_t *dip;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering identify()\n");
-X
-X#endif
-X
-X if (strcmp(ddi_get_name(dip), DEV_IDENT))
-X error = 1 /* DDI_NOT_IDENTIFIED obsolete since SunOS 5.10 */ ;
-X else
-X error = 2 /* DDI_IDENTIFIED obsolete since SunOS 5.10 */ ;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving identify() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * attach(9E)
-X */
-X/*ARGSUSED*/
-Xstatic int
-Xaperture_attach
-X(
-X#ifdef __STDC__
-X dev_info_t *dip,
-X ddi_attach_cmd_t cmd
-X#endif
-X)
-X#ifndef __STDC__
-X dev_info_t *dip;
-X ddi_attach_cmd_t cmd;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering attach()\n");
-X
-X#endif
-X
-X if (cmd != DDI_ATTACH)
-X {
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": not attach(, DDI_ATTACH)\n");
-X
-X#endif
-X
-X error = DDI_FAILURE;
-X }
-X else
-X {
-X error = ddi_create_minor_node(dip, ddi_get_name(dip), S_IFCHR,
-X (minor_t)ddi_get_instance(dip),
-X NULL, 0 /* NODESPECIFIC_DEV obsolete since SunOS 5.10 */ );
-X
-X if (error == DDI_SUCCESS)
-X {
-X aperture_dip = dip;
-X ddi_report_dev(dip);
-X }
-X }
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving attach() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * detach(9E)
-X */
-Xstatic int
-Xaperture_detach
-X(
-X#ifdef __STDC__
-X dev_info_t *dip,
-X ddi_detach_cmd_t cmd
-X#endif
-X)
-X#ifndef __STDC__
-X dev_info_t *dip;
-X ddi_detach_cmd_t cmd;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering detach()\n");
-X
-X#endif
-X
-X if (cmd != DDI_DETACH)
-X {
-X error = DDI_FAILURE;
-X }
-X else
-X {
-X ddi_remove_minor_node(dip, NULL);
-X aperture_dip = NULL;
-X error = DDI_SUCCESS;
-X }
-X
-X#if APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving detach() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X
-Xstatic struct dev_ops aperture_ops =
-X{
-X DEVO_REV, /* revision */
-X 0, /* refcnt */
-X aperture_getinfo, /* getinfo */
-X aperture_identify, /* identify */
-X nulldev, /* probe */
-X aperture_attach, /* attach */
-X aperture_detach, /* detach */
-X nodev, /* reset */
-X &aperture_cb_ops, /* driver operations */
-X NULL /* bus operations */
-X};
-X
-X
-Xstatic struct modldrv modldrv =
-X{
-X &mod_driverops, /* mod_ops structure pointer */
-X DEV_BANNER, /* driver banner string */
-X &aperture_ops, /* dev_ops structure pointer */
-X};
-X
-X
-Xstatic struct modlinkage modlinkage =
-X{
-X MODREV_1, /* module API revision */
-X {
-X &modldrv, /* module driver structure pointer */
-X NULL /* list termination */
-X }
-X};
-X
-X
-X/*
-X * _init(9E)
-X */
-Xint
-X_init
-X(
-X#ifdef __STDC__
-X void
-X#endif
-X)
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering _init()\n");
-X
-X#endif
-X
-X error = mod_install(&modlinkage);
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving _init() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * _info(9E)
-X */
-Xint
-X_info
-X(
-X#ifdef __STDC__
-X struct modinfo *modinfop
-X#endif
-X)
-X#ifndef __STDC__
-X struct modinfo *modinfop;
-X#endif
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering _info()\n");
-X
-X#endif
-X
-X error = mod_info(&modlinkage, modinfop);
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving _info() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-X
-X/*
-X * _fini(9E)
-X */
-Xint
-X_fini
-X(
-X#ifdef __STDC__
-X void
-X#endif
-X)
-X{
-X int error;
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": entering _fini()\n");
-X
-X#endif
-X
-X error = mod_remove(&modlinkage);
-X
-X#ifdef APERTURE_DEBUG
-X
-X cmn_err(CE_CONT, DEV_IDENT ": leaving _fini() = %d\n", error);
-X
-X#endif
-X
-X return error;
-X}
-END-of-./aperture/aperture.c
-echo x - ./aperture/aperture.conf
-sed 's/^X//' >./aperture/aperture.conf << 'END-of-./aperture/aperture.conf'
-X#
-X# Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com
-X#
-X# File: aperture.conf
-X# Author: Doug Anson (danson@lgc.com)
-X#
-X# Modified: David Holland (davidh@use.com)
-X# Log: Change comments 02/23/94
-X# Change defaults/comments 09/25/94
-X#
-X# Modified: Marc Aurele La France (tsi@xfree86.org)
-X# Log: SPARC changes 2001.09
-X#
-X# Purpose: This conf file is used by the aperture driver.
-X#
-Xname="aperture" parent="pseudo";
-END-of-./aperture/aperture.conf
-echo x - ./aperture/devlink.tab
-sed 's/^X//' >./aperture/devlink.tab << 'END-of-./aperture/devlink.tab'
-X# The following entry is for the aperture driver
-Xtype=ddi_pseudo;name=aperture fbs/\M0
-END-of-./aperture/devlink.tab
-exit
-
diff --git a/xserver/hw/xfree86/os-support/stub/Makefile.in b/xserver/hw/xfree86/os-support/stub/Makefile.in
index 00b96d4cd..fd5348ad0 100644
--- a/xserver/hw/xfree86/os-support/stub/Makefile.in
+++ b/xserver/hw/xfree86/os-support/stub/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -217,7 +216,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -347,8 +345,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/os-support/xf86_OSlib.h b/xserver/hw/xfree86/os-support/xf86_OSlib.h
index 95c3a7365..c7b295ae9 100644
--- a/xserver/hw/xfree86/os-support/xf86_OSlib.h
+++ b/xserver/hw/xfree86/os-support/xf86_OSlib.h
@@ -208,13 +208,9 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX];
#endif /* __linux__ || __GLIBC__ */
/**************************************************************************/
-/* 386BSD and derivatives, BSD/386 */
+/* System is BSD-like */
/**************************************************************************/
-#if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__))
-#undef __386BSD__
-#endif
-
#ifdef CSRG_BASED
#include <sys/ioctl.h>
#include <signal.h>
@@ -242,8 +238,6 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX];
#define __FreeBSD_kernel_version __FreeBSD_version
#endif
-#if !defined(LINKKIT)
- /* Don't need this stuff for the Link Kit */
#ifdef SYSCONS_SUPPORT
#define COMPAT_SYSCONS
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
@@ -309,7 +303,6 @@ struct pcvtid {
#ifndef CONSOLE_GET_MEM_INFO
#define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info)
#endif
-#endif /* !LINKKIT */
#if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL)
#include <machine/sysarch.h>
diff --git a/xserver/hw/xfree86/parser/Configint.h b/xserver/hw/xfree86/parser/Configint.h
index 31035ae2d..e5fa6cec2 100644
--- a/xserver/hw/xfree86/parser/Configint.h
+++ b/xserver/hw/xfree86/parser/Configint.h
@@ -204,6 +204,8 @@ else\
"Multiple \"%s\" lines."
#define MUST_BE_OCTAL_MSG \
"The number \"%d\" given in this section must be in octal (0xxx) format."
+#define GPU_DEVICE_TOO_MANY \
+"More than %d GPU devices defined."
/* Warning messages */
#define OBSOLETE_MSG \
diff --git a/xserver/hw/xfree86/parser/InputClass.c b/xserver/hw/xfree86/parser/InputClass.c
index c2fbd22a7..29bd9fa64 100644
--- a/xserver/hw/xfree86/parser/InputClass.c
+++ b/xserver/hw/xfree86/parser/InputClass.c
@@ -58,6 +58,82 @@ xf86ConfigSymTabRec InputClassTab[] = {
{-1, ""},
};
+static void
+xf86freeInputClassList(XF86ConfInputClassPtr ptr)
+{
+ XF86ConfInputClassPtr prev;
+
+ while (ptr) {
+ xf86MatchGroup *group, *next;
+ char **list;
+
+ TestFree(ptr->identifier);
+ TestFree(ptr->driver);
+
+ xorg_list_for_each_entry_safe(group, next, &ptr->match_product, entry) {
+ xorg_list_del(&group->entry);
+ for (list = group->values; *list; list++)
+ free(*list);
+ free(group);
+ }
+ xorg_list_for_each_entry_safe(group, next, &ptr->match_vendor, entry) {
+ xorg_list_del(&group->entry);
+ for (list = group->values; *list; list++)
+ free(*list);
+ free(group);
+ }
+ xorg_list_for_each_entry_safe(group, next, &ptr->match_device, entry) {
+ xorg_list_del(&group->entry);
+ for (list = group->values; *list; list++)
+ free(*list);
+ free(group);
+ }
+ xorg_list_for_each_entry_safe(group, next, &ptr->match_os, entry) {
+ xorg_list_del(&group->entry);
+ for (list = group->values; *list; list++)
+ free(*list);
+ free(group);
+ }
+ xorg_list_for_each_entry_safe(group, next, &ptr->match_pnpid, entry) {
+ xorg_list_del(&group->entry);
+ for (list = group->values; *list; list++)
+ free(*list);
+ free(group);
+ }
+ xorg_list_for_each_entry_safe(group, next, &ptr->match_usbid, entry) {
+ xorg_list_del(&group->entry);
+ for (list = group->values; *list; list++)
+ free(*list);
+ free(group);
+ }
+ xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) {
+ xorg_list_del(&group->entry);
+ for (list = group->values; *list; list++)
+ free(*list);
+ free(group);
+ }
+ xorg_list_for_each_entry_safe(group, next, &ptr->match_tag, entry) {
+ xorg_list_del(&group->entry);
+ for (list = group->values; *list; list++)
+ free(*list);
+ free(group);
+ }
+ xorg_list_for_each_entry_safe(group, next, &ptr->match_layout, entry) {
+ xorg_list_del(&group->entry);
+ for (list = group->values; *list; list++)
+ free(*list);
+ free(group);
+ }
+
+ TestFree(ptr->comment);
+ xf86optionListFree(ptr->option_lst);
+
+ prev = ptr;
+ ptr = ptr->list.next;
+ free(prev);
+ }
+}
+
#define CLEANUP xf86freeInputClassList
#define TOKEN_SEP "|"
@@ -354,79 +430,3 @@ xf86printInputClassSection(FILE * cf, XF86ConfInputClassPtr ptr)
ptr = ptr->list.next;
}
}
-
-void
-xf86freeInputClassList(XF86ConfInputClassPtr ptr)
-{
- XF86ConfInputClassPtr prev;
-
- while (ptr) {
- xf86MatchGroup *group, *next;
- char **list;
-
- TestFree(ptr->identifier);
- TestFree(ptr->driver);
-
- xorg_list_for_each_entry_safe(group, next, &ptr->match_product, entry) {
- xorg_list_del(&group->entry);
- for (list = group->values; *list; list++)
- free(*list);
- free(group);
- }
- xorg_list_for_each_entry_safe(group, next, &ptr->match_vendor, entry) {
- xorg_list_del(&group->entry);
- for (list = group->values; *list; list++)
- free(*list);
- free(group);
- }
- xorg_list_for_each_entry_safe(group, next, &ptr->match_device, entry) {
- xorg_list_del(&group->entry);
- for (list = group->values; *list; list++)
- free(*list);
- free(group);
- }
- xorg_list_for_each_entry_safe(group, next, &ptr->match_os, entry) {
- xorg_list_del(&group->entry);
- for (list = group->values; *list; list++)
- free(*list);
- free(group);
- }
- xorg_list_for_each_entry_safe(group, next, &ptr->match_pnpid, entry) {
- xorg_list_del(&group->entry);
- for (list = group->values; *list; list++)
- free(*list);
- free(group);
- }
- xorg_list_for_each_entry_safe(group, next, &ptr->match_usbid, entry) {
- xorg_list_del(&group->entry);
- for (list = group->values; *list; list++)
- free(*list);
- free(group);
- }
- xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) {
- xorg_list_del(&group->entry);
- for (list = group->values; *list; list++)
- free(*list);
- free(group);
- }
- xorg_list_for_each_entry_safe(group, next, &ptr->match_tag, entry) {
- xorg_list_del(&group->entry);
- for (list = group->values; *list; list++)
- free(*list);
- free(group);
- }
- xorg_list_for_each_entry_safe(group, next, &ptr->match_layout, entry) {
- xorg_list_del(&group->entry);
- for (list = group->values; *list; list++)
- free(*list);
- free(group);
- }
-
- TestFree(ptr->comment);
- xf86optionListFree(ptr->option_lst);
-
- prev = ptr;
- ptr = ptr->list.next;
- free(prev);
- }
-}
diff --git a/xserver/hw/xfree86/parser/Makefile.am b/xserver/hw/xfree86/parser/Makefile.am
index 4d0bb4fd8..9aa8cfefb 100644
--- a/xserver/hw/xfree86/parser/Makefile.am
+++ b/xserver/hw/xfree86/parser/Makefile.am
@@ -1,12 +1,4 @@
-if INSTALL_LIBXF86CONFIG
-noinst_LTLIBRARIES = libxf86config_internal.la
-lib_LTLIBRARIES = libxf86config.la
-LIBHEADERS = \
- xf86Optrec.h \
- xf86Parser.h
-else
-noinst_LTLIBRARIES = libxf86config_internal.la
-endif
+noinst_LTLIBRARIES = libxf86config.la
INTERNAL_SOURCES= \
Device.c \
@@ -28,14 +20,8 @@ INTERNAL_SOURCES= \
DRI.c \
Extensions.c
-libxf86config_internal_la_SOURCES = \
- $(INTERNAL_SOURCES)
-
libxf86config_la_SOURCES = \
- $(top_srcdir)/os/xprintf.c \
$(INTERNAL_SOURCES)
-libxf86config_la_CFLAGS = $(AM_CFLAGS)
-libxf86config_la_LDFLAGS = -static
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \
-DSYSCONFDIR=\"$(sysconfdir)\" \
diff --git a/xserver/hw/xfree86/parser/Makefile.in b/xserver/hw/xfree86/parser/Makefile.in
index 4d8b773da..9de7a0585 100644
--- a/xserver/hw/xfree86/parser/Makefile.in
+++ b/xserver/hw/xfree86/parser/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -73,68 +72,18 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
$(top_builddir)/include/version-config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sdkdir)"
-LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
+LTLIBRARIES = $(noinst_LTLIBRARIES)
libxf86config_la_LIBADD =
-am__objects_1 = libxf86config_la-Device.lo libxf86config_la-Files.lo \
- libxf86config_la-Flags.lo libxf86config_la-Input.lo \
- libxf86config_la-InputClass.lo libxf86config_la-OutputClass.lo \
- libxf86config_la-Layout.lo libxf86config_la-Module.lo \
- libxf86config_la-Video.lo libxf86config_la-Monitor.lo \
- libxf86config_la-Pointer.lo libxf86config_la-Screen.lo \
- libxf86config_la-Vendor.lo libxf86config_la-read.lo \
- libxf86config_la-scan.lo libxf86config_la-write.lo \
- libxf86config_la-DRI.lo libxf86config_la-Extensions.lo
-am_libxf86config_la_OBJECTS = libxf86config_la-xprintf.lo \
- $(am__objects_1)
+am__objects_1 = Device.lo Files.lo Flags.lo Input.lo InputClass.lo \
+ OutputClass.lo Layout.lo Module.lo Video.lo Monitor.lo \
+ Pointer.lo Screen.lo Vendor.lo read.lo scan.lo write.lo DRI.lo \
+ Extensions.lo
+am_libxf86config_la_OBJECTS = $(am__objects_1)
libxf86config_la_OBJECTS = $(am_libxf86config_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 =
-libxf86config_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(libxf86config_la_CFLAGS) $(CFLAGS) \
- $(libxf86config_la_LDFLAGS) $(LDFLAGS) -o $@
-@INSTALL_LIBXF86CONFIG_TRUE@am_libxf86config_la_rpath = -rpath \
-@INSTALL_LIBXF86CONFIG_TRUE@ $(libdir)
-libxf86config_internal_la_LIBADD =
-am__objects_2 = Device.lo Files.lo Flags.lo Input.lo InputClass.lo \
- OutputClass.lo Layout.lo Module.lo Video.lo Monitor.lo \
- Pointer.lo Screen.lo Vendor.lo read.lo scan.lo write.lo DRI.lo \
- Extensions.lo
-am_libxf86config_internal_la_OBJECTS = $(am__objects_2)
-libxf86config_internal_la_OBJECTS = \
- $(am_libxf86config_internal_la_OBJECTS)
-@INSTALL_LIBXF86CONFIG_FALSE@am_libxf86config_internal_la_rpath =
-@INSTALL_LIBXF86CONFIG_TRUE@am_libxf86config_internal_la_rpath =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -169,15 +118,41 @@ 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 = $(libxf86config_la_SOURCES) \
- $(libxf86config_internal_la_SOURCES)
-DIST_SOURCES = $(libxf86config_la_SOURCES) \
- $(libxf86config_internal_la_SOURCES)
+SOURCES = $(libxf86config_la_SOURCES)
+DIST_SOURCES = $(libxf86config_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(sdkdir)"
HEADERS = $(sdk_HEADERS)
ETAGS = etags
CTAGS = ctags
@@ -273,7 +248,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -403,8 +377,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -528,13 +500,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-@INSTALL_LIBXF86CONFIG_FALSE@noinst_LTLIBRARIES = libxf86config_internal.la
-@INSTALL_LIBXF86CONFIG_TRUE@noinst_LTLIBRARIES = libxf86config_internal.la
-@INSTALL_LIBXF86CONFIG_TRUE@lib_LTLIBRARIES = libxf86config.la
-@INSTALL_LIBXF86CONFIG_TRUE@LIBHEADERS = \
-@INSTALL_LIBXF86CONFIG_TRUE@ xf86Optrec.h \
-@INSTALL_LIBXF86CONFIG_TRUE@ xf86Parser.h
-
+noinst_LTLIBRARIES = libxf86config.la
INTERNAL_SOURCES = \
Device.c \
Files.c \
@@ -555,15 +521,9 @@ INTERNAL_SOURCES = \
DRI.c \
Extensions.c
-libxf86config_internal_la_SOURCES = \
- $(INTERNAL_SOURCES)
-
libxf86config_la_SOURCES = \
- $(top_srcdir)/os/xprintf.c \
$(INTERNAL_SOURCES)
-libxf86config_la_CFLAGS = $(AM_CFLAGS)
-libxf86config_la_LDFLAGS = -static
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DDATADIR=\"$(datadir)\"
@@ -614,40 +574,6 @@ $(top_srcdir)/configure: $(am__configure_deps)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
- @$(NORMAL_INSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
- list2=; for p in $$list; do \
- if test -f $$p; then \
- list2="$$list2 $$p"; \
- else :; fi; \
- done; \
- test -z "$$list2" || { \
- echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
- }
-
-uninstall-libLTLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
- done
-
-clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
- @list='$(lib_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}; \
- }
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@@ -660,9 +586,7 @@ clean-noinstLTLIBRARIES:
rm -f $${locs}; \
}
libxf86config.la: $(libxf86config_la_OBJECTS) $(libxf86config_la_DEPENDENCIES) $(EXTRA_libxf86config_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libxf86config_la_LINK) $(am_libxf86config_la_rpath) $(libxf86config_la_OBJECTS) $(libxf86config_la_LIBADD) $(LIBS)
-libxf86config_internal.la: $(libxf86config_internal_la_OBJECTS) $(libxf86config_internal_la_DEPENDENCIES) $(EXTRA_libxf86config_internal_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(am_libxf86config_internal_la_rpath) $(libxf86config_internal_la_OBJECTS) $(libxf86config_internal_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(libxf86config_la_OBJECTS) $(libxf86config_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -685,25 +609,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Screen.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Vendor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Video.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-DRI.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Device.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Extensions.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Files.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Flags.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Input.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-InputClass.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Layout.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Module.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Monitor.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-OutputClass.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Pointer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Screen.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Vendor.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-Video.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-read.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-scan.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-write.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxf86config_la-xprintf.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scan.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write.Plo@am__quote@
@@ -729,139 +634,6 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-libxf86config_la-xprintf.lo: $(top_srcdir)/os/xprintf.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-xprintf.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-xprintf.Tpo -c -o libxf86config_la-xprintf.lo `test -f '$(top_srcdir)/os/xprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/os/xprintf.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-xprintf.Tpo $(DEPDIR)/libxf86config_la-xprintf.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/os/xprintf.c' object='libxf86config_la-xprintf.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-xprintf.lo `test -f '$(top_srcdir)/os/xprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/os/xprintf.c
-
-libxf86config_la-Device.lo: Device.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Device.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Device.Tpo -c -o libxf86config_la-Device.lo `test -f 'Device.c' || echo '$(srcdir)/'`Device.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Device.Tpo $(DEPDIR)/libxf86config_la-Device.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Device.c' object='libxf86config_la-Device.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Device.lo `test -f 'Device.c' || echo '$(srcdir)/'`Device.c
-
-libxf86config_la-Files.lo: Files.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Files.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Files.Tpo -c -o libxf86config_la-Files.lo `test -f 'Files.c' || echo '$(srcdir)/'`Files.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Files.Tpo $(DEPDIR)/libxf86config_la-Files.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Files.c' object='libxf86config_la-Files.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Files.lo `test -f 'Files.c' || echo '$(srcdir)/'`Files.c
-
-libxf86config_la-Flags.lo: Flags.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Flags.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Flags.Tpo -c -o libxf86config_la-Flags.lo `test -f 'Flags.c' || echo '$(srcdir)/'`Flags.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Flags.Tpo $(DEPDIR)/libxf86config_la-Flags.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Flags.c' object='libxf86config_la-Flags.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Flags.lo `test -f 'Flags.c' || echo '$(srcdir)/'`Flags.c
-
-libxf86config_la-Input.lo: Input.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Input.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Input.Tpo -c -o libxf86config_la-Input.lo `test -f 'Input.c' || echo '$(srcdir)/'`Input.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Input.Tpo $(DEPDIR)/libxf86config_la-Input.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Input.c' object='libxf86config_la-Input.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Input.lo `test -f 'Input.c' || echo '$(srcdir)/'`Input.c
-
-libxf86config_la-InputClass.lo: InputClass.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-InputClass.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-InputClass.Tpo -c -o libxf86config_la-InputClass.lo `test -f 'InputClass.c' || echo '$(srcdir)/'`InputClass.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-InputClass.Tpo $(DEPDIR)/libxf86config_la-InputClass.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='InputClass.c' object='libxf86config_la-InputClass.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-InputClass.lo `test -f 'InputClass.c' || echo '$(srcdir)/'`InputClass.c
-
-libxf86config_la-OutputClass.lo: OutputClass.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-OutputClass.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-OutputClass.Tpo -c -o libxf86config_la-OutputClass.lo `test -f 'OutputClass.c' || echo '$(srcdir)/'`OutputClass.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-OutputClass.Tpo $(DEPDIR)/libxf86config_la-OutputClass.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='OutputClass.c' object='libxf86config_la-OutputClass.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-OutputClass.lo `test -f 'OutputClass.c' || echo '$(srcdir)/'`OutputClass.c
-
-libxf86config_la-Layout.lo: Layout.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Layout.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Layout.Tpo -c -o libxf86config_la-Layout.lo `test -f 'Layout.c' || echo '$(srcdir)/'`Layout.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Layout.Tpo $(DEPDIR)/libxf86config_la-Layout.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Layout.c' object='libxf86config_la-Layout.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Layout.lo `test -f 'Layout.c' || echo '$(srcdir)/'`Layout.c
-
-libxf86config_la-Module.lo: Module.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Module.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Module.Tpo -c -o libxf86config_la-Module.lo `test -f 'Module.c' || echo '$(srcdir)/'`Module.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Module.Tpo $(DEPDIR)/libxf86config_la-Module.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Module.c' object='libxf86config_la-Module.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Module.lo `test -f 'Module.c' || echo '$(srcdir)/'`Module.c
-
-libxf86config_la-Video.lo: Video.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Video.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Video.Tpo -c -o libxf86config_la-Video.lo `test -f 'Video.c' || echo '$(srcdir)/'`Video.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Video.Tpo $(DEPDIR)/libxf86config_la-Video.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Video.c' object='libxf86config_la-Video.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Video.lo `test -f 'Video.c' || echo '$(srcdir)/'`Video.c
-
-libxf86config_la-Monitor.lo: Monitor.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Monitor.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Monitor.Tpo -c -o libxf86config_la-Monitor.lo `test -f 'Monitor.c' || echo '$(srcdir)/'`Monitor.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Monitor.Tpo $(DEPDIR)/libxf86config_la-Monitor.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Monitor.c' object='libxf86config_la-Monitor.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Monitor.lo `test -f 'Monitor.c' || echo '$(srcdir)/'`Monitor.c
-
-libxf86config_la-Pointer.lo: Pointer.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Pointer.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Pointer.Tpo -c -o libxf86config_la-Pointer.lo `test -f 'Pointer.c' || echo '$(srcdir)/'`Pointer.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Pointer.Tpo $(DEPDIR)/libxf86config_la-Pointer.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Pointer.c' object='libxf86config_la-Pointer.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Pointer.lo `test -f 'Pointer.c' || echo '$(srcdir)/'`Pointer.c
-
-libxf86config_la-Screen.lo: Screen.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Screen.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Screen.Tpo -c -o libxf86config_la-Screen.lo `test -f 'Screen.c' || echo '$(srcdir)/'`Screen.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Screen.Tpo $(DEPDIR)/libxf86config_la-Screen.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Screen.c' object='libxf86config_la-Screen.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Screen.lo `test -f 'Screen.c' || echo '$(srcdir)/'`Screen.c
-
-libxf86config_la-Vendor.lo: Vendor.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Vendor.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Vendor.Tpo -c -o libxf86config_la-Vendor.lo `test -f 'Vendor.c' || echo '$(srcdir)/'`Vendor.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Vendor.Tpo $(DEPDIR)/libxf86config_la-Vendor.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Vendor.c' object='libxf86config_la-Vendor.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Vendor.lo `test -f 'Vendor.c' || echo '$(srcdir)/'`Vendor.c
-
-libxf86config_la-read.lo: read.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-read.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-read.Tpo -c -o libxf86config_la-read.lo `test -f 'read.c' || echo '$(srcdir)/'`read.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-read.Tpo $(DEPDIR)/libxf86config_la-read.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='read.c' object='libxf86config_la-read.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-read.lo `test -f 'read.c' || echo '$(srcdir)/'`read.c
-
-libxf86config_la-scan.lo: scan.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-scan.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-scan.Tpo -c -o libxf86config_la-scan.lo `test -f 'scan.c' || echo '$(srcdir)/'`scan.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-scan.Tpo $(DEPDIR)/libxf86config_la-scan.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scan.c' object='libxf86config_la-scan.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-scan.lo `test -f 'scan.c' || echo '$(srcdir)/'`scan.c
-
-libxf86config_la-write.lo: write.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-write.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-write.Tpo -c -o libxf86config_la-write.lo `test -f 'write.c' || echo '$(srcdir)/'`write.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-write.Tpo $(DEPDIR)/libxf86config_la-write.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='write.c' object='libxf86config_la-write.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-write.lo `test -f 'write.c' || echo '$(srcdir)/'`write.c
-
-libxf86config_la-DRI.lo: DRI.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-DRI.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-DRI.Tpo -c -o libxf86config_la-DRI.lo `test -f 'DRI.c' || echo '$(srcdir)/'`DRI.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-DRI.Tpo $(DEPDIR)/libxf86config_la-DRI.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='DRI.c' object='libxf86config_la-DRI.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-DRI.lo `test -f 'DRI.c' || echo '$(srcdir)/'`DRI.c
-
-libxf86config_la-Extensions.lo: Extensions.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -MT libxf86config_la-Extensions.lo -MD -MP -MF $(DEPDIR)/libxf86config_la-Extensions.Tpo -c -o libxf86config_la-Extensions.lo `test -f 'Extensions.c' || echo '$(srcdir)/'`Extensions.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libxf86config_la-Extensions.Tpo $(DEPDIR)/libxf86config_la-Extensions.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Extensions.c' object='libxf86config_la-Extensions.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxf86config_la_CFLAGS) $(CFLAGS) -c -o libxf86config_la-Extensions.lo `test -f 'Extensions.c' || echo '$(srcdir)/'`Extensions.c
-
mostlyclean-libtool:
-rm -f *.lo
@@ -989,7 +761,7 @@ check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sdkdir)"; do \
+ for dir in "$(DESTDIR)$(sdkdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -1024,8 +796,8 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
- clean-noinstLTLIBRARIES mostlyclean-am
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
@@ -1051,7 +823,7 @@ install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am: install-libLTLIBRARIES
+install-exec-am:
install-html: install-html-am
@@ -1091,24 +863,23 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-libLTLIBRARIES uninstall-sdkHEADERS
+uninstall-am: uninstall-sdkHEADERS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
- cscopelist ctags distclean distclean-compile distclean-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-libLTLIBRARIES install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-sdkHEADERS \
- 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 \
- uninstall-libLTLIBRARIES uninstall-sdkHEADERS
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-sdkHEADERS 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 uninstall-sdkHEADERS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/xserver/hw/xfree86/parser/OutputClass.c b/xserver/hw/xfree86/parser/OutputClass.c
index 7e9a8ac1a..3f2082ecb 100644
--- a/xserver/hw/xfree86/parser/OutputClass.c
+++ b/xserver/hw/xfree86/parser/OutputClass.c
@@ -41,6 +41,32 @@ xf86ConfigSymTabRec OutputClassTab[] = {
{-1, ""},
};
+static void
+xf86freeOutputClassList(XF86ConfOutputClassPtr ptr)
+{
+ XF86ConfOutputClassPtr prev;
+
+ while (ptr) {
+ xf86MatchGroup *group, *next;
+ char **list;
+
+ TestFree(ptr->identifier);
+ TestFree(ptr->comment);
+ TestFree(ptr->driver);
+
+ xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) {
+ xorg_list_del(&group->entry);
+ for (list = group->values; *list; list++)
+ free(*list);
+ free(group);
+ }
+
+ prev = ptr;
+ ptr = ptr->list.next;
+ free(prev);
+ }
+}
+
#define CLEANUP xf86freeOutputClassList
#define TOKEN_SEP "|"
@@ -139,29 +165,3 @@ xf86printOutputClassSection(FILE * cf, XF86ConfOutputClassPtr ptr)
ptr = ptr->list.next;
}
}
-
-void
-xf86freeOutputClassList(XF86ConfOutputClassPtr ptr)
-{
- XF86ConfOutputClassPtr prev;
-
- while (ptr) {
- xf86MatchGroup *group, *next;
- char **list;
-
- TestFree(ptr->identifier);
- TestFree(ptr->comment);
- TestFree(ptr->driver);
-
- xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) {
- xorg_list_del(&group->entry);
- for (list = group->values; *list; list++)
- free(*list);
- free(group);
- }
-
- prev = ptr;
- ptr = ptr->list.next;
- free(prev);
- }
-}
diff --git a/xserver/hw/xfree86/parser/Screen.c b/xserver/hw/xfree86/parser/Screen.c
index 9d8eda277..47319706f 100644
--- a/xserver/hw/xfree86/parser/Screen.c
+++ b/xserver/hw/xfree86/parser/Screen.c
@@ -76,6 +76,33 @@ static xf86ConfigSymTabRec DisplayTab[] = {
{-1, ""},
};
+static void
+xf86freeModeList(XF86ModePtr ptr)
+{
+ XF86ModePtr prev;
+
+ while (ptr) {
+ TestFree(ptr->mode_name);
+ prev = ptr;
+ ptr = ptr->list.next;
+ free(prev);
+ }
+}
+
+static void
+xf86freeDisplayList(XF86ConfDisplayPtr ptr)
+{
+ XF86ConfDisplayPtr prev;
+
+ while (ptr) {
+ xf86freeModeList(ptr->disp_mode_lst);
+ xf86optionListFree(ptr->disp_option_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ free(prev);
+ }
+}
+
#define CLEANUP xf86freeDisplayList
static XF86ConfDisplayPtr
@@ -211,6 +238,7 @@ static xf86ConfigSymTabRec ScreenTab[] = {
{DEFAULTFBBPP, "defaultfbbpp"},
{VIRTUAL, "virtual"},
{OPTION, "option"},
+ {GDEVICE, "gpudevice"},
{-1, ""},
};
@@ -270,6 +298,13 @@ xf86parseScreenSection(void)
Error(QUOTE_MSG, "Device");
ptr->scrn_device_str = xf86_lex_val.str;
break;
+ case GDEVICE:
+ if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
+ Error(QUOTE_MSG, "GPUDevice");
+ if (ptr->num_gpu_devices == CONF_MAXGPUDEVICES)
+ Error(GPU_DEVICE_TOO_MANY, CONF_MAXGPUDEVICES);
+ ptr->scrn_gpu_device_str[ptr->num_gpu_devices++] = xf86_lex_val.str;
+ break;
case MONITOR:
if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
Error(QUOTE_MSG, "Monitor");
@@ -342,7 +377,7 @@ xf86printScreenSection(FILE * cf, XF86ConfScreenPtr ptr)
XF86ConfAdaptorLinkPtr aptr;
XF86ConfDisplayPtr dptr;
XF86ModePtr mptr;
-
+ int i;
while (ptr) {
fprintf(cf, "Section \"Screen\"\n");
if (ptr->scrn_comment)
@@ -353,6 +388,9 @@ xf86printScreenSection(FILE * cf, XF86ConfScreenPtr ptr)
fprintf(cf, "\tDriver \"%s\"\n", ptr->scrn_obso_driver);
if (ptr->scrn_device_str)
fprintf(cf, "\tDevice \"%s\"\n", ptr->scrn_device_str);
+ for (i = 0; i < ptr->num_gpu_devices; i++)
+ if (ptr->scrn_gpu_device_str[i])
+ fprintf(cf, "\tGPUDevice \"%s\"\n", ptr->scrn_gpu_device_str[i]);
if (ptr->scrn_monitor_str)
fprintf(cf, "\tMonitor \"%s\"\n", ptr->scrn_monitor_str);
if (ptr->scrn_defaultdepth)
@@ -422,26 +460,7 @@ xf86printScreenSection(FILE * cf, XF86ConfScreenPtr ptr)
}
-void
-xf86freeScreenList(XF86ConfScreenPtr ptr)
-{
- XF86ConfScreenPtr prev;
-
- while (ptr) {
- TestFree(ptr->scrn_identifier);
- TestFree(ptr->scrn_monitor_str);
- TestFree(ptr->scrn_device_str);
- TestFree(ptr->scrn_comment);
- xf86optionListFree(ptr->scrn_option_lst);
- xf86freeAdaptorLinkList(ptr->scrn_adaptor_lst);
- xf86freeDisplayList(ptr->scrn_display_lst);
- prev = ptr;
- ptr = ptr->list.next;
- free(prev);
- }
-}
-
-void
+static void
xf86freeAdaptorLinkList(XF86ConfAdaptorLinkPtr ptr)
{
XF86ConfAdaptorLinkPtr prev;
@@ -455,26 +474,20 @@ xf86freeAdaptorLinkList(XF86ConfAdaptorLinkPtr ptr)
}
void
-xf86freeDisplayList(XF86ConfDisplayPtr ptr)
-{
- XF86ConfDisplayPtr prev;
-
- while (ptr) {
- xf86freeModeList(ptr->disp_mode_lst);
- xf86optionListFree(ptr->disp_option_lst);
- prev = ptr;
- ptr = ptr->list.next;
- free(prev);
- }
-}
-
-void
-xf86freeModeList(XF86ModePtr ptr)
+xf86freeScreenList(XF86ConfScreenPtr ptr)
{
- XF86ModePtr prev;
-
+ XF86ConfScreenPtr prev;
+ int i;
while (ptr) {
- TestFree(ptr->mode_name);
+ TestFree(ptr->scrn_identifier);
+ TestFree(ptr->scrn_monitor_str);
+ TestFree(ptr->scrn_device_str);
+ for (i = 0; i < ptr->num_gpu_devices; i++)
+ TestFree(ptr->scrn_gpu_device_str[i]);
+ TestFree(ptr->scrn_comment);
+ xf86optionListFree(ptr->scrn_option_lst);
+ xf86freeAdaptorLinkList(ptr->scrn_adaptor_lst);
+ xf86freeDisplayList(ptr->scrn_display_lst);
prev = ptr;
ptr = ptr->list.next;
free(prev);
@@ -487,6 +500,7 @@ xf86validateScreen(XF86ConfigPtr p)
XF86ConfScreenPtr screen = p->conf_screen_lst;
XF86ConfMonitorPtr monitor;
XF86ConfAdaptorLinkPtr adaptor;
+ int i;
while (screen) {
if (screen->scrn_obso_driver && !screen->scrn_identifier)
@@ -505,6 +519,10 @@ xf86validateScreen(XF86ConfigPtr p)
screen->scrn_device =
xf86findDevice(screen->scrn_device_str, p->conf_device_lst);
+ for (i = 0; i < screen->num_gpu_devices; i++) {
+ screen->scrn_gpu_devices[i] =
+ xf86findDevice(screen->scrn_gpu_device_str[i], p->conf_device_lst);
+ }
adaptor = screen->scrn_adaptor_lst;
while (adaptor) {
adaptor->al_adaptor =
diff --git a/xserver/hw/xfree86/parser/Vendor.c b/xserver/hw/xfree86/parser/Vendor.c
index 4f6e510bb..f137a4eb9 100644
--- a/xserver/hw/xfree86/parser/Vendor.c
+++ b/xserver/hw/xfree86/parser/Vendor.c
@@ -68,6 +68,22 @@ static xf86ConfigSymTabRec VendorSubTab[] = {
{-1, ""},
};
+static void
+xf86freeVendorSubList(XF86ConfVendSubPtr ptr)
+{
+ XF86ConfVendSubPtr prev;
+
+ while (ptr) {
+ TestFree(ptr->vs_identifier);
+ TestFree(ptr->vs_name);
+ TestFree(ptr->vs_comment);
+ xf86optionListFree(ptr->vs_option_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ free(prev);
+ }
+}
+
#define CLEANUP xf86freeVendorSubList
static XF86ConfVendSubPtr
@@ -215,19 +231,3 @@ xf86freeVendorList(XF86ConfVendorPtr p)
xf86optionListFree(p->vnd_option_lst);
free(p);
}
-
-void
-xf86freeVendorSubList(XF86ConfVendSubPtr ptr)
-{
- XF86ConfVendSubPtr prev;
-
- while (ptr) {
- TestFree(ptr->vs_identifier);
- TestFree(ptr->vs_name);
- TestFree(ptr->vs_comment);
- xf86optionListFree(ptr->vs_option_lst);
- prev = ptr;
- ptr = ptr->list.next;
- free(prev);
- }
-}
diff --git a/xserver/hw/xfree86/parser/configProcs.h b/xserver/hw/xfree86/parser/configProcs.h
index 774e2a2da..171f8e85f 100644
--- a/xserver/hw/xfree86/parser/configProcs.h
+++ b/xserver/hw/xfree86/parser/configProcs.h
@@ -27,8 +27,7 @@
/* Private procs. Public procs are in xf86Parser.h and xf86Optrec.h */
-/* exported functions are/were used by the X Server, and need to be
- * made public when installing libxf86config */
+/* exported functions are/were used by the X Server */
/* Device.c */
XF86ConfDevicePtr xf86parseDeviceSection(void);
@@ -55,12 +54,10 @@ int xf86validateInput(XF86ConfigPtr p);
/* InputClass.c */
XF86ConfInputClassPtr xf86parseInputClassSection(void);
void xf86printInputClassSection(FILE * f, XF86ConfInputClassPtr ptr);
-void xf86freeInputClassList(XF86ConfInputClassPtr ptr);
/* OutputClass.c */
XF86ConfOutputClassPtr xf86parseOutputClassSection(void);
void xf86printOutputClassSection(FILE * f, XF86ConfOutputClassPtr ptr);
-void xf86freeOutputClassList(XF86ConfOutputClassPtr ptr);
/* Layout.c */
XF86ConfLayoutPtr xf86parseLayoutSection(void);
@@ -92,16 +89,12 @@ XF86ConfInputPtr xf86parsePointerSection(void);
XF86ConfScreenPtr xf86parseScreenSection(void);
void xf86printScreenSection(FILE * cf, XF86ConfScreenPtr ptr);
extern _X_EXPORT void xf86freeScreenList(XF86ConfScreenPtr ptr);
-void xf86freeAdaptorLinkList(XF86ConfAdaptorLinkPtr ptr);
-void xf86freeDisplayList(XF86ConfDisplayPtr ptr);
-void xf86freeModeList(XF86ModePtr ptr);
int xf86validateScreen(XF86ConfigPtr p);
/* Vendor.c */
XF86ConfVendorPtr xf86parseVendorSection(void);
void xf86freeVendorList(XF86ConfVendorPtr p);
void xf86printVendorSection(FILE * cf, XF86ConfVendorPtr ptr);
-void xf86freeVendorSubList(XF86ConfVendSubPtr ptr);
/* Video.c */
XF86ConfVideoAdaptorPtr xf86parseVideoAdaptorSection(void);
diff --git a/xserver/hw/xfree86/parser/xf86Parser.h b/xserver/hw/xfree86/parser/xf86Parser.h
index 43e17550c..b3a50e52f 100644
--- a/xserver/hw/xfree86/parser/xf86Parser.h
+++ b/xserver/hw/xfree86/parser/xf86Parser.h
@@ -259,6 +259,7 @@ typedef struct {
XF86ConfVideoAdaptorPtr al_adaptor;
} XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr;
+#define CONF_MAXGPUDEVICES 4
typedef struct {
GenericListRec list;
const char *scrn_identifier;
@@ -276,6 +277,10 @@ typedef struct {
char *scrn_comment;
int scrn_virtualX, scrn_virtualY;
char *match_seat;
+
+ int num_gpu_devices;
+ const char *scrn_gpu_device_str[CONF_MAXGPUDEVICES];
+ XF86ConfDevicePtr scrn_gpu_devices[CONF_MAXGPUDEVICES];
} XF86ConfScreenRec, *XF86ConfScreenPtr;
typedef struct {
diff --git a/xserver/hw/xfree86/parser/xf86tokens.h b/xserver/hw/xfree86/parser/xf86tokens.h
index 9c44970ea..bbd6b90d1 100644
--- a/xserver/hw/xfree86/parser/xf86tokens.h
+++ b/xserver/hw/xfree86/parser/xf86tokens.h
@@ -143,6 +143,7 @@ typedef enum {
/* Screen tokens */
OBSDRIVER,
MDEVICE,
+ GDEVICE,
MONITOR,
SCREENNO,
DEFAULTDEPTH,
diff --git a/xserver/hw/xfree86/ramdac/Makefile.in b/xserver/hw/xfree86/ramdac/Makefile.in
index ebe00cabe..7b0271f3b 100644
--- a/xserver/hw/xfree86/ramdac/Makefile.in
+++ b/xserver/hw/xfree86/ramdac/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -246,7 +245,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -376,8 +374,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/ramdac/TI.c b/xserver/hw/xfree86/ramdac/TI.c
index f8081caea..0ae1db57e 100644
--- a/xserver/hw/xfree86/ramdac/TI.c
+++ b/xserver/hw/xfree86/ramdac/TI.c
@@ -114,7 +114,7 @@ TIramdacCalculateMNPForClock(unsigned long RefClock, /* In 100Hz units */
VCO = 8.0 * IntRef * best_m / best_n;
ActualClock = VCO / (1 << p);
- DebugF("f_out=%ld f_vco=%.1f n=%d m=%d p=%d\n",
+ DebugF("f_out=%ld f_vco=%.1f n=%lu m=%lu p=%lu\n",
ActualClock, VCO, *rN, *rM, *rP);
return ActualClock;
diff --git a/xserver/hw/xfree86/ramdac/xf86Cursor.c b/xserver/hw/xfree86/ramdac/xf86Cursor.c
index 04496d531..c061b8028 100644
--- a/xserver/hw/xfree86/ramdac/xf86Cursor.c
+++ b/xserver/hw/xfree86/ramdac/xf86Cursor.c
@@ -340,12 +340,10 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
if (infoPtr->pScrn->vtSema && xorg_list_is_empty(&pScreen->pixmap_dirty_list) &&
(ScreenPriv->ForceHWCursorCount ||
((
-#ifdef ARGB_CURSOR
cursor->bits->argb &&
infoPtr->UseHWCursorARGB &&
(*infoPtr->UseHWCursorARGB)(pScreen, cursor)) ||
(cursor->bits->argb == 0 &&
-#endif
(cursor->bits->height <= infoPtr->MaxHeight) &&
(cursor->bits->width <= infoPtr->MaxWidth) &&
(!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, cursor)))))) {
@@ -387,6 +385,30 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
(*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, pCurs, x, y);
}
+/* Re-set the current cursor. This will switch between hardware and software
+ * cursor depending on whether hardware cursor is currently supported
+ * according to the driver.
+ */
+void
+xf86CursorResetCursor(ScreenPtr pScreen)
+{
+ xf86CursorScreenPtr ScreenPriv;
+
+ if (!inputInfo.pointer)
+ return;
+
+ if (!dixPrivateKeyRegistered(xf86CursorScreenKey))
+ return;
+
+ ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
+ xf86CursorScreenKey);
+ if (!ScreenPriv)
+ return;
+
+ xf86CursorSetCursor(inputInfo.pointer, pScreen, ScreenPriv->CurrentCursor,
+ ScreenPriv->x, ScreenPriv->y);
+}
+
static void
xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
diff --git a/xserver/hw/xfree86/ramdac/xf86Cursor.h b/xserver/hw/xfree86/ramdac/xf86Cursor.h
index a389a9988..6e88240d9 100644
--- a/xserver/hw/xfree86/ramdac/xf86Cursor.h
+++ b/xserver/hw/xfree86/ramdac/xf86Cursor.h
@@ -19,11 +19,9 @@ typedef struct _xf86CursorInfoRec {
unsigned char *(*RealizeCursor) (struct _xf86CursorInfoRec *, CursorPtr);
Bool (*UseHWCursor) (ScreenPtr, CursorPtr);
-#ifdef ARGB_CURSOR
Bool (*UseHWCursorARGB) (ScreenPtr, CursorPtr);
void (*LoadCursorARGB) (ScrnInfoPtr, CursorPtr);
Bool (*LoadCursorARGBCheck) (ScrnInfoPtr, CursorPtr);
-#endif
} xf86CursorInfoRec, *xf86CursorInfoPtr;
@@ -61,6 +59,7 @@ extern _X_EXPORT Bool xf86InitCursor(ScreenPtr pScreen,
xf86CursorInfoPtr infoPtr);
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);
#define HARDWARE_CURSOR_INVERT_MASK 0x00000001
@@ -77,8 +76,6 @@ extern _X_EXPORT void xf86ForceHWCursor(ScreenPtr pScreen, Bool on);
#define HARDWARE_CURSOR_NIBBLE_SWAPPED 0x00000800
#define HARDWARE_CURSOR_SHOW_TRANSPARENT 0x00001000
#define HARDWARE_CURSOR_UPDATE_UNHIDDEN 0x00002000
-#ifdef ARGB_CURSOR
#define HARDWARE_CURSOR_ARGB 0x00004000
-#endif
#endif /* _XF86CURSOR_H */
diff --git a/xserver/hw/xfree86/ramdac/xf86HWCurs.c b/xserver/hw/xfree86/ramdac/xf86HWCurs.c
index be7154e0f..84febe0df 100644
--- a/xserver/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/xserver/hw/xfree86/ramdac/xf86HWCurs.c
@@ -139,9 +139,7 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
-#ifdef ARGB_CURSOR
if (!pCurs->bits->argb || !xf86DriverHasLoadCursorARGB(infoPtr))
-#endif
if (!bits) {
bits = (*infoPtr->RealizeCursor) (infoPtr, pCurs);
dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen,
@@ -151,12 +149,10 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
(*infoPtr->HideCursor) (infoPtr->pScrn);
-#ifdef ARGB_CURSOR
if (pCurs->bits->argb && xf86DriverHasLoadCursorARGB(infoPtr)) {
if (!xf86DriverLoadCursorARGB (infoPtr, pCurs))
return FALSE;
} else
-#endif
if (bits)
if (!xf86DriverLoadCursorImage (infoPtr, bits))
return FALSE;
@@ -213,12 +209,10 @@ xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed)
xf86CursorScreenKey);
xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
-#ifdef ARGB_CURSOR
/* recoloring isn't applicable to ARGB cursors and drivers
shouldn't have to ignore SetCursorColors requests */
if (pCurs->bits->argb)
return;
-#endif
if (ScreenPriv->PalettedCursor) {
xColorItem sourceColor, maskColor;
diff --git a/xserver/hw/xfree86/sdksyms.sh b/xserver/hw/xfree86/sdksyms.sh
index 8344d0b67..1f6bcf505 100644
--- a/xserver/hw/xfree86/sdksyms.sh
+++ b/xserver/hw/xfree86/sdksyms.sh
@@ -54,7 +54,6 @@ cat > sdksyms.c << EOF
#include "xvmcext.h"
#endif
#include "geext.h"
-#include "geint.h"
#ifdef MITSHM
#include "shmint.h"
#endif
@@ -137,9 +136,6 @@ cat > sdksyms.c << EOF
# include "xf86xvmc.h"
# include "xf86xvpriv.h"
#endif
-#if XF86VIDMODE
-# include "vidmodeproc.h"
-#endif
#include "xorgVersion.h"
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
# include "xf86sbusBus.h"
@@ -180,12 +176,6 @@ cat > sdksyms.c << EOF
#endif
-/* hw/xfree86/dixmods/extmod/Makefile.am -- module */
-#ifdef XFreeXDGA
-#include "dgaproc.h"
-#endif
-
-
/* hw/xfree86/parser/Makefile.am */
#include "xf86Parser.h"
#include "xf86Optrec.h"
@@ -295,8 +285,6 @@ cat > sdksyms.c << EOF
#include "selection.h"
#include "servermd.h"
#include "site.h"
-#include "swaprep.h"
-#include "swapreq.h"
#include "validate.h"
#include "window.h"
#include "windowstr.h"
diff --git a/xserver/hw/xfree86/shadowfb/Makefile.in b/xserver/hw/xfree86/shadowfb/Makefile.in
index 330a1dfa1..5d5020b35 100644
--- a/xserver/hw/xfree86/shadowfb/Makefile.in
+++ b/xserver/hw/xfree86/shadowfb/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -250,7 +249,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -380,8 +378,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/utils/Makefile.in b/xserver/hw/xfree86/utils/Makefile.in
index f9cfc1efc..f4d373e29 100644
--- a/xserver/hw/xfree86/utils/Makefile.in
+++ b/xserver/hw/xfree86/utils/Makefile.in
@@ -55,8 +55,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -221,7 +220,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -351,8 +349,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/utils/cvt/Makefile.in b/xserver/hw/xfree86/utils/cvt/Makefile.in
index 62537761c..7c0ae9466 100644
--- a/xserver/hw/xfree86/utils/cvt/Makefile.in
+++ b/xserver/hw/xfree86/utils/cvt/Makefile.in
@@ -80,8 +80,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -243,7 +242,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -373,8 +371,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/utils/cvt/cvt.c b/xserver/hw/xfree86/utils/cvt/cvt.c
index d5df17fd9..9413c20fa 100644
--- a/xserver/hw/xfree86/utils/cvt/cvt.c
+++ b/xserver/hw/xfree86/utils/cvt/cvt.c
@@ -54,11 +54,11 @@ XNFalloc(unsigned long n)
/* xnfcalloc implementation used by the server code we built in */
void *
-XNFcalloc(unsigned long n)
+XNFcallocarray(size_t nmemb, size_t size)
{
void *r;
- r = calloc(1, n);
+ r = calloc(nmemb, size);
if (!r) {
perror("calloc failed");
exit(1);
diff --git a/xserver/hw/xfree86/utils/gtf/Makefile.in b/xserver/hw/xfree86/utils/gtf/Makefile.in
index e65ca6a95..20b382bc8 100644
--- a/xserver/hw/xfree86/utils/gtf/Makefile.in
+++ b/xserver/hw/xfree86/utils/gtf/Makefile.in
@@ -80,8 +80,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -242,7 +241,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -372,8 +370,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/utils/man/Makefile.in b/xserver/hw/xfree86/utils/man/Makefile.in
index eecccb6ba..420edf2ab 100644
--- a/xserver/hw/xfree86/utils/man/Makefile.in
+++ b/xserver/hw/xfree86/utils/man/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -213,7 +212,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -360,8 +358,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/vbe/Makefile.in b/xserver/hw/xfree86/vbe/Makefile.in
index 9fd68dfbc..522c489bd 100644
--- a/xserver/hw/xfree86/vbe/Makefile.in
+++ b/xserver/hw/xfree86/vbe/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -248,7 +247,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -378,8 +376,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/vbe/vbe.c b/xserver/hw/xfree86/vbe/vbe.c
index 5ea019733..ef12cb805 100644
--- a/xserver/hw/xfree86/vbe/vbe.c
+++ b/xserver/hw/xfree86/vbe/vbe.c
@@ -397,7 +397,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe)
i = 0;
while (modes[i] != 0xffff)
i++;
- block->VideoModePtr = malloc(sizeof(CARD16) * (i + 1));
+ block->VideoModePtr = xallocarray(i + 1, sizeof(CARD16));
memcpy(block->VideoModePtr, modes, sizeof(CARD16) * i);
block->VideoModePtr[i] = 0xffff;
@@ -825,7 +825,7 @@ VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num,
if (set)
return data;
- data = malloc(num * sizeof(CARD32));
+ data = xallocarray(num, sizeof(CARD32));
memcpy(data, pVbe->memory, num * sizeof(CARD32));
return data;
diff --git a/xserver/hw/xfree86/vgahw/Makefile.in b/xserver/hw/xfree86/vgahw/Makefile.in
index 7f75bbdbb..e116a2ccb 100644
--- a/xserver/hw/xfree86/vgahw/Makefile.in
+++ b/xserver/hw/xfree86/vgahw/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -249,7 +248,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -379,8 +377,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/x86emu/Makefile.in b/xserver/hw/xfree86/x86emu/Makefile.in
index 8c4ca341d..f20f4ee56 100644
--- a/xserver/hw/xfree86/x86emu/Makefile.in
+++ b/xserver/hw/xfree86/x86emu/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -217,7 +216,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -347,8 +345,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xfree86/x86emu/ops.c b/xserver/hw/xfree86/x86emu/ops.c
index 853792e7e..210f8ce64 100644
--- a/xserver/hw/xfree86/x86emu/ops.c
+++ b/xserver/hw/xfree86/x86emu/ops.c
@@ -8949,7 +8949,11 @@ x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
DECODE_PRINTF2("%x\n", imm);
RETURN_TRACE("RET", M.x86.saved_cs, M.x86.saved_ip);
TRACE_AND_STEP();
- M.x86.R_IP = pop_word();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EIP = pop_long();
+ } else {
+ M.x86.R_IP = pop_word();
+ }
M.x86.R_SP += imm;
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
@@ -8966,7 +8970,11 @@ x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
DECODE_PRINTF("RET\n");
RETURN_TRACE("RET", M.x86.saved_cs, M.x86.saved_ip);
TRACE_AND_STEP();
- M.x86.R_IP = pop_word();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EIP = pop_long();
+ } else {
+ M.x86.R_IP = pop_word();
+ }
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
}
@@ -9259,8 +9267,13 @@ x86emuOp_enter(u8 X86EMU_UNUSED(op1))
frame_pointer = M.x86.R_SP;
if (nesting > 0) {
for (i = 1; i < nesting; i++) {
- M.x86.R_BP -= 2;
- push_word(fetch_data_word_abs(M.x86.R_SS, M.x86.R_BP));
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_BP -= 4;
+ push_long(fetch_data_long_abs(M.x86.R_SS, M.x86.R_BP));
+ } else {
+ M.x86.R_BP -= 2;
+ push_word(fetch_data_word_abs(M.x86.R_SS, M.x86.R_BP));
+ }
}
push_word(frame_pointer);
}
@@ -9281,7 +9294,11 @@ x86emuOp_leave(u8 X86EMU_UNUSED(op1))
DECODE_PRINTF("LEAVE\n");
TRACE_AND_STEP();
M.x86.R_SP = M.x86.R_BP;
- M.x86.R_BP = pop_word();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = pop_long();
+ } else {
+ M.x86.R_BP = pop_word();
+ }
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
}
@@ -9301,8 +9318,13 @@ x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
DECODE_PRINTF2("%x\n", imm);
RETURN_TRACE("RETF", M.x86.saved_cs, M.x86.saved_ip);
TRACE_AND_STEP();
- M.x86.R_IP = pop_word();
- M.x86.R_CS = pop_word();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EIP = pop_long();
+ M.x86.R_CS = pop_long() & 0xffff;
+ } else {
+ M.x86.R_IP = pop_word();
+ M.x86.R_CS = pop_word();
+ }
M.x86.R_SP += imm;
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
@@ -9319,8 +9341,13 @@ x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
DECODE_PRINTF("RETF\n");
RETURN_TRACE("RETF", M.x86.saved_cs, M.x86.saved_ip);
TRACE_AND_STEP();
- M.x86.R_IP = pop_word();
- M.x86.R_CS = pop_word();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EIP = pop_long();
+ M.x86.R_CS = pop_long() & 0xffff;
+ } else {
+ M.x86.R_IP = pop_word();
+ M.x86.R_CS = pop_word();
+ }
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
}
@@ -9421,9 +9448,15 @@ x86emuOp_iret(u8 X86EMU_UNUSED(op1))
TRACE_AND_STEP();
- M.x86.R_IP = pop_word();
- M.x86.R_CS = pop_word();
- M.x86.R_FLG = pop_word();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EIP = pop_long();
+ M.x86.R_CS = pop_long() & 0xffff;
+ M.x86.R_EFLG = (pop_long() & 0x257FD5) | (M.x86.R_EFLG & 0x1A0000);
+ } else {
+ M.x86.R_IP = pop_word();
+ M.x86.R_CS = pop_word();
+ M.x86.R_FLG = pop_word();
+ }
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
}
@@ -11740,19 +11773,36 @@ x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
}
break;
case 2: /* call word ptr ... */
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(M.x86.R_EIP);
+ M.x86.R_EIP = destval;
+ } else {
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ }
break;
case 3: /* call far ptr ... */
- destval = fetch_data_word(destoffset);
- destval2 = fetch_data_word(destoffset + 2);
- TRACE_AND_STEP();
- push_word(M.x86.R_CS);
- M.x86.R_CS = destval2;
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ destval = fetch_data_long(destoffset);
+ destval2 = fetch_data_word(destoffset + 4);
+ TRACE_AND_STEP();
+ push_long(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_long(M.x86.R_EIP);
+ M.x86.R_EIP = destval;
+ } else {
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ }
break;
case 4: /* jmp word ptr ... */
destval = fetch_data_word(destoffset);
@@ -11825,19 +11875,36 @@ x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
}
break;
case 2: /* call word ptr ... */
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(M.x86.R_EIP);
+ M.x86.R_EIP = destval;
+ } else {
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ }
break;
case 3: /* call far ptr ... */
- destval = fetch_data_word(destoffset);
- destval2 = fetch_data_word(destoffset + 2);
- TRACE_AND_STEP();
- push_word(M.x86.R_CS);
- M.x86.R_CS = destval2;
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ destval = fetch_data_long(destoffset);
+ destval2 = fetch_data_word(destoffset + 4);
+ TRACE_AND_STEP();
+ push_long(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_long(M.x86.R_EIP);
+ M.x86.R_EIP = destval;
+ } else {
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ }
break;
case 4: /* jmp word ptr ... */
destval = fetch_data_word(destoffset);
@@ -11910,19 +11977,36 @@ x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
}
break;
case 2: /* call word ptr ... */
- destval = fetch_data_word(destoffset);
- TRACE_AND_STEP();
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(M.x86.R_EIP);
+ M.x86.R_EIP = destval;
+ } else {
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ }
break;
case 3: /* call far ptr ... */
- destval = fetch_data_word(destoffset);
- destval2 = fetch_data_word(destoffset + 2);
- TRACE_AND_STEP();
- push_word(M.x86.R_CS);
- M.x86.R_CS = destval2;
- push_word(M.x86.R_IP);
- M.x86.R_IP = destval;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ destval = fetch_data_long(destoffset);
+ destval2 = fetch_data_word(destoffset + 4);
+ TRACE_AND_STEP();
+ push_long(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_long(M.x86.R_EIP);
+ M.x86.R_EIP = destval;
+ } else {
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ }
break;
case 4: /* jmp word ptr ... */
destval = fetch_data_word(destoffset);
@@ -11993,11 +12077,19 @@ x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
}
break;
case 2: /* call word ptr ... */
- destreg = DECODE_RM_WORD_REGISTER(rl);
- DECODE_PRINTF("\n");
- TRACE_AND_STEP();
- push_word(M.x86.R_IP);
- M.x86.R_IP = *destreg;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ destreg = (u16 *)DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ push_long(M.x86.R_EIP);
+ M.x86.R_EIP = *destreg;
+ } else {
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = *destreg;
+ }
break;
case 3: /* jmp far ptr ... */
DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
diff --git a/xserver/hw/xfree86/xorg-wrapper.c b/xserver/hw/xfree86/xorg-wrapper.c
index 22e97ad5d..d93096294 100644
--- a/xserver/hw/xfree86/xorg-wrapper.c
+++ b/xserver/hw/xfree86/xorg-wrapper.c
@@ -24,6 +24,7 @@
*/
#include "dix-config.h"
+#include "xorg-config.h"
#include <errno.h>
#include <fcntl.h>
@@ -39,8 +40,12 @@
#include <sys/consio.h>
#endif
#include <unistd.h>
+#ifdef WITH_LIBDRM
#include <drm.h>
#include <xf86drm.h> /* For DRM_DEV_NAME */
+#endif
+
+#include "misc.h"
#define CONFIG_FILE SYSCONFDIR "/X11/Xwrapper.config"
@@ -183,13 +188,16 @@ static int on_console(int fd)
int main(int argc, char *argv[])
{
+#ifdef WITH_LIBDRM
struct drm_mode_card_res res;
+#endif
char buf[PATH_MAX];
int i, r, fd;
int kms_cards = 0;
int total_cards = 0;
int allowed = CONSOLE_ONLY;
int needs_root_rights = -1;
+ char *const empty_envp[1] = { NULL, };
progname = argv[0];
@@ -219,6 +227,7 @@ int main(int argc, char *argv[])
}
}
+#ifdef WITH_LIBDRM
/* Detect if we need root rights, except when overriden by the config */
if (needs_root_rights == -1) {
for (i = 0; i < 16; i++) {
@@ -237,6 +246,7 @@ int main(int argc, char *argv[])
close(fd);
}
}
+#endif
/* If we've found cards, and all cards support kms, drop root rights */
if (needs_root_rights == 0 || (total_cards && kms_cards == total_cards)) {
@@ -265,7 +275,10 @@ int main(int argc, char *argv[])
}
argv[0] = buf;
- (void) execv(argv[0], argv);
+ if (getuid() == geteuid())
+ (void) execv(argv[0], argv);
+ else
+ (void) execve(argv[0], argv, empty_envp);
fprintf(stderr, "%s: Failed to execute %s: %s\n",
progname, buf, strerror(errno));
exit(1);
diff --git a/xserver/hw/xnest/Color.c b/xserver/hw/xnest/Color.c
index 8d9d35621..3a9e42203 100644
--- a/xserver/hw/xnest/Color.c
+++ b/xserver/hw/xnest/Color.c
@@ -62,7 +62,7 @@ xnestCreateColormap(ColormapPtr pCmap)
switch (pVisual->class) {
case StaticGray: /* read only */
- colors = (XColor *) malloc(ncolors * sizeof(XColor));
+ colors = xallocarray(ncolors, sizeof(XColor));
for (i = 0; i < ncolors; i++)
colors[i].pixel = i;
XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors);
@@ -75,7 +75,7 @@ xnestCreateColormap(ColormapPtr pCmap)
break;
case StaticColor: /* read only */
- colors = (XColor *) malloc(ncolors * sizeof(XColor));
+ colors = xallocarray(ncolors, sizeof(XColor));
for (i = 0; i < ncolors; i++)
colors[i].pixel = i;
XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors);
@@ -88,7 +88,7 @@ xnestCreateColormap(ColormapPtr pCmap)
break;
case TrueColor: /* read only */
- colors = (XColor *) malloc(ncolors * sizeof(XColor));
+ colors = xallocarray(ncolors, sizeof(XColor));
red = green = blue = 0L;
redInc = lowbit(pVisual->redMask);
greenInc = lowbit(pVisual->greenMask);
@@ -194,14 +194,12 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen)
xnestInstalledColormapWindows icws;
int numWindows;
- icws.cmapIDs = (Colormap *) malloc(pScreen->maxInstalledCmaps *
- sizeof(Colormap));
+ icws.cmapIDs = xallocarray(pScreen->maxInstalledCmaps, sizeof(Colormap));
icws.numCmapIDs = xnestListInstalledColormaps(pScreen, icws.cmapIDs);
icws.numWindows = 0;
WalkTree(pScreen, xnestCountInstalledColormapWindows, (void *) &icws);
if (icws.numWindows) {
- icws.windows =
- (Window *) malloc((icws.numWindows + 1) * sizeof(Window));
+ icws.windows = xallocarray(icws.numWindows + 1, sizeof(Window));
icws.index = 0;
WalkTree(pScreen, xnestGetInstalledColormapWindows, (void *) &icws);
icws.windows[icws.numWindows] = xnestDefaultWindows[pScreen->myNum];
@@ -220,8 +218,7 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen)
#ifdef _XSERVER64
{
int i;
- Window64 *windows =
- (Window64 *) malloc(numWindows * sizeof(Window64));
+ Window64 *windows = xallocarray(numWindows, sizeof(Window64));
for (i = 0; i < numWindows; ++i)
windows[i] = icws.windows[i];
@@ -393,7 +390,7 @@ xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem * pColors)
#ifdef _XSERVER64
{
int i;
- XColor *pColors64 = (XColor *) malloc(nColors * sizeof(XColor));
+ XColor *pColors64 = xallocarray(nColors, sizeof(XColor));
for (i = 0; i < nColors; ++i) {
pColors64[i].pixel = pColors[i].pixel;
diff --git a/xserver/hw/xnest/Display.c b/xserver/hw/xnest/Display.c
index a2f8acbaa..e6d07dfd1 100644
--- a/xserver/hw/xnest/Display.c
+++ b/xserver/hw/xnest/Display.c
@@ -121,8 +121,8 @@ xnestOpenDisplay(int argc, char *argv[])
}
xnestNumDefaultColormaps = xnestNumVisuals;
- xnestDefaultColormaps = (Colormap *) malloc(xnestNumDefaultColormaps *
- sizeof(Colormap));
+ xnestDefaultColormaps = xallocarray(xnestNumDefaultColormaps,
+ sizeof(Colormap));
for (i = 0; i < xnestNumDefaultColormaps; i++)
xnestDefaultColormaps[i] = XCreateColormap(xnestDisplay,
DefaultRootWindow
diff --git a/xserver/hw/xnest/Events.c b/xserver/hw/xnest/Events.c
index 3ff095bb8..f727557ba 100644
--- a/xserver/hw/xnest/Events.c
+++ b/xserver/hw/xnest/Events.c
@@ -103,7 +103,7 @@ void
xnestQueueKeyEvent(int type, unsigned int keycode)
{
lastEventTime = GetTimeInMillis();
- QueueKeyboardEvents(xnestKeyboardDevice, type, keycode, NULL);
+ QueueKeyboardEvents(xnestKeyboardDevice, type, keycode);
}
void
diff --git a/xserver/hw/xnest/GC.c b/xserver/hw/xnest/GC.c
index 96af6eb91..ecfa61e39 100644
--- a/xserver/hw/xnest/GC.c
+++ b/xserver/hw/xnest/GC.c
@@ -190,7 +190,7 @@ xnestDestroyGC(GCPtr pGC)
void
xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects)
{
- int i, size;
+ int i;
BoxPtr pBox;
XRectangle *pRects;
@@ -204,8 +204,7 @@ xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects)
case CT_REGION:
nRects = RegionNumRects((RegionPtr) pValue);
- size = nRects * sizeof(*pRects);
- pRects = (XRectangle *) malloc(size);
+ pRects = xallocarray(nRects, sizeof(*pRects));
pBox = RegionRects((RegionPtr) pValue);
for (i = nRects; i-- > 0;) {
pRects[i].x = pBox[i].x1;
diff --git a/xserver/hw/xnest/Keyboard.c b/xserver/hw/xnest/Keyboard.c
index ae8375ee3..85deabab4 100644
--- a/xserver/hw/xnest/Keyboard.c
+++ b/xserver/hw/xnest/Keyboard.c
@@ -22,7 +22,6 @@ is" without express or implied warranty.
#include <X11/X.h>
#include <X11/Xproto.h>
-#include <xcb/xcb_keysyms.h>
#include <X11/keysym.h>
#include "screenint.h"
#include "inputstr.h"
@@ -138,7 +137,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
max_keycode - min_keycode + 1,
&mapWidth);
len = (max_keycode - min_keycode + 1) * mapWidth;
- keymap = (KeySym *) malloc(len * sizeof(KeySym));
+ keymap = xallocarray(len, sizeof(KeySym));
for (i = 0; i < len; ++i)
keymap[i] = keymap64[i];
XFree(keymap64);
@@ -252,7 +251,7 @@ xnestUpdateModifierState(unsigned int state)
for (key = 0; key < MAP_LENGTH; key++)
if (keyc->xkbInfo->desc->map->modmap[key] & mask) {
- if (mask == XCB_MOD_MASK_LOCK) {
+ if (mask == LockMask) {
xnestQueueKeyEvent(KeyPress, key);
xnestQueueKeyEvent(KeyRelease, key);
}
@@ -270,7 +269,7 @@ xnestUpdateModifierState(unsigned int state)
for (key = 0; key < MAP_LENGTH; key++)
if (keyc->xkbInfo->desc->map->modmap[key] & mask) {
xnestQueueKeyEvent(KeyPress, key);
- if (mask == XCB_MOD_MASK_LOCK)
+ if (mask == LockMask)
xnestQueueKeyEvent(KeyRelease, key);
break;
}
diff --git a/xserver/hw/xnest/Makefile.in b/xserver/hw/xnest/Makefile.in
index 2340b1239..a04316e24 100644
--- a/xserver/hw/xnest/Makefile.in
+++ b/xserver/hw/xnest/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -266,7 +265,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -396,8 +394,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xnest/Screen.c b/xserver/hw/xnest/Screen.c
index abb4d372d..214b55015 100644
--- a/xserver/hw/xnest/Screen.c
+++ b/xserver/hw/xnest/Screen.c
@@ -158,7 +158,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
if (!dixRegisterPrivateKey(&xnestCursorScreenKeyRec, PRIVATE_SCREEN, 0))
return FALSE;
- visuals = (VisualPtr) malloc(xnestNumVisuals * sizeof(VisualRec));
+ visuals = xallocarray(xnestNumVisuals, sizeof(VisualRec));
numVisuals = 0;
depths = (DepthPtr) malloc(MAXDEPTH * sizeof(DepthRec));
@@ -224,7 +224,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
numVisuals++;
}
- visuals = (VisualPtr) realloc(visuals, numVisuals * sizeof(VisualRec));
+ visuals = reallocarray(visuals, numVisuals, sizeof(VisualRec));
defaultVisual = visuals[xnestDefaultVisualIndex].vid;
rootDepth = visuals[xnestDefaultVisualIndex].nplanes;
diff --git a/xserver/hw/xnest/man/Makefile.in b/xserver/hw/xnest/man/Makefile.in
index 879378b13..34bca49af 100644
--- a/xserver/hw/xnest/man/Makefile.in
+++ b/xserver/hw/xnest/man/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -213,7 +212,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -360,8 +358,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xquartz/GL/Makefile.in b/xserver/hw/xquartz/GL/Makefile.in
index f05e29d95..2545ba506 100644
--- a/xserver/hw/xquartz/GL/Makefile.in
+++ b/xserver/hw/xquartz/GL/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -216,7 +215,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -346,8 +344,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xquartz/Makefile.in b/xserver/hw/xquartz/Makefile.in
index a4c0323d0..743b4d3a4 100644
--- a/xserver/hw/xquartz/Makefile.in
+++ b/xserver/hw/xquartz/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -272,7 +271,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -402,8 +400,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xquartz/bundle/Makefile.in b/xserver/hw/xquartz/bundle/Makefile.in
index 9825b84a8..0f1abb661 100644
--- a/xserver/hw/xquartz/bundle/Makefile.in
+++ b/xserver/hw/xquartz/bundle/Makefile.in
@@ -65,8 +65,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -220,7 +219,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -350,8 +348,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xquartz/darwinEvents.c b/xserver/hw/xquartz/darwinEvents.c
index 6964e2009..7f34e0c68 100644
--- a/xserver/hw/xquartz/darwinEvents.c
+++ b/xserver/hw/xquartz/darwinEvents.c
@@ -275,7 +275,7 @@ DarwinEventHandler(int screenNum, InternalEvent *ie, DeviceIntPtr dev)
break;
case kXquartzSetRootClip:
- QuartzSetRootClip((Bool)e->data[0]);
+ QuartzSetRootClip(e->data[0]);
break;
case kXquartzQuit:
@@ -453,8 +453,7 @@ DarwinInputReleaseButtonsAndKeys(DeviceIntPtr pDev)
if (pDev->key) {
for (i = 0; i < NUM_KEYCODES; i++) {
if (BitIsOn(pDev->key->down, i + MIN_KEYCODE)) {
- QueueKeyboardEvents(pDev, KeyRelease, i + MIN_KEYCODE,
- NULL);
+ QueueKeyboardEvents(pDev, KeyRelease, i + MIN_KEYCODE);
}
}
}
@@ -608,8 +607,7 @@ DarwinSendKeyboardEvents(int ev_type, int keycode)
darwinEvents_lock();
{
- QueueKeyboardEvents(darwinKeyboard, ev_type, keycode + MIN_KEYCODE,
- NULL);
+ QueueKeyboardEvents(darwinKeyboard, ev_type, keycode + MIN_KEYCODE);
DarwinPokeEQ();
} darwinEvents_unlock();
}
diff --git a/xserver/hw/xquartz/mach-startup/Makefile.in b/xserver/hw/xquartz/mach-startup/Makefile.in
index 98f10d951..2ae4f8196 100644
--- a/xserver/hw/xquartz/mach-startup/Makefile.in
+++ b/xserver/hw/xquartz/mach-startup/Makefile.in
@@ -72,8 +72,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -251,7 +250,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -381,8 +379,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xquartz/man/Makefile.in b/xserver/hw/xquartz/man/Makefile.in
index f2bc36e2d..5cebdaadd 100644
--- a/xserver/hw/xquartz/man/Makefile.in
+++ b/xserver/hw/xquartz/man/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -213,7 +212,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -360,8 +358,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xquartz/pbproxy/Makefile.in b/xserver/hw/xquartz/pbproxy/Makefile.in
index b45b556f4..44d898cd5 100644
--- a/xserver/hw/xquartz/pbproxy/Makefile.in
+++ b/xserver/hw/xquartz/pbproxy/Makefile.in
@@ -60,8 +60,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -246,7 +245,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -376,8 +374,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xquartz/quartz.c b/xserver/hw/xquartz/quartz.c
index d7229cecb..c8b6f966d 100644
--- a/xserver/hw/xquartz/quartz.c
+++ b/xserver/hw/xquartz/quartz.c
@@ -43,6 +43,7 @@
#include "darwinEvents.h"
#include "pseudoramiX.h"
#include "extension.h"
+#include "nonsdk_extinit.h"
#include "glx_extinit.h"
#define _APPLEWM_SERVER_
#include "applewmExt.h"
@@ -299,8 +300,8 @@ QuartzUpdateScreens(void)
quartzProcs->UpdateScreen(pScreen);
- /* miPaintWindow needs to be called after RootlessUpdateScreenPixmap (from xprUpdateScreen) */
- miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
+ /* PaintWindow needs to be called after RootlessUpdateScreenPixmap (from xprUpdateScreen) */
+ pScreen->PaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
/* Tell RandR about the new size, so new connections get the correct info */
RRScreenSizeNotify(pScreen);
@@ -484,7 +485,7 @@ QuartzHide(void)
* Enable or disable rendering to the X screen.
*/
void
-QuartzSetRootClip(BOOL enable)
+QuartzSetRootClip(int mode)
{
int i;
@@ -493,7 +494,7 @@ QuartzSetRootClip(BOOL enable)
for (i = 0; i < screenInfo.numScreens; i++) {
if (screenInfo.screens[i]) {
- SetRootClip(screenInfo.screens[i], enable);
+ SetRootClip(screenInfo.screens[i], mode);
}
}
}
diff --git a/xserver/hw/xquartz/quartz.h b/xserver/hw/xquartz/quartz.h
index 47c44162f..ddbf2e780 100644
--- a/xserver/hw/xquartz/quartz.h
+++ b/xserver/hw/xquartz/quartz.h
@@ -149,7 +149,7 @@ QuartzShow(void);
void
QuartzHide(void);
void
-QuartzSetRootClip(BOOL enable);
+QuartzSetRootClip(int mode);
void
QuartzSpaceChanged(uint32_t space_id);
diff --git a/xserver/hw/xquartz/xpr/Makefile.in b/xserver/hw/xquartz/xpr/Makefile.in
index 3e8892ff4..e36e69cad 100644
--- a/xserver/hw/xquartz/xpr/Makefile.in
+++ b/xserver/hw/xquartz/xpr/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -217,7 +216,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -347,8 +345,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xquartz/xpr/xprCursor.c b/xserver/hw/xquartz/xpr/xprCursor.c
index 4168f7c53..5e89348c0 100644
--- a/xserver/hw/xquartz/xpr/xprCursor.c
+++ b/xserver/hw/xquartz/xpr/xprCursor.c
@@ -85,7 +85,6 @@ load_cursor(CursorPtr src, int screen)
hot_x = src->bits->xhot;
hot_y = src->bits->yhot;
-#ifdef ARGB_CURSOR
if (src->bits->argb != NULL) {
#if BITMAP_BIT_ORDER == MSBFirst
rowbytes = src->bits->width * sizeof(CARD32);
@@ -104,7 +103,6 @@ load_cursor(CursorPtr src, int screen)
#endif
}
else
-#endif
{
fg_color = 0xFF00 | (src->foreRed >> 8);
fg_color <<= 16;
diff --git a/xserver/hw/xquartz/xpr/xprScreen.c b/xserver/hw/xquartz/xpr/xprScreen.c
index d0a525ff4..30f2218b6 100644
--- a/xserver/hw/xquartz/xpr/xprScreen.c
+++ b/xserver/hw/xquartz/xpr/xprScreen.c
@@ -54,6 +54,8 @@
#include "damage.h"
#endif
+#include "nonsdk_extinit.h"
+
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
// From NSApplication.h
extern const double NSAppKitVersionNumber;
diff --git a/xserver/hw/xwayland/Makefile.am b/xserver/hw/xwayland/Makefile.am
index ab1bbb6a5..0e6a1eaa2 100644
--- a/xserver/hw/xwayland/Makefile.am
+++ b/xserver/hw/xwayland/Makefile.am
@@ -16,6 +16,7 @@ Xwayland_SOURCES = \
xwayland-shm.c \
xwayland-output.c \
xwayland-cvt.c \
+ xwayland-vidmode.c \
xwayland.h \
$(top_srcdir)/Xext/dpmsstubs.c \
$(top_srcdir)/Xi/stubs.c \
@@ -25,12 +26,18 @@ Xwayland_LDADD = \
$(glamor_lib) \
$(XWAYLAND_LIBS) \
$(XWAYLAND_SYS_LIBS) \
+ $(top_builddir)/Xext/libXvidmode.la \
$(XSERVER_SYS_LIBS)
Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
if GLAMOR_EGL
-Xwayland_SOURCES += xwayland-glamor.c
+Xwayland_SOURCES += \
+ xwayland-glamor.c
+if XV
+Xwayland_SOURCES += \
+ xwayland-glamor-xv.c
+endif
nodist_Xwayland_SOURCES = \
drm-client-protocol.h \
diff --git a/xserver/hw/xwayland/Makefile.in b/xserver/hw/xwayland/Makefile.in
index 791a36ba2..6a2d5cfa9 100644
--- a/xserver/hw/xwayland/Makefile.in
+++ b/xserver/hw/xwayland/Makefile.in
@@ -51,10 +51,16 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = Xwayland$(EXEEXT)
-@GLAMOR_EGL_TRUE@am__append_1 = xwayland-glamor.c
-@GLAMOR_EGL_TRUE@am__append_2 = $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL
+@GLAMOR_EGL_TRUE@am__append_1 = \
+@GLAMOR_EGL_TRUE@ xwayland-glamor.c
+
+@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_FALSE@Xwayland_DEPENDENCIES = $(glamor_lib) \
@GLAMOR_EGL_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+@GLAMOR_EGL_FALSE@ $(top_builddir)/Xext/libXvidmode.la \
@GLAMOR_EGL_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
subdir = hw/xwayland
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
@@ -63,8 +69,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -82,18 +87,21 @@ am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am__Xwayland_SOURCES_DIST = xwayland.c xwayland-input.c \
xwayland-cursor.c xwayland-shm.c xwayland-output.c \
- xwayland-cvt.c xwayland.h $(top_srcdir)/Xext/dpmsstubs.c \
- $(top_srcdir)/Xi/stubs.c $(top_srcdir)/mi/miinitext.c \
- xwayland-glamor.c
+ xwayland-cvt.c xwayland-vidmode.c xwayland.h \
+ $(top_srcdir)/Xext/dpmsstubs.c $(top_srcdir)/Xi/stubs.c \
+ $(top_srcdir)/mi/miinitext.c xwayland-glamor.c \
+ xwayland-glamor-xv.c
@GLAMOR_EGL_TRUE@am__objects_1 = Xwayland-xwayland-glamor.$(OBJEXT)
+@GLAMOR_EGL_TRUE@@XV_TRUE@am__objects_2 = Xwayland-xwayland-glamor-xv.$(OBJEXT)
am_Xwayland_OBJECTS = Xwayland-xwayland.$(OBJEXT) \
Xwayland-xwayland-input.$(OBJEXT) \
Xwayland-xwayland-cursor.$(OBJEXT) \
Xwayland-xwayland-shm.$(OBJEXT) \
Xwayland-xwayland-output.$(OBJEXT) \
- Xwayland-xwayland-cvt.$(OBJEXT) Xwayland-dpmsstubs.$(OBJEXT) \
- Xwayland-stubs.$(OBJEXT) Xwayland-miinitext.$(OBJEXT) \
- $(am__objects_1)
+ Xwayland-xwayland-cvt.$(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)
Xwayland_OBJECTS = $(am_Xwayland_OBJECTS) $(nodist_Xwayland_OBJECTS)
@@ -242,7 +250,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -372,8 +379,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -507,11 +512,13 @@ Xwayland_CFLAGS = \
$(GBM_CFLAGS)
Xwayland_SOURCES = xwayland.c xwayland-input.c xwayland-cursor.c \
- xwayland-shm.c xwayland-output.c xwayland-cvt.c xwayland.h \
- $(top_srcdir)/Xext/dpmsstubs.c $(top_srcdir)/Xi/stubs.c \
- $(top_srcdir)/mi/miinitext.c $(am__append_1)
+ xwayland-shm.c xwayland-output.c xwayland-cvt.c \
+ xwayland-vidmode.c xwayland.h $(top_srcdir)/Xext/dpmsstubs.c \
+ $(top_srcdir)/Xi/stubs.c $(top_srcdir)/mi/miinitext.c \
+ $(am__append_1) $(am__append_2)
Xwayland_LDADD = $(glamor_lib) $(XWAYLAND_LIBS) $(XWAYLAND_SYS_LIBS) \
- $(XSERVER_SYS_LIBS) $(am__append_2)
+ $(top_builddir)/Xext/libXvidmode.la $(XSERVER_SYS_LIBS) \
+ $(am__append_3)
Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
@GLAMOR_EGL_TRUE@nodist_Xwayland_SOURCES = \
@GLAMOR_EGL_TRUE@ drm-client-protocol.h \
@@ -617,10 +624,12 @@ distclean-compile:
@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@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-glamor-xv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-glamor.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-input.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-output.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-shm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland-vidmode.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xwayland-xwayland.Po@am__quote@
.c.o:
@@ -728,6 +737,20 @@ Xwayland-xwayland-cvt.obj: xwayland-cvt.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-xwayland-cvt.obj `if test -f 'xwayland-cvt.c'; then $(CYGPATH_W) 'xwayland-cvt.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-cvt.c'; fi`
+Xwayland-xwayland-vidmode.o: xwayland-vidmode.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-vidmode.o -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-vidmode.Tpo -c -o Xwayland-xwayland-vidmode.o `test -f 'xwayland-vidmode.c' || echo '$(srcdir)/'`xwayland-vidmode.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-vidmode.Tpo $(DEPDIR)/Xwayland-xwayland-vidmode.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-vidmode.c' object='Xwayland-xwayland-vidmode.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-xwayland-vidmode.o `test -f 'xwayland-vidmode.c' || echo '$(srcdir)/'`xwayland-vidmode.c
+
+Xwayland-xwayland-vidmode.obj: xwayland-vidmode.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-vidmode.obj -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-vidmode.Tpo -c -o Xwayland-xwayland-vidmode.obj `if test -f 'xwayland-vidmode.c'; then $(CYGPATH_W) 'xwayland-vidmode.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-vidmode.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-vidmode.Tpo $(DEPDIR)/Xwayland-xwayland-vidmode.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-vidmode.c' object='Xwayland-xwayland-vidmode.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-xwayland-vidmode.obj `if test -f 'xwayland-vidmode.c'; then $(CYGPATH_W) 'xwayland-vidmode.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-vidmode.c'; fi`
+
Xwayland-dpmsstubs.o: $(top_srcdir)/Xext/dpmsstubs.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-dpmsstubs.o -MD -MP -MF $(DEPDIR)/Xwayland-dpmsstubs.Tpo -c -o Xwayland-dpmsstubs.o `test -f '$(top_srcdir)/Xext/dpmsstubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xext/dpmsstubs.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-dpmsstubs.Tpo $(DEPDIR)/Xwayland-dpmsstubs.Po
@@ -784,6 +807,20 @@ Xwayland-xwayland-glamor.obj: xwayland-glamor.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-xwayland-glamor.obj `if test -f 'xwayland-glamor.c'; then $(CYGPATH_W) 'xwayland-glamor.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-glamor.c'; fi`
+Xwayland-xwayland-glamor-xv.o: xwayland-glamor-xv.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-glamor-xv.o -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-glamor-xv.Tpo -c -o Xwayland-xwayland-glamor-xv.o `test -f 'xwayland-glamor-xv.c' || echo '$(srcdir)/'`xwayland-glamor-xv.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-glamor-xv.Tpo $(DEPDIR)/Xwayland-xwayland-glamor-xv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-glamor-xv.c' object='Xwayland-xwayland-glamor-xv.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-xwayland-glamor-xv.o `test -f 'xwayland-glamor-xv.c' || echo '$(srcdir)/'`xwayland-glamor-xv.c
+
+Xwayland-xwayland-glamor-xv.obj: xwayland-glamor-xv.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-xwayland-glamor-xv.obj -MD -MP -MF $(DEPDIR)/Xwayland-xwayland-glamor-xv.Tpo -c -o Xwayland-xwayland-glamor-xv.obj `if test -f 'xwayland-glamor-xv.c'; then $(CYGPATH_W) 'xwayland-glamor-xv.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-glamor-xv.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-xwayland-glamor-xv.Tpo $(DEPDIR)/Xwayland-xwayland-glamor-xv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland-glamor-xv.c' object='Xwayland-xwayland-glamor-xv.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-xwayland-glamor-xv.obj `if test -f 'xwayland-glamor-xv.c'; then $(CYGPATH_W) 'xwayland-glamor-xv.c'; else $(CYGPATH_W) '$(srcdir)/xwayland-glamor-xv.c'; fi`
+
Xwayland-drm-protocol.o: drm-protocol.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(Xwayland_CFLAGS) $(CFLAGS) -MT Xwayland-drm-protocol.o -MD -MP -MF $(DEPDIR)/Xwayland-drm-protocol.Tpo -c -o Xwayland-drm-protocol.o `test -f 'drm-protocol.c' || echo '$(srcdir)/'`drm-protocol.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Xwayland-drm-protocol.Tpo $(DEPDIR)/Xwayland-drm-protocol.Po
diff --git a/xserver/hw/xwayland/xwayland-cursor.c b/xserver/hw/xwayland/xwayland-cursor.c
index c137e1ec0..76729db9e 100644
--- a/xserver/hw/xwayland/xwayland-cursor.c
+++ b/xserver/hw/xwayland/xwayland-cursor.c
@@ -199,6 +199,7 @@ xwl_cross_screen(ScreenPtr pScreen, Bool entering)
static void
xwl_pointer_warp_cursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
+ miPointerWarpCursor(pDev, pScreen, x, y);
}
static miPointerScreenFuncRec xwl_pointer_screen_funcs = {
diff --git a/xserver/hw/xwayland/xwayland-cvt.c b/xserver/hw/xwayland/xwayland-cvt.c
index 35665597f..9655e104e 100644
--- a/xserver/hw/xwayland/xwayland-cvt.c
+++ b/xserver/hw/xwayland/xwayland-cvt.c
@@ -296,8 +296,8 @@ xwayland_cvt(int HDisplay, int VDisplay, float VRefresh, Bool Reduced,
if (Interlaced)
modeinfo.modeFlags |= RR_Interlace;
- snprintf(name, sizeof name, "%dx%d@%.1fHz",
- modeinfo.width, modeinfo.height, VRefresh);
+ snprintf(name, sizeof name, "%dx%d",
+ modeinfo.width, modeinfo.height);
modeinfo.nameLength = strlen(name);
return RRModeGet(&modeinfo, name);
diff --git a/xserver/hw/xwayland/xwayland-glamor-xv.c b/xserver/hw/xwayland/xwayland-glamor-xv.c
new file mode 100644
index 000000000..c99418d43
--- /dev/null
+++ b/xserver/hw/xwayland/xwayland-glamor-xv.c
@@ -0,0 +1,412 @@
+/*
+ * Copyright (c) 1998-2003 by The XFree86 Project, Inc.
+ * Copyright © 2013 Red Hat
+ * Copyright © 2014 Intel Corporation
+ * Copyright © 2016 Red Hat
+ *
+ * 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:
+ * Olivier Fourdan <ofourdan@redhat.com>
+ *
+ * Derived from the glamor_xf86_xv, ephyr_glamor_xv and xf86xv
+ * implementations
+ */
+
+#include "xwayland.h"
+#include "glamor_priv.h"
+
+#include <X11/extensions/Xv.h>
+
+#define NUM_FORMATS 3
+#define NUM_PORTS 16
+#define ADAPTOR_NAME "glamor textured video"
+#define ENCODER_NAME "XV_IMAGE"
+
+static DevPrivateKeyRec xwlXvScreenPrivateKeyRec;
+#define xwlXvScreenPrivateKey (&xwlXvScreenPrivateKeyRec)
+
+typedef struct {
+ XvAdaptorPtr glxv_adaptor; /* We have only one adaptor, glamor Xv */
+ glamor_port_private *port_privates;
+
+ CloseScreenProcPtr CloseScreen;
+} xwlXvScreenRec, *xwlXvScreenPtr;
+
+typedef struct {
+ char depth;
+ short class;
+} xwlVideoFormatRec, *xwlVideoFormatPtr;
+
+static xwlVideoFormatRec Formats[NUM_FORMATS] = {
+ {15, TrueColor},
+ {16, TrueColor},
+ {24, TrueColor}
+};
+
+static int
+xwl_glamor_xv_stop_video(XvPortPtr pPort,
+ DrawablePtr pDraw)
+{
+ glamor_port_private *gpp = (glamor_port_private *) (pPort->devPriv.ptr);
+
+ if (pDraw->type != DRAWABLE_WINDOW)
+ return BadAlloc;
+
+ glamor_xv_stop_video(gpp);
+
+ return Success;
+}
+
+static int
+xwl_glamor_xv_set_port_attribute(XvPortPtr pPort,
+ Atom attribute,
+ INT32 value)
+{
+ glamor_port_private *gpp = (glamor_port_private *) (pPort->devPriv.ptr);
+
+ return glamor_xv_set_port_attribute(gpp, attribute, value);
+}
+
+static int
+xwl_glamor_xv_get_port_attribute(XvPortPtr pPort,
+ Atom attribute,
+ INT32 *pValue)
+{
+ glamor_port_private *gpp = (glamor_port_private *) (pPort->devPriv.ptr);
+
+ return glamor_xv_get_port_attribute(gpp, attribute, pValue);
+}
+
+static int
+xwl_glamor_xv_query_best_size(XvPortPtr pPort,
+ CARD8 motion,
+ CARD16 vid_w,
+ CARD16 vid_h,
+ CARD16 drw_w,
+ CARD16 drw_h,
+ unsigned int *p_w,
+ unsigned int *p_h)
+{
+ *p_w = drw_w;
+ *p_h = drw_h;
+
+ return Success;
+}
+
+static int
+xwl_glamor_xv_query_image_attributes(XvPortPtr pPort,
+ XvImagePtr format,
+ CARD16 *width,
+ CARD16 *height,
+ int *pitches,
+ int *offsets)
+{
+ return glamor_xv_query_image_attributes(format->id,
+ width,
+ height,
+ pitches,
+ offsets);
+}
+
+static int
+xwl_glamor_xv_put_image(DrawablePtr pDrawable,
+ XvPortPtr pPort,
+ GCPtr pGC,
+ INT16 src_x,
+ INT16 src_y,
+ CARD16 src_w,
+ CARD16 src_h,
+ INT16 drw_x,
+ INT16 drw_y,
+ CARD16 drw_w,
+ CARD16 drw_h,
+ XvImagePtr format,
+ unsigned char *data,
+ Bool sync,
+ CARD16 width,
+ CARD16 height)
+{
+ glamor_port_private *gpp = (glamor_port_private *) (pPort->devPriv.ptr);
+
+ RegionRec WinRegion;
+ RegionRec ClipRegion;
+ BoxRec WinBox;
+ int ret = Success;
+
+ if (pDrawable->type != DRAWABLE_WINDOW)
+ return BadWindow;
+
+ WinBox.x1 = pDrawable->x + drw_x;
+ WinBox.y1 = pDrawable->y + drw_y;
+ WinBox.x2 = WinBox.x1 + drw_w;
+ WinBox.y2 = WinBox.y1 + drw_h;
+
+ RegionInit(&WinRegion, &WinBox, 1);
+ RegionInit(&ClipRegion, NullBox, 1);
+ RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
+
+ if (RegionNotEmpty(&ClipRegion))
+ ret = glamor_xv_put_image(gpp,
+ pDrawable,
+ src_x,
+ src_y,
+ pDrawable->x + drw_x,
+ pDrawable->y + drw_y,
+ src_w,
+ src_h,
+ drw_w,
+ drw_h,
+ format->id,
+ data,
+ width,
+ height,
+ sync,
+ &ClipRegion);
+
+ RegionUninit(&WinRegion);
+ RegionUninit(&ClipRegion);
+
+ return ret;
+
+}
+
+static Bool
+xwl_glamor_xv_add_formats(XvAdaptorPtr pa)
+{
+ ScreenPtr pScreen;
+ XvFormatPtr pFormat, pf;
+ VisualPtr pVisual;
+ int numFormat;
+ int totFormat;
+ int numVisuals;
+ int i;
+
+ totFormat = NUM_FORMATS;
+ pFormat = xnfcalloc(totFormat, sizeof(XvFormatRec));
+ pScreen = pa->pScreen;
+ for (pf = pFormat, i = 0, numFormat = 0; i < NUM_FORMATS; i++) {
+ numVisuals = pScreen->numVisuals;
+ pVisual = pScreen->visuals;
+
+ while (numVisuals--) {
+ if ((pVisual->class == Formats[i].class) &&
+ (pVisual->nplanes == Formats[i].depth)) {
+ if (numFormat >= totFormat) {
+ void *moreSpace;
+
+ totFormat *= 2;
+ moreSpace = XNFreallocarray(pFormat, totFormat,
+ sizeof(XvFormatRec));
+ pFormat = moreSpace;
+ pf = pFormat + numFormat;
+ }
+
+ pf->visual = pVisual->vid;
+ pf->depth = Formats[i].depth;
+
+ pf++;
+ numFormat++;
+ }
+ pVisual++;
+ }
+ }
+ pa->nFormats = numFormat;
+ pa->pFormats = pFormat;
+
+ return numFormat != 0;
+}
+
+static Bool
+xwl_glamor_xv_add_ports(XvAdaptorPtr pa)
+{
+ XvPortPtr pPorts, pp;
+ xwlXvScreenPtr xwlXvScreen;
+ unsigned long PortResource = 0;
+ int nPorts;
+ int i;
+
+ pPorts = xnfcalloc(NUM_PORTS, sizeof(XvPortRec));
+ xwlXvScreen = dixLookupPrivate(&(pa->pScreen)->devPrivates,
+ xwlXvScreenPrivateKey);
+ xwlXvScreen->port_privates = xnfcalloc(NUM_PORTS,
+ sizeof(glamor_port_private));
+
+ PortResource = XvGetRTPort();
+ for (pp = pPorts, i = 0, nPorts = 0; i < NUM_PORTS; i++) {
+ if (!(pp->id = FakeClientID(0)))
+ continue;
+
+ pp->pAdaptor = pa;
+
+ glamor_xv_init_port(&xwlXvScreen->port_privates[i]);
+ pp->devPriv.ptr = &xwlXvScreen->port_privates[i];
+
+ if (AddResource(pp->id, PortResource, pp)) {
+ pp++;
+ nPorts++;
+ }
+ }
+
+ pa->base_id = pPorts->id;
+ pa->nPorts = nPorts;
+ pa->pPorts = pPorts;
+
+ return nPorts != 0;
+}
+
+static void
+xwl_glamor_xv_add_attributes(XvAdaptorPtr pa)
+{
+ int i;
+
+ pa->pAttributes = xnfcalloc(glamor_xv_num_attributes, sizeof(XvAttributeRec));
+ memcpy(pa->pAttributes, glamor_xv_attributes,
+ glamor_xv_num_attributes * sizeof(XvAttributeRec));
+
+ for (i = 0; i < glamor_xv_num_attributes; i++)
+ pa->pAttributes[i].name = strdup(glamor_xv_attributes[i].name);
+
+ pa->nAttributes = glamor_xv_num_attributes;
+}
+
+static void
+xwl_glamor_xv_add_images(XvAdaptorPtr pa)
+{
+ pa->pImages = xnfcalloc(glamor_xv_num_images, sizeof(XvImageRec));
+ memcpy(pa->pImages, glamor_xv_images, glamor_xv_num_images * sizeof(XvImageRec));
+
+ pa->nImages = glamor_xv_num_images;
+}
+
+static void
+xwl_glamor_xv_add_encodings(XvAdaptorPtr pa)
+{
+ XvEncodingPtr pe;
+ GLint texsize;
+
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texsize);
+
+ pe = xnfcalloc(1, sizeof(XvEncodingRec));
+ pe->id = 0;
+ pe->pScreen = pa->pScreen;
+ pe->name = strdup(ENCODER_NAME);
+ pe->width = texsize;
+ pe->height = texsize;
+ pe->rate.numerator = 1;
+ pe->rate.denominator = 1;
+
+ pa->pEncodings = pe;
+ pa->nEncodings = 1;
+}
+
+static Bool
+xwl_glamor_xv_add_adaptors(ScreenPtr pScreen)
+{
+ DevPrivateKey XvScreenKey;
+ XvScreenPtr XvScreen;
+ xwlXvScreenPtr xwlXvScreen;
+ XvAdaptorPtr pa;
+
+ if (XvScreenInit(pScreen) != Success)
+ return FALSE;
+
+ XvScreenKey = XvGetScreenKey();
+ XvScreen = dixLookupPrivate(&(pScreen)->devPrivates, XvScreenKey);
+
+ XvScreen->nAdaptors = 0;
+ XvScreen->pAdaptors = NULL;
+
+ pa = xnfcalloc(1, sizeof(XvAdaptorRec));
+ pa->pScreen = pScreen;
+ pa->type = (unsigned int) (XvWindowMask | XvInputMask | XvImageMask);
+ pa->ddStopVideo = xwl_glamor_xv_stop_video;
+ pa->ddPutImage = xwl_glamor_xv_put_image;
+ pa->ddSetPortAttribute = xwl_glamor_xv_set_port_attribute;
+ pa->ddGetPortAttribute = xwl_glamor_xv_get_port_attribute;
+ pa->ddQueryBestSize = xwl_glamor_xv_query_best_size;
+ pa->ddQueryImageAttributes = xwl_glamor_xv_query_image_attributes;
+ pa->name = strdup(ADAPTOR_NAME);
+
+ xwl_glamor_xv_add_encodings(pa);
+ xwl_glamor_xv_add_images(pa);
+ xwl_glamor_xv_add_attributes(pa);
+ if (!xwl_glamor_xv_add_formats(pa))
+ goto failed;
+ if (!xwl_glamor_xv_add_ports(pa))
+ goto failed;
+
+ /* We're good now with out Xv adaptor */
+ XvScreen->nAdaptors = 1;
+ XvScreen->pAdaptors = pa;
+
+ xwlXvScreen = dixLookupPrivate(&(pa->pScreen)->devPrivates,
+ xwlXvScreenPrivateKey);
+ xwlXvScreen->glxv_adaptor = pa;
+
+ return TRUE;
+
+failed:
+ XvFreeAdaptor(pa);
+ free(pa);
+
+ return FALSE;
+}
+
+static Bool
+xwl_glamor_xv_close_screen(ScreenPtr pScreen)
+{
+ xwlXvScreenPtr xwlXvScreen;
+
+ xwlXvScreen = dixLookupPrivate(&(pScreen)->devPrivates,
+ xwlXvScreenPrivateKey);
+
+ if (xwlXvScreen->glxv_adaptor) {
+ XvFreeAdaptor(xwlXvScreen->glxv_adaptor);
+ free(xwlXvScreen->glxv_adaptor);
+ }
+ free(xwlXvScreen->port_privates);
+
+ pScreen->CloseScreen = xwlXvScreen->CloseScreen;
+
+ return pScreen->CloseScreen(pScreen);
+}
+
+Bool
+xwl_glamor_xv_init(ScreenPtr pScreen)
+{
+ xwlXvScreenPtr xwlXvScreen;
+
+ if (!dixRegisterPrivateKey(xwlXvScreenPrivateKey, PRIVATE_SCREEN,
+ sizeof(xwlXvScreenRec)))
+ return FALSE;
+
+ xwlXvScreen = dixLookupPrivate(&(pScreen)->devPrivates,
+ xwlXvScreenPrivateKey);
+
+ xwlXvScreen->port_privates = NULL;
+ xwlXvScreen->glxv_adaptor = NULL;
+ xwlXvScreen->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = xwl_glamor_xv_close_screen;
+
+ glamor_xv_core_init(pScreen);
+
+ return xwl_glamor_xv_add_adaptors(pScreen);
+}
diff --git a/xserver/hw/xwayland/xwayland-glamor.c b/xserver/hw/xwayland/xwayland-glamor.c
index d574d9407..04aa8f223 100644
--- a/xserver/hw/xwayland/xwayland-glamor.c
+++ b/xserver/hw/xwayland/xwayland-glamor.c
@@ -233,9 +233,10 @@ xwl_glamor_create_screen_resources(ScreenPtr screen)
if (!ret)
return ret;
- if (xwl_screen->rootless)
+ if (xwl_screen->rootless) {
screen->devPrivate =
fbCreatePixmap(screen, 0, 0, screen->rootDepth, 0);
+ }
else {
screen->devPrivate =
xwl_glamor_create_pixmap(screen, screen->width, screen->height,
@@ -245,6 +246,8 @@ xwl_glamor_create_screen_resources(ScreenPtr screen)
glamor_set_screen_pixmap(screen->devPrivate, NULL);
}
+ SetRootClip(screen, xwl_screen->root_clip_mode);
+
return screen->devPrivate != NULL;
}
@@ -268,6 +271,15 @@ xwl_drm_init_egl(struct xwl_screen *xwl_screen)
{
EGLint major, minor;
const char *version;
+ static const EGLint config_attribs_core[] = {
+ EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR,
+ EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR,
+ EGL_CONTEXT_MAJOR_VERSION_KHR,
+ GLAMOR_GL_CORE_VER_MAJOR,
+ EGL_CONTEXT_MINOR_VERSION_KHR,
+ GLAMOR_GL_CORE_VER_MINOR,
+ EGL_NONE
+ };
if (xwl_screen->egl_display)
return;
@@ -296,7 +308,11 @@ xwl_drm_init_egl(struct xwl_screen *xwl_screen)
ErrorF("glamor: EGL version %s:\n", version);
xwl_screen->egl_context = eglCreateContext(xwl_screen->egl_display,
- NULL, EGL_NO_CONTEXT, NULL);
+ NULL, EGL_NO_CONTEXT, config_attribs_core);
+ if (!xwl_screen->egl_context)
+ xwl_screen->egl_context = eglCreateContext(xwl_screen->egl_display,
+ NULL, EGL_NO_CONTEXT, NULL);
+
if (xwl_screen->egl_context == EGL_NO_CONTEXT) {
ErrorF("Failed to create EGL context\n");
return;
@@ -414,12 +430,6 @@ glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen,
return 0;
}
-unsigned int
-glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h)
-{
- return 0;
-}
-
struct xwl_auth_state {
int fd;
ClientPtr client;
@@ -549,11 +559,7 @@ xwl_glamor_init(struct xwl_screen *xwl_screen)
return FALSE;
}
- if (!glamor_init(xwl_screen->screen,
- GLAMOR_INVERTED_Y_AXIS |
- GLAMOR_USE_EGL_SCREEN |
- GLAMOR_USE_SCREEN |
- GLAMOR_USE_PICTURE_SCREEN)) {
+ if (!glamor_init(xwl_screen->screen, GLAMOR_USE_EGL_SCREEN)) {
ErrorF("Failed to initialize glamor\n");
return FALSE;
}
@@ -568,5 +574,10 @@ xwl_glamor_init(struct xwl_screen *xwl_screen)
screen->CreatePixmap = xwl_glamor_create_pixmap;
screen->DestroyPixmap = xwl_glamor_destroy_pixmap;
+#ifdef XV
+ if (!xwl_glamor_xv_init(screen))
+ ErrorF("Failed to initialize glamor Xv extension\n");
+#endif
+
return TRUE;
}
diff --git a/xserver/hw/xwayland/xwayland-input.c b/xserver/hw/xwayland/xwayland-input.c
index f4d8fabd4..23e138d53 100644
--- a/xserver/hw/xwayland/xwayland-input.c
+++ b/xserver/hw/xwayland/xwayland-input.c
@@ -32,6 +32,14 @@
#include <xkbsrv.h>
#include <xserver-properties.h>
#include <inpututils.h>
+#include <mipointer.h>
+#include <mipointrst.h>
+
+/* Copied from mipointer.c */
+#define MIPOINTER(dev) \
+ (IsFloating(dev) ? \
+ (miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \
+ (miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey))
static void
xwl_pointer_control(DeviceIntPtr device, PtrCtrl *ctrl)
@@ -148,6 +156,61 @@ xwl_keyboard_proc(DeviceIntPtr device, int what)
return BadMatch;
}
+static int
+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 };
+
+ switch (what) {
+ case DEVICE_INIT:
+ device->public.on = FALSE;
+
+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_X);
+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y);
+
+ if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels,
+ GetMotionHistorySize(), Absolute))
+ return BadValue;
+
+ if (!InitButtonClassDeviceStruct(device, NBUTTONS, btn_labels, map))
+ return BadValue;
+
+ if (!InitTouchClassDeviceStruct(device, NTOUCHPOINTS,
+ XIDirectTouch, NAXES))
+ 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);
+ InitValuatorAxisStruct(device, 1, axes_labels[1],
+ 0, xwl_seat->xwl_screen->height,
+ 10000, 0, 10000, Absolute);
+ 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 NAXES
+#undef NBUTTONS
+#undef NTOUCHPOINTS
+}
+
static void
pointer_handle_enter(void *data, struct wl_pointer *pointer,
uint32_t serial, struct wl_surface *surface,
@@ -155,6 +218,8 @@ 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);
@@ -175,8 +240,18 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
xwl_seat->focus_window = wl_surface_get_user_data(surface);
+ master = GetMaster(dev, POINTER_OR_FLOAT);
(*pScreen->SetCursorPosition) (dev, pScreen, sx, sy, TRUE);
- CheckMotion(NULL, GetMaster(dev, MASTER_POINTER));
+
+ /* 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;
+
+ CheckMotion(NULL, master);
/* Ideally, X clients shouldn't see these button releases. When
* the pointer leaves a window with buttons down, it means that
@@ -191,7 +266,17 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
valuator_mask_zero(&mask);
for (i = 0; i < dev->button->numButtons; i++)
if (BitIsOn(dev->button->down, i))
- QueuePointerEvents(xwl_seat->pointer, ButtonRelease, i, 0, &mask);
+ QueuePointerEvents(dev, ButtonRelease, i, 0, &mask);
+
+ /* The last cursor frame we commited before the pointer left one
+ * of our surfaces might not have been shown. In that case we'll
+ * have a cursor surface frame callback pending which we need to
+ * clear so that we can continue submitting new cursor frames. */
+ if (xwl_seat->cursor_frame_cb) {
+ wl_callback_destroy(xwl_seat->cursor_frame_cb);
+ xwl_seat->cursor_frame_cb = NULL;
+ xwl_seat_set_cursor(xwl_seat);
+ }
}
static void
@@ -204,7 +289,7 @@ pointer_handle_leave(void *data, struct wl_pointer *pointer,
xwl_seat->xwl_screen->serial = serial;
xwl_seat->focus_window = NULL;
- CheckMotion(NULL, GetMaster(dev, MASTER_POINTER));
+ CheckMotion(NULL, GetMaster(dev, POINTER_OR_FLOAT));
}
static void
@@ -302,7 +387,6 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial,
{
struct xwl_seat *xwl_seat = data;
uint32_t *k, *end;
- ValuatorMask mask;
xwl_seat->xwl_screen->serial = serial;
@@ -317,9 +401,8 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial,
*k = key;
}
- valuator_mask_zero(&mask);
QueueKeyboardEvents(xwl_seat->keyboard,
- state ? KeyPress : KeyRelease, key + 8, &mask);
+ state ? KeyPress : KeyRelease, key + 8);
}
static void
@@ -372,16 +455,14 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard,
struct wl_surface *surface, struct wl_array *keys)
{
struct xwl_seat *xwl_seat = data;
- ValuatorMask mask;
uint32_t *k;
xwl_seat->xwl_screen->serial = serial;
xwl_seat->keyboard_focus = surface;
wl_array_copy(&xwl_seat->keys, keys);
- valuator_mask_zero(&mask);
wl_array_for_each(k, &xwl_seat->keys)
- QueueKeyboardEvents(xwl_seat->keyboard, KeyPress, *k + 8, &mask);
+ QueueKeyboardEvents(xwl_seat->keyboard, KeyPress, *k + 8);
}
static void
@@ -389,14 +470,12 @@ keyboard_handle_leave(void *data, struct wl_keyboard *keyboard,
uint32_t serial, struct wl_surface *surface)
{
struct xwl_seat *xwl_seat = data;
- ValuatorMask mask;
uint32_t *k;
xwl_seat->xwl_screen->serial = serial;
- valuator_mask_zero(&mask);
wl_array_for_each(k, &xwl_seat->keys)
- QueueKeyboardEvents(xwl_seat->keyboard, KeyRelease, *k + 8, &mask);
+ QueueKeyboardEvents(xwl_seat->keyboard, KeyRelease, *k + 8);
xwl_seat->keyboard_focus = NULL;
}
@@ -413,12 +492,6 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard,
xkbStateNotify sn;
CARD16 changed;
- /* We don't need any of this while we have keyboard focus since
- the regular key event processing already takes care of setting
- our internal state correctly. */
- if (xwl_seat->keyboard_focus)
- return;
-
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (dev != xwl_seat->keyboard &&
dev != GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD))
@@ -427,10 +500,12 @@ 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->locked_mods = mods_locked & XkbAllModifiersMask;
- XkbLatchModifiers(dev, XkbAllModifiersMask,
- mods_latched & XkbAllModifiersMask);
XkbComputeDerivedState(dev->key->xkbInfo);
@@ -447,12 +522,166 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard,
}
}
+static void
+keyboard_handle_repeat_info (void *data, struct wl_keyboard *keyboard,
+ int32_t rate, int32_t delay)
+{
+ struct xwl_seat *xwl_seat = data;
+ DeviceIntPtr dev;
+ XkbControlsPtr ctrl;
+
+ if (rate < 0 || delay < 0) {
+ ErrorF("Wrong rate/delay: %d, %d\n", rate, delay);
+ return;
+ }
+
+ for (dev = inputInfo.devices; dev; dev = dev->next) {
+ if (dev != xwl_seat->keyboard &&
+ dev != GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD))
+ continue;
+
+ 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);
+ }
+}
+
static const struct wl_keyboard_listener keyboard_listener = {
keyboard_handle_keymap,
keyboard_handle_enter,
keyboard_handle_leave,
keyboard_handle_key,
keyboard_handle_modifiers,
+ keyboard_handle_repeat_info,
+};
+
+static struct xwl_touch *
+xwl_seat_lookup_touch(struct xwl_seat *xwl_seat, int32_t id)
+{
+ struct xwl_touch *xwl_touch, *next_xwl_touch;
+
+ xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch,
+ &xwl_seat->touches, link_touch) {
+ if (xwl_touch->id == id)
+ return xwl_touch;
+ }
+
+ return NULL;
+}
+
+static void
+xwl_touch_send_event(struct xwl_touch *xwl_touch,
+ struct xwl_seat *xwl_seat, int type)
+{
+ int32_t dx, dy;
+ ValuatorMask mask;
+
+ dx = xwl_touch->window->window->drawable.x;
+ dy = xwl_touch->window->window->drawable.y;
+
+ valuator_mask_zero(&mask);
+ valuator_mask_set(&mask, 0, dx + xwl_touch->x);
+ valuator_mask_set(&mask, 1, dy + xwl_touch->y);
+ QueueTouchEvents(xwl_seat->touch, type, xwl_touch->id, 0, &mask);
+}
+
+static void
+touch_handle_down(void *data, struct wl_touch *wl_touch,
+ uint32_t serial, uint32_t time,
+ struct wl_surface *surface,
+ int32_t id, wl_fixed_t sx_w, wl_fixed_t sy_w)
+{
+ struct xwl_seat *xwl_seat = data;
+ struct xwl_touch *xwl_touch;
+
+ if (surface == NULL)
+ return;
+
+ xwl_touch = calloc(sizeof *xwl_touch, 1);
+ if (xwl_touch == NULL) {
+ ErrorF("touch_handle_down ENOMEM");
+ return;
+ }
+
+ xwl_touch->window = wl_surface_get_user_data(surface);
+ xwl_touch->id = id;
+ xwl_touch->x = wl_fixed_to_int(sx_w);
+ xwl_touch->y = wl_fixed_to_int(sy_w);
+ xorg_list_add(&xwl_touch->link_touch, &xwl_seat->touches);
+
+ xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchBegin);
+}
+
+static void
+touch_handle_up(void *data, struct wl_touch *wl_touch,
+ uint32_t serial, uint32_t time, int32_t id)
+{
+ struct xwl_touch *xwl_touch;
+ struct xwl_seat *xwl_seat = data;
+
+ xwl_touch = xwl_seat_lookup_touch(xwl_seat, id);
+
+ if (!xwl_touch)
+ return;
+
+ xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchEnd);
+ xorg_list_del(&xwl_touch->link_touch);
+ free(xwl_touch);
+}
+
+static void
+touch_handle_motion(void *data, struct wl_touch *wl_touch,
+ uint32_t time, int32_t id,
+ wl_fixed_t sx_w, wl_fixed_t sy_w)
+{
+ struct xwl_seat *xwl_seat = data;
+ struct xwl_touch *xwl_touch;
+
+ xwl_touch = xwl_seat_lookup_touch(xwl_seat, id);
+
+ if (!xwl_touch)
+ return;
+
+ xwl_touch->x = wl_fixed_to_int(sx_w);
+ xwl_touch->y = wl_fixed_to_int(sy_w);
+ xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchUpdate);
+}
+
+static void
+touch_handle_frame(void *data, struct wl_touch *wl_touch)
+{
+}
+
+static void
+touch_handle_cancel(void *data, struct wl_touch *wl_touch)
+{
+ struct xwl_seat *xwl_seat = data;
+ struct xwl_touch *xwl_touch, *next_xwl_touch;
+
+ xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch,
+ &xwl_seat->touches, link_touch) {
+ /* We can't properly notify of cancellation to the X client
+ * once it thinks it has the ownership, send at least a
+ * TouchEnd event.
+ */
+ xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchEnd);
+ xorg_list_del(&xwl_touch->link_touch);
+ free(xwl_touch);
+ }
+}
+
+static const struct wl_touch_listener touch_listener = {
+ touch_handle_down,
+ touch_handle_up,
+ touch_handle_motion,
+ touch_handle_frame,
+ touch_handle_cancel
};
static DeviceIntPtr
@@ -489,13 +718,13 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
wl_pointer_add_listener(xwl_seat->wl_pointer,
&pointer_listener, xwl_seat);
- if (xwl_seat->pointer)
- EnableDevice(xwl_seat->pointer, TRUE);
- else {
+ 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);
} else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && xwl_seat->wl_pointer) {
wl_pointer_release(xwl_seat->wl_pointer);
xwl_seat->wl_pointer = NULL;
@@ -509,12 +738,12 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
wl_keyboard_add_listener(xwl_seat->wl_keyboard,
&keyboard_listener, xwl_seat);
- if (xwl_seat->keyboard)
- EnableDevice(xwl_seat->keyboard, TRUE);
- else {
+ 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);
} else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && xwl_seat->wl_keyboard) {
wl_keyboard_release(xwl_seat->wl_keyboard);
xwl_seat->wl_keyboard = NULL;
@@ -523,8 +752,26 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
DisableDevice(xwl_seat->keyboard, TRUE);
}
+ 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);
+ }
+ } 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);
+ }
+
xwl_seat->xwl_screen->expecting_event--;
- /* FIXME: Touch ... */
}
static void
@@ -540,7 +787,7 @@ static const struct wl_seat_listener seat_listener = {
};
static void
-create_input_device(struct xwl_screen *xwl_screen, uint32_t id)
+create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version)
{
struct xwl_seat *xwl_seat;
@@ -554,17 +801,28 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id)
xorg_list_add(&xwl_seat->link, &xwl_screen->seat_list);
xwl_seat->seat =
- wl_registry_bind(xwl_screen->registry, id, &wl_seat_interface, 3);
+ wl_registry_bind(xwl_screen->registry, id,
+ &wl_seat_interface, min(version, 4));
xwl_seat->id = id;
xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor);
wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat);
wl_array_init(&xwl_seat->keys);
+
+ xorg_list_init(&xwl_seat->touches);
}
void
xwl_seat_destroy(struct xwl_seat *xwl_seat)
{
+ struct xwl_touch *xwl_touch, *next_xwl_touch;
+
+ xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch,
+ &xwl_seat->touches, link_touch) {
+ xorg_list_del(&xwl_touch->link_touch);
+ free(xwl_touch);
+ }
+
wl_seat_destroy(xwl_seat->seat);
wl_surface_destroy(xwl_seat->cursor);
if (xwl_seat->cursor_frame_cb)
@@ -580,7 +838,7 @@ input_handler(void *data, struct wl_registry *registry, uint32_t id,
struct xwl_screen *xwl_screen = data;
if (strcmp(interface, "wl_seat") == 0 && version >= 3) {
- create_input_device(xwl_screen, id);
+ create_input_device(xwl_screen, id, version);
xwl_screen->expecting_event++;
}
}
@@ -612,35 +870,18 @@ DDXRingBell(int volume, int pitch, int duration)
{
}
-static WindowPtr
-xwl_xy_to_window(ScreenPtr screen, SpritePtr sprite, int x, int y)
+void
+xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window)
{
- struct xwl_seat *xwl_seat = NULL;
- DeviceIntPtr device;
+ struct xwl_touch *xwl_touch, *next_xwl_touch;
- for (device = inputInfo.devices; device; device = device->next) {
- if (device->deviceProc == xwl_pointer_proc &&
- device->spriteInfo->sprite == sprite) {
- xwl_seat = device->public.devicePrivate;
- break;
+ xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch,
+ &xwl_seat->touches, link_touch) {
+ if (xwl_touch->window->window == window) {
+ xorg_list_del(&xwl_touch->link_touch);
+ free(xwl_touch);
}
}
-
- if (xwl_seat == NULL) {
- /* XTEST device */
- sprite->spriteTraceGood = 1;
- return sprite->spriteTrace[0];
- }
-
- if (xwl_seat->focus_window) {
- sprite->spriteTraceGood = 2;
- sprite->spriteTrace[1] = xwl_seat->focus_window->window;
- return miSpriteTrace(sprite, x, y);
- }
- else {
- sprite->spriteTraceGood = 1;
- return sprite->spriteTrace[0];
- }
}
void
@@ -655,9 +896,6 @@ InitInput(int argc, char *argv[])
wl_registry_add_listener(xwl_screen->input_registry, &input_listener,
xwl_screen);
- xwl_screen->XYToWindow = pScreen->XYToWindow;
- pScreen->XYToWindow = xwl_xy_to_window;
-
xwl_screen->expecting_event = 0;
wl_display_roundtrip(xwl_screen->display);
while (xwl_screen->expecting_event)
diff --git a/xserver/hw/xwayland/xwayland-output.c b/xserver/hw/xwayland/xwayland-output.c
index 7e5484c7d..4903062a1 100644
--- a/xserver/hw/xwayland/xwayland-output.c
+++ b/xserver/hw/xwayland/xwayland-output.c
@@ -30,6 +30,8 @@
#include "xwayland.h"
#include <randrstr.h>
+#define DEFAULT_DPI 96
+
static Rotation
wl_transform_to_xrandr(enum wl_output_transform transform)
{
@@ -101,8 +103,13 @@ output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags,
if (!(flags & WL_OUTPUT_MODE_CURRENT))
return;
- xwl_output->width = width;
- xwl_output->height = height;
+ 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;
+ }
randr_mode = xwayland_cvt(width, height, refresh / 1000.0, 0, 0);
@@ -113,29 +120,106 @@ output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags,
xwl_output->rotation, NULL, 1, &xwl_output->randr_output);
}
+static inline void
+output_get_new_size(struct xwl_output *xwl_output,
+ int *height, int *width)
+{
+ if (*width < xwl_output->x + xwl_output->width)
+ *width = xwl_output->x + xwl_output->width;
+
+ if (*height < xwl_output->y + xwl_output->height)
+ *height = xwl_output->y + xwl_output->height;
+}
+
+/* Approximate some kind of mmpd (m.m. per dot) of the screen given the outputs
+ * associated with it.
+ *
+ * It will either calculate the mean mmpd of all the outputs, or default to
+ * 96 DPI if no reasonable value could be calculated.
+ */
+static double
+approximate_mmpd(struct xwl_screen *xwl_screen)
+{
+ struct xwl_output *it;
+ int total_width_mm = 0;
+ int total_width = 0;
+
+ xorg_list_for_each_entry(it, &xwl_screen->output_list, link) {
+ if (it->randr_output->mmWidth == 0)
+ continue;
+
+ total_width_mm += it->randr_output->mmWidth;
+ total_width += it->width;
+ }
+
+ if (total_width_mm != 0)
+ return (double)total_width_mm / total_width;
+ else
+ return 25.4 / DEFAULT_DPI;
+}
+
+static void
+update_screen_size(struct xwl_output *xwl_output, int width, int height)
+{
+ struct xwl_screen *xwl_screen = xwl_output->xwl_screen;
+ double mmpd;
+
+ if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL)
+ SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE);
+
+ xwl_screen->width = width;
+ xwl_screen->height = height;
+ xwl_screen->screen->width = width;
+ xwl_screen->screen->height = height;
+
+ if (xwl_output->width == width && xwl_output->height == height) {
+ xwl_screen->screen->mmWidth = xwl_output->randr_output->mmWidth;
+ xwl_screen->screen->mmHeight = xwl_output->randr_output->mmHeight;
+ } else {
+ mmpd = approximate_mmpd(xwl_screen);
+ xwl_screen->screen->mmWidth = width * mmpd;
+ xwl_screen->screen->mmHeight = height * mmpd;
+ }
+
+ SetRootClip(xwl_screen->screen, xwl_screen->root_clip_mode);
+
+ if (xwl_screen->screen->root) {
+ xwl_screen->screen->root->drawable.width = width;
+ xwl_screen->screen->root->drawable.height = height;
+ RRScreenSizeNotify(xwl_screen->screen);
+ }
+
+ update_desktop_dimensions();
+}
+
static void
output_handle_done(void *data, struct wl_output *wl_output)
{
- struct xwl_output *xwl_output = data;
+ struct xwl_output *it, *xwl_output = data;
struct xwl_screen *xwl_screen = xwl_output->xwl_screen;
- int width, height;
+ int width = 0, height = 0, has_this_output = 0;
- xorg_list_append(&xwl_output->link, &xwl_screen->output_list);
+ xorg_list_for_each_entry(it, &xwl_screen->output_list, link) {
+ /* output done event is sent even when some property
+ * of output is changed. That means that we may already
+ * have this output. If it is true, we must not add it
+ * into the output_list otherwise we'll corrupt it */
+ if (it == xwl_output)
+ has_this_output = 1;
- width = 0;
- height = 0;
- xorg_list_for_each_entry(xwl_output, &xwl_screen->output_list, link) {
- if (width < xwl_output->x + xwl_output->width)
- width = xwl_output->x + xwl_output->width;
- if (height < xwl_output->y + xwl_output->height)
- height = xwl_output->y + xwl_output->height;
+ output_get_new_size(it, &height, &width);
}
- xwl_screen->width = width;
- xwl_screen->height = height;
- RRScreenSizeNotify(xwl_screen->screen);
+ if (!has_this_output) {
+ xorg_list_append(&xwl_output->link, &xwl_screen->output_list);
- xwl_screen->expecting_event--;
+ /* we did not check this output for new screen size, do it now */
+ output_get_new_size(xwl_output, &height, &width);
+
+ --xwl_screen->expecting_event;
+ }
+
+ update_screen_size(xwl_output, width, height);
}
static void
@@ -165,29 +249,61 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id)
xwl_output->output = wl_registry_bind(xwl_screen->registry, id,
&wl_output_interface, 2);
+ if (!xwl_output->output) {
+ ErrorF("Failed binding wl_output\n");
+ goto err;
+ }
+
+ xwl_output->server_output_id = id;
wl_output_add_listener(xwl_output->output, &output_listener, xwl_output);
- if (snprintf(name, sizeof name, "XWAYLAND%d", serial++) < 0) {
- ErrorF("create_output ENOMEM\n");
- free(xwl_output);
- return NULL;
- }
+ snprintf(name, sizeof name, "XWAYLAND%d", serial++);
xwl_output->xwl_screen = xwl_screen;
xwl_output->randr_crtc = RRCrtcCreate(xwl_screen->screen, xwl_output);
+ if (!xwl_output->randr_crtc) {
+ ErrorF("Failed creating RandR CRTC\n");
+ goto err;
+ }
+
xwl_output->randr_output = RROutputCreate(xwl_screen->screen, name,
strlen(name), xwl_output);
+ if (!xwl_output->randr_output) {
+ ErrorF("Failed creating RandR Output\n");
+ goto err;
+ }
+
RRCrtcGammaSetSize(xwl_output->randr_crtc, 256);
RROutputSetCrtcs(xwl_output->randr_output, &xwl_output->randr_crtc, 1);
RROutputSetConnection(xwl_output->randr_output, RR_Connected);
return xwl_output;
+
+err:
+ if (xwl_output->randr_crtc)
+ RRCrtcDestroy(xwl_output->randr_crtc);
+ if (xwl_output->output)
+ wl_output_destroy(xwl_output->output);
+ free(xwl_output);
+ return NULL;
}
void
xwl_output_destroy(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_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);
}
diff --git a/xserver/hw/xwayland/xwayland-shm.c b/xserver/hw/xwayland/xwayland-shm.c
index 2d0ce3eb6..e8545b3be 100644
--- a/xserver/hw/xwayland/xwayland-shm.c
+++ b/xserver/hw/xwayland/xwayland-shm.c
@@ -24,6 +24,10 @@
* SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "xwayland.h"
#include <sys/mman.h>
@@ -82,7 +86,7 @@ create_tmpfile_cloexec(char *tmpname)
}
#endif
- return fd;
+ return os_move_fd(fd);
}
/*
@@ -109,7 +113,7 @@ create_tmpfile_cloexec(char *tmpname)
static int
os_create_anonymous_file(off_t size)
{
- static const char template[] = "/weston-shared-XXXXXX";
+ static const char template[] = "/xwayland-shared-XXXXXX";
const char *path;
char *name;
int fd;
@@ -288,5 +292,7 @@ xwl_shm_create_screen_resources(ScreenPtr screen)
screen->rootDepth,
CREATE_PIXMAP_USAGE_BACKING_PIXMAP);
+ SetRootClip(screen, xwl_screen->root_clip_mode);
+
return screen->devPrivate != NULL;
}
diff --git a/xserver/hw/xwayland/xwayland-vidmode.c b/xserver/hw/xwayland/xwayland-vidmode.c
new file mode 100644
index 000000000..0bcd11401
--- /dev/null
+++ b/xserver/hw/xwayland/xwayland-vidmode.c
@@ -0,0 +1,419 @@
+/*
+ * Copyright (c) 1999-2003 by The XFree86 Project, 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 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include "misc.h"
+#include "os.h"
+#include "extinit.h"
+
+#ifdef XF86VIDMODE
+#include "xwayland.h"
+#include "randrstr.h"
+#include "vidmodestr.h"
+
+static DevPrivateKeyRec xwlVidModePrivateKeyRec;
+#define xwlVidModePrivateKey (&xwlVidModePrivateKeyRec)
+
+/* Taken from xrandr, h sync frequency in KHz */
+static double
+mode_hsync(const xRRModeInfo *mode_info)
+{
+ double rate;
+
+ if (mode_info->hTotal)
+ rate = (double) mode_info->dotClock / (double) mode_info->hTotal;
+ else
+ rate = 0.0;
+
+ return rate / 1000.0;
+}
+
+/* Taken from xrandr, v refresh frequency in Hz */
+static double
+mode_refresh(const xRRModeInfo *mode_info)
+{
+ double rate;
+ double vTotal = mode_info->vTotal;
+
+ if (mode_info->modeFlags & RR_DoubleScan)
+ vTotal *= 2.0;
+
+ if (mode_info->modeFlags & RR_Interlace)
+ vTotal /= 2.0;
+
+ if (mode_info->hTotal > 0.0 && vTotal > 0.0)
+ rate = ((double) mode_info->dotClock /
+ ((double) mode_info->hTotal * (double) vTotal));
+ else
+ rate = 0.0;
+
+ return rate;
+}
+
+static Bool
+xwlVidModeGetCurrentModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock)
+{
+ DisplayModePtr pMod;
+ RROutputPtr output;
+ RRCrtcPtr crtc;
+ xRRModeInfo rrmode;
+
+ pMod = dixLookupPrivate(&pScreen->devPrivates, xwlVidModePrivateKey);
+ if (pMod == NULL)
+ return FALSE;
+
+ output = RRFirstOutput(pScreen);
+ if (output == NULL)
+ return FALSE;
+
+ crtc = output->crtc;
+ if (crtc == NULL)
+ return FALSE;
+
+ rrmode = crtc->mode->mode;
+
+ pMod->next = pMod;
+ pMod->prev = pMod;
+ pMod->name = "";
+ pMod->VScan = 1;
+ pMod->Private = NULL;
+ pMod->HDisplay = rrmode.width;
+ pMod->HSyncStart = rrmode.hSyncStart;
+ pMod->HSyncEnd = rrmode.hSyncEnd;
+ pMod->HTotal = rrmode.hTotal;
+ pMod->HSkew = rrmode.hSkew;
+ pMod->VDisplay = rrmode.height;
+ pMod->VSyncStart = rrmode.vSyncStart;
+ pMod->VSyncEnd = rrmode.vSyncEnd;
+ pMod->VTotal = rrmode.vTotal;
+ pMod->Flags = rrmode.modeFlags;
+ pMod->Clock = rrmode.dotClock / 1000.0;
+ pMod->VRefresh = mode_refresh(&rrmode); /* Or RRVerticalRefresh() */
+ pMod->HSync = mode_hsync(&rrmode);
+ *mode = pMod;
+
+ if (dotClock != NULL)
+ *dotClock = rrmode.dotClock / 1000.0;
+
+ return TRUE;
+}
+
+static vidMonitorValue
+xwlVidModeGetMonitorValue(ScreenPtr pScreen, int valtyp, int indx)
+{
+ vidMonitorValue ret = { NULL, };
+ DisplayModePtr pMod;
+
+ if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL))
+ return ret;
+
+ switch (valtyp) {
+ case VIDMODE_MON_VENDOR:
+ ret.ptr = XVENDORNAME;
+ break;
+ case VIDMODE_MON_MODEL:
+ ret.ptr = "XWAYLAND";
+ break;
+ case VIDMODE_MON_NHSYNC:
+ ret.i = 1;
+ break;
+ case VIDMODE_MON_NVREFRESH:
+ ret.i = 1;
+ break;
+ case VIDMODE_MON_HSYNC_LO:
+ case VIDMODE_MON_HSYNC_HI:
+ ret.f = 100.0 * pMod->HSync;
+ break;
+ case VIDMODE_MON_VREFRESH_LO:
+ case VIDMODE_MON_VREFRESH_HI:
+ ret.f = 100.0 * pMod->VRefresh;
+ break;
+ }
+ return ret;
+}
+
+static int
+xwlVidModeGetDotClock(ScreenPtr pScreen, int Clock)
+{
+ DisplayModePtr pMod;
+
+ if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL))
+ return 0;
+
+ return pMod->Clock;
+
+}
+
+static int
+xwlVidModeGetNumOfClocks(ScreenPtr pScreen, Bool *progClock)
+{
+ return 1;
+}
+
+static Bool
+xwlVidModeGetClocks(ScreenPtr pScreen, int *Clocks)
+{
+ *Clocks = xwlVidModeGetDotClock(pScreen, 0);
+
+ return TRUE;
+}
+
+static Bool
+xwlVidModeGetNextModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock)
+{
+ return FALSE;
+}
+
+static Bool
+xwlVidModeGetFirstModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock)
+{
+ return xwlVidModeGetCurrentModeline(pScreen, mode, dotClock);
+}
+
+static Bool
+xwlVidModeDeleteModeline(ScreenPtr pScreen, DisplayModePtr mode)
+{
+ /* Unsupported */
+ return FALSE;
+}
+
+static Bool
+xwlVidModeZoomViewport(ScreenPtr pScreen, int zoom)
+{
+ /* Support only no zoom */
+ return (zoom == 1);
+}
+
+static Bool
+xwlVidModeSetViewPort(ScreenPtr pScreen, int x, int y)
+{
+ RROutputPtr output;
+ RRCrtcPtr crtc;
+
+ output = RRFirstOutput(pScreen);
+ if (output == NULL)
+ return FALSE;
+
+ crtc = output->crtc;
+ if (crtc == NULL)
+ return FALSE;
+
+ /* Support only default viewport */
+ return (x == crtc->x && y == crtc->y);
+}
+
+static Bool
+xwlVidModeGetViewPort(ScreenPtr pScreen, int *x, int *y)
+{
+ RROutputPtr output;
+ RRCrtcPtr crtc;
+
+ output = RRFirstOutput(pScreen);
+ if (output == NULL)
+ return FALSE;
+
+ crtc = output->crtc;
+ if (crtc == NULL)
+ return FALSE;
+
+ *x = crtc->x;
+ *y = crtc->y;
+
+ return TRUE;
+}
+
+static Bool
+xwlVidModeSwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
+{
+ /* Unsupported for now */
+ return FALSE;
+}
+
+static Bool
+xwlVidModeLockZoom(ScreenPtr pScreen, Bool lock)
+{
+ /* Unsupported for now, but pretend it works */
+ return TRUE;
+}
+
+static ModeStatus
+xwlVidModeCheckModeForMonitor(ScreenPtr pScreen, DisplayModePtr mode)
+{
+ DisplayModePtr pMod;
+
+ /* This should not happen */
+ if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL))
+ return MODE_ERROR;
+
+ /* Only support mode with the same HSync/VRefresh as we advertise */
+ if (mode->HSync == pMod->HSync && mode->VRefresh == pMod->VRefresh)
+ return MODE_OK;
+
+ /* All the rest is unsupported - If we want to succeed, return MODE_OK instead */
+ return MODE_ONE_SIZE;
+}
+
+static ModeStatus
+xwlVidModeCheckModeForDriver(ScreenPtr pScreen, DisplayModePtr mode)
+{
+ DisplayModePtr pMod;
+
+ /* This should not happen */
+ if (!xwlVidModeGetCurrentModeline(pScreen, &pMod, NULL))
+ return MODE_ERROR;
+
+ if (mode->HTotal != pMod->HTotal)
+ return MODE_BAD_HVALUE;
+
+ if (mode->VTotal != pMod->VTotal)
+ return MODE_BAD_VVALUE;
+
+ /* Unsupported for now, but pretend it works */
+ return MODE_OK;
+}
+
+static void
+xwlVidModeSetCrtcForMode(ScreenPtr pScreen, DisplayModePtr mode)
+{
+ /* Unsupported */
+ return;
+}
+
+static Bool
+xwlVidModeAddModeline(ScreenPtr pScreen, DisplayModePtr mode)
+{
+ /* Unsupported */
+ return FALSE;
+}
+
+static int
+xwlVidModeGetNumOfModes(ScreenPtr pScreen)
+{
+ /* We have only one mode */
+ return 1;
+}
+
+static Bool
+xwlVidModeSetGamma(ScreenPtr pScreen, float red, float green, float blue)
+{
+ /* Unsupported for now, but pretend it works */
+ return TRUE;
+}
+
+static Bool
+xwlVidModeGetGamma(ScreenPtr pScreen, float *red, float *green, float *blue)
+{
+ /* Unsupported for now, but pretend it works */
+ return TRUE;
+}
+
+static Bool
+xwlVidModeSetGammaRamp(ScreenPtr pScreen, int size, CARD16 *r, CARD16 *g, CARD16 *b)
+{
+ /* Unsupported for now */
+ return FALSE;
+}
+
+static Bool
+xwlVidModeGetGammaRamp(ScreenPtr pScreen, int size, CARD16 *r, CARD16 *g, CARD16 *b)
+{
+ /* Unsupported for now */
+ return FALSE;
+}
+
+static int
+xwlVidModeGetGammaRampSize(ScreenPtr pScreen)
+{
+ /* Unsupported for now */
+ return 0;
+}
+
+static Bool
+xwlVidModeInit(ScreenPtr pScreen)
+{
+ VidModePtr pVidMode = NULL;
+
+ pVidMode = VidModeInit(pScreen);
+ if (!pVidMode)
+ return FALSE;
+
+ pVidMode->Flags = 0;
+ pVidMode->Next = NULL;
+
+ pVidMode->GetMonitorValue = xwlVidModeGetMonitorValue;
+ pVidMode->GetCurrentModeline = xwlVidModeGetCurrentModeline;
+ pVidMode->GetFirstModeline = xwlVidModeGetFirstModeline;
+ pVidMode->GetNextModeline = xwlVidModeGetNextModeline;
+ pVidMode->DeleteModeline = xwlVidModeDeleteModeline;
+ pVidMode->ZoomViewport = xwlVidModeZoomViewport;
+ pVidMode->GetViewPort = xwlVidModeGetViewPort;
+ pVidMode->SetViewPort = xwlVidModeSetViewPort;
+ pVidMode->SwitchMode = xwlVidModeSwitchMode;
+ pVidMode->LockZoom = xwlVidModeLockZoom;
+ pVidMode->GetNumOfClocks = xwlVidModeGetNumOfClocks;
+ pVidMode->GetClocks = xwlVidModeGetClocks;
+ pVidMode->CheckModeForMonitor = xwlVidModeCheckModeForMonitor;
+ pVidMode->CheckModeForDriver = xwlVidModeCheckModeForDriver;
+ pVidMode->SetCrtcForMode = xwlVidModeSetCrtcForMode;
+ pVidMode->AddModeline = xwlVidModeAddModeline;
+ pVidMode->GetDotClock = xwlVidModeGetDotClock;
+ pVidMode->GetNumOfModes = xwlVidModeGetNumOfModes;
+ pVidMode->SetGamma = xwlVidModeSetGamma;
+ pVidMode->GetGamma = xwlVidModeGetGamma;
+ pVidMode->SetGammaRamp = xwlVidModeSetGammaRamp;
+ pVidMode->GetGammaRamp = xwlVidModeGetGammaRamp;
+ pVidMode->GetGammaRampSize = xwlVidModeGetGammaRampSize;
+
+ return TRUE;
+}
+
+void
+xwlVidModeExtensionInit(void)
+{
+ int i;
+ Bool enabled = FALSE;
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ if (xwlVidModeInit (screenInfo.screens[i]))
+ enabled = TRUE;
+ }
+ /* This means that the DDX doesn't want the vidmode extension enabled */
+ if (!enabled)
+ return;
+
+ if (!dixRegisterPrivateKey(xwlVidModePrivateKey, PRIVATE_SCREEN,
+ sizeof(DisplayModeRec)))
+ return;
+
+ VidModeAddExtension(FALSE);
+}
+
+#endif /* XF86VIDMODE */
diff --git a/xserver/hw/xwayland/xwayland.c b/xserver/hw/xwayland/xwayland.c
index bc92beb38..2d44d0709 100644
--- a/xserver/hw/xwayland/xwayland.c
+++ b/xserver/hw/xwayland/xwayland.c
@@ -33,6 +33,11 @@
#include <compositeext.h>
#include <glx_extinit.h>
+#ifdef XF86VIDMODE
+#include <X11/extensions/xf86vmproto.h>
+_X_EXPORT Bool noXFree86VidModeExtension;
+#endif
+
void
ddxGiveUp(enum ExitCode error)
{
@@ -233,23 +238,36 @@ xwl_realize_window(WindowPtr window)
}
xwl_window = calloc(sizeof *xwl_window, 1);
+ if (xwl_window == NULL)
+ return FALSE;
+
xwl_window->xwl_screen = xwl_screen;
xwl_window->window = window;
xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor);
if (xwl_window->surface == NULL) {
ErrorF("wl_display_create_surface failed\n");
- return FALSE;
+ goto err;
}
if (!xwl_screen->rootless) {
xwl_window->shell_surface =
wl_shell_get_shell_surface(xwl_screen->shell, xwl_window->surface);
+ if (xwl_window->shell_surface == NULL) {
+ ErrorF("Failed creating shell surface\n");
+ goto err_surf;
+ }
+
wl_shell_surface_add_listener(xwl_window->shell_surface,
&shell_surface_listener, xwl_window);
wl_shell_surface_set_toplevel(xwl_window->shell_surface);
region = wl_compositor_create_region(xwl_screen->compositor);
+ if (region == NULL) {
+ ErrorF("Failed creating region\n");
+ goto err_surf;
+ }
+
wl_region_add(region, 0, 0,
window->drawable.width, window->drawable.height);
wl_surface_set_opaque_region(xwl_window->surface, region);
@@ -262,17 +280,29 @@ xwl_realize_window(WindowPtr window)
wl_surface_set_user_data(xwl_window->surface, xwl_window);
- dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window);
-
xwl_window->damage =
DamageCreate(damage_report, damage_destroy, DamageReportNonEmpty,
FALSE, screen, xwl_window);
+ if (xwl_window->damage == NULL) {
+ ErrorF("Failed creating damage\n");
+ goto err_surf;
+ }
+
DamageRegister(&window->drawable, xwl_window->damage);
DamageSetReportAfterOp(xwl_window->damage, TRUE);
+ dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window);
xorg_list_init(&xwl_window->link_damage);
return ret;
+
+err_surf:
+ if (xwl_window->shell_surface)
+ wl_shell_surface_destroy(xwl_window->shell_surface);
+ wl_surface_destroy(xwl_window->surface);
+err:
+ free(xwl_window);
+ return FALSE;
}
static Bool
@@ -287,10 +317,10 @@ xwl_unrealize_window(WindowPtr window)
xwl_screen = xwl_screen_get(screen);
xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) {
- if (!xwl_seat->focus_window)
- continue;
- if (xwl_seat->focus_window->window == window)
+ if (xwl_seat->focus_window && xwl_seat->focus_window->window == window)
xwl_seat->focus_window = NULL;
+
+ xwl_seat_clear_touch(xwl_seat, window);
}
screen->UnrealizeWindow = xwl_screen->UnrealizeWindow;
@@ -396,8 +426,8 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
wl_registry_bind(registry, id, &wl_shell_interface, 1);
}
else if (strcmp(interface, "wl_output") == 0 && version >= 2) {
- xwl_output_create(xwl_screen, id);
- xwl_screen->expecting_event++;
+ if (xwl_output_create(xwl_screen, id))
+ xwl_screen->expecting_event++;
}
#ifdef GLAMOR_HAS_GBM
else if (xwl_screen->glamor &&
@@ -410,7 +440,16 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
static void
global_remove(void *data, struct wl_registry *registry, uint32_t name)
{
- /* Nothing to do here, wl_compositor and wl_shm should not be removed */
+ struct xwl_screen *xwl_screen = data;
+ struct xwl_output *xwl_output, *tmp_xwl_output;
+
+ 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);
+ break;
+ }
+ }
}
static const struct wl_registry_listener registry_listener = {
@@ -555,6 +594,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
}
}
+ /* In rootless mode, we don't have any screen storage, and the only
+ * rendering should be to redirected mode. */
+ if (xwl_screen->rootless)
+ xwl_screen->root_clip_mode = ROOT_CLIP_INPUT_ONLY;
+ else
+ xwl_screen->root_clip_mode = ROOT_CLIP_FULL;
+
if (xwl_screen->listen_fd_count > 0) {
if (xwl_screen->wm_fd >= 0)
AddCallback(&SelectionCallback, wm_selection_callback, xwl_screen);
@@ -670,6 +716,9 @@ static const ExtensionModule xwayland_extensions[] = {
#ifdef GLXEXT
{ GlxExtensionInit, "GLX", &noGlxExtension },
#endif
+#ifdef XF86VIDMODE
+ { xwlVidModeExtensionInit, XF86VIDMODENAME, &noXFree86VidModeExtension },
+#endif
};
void
diff --git a/xserver/hw/xwayland/xwayland.h b/xserver/hw/xwayland/xwayland.h
index 28b0c995e..67b30cb94 100644
--- a/xserver/hw/xwayland/xwayland.h
+++ b/xserver/hw/xwayland/xwayland.h
@@ -49,6 +49,7 @@ struct xwl_screen {
ScreenPtr screen;
WindowPtr pointer_limbo_window;
int expecting_event;
+ enum RootClipMode root_clip_mode;
int wm_fd;
int listen_fds[5];
@@ -62,7 +63,6 @@ struct xwl_screen {
DestroyWindowProcPtr DestroyWindow;
RealizeWindowProcPtr RealizeWindow;
UnrealizeWindowProcPtr UnrealizeWindow;
- XYToWindowProcPtr XYToWindow;
struct xorg_list output_list;
struct xorg_list seat_list;
@@ -107,13 +107,22 @@ struct xwl_window {
#define MODIFIER_META 0x01
+struct xwl_touch {
+ struct xwl_window *window;
+ int32_t id;
+ int x, y;
+ struct xorg_list link_touch;
+};
+
struct xwl_seat {
DeviceIntPtr pointer;
DeviceIntPtr keyboard;
+ DeviceIntPtr touch;
struct xwl_screen *xwl_screen;
struct wl_seat *seat;
struct wl_pointer *wl_pointer;
struct wl_keyboard *wl_keyboard;
+ struct wl_touch *wl_touch;
struct wl_array keys;
struct xwl_window *focus_window;
uint32_t id;
@@ -124,6 +133,8 @@ struct xwl_seat {
struct wl_callback *cursor_frame_cb;
Bool cursor_needs_update;
+ struct xorg_list touches;
+
size_t keymap_size;
char *keymap;
struct wl_surface *keyboard_focus;
@@ -132,6 +143,7 @@ struct xwl_seat {
struct xwl_output {
struct xorg_list link;
struct wl_output *output;
+ uint32_t server_output_id;
struct xwl_screen *xwl_screen;
RROutputPtr randr_output;
RRCrtcPtr randr_crtc;
@@ -149,6 +161,8 @@ void xwl_seat_set_cursor(struct xwl_seat *xwl_seat);
void xwl_seat_destroy(struct xwl_seat *xwl_seat);
+void xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window);
+
Bool xwl_screen_init_output(struct xwl_screen *xwl_screen);
struct xwl_output *xwl_output_create(struct xwl_screen *xwl_screen,
@@ -176,4 +190,13 @@ Bool xwl_screen_init_glamor(struct xwl_screen *xwl_screen,
uint32_t id, uint32_t version);
struct wl_buffer *xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap);
+#ifdef XV
+/* glamor Xv Adaptor */
+Bool xwl_glamor_xv_init(ScreenPtr pScreen);
+#endif
+
+#ifdef XF86VIDMODE
+void xwlVidModeExtensionInit(void);
+#endif
+
#endif
diff --git a/xserver/hw/xwin/InitOutput.c b/xserver/hw/xwin/InitOutput.c
index 654c58c14..b6f258313 100644
--- a/xserver/hw/xwin/InitOutput.c
+++ b/xserver/hw/xwin/InitOutput.c
@@ -58,6 +58,11 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
HANDLE hToken,
DWORD dwFlags, LPTSTR pszPath);
#endif
+
+#include "winmonitors.h"
+#include "nonsdk_extinit.h"
+#include "pseudoramiX/pseudoramiX.h"
+
#include "glx_extinit.h"
#ifdef XWIN_GLX_WINDOWS
#include "glx/glwindows.h"
@@ -733,13 +738,12 @@ winUseMsg(void)
ErrorF("-engine engine_type_id\n"
"\tOverride the server's automatically selected engine type:\n"
"\t\t1 - Shadow GDI\n"
- "\t\t2 - Shadow DirectDraw\n"
"\t\t4 - Shadow DirectDraw4 Non-Locking\n"
);
ErrorF("-fullscreen\n" "\tRun the server in fullscreen mode.\n");
- ErrorF("-hostintitle\n"
+ ErrorF("-[no]hostintitle\n"
"\tIn multiwindow mode, add remote host names to window titles.\n");
ErrorF("-ignoreinput\n" "\tIgnore keyboard and mouse input.\n");
@@ -973,6 +977,59 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
}
}
+ /*
+ Unless full xinerama has been explicitly enabled, register all native screens with pseudoramiX
+ */
+ if (!noPanoramiXExtension)
+ noPseudoramiXExtension = TRUE;
+
+ if ((g_ScreenInfo[0].fMultipleMonitors) && !noPseudoramiXExtension)
+ {
+ int pass;
+
+ PseudoramiXExtensionInit();
+
+ /* Add primary monitor on pass 0, other monitors on pass 1, to ensure
+ the primary monitor is first in XINERAMA list */
+ for (pass = 0; pass < 2; pass++)
+ {
+ int iMonitor;
+
+ for (iMonitor = 1; ; iMonitor++)
+ {
+ struct GetMonitorInfoData data;
+ QueryMonitor(iMonitor, &data);
+ if (data.bMonitorSpecifiedExists)
+ {
+ MONITORINFO mi;
+ mi.cbSize = sizeof(MONITORINFO);
+
+ if (GetMonitorInfo(data.monitorHandle, &mi))
+ {
+ /* pass == 1 XOR primary monitor flags is set */
+ if ((!(pass == 1)) != (!(mi.dwFlags & MONITORINFOF_PRIMARY)))
+ {
+ /*
+ Note the screen origin in a normalized coordinate space where (0,0) is at the top left
+ of the native virtual desktop area
+ */
+ data.monitorOffsetX = data.monitorOffsetX - GetSystemMetrics(SM_XVIRTUALSCREEN);
+ data.monitorOffsetY = data.monitorOffsetY - GetSystemMetrics(SM_YVIRTUALSCREEN);
+
+ winDebug ("InitOutput - screen %d added at virtual desktop coordinate (%d,%d) (pseudoramiX) \n",
+ iMonitor-1, data.monitorOffsetX, data.monitorOffsetY);
+
+ PseudoramiXAddScreen(data.monitorOffsetX, data.monitorOffsetY,
+ data.monitorWidth, data.monitorHeight);
+ }
+ }
+ }
+ else
+ break;
+ }
+ }
+ }
+
#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
/* Generate a cookie used by internal clients for authorization */
diff --git a/xserver/hw/xwin/Makefile.am b/xserver/hw/xwin/Makefile.am
index 0ea8ba769..4da3d12a4 100644
--- a/xserver/hw/xwin/Makefile.am
+++ b/xserver/hw/xwin/Makefile.am
@@ -71,12 +71,12 @@ SRCS = InitInput.c \
winmsgwindow.c \
winmultiwindowclass.c \
winmultiwindowicons.c \
+ winos.c \
winprefs.c \
winprefsyacc.y \
winprefslex.l \
winprocarg.c \
winscrinit.c \
- winshaddd.c \
winshadddnl.c \
winshadgdi.c \
wintaskbar.c \
diff --git a/xserver/hw/xwin/Makefile.in b/xserver/hw/xwin/Makefile.in
index 96fbe965a..b8d2fa5b5 100644
--- a/xserver/hw/xwin/Makefile.in
+++ b/xserver/hw/xwin/Makefile.in
@@ -60,8 +60,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -82,8 +81,8 @@ am__XWin_SOURCES_DIST = InitInput.c InitOutput.c winallpriv.c \
wincursor.c windialogs.c winengine.c winerror.c winglobals.c \
winkeybd.c winkeyhook.c winmisc.c winmonitors.c winmouse.c \
winmsg.c winmsgwindow.c winmultiwindowclass.c \
- winmultiwindowicons.c winprefs.c winprefsyacc.y winprefslex.l \
- winprocarg.c winscrinit.c winshaddd.c winshadddnl.c \
+ winmultiwindowicons.c winos.c winprefs.c winprefsyacc.y \
+ winprefslex.l winprocarg.c winscrinit.c winshadddnl.c \
winshadgdi.c wintaskbar.c wintrayicon.c winvalargs.c \
winwakeup.c winwindow.c winwndproc.c ddraw.h winconfig.h win.h \
winglobals.h winkeybd.h winkeynames.h winlayouts.h \
@@ -118,9 +117,9 @@ am__objects_6 = InitInput.$(OBJEXT) InitOutput.$(OBJEXT) \
winkeyhook.$(OBJEXT) winmisc.$(OBJEXT) winmonitors.$(OBJEXT) \
winmouse.$(OBJEXT) winmsg.$(OBJEXT) winmsgwindow.$(OBJEXT) \
winmultiwindowclass.$(OBJEXT) winmultiwindowicons.$(OBJEXT) \
- winprefs.$(OBJEXT) winprefsyacc.$(OBJEXT) \
+ winos.$(OBJEXT) winprefs.$(OBJEXT) winprefsyacc.$(OBJEXT) \
winprefslex.$(OBJEXT) winprocarg.$(OBJEXT) \
- winscrinit.$(OBJEXT) winshaddd.$(OBJEXT) winshadddnl.$(OBJEXT) \
+ winscrinit.$(OBJEXT) winshadddnl.$(OBJEXT) \
winshadgdi.$(OBJEXT) wintaskbar.$(OBJEXT) \
wintrayicon.$(OBJEXT) winvalargs.$(OBJEXT) winwakeup.$(OBJEXT) \
winwindow.$(OBJEXT) winwndproc.$(OBJEXT) windisplay.$(OBJEXT) \
@@ -365,7 +364,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -495,8 +493,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -680,12 +676,12 @@ SRCS = InitInput.c \
winmsgwindow.c \
winmultiwindowclass.c \
winmultiwindowicons.c \
+ winos.c \
winprefs.c \
winprefsyacc.y \
winprefslex.l \
winprocarg.c \
winscrinit.c \
- winshaddd.c \
winshadddnl.c \
winshadgdi.c \
wintaskbar.c \
@@ -884,13 +880,13 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winmultiwindowwindow.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winmultiwindowwm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winmultiwindowwndproc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winos.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winprefs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winprefslex.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winprefsyacc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winprocarg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winrandr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winscrinit.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winshaddd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winshadddnl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winshadgdi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wintaskbar.Po@am__quote@
diff --git a/xserver/hw/xwin/XWin.exe.manifest b/xserver/hw/xwin/XWin.exe.manifest
index 477334fb3..bd44b1066 100644
--- a/xserver/hw/xwin/XWin.exe.manifest
+++ b/xserver/hw/xwin/XWin.exe.manifest
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
- <description>The XWin X Windows server for Cygwin.</description>
+ <description>The XWin X Windows server</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
@@ -18,4 +18,18 @@
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!-- Windows Vista -->
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+ <!-- Windows 7 -->
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+ <!-- Windows 8 -->
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+ <!-- Windows 8.1 -->
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+ <!-- Windows 10 -->
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+ </application>
+ </compatibility>
</assembly>
diff --git a/xserver/hw/xwin/glx/Makefile.in b/xserver/hw/xwin/glx/Makefile.in
index bf112168b..ea05a4786 100644
--- a/xserver/hw/xwin/glx/Makefile.in
+++ b/xserver/hw/xwin/glx/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -251,7 +250,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -381,8 +379,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xwin/glx/indirect.c b/xserver/hw/xwin/glx/indirect.c
index 93cdb29d6..e4be64228 100644
--- a/xserver/hw/xwin/glx/indirect.c
+++ b/xserver/hw/xwin/glx/indirect.c
@@ -253,7 +253,7 @@ pfdOut(const PIXELFORMATDESCRIPTOR * pfd)
ErrorF("PIXELFORMATDESCRIPTOR:\n");
ErrorF("nSize = %u\n", pfd->nSize);
ErrorF("nVersion = %u\n", pfd->nVersion);
- ErrorF("dwFlags = %lu = {", pfd->dwFlags);
+ ErrorF("dwFlags = %u = {", (unsigned int)pfd->dwFlags);
DUMP_PFD_FLAG(PFD_DOUBLEBUFFER);
DUMP_PFD_FLAG(PFD_STEREO);
DUMP_PFD_FLAG(PFD_DRAW_TO_WINDOW);
@@ -297,9 +297,9 @@ pfdOut(const PIXELFORMATDESCRIPTOR * pfd)
ErrorF("cAuxBuffers = %hhu\n", pfd->cAuxBuffers);
ErrorF("iLayerType = %hhu\n", pfd->iLayerType);
ErrorF("bReserved = %hhu\n", pfd->bReserved);
- ErrorF("dwLayerMask = %lu\n", pfd->dwLayerMask);
- ErrorF("dwVisibleMask = %lu\n", pfd->dwVisibleMask);
- ErrorF("dwDamageMask = %lu\n", pfd->dwDamageMask);
+ ErrorF("dwLayerMask = %u\n", (unsigned int)pfd->dwLayerMask);
+ ErrorF("dwVisibleMask = %u\n", (unsigned int)pfd->dwVisibleMask);
+ ErrorF("dwDamageMask = %u\n", (unsigned int)pfd->dwDamageMask);
ErrorF("\n");
}
@@ -1862,8 +1862,8 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen)
if (!(pfd.dwFlags & (PFD_DRAW_TO_WINDOW | PFD_DRAW_TO_BITMAP)) ||
!(pfd.dwFlags & PFD_SUPPORT_OPENGL)) {
GLWIN_DEBUG_MSG
- ("pixelFormat %d has unsuitable flags 0x%08lx, skipping", i + 1,
- pfd.dwFlags);
+ ("pixelFormat %d has unsuitable flags 0x%08x, skipping", i + 1,
+ (unsigned int)pfd.dwFlags);
continue;
}
diff --git a/xserver/hw/xwin/glx/winpriv.c b/xserver/hw/xwin/glx/winpriv.c
index 9b4baf381..e6afbff01 100644
--- a/xserver/hw/xwin/glx/winpriv.c
+++ b/xserver/hw/xwin/glx/winpriv.c
@@ -21,7 +21,7 @@ void
HWND
winGetWindowInfo(WindowPtr pWin)
{
- winTrace("%s: pWin %p XID 0x%x\n", __FUNCTION__, pWin, pWin->drawable.id);
+ winTrace("%s: pWin %p XID 0x%x\n", __FUNCTION__, pWin, (unsigned int)pWin->drawable.id);
/* a real window was requested */
if (pWin != NULL) {
diff --git a/xserver/hw/xwin/man/Makefile.in b/xserver/hw/xwin/man/Makefile.in
index 08014b786..61437da9c 100644
--- a/xserver/hw/xwin/man/Makefile.in
+++ b/xserver/hw/xwin/man/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -213,7 +212,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -360,8 +358,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xwin/man/XWin.man b/xserver/hw/xwin/man/XWin.man
index 15a57db02..d68ee2a41 100644
--- a/xserver/hw/xwin/man/XWin.man
+++ b/xserver/hw/xwin/man/XWin.man
@@ -76,6 +76,9 @@ preceeding \fB\-screen\fP parameter.
.B \-[no]multimonitors or \-[no]multiplemonitors
Create a screen 0 that covers all monitors [the primary monitor] on a system with
multiple monitors.
+Fake XINERAMA data is created describing the individual monitors,
+(This is similar to the 'merged framebuffer' or 'pseudo-xinerama' mode provided by
+some drivers for the xorg X server).
This option is currently enabled by default in \fB\-multiwindow\fP mode.
.TP 8
.B "\-screen \fIscreen_number\fP [\fIW\fP \fIH\fP [\fIX\fP \fIY\fP] | [[\fIW\fPx\fIH\fP[+\fIX\fP+\fIY\fP]][@\fIM\fP]] ] "
@@ -167,9 +170,10 @@ on its own is equivalent to \fB\-resize=randr\fP
.SH OPTIONS FOR MULTIWINDOW MODE
.TP 8
-.B \-hostintitle
+.B \-[no]hostintitle
Add the host name to the window title for X applications which are running
on remote hosts, when that information is available and it's useful to do so.
+The default is enabled.
.SH OPTIONS CONTROLLING WINDOWS INTEGRATION
.TP 8
@@ -244,9 +248,6 @@ functionality does not provide a benefit at any number of boxes; we
can only determine the usefulness of this feature through testing.
This option probably has limited effect on current \fIWindows\fP versions
as they already perform GDI batching.
-This parameter works in conjunction with engines 1, 2, and 4 (Shadow
-GDI, Shadow DirectDraw, and Shadow DirectDraw Non-Locking,
-respectively).
.TP 8
.B "\-engine \fIengine_type_id\fP"
This option, which is intended for Cygwin/X developers,
@@ -261,8 +262,6 @@ The engine type ids are:
.RS
.IP 1 4
Shadow GDI
-.IP 2 4
-Shadow DirectDraw
.IP 4 4
Shadow DirectDraw Non-Locking
.RE
diff --git a/xserver/hw/xwin/win.h b/xserver/hw/xwin/win.h
index b7d20ca73..5710ea852 100644
--- a/xserver/hw/xwin/win.h
+++ b/xserver/hw/xwin/win.h
@@ -101,7 +101,6 @@
#define WIN_SERVER_NONE 0x0L /* 0 */
#define WIN_SERVER_SHADOW_GDI 0x1L /* 1 */
-#define WIN_SERVER_SHADOW_DD 0x2L /* 2 */
#define WIN_SERVER_SHADOW_DDNL 0x4L /* 4 */
#define AltMapIndex Mod1MapIndex
@@ -468,35 +467,20 @@ typedef struct _winPrivScreenRec {
int iE3BCachedPress;
Bool fE3BFakeButton2Sent;
- /* Privates used by shadow fb GDI server */
+ /* Privates used by shadow fb GDI engine */
HBITMAP hbmpShadow;
HDC hdcScreen;
HDC hdcShadow;
HWND hwndScreen;
BITMAPINFOHEADER *pbmih;
- /* Privates used by shadow fb and primary fb DirectDraw servers */
+ /* Privates used by shadow fb DirectDraw Nonlocking engine */
LPDIRECTDRAW pdd;
- LPDIRECTDRAWSURFACE2 pddsPrimary;
- LPDIRECTDRAW2 pdd2;
-
- /* Privates used by shadow fb DirectDraw server */
- LPDIRECTDRAWSURFACE2 pddsShadow;
- LPDDSURFACEDESC pddsdShadow;
-
- /* Privates used by primary fb DirectDraw server */
- LPDIRECTDRAWSURFACE2 pddsOffscreen;
- LPDDSURFACEDESC pddsdOffscreen;
- LPDDSURFACEDESC pddsdPrimary;
-
- /* Privates used by shadow fb DirectDraw Nonlocking server */
LPDIRECTDRAW4 pdd4;
LPDIRECTDRAWSURFACE4 pddsShadow4;
LPDIRECTDRAWSURFACE4 pddsPrimary4;
- BOOL fRetryCreateSurface;
-
- /* Privates used by both shadow fb DirectDraw servers */
LPDIRECTDRAWCLIPPER pddcPrimary;
+ BOOL fRetryCreateSurface;
#ifdef XWIN_MULTIWINDOWEXTWM
/* Privates used by multi-window external window manager */
@@ -921,13 +905,6 @@ Bool
winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv);
/*
- * winshaddd.c
- */
-
-Bool
- winSetEngineFunctionsShadowDD(ScreenPtr pScreen);
-
-/*
* winshadddnl.c
*/
@@ -1219,6 +1196,12 @@ Bool
winCreateMsgWindowThread(void);
/*
+ * winos.c
+ */
+void
+winOS(void);
+
+/*
* END DDX and DIX Function Prototypes
*/
diff --git a/xserver/hw/xwin/winallpriv.c b/xserver/hw/xwin/winallpriv.c
index 629af92c9..816b030ca 100644
--- a/xserver/hw/xwin/winallpriv.c
+++ b/xserver/hw/xwin/winallpriv.c
@@ -48,8 +48,8 @@ winAllocatePrivates(ScreenPtr pScreen)
winPrivScreenPtr pScreenPriv;
#if CYGDEBUG
- winDebug("winAllocateScreenPrivates - g_ulServerGeneration: %d "
- "serverGeneration: %d\n", g_ulServerGeneration, serverGeneration);
+ winDebug("winAllocateScreenPrivates - g_ulServerGeneration: %lu "
+ "serverGeneration: %lu\n", g_ulServerGeneration, serverGeneration);
#endif
/* We need a new slot for our privates if the screen gen has changed */
diff --git a/xserver/hw/xwin/winauth.c b/xserver/hw/xwin/winauth.c
index 7efa1c00f..7be7dcae1 100644
--- a/xserver/hw/xwin/winauth.c
+++ b/xserver/hw/xwin/winauth.c
@@ -114,7 +114,6 @@ GenerateAuthorization(unsigned name_length,
Bool
winGenerateAuthorization(void)
{
- Bool fFreeAuth = FALSE;
SecurityAuthorizationPtr pAuth = NULL;
/* Call OS layer to generate authorization key */
@@ -123,7 +122,7 @@ winGenerateAuthorization(void)
0, NULL, &g_uiAuthDataLen, &g_pAuthData);
if ((XID) ~0L == g_authId) {
ErrorF("winGenerateAuthorization - GenerateAuthorization failed\n");
- goto auth_bailout;
+ return FALSE;
}
else {
@@ -139,7 +138,7 @@ winGenerateAuthorization(void)
if (!(pAuth)) {
ErrorF("winGenerateAuthorization - Failed allocating "
"SecurityAuthorizationPtr.\n");
- goto auth_bailout;
+ return FALSE;
}
/* Fill in the auth fields */
@@ -155,21 +154,11 @@ winGenerateAuthorization(void)
/* Add the authorization to the server's auth list */
if (!AddResource(g_authId, SecurityAuthorizationResType, pAuth)) {
ErrorF("winGenerateAuthorization - AddResource failed for auth.\n");
- fFreeAuth = TRUE;
- goto auth_bailout;
+ return FALSE;
}
-
- /* Don't free the auth data, since it is still used internally */
- pAuth = NULL;
#endif
return TRUE;
-
- auth_bailout:
- if (fFreeAuth)
- free(pAuth);
-
- return FALSE;
}
/* Use our generated cookie for authentication */
diff --git a/xserver/hw/xwin/winclipboard/Makefile.in b/xserver/hw/xwin/winclipboard/Makefile.in
index 772a40230..31bdcba0e 100644
--- a/xserver/hw/xwin/winclipboard/Makefile.in
+++ b/xserver/hw/xwin/winclipboard/Makefile.in
@@ -60,8 +60,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -263,7 +262,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -410,8 +408,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/hw/xwin/winclipboard/thread.c b/xserver/hw/xwin/winclipboard/thread.c
index 50e1e8cb5..fa57ada80 100644
--- a/xserver/hw/xwin/winclipboard/thread.c
+++ b/xserver/hw/xwin/winclipboard/thread.c
@@ -84,6 +84,10 @@ static pthread_t g_winClipboardProcThread;
int xfixes_event_base;
int xfixes_error_base;
+Bool g_fHasModernClipboardApi = FALSE;
+ADDCLIPBOARDFORMATLISTENERPROC g_fpAddClipboardFormatListener;
+REMOVECLIPBOARDFORMATLISTENERPROC g_fpRemoveClipboardFormatListener;
+
/*
* Local function prototypes
*/
@@ -138,6 +142,11 @@ winClipboardProc(Bool fUseUnicode, char *szDisplay)
ErrorF("winClipboardProc - Warning: Locale not supported by X.\n");
}
+ g_fpAddClipboardFormatListener = (ADDCLIPBOARDFORMATLISTENERPROC)GetProcAddress(GetModuleHandle("user32"),"AddClipboardFormatListener");
+ g_fpRemoveClipboardFormatListener = (REMOVECLIPBOARDFORMATLISTENERPROC)GetProcAddress(GetModuleHandle("user32"),"RemoveClipboardFormatListener");
+ g_fHasModernClipboardApi = g_fpAddClipboardFormatListener && g_fpRemoveClipboardFormatListener;
+ ErrorF("OS maintains clipboard viewer chain: %s\n", g_fHasModernClipboardApi ? "yes" : "no");
+
g_winClipboardProcThread = pthread_self();
/* Set error handler */
diff --git a/xserver/hw/xwin/winclipboard/wndproc.c b/xserver/hw/xwin/winclipboard/wndproc.c
index 1ea5bc6b7..d289f7755 100644
--- a/xserver/hw/xwin/winclipboard/wndproc.c
+++ b/xserver/hw/xwin/winclipboard/wndproc.c
@@ -58,6 +58,9 @@
#define WIN_POLL_TIMEOUT 1
+#ifndef WM_CLIPBOARDUPDATE
+#define WM_CLIPBOARDUPDATE 0x031D
+#endif
/*
* Process X events up to specified timeout
@@ -104,7 +107,7 @@ winProcessXEventsTimeout(HWND hwnd, Window iWindow, Display * pDisplay,
remainingTime = dwStopTime - GetTickCount();
tv.tv_sec = remainingTime / 1000;
tv.tv_usec = (remainingTime % 1000) * 1000;
- winDebug("winProcessXEventsTimeout () - %d milliseconds left\n",
+ winDebug("winProcessXEventsTimeout () - %ld milliseconds left\n",
remainingTime);
/* Break out if no time left */
@@ -151,8 +154,16 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
winDebug("winClipboardWindowProc - WM_DESTROY\n");
- /* Remove ourselves from the clipboard chain */
- ChangeClipboardChain(hwnd, s_hwndNextViewer);
+ if (g_fHasModernClipboardApi)
+ {
+ /* Remove clipboard listener */
+ g_fpRemoveClipboardFormatListener(hwnd);
+ }
+ else
+ {
+ /* Remove ourselves from the clipboard chain */
+ ChangeClipboardChain(hwnd, s_hwndNextViewer);
+ }
s_hwndNextViewer = NULL;
}
@@ -168,8 +179,6 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_CREATE:
{
- HWND first, next;
- DWORD error_code = 0;
ClipboardWindowCreationParams *cwcp = (ClipboardWindowCreationParams *)((CREATESTRUCT *)lParam)->lpCreateParams;
winDebug("winClipboardWindowProc - WM_CREATE\n");
@@ -179,24 +188,34 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
atoms = cwcp->atoms;
fRunning = TRUE;
- first = GetClipboardViewer(); /* Get handle to first viewer in chain. */
- if (first == hwnd)
- return 0; /* Make sure it's not us! */
- /* Add ourselves to the clipboard viewer chain */
- next = SetClipboardViewer(hwnd);
- error_code = GetLastError();
- if (SUCCEEDED(error_code) && (next == first)) /* SetClipboardViewer must have succeeded, and the handle */
- s_hwndNextViewer = next; /* it returned must have been the first window in the chain */
+ if (g_fHasModernClipboardApi)
+ {
+ g_fpAddClipboardFormatListener(hwnd);
+ }
else
- s_fCBCInitialized = FALSE;
+ {
+ HWND first, next;
+ DWORD error_code = 0;
+
+ first = GetClipboardViewer(); /* Get handle to first viewer in chain. */
+ if (first == hwnd)
+ return 0; /* Make sure it's not us! */
+ /* Add ourselves to the clipboard viewer chain */
+ next = SetClipboardViewer(hwnd);
+ error_code = GetLastError();
+ if (SUCCEEDED(error_code) && (next == first)) /* SetClipboardViewer must have succeeded, and the handle */
+ s_hwndNextViewer = next; /* it returned must have been the first window in the chain */
+ else
+ s_fCBCInitialized = FALSE;
+ }
}
return 0;
case WM_CHANGECBCHAIN:
{
- winDebug("winClipboardWindowProc - WM_CHANGECBCHAIN: wParam(%x) "
- "lParam(%x) s_hwndNextViewer(%x)\n",
- wParam, lParam, s_hwndNextViewer);
+ winDebug("winClipboardWindowProc - WM_CHANGECBCHAIN: wParam(%p) "
+ "lParam(%p) s_hwndNextViewer(%p)\n",
+ (HWND)wParam, (HWND)lParam, s_hwndNextViewer);
if ((HWND) wParam == s_hwndNextViewer) {
s_hwndNextViewer = (HWND) lParam;
@@ -233,10 +252,15 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
winDebug("winClipboardWindowProc - WM_WM_REINIT: Enter\n");
+ if (g_fHasModernClipboardApi)
+ {
+ return 0;
+ }
+
first = GetClipboardViewer(); /* Get handle to first viewer in chain. */
if (first == hwnd)
return 0; /* Make sure it's not us! */
- winDebug(" WM_WM_REINIT: Replacing us(%x) with %x at head "
+ winDebug(" WM_WM_REINIT: Replacing us(%p) with %p at head "
"of chain\n", hwnd, s_hwndNextViewer);
s_fCBCInitialized = FALSE;
ChangeClipboardChain(hwnd, s_hwndNextViewer);
@@ -257,38 +281,45 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
return 0;
case WM_DRAWCLIPBOARD:
+ case WM_CLIPBOARDUPDATE:
{
static Bool s_fProcessingDrawClipboard = FALSE;
int iReturn;
- winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Enter\n");
+ if (message == WM_DRAWCLIPBOARD)
+ winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Enter\n");
+ else
+ winDebug("winClipboardWindowProc - WM_CLIPBOARDUPDATE: Enter\n");
- /*
- * We've occasionally seen a loop in the clipboard chain.
- * Try and fix it on the first hint of recursion.
- */
- if (!s_fProcessingDrawClipboard) {
- s_fProcessingDrawClipboard = TRUE;
- }
- else {
- /* Attempt to break the nesting by getting out of the chain, twice?, and then fix and bail */
- s_fCBCInitialized = FALSE;
- ChangeClipboardChain(hwnd, s_hwndNextViewer);
- winFixClipboardChain();
- ErrorF("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
- "Nested calls detected. Re-initing.\n");
- winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
- s_fProcessingDrawClipboard = FALSE;
- return 0;
- }
+ if (!g_fHasModernClipboardApi)
+ {
+ /*
+ * We've occasionally seen a loop in the clipboard chain.
+ * Try and fix it on the first hint of recursion.
+ */
+ if (!s_fProcessingDrawClipboard) {
+ s_fProcessingDrawClipboard = TRUE;
+ }
+ else {
+ /* Attempt to break the nesting by getting out of the chain, twice?, and then fix and bail */
+ s_fCBCInitialized = FALSE;
+ ChangeClipboardChain(hwnd, s_hwndNextViewer);
+ winFixClipboardChain();
+ ErrorF("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "Nested calls detected. Re-initing.\n");
+ winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
+ s_fProcessingDrawClipboard = FALSE;
+ return 0;
+ }
- /* Bail on first message */
- if (!s_fCBCInitialized) {
- s_fCBCInitialized = TRUE;
- s_fProcessingDrawClipboard = FALSE;
- winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
- return 0;
- }
+ /* Bail on first message */
+ if (!s_fCBCInitialized) {
+ s_fCBCInitialized = TRUE;
+ s_fProcessingDrawClipboard = FALSE;
+ winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
+ return 0;
+ }
+ }
/*
* NOTE: We cannot bail out when NULL == GetClipboardOwner ()
@@ -441,7 +472,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
int best_target = 0;
winDebug("winClipboardWindowProc - WM_RENDERFORMAT %d - Hello.\n",
- wParam);
+ (int)wParam);
/* Flag whether to convert to Unicode or not */
fConvertToUnicode = (CF_UNICODETEXT == wParam);
diff --git a/xserver/hw/xwin/winclipboard/xevents.c b/xserver/hw/xwin/winclipboard/xevents.c
index 835195b52..aee6c86a2 100644
--- a/xserver/hw/xwin/winclipboard/xevents.c
+++ b/xserver/hw/xwin/winclipboard/xevents.c
@@ -107,7 +107,7 @@ MonitorSelection(XFixesSelectionNotifyEvent * e, unsigned int i)
/* Save new selection owner or None */
s_iOwners[i] = e->owner;
- winDebug("MonitorSelection - %s - Now owned by XID %x\n",
+ winDebug("MonitorSelection - %s - Now owned by XID %lx\n",
szSelectionNames[i], e->owner);
}
@@ -172,7 +172,7 @@ winClipboardSelectionNotifyTargets(HWND hwnd, Window iWindow, Display *pDisplay,
Atom atom = prop[i];
char *pszAtomName = XGetAtomName(pDisplay, atom);
data->targetList[i] = atom;
- winDebug("winClipboardFlushXEvents - SelectionNotify - target[%d] %d = %s\n", i, atom, pszAtomName);
+ winDebug("winClipboardFlushXEvents - SelectionNotify - target[%d] %ld = %s\n", i, atom, pszAtomName);
XFree(pszAtomName);
}
@@ -231,7 +231,7 @@ winClipboardFlushXEvents(HWND hwnd,
{
char *pszAtomName = NULL;
- winDebug("SelectionRequest - target %d\n",
+ winDebug("SelectionRequest - target %ld\n",
event.xselectionrequest.target);
pszAtomName = XGetAtomName(pDisplay,
@@ -309,7 +309,7 @@ winClipboardFlushXEvents(HWND hwnd,
/* Access the clipboard */
if (!OpenClipboard(hwnd)) {
ErrorF("winClipboardFlushXEvents - SelectionRequest - "
- "OpenClipboard () failed: %08lx\n", GetLastError());
+ "OpenClipboard () failed: %08x\n", (unsigned int)GetLastError());
/* Abort */
fAbort = TRUE;
@@ -369,7 +369,7 @@ winClipboardFlushXEvents(HWND hwnd,
}
if (!hGlobal) {
ErrorF("winClipboardFlushXEvents - SelectionRequest - "
- "GetClipboardData () failed: %08lx\n", GetLastError());
+ "GetClipboardData () failed: %08x\n", (unsigned int)GetLastError());
/* Abort */
fAbort = TRUE;
@@ -561,7 +561,7 @@ winClipboardFlushXEvents(HWND hwnd,
*/
if (event.xselection.property == None) {
ErrorF("winClipboardFlushXEvents - SelectionNotify - "
- "Conversion to format %d refused.\n",
+ "Conversion to format %ld refused.\n",
event.xselection.target);
return WIN_XEVENTS_FAILED;
}
@@ -591,7 +591,7 @@ winClipboardFlushXEvents(HWND hwnd,
{
char *pszAtomName = NULL;
- winDebug("SelectionNotify - returned data %d left %d\n",
+ winDebug("SelectionNotify - returned data %lu left %lu\n",
xtpText.nitems, ulReturnBytesLeft);
pszAtomName = XGetAtomName(pDisplay, xtpText.encoding);
winDebug("Notify atom name %s\n", pszAtomName);
@@ -706,7 +706,7 @@ winClipboardFlushXEvents(HWND hwnd,
/* Check that global memory was allocated */
if (!hGlobal) {
ErrorF("winClipboardFlushXEvents - SelectionNotify "
- "GlobalAlloc failed, aborting: %ld\n", GetLastError());
+ "GlobalAlloc failed, aborting: %08x\n", (unsigned int)GetLastError());
/* Abort */
fAbort = TRUE;
diff --git a/xserver/hw/xwin/wincmap.c b/xserver/hw/xwin/wincmap.c
index 1bdc7df70..000334ce3 100644
--- a/xserver/hw/xwin/wincmap.c
+++ b/xserver/hw/xwin/wincmap.c
@@ -360,8 +360,8 @@ winGetPaletteDIB(ScreenPtr pScreen, ColormapPtr pcmap)
nBlue = rgbColors[i].rgbBlue << 8;
#if CYGDEBUG
- winDebug("winGetPaletteDIB - Allocating a color: %d; "
- "%d %d %d\n", pixel, nRed, nGreen, nBlue);
+ winDebug("winGetPaletteDIB - Allocating a color: %u; "
+ "%d %d %d\n", (unsigned int)pixel, nRed, nGreen, nBlue);
#endif
/* Allocate a entry in the X colormap */
@@ -445,8 +445,8 @@ winGetPaletteDD(ScreenPtr pScreen, ColormapPtr pcmap)
nGreen = ppeColors[i].peGreen << 8;
nBlue = ppeColors[i].peBlue << 8;
#if CYGDEBUG
- winDebug("winGetPaletteDD - Allocating a color: %d; "
- "%d %d %d\n", pixel, nRed, nGreen, nBlue);
+ winDebug("winGetPaletteDD - Allocating a color: %u; "
+ "%d %d %d\n", (unsigned int)pixel, nRed, nGreen, nBlue);
#endif
if (AllocColor(pcmap, &nRed, &nGreen, &nBlue, &pixel, 0) != Success) {
ErrorF("winGetPaletteDD - AllocColor () failed, pixel %d\n", i);
@@ -515,7 +515,7 @@ winCreateDefColormap(ScreenPtr pScreen)
*/
#if CYGDEBUG
- winDebug("winCreateDefColormap - defColormap: %d\n", pScreen->defColormap);
+ winDebug("winCreateDefColormap - defColormap: %lu\n", pScreen->defColormap);
#endif
/* Allocate an X colormap, owned by client 0 */
diff --git a/xserver/hw/xwin/winconfig.c b/xserver/hw/xwin/winconfig.c
index 321dfeed2..fb99113d5 100644
--- a/xserver/hw/xwin/winconfig.c
+++ b/xserver/hw/xwin/winconfig.c
@@ -224,7 +224,8 @@ winConfigKeyboard(DeviceIntPtr pDevice)
{
char layoutName[KL_NAMELENGTH];
unsigned char layoutFriendlyName[256];
- static unsigned int layoutNum = 0;
+ unsigned int layoutNum = 0;
+ unsigned int deviceIdentifier = 0;
int keyboardType;
#ifdef XWIN_XF86CONFIG
@@ -263,7 +264,7 @@ winConfigKeyboard(DeviceIntPtr pDevice)
break;
}
g_winInfo.keyboard.rate = (kbd_speed > 0) ? kbd_speed : 1;
- winMsgVerb(X_PROBED, 1, "Setting autorepeat to delay=%d, rate=%d\n",
+ winMsgVerb(X_PROBED, 1, "Setting autorepeat to delay=%ld, rate=%ld\n",
g_winInfo.keyboard.delay, g_winInfo.keyboard.rate);
}
}
@@ -272,15 +273,10 @@ winConfigKeyboard(DeviceIntPtr pDevice)
if (keyboardType > 0 && GetKeyboardLayoutName(layoutName)) {
WinKBLayoutPtr pLayout;
Bool bfound = FALSE;
+ int pass;
- if (!layoutNum)
- layoutNum = strtoul(layoutName, (char **) NULL, 16);
+ layoutNum = strtoul(layoutName, (char **) NULL, 16);
if ((layoutNum & 0xffff) == 0x411) {
- /* The japanese layouts know a lot of different IMEs which all have
- different layout numbers set. Map them to a single entry.
- Same might apply for chinese, korean and other symbol languages
- too */
- layoutNum = (layoutNum & 0xffff);
if (keyboardType == 7) {
/* Japanese layouts have problems with key event messages
such as the lack of WM_KEYUP for Caps Lock key.
@@ -318,31 +314,47 @@ winConfigKeyboard(DeviceIntPtr pDevice)
"Windows keyboard layout: \"%s\" (%08x) \"%s\", type %d\n",
layoutName, layoutNum, layoutFriendlyName, keyboardType);
- for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++) {
- if (pLayout->winlayout != layoutNum)
- continue;
- if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType)
- continue;
-
- bfound = TRUE;
- winMsg(X_PROBED,
- "Found matching XKB configuration \"%s\"\n",
- pLayout->layoutname);
-
- winMsg(X_PROBED,
- "Model = \"%s\" Layout = \"%s\""
- " Variant = \"%s\" Options = \"%s\"\n",
- pLayout->xkbmodel ? pLayout->xkbmodel : "none",
- pLayout->xkblayout ? pLayout->xkblayout : "none",
- pLayout->xkbvariant ? pLayout->xkbvariant : "none",
- pLayout->xkboptions ? pLayout->xkboptions : "none");
+ deviceIdentifier = layoutNum >> 16;
+ for (pass = 0; pass < 2; pass++) {
+ /* If we didn't find an exact match for the input locale identifer,
+ try to find an match on the language identifier part only */
+ if (pass == 1)
+ layoutNum = (layoutNum & 0xffff);
+
+ for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++) {
+ if (pLayout->winlayout != layoutNum)
+ continue;
+ if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType)
+ continue;
+
+ bfound = TRUE;
+ winMsg(X_PROBED,
+ "Found matching XKB configuration \"%s\"\n",
+ pLayout->layoutname);
+
+ winMsg(X_PROBED,
+ "Model = \"%s\" Layout = \"%s\""
+ " Variant = \"%s\" Options = \"%s\"\n",
+ pLayout->xkbmodel ? pLayout->xkbmodel : "none",
+ pLayout->xkblayout ? pLayout->xkblayout : "none",
+ pLayout->xkbvariant ? pLayout->xkbvariant : "none",
+ pLayout->xkboptions ? pLayout->xkboptions : "none");
+
+ g_winInfo.xkb.model = pLayout->xkbmodel;
+ g_winInfo.xkb.layout = pLayout->xkblayout;
+ g_winInfo.xkb.variant = pLayout->xkbvariant;
+ g_winInfo.xkb.options = pLayout->xkboptions;
+
+ if (deviceIdentifier == 0xa000) {
+ winMsg(X_PROBED, "Windows keyboard layout device identifier indicates Macintosh, setting Model = \"macintosh\"");
+ g_winInfo.xkb.model = "macintosh";
+ }
- g_winInfo.xkb.model = pLayout->xkbmodel;
- g_winInfo.xkb.layout = pLayout->xkblayout;
- g_winInfo.xkb.variant = pLayout->xkbvariant;
- g_winInfo.xkb.options = pLayout->xkboptions;
+ break;
+ }
- break;
+ if (bfound)
+ break;
}
if (!bfound) {
diff --git a/xserver/hw/xwin/wincreatewnd.c b/xserver/hw/xwin/wincreatewnd.c
index 6c5b21dfa..b2f797c51 100644
--- a/xserver/hw/xwin/wincreatewnd.c
+++ b/xserver/hw/xwin/wincreatewnd.c
@@ -357,10 +357,11 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
}
winDebug("winCreateBoundingWindowWindowed - WindowClient "
- "w %ld h %ld r %ld l %ld b %ld t %ld\n",
- rcClient.right - rcClient.left,
- rcClient.bottom - rcClient.top,
- rcClient.right, rcClient.left, rcClient.bottom, rcClient.top);
+ "w %d h %d r %d l %d b %d t %d\n",
+ (int)(rcClient.right - rcClient.left),
+ (int)(rcClient.bottom - rcClient.top),
+ (int)rcClient.right, (int)rcClient.left,
+ (int)rcClient.bottom, (int)rcClient.top);
/* We adjust the visual size if the user did not specify it */
if (!
diff --git a/xserver/hw/xwin/windialogs.c b/xserver/hw/xwin/windialogs.c
index 6fe3fc442..c83b49bab 100644
--- a/xserver/hw/xwin/windialogs.c
+++ b/xserver/hw/xwin/windialogs.c
@@ -443,9 +443,9 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message,
#endif
#if CYGDEBUG
- winDebug("winChangeDepthDlgProc - WM_INITDIALOG - orig bpp: %d, "
+ winDebug("winChangeDepthDlgProc - WM_INITDIALOG - orig bpp: %u, "
"current bpp: %d\n",
- s_pScreenInfo->dwBPP,
+ (unsigned int)s_pScreenInfo->dwBPP,
GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL));
#endif
@@ -455,9 +455,9 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message,
case WM_DISPLAYCHANGE:
#if CYGDEBUG
- winDebug("winChangeDepthDlgProc - WM_DISPLAYCHANGE - orig bpp: %d, "
+ winDebug("winChangeDepthDlgProc - WM_DISPLAYCHANGE - orig bpp: %u, "
"new bpp: %d\n",
- s_pScreenInfo->dwBPP,
+ (unsigned int)s_pScreenInfo->dwBPP,
GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL));
#endif
diff --git a/xserver/hw/xwin/winengine.c b/xserver/hw/xwin/winengine.c
index b473b3ac0..b8f8da06b 100644
--- a/xserver/hw/xwin/winengine.c
+++ b/xserver/hw/xwin/winengine.c
@@ -54,16 +54,9 @@ static HMODULE g_hmodDirectDraw = NULL;
void
winDetectSupportedEngines(void)
{
- OSVERSIONINFO osvi;
-
/* Initialize the engine support flags */
g_dwEnginesSupported = WIN_SERVER_SHADOW_GDI;
- /* Get operating system version information */
- ZeroMemory(&osvi, sizeof(osvi));
- osvi.dwOSVersionInfoSize = sizeof(osvi);
- GetVersionEx(&osvi);
-
/* Do we have DirectDraw? */
if (g_hmodDirectDraw != NULL) {
LPDIRECTDRAW lpdd = NULL;
@@ -85,12 +78,6 @@ winDetectSupportedEngines(void)
"winDetectSupportedEngines - DirectDraw not installed\n");
return;
}
- else {
- /* We have DirectDraw */
- winErrorFVerb(2,
- "winDetectSupportedEngines - DirectDraw installed, allowing ShadowDD\n");
- g_dwEnginesSupported |= WIN_SERVER_SHADOW_DD;
- }
/* Try to query for DirectDraw4 interface */
ddrval = IDirectDraw_QueryInterface(lpdd,
@@ -187,9 +174,6 @@ winSetEngine(ScreenPtr pScreen)
case WIN_SERVER_SHADOW_GDI:
winSetEngineFunctionsShadowGDI(pScreen);
break;
- case WIN_SERVER_SHADOW_DD:
- winSetEngineFunctionsShadowDD(pScreen);
- break;
case WIN_SERVER_SHADOW_DDNL:
winSetEngineFunctionsShadowDDNL(pScreen);
break;
@@ -209,16 +193,6 @@ winSetEngine(ScreenPtr pScreen)
return TRUE;
}
- /* ShadowDD is next in line */
- if (g_dwEnginesSupported & WIN_SERVER_SHADOW_DD) {
- winErrorFVerb(2, "winSetEngine - Using Shadow DirectDraw\n");
- pScreenInfo->dwEngine = WIN_SERVER_SHADOW_DD;
-
- /* Set engine function pointers */
- winSetEngineFunctionsShadowDD(pScreen);
- return TRUE;
- }
-
/* ShadowGDI is next in line */
if (g_dwEnginesSupported & WIN_SERVER_SHADOW_GDI) {
winErrorFVerb(2, "winSetEngine - Using Shadow GDI DIB\n");
diff --git a/xserver/hw/xwin/winglobals.c b/xserver/hw/xwin/winglobals.c
index ad82b83f6..1382c8972 100644
--- a/xserver/hw/xwin/winglobals.c
+++ b/xserver/hw/xwin/winglobals.c
@@ -78,7 +78,7 @@ Bool g_fNoHelpMessageBox = FALSE;
Bool g_fSoftwareCursor = FALSE;
Bool g_fSilentDupError = FALSE;
Bool g_fNativeGl = TRUE;
-Bool g_fHostInTitle = FALSE;
+Bool g_fHostInTitle = TRUE;
pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER;
#ifdef XWIN_CLIPBOARD
diff --git a/xserver/hw/xwin/winkeybd.c b/xserver/hw/xwin/winkeybd.c
index 3a75ab268..ab53af4ba 100644
--- a/xserver/hw/xwin/winkeybd.c
+++ b/xserver/hw/xwin/winkeybd.c
@@ -74,7 +74,7 @@ winTranslateKey(WPARAM wParam, LPARAM lParam)
int iParamScanCode = LOBYTE(iParam);
int iScanCode;
- winDebug("winTranslateKey: wParam %08x lParam %08x\n", wParam, lParam);
+ winDebug("winTranslateKey: wParam %08x lParam %08x\n", (int)wParam, (int)lParam);
/* WM_ key messages faked by Vista speech recognition (WSR) don't have a
* scan code.
@@ -502,9 +502,9 @@ winSendKeyEvent(DWORD dwKey, Bool fDown)
g_winKeyState[dwKey] = fDown;
QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease,
- dwKey + MIN_KEYCODE, NULL);
+ dwKey + MIN_KEYCODE);
- winDebug("winSendKeyEvent: dwKey: %d, fDown: %d\n", dwKey, fDown);
+ winDebug("winSendKeyEvent: dwKey: %u, fDown: %u\n", (unsigned int)dwKey, fDown);
}
BOOL
diff --git a/xserver/hw/xwin/winkeyhook.c b/xserver/hw/xwin/winkeyhook.c
index fe77b2190..66d68f63d 100644
--- a/xserver/hw/xwin/winkeyhook.c
+++ b/xserver/hw/xwin/winkeyhook.c
@@ -84,7 +84,7 @@ winKeyboardMessageHookLL(int iCode, WPARAM wParam, LPARAM lParam)
/* Pass keystrokes on to our main message loop */
if (iCode == HC_ACTION) {
winDebug("winKeyboardMessageHook: vkCode: %08x scanCode: %08x\n",
- p->vkCode, p->scanCode);
+ (unsigned int)p->vkCode, (unsigned int)p->scanCode);
switch (wParam) {
case WM_KEYDOWN:
diff --git a/xserver/hw/xwin/winlayouts.h b/xserver/hw/xwin/winlayouts.h
index a61fd7ac1..c7905e3c2 100644
--- a/xserver/hw/xwin/winlayouts.h
+++ b/xserver/hw/xwin/winlayouts.h
@@ -42,7 +42,8 @@ typedef struct {
*/
WinKBLayoutRec winKBLayouts[] = {
- {0x00000404, -1, "pc105", "zh_TW", NULL, NULL, "Chinese (Taiwan)"},
+ {0x00000404, -1, "pc105", "cn", NULL, NULL, "Chinese (Traditional)"},
+ {0x00000804, -1, "pc105", "cn", NULL, NULL, "Chinese (Simplified)"},
{0x00000405, -1, "pc105", "cz", NULL, NULL, "Czech"},
{0x00010405, -1, "pc105", "cz_qwerty", NULL, NULL, "Czech (QWERTY)"},
{0x00000406, -1, "pc105", "dk", NULL, NULL, "Danish"},
@@ -72,8 +73,8 @@ WinKBLayoutRec winKBLayouts[] = {
{0x0000040f, -1, "pc105", "is", NULL, NULL, "Icelandic"},
{0x00000410, -1, "pc105", "it", NULL, NULL, "Italian"},
{0x00010410, -1, "pc105", "it", NULL, NULL, "Italian (142)"},
- {0xa0000410, -1, "macbook79", "it", "mac", NULL, "Italiano (Apple)"},
{0x00000411, 7, "jp106", "jp", NULL, NULL, "Japanese"},
+ {0x00000412, -1, "kr106", "kr", NULL, NULL, "Korean"},
{0x00000413, -1, "pc105", "nl", NULL, NULL, "Dutch"},
{0x00000813, -1, "pc105", "be", NULL, NULL, "Dutch (Belgian)"},
{0x00000414, -1, "pc105", "no", NULL, NULL, "Norwegian"},
diff --git a/xserver/hw/xwin/winmsg.c b/xserver/hw/xwin/winmsg.c
index 56e7a097c..575bc47b2 100644
--- a/xserver/hw/xwin/winmsg.c
+++ b/xserver/hw/xwin/winmsg.c
@@ -158,8 +158,8 @@ winDebugWin32Message(const char *function, HWND hwnd, UINT message,
getenv("WIN_DEBUG_WM_USER")) {
winDebug("%s - Message WM_USER + %d\n", function,
message - WM_USER);
- winDebug("\thwnd 0x%x wParam 0x%x lParam 0x%x\n", hwnd, wParam,
- lParam);
+ winDebug("\thwnd 0x%p wParam 0x%x lParam 0x%x\n", hwnd, (int)wParam,
+ (int)lParam);
}
}
else if (message < MESSAGE_NAMES_LEN && MESSAGE_NAMES[message]) {
@@ -170,8 +170,8 @@ winDebugWin32Message(const char *function, HWND hwnd, UINT message,
buffer[63] = 0;
if (force || getenv("WIN_DEBUG_MESSAGES") || getenv(buffer)) {
winDebug("%s - Message %s\n", function, MESSAGE_NAMES[message]);
- winDebug("\thwnd 0x%x wParam 0x%x lParam 0x%x\n", hwnd, wParam,
- lParam);
+ winDebug("\thwnd 0x%p wParam 0x%x lParam 0x%x\n", hwnd, (int)wParam,
+ (int)lParam);
}
}
}
diff --git a/xserver/hw/xwin/winmultiwindowclass.h b/xserver/hw/xwin/winmultiwindowclass.h
index 3244f78e3..37ee9fb13 100644
--- a/xserver/hw/xwin/winmultiwindowclass.h
+++ b/xserver/hw/xwin/winmultiwindowclass.h
@@ -31,11 +31,24 @@
*/
/*
+ * The next block of definitions are for window manager properties that
+ * clients and applications use for communication.
+ */
+
+/*
* Structures
*/
+/*
+ * WM_HINTS structure
+ *
+ * NOTE: this structure represents the internal format stored in the property
+ * after it is marshalled by libX11, converting the flags field from an
+ * arch-dependent long to a 32-bit int.
+ */
+
typedef struct {
- long flags; /* marks which fields in this structure are defined */
+ int flags; /* marks which fields in this structure are defined */
Bool input; /* does this application rely on the window manager to
get keyboard input? */
int initial_state; /* see below */
@@ -59,11 +72,15 @@ typedef struct {
#define AllHints (InputHint|StateHint|IconPixmapHint|IconWindowHint|IconPositionHint|IconMaskHint|WindowGroupHint)
/*
- * new version containing base_width, base_height, and win_gravity fields;
+ * ICCCM 1.0 version containing base_width, base_height, and win_gravity fields;
* used with WM_NORMAL_HINTS.
+ *
+ * NOTE: this structure represents the internal format stored in the property
+ * after it is marshalled by libX11, converting the flags field from an
+ * arch-dependent long to a 32-bit int.
*/
typedef struct {
- long flags; /* marks which fields in this structure are defined */
+ int flags; /* marks which fields in this structure are defined */
int x, y; /* obsolete for new window mgrs, but clients */
int width, height; /* should set so old wm's don't mess up */
int min_width, min_height;
@@ -77,11 +94,6 @@ typedef struct {
int win_gravity; /* added by ICCCM version 1 */
} WinXSizeHints;
-/*
- * The next block of definitions are for window manager properties that
- * clients and applications use for communication.
- */
-
/* flags argument in size hints */
#define USPosition (1L << 0) /* user specified x, y */
#define USSize (1L << 1) /* user specified width, height */
diff --git a/xserver/hw/xwin/winmultiwindowicons.c b/xserver/hw/xwin/winmultiwindowicons.c
index c22e68874..cc4538709 100644
--- a/xserver/hw/xwin/winmultiwindowicons.c
+++ b/xserver/hw/xwin/winmultiwindowicons.c
@@ -449,8 +449,9 @@ winXIconToHICON(Display * pDisplay, Window id, int iconSize)
hints = XGetWMHints(pDisplay, id);
if (hints) {
- winDebug("winXIconToHICON: id 0x%x icon_pixmap hint %x\n", id,
- hints->icon_pixmap);
+ winDebug("winXIconToHICON: id 0x%x icon_pixmap hint 0x%x\n",
+ (unsigned int)id,
+ (unsigned int)hints->icon_pixmap);
if (hints->icon_pixmap) {
Window root;
@@ -465,8 +466,8 @@ winXIconToHICON(Display * pDisplay, Window id, int iconSize)
xImageIcon =
XGetImage(pDisplay, hints->icon_pixmap, 0, 0, width, height,
0xFFFFFFFF, ZPixmap);
- winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%p\n", id,
- xImageIcon);
+ winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%p\n",
+ (unsigned int)id, xImageIcon);
if (hints->icon_mask)
xImageMask =
diff --git a/xserver/hw/xwin/winmultiwindowwindow.c b/xserver/hw/xwin/winmultiwindowwindow.c
index c22d69074..8b857855f 100644
--- a/xserver/hw/xwin/winmultiwindowwindow.c
+++ b/xserver/hw/xwin/winmultiwindowwindow.c
@@ -219,8 +219,8 @@ winPositionWindowMultiWindow(WindowPtr pWin, int x, int y)
#if CYGMULTIWINDOW_DEBUG
lpRc = &rcNew;
- ErrorF("winPositionWindowMultiWindow - (%d ms)drawable (%d, %d)-(%d, %d)\n",
- GetTickCount(), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+ ErrorF("winPositionWindowMultiWindow - drawable (%d, %d)-(%d, %d)\n",
+ (int)lpRc->left, (int)lpRc->top, (int)lpRc->right, (int)lpRc->bottom);
#endif
/*
@@ -237,16 +237,16 @@ winPositionWindowMultiWindow(WindowPtr pWin, int x, int y)
GetClientRect(hWnd, &rcClient);
lpRc = &rcNew;
- ErrorF("winPositionWindowMultiWindow - (%d ms)rcNew (%d, %d)-(%d, %d)\n",
- GetTickCount(), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+ ErrorF("winPositionWindowMultiWindow - rcNew (%d, %d)-(%d, %d)\n",
+ (int)lpRc->left, (int)lpRc->top, (int)lpRc->right, (int)lpRc->bottom);
lpRc = &rcOld;
- ErrorF("winPositionWindowMultiWindow - (%d ms)rcOld (%d, %d)-(%d, %d)\n",
- GetTickCount(), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+ ErrorF("winPositionWindowMultiWindow - rcOld (%d, %d)-(%d, %d)\n",
+ (int)lpRc->left, (int)lpRc->top, (int)lpRc->right, (int)lpRc->bottom);
lpRc = &rcClient;
- ErrorF("(%d ms)rcClient (%d, %d)-(%d, %d)\n",
- GetTickCount(), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+ ErrorF("rcClient (%d, %d)-(%d, %d)\n",
+ (int)lpRc->left, (int)lpRc->top, (int)lpRc->right, (int)lpRc->bottom);
#endif
/* Check if the old rectangle and new rectangle are the same */
@@ -256,8 +256,8 @@ winPositionWindowMultiWindow(WindowPtr pWin, int x, int y)
#endif
#if CYGWINDOWING_DEBUG
- ErrorF("\tMoveWindow to (%ld, %ld) - %ldx%ld\n", rcNew.left, rcNew.top,
- rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
+ ErrorF("\tMoveWindow to (%d, %d) - %dx%d\n", (int)rcNew.left, (int)rcNew.top,
+ (int)(rcNew.right - rcNew.left), (int)(rcNew.bottom - rcNew.top));
#endif
/* Change the position and dimensions of the Windows window */
MoveWindow(hWnd,
@@ -379,8 +379,9 @@ winReparentWindowMultiWindow(WindowPtr pWin, WindowPtr pPriorParent)
winDebug
("winReparentMultiWindow - pWin:%p XID:0x%x, reparent from pWin:%p XID:0x%x to pWin:%p XID:0x%x\n",
- pWin, pWin->drawable.id, pPriorParent, pPriorParent->drawable.id,
- pWin->parent, pWin->parent->drawable.id);
+ pWin, (unsigned int)pWin->drawable.id,
+ pPriorParent, (unsigned int)pPriorParent->drawable.id,
+ pWin->parent, (unsigned int)pWin->parent->drawable.id);
WIN_UNWRAP(ReparentWindow);
if (pScreen->ReparentWindow)
@@ -493,7 +494,7 @@ winCreateWindowsWindow(WindowPtr pWin)
winInitMultiWindowClass();
winDebug("winCreateWindowsTopLevelWindow - pWin:%p XID:0x%x \n", pWin,
- pWin->drawable.id);
+ (unsigned int)pWin->drawable.id);
iX = pWin->drawable.x + GetSystemMetrics(SM_XVIRTUALSCREEN);
iY = pWin->drawable.y + GetSystemMetrics(SM_YVIRTUALSCREEN);
@@ -502,15 +503,19 @@ winCreateWindowsWindow(WindowPtr pWin)
iHeight = pWin->drawable.height;
/* If it's an InputOutput window, and so is going to end up being made visible,
- make sure the window actually ends up somewhere where it will be visible */
- if (pWin->drawable.class != InputOnly) {
- if ((iX < GetSystemMetrics(SM_XVIRTUALSCREEN)) ||
- (iX > GetSystemMetrics(SM_CXVIRTUALSCREEN)))
- iX = CW_USEDEFAULT;
+ make sure the window actually ends up somewhere where it will be visible
- if ((iY < GetSystemMetrics(SM_YVIRTUALSCREEN)) ||
- (iY > GetSystemMetrics(SM_CYVIRTUALSCREEN)))
- iY = CW_USEDEFAULT;
+ To handle arrangements of monitors which form a non-rectangular virtual
+ desktop, check if the window will end up with it's top-left corner on any
+ monitor
+ */
+ if (pWin->drawable.class != InputOnly) {
+ POINT pt = { iX, iY };
+ if (MonitorFromPoint(pt, MONITOR_DEFAULTTONULL) == NULL)
+ {
+ iX = CW_USEDEFAULT;
+ iY = CW_USEDEFAULT;
+ }
}
winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX,
@@ -518,9 +523,13 @@ winCreateWindowsWindow(WindowPtr pWin)
if (winMultiWindowGetTransientFor(pWin, &daddyId)) {
if (daddyId) {
- hFore = GetForegroundWindow();
- if (hFore && (daddyId != (Window) (INT_PTR) GetProp(hFore, WIN_WID_PROP)))
- hFore = NULL;
+ WindowPtr pParent;
+ int res = dixLookupWindow(&pParent, daddyId, serverClient, DixReadAccess);
+ if (res == Success)
+ {
+ winPrivWinPtr pParentPriv = winGetWindowPriv(pParent);
+ hFore = pParentPriv->hWnd;
+ }
}
}
else {
@@ -619,7 +628,7 @@ winDestroyWindowsWindow(WindowPtr pWin)
HICON hIconSm;
winDebug("winDestroyWindowsWindow - pWin:%p XID:0x%x \n", pWin,
- pWin->drawable.id);
+ (unsigned int)pWin->drawable.id);
/* Bail out if the Windows window handle is invalid */
if (pWinPriv->hWnd == NULL)
@@ -713,7 +722,7 @@ winGetWindowID(WindowPtr pWin)
FindClientResourcesByType(c, RT_WINDOW, winFindWindow, &wi);
#if CYGMULTIWINDOW_DEBUG
- ErrorF("winGetWindowID - Window ID: %d\n", wi.id);
+ ErrorF("winGetWindowID - Window ID: %u\n", (unsigned int)wi.id);
#endif
return wi.id;
@@ -947,13 +956,13 @@ winAdjustXWindow(WindowPtr pWin, HWND hwnd)
SetRect(&rcDraw, x, y, x + pDraw->width, y + pDraw->height);
#ifdef CYGMULTIWINDOW_DEBUG
winDebug("\tDrawable extend {%d, %d, %d, %d}, {%d, %d}\n",
- rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom,
- rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top);
+ (int)rcDraw.left, (int)rcDraw.top, (int)rcDraw.right, (int)rcDraw.bottom,
+ (int)(rcDraw.right - rcDraw.left), (int)(rcDraw.bottom - rcDraw.top));
#endif
dwExStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
#ifdef CYGMULTIWINDOW_DEBUG
- winDebug("\tWindowStyle: %08x %08x\n", dwStyle, dwExStyle);
+ winDebug("\tWindowStyle: %08x %08x\n", (unsigned int)dwStyle, (unsigned int)dwExStyle);
#endif
AdjustWindowRectEx(&rcDraw, dwStyle, FALSE, dwExStyle);
@@ -961,11 +970,11 @@ winAdjustXWindow(WindowPtr pWin, HWND hwnd)
GetWindowRect(hwnd, &rcWin);
#ifdef CYGMULTIWINDOW_DEBUG
winDebug("\tWindow extend {%d, %d, %d, %d}, {%d, %d}\n",
- rcWin.left, rcWin.top, rcWin.right, rcWin.bottom,
- rcWin.right - rcWin.left, rcWin.bottom - rcWin.top);
+ (int)rcWin.left, (int)rcWin.top, (int)rcWin.right, (int)rcWin.bottom,
+ (int)(rcWin.right - rcWin.left), (int)(rcWin.bottom - rcWin.top));
winDebug("\tDraw extend {%d, %d, %d, %d}, {%d, %d}\n",
- rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom,
- rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top);
+ (int)rcDraw.left, (int)rcDraw.top, (int)rcDraw.right, (int)rcDraw.bottom,
+ (int)(rcDraw.right - rcDraw.left), (int)(rcDraw.bottom - rcDraw.top));
#endif
if (EqualRect(&rcDraw, &rcWin)) {
@@ -993,8 +1002,9 @@ winAdjustXWindow(WindowPtr pWin, HWND hwnd)
vlist[2] = pDraw->width + dW;
vlist[3] = pDraw->height + dH;
#if CYGWINDOWING_DEBUG
- ErrorF("\tConfigureWindow to (%ld, %ld) - %ldx%ld\n", vlist[0], vlist[1],
- vlist[2], vlist[3]);
+ ErrorF("\tConfigureWindow to (%u, %u) - %ux%u\n",
+ (unsigned int)vlist[0], (unsigned int)vlist[1],
+ (unsigned int)vlist[2], (unsigned int)vlist[3]);
#endif
return ConfigureWindow(pWin, CWX | CWY | CWWidth | CWHeight,
vlist, wClient(pWin));
diff --git a/xserver/hw/xwin/winmultiwindowwm.c b/xserver/hw/xwin/winmultiwindowwm.c
index 6599dfba8..a693274d5 100644
--- a/xserver/hw/xwin/winmultiwindowwm.c
+++ b/xserver/hw/xwin/winmultiwindowwm.c
@@ -772,8 +772,8 @@ winMultiWindowWMProc(void *pArg)
}
#if CYGMULTIWINDOW_DEBUG
- ErrorF("winMultiWindowWMProc - %d ms MSG: %d ID: %d\n",
- GetTickCount(), (int) pNode->msg.msg, (int) pNode->msg.dwID);
+ ErrorF("winMultiWindowWMProc - MSG: %d ID: %d\n",
+ (int) pNode->msg.msg, (int) pNode->msg.dwID);
#endif
/* Branch on the message type */
@@ -1738,7 +1738,7 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
if (mwm_hint && nitems == PropMwmHintsElements &&
(mwm_hint->flags & MwmHintsDecorations)) {
if (!mwm_hint->decorations)
- hint |= HINT_NOFRAME;
+ hint |= (HINT_NOFRAME | HINT_NOSYSMENU | HINT_NOMINIMIZE | HINT_NOMAXIMIZE);
else if (!(mwm_hint->decorations & MwmDecorAll)) {
if (mwm_hint->decorations & MwmDecorBorder)
hint |= HINT_BORDER;
@@ -1772,7 +1772,7 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
(unsigned char **) &pAtom) == Success) {
if (pAtom && nitems == 1) {
if (*pAtom == dockWindow) {
- hint = (hint & ~HINT_NOFRAME) | HINT_SIZEBOX; /* Xming puts a sizebox on dock windows */
+ hint = (hint & ~HINT_NOFRAME) | HINT_SKIPTASKBAR | HINT_SIZEBOX;
*zstyle = HWND_TOPMOST;
}
}
@@ -1785,8 +1785,7 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
long supplied;
if (normal_hint &&
- (XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied) ==
- Success)) {
+ XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied)) {
if (normal_hint->flags & PMaxSize) {
/* Not maximizable if a maximum size is specified */
hint |= HINT_NOMAXIMIZE;
diff --git a/xserver/hw/xwin/winmultiwindowwndproc.c b/xserver/hw/xwin/winmultiwindowwndproc.c
index d296f0f0c..656f6c2da 100644
--- a/xserver/hw/xwin/winmultiwindowwndproc.c
+++ b/xserver/hw/xwin/winmultiwindowwndproc.c
@@ -770,20 +770,20 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
ErrorF("\nCYGWINDOWING Dump:\n"
"\tdrawable: (%hd, %hd) - %hdx%hd\n", pDraw->x,
pDraw->y, pDraw->width, pDraw->height);
- ErrorF("\twindPlace: (%ld, %ld) - %ldx%ld\n", pRect->left,
- pRect->top, pRect->right - pRect->left,
- pRect->bottom - pRect->top);
+ ErrorF("\twindPlace: (%d, %d) - %dx%d\n", (int)pRect->left,
+ (int)pRect->top, (int)(pRect->right - pRect->left),
+ (int)(pRect->bottom - pRect->top));
if (GetClientRect(hwnd, &rc)) {
pRect = &rc;
- ErrorF("\tClientRect: (%ld, %ld) - %ldx%ld\n", pRect->left,
- pRect->top, pRect->right - pRect->left,
- pRect->bottom - pRect->top);
+ ErrorF("\tClientRect: (%d, %d) - %dx%d\n", (int)pRect->left,
+ (int)pRect->top, (int)(pRect->right - pRect->left),
+ (int)(pRect->bottom - pRect->top));
}
if (GetWindowRect(hwnd, &rc)) {
pRect = &rc;
- ErrorF("\tWindowRect: (%ld, %ld) - %ldx%ld\n", pRect->left,
- pRect->top, pRect->right - pRect->left,
- pRect->bottom - pRect->top);
+ ErrorF("\tWindowRect: (%d, %d) - %dx%d\n", (int)pRect->left,
+ (int)pRect->top, (int)(pRect->right - pRect->left),
+ (int)(pRect->bottom - pRect->top));
}
ErrorF("\n");
}
@@ -1037,9 +1037,8 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
default:
strcpy(buf, "UNKNOWN_FLAG");
}
- ErrorF("winTopLevelWindowProc - WM_SIZE to %dx%d (%s) - %d ms\n",
- (int) LOWORD(lParam), (int) HIWORD(lParam), buf,
- (int) (GetTickCount()));
+ ErrorF("winTopLevelWindowProc - WM_SIZE to %dx%d (%s)\n",
+ (int) LOWORD(lParam), (int) HIWORD(lParam), buf);
}
#endif
if (!hasEnteredSizeMove) {
@@ -1065,7 +1064,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
winDebug("winTopLevelWindowProc - WM_STYLECHANGING from %08x %08x\n",
- dwStyle, dwExStyle);
+ (unsigned int)dwStyle, (unsigned int)dwExStyle);
if (wParam == GWL_EXSTYLE)
dwExStyle = newStyle;
@@ -1074,7 +1073,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
dwStyle = newStyle;
winDebug("winTopLevelWindowProc - WM_STYLECHANGING to %08x %08x\n",
- dwStyle, dwExStyle);
+ (unsigned int)dwStyle, (unsigned int)dwExStyle);
/* Get client rect in screen coordinates */
wi.cbSize = sizeof(WINDOWINFO);
@@ -1082,9 +1081,9 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
winDebug
("winTopLevelWindowProc - WM_STYLECHANGING client area {%d, %d, %d, %d}, {%d x %d}\n",
- wi.rcClient.left, wi.rcClient.top, wi.rcClient.right,
- wi.rcClient.bottom, wi.rcClient.right - wi.rcClient.left,
- wi.rcClient.bottom - wi.rcClient.top);
+ (int)wi.rcClient.left, (int)wi.rcClient.top, (int)wi.rcClient.right,
+ (int)wi.rcClient.bottom, (int)(wi.rcClient.right - wi.rcClient.left),
+ (int)(wi.rcClient.bottom - wi.rcClient.top));
newWinRect = wi.rcClient;
if (!AdjustWindowRectEx(&newWinRect, dwStyle, FALSE, dwExStyle))
@@ -1093,9 +1092,9 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
winDebug
("winTopLevelWindowProc - WM_STYLECHANGING window area should be {%d, %d, %d, %d}, {%d x %d}\n",
- newWinRect.left, newWinRect.top, newWinRect.right,
- newWinRect.bottom, newWinRect.right - newWinRect.left,
- newWinRect.bottom - newWinRect.top);
+ (int)newWinRect.left, (int)newWinRect.top, (int)newWinRect.right,
+ (int)newWinRect.bottom, (int)(newWinRect.right - newWinRect.left),
+ (int)(newWinRect.bottom - newWinRect.top));
/*
Style change hasn't happened yet, so we can't adjust the window size yet, as the winAdjustXWindow()
diff --git a/xserver/hw/xwin/winos.c b/xserver/hw/xwin/winos.c
new file mode 100644
index 000000000..0d825bb83
--- /dev/null
+++ b/xserver/hw/xwin/winos.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2010-2014 Colin Harrison All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ *
+ * Author: Colin Harrison
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS)(HANDLE, PBOOL);
+
+static const char*
+IsWow64(void)
+{
+#ifdef __x86_64__
+ return " (64-bit)";
+#else
+ WINBOOL bIsWow64;
+ LPFN_ISWOW64PROCESS fnIsWow64Process =
+ (LPFN_ISWOW64PROCESS) GetProcAddress(GetModuleHandle(TEXT("kernel32")),
+ "IsWow64Process");
+ if (NULL != fnIsWow64Process) {
+ if (fnIsWow64Process(GetCurrentProcess(), &bIsWow64))
+ return bIsWow64 ? " (WoW64)" : " (32-bit)";
+ }
+
+ /* OS doesn't support IsWow64Process() */
+ return "";
+#endif
+}
+
+/*
+ * Report the OS version
+ */
+
+void
+winOS(void)
+{
+ OSVERSIONINFOEX osvi = {0};
+
+ /* Get operating system version information */
+ osvi.dwOSVersionInfoSize = sizeof(osvi);
+ GetVersionEx((LPOSVERSIONINFO)&osvi);
+
+ ErrorF("OS: Windows NT %d.%d build %d%s\n",
+ (int)osvi.dwMajorVersion, (int)osvi.dwMinorVersion,
+ (int)osvi.dwBuildNumber, IsWow64());
+}
diff --git a/xserver/hw/xwin/winprocarg.c b/xserver/hw/xwin/winprocarg.c
index 837cdb2f4..73aa027d8 100644
--- a/xserver/hw/xwin/winprocarg.c
+++ b/xserver/hw/xwin/winprocarg.c
@@ -1098,6 +1098,11 @@ ddxProcessArgument(int argc, char *argv[], int i)
return 1;
}
+ if (IS_OPTION("-nohostintitle")) {
+ g_fHostInTitle = FALSE;
+ return 1;
+ }
+
return 0;
}
@@ -1195,6 +1200,7 @@ winLogVersionInfo(void)
}
}
#endif
+ winOS();
if (strlen(BUILDERSTRING))
ErrorF("%s\n", BUILDERSTRING);
ErrorF("Contact: %s\n", BUILDERADDR);
diff --git a/xserver/hw/xwin/winrandr.c b/xserver/hw/xwin/winrandr.c
index 1b340850c..1560199c1 100644
--- a/xserver/hw/xwin/winrandr.c
+++ b/xserver/hw/xwin/winrandr.c
@@ -34,11 +34,6 @@
#include <xwin-config.h>
#endif
#include "win.h"
-#include "mivalidate.h" // for union _Validate used by windowstr.h
-
-#ifndef RANDR_12_INTERFACE
-#error X server must have RandR 1.2 interface
-#endif
/*
* Answer queries about the RandR features supported.
@@ -47,17 +42,47 @@
static Bool
winRandRGetInfo(ScreenPtr pScreen, Rotation * pRotations)
{
+ rrScrPrivPtr pRRScrPriv;
+ RROutputPtr output;
+
+ pRRScrPriv = rrGetScrPriv(pScreen);
+ output = pRRScrPriv->outputs[0];
+
winDebug("winRandRGetInfo ()\n");
/* Don't support rotations */
*pRotations = RR_Rotate_0;
- /*
- The screen doesn't have to be limited to the actual
- monitor size (we can have scrollbars :-), so what is
- the upper limit?
- */
- RRScreenSetSizeRange(pScreen, 0, 0, 4096, 4096);
+ /* Delete previous mode */
+ if (output->modes[0])
+ {
+ RRModeDestroy(output->modes[0]);
+ RRModeDestroy(output->crtc->mode);
+ }
+
+ /* Register current mode */
+ {
+ xRRModeInfo modeInfo;
+ RRModePtr mode;
+ char name[100];
+
+ memset(&modeInfo, '\0', sizeof(modeInfo));
+ snprintf(name, sizeof(name), "%dx%d", pScreen->width, pScreen->height);
+
+ modeInfo.width = pScreen->width;
+ modeInfo.height = pScreen->height;
+ modeInfo.hTotal = pScreen->width;
+ modeInfo.vTotal = pScreen->height;
+ modeInfo.dotClock = 0;
+ modeInfo.nameLength = strlen(name);
+ mode = RRModeGet(&modeInfo, name);
+
+ output->modes[0] = mode;
+ output->numModes = 1;
+
+ mode = RRModeGet(&modeInfo, name);
+ output->crtc->mode = mode;
+ }
return TRUE;
}
@@ -74,8 +99,13 @@ winDoRandRScreenSetSize(ScreenPtr pScreen,
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
WindowPtr pRoot = pScreen->root;
+ /* Ignore changes which do nothing */
+ if ((pScreen->width == width) && (pScreen->height == height) &&
+ (pScreen->mmWidth == mmWidth) && (pScreen->mmHeight == mmHeight))
+ return;
+
// Prevent screen updates while we change things around
- SetRootClip(pScreen, FALSE);
+ SetRootClip(pScreen, ROOT_CLIP_NONE);
/* Update the screen size as requested */
pScreenInfo->dwWidth = width;
@@ -101,10 +131,10 @@ winDoRandRScreenSetSize(ScreenPtr pScreen,
// does this emit a ConfigureNotify??
// Restore the ability to update screen, now with new dimensions
- SetRootClip(pScreen, TRUE);
+ SetRootClip(pScreen, ROOT_CLIP_FULL);
// and arrange for it to be repainted
- miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
+ pScreen->PaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
/* Indicate that a screen size change took place */
RRScreenSizeNotify(pScreen);
@@ -178,8 +208,9 @@ winRandRScreenSetSize(ScreenPtr pScreen,
*/
AdjustWindowRectEx(&rcClient, dwStyle, FALSE, dwExStyle);
- ErrorF("winRandRScreenSetSize new window area w: %ld h: %ld\n",
- rcClient.right - rcClient.left, rcClient.bottom - rcClient.top);
+ ErrorF("winRandRScreenSetSize new window area w: %d h: %d\n",
+ (int)(rcClient.right - rcClient.left),
+ (int)(rcClient.bottom - rcClient.top));
SetWindowPos(pScreenPriv->hwndScreen, NULL,
0, 0, rcClient.right - rcClient.left,
@@ -213,5 +244,45 @@ winRandRInit(ScreenPtr pScreen)
pRRScrPriv->rrCrtcSet = NULL;
pRRScrPriv->rrCrtcSetGamma = NULL;
+ /* Create a CRTC and an output for the screen, and hook them together */
+ {
+ RRCrtcPtr crtc;
+ RROutputPtr output;
+
+ crtc = RRCrtcCreate(pScreen, NULL);
+ if (!crtc)
+ return FALSE;
+
+ crtc->rotations = RR_Rotate_0;
+
+ output = RROutputCreate(pScreen, "default", 7, NULL);
+ if (!output)
+ return FALSE;
+
+ RROutputSetCrtcs(output, &crtc, 1);
+ RROutputSetConnection(output, RR_Connected);
+ RROutputSetSubpixelOrder(output, PictureGetSubpixelOrder(pScreen));
+
+ output->crtc = crtc;
+
+ /* Set crtc outputs (should use RRCrtcNotify?) */
+ crtc->outputs = malloc(sizeof(RROutputPtr));
+ crtc->outputs[0] = output;
+ crtc->numOutputs = 1;
+
+ pRRScrPriv->primaryOutput = output;
+
+ /* Ensure we have space for exactly one mode */
+ output->modes = malloc(sizeof(RRModePtr));
+ output->modes[0] = NULL;
+ }
+
+ /*
+ The screen doesn't have to be limited to the actual
+ monitor size (we can have scrollbars :-), so set the
+ upper limit to the maximum coordinates X11 can use.
+ */
+ RRScreenSetSizeRange(pScreen, 0, 0, 32768, 32768);
+
return TRUE;
}
diff --git a/xserver/hw/xwin/winscrinit.c b/xserver/hw/xwin/winscrinit.c
index ce0aada31..735ce9325 100644
--- a/xserver/hw/xwin/winscrinit.c
+++ b/xserver/hw/xwin/winscrinit.c
@@ -89,8 +89,8 @@ winScreenInit(ScreenPtr pScreen, int argc, char **argv)
DWORD dwInitialBPP;
#if CYGDEBUG || YES
- winDebug("winScreenInit - dwWidth: %ld dwHeight: %ld\n",
- pScreenInfo->dwWidth, pScreenInfo->dwHeight);
+ winDebug("winScreenInit - dwWidth: %u dwHeight: %u\n",
+ (unsigned int)pScreenInfo->dwWidth, (unsigned int)pScreenInfo->dwHeight);
#endif
/* Allocate privates for this screen */
@@ -216,15 +216,19 @@ winScreenInit(ScreenPtr pScreen, int argc, char **argv)
else
winErrorFVerb(2, "winScreenInit - Using software cursor\n");
- /*
- Note the screen origin in a normalized coordinate space where (0,0) is at the top left
- of the native virtual desktop area
- */
- pScreen->x = pScreenInfo->dwInitialX - GetSystemMetrics(SM_XVIRTUALSCREEN);
- pScreen->y = pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN);
+ if (!noPanoramiXExtension) {
+ /*
+ Note the screen origin in a normalized coordinate space where (0,0) is at the top left
+ of the native virtual desktop area
+ */
+ pScreen->x =
+ pScreenInfo->dwInitialX - GetSystemMetrics(SM_XVIRTUALSCREEN);
+ pScreen->y =
+ pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN);
- ErrorF("Screen %d added at virtual desktop coordinate (%d,%d).\n",
- pScreen->myNum, pScreen->x, pScreen->y);
+ ErrorF("Screen %d added at virtual desktop coordinate (%d,%d).\n",
+ pScreen->myNum, pScreen->x, pScreen->y);
+ }
#if CYGDEBUG || YES
winDebug("winScreenInit - returning\n");
@@ -309,8 +313,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
if (pScreenInfo->dwDepth == 8
&& (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
|| (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL
- && pScreenInfo->fFullScreen)
- || (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
&& pScreenInfo->fFullScreen))) {
winSetColormapFunctions(pScreen);
@@ -384,7 +386,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
/* Initialize the shadow framebuffer layer */
if ((pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
- || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
|| pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)
#ifdef XWIN_MULTIWINDOWEXTWM
&& !pScreenInfo->fMWExtWM
diff --git a/xserver/hw/xwin/winshaddd.c b/xserver/hw/xwin/winshaddd.c
deleted file mode 100644
index 4904eb440..000000000
--- a/xserver/hw/xwin/winshaddd.c
+++ /dev/null
@@ -1,1221 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- */
-
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include "win.h"
-
-/*
- * Local prototypes
- */
-
-static Bool
- winAllocateFBShadowDD(ScreenPtr pScreen);
-
-static void
- winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf);
-
-static Bool
- winCloseScreenShadowDD(ScreenPtr pScreen);
-
-static Bool
- winInitVisualsShadowDD(ScreenPtr pScreen);
-
-static Bool
- winAdjustVideoModeShadowDD(ScreenPtr pScreen);
-
-static Bool
- winBltExposedRegionsShadowDD(ScreenPtr pScreen);
-
-static Bool
- winActivateAppShadowDD(ScreenPtr pScreen);
-
-static Bool
- winRedrawScreenShadowDD(ScreenPtr pScreen);
-
-static Bool
- winRealizeInstalledPaletteShadowDD(ScreenPtr pScreen);
-
-static Bool
- winInstallColormapShadowDD(ColormapPtr pColormap);
-
-static Bool
- winStoreColorsShadowDD(ColormapPtr pmap, int ndef, xColorItem * pdefs);
-
-static Bool
- winCreateColormapShadowDD(ColormapPtr pColormap);
-
-static Bool
- winDestroyColormapShadowDD(ColormapPtr pColormap);
-
-static Bool
- winCreatePrimarySurfaceShadowDD(ScreenPtr pScreen);
-
-static Bool
- winReleasePrimarySurfaceShadowDD(ScreenPtr pScreen);
-
-/*
- * Create the primary surface and attach the clipper.
- * Used for both the initial surface creation and during
- * WM_DISPLAYCHANGE messages.
- */
-
-static Bool
-winCreatePrimarySurfaceShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- HRESULT ddrval = DD_OK;
- DDSURFACEDESC ddsd;
-
- /* Describe the primary surface */
- ZeroMemory(&ddsd, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- ddsd.dwFlags = DDSD_CAPS;
- ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
-
- /* Create the primary surface */
- ddrval = IDirectDraw2_CreateSurface(pScreenPriv->pdd2,
- &ddsd, &pScreenPriv->pddsPrimary, NULL);
- if (FAILED(ddrval)) {
- ErrorF("winCreatePrimarySurfaceShadowDD - Could not create primary "
- "surface: %08x\n", (unsigned int) ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- winDebug("winCreatePrimarySurfaceShadowDD - Created primary surface\n");
-#endif
-
- /*
- * Attach a clipper to the primary surface that will clip our blits to our
- * display window.
- */
- ddrval = IDirectDrawSurface2_SetClipper(pScreenPriv->pddsPrimary,
- pScreenPriv->pddcPrimary);
- if (FAILED(ddrval)) {
- ErrorF("winCreatePrimarySurfaceShadowDD - Primary attach clipper "
- "failed: %08x\n", (unsigned int) ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- winDebug("winCreatePrimarySurfaceShadowDD - Attached clipper to "
- "primary surface\n");
-#endif
-
- /* Everything was correct */
- return TRUE;
-}
-
-/*
- * Detach the clipper and release the primary surface.
- * Called from WM_DISPLAYCHANGE.
- */
-
-static Bool
-winReleasePrimarySurfaceShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
-
- ErrorF("winReleasePrimarySurfaceShadowDD - Hello\n");
-
- /* Release the primary surface and clipper, if they exist */
- if (pScreenPriv->pddsPrimary) {
- /*
- * Detach the clipper from the primary surface.
- * NOTE: We do this explicity for clarity. The Clipper is not released.
- */
- IDirectDrawSurface2_SetClipper(pScreenPriv->pddsPrimary, NULL);
-
- ErrorF("winReleasePrimarySurfaceShadowDD - Detached clipper\n");
-
- /* Release the primary surface */
- IDirectDrawSurface2_Release(pScreenPriv->pddsPrimary);
- pScreenPriv->pddsPrimary = NULL;
- }
-
- ErrorF("winReleasePrimarySurfaceShadowDD - Released primary surface\n");
-
- return TRUE;
-}
-
-/*
- * Create a DirectDraw surface for the shadow framebuffer; also create
- * a primary surface object so we can blit to the display.
- *
- * Install a DirectDraw clipper on our primary surface object
- * that clips our blits to the unobscured client area of our display window.
- */
-
-static Bool
-winAllocateFBShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HRESULT ddrval = DD_OK;
- DDSURFACEDESC ddsd;
- DDSURFACEDESC *pddsdShadow = NULL;
-
-#if CYGDEBUG
- winDebug("winAllocateFBShadowDD\n");
-#endif
-
- /* Create a clipper */
- ddrval = (*g_fpDirectDrawCreateClipper) (0,
- &pScreenPriv->pddcPrimary, NULL);
- if (FAILED(ddrval)) {
- ErrorF("winAllocateFBShadowDD - Could not create clipper: %08x\n",
- (unsigned int) ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- winDebug("winAllocateFBShadowDD - Created a clipper\n");
-#endif
-
- /* Attach the clipper to our display window */
- ddrval = IDirectDrawClipper_SetHWnd(pScreenPriv->pddcPrimary,
- 0, pScreenPriv->hwndScreen);
- if (FAILED(ddrval)) {
- ErrorF("winAllocateFBShadowDD - Clipper not attached to "
- "window: %08x\n", (unsigned int) ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- winDebug("winAllocateFBShadowDD - Attached clipper to window\n");
-#endif
-
- /* Create a DirectDraw object, store the address at lpdd */
- ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL);
- if (FAILED(ddrval)) {
- ErrorF("winAllocateFBShadowDD - Could not start DirectDraw: %08x\n",
- (unsigned int) ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- winDebug("winAllocateFBShadowDD () - Created and initialized DD\n");
-#endif
-
- /* Get a DirectDraw2 interface pointer */
- ddrval = IDirectDraw_QueryInterface(pScreenPriv->pdd,
- &IID_IDirectDraw2,
- (LPVOID *) &pScreenPriv->pdd2);
- if (FAILED(ddrval)) {
- ErrorF("winAllocateFBShadowDD - Failed DD2 query: %08x\n",
- (unsigned int) ddrval);
- return FALSE;
- }
-
- /* Are we full screen? */
- if (pScreenInfo->fFullScreen) {
- DDSURFACEDESC ddsdCurrent;
- DWORD dwRefreshRateCurrent = 0;
- HDC hdc = NULL;
-
- /* Set the cooperative level to full screen */
- ddrval = IDirectDraw2_SetCooperativeLevel(pScreenPriv->pdd2,
- pScreenPriv->hwndScreen,
- DDSCL_EXCLUSIVE
- | DDSCL_FULLSCREEN);
- if (FAILED(ddrval)) {
- ErrorF("winAllocateFBShadowDD - Could not set "
- "cooperative level: %08x\n", (unsigned int) ddrval);
- return FALSE;
- }
-
- /*
- * We only need to get the current refresh rate for comparison
- * if a refresh rate has been passed on the command line.
- */
- if (pScreenInfo->dwRefreshRate != 0) {
- ZeroMemory(&ddsdCurrent, sizeof(ddsdCurrent));
- ddsdCurrent.dwSize = sizeof(ddsdCurrent);
-
- /* Get information about current display settings */
- ddrval = IDirectDraw2_GetDisplayMode(pScreenPriv->pdd2,
- &ddsdCurrent);
- if (FAILED(ddrval)) {
- ErrorF("winAllocateFBShadowDD - Could not get current "
- "refresh rate: %08x. Continuing.\n",
- (unsigned int) ddrval);
- dwRefreshRateCurrent = 0;
- }
- else {
- /* Grab the current refresh rate */
- dwRefreshRateCurrent = ddsdCurrent.u2.dwRefreshRate;
- }
- }
-
- /* Clean up the refresh rate */
- if (dwRefreshRateCurrent == pScreenInfo->dwRefreshRate) {
- /*
- * Refresh rate is non-specified or equal to current.
- */
- pScreenInfo->dwRefreshRate = 0;
- }
-
- /* Grab a device context for the screen */
- hdc = GetDC(NULL);
- if (hdc == NULL) {
- ErrorF("winAllocateFBShadowDD - GetDC () failed\n");
- return FALSE;
- }
-
- /* Only change the video mode when different than current mode */
- if (!pScreenInfo->fMultipleMonitors
- && (pScreenInfo->dwWidth != GetSystemMetrics(SM_CXSCREEN)
- || pScreenInfo->dwHeight != GetSystemMetrics(SM_CYSCREEN)
- || pScreenInfo->dwBPP != GetDeviceCaps(hdc, BITSPIXEL)
- || pScreenInfo->dwRefreshRate != 0)) {
- ErrorF("winAllocateFBShadowDD - Changing video mode\n");
-
- /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */
- ddrval = IDirectDraw2_SetDisplayMode(pScreenPriv->pdd2,
- pScreenInfo->dwWidth,
- pScreenInfo->dwHeight,
- pScreenInfo->dwBPP,
- pScreenInfo->dwRefreshRate, 0);
- if (FAILED(ddrval)) {
- ErrorF("winAllocateFBShadowDD - Could not set "
- "full screen display mode: %08x\n",
- (unsigned int) ddrval);
- ErrorF
- ("winAllocateFBShadowDD - Using default driver refresh rate\n");
- ddrval =
- IDirectDraw2_SetDisplayMode(pScreenPriv->pdd2,
- pScreenInfo->dwWidth,
- pScreenInfo->dwHeight,
- pScreenInfo->dwBPP, 0, 0);
- if (FAILED(ddrval)) {
- ErrorF
- ("winAllocateFBShadowDD - Could not set default refresh rate "
- "full screen display mode: %08x\n",
- (unsigned int) ddrval);
- return FALSE;
- }
- }
- }
- else {
- ErrorF("winAllocateFBShadowDD - Not changing video mode\n");
- }
-
- /* Release our DC */
- ReleaseDC(NULL, hdc);
- hdc = NULL;
- }
- else {
- /* Set the cooperative level for windowed mode */
- ddrval = IDirectDraw2_SetCooperativeLevel(pScreenPriv->pdd2,
- pScreenPriv->hwndScreen,
- DDSCL_NORMAL);
- if (FAILED(ddrval)) {
- ErrorF("winAllocateFBShadowDD - Could not set "
- "cooperative level: %08x\n", (unsigned int) ddrval);
- return FALSE;
- }
- }
-
- /* Create the primary surface */
- if (!winCreatePrimarySurfaceShadowDD(pScreen)) {
- ErrorF("winAllocateFBShadowDD - winCreatePrimarySurfaceShadowDD "
- "failed\n");
- return FALSE;
- }
-
- /* Describe the shadow surface to be created */
- /* NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
- * as drawing, locking, and unlocking take forever
- * with video memory surfaces. In addition,
- * video memory is a somewhat scarce resource,
- * so you shouldn't be allocating video memory when
- * you have the option of using system memory instead.
- */
- ZeroMemory(&ddsd, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
- ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
- ddsd.dwHeight = pScreenInfo->dwHeight;
- ddsd.dwWidth = pScreenInfo->dwWidth;
-
- /* Create the shadow surface */
- ddrval = IDirectDraw2_CreateSurface(pScreenPriv->pdd2,
- &ddsd, &pScreenPriv->pddsShadow, NULL);
- if (FAILED(ddrval)) {
- ErrorF("winAllocateFBShadowDD - Could not create shadow "
- "surface: %08x\n", (unsigned int) ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- winDebug("winAllocateFBShadowDD - Created shadow\n");
-#endif
-
- /* Allocate a DD surface description for our screen privates */
- pddsdShadow = pScreenPriv->pddsdShadow = malloc(sizeof(DDSURFACEDESC));
- if (pddsdShadow == NULL) {
- ErrorF("winAllocateFBShadowDD - Could not allocate surface "
- "description memory\n");
- return FALSE;
- }
- ZeroMemory(pddsdShadow, sizeof(*pddsdShadow));
- pddsdShadow->dwSize = sizeof(*pddsdShadow);
-
-#if CYGDEBUG
- winDebug("winAllocateFBShadowDD - Locking shadow\n");
-#endif
-
- /* Lock the shadow surface */
- ddrval = IDirectDrawSurface2_Lock(pScreenPriv->pddsShadow,
- NULL, pddsdShadow, DDLOCK_WAIT, NULL);
- if (FAILED(ddrval) || pddsdShadow->lpSurface == NULL) {
- ErrorF("winAllocateFBShadowDD - Could not lock shadow "
- "surface: %08x\n", (unsigned int) ddrval);
- return FALSE;
- }
-
-#if CYGDEBUG
- winDebug("winAllocateFBShadowDD - Locked shadow\n");
-#endif
-
- /* We don't know how to deal with anything other than RGB */
- if (!(pddsdShadow->ddpfPixelFormat.dwFlags & DDPF_RGB)) {
- ErrorF("winAllocateFBShadowDD - Color format other than RGB\n");
- return FALSE;
- }
-
- /* Grab the pitch from the surface desc */
- pScreenInfo->dwStride = (pddsdShadow->u1.lPitch * 8)
- / pScreenInfo->dwBPP;
-
- /* Save the pointer to our surface memory */
- pScreenInfo->pfb = pddsdShadow->lpSurface;
-
- /* Grab the color depth and masks from the surface description */
- pScreenPriv->dwRedMask = pddsdShadow->ddpfPixelFormat.u2.dwRBitMask;
- pScreenPriv->dwGreenMask = pddsdShadow->ddpfPixelFormat.u3.dwGBitMask;
- pScreenPriv->dwBlueMask = pddsdShadow->ddpfPixelFormat.u4.dwBBitMask;
-
-#if CYGDEBUG
- winDebug("winAllocateFBShadowDD - Returning\n");
-#endif
-
- return TRUE;
-}
-
-static void
-winFreeFBShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Free the shadow surface, if there is one */
- if (pScreenPriv->pddsShadow) {
- IDirectDrawSurface2_Unlock(pScreenPriv->pddsShadow, NULL);
- IDirectDrawSurface2_Release(pScreenPriv->pddsShadow);
- pScreenPriv->pddsShadow = NULL;
- }
-
- /* Detach the clipper from the primary surface and release the primary surface, if there is one */
- winReleasePrimarySurfaceShadowDD(pScreen);
-
- /* Release the clipper object */
- if (pScreenPriv->pddcPrimary) {
- IDirectDrawClipper_Release(pScreenPriv->pddcPrimary);
- pScreenPriv->pddcPrimary = NULL;
- }
-
- /* Free the DirectDraw2 object, if there is one */
- if (pScreenPriv->pdd2) {
- IDirectDraw2_RestoreDisplayMode(pScreenPriv->pdd2);
- IDirectDraw2_Release(pScreenPriv->pdd2);
- pScreenPriv->pdd2 = NULL;
- }
-
- /* Free the DirectDraw object, if there is one */
- if (pScreenPriv->pdd) {
- IDirectDraw_Release(pScreenPriv->pdd);
- pScreenPriv->pdd = NULL;
- }
-
- /* Invalidate the ScreenInfo's fb pointer */
- pScreenInfo->pfb = NULL;
-}
-
-/*
- * Transfer the damaged regions of the shadow framebuffer to the display.
- */
-
-static void
-winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RegionPtr damage = shadowDamage(pBuf);
- HRESULT ddrval = DD_OK;
- RECT rcDest, rcSrc;
- POINT ptOrigin;
- DWORD dwBox = RegionNumRects(damage);
- BoxPtr pBox = RegionRects(damage);
- HRGN hrgnCombined = NULL;
-
- /*
- * Return immediately if the app is not active
- * and we are fullscreen, or if we have a bad display depth
- */
- if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen)
- || pScreenPriv->fBadDepth)
- return;
-
- /* Return immediately if we didn't get needed surfaces */
- if (!pScreenPriv->pddsPrimary || !pScreenPriv->pddsShadow)
- return;
-
- /* Get the origin of the window in the screen coords */
- ptOrigin.x = pScreenInfo->dwXOffset;
- ptOrigin.y = pScreenInfo->dwYOffset;
- MapWindowPoints(pScreenPriv->hwndScreen,
- HWND_DESKTOP, (LPPOINT) &ptOrigin, 1);
-
- /* Unlock the shadow surface, so we can blit */
- ddrval = IDirectDrawSurface2_Unlock(pScreenPriv->pddsShadow, NULL);
- if (FAILED(ddrval)) {
- ErrorF("winShadowUpdateDD - Unlock failed\n");
- return;
- }
-
- /*
- * Handle small regions with multiple blits,
- * handle large regions by creating a clipping region and
- * doing a single blit constrained to that clipping region.
- */
- if (pScreenInfo->dwClipUpdatesNBoxes == 0
- || dwBox < pScreenInfo->dwClipUpdatesNBoxes) {
- /* Loop through all boxes in the damaged region */
- while (dwBox--) {
- /* Assign damage box to source rectangle */
- rcSrc.left = pBox->x1;
- rcSrc.top = pBox->y1;
- rcSrc.right = pBox->x2;
- rcSrc.bottom = pBox->y2;
-
- /* Calculate destination rectange */
- rcDest.left = ptOrigin.x + rcSrc.left;
- rcDest.top = ptOrigin.y + rcSrc.top;
- rcDest.right = ptOrigin.x + rcSrc.right;
- rcDest.bottom = ptOrigin.y + rcSrc.bottom;
-
- /* Blit the damaged areas */
- ddrval = IDirectDrawSurface2_Blt(pScreenPriv->pddsPrimary,
- &rcDest,
- pScreenPriv->pddsShadow,
- &rcSrc, DDBLT_WAIT, NULL);
-
- /* Get a pointer to the next box */
- ++pBox;
- }
- }
- else {
- BoxPtr pBoxExtents = RegionExtents(damage);
-
- /* Compute a GDI region from the damaged region */
- hrgnCombined =
- CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2,
- pBoxExtents->y2);
-
- /* Install the GDI region as a clipping region */
- SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined);
- DeleteObject(hrgnCombined);
- hrgnCombined = NULL;
-
- /* Calculating a bounding box for the source is easy */
- rcSrc.left = pBoxExtents->x1;
- rcSrc.top = pBoxExtents->y1;
- rcSrc.right = pBoxExtents->x2;
- rcSrc.bottom = pBoxExtents->y2;
-
- /* Calculating a bounding box for the destination is trickier */
- rcDest.left = ptOrigin.x + rcSrc.left;
- rcDest.top = ptOrigin.y + rcSrc.top;
- rcDest.right = ptOrigin.x + rcSrc.right;
- rcDest.bottom = ptOrigin.y + rcSrc.bottom;
-
- /* Our Blt should be clipped to the invalidated region */
- ddrval = IDirectDrawSurface2_Blt(pScreenPriv->pddsPrimary,
- &rcDest,
- pScreenPriv->pddsShadow,
- &rcSrc, DDBLT_WAIT, NULL);
-
- /* Reset the clip region */
- SelectClipRgn(pScreenPriv->hdcScreen, NULL);
- }
-
- /* Relock the shadow surface */
- ddrval = IDirectDrawSurface2_Lock(pScreenPriv->pddsShadow,
- NULL,
- pScreenPriv->pddsdShadow,
- DDLOCK_WAIT, NULL);
- if (FAILED(ddrval)) {
- ErrorF("winShadowUpdateDD - Lock failed\n");
- return;
- }
-
- /* Has our memory pointer changed? */
- if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface) {
- ErrorF("winShadowUpdateDD - Memory location of the shadow "
- "surface has changed, trying to update the root window "
- "pixmap header to point to the new address. If you get "
- "this message and " PROJECT_NAME " freezes or crashes "
- "after this message then send a problem report and your "
- "%s file to " BUILDERADDR "\n", g_pszLogFile);
-
- /* Location of shadow framebuffer has changed */
- winUpdateFBPointer(pScreen, pScreenPriv->pddsdShadow->lpSurface);
- }
-}
-
-static Bool
-winInitScreenShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
-
- /* Get a device context for the screen */
- pScreenPriv->hdcScreen = GetDC(pScreenPriv->hwndScreen);
-
- return winAllocateFBShadowDD(pScreen);
-}
-
-/*
- * Call the wrapped CloseScreen function.
- *
- * Free our resources and private structures.
- */
-
-static Bool
-winCloseScreenShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- Bool fReturn;
-
-#if CYGDEBUG
- winDebug("winCloseScreenShadowDD - Freeing screen resources\n");
-#endif
-
- /* Flag that the screen is closed */
- pScreenPriv->fClosed = TRUE;
- pScreenPriv->fActive = FALSE;
-
- /* Call the wrapped CloseScreen procedure */
- WIN_UNWRAP(CloseScreen);
- if (pScreen->CloseScreen)
- fReturn = (*pScreen->CloseScreen) (pScreen);
-
- winFreeFBShadowDD(pScreen);
-
- /* Free the screen DC */
- ReleaseDC(pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
-
- /* Delete the window property */
- RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP);
-
- /* Delete tray icon, if we have one */
- if (!pScreenInfo->fNoTrayIcon)
- winDeleteNotifyIcon(pScreenPriv);
-
- /* Free the exit confirmation dialog box, if it exists */
- if (g_hDlgExit != NULL) {
- DestroyWindow(g_hDlgExit);
- g_hDlgExit = NULL;
- }
-
- /* Kill our window */
- if (pScreenPriv->hwndScreen) {
- DestroyWindow(pScreenPriv->hwndScreen);
- pScreenPriv->hwndScreen = NULL;
- }
-
-#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
- /* Destroy the thread startup mutex */
- pthread_mutex_destroy(&pScreenPriv->pmServerStarted);
-#endif
-
- /* Kill our screeninfo's pointer to the screen */
- pScreenInfo->pScreen = NULL;
-
- /* Free the screen privates for this screen */
- free((void *) pScreenPriv);
-
- return fReturn;
-}
-
-/*
- * Tell mi what sort of visuals we need.
- *
- * Generally we only need one visual, as our screen can only
- * handle one format at a time, I believe. You may want
- * to verify that last sentence.
- */
-
-static Bool
-winInitVisualsShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- DWORD dwRedBits, dwGreenBits, dwBlueBits;
-
- /* Count the number of ones in each color mask */
- dwRedBits = winCountBits(pScreenPriv->dwRedMask);
- dwGreenBits = winCountBits(pScreenPriv->dwGreenMask);
- dwBlueBits = winCountBits(pScreenPriv->dwBlueMask);
-
- /* Store the maximum number of ones in a color mask as the bitsPerRGB */
- if (dwRedBits == 0 || dwGreenBits == 0 || dwBlueBits == 0)
- pScreenPriv->dwBitsPerRGB = 8;
- else if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwRedBits;
- else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwGreenBits;
- else
- pScreenPriv->dwBitsPerRGB = dwBlueBits;
-
- ErrorF("winInitVisualsShadowDD - Masks %08x %08x %08x BPRGB %d d %d "
- "bpp %d\n",
- (unsigned int) pScreenPriv->dwRedMask,
- (unsigned int) pScreenPriv->dwGreenMask,
- (unsigned int) pScreenPriv->dwBlueMask,
- (int) pScreenPriv->dwBitsPerRGB,
- (int) pScreenInfo->dwDepth, (int) pScreenInfo->dwBPP);
-
- /* Create a single visual according to the Windows screen depth */
- switch (pScreenInfo->dwDepth) {
- case 24:
- case 16:
- case 15:
- /* Create the real visual */
- if (!miSetVisualTypesAndMasks(pScreenInfo->dwDepth,
- TrueColorMask,
- pScreenPriv->dwBitsPerRGB,
- TrueColor,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask)) {
- ErrorF("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
- "failed for TrueColor\n");
- return FALSE;
- }
-
-#ifdef XWIN_EMULATEPSEUDO
- if (!pScreenInfo->fEmulatePseudo)
- break;
-
- /* Setup a pseudocolor visual */
- if (!miSetVisualTypesAndMasks(8, PseudoColorMask, 8, -1, 0, 0, 0)) {
- ErrorF("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
- "failed for PseudoColor\n");
- return FALSE;
- }
-#endif
- break;
-
- case 8:
- if (!miSetVisualTypesAndMasks(pScreenInfo->dwDepth,
- pScreenInfo->fFullScreen
- ? PseudoColorMask : StaticColorMask,
- pScreenPriv->dwBitsPerRGB,
- pScreenInfo->fFullScreen
- ? PseudoColor : StaticColor,
- pScreenPriv->dwRedMask,
- pScreenPriv->dwGreenMask,
- pScreenPriv->dwBlueMask)) {
- ErrorF("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
- "failed\n");
- return FALSE;
- }
- break;
-
- default:
- ErrorF("winInitVisualsShadowDD - Unknown screen depth\n");
- return FALSE;
- }
-
-#if CYGDEBUG
- winDebug("winInitVisualsShadowDD - Returning\n");
-#endif
-
- return TRUE;
-}
-
-/*
- * Adjust the user proposed video mode
- */
-
-static Bool
-winAdjustVideoModeShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HDC hdc = NULL;
- DWORD dwBPP;
-
- /* We're in serious trouble if we can't get a DC */
- hdc = GetDC(NULL);
- if (hdc == NULL) {
- ErrorF("winAdjustVideoModeShadowDD - GetDC () failed\n");
- return FALSE;
- }
-
- /* Query GDI for current display depth */
- dwBPP = GetDeviceCaps(hdc, BITSPIXEL);
-
- /* DirectDraw can only change the depth in fullscreen mode */
- if (!(pScreenInfo->fFullScreen && (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) {
- /* Otherwise, We'll use GDI's depth */
- pScreenInfo->dwBPP = dwBPP;
- }
-
- /* Release our DC */
- ReleaseDC(NULL, hdc);
- return TRUE;
-}
-
-/*
- * Blt exposed regions to the screen
- */
-
-static Bool
-winBltExposedRegionsShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RECT rcSrc, rcDest;
- POINT ptOrigin;
- HDC hdcUpdate = NULL;
- PAINTSTRUCT ps;
- HRESULT ddrval = DD_OK;
- Bool fReturn = TRUE;
- Bool fLocked = TRUE;
- int i;
-
- /* BeginPaint gives us an hdc that clips to the invalidated region */
- hdcUpdate = BeginPaint(pScreenPriv->hwndScreen, &ps);
- if (hdcUpdate == NULL) {
- ErrorF("winBltExposedRegionsShadowDD - BeginPaint () returned "
- "a NULL device context handle. Aborting blit attempt.\n");
- return FALSE;
- }
-
- /* Unlock the shadow surface, so we can blit */
- ddrval = IDirectDrawSurface2_Unlock(pScreenPriv->pddsShadow, NULL);
- if (FAILED(ddrval)) {
- fReturn = FALSE;
- goto winBltExposedRegionsShadowDD_Exit;
- }
- else {
- /* Flag that we have unlocked the shadow surface */
- fLocked = FALSE;
- }
-
- /* Get the origin of the window in the screen coords */
- ptOrigin.x = pScreenInfo->dwXOffset;
- ptOrigin.y = pScreenInfo->dwYOffset;
-
- MapWindowPoints(pScreenPriv->hwndScreen,
- HWND_DESKTOP, (LPPOINT) &ptOrigin, 1);
- rcDest.left = ptOrigin.x;
- rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
- rcDest.top = ptOrigin.y;
- rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
-
- /* Source can be enter shadow surface, as Blt should clip */
- rcSrc.left = 0;
- rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
-
- /* Try to regain the primary surface and blit again if we've lost it */
- for (i = 0; i <= WIN_REGAIN_SURFACE_RETRIES; ++i) {
- /* Our Blt should be clipped to the invalidated region */
- ddrval = IDirectDrawSurface2_Blt(pScreenPriv->pddsPrimary,
- &rcDest,
- pScreenPriv->pddsShadow,
- &rcSrc, DDBLT_WAIT, NULL);
- if (ddrval == DDERR_SURFACELOST) {
- /* Surface was lost */
- ErrorF("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Blt "
- "reported that the primary surface was lost, "
- "trying to restore, retry: %d\n", i + 1);
-
- /* Try to restore the surface, once */
- ddrval = IDirectDrawSurface2_Restore(pScreenPriv->pddsPrimary);
- ErrorF("winBltExposedRegionsShadowDD - "
- "IDirectDrawSurface2_Restore returned: ");
- if (ddrval == DD_OK)
- ErrorF("DD_OK\n");
- else if (ddrval == DDERR_WRONGMODE)
- ErrorF("DDERR_WRONGMODE\n");
- else if (ddrval == DDERR_INCOMPATIBLEPRIMARY)
- ErrorF("DDERR_INCOMPATIBLEPRIMARY\n");
- else if (ddrval == DDERR_UNSUPPORTED)
- ErrorF("DDERR_UNSUPPORTED\n");
- else if (ddrval == DDERR_INVALIDPARAMS)
- ErrorF("DDERR_INVALIDPARAMS\n");
- else if (ddrval == DDERR_INVALIDOBJECT)
- ErrorF("DDERR_INVALIDOBJECT\n");
- else
- ErrorF("unknown error: %08x\n", (unsigned int) ddrval);
-
- /* Loop around to try the blit one more time */
- continue;
- }
- else if (FAILED(ddrval)) {
- fReturn = FALSE;
- ErrorF("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Blt "
- "failed, but surface not lost: %08x %d\n",
- (unsigned int) ddrval, (int) ddrval);
- goto winBltExposedRegionsShadowDD_Exit;
- }
- else {
- /* Success, stop looping */
- break;
- }
- }
-
- /* Relock the shadow surface */
- ddrval = IDirectDrawSurface2_Lock(pScreenPriv->pddsShadow,
- NULL,
- pScreenPriv->pddsdShadow,
- DDLOCK_WAIT, NULL);
- if (FAILED(ddrval)) {
- fReturn = FALSE;
- ErrorF("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Lock "
- "failed\n");
- goto winBltExposedRegionsShadowDD_Exit;
- }
- else {
- /* Indicate that we have relocked the shadow surface */
- fLocked = TRUE;
- }
-
- /* Has our memory pointer changed? */
- if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
- winUpdateFBPointer(pScreen, pScreenPriv->pddsdShadow->lpSurface);
-
- winBltExposedRegionsShadowDD_Exit:
- /* EndPaint frees the DC */
- if (hdcUpdate != NULL)
- EndPaint(pScreenPriv->hwndScreen, &ps);
-
- /*
- * Relock the surface if it is not locked. We don't care if locking fails,
- * as it will cause the server to shutdown within a few more operations.
- */
- if (!fLocked) {
- IDirectDrawSurface2_Lock(pScreenPriv->pddsShadow,
- NULL,
- pScreenPriv->pddsdShadow, DDLOCK_WAIT, NULL);
-
- /* Has our memory pointer changed? */
- if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
- winUpdateFBPointer(pScreen, pScreenPriv->pddsdShadow->lpSurface);
-
- fLocked = TRUE;
- }
- return fReturn;
-}
-
-/*
- * Do any engine-specific appliation-activation processing
- */
-
-static Bool
-winActivateAppShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
-
- /*
- * Do we have a surface?
- * Are we active?
- * Are we fullscreen?
- */
- if (pScreenPriv != NULL
- && pScreenPriv->pddsPrimary != NULL && pScreenPriv->fActive) {
- /* Primary surface was lost, restore it */
- IDirectDrawSurface2_Restore(pScreenPriv->pddsPrimary);
- }
-
- return TRUE;
-}
-
-/*
- * Reblit the shadow framebuffer to the screen.
- */
-
-static Bool
-winRedrawScreenShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HRESULT ddrval = DD_OK;
- RECT rcSrc, rcDest;
- POINT ptOrigin;
-
- /* Get the origin of the window in the screen coords */
- ptOrigin.x = pScreenInfo->dwXOffset;
- ptOrigin.y = pScreenInfo->dwYOffset;
- MapWindowPoints(pScreenPriv->hwndScreen,
- HWND_DESKTOP, (LPPOINT) &ptOrigin, 1);
- rcDest.left = ptOrigin.x;
- rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
- rcDest.top = ptOrigin.y;
- rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
-
- /* Source can be entire shadow surface, as Blt should clip for us */
- rcSrc.left = 0;
- rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
-
- /* Redraw the whole window, to take account for the new colors */
- ddrval = IDirectDrawSurface2_Blt(pScreenPriv->pddsPrimary,
- &rcDest,
- pScreenPriv->pddsShadow,
- &rcSrc, DDBLT_WAIT, NULL);
- if (FAILED(ddrval)) {
- ErrorF("winRedrawScreenShadowDD - IDirectDrawSurface_Blt () "
- "failed: %08x\n", (unsigned int) ddrval);
- }
-
- return TRUE;
-}
-
-/*
- * Realize the currently installed colormap
- */
-
-static Bool
-winRealizeInstalledPaletteShadowDD(ScreenPtr pScreen)
-{
- return TRUE;
-}
-
-/*
- * Install the specified colormap
- */
-
-static Bool
-winInstallColormapShadowDD(ColormapPtr pColormap)
-{
- ScreenPtr pScreen = pColormap->pScreen;
-
- winScreenPriv(pScreen);
- winCmapPriv(pColormap);
- HRESULT ddrval = DD_OK;
-
- /* Install the DirectDraw palette on the primary surface */
- ddrval = IDirectDrawSurface2_SetPalette(pScreenPriv->pddsPrimary,
- pCmapPriv->lpDDPalette);
- if (FAILED(ddrval)) {
- ErrorF("winInstallColormapShadowDD - Failed installing the "
- "DirectDraw palette.\n");
- return FALSE;
- }
-
- /* Save a pointer to the newly installed colormap */
- pScreenPriv->pcmapInstalled = pColormap;
-
- return TRUE;
-}
-
-/*
- * Store the specified colors in the specified colormap
- */
-
-static Bool
-winStoreColorsShadowDD(ColormapPtr pColormap, int ndef, xColorItem * pdefs)
-{
- ScreenPtr pScreen = pColormap->pScreen;
-
- winScreenPriv(pScreen);
- winCmapPriv(pColormap);
- ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
- HRESULT ddrval = DD_OK;
-
- /* Put the X colormap entries into the Windows logical palette */
- ddrval = IDirectDrawPalette_SetEntries(pCmapPriv->lpDDPalette,
- 0,
- pdefs[0].pixel,
- ndef,
- pCmapPriv->peColors
- + pdefs[0].pixel);
- if (FAILED(ddrval)) {
- ErrorF("winStoreColorsShadowDD - SetEntries () failed\n");
- return FALSE;
- }
-
- /* Don't install the DirectDraw palette if the colormap is not installed */
- if (pColormap != curpmap) {
- return TRUE;
- }
-
- if (!winInstallColormapShadowDD(pColormap)) {
- ErrorF("winStoreColorsShadowDD - Failed installing colormap\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-/*
- * Colormap initialization procedure
- */
-
-static Bool
-winCreateColormapShadowDD(ColormapPtr pColormap)
-{
- HRESULT ddrval = DD_OK;
- ScreenPtr pScreen = pColormap->pScreen;
-
- winScreenPriv(pScreen);
- winCmapPriv(pColormap);
-
- /* Create a DirectDraw palette */
- ddrval = IDirectDraw2_CreatePalette(pScreenPriv->pdd,
- DDPCAPS_8BIT | DDPCAPS_ALLOW256,
- pCmapPriv->peColors,
- &pCmapPriv->lpDDPalette, NULL);
- if (FAILED(ddrval)) {
- ErrorF("winCreateColormapShadowDD - CreatePalette failed\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-/*
- * Colormap destruction procedure
- */
-
-static Bool
-winDestroyColormapShadowDD(ColormapPtr pColormap)
-{
- winScreenPriv(pColormap->pScreen);
- winCmapPriv(pColormap);
- HRESULT ddrval = DD_OK;
-
- /*
- * Is colormap to be destroyed the default?
- *
- * Non-default colormaps should have had winUninstallColormap
- * called on them before we get here. The default colormap
- * will not have had winUninstallColormap called on it. Thus,
- * we need to handle the default colormap in a special way.
- */
- if (pColormap->flags & IsDefault) {
-#if CYGDEBUG
- winDebug("winDestroyColormapShadowDD - Destroying default "
- "colormap\n");
-#endif
-
- /*
- * FIXME: Walk the list of all screens, popping the default
- * palette out of each screen device context.
- */
-
- /* Pop the palette out of the primary surface */
- ddrval = IDirectDrawSurface2_SetPalette(pScreenPriv->pddsPrimary, NULL);
- if (FAILED(ddrval)) {
- ErrorF("winDestroyColormapShadowDD - Failed freeing the "
- "default colormap DirectDraw palette.\n");
- return FALSE;
- }
-
- /* Clear our private installed colormap pointer */
- pScreenPriv->pcmapInstalled = NULL;
- }
-
- /* Release the palette */
- IDirectDrawPalette_Release(pCmapPriv->lpDDPalette);
-
- /* Invalidate the colormap privates */
- pCmapPriv->lpDDPalette = NULL;
-
- return TRUE;
-}
-
-/*
- * Set engine specific functions
- */
-
-Bool
-winSetEngineFunctionsShadowDD(ScreenPtr pScreen)
-{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Set our pointers */
- pScreenPriv->pwinAllocateFB = winAllocateFBShadowDD;
- pScreenPriv->pwinFreeFB = winFreeFBShadowDD;
- pScreenPriv->pwinShadowUpdate = winShadowUpdateDD;
- pScreenPriv->pwinInitScreen = winInitScreenShadowDD;
- pScreenPriv->pwinCloseScreen = winCloseScreenShadowDD;
- pScreenPriv->pwinInitVisuals = winInitVisualsShadowDD;
- pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowDD;
- if (pScreenInfo->fFullScreen)
- pScreenPriv->pwinCreateBoundingWindow =
- winCreateBoundingWindowFullScreen;
- else
- pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
- pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
- pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDD;
- pScreenPriv->pwinActivateApp = winActivateAppShadowDD;
- pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowDD;
- pScreenPriv->pwinRealizeInstalledPalette
- = winRealizeInstalledPaletteShadowDD;
- pScreenPriv->pwinInstallColormap = winInstallColormapShadowDD;
- pScreenPriv->pwinStoreColors = winStoreColorsShadowDD;
- pScreenPriv->pwinCreateColormap = winCreateColormapShadowDD;
- pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDD;
- pScreenPriv->pwinHotKeyAltTab =
- (winHotKeyAltTabProcPtr) (void (*)(void)) NoopDDA;
- pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDD;
- pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDD;
-#ifdef XWIN_MULTIWINDOW
- pScreenPriv->pwinFinishCreateWindowsWindow =
- (winFinishCreateWindowsWindowProcPtr) (void (*)(void)) NoopDDA;
-#endif
-
- return TRUE;
-}
diff --git a/xserver/hw/xwin/winshadddnl.c b/xserver/hw/xwin/winshadddnl.c
index 48599b266..d4f940ec1 100644
--- a/xserver/hw/xwin/winshadddnl.c
+++ b/xserver/hw/xwin/winshadddnl.c
@@ -200,8 +200,10 @@ winAllocateFBShadowDDNL(ScreenPtr pScreen)
DDPIXELFORMAT ddpfPrimary;
#if CYGDEBUG
- winDebug("winAllocateFBShadowDDNL - w %d h %d d %d\n",
- pScreenInfo->dwWidth, pScreenInfo->dwHeight, pScreenInfo->dwDepth);
+ winDebug("winAllocateFBShadowDDNL - w %u h %u d %u\n",
+ (unsigned int)pScreenInfo->dwWidth,
+ (unsigned int)pScreenInfo->dwHeight,
+ (unsigned int)pScreenInfo->dwDepth);
#endif
/* Set the padded screen width */
@@ -400,10 +402,11 @@ winAllocateFBShadowDDNL(ScreenPtr pScreen)
#if CYGDEBUG
winDebug("winAllocateFBShadowDDNL - Primary masks: %08x %08x %08x "
- "dwRGBBitCount: %d\n",
- ddpfPrimary.u2.dwRBitMask,
- ddpfPrimary.u3.dwGBitMask,
- ddpfPrimary.u4.dwBBitMask, ddpfPrimary.u1.dwRGBBitCount);
+ "dwRGBBitCount: %u\n",
+ (unsigned int)ddpfPrimary.u2.dwRBitMask,
+ (unsigned int)ddpfPrimary.u3.dwGBitMask,
+ (unsigned int)ddpfPrimary.u4.dwBBitMask,
+ (unsigned int)ddpfPrimary.u1.dwRGBBitCount);
#endif
/* Describe the shadow surface to be created */
diff --git a/xserver/hw/xwin/winshadgdi.c b/xserver/hw/xwin/winshadgdi.c
index 3d222ad4b..bf655174d 100644
--- a/xserver/hw/xwin/winshadgdi.c
+++ b/xserver/hw/xwin/winshadgdi.c
@@ -121,7 +121,7 @@ winQueryScreenDIBFormat(ScreenPtr pScreen, BITMAPINFOHEADER * pbmih)
pdw = (DWORD *) ((CARD8 *) pbmih + sizeof(BITMAPINFOHEADER));
winDebug("winQueryScreenDIBFormat - First call masks: %08x %08x %08x\n",
- pdw[0], pdw[1], pdw[2]);
+ (unsigned int)pdw[0], (unsigned int)pdw[1], (unsigned int)pdw[2]);
#endif
/* Get optimal color table, or the optimal bitfields */
@@ -197,12 +197,12 @@ winQueryRGBBitsAndMasks(ScreenPtr pScreen)
#if CYGDEBUG
winDebug("%s - Masks: %08x %08x %08x\n", __FUNCTION__,
- pdw[0], pdw[1], pdw[2]);
+ (unsigned int)pdw[0], (unsigned int)pdw[1], (unsigned int)pdw[2]);
winDebug("%s - Bitmap: %dx%d %d bpp %d planes\n", __FUNCTION__,
- pbmih->biWidth, pbmih->biHeight, pbmih->biBitCount,
+ (int)pbmih->biWidth, (int)pbmih->biHeight, pbmih->biBitCount,
pbmih->biPlanes);
- winDebug("%s - Compression: %d %s\n", __FUNCTION__,
- pbmih->biCompression,
+ winDebug("%s - Compression: %u %s\n", __FUNCTION__,
+ (unsigned int)pbmih->biCompression,
(pbmih->biCompression ==
BI_RGB ? "(BI_RGB)" : (pbmih->biCompression ==
BI_RLE8 ? "(BI_RLE8)" : (pbmih->
diff --git a/xserver/hw/xwin/winwin32rootlesswndproc.c b/xserver/hw/xwin/winwin32rootlesswndproc.c
index f65811c9a..79d959161 100644
--- a/xserver/hw/xwin/winwin32rootlesswndproc.c
+++ b/xserver/hw/xwin/winwin32rootlesswndproc.c
@@ -858,8 +858,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_MOVE:
#if CYGMULTIWINDOW_DEBUG
- winDebug("winMWExtWMWindowProc - WM_MOVE - %d ms\n",
- (unsigned int) GetTickCount());
+ winDebug("winMWExtWMWindowProc - WM_MOVE\n");
#endif
if (g_fNoConfigureWindow)
break;
@@ -902,8 +901,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_SHOWWINDOW:
#if CYGMULTIWINDOW_DEBUG || TRUE
- winDebug("winMWExtWMWindowProc - WM_SHOWWINDOW - %d ms\n",
- (unsigned int) GetTickCount());
+ winDebug("winMWExtWMWindowProc - WM_SHOWWINDOW\n");
#endif
/* Bail out if the window is being hidden */
if (!wParam)
@@ -1155,8 +1153,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/* see dix/window.c */
/* FIXME: Maximize/Restore? */
#if CYGMULTIWINDOW_DEBUG
- winDebug("winMWExtWMWindowProc - WM_SIZE - %d ms\n",
- (unsigned int) GetTickCount());
+ winDebug("winMWExtWMWindowProc - WM_SIZE\n");
#endif
#if CYGMULTIWINDOW_DEBUG
winDebug("\t(%d, %d) %d\n", (short) LOWORD(lParam),
@@ -1224,8 +1221,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_ACTIVATEAPP:
#if CYGMULTIWINDOW_DEBUG
- winDebug("winMWExtWMWindowProc - WM_ACTIVATEAPP - %d ms\n",
- (unsigned int) GetTickCount());
+ winDebug("winMWExtWMWindowProc - WM_ACTIVATEAPP\n");
#endif
if (wParam) {
if (winIsInternalWMRunning(pScreenInfo)) {
@@ -1257,16 +1253,14 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_ENTERSIZEMOVE:
#if CYGMULTIWINDOW_DEBUG
- winDebug("winMWExtWMWindowProc - WM_ENTERSIZEMOVE - %d ms\n",
- (unsigned int) GetTickCount());
+ winDebug("winMWExtWMWindowProc - WM_ENTERSIZEMOVE\n");
#endif
pRLWinPriv->fMovingOrSizing = TRUE;
break;
case WM_EXITSIZEMOVE:
#if CYGMULTIWINDOW_DEBUG
- winDebug("winMWExtWMWindowProc - WM_EXITSIZEMOVE - %d ms\n",
- (unsigned int) GetTickCount());
+ winDebug("winMWExtWMWindowProc - WM_EXITSIZEMOVE\n");
#endif
pRLWinPriv->fMovingOrSizing = FALSE;
diff --git a/xserver/hw/xwin/winwndproc.c b/xserver/hw/xwin/winwndproc.c
index 1bf3f5cde..123b84f31 100644
--- a/xserver/hw/xwin/winwndproc.c
+++ b/xserver/hw/xwin/winwndproc.c
@@ -162,14 +162,13 @@ 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_DD
- || s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)) {
+ || (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)) {
break;
}
ErrorF("winWindowProc - WM_DISPLAYCHANGE - new width: %d "
"new height: %d new bpp: %d\n",
- LOWORD(lParam), HIWORD(lParam), wParam);
+ LOWORD(lParam), HIWORD(lParam), (int)wParam);
/* 0 bpp has no defined meaning, ignore this message */
if (wParam == 0)
@@ -186,8 +185,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
*/
if (s_pScreenInfo->dwBPP !=
GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL)) {
- if ((s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD ||
- s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)) {
+ if (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL) {
/* Cannot display the visual until the depth is restored */
ErrorF("winWindowProc - Disruptive change in depth\n");
diff --git a/xserver/include/Makefile.am b/xserver/include/Makefile.am
index 168b00f70..b9cf584cb 100644
--- a/xserver/include/Makefile.am
+++ b/xserver/include/Makefile.am
@@ -33,6 +33,7 @@ sdk_HEADERS = \
misc.h \
miscstruct.h \
opaque.h \
+ nonsdk_extinit.h \
optionstr.h \
os.h \
pixmap.h \
@@ -51,9 +52,8 @@ sdk_HEADERS = \
selection.h \
servermd.h \
site.h \
- swaprep.h \
- swapreq.h \
validate.h \
+ displaymode.h \
window.h \
windowstr.h \
xkbfile.h \
@@ -73,5 +73,8 @@ EXTRA_DIST = \
dixfontstubs.h eventconvert.h eventstr.h inpututils.h \
probes.h \
protocol-versions.h \
+ swaprep.h \
+ swapreq.h \
systemd-logind.h \
+ vidmodestr.h \
xsha1.h
diff --git a/xserver/include/Makefile.in b/xserver/include/Makefile.in
index 0ffaccca2..e4a022840 100644
--- a/xserver/include/Makefile.in
+++ b/xserver/include/Makefile.in
@@ -61,8 +61,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -124,12 +123,12 @@ am__sdk_HEADERS_DIST = XIstubs.h Xprintf.h callback.h client.h \
dixfontstr.h dixgrabs.h dixstruct.h events.h exevents.h \
extension.h extinit.h extnsionst.h gc.h gcstruct.h globals.h \
glx_extinit.h input.h inputstr.h list.h misc.h miscstruct.h \
- opaque.h optionstr.h os.h pixmap.h pixmapstr.h privates.h \
- property.h propertyst.h ptrveloc.h region.h regionstr.h \
- registry.h resource.h rgb.h screenint.h scrnintstr.h \
- selection.h servermd.h site.h swaprep.h swapreq.h validate.h \
- window.h windowstr.h xkbfile.h xkbsrv.h xkbstr.h xkbrules.h \
- xserver-properties.h
+ opaque.h nonsdk_extinit.h optionstr.h os.h pixmap.h \
+ pixmapstr.h privates.h property.h propertyst.h ptrveloc.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
HEADERS = $(nodist_sdk_HEADERS) $(sdk_HEADERS)
ETAGS = etags
CTAGS = ctags
@@ -225,7 +224,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -355,8 +353,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -514,6 +510,7 @@ top_srcdir = @top_srcdir@
@XORG_TRUE@ misc.h \
@XORG_TRUE@ miscstruct.h \
@XORG_TRUE@ opaque.h \
+@XORG_TRUE@ nonsdk_extinit.h \
@XORG_TRUE@ optionstr.h \
@XORG_TRUE@ os.h \
@XORG_TRUE@ pixmap.h \
@@ -532,9 +529,8 @@ top_srcdir = @top_srcdir@
@XORG_TRUE@ selection.h \
@XORG_TRUE@ servermd.h \
@XORG_TRUE@ site.h \
-@XORG_TRUE@ swaprep.h \
-@XORG_TRUE@ swapreq.h \
@XORG_TRUE@ validate.h \
+@XORG_TRUE@ displaymode.h \
@XORG_TRUE@ window.h \
@XORG_TRUE@ windowstr.h \
@XORG_TRUE@ xkbfile.h \
@@ -551,7 +547,10 @@ EXTRA_DIST = \
dixfontstubs.h eventconvert.h eventstr.h inpututils.h \
probes.h \
protocol-versions.h \
+ swaprep.h \
+ swapreq.h \
systemd-logind.h \
+ vidmodestr.h \
xsha1.h
all: do-not-use-config.h xorg-server.h dix-config.h xorg-config.h xkb-config.h xwin-config.h kdrive-config.h version-config.h
diff --git a/xserver/include/colormap.h b/xserver/include/colormap.h
index 5f6b97fec..f3b18a613 100644
--- a/xserver/include/colormap.h
+++ b/xserver/include/colormap.h
@@ -108,18 +108,6 @@ extern _X_EXPORT void FakeAllocColor(ColormapPtr /*pmap */ ,
extern _X_EXPORT void FakeFreeColor(ColormapPtr /*pmap */ ,
Pixel /*pixel */ );
-typedef int (*ColorCompareProcPtr) (EntryPtr /*pent */ ,
- xrgb * /*prgb */ );
-
-extern _X_EXPORT int FindColor(ColormapPtr /*pmap */ ,
- EntryPtr /*pentFirst */ ,
- int /*size */ ,
- xrgb * /*prgb */ ,
- Pixel * /*pPixel */ ,
- int /*channel */ ,
- int /*client */ ,
- ColorCompareProcPtr /*comp */ );
-
extern _X_EXPORT int QueryColors(ColormapPtr /*pmap */ ,
int /*count */ ,
Pixel * /*ppixIn */ ,
diff --git a/xserver/include/cursorstr.h b/xserver/include/cursorstr.h
index 221cd7034..3f306a496 100644
--- a/xserver/include/cursorstr.h
+++ b/xserver/include/cursorstr.h
@@ -64,9 +64,7 @@ typedef struct _CursorBits {
unsigned short width, height, xhot, yhot; /* metrics */
int refcnt; /* can be shared */
PrivateRec *devPrivates; /* set by pScr->RealizeCursor */
-#ifdef ARGB_CURSOR
CARD32 *argb; /* full-color alpha blended */
-#endif
} CursorBits, *CursorBitsPtr;
#define CURSOR_BITS_SIZE (sizeof(CursorBits) + dixPrivatesSize(PRIVATE_CURSOR_BITS))
diff --git a/xserver/include/displaymode.h b/xserver/include/displaymode.h
new file mode 100644
index 000000000..ad01b87ec
--- /dev/null
+++ b/xserver/include/displaymode.h
@@ -0,0 +1,102 @@
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _DISMODEPROC_H_
+#define _DISMODEPROC_H_
+
+#include "scrnintstr.h"
+
+#define MAXCLOCKS 128
+
+/* These are possible return values for xf86CheckMode() and ValidMode() */
+typedef enum {
+ MODE_OK = 0, /* Mode OK */
+ MODE_HSYNC, /* hsync out of range */
+ MODE_VSYNC, /* vsync out of range */
+ MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
+ MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
+ MODE_BAD_WIDTH, /* requires an unsupported linepitch */
+ MODE_NOMODE, /* no mode with a matching name */
+ MODE_NO_INTERLACE, /* interlaced mode not supported */
+ MODE_NO_DBLESCAN, /* doublescan mode not supported */
+ MODE_NO_VSCAN, /* multiscan mode not supported */
+ MODE_MEM, /* insufficient video memory */
+ MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
+ MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
+ MODE_MEM_VIRT, /* insufficient video memory given virtual size */
+ MODE_NOCLOCK, /* no fixed clock available */
+ MODE_CLOCK_HIGH, /* clock required is too high */
+ MODE_CLOCK_LOW, /* clock required is too low */
+ MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
+ MODE_BAD_HVALUE, /* horizontal timing was out of range */
+ MODE_BAD_VVALUE, /* vertical timing was out of range */
+ MODE_BAD_VSCAN, /* VScan value out of range */
+ MODE_HSYNC_NARROW, /* horizontal sync too narrow */
+ MODE_HSYNC_WIDE, /* horizontal sync too wide */
+ MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
+ MODE_HBLANK_WIDE, /* horizontal blanking too wide */
+ MODE_VSYNC_NARROW, /* vertical sync too narrow */
+ MODE_VSYNC_WIDE, /* vertical sync too wide */
+ MODE_VBLANK_NARROW, /* vertical blanking too narrow */
+ MODE_VBLANK_WIDE, /* vertical blanking too wide */
+ MODE_PANEL, /* exceeds panel dimensions */
+ MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
+ MODE_ONE_WIDTH, /* only one width is supported */
+ MODE_ONE_HEIGHT, /* only one height is supported */
+ MODE_ONE_SIZE, /* only one resolution is supported */
+ MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */
+ MODE_BANDWIDTH, /* mode requires too much memory bandwidth */
+ MODE_BAD = -2, /* unspecified reason */
+ MODE_ERROR = -1 /* error condition */
+} ModeStatus;
+
+/* Video mode */
+typedef struct _DisplayModeRec {
+ struct _DisplayModeRec *prev;
+ struct _DisplayModeRec *next;
+ const char *name; /* identifier for the mode */
+ ModeStatus status;
+ int type;
+
+ /* These are the values that the user sees/provides */
+ int Clock; /* pixel clock freq (kHz) */
+ int HDisplay; /* horizontal timing */
+ int HSyncStart;
+ int HSyncEnd;
+ int HTotal;
+ int HSkew;
+ int VDisplay; /* vertical timing */
+ int VSyncStart;
+ int VSyncEnd;
+ int VTotal;
+ int VScan;
+ int Flags;
+
+ /* These are the values the hardware uses */
+ int ClockIndex;
+ int SynthClock; /* Actual clock freq to
+ * be programmed (kHz) */
+ int CrtcHDisplay;
+ int CrtcHBlankStart;
+ int CrtcHSyncStart;
+ int CrtcHSyncEnd;
+ int CrtcHBlankEnd;
+ int CrtcHTotal;
+ int CrtcHSkew;
+ int CrtcVDisplay;
+ int CrtcVBlankStart;
+ int CrtcVSyncStart;
+ int CrtcVSyncEnd;
+ int CrtcVBlankEnd;
+ int CrtcVTotal;
+ Bool CrtcHAdjusted;
+ Bool CrtcVAdjusted;
+ int PrivSize;
+ INT32 *Private;
+ int PrivFlags;
+
+ float HSync, VRefresh;
+} DisplayModeRec, *DisplayModePtr;
+
+#endif
diff --git a/xserver/include/dix-config.h.in b/xserver/include/dix-config.h.in
index bf7b76bd0..51a391f24 100644
--- a/xserver/include/dix-config.h.in
+++ b/xserver/include/dix-config.h.in
@@ -149,6 +149,9 @@
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
+/* Define to 1 if you have the `reallocarray' function. */
+#undef HAVE_REALLOCARRAY
+
/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */
#undef HAVE_RPCSVC_DBM_H
@@ -304,9 +307,6 @@
/* Support TCP socket connections */
#undef TCPCONN
-/* Enable touchscreen support */
-#undef TOUCHSCREEN
-
/* Support tslib touchscreen abstraction library */
#undef TSLIB
@@ -466,9 +466,6 @@
/* Define to __typeof__ if your compiler spells it that way. */
#undef typeof
-/* The compiler supported TLS storage class, prefering initial-exec if tls_model is supported */
-#undef TLS
-
/* Correctly set _XSERVER64 for OSX fat binaries */
#ifdef __APPLE__
#include "dix-config-apple-verbatim.h"
@@ -518,6 +515,9 @@
/* Build glamor's GBM-based EGL support */
#undef GLAMOR_HAS_GBM
+/* Build glamor/gbm has linear support */
+#undef GLAMOR_HAS_GBM_LINEAR
+
/* byte order */
#undef X_BYTE_ORDER
@@ -530,4 +530,10 @@
/* Listen on local socket */
#undef LISTEN_LOCAL
+/* Define if no local socket credentials interface exists */
+#undef NO_LOCAL_CLIENT_CRED
+
+/* Have posix_fallocate() */
+#undef HAVE_POSIX_FALLOCATE
+
#endif /* _DIX_CONFIG_H_ */
diff --git a/xserver/include/dix.h b/xserver/include/dix.h
index 921156b4c..d49d05569 100644
--- a/xserver/include/dix.h
+++ b/xserver/include/dix.h
@@ -255,6 +255,14 @@ extern _X_EXPORT Bool ClientSleep(ClientPtr client,
extern _X_EXPORT Bool ClientSignal(ClientPtr /*client */ );
#endif /* ___CLIENTSIGNAL_DEFINED___ */
+#ifndef ___CLIENTSIGNALALL_DEFINED___
+#define ___CLIENTSIGNALALL_DEFINED___
+#define CLIENT_SIGNAL_ANY ((void *)-1)
+extern _X_EXPORT int ClientSignalAll(ClientPtr /*client*/,
+ ClientSleepProcPtr /*function*/,
+ void * /*closure*/);
+#endif /* ___CLIENTSIGNALALL_DEFINED___ */
+
extern _X_EXPORT void ClientWakeup(ClientPtr /*client */ );
extern _X_EXPORT Bool ClientIsAsleep(ClientPtr /*client */ );
diff --git a/xserver/include/dixfont.h b/xserver/include/dixfont.h
index 48c630539..b44996ffa 100644
--- a/xserver/include/dixfont.h
+++ b/xserver/include/dixfont.h
@@ -29,6 +29,7 @@ SOFTWARE.
#include "closure.h"
#include <X11/fonts/fontstruct.h>
#include <X11/fonts/fontproto.h>
+#include <X11/fonts/fontutil.h>
#define NullDIXFontProp ((DIXFontPropPtr)0)
@@ -36,14 +37,6 @@ typedef struct _DIXFontProp *DIXFontPropPtr;
extern _X_EXPORT Bool SetDefaultFont(const char * /*defaultfontname */ );
-extern _X_EXPORT void QueueFontWakeup(FontPathElementPtr /*fpe */ );
-
-extern _X_EXPORT void RemoveFontWakeup(FontPathElementPtr /*fpe */ );
-
-extern _X_EXPORT void FontWakeup(void *data,
- int count,
- void *LastSelectMask);
-
extern _X_EXPORT int OpenFont(ClientPtr /*client */ ,
XID /*fid */ ,
Mask /*flags */ ,
@@ -64,14 +57,6 @@ extern _X_EXPORT int ListFonts(ClientPtr /*client */ ,
unsigned int /*length */ ,
unsigned int /*max_names */ );
-extern _X_EXPORT int
- doListFontsWithInfo(ClientPtr /*client */ ,
- LFWIclosurePtr /*c */ );
-
-extern _X_EXPORT int doPolyText(ClientPtr /*client */ ,
- PTclosurePtr /*c */
- );
-
extern _X_EXPORT int PolyText(ClientPtr /*client */ ,
DrawablePtr /*pDraw */ ,
GCPtr /*pGC */ ,
@@ -82,9 +67,6 @@ extern _X_EXPORT int PolyText(ClientPtr /*client */ ,
int /*reqType */ ,
XID /*did */ );
-extern _X_EXPORT int doImageText(ClientPtr /*client */ ,
- ITclosurePtr /*c */ );
-
extern _X_EXPORT int ImageText(ClientPtr /*client */ ,
DrawablePtr /*pDraw */ ,
GCPtr /*pGC */ ,
@@ -126,22 +108,6 @@ extern _X_EXPORT void dixGetGlyphs(FontPtr /*font */ ,
unsigned long * /*glyphcount */ ,
CharInfoPtr * /*glyphs */ );
-extern _X_EXPORT void QueryGlyphExtents(FontPtr /*pFont */ ,
- CharInfoPtr * /*charinfo */ ,
- unsigned long /*count */ ,
- ExtentInfoPtr /*info */ );
-
-extern _X_EXPORT Bool QueryTextExtents(FontPtr /*pFont */ ,
- unsigned long /*count */ ,
- unsigned char * /*chars */ ,
- ExtentInfoPtr /*info */ );
-
-extern _X_EXPORT Bool ParseGlyphCachingMode(char * /*str */ );
-
-extern _X_EXPORT void InitGlyphCaching(void);
-
-extern _X_EXPORT void SetGlyphCachingMode(int /*newmode */ );
-
extern _X_EXPORT void register_fpe_functions(void);
#endif /* DIXFONT_H */
diff --git a/xserver/include/dixstruct.h b/xserver/include/dixstruct.h
index 6c13895d7..757506623 100644
--- a/xserver/include/dixstruct.h
+++ b/xserver/include/dixstruct.h
@@ -126,21 +126,18 @@ SetReqFds(ClientPtr client, int req_fds) {
/*
* Scheduling interface
*/
-extern _X_EXPORT long SmartScheduleTime;
-extern _X_EXPORT long SmartScheduleInterval;
-extern _X_EXPORT long SmartScheduleSlice;
-extern _X_EXPORT long SmartScheduleMaxSlice;
-extern _X_EXPORT Bool SmartScheduleDisable;
-extern _X_EXPORT void
-SmartScheduleStartTimer(void);
-extern _X_EXPORT void
-SmartScheduleStopTimer(void);
+extern long SmartScheduleTime;
+extern long SmartScheduleInterval;
+extern long SmartScheduleSlice;
+extern long SmartScheduleMaxSlice;
+extern Bool SmartScheduleDisable;
+extern void SmartScheduleStartTimer(void);
+extern void SmartScheduleStopTimer(void);
#define SMART_MAX_PRIORITY (20)
#define SMART_MIN_PRIORITY (-20)
-extern _X_EXPORT void
-SmartScheduleInit(void);
+extern void SmartScheduleInit(void);
/* This prototype is used pervasively in Xext, dix */
#define DISPATCH_PROC(func) int func(ClientPtr /* client */)
@@ -179,13 +176,13 @@ typedef struct _CallbackList {
/* proc vectors */
-extern _X_EXPORT int (*InitialVector[3]) (ClientPtr /*client */ );
+extern int (*InitialVector[3]) (ClientPtr /*client */ );
extern _X_EXPORT int (*ProcVector[256]) (ClientPtr /*client */ );
extern _X_EXPORT int (*SwappedProcVector[256]) (ClientPtr /*client */ );
-extern _X_EXPORT ReplySwapPtr ReplySwapVector[256];
+extern ReplySwapPtr ReplySwapVector[256];
extern _X_EXPORT int
ProcBadRequest(ClientPtr /*client */ );
diff --git a/xserver/include/do-not-use-config.h.in b/xserver/include/do-not-use-config.h.in
index ca5731f30..221ed51cb 100644
--- a/xserver/include/do-not-use-config.h.in
+++ b/xserver/include/do-not-use-config.h.in
@@ -117,6 +117,9 @@
/* Build glamor with GBM-based EGL support */
#undef GLAMOR_HAS_GBM
+/* Have GBM_BO_USE_LINEAR */
+#undef GLAMOR_HAS_GBM_LINEAR
+
/* Build GLX extension */
#undef GLXEXT
@@ -257,6 +260,12 @@
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
+/* Define to 1 if you have the `posix_fallocate' function. */
+#undef HAVE_POSIX_FALLOCATE
+
+/* Define to 1 if you have the `reallocarray' function. */
+#undef HAVE_REALLOCARRAY
+
/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */
#undef HAVE_RPCSVC_DBM_H
@@ -444,8 +453,8 @@
/* Need XFree86 typedefs */
#undef NEED_XF86_TYPES
-/* Define to 1 if modules should avoid the libcwrapper */
-#undef NO_LIBCWRAPPER
+/* Define to 1 if no local socket credentials interface exists */
+#undef NO_LOCAL_CLIENT_CRED
/* Operating System Name */
#undef OSNAME
@@ -558,10 +567,6 @@
/* Support TCP socket connections */
#undef TCPCONN
-/* The compiler supported TLS storage class, prefering initial-exec if
- tls_model is supported */
-#undef TLS
-
/* Have tslib support */
#undef TSLIB
diff --git a/xserver/include/extinit.h b/xserver/include/extinit.h
index fa5f29378..4ad4fcac0 100644
--- a/xserver/include/extinit.h
+++ b/xserver/include/extinit.h
@@ -163,11 +163,6 @@ extern void SELinuxExtensionInit(void);
extern void XTestExtensionInit(void);
#endif
-#ifdef INXQUARTZ
-extern _X_EXPORT Bool noPseudoramiXExtension;
-extern void PseudoramiXExtensionInit(void);
-#endif
-
#if defined(XV)
#include <X11/extensions/Xv.h>
#include <X11/extensions/XvMC.h>
diff --git a/xserver/include/input.h b/xserver/include/input.h
index 7212cc176..d8bd9c602 100644
--- a/xserver/include/input.h
+++ b/xserver/include/input.h
@@ -448,12 +448,11 @@ extern _X_EXPORT void QueuePointerEvents(DeviceIntPtr pDev,
extern _X_EXPORT int GetKeyboardEvents(InternalEvent *events,
DeviceIntPtr pDev,
int type,
- int key_code, const ValuatorMask *mask);
+ int key_code);
extern _X_EXPORT void QueueKeyboardEvents(DeviceIntPtr pDev,
int type,
- int key_code,
- const ValuatorMask *mask);
+ int key_code);
extern int GetTouchEvents(InternalEvent *events,
DeviceIntPtr pDev,
@@ -674,6 +673,21 @@ extern _X_EXPORT Bool valuator_mask_fetch(const ValuatorMask *mask,
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 double valuator_mask_get_accelerated(const ValuatorMask *mask,
+ int valuator);
+extern _X_EXPORT double valuator_mask_get_unaccelerated(const ValuatorMask *mask,
+ int valuator);
+extern _X_EXPORT Bool valuator_mask_fetch_unaccelerated(const ValuatorMask *mask,
+ int valuator,
+ double *accel,
+ double *unaccel);
+extern _X_HIDDEN void valuator_mask_drop_unaccelerated(ValuatorMask *mask);
+
/* InputOption handling interface */
extern _X_EXPORT InputOption *input_option_new(InputOption *list,
const char *key,
diff --git a/xserver/include/inpututils.h b/xserver/include/inpututils.h
index 53c96ba1c..4e9081563 100644
--- a/xserver/include/inpututils.h
+++ b/xserver/include/inpututils.h
@@ -36,8 +36,10 @@ extern Mask event_filters[MAXDEVICES][MAXEVENTS];
struct _ValuatorMask {
int8_t last_bit; /* highest bit set in mask */
+ int8_t has_unaccelerated;
uint8_t mask[(MAX_VALUATORS + 7) / 8];
double valuators[MAX_VALUATORS]; /* valuator data */
+ double unaccelerated[MAX_VALUATORS]; /* valuator data */
};
extern void verify_internal_event(const InternalEvent *ev);
diff --git a/xserver/include/kdrive-config.h.in b/xserver/include/kdrive-config.h.in
index 0e54aa18f..3d7e9a4a7 100644
--- a/xserver/include/kdrive-config.h.in
+++ b/xserver/include/kdrive-config.h.in
@@ -13,9 +13,6 @@
/* Include framebuffer support in X servers */
#undef KDRIVEFBDEV
-/* Enable touchscreen support */
-#undef TOUCHSCREEN
-
/* Support tslib touchscreen abstraction library */
#undef TSLIB
diff --git a/xserver/include/list.h b/xserver/include/list.h
index 39f198590..3f0574d43 100644
--- a/xserver/include/list.h
+++ b/xserver/include/list.h
@@ -304,8 +304,9 @@ xorg_list_is_empty(struct xorg_list *head)
* @param member Member name of the struct xorg_list in the list elements.
*
*/
-#define xorg_list_for_each_entry(pos, head, member) \
- for (pos = __container_of((head)->next, pos, member); \
+#define xorg_list_for_each_entry(pos, head, member) \
+ for (pos = NULL, \
+ pos = __container_of((head)->next, pos, member); \
&pos->member != (head); \
pos = __container_of(pos->member.next, pos, member))
@@ -317,7 +318,8 @@ xorg_list_is_empty(struct xorg_list *head)
* See xorg_list_for_each_entry for more details.
*/
#define xorg_list_for_each_entry_safe(pos, tmp, head, member) \
- for (pos = __container_of((head)->next, pos, member), \
+ for (pos = NULL, \
+ pos = __container_of((head)->next, pos, member), \
tmp = __container_of(pos->member.next, pos, member); \
&pos->member != (head); \
pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
diff --git a/xserver/include/misc.h b/xserver/include/misc.h
index 9b1c03a67..56e138c6b 100644
--- a/xserver/include/misc.h
+++ b/xserver/include/misc.h
@@ -86,7 +86,8 @@ OF THIS SOFTWARE.
#ifndef MAXGPUSCREENS
#define MAXGPUSCREENS 16
#endif
-#define MAXCLIENTS 256
+#define MAXCLIENTS 512
+#define LIMITCLIENTS 256 /* Must be a power of 2 and <= MAXCLIENTS */
#define MAXEXTENSIONS 128
#define MAXFORMATS 8
#define MAXDEVICES 40 /* input devices */
diff --git a/xserver/include/nonsdk_extinit.h b/xserver/include/nonsdk_extinit.h
new file mode 100644
index 000000000..da8d370bd
--- /dev/null
+++ b/xserver/include/nonsdk_extinit.h
@@ -0,0 +1,35 @@
+/***********************************************************
+
+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 NONSDK_EXT_INIT_H
+#define NONSDK_EXT_INIT_H
+
+/* this is separate from extinit.h to avoid references to these symbols being
+ pulled in by sdksyms */
+
+extern _X_EXPORT Bool noPseudoramiXExtension;
+extern void PseudoramiXExtensionInit(void);
+
+#endif
diff --git a/xserver/include/opaque.h b/xserver/include/opaque.h
index a2c54aa6a..0ba0d64da 100644
--- a/xserver/include/opaque.h
+++ b/xserver/include/opaque.h
@@ -36,6 +36,7 @@ from The Open Group.
extern _X_EXPORT const char *defaultTextFont;
extern _X_EXPORT const char *defaultCursorFont;
extern _X_EXPORT int MaxClients;
+extern _X_EXPORT int LimitClients;
extern _X_EXPORT volatile char isItTimeToYield;
extern _X_EXPORT volatile char dispatchException;
diff --git a/xserver/include/os.h b/xserver/include/os.h
index a910c6558..abcc0673d 100644
--- a/xserver/include/os.h
+++ b/xserver/include/os.h
@@ -69,11 +69,15 @@ typedef struct _NewClientRec *NewClientPtr;
#ifndef xnfalloc
#define xnfalloc(size) XNFalloc((unsigned long)(size))
-#define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size))
+#define xnfcalloc(_num, _size) XNFcallocarray((_num), (_size))
#define xnfrealloc(ptr, size) XNFrealloc((void *)(ptr), (unsigned long)(size))
#define xstrdup(s) Xstrdup(s)
#define xnfstrdup(s) XNFstrdup(s)
+
+#define xallocarray(num, size) reallocarray(NULL, (num), (size))
+#define xnfallocarray(num, size) XNFreallocarray(NULL, (num), (size))
+#define xnfreallocarray(ptr, num, size) XNFreallocarray((ptr), (num), (size))
#endif
#include <stdio.h>
@@ -222,7 +226,14 @@ XNFalloc(unsigned long /*amount */ );
* enough memory.
*/
extern _X_EXPORT void *
-XNFcalloc(unsigned long /*amount */ );
+XNFcalloc(unsigned long /*amount */ ) _X_DEPRECATED;
+
+/*
+ * This function calloc(3)s buffer, terminating the server if there is not
+ * enough memory or the arguments overflow when multiplied
+ */
+extern _X_EXPORT void *
+XNFcallocarray(size_t nmemb, size_t size);
/*
* This function realloc(3)s passed buffer, terminating the server if there is
@@ -232,6 +243,13 @@ extern _X_EXPORT void *
XNFrealloc(void * /*ptr */ , unsigned long /*amount */ );
/*
+ * This function reallocarray(3)s passed buffer, terminating the server if
+ * there is not enough memory or the arguments overflow when multiplied.
+ */
+extern _X_EXPORT void *
+XNFreallocarray(void *ptr, size_t nmemb, size_t size);
+
+/*
* This function strdup(3)s passed string. The only difference from the library
* function that it is safe to pass NULL, as NULL will be returned.
*/
@@ -404,6 +422,7 @@ typedef struct {
extern _X_EXPORT int
GetLocalClientCreds(ClientPtr, LocalClientCredRec **);
+
extern _X_EXPORT void
FreeLocalClientCreds(LocalClientCredRec *);
@@ -411,6 +430,12 @@ extern _X_EXPORT int
ChangeAccessControl(ClientPtr /*client */ , int /*fEnabled */ );
extern _X_EXPORT int
+GetClientFd(ClientPtr);
+
+extern _X_EXPORT Bool
+ClientIsLocal(ClientPtr client);
+
+extern _X_EXPORT int
GetAccessControl(void);
extern _X_EXPORT void
@@ -534,7 +559,14 @@ ddxGiveUp(enum ExitCode error);
extern _X_EXPORT int
TimeSinceLastInputEvent(void);
-/* strcasecmp.c */
+/* Function fallbacks provided by AC_REPLACE_FUNCS in configure.ac */
+
+#ifndef HAVE_REALLOCARRAY
+#define reallocarray xreallocarray
+extern _X_EXPORT void *
+reallocarray(void *optr, size_t nmemb, size_t size);
+#endif
+
#ifndef HAVE_STRCASECMP
#define strcasecmp xstrcasecmp
extern _X_EXPORT int
@@ -591,6 +623,8 @@ typedef enum {
extern _X_EXPORT const char *
LogInit(const char *fname, const char *backup);
+extern void
+LogSetDisplay(void);
extern _X_EXPORT void
LogClose(enum ExitCode error);
extern _X_EXPORT Bool
diff --git a/xserver/include/pixmap.h b/xserver/include/pixmap.h
index 9656c3ade..c6a773649 100644
--- a/xserver/include/pixmap.h
+++ b/xserver/include/pixmap.h
@@ -50,7 +50,7 @@ SOFTWARE.
#include "misc.h"
#include "screenint.h"
#include "regionstr.h"
-
+#include <X11/extensions/randr.h>
/* types for Drawable */
#define DRAWABLE_WINDOW 0
#define DRAWABLE_PIXMAP 1
@@ -115,16 +115,12 @@ extern _X_EXPORT void FreePixmap(PixmapPtr /*pPixmap */ );
extern _X_EXPORT PixmapPtr
PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave);
+#define HAS_DIRTYTRACKING_ROTATION 1
extern _X_EXPORT Bool
PixmapStartDirtyTracking(PixmapPtr src,
PixmapPtr slave_dst,
- int x, int y);
-
-#define HAS_DIRTYTRACKING2 1
-extern _X_EXPORT Bool
-PixmapStartDirtyTracking2(PixmapPtr src,
- PixmapPtr slave_dst,
- int x, int y, int dst_x, int dst_y);
+ int x, int y, int dst_x, int dst_y,
+ Rotation rotation);
extern _X_EXPORT Bool
PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst);
@@ -132,6 +128,6 @@ PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst);
/* helper function, drivers can do this themselves if they can do it more
efficently */
extern _X_EXPORT Bool
-PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region);
+PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty);
#endif /* PIXMAP_H */
diff --git a/xserver/include/pixmapstr.h b/xserver/include/pixmapstr.h
index 380e48335..4bd246562 100644
--- a/xserver/include/pixmapstr.h
+++ b/xserver/include/pixmapstr.h
@@ -51,6 +51,8 @@ SOFTWARE.
#include "regionstr.h"
#include "privates.h"
#include "damage.h"
+#include <X11/extensions/randr.h>
+#include "picturestr.h"
typedef struct _Drawable {
unsigned char type; /* DRAWABLE_<type> */
@@ -91,6 +93,9 @@ typedef struct _PixmapDirtyUpdate {
DamagePtr damage;
struct xorg_list ent;
int dst_x, dst_y;
+ Rotation rotation;
+ PictTransform transform;
+ struct pixman_f_transform f_transform, f_inverse;
} PixmapDirtyUpdateRec;
static inline void
diff --git a/xserver/include/protocol-versions.h b/xserver/include/protocol-versions.h
index fc428c8cf..be532ff55 100644
--- a/xserver/include/protocol-versions.h
+++ b/xserver/include/protocol-versions.h
@@ -73,7 +73,7 @@
/* RandR */
#define SERVER_RANDR_MAJOR_VERSION 1
-#define SERVER_RANDR_MINOR_VERSION 4
+#define SERVER_RANDR_MINOR_VERSION 5
/* Record */
#define SERVER_RECORD_MAJOR_VERSION 1
diff --git a/xserver/include/resource.h b/xserver/include/resource.h
index 772f363b0..5871a4cb4 100644
--- a/xserver/include/resource.h
+++ b/xserver/include/resource.h
@@ -85,21 +85,10 @@ typedef uint32_t RESTYPE;
#define RT_LASTPREDEF ((RESTYPE)9)
#define RT_NONE ((RESTYPE)0)
+extern _X_EXPORT unsigned int ResourceClientBits(void);
/* bits and fields within a resource id */
#define RESOURCE_AND_CLIENT_COUNT 29 /* 29 bits for XIDs */
-#if MAXCLIENTS == 64
-#define RESOURCE_CLIENT_BITS 6
-#endif
-#if MAXCLIENTS == 128
-#define RESOURCE_CLIENT_BITS 7
-#endif
-#if MAXCLIENTS == 256
-#define RESOURCE_CLIENT_BITS 8
-#endif
-#if MAXCLIENTS == 512
-#define RESOURCE_CLIENT_BITS 9
-#endif
-/* client field offset */
+#define RESOURCE_CLIENT_BITS ResourceClientBits() /* client field offset */
#define CLIENTOFFSET (RESOURCE_AND_CLIENT_COUNT - RESOURCE_CLIENT_BITS)
/* resource field */
#define RESOURCE_ID_MASK ((1 << CLIENTOFFSET) - 1)
diff --git a/xserver/include/scrnintstr.h b/xserver/include/scrnintstr.h
index faf05630c..2e617c466 100644
--- a/xserver/include/scrnintstr.h
+++ b/xserver/include/scrnintstr.h
@@ -55,6 +55,7 @@ SOFTWARE.
#include <X11/Xproto.h>
#include "dix.h"
#include "privates.h"
+#include <X11/extensions/randr.h>
typedef struct _PixmapFormat {
unsigned char depth;
@@ -157,6 +158,10 @@ typedef void (*PostValidateTreeProcPtr) (WindowPtr /*pParent */ ,
typedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ ,
RegionPtr /*prgn */);
+typedef void (*PaintWindowProcPtr) (WindowPtr /*pWindow*/,
+ RegionPtr /*pRegion*/,
+ int /*what*/);
+
typedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ ,
DDXPointRec /*ptOldOrg */ ,
RegionPtr /*prgnSrc */ );
@@ -340,7 +345,9 @@ typedef Bool (*SharePixmapBackingProcPtr)(PixmapPtr, ScreenPtr, void **);
typedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *);
typedef Bool (*StartPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr,
- int x, int y);
+ int x, int y,
+ int dst_x, int dst_y,
+ Rotation rotation);
typedef Bool (*StopPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr);
@@ -495,6 +502,7 @@ typedef struct _Screen {
ClearToBackgroundProcPtr ClearToBackground;
ClipNotifyProcPtr ClipNotify;
RestackWindowProcPtr RestackWindow;
+ PaintWindowProcPtr PaintWindow;
/* Pixmap procedures */
diff --git a/xserver/include/swaprep.h b/xserver/include/swaprep.h
index 3fa2a090c..63c54c7fb 100644
--- a/xserver/include/swaprep.h
+++ b/xserver/include/swaprep.h
@@ -26,207 +26,207 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef SWAPREP_H
#define SWAPREP_H 1
-extern _X_EXPORT void Swap32Write(ClientPtr /* pClient */ ,
- int /* size */ ,
- CARD32 * /* pbuf */ );
+extern void Swap32Write(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ CARD32 * /* pbuf */ );
-extern _X_EXPORT void CopySwap32Write(ClientPtr /* pClient */ ,
- int /* size */ ,
- CARD32 * /* pbuf */ );
+extern void CopySwap32Write(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ CARD32 * /* pbuf */ );
+
+extern void CopySwap16Write(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ short * /* pbuf */ );
+
+extern void SGenericReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGenericReply * /* pRep */ );
-extern _X_EXPORT void CopySwap16Write(ClientPtr /* pClient */ ,
+extern void SGetWindowAttributesReply(ClientPtr /* pClient */ ,
int /* size */ ,
- short * /* pbuf */ );
+ xGetWindowAttributesReply *
+ /* pRep */ );
+
+extern void SGetGeometryReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGetGeometryReply * /* pRep */ );
+
+extern void SQueryTreeReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xQueryTreeReply * /* pRep */ );
+
+extern void SInternAtomReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xInternAtomReply * /* pRep */ );
+
+extern void SGetAtomNameReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGetAtomNameReply * /* pRep */ );
-extern _X_EXPORT void SGenericReply(ClientPtr /* pClient */ ,
+extern void SGetPropertyReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGetPropertyReply * /* pRep */ );
+
+extern void SListPropertiesReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xListPropertiesReply * /* pRep */ );
+
+extern void SGetSelectionOwnerReply(ClientPtr /* pClient */ ,
int /* size */ ,
- xGenericReply * /* pRep */ );
+ xGetSelectionOwnerReply *
+ /* pRep */ );
-extern _X_EXPORT void SGetWindowAttributesReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetWindowAttributesReply *
- /* pRep */ );
+extern void SQueryPointerReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xQueryPointerReply * /* pRep */ );
-extern _X_EXPORT void SGetGeometryReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetGeometryReply * /* pRep */ );
+extern void SwapTimeCoordWrite(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xTimecoord * /* pRep */ );
-extern _X_EXPORT void SQueryTreeReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xQueryTreeReply * /* pRep */ );
+extern void SGetMotionEventsReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGetMotionEventsReply * /* pRep */
+ );
-extern _X_EXPORT void SInternAtomReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xInternAtomReply * /* pRep */ );
+extern void STranslateCoordsReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xTranslateCoordsReply * /* pRep */
+ );
-extern _X_EXPORT void SGetAtomNameReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetAtomNameReply * /* pRep */ );
+extern void SGetInputFocusReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGetInputFocusReply * /* pRep */ );
-extern _X_EXPORT void SGetPropertyReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetPropertyReply * /* pRep */ );
+extern void SQueryKeymapReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xQueryKeymapReply * /* pRep */ );
-extern _X_EXPORT void SListPropertiesReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xListPropertiesReply * /* pRep */ );
+extern void SQueryFontReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xQueryFontReply * /* pRep */ );
-extern _X_EXPORT void SGetSelectionOwnerReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetSelectionOwnerReply *
- /* pRep */ );
+extern void SQueryTextExtentsReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xQueryTextExtentsReply * /* pRep */
+ );
-extern _X_EXPORT void SQueryPointerReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xQueryPointerReply * /* pRep */ );
+extern void SListFontsReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xListFontsReply * /* pRep */ );
-extern _X_EXPORT void SwapTimeCoordWrite(ClientPtr /* pClient */ ,
- int /* size */ ,
- xTimecoord * /* pRep */ );
+extern void SListFontsWithInfoReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xListFontsWithInfoReply *
+ /* pRep */ );
-extern _X_EXPORT void SGetMotionEventsReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetMotionEventsReply * /* pRep */
- );
+extern void SGetFontPathReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGetFontPathReply * /* pRep */ );
-extern _X_EXPORT void STranslateCoordsReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xTranslateCoordsReply * /* pRep */
- );
+extern void SGetImageReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGetImageReply * /* pRep */ );
-extern _X_EXPORT void SGetInputFocusReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetInputFocusReply * /* pRep */ );
+extern void SListInstalledColormapsReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xListInstalledColormapsReply
+ * /* pRep */ );
-extern _X_EXPORT void SQueryKeymapReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xQueryKeymapReply * /* pRep */ );
+extern void SAllocColorReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xAllocColorReply * /* pRep */ );
-extern _X_EXPORT void SQueryFontReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xQueryFontReply * /* pRep */ );
+extern void SAllocNamedColorReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xAllocNamedColorReply * /* pRep */
+ );
-extern _X_EXPORT void SQueryTextExtentsReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xQueryTextExtentsReply * /* pRep */
- );
+extern void SAllocColorCellsReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xAllocColorCellsReply * /* pRep */
+ );
-extern _X_EXPORT void SListFontsReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xListFontsReply * /* pRep */ );
+extern void SAllocColorPlanesReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xAllocColorPlanesReply * /* pRep */
+ );
-extern _X_EXPORT void SListFontsWithInfoReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xListFontsWithInfoReply *
- /* pRep */ );
+extern void SQColorsExtend(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xrgb * /* prgb */ );
-extern _X_EXPORT void SGetFontPathReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetFontPathReply * /* pRep */ );
+extern void SQueryColorsReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xQueryColorsReply * /* pRep */ );
-extern _X_EXPORT void SGetImageReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetImageReply * /* pRep */ );
+extern void SLookupColorReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xLookupColorReply * /* pRep */ );
-extern _X_EXPORT void SListInstalledColormapsReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xListInstalledColormapsReply
- * /* pRep */ );
+extern void SQueryBestSizeReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xQueryBestSizeReply * /* pRep */ );
-extern _X_EXPORT void SAllocColorReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xAllocColorReply * /* pRep */ );
+extern void SListExtensionsReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xListExtensionsReply * /* pRep */ );
-extern _X_EXPORT void SAllocNamedColorReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xAllocNamedColorReply * /* pRep */
- );
+extern void SGetKeyboardMappingReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGetKeyboardMappingReply *
+ /* pRep */ );
-extern _X_EXPORT void SAllocColorCellsReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xAllocColorCellsReply * /* pRep */
- );
+extern void SGetPointerMappingReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGetPointerMappingReply *
+ /* pRep */ );
-extern _X_EXPORT void SAllocColorPlanesReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xAllocColorPlanesReply * /* pRep */
- );
+extern void SGetModifierMappingReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGetModifierMappingReply *
+ /* pRep */ );
-extern _X_EXPORT void SQColorsExtend(ClientPtr /* pClient */ ,
+extern void SGetKeyboardControlReply(ClientPtr /* pClient */ ,
int /* size */ ,
- xrgb * /* prgb */ );
-
-extern _X_EXPORT void SQueryColorsReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xQueryColorsReply * /* pRep */ );
-
-extern _X_EXPORT void SLookupColorReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xLookupColorReply * /* pRep */ );
-
-extern _X_EXPORT void SQueryBestSizeReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xQueryBestSizeReply * /* pRep */ );
-
-extern _X_EXPORT void SListExtensionsReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xListExtensionsReply * /* pRep */ );
-
-extern _X_EXPORT void SGetKeyboardMappingReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetKeyboardMappingReply *
- /* pRep */ );
-
-extern _X_EXPORT void SGetPointerMappingReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetPointerMappingReply *
- /* pRep */ );
-
-extern _X_EXPORT void SGetModifierMappingReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetModifierMappingReply *
- /* pRep */ );
-
-extern _X_EXPORT void SGetKeyboardControlReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetKeyboardControlReply *
- /* pRep */ );
-
-extern _X_EXPORT void SGetPointerControlReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetPointerControlReply *
- /* pRep */ );
-
-extern _X_EXPORT void SGetScreenSaverReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xGetScreenSaverReply * /* pRep */ );
-
-extern _X_EXPORT void SLHostsExtend(ClientPtr /* pClient */ ,
+ xGetKeyboardControlReply *
+ /* pRep */ );
+
+extern void SGetPointerControlReply(ClientPtr /* pClient */ ,
int /* size */ ,
- char * /* buf */ );
+ xGetPointerControlReply *
+ /* pRep */ );
-extern _X_EXPORT void SListHostsReply(ClientPtr /* pClient */ ,
- int /* size */ ,
- xListHostsReply * /* pRep */ );
+extern void SGetScreenSaverReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xGetScreenSaverReply * /* pRep */ );
+
+extern void SLHostsExtend(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ char * /* buf */ );
+
+extern void SListHostsReply(ClientPtr /* pClient */ ,
+ int /* size */ ,
+ xListHostsReply * /* pRep */ );
-extern _X_EXPORT void SErrorEvent(xError * /* from */ ,
- xError * /* to */ );
+extern void SErrorEvent(xError * /* from */ ,
+ xError * /* to */ );
-extern _X_EXPORT void SwapConnSetupInfo(char * /* pInfo */ ,
- char * /* pInfoTBase */ );
+extern void SwapConnSetupInfo(char * /* pInfo */ ,
+ char * /* pInfoTBase */ );
-extern _X_EXPORT void WriteSConnectionInfo(ClientPtr /* pClient */ ,
- unsigned long /* size */ ,
- char * /* pInfo */ );
+extern void WriteSConnectionInfo(ClientPtr /* pClient */ ,
+ unsigned long /* size */ ,
+ char * /* pInfo */ );
-extern _X_EXPORT void SwapConnSetupPrefix(xConnSetupPrefix * /* pcspFrom */ ,
- xConnSetupPrefix * /* pcspTo */ );
+extern void SwapConnSetupPrefix(xConnSetupPrefix * /* pcspFrom */ ,
+ xConnSetupPrefix * /* pcspTo */ );
-extern _X_EXPORT void WriteSConnSetupPrefix(ClientPtr /* pClient */ ,
- xConnSetupPrefix * /* pcsp */ );
+extern void WriteSConnSetupPrefix(ClientPtr /* pClient */ ,
+ xConnSetupPrefix * /* pcsp */ );
#undef SWAPREP_PROC
-#define SWAPREP_PROC(func) extern _X_EXPORT void func(xEvent * /* from */, xEvent * /* to */)
+#define SWAPREP_PROC(func) extern void func(xEvent * /* from */, xEvent * /* to */)
SWAPREP_PROC(SCirculateEvent);
SWAPREP_PROC(SClientMessageEvent);
diff --git a/xserver/include/swapreq.h b/xserver/include/swapreq.h
index 07eff807f..d696aa05e 100644
--- a/xserver/include/swapreq.h
+++ b/xserver/include/swapreq.h
@@ -26,13 +26,13 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef SWAPREQ_H
#define SWAPREQ_H 1
-extern _X_EXPORT void SwapColorItem(xColorItem * /* pItem */ );
+extern void SwapColorItem(xColorItem * /* pItem */ );
-extern _X_EXPORT void SwapConnClientPrefix(xConnClientPrefix * /* pCCP */ );
+extern void SwapConnClientPrefix(xConnClientPrefix * /* pCCP */ );
#undef SWAPREQ_PROC
-#define SWAPREQ_PROC(func) extern _X_EXPORT int func(ClientPtr /* client */)
+#define SWAPREQ_PROC(func) extern int func(ClientPtr /* client */)
SWAPREQ_PROC(SProcAllocColor);
SWAPREQ_PROC(SProcAllocColorCells);
diff --git a/xserver/include/vidmodestr.h b/xserver/include/vidmodestr.h
new file mode 100644
index 000000000..b47daa779
--- /dev/null
+++ b/xserver/include/vidmodestr.h
@@ -0,0 +1,142 @@
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _VIDMODEPROC_H_
+#define _VIDMODEPROC_H_
+
+#include "displaymode.h"
+
+typedef enum {
+ VIDMODE_H_DISPLAY,
+ VIDMODE_H_SYNCSTART,
+ VIDMODE_H_SYNCEND,
+ VIDMODE_H_TOTAL,
+ VIDMODE_H_SKEW,
+ VIDMODE_V_DISPLAY,
+ VIDMODE_V_SYNCSTART,
+ VIDMODE_V_SYNCEND,
+ VIDMODE_V_TOTAL,
+ VIDMODE_FLAGS,
+ VIDMODE_CLOCK
+} VidModeSelectMode;
+
+typedef enum {
+ VIDMODE_MON_VENDOR,
+ VIDMODE_MON_MODEL,
+ VIDMODE_MON_NHSYNC,
+ VIDMODE_MON_NVREFRESH,
+ VIDMODE_MON_HSYNC_LO,
+ VIDMODE_MON_HSYNC_HI,
+ VIDMODE_MON_VREFRESH_LO,
+ VIDMODE_MON_VREFRESH_HI
+} VidModeSelectMonitor;
+
+typedef union {
+ const void *ptr;
+ int i;
+ float f;
+} vidMonitorValue;
+
+typedef Bool (*VidModeExtensionInitProcPtr) (ScreenPtr pScreen);
+typedef vidMonitorValue (*VidModeGetMonitorValueProcPtr) (ScreenPtr pScreen,
+ int valtyp,
+ int indx);
+typedef Bool (*VidModeGetEnabledProcPtr) (void);
+typedef Bool (*VidModeGetAllowNonLocalProcPtr) (void);
+typedef Bool (*VidModeGetCurrentModelineProcPtr) (ScreenPtr pScreen,
+ DisplayModePtr *mode,
+ int *dotClock);
+typedef Bool (*VidModeGetFirstModelineProcPtr) (ScreenPtr pScreen,
+ DisplayModePtr *mode,
+ int *dotClock);
+typedef Bool (*VidModeGetNextModelineProcPtr) (ScreenPtr pScreen,
+ DisplayModePtr *mode,
+ int *dotClock);
+typedef Bool (*VidModeDeleteModelineProcPtr) (ScreenPtr pScreen,
+ DisplayModePtr mode);
+typedef Bool (*VidModeZoomViewportProcPtr) (ScreenPtr pScreen,
+ int zoom);
+typedef Bool (*VidModeGetViewPortProcPtr) (ScreenPtr pScreen,
+ int *x,
+ int *y);
+typedef Bool (*VidModeSetViewPortProcPtr) (ScreenPtr pScreen,
+ int x,
+ int y);
+typedef Bool (*VidModeSwitchModeProcPtr) (ScreenPtr pScreen,
+ DisplayModePtr mode);
+typedef Bool (*VidModeLockZoomProcPtr) (ScreenPtr pScreen,
+ Bool lock);
+typedef int (*VidModeGetNumOfClocksProcPtr) (ScreenPtr pScreen,
+ Bool *progClock);
+typedef Bool (*VidModeGetClocksProcPtr) (ScreenPtr pScreen,
+ int *Clocks);
+typedef ModeStatus (*VidModeCheckModeForMonitorProcPtr) (ScreenPtr pScreen,
+ DisplayModePtr mode);
+typedef ModeStatus (*VidModeCheckModeForDriverProcPtr) (ScreenPtr pScreen,
+ DisplayModePtr mode);
+typedef void (*VidModeSetCrtcForModeProcPtr) (ScreenPtr pScreen,
+ DisplayModePtr mode);
+typedef Bool (*VidModeAddModelineProcPtr) (ScreenPtr pScreen,
+ DisplayModePtr mode);
+typedef int (*VidModeGetDotClockProcPtr) (ScreenPtr pScreen,
+ int Clock);
+typedef int (*VidModeGetNumOfModesProcPtr) (ScreenPtr pScreen);
+typedef Bool (*VidModeSetGammaProcPtr) (ScreenPtr pScreen,
+ float red,
+ float green,
+ float blue);
+typedef Bool (*VidModeGetGammaProcPtr) (ScreenPtr pScreen,
+ float *red,
+ float *green,
+ float *blue);
+typedef Bool (*VidModeSetGammaRampProcPtr) (ScreenPtr pScreen,
+ int size,
+ CARD16 *red,
+ CARD16 *green,
+ CARD16 *blue);
+typedef Bool (*VidModeGetGammaRampProcPtr) (ScreenPtr pScreen,
+ int size,
+ CARD16 *red,
+ CARD16 *green,
+ CARD16 *blue);
+typedef int (*VidModeGetGammaRampSizeProcPtr) (ScreenPtr pScreen);
+
+typedef struct {
+ DisplayModePtr First;
+ DisplayModePtr Next;
+ int Flags;
+
+ VidModeExtensionInitProcPtr ExtensionInit;
+ VidModeGetMonitorValueProcPtr GetMonitorValue;
+ VidModeGetCurrentModelineProcPtr GetCurrentModeline;
+ VidModeGetFirstModelineProcPtr GetFirstModeline;
+ VidModeGetNextModelineProcPtr GetNextModeline;
+ VidModeDeleteModelineProcPtr DeleteModeline;
+ VidModeZoomViewportProcPtr ZoomViewport;
+ VidModeGetViewPortProcPtr GetViewPort;
+ VidModeSetViewPortProcPtr SetViewPort;
+ VidModeSwitchModeProcPtr SwitchMode;
+ VidModeLockZoomProcPtr LockZoom;
+ VidModeGetNumOfClocksProcPtr GetNumOfClocks;
+ VidModeGetClocksProcPtr GetClocks;
+ VidModeCheckModeForMonitorProcPtr CheckModeForMonitor;
+ VidModeCheckModeForDriverProcPtr CheckModeForDriver;
+ VidModeSetCrtcForModeProcPtr SetCrtcForMode;
+ VidModeAddModelineProcPtr AddModeline;
+ VidModeGetDotClockProcPtr GetDotClock;
+ VidModeGetNumOfModesProcPtr GetNumOfModes;
+ VidModeSetGammaProcPtr SetGamma;
+ VidModeGetGammaProcPtr GetGamma;
+ VidModeSetGammaRampProcPtr SetGammaRamp;
+ VidModeGetGammaRampProcPtr GetGammaRamp;
+ VidModeGetGammaRampSizeProcPtr GetGammaRampSize;
+} VidModeRec, *VidModePtr;
+
+#ifdef XF86VIDMODE
+void VidModeAddExtension(Bool allow_non_local);
+VidModePtr VidModeGetPtr(ScreenPtr pScreen);
+VidModePtr VidModeInit(ScreenPtr pScreen);
+#endif /* XF86VIDMODE */
+
+#endif
diff --git a/xserver/include/window.h b/xserver/include/window.h
index 6daec8599..7a22febf8 100644
--- a/xserver/include/window.h
+++ b/xserver/include/window.h
@@ -72,6 +72,12 @@ struct _Cursor;
typedef struct _BackingStore *BackingStorePtr;
typedef struct _Window *WindowPtr;
+enum RootClipMode {
+ ROOT_CLIP_NONE = 0, /**< resize the root window to 0x0 */
+ ROOT_CLIP_FULL = 1, /**< resize the root window to fit screen */
+ ROOT_CLIP_INPUT_ONLY = 2, /**< as above, but no rendering to screen */
+};
+
typedef int (*VisitWindowProcPtr) (WindowPtr pWin,
void *data);
@@ -221,8 +227,9 @@ extern _X_EXPORT RegionPtr CreateBoundingShape(WindowPtr /* pWin */ );
extern _X_EXPORT RegionPtr CreateClipShape(WindowPtr /* pWin */ );
-extern _X_EXPORT void SetRootClip(ScreenPtr pScreen, Bool enable);
+extern _X_EXPORT void SetRootClip(ScreenPtr pScreen, int enable);
extern _X_EXPORT void PrintWindowTree(void);
+extern _X_EXPORT void PrintPassiveGrabs(void);
extern _X_EXPORT VisualPtr WindowGetVisual(WindowPtr /*pWin*/);
#endif /* WINDOW_H */
diff --git a/xserver/include/windowstr.h b/xserver/include/windowstr.h
index 53eef376e..4383dabdc 100644
--- a/xserver/include/windowstr.h
+++ b/xserver/include/windowstr.h
@@ -162,9 +162,7 @@ typedef struct _Window {
unsigned forcedBS:1; /* system-supplied backingStore */
unsigned redirectDraw:2; /* COMPOSITE rendering redirect */
unsigned forcedBG:1; /* must have an opaque background */
-#ifdef ROOTLESS
- unsigned rootlessUnhittable:1; /* doesn't hit-test */
-#endif
+ unsigned unhittable:1; /* doesn't hit-test, for rootless */
#ifdef COMPOSITE
unsigned damagedDescendants:1; /* some descendants are damaged */
unsigned inhibitBGPaint:1; /* paint the background? */
diff --git a/xserver/include/xorg-server.h.in b/xserver/include/xorg-server.h.in
index 655b4036b..ed431c3c4 100644
--- a/xserver/include/xorg-server.h.in
+++ b/xserver/include/xorg-server.h.in
@@ -47,6 +47,9 @@
/* Define to 1 if you have the `ffs' function. */
#undef HAVE_FFS
+/* Define to 1 if you have the `reallocarray' function. */
+#undef HAVE_REALLOCARRAY
+
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
@@ -98,9 +101,6 @@
/* Support TCP socket connections */
#undef TCPCONN
-/* Enable touchscreen support */
-#undef TOUCHSCREEN
-
/* Support tslib touchscreen abstraction library */
#undef TSLIB
diff --git a/xserver/m4/xorg-tls.m4 b/xserver/m4/xorg-tls.m4
deleted file mode 100644
index 57687758f..000000000
--- a/xserver/m4/xorg-tls.m4
+++ /dev/null
@@ -1,55 +0,0 @@
-dnl Copyright © 2011 Apple Inc.
-dnl
-dnl Permission is hereby granted, free of charge, to any person obtaining a
-dnl copy of this software and associated documentation files (the "Software"),
-dnl to deal in the Software without restriction, including without limitation
-dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
-dnl and/or sell copies of the Software, and to permit persons to whom the
-dnl Software is furnished to do so, subject to the following conditions:
-dnl
-dnl The above copyright notice and this permission notice (including the next
-dnl paragraph) shall be included in all copies or substantial portions of the
-dnl Software.
-dnl
-dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-dnl DEALINGS IN THE SOFTWARE.
-dnl
-dnl Authors: Jeremy Huddleston <jeremyhu@apple.com>
-
-AC_DEFUN([XORG_TLS], [
- AC_REQUIRE([XORG_STRICT_OPTION])
- AC_MSG_CHECKING(for thread local storage (TLS) support)
- AC_CACHE_VAL(ac_cv_tls, [
- ac_cv_tls=none
- keywords="__thread __declspec(thread)"
- for kw in $keywords ; do
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int $kw test;]], [])], ac_cv_tls=$kw ; break ;)
- done
- ])
- AC_MSG_RESULT($ac_cv_tls)
-
- if test "$ac_cv_tls" != "none"; then
- AC_MSG_CHECKING(for tls_model attribute support)
- AC_CACHE_VAL(ac_cv_tls_model, [
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $STRICT_CFLAGS"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int $ac_cv_tls __attribute__((tls_model("initial-exec"))) test;]], [])],
- ac_cv_tls_model=yes, ac_cv_tls_model=no)
- CFLAGS="$save_CFLAGS"
- ])
- AC_MSG_RESULT($ac_cv_tls_model)
-
- if test "x$ac_cv_tls_model" = "xyes" ; then
- xorg_tls=$ac_cv_tls' __attribute__((tls_model("initial-exec")))'
- else
- xorg_tls=$ac_cv_tls
- fi
-
- AC_DEFINE_UNQUOTED([TLS], $xorg_tls, [The compiler supported TLS storage class, prefering initial-exec if tls_model is supported])
- fi
-])
diff --git a/xserver/man/Makefile.in b/xserver/man/Makefile.in
index 3b055975f..6f2627d39 100644
--- a/xserver/man/Makefile.in
+++ b/xserver/man/Makefile.in
@@ -61,8 +61,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -217,7 +216,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -364,8 +362,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/man/Xserver.man b/xserver/man/Xserver.man
index 32b364858..d83294d10 100644
--- a/xserver/man/Xserver.man
+++ b/xserver/man/Xserver.man
@@ -1,5 +1,5 @@
-.\" $Xorg: Xserver.man,v 1.4 2001/02/09 02:04:07 xorgcvs Exp $
-.\" $XdotOrg: xserver/xorg/doc/Xserver.man.pre,v 1.4 2005/12/23 20:11:12 alanc Exp $
+'\" t
+.\"
.\" Copyright 1984 - 1991, 1993, 1994, 1998 The Open Group
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and its
@@ -205,6 +205,15 @@ with
.BR "\-nolisten tcp" .
This option may be issued multiple times to disable listening to different
transport types.
+Supported transport types are platform dependent, but commonly include:
+.TS
+l l.
+tcp TCP over IPv4 or IPv6
+inet TCP over IPv4 only
+inet6 TCP over IPv6 only
+unix UNIX Domain Sockets
+local Platform preferred local connection method
+.TE
.TP 8
.B \-listen \fItrans-type\fP
enables a transport type. For example, TCP/IP connections can be enabled
@@ -320,6 +329,11 @@ sets the stack space limit of the server to the specified number of kilobytes.
A value of zero makes the stack size as large as possible. The default value
of \-1 leaves the stack space limit unchanged.
.TP 8
+.B \-maxclients
+.BR 64 | 128 | 256 | 512
+Set the maximum number of clients allowed to connect to the X server.
+Acceptable values are 64, 128, 256 or 512.
+.TP 8
.B \-render
.BR default | mono | gray | color
sets the color allocation policy that will be used by the render extension.
diff --git a/xserver/mi/Makefile.in b/xserver/mi/Makefile.in
index 0bc732114..7be1ee55c 100644
--- a/xserver/mi/Makefile.in
+++ b/xserver/mi/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -253,7 +252,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -383,8 +381,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/mi/miarc.c b/xserver/mi/miarc.c
index d26f67486..2588ee48a 100644
--- a/xserver/mi/miarc.c
+++ b/xserver/mi/miarc.c
@@ -1187,9 +1187,9 @@ miFillSppPoly(DrawablePtr dst, GCPtr pgc, int count, /* number of points */
y = ymax - ymin + 1;
if ((count < 3) || (y <= 0))
return;
- ptsOut = FirstPoint = malloc(sizeof(DDXPointRec) * y);
- width = FirstWidth = malloc(sizeof(int) * y);
- Marked = malloc(sizeof(int) * count);
+ ptsOut = FirstPoint = xallocarray(y, sizeof(DDXPointRec));
+ width = FirstWidth = xallocarray(y, sizeof(int));
+ Marked = xallocarray(count, sizeof(int));
if (!ptsOut || !width || !Marked) {
free(Marked);
@@ -1679,8 +1679,7 @@ miGetArcPts(SppArcPtr parc, /* points to an arc */
count++;
cdt = 2 * miDcos(dt);
- if (!(poly = (SppPointPtr) realloc((void *) *ppPts,
- (cpt + count) * sizeof(SppPointRec))))
+ if (!(poly = reallocarray(*ppPts, cpt + count, sizeof(SppPointRec))))
return 0;
*ppPts = poly;
@@ -1737,7 +1736,7 @@ addCap(miArcCapPtr * capsp, int *ncapsp, int *sizep, int end, int arcIndex)
if (*ncapsp == *sizep) {
newsize = *sizep + ADD_REALLOC_STEP;
- cap = (miArcCapPtr) realloc(*capsp, newsize * sizeof(**capsp));
+ cap = reallocarray(*capsp, newsize, sizeof(**capsp));
if (!cap)
return;
*sizep = newsize;
@@ -1760,7 +1759,7 @@ addJoin(miArcJoinPtr * joinsp,
if (*njoinsp == *sizep) {
newsize = *sizep + ADD_REALLOC_STEP;
- join = (miArcJoinPtr) realloc(*joinsp, newsize * sizeof(**joinsp));
+ join = reallocarray(*joinsp, newsize, sizeof(**joinsp));
if (!join)
return;
*sizep = newsize;
@@ -1784,7 +1783,7 @@ addArc(miArcDataPtr * arcsp, int *narcsp, int *sizep, xArc * xarc)
if (*narcsp == *sizep) {
newsize = *sizep + ADD_REALLOC_STEP;
- arc = (miArcDataPtr) realloc(*arcsp, newsize * sizeof(**arcsp));
+ arc = reallocarray(*arcsp, newsize, sizeof(**arcsp));
if (!arc)
return NULL;
*sizep = newsize;
@@ -1890,10 +1889,10 @@ miComputeArcs(xArc * parcs, int narcs, GCPtr pGC)
isDoubleDash = (pGC->lineStyle == LineDoubleDash);
dashOffset = pGC->dashOffset;
- data = malloc(narcs * sizeof(struct arcData));
+ data = xallocarray(narcs, sizeof(struct arcData));
if (!data)
return NULL;
- arcs = malloc(sizeof(*arcs) * (isDoubleDash ? 2 : 1));
+ arcs = xallocarray(isDoubleDash ? 2 : 1, sizeof(*arcs));
if (!arcs) {
free(data);
return NULL;
@@ -3081,8 +3080,8 @@ fillSpans(DrawablePtr pDrawable, GCPtr pGC)
if (nspans == 0)
return;
- xSpan = xSpans = malloc(nspans * sizeof(DDXPointRec));
- xWidth = xWidths = malloc(nspans * sizeof(int));
+ xSpan = xSpans = xallocarray(nspans, sizeof(DDXPointRec));
+ xWidth = xWidths = xallocarray(nspans, sizeof(int));
if (xSpans && xWidths) {
i = 0;
f = finalSpans;
@@ -3136,7 +3135,7 @@ realFindSpan(int y)
else
change = SPAN_REALLOC;
newSize = finalSize + change;
- newSpans = malloc(newSize * sizeof(struct finalSpan *));
+ newSpans = xallocarray(newSize, sizeof(struct finalSpan *));
if (!newSpans)
return NULL;
newMiny = finalMiny;
diff --git a/xserver/mi/mibitblt.c b/xserver/mi/mibitblt.c
index 724396333..28296a449 100644
--- a/xserver/mi/mibitblt.c
+++ b/xserver/mi/mibitblt.c
@@ -136,11 +136,11 @@ miCopyArea(DrawablePtr pSrcDrawable,
dsty += pDstDrawable->y;
}
- pptFirst = ppt = malloc(heightSrc * sizeof(DDXPointRec));
- pwidthFirst = pwidth = malloc(heightSrc * sizeof(unsigned int));
+ pptFirst = ppt = xallocarray(heightSrc, sizeof(DDXPointRec));
+ pwidthFirst = pwidth = xallocarray(heightSrc, sizeof(unsigned int));
numRects = RegionNumRects(prgnSrcClip);
boxes = RegionRects(prgnSrcClip);
- ordering = malloc(numRects * sizeof(unsigned int));
+ ordering = xallocarray(numRects, sizeof(unsigned int));
if (!pptFirst || !pwidthFirst || !ordering) {
free(ordering);
free(pwidthFirst);
@@ -221,7 +221,7 @@ miCopyArea(DrawablePtr pSrcDrawable,
ppt++->y = y++;
*pwidth++ = width;
}
- pbits = malloc(height * PixmapBytePad(width, pSrcDrawable->depth));
+ pbits = xallocarray(height, PixmapBytePad(width, pSrcDrawable->depth));
if (pbits) {
(*pSrcDrawable->pScreen->GetSpans) (pSrcDrawable, width, pptFirst,
(int *) pwidthFirst, height,
@@ -398,8 +398,8 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
ChangeGC(NullClient, pGCT, GCBackground, gcv);
ValidateGC((DrawablePtr) pPixmap, pGCT);
miClearDrawable((DrawablePtr) pPixmap, pGCT);
- ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = malloc(h * sizeof(int));
+ ppt = pptFirst = xallocarray(h, sizeof(DDXPointRec));
+ pwidth = pwidthFirst = xallocarray(h, sizeof(int));
if (!pptFirst || !pwidthFirst) {
free(pwidthFirst);
free(pptFirst);
@@ -746,8 +746,8 @@ miPutImage(DrawablePtr pDraw, GCPtr pGC, int depth,
break;
case ZPixmap:
- ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = malloc(h * sizeof(int));
+ ppt = pptFirst = xallocarray(h, sizeof(DDXPointRec));
+ pwidth = pwidthFirst = xallocarray(h, sizeof(int));
if (!pptFirst || !pwidthFirst) {
free(pwidthFirst);
free(pptFirst);
diff --git a/xserver/mi/micmap.c b/xserver/mi/micmap.c
index 1aeb359ba..5743adb19 100644
--- a/xserver/mi/micmap.c
+++ b/xserver/mi/micmap.c
@@ -458,9 +458,9 @@ miInitVisuals(VisualPtr * visualp, DepthPtr * depthp, int *nvisualp,
ndepth++;
nvisual += visuals->count;
}
- depth = malloc(ndepth * sizeof(DepthRec));
- visual = malloc(nvisual * sizeof(VisualRec));
- preferredCVCs = malloc(ndepth * sizeof(int));
+ depth = xallocarray(ndepth, sizeof(DepthRec));
+ visual = xallocarray(nvisual, sizeof(VisualRec));
+ preferredCVCs = xallocarray(ndepth, sizeof(int));
if (!depth || !visual || !preferredCVCs) {
free(depth);
free(visual);
@@ -481,7 +481,7 @@ miInitVisuals(VisualPtr * visualp, DepthPtr * depthp, int *nvisualp,
prefp++;
vid = NULL;
if (nvtype) {
- vid = malloc(nvtype * sizeof(VisualID));
+ vid = xallocarray(nvtype, sizeof(VisualID));
if (!vid) {
free(depth);
free(visual);
diff --git a/xserver/mi/micopy.c b/xserver/mi/micopy.c
index 2409c7880..12cdad4ad 100644
--- a/xserver/mi/micopy.c
+++ b/xserver/mi/micopy.c
@@ -62,7 +62,7 @@ miCopyRegion(DrawablePtr pSrcDrawable,
if (nbox > 1) {
/* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr) malloc(sizeof(BoxRec) * nbox);
+ pboxNew1 = xallocarray(nbox, sizeof(BoxRec));
if (!pboxNew1)
return;
pboxBase = pboxNext = pbox + nbox - 1;
@@ -93,7 +93,7 @@ miCopyRegion(DrawablePtr pSrcDrawable,
if (nbox > 1) {
/* reverse order of rects in each band */
- pboxNew2 = (BoxPtr) malloc(sizeof(BoxRec) * nbox);
+ pboxNew2 = xallocarray(nbox, sizeof(BoxRec));
if (!pboxNew2) {
free(pboxNew1);
return;
diff --git a/xserver/mi/midispcur.c b/xserver/mi/midispcur.c
index 50f0dd212..d1da0fd58 100644
--- a/xserver/mi/midispcur.c
+++ b/xserver/mi/midispcur.c
@@ -46,9 +46,7 @@ in this Software without prior written authorization from The Open Group.
#include "misprite.h"
#include "gcstruct.h"
-#ifdef ARGB_CURSOR
#include "picturestr.h"
-#endif
#include "inputstr.h"
@@ -68,9 +66,7 @@ typedef struct {
GCPtr pSourceGC, pMaskGC;
GCPtr pSaveGC, pRestoreGC;
PixmapPtr pSave;
-#ifdef ARGB_CURSOR
PicturePtr pRootPicture;
-#endif
} miDCBufferRec, *miDCBufferPtr;
#define miGetDCDevice(dev, screen) \
@@ -86,9 +82,7 @@ typedef struct {
CloseScreenProcPtr CloseScreen;
PixmapPtr sourceBits; /* source bits */
PixmapPtr maskBits; /* mask bits */
-#ifdef ARGB_CURSOR
PicturePtr pPicture;
-#endif
CursorPtr pCursor;
} miDCScreenRec, *miDCScreenPtr;
@@ -133,11 +127,9 @@ miDCSwitchScreenCursor(ScreenPtr pScreen, CursorPtr pCursor, PixmapPtr sourceBit
(*pScreen->DestroyPixmap)(pScreenPriv->maskBits);
pScreenPriv->maskBits = maskBits;
-#ifdef ARGB_CURSOR
if (pScreenPriv->pPicture)
FreePicture(pScreenPriv->pPicture, 0);
pScreenPriv->pPicture = pPicture;
-#endif
pScreenPriv->pCursor = pCursor;
}
@@ -162,7 +154,6 @@ miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
return TRUE;
}
-#ifdef ARGB_CURSOR
#define EnsurePicture(picture,draw,win) (picture || miDCMakePicture(&picture,draw,win))
static PicturePtr
@@ -182,7 +173,6 @@ miDCMakePicture(PicturePtr * ppPicture, DrawablePtr pDraw, WindowPtr pWin)
*ppPicture = pPicture;
return pPicture;
}
-#endif
static Bool
miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
@@ -195,8 +185,6 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
if (pScreenPriv->pCursor == pCursor)
return TRUE;
-#ifdef ARGB_CURSOR
-
if (pCursor->bits->argb) {
PixmapPtr pPixmap;
PictFormatPtr pFormat;
@@ -233,7 +221,7 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
miDCSwitchScreenCursor(pScreen, pCursor, NULL, NULL, pPicture);
return TRUE;
}
-#endif
+
sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
pCursor->bits->height, 1, 0);
if (!sourceBits)
@@ -373,7 +361,6 @@ miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
pWin = pScreen->root;
pBuffer = miGetDCDevice(pDev, pScreen);
-#ifdef ARGB_CURSOR
if (pScreenPriv->pPicture) {
if (!EnsurePicture(pBuffer->pRootPicture, &pWin->drawable, pWin))
return FALSE;
@@ -385,7 +372,6 @@ miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
x, y, pCursor->bits->width, pCursor->bits->height);
}
else
-#endif
{
miDCPutBits((DrawablePtr) pWin,
pBuffer->pSourceGC, pBuffer->pMaskGC,
@@ -486,9 +472,7 @@ miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
if (!pBuffer->pRestoreGC)
goto failure;
-#ifdef ARGB_CURSOR
pBuffer->pRootPicture = NULL;
-#endif
/* (re)allocated lazily depending on the cursor size */
pBuffer->pSave = NULL;
@@ -525,11 +509,9 @@ miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
if (pBuffer->pRestoreGC)
FreeGC(pBuffer->pRestoreGC, (GContext) 0);
-#ifdef ARGB_CURSOR
/* If a pRootPicture was allocated for a root window, it
* is freed when that root window is destroyed, so don't
* free it again here. */
-#endif
if (pBuffer->pSave)
(*pScreen->DestroyPixmap) (pBuffer->pSave);
diff --git a/xserver/mi/mieq.c b/xserver/mi/mieq.c
index b7be193fe..01812bdeb 100644
--- a/xserver/mi/mieq.c
+++ b/xserver/mi/mieq.c
@@ -576,14 +576,23 @@ mieqProcessInputEvents(void)
{
EventRec *e = NULL;
ScreenPtr screen;
- static InternalEvent event;
+ InternalEvent event;
DeviceIntPtr dev = NULL, master = NULL;
size_t n_enqueued;
+ static Bool inProcessInputEvents = FALSE;
#ifdef XQUARTZ
pthread_mutex_lock(&miEventQueueMutex);
#endif
+ /*
+ * report an error if mieqProcessInputEvents() is called recursively;
+ * this can happen, e.g., if something in the mieqProcessDeviceEvent()
+ * call chain calls UpdateCurrentTime() instead of UpdateCurrentTimeIf()
+ */
+ 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)) &&
@@ -642,6 +651,9 @@ mieqProcessInputEvents(void)
pthread_mutex_lock(&miEventQueueMutex);
#endif
}
+
+ inProcessInputEvents = FALSE;
+
#ifdef XQUARTZ
pthread_mutex_unlock(&miEventQueueMutex);
#endif
diff --git a/xserver/mi/miexpose.c b/xserver/mi/miexpose.c
index 3e49f15f4..148d1a63b 100644
--- a/xserver/mi/miexpose.c
+++ b/xserver/mi/miexpose.c
@@ -268,10 +268,11 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
RegionTranslate(&rgnExposed, pDstDrawable->x, pDstDrawable->y);
if (extents) {
- /* miPaintWindow doesn't clip, so we have to */
+ /* PaintWindow doesn't clip, so we have to */
RegionIntersect(&rgnExposed, &rgnExposed, &pWin->clipList);
}
- miPaintWindow((WindowPtr) pDstDrawable, &rgnExposed, PW_BACKGROUND);
+ pDstDrawable->pScreen->PaintWindow((WindowPtr) pDstDrawable,
+ &rgnExposed, PW_BACKGROUND);
if (extents) {
RegionReset(&rgnExposed, &expBox);
@@ -383,16 +384,14 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn)
* work overall, on both client and server. This is cheating, but
* isn't prohibited by the protocol ("spontaneous combustion" :-).
*/
- BoxRec box;
-
- box = *RegionExtents(prgn);
+ BoxRec box = *RegionExtents(prgn);
exposures = &expRec;
RegionInit(exposures, &box, 1);
RegionReset(prgn, &box);
/* miPaintWindow doesn't clip, so we have to */
RegionIntersect(prgn, prgn, &pWin->clipList);
}
- miPaintWindow(pWin, prgn, PW_BACKGROUND);
+ pWin->drawable.pScreen->PaintWindow(pWin, prgn, PW_BACKGROUND);
if (clientInterested)
miSendExposures(pWin, exposures,
pWin->drawable.x, pWin->drawable.y);
@@ -402,14 +401,6 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn)
}
}
-#ifdef ROOTLESS
-/* Ugly, ugly, but we lost our hooks into miPaintWindow... =/ */
-void RootlessSetPixmapOfAncestors(WindowPtr pWin);
-void RootlessStartDrawing(WindowPtr pWin);
-void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
-Bool IsFramedWindow(WindowPtr pWin);
-#endif
-
void
miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
{
@@ -437,22 +428,6 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
Bool solid = TRUE;
DrawablePtr drawable = &pWin->drawable;
-#ifdef ROOTLESS
- if (!drawable || drawable->type == UNDRAWABLE_WINDOW)
- return;
-
- if (IsFramedWindow(pWin)) {
- RootlessStartDrawing(pWin);
- RootlessDamageRegion(pWin, prgn);
-
- if (pWin->backgroundState == ParentRelative) {
- if ((what == PW_BACKGROUND) ||
- (what == PW_BORDER && !pWin->borderIsPixel))
- RootlessSetPixmapOfAncestors(pWin);
- }
- }
-#endif
-
if (what == PW_BACKGROUND) {
while (pWin->backgroundState == ParentRelative)
pWin = pWin->parent;
@@ -540,7 +515,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin;
}
- prect = malloc(RegionNumRects(prgn) * sizeof(xRectangle));
+ prect = xallocarray(RegionNumRects(prgn), sizeof(xRectangle));
if (!prect)
return;
diff --git a/xserver/mi/mifillrct.c b/xserver/mi/mifillrct.c
index 28f2322e6..eb98a779e 100644
--- a/xserver/mi/mifillrct.c
+++ b/xserver/mi/mifillrct.c
@@ -100,8 +100,8 @@ miPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, /* number of rec
maxheight = max(maxheight, prect->height);
}
- pptFirst = malloc(maxheight * sizeof(DDXPointRec));
- pwFirst = malloc(maxheight * sizeof(int));
+ pptFirst = xallocarray(maxheight, sizeof(DDXPointRec));
+ pwFirst = xallocarray(maxheight, sizeof(int));
if (!pptFirst || !pwFirst) {
free(pwFirst);
free(pptFirst);
diff --git a/xserver/mi/miglblt.c b/xserver/mi/miglblt.c
index 0183e998b..46268aee9 100644
--- a/xserver/mi/miglblt.c
+++ b/xserver/mi/miglblt.c
@@ -53,6 +53,7 @@ SOFTWARE.
#include <X11/Xproto.h>
#include "misc.h"
#include <X11/fonts/fontstruct.h>
+#include <X11/fonts/fontutil.h>
#include "dixfontstr.h"
#include "gcstruct.h"
#include "windowstr.h"
@@ -131,7 +132,7 @@ miPolyGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyp
gcvals);
nbyLine = BitmapBytePad(width);
- pbits = malloc(height * nbyLine);
+ pbits = xallocarray(height, nbyLine);
if (!pbits) {
(*pDrawable->pScreen->DestroyPixmap) (pPixmap);
FreeScratchGC(pGCtmp);
diff --git a/xserver/mi/miinitext.c b/xserver/mi/miinitext.c
index 5872bf534..5fc44e3f4 100644
--- a/xserver/mi/miinitext.c
+++ b/xserver/mi/miinitext.c
@@ -108,6 +108,9 @@ SOFTWARE.
#include "misc.h"
#include "extension.h"
#include "extinit.h"
+#ifdef INXQUARTZ
+#include "nonsdk_extinit.h"
+#endif
#include "micmap.h"
#include "globals.h"
@@ -349,8 +352,8 @@ NewExtensionModuleList(int size)
numExtensionModules = 0;
n = numExtensionModules + size;
- ExtensionModuleList = realloc(ExtensionModuleList,
- n * sizeof(ExtensionModule));
+ ExtensionModuleList = reallocarray(ExtensionModuleList, n,
+ sizeof(ExtensionModule));
if (ExtensionModuleList == NULL) {
ExtensionModuleList = save;
return NULL;
diff --git a/xserver/mi/mioverlay.c b/xserver/mi/mioverlay.c
index 2b20fd72f..b8b7a5ba8 100644
--- a/xserver/mi/mioverlay.c
+++ b/xserver/mi/mioverlay.c
@@ -844,8 +844,8 @@ miOverlayHandleExposures(WindowPtr pWin)
if ((mival = pTree->valdata)) {
if (!((*pPriv->InOverlay) (pTree->pWin))) {
if (RegionNotEmpty(&mival->borderExposed)) {
- miPaintWindow(pTree->pWin, &mival->borderExposed,
- PW_BORDER);
+ pScreen->PaintWindow(pTree->pWin, &mival->borderExposed,
+ PW_BORDER);
}
RegionUninit(&mival->borderExposed);
@@ -883,7 +883,8 @@ miOverlayHandleExposures(WindowPtr pWin)
}
else {
if (RegionNotEmpty(&val->after.borderExposed)) {
- miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER);
+ pScreen->PaintWindow(pChild, &val->after.borderExposed,
+ PW_BORDER);
}
(*WindowExposures) (pChild, &val->after.exposed);
}
@@ -982,13 +983,13 @@ static void
miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn)
{
RegionPtr exposures = prgn;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
if (prgn && !RegionNil(prgn)) {
RegionRec expRec;
int clientInterested =
(pWin->eventMask | wOtherEventMasks(pWin)) & ExposureMask;
if (clientInterested && (RegionNumRects(prgn) > RECTLIMIT)) {
- ScreenPtr pScreen = pWin->drawable.pScreen;
miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
BoxRec box;
@@ -1007,7 +1008,7 @@ miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn)
else
RegionIntersect(prgn, prgn, &pWin->clipList);
}
- miPaintWindow(pWin, prgn, PW_BACKGROUND);
+ pScreen->PaintWindow(pWin, prgn, PW_BACKGROUND);
if (clientInterested)
miSendExposures(pWin, exposures,
pWin->drawable.x, pWin->drawable.y);
@@ -1606,7 +1607,7 @@ miOverlayClearToBackground(WindowPtr pWin,
if (generateExposures)
(*pScreen->WindowExposures) (pWin, &reg);
else if (pWin->backgroundState != None)
- miPaintWindow(pWin, &reg, PW_BACKGROUND);
+ pScreen->PaintWindow(pWin, &reg, PW_BACKGROUND);
RegionUninit(&reg);
}
diff --git a/xserver/mi/mipoly.c b/xserver/mi/mipoly.c
index a332376d1..a97e2bb64 100644
--- a/xserver/mi/mipoly.c
+++ b/xserver/mi/mipoly.c
@@ -412,8 +412,8 @@ miFillConvexPoly(DrawablePtr dst, GCPtr pgc, int count, DDXPointPtr ptsIn)
dy = ymax - ymin + 1;
if ((count < 3) || (dy < 0))
return TRUE;
- ptsOut = FirstPoint = malloc(sizeof(DDXPointRec) * dy);
- width = FirstWidth = malloc(sizeof(int) * dy);
+ ptsOut = FirstPoint = xallocarray(dy, sizeof(DDXPointRec));
+ width = FirstWidth = xallocarray(dy, sizeof(int));
if (!FirstPoint || !FirstWidth) {
free(FirstWidth);
free(FirstPoint);
diff --git a/xserver/mi/mipolypnt.c b/xserver/mi/mipolypnt.c
index 4fa521d07..1c4150dfb 100644
--- a/xserver/mi/mipolypnt.c
+++ b/xserver/mi/mipolypnt.c
@@ -67,7 +67,7 @@ miPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, /* Origin or Previous */
int i;
xPoint *ppt;
- if (!(pwidthInit = malloc(npt * sizeof(int))))
+ if (!(pwidthInit = xallocarray(npt, sizeof(int))))
return;
/* make pointlist origin relative */
diff --git a/xserver/mi/mipolyrect.c b/xserver/mi/mipolyrect.c
index 830822513..7ebf9db8d 100644
--- a/xserver/mi/mipolyrect.c
+++ b/xserver/mi/mipolyrect.c
@@ -88,7 +88,7 @@ miPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nrects, xRectangle *pRects)
offset2 = pGC->lineWidth;
offset1 = offset2 >> 1;
offset3 = offset2 - offset1;
- tmp = malloc(ntmp * sizeof(xRectangle));
+ tmp = xallocarray(ntmp, sizeof(xRectangle));
if (!tmp)
return;
t = tmp;
diff --git a/xserver/mi/miscrinit.c b/xserver/mi/miscrinit.c
index b53c7e41a..9c6af0dc7 100644
--- a/xserver/mi/miscrinit.c
+++ b/xserver/mi/miscrinit.c
@@ -253,6 +253,7 @@ miScreenInit(ScreenPtr pScreen, void *pbits, /* pointer to screen bits */
pScreen->ClearToBackground = miClearToBackground;
pScreen->ClipNotify = (ClipNotifyProcPtr) 0;
pScreen->RestackWindow = (RestackWindowProcPtr) 0;
+ pScreen->PaintWindow = miPaintWindow;
/* CreatePixmap, DestroyPixmap */
/* RealizeFont, UnrealizeFont */
/* CreateGC */
diff --git a/xserver/mi/miwideline.c b/xserver/mi/miwideline.c
index 6f0b9bcbd..54de1d3e6 100644
--- a/xserver/mi/miwideline.c
+++ b/xserver/mi/miwideline.c
@@ -189,19 +189,16 @@ miSubtractSpans(SpanGroup * spanGroup, Spans * sub)
int *newwid;
#define EXTRA 8
- newPt =
- (DDXPointPtr) realloc(spans->points,
- (spans->count +
- EXTRA) *
- sizeof(DDXPointRec));
+ newPt = reallocarray(spans->points,
+ spans->count + EXTRA,
+ sizeof(DDXPointRec));
if (!newPt)
break;
spansPt = newPt + (spansPt - spans->points);
spans->points = newPt;
- newwid =
- (int *) realloc(spans->widths,
- (spans->count +
- EXTRA) * sizeof(int));
+ newwid = reallocarray(spans->widths,
+ spans->count + EXTRA,
+ sizeof(int));
if (!newwid)
break;
spansWid = newwid + (spansWid - spans->widths);
@@ -240,8 +237,8 @@ miAppendSpans(SpanGroup * spanGroup, SpanGroup * otherGroup, Spans * spans)
if (spansCount > 0) {
if (spanGroup->size == spanGroup->count) {
spanGroup->size = (spanGroup->size + 8) * 2;
- spanGroup->group = (Spans *)
- realloc(spanGroup->group, sizeof(Spans) * spanGroup->size);
+ spanGroup->group =
+ reallocarray(spanGroup->group, sizeof(Spans), spanGroup->size);
}
spanGroup->group[spanGroup->count] = *spans;
@@ -456,8 +453,8 @@ miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup)
ylength = spanGroup->ymax - ymin + 1;
/* Allocate Spans for y buckets */
- yspans = malloc(ylength * sizeof(Spans));
- ysizes = malloc(ylength * sizeof(int));
+ yspans = xallocarray(ylength, sizeof(Spans));
+ ysizes = xallocarray(ylength, sizeof(int));
if (!yspans || !ysizes) {
free(yspans);
@@ -491,12 +488,11 @@ miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup)
int *newwidths;
ysizes[index] = (ysizes[index] + 8) * 2;
- newpoints = (DDXPointPtr) realloc(newspans->points,
- ysizes[index] *
- sizeof(DDXPointRec));
- newwidths =
- (int *) realloc(newspans->widths,
- ysizes[index] * sizeof(int));
+ newpoints = reallocarray(newspans->points,
+ ysizes[index],
+ sizeof(DDXPointRec));
+ newwidths = reallocarray(newspans->widths,
+ ysizes[index], sizeof(int));
if (!newpoints || !newwidths) {
for (i = 0; i < ylength; i++) {
free(yspans[i].points);
@@ -525,8 +521,8 @@ miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup)
} /* for i thorough Spans */
/* Now sort by x and uniquify each bucket into the final array */
- points = malloc(count * sizeof(DDXPointRec));
- widths = malloc(count * sizeof(int));
+ points = xallocarray(count, sizeof(DDXPointRec));
+ widths = xallocarray(count, sizeof(int));
if (!points || !widths) {
for (i = 0; i < ylength; i++) {
free(yspans[i].points);
@@ -573,10 +569,10 @@ miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup)
static Bool
InitSpans(Spans * spans, size_t nspans)
{
- spans->points = malloc(nspans * sizeof(*spans->points));
+ spans->points = xallocarray(nspans, sizeof(*spans->points));
if (!spans->points)
return FALSE;
- spans->widths = malloc(nspans * sizeof(*spans->widths));
+ spans->widths = xallocarray(nspans, sizeof(*spans->widths));
if (!spans->widths) {
free(spans->points);
return FALSE;
diff --git a/xserver/mi/miwindow.c b/xserver/mi/miwindow.c
index a1af3a770..39c279e18 100644
--- a/xserver/mi/miwindow.c
+++ b/xserver/mi/miwindow.c
@@ -113,7 +113,7 @@ miClearToBackground(WindowPtr pWin,
if (generateExposures)
(*pWin->drawable.pScreen->WindowExposures) (pWin, &reg);
else if (pWin->backgroundState != None)
- miPaintWindow(pWin, &reg, PW_BACKGROUND);
+ pWin->drawable.pScreen->PaintWindow(pWin, &reg, PW_BACKGROUND);
RegionUninit(&reg);
}
@@ -219,7 +219,9 @@ miHandleValidateExposures(WindowPtr pWin)
while (1) {
if ((val = pChild->valdata)) {
if (RegionNotEmpty(&val->after.borderExposed))
- miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER);
+ pWin->drawable.pScreen->PaintWindow(pChild,
+ &val->after.borderExposed,
+ PW_BORDER);
RegionUninit(&val->after.borderExposed);
(*WindowExposures) (pChild, &val->after.exposed);
RegionUninit(&val->after.exposed);
@@ -767,19 +769,16 @@ miSpriteTrace(SpritePtr pSprite, int x, int y)
RegionContainsPoint(wInputShape(pWin),
x - pWin->drawable.x,
y - pWin->drawable.y, &box))
-#ifdef ROOTLESS
/* In rootless mode windows may be offscreen, even when
* they're in X's stack. (E.g. if the native window system
* implements some form of virtual desktop system).
*/
- && !pWin->rootlessUnhittable
-#endif
- ) {
+ && !pWin->unhittable) {
if (pSprite->spriteTraceGood >= pSprite->spriteTraceSize) {
pSprite->spriteTraceSize += 10;
- pSprite->spriteTrace = realloc(pSprite->spriteTrace,
- pSprite->spriteTraceSize *
- sizeof(WindowPtr));
+ pSprite->spriteTrace = reallocarray(pSprite->spriteTrace,
+ pSprite->spriteTraceSize,
+ sizeof(WindowPtr));
}
pSprite->spriteTrace[pSprite->spriteTraceGood++] = pWin;
pWin = pWin->firstChild;
diff --git a/xserver/mi/mizerarc.c b/xserver/mi/mizerarc.c
index b216cf43d..e1b5f0c18 100644
--- a/xserver/mi/mizerarc.c
+++ b/xserver/mi/mizerarc.c
@@ -671,7 +671,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
numPts = maxPts << 2;
dospans = (pGC->fillStyle != FillSolid);
if (dospans) {
- widths = malloc(sizeof(int) * numPts);
+ widths = xallocarray(numPts, sizeof(int));
if (!widths)
return;
maxw = 0;
@@ -687,7 +687,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
(unsigned char *) pGC->dash, (int) pGC->numInDashList,
&dinfo.dashOffsetInit);
}
- points = malloc(sizeof(DDXPointRec) * numPts);
+ points = xallocarray(numPts, sizeof(DDXPointRec));
if (!points) {
if (dospans) {
free(widths);
diff --git a/xserver/mi/mizerline.c b/xserver/mi/mizerline.c
index 5a2447014..2f22d2309 100644
--- a/xserver/mi/mizerline.c
+++ b/xserver/mi/mizerline.c
@@ -150,8 +150,8 @@ miZeroLine(DrawablePtr pDraw, GCPtr pGC, int mode, /* Origin or Previous */
width = xright - xleft + 1;
height = ybottom - ytop + 1;
list_len = (height >= width) ? height : width;
- pspanInit = malloc(list_len * sizeof(DDXPointRec));
- pwidthInit = malloc(list_len * sizeof(int));
+ pspanInit = xallocarray(list_len, sizeof(DDXPointRec));
+ pwidthInit = xallocarray(list_len, sizeof(int));
if (!pspanInit || !pwidthInit) {
free(pspanInit);
free(pwidthInit);
diff --git a/xserver/miext/Makefile.am b/xserver/miext/Makefile.am
index b84adc12b..add4d18b0 100644
--- a/xserver/miext/Makefile.am
+++ b/xserver/miext/Makefile.am
@@ -1,8 +1 @@
-SUBDIRS = sync damage shadow
-if XQUARTZ
-SUBDIRS += rootless
-endif
-if XWIN_MULTIWINDOWEXTWM
-SUBDIRS += rootless
-endif
-DIST_SUBDIRS = sync damage shadow rootless
+SUBDIRS = sync damage shadow rootless
diff --git a/xserver/miext/Makefile.in b/xserver/miext/Makefile.in
index d30f855ba..3dc8e93f7 100644
--- a/xserver/miext/Makefile.in
+++ b/xserver/miext/Makefile.in
@@ -49,16 +49,13 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-@XQUARTZ_TRUE@am__append_1 = rootless
-@XWIN_MULTIWINDOWEXTWM_TRUE@am__append_2 = rootless
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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -105,6 +102,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
distdir
ETAGS = etags
CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@@ -222,7 +220,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -352,8 +349,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -477,8 +472,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = sync damage shadow $(am__append_1) $(am__append_2)
-DIST_SUBDIRS = sync damage shadow rootless
+SUBDIRS = sync damage shadow rootless
all: all-recursive
.SUFFIXES:
diff --git a/xserver/miext/damage/Makefile.in b/xserver/miext/damage/Makefile.in
index 504b9102b..5c3a9aa48 100644
--- a/xserver/miext/damage/Makefile.in
+++ b/xserver/miext/damage/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -246,7 +245,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -376,8 +374,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/miext/damage/damage.c b/xserver/miext/damage/damage.c
index 6ef7f9dfc..746e7984f 100644
--- a/xserver/miext/damage/damage.c
+++ b/xserver/miext/damage/damage.c
@@ -32,6 +32,7 @@
#include <X11/fonts/font.h>
#include "dixfontstr.h"
#include <X11/fonts/fontstruct.h>
+#include <X11/fonts/fontutil.h>
#include "mi.h"
#include "regionstr.h"
#include "globals.h"
@@ -1293,7 +1294,7 @@ damageText(DrawablePtr pDrawable,
if (!checkGCDamage(pDrawable, pGC))
return;
- charinfo = malloc(count * sizeof(CharInfoPtr));
+ charinfo = xallocarray(count, sizeof(CharInfoPtr));
if (!charinfo)
return;
diff --git a/xserver/miext/rootless/Makefile.in b/xserver/miext/rootless/Makefile.in
index ba943de82..b0e2029ad 100644
--- a/xserver/miext/rootless/Makefile.in
+++ b/xserver/miext/rootless/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -216,7 +215,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -346,8 +344,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/miext/rootless/rootlessCommon.h b/xserver/miext/rootless/rootlessCommon.h
index 7fdea22b3..c3fa2a297 100644
--- a/xserver/miext/rootless/rootlessCommon.h
+++ b/xserver/miext/rootless/rootlessCommon.h
@@ -94,6 +94,7 @@ typedef struct _RootlessScreenRec {
ChangeBorderWidthProcPtr ChangeBorderWidth;
PositionWindowProcPtr PositionWindow;
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ PaintWindowProcPtr PaintWindow;
CreateGCProcPtr CreateGC;
CopyWindowProcPtr CopyWindow;
diff --git a/xserver/miext/rootless/rootlessConfig.h b/xserver/miext/rootless/rootlessConfig.h
index d39ae63d2..4c464b9f5 100644
--- a/xserver/miext/rootless/rootlessConfig.h
+++ b/xserver/miext/rootless/rootlessConfig.h
@@ -35,28 +35,17 @@
#define _ROOTLESSCONFIG_H
#ifdef __APPLE__
+#define ROOTLESS_RESIZE_GRAVITY TRUE
+#endif
+
+/*# define ROOTLESSDEBUG*/
#define ROOTLESS_PROTECT_ALPHA TRUE
#define ROOTLESS_REDISPLAY_DELAY 10
-#define ROOTLESS_RESIZE_GRAVITY TRUE
-/*# define ROOTLESSDEBUG*/
/* Bit mask for alpha channel with a particular number of bits per
pixel. Note that we only care for 32bpp data. Mac OS X uses planar
alpha for 16bpp. */
#define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0)
-#endif /* __APPLE__ */
-
-#if defined(__CYGWIN__) || defined(WIN32)
-
-#define ROOTLESS_PROTECT_ALPHA NO
-#define ROOTLESS_REDISPLAY_DELAY 10
-#undef ROOTLESS_RESIZE_GRAVITY
-/*# define ROOTLESSDEBUG*/
-
-#define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0)
-
-#endif /* __CYGWIN__ */
-
#endif /* _ROOTLESSCONFIG_H */
diff --git a/xserver/miext/rootless/rootlessScreen.c b/xserver/miext/rootless/rootlessScreen.c
index 6226ee84a..471656428 100644
--- a/xserver/miext/rootless/rootlessScreen.c
+++ b/xserver/miext/rootless/rootlessScreen.c
@@ -473,7 +473,7 @@ expose_1(WindowPtr pWin)
if (!pWin->realized)
return;
- miPaintWindow(pWin, &pWin->borderClip, PW_BACKGROUND);
+ pWin->drawable.pScreen->PaintWindow(pWin, &pWin->borderClip, PW_BACKGROUND);
/* FIXME: comments in windowstr.h indicate that borderClip doesn't
include subwindow visibility. But I'm not so sure.. so we may
@@ -669,6 +669,7 @@ RootlessWrap(ScreenPtr pScreen)
WRAP(CloseScreen);
WRAP(CreateGC);
WRAP(CopyWindow);
+ WRAP(PaintWindow);
WRAP(GetImage);
WRAP(SourceValidate);
WRAP(CreateWindow);
diff --git a/xserver/miext/rootless/rootlessWindow.c b/xserver/miext/rootless/rootlessWindow.c
index a8f296a39..e3042990c 100644
--- a/xserver/miext/rootless/rootlessWindow.c
+++ b/xserver/miext/rootless/rootlessWindow.c
@@ -92,7 +92,7 @@ RootlessNativeWindowStateChanged(WindowPtr pWin, unsigned int state)
winRec->is_offscreen = ((state & XP_WINDOW_STATE_OFFSCREEN) != 0);
winRec->is_obscured = ((state & XP_WINDOW_STATE_OBSCURED) != 0);
- pWin->rootlessUnhittable = winRec->is_offscreen;
+ pWin->unhittable = winRec->is_offscreen;
}
void
@@ -569,7 +569,7 @@ RootlessReorderWindow(WindowPtr pWin)
newPrevW = pWin->prevSib;
while (newPrevW &&
(WINREC(newPrevW) == NULL || !newPrevW->realized ||
- newPrevW->rootlessUnhittable != pWin->rootlessUnhittable))
+ newPrevW->unhittable != pWin->unhittable))
newPrevW = newPrevW->prevSib;
newPrev = newPrevW != NULL ? WINREC(newPrevW) : NULL;
@@ -720,7 +720,7 @@ RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
/*
* RootlessCopyWindow
* Update *new* location of window. Old location is redrawn with
- * miPaintWindow. Cloned from fbCopyWindow.
+ * PaintWindow. Cloned from fbCopyWindow.
* The original always draws on the root pixmap, which we don't have.
* Instead, draw on the parent window's pixmap.
*/
@@ -794,6 +794,27 @@ RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
RL_DEBUG_MSG("copywindowFB end\n");
}
+void
+RootlessPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+
+ if (IsFramedWindow(pWin)) {
+ RootlessStartDrawing(pWin);
+ RootlessDamageRegion(pWin, prgn);
+
+ if (pWin->backgroundState == ParentRelative) {
+ if ((what == PW_BACKGROUND) ||
+ (what == PW_BORDER && !pWin->borderIsPixel))
+ RootlessSetPixmapOfAncestors(pWin);
+ }
+ }
+
+ SCREEN_UNWRAP(pScreen, PaintWindow);
+ pScreen->PaintWindow(pWin, prgn, what);
+ SCREEN_WRAP(pScreen, PaintWindow);
+}
+
/*
* Window resize procedures
*/
@@ -949,7 +970,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
copy_rect_width = copy_rect.x2 - copy_rect.x1;
copy_rect_height = copy_rect.y2 - copy_rect.y1;
copy_rowbytes = ((copy_rect_width * Bpp) + 31) & ~31;
- gResizeDeathBits = malloc(copy_rowbytes * copy_rect_height);
+ gResizeDeathBits = xallocarray(copy_rowbytes, copy_rect_height);
if (copy_rect_width * copy_rect_height >
rootless_CopyBytes_threshold &&
@@ -998,7 +1019,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
RootlessStartDrawing(pWin);
- gResizeDeathBits = malloc(winRec->bytesPerRow * winRec->height);
+ gResizeDeathBits = xallocarray(winRec->bytesPerRow, winRec->height);
memcpy(gResizeDeathBits, winRec->pixelData,
winRec->bytesPerRow * winRec->height);
@@ -1365,7 +1386,7 @@ RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
pTopWin = TopLevelParent(pWin);
assert(pTopWin != pWin);
- pWin->rootlessUnhittable = FALSE;
+ pWin->unhittable = FALSE;
DeleteProperty(serverClient, pWin, xa_native_window_id());
@@ -1503,7 +1524,7 @@ RootlessOrderAllWindows(Bool include_unhitable)
continue;
if (RootlessEnsureFrame(pWin) == NULL)
continue;
- if (!include_unhitable && pWin->rootlessUnhittable)
+ if (!include_unhitable && pWin->unhittable)
continue;
RootlessReorderWindow(pWin);
}
diff --git a/xserver/miext/rootless/rootlessWindow.h b/xserver/miext/rootless/rootlessWindow.h
index d3955fc89..4fd34d54d 100644
--- a/xserver/miext/rootless/rootlessWindow.h
+++ b/xserver/miext/rootless/rootlessWindow.h
@@ -48,6 +48,7 @@ Bool RootlessUnrealizeWindow(WindowPtr pWin);
void RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib);
void RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
RegionPtr prgnSrc);
+void RootlessPaintWindow(WindowPtr pWin, RegionPtr prgn, int what);
void RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib,
VTKind kind);
void RootlessResizeWindow(WindowPtr pWin, int x, int y, unsigned int w,
diff --git a/xserver/miext/shadow/Makefile.in b/xserver/miext/shadow/Makefile.in
index 8fb172bad..1fe16b504 100644
--- a/xserver/miext/shadow/Makefile.in
+++ b/xserver/miext/shadow/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -252,7 +251,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -382,8 +380,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/miext/shadow/shalloc.c b/xserver/miext/shadow/shalloc.c
index e555135b9..6a79085c4 100644
--- a/xserver/miext/shadow/shalloc.c
+++ b/xserver/miext/shadow/shalloc.c
@@ -44,6 +44,6 @@ shadowAlloc(int width, int height, int bpp)
/* Cant use PixmapBytePad -- the structure is probably not initialized yet */
stride = BitmapBytePad(width * bpp);
- fb = malloc(stride * height);
+ fb = xallocarray(stride, height);
return fb;
}
diff --git a/xserver/miext/sync/Makefile.in b/xserver/miext/sync/Makefile.in
index b41a813ac..be3cab391 100644
--- a/xserver/miext/sync/Makefile.in
+++ b/xserver/miext/sync/Makefile.in
@@ -59,8 +59,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -251,7 +250,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -381,8 +379,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/os/Makefile.in b/xserver/os/Makefile.in
index 17e0fded7..e99805462 100644
--- a/xserver/os/Makefile.in
+++ b/xserver/os/Makefile.in
@@ -60,14 +60,13 @@ host_triplet = @host@
@SPECIAL_DTRACE_OBJECTS_TRUE@noinst_PROGRAMS = os.O$(EXEEXT)
subdir = os
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(top_srcdir)/depcomp strcasecmp.c strcasestr.c strlcat.c \
- strlcpy.c strndup.c
+ $(top_srcdir)/depcomp reallocarray.c strcasecmp.c strcasestr.c \
+ strlcat.c strlcpy.c strndup.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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -248,7 +247,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -378,8 +376,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -585,6 +581,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/reallocarray.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasestr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strlcat.Plo@am__quote@
diff --git a/xserver/os/access.c b/xserver/os/access.c
index 75e7a6983..2499a9f12 100644
--- a/xserver/os/access.c
+++ b/xserver/os/access.c
@@ -1221,7 +1221,6 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec ** lccp)
#endif
#else
/* No system call available to get the credentials of the peer */
-#define NO_LOCAL_CLIENT_CRED
return -1;
#endif
}
@@ -1575,6 +1574,20 @@ GetAccessControl(void)
return AccessEnabled;
}
+int
+GetClientFd(ClientPtr client)
+{
+ return ((OsCommPtr) client->osPrivate)->fd;
+}
+
+Bool
+ClientIsLocal(ClientPtr client)
+{
+ XtransConnInfo ci = ((OsCommPtr) client->osPrivate)->trans_conn;
+
+ return _XSERVTransIsLocal(ci);
+}
+
/*****************************************************************************
* FamilyServerInterpreted host entry implementation
*
diff --git a/xserver/os/connection.c b/xserver/os/connection.c
index 52b4d760d..e2c765ca4 100644
--- a/xserver/os/connection.c
+++ b/xserver/os/connection.c
@@ -161,9 +161,9 @@ int *ConnectionTranslation = NULL;
*/
#undef MAXSOCKS
-#define MAXSOCKS 500
+#define MAXSOCKS 512
#undef MAXSELECT
-#define MAXSELECT 500
+#define MAXSELECT 512
struct _ct_node {
struct _ct_node *next;
@@ -299,7 +299,7 @@ InitConnectionLimits(void)
if (lastfdesc > MAXCLIENTS) {
lastfdesc = MAXCLIENTS;
if (debug_conns)
- ErrorF("REACHED MAXIMUM CLIENTS LIMIT %d\n", MAXCLIENTS);
+ ErrorF("REACHED MAXIMUM CLIENTS LIMIT %d\n", LimitClients);
}
MaxClients = lastfdesc;
@@ -309,7 +309,7 @@ InitConnectionLimits(void)
#if !defined(WIN32)
if (!ConnectionTranslation)
- ConnectionTranslation = (int *) xnfalloc(sizeof(int) * (lastfdesc + 1));
+ ConnectionTranslation = xnfallocarray(lastfdesc + 1, sizeof(int));
#else
InitConnectionTranslation();
#endif
@@ -434,9 +434,12 @@ CreateWellKnownSockets(void)
FatalError("Failed to find a socket to listen on");
snprintf(dynamic_display, sizeof(dynamic_display), "%d", i);
display = dynamic_display;
+ LogSetDisplay();
}
- ListenTransFds = malloc(ListenTransCount * sizeof (int));
+ ListenTransFds = xallocarray(ListenTransCount, sizeof (int));
+ if (ListenTransFds == NULL)
+ FatalError ("Failed to create listening socket array");
for (i = 0; i < ListenTransCount; i++) {
int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]);
@@ -1298,11 +1301,10 @@ ListenOnOpenFD(int fd, int noxauth)
/* Allocate space to store it */
ListenTransFds =
- (int *) realloc(ListenTransFds, (ListenTransCount + 1) * sizeof(int));
+ xnfreallocarray(ListenTransFds, ListenTransCount + 1, sizeof(int));
ListenTransConns =
- (XtransConnInfo *) realloc(ListenTransConns,
- (ListenTransCount +
- 1) * sizeof(XtransConnInfo));
+ xnfreallocarray(ListenTransConns, ListenTransCount + 1,
+ sizeof(XtransConnInfo));
/* Store it */
ListenTransConns[ListenTransCount] = ciptr;
diff --git a/xserver/os/log.c b/xserver/os/log.c
index 3db5c5333..91e55a532 100644
--- a/xserver/os/log.c
+++ b/xserver/os/log.c
@@ -85,6 +85,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <sys/stat.h>
#include <stdarg.h>
#include <stdlib.h> /* for malloc() */
+#include <errno.h>
#include "input.h"
#include "site.h"
@@ -181,16 +182,64 @@ strlen_sigsafe(const char *s)
}
/*
+ * LogFilePrep is called to setup files for logging, including getting
+ * an old file out of the way, but it doesn't actually open the file,
+ * since it may be used for renaming a file we're already logging to.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+
+static char *
+LogFilePrep(const char *fname, const char *backup, const char *idstring)
+{
+ char *logFileName = NULL;
+
+ if (asprintf(&logFileName, fname, idstring) == -1)
+ FatalError("Cannot allocate space for the log file name\n");
+
+ if (backup && *backup) {
+ struct stat buf;
+
+ if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) {
+ char *suffix;
+ char *oldLog;
+
+ if ((asprintf(&suffix, backup, idstring) == -1) ||
+ (asprintf(&oldLog, "%s%s", logFileName, suffix) == -1)) {
+ FatalError("Cannot allocate space for the log file name\n");
+ }
+ free(suffix);
+
+ if (rename(logFileName, oldLog) == -1) {
+ FatalError("Cannot move old log file \"%s\" to \"%s\"\n",
+ logFileName, oldLog);
+ }
+ free(oldLog);
+ }
+ }
+ else {
+ if (remove(logFileName) != 0 && errno != ENOENT) {
+ FatalError("Cannot remove old log file \"%s\": %s\n",
+ logFileName, strerror(errno));
+ }
+ }
+
+ return logFileName;
+}
+#pragma GCC diagnostic pop
+
+/*
* LogInit is called to start logging to a file. It is also called (with
* NULL arguments) when logging to a file is not wanted. It must always be
* called, otherwise log messages will continue to accumulate in a buffer.
*
* %s, if present in the fname or backup strings, is expanded to the display
- * string.
+ * string (or to a string containing the pid if the display is not yet set).
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+static char *saved_log_fname;
+static char *saved_log_backup;
+static char *saved_log_tempname;
const char *
LogInit(const char *fname, const char *backup)
@@ -198,30 +247,22 @@ LogInit(const char *fname, const char *backup)
char *logFileName = NULL;
if (fname && *fname) {
- if (asprintf(&logFileName, fname, display) == -1)
- FatalError("Cannot allocate space for the log file name\n");
-
- if (backup && *backup) {
- struct stat buf;
-
- if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) {
- char *suffix;
- char *oldLog;
-
- if ((asprintf(&suffix, backup, display) == -1) ||
- (asprintf(&oldLog, "%s%s", logFileName, suffix) == -1))
- FatalError("Cannot allocate space for the log file name\n");
- free(suffix);
- if (rename(logFileName, oldLog) == -1) {
- FatalError("Cannot move old log file \"%s\" to \"%s\"\n",
- logFileName, oldLog);
- }
- free(oldLog);
- }
- }
- else {
- unlink(logFileName);
- }
+ if (displayfd != -1) {
+ /* Display isn't set yet, so we can't use it in filenames yet. */
+ char pidstring[32];
+ snprintf(pidstring, sizeof(pidstring), "pid-%ld",
+ (unsigned long) getpid());
+ logFileName = LogFilePrep(fname, backup, pidstring);
+ saved_log_tempname = logFileName;
+
+ /* Save the patterns for use when the display is named. */
+ saved_log_fname = strdup(fname);
+ if (backup == NULL)
+ saved_log_backup = NULL;
+ else
+ saved_log_backup = strdup(backup);
+ } else
+ logFileName = LogFilePrep(fname, backup, display);
if ((logFile = fopen(logFileName, "w")) == NULL)
FatalError("Cannot open log file \"%s\"\n", logFileName);
setvbuf(logFile, NULL, _IONBF, 0);
@@ -251,7 +292,36 @@ LogInit(const char *fname, const char *backup)
return logFileName;
}
-#pragma GCC diagnostic pop
+
+void
+LogSetDisplay(void)
+{
+ if (saved_log_fname) {
+ char *logFileName;
+
+ logFileName = LogFilePrep(saved_log_fname, saved_log_backup, display);
+
+ if (rename(saved_log_tempname, logFileName) == 0) {
+ LogMessageVerb(X_PROBED, 0,
+ "Log file renamed from \"%s\" to \"%s\"\n",
+ saved_log_tempname, logFileName);
+
+ if (strlen(saved_log_tempname) >= strlen(logFileName))
+ strncpy(saved_log_tempname, logFileName,
+ strlen(saved_log_tempname));
+ }
+ else {
+ ErrorF("Failed to rename log file \"%s\" to \"%s\": %s\n",
+ saved_log_tempname, logFileName, strerror(errno));
+ }
+
+ /* free newly allocated string - can't free old one since existing
+ pointers to it may exist in DDX callers. */
+ free(logFileName);
+ free(saved_log_fname);
+ free(saved_log_backup);
+ }
+}
void
LogClose(enum ExitCode error)
diff --git a/xserver/os/osdep.h b/xserver/os/osdep.h
index 851136f01..2e3614f2d 100644
--- a/xserver/os/osdep.h
+++ b/xserver/os/osdep.h
@@ -65,17 +65,17 @@ SOFTWARE.
#ifndef OPEN_MAX
#ifdef SVR4
-#define OPEN_MAX 256
+#define OPEN_MAX 512
#else
#include <sys/param.h>
#ifndef OPEN_MAX
#if defined(NOFILE) && !defined(NOFILES_MAX)
#define OPEN_MAX NOFILE
#else
-#if !defined(WIN32)
+#if !defined(WIN32) || defined(__CYGWIN__)
#define OPEN_MAX NOFILES_MAX
#else
-#define OPEN_MAX 256
+#define OPEN_MAX 512
#endif
#endif
#endif
@@ -89,10 +89,10 @@ SOFTWARE.
* like sysconf(_SC_OPEN_MAX) is not supported.
*/
-#if OPEN_MAX <= 256
+#if OPEN_MAX <= 512
#define MAXSOCKS (OPEN_MAX - 1)
#else
-#define MAXSOCKS 256
+#define MAXSOCKS 512
#endif
/* MAXSELECT is the number of fds that select() can handle */
@@ -171,7 +171,7 @@ extern fd_set ClientsWriteBlocked;
extern fd_set OutputPending;
extern fd_set IgnoredClientsWithInput;
-#ifndef WIN32
+#if !defined(WIN32) || defined(__CYGWIN__)
extern int *ConnectionTranslation;
#else
extern int GetConnectionTranslation(int conn);
@@ -185,7 +185,7 @@ extern Bool AnyClientsWriteBlocked;
extern WorkQueuePtr workQueue;
/* in WaitFor.c */
-#ifdef WIN32
+#if defined(WIN32) && !defined(__CYGWIN__)
typedef long int fd_mask;
#endif
#define ffs mffs
diff --git a/xserver/os/osinit.c b/xserver/os/osinit.c
index 9e7797bd3..b7a27210c 100644
--- a/xserver/os/osinit.c
+++ b/xserver/os/osinit.c
@@ -86,6 +86,9 @@ int limitStackSpace = -1;
int limitNoFile = -1;
#endif
+/* The actual user defined max number of clients */
+int LimitClients = LIMITCLIENTS;
+
static OsSigWrapperPtr OsSigWrapper = NULL;
OsSigWrapperPtr
@@ -155,8 +158,10 @@ void
OsInit(void)
{
static Bool been_here = FALSE;
+#ifndef XQUARTZ
static const char *devnull = "/dev/null";
char fname[PATH_MAX];
+#endif
if (!been_here) {
#if !defined(WIN32) || defined(__CYGWIN__)
diff --git a/xserver/os/reallocarray.c b/xserver/os/reallocarray.c
new file mode 100644
index 000000000..bb044b13a
--- /dev/null
+++ b/xserver/os/reallocarray.c
@@ -0,0 +1,43 @@
+/* $OpenBSD: reallocarray.c,v 1.1 2016/05/29 12:02:40 matthieu Exp $ */
+/*
+ * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, 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 <sys/types.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include "os.h"
+
+/*
+ * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
+ * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
+ */
+#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
+
+void *
+reallocarray(void *optr, size_t nmemb, size_t size)
+{
+ if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
+ nmemb > 0 && SIZE_MAX / nmemb < size) {
+ errno = ENOMEM;
+ return NULL;
+ }
+ return realloc(optr, size * nmemb);
+}
diff --git a/xserver/os/utils.c b/xserver/os/utils.c
index 4e3434955..d5a6eccc0 100644
--- a/xserver/os/utils.c
+++ b/xserver/os/utils.c
@@ -81,6 +81,7 @@ __stdcall unsigned long GetTickCount(void);
#include <X11/Xtrans/Xtrans.h>
#include "input.h"
#include "dixfont.h"
+#include <X11/fonts/fontutil.h>
#include "osdep.h"
#include "extension.h"
#ifdef X_POSIX_C_SOURCE
@@ -568,6 +569,7 @@ UseMsg(void)
#ifdef LOCK_SERVER
ErrorF("-nolock disable the locking mechanism\n");
#endif
+ ErrorF("-maxclients n set maximum number of clients (power of two)\n");
ErrorF("-nolisten string don't listen on protocol\n");
ErrorF("-listen string listen on protocol\n");
ErrorF("-noreset don't reset after last client exists\n");
@@ -876,6 +878,19 @@ ProcessCommandLine(int argc, char *argv[])
nolock = TRUE;
}
#endif
+ else if ( strcmp( argv[i], "-maxclients") == 0)
+ {
+ if (++i < argc) {
+ LimitClients = atoi(argv[i]);
+ if (LimitClients != 64 &&
+ LimitClients != 128 &&
+ LimitClients != 256 &&
+ LimitClients != 512) {
+ FatalError("maxclients must be one of 64, 128, 256 or 512\n");
+ }
+ } else
+ UseMsg();
+ }
else if (strcmp(argv[i], "-nolisten") == 0) {
if (++i < argc) {
if (_XSERVTransNoListen(argv[i]))
@@ -1149,10 +1164,20 @@ XNFalloc(unsigned long amount)
return ptr;
}
+/* The original XNFcalloc was used with the xnfcalloc macro which multiplied
+ * the arguments at the call site without allowing calloc to check for overflow.
+ * XNFcallocarray was added to fix that without breaking ABI.
+ */
void *
XNFcalloc(unsigned long amount)
{
- void *ret = calloc(1, amount);
+ return XNFcallocarray(1, amount);
+}
+
+void *
+XNFcallocarray(size_t nmemb, size_t size)
+{
+ void *ret = calloc(nmemb, size);
if (!ret)
FatalError("XNFcalloc: Out of memory");
@@ -1169,6 +1194,16 @@ XNFrealloc(void *ptr, unsigned long amount)
return ret;
}
+void *
+XNFreallocarray(void *ptr, size_t nmemb, size_t size)
+{
+ void *ret = reallocarray(ptr, nmemb, size);
+
+ if (!ret)
+ FatalError("XNFreallocarray: Out of memory");
+ return ret;
+}
+
char *
Xstrdup(const char *s)
{
@@ -1689,7 +1724,7 @@ Fclose(void *iop)
#include <X11/Xwindows.h>
const char *
-Win32TempDir()
+Win32TempDir(void)
{
static char buffer[PATH_MAX];
@@ -2030,7 +2065,7 @@ xstrtokenize(const char *str, const char *separators)
if (!tmp)
goto error;
for (tok = strtok(tmp, separators); tok; tok = strtok(NULL, separators)) {
- nlist = realloc(list, (num + 2) * sizeof(*list));
+ nlist = reallocarray(list, num + 2, sizeof(*list));
if (!nlist)
goto error;
list = nlist;
diff --git a/xserver/present/Makefile.in b/xserver/present/Makefile.in
index 6422e7552..8a29788fc 100644
--- a/xserver/present/Makefile.in
+++ b/xserver/present/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -247,7 +246,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -377,8 +375,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/present/present.c b/xserver/present/present.c
index beb4ff03a..105e2bf47 100644
--- a/xserver/present/present.c
+++ b/xserver/present/present.c
@@ -46,6 +46,28 @@ static void
present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
/*
+ * Returns:
+ * TRUE if the first MSC value is after the second one
+ * FALSE if the first MSC value is equal to or before the second one
+ */
+static Bool
+msc_is_after(uint64_t test, uint64_t reference)
+{
+ return (int64_t)(test - reference) > 0;
+}
+
+/*
+ * Returns:
+ * TRUE if the first MSC value is equal to or after the second one
+ * FALSE if the first MSC value is before the second one
+ */
+static Bool
+msc_is_equal_or_after(uint64_t test, uint64_t reference)
+{
+ return (int64_t)(test - reference) >= 0;
+}
+
+/*
* Copies the update region from a pixmap to the target drawable
*/
static void
@@ -122,6 +144,10 @@ present_check_flip(RRCrtcPtr crtc,
if (!screen_priv->info->flip)
return FALSE;
+ /* Fail to flip if we have slave outputs */
+ if (!xorg_list_is_empty(&screen->output_slave_list))
+ return FALSE;
+
/* Make sure the window hasn't been redirected with Composite */
window_pixmap = screen->GetWindowPixmap(window);
if (window_pixmap != screen->GetScreenPixmap(screen) &&
@@ -374,12 +400,17 @@ present_set_tree_pixmap_visit(WindowPtr window, void *data)
}
static void
-present_set_tree_pixmap(WindowPtr window, PixmapPtr pixmap)
+present_set_tree_pixmap(WindowPtr window,
+ PixmapPtr expected,
+ PixmapPtr pixmap)
{
struct pixmap_visit visit;
ScreenPtr screen = window->drawable.pScreen;
visit.old = (*screen->GetWindowPixmap)(window);
+ if (expected && visit.old != expected)
+ return;
+
visit.new = pixmap;
if (visit.old == visit.new)
return;
@@ -387,20 +418,44 @@ present_set_tree_pixmap(WindowPtr window, PixmapPtr pixmap)
}
static void
-present_set_abort_flip(ScreenPtr screen)
+present_restore_screen_pixmap(ScreenPtr screen)
{
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+ PixmapPtr screen_pixmap = (*screen->GetScreenPixmap)(screen);
+ PixmapPtr flip_pixmap;
+ WindowPtr flip_window;
+
+ if (screen_priv->flip_pending) {
+ flip_window = screen_priv->flip_pending->window;
+ flip_pixmap = screen_priv->flip_pending->pixmap;
+ } else {
+ flip_window = screen_priv->flip_window;
+ flip_pixmap = screen_priv->flip_pixmap;
+ }
+
+ assert (flip_pixmap);
+
+ /* Update the screen pixmap with the current flip pixmap contents
+ * 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)
+ present_copy_region(&screen_pixmap->drawable, flip_pixmap, NULL, 0, 0);
/* Switch back to using the screen pixmap now to avoid
* 2D applications drawing to the wrong pixmap.
*/
+ if (flip_window)
+ present_set_tree_pixmap(flip_window, flip_pixmap, screen_pixmap);
+ present_set_tree_pixmap(screen->root, NULL, screen_pixmap);
+}
- if (screen_priv->flip_window)
- present_set_tree_pixmap(screen_priv->flip_window,
- (*screen->GetScreenPixmap)(screen));
+static void
+present_set_abort_flip(ScreenPtr screen)
+{
+ present_screen_priv_ptr screen_priv = present_screen_priv(screen);
- if (screen->root)
- present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen));
+ present_restore_screen_pixmap(screen);
screen_priv->flip_pending->abort_flip = TRUE;
}
@@ -409,23 +464,12 @@ static void
present_unflip(ScreenPtr screen)
{
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
- PixmapPtr pixmap = (*screen->GetScreenPixmap)(screen);
assert (!screen_priv->unflip_event_id);
assert (!screen_priv->flip_pending);
- if (screen_priv->flip_window)
- present_set_tree_pixmap(screen_priv->flip_window, pixmap);
-
- present_set_tree_pixmap(screen->root, pixmap);
+ present_restore_screen_pixmap(screen);
- /* Update the screen pixmap with the current flip pixmap contents
- */
- if (screen_priv->flip_pixmap && screen_priv->flip_window) {
- present_copy_region(&pixmap->drawable,
- screen_priv->flip_pixmap,
- NULL, 0, 0);
- }
screen_priv->unflip_event_id = ++present_event_id;
DebugPresent(("u %lld\n", screen_priv->unflip_event_id));
(*screen_priv->info->unflip) (screen, screen_priv->unflip_event_id);
@@ -453,6 +497,7 @@ present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
screen_priv->flip_window = vblank->window;
screen_priv->flip_serial = vblank->serial;
screen_priv->flip_pixmap = vblank->pixmap;
+ screen_priv->flip_sync = vblank->sync_flip;
screen_priv->flip_idle_fence = vblank->idle_fence;
vblank->pixmap = NULL;
@@ -541,15 +586,18 @@ present_check_flip_window (WindowPtr window)
* Check current flip
*/
if (window == screen_priv->flip_window) {
- if (!present_check_flip(screen_priv->flip_crtc, window, screen_priv->flip_pixmap, FALSE, NULL, 0, 0))
+ if (!present_check_flip(screen_priv->flip_crtc, window, screen_priv->flip_pixmap, screen_priv->flip_sync, NULL, 0, 0))
present_unflip(screen);
}
}
/* Now check any queued vblanks */
xorg_list_for_each_entry(vblank, &window_priv->vblank, window_list) {
- if (vblank->queued && vblank->flip && !present_check_flip(vblank->crtc, window, vblank->pixmap, FALSE, NULL, 0, 0))
+ if (vblank->queued && vblank->flip && !present_check_flip(vblank->crtc, window, vblank->pixmap, vblank->sync_flip, NULL, 0, 0)) {
vblank->flip = FALSE;
+ if (vblank->sync_flip)
+ vblank->requeue = TRUE;
+ }
}
}
@@ -583,6 +631,16 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
uint8_t mode;
+ if (vblank->requeue) {
+ vblank->requeue = FALSE;
+ if (msc_is_after(vblank->target_msc, crtc_msc) &&
+ Success == present_queue_vblank(screen,
+ vblank->crtc,
+ vblank->event_id,
+ vblank->target_msc))
+ return;
+ }
+
if (vblank->wait_fence) {
if (!present_fence_check_triggered(vblank->wait_fence)) {
present_fence_set_callback(vblank->wait_fence, present_wait_fence_triggered, vblank);
@@ -629,9 +687,10 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
*/
if (screen_priv->flip_window && screen_priv->flip_window != window)
present_set_tree_pixmap(screen_priv->flip_window,
- (*screen->GetScreenPixmap)(screen));
- present_set_tree_pixmap(vblank->window, vblank->pixmap);
- present_set_tree_pixmap(screen->root, vblank->pixmap);
+ screen_priv->flip_pixmap,
+ (*screen->GetScreenPixmap)(screen));
+ present_set_tree_pixmap(vblank->window, NULL, vblank->pixmap);
+ present_set_tree_pixmap(screen->root, NULL, vblank->pixmap);
/* Report update region as damaged
*/
@@ -665,6 +724,20 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
if (window == screen_priv->flip_window)
present_unflip(screen);
}
+
+ /* If present_flip failed, we may have to requeue for the target MSC */
+ if (vblank->target_msc == crtc_msc + 1 &&
+ Success == present_queue_vblank(screen,
+ vblank->crtc,
+ vblank->event_id,
+ vblank->target_msc)) {
+ xorg_list_add(&vblank->event_queue, &present_exec_queue);
+ xorg_list_append(&vblank->window_list,
+ &present_get_window_priv(window, TRUE)->vblank);
+ vblank->queued = TRUE;
+ return;
+ }
+
present_copy_region(&window->drawable, vblank->pixmap, vblank->update, vblank->x_off, vblank->y_off);
/* present_copy_region sticks the region into a scratch GC,
@@ -746,14 +819,14 @@ present_pixmap(WindowPtr window,
/* Adjust target_msc to match modulus
*/
- if (crtc_msc >= target_msc) {
+ if (msc_is_equal_or_after(crtc_msc, target_msc)) {
if (divisor != 0) {
target_msc = crtc_msc - (crtc_msc % divisor) + remainder;
if (options & PresentOptionAsync) {
- if (target_msc < crtc_msc)
+ if (msc_is_after(crtc_msc, target_msc))
target_msc += divisor;
} else {
- if (target_msc <= crtc_msc)
+ if (msc_is_equal_or_after(crtc_msc, target_msc))
target_msc += divisor;
}
} else {
@@ -836,19 +909,20 @@ present_pixmap(WindowPtr window,
vblank->notifies = notifies;
vblank->num_notifies = num_notifies;
- if (!(options & PresentOptionAsync))
- vblank->sync_flip = TRUE;
-
- if (!(options & PresentOptionCopy) &&
- !((options & PresentOptionAsync) &&
- (!screen_priv->info ||
- !(screen_priv->info->capabilities & PresentCapabilityAsync))) &&
- pixmap != NULL &&
- present_check_flip (target_crtc, window, pixmap, vblank->sync_flip, valid, x_off, y_off))
- {
- vblank->flip = TRUE;
- if (vblank->sync_flip)
+ if (pixmap != NULL &&
+ !(options & PresentOptionCopy) &&
+ screen_priv->info) {
+ if (msc_is_after(target_msc, crtc_msc) &&
+ present_check_flip (target_crtc, window, pixmap, TRUE, valid, x_off, y_off))
+ {
+ vblank->flip = TRUE;
+ vblank->sync_flip = TRUE;
target_msc--;
+ } else if ((screen_priv->info->capabilities & PresentCapabilityAsync) &&
+ present_check_flip (target_crtc, window, pixmap, FALSE, valid, x_off, y_off))
+ {
+ vblank->flip = TRUE;
+ }
}
if (wait_fence) {
@@ -871,7 +945,7 @@ present_pixmap(WindowPtr window,
xorg_list_add(&vblank->event_queue, &present_exec_queue);
vblank->queued = TRUE;
- if ((pixmap && target_msc >= crtc_msc) || (!pixmap && target_msc > crtc_msc)) {
+ if (msc_is_after(target_msc, crtc_msc)) {
ret = present_queue_vblank(screen, target_crtc, vblank->event_id, target_msc);
if (ret == Success)
return Success;
diff --git a/xserver/present/present_event.c b/xserver/present/present_event.c
index d3a59ea25..c586c9a60 100644
--- a/xserver/present/present_event.c
+++ b/xserver/present/present_event.c
@@ -26,7 +26,7 @@
#include "present_priv.h"
-RESTYPE present_event_type;
+static RESTYPE present_event_type;
static int
present_free_event(void *data, XID id)
diff --git a/xserver/present/present_priv.h b/xserver/present/present_priv.h
index f5c1652d1..0d16cfaba 100644
--- a/xserver/present/present_priv.h
+++ b/xserver/present/present_priv.h
@@ -70,6 +70,7 @@ struct present_vblank {
present_notify_ptr notifies;
int num_notifies;
Bool queued; /* on present_exec_queue */
+ Bool requeue; /* on queue, but target_msc has changed */
Bool flip; /* planning on using flip */
Bool flip_ready; /* wants to flip, but waiting for previous flip or unflip */
Bool sync_flip; /* do flip synchronous to vblank */
@@ -93,6 +94,7 @@ typedef struct present_screen_priv {
uint32_t flip_serial;
PixmapPtr flip_pixmap;
present_fence_ptr flip_idle_fence;
+ Bool flip_sync;
present_screen_info_ptr info;
} present_screen_priv_rec, *present_screen_priv_ptr;
@@ -147,8 +149,6 @@ present_window_priv(WindowPtr window)
present_window_priv_ptr
present_get_window_priv(WindowPtr window, Bool create);
-extern RESTYPE present_event_type;
-
/*
* present.c
*/
diff --git a/xserver/present/present_request.c b/xserver/present/present_request.c
index 7c53e7262..35320b64e 100644
--- a/xserver/present/present_request.c
+++ b/xserver/present/present_request.c
@@ -234,7 +234,7 @@ proc_present_query_capabilities (ClientPtr client)
return Success;
}
-int (*proc_present_vector[PresentNumberRequests]) (ClientPtr) = {
+static int (*proc_present_vector[PresentNumberRequests]) (ClientPtr) = {
proc_present_query_version, /* 0 */
proc_present_pixmap, /* 1 */
proc_present_notify_msc, /* 2 */
@@ -319,7 +319,7 @@ sproc_present_query_capabilities (ClientPtr client)
return (*proc_present_vector[stuff->presentReqType]) (client);
}
-int (*sproc_present_vector[PresentNumberRequests]) (ClientPtr) = {
+static int (*sproc_present_vector[PresentNumberRequests]) (ClientPtr) = {
sproc_present_query_version, /* 0 */
sproc_present_pixmap, /* 1 */
sproc_present_notify_msc, /* 2 */
diff --git a/xserver/pseudoramiX/Makefile.in b/xserver/pseudoramiX/Makefile.in
index 3e2d90ade..4b5846f90 100644
--- a/xserver/pseudoramiX/Makefile.in
+++ b/xserver/pseudoramiX/Makefile.in
@@ -59,8 +59,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -217,7 +216,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -347,8 +345,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/pseudoramiX/pseudoramiX.c b/xserver/pseudoramiX/pseudoramiX.c
index f47c7836d..d8b259341 100644
--- a/xserver/pseudoramiX/pseudoramiX.c
+++ b/xserver/pseudoramiX/pseudoramiX.c
@@ -39,7 +39,7 @@
#include "pseudoramiX.h"
#include "extnsionst.h"
-#include "extinit.h"
+#include "nonsdk_extinit.h"
#include "dixstruct.h"
#include "window.h"
#include <X11/extensions/panoramiXproto.h>
@@ -49,6 +49,7 @@
#define DEBUG_LOG PseudoramiXDebug
Bool noPseudoramiXExtension = FALSE;
+extern Bool noRRXineramaExtension;
extern int
ProcPanoramiXQueryVersion(ClientPtr client);
@@ -139,9 +140,9 @@ PseudoramiXAddScreen(int x, int y, int w, int h)
if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) {
pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1;
- pseudoramiXScreens = realloc(pseudoramiXScreens,
- pseudoramiXScreensAllocated *
- sizeof(PseudoramiXScreenRec));
+ pseudoramiXScreens = reallocarray(pseudoramiXScreens,
+ pseudoramiXScreensAllocated,
+ sizeof(PseudoramiXScreenRec));
}
DEBUG_LOG("x: %d, y: %d, w: %d, h: %d\n", x, y, w, h);
@@ -190,6 +191,9 @@ PseudoramiXExtensionInit(void)
}
}
+ /* Do not allow RRXinerama to initialize if we did */
+ noRRXineramaExtension = success;
+
if (!success) {
ErrorF("%s Extension (PseudoramiX) failed to initialize\n",
PANORAMIX_PROTOCOL_NAME);
diff --git a/xserver/pseudoramiX/pseudoramiX.h b/xserver/pseudoramiX/pseudoramiX.h
index f063919dd..5393062ee 100644
--- a/xserver/pseudoramiX/pseudoramiX.h
+++ b/xserver/pseudoramiX/pseudoramiX.h
@@ -2,8 +2,6 @@
* Minimal implementation of PanoramiX/Xinerama
*/
-extern int noPseudoramiXExtension;
-
void
PseudoramiXAddScreen(int x, int y, int w, int h);
void
diff --git a/xserver/randr/Makefile.am b/xserver/randr/Makefile.am
index ccaff3f02..90dc9ec9a 100644
--- a/xserver/randr/Makefile.am
+++ b/xserver/randr/Makefile.am
@@ -15,6 +15,7 @@ librandr_la_SOURCES = \
rrdispatch.c \
rrinfo.c \
rrmode.c \
+ rrmonitor.c \
rroutput.c \
rrpointer.c \
rrproperty.c \
diff --git a/xserver/randr/Makefile.in b/xserver/randr/Makefile.in
index 6526f10e3..f356475ab 100644
--- a/xserver/randr/Makefile.in
+++ b/xserver/randr/Makefile.in
@@ -59,8 +59,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -77,14 +76,15 @@ CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
librandr_la_LIBADD =
am__librandr_la_SOURCES_DIST = randr.c randrstr.h rrcrtc.c \
- rrdispatch.c rrinfo.c rrmode.c rroutput.c rrpointer.c \
- rrproperty.c rrprovider.c rrproviderproperty.c rrscreen.c \
- rrsdispatch.c rrtransform.h rrtransform.c rrxinerama.c
+ rrdispatch.c rrinfo.c rrmode.c rrmonitor.c rroutput.c \
+ rrpointer.c rrproperty.c rrprovider.c rrproviderproperty.c \
+ rrscreen.c rrsdispatch.c rrtransform.h rrtransform.c \
+ rrxinerama.c
am__objects_1 = rrxinerama.lo
@XINERAMA_TRUE@am__objects_2 = $(am__objects_1)
am_librandr_la_OBJECTS = randr.lo rrcrtc.lo rrdispatch.lo rrinfo.lo \
- rrmode.lo rroutput.lo rrpointer.lo rrproperty.lo rrprovider.lo \
- rrproviderproperty.lo rrscreen.lo rrsdispatch.lo \
+ rrmode.lo rrmonitor.lo rroutput.lo rrpointer.lo rrproperty.lo \
+ rrprovider.lo rrproviderproperty.lo rrscreen.lo rrsdispatch.lo \
rrtransform.lo $(am__objects_2)
librandr_la_OBJECTS = $(am_librandr_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
@@ -256,7 +256,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -386,8 +385,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -516,9 +513,9 @@ AM_CFLAGS = $(DIX_CFLAGS)
XINERAMA_SRCS = rrxinerama.c
@XORG_TRUE@sdk_HEADERS = randrstr.h rrtransform.h
librandr_la_SOURCES = randr.c randrstr.h rrcrtc.c rrdispatch.c \
- rrinfo.c rrmode.c rroutput.c rrpointer.c rrproperty.c \
- rrprovider.c rrproviderproperty.c rrscreen.c rrsdispatch.c \
- rrtransform.h rrtransform.c $(am__append_1)
+ rrinfo.c rrmode.c rrmonitor.c rroutput.c rrpointer.c \
+ rrproperty.c rrprovider.c rrproviderproperty.c rrscreen.c \
+ rrsdispatch.c rrtransform.h rrtransform.c $(am__append_1)
all: all-am
.SUFFIXES:
@@ -578,6 +575,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrdispatch.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrinfo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrmode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrmonitor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rroutput.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrpointer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrproperty.Plo@am__quote@
diff --git a/xserver/randr/randr.c b/xserver/randr/randr.c
index 6e3f14b4e..ad1dda227 100644
--- a/xserver/randr/randr.c
+++ b/xserver/randr/randr.c
@@ -98,6 +98,8 @@ RRCloseScreen(ScreenPtr pScreen)
if (pScrPriv->provider)
RRProviderDestroy(pScrPriv->provider);
+ RRMonitorClose(pScreen);
+
free(pScrPriv->crtcs);
free(pScrPriv->outputs);
free(pScrPriv);
@@ -333,6 +335,8 @@ RRScreenInit(ScreenPtr pScreen)
pScrPriv->numCrtcs = 0;
pScrPriv->crtcs = NULL;
+ RRMonitorInit(pScreen);
+
RRNScreens += 1; /* keep count of screens that implement randr */
return TRUE;
}
diff --git a/xserver/randr/randrstr.h b/xserver/randr/randrstr.h
index 13e6a8596..472721a5a 100644
--- a/xserver/randr/randrstr.h
+++ b/xserver/randr/randrstr.h
@@ -64,10 +64,10 @@ typedef XID RROutput;
typedef XID RRCrtc;
typedef XID RRProvider;
-extern _X_EXPORT int RREventBase, RRErrorBase;
+extern int RREventBase, RRErrorBase;
-extern _X_EXPORT int (*ProcRandrVector[RRNumberRequests]) (ClientPtr);
-extern _X_EXPORT int (*SProcRandrVector[RRNumberRequests]) (ClientPtr);
+extern int (*ProcRandrVector[RRNumberRequests]) (ClientPtr);
+extern int (*SProcRandrVector[RRNumberRequests]) (ClientPtr);
/*
* Modeline for a monitor. Name follows directly after this struct
@@ -80,6 +80,7 @@ typedef struct _rrProperty RRPropertyRec, *RRPropertyPtr;
typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr;
typedef struct _rrOutput RROutputRec, *RROutputPtr;
typedef struct _rrProvider RRProviderRec, *RRProviderPtr;
+typedef struct _rrMonitor RRMonitorRec, *RRMonitorPtr;
struct _rrMode {
int refcnt;
@@ -169,6 +170,22 @@ struct _rrProvider {
struct _rrProvider *output_source;
};
+typedef struct _rrMonitorGeometry {
+ BoxRec box;
+ CARD32 mmWidth;
+ CARD32 mmHeight;
+} RRMonitorGeometryRec, *RRMonitorGeometryPtr;
+
+struct _rrMonitor {
+ Atom name;
+ ScreenPtr pScreen;
+ int numOutputs;
+ RROutput *outputs;
+ Bool primary;
+ Bool automatic;
+ RRMonitorGeometryRec geometry;
+};
+
#if RANDR_12_INTERFACE
typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen,
CARD16 width,
@@ -338,6 +355,9 @@ typedef struct _rrScrPriv {
RRProviderDestroyProcPtr rrProviderDestroy;
+ int numMonitors;
+ RRMonitorPtr *monitors;
+
} rrScrPrivRec, *rrScrPrivPtr;
extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;
@@ -377,8 +397,8 @@ typedef struct _RRClient {
/* RRTimesRec times[0]; */
} RRClientRec, *RRClientPtr;
-extern _X_EXPORT RESTYPE RRClientType, RREventType; /* resource types for event masks */
-extern _X_EXPORT DevPrivateKeyRec RRClientPrivateKeyRec;
+extern RESTYPE RRClientType, RREventType; /* resource types for event masks */
+extern DevPrivateKeyRec RRClientPrivateKeyRec;
#define RRClientPrivateKey (&RRClientPrivateKeyRec)
extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType;
@@ -981,6 +1001,39 @@ extern _X_EXPORT void
RRXineramaExtensionInit(void);
#endif
+void
+RRMonitorInit(ScreenPtr screen);
+
+Bool
+RRMonitorMakeList(ScreenPtr screen, Bool get_active, RRMonitorPtr *monitors_ret, int *nmon_ret);
+
+int
+RRMonitorCountList(ScreenPtr screen);
+
+void
+RRMonitorFreeList(RRMonitorPtr monitors, int nmon);
+
+void
+RRMonitorClose(ScreenPtr screen);
+
+RRMonitorPtr
+RRMonitorAlloc(int noutput);
+
+int
+RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor);
+
+void
+RRMonitorFree(RRMonitorPtr monitor);
+
+int
+ProcRRGetMonitors(ClientPtr client);
+
+int
+ProcRRSetMonitor(ClientPtr client);
+
+int
+ProcRRDeleteMonitor(ClientPtr client);
+
#endif /* _RANDRSTR_H_ */
/*
diff --git a/xserver/randr/rrcrtc.c b/xserver/randr/rrcrtc.c
index 349874514..9bc456bdc 100644
--- a/xserver/randr/rrcrtc.c
+++ b/xserver/randr/rrcrtc.c
@@ -65,8 +65,8 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate)
/* make space for the crtc pointer */
if (pScrPriv->numCrtcs)
- crtcs = realloc(pScrPriv->crtcs,
- (pScrPriv->numCrtcs + 1) * sizeof(RRCrtcPtr));
+ crtcs = reallocarray(pScrPriv->crtcs,
+ pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr));
else
crtcs = malloc(sizeof(RRCrtcPtr));
if (!crtcs)
@@ -176,10 +176,10 @@ RRCrtcNotify(RRCrtcPtr crtc,
if (numOutputs) {
if (crtc->numOutputs)
- newoutputs = realloc(crtc->outputs,
- numOutputs * sizeof(RROutputPtr));
+ newoutputs = reallocarray(crtc->outputs,
+ numOutputs, sizeof(RROutputPtr));
else
- newoutputs = malloc(numOutputs * sizeof(RROutputPtr));
+ newoutputs = xallocarray(numOutputs, sizeof(RROutputPtr));
if (!newoutputs)
return FALSE;
}
@@ -387,14 +387,14 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
static Bool
rrCreateSharedPixmap(RRCrtcPtr crtc, int width, int height,
- int x, int y)
+ int x, int y, Rotation rotation)
{
PixmapPtr mpix, spix;
ScreenPtr master = crtc->pScreen->current_master;
Bool ret;
int depth;
PixmapPtr mscreenpix;
- PixmapPtr protopix = crtc->pScreen->current_master->GetScreenPixmap(crtc->pScreen->current_master);
+ PixmapPtr protopix = master->GetScreenPixmap(master);
rrScrPriv(crtc->pScreen);
/* create a pixmap on the master screen,
@@ -434,13 +434,33 @@ rrCreateSharedPixmap(RRCrtcPtr crtc, int width, int height,
crtc->scanout_pixmap = spix;
- master->StartPixmapTracking(mscreenpix, spix, x, y);
+ master->StartPixmapTracking(mscreenpix, spix, x, y, 0, 0, rotation);
return TRUE;
}
+static void crtc_to_box(BoxPtr box, RRCrtcPtr crtc)
+{
+ box->x1 = crtc->x;
+ box->y1 = crtc->y;
+ switch (crtc->rotation) {
+ case RR_Rotate_0:
+ case RR_Rotate_180:
+ default:
+ box->x2 = crtc->x + crtc->mode->mode.width;
+ box->y2 = crtc->y + crtc->mode->mode.height;
+ break;
+ case RR_Rotate_90:
+ case RR_Rotate_270:
+ box->x2 = crtc->x + crtc->mode->mode.height;
+ box->y2 = crtc->y + crtc->mode->mode.width;
+ break;
+ }
+}
+
static Bool
rrCheckPixmapBounding(ScreenPtr pScreen,
- RRCrtcPtr rr_crtc, int x, int y, int w, int h)
+ RRCrtcPtr rr_crtc, Rotation rotation,
+ int x, int y, int w, int h)
{
RegionRec root_pixmap_region, total_region, new_crtc_region;
int c;
@@ -457,18 +477,23 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
/* have to iterate all the crtcs of the attached gpu masters
and all their output slaves */
for (c = 0; c < pScrPriv->numCrtcs; c++) {
- if (pScrPriv->crtcs[c] == rr_crtc) {
+ RRCrtcPtr crtc = pScrPriv->crtcs[c];
+
+ if (crtc == rr_crtc) {
newbox.x1 = x;
- newbox.x2 = x + w;
newbox.y1 = y;
- newbox.y2 = y + h;
+ if (rotation == RR_Rotate_90 ||
+ rotation == RR_Rotate_270) {
+ newbox.x2 = x + h;
+ newbox.y2 = y + w;
+ } else {
+ newbox.x2 = x + w;
+ newbox.y2 = y + h;
+ }
} else {
- if (!pScrPriv->crtcs[c]->mode)
+ if (!crtc->mode)
continue;
- newbox.x1 = pScrPriv->crtcs[c]->x;
- newbox.x2 = pScrPriv->crtcs[c]->x + pScrPriv->crtcs[c]->mode->mode.width;
- newbox.y1 = pScrPriv->crtcs[c]->y;
- newbox.y2 = pScrPriv->crtcs[c]->y + pScrPriv->crtcs[c]->mode->mode.height;
+ crtc_to_box(&newbox, crtc);
}
RegionInit(&new_crtc_region, &newbox, 1);
RegionUnion(&total_region, &total_region, &new_crtc_region);
@@ -477,19 +502,24 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
rrScrPrivPtr slave_priv = rrGetScrPriv(slave);
for (c = 0; c < slave_priv->numCrtcs; c++) {
- if (slave_priv->crtcs[c] == rr_crtc) {
+ RRCrtcPtr slave_crtc = slave_priv->crtcs[c];
+
+ if (slave_crtc == rr_crtc) {
newbox.x1 = x;
- newbox.x2 = x + w;
newbox.y1 = y;
- newbox.y2 = y + h;
+ if (rotation == RR_Rotate_90 ||
+ rotation == RR_Rotate_270) {
+ newbox.x2 = x + h;
+ newbox.y2 = y + w;
+ } else {
+ newbox.x2 = x + w;
+ newbox.y2 = y + h;
+ }
}
else {
- if (!slave_priv->crtcs[c]->mode)
+ if (!slave_crtc->mode)
continue;
- newbox.x1 = slave_priv->crtcs[c]->x;
- newbox.x2 = slave_priv->crtcs[c]->x + slave_priv->crtcs[c]->mode->mode.width;
- newbox.y1 = slave_priv->crtcs[c]->y;
- newbox.y2 = slave_priv->crtcs[c]->y + slave_priv->crtcs[c]->mode->mode.height;
+ crtc_to_box(&newbox, slave_crtc);
}
RegionInit(&new_crtc_region, &newbox, 1);
RegionUnion(&total_region, &total_region, &new_crtc_region);
@@ -557,12 +587,12 @@ RRCrtcSet(RRCrtcPtr crtc,
height = mode->mode.height;
}
ret = rrCheckPixmapBounding(master, crtc,
- x, y, width, height);
+ rotation, x, y, width, height);
if (!ret)
return FALSE;
if (pScreen->current_master) {
- ret = rrCreateSharedPixmap(crtc, width, height, x, y);
+ ret = rrCreateSharedPixmap(crtc, width, height, x, y, rotation);
}
}
#if RANDR_12_INTERFACE
@@ -794,7 +824,7 @@ RRCrtcGammaSetSize(RRCrtcPtr crtc, int size)
if (size == crtc->gammaSize)
return TRUE;
if (size) {
- gamma = malloc(size * 3 * sizeof(CARD16));
+ gamma = xallocarray(size, 3 * sizeof(CARD16));
if (!gamma)
return FALSE;
}
@@ -1023,7 +1053,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
return BadMatch;
}
if (numOutputs) {
- outputs = malloc(numOutputs * sizeof(RROutputPtr));
+ outputs = xallocarray(numOutputs, sizeof(RROutputPtr));
if (!outputs)
return BadAlloc;
}
@@ -1571,7 +1601,8 @@ ProcRRGetCrtcTransform(ClientPtr client)
return Success;
}
-static Bool check_all_screen_crtcs(ScreenPtr pScreen, int *x, int *y)
+static Bool
+check_all_screen_crtcs(ScreenPtr pScreen, int *x, int *y)
{
rrScrPriv(pScreen);
int i;
@@ -1591,7 +1622,8 @@ static Bool check_all_screen_crtcs(ScreenPtr pScreen, int *x, int *y)
return FALSE;
}
-static Bool constrain_all_screen_crtcs(DeviceIntPtr pDev, ScreenPtr pScreen, int *x, int *y)
+static Bool
+constrain_all_screen_crtcs(DeviceIntPtr pDev, ScreenPtr pScreen, int *x, int *y)
{
rrScrPriv(pScreen);
int i;
diff --git a/xserver/randr/rrdispatch.c b/xserver/randr/rrdispatch.c
index 7fee2bf9c..314e4ea52 100644
--- a/xserver/randr/rrdispatch.c
+++ b/xserver/randr/rrdispatch.c
@@ -256,4 +256,7 @@ int (*ProcRandrVector[RRNumberRequests]) (ClientPtr) = {
ProcRRChangeProviderProperty, /* 39 */
ProcRRDeleteProviderProperty, /* 40 */
ProcRRGetProviderProperty, /* 41 */
+ ProcRRGetMonitors, /* 42 */
+ ProcRRSetMonitor, /* 43 */
+ ProcRRDeleteMonitor, /* 44 */
};
diff --git a/xserver/randr/rrinfo.c b/xserver/randr/rrinfo.c
index fc57bd408..24245b7b6 100644
--- a/xserver/randr/rrinfo.c
+++ b/xserver/randr/rrinfo.c
@@ -55,8 +55,8 @@ RROldModeAdd(RROutputPtr output, RRScreenSizePtr size, int refresh)
}
if (output->numModes)
- modes = realloc(output->modes,
- (output->numModes + 1) * sizeof(RRModePtr));
+ modes = reallocarray(output->modes,
+ output->numModes + 1, sizeof(RRModePtr));
else
modes = malloc(sizeof(RRModePtr));
if (!modes) {
@@ -266,8 +266,8 @@ RRRegisterSize(ScreenPtr pScreen,
for (i = 0; i < pScrPriv->nSizes; i++)
if (RRScreenSizeMatches(&tmp, &pScrPriv->pSizes[i]))
return &pScrPriv->pSizes[i];
- pNew = realloc(pScrPriv->pSizes,
- (pScrPriv->nSizes + 1) * sizeof(RRScreenSize));
+ pNew = reallocarray(pScrPriv->pSizes,
+ pScrPriv->nSizes + 1, sizeof(RRScreenSize));
if (!pNew)
return 0;
pNew[pScrPriv->nSizes++] = tmp;
@@ -289,7 +289,7 @@ RRRegisterRate(ScreenPtr pScreen, RRScreenSizePtr pSize, int rate)
if (pSize->pRates[i].rate == rate)
return TRUE;
- pNew = realloc(pSize->pRates, (pSize->nRates + 1) * sizeof(RRScreenRate));
+ pNew = reallocarray(pSize->pRates, pSize->nRates + 1, sizeof(RRScreenRate));
if (!pNew)
return FALSE;
pRate = &pNew[pSize->nRates++];
diff --git a/xserver/randr/rrmode.c b/xserver/randr/rrmode.c
index befac4741..a7aa43320 100644
--- a/xserver/randr/rrmode.c
+++ b/xserver/randr/rrmode.c
@@ -79,7 +79,7 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen)
mode->userScreen = userScreen;
if (num_modes)
- newModes = realloc(modes, (num_modes + 1) * sizeof(RRModePtr));
+ newModes = reallocarray(modes, num_modes + 1, sizeof(RRModePtr));
else
newModes = malloc(sizeof(RRModePtr));
@@ -166,7 +166,7 @@ RRModesForScreen(ScreenPtr pScreen, int *num_ret)
RRModePtr *screen_modes;
int num_screen_modes = 0;
- screen_modes = malloc((num_modes ? num_modes : 1) * sizeof(RRModePtr));
+ screen_modes = xallocarray((num_modes ? num_modes : 1), sizeof(RRModePtr));
if (!screen_modes)
return NULL;
diff --git a/xserver/randr/rrmonitor.c b/xserver/randr/rrmonitor.c
new file mode 100644
index 000000000..ba310eaa4
--- /dev/null
+++ b/xserver/randr/rrmonitor.c
@@ -0,0 +1,754 @@
+/*
+ * Copyright © 2014 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.
+ */
+
+#include "randrstr.h"
+#include "swaprep.h"
+
+static Atom
+RRMonitorCrtcName(RRCrtcPtr crtc)
+{
+ char name[20];
+
+ if (crtc->numOutputs) {
+ RROutputPtr output = crtc->outputs[0];
+ return MakeAtom(output->name, output->nameLength, TRUE);
+ }
+ sprintf(name, "Monitor-%08lx", (unsigned long int)crtc->id);
+ return MakeAtom(name, strlen(name), TRUE);
+}
+
+static Bool
+RRMonitorCrtcPrimary(RRCrtcPtr crtc)
+{
+ ScreenPtr screen = crtc->pScreen;
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
+ int o;
+
+ for (o = 0; o < crtc->numOutputs; o++)
+ if (crtc->outputs[o] == pScrPriv->primaryOutput)
+ return TRUE;
+ return FALSE;
+}
+
+#define DEFAULT_PIXELS_PER_MM (96.0 / 25.4)
+
+static void
+RRMonitorGetCrtcGeometry(RRCrtcPtr crtc, RRMonitorGeometryPtr geometry)
+{
+ ScreenPtr screen = crtc->pScreen;
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
+ BoxRec panned_area;
+
+ /* Check to see if crtc is panned and return the full area when applicable. */
+ if (pScrPriv && pScrPriv->rrGetPanning &&
+ pScrPriv->rrGetPanning(screen, crtc, &panned_area, NULL, NULL) &&
+ (panned_area.x2 > panned_area.x1) &&
+ (panned_area.y2 > panned_area.y1)) {
+ geometry->box = panned_area;
+ }
+ else {
+ int width, height;
+
+ RRCrtcGetScanoutSize(crtc, &width, &height);
+ geometry->box.x1 = crtc->x;
+ geometry->box.y1 = crtc->y;
+ geometry->box.x2 = geometry->box.x1 + width;
+ geometry->box.y2 = geometry->box.y1 + height;
+ }
+ if (crtc->numOutputs && crtc->outputs[0]->mmWidth && crtc->outputs[0]->mmHeight) {
+ RROutputPtr output = crtc->outputs[0];
+ geometry->mmWidth = output->mmWidth;
+ geometry->mmHeight = output->mmHeight;
+ } else {
+ geometry->mmWidth = floor ((geometry->box.x2 - geometry->box.x1) / DEFAULT_PIXELS_PER_MM + 0.5);
+ geometry->mmHeight = floor ((geometry->box.y2 - geometry->box.y1) / DEFAULT_PIXELS_PER_MM + 0.5);
+ }
+}
+
+static Bool
+RRMonitorSetFromServer(RRCrtcPtr crtc, RRMonitorPtr monitor)
+{
+ int o;
+
+ monitor->name = RRMonitorCrtcName(crtc);
+ monitor->pScreen = crtc->pScreen;
+ monitor->numOutputs = crtc->numOutputs;
+ monitor->outputs = calloc(crtc->numOutputs, sizeof(RRCrtc));
+ if (!monitor->outputs)
+ return FALSE;
+ for (o = 0; o < crtc->numOutputs; o++)
+ monitor->outputs[o] = crtc->outputs[o]->id;
+ monitor->primary = RRMonitorCrtcPrimary(crtc);
+ monitor->automatic = TRUE;
+ RRMonitorGetCrtcGeometry(crtc, &monitor->geometry);
+ return TRUE;
+}
+
+static Bool
+RRMonitorAutomaticGeometry(RRMonitorPtr monitor)
+{
+ return (monitor->geometry.box.x1 == 0 &&
+ monitor->geometry.box.y1 == 0 &&
+ monitor->geometry.box.x2 == 0 &&
+ monitor->geometry.box.y2 == 0);
+}
+
+static void
+RRMonitorGetGeometry(RRMonitorPtr monitor, RRMonitorGeometryPtr geometry)
+{
+ if (RRMonitorAutomaticGeometry(monitor) && monitor->numOutputs > 0) {
+ ScreenPtr screen = monitor->pScreen;
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
+ RRMonitorGeometryRec first = { .box = { 0, 0, 0, 0 }, .mmWidth = 0, .mmHeight = 0 };
+ RRMonitorGeometryRec this;
+ int c, o, co;
+ int active_crtcs = 0;
+
+ *geometry = first;
+ for (o = 0; o < monitor->numOutputs; o++) {
+ RRCrtcPtr crtc = NULL;
+ Bool in_use = FALSE;
+
+ for (c = 0; !in_use && c < pScrPriv->numCrtcs; c++) {
+ crtc = pScrPriv->crtcs[c];
+ if (!crtc->mode)
+ continue;
+ for (co = 0; !in_use && co < crtc->numOutputs; co++)
+ if (monitor->outputs[o] == crtc->outputs[co]->id)
+ in_use = TRUE;
+ }
+
+ if (!in_use)
+ continue;
+
+ RRMonitorGetCrtcGeometry(crtc, &this);
+
+ if (active_crtcs == 0) {
+ first = this;
+ *geometry = this;
+ } else {
+ geometry->box.x1 = min(this.box.x1, geometry->box.x1);
+ geometry->box.x2 = max(this.box.x2, geometry->box.x2);
+ geometry->box.y1 = min(this.box.y1, geometry->box.y1);
+ geometry->box.y2 = max(this.box.y2, geometry->box.y2);
+ }
+ active_crtcs++;
+ }
+
+ /* Adjust physical sizes to account for total area */
+ if (active_crtcs > 1 && first.box.x2 != first.box.x1 && first.box.y2 != first.box.y1) {
+ geometry->mmWidth = (this.box.x2 - this.box.x1) / (first.box.x2 - first.box.x1) * first.mmWidth;
+ geometry->mmHeight = (this.box.y2 - this.box.y1) / (first.box.y2 - first.box.y1) * first.mmHeight;
+ }
+ } else {
+ *geometry = monitor->geometry;
+ }
+}
+
+static Bool
+RRMonitorSetFromClient(RRMonitorPtr client_monitor, RRMonitorPtr monitor)
+{
+ monitor->name = client_monitor->name;
+ monitor->pScreen = client_monitor->pScreen;
+ monitor->numOutputs = client_monitor->numOutputs;
+ monitor->outputs = calloc(client_monitor->numOutputs, sizeof (RROutput));
+ if (!monitor->outputs && client_monitor->numOutputs)
+ return FALSE;
+ memcpy(monitor->outputs, client_monitor->outputs, client_monitor->numOutputs * sizeof (RROutput));
+ monitor->primary = client_monitor->primary;
+ monitor->automatic = client_monitor->automatic;
+ RRMonitorGetGeometry(client_monitor, &monitor->geometry);
+ return TRUE;
+}
+
+typedef struct _rrMonitorList {
+ int num_client;
+ int num_server;
+ RRCrtcPtr *server_crtc;
+ int num_crtcs;
+ int client_primary;
+ int server_primary;
+} RRMonitorListRec, *RRMonitorListPtr;
+
+static Bool
+RRMonitorInitList(ScreenPtr screen, RRMonitorListPtr mon_list, Bool get_active)
+{
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
+ int m, o, c, sc;
+ int numCrtcs;
+ ScreenPtr slave;
+
+ if (!RRGetInfo(screen, FALSE))
+ return FALSE;
+
+ /* 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) {
+ rrScrPrivPtr pSlavePriv;
+ pSlavePriv = rrGetScrPriv(slave);
+ numCrtcs += pSlavePriv->numCrtcs;
+ }
+ mon_list->num_crtcs = numCrtcs;
+
+ mon_list->server_crtc = calloc(numCrtcs * 2, sizeof (RRCrtcPtr));
+ if (!mon_list->server_crtc)
+ return FALSE;
+
+ /* Collect pointers to all of the active crtcs */
+ c = 0;
+ for (sc = 0; sc < pScrPriv->numCrtcs; sc++, c++) {
+ if (pScrPriv->crtcs[sc]->mode != NULL)
+ mon_list->server_crtc[c] = pScrPriv->crtcs[sc];
+ }
+
+ xorg_list_for_each_entry(slave, &screen->output_slave_list, output_head) {
+ rrScrPrivPtr pSlavePriv;
+ pSlavePriv = rrGetScrPriv(slave);
+ for (sc = 0; sc < pSlavePriv->numCrtcs; sc++, c++) {
+ if (pSlavePriv->crtcs[sc]->mode != NULL)
+ mon_list->server_crtc[c] = pSlavePriv->crtcs[sc];
+ }
+ }
+
+ /* Walk the list of client-defined monitors, clearing the covered
+ * CRTCs from the full list and finding whether one of the
+ * monitors is primary
+ */
+ mon_list->num_client = pScrPriv->numMonitors;
+ mon_list->client_primary = -1;
+
+ for (m = 0; m < pScrPriv->numMonitors; m++) {
+ RRMonitorPtr monitor = pScrPriv->monitors[m];
+ if (get_active) {
+ RRMonitorGeometryRec geom;
+
+ RRMonitorGetGeometry(monitor, &geom);
+ if (geom.box.x2 - geom.box.x1 == 0 ||
+ geom.box.y2 - geom.box.y1 == 0) {
+ mon_list->num_client--;
+ continue;
+ }
+ }
+ if (monitor->primary && mon_list->client_primary == -1)
+ mon_list->client_primary = m;
+ for (o = 0; o < monitor->numOutputs; o++) {
+ for (c = 0; c < numCrtcs; c++) {
+ RRCrtcPtr crtc = mon_list->server_crtc[c];
+ if (crtc) {
+ int co;
+ for (co = 0; co < crtc->numOutputs; co++)
+ if (crtc->outputs[co]->id == monitor->outputs[o]) {
+ mon_list->server_crtc[c] = NULL;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ /* Now look at the active CRTCs, and count
+ * those not covered by a client monitor, as well
+ * as finding whether one of them is marked primary
+ */
+ mon_list->num_server = 0;
+ mon_list->server_primary = -1;
+
+ for (c = 0; c < mon_list->num_crtcs; c++) {
+ RRCrtcPtr crtc = mon_list->server_crtc[c];
+
+ if (!crtc)
+ continue;
+
+ mon_list->num_server++;
+
+ if (RRMonitorCrtcPrimary(crtc) && mon_list->server_primary == -1)
+ mon_list->server_primary = c;
+ }
+ return TRUE;
+}
+
+static void
+RRMonitorFiniList(RRMonitorListPtr list)
+{
+ free(list->server_crtc);
+}
+
+/* Construct a complete list of protocol-visible monitors, including
+ * the manually generated ones as well as those generated
+ * automatically from the remaining CRCTs
+ */
+
+Bool
+RRMonitorMakeList(ScreenPtr screen, Bool get_active, RRMonitorPtr *monitors_ret, int *nmon_ret)
+{
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
+ RRMonitorListRec list;
+ int m, c;
+ RRMonitorPtr mon, monitors;
+ Bool has_primary = FALSE;
+
+ if (!pScrPriv)
+ return FALSE;
+
+ if (!RRMonitorInitList(screen, &list, get_active))
+ return FALSE;
+
+ monitors = calloc(list.num_client + list.num_server, sizeof (RRMonitorRec));
+ if (!monitors) {
+ RRMonitorFiniList(&list);
+ return FALSE;
+ }
+
+ mon = monitors;
+
+ /* Fill in the primary monitor data first
+ */
+ if (list.client_primary >= 0) {
+ RRMonitorSetFromClient(pScrPriv->monitors[list.client_primary], mon);
+ mon++;
+ } else if (list.server_primary >= 0) {
+ RRMonitorSetFromServer(list.server_crtc[list.server_primary], mon);
+ mon++;
+ }
+
+ /* Fill in the client-defined monitors next
+ */
+ for (m = 0; m < pScrPriv->numMonitors; m++) {
+ if (m == list.client_primary)
+ continue;
+ if (get_active) {
+ RRMonitorGeometryRec geom;
+
+ RRMonitorGetGeometry(pScrPriv->monitors[m], &geom);
+ if (geom.box.x2 - geom.box.x1 == 0 ||
+ geom.box.y2 - geom.box.y1 == 0) {
+ continue;
+ }
+ }
+ RRMonitorSetFromClient(pScrPriv->monitors[m], mon);
+ if (has_primary)
+ mon->primary = FALSE;
+ else if (mon->primary)
+ has_primary = TRUE;
+ mon++;
+ }
+
+ /* And finish with the list of crtc-inspired monitors
+ */
+ for (c = 0; c < list.num_crtcs; c++) {
+ RRCrtcPtr crtc = list.server_crtc[c];
+ if (c == list.server_primary && list.client_primary < 0)
+ continue;
+
+ if (!list.server_crtc[c])
+ continue;
+
+ RRMonitorSetFromServer(crtc, mon);
+ if (has_primary)
+ mon->primary = FALSE;
+ else if (mon->primary)
+ has_primary = TRUE;
+ mon++;
+ }
+
+ RRMonitorFiniList(&list);
+ *nmon_ret = list.num_client + list.num_server;
+ *monitors_ret = monitors;
+ return TRUE;
+}
+
+int
+RRMonitorCountList(ScreenPtr screen)
+{
+ RRMonitorListRec list;
+ int nmon;
+
+ if (!RRMonitorInitList(screen, &list, FALSE))
+ return -1;
+ nmon = list.num_client + list.num_server;
+ RRMonitorFiniList(&list);
+ return nmon;
+}
+
+void
+RRMonitorFree(RRMonitorPtr monitor)
+{
+ free(monitor);
+}
+
+RRMonitorPtr
+RRMonitorAlloc(int noutput)
+{
+ RRMonitorPtr monitor;
+
+ monitor = calloc(1, sizeof (RRMonitorRec) + noutput * sizeof (RROutput));
+ if (!monitor)
+ return NULL;
+ monitor->numOutputs = noutput;
+ monitor->outputs = (RROutput *) (monitor + 1);
+ return monitor;
+}
+
+static int
+RRMonitorDelete(ClientPtr client, ScreenPtr screen, Atom name)
+{
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
+ int m;
+
+ if (!pScrPriv) {
+ client->errorValue = name;
+ return BadAtom;
+ }
+
+ for (m = 0; m < pScrPriv->numMonitors; m++) {
+ RRMonitorPtr monitor = pScrPriv->monitors[m];
+ if (monitor->name == name) {
+ memmove(pScrPriv->monitors + m, pScrPriv->monitors + m + 1,
+ (pScrPriv->numMonitors - (m + 1)) * sizeof (RRMonitorPtr));
+ --pScrPriv->numMonitors;
+ RRMonitorFree(monitor);
+ return Success;
+ }
+ }
+
+ client->errorValue = name;
+ return BadValue;
+}
+
+static Bool
+RRMonitorMatchesOutputName(ScreenPtr screen, Atom name)
+{
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
+ int o;
+ const char *str = NameForAtom(name);
+ int len = strlen(str);
+
+ for (o = 0; o < pScrPriv->numOutputs; o++) {
+ RROutputPtr output = pScrPriv->outputs[o];
+
+ if (output->nameLength == len && !memcmp(output->name, str, len))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+int
+RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor)
+{
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
+ int m;
+ ScreenPtr slave;
+ RRMonitorPtr *monitors;
+
+ if (!pScrPriv)
+ return BadAlloc;
+
+ /* 'name' must not match the name of any Output on the screen, or
+ * a Value error results.
+ */
+
+ if (RRMonitorMatchesOutputName(screen, monitor->name)) {
+ client->errorValue = monitor->name;
+ return BadValue;
+ }
+
+ xorg_list_for_each_entry(slave, &screen->output_slave_list, output_head) {
+ if (RRMonitorMatchesOutputName(slave, monitor->name)) {
+ client->errorValue = monitor->name;
+ return BadValue;
+ }
+ }
+
+ /* 'name' must not match the name of any Monitor on the screen, or
+ * a Value error results.
+ */
+
+ for (m = 0; m < pScrPriv->numMonitors; m++) {
+ if (pScrPriv->monitors[m]->name == monitor->name) {
+ client->errorValue = monitor->name;
+ return BadValue;
+ }
+ }
+
+ /* Allocate space for the new pointer. This is done before
+ * removing matching monitors as it may fail, and the request
+ * needs to not have any side-effects on failure
+ */
+ if (pScrPriv->numMonitors)
+ monitors = reallocarray(pScrPriv->monitors,
+ pScrPriv->numMonitors + 1,
+ sizeof (RRMonitorPtr));
+ else
+ monitors = malloc(sizeof (RRMonitorPtr));
+
+ if (!monitors)
+ return BadAlloc;
+
+ pScrPriv->monitors = monitors;
+
+ for (m = 0; m < pScrPriv->numMonitors; m++) {
+ RRMonitorPtr existing = pScrPriv->monitors[m];
+ int o, eo;
+
+ /* If 'name' matches an existing Monitor on the screen, the
+ * existing one will be deleted as if RRDeleteMonitor were called.
+ */
+ if (existing->name == monitor->name) {
+ (void) RRMonitorDelete(client, screen, existing->name);
+ continue;
+ }
+
+ /* For each output in 'info.outputs', each one is removed from all
+ * pre-existing Monitors. If removing the output causes the list
+ * of outputs for that Monitor to become empty, then that
+ * Monitor will be deleted as if RRDeleteMonitor were called.
+ */
+
+ for (eo = 0; eo < existing->numOutputs; eo++) {
+ for (o = 0; o < monitor->numOutputs; o++) {
+ if (monitor->outputs[o] == existing->outputs[eo]) {
+ memmove(existing->outputs + eo, existing->outputs + eo + 1,
+ (existing->numOutputs - (eo + 1)) * sizeof (RROutput));
+ --existing->numOutputs;
+ --eo;
+ break;
+ }
+ }
+ if (existing->numOutputs == 0) {
+ (void) RRMonitorDelete(client, screen, existing->name);
+ break;
+ }
+ }
+ if (monitor->primary)
+ existing->primary = FALSE;
+ }
+
+ /* Add the new one to the list
+ */
+ pScrPriv->monitors[pScrPriv->numMonitors++] = monitor;
+
+ return Success;
+}
+
+void
+RRMonitorFreeList(RRMonitorPtr monitors, int nmon)
+{
+ int m;
+
+ for (m = 0; m < nmon; m++)
+ free(monitors[m].outputs);
+ free(monitors);
+}
+
+void
+RRMonitorInit(ScreenPtr screen)
+{
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
+
+ if (!pScrPriv)
+ return;
+
+ pScrPriv->numMonitors = 0;
+ pScrPriv->monitors = NULL;
+}
+
+void
+RRMonitorClose(ScreenPtr screen)
+{
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
+ int m;
+
+ if (!pScrPriv)
+ return;
+
+ for (m = 0; m < pScrPriv->numMonitors; m++)
+ RRMonitorFree(pScrPriv->monitors[m]);
+ free(pScrPriv->monitors);
+ pScrPriv->monitors = NULL;
+ pScrPriv->numMonitors = 0;
+}
+
+static CARD32
+RRMonitorTimestamp(ScreenPtr screen)
+{
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
+
+ /* XXX should take client monitor changes into account */
+ return pScrPriv->lastConfigTime.milliseconds;
+}
+
+int
+ProcRRGetMonitors(ClientPtr client)
+{
+ REQUEST(xRRGetMonitorsReq);
+ xRRGetMonitorsReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ };
+ WindowPtr window;
+ ScreenPtr screen;
+ int r;
+ RRMonitorPtr monitors;
+ int nmonitors;
+ int noutputs;
+ int m;
+ Bool get_active;
+ REQUEST_SIZE_MATCH(xRRGetMonitorsReq);
+ r = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess);
+ if (r != Success)
+ return r;
+ screen = window->drawable.pScreen;
+
+ get_active = stuff->get_active;
+ if (!RRMonitorMakeList(screen, get_active, &monitors, &nmonitors))
+ return BadAlloc;
+
+ rep.timestamp = RRMonitorTimestamp(screen);
+
+ noutputs = 0;
+ for (m = 0; m < nmonitors; m++) {
+ rep.length += SIZEOF(xRRMonitorInfo) >> 2;
+ rep.length += monitors[m].numOutputs;
+ noutputs += monitors[m].numOutputs;
+ }
+
+ rep.nmonitors = nmonitors;
+ rep.noutputs = noutputs;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.timestamp);
+ swapl(&rep.nmonitors);
+ swapl(&rep.noutputs);
+ }
+ WriteToClient(client, sizeof(xRRGetMonitorsReply), &rep);
+
+ client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
+
+ for (m = 0; m < nmonitors; m++) {
+ RRMonitorPtr monitor = &monitors[m];
+ xRRMonitorInfo info = {
+ .name = monitor->name,
+ .primary = monitor->primary,
+ .automatic = monitor->automatic,
+ .noutput = monitor->numOutputs,
+ .x = monitor->geometry.box.x1,
+ .y = monitor->geometry.box.y1,
+ .width = monitor->geometry.box.x2 - monitor->geometry.box.x1,
+ .height = monitor->geometry.box.y2 - monitor->geometry.box.y1,
+ .widthInMillimeters = monitor->geometry.mmWidth,
+ .heightInMillimeters = monitor->geometry.mmHeight,
+ };
+ if (client->swapped) {
+ swapl(&info.name);
+ swaps(&info.noutput);
+ swaps(&info.x);
+ swaps(&info.y);
+ swaps(&info.width);
+ swaps(&info.height);
+ swapl(&info.widthInMillimeters);
+ swapl(&info.heightInMillimeters);
+ }
+
+ WriteToClient(client, sizeof(xRRMonitorInfo), &info);
+ WriteSwappedDataToClient(client, monitor->numOutputs * sizeof (RROutput), monitor->outputs);
+ }
+
+ RRMonitorFreeList(monitors, nmonitors);
+
+ return Success;
+}
+
+int
+ProcRRSetMonitor(ClientPtr client)
+{
+ REQUEST(xRRSetMonitorReq);
+ WindowPtr window;
+ ScreenPtr screen;
+ RRMonitorPtr monitor;
+ int r;
+
+ REQUEST_AT_LEAST_SIZE(xRRSetMonitorReq);
+
+ if (stuff->monitor.noutput != stuff->length - (SIZEOF(xRRSetMonitorReq) >> 2))
+ return BadLength;
+
+ r = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess);
+ if (r != Success)
+ return r;
+ screen = window->drawable.pScreen;
+
+ if (!ValidAtom(stuff->monitor.name))
+ return BadAtom;
+
+ /* Allocate the new monitor */
+ monitor = RRMonitorAlloc(stuff->monitor.noutput);
+ if (!monitor)
+ return BadAlloc;
+
+ /* Fill in the bits from the request */
+ monitor->pScreen = screen;
+ monitor->name = stuff->monitor.name;
+ monitor->primary = stuff->monitor.primary;
+ monitor->automatic = FALSE;
+ memcpy(monitor->outputs, stuff + 1, stuff->monitor.noutput * sizeof (RROutput));
+ monitor->geometry.box.x1 = stuff->monitor.x;
+ monitor->geometry.box.y1 = stuff->monitor.y;
+ monitor->geometry.box.x2 = stuff->monitor.x + stuff->monitor.width;
+ monitor->geometry.box.y2 = stuff->monitor.y + stuff->monitor.height;
+ monitor->geometry.mmWidth = stuff->monitor.widthInMillimeters;
+ monitor->geometry.mmHeight = stuff->monitor.heightInMillimeters;
+
+ r = RRMonitorAdd(client, screen, monitor);
+ if (r == Success)
+ RRSendConfigNotify(screen);
+ else
+ RRMonitorFree(monitor);
+ return r;
+}
+
+int
+ProcRRDeleteMonitor(ClientPtr client)
+{
+ REQUEST(xRRDeleteMonitorReq);
+ WindowPtr window;
+ ScreenPtr screen;
+ int r;
+
+ REQUEST_SIZE_MATCH(xRRDeleteMonitorReq);
+ r = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess);
+ if (r != Success)
+ return r;
+ screen = window->drawable.pScreen;
+
+ if (!ValidAtom(stuff->name)) {
+ client->errorValue = stuff->name;
+ return BadAtom;
+ }
+
+ r = RRMonitorDelete(client, screen, stuff->name);
+ if (r == Success)
+ RRSendConfigNotify(screen);
+ return r;
+}
diff --git a/xserver/randr/rroutput.c b/xserver/randr/rroutput.c
index 548e07d1d..686ae49a6 100644
--- a/xserver/randr/rroutput.c
+++ b/xserver/randr/rroutput.c
@@ -31,15 +31,27 @@ RESTYPE RROutputType;
void
RROutputChanged(RROutputPtr output, Bool configChanged)
{
+ /* set changed bits on the master screen only */
ScreenPtr pScreen = output->pScreen;
+ rrScrPrivPtr mastersp;
output->changed = TRUE;
- if (pScreen) {
- rrScrPriv(pScreen);
- RRSetChanged(pScreen);
- if (configChanged)
- pScrPriv->configChanged = TRUE;
+ if (!pScreen)
+ return;
+
+ if (pScreen->isGPU) {
+ ScreenPtr master = pScreen->current_master;
+ if (!master)
+ return;
+ mastersp = rrGetScrPriv(master);
+ }
+ else {
+ mastersp = rrGetScrPriv(pScreen);
}
+
+ RRSetChanged(pScreen);
+ if (configChanged)
+ mastersp->configChanged = TRUE;
}
/*
@@ -60,8 +72,8 @@ RROutputCreate(ScreenPtr pScreen,
pScrPriv = rrGetScrPriv(pScreen);
if (pScrPriv->numOutputs)
- outputs = realloc(pScrPriv->outputs,
- (pScrPriv->numOutputs + 1) * sizeof(RROutputPtr));
+ outputs = reallocarray(pScrPriv->outputs,
+ pScrPriv->numOutputs + 1, sizeof(RROutputPtr));
else
outputs = malloc(sizeof(RROutputPtr));
if (!outputs)
@@ -124,7 +136,7 @@ RROutputSetClones(RROutputPtr output, RROutputPtr * clones, int numClones)
return TRUE;
}
if (numClones) {
- newClones = malloc(numClones * sizeof(RROutputPtr));
+ newClones = xallocarray(numClones, sizeof(RROutputPtr));
if (!newClones)
return FALSE;
}
@@ -157,7 +169,7 @@ RROutputSetModes(RROutputPtr output,
}
if (numModes) {
- newModes = malloc(numModes * sizeof(RRModePtr));
+ newModes = xallocarray(numModes, sizeof(RRModePtr));
if (!newModes)
return FALSE;
}
@@ -200,8 +212,8 @@ RROutputAddUserMode(RROutputPtr output, RRModePtr mode)
return BadMatch;
if (output->userModes)
- newModes = realloc(output->userModes,
- (output->numUserModes + 1) * sizeof(RRModePtr));
+ newModes = reallocarray(output->userModes,
+ output->numUserModes + 1, sizeof(RRModePtr));
else
newModes = malloc(sizeof(RRModePtr));
if (!newModes)
@@ -256,7 +268,7 @@ RROutputSetCrtcs(RROutputPtr output, RRCrtcPtr * crtcs, int numCrtcs)
return TRUE;
}
if (numCrtcs) {
- newCrtcs = malloc(numCrtcs * sizeof(RRCrtcPtr));
+ newCrtcs = xallocarray(numCrtcs, sizeof(RRCrtcPtr));
if (!newCrtcs)
return FALSE;
}
@@ -531,6 +543,7 @@ ProcRRSetOutputPrimary(ClientPtr client)
WindowPtr pWin;
rrScrPrivPtr pScrPriv;
int ret;
+ ScreenPtr slave;
REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
@@ -553,8 +566,19 @@ ProcRRSetOutputPrimary(ClientPtr client)
pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);
if (pScrPriv)
+ {
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);
+ }
+ }
+
return Success;
}
diff --git a/xserver/randr/rrproperty.c b/xserver/randr/rrproperty.c
index e385e15ab..e56626cd2 100644
--- a/xserver/randr/rrproperty.c
+++ b/xserver/randr/rrproperty.c
@@ -140,7 +140,6 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
RRPropertyPtr prop;
rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen);
int size_in_bytes;
- int total_size;
unsigned long total_len;
RRPropertyValuePtr prop_value;
RRPropertyValueRec new_value;
@@ -180,9 +179,8 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
if (mode == PropModeReplace || len > 0) {
void *new_data = NULL, *old_data = NULL;
- total_size = total_len * size_in_bytes;
- new_value.data = (void *) malloc(total_size);
- if (!new_value.data && total_size) {
+ new_value.data = xallocarray(total_len, size_in_bytes);
+ if (!new_value.data && total_len && size_in_bytes) {
if (add)
RRDestroyOutputProperty(prop);
return BadAlloc;
@@ -350,7 +348,7 @@ RRConfigureOutputProperty(RROutputPtr output, Atom property,
return BadMatch;
}
- new_values = malloc(num_values * sizeof(INT32));
+ new_values = xallocarray(num_values, sizeof(INT32));
if (!new_values && num_values) {
if (add)
RRDestroyOutputProperty(prop);
@@ -400,7 +398,7 @@ ProcRRListOutputProperties(ClientPtr client)
for (prop = output->properties; prop; prop = prop->next)
numProps++;
if (numProps)
- if (!(pAtoms = (Atom *) malloc(numProps * sizeof(Atom))))
+ if (!(pAtoms = xallocarray(numProps, sizeof(Atom))))
return BadAlloc;
rep = (xRRListOutputPropertiesReply) {
@@ -447,7 +445,7 @@ ProcRRQueryOutputProperty(ClientPtr client)
return BadName;
if (prop->num_valid) {
- extra = malloc(prop->num_valid * sizeof(INT32));
+ extra = xallocarray(prop->num_valid, sizeof(INT32));
if (!extra)
return BadAlloc;
}
diff --git a/xserver/randr/rrproviderproperty.c b/xserver/randr/rrproviderproperty.c
index ff2c614d0..b79c17f9b 100644
--- a/xserver/randr/rrproviderproperty.c
+++ b/xserver/randr/rrproviderproperty.c
@@ -350,7 +350,7 @@ RRConfigureProviderProperty(RRProviderPtr provider, Atom property,
return BadMatch;
}
- new_values = malloc(num_values * sizeof(INT32));
+ new_values = xallocarray(num_values, sizeof(INT32));
if (!new_values && num_values) {
if (add)
RRDestroyProviderProperty(prop);
@@ -400,7 +400,7 @@ ProcRRListProviderProperties(ClientPtr client)
for (prop = provider->properties; prop; prop = prop->next)
numProps++;
if (numProps)
- if (!(pAtoms = (Atom *) malloc(numProps * sizeof(Atom))))
+ if (!(pAtoms = xallocarray(numProps, sizeof(Atom))))
return BadAlloc;
rep = (xRRListProviderPropertiesReply) {
@@ -445,7 +445,7 @@ ProcRRQueryProviderProperty(ClientPtr client)
return BadName;
if (prop->num_valid) {
- extra = malloc(prop->num_valid * sizeof(INT32));
+ extra = xallocarray(prop->num_valid, sizeof(INT32));
if (!extra)
return BadAlloc;
}
diff --git a/xserver/randr/rrscreen.c b/xserver/randr/rrscreen.c
index c2a7798e1..d0ca91e0e 100644
--- a/xserver/randr/rrscreen.c
+++ b/xserver/randr/rrscreen.c
@@ -413,8 +413,9 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
.nbytesNames = total_name_len
};
- rep.length = (total_crtcs + total_outputs + total_modes * bytes_to_int32(SIZEOF(xRRModeInfo)) +
- bytes_to_int32(rep.nbytesNames));
+ rep.length = (total_crtcs + total_outputs +
+ total_modes * bytes_to_int32(SIZEOF(xRRModeInfo)) +
+ bytes_to_int32(total_name_len));
extraLen = rep.length << 2;
if (extraLen) {
diff --git a/xserver/randr/rrsdispatch.c b/xserver/randr/rrsdispatch.c
index 47558cf75..cf2a3b024 100644
--- a/xserver/randr/rrsdispatch.c
+++ b/xserver/randr/rrsdispatch.c
@@ -565,6 +565,41 @@ static int SProcRRGetProviderProperty(ClientPtr client)
return ProcRandrVector[stuff->randrReqType] (client);
}
+static int SProcRRGetMonitors(ClientPtr client) {
+ REQUEST(xRRGetMonitorsReq);
+
+ REQUEST_SIZE_MATCH(xRRGetMonitorsReq);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
+ return ProcRandrVector[stuff->randrReqType] (client);
+}
+
+static int SProcRRSetMonitor(ClientPtr client) {
+ REQUEST(xRRSetMonitorReq);
+
+ REQUEST_AT_LEAST_SIZE(xRRGetMonitorsReq);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
+ swapl(&stuff->monitor.name);
+ swaps(&stuff->monitor.noutput);
+ swaps(&stuff->monitor.x);
+ swaps(&stuff->monitor.y);
+ swaps(&stuff->monitor.width);
+ swaps(&stuff->monitor.height);
+ SwapRestL(stuff);
+ return ProcRandrVector[stuff->randrReqType] (client);
+}
+
+static int SProcRRDeleteMonitor(ClientPtr client) {
+ REQUEST(xRRDeleteMonitorReq);
+
+ REQUEST_SIZE_MATCH(xRRDeleteMonitorReq);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
+ swapl(&stuff->name);
+ return ProcRandrVector[stuff->randrReqType] (client);
+}
+
int (*SProcRandrVector[RRNumberRequests]) (ClientPtr) = {
SProcRRQueryVersion, /* 0 */
/* we skip 1 to make old clients fail pretty immediately */
@@ -614,4 +649,7 @@ int (*SProcRandrVector[RRNumberRequests]) (ClientPtr) = {
SProcRRChangeProviderProperty, /* 39 */
SProcRRDeleteProviderProperty, /* 40 */
SProcRRGetProviderProperty, /* 41 */
+ SProcRRGetMonitors, /* 42 */
+ SProcRRSetMonitor, /* 43 */
+ SProcRRDeleteMonitor, /* 44 */
};
diff --git a/xserver/randr/rrtransform.c b/xserver/randr/rrtransform.c
index f3f1b1e65..d32b43aa3 100644
--- a/xserver/randr/rrtransform.c
+++ b/xserver/randr/rrtransform.c
@@ -70,7 +70,7 @@ RRTransformSetFilter(RRTransformPtr dst,
xFixed *new_params;
if (nparams) {
- new_params = malloc(nparams * sizeof(xFixed));
+ new_params = xallocarray(nparams, sizeof(xFixed));
if (!new_params)
return FALSE;
memcpy(new_params, params, nparams * sizeof(xFixed));
@@ -196,7 +196,7 @@ RRTransformCompute(int x,
f_rot_sin = 0;
f_rot_dx = width;
f_rot_dy = height;
- rot_cos = F(-1);
+ rot_cos = F(~0u);
rot_sin = F(0);
rot_dx = F(width);
rot_dy = F(height);
@@ -207,7 +207,7 @@ RRTransformCompute(int x,
f_rot_dx = 0;
f_rot_dy = width;
rot_cos = F(0);
- rot_sin = F(-1);
+ rot_sin = F(~0u);
rot_dx = F(0);
rot_dy = F(width);
break;
@@ -230,7 +230,7 @@ RRTransformCompute(int x,
scale_dy = 0;
if (rotation & RR_Reflect_X) {
f_scale_x = -1;
- scale_x = F(-1);
+ scale_x = F(~0u);
if (rotation & (RR_Rotate_0 | RR_Rotate_180)) {
f_scale_dx = width;
scale_dx = F(width);
@@ -242,7 +242,7 @@ RRTransformCompute(int x,
}
if (rotation & RR_Reflect_Y) {
f_scale_y = -1;
- scale_y = F(-1);
+ scale_y = F(~0u);
if (rotation & (RR_Rotate_0 | RR_Rotate_180)) {
f_scale_dy = height;
scale_dy = F(height);
diff --git a/xserver/randr/rrxinerama.c b/xserver/randr/rrxinerama.c
index b336bd7cd..b6e9586d7 100644
--- a/xserver/randr/rrxinerama.c
+++ b/xserver/randr/rrxinerama.c
@@ -84,6 +84,8 @@ static int ProcRRXineramaIsActive(ClientPtr client);
static int ProcRRXineramaQueryScreens(ClientPtr client);
static int SProcRRXineramaDispatch(ClientPtr client);
+Bool noRRXineramaExtension = FALSE;
+
/* Proc */
int
@@ -147,35 +149,10 @@ ProcRRXineramaGetState(ClientPtr client)
return Success;
}
-static Bool
-RRXineramaCrtcActive(RRCrtcPtr crtc)
-{
- return crtc->mode != NULL && crtc->numOutputs > 0;
-}
-
static int
RRXineramaScreenCount(ScreenPtr pScreen)
{
- int i, n;
- ScreenPtr slave;
-
- n = 0;
- if (rrGetScrPriv(pScreen)) {
- rrScrPriv(pScreen);
- for (i = 0; i < pScrPriv->numCrtcs; i++)
- if (RRXineramaCrtcActive(pScrPriv->crtcs[i]))
- n++;
- }
-
- xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
- rrScrPrivPtr pSlavePriv;
- pSlavePriv = rrGetScrPriv(slave);
- for (i = 0; i < pSlavePriv->numCrtcs; i++)
- if (RRXineramaCrtcActive(pSlavePriv->crtcs[i]))
- n++;
- }
-
- return n;
+ return RRMonitorCountList(pScreen);
}
static Bool
@@ -274,42 +251,16 @@ ProcRRXineramaIsActive(ClientPtr client)
}
static void
-RRXineramaWriteCrtc(ClientPtr client, RRCrtcPtr crtc)
+RRXineramaWriteMonitor(ClientPtr client, RRMonitorPtr monitor)
{
xXineramaScreenInfo scratch;
- if (RRXineramaCrtcActive(crtc)) {
- ScreenPtr pScreen = crtc->pScreen;
- rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
- BoxRec panned_area;
-
- /* Check to see if crtc is panned and return the full area when applicable. */
- if (pScrPriv && pScrPriv->rrGetPanning &&
- pScrPriv->rrGetPanning(pScreen, crtc, &panned_area, NULL, NULL) &&
- (panned_area.x2 > panned_area.x1) &&
- (panned_area.y2 > panned_area.y1)) {
- scratch.x_org = panned_area.x1;
- scratch.y_org = panned_area.y1;
- scratch.width = panned_area.x2 - panned_area.x1;
- scratch.height = panned_area.y2 - panned_area.y1;
- }
- else {
- int width, height;
-
- RRCrtcGetScanoutSize(crtc, &width, &height);
- scratch.x_org = crtc->x;
- scratch.y_org = crtc->y;
- scratch.width = width;
- scratch.height = height;
- }
- if (client->swapped) {
- swaps(&scratch.x_org);
- swaps(&scratch.y_org);
- swaps(&scratch.width);
- swaps(&scratch.height);
- }
- WriteToClient(client, sz_XineramaScreenInfo, &scratch);
- }
+ scratch.x_org = monitor->geometry.box.x1;
+ scratch.y_org = monitor->geometry.box.y1;
+ scratch.width = monitor->geometry.box.x2 - monitor->geometry.box.x1;
+ scratch.height = monitor->geometry.box.y2 - monitor->geometry.box.y1;
+
+ WriteToClient(client, sz_XineramaScreenInfo, &scratch);
}
int
@@ -317,21 +268,23 @@ ProcRRXineramaQueryScreens(ClientPtr client)
{
xXineramaQueryScreensReply rep;
ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
- int n = 0;
- int i;
+ int m;
+ RRMonitorPtr monitors = NULL;
+ int nmonitors = 0;
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
if (RRXineramaScreenActive(pScreen)) {
RRGetInfo(pScreen, FALSE);
- n = RRXineramaScreenCount(pScreen);
+ if (!RRMonitorMakeList(pScreen, TRUE, &monitors, &nmonitors))
+ return BadAlloc;
}
rep = (xXineramaQueryScreensReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
- .length = bytes_to_int32(n * sz_XineramaScreenInfo),
- .number = n
+ .length = bytes_to_int32(nmonitors * sz_XineramaScreenInfo),
+ .number = nmonitors
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
@@ -340,40 +293,11 @@ ProcRRXineramaQueryScreens(ClientPtr client)
}
WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
- if (n) {
- ScreenPtr slave;
- rrScrPriv(pScreen);
- int has_primary = 0;
- RRCrtcPtr primary_crtc = NULL;
-
- if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
- has_primary = 1;
- primary_crtc = pScrPriv->primaryOutput->crtc;
- RRXineramaWriteCrtc(client, pScrPriv->primaryOutput->crtc);
- }
-
- for (i = 0; i < pScrPriv->numCrtcs; i++) {
- if (has_primary &&
- primary_crtc == pScrPriv->crtcs[i]) {
- has_primary = 0;
- continue;
- }
- RRXineramaWriteCrtc(client, pScrPriv->crtcs[i]);
- }
-
- xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
- rrScrPrivPtr pSlavePriv;
- pSlavePriv = rrGetScrPriv(slave);
- for (i = 0; i < pSlavePriv->numCrtcs; i++) {
- if (has_primary &&
- primary_crtc == pSlavePriv->crtcs[i]) {
- has_primary = 0;
- continue;
- }
- RRXineramaWriteCrtc(client, pSlavePriv->crtcs[i]);
- }
- }
- }
+ for (m = 0; m < nmonitors; m++)
+ RRXineramaWriteMonitor(client, &monitors[m]);
+
+ if (monitors)
+ RRMonitorFreeList(monitors, nmonitors);
return Success;
}
@@ -488,6 +412,9 @@ RRXineramaExtensionInit(void)
return;
#endif
+ if (noRRXineramaExtension)
+ return;
+
/*
* Xinerama isn't capable enough to have multiple protocol screens each
* with their own output geometry. So if there's more than one protocol
diff --git a/xserver/record/Makefile.in b/xserver/record/Makefile.in
index 1e83894c0..74f1f0d2c 100644
--- a/xserver/record/Makefile.in
+++ b/xserver/record/Makefile.in
@@ -57,8 +57,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -215,7 +214,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -345,8 +343,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/record/record.c b/xserver/record/record.c
index 0a466e279..82bb0607e 100644
--- a/xserver/record/record.c
+++ b/xserver/record/record.c
@@ -1074,19 +1074,19 @@ RecordAddClientToRCAP(RecordClientsAndProtocolPtr pRCAP, XID clientspec)
{
if (pRCAP->numClients == pRCAP->sizeClients) {
if (pRCAP->clientIDsSeparatelyAllocated) {
- XID *pNewIDs = (XID *) realloc(pRCAP->pClientIDs,
- (pRCAP->sizeClients +
- CLIENT_ARRAY_GROWTH_INCREMENT) *
- sizeof(XID));
+ XID *pNewIDs =
+ reallocarray(pRCAP->pClientIDs,
+ pRCAP->sizeClients + CLIENT_ARRAY_GROWTH_INCREMENT,
+ sizeof(XID));
if (!pNewIDs)
return;
pRCAP->pClientIDs = pNewIDs;
pRCAP->sizeClients += CLIENT_ARRAY_GROWTH_INCREMENT;
}
else {
- XID *pNewIDs = (XID *) malloc((pRCAP->sizeClients +
- CLIENT_ARRAY_GROWTH_INCREMENT) *
- sizeof(XID));
+ XID *pNewIDs =
+ xallocarray(pRCAP->sizeClients + CLIENT_ARRAY_GROWTH_INCREMENT,
+ sizeof(XID));
if (!pNewIDs)
return;
memcpy(pNewIDs, pRCAP->pClientIDs, pRCAP->numClients * sizeof(XID));
@@ -1217,7 +1217,7 @@ RecordCanonicalizeClientSpecifiers(XID *pClientspecs, int *pNumClientspecs,
for (i = 0; i < numClients; i++) {
if (pClientspecs[i] == XRecordAllClients || pClientspecs[i] == XRecordCurrentClients) { /* expand All/Current */
int j, nc;
- XID *pCanon = (XID *) malloc(sizeof(XID) * (currentMaxClients + 1));
+ XID *pCanon = xallocarray(currentMaxClients + 1, sizeof(XID));
if (!pCanon)
return NULL;
@@ -1421,8 +1421,7 @@ static int
RecordAllocIntervals(SetInfoPtr psi, int nIntervals)
{
assert(!psi->intervals);
- psi->intervals = (RecordSetInterval *)
- malloc(nIntervals * sizeof(RecordSetInterval));
+ psi->intervals = xallocarray(nIntervals, sizeof(RecordSetInterval));
if (!psi->intervals)
return BadAlloc;
memset(psi->intervals, 0, nIntervals * sizeof(RecordSetInterval));
@@ -1584,7 +1583,7 @@ RecordRegisterClients(RecordContextPtr pContext, ClientPtr client,
* range for extension replies.
*/
maxSets = PREDEFSETS + 2 * stuff->nRanges;
- si = (SetInfoPtr) malloc(sizeof(SetInfoRec) * maxSets);
+ si = xallocarray(maxSets, sizeof(SetInfoRec));
if (!si) {
err = BadAlloc;
goto bailout;
@@ -1853,8 +1852,8 @@ ProcRecordCreateContext(ClientPtr client)
/* make sure there is room in ppAllContexts to store the new context */
- ppNewAllContexts = (RecordContextPtr *)
- realloc(ppAllContexts, sizeof(RecordContextPtr) * (numContexts + 1));
+ ppNewAllContexts =
+ reallocarray(ppAllContexts, numContexts + 1, sizeof(RecordContextPtr));
if (!ppNewAllContexts)
goto bailout;
ppAllContexts = ppNewAllContexts;
@@ -1879,7 +1878,6 @@ ProcRecordCreateContext(ClientPtr client)
return Success;
}
else {
- RecordDeleteContext((void *) pContext, pContext->id);
return BadAlloc;
}
bailout:
@@ -1971,8 +1969,7 @@ RecordAllocRanges(GetContextRangeInfoPtr pri, int nRanges)
#define SZINCR 8
newsize = max(pri->size + SZINCR, nRanges);
- pNewRange = (xRecordRange *) realloc(pri->pRanges,
- newsize * sizeof(xRecordRange));
+ pNewRange = reallocarray(pri->pRanges, newsize, sizeof(xRecordRange));
if (!pNewRange)
return BadAlloc;
@@ -2150,9 +2147,7 @@ ProcRecordGetContext(ClientPtr client)
/* allocate and initialize space for record range info */
- pRangeInfo =
- (GetContextRangeInfoPtr) malloc(nRCAPs *
- sizeof(GetContextRangeInfoRec));
+ pRangeInfo = xallocarray(nRCAPs, sizeof(GetContextRangeInfoRec));
if (!pRangeInfo && nRCAPs > 0)
return BadAlloc;
for (i = 0; i < nRCAPs; i++) {
@@ -2733,7 +2728,8 @@ RecordAClientStateChange(CallbackListPtr *pcbl, void *nulldata,
/* RecordDisableContext modifies contents of ppAllContexts. */
numContextsCopy = numContexts;
- ppAllContextsCopy = malloc(numContextsCopy * sizeof(RecordContextPtr));
+ ppAllContextsCopy = xallocarray(numContextsCopy,
+ sizeof(RecordContextPtr));
assert(ppAllContextsCopy);
memcpy(ppAllContextsCopy, ppAllContexts,
numContextsCopy * sizeof(RecordContextPtr));
diff --git a/xserver/record/set.c b/xserver/record/set.c
index 34faa617e..e0db385b9 100644
--- a/xserver/record/set.c
+++ b/xserver/record/set.c
@@ -303,9 +303,7 @@ IntervalListCreateSet(RecordSetInterval * pIntervals, int nIntervals,
CARD16 first;
if (nIntervals > 0) {
- stackIntervals =
- (RecordSetInterval *) malloc(sizeof(RecordSetInterval) *
- nIntervals);
+ stackIntervals = xallocarray(nIntervals, sizeof(RecordSetInterval));
if (!stackIntervals)
return NULL;
diff --git a/xserver/render/Makefile.in b/xserver/render/Makefile.in
index 5d95cc5aa..e4b0831cc 100644
--- a/xserver/render/Makefile.in
+++ b/xserver/render/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -248,7 +247,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -378,8 +376,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/render/filter.c b/xserver/render/filter.c
index 019ea7f94..2741f406c 100644
--- a/xserver/render/filter.c
+++ b/xserver/render/filter.c
@@ -67,7 +67,7 @@ PictureGetFilterId(const char *filter, int len, Bool makeit)
memcpy(name, filter, len);
name[len] = '\0';
if (filterNames)
- names = realloc(filterNames, (nfilterNames + 1) * sizeof(char *));
+ names = reallocarray(filterNames, nfilterNames + 1, sizeof(char *));
else
names = malloc(sizeof(char *));
if (!names) {
@@ -145,7 +145,7 @@ PictureAddFilter(ScreenPtr pScreen,
return -1;
if (ps->filters)
filters =
- realloc(ps->filters, (ps->nfilters + 1) * sizeof(PictFilterRec));
+ reallocarray(ps->filters, ps->nfilters + 1, sizeof(PictFilterRec));
else
filters = malloc(sizeof(PictFilterRec));
if (!filters)
@@ -177,9 +177,9 @@ PictureSetFilterAlias(ScreenPtr pScreen, const char *filter, const char *alias)
PictFilterAliasPtr aliases;
if (ps->filterAliases)
- aliases = realloc(ps->filterAliases,
- (ps->nfilterAliases + 1) *
- sizeof(PictFilterAliasRec));
+ aliases = reallocarray(ps->filterAliases,
+ ps->nfilterAliases + 1,
+ sizeof(PictFilterAliasRec));
else
aliases = malloc(sizeof(PictFilterAliasRec));
if (!aliases)
@@ -336,7 +336,7 @@ SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter,
return BadMatch;
if (nparams != pPicture->filter_nparams) {
- xFixed *new_params = malloc(nparams * sizeof(xFixed));
+ xFixed *new_params = xallocarray(nparams, sizeof(xFixed));
if (!new_params && nparams)
return BadAlloc;
diff --git a/xserver/render/glyph.c b/xserver/render/glyph.c
index f3310db12..ea865af58 100644
--- a/xserver/render/glyph.c
+++ b/xserver/render/glyph.c
@@ -106,7 +106,7 @@ GlyphUninit(ScreenPtr pScreen)
}
}
-GlyphHashSetPtr
+static GlyphHashSetPtr
FindGlyphHashSet(CARD32 filled)
{
int i;
@@ -117,7 +117,7 @@ FindGlyphHashSet(CARD32 filled)
return 0;
}
-GlyphRefPtr
+static GlyphRefPtr
FindGlyphRef(GlyphHashPtr hash,
CARD32 signature, Bool match, unsigned char sha1[20])
{
@@ -245,7 +245,7 @@ FreeGlyphPicture(GlyphPtr glyph)
}
}
-void
+static void
FreeGlyph(GlyphPtr glyph, int format)
{
CheckDuplicates(&globalGlyphs[format], "FreeGlyph");
@@ -383,7 +383,7 @@ AllocateGlyph(xGlyphInfo * gi, int fdepth)
return 0;
}
-Bool
+static Bool
AllocateGlyphHash(GlyphHashPtr hash, GlyphHashSetPtr hashSet)
{
hash->table = calloc(hashSet->size, sizeof(GlyphRefRec));
@@ -394,7 +394,7 @@ AllocateGlyphHash(GlyphHashPtr hash, GlyphHashSetPtr hashSet)
return TRUE;
}
-Bool
+static Bool
ResizeGlyphHash(GlyphHashPtr hash, CARD32 change, Bool global)
{
CARD32 tableEntries;
diff --git a/xserver/render/glyphstr.h b/xserver/render/glyphstr.h
index 2df055dfd..2f51bd244 100644
--- a/xserver/render/glyphstr.h
+++ b/xserver/render/glyphstr.h
@@ -90,47 +90,31 @@ typedef struct _GlyphList {
PictFormatPtr format;
} GlyphListRec, *GlyphListPtr;
-extern _X_EXPORT void
+extern void
GlyphUninit(ScreenPtr pScreen);
-extern _X_EXPORT GlyphHashSetPtr FindGlyphHashSet(CARD32 filled);
-
-extern _X_EXPORT GlyphRefPtr
-FindGlyphRef(GlyphHashPtr hash,
- CARD32 signature, Bool match, unsigned char sha1[20]);
-
-extern _X_EXPORT GlyphPtr FindGlyphByHash(unsigned char sha1[20], int format);
-
-extern _X_EXPORT int
+extern GlyphPtr FindGlyphByHash(unsigned char sha1[20], int format);
+extern int
HashGlyph(xGlyphInfo * gi,
CARD8 *bits, unsigned long size, unsigned char sha1[20]);
-extern _X_EXPORT void
- FreeGlyph(GlyphPtr glyph, int format);
-
-extern _X_EXPORT void
+extern void
AddGlyph(GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id);
-extern _X_EXPORT Bool
+extern Bool
DeleteGlyph(GlyphSetPtr glyphSet, Glyph id);
-extern _X_EXPORT GlyphPtr FindGlyph(GlyphSetPtr glyphSet, Glyph id);
-
-extern _X_EXPORT GlyphPtr AllocateGlyph(xGlyphInfo * gi, int format);
-
-extern _X_EXPORT Bool
- AllocateGlyphHash(GlyphHashPtr hash, GlyphHashSetPtr hashSet);
+extern GlyphPtr FindGlyph(GlyphSetPtr glyphSet, Glyph id);
-extern _X_EXPORT Bool
- ResizeGlyphHash(GlyphHashPtr hash, CARD32 change, Bool global);
+extern GlyphPtr AllocateGlyph(xGlyphInfo * gi, int format);
-extern _X_EXPORT Bool
+extern Bool
ResizeGlyphSet(GlyphSetPtr glyphSet, CARD32 change);
-extern _X_EXPORT GlyphSetPtr AllocateGlyphSet(int fdepth, PictFormatPtr format);
+extern GlyphSetPtr AllocateGlyphSet(int fdepth, PictFormatPtr format);
-extern _X_EXPORT int
+extern int
FreeGlyphSet(void *value, XID gid);
#define GLYPH_HAS_GLYPH_PICTURE_ACCESSOR 1 /* used for api compat */
diff --git a/xserver/render/miindex.c b/xserver/render/miindex.c
index 0375e8f88..4119eef66 100644
--- a/xserver/render/miindex.c
+++ b/xserver/render/miindex.c
@@ -254,7 +254,7 @@ miInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat)
return FALSE;
pFormat->index.nvalues = num;
- pFormat->index.pValues = malloc(num * sizeof(xIndexValue));
+ pFormat->index.pValues = xallocarray(num, sizeof(xIndexValue));
if (!pFormat->index.pValues) {
free(pIndexed);
return FALSE;
diff --git a/xserver/render/mipict.c b/xserver/render/mipict.c
index a72510480..4b855122e 100644
--- a/xserver/render/mipict.c
+++ b/xserver/render/mipict.c
@@ -46,7 +46,7 @@ miDestroyPicture(PicturePtr pPicture)
RegionDestroy(pPicture->pCompositeClip);
}
-void
+static void
miDestroyPictureClip(PicturePtr pPicture)
{
if (pPicture->clientClip)
@@ -54,7 +54,7 @@ miDestroyPictureClip(PicturePtr pPicture)
pPicture->clientClip = NULL;
}
-int
+static int
miChangePictureClip(PicturePtr pPicture, int type, void *value, int n)
{
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
@@ -88,13 +88,13 @@ miChangePictureClip(PicturePtr pPicture, int type, void *value, int n)
return Success;
}
-void
+static void
miChangePicture(PicturePtr pPicture, Mask mask)
{
return;
}
-void
+static void
miValidatePicture(PicturePtr pPicture, Mask mask)
{
DrawablePtr pDrawable = pPicture->pDrawable;
@@ -211,13 +211,13 @@ miValidatePicture(PicturePtr pPicture, Mask mask)
}
}
-int
+static int
miChangePictureTransform(PicturePtr pPicture, PictTransform * transform)
{
return Success;
}
-int
+static int
miChangePictureFilter(PicturePtr pPicture,
int filter, xFixed * params, int nparams)
{
@@ -499,7 +499,7 @@ miRenderPixelToColor(PictFormatPtr format, CARD32 pixel, xRenderColor * color)
}
}
-void
+static void
miTriStrip(CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
@@ -510,7 +510,7 @@ miTriStrip(CARD8 op,
int ntri;
ntri = npoints - 2;
- tris = malloc(ntri * sizeof(xTriangle));
+ tris = xallocarray(ntri, sizeof(xTriangle));
if (!tris)
return;
@@ -523,7 +523,7 @@ miTriStrip(CARD8 op,
free(tris);
}
-void
+static void
miTriFan(CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
@@ -535,7 +535,7 @@ miTriFan(CARD8 op,
int ntri;
ntri = npoints - 2;
- tris = malloc(ntri * sizeof(xTriangle));
+ tris = xallocarray(ntri, sizeof(xTriangle));
if (!tris)
return;
diff --git a/xserver/render/mipict.h b/xserver/render/mipict.h
index 23ce9e8f6..3241be4b9 100644
--- a/xserver/render/mipict.h
+++ b/xserver/render/mipict.h
@@ -54,26 +54,6 @@ extern _X_EXPORT void
miDestroyPicture(PicturePtr pPicture);
extern _X_EXPORT void
- miDestroyPictureClip(PicturePtr pPicture);
-
-extern _X_EXPORT int
- miChangePictureClip(PicturePtr pPicture, int type, void *value, int n);
-
-extern _X_EXPORT void
- miChangePicture(PicturePtr pPicture, Mask mask);
-
-extern _X_EXPORT void
- miValidatePicture(PicturePtr pPicture, Mask mask);
-
-extern _X_EXPORT int
- miChangePictureTransform(PicturePtr pPicture, PictTransform * transform);
-
-extern _X_EXPORT int
-
-miChangePictureFilter(PicturePtr pPicture,
- int filter, xFixed * params, int nparams);
-
-extern _X_EXPORT void
miCompositeSourceValidate(PicturePtr pPicture);
extern _X_EXPORT Bool
@@ -122,22 +102,6 @@ miCompositeRects(CARD8 op,
xRenderColor * color, int nRect, xRectangle *rects);
extern _X_EXPORT void
-
-miTriStrip(CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
-
-extern _X_EXPORT void
-
-miTriFan(CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
-
-extern _X_EXPORT void
miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box);
extern _X_EXPORT void
diff --git a/xserver/render/picture.c b/xserver/render/picture.c
index 6e23e2bbf..9e4036e7d 100644
--- a/xserver/render/picture.c
+++ b/xserver/render/picture.c
@@ -61,7 +61,7 @@ PictureWindowFormat(WindowPtr pWindow)
WindowGetVisual(pWindow));
}
-Bool
+static Bool
PictureDestroyWindow(WindowPtr pWindow)
{
ScreenPtr pScreen = pWindow->drawable.pScreen;
@@ -82,7 +82,7 @@ PictureDestroyWindow(WindowPtr pWindow)
return ret;
}
-Bool
+static Bool
PictureCloseScreen(ScreenPtr pScreen)
{
PictureScreenPtr ps = GetPictureScreen(pScreen);
@@ -102,7 +102,7 @@ PictureCloseScreen(ScreenPtr pScreen)
return ret;
}
-void
+static void
PictureStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef)
{
ScreenPtr pScreen = pColormap->pScreen;
@@ -163,7 +163,7 @@ addFormat(FormatInitRec formats[256], int nformat, CARD32 format, CARD8 depth)
#define Mask(n) ((1 << (n)) - 1)
-PictFormatPtr
+static PictFormatPtr
PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp)
{
int nformats, f;
@@ -439,7 +439,7 @@ PictureFindVisual(ScreenPtr pScreen, VisualID visual)
return 0;
}
-Bool
+static Bool
PictureInitIndexedFormat(ScreenPtr pScreen, PictFormatPtr format)
{
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
@@ -625,6 +625,12 @@ GetPictureBytes(void *value, XID id, ResourceSizePtr size)
}
}
+static int
+FreePictFormat(void *pPictFormat, XID pid)
+{
+ return Success;
+}
+
Bool
PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
@@ -659,6 +665,9 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
for (n = 0; n < nformats; n++) {
if (!AddResource
(formats[n].id, PictFormatType, (void *) (formats + n))) {
+ int i;
+ for (i = 0; i < n; i++)
+ FreeResource(formats[i].id, RT_NONE);
free(formats);
return FALSE;
}
@@ -724,7 +733,7 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
return TRUE;
}
-void
+static void
SetPictureToDefaults(PicturePtr pPicture)
{
pPicture->refcnt = 1;
@@ -837,7 +846,7 @@ initGradient(SourcePictPtr pGradient, int stopCount,
dpos = stopPoints[i];
}
- pGradient->gradient.stops = malloc(stopCount * sizeof(PictGradientStop));
+ pGradient->gradient.stops = xallocarray(stopCount, sizeof(PictGradientStop));
if (!pGradient->gradient.stops) {
*error = BadAlloc;
return;
@@ -1435,12 +1444,6 @@ FreePicture(void *value, XID pid)
return Success;
}
-int
-FreePictFormat(void *pPictFormat, XID pid)
-{
- return Success;
-}
-
/**
* ReduceCompositeOp is used to choose simpler ops for cases where alpha
* channels are always one and so math on the alpha channel per pixel becomes
diff --git a/xserver/render/picture.h b/xserver/render/picture.h
index 66c85c56f..087e54d7a 100644
--- a/xserver/render/picture.h
+++ b/xserver/render/picture.h
@@ -169,11 +169,11 @@ typedef enum _PictFormatShort {
#define PictureCmapPolicyColor 3
#define PictureCmapPolicyAll 4
-extern _X_EXPORT int PictureCmapPolicy;
+extern int PictureCmapPolicy;
-extern _X_EXPORT int PictureParseCmapPolicy(const char *name);
+extern int PictureParseCmapPolicy(const char *name);
-extern _X_EXPORT int RenderErrBase;
+extern int RenderErrBase;
/* Fixed point updates from Carl Worth, USC, Information Sciences Institute */
diff --git a/xserver/render/picturestr.h b/xserver/render/picturestr.h
index 177f87b80..33baef9bf 100644
--- a/xserver/render/picturestr.h
+++ b/xserver/render/picturestr.h
@@ -344,16 +344,14 @@ typedef struct _PictureScreen {
} PictureScreenRec, *PictureScreenPtr;
extern _X_EXPORT DevPrivateKeyRec PictureScreenPrivateKeyRec;
-
#define PictureScreenPrivateKey (&PictureScreenPrivateKeyRec)
extern _X_EXPORT DevPrivateKeyRec PictureWindowPrivateKeyRec;
-
#define PictureWindowPrivateKey (&PictureWindowPrivateKeyRec)
-extern _X_EXPORT RESTYPE PictureType;
-extern _X_EXPORT RESTYPE PictFormatType;
-extern _X_EXPORT RESTYPE GlyphSetType;
+extern RESTYPE PictureType;
+extern RESTYPE PictFormatType;
+extern RESTYPE GlyphSetType;
#define GetPictureScreen(s) ((PictureScreenPtr)dixLookupPrivate(&(s)->devPrivates, PictureScreenPrivateKey))
#define GetPictureScreenIfSet(s) (dixPrivateKeyRegistered(PictureScreenPrivateKey) ? GetPictureScreen(s) : NULL)
@@ -380,27 +378,12 @@ extern _X_EXPORT PictFormatPtr
PictureWindowFormat(WindowPtr pWindow);
extern _X_EXPORT Bool
- PictureDestroyWindow(WindowPtr pWindow);
-
-extern _X_EXPORT Bool
- PictureCloseScreen(ScreenPtr pScreen);
-
-extern _X_EXPORT void
- PictureStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef);
-
-extern _X_EXPORT Bool
- PictureInitIndexedFormat(ScreenPtr pScreen, PictFormatPtr format);
-
-extern _X_EXPORT Bool
PictureSetSubpixelOrder(ScreenPtr pScreen, int subpixel);
extern _X_EXPORT int
PictureGetSubpixelOrder(ScreenPtr pScreen);
extern _X_EXPORT PictFormatPtr
-PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp);
-
-extern _X_EXPORT PictFormatPtr
PictureMatchVisual(ScreenPtr pScreen, int depth, VisualPtr pVisual);
extern _X_EXPORT PictFormatPtr
@@ -415,14 +398,12 @@ extern _X_EXPORT int
extern _X_EXPORT char *PictureGetFilterName(int id);
extern _X_EXPORT int
-
PictureAddFilter(ScreenPtr pScreen,
const char *filter,
PictFilterValidateParamsProcPtr ValidateParams,
int width, int height);
extern _X_EXPORT Bool
-
PictureSetFilterAlias(ScreenPtr pScreen, const char *filter, const char *alias);
extern _X_EXPORT Bool
@@ -435,21 +416,16 @@ extern _X_EXPORT PictFilterPtr
PictureFindFilter(ScreenPtr pScreen, char *name, int len);
extern _X_EXPORT int
-
SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter,
xFixed * params, int nparams);
extern _X_EXPORT int
-
SetPictureFilter(PicturePtr pPicture, char *name, int len,
xFixed * params, int nparams);
extern _X_EXPORT Bool
PictureFinishInit(void);
-extern _X_EXPORT void
- SetPictureToDefaults(PicturePtr pPicture);
-
extern _X_EXPORT PicturePtr
CreatePicture(Picture pid,
DrawablePtr pDrawable,
@@ -457,7 +433,6 @@ CreatePicture(Picture pid,
Mask mask, XID *list, ClientPtr client, int *error);
extern _X_EXPORT int
-
ChangePicture(PicturePtr pPicture,
Mask vmask, XID *vlist, DevUnion *ulist, ClientPtr client);
@@ -467,7 +442,6 @@ SetPictureClipRects(PicturePtr pPicture,
int xOrigin, int yOrigin, int nRect, xRectangle *rects);
extern _X_EXPORT int
-
SetPictureClipRegion(PicturePtr pPicture,
int xOrigin, int yOrigin, RegionPtr pRegion);
@@ -480,11 +454,7 @@ extern _X_EXPORT void
extern _X_EXPORT int
FreePicture(void *pPicture, XID pid);
-extern _X_EXPORT int
- FreePictFormat(void *pPictFormat, XID pid);
-
extern _X_EXPORT void
-
CompositePicture(CARD8 op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -496,7 +466,6 @@ CompositePicture(CARD8 op,
INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
extern _X_EXPORT void
-
CompositeGlyphs(CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
@@ -505,13 +474,11 @@ CompositeGlyphs(CARD8 op,
INT16 ySrc, int nlist, GlyphListPtr lists, GlyphPtr * glyphs);
extern _X_EXPORT void
-
CompositeRects(CARD8 op,
PicturePtr pDst,
xRenderColor * color, int nRect, xRectangle *rects);
extern _X_EXPORT void
-
CompositeTrapezoids(CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
@@ -519,7 +486,6 @@ CompositeTrapezoids(CARD8 op,
INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps);
extern _X_EXPORT void
-
CompositeTriangles(CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
@@ -528,7 +494,6 @@ CompositeTriangles(CARD8 op,
INT16 ySrc, int ntriangles, xTriangle * triangles);
extern _X_EXPORT void
-
CompositeTriStrip(CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
@@ -536,7 +501,6 @@ CompositeTriStrip(CARD8 op,
INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
extern _X_EXPORT void
-
CompositeTriFan(CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
@@ -547,12 +511,10 @@ Bool
AnimCurInit(ScreenPtr pScreen);
int
-
AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
CursorPtr *ppCursor, ClientPtr client, XID cid);
extern _X_EXPORT void
-
AddTraps(PicturePtr pPicture,
INT16 xOff, INT16 yOff, int ntraps, xTrap * traps);
@@ -583,8 +545,8 @@ CreateConicalGradientPicture(Picture pid,
xFixed * stops, xRenderColor * colors, int *error);
#ifdef PANORAMIX
-extern _X_EXPORT void PanoramiXRenderInit(void);
-extern _X_EXPORT void PanoramiXRenderReset(void);
+extern void PanoramiXRenderInit(void);
+extern void PanoramiXRenderReset(void);
#endif
/*
@@ -592,12 +554,10 @@ extern _X_EXPORT void PanoramiXRenderReset(void);
*/
extern _X_EXPORT void
-
PictTransform_from_xRenderTransform(PictTransformPtr pict,
xRenderTransform * render);
extern _X_EXPORT void
-
xRenderTransform_from_PictTransform(xRenderTransform * render,
PictTransformPtr pict);
diff --git a/xserver/render/render.c b/xserver/render/render.c
index 93e43e7a3..b777991d0 100644
--- a/xserver/render/render.c
+++ b/xserver/render/render.c
@@ -1318,14 +1318,14 @@ ProcRenderCompositeGlyphs(ClientPtr client)
if (nglyph <= NLOCALGLYPH)
glyphsBase = glyphsLocal;
else {
- glyphsBase = (GlyphPtr *) malloc(nglyph * sizeof(GlyphPtr));
+ glyphsBase = xallocarray(nglyph, sizeof(GlyphPtr));
if (!glyphsBase)
return BadAlloc;
}
if (nlist <= NLOCALDELTA)
listsBase = listsLocal;
else {
- listsBase = (GlyphListPtr) malloc(nlist * sizeof(GlyphListRec));
+ listsBase = xallocarray(nlist, sizeof(GlyphListRec));
if (!listsBase) {
rc = BadAlloc;
goto bail;
@@ -1793,7 +1793,7 @@ ProcRenderCreateAnimCursor(ClientPtr client)
ncursor =
(client->req_len -
(bytes_to_int32(sizeof(xRenderCreateAnimCursorReq)))) >> 1;
- cursors = malloc(ncursor * (sizeof(CursorPtr) + sizeof(CARD32)));
+ cursors = xallocarray(ncursor, sizeof(CursorPtr) + sizeof(CARD32));
if (!cursors)
return BadAlloc;
deltas = (CARD32 *) (cursors + ncursor);
diff --git a/xserver/test/Makefile.am b/xserver/test/Makefile.am
index 82578d977..9f13e269d 100644
--- a/xserver/test/Makefile.am
+++ b/xserver/test/Makefile.am
@@ -16,7 +16,7 @@ TESTS=$(noinst_PROGRAMS)
TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV)
AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-AM_CPPFLAGS = $(XORG_INCS) -I$(top_srcdir)/miext/cw
+AM_CPPFLAGS = $(XORG_INCS)
if XORG
AM_CPPFLAGS += -I$(top_srcdir)/hw/xfree86/parser \
-I$(top_srcdir)/hw/xfree86/ddc \
@@ -49,13 +49,14 @@ libxservertest_la_LIBADD += \
$(top_builddir)/hw/xfree86/loader/libloader.la \
$(top_builddir)/hw/xfree86/os-support/libxorgos.la \
$(top_builddir)/hw/xfree86/common/libcommon.la \
- $(top_builddir)/hw/xfree86/parser/libxf86config_internal.la \
+ $(top_builddir)/hw/xfree86/parser/libxf86config.la \
$(top_builddir)/hw/xfree86/dixmods/libdixmods.la \
$(top_builddir)/hw/xfree86/modes/libxf86modes.la \
$(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)/Xext/libXvidmode.la \
@XORG_LIBS@
BUILT_SOURCES = sdksyms.c
@@ -91,6 +92,7 @@ libxservertest_la_LIBADD += \
$(top_builddir)/render/librender.la \
$(top_builddir)/Xext/libXext.la \
$(top_builddir)/Xext/libXextdpmsstubs.la \
+ $(top_builddir)/Xext/libXvidmode.la \
$(top_builddir)/Xi/libXi.la \
$(top_builddir)/Xi/libXistubs.la \
$(top_builddir)/xfixes/libxfixes.la \
diff --git a/xserver/test/Makefile.in b/xserver/test/Makefile.in
index 859725c8a..ab1f7becd 100644
--- a/xserver/test/Makefile.in
+++ b/xserver/test/Makefile.in
@@ -69,13 +69,14 @@ host_triplet = @host@
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/loader/libloader.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/common/libcommon.la \
-@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/parser/libxf86config_internal.la \
+@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/parser/libxf86config.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \
@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)/Xext/libXvidmode.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ @XORG_LIBS@
@DRI_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_7 = $(top_builddir)/hw/xfree86/dri/libdri.la
@@ -91,6 +92,7 @@ host_triplet = @host@
@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/render/librender.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xext/libXext.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xext/libXextdpmsstubs.la \
+@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xext/libXvidmode.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xi/libXi.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/Xi/libXistubs.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/xfixes/libxfixes.la \
@@ -126,8 +128,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -145,13 +146,14 @@ am__DEPENDENCIES_1 =
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/hw/xfree86/loader/libloader.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/common/libcommon.la \
-@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/parser/libxf86config_internal.la \
+@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/parser/libxf86config.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \
@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/dixmods/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
@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@nodist_libxservertest_la_OBJECTS = \
@@ -399,7 +401,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -529,8 +530,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -659,9 +658,7 @@ top_srcdir = @top_srcdir@
@ENABLE_UNIT_TESTS_TRUE@TESTS = $(noinst_PROGRAMS)
@ENABLE_UNIT_TESTS_TRUE@TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV)
@ENABLE_UNIT_TESTS_TRUE@AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-@ENABLE_UNIT_TESTS_TRUE@AM_CPPFLAGS = $(XORG_INCS) \
-@ENABLE_UNIT_TESTS_TRUE@ -I$(top_srcdir)/miext/cw \
-@ENABLE_UNIT_TESTS_TRUE@ $(am__append_4)
+@ENABLE_UNIT_TESTS_TRUE@AM_CPPFLAGS = $(XORG_INCS) $(am__append_4)
@ENABLE_UNIT_TESTS_TRUE@TEST_LDADD = libxservertest.la \
@ENABLE_UNIT_TESTS_TRUE@ $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) \
@ENABLE_UNIT_TESTS_TRUE@ $(GLX_SYS_LIBS) $(am__append_5) \
diff --git a/xserver/test/README b/xserver/test/README
index 5759a72fd..618130ce0 100644
--- a/xserver/test/README
+++ b/xserver/test/README
@@ -1,8 +1,7 @@
X server test suite
This suite contains a set of tests to verify the behaviour of functions used
-internally to the server. This test suite is based on glib's testing
-framework [1].
+internally to the server.
= How it works =
Through some automake abuse, we link the test programs with the same static
@@ -15,7 +14,7 @@ of the X server. Unless the test suite replicates the expected state, which
may be difficult.
= How to run the tests =
-Run "make check" the test directory. This will compile the tests and execute
+Run "make check" in the test directory. This will compile the tests and execute
them in the order specified in the TESTS variable in test/Makefile.am.
Each set of tests related to a subsystem are available as a binary that can be
@@ -23,14 +22,4 @@ executed directly. For example, run "xkb" to perform some xkb-related tests.
== Adding a new test ==
When adding a new test, ensure that you add a short description of what the
-test does and what the expected outcome is. If the test reproduces a
-particular bug, using g_test_bug().
-
-== Misc ==
-
-The programs "gtester" and "gtester-report" may be used to generate XML/HTML
-log files of tests succeeded and failed.
-
----------
-
-[1] http://library.gnome.org/devel/glib/stable/glib-Testing.html
+test does and what the expected outcome is.
diff --git a/xserver/test/input.c b/xserver/test/input.c
index a4615c9c9..91ee43c46 100644
--- a/xserver/test/input.c
+++ b/xserver/test/input.c
@@ -1358,6 +1358,68 @@ dix_valuator_mode(void)
}
static void
+dix_input_valuator_masks_unaccel(void)
+{
+ ValuatorMask *mask = NULL;
+ double x, ux;
+
+ /* set mask normally */
+ mask = valuator_mask_new(MAX_VALUATORS);
+ assert(!valuator_mask_has_unaccelerated(mask));
+ valuator_mask_set_double(mask, 0, 1.0);
+ assert(!valuator_mask_has_unaccelerated(mask));
+ valuator_mask_unset(mask, 0);
+ assert(!valuator_mask_has_unaccelerated(mask));
+
+ /* all unset, now set accel mask */
+ valuator_mask_set_unaccelerated(mask, 0, 1.0, 2.0);
+ assert(valuator_mask_has_unaccelerated(mask));
+ assert(valuator_mask_isset(mask, 0));
+ assert(!valuator_mask_isset(mask, 1));
+ assert(valuator_mask_get_accelerated(mask, 0) == 1.0);
+ assert(valuator_mask_get_unaccelerated(mask, 0) == 2.0);
+ assert(valuator_mask_fetch_unaccelerated(mask, 0, &x, &ux));
+ assert(x == 1.0);
+ assert(ux == 2.0);
+ x = 0xff;
+ ux = 0xfe;
+ assert(!valuator_mask_fetch_unaccelerated(mask, 1, &x, &ux));
+ assert(x == 0xff);
+ assert(ux == 0xfe);
+
+ /* all unset, now set normally again */
+ valuator_mask_unset(mask, 0);
+ assert(!valuator_mask_has_unaccelerated(mask));
+ assert(!valuator_mask_isset(mask, 0));
+ valuator_mask_set_double(mask, 0, 1.0);
+ assert(!valuator_mask_has_unaccelerated(mask));
+ valuator_mask_unset(mask, 0);
+ assert(!valuator_mask_has_unaccelerated(mask));
+
+ valuator_mask_zero(mask);
+ assert(!valuator_mask_has_unaccelerated(mask));
+
+ valuator_mask_set_unaccelerated(mask, 0, 1.0, 2.0);
+ valuator_mask_set_unaccelerated(mask, 1, 3.0, 4.5);
+ assert(valuator_mask_isset(mask, 0));
+ assert(valuator_mask_isset(mask, 1));
+ assert(!valuator_mask_isset(mask, 2));
+ assert(valuator_mask_has_unaccelerated(mask));
+ assert(valuator_mask_get_accelerated(mask, 0) == 1.0);
+ assert(valuator_mask_get_accelerated(mask, 1) == 3.0);
+ assert(valuator_mask_get_unaccelerated(mask, 0) == 2.0);
+ assert(valuator_mask_get_unaccelerated(mask, 1) == 4.5);
+ assert(valuator_mask_fetch_unaccelerated(mask, 0, &x, &ux));
+ assert(x == 1.0);
+ assert(ux == 2.0);
+ assert(valuator_mask_fetch_unaccelerated(mask, 1, &x, &ux));
+ assert(x == 3.0);
+ assert(ux == 4.5);
+
+ valuator_mask_free(&mask);
+}
+
+static void
include_bit_test_macros(void)
{
uint8_t mask[9] = { 0 };
@@ -1847,6 +1909,7 @@ main(int argc, char **argv)
dix_enqueue_events();
dix_double_fp_conversion();
dix_input_valuator_masks();
+ dix_input_valuator_masks_unaccel();
dix_input_attributes();
dix_init_valuators();
dix_event_to_core_conversion();
diff --git a/xserver/test/xi1/Makefile.in b/xserver/test/xi1/Makefile.in
index ed7633458..3e657ecb1 100644
--- a/xserver/test/xi1/Makefile.in
+++ b/xserver/test/xi1/Makefile.in
@@ -59,8 +59,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -240,7 +239,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -370,8 +368,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/test/xi2/Makefile.in b/xserver/test/xi2/Makefile.in
index ff9478fdc..0850d63fd 100644
--- a/xserver/test/xi2/Makefile.in
+++ b/xserver/test/xi2/Makefile.in
@@ -69,8 +69,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -370,7 +369,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -500,8 +498,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/xfixes/Makefile.am b/xserver/xfixes/Makefile.am
index a8425e8ea..2a95c065b 100644
--- a/xserver/xfixes/Makefile.am
+++ b/xserver/xfixes/Makefile.am
@@ -2,10 +2,6 @@ noinst_LTLIBRARIES = libxfixes.la
AM_CFLAGS = $(DIX_CFLAGS)
-if XORG
-sdk_HEADERS = xfixes.h
-endif
-
libxfixes_la_SOURCES = \
cursor.c \
region.c \
diff --git a/xserver/xfixes/Makefile.in b/xserver/xfixes/Makefile.in
index 4a0afb71c..2274b4186 100644
--- a/xserver/xfixes/Makefile.in
+++ b/xserver/xfixes/Makefile.in
@@ -14,7 +14,6 @@
@SET_MAKE@
-
VPATH = @srcdir@
am__make_dryrun = \
{ \
@@ -52,14 +51,13 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = xfixes
-DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -123,36 +121,6 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
-am__sdk_HEADERS_DIST = xfixes.h
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__installdirs = "$(DESTDIR)$(sdkdir)"
-HEADERS = $(sdk_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -247,7 +215,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -377,8 +344,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -504,7 +469,6 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = libxfixes.la
AM_CFLAGS = $(DIX_CFLAGS)
-@XORG_TRUE@sdk_HEADERS = xfixes.h
libxfixes_la_SOURCES = \
cursor.c \
region.c \
@@ -600,27 +564,6 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-install-sdkHEADERS: $(sdk_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(sdkdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(sdkdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(sdkdir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(sdkdir)" || exit $$?; \
- done
-
-uninstall-sdkHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(sdkdir)'; $(am__uninstall_files_from_dir)
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -720,11 +663,8 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+all-am: Makefile $(LTLIBRARIES)
installdirs:
- for dir in "$(DESTDIR)$(sdkdir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
@@ -778,7 +718,7 @@ info: info-am
info-am:
-install-data-am: install-sdkHEADERS
+install-data-am:
install-dvi: install-dvi-am
@@ -824,7 +764,7 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-sdkHEADERS
+uninstall-am:
.MAKE: install-am install-strip
@@ -836,11 +776,11 @@ uninstall-am: uninstall-sdkHEADERS
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-sdkHEADERS install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
+ 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 uninstall-sdkHEADERS
+ tags uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/xserver/xfixes/cursor.c b/xserver/xfixes/cursor.c
index 94d24a8e2..10f9b2346 100644
--- a/xserver/xfixes/cursor.c
+++ b/xserver/xfixes/cursor.c
@@ -306,11 +306,9 @@ CopyCursorToImage(CursorPtr pCursor, CARD32 *image)
int height = pCursor->bits->height;
int npixels = width * height;
-#ifdef ARGB_CURSOR
if (pCursor->bits->argb)
memcpy(image, pCursor->bits->argb, npixels * sizeof(CARD32));
else
-#endif
{
unsigned char *srcLine = pCursor->bits->source;
unsigned char *mskLine = pCursor->bits->mask;
@@ -776,10 +774,8 @@ createCursorHideCount(ClientPtr pClient, ScreenPtr pScreen)
* Create a resource for this element so it can be deleted
* when the client goes away.
*/
- if (!AddResource(pChc->resource, CursorHideCountType, (void *) pChc)) {
- free(pChc);
+ if (!AddResource(pChc->resource, CursorHideCountType, (void *) pChc))
return BadAlloc;
- }
return Success;
}
diff --git a/xserver/xfixes/region.c b/xserver/xfixes/region.c
index 4492f1267..dd74d7f7e 100644
--- a/xserver/xfixes/region.c
+++ b/xserver/xfixes/region.c
@@ -777,7 +777,7 @@ ProcXFixesExpandRegion(ClientPtr client)
nBoxes = RegionNumRects(pSource);
pSrc = RegionRects(pSource);
if (nBoxes) {
- pTmp = malloc(nBoxes * sizeof(BoxRec));
+ pTmp = xallocarray(nBoxes, sizeof(BoxRec));
if (!pTmp)
return BadAlloc;
for (i = 0; i < nBoxes; i++) {
diff --git a/xserver/xfixes/xfixes.h b/xserver/xfixes/xfixes.h
index fdcf44f3f..23f31cde4 100644
--- a/xserver/xfixes/xfixes.h
+++ b/xserver/xfixes/xfixes.h
@@ -29,8 +29,8 @@
#include "resource.h"
-extern _X_EXPORT RESTYPE RegionResType;
-extern _X_EXPORT int XFixesErrorBase;
+extern RESTYPE RegionResType;
+extern int XFixesErrorBase;
#define VERIFY_REGION(pRegion, rid, client, mode) \
do { \
@@ -48,7 +48,7 @@ extern _X_EXPORT int XFixesErrorBase;
if (rid) VERIFY_REGION(pRegion, rid, client, mode); \
}
-extern _X_EXPORT RegionPtr
+extern RegionPtr
XFixesRegionCopy(RegionPtr pRegion);
#include "xibarriers.h"
diff --git a/xserver/xkb/Makefile.in b/xserver/xkb/Makefile.in
index 7ec7ad2e0..a67851c89 100644
--- a/xserver/xkb/Makefile.in
+++ b/xserver/xkb/Makefile.in
@@ -58,8 +58,7 @@ 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)/m4/xorg-tls.m4 \
- $(top_srcdir)/configure.ac
+ $(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
@@ -255,7 +254,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_SYS_LIBS = @GLX_SYS_LIBS@
-GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
@@ -385,8 +383,6 @@ XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
-XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
diff --git a/xserver/xkb/XKBAlloc.c b/xserver/xkb/XKBAlloc.c
index 78c98371d..18557b804 100644
--- a/xserver/xkb/XKBAlloc.c
+++ b/xserver/xkb/XKBAlloc.c
@@ -56,8 +56,8 @@ XkbAllocCompatMap(XkbDescPtr xkb, unsigned which, unsigned nSI)
if (compat->sym_interpret == NULL)
compat->num_si = 0;
prev_interpret = compat->sym_interpret;
- compat->sym_interpret = realloc(compat->sym_interpret,
- nSI * sizeof(XkbSymInterpretRec));
+ compat->sym_interpret = reallocarray(compat->sym_interpret,
+ nSI, sizeof(XkbSymInterpretRec));
if (compat->sym_interpret == NULL) {
free(prev_interpret);
compat->size_si = compat->num_si = 0;
@@ -159,9 +159,9 @@ XkbAllocNames(XkbDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases)
else if (nTotalAliases > names->num_key_aliases) {
XkbKeyAliasRec *prev_aliases = names->key_aliases;
- names->key_aliases = realloc(names->key_aliases,
- nTotalAliases *
- sizeof(XkbKeyAliasRec));
+ names->key_aliases = reallocarray(names->key_aliases,
+ nTotalAliases,
+ sizeof(XkbKeyAliasRec));
if (names->key_aliases != NULL) {
memset(&names->key_aliases[names->num_key_aliases], 0,
(nTotalAliases -
@@ -184,8 +184,8 @@ XkbAllocNames(XkbDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases)
else if (nTotalRG > names->num_rg) {
Atom *prev_radio_groups = names->radio_groups;
- names->radio_groups = realloc(names->radio_groups,
- nTotalRG * sizeof(Atom));
+ names->radio_groups = reallocarray(names->radio_groups,
+ nTotalRG, sizeof(Atom));
if (names->radio_groups != NULL) {
memset(&names->radio_groups[names->num_rg], 0,
(nTotalRG - names->num_rg) * sizeof(Atom));
diff --git a/xserver/xkb/XKBGAlloc.c b/xserver/xkb/XKBGAlloc.c
index 25917d304..e9f55fa43 100644
--- a/xserver/xkb/XKBGAlloc.c
+++ b/xserver/xkb/XKBGAlloc.c
@@ -409,7 +409,7 @@ XkbGeomRealloc(void **buffer, int szItems, int nrItems,
return FALSE;
/* Check if there is need to resize. */
if (nrItems != szItems)
- if (!(items = realloc(items, nrItems * itemSize)))
+ if (!(items = reallocarray(items, nrItems, itemSize)))
return FALSE;
/* Clear specified items to zero. */
switch (clearance) {
diff --git a/xserver/xkb/XKBMAlloc.c b/xserver/xkb/XKBMAlloc.c
index 37ed1a725..dbc1389e6 100644
--- a/xserver/xkb/XKBMAlloc.c
+++ b/xserver/xkb/XKBMAlloc.c
@@ -80,7 +80,7 @@ XkbAllocClientMap(XkbDescPtr xkb, unsigned which, unsigned nTotalTypes)
XkbKeyTypeRec *prev_types = map->types;
map->types =
- realloc(map->types, nTotalTypes * sizeof(XkbKeyTypeRec));
+ reallocarray(map->types, nTotalTypes, sizeof(XkbKeyTypeRec));
if (map->types == NULL) {
free(prev_types);
map->num_types = map->size_types = 0;
@@ -177,7 +177,7 @@ XkbAllocServerMap(XkbDescPtr xkb, unsigned which, unsigned nNewActions)
XkbAction *prev_acts = map->acts;
need = map->num_acts + nNewActions;
- map->acts = realloc(map->acts, need * sizeof(XkbAction));
+ map->acts = reallocarray(map->acts, need, sizeof(XkbAction));
if (map->acts == NULL) {
free(prev_acts);
map->num_acts = map->size_acts = 0;
@@ -309,7 +309,7 @@ XkbResizeKeyType(XkbDescPtr xkb,
if ((map_count > type->map_count) || (type->map == NULL))
type->map =
- realloc(type->map, map_count * sizeof(XkbKTMapEntryRec));
+ reallocarray(type->map, map_count, sizeof(XkbKTMapEntryRec));
if (!type->map) {
free(prev_map);
return BadAlloc;
@@ -318,8 +318,8 @@ XkbResizeKeyType(XkbDescPtr xkb,
XkbModsRec *prev_preserve = type->preserve;
if ((map_count > type->map_count) || (type->preserve == NULL)) {
- type->preserve = realloc(type->preserve,
- map_count * sizeof(XkbModsRec));
+ type->preserve = reallocarray(type->preserve,
+ map_count, sizeof(XkbModsRec));
}
if (!type->preserve) {
free(prev_preserve);
@@ -336,8 +336,8 @@ XkbResizeKeyType(XkbDescPtr xkb,
if ((new_num_lvls > type->num_levels) || (type->level_names == NULL)) {
Atom *prev_level_names = type->level_names;
- type->level_names = realloc(type->level_names,
- new_num_lvls * sizeof(Atom));
+ type->level_names = reallocarray(type->level_names,
+ new_num_lvls, sizeof(Atom));
if (!type->level_names) {
free(prev_level_names);
return BadAlloc;
@@ -659,9 +659,9 @@ XkbChangeKeycodeRange(XkbDescPtr xkb,
if (xkb->map->key_sym_map) {
XkbSymMapRec *prev_key_sym_map = xkb->map->key_sym_map;
- xkb->map->key_sym_map = realloc(xkb->map->key_sym_map,
- (maxKC +
- 1) * sizeof(XkbSymMapRec));
+ xkb->map->key_sym_map = reallocarray(xkb->map->key_sym_map,
+ maxKC + 1,
+ sizeof(XkbSymMapRec));
if (!xkb->map->key_sym_map) {
free(prev_key_sym_map);
return BadAlloc;
@@ -680,8 +680,9 @@ XkbChangeKeycodeRange(XkbDescPtr xkb,
if (xkb->map->modmap) {
unsigned char *prev_modmap = xkb->map->modmap;
- xkb->map->modmap = realloc(xkb->map->modmap,
- (maxKC + 1) * sizeof(unsigned char));
+ xkb->map->modmap = reallocarray(xkb->map->modmap,
+ maxKC + 1,
+ sizeof(unsigned char));
if (!xkb->map->modmap) {
free(prev_modmap);
return BadAlloc;
@@ -702,9 +703,9 @@ XkbChangeKeycodeRange(XkbDescPtr xkb,
if (xkb->server->behaviors) {
XkbBehavior *prev_behaviors = xkb->server->behaviors;
- xkb->server->behaviors = realloc(xkb->server->behaviors,
- (maxKC +
- 1) * sizeof(XkbBehavior));
+ xkb->server->behaviors = reallocarray(xkb->server->behaviors,
+ maxKC + 1,
+ sizeof(XkbBehavior));
if (!xkb->server->behaviors) {
free(prev_behaviors);
return BadAlloc;
@@ -724,9 +725,9 @@ XkbChangeKeycodeRange(XkbDescPtr xkb,
if (xkb->server->key_acts) {
unsigned short *prev_key_acts = xkb->server->key_acts;
- xkb->server->key_acts = realloc(xkb->server->key_acts,
- (maxKC +
- 1) * sizeof(unsigned short));
+ xkb->server->key_acts = reallocarray(xkb->server->key_acts,
+ maxKC + 1,
+ sizeof(unsigned short));
if (!xkb->server->key_acts) {
free(prev_key_acts);
return BadAlloc;
@@ -746,9 +747,9 @@ XkbChangeKeycodeRange(XkbDescPtr xkb,
if (xkb->server->vmodmap) {
unsigned short *prev_vmodmap = xkb->server->vmodmap;
- xkb->server->vmodmap = realloc(xkb->server->vmodmap,
- (maxKC +
- 1) * sizeof(unsigned short));
+ xkb->server->vmodmap = reallocarray(xkb->server->vmodmap,
+ maxKC + 1,
+ sizeof(unsigned short));
if (!xkb->server->vmodmap) {
free(prev_vmodmap);
return BadAlloc;
@@ -769,8 +770,8 @@ XkbChangeKeycodeRange(XkbDescPtr xkb,
if ((xkb->names) && (xkb->names->keys)) {
XkbKeyNameRec *prev_keys = xkb->names->keys;
- xkb->names->keys = realloc(xkb->names->keys,
- (maxKC + 1) * sizeof(XkbKeyNameRec));
+ xkb->names->keys = reallocarray(xkb->names->keys,
+ maxKC + 1, sizeof(XkbKeyNameRec));
if (!xkb->names->keys) {
free(prev_keys);
return BadAlloc;
diff --git a/xserver/xkb/maprules.c b/xserver/xkb/maprules.c
index 28148d9a5..8e2277969 100644
--- a/xserver/xkb/maprules.c
+++ b/xserver/xkb/maprules.c
@@ -89,11 +89,11 @@ InputLineAddChar(InputLine * line, int ch)
{
if (line->num_line >= line->sz_line) {
if (line->line == line->buf) {
- line->line = malloc(line->sz_line * 2);
+ line->line = xallocarray(line->sz_line, 2);
memcpy(line->line, line->buf, line->sz_line);
}
else {
- line->line = realloc((char *) line->line, line->sz_line * 2);
+ line->line = reallocarray(line->line, line->sz_line, 2);
}
line->sz_line *= 2;
}
@@ -897,8 +897,8 @@ XkbRF_AddRule(XkbRF_RulesPtr rules)
}
else if (rules->num_rules >= rules->sz_rules) {
rules->sz_rules *= 2;
- rules->rules = realloc(rules->rules,
- rules->sz_rules * sizeof(XkbRF_RuleRec));
+ rules->rules = reallocarray(rules->rules,
+ rules->sz_rules, sizeof(XkbRF_RuleRec));
}
if (!rules->rules) {
rules->sz_rules = rules->num_rules = 0;
@@ -919,8 +919,8 @@ XkbRF_AddGroup(XkbRF_RulesPtr rules)
}
else if (rules->num_groups >= rules->sz_groups) {
rules->sz_groups *= 2;
- rules->groups = realloc(rules->groups,
- rules->sz_groups * sizeof(XkbRF_GroupRec));
+ rules->groups = reallocarray(rules->groups,
+ rules->sz_groups, sizeof(XkbRF_GroupRec));
}
if (!rules->groups) {
rules->sz_groups = rules->num_groups = 0;
diff --git a/xserver/xkb/xkb.c b/xserver/xkb/xkb.c
index f3988f9a7..294cdf8a3 100644
--- a/xserver/xkb/xkb.c
+++ b/xserver/xkb/xkb.c
@@ -2216,12 +2216,11 @@ SetKeyBehaviors(XkbSrvInfoPtr xkbi,
}
if (maxRG > (int) xkbi->nRadioGroups) {
- int sz = maxRG * sizeof(XkbRadioGroupRec);
-
if (xkbi->radioGroups)
- xkbi->radioGroups = realloc(xkbi->radioGroups, sz);
+ xkbi->radioGroups = reallocarray(xkbi->radioGroups, maxRG,
+ sizeof(XkbRadioGroupRec));
else
- xkbi->radioGroups = calloc(1, sz);
+ xkbi->radioGroups = calloc(maxRG, sizeof(XkbRadioGroupRec));
if (xkbi->radioGroups) {
if (xkbi->nRadioGroups)
memset(&xkbi->radioGroups[xkbi->nRadioGroups], 0,
@@ -2700,15 +2699,16 @@ XkbSendCompatMap(ClientPtr client,
char *data;
int size;
- size = rep->length * 4;
- if (size > 0) {
- data = malloc(size);
+ if (rep->length > 0) {
+ data = xallocarray(rep->length, 4);
if (data) {
register unsigned i, bit;
xkbModsWireDesc *grp;
XkbSymInterpretPtr sym = &compat->sym_interpret[rep->firstSI];
xkbSymInterpretWireDesc *wire = (xkbSymInterpretWireDesc *) data;
+ size = rep->length * 4;
+
for (i = 0; i < rep->nSI; i++, sym++, wire++) {
wire->sym = sym->sym;
wire->mods = sym->mods;
@@ -2856,9 +2856,9 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
if ((unsigned) (req->firstSI + req->nSI) > compat->num_si) {
compat->num_si = req->firstSI + req->nSI;
- compat->sym_interpret = realloc(compat->sym_interpret,
- compat->num_si *
- sizeof(XkbSymInterpretRec));
+ compat->sym_interpret = reallocarray(compat->sym_interpret,
+ compat->num_si,
+ sizeof(XkbSymInterpretRec));
if (!compat->sym_interpret) {
compat->num_si = 0;
return BadAlloc;
@@ -3086,14 +3086,15 @@ XkbSendIndicatorMap(ClientPtr client,
register int i;
register unsigned bit;
- length = rep->length * 4;
- if (length > 0) {
+ if (rep->length > 0) {
CARD8 *to;
- to = map = malloc(length);
+ to = map = xallocarray(rep->length, 4);
if (map) {
xkbIndicatorMapWireDesc *wire = (xkbIndicatorMapWireDesc *) to;
+ length = rep->length * 4;
+
for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) {
if (rep->which & bit) {
wire->flags = indicators->maps[i].flags;
@@ -4863,7 +4864,6 @@ XkbComputeGetGeometryReplySize(XkbGeometryPtr geom,
}
return Success;
}
-
static int
XkbSendGeometry(ClientPtr client,
XkbGeometryPtr geom, xkbGetGeometryReply * rep, Bool freeGeom)
@@ -4872,10 +4872,10 @@ XkbSendGeometry(ClientPtr client,
int len;
if (geom != NULL) {
- len = rep->length * 4;
- start = desc = malloc(len);
+ start = desc = xallocarray(rep->length, 4);
if (!start)
return BadAlloc;
+ len = rep->length * 4;
desc = XkbWriteCountedString(desc, geom->label_font, client->swapped);
if (rep->nProperties > 0)
desc = XkbWriteGeomProperties(desc, geom, client->swapped);
diff --git a/xserver/xkb/xkbActions.c b/xserver/xkb/xkbActions.c
index 2a196f151..1a9878dda 100644
--- a/xserver/xkb/xkbActions.c
+++ b/xserver/xkb/xkbActions.c
@@ -181,6 +181,7 @@ _XkbFilterSetState(XkbSrvInfoPtr xkbi,
XkbFilterPtr filter, unsigned keycode, XkbAction *pAction)
{
if (filter->keycode == 0) { /* initial press */
+ AccessXCancelRepeatKey(xkbi, keycode);
filter->keycode = keycode;
filter->active = 1;
filter->filterOthers = ((pAction->mods.mask & XkbSA_ClearLocks) != 0);
@@ -354,6 +355,9 @@ static int
_XkbFilterLockState(XkbSrvInfoPtr xkbi,
XkbFilterPtr filter, unsigned keycode, XkbAction *pAction)
{
+ if (filter->keycode == 0) /* initial press */
+ AccessXCancelRepeatKey(xkbi, keycode);
+
if (pAction && (pAction->type == XkbSA_LockGroup)) {
if (pAction->group.flags & XkbSA_GroupAbsolute)
xkbi->state.locked_group = XkbSAGroup(&pAction->group);
@@ -635,6 +639,7 @@ _XkbFilterPointerBtn(XkbSrvInfoPtr xkbi,
}
break;
}
+ return 0;
}
else if (filter->keycode == keycode) {
int button = filter->upAction.btn.button;
@@ -660,8 +665,9 @@ _XkbFilterPointerBtn(XkbSrvInfoPtr xkbi,
break;
}
filter->active = 0;
+ return 0;
}
- return 0;
+ return 1;
}
static int
@@ -678,6 +684,7 @@ _XkbFilterControls(XkbSrvInfoPtr xkbi,
ctrls = xkbi->desc->ctrls;
old = *ctrls;
if (filter->keycode == 0) { /* initial press */
+ AccessXCancelRepeatKey(xkbi, keycode);
filter->keycode = keycode;
filter->active = 1;
filter->filterOthers = 0;
@@ -1103,8 +1110,8 @@ _XkbNextFreeFilter(XkbSrvInfoPtr xkbi)
}
}
xkbi->szFilters *= 2;
- xkbi->filters = realloc(xkbi->filters,
- xkbi->szFilters * sizeof(XkbFilterRec));
+ xkbi->filters = reallocarray(xkbi->filters,
+ xkbi->szFilters, sizeof(XkbFilterRec));
/* 6/21/93 (ef) -- XXX! deal with allocation failure */
memset(&xkbi->filters[xkbi->szFilters / 2], 0,
(xkbi->szFilters / 2) * sizeof(XkbFilterRec));
diff --git a/xserver/xkb/xkbUtils.c b/xserver/xkb/xkbUtils.c
index 6019f0f31..25b5a364e 100644
--- a/xserver/xkb/xkbUtils.c
+++ b/xserver/xkb/xkbUtils.c
@@ -946,8 +946,8 @@ _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst)
if (src->map->syms) {
if (src->map->size_syms != dst->map->size_syms) {
- tmp = realloc(dst->map->syms,
- src->map->size_syms * sizeof(KeySym));
+ tmp = reallocarray(dst->map->syms,
+ src->map->size_syms, sizeof(KeySym));
if (!tmp)
return FALSE;
dst->map->syms = tmp;
@@ -965,8 +965,8 @@ _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst)
if (src->map->key_sym_map) {
if (src->max_key_code != dst->max_key_code) {
- tmp = realloc(dst->map->key_sym_map,
- (src->max_key_code + 1) * sizeof(XkbSymMapRec));
+ tmp = reallocarray(dst->map->key_sym_map,
+ src->max_key_code + 1, sizeof(XkbSymMapRec));
if (!tmp)
return FALSE;
dst->map->key_sym_map = tmp;
@@ -983,8 +983,8 @@ _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst)
if (src->map->num_types > dst->map->size_types ||
!dst->map->types || !dst->map->size_types) {
if (dst->map->types && dst->map->size_types) {
- tmp = realloc(dst->map->types,
- src->map->num_types * sizeof(XkbKeyTypeRec));
+ tmp = reallocarray(dst->map->types, src->map->num_types,
+ sizeof(XkbKeyTypeRec));
if (!tmp)
return FALSE;
dst->map->types = tmp;
@@ -1020,8 +1020,8 @@ _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst)
if (stype->num_levels != dtype->num_levels &&
dtype->num_levels && dtype->level_names &&
i < dst->map->num_types) {
- tmp = realloc(dtype->level_names,
- stype->num_levels * sizeof(Atom));
+ tmp = reallocarray(dtype->level_names,
+ stype->num_levels, sizeof(Atom));
if (!tmp)
continue;
dtype->level_names = tmp;
@@ -1053,17 +1053,17 @@ _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst)
if (stype->map_count != dtype->map_count &&
dtype->map_count && dtype->map &&
i < dst->map->num_types) {
- tmp = realloc(dtype->map,
- stype->map_count *
- sizeof(XkbKTMapEntryRec));
+ tmp = reallocarray(dtype->map,
+ stype->map_count,
+ sizeof(XkbKTMapEntryRec));
if (!tmp)
return FALSE;
dtype->map = tmp;
}
else if (!dtype->map_count || !dtype->map ||
i >= dst->map->num_types) {
- tmp = malloc(stype->map_count *
- sizeof(XkbKTMapEntryRec));
+ tmp = xallocarray(stype->map_count,
+ sizeof(XkbKTMapEntryRec));
if (!tmp)
return FALSE;
dtype->map = tmp;
@@ -1082,16 +1082,17 @@ _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst)
if (stype->map_count != dtype->map_count &&
dtype->map_count && dtype->preserve &&
i < dst->map->num_types) {
- tmp = realloc(dtype->preserve,
- stype->map_count *
- sizeof(XkbModsRec));
+ tmp = reallocarray(dtype->preserve,
+ stype->map_count,
+ sizeof(XkbModsRec));
if (!tmp)
return FALSE;
dtype->preserve = tmp;
}
else if (!dtype->preserve || !dtype->map_count ||
i >= dst->map->num_types) {
- tmp = malloc(stype->map_count * sizeof(XkbModsRec));
+ tmp = xallocarray(stype->map_count,
+ sizeof(XkbModsRec));
if (!tmp)
return FALSE;
dtype->preserve = tmp;
@@ -1192,8 +1193,8 @@ _XkbCopyServerMap(XkbDescPtr src, XkbDescPtr dst)
if (src->server->acts) {
if (src->server->size_acts != dst->server->size_acts) {
- tmp = realloc(dst->server->acts,
- src->server->size_acts * sizeof(XkbAction));
+ tmp = reallocarray(dst->server->acts,
+ src->server->size_acts, sizeof(XkbAction));
if (!tmp)
return FALSE;
dst->server->acts = tmp;
@@ -1210,8 +1211,8 @@ _XkbCopyServerMap(XkbDescPtr src, XkbDescPtr dst)
if (src->server->key_acts) {
if (src->max_key_code != dst->max_key_code) {
- tmp = realloc(dst->server->key_acts,
- (src->max_key_code + 1) * sizeof(unsigned short));
+ tmp = reallocarray(dst->server->key_acts,
+ src->max_key_code + 1, sizeof(unsigned short));
if (!tmp)
return FALSE;
dst->server->key_acts = tmp;
@@ -1226,8 +1227,8 @@ _XkbCopyServerMap(XkbDescPtr src, XkbDescPtr dst)
if (src->server->behaviors) {
if (src->max_key_code != dst->max_key_code) {
- tmp = realloc(dst->server->behaviors,
- (src->max_key_code + 1) * sizeof(XkbBehavior));
+ tmp = reallocarray(dst->server->behaviors,
+ src->max_key_code + 1, sizeof(XkbBehavior));
if (!tmp)
return FALSE;
dst->server->behaviors = tmp;
@@ -1244,8 +1245,8 @@ _XkbCopyServerMap(XkbDescPtr src, XkbDescPtr dst)
if (src->server->vmodmap) {
if (src->max_key_code != dst->max_key_code) {
- tmp = realloc(dst->server->vmodmap,
- (src->max_key_code + 1) * sizeof(unsigned short));
+ tmp = reallocarray(dst->server->vmodmap,
+ src->max_key_code + 1, sizeof(unsigned short));
if (!tmp)
return FALSE;
dst->server->vmodmap = tmp;
@@ -1281,8 +1282,8 @@ _XkbCopyNames(XkbDescPtr src, XkbDescPtr dst)
if (src->names->keys) {
if (src->max_key_code != dst->max_key_code) {
- tmp = realloc(dst->names->keys,
- (src->max_key_code + 1) * sizeof(XkbKeyNameRec));
+ tmp = reallocarray(dst->names->keys, src->max_key_code + 1,
+ sizeof(XkbKeyNameRec));
if (!tmp)
return FALSE;
dst->names->keys = tmp;
@@ -1297,9 +1298,9 @@ _XkbCopyNames(XkbDescPtr src, XkbDescPtr dst)
if (src->names->num_key_aliases) {
if (src->names->num_key_aliases != dst->names->num_key_aliases) {
- tmp = realloc(dst->names->key_aliases,
- src->names->num_key_aliases *
- sizeof(XkbKeyAliasRec));
+ tmp = reallocarray(dst->names->key_aliases,
+ src->names->num_key_aliases,
+ sizeof(XkbKeyAliasRec));
if (!tmp)
return FALSE;
dst->names->key_aliases = tmp;
@@ -1315,8 +1316,8 @@ _XkbCopyNames(XkbDescPtr src, XkbDescPtr dst)
if (src->names->num_rg) {
if (src->names->num_rg != dst->names->num_rg) {
- tmp = realloc(dst->names->radio_groups,
- src->names->num_rg * sizeof(Atom));
+ tmp = reallocarray(dst->names->radio_groups,
+ src->names->num_rg, sizeof(Atom));
if (!tmp)
return FALSE;
dst->names->radio_groups = tmp;
@@ -1366,8 +1367,9 @@ _XkbCopyCompat(XkbDescPtr src, XkbDescPtr dst)
if (src->compat->sym_interpret && src->compat->num_si) {
if (src->compat->num_si != dst->compat->size_si) {
- tmp = realloc(dst->compat->sym_interpret,
- src->compat->num_si * sizeof(XkbSymInterpretRec));
+ tmp = reallocarray(dst->compat->sym_interpret,
+ src->compat->num_si,
+ sizeof(XkbSymInterpretRec));
if (!tmp)
return FALSE;
dst->compat->sym_interpret = tmp;
@@ -1582,8 +1584,8 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst)
j < sshape->num_outlines;
j++, soutline++, doutline++) {
if (soutline->num_points) {
- tmp = malloc(soutline->num_points *
- sizeof(XkbPointRec));
+ tmp = xallocarray(soutline->num_points,
+ sizeof(XkbPointRec));
if (!tmp)
return FALSE;
doutline->points = tmp;
@@ -1710,7 +1712,7 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst)
for (j = 0, srow = ssection->rows, drow = dsection->rows;
j < ssection->num_rows; j++, srow++, drow++) {
if (srow->num_keys) {
- tmp = malloc(srow->num_keys * sizeof(XkbKeyRec));
+ tmp = xallocarray(srow->num_keys, sizeof(XkbKeyRec));
if (!tmp)
return FALSE;
drow->keys = tmp;
diff --git a/xserver/xkb/xkmread.c b/xserver/xkb/xkmread.c
index 0b9f0ef6d..1666e3216 100644
--- a/xserver/xkb/xkmread.c
+++ b/xserver/xkb/xkmread.c
@@ -64,7 +64,7 @@ XkmInsureSize(void *oldPtr, int oldCount, int *newCountRtrn, int elemSize)
oldPtr = calloc(newCount, elemSize);
}
else if (oldCount < newCount) {
- oldPtr = realloc(oldPtr, newCount * elemSize);
+ oldPtr = reallocarray(oldPtr, newCount, elemSize);
if (oldPtr != NULL) {
char *tmp = (char *) oldPtr;